andoncloud-prometheus-widget 1.3.2 → 1.3.3

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.js CHANGED
@@ -1,2 +1,2 @@
1
- var React=require("react"),andoncloudDashboardToolkit=require("andoncloud-dashboard-toolkit"),andoncloudWidgetBase=require("andoncloud-widget-base"),reactI18next=require("react-i18next"),iconsMaterial=require("@mui/icons-material"),material=require("@mui/material");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("react-is");var React__default=/*#__PURE__*/_interopDefaultLegacy(React);function _extends$1(){return _extends$1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_extends$1.apply(null,arguments)}function _objectWithoutPropertiesLoose$1(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}var Period$1="Period",Query$1="Query",Name$1="Name",en={"Previous shift":"Previous shift","Current shift":"Current shift","Endpoint URL":"Endpoint URL",Period:Period$1,Query:Query$1,Name:Name$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"},Period="Okres",Query="Zapytanie",Name="Nazwa",pl={"Previous shift":"Poprzednia zmiana","Current shift":"Obecna zmiana","Endpoint URL":"Adres URL",Period:Period,Query:Query,Name:Name,"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"},resources={en:{translation:en},pl:{translation:pl}},LIBRARY_VERSION="1.3.2",freeGlobal$1="object"==typeof global&&global&&global.Object===Object&&global,freeGlobal$2=freeGlobal$1,freeSelf$1="object"==typeof self&&self&&self.Object===Object&&self,root$1=freeGlobal$2||freeSelf$1||Function("return this")(),root$2=root$1,Symbol$2=root$2.Symbol,Symbol$3=Symbol$2,objectProto$d=Object.prototype,hasOwnProperty$a=objectProto$d.hasOwnProperty,nativeObjectToString$1=objectProto$d.toString,symToStringTag$1=Symbol$3?Symbol$3.toStringTag:void 0;function getRawTag(e){var t=hasOwnProperty$a.call(e,symToStringTag$1),r=e[symToStringTag$1];try{e[symToStringTag$1]=void 0;var n=!0}catch(e){}var a=nativeObjectToString$1.call(e);return n&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),a}var objectProto$c=Object.prototype,nativeObjectToString=objectProto$c.toString;function objectToString$1(e){return nativeObjectToString.call(e)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=Symbol$3?Symbol$3.toStringTag:void 0;function baseGetTag(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString$1(e)}function overArg(e,t){return function(r){return e(t(r))}}var getPrototype=overArg(Object.getPrototypeOf,Object),getPrototype$1=getPrototype;function isObjectLike$1(e){return null!=e&&"object"==typeof e}function listCacheClear(){this.__data__=[],this.size=0}function eq(e,t){return e===t||e!=e&&t!=t}function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}var arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(e){var t=this.__data__,r=assocIndexOf(t,e);return!(r<0||(r==t.length-1?t.pop():splice.call(t,r,1),--this.size,0))}function listCacheGet(e){var t=this.__data__,r=assocIndexOf(t,e);return r<0?void 0:t[r][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function ListCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function stackClear(){this.__data__=new ListCache,this.size=0}function stackDelete(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function stackGet(e){return this.__data__.get(e)}function stackHas(e){return this.__data__.has(e)}function isObject$3(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet;var asyncTag="[object AsyncFunction]",funcTag$3="[object Function]",genTag$2="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction$2(e){if(!isObject$3(e))return!1;var t=baseGetTag(e);return t==funcTag$3||t==genTag$2||t==asyncTag||t==proxyTag}var coreJsData=root$2["__core-js_shared__"],coreJsData$1=coreJsData,maskSrcKey=(uid=/[^.]+$/.exec(coreJsData$1&&coreJsData$1.keys&&coreJsData$1.keys.IE_PROTO||""),uid?"Symbol(src)_1."+uid:""),uid;function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}var funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource(e){if(null!=e){try{return funcToString$1.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto=Function.prototype,objectProto$b=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$9=objectProto$b.hasOwnProperty,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$9).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(e){return!(!isObject$3(e)||isMasked(e))&&(isFunction$2(e)?reIsNative:reIsHostCtor).test(toSource(e))}function getValue(e,t){return null==e?void 0:e[t]}function getNative(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}var Map$1=getNative(root$2,"Map"),Map$2=Map$1,nativeCreate=getNative(Object,"create"),nativeCreate$1=nativeCreate;function hashClear(){this.__data__=nativeCreate$1?nativeCreate$1(null):{},this.size=0}function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var HASH_UNDEFINED$1="__lodash_hash_undefined__",objectProto$a=Object.prototype,hasOwnProperty$8=objectProto$a.hasOwnProperty;function hashGet(e){var t=this.__data__;if(nativeCreate$1){var r=t[e];return r===HASH_UNDEFINED$1?void 0:r}return hasOwnProperty$8.call(t,e)?t[e]:void 0}var objectProto$9=Object.prototype,hasOwnProperty$7=objectProto$9.hasOwnProperty;function hashHas(e){var t=this.__data__;return nativeCreate$1?void 0!==t[e]:hasOwnProperty$7.call(t,e)}var HASH_UNDEFINED="__lodash_hash_undefined__";function hashSet(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=nativeCreate$1&&void 0===t?HASH_UNDEFINED:t,this}function Hash(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$2||ListCache),string:new Hash}}function isKeyable(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function getMapData(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=t?1:0,t}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){var r=getMapData(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function MapCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var LARGE_ARRAY_SIZE=200;function stackSet(e,t){var r=this.__data__;if(r instanceof ListCache){var n=r.__data__;if(!Map$2||n.length<LARGE_ARRAY_SIZE-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new MapCache(n)}return r.set(e,t),this.size=r.size,this}function Stack(e){var t=this.__data__=new ListCache(e);this.size=t.size}function arrayEach(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var defineProperty=function(){try{var e=getNative(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),defineProperty$1=defineProperty;function baseAssignValue(e,t,r){"__proto__"==t&&defineProperty$1?defineProperty$1(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var objectProto$8=Object.prototype,hasOwnProperty$6=objectProto$8.hasOwnProperty;function assignValue(e,t,r){var n=e[t];hasOwnProperty$6.call(e,t)&&eq(n,r)&&(void 0!==r||t in e)||baseAssignValue(e,t,r)}function copyObject(e,t,r,n){var a=!r;r||(r={});for(var i=-1,o=t.length;++i<o;){var s=t[i],l=n?n(r[s],e[s],s,r,e):void 0;void 0===l&&(l=e[s]),a?baseAssignValue(r,s,l):assignValue(r,s,l)}return r}function baseTimes(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var argsTag$3="[object Arguments]";function baseIsArguments(e){return isObjectLike$1(e)&&baseGetTag(e)==argsTag$3}var objectProto$7=Object.prototype,hasOwnProperty$5=objectProto$7.hasOwnProperty,propertyIsEnumerable$2=objectProto$7.propertyIsEnumerable,isArguments$1=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike$1(e)&&hasOwnProperty$5.call(e,"callee")&&!propertyIsEnumerable$2.call(e,"callee")},isArguments$2=isArguments$1,isArray$2=Array.isArray,isArray$3=isArray$2;function stubFalse(){return!1}var freeExports$2="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule$2=freeExports$2&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports$2=freeModule$2&&freeModule$2.exports===freeExports$2,Buffer$1=moduleExports$2?root$2.Buffer:void 0,nativeIsBuffer=Buffer$1?Buffer$1.isBuffer:void 0,isBuffer=nativeIsBuffer||stubFalse,isBuffer$1=isBuffer,MAX_SAFE_INTEGER$2=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex(e,t){var r=typeof e;return!!(t=null==t?MAX_SAFE_INTEGER$2:t)&&("number"==r||"symbol"!=r&&reIsUint.test(e))&&e>-1&&e%1==0&&e<t}var MAX_SAFE_INTEGER$1=9007199254740991;function isLength$1(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=MAX_SAFE_INTEGER$1}var argsTag$2="[object Arguments]",arrayTag$1="[object Array]",boolTag$2="[object Boolean]",dateTag$2="[object Date]",errorTag$1="[object Error]",funcTag$2="[object Function]",mapTag$4="[object Map]",numberTag$2="[object Number]",objectTag$2="[object Object]",regexpTag$2="[object RegExp]",setTag$4="[object Set]",stringTag$2="[object String]",weakMapTag$2="[object WeakMap]",arrayBufferTag$2="[object ArrayBuffer]",dataViewTag$3="[object DataView]",float32Tag$2="[object Float32Array]",float64Tag$2="[object Float64Array]",int8Tag$2="[object Int8Array]",int16Tag$2="[object Int16Array]",int32Tag$2="[object Int32Array]",uint8Tag$2="[object Uint8Array]",uint8ClampedTag$2="[object Uint8ClampedArray]",uint16Tag$2="[object Uint16Array]",uint32Tag$2="[object Uint32Array]",typedArrayTags={};function baseIsTypedArray(e){return isObjectLike$1(e)&&isLength$1(e.length)&&!!typedArrayTags[baseGetTag(e)]}function baseUnary(e){return function(t){return e(t)}}typedArrayTags[float32Tag$2]=typedArrayTags[float64Tag$2]=typedArrayTags[int8Tag$2]=typedArrayTags[int16Tag$2]=typedArrayTags[int32Tag$2]=typedArrayTags[uint8Tag$2]=typedArrayTags[uint8ClampedTag$2]=typedArrayTags[uint16Tag$2]=typedArrayTags[uint32Tag$2]=!0,typedArrayTags[argsTag$2]=typedArrayTags[arrayTag$1]=typedArrayTags[arrayBufferTag$2]=typedArrayTags[boolTag$2]=typedArrayTags[dataViewTag$3]=typedArrayTags[dateTag$2]=typedArrayTags[errorTag$1]=typedArrayTags[funcTag$2]=typedArrayTags[mapTag$4]=typedArrayTags[numberTag$2]=typedArrayTags[objectTag$2]=typedArrayTags[regexpTag$2]=typedArrayTags[setTag$4]=typedArrayTags[stringTag$2]=typedArrayTags[weakMapTag$2]=!1;var freeExports$1="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule$1=freeExports$1&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports$1=freeModule$1&&freeModule$1.exports===freeExports$1,freeProcess=moduleExports$1&&freeGlobal$2.process,nodeUtil=function(){try{return freeModule$1&&freeModule$1.require&&freeModule$1.require("util").types||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e){}}(),nodeUtil$1=nodeUtil,nodeIsTypedArray=nodeUtil$1&&nodeUtil$1.isTypedArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray,isTypedArray$1=isTypedArray,objectProto$6=Object.prototype,hasOwnProperty$4=objectProto$6.hasOwnProperty;function arrayLikeKeys(e,t){var r=isArray$3(e),n=!r&&isArguments$2(e),a=!r&&!n&&isBuffer$1(e),i=!r&&!n&&!a&&isTypedArray$1(e),o=r||n||a||i,s=o?baseTimes(e.length,String):[],l=s.length;for(var u in e)!t&&!hasOwnProperty$4.call(e,u)||o&&("length"==u||a&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||isIndex(u,l))||s.push(u);return s}var objectProto$5=Object.prototype;function isPrototype(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||objectProto$5)}var nativeKeys=overArg(Object.keys,Object),nativeKeys$1=nativeKeys,objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty;function baseKeys(e){if(!isPrototype(e))return nativeKeys$1(e);var t=[];for(var r in Object(e))hasOwnProperty$3.call(e,r)&&"constructor"!=r&&t.push(r);return t}function isArrayLike$1(e){return null!=e&&isLength$1(e.length)&&!isFunction$2(e)}function keys(e){return isArrayLike$1(e)?arrayLikeKeys(e):baseKeys(e)}function baseAssign(e,t){return e&&copyObject(t,keys(t),e)}function nativeKeysIn(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}var objectProto$3=Object.prototype,hasOwnProperty$2=objectProto$3.hasOwnProperty;function baseKeysIn(e){if(!isObject$3(e))return nativeKeysIn(e);var t=isPrototype(e),r=[];for(var n in e)("constructor"!=n||!t&&hasOwnProperty$2.call(e,n))&&r.push(n);return r}function keysIn(e){return isArrayLike$1(e)?arrayLikeKeys(e,!0):baseKeysIn(e)}function baseAssignIn(e,t){return e&&copyObject(t,keysIn(t),e)}var freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,Buffer=moduleExports?root$2.Buffer:void 0,allocUnsafe=Buffer?Buffer.allocUnsafe:void 0;function cloneBuffer(e,t){if(t)return e.slice();var r=e.length,n=allocUnsafe?allocUnsafe(r):new e.constructor(r);return e.copy(n),n}function copyArray(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function arrayFilter(e,t){for(var r=-1,n=null==e?0:e.length,a=0,i=[];++r<n;){var o=e[r];t(o,r,e)&&(i[a++]=o)}return i}function stubArray(){return[]}var objectProto$2=Object.prototype,propertyIsEnumerable$1=objectProto$2.propertyIsEnumerable,nativeGetSymbols$1=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols$1?function(e){return null==e?[]:(e=Object(e),arrayFilter(nativeGetSymbols$1(e),function(t){return propertyIsEnumerable$1.call(e,t)}))}:stubArray,getSymbols$1=getSymbols;function copySymbols(e,t){return copyObject(e,getSymbols$1(e),t)}function arrayPush$1(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}var nativeGetSymbols=Object.getOwnPropertySymbols,getSymbolsIn=nativeGetSymbols?function(e){for(var t=[];e;)arrayPush$1(t,getSymbols$1(e)),e=getPrototype$1(e);return t}:stubArray,getSymbolsIn$1=getSymbolsIn;function copySymbolsIn(e,t){return copyObject(e,getSymbolsIn$1(e),t)}function baseGetAllKeys(e,t,r){var n=t(e);return isArray$3(e)?n:arrayPush$1(n,r(e))}function getAllKeys(e){return baseGetAllKeys(e,keys,getSymbols$1)}function getAllKeysIn(e){return baseGetAllKeys(e,keysIn,getSymbolsIn$1)}var DataView=getNative(root$2,"DataView"),DataView$1=DataView,Promise$1=getNative(root$2,"Promise"),Promise$2=Promise$1,Set$1=getNative(root$2,"Set"),Set$2=Set$1,WeakMap=getNative(root$2,"WeakMap"),WeakMap$1=WeakMap,mapTag$3="[object Map]",objectTag$1="[object Object]",promiseTag="[object Promise]",setTag$3="[object Set]",weakMapTag$1="[object WeakMap]",dataViewTag$2="[object DataView]",dataViewCtorString=toSource(DataView$1),mapCtorString=toSource(Map$2),promiseCtorString=toSource(Promise$2),setCtorString=toSource(Set$2),weakMapCtorString=toSource(WeakMap$1),getTag=baseGetTag;(DataView$1&&getTag(new DataView$1(new ArrayBuffer(1)))!=dataViewTag$2||Map$2&&getTag(new Map$2)!=mapTag$3||Promise$2&&getTag(Promise$2.resolve())!=promiseTag||Set$2&&getTag(new Set$2)!=setTag$3||WeakMap$1&&getTag(new WeakMap$1)!=weakMapTag$1)&&(getTag=function(e){var t=baseGetTag(e),r=t==objectTag$1?e.constructor:void 0,n=r?toSource(r):"";if(n)switch(n){case dataViewCtorString:return dataViewTag$2;case mapCtorString:return mapTag$3;case promiseCtorString:return promiseTag;case setCtorString:return setTag$3;case weakMapCtorString:return weakMapTag$1}return t});var getTag$1=getTag,objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function initCloneArray(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&hasOwnProperty$1.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var Uint8Array=root$2.Uint8Array,Uint8Array$1=Uint8Array;function cloneArrayBuffer(e){var t=new e.constructor(e.byteLength);return new Uint8Array$1(t).set(new Uint8Array$1(e)),t}function cloneDataView(e,t){var r=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var reFlags=/\w*$/;function cloneRegExp(e){var t=new e.constructor(e.source,reFlags.exec(e));return t.lastIndex=e.lastIndex,t}var symbolProto$1=Symbol$3?Symbol$3.prototype:void 0,symbolValueOf=symbolProto$1?symbolProto$1.valueOf:void 0;function cloneSymbol(e){return symbolValueOf?Object(symbolValueOf.call(e)):{}}function cloneTypedArray(e,t){var r=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var boolTag$1="[object Boolean]",dateTag$1="[object Date]",mapTag$2="[object Map]",numberTag$1="[object Number]",regexpTag$1="[object RegExp]",setTag$2="[object Set]",stringTag$1="[object String]",symbolTag$3="[object Symbol]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$1="[object DataView]",float32Tag$1="[object Float32Array]",float64Tag$1="[object Float64Array]",int8Tag$1="[object Int8Array]",int16Tag$1="[object Int16Array]",int32Tag$1="[object Int32Array]",uint8Tag$1="[object Uint8Array]",uint8ClampedTag$1="[object Uint8ClampedArray]",uint16Tag$1="[object Uint16Array]",uint32Tag$1="[object Uint32Array]";function initCloneByTag(e,t,r){var n=e.constructor;switch(t){case arrayBufferTag$1:return cloneArrayBuffer(e);case boolTag$1:case dateTag$1:return new n(+e);case dataViewTag$1:return cloneDataView(e,r);case float32Tag$1:case float64Tag$1:case int8Tag$1:case int16Tag$1:case int32Tag$1:case uint8Tag$1:case uint8ClampedTag$1:case uint16Tag$1:case uint32Tag$1:return cloneTypedArray(e,r);case mapTag$2:return new n;case numberTag$1:case stringTag$1:return new n(e);case regexpTag$1:return cloneRegExp(e);case setTag$2:return new n;case symbolTag$3:return cloneSymbol(e)}}var objectCreate=Object.create,baseCreate=function(){function e(){}return function(t){if(!isObject$3(t))return{};if(objectCreate)return objectCreate(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),baseCreate$1=baseCreate;function initCloneObject(e){return"function"!=typeof e.constructor||isPrototype(e)?{}:baseCreate$1(getPrototype$1(e))}var mapTag$1="[object Map]";function baseIsMap(e){return isObjectLike$1(e)&&getTag$1(e)==mapTag$1}var nodeIsMap=nodeUtil$1&&nodeUtil$1.isMap,isMap=nodeIsMap?baseUnary(nodeIsMap):baseIsMap,isMap$1=isMap,setTag$1="[object Set]";function baseIsSet(e){return isObjectLike$1(e)&&getTag$1(e)==setTag$1}var nodeIsSet=nodeUtil$1&&nodeUtil$1.isSet,isSet=nodeIsSet?baseUnary(nodeIsSet):baseIsSet,isSet$1=isSet,CLONE_DEEP_FLAG$1=1,CLONE_FLAT_FLAG=2,CLONE_SYMBOLS_FLAG$2=4,argsTag$1="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag$1="[object Function]",genTag$1="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag$2="[object Symbol]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",cloneableTags={};function baseClone(e,t,r,n,a,i){var o,s=t&CLONE_DEEP_FLAG$1,l=t&CLONE_FLAT_FLAG,u=t&CLONE_SYMBOLS_FLAG$2;if(r&&(o=a?r(e,n,a,i):r(e)),void 0!==o)return o;if(!isObject$3(e))return e;var c=isArray$3(e);if(c){if(o=initCloneArray(e),!s)return copyArray(e,o)}else{var d=getTag$1(e),h=d==funcTag$1||d==genTag$1;if(isBuffer$1(e))return cloneBuffer(e,s);if(d==objectTag||d==argsTag$1||h&&!a){if(o=l||h?{}:initCloneObject(e),!s)return l?copySymbolsIn(e,baseAssignIn(o,e)):copySymbols(e,baseAssign(o,e))}else{if(!cloneableTags[d])return a?e:{};o=initCloneByTag(e,d,s)}}i||(i=new Stack);var f=i.get(e);if(f)return f;i.set(e,o),isSet$1(e)?e.forEach(function(n){o.add(baseClone(n,t,r,n,e,i))}):isMap$1(e)&&e.forEach(function(n,a){o.set(a,baseClone(n,t,r,a,e,i))});var p=c?void 0:(u?l?getAllKeysIn:getAllKeys:l?keysIn:keys)(e);return arrayEach(p||e,function(n,a){p&&(n=e[a=n]),assignValue(o,a,baseClone(n,t,r,a,e,i))}),o}cloneableTags[argsTag$1]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[dataViewTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[setTag]=cloneableTags[stringTag]=cloneableTags[symbolTag$2]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=!0,cloneableTags[errorTag]=cloneableTags[funcTag$1]=cloneableTags[weakMapTag]=!1;var CLONE_DEEP_FLAG=1,CLONE_SYMBOLS_FLAG$1=4;function cloneDeep(e){return baseClone(e,CLONE_DEEP_FLAG|CLONE_SYMBOLS_FLAG$1)}var isArray$1=Array.isArray,keyList=Object.keys,hasProp=Object.prototype.hasOwnProperty,hasElementType="undefined"!=typeof Element;function equal(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var r,n,a,i=isArray$1(e),o=isArray$1(t);if(i&&o){if((n=e.length)!=t.length)return!1;for(r=n;0!==r--;)if(!equal(e[r],t[r]))return!1;return!0}if(i!=o)return!1;var s=e instanceof Date,l=t instanceof Date;if(s!=l)return!1;if(s&&l)return e.getTime()==t.getTime();var u=e instanceof RegExp,c=t instanceof RegExp;if(u!=c)return!1;if(u&&c)return e.toString()==t.toString();var d=keyList(e);if((n=d.length)!==keyList(t).length)return!1;for(r=n;0!==r--;)if(!hasProp.call(t,d[r]))return!1;if(hasElementType&&e instanceof Element&&t instanceof Element)return e===t;for(r=n;0!==r--;)if(!("_owner"===(a=d[r])&&e.$$typeof||equal(e[a],t[a])))return!1;return!0}return e!=e&&t!=t}var reactFastCompare=function(e,t){try{return equal(e,t)}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: react-fast-compare does not handle circular references.",e.name,e.message),!1;throw e}},isProduction="production"==='{NODE_ENV:"production"}'.NODE_ENV;function warning(e,t){if(!isProduction){if(e)return;var r="Warning: "+t;"undefined"!=typeof console&&console.warn(r);try{throw Error(r)}catch(e){}}}var CLONE_SYMBOLS_FLAG=4;function clone$1(e){return baseClone(e,CLONE_SYMBOLS_FLAG)}function arrayMap$1(e,t){for(var r=-1,n=null==e?0:e.length,a=Array(n);++r<n;)a[r]=t(e[r],r,e);return a}var symbolTag$1="[object Symbol]";function isSymbol$1(e){return"symbol"==typeof e||isObjectLike$1(e)&&baseGetTag(e)==symbolTag$1}var FUNC_ERROR_TEXT="Expected a function";function memoize(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=e.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(memoize.Cache||MapCache),r}memoize.Cache=MapCache;var MAX_MEMOIZE_SIZE=500;function memoizeCapped(e){var t=memoize(e,function(e){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),e}),r=t.cache;return t}var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=memoizeCapped(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,function(e,r,n,a){t.push(n?a.replace(reEscapeChar,"$1"):r||e)}),t}),stringToPath$1=stringToPath,INFINITY$2=1/0;function toKey$1(e){if("string"==typeof e||isSymbol$1(e))return e;var t=e+"";return"0"==t&&1/e==-INFINITY$2?"-0":t}var INFINITY$1=1/0,symbolProto=Symbol$3?Symbol$3.prototype:void 0,symbolToString$1=symbolProto?symbolProto.toString:void 0;function baseToString(e){if("string"==typeof e)return e;if(isArray$3(e))return arrayMap$1(e,baseToString)+"";if(isSymbol$1(e))return symbolToString$1?symbolToString$1.call(e):"";var t=e+"";return"0"==t&&1/e==-INFINITY$1?"-0":t}function toString$1(e){return null==e?"":baseToString(e)}function toPath(e){return isArray$3(e)?arrayMap$1(e,toKey$1):isSymbol$1(e)?[e]:copyArray(stringToPath$1(toString$1(e)))}function _extends(){return _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_extends.apply(this,arguments)}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)t.indexOf(r=i[n])>=0||(a[r]=e[r]);return a}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var FormikContext=/*#__PURE__*/React.createContext(void 0);function useFormikContext(){var e=React.useContext(FormikContext);return e||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?warning(!1,"Formik context is undefined, please verify you are calling useFormikContext() as child of a <Formik> component."):warning(!1)),e}FormikContext.displayName="FormikContext";var isEmptyArray=function(e){return Array.isArray(e)&&0===e.length},isFunction$1=function(e){return"function"==typeof e},isObject$2=function(e){return null!==e&&"object"==typeof e},isInteger=function(e){return String(Math.floor(Number(e)))===e},isEmptyChildren=function(e){return 0===React.Children.count(e)};function getIn$1(e,t,r,n){void 0===n&&(n=0);for(var a=toPath(t);e&&n<a.length;)e=e[a[n++]];return n===a.length||e?void 0===e?r:e:r}function setIn(e,t,r){for(var n=clone$1(e),a=n,i=0,o=toPath(t);i<o.length-1;i++){var s=o[i],l=getIn$1(e,o.slice(0,i+1));if(l&&(isObject$2(l)||Array.isArray(l)))a=a[s]=clone$1(l);else{var u=o[i+1];a=a[s]=isInteger(u)&&Number(u)>=0?[]:{}}}return(0===i?e:a)[o[i]]===r?e:(void 0===r?delete a[o[i]]:a[o[i]]=r,0===i&&void 0===r&&delete n[o[i]],n)}var Form=/*#__PURE__*/React.forwardRef(function(e,t){var r=e.action,n=_objectWithoutPropertiesLoose(e,["action"]),a=null!=r?r:"#",i=useFormikContext();return React.createElement("form",_extends({onSubmit:i.handleSubmit,ref:t,onReset:i.handleReset,action:a},n))});Form.displayName="Form";var move=function(e,t,r){var n=copyArrayLike(e),a=n[t];return n.splice(t,1),n.splice(r,0,a),n},swap=function(e,t,r){var n=copyArrayLike(e),a=n[t];return n[t]=n[r],n[r]=a,n},insert=function(e,t,r){var n=copyArrayLike(e);return n.splice(t,0,r),n},replace=function(e,t,r){var n=copyArrayLike(e);return n[t]=r,n},copyArrayLike=function(e){if(e){if(Array.isArray(e))return[].concat(e);var t=Object.keys(e).map(function(e){return parseInt(e)}).reduce(function(e,t){return t>e?t:e},0);return Array.from(_extends({},e,{length:t+1}))}return[]},createAlterationHandler=function(e,t){var r="function"==typeof e?e:t;return function(e){if(Array.isArray(e)||isObject$2(e)){var t=copyArrayLike(e);return r(t)}return e}},FieldArrayInner=/*#__PURE__*/function(e){function t(t){var r;return(r=e.call(this,t)||this).updateArrayField=function(e,t,n){var a=r.props,i=a.name;(0,a.formik.setFormikState)(function(r){var a=createAlterationHandler(n,e),o=createAlterationHandler(t,e),s=setIn(r.values,i,e(getIn$1(r.values,i))),l=n?a(getIn$1(r.errors,i)):void 0,u=t?o(getIn$1(r.touched,i)):void 0;return isEmptyArray(l)&&(l=void 0),isEmptyArray(u)&&(u=void 0),_extends({},r,{values:s,errors:n?setIn(r.errors,i,l):r.errors,touched:t?setIn(r.touched,i,u):r.touched})})},r.push=function(e){return r.updateArrayField(function(t){return[].concat(copyArrayLike(t),[cloneDeep(e)])},!1,!1)},r.handlePush=function(e){return function(){return r.push(e)}},r.swap=function(e,t){return r.updateArrayField(function(r){return swap(r,e,t)},!0,!0)},r.handleSwap=function(e,t){return function(){return r.swap(e,t)}},r.move=function(e,t){return r.updateArrayField(function(r){return move(r,e,t)},!0,!0)},r.handleMove=function(e,t){return function(){return r.move(e,t)}},r.insert=function(e,t){return r.updateArrayField(function(r){return insert(r,e,t)},function(t){return insert(t,e,null)},function(t){return insert(t,e,null)})},r.handleInsert=function(e,t){return function(){return r.insert(e,t)}},r.replace=function(e,t){return r.updateArrayField(function(r){return replace(r,e,t)},!1,!1)},r.handleReplace=function(e,t){return function(){return r.replace(e,t)}},r.unshift=function(e){var t=-1;return r.updateArrayField(function(r){var n=r?[e].concat(r):[e];return t=n.length,n},function(e){return e?[null].concat(e):[null]},function(e){return e?[null].concat(e):[null]}),t},r.handleUnshift=function(e){return function(){return r.unshift(e)}},r.handleRemove=function(e){return function(){return r.remove(e)}},r.handlePop=function(){return function(){return r.pop()}},r.remove=r.remove.bind(_assertThisInitialized(r)),r.pop=r.pop.bind(_assertThisInitialized(r)),r}_inheritsLoose(t,e);var r=t.prototype;return r.componentDidUpdate=function(e){this.props.validateOnChange&&this.props.formik.validateOnChange&&!reactFastCompare(getIn$1(e.formik.values,e.name),getIn$1(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},r.remove=function(e){var t;return this.updateArrayField(function(r){var n=r?copyArrayLike(r):[];return t||(t=n[e]),isFunction$1(n.splice)&&n.splice(e,1),isFunction$1(n.every)&&n.every(function(e){return void 0===e})?[]:n},!0,!0),t},r.pop=function(){var e;return this.updateArrayField(function(t){var r=t.slice();return e||(e=r&&r.pop&&r.pop()),r},!0,!0),e},r.render=function(){var e=this.props,t=e.component,r=e.render,n=e.children,a=e.name,i=_extends({},{push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},{form:_objectWithoutPropertiesLoose(e.formik,["validate","validationSchema"]),name:a});return t?React.createElement(t,i):r?r(i):n?"function"==typeof n?n(i):isEmptyChildren(n)?null:React.Children.only(n):null},t}(React.Component),QueriesPeriod;FieldArrayInner.defaultProps={validateOnChange:!0},function(e){e.CURRENT_SHIFT="CURRENT_SHIFT",e.PREVIOUS_SHIFT="PREVIOUS_SHIFT"}(QueriesPeriod||(QueriesPeriod={}));var SettingsFormContent=function(e){var t=e.formProps,r=reactI18next.useTranslation().t,n={query:"",displayName:""},a={mt:2},i=function(e,r){var a=[].concat(t.values.prometheusQueries||[n]);a[e]=_extends$1({},a[e],r),t.setFieldValue("prometheusQueries",a)};return React__default.default.createElement(material.Box,{mb:2},React__default.default.createElement(material.FormControl,{sx:a,fullWidth:!0},React__default.default.createElement(material.TextField,{name:"endpointUrl",label:r("Endpoint URL"),value:t.values.endpointUrl,onChange:t.handleChange,onBlur:t.handleBlur,error:t.touched.endpointUrl&&Boolean(t.errors.endpointUrl),helperText:t.touched.endpointUrl&&t.errors.endpointUrl,fullWidth:!0})),React__default.default.createElement(material.FormControl,{sx:a,fullWidth:!0},React__default.default.createElement(material.InputLabel,{id:"queries-period-label"},r("Period")),React__default.default.createElement(material.Select,{variant:"outlined",name:"queriesPeriod",labelId:"queries-period-label",value:t.values.queriesPeriod||QueriesPeriod.CURRENT_SHIFT,onChange:t.handleChange,onBlur:t.handleBlur,error:t.touched.queriesPeriod&&Boolean(t.errors.queriesPeriod),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"))})),React__default.default.createElement(material.FormHelperText,{error:!0},t.touched.queriesPeriod&&t.errors.queriesPeriod)),(t.values.prometheusQueries||[n]).map(function(e,o){var s,l,u,c,d=e.query,h=e.displayName;return React__default.default.createElement(material.FormControl,{key:o,sx:a,fullWidth:!0},React__default.default.createElement(material.Stack,{direction:"row",width:"100%",gap:1},React__default.default.createElement(material.TextField,{label:r("Query"),value:d,onChange:function(e){return i(o,{query:e.target.value})},onBlur:t.handleBlur,error:(null==(s=t.touched.prometheusQueries)||null==(s=s[o])?void 0:s.query)&&Boolean(getIn$1(t.errors,"prometheusQueries.["+o+"].query")),helperText:(null==(l=t.touched.prometheusQueries)||null==(l=l[o])?void 0:l.query)&&getIn$1(t.errors,"prometheusQueries.["+o+"].query"),fullWidth:!0}),React__default.default.createElement(material.TextField,{label:r("Name"),value:h,onChange:function(e){return i(o,{query:d,displayName:e.target.value})},onBlur:t.handleBlur,error:(null==(u=t.touched.prometheusQueries)||null==(u=u[o])?void 0:u.displayName)&&Boolean(getIn$1(t.errors,"prometheusQueries.["+o+"].displayName")),helperText:(null==(c=t.touched.prometheusQueries)||null==(c=c[o])?void 0:c.displayName)&&getIn$1(t.errors,"prometheusQueries.["+o+"].displayName"),fullWidth:!0}),React__default.default.createElement(material.IconButton,{color:"error",onClick:function(){return function(e){var r=[].concat(t.values.prometheusQueries||[n]);r.splice(e,1),t.setFieldValue("prometheusQueries",r)}(o)}},React__default.default.createElement(iconsMaterial.Clear,null))))}),React__default.default.createElement(material.Button,{color:"secondary",onClick:function(){var e=[].concat(t.values.prometheusQueries||[n]);t.setFieldValue("prometheusQueries",[].concat(e,[n]))},sx:{mt:function(e){return e.spacing(2)}},fullWidth:!0},React__default.default.createElement(reactI18next.Trans,{t:r},"Add another query")),(t.values.displayedQueryParams||[""]).map(function(e,n){var i,o;return React__default.default.createElement(material.FormControl,{key:n,sx:a,fullWidth:!0},React__default.default.createElement(material.Stack,{direction:"row",width:"100%"},React__default.default.createElement(material.TextField,{label:r("Displayed query parameter"),value:e,onChange:function(e){return function(e,r){var n=[].concat(t.values.displayedQueryParams||[""]);n[e]=r,t.setFieldValue("displayedQueryParams",n)}(n,e.target.value)},error:(null==(i=t.touched.displayedQueryParams)?void 0:i[n])&&Boolean(getIn$1(t.errors,"displayedQueryParams.["+n+"]")),helperText:(null==(o=t.touched.displayedQueryParams)?void 0:o[n])&&getIn$1(t.errors,"displayedQueryParams.["+n+"]"),fullWidth:!0}),React__default.default.createElement(material.IconButton,{color:"error",onClick:function(){return function(e){var r=[].concat(t.values.displayedQueryParams||[""]);r.splice(e,1),t.setFieldValue("displayedQueryParams",r)}(n)}},React__default.default.createElement(iconsMaterial.Clear,null))))}),React__default.default.createElement(material.Button,{color:"secondary",onClick:function(){var e=[].concat(t.values.displayedQueryParams||[""]);t.setFieldValue("displayedQueryParams",[].concat(e,[""]))},sx:{mt:function(e){return e.spacing(2)}},fullWidth:!0},React__default.default.createElement(reactI18next.Trans,{t:r},"Add another displayed query parameter")),React__default.default.createElement(material.FormControl,{sx:a,fullWidth:!0},React__default.default.createElement(material.TextField,{name:"xAxisUnit",label:r("X axis unit"),value:t.values.xAxisUnit||"",onChange:t.handleChange,onBlur:t.handleBlur,error:t.touched.xAxisUnit&&Boolean(t.errors.xAxisUnit),helperText:t.touched.xAxisUnit&&t.errors.xAxisUnit,fullWidth:!0})),React__default.default.createElement(material.FormControl,{sx:a,fullWidth:!0},React__default.default.createElement(material.TextField,{name:"yAxisUnit",label:r("Y axis unit"),value:t.values.yAxisUnit||"",onChange:t.handleChange,onBlur:t.handleBlur,error:t.touched.yAxisUnit&&Boolean(t.errors.yAxisUnit),helperText:t.touched.yAxisUnit&&t.errors.yAxisUnit,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,r;function n(){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 r,n=[],a=e.length;for(r=0;r<a;++r)n.push(t(e[r],r));return n}function h(e,t){for(var r in t)o(t,r)&&(e[r]=t[r]);return o(t,"toString")&&(e.toString=t.toString),o(t,"valueOf")&&(e.valueOf=t.valueOf),e}function f(e,t,r,n){return $t(e,t,r,n,!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){var t=null,n=!1,a=e._d&&!isNaN(e._d.getTime());return a&&(t=p(e),n=r.call(t.parsedDateParts,function(e){return null!=e}),a=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict&&(a=a&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour)),null!=Object.isFrozen&&Object.isFrozen(e)?a:(e._isValid=a,e._isValid)}function m(e){var t=f(NaN);return null!=e?h(p(t),e):p(t).userInvalidated=!0,t}r=Array.prototype.some?Array.prototype.some:function(e){var t,r=Object(this),n=r.length>>>0;for(t=0;t<n;t++)if(t in r&&e.call(this,r[t],t,r))return!0;return!1};var y=n.momentProperties=[],v=!1;function b(e,t){var r,n,a,i=y.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(r=0;r<i;r++)l(a=t[n=y[r]])||(e[n]=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===v&&(v=!0,n.updateOffset(this),v=!1)}function _(e){return e instanceof x||null!=e&&null!=e._isAMomentObject}function w(e){!1===n.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function k(e,t){var r=!0;return h(function(){if(null!=n.deprecationHandler&&n.deprecationHandler(null,e),r){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),r=!1}return t.apply(this,arguments)},t)}var S,T={};function M(e,t){null!=n.deprecationHandler&&n.deprecationHandler(e,t),T[e]||(w(t),T[e]=!0)}function O(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function A(e,t){var r,n=h({},e);for(r in t)o(t,r)&&(i(e[r])&&i(t[r])?(n[r]={},h(n[r],e[r]),h(n[r],t[r])):null!=t[r]?n[r]=t[r]:delete n[r]);for(r in e)o(e,r)&&!o(t,r)&&i(e[r])&&(n[r]=h({},n[r]));return n}function C(e){null!=e&&this.set(e)}function P(e,t,r){var n=""+Math.abs(e);return(e>=0?r?"+":"":"-")+Math.pow(10,Math.max(0,t-n.length)).toString().substr(1)+n}n.suppressDeprecationWarnings=!1,n.deprecationHandler=null,S=Object.keys?Object.keys:function(e){var t,r=[];for(t in e)o(e,t)&&r.push(t);return r};var D=/(\[[^\[]*\])|(\\)?([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,E=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,$={},F={};function I(e,t,r,n){var a=n;"string"==typeof n&&(a=function(){return this[n]()}),e&&(F[e]=a),t&&(F[t[0]]=function(){return P(a.apply(this,arguments),t[1],t[2])}),r&&(F[r]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function R(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function N(e,t){return e.isValid()?(t=j(t,e.localeData()),$[t]=$[t]||function(e){var t,r,n=e.match(D);for(t=0,r=n.length;t<r;t++)n[t]=F[n[t]]?F[n[t]]:R(n[t]);return function(t){var a,i="";for(a=0;a<r;a++)i+=O(n[a])?n[a].call(t,e):n[a];return i}}(t),$[t](e)):e.localeData().invalidDate()}function j(e,t){var r=5;function n(e){return t.longDateFormat(e)||e}for(E.lastIndex=0;r>=0&&E.test(e);)e=e.replace(E,n),E.lastIndex=0,r-=1;return e}var L={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function V(e){return"string"==typeof e?L[e]||L[e.toLowerCase()]:void 0}function z(e){var t,r,n={};for(r in e)o(e,r)&&(t=V(r))&&(n[t]=e[r]);return n}var W,B={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1},Y=/\d/,U=/\d\d/,H=/\d{3}/,q=/\d{4}/,G=/[+-]?\d{6}/,Q=/\d\d?/,Z=/\d\d\d\d?/,J=/\d\d\d\d\d\d?/,K=/\d{1,3}/,X=/\d{1,4}/,ee=/[+-]?\d{1,6}/,te=/\d+/,re=/[+-]?\d+/,ne=/Z|[+-]\d\d:?\d\d/gi,ae=/Z|[+-]\d\d(?::?\d\d)?/gi,ie=/[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,oe=/^[1-9]\d?/,se=/^([1-9]\d|\d)/;function le(e,t,r){W[e]=O(t)?t:function(e,n){return e&&r?r:t}}function ue(e,t){return o(W,e)?W[e](t._strict,t._locale):new RegExp(ce(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,r,n,a){return t||r||n||a})))}function ce(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function de(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function he(e){var t=+e,r=0;return 0!==t&&isFinite(t)&&(r=de(t)),r}W={};var fe={};function pe(e,t){var r,n,a=t;for("string"==typeof e&&(e=[e]),u(t)&&(a=function(e,r){r[t]=he(e)}),n=e.length,r=0;r<n;r++)fe[e[r]]=a}function ge(e,t){pe(e,function(e,r,n,a){n._w=n._w||{},t(e,n._w,n,a)})}function me(e,t,r){null!=t&&o(fe,e)&&fe[e](t,r._a,r,e)}function ye(e){return e%4==0&&e%100!=0||e%400==0}var ve=0,be=1,xe=2,_e=3,we=4,ke=5,Se=6,Te=7,Me=8;function Oe(e){return ye(e)?366:365}I("Y",0,0,function(){var e=this.year();return e<=9999?P(e,4):"+"+e}),I(0,["YY",2],0,function(){return this.year()%100}),I(0,["YYYY",4],0,"year"),I(0,["YYYYY",5],0,"year"),I(0,["YYYYYY",6,!0],0,"year"),le("Y",re),le("YY",Q,U),le("YYYY",X,q),le("YYYYY",ee,G),le("YYYYYY",ee,G),pe(["YYYYY","YYYYYY"],ve),pe("YYYY",function(e,t){t[ve]=2===e.length?n.parseTwoDigitYear(e):he(e)}),pe("YY",function(e,t){t[ve]=n.parseTwoDigitYear(e)}),pe("Y",function(e,t){t[ve]=parseInt(e,10)}),n.parseTwoDigitYear=function(e){return he(e)+(he(e)>68?1900:2e3)};var Ae,Ce=Pe("FullYear",!0);function Pe(e,t){return function(r){return null!=r?(Ee(this,e,r),n.updateOffset(this,t),this):De(this,e)}}function De(e,t){if(!e.isValid())return NaN;var r=e._d,n=e._isUTC;switch(t){case"Milliseconds":return n?r.getUTCMilliseconds():r.getMilliseconds();case"Seconds":return n?r.getUTCSeconds():r.getSeconds();case"Minutes":return n?r.getUTCMinutes():r.getMinutes();case"Hours":return n?r.getUTCHours():r.getHours();case"Date":return n?r.getUTCDate():r.getDate();case"Day":return n?r.getUTCDay():r.getDay();case"Month":return n?r.getUTCMonth():r.getMonth();case"FullYear":return n?r.getUTCFullYear():r.getFullYear();default:return NaN}}function Ee(e,t,r){var n,a,i,o,s;if(e.isValid()&&!isNaN(r)){switch(n=e._d,a=e._isUTC,t){case"Milliseconds":return void(a?n.setUTCMilliseconds(r):n.setMilliseconds(r));case"Seconds":return void(a?n.setUTCSeconds(r):n.setSeconds(r));case"Minutes":return void(a?n.setUTCMinutes(r):n.setMinutes(r));case"Hours":return void(a?n.setUTCHours(r):n.setHours(r));case"Date":return void(a?n.setUTCDate(r):n.setDate(r));case"FullYear":break;default:return}i=r,o=e.month(),s=29!==(s=e.date())||1!==o||ye(i)?s:28,a?n.setUTCFullYear(i,o,s):n.setFullYear(i,o,s)}}function $e(e,t){if(isNaN(e)||isNaN(t))return NaN;var r=(t%12+12)%12;return e+=(t-r)/12,1===r?ye(e)?29:28:31-r%7%2}Ae=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},I("M",["MM",2],"Mo",function(){return this.month()+1}),I("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),I("MMMM",0,0,function(e){return this.localeData().months(this,e)}),le("M",Q,oe),le("MM",Q,U),le("MMM",function(e,t){return t.monthsShortRegex(e)}),le("MMMM",function(e,t){return t.monthsRegex(e)}),pe(["M","MM"],function(e,t){t[be]=he(e)-1}),pe(["MMM","MMMM"],function(e,t,r,n){var a=r._locale.monthsParse(e,n,r._strict);null!=a?t[be]=a:p(r).invalidMonth=e});var Fe="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Ie="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Re=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Ne=ie,je=ie;function Le(e,t,r){var n,a,i,o=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)i=f([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(i,"").toLocaleLowerCase();return r?"MMM"===t?-1!==(a=Ae.call(this._shortMonthsParse,o))?a:null:-1!==(a=Ae.call(this._longMonthsParse,o))?a:null:"MMM"===t?-1!==(a=Ae.call(this._shortMonthsParse,o))||-1!==(a=Ae.call(this._longMonthsParse,o))?a:null:-1!==(a=Ae.call(this._longMonthsParse,o))||-1!==(a=Ae.call(this._shortMonthsParse,o))?a:null}function Ve(e,t){if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=he(t);else if(!u(t=e.localeData().monthsParse(t)))return e;var r=t,n=e.date();return n=n<29?n:Math.min(n,$e(e.year(),r)),e._isUTC?e._d.setUTCMonth(r,n):e._d.setMonth(r,n),e}function ze(e){return null!=e?(Ve(this,e),n.updateOffset(this,!0),this):De(this,"Month")}function We(){function e(e,t){return t.length-e.length}var t,r,n,a,i=[],o=[],s=[];for(t=0;t<12;t++)r=f([2e3,t]),n=ce(this.monthsShort(r,"")),a=ce(this.months(r,"")),i.push(n),o.push(a),s.push(a),s.push(n);i.sort(e),o.sort(e),s.sort(e),this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")","i")}function Be(e,t,r,n,a,i,o){var s;return e<100&&e>=0?(s=new Date(e+400,t,r,n,a,i,o),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,r,n,a,i,o),s}function Ye(e){var t,r;return e<100&&e>=0?((r=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,r)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Ue(e,t,r){var n=7+t-r;return-(7+Ye(e,0,n).getUTCDay()-t)%7+n-1}function He(e,t,r,n,a){var i,o,s=1+7*(t-1)+(7+r-n)%7+Ue(e,n,a);return s<=0?o=Oe(i=e-1)+s:s>Oe(e)?(i=e+1,o=s-Oe(e)):(i=e,o=s),{year:i,dayOfYear:o}}function qe(e,t,r){var n,a,i=Ue(e.year(),t,r),o=Math.floor((e.dayOfYear()-i-1)/7)+1;return o<1?n=o+Ge(a=e.year()-1,t,r):o>Ge(e.year(),t,r)?(n=o-Ge(e.year(),t,r),a=e.year()+1):(a=e.year(),n=o),{week:n,year:a}}function Ge(e,t,r){var n=Ue(e,t,r),a=Ue(e+1,t,r);return(Oe(e)-n+a)/7}function Qe(e,t){return e.slice(t,7).concat(e.slice(0,t))}I("w",["ww",2],"wo","week"),I("W",["WW",2],"Wo","isoWeek"),le("w",Q,oe),le("ww",Q,U),le("W",Q,oe),le("WW",Q,U),ge(["w","ww","W","WW"],function(e,t,r,n){t[n.substr(0,1)]=he(e)}),I("d",0,"do","day"),I("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),I("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),I("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),I("e",0,0,"weekday"),I("E",0,0,"isoWeekday"),le("d",Q),le("e",Q),le("E",Q),le("dd",function(e,t){return t.weekdaysMinRegex(e)}),le("ddd",function(e,t){return t.weekdaysShortRegex(e)}),le("dddd",function(e,t){return t.weekdaysRegex(e)}),ge(["dd","ddd","dddd"],function(e,t,r,n){var a=r._locale.weekdaysParse(e,n,r._strict);null!=a?t.d=a:p(r).invalidWeekday=e}),ge(["d","e","E"],function(e,t,r,n){t[n]=he(e)});var Ze="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("_"),Xe=ie,et=ie,tt=ie;function rt(e,t,r){var n,a,i,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)i=f([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(i,"").toLocaleLowerCase();return r?"dddd"===t?-1!==(a=Ae.call(this._weekdaysParse,o))?a:null:"ddd"===t?-1!==(a=Ae.call(this._shortWeekdaysParse,o))?a:null:-1!==(a=Ae.call(this._minWeekdaysParse,o))?a:null:"dddd"===t?-1!==(a=Ae.call(this._weekdaysParse,o))||-1!==(a=Ae.call(this._shortWeekdaysParse,o))||-1!==(a=Ae.call(this._minWeekdaysParse,o))?a:null:"ddd"===t?-1!==(a=Ae.call(this._shortWeekdaysParse,o))||-1!==(a=Ae.call(this._weekdaysParse,o))||-1!==(a=Ae.call(this._minWeekdaysParse,o))?a:null:-1!==(a=Ae.call(this._minWeekdaysParse,o))||-1!==(a=Ae.call(this._weekdaysParse,o))||-1!==(a=Ae.call(this._shortWeekdaysParse,o))?a:null}function nt(){function e(e,t){return t.length-e.length}var t,r,n,a,i,o=[],s=[],l=[],u=[];for(t=0;t<7;t++)r=f([2e3,1]).day(t),n=ce(this.weekdaysMin(r,"")),a=ce(this.weekdaysShort(r,"")),i=ce(this.weekdays(r,"")),o.push(n),s.push(a),l.push(i),u.push(n),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 at(){return this.hours()%12||12}function it(e,t){I(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function ot(e,t){return t._meridiemParse}I("H",["HH",2],0,"hour"),I("h",["hh",2],0,at),I("k",["kk",2],0,function(){return this.hours()||24}),I("hmm",0,0,function(){return""+at.apply(this)+P(this.minutes(),2)}),I("hmmss",0,0,function(){return""+at.apply(this)+P(this.minutes(),2)+P(this.seconds(),2)}),I("Hmm",0,0,function(){return""+this.hours()+P(this.minutes(),2)}),I("Hmmss",0,0,function(){return""+this.hours()+P(this.minutes(),2)+P(this.seconds(),2)}),it("a",!0),it("A",!1),le("a",ot),le("A",ot),le("H",Q,se),le("h",Q,oe),le("k",Q,oe),le("HH",Q,U),le("hh",Q,U),le("kk",Q,U),le("hmm",Z),le("hmmss",J),le("Hmm",Z),le("Hmmss",J),pe(["H","HH"],_e),pe(["k","kk"],function(e,t,r){var n=he(e);t[_e]=24===n?0:n}),pe(["a","A"],function(e,t,r){r._isPm=r._locale.isPM(e),r._meridiem=e}),pe(["h","hh"],function(e,t,r){t[_e]=he(e),p(r).bigHour=!0}),pe("hmm",function(e,t,r){var n=e.length-2;t[_e]=he(e.substr(0,n)),t[we]=he(e.substr(n)),p(r).bigHour=!0}),pe("hmmss",function(e,t,r){var n=e.length-4,a=e.length-2;t[_e]=he(e.substr(0,n)),t[we]=he(e.substr(n,2)),t[ke]=he(e.substr(a)),p(r).bigHour=!0}),pe("Hmm",function(e,t,r){var n=e.length-2;t[_e]=he(e.substr(0,n)),t[we]=he(e.substr(n))}),pe("Hmmss",function(e,t,r){var n=e.length-4,a=e.length-2;t[_e]=he(e.substr(0,n)),t[we]=he(e.substr(n,2)),t[ke]=he(e.substr(a))});var st,lt=Pe("Hours",!0),ut={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:Fe,monthsShort:Ie,week:{dow:0,doy:6},weekdays:Ze,weekdaysMin:Ke,weekdaysShort:Je,meridiemParse:/[ap]\.?m?\.?/i},ct={},dt={};function ht(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r<n;r+=1)if(e[r]!==t[r])return r;return n}function ft(e){return e?e.toLowerCase().replace("_","-"):e}function pt(t){var r=null;if(void 0===ct[t]&&e&&e.exports&&function(e){return!(!e||!e.match("^[^/\\\\]*$"))}(t))try{r=st._abbr,commonjsRequire("./locale/"+t),gt(r)}catch(e){ct[t]=null}return ct[t]}function gt(e,t){var r;return e&&((r=l(t)?yt(e):mt(e,t))?st=r:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),st._abbr}function mt(e,t){if(null!==t){var r,n=ut;if(t.abbr=e,null!=ct[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."),n=ct[e]._config;else if(null!=t.parentLocale)if(null!=ct[t.parentLocale])n=ct[t.parentLocale]._config;else{if(null==(r=pt(t.parentLocale)))return dt[t.parentLocale]||(dt[t.parentLocale]=[]),dt[t.parentLocale].push({name:e,config:t}),null;n=r._config}return ct[e]=new C(A(n,t)),dt[e]&&dt[e].forEach(function(e){mt(e.name,e.config)}),gt(e),ct[e]}return delete ct[e],null}function yt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return st;if(!a(e)){if(t=pt(e))return t;e=[e]}return function(e){for(var t,r,n,a,i=0;i<e.length;){for(t=(a=ft(e[i]).split("-")).length,r=(r=ft(e[i+1]))?r.split("-"):null;t>0;){if(n=pt(a.slice(0,t).join("-")))return n;if(r&&r.length>=t&&ht(a,r)>=t-1)break;t--}i++}return st}(e)}function vt(e){var t,r=e._a;return r&&-2===p(e).overflow&&(t=r[be]<0||r[be]>11?be:r[xe]<1||r[xe]>$e(r[ve],r[be])?xe:r[_e]<0||r[_e]>24||24===r[_e]&&(0!==r[we]||0!==r[ke]||0!==r[Se])?_e:r[we]<0||r[we]>59?we:r[ke]<0||r[ke]>59?ke:r[Se]<0||r[Se]>999?Se:-1,p(e)._overflowDayOfYear&&(t<ve||t>xe)&&(t=xe),p(e)._overflowWeeks&&-1===t&&(t=Te),p(e)._overflowWeekday&&-1===t&&(t=Me),p(e).overflow=t),e}var 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=/^\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)?)?$/,_t=/Z|[+-]\d\d(?::?\d\d)?/,wt=[["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]],kt=[["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/]],St=/^\/?Date\((-?\d+)/i,Tt=/^(?:(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,r,n,a,i,o,s=e._i,l=bt.exec(s)||xt.exec(s),u=wt.length,c=kt.length;if(l){for(p(e).iso=!0,t=0,r=u;t<r;t++)if(wt[t][1].exec(l[1])){a=wt[t][0],n=!1!==wt[t][2];break}if(null==a)return void(e._isValid=!1);if(l[3]){for(t=0,r=c;t<r;t++)if(kt[t][1].exec(l[3])){i=(l[2]||" ")+kt[t][0];break}if(null==i)return void(e._isValid=!1)}if(!n&&null!=i)return void(e._isValid=!1);if(l[4]){if(!_t.exec(l[4]))return void(e._isValid=!1);o="Z"}e._f=a+(i||"")+(o||""),Dt(e)}else e._isValid=!1}function At(e){var t,r,n,a,i,o,s,l,u,c=Tt.exec(e._i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(c){if(r=c[3],n=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),Ie.indexOf(r),parseInt(n,10),parseInt(a,10),parseInt(i,10)],o&&s.push(parseInt(o,10)),!function(e,t,r){return!e||Je.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(p(r).weekdayMismatch=!0,r._isValid=!1,!1)}(c[1],t=s,e))return;e._a=t,e._tzm=function(e,t,r){if(e)return Mt[e];if(t)return 0;var n=parseInt(r,10),a=n%100;return(n-a)/100*60+a}(c[8],c[9],c[10]),e._d=Ye.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),p(e).rfc2822=!0}else e._isValid=!1}function Ct(e,t,r){return null!=e?e:null!=t?t:r}function Pt(e){var t,r,a,i,o,s=[];if(!e._d){for(a=function(e){var t=new Date(n.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[xe]&&null==e._a[be]&&function(e){var t,r,n,a,i,o,s,l,u;null!=(t=e._w).GG||null!=t.W||null!=t.E?(i=1,o=4,r=Ct(t.GG,e._a[ve],qe(Ft(),1,4).year),n=Ct(t.W,1),((a=Ct(t.E,1))<1||a>7)&&(l=!0)):(i=e._locale._week.dow,o=e._locale._week.doy,u=qe(Ft(),i,o),r=Ct(t.gg,e._a[ve],u.year),n=Ct(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),n<1||n>Ge(r,i,o)?p(e)._overflowWeeks=!0:null!=l?p(e)._overflowWeekday=!0:(s=He(r,n,a,i,o),e._a[ve]=s.year,e._dayOfYear=s.dayOfYear)}(e),null!=e._dayOfYear&&(o=Ct(e._a[ve],a[ve]),(e._dayOfYear>Oe(o)||0===e._dayOfYear)&&(p(e)._overflowDayOfYear=!0),r=Ye(o,0,e._dayOfYear),e._a[be]=r.getUTCMonth(),e._a[xe]=r.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[_e]&&0===e._a[we]&&0===e._a[ke]&&0===e._a[Se]&&(e._nextDay=!0,e._a[_e]=0),e._d=(e._useUTC?Ye:Be).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[_e]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(p(e).weekdayMismatch=!0)}}function Dt(e){if(e._f!==n.ISO_8601)if(e._f!==n.RFC_2822){e._a=[],p(e).empty=!0;var t,r,a,i,o,s,l,u=""+e._i,c=u.length,d=0;for(l=(a=j(e._f,e._locale).match(D)||[]).length,t=0;t<l;t++)(r=(u.match(ue(i=a[t],e))||[])[0])&&((o=u.substr(0,u.indexOf(r))).length>0&&p(e).unusedInput.push(o),u=u.slice(u.indexOf(r)+r.length),d+=r.length),F[i]?(r?p(e).empty=!1:p(e).unusedTokens.push(i),me(i,r,e)):e._strict&&!r&&p(e).unusedTokens.push(i);p(e).charsLeftOver=c-d,u.length>0&&p(e).unusedInput.push(u),e._a[_e]<=12&&!0===p(e).bigHour&&e._a[_e]>0&&(p(e).bigHour=void 0),p(e).parsedDateParts=e._a.slice(0),p(e).meridiem=e._meridiem,e._a[_e]=function(e,t,r){var n;return null==r?t:null!=e.meridiemHour?e.meridiemHour(t,r):null!=e.isPM?((n=e.isPM(r))&&t<12&&(t+=12),n||12!==t||(t=0),t):t}(e._locale,e._a[_e],e._meridiem),null!==(s=p(e).era)&&(e._a[ve]=e._locale.erasConvertYear(s,e._a[ve])),Pt(e),vt(e)}else At(e);else Ot(e)}function Et(e){var t=e._i,r=e._f;return e._locale=e._locale||yt(e._l),null===t||void 0===r&&""===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(r)?function(e){var t,r,n,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],Dt(t),g(t)&&(o=!0),i+=p(t).charsLeftOver,i+=10*p(t).unusedTokens.length,p(t).score=i,s?i<n&&(n=i,r=t):(null==n||i<n||o)&&(n=i,r=t,o&&(s=!0));h(e,r||t)}(e):r?Dt(e):function(e){var t=e._i;l(t)?e._d=new Date(n.now()):c(t)?e._d=new Date(t.valueOf()):"string"==typeof t?function(e){var t=St.exec(e._i);null===t?(Ot(e),!1===e._isValid&&(delete e._isValid,At(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:n.createFromInputFallback(e)))):e._d=new Date(+t[1])}(e):a(t)?(e._a=d(t.slice(0),function(e){return parseInt(e,10)}),Pt(e)):i(t)?function(e){if(!e._d){var t=z(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)}),Pt(e)}}(e):u(t)?e._d=new Date(t):n.createFromInputFallback(e)}(e),g(e)||(e._d=null),e))}function $t(e,t,r,n,o){var l,u={};return!0!==t&&!1!==t||(n=t,t=void 0),!0!==r&&!1!==r||(n=r,r=void 0),(i(e)&&s(e)||a(e)&&0===e.length)&&(e=void 0),u._isAMomentObject=!0,u._useUTC=u._isUTC=o,u._l=r,u._i=e,u._f=t,u._strict=n,(l=new x(vt(Et(u))))._nextDay&&(l.add(1,"d"),l._nextDay=void 0),l}function Ft(e,t,r,n){return $t(e,t,r,n,!1)}n.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":""))}),n.ISO_8601=function(){},n.RFC_2822=function(){};var It=k("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ft.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:m()}),Rt=k("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ft.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:m()});function Nt(e,t){var r,n;if(1===t.length&&a(t[0])&&(t=t[0]),!t.length)return Ft();for(r=t[0],n=1;n<t.length;++n)t[n].isValid()&&!t[n][e](r)||(r=t[n]);return r}var jt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Lt(e){var t=z(e),r=t.year||0,n=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,r,n=!1,a=jt.length;for(t in e)if(o(e,t)&&(-1===Ae.call(jt,t)||null!=e[t]&&isNaN(e[t])))return!1;for(r=0;r<a;++r)if(e[jt[r]]){if(n)return!1;parseFloat(e[jt[r]])!==he(e[jt[r]])&&(n=!0)}return!0}(t),this._milliseconds=+d+1e3*c+6e4*u+1e3*l*60*60,this._days=+s+7*i,this._months=+a+3*n+12*r,this._data={},this._locale=yt(),this._bubble()}function Vt(e){return e instanceof Lt}function zt(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Wt(e,t){I(e,0,0,function(){var e=this.utcOffset(),r="+";return e<0&&(e=-e,r="-"),r+P(~~(e/60),2)+t+P(~~e%60,2)})}Wt("Z",":"),Wt("ZZ",""),le("Z",ae),le("ZZ",ae),pe(["Z","ZZ"],function(e,t,r){r._useUTC=!0,r._tzm=Yt(ae,e)});var Bt=/([\+\-]|\d\d)/gi;function Yt(e,t){var r,n,a=(t||"").match(e);return null===a?null:0===(n=60*(r=((a[a.length-1]||[])+"").match(Bt)||["-",0,0])[1]+he(r[2]))?0:"+"===r[0]?n:-n}function Ut(e,t){var r,a;return t._isUTC?(r=t.clone(),a=(_(e)||c(e)?e.valueOf():Ft(e).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+a),n.updateOffset(r,!1),r):Ft(e).local()}function Ht(e){return-Math.round(e._d.getTimezoneOffset())}function qt(){return!!this.isValid()&&this._isUTC&&0===this._offset}n.updateOffset=function(){};var Gt=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Qt=/^(-|\+)?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 r,n,a,i,s,l,c=e,d=null;return Vt(e)?c={ms:e._milliseconds,d:e._days,M:e._months}:u(e)||!isNaN(+e)?(c={},t?c[t]=+e:c.milliseconds=+e):(d=Gt.exec(e))?(r="-"===d[1]?-1:1,c={y:0,d:he(d[xe])*r,h:he(d[_e])*r,m:he(d[we])*r,s:he(d[ke])*r,ms:he(zt(1e3*d[Se]))*r}):(d=Qt.exec(e))?c={y:Jt(d[2],r="-"===d[1]?-1:1),M:Jt(d[3],r),w:Jt(d[4],r),d:Jt(d[5],r),h:Jt(d[6],r),m:Jt(d[7],r),s:Jt(d[8],r)}:null==c?c={}:"object"==typeof c&&("from"in c||"to"in c)&&(i=Ft(c.from),s=Ft(c.to),a=i.isValid()&&s.isValid()?(s=Ut(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),n=new Lt(c),Vt(e)&&o(e,"_locale")&&(n._locale=e._locale),Vt(e)&&o(e,"_isValid")&&(n._isValid=e._isValid),n}function Jt(e,t){var r=e&&parseFloat(e.replace(",","."));return(isNaN(r)?0:r)*t}function Kt(e,t){var r={};return r.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(r.months,"M").isAfter(t)&&--r.months,r.milliseconds=+t-+e.clone().add(r.months,"M"),r}function Xt(e,t){return function(r,n){var a;return null===n||isNaN(+n)||(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=r,r=n,n=a),er(this,Zt(r,n),e),this}}function er(e,t,r,a){var i=t._milliseconds,o=zt(t._days),s=zt(t._months);e.isValid()&&(a=null==a||a,s&&Ve(e,De(e,"Month")+s*r),o&&Ee(e,"Date",De(e,"Date")+o*r),i&&e._d.setTime(e._d.valueOf()+i*r),a&&n.updateOffset(e,o||s))}Zt.fn=Lt.prototype,Zt.invalid=function(){return Zt(NaN)};var tr=Xt(1,"add"),rr=Xt(-1,"subtract");function nr(e){return"string"==typeof e||e instanceof String}function ar(e,t){if(e.date()<t.date())return-ar(t,e);var r=12*(t.year()-e.year())+(t.month()-e.month()),n=e.clone().add(r,"months");return-(r+(t-n<0?(t-n)/(n-e.clone().add(r-1,"months")):(t-n)/(e.clone().add(r+1,"months")-n)))||0}function ir(e){var t;return void 0===e?this._locale._abbr:(null!=(t=yt(e))&&(this._locale=t),this)}n.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",n.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var or=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 sr(){return this._locale}var lr=1e3,ur=6e4,cr=36e5,dr=126227808e5;function hr(e,t){return(e%t+t)%t}function fr(e,t,r){return e<100&&e>=0?new Date(e+400,t,r)-dr:new Date(e,t,r).valueOf()}function pr(e,t,r){return e<100&&e>=0?Date.UTC(e+400,t,r)-dr:Date.UTC(e,t,r)}function gr(e,t){return t.erasAbbrRegex(e)}function mr(){var e,t,r,n,a,i=[],o=[],s=[],l=[],u=this.eras();for(e=0,t=u.length;e<t;++e)r=ce(u[e].name),n=ce(u[e].abbr),a=ce(u[e].narrow),o.push(r),i.push(n),s.push(a),l.push(r),l.push(n),l.push(a);this._erasRegex=new RegExp("^("+l.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+o.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+i.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+s.join("|")+")","i")}function yr(e,t){I(0,[e,e.length],0,t)}function vr(e,t,r,n,a){var i;return null==e?qe(this,n,a).year:(t>(i=Ge(e,n,a))&&(t=i),br.call(this,e,t,r,n,a))}function br(e,t,r,n,a){var i=He(e,t,r,n,a),o=Ye(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}I("N",0,0,"eraAbbr"),I("NN",0,0,"eraAbbr"),I("NNN",0,0,"eraAbbr"),I("NNNN",0,0,"eraName"),I("NNNNN",0,0,"eraNarrow"),I("y",["y",1],"yo","eraYear"),I("y",["yy",2],0,"eraYear"),I("y",["yyy",3],0,"eraYear"),I("y",["yyyy",4],0,"eraYear"),le("N",gr),le("NN",gr),le("NNN",gr),le("NNNN",function(e,t){return t.erasNameRegex(e)}),le("NNNNN",function(e,t){return t.erasNarrowRegex(e)}),pe(["N","NN","NNN","NNNN","NNNNN"],function(e,t,r,n){var a=r._locale.erasParse(e,n,r._strict);a?p(r).era=a:p(r).invalidEra=e}),le("y",te),le("yy",te),le("yyy",te),le("yyyy",te),le("yo",function(e,t){return t._eraYearOrdinalRegex||te}),pe(["y","yy","yyy","yyyy"],ve),pe(["yo"],function(e,t,r,n){var a;r._locale._eraYearOrdinalRegex&&(a=e.match(r._locale._eraYearOrdinalRegex)),t[ve]=r._locale.eraYearOrdinalParse?r._locale.eraYearOrdinalParse(e,a):parseInt(e,10)}),I(0,["gg",2],0,function(){return this.weekYear()%100}),I(0,["GG",2],0,function(){return this.isoWeekYear()%100}),yr("gggg","weekYear"),yr("ggggg","weekYear"),yr("GGGG","isoWeekYear"),yr("GGGGG","isoWeekYear"),le("G",re),le("g",re),le("GG",Q,U),le("gg",Q,U),le("GGGG",X,q),le("gggg",X,q),le("GGGGG",ee,G),le("ggggg",ee,G),ge(["gggg","ggggg","GGGG","GGGGG"],function(e,t,r,n){t[n.substr(0,2)]=he(e)}),ge(["gg","GG"],function(e,t,r,a){t[a]=n.parseTwoDigitYear(e)}),I("Q",0,"Qo","quarter"),le("Q",Y),pe("Q",function(e,t){t[be]=3*(he(e)-1)}),I("D",["DD",2],"Do","date"),le("D",Q,oe),le("DD",Q,U),le("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),pe(["D","DD"],xe),pe("Do",function(e,t){t[xe]=he(e.match(Q)[0])});var xr=Pe("Date",!0);I("DDD",["DDDD",3],"DDDo","dayOfYear"),le("DDD",K),le("DDDD",H),pe(["DDD","DDDD"],function(e,t,r){r._dayOfYear=he(e)}),I("m",["mm",2],0,"minute"),le("m",Q,se),le("mm",Q,U),pe(["m","mm"],we);var _r=Pe("Minutes",!1);I("s",["ss",2],0,"second"),le("s",Q,se),le("ss",Q,U),pe(["s","ss"],ke);var wr,kr,Sr=Pe("Seconds",!1);for(I("S",0,0,function(){return~~(this.millisecond()/100)}),I(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),I(0,["SSS",3],0,"millisecond"),I(0,["SSSS",4],0,function(){return 10*this.millisecond()}),I(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),I(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),I(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),I(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),I(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),le("S",K,Y),le("SS",K,U),le("SSS",K,H),wr="SSSS";wr.length<=9;wr+="S")le(wr,te);function Tr(e,t){t[Se]=he(1e3*("0."+e))}for(wr="S";wr.length<=9;wr+="S")pe(wr,Tr);kr=Pe("Milliseconds",!1),I("z",0,0,"zoneAbbr"),I("zz",0,0,"zoneName");var Mr=x.prototype;function Or(e){return e}Mr.add=tr,Mr.calendar=function(e,t){var r;1===arguments.length&&(arguments[0]?_(r=arguments[0])||c(r)||nr(r)||u(r)||function(e){var t=a(e),r=!1;return t&&(r=0===e.filter(function(t){return!u(t)&&nr(e)}).length),t&&r}(r)||function(e){var t,r=i(e)&&!s(e),n=!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)n=n||o(e,a[t]);return r&&n}(r)||null==r?(e=arguments[0],t=void 0):function(e){var t,r=i(e)&&!s(e),n=!1,a=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<a.length;t+=1)n=n||o(e,a[t]);return r&&n}(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var l=e||Ft(),d=Ut(l,this).startOf("day"),h=n.calendarFormat(this,d)||"sameElse",f=t&&(O(t[h])?t[h].call(this,l):t[h]);return this.format(f||this.localeData().calendar(h,this,Ft(l)))},Mr.clone=function(){return new x(this)},Mr.diff=function(e,t,r){var n,a,i;if(!this.isValid())return NaN;if(!(n=Ut(e,this)).isValid())return NaN;switch(a=6e4*(n.utcOffset()-this.utcOffset()),t=V(t)){case"year":i=ar(this,n)/12;break;case"month":i=ar(this,n);break;case"quarter":i=ar(this,n)/3;break;case"second":i=(this-n)/1e3;break;case"minute":i=(this-n)/6e4;break;case"hour":i=(this-n)/36e5;break;case"day":i=(this-n-a)/864e5;break;case"week":i=(this-n-a)/6048e5;break;default:i=this-n}return r?i:de(i)},Mr.endOf=function(e){var t,r;if(void 0===(e=V(e))||"millisecond"===e||!this.isValid())return this;switch(r=this._isUTC?pr:fr,e){case"year":t=r(this.year()+1,0,1)-1;break;case"quarter":t=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=r(this.year(),this.month()+1,1)-1;break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=cr-hr(t+(this._isUTC?0:this.utcOffset()*ur),cr)-1;break;case"minute":t=this._d.valueOf(),t+=ur-hr(t,ur)-1;break;case"second":t=this._d.valueOf(),t+=lr-hr(t,lr)-1}return this._d.setTime(t),n.updateOffset(this,!0),this},Mr.format=function(e){e||(e=this.isUtc()?n.defaultFormatUtc:n.defaultFormat);var t=N(this,e);return this.localeData().postformat(t)},Mr.from=function(e,t){return this.isValid()&&(_(e)&&e.isValid()||Ft(e).isValid())?Zt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Mr.fromNow=function(e){return this.from(Ft(),e)},Mr.to=function(e,t){return this.isValid()&&(_(e)&&e.isValid()||Ft(e).isValid())?Zt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Mr.toNow=function(e){return this.to(Ft(),e)},Mr.get=function(e){return O(this[e=V(e)])?this[e]():this},Mr.invalidAt=function(){return p(this).overflow},Mr.isAfter=function(e,t){var r=_(e)?e:Ft(e);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=V(t)||"millisecond")?this.valueOf()>r.valueOf():r.valueOf()<this.clone().startOf(t).valueOf())},Mr.isBefore=function(e,t){var r=_(e)?e:Ft(e);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=V(t)||"millisecond")?this.valueOf()<r.valueOf():this.clone().endOf(t).valueOf()<r.valueOf())},Mr.isBetween=function(e,t,r,n){var a=_(e)?e:Ft(e),i=_(t)?t:Ft(t);return!!(this.isValid()&&a.isValid()&&i.isValid())&&("("===(n=n||"()")[0]?this.isAfter(a,r):!this.isBefore(a,r))&&(")"===n[1]?this.isBefore(i,r):!this.isAfter(i,r))},Mr.isSame=function(e,t){var r,n=_(e)?e:Ft(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=V(t)||"millisecond")?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(t).valueOf()<=r&&r<=this.clone().endOf(t).valueOf()))},Mr.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},Mr.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},Mr.isValid=function(){return g(this)},Mr.lang=or,Mr.locale=ir,Mr.localeData=sr,Mr.max=Rt,Mr.min=It,Mr.parsingFlags=function(){return h({},p(this))},Mr.set=function(e,t){if("object"==typeof e){var r,n=function(e){var t,r=[];for(t in e)o(e,t)&&r.push({unit:t,priority:B[t]});return r.sort(function(e,t){return e.priority-t.priority}),r}(e=z(e)),a=n.length;for(r=0;r<a;r++)this[n[r].unit](e[n[r].unit])}else if(O(this[e=V(e)]))return this[e](t);return this},Mr.startOf=function(e){var t,r;if(void 0===(e=V(e))||"millisecond"===e||!this.isValid())return this;switch(r=this._isUTC?pr:fr,e){case"year":t=r(this.year(),0,1);break;case"quarter":t=r(this.year(),this.month()-this.month()%3,1);break;case"month":t=r(this.year(),this.month(),1);break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=r(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=hr(t+(this._isUTC?0:this.utcOffset()*ur),cr);break;case"minute":t=this._d.valueOf(),t-=hr(t,ur);break;case"second":t=this._d.valueOf(),t-=hr(t,lr)}return this._d.setTime(t),n.updateOffset(this,!0),this},Mr.subtract=rr,Mr.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},Mr.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()}},Mr.toDate=function(){return new Date(this.valueOf())},Mr.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,r=t?this.clone().utc():this;return r.year()<0||r.year()>9999?N(r,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):O(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",N(r,"Z")):N(r,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},Mr.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,r="moment",n="";return this.isLocal()||(r=0===this.utcOffset()?"moment.utc":"moment.parseZone",n="Z"),e="["+r+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+n+'[")]')},"undefined"!=typeof Symbol&&null!=Symbol.for&&(Mr[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Mr.toJSON=function(){return this.isValid()?this.toISOString():null},Mr.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},Mr.unix=function(){return Math.floor(this.valueOf()/1e3)},Mr.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},Mr.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},Mr.eraName=function(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e){if(r=this.clone().startOf("day").valueOf(),n[e].since<=r&&r<=n[e].until)return n[e].name;if(n[e].until<=r&&r<=n[e].since)return n[e].name}return""},Mr.eraNarrow=function(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e){if(r=this.clone().startOf("day").valueOf(),n[e].since<=r&&r<=n[e].until)return n[e].narrow;if(n[e].until<=r&&r<=n[e].since)return n[e].narrow}return""},Mr.eraAbbr=function(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e){if(r=this.clone().startOf("day").valueOf(),n[e].since<=r&&r<=n[e].until)return n[e].abbr;if(n[e].until<=r&&r<=n[e].since)return n[e].abbr}return""},Mr.eraYear=function(){var e,t,r,a,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e)if(r=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()-n(i[e].since).year())*r+i[e].offset;return this.year()},Mr.year=Ce,Mr.isLeapYear=function(){return ye(this.year())},Mr.weekYear=function(e){return vr.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)},Mr.isoWeekYear=function(e){return vr.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},Mr.quarter=Mr.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},Mr.month=ze,Mr.daysInMonth=function(){return $e(this.year(),this.month())},Mr.week=Mr.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},Mr.isoWeek=Mr.isoWeeks=function(e){var t=qe(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},Mr.weeksInYear=function(){var e=this.localeData()._week;return Ge(this.year(),e.dow,e.doy)},Mr.weeksInWeekYear=function(){var e=this.localeData()._week;return Ge(this.weekYear(),e.dow,e.doy)},Mr.isoWeeksInYear=function(){return Ge(this.year(),1,4)},Mr.isoWeeksInISOWeekYear=function(){return Ge(this.isoWeekYear(),1,4)},Mr.date=xr,Mr.day=Mr.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=De(this,"Day");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},Mr.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")},Mr.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},Mr.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")},Mr.hour=Mr.hours=lt,Mr.minute=Mr.minutes=_r,Mr.second=Mr.seconds=Sr,Mr.millisecond=Mr.milliseconds=kr,Mr.utcOffset=function(e,t,r){var a,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=Yt(ae,e)))return this}else Math.abs(e)<16&&!r&&(e*=60);return!this._isUTC&&t&&(a=Ht(this)),this._offset=e,this._isUTC=!0,null!=a&&this.add(a,"m"),i!==e&&(!t||this._changeInProgress?er(this,Zt(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:Ht(this)},Mr.utc=function(e){return this.utcOffset(0,e)},Mr.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Ht(this),"m")),this},Mr.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Yt(ne,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},Mr.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Ft(e).utcOffset():0,(this.utcOffset()-e)%60==0)},Mr.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Mr.isLocal=function(){return!!this.isValid()&&!this._isUTC},Mr.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},Mr.isUtc=qt,Mr.isUTC=qt,Mr.zoneAbbr=function(){return this._isUTC?"UTC":""},Mr.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},Mr.dates=k("dates accessor is deprecated. Use date instead.",xr),Mr.months=k("months accessor is deprecated. Use month instead",ze),Mr.years=k("years accessor is deprecated. Use year instead",Ce),Mr.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()}),Mr.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=Et(t))._a?(e=t._isUTC?f(t._a):Ft(t._a),this._isDSTShifted=this.isValid()&&function(e,t){var r,n=Math.min(e.length,t.length),a=Math.abs(e.length-t.length),i=0;for(r=0;r<n;r++)he(e[r])!==he(t[r])&&i++;return i+a}(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted});var Ar=C.prototype;function Cr(e,t,r,n){var a=yt(),i=f().set(n,t);return a[r](i,e)}function Pr(e,t,r){if(u(e)&&(t=e,e=void 0),e=e||"",null!=t)return Cr(e,t,r,"month");var n,a=[];for(n=0;n<12;n++)a[n]=Cr(e,n,r,"month");return a}function Dr(e,t,r,n){"boolean"==typeof e?(u(t)&&(r=t,t=void 0),t=t||""):(r=t=e,e=!1,u(t)&&(r=t,t=void 0),t=t||"");var a,i=yt(),o=e?i._week.dow:0,s=[];if(null!=r)return Cr(t,(r+o)%7,n,"day");for(a=0;a<7;a++)s[a]=Cr(t,(a+o)%7,n,"day");return s}Ar.calendar=function(e,t,r){var n=this._calendar[e]||this._calendar.sameElse;return O(n)?n.call(t,r):n},Ar.longDateFormat=function(e){var t=this._longDateFormat[e],r=this._longDateFormat[e.toUpperCase()];return t||!r?t:(this._longDateFormat[e]=r.match(D).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])},Ar.invalidDate=function(){return this._invalidDate},Ar.ordinal=function(e){return this._ordinal.replace("%d",e)},Ar.preparse=Or,Ar.postformat=Or,Ar.relativeTime=function(e,t,r,n){var a=this._relativeTime[r];return O(a)?a(e,t,r,n):a.replace(/%d/i,e)},Ar.pastFuture=function(e,t){var r=this._relativeTime[e>0?"future":"past"];return O(r)?r(t):r.replace(/%s/i,t)},Ar.set=function(e){var t,r;for(r in e)o(e,r)&&(O(t=e[r])?this[r]=t:this["_"+r]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Ar.eras=function(e,t){var r,a,i,o=this._eras||yt("en")._eras;for(r=0,a=o.length;r<a;++r)switch("string"==typeof o[r].since&&(i=n(o[r].since).startOf("day"),o[r].since=i.valueOf()),typeof o[r].until){case"undefined":o[r].until=Infinity;break;case"string":i=n(o[r].until).startOf("day").valueOf(),o[r].until=i.valueOf()}return o},Ar.erasParse=function(e,t,r){var n,a,i,o,s,l=this.eras();for(e=e.toUpperCase(),n=0,a=l.length;n<a;++n)if(i=l[n].name.toUpperCase(),o=l[n].abbr.toUpperCase(),s=l[n].narrow.toUpperCase(),r)switch(t){case"N":case"NN":case"NNN":if(o===e)return l[n];break;case"NNNN":if(i===e)return l[n];break;case"NNNNN":if(s===e)return l[n]}else if([i,o,s].indexOf(e)>=0)return l[n]},Ar.erasConvertYear=function(e,t){var r=e.since<=e.until?1:-1;return void 0===t?n(e.since).year():n(e.since).year()+(t-e.offset)*r},Ar.erasAbbrRegex=function(e){return o(this,"_erasAbbrRegex")||mr.call(this),e?this._erasAbbrRegex:this._erasRegex},Ar.erasNameRegex=function(e){return o(this,"_erasNameRegex")||mr.call(this),e?this._erasNameRegex:this._erasRegex},Ar.erasNarrowRegex=function(e){return o(this,"_erasNarrowRegex")||mr.call(this),e?this._erasNarrowRegex:this._erasRegex},Ar.months=function(e,t){return e?a(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Re).test(t)?"format":"standalone"][e.month()]:a(this._months)?this._months:this._months.standalone},Ar.monthsShort=function(e,t){return e?a(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Re.test(t)?"format":"standalone"][e.month()]:a(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Ar.monthsParse=function(e,t,r){var n,a,i;if(this._monthsParseExact)return Le.call(this,e,t,r);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(a=f([2e3,n]),r&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),r||this._monthsParse[n]||(i="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[n]=new RegExp(i.replace(".",""),"i")),r&&"MMMM"===t&&this._longMonthsParse[n].test(e))return n;if(r&&"MMM"===t&&this._shortMonthsParse[n].test(e))return n;if(!r&&this._monthsParse[n].test(e))return n}},Ar.monthsRegex=function(e){return this._monthsParseExact?(o(this,"_monthsRegex")||We.call(this),e?this._monthsStrictRegex:this._monthsRegex):(o(this,"_monthsRegex")||(this._monthsRegex=je),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},Ar.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)},Ar.week=function(e){return qe(e,this._week.dow,this._week.doy).week},Ar.firstDayOfYear=function(){return this._week.doy},Ar.firstDayOfWeek=function(){return this._week.dow},Ar.weekdays=function(e,t){var r=a(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Qe(r,this._week.dow):e?r[e.day()]:r},Ar.weekdaysMin=function(e){return!0===e?Qe(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},Ar.weekdaysShort=function(e){return!0===e?Qe(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},Ar.weekdaysParse=function(e,t,r){var n,a,i;if(this._weekdaysParseExact)return rt.call(this,e,t,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(a=f([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(i="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[n]=new RegExp(i.replace(".",""),"i")),r&&"dddd"===t&&this._fullWeekdaysParse[n].test(e))return n;if(r&&"ddd"===t&&this._shortWeekdaysParse[n].test(e))return n;if(r&&"dd"===t&&this._minWeekdaysParse[n].test(e))return n;if(!r&&this._weekdaysParse[n].test(e))return n}},Ar.weekdaysRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(o(this,"_weekdaysRegex")||(this._weekdaysRegex=Xe),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},Ar.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(o(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=et),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Ar.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(o(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=tt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Ar.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},Ar.meridiem=function(e,t,r){return e>11?r?"pm":"PM":r?"am":"AM"},gt("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===he(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),n.lang=k("moment.lang is deprecated. Use moment.locale instead.",gt),n.langData=k("moment.langData is deprecated. Use moment.localeData instead.",yt);var Er=Math.abs;function $r(e,t,r,n){var a=Zt(t,r);return e._milliseconds+=n*a._milliseconds,e._days+=n*a._days,e._months+=n*a._months,e._bubble()}function Fr(e){return e<0?Math.floor(e):Math.ceil(e)}function Ir(e){return 4800*e/146097}function Rr(e){return 146097*e/4800}function Nr(e){return function(){return this.as(e)}}var jr=Nr("ms"),Lr=Nr("s"),Vr=Nr("m"),zr=Nr("h"),Wr=Nr("d"),Br=Nr("w"),Yr=Nr("M"),Ur=Nr("Q"),Hr=Nr("y"),qr=jr;function Gr(e){return function(){return this.isValid()?this._data[e]:NaN}}var Qr=Gr("milliseconds"),Zr=Gr("seconds"),Jr=Gr("minutes"),Kr=Gr("hours"),Xr=Gr("days"),en=Gr("months"),tn=Gr("years"),rn=Math.round,nn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function an(e,t,r,n,a){return a.relativeTime(t||1,!!r,e,n)}var on=Math.abs;function sn(e){return(e>0)-(e<0)||+e}function ln(){if(!this.isValid())return this.localeData().invalidDate();var e,t,r,n,a,i,o,s,l=on(this._milliseconds)/1e3,u=on(this._days),c=on(this._months),d=this.asSeconds();return d?(e=de(l/60),t=de(e/60),l%=60,e%=60,r=de(c/12),c%=12,n=l?l.toFixed(3).replace(/\.?0+$/,""):"",a=d<0?"-":"",i=sn(this._months)!==sn(d)?"-":"",o=sn(this._days)!==sn(d)?"-":"",s=sn(this._milliseconds)!==sn(d)?"-":"",a+"P"+(r?i+r+"Y":"")+(c?i+c+"M":"")+(u?o+u+"D":"")+(t||e||l?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(l?s+n+"S":"")):"P0D"}var un=Lt.prototype;return un.isValid=function(){return this._isValid},un.abs=function(){var e=this._data;return this._milliseconds=Er(this._milliseconds),this._days=Er(this._days),this._months=Er(this._months),e.milliseconds=Er(e.milliseconds),e.seconds=Er(e.seconds),e.minutes=Er(e.minutes),e.hours=Er(e.hours),e.months=Er(e.months),e.years=Er(e.years),this},un.add=function(e,t){return $r(this,e,t,1)},un.subtract=function(e,t){return $r(this,e,t,-1)},un.as=function(e){if(!this.isValid())return NaN;var t,r,n=this._milliseconds;if("month"===(e=V(e))||"quarter"===e||"year"===e)switch(r=this._months+Ir(t=this._days+n/864e5),e){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(t=this._days+Math.round(Rr(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return 24*t+n/36e5;case"minute":return 1440*t+n/6e4;case"second":return 86400*t+n/1e3;case"millisecond":return Math.floor(864e5*t)+n;default:throw new Error("Unknown unit "+e)}},un.asMilliseconds=jr,un.asSeconds=Lr,un.asMinutes=Vr,un.asHours=zr,un.asDays=Wr,un.asWeeks=Br,un.asMonths=Yr,un.asQuarters=Ur,un.asYears=Hr,un.valueOf=qr,un._bubble=function(){var e,t,r,n,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*Fr(Rr(s)+o),o=0,s=0),l.milliseconds=i%1e3,e=de(i/1e3),l.seconds=e%60,t=de(e/60),l.minutes=t%60,r=de(t/60),l.hours=r%24,o+=de(r/24),s+=a=de(Ir(o)),o-=Fr(Rr(a)),n=de(s/12),s%=12,l.days=o,l.months=s,l.years=n,this},un.clone=function(){return Zt(this)},un.get=function(e){return e=V(e),this.isValid()?this[e+"s"]():NaN},un.milliseconds=Qr,un.seconds=Zr,un.minutes=Jr,un.hours=Kr,un.days=Xr,un.weeks=function(){return de(this.days()/7)},un.months=en,un.years=tn,un.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var r,n,a=!1,i=nn;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(a=e),"object"==typeof t&&(i=Object.assign({},nn,t),null!=t.s&&null==t.ss&&(i.ss=t.s-1)),n=function(e,t,r,n){var a=Zt(e).abs(),i=rn(a.as("s")),o=rn(a.as("m")),s=rn(a.as("h")),l=rn(a.as("d")),u=rn(a.as("M")),c=rn(a.as("w")),d=rn(a.as("y")),h=i<=r.ss&&["s",i]||i<r.s&&["ss",i]||o<=1&&["m"]||o<r.m&&["mm",o]||s<=1&&["h"]||s<r.h&&["hh",s]||l<=1&&["d"]||l<r.d&&["dd",l];return null!=r.w&&(h=h||c<=1&&["w"]||c<r.w&&["ww",c]),(h=h||u<=1&&["M"]||u<r.M&&["MM",u]||d<=1&&["y"]||["yy",d])[2]=t,h[3]=+e>0,h[4]=n,an.apply(null,h)}(this,!a,i,r=this.localeData()),a&&(n=r.pastFuture(+this,n)),r.postformat(n)},un.toISOString=ln,un.toString=ln,un.toJSON=ln,un.locale=ir,un.localeData=sr,un.toIsoString=k("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ln),un.lang=or,I("X",0,0,"unix"),I("x",0,0,"valueOf"),le("x",re),le("X",/[+-]?\d+(\.\d{1,3})?/),pe("X",function(e,t,r){r._d=new Date(1e3*parseFloat(e))}),pe("x",function(e,t,r){r._d=new Date(he(e))}),n.version="2.30.1",t=Ft,n.fn=Mr,n.min=function(){return Nt("isBefore",[].slice.call(arguments,0))},n.max=function(){return Nt("isAfter",[].slice.call(arguments,0))},n.now=function(){return Date.now?Date.now():+new Date},n.utc=f,n.unix=function(e){return Ft(1e3*e)},n.months=function(e,t){return Pr(e,t,"months")},n.isDate=c,n.locale=gt,n.invalid=m,n.duration=Zt,n.isMoment=_,n.weekdays=function(e,t,r){return Dr(e,t,r,"weekdays")},n.parseZone=function(){return Ft.apply(null,arguments).parseZone()},n.localeData=yt,n.isDuration=Vt,n.monthsShort=function(e,t){return Pr(e,t,"monthsShort")},n.weekdaysMin=function(e,t,r){return Dr(e,t,r,"weekdaysMin")},n.defineLocale=mt,n.updateLocale=function(e,t){if(null!=t){var r,n,a=ut;null!=ct[e]&&null!=ct[e].parentLocale?ct[e].set(A(ct[e]._config,t)):(null!=(n=pt(e))&&(a=n._config),t=A(a,t),null==n&&(t.abbr=e),(r=new C(t)).parentLocale=ct[e],ct[e]=r),gt(e)}else null!=ct[e]&&(null!=ct[e].parentLocale?(ct[e]=ct[e].parentLocale,e===gt()&&gt(e)):null!=ct[e]&&delete ct[e]);return ct[e]},n.locales=function(){return S(ct)},n.weekdaysShort=function(e,t,r){return Dr(e,t,r,"weekdaysShort")},n.normalizeUnits=V,n.relativeTimeRounding=function(e){return void 0===e?rn:"function"==typeof e&&(rn=e,!0)},n.relativeTimeThreshold=function(e,t){return void 0!==nn[e]&&(void 0===t?nn[e]:(nn[e]=t,"s"===e&&(nn.ss=t-1),!0))},n.calendarFormat=function(e,t){var r=e.diff(t,"days",!0);return r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse"},n.prototype=Mr,n.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"},n}()}),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]},r=function(e,r){return function(e){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[t[n]]=n);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})}function l(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}a.rgb.hsl=function(e){var t,r,n=e[0]/255,a=e[1]/255,i=e[2]/255,o=Math.min(n,a,i),s=Math.max(n,a,i),l=s-o;return s===o?t=0:n===s?t=(a-i)/l:a===s?t=2+(i-n)/l:i===s&&(t=4+(n-a)/l),(t=Math.min(60*t,360))<0&&(t+=360),r=(o+s)/2,[t,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]},a.rgb.hsv=function(e){var t,r,n,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),r=d(s),n=d(l),o===u?a=n-r:s===u?a=1/3+t-n:l===u&&(a=2/3+r-t),a<0?a+=1:a>1&&(a-=1)),[360*a,100*i,100*u]},a.rgb.hwb=function(e){var t=e[0],r=e[1],n=e[2];return[a.rgb.hsl(e)[0],1/255*Math.min(t,Math.min(r,n))*100,100*(n=1-1/255*Math.max(t,Math.max(r,n)))]},a.rgb.cmyk=function(e){var t,r=e[0]/255,n=e[1]/255,a=e[2]/255;return[100*((1-r-(t=Math.min(1-r,1-n,1-a)))/(1-t)||0),100*((1-n-t)/(1-t)||0),100*((1-a-t)/(1-t)||0),100*t]},a.rgb.keyword=function(e){var n=r[e];if(n)return n;var a,i=Infinity;for(var o in t)if(t.hasOwnProperty(o)){var s=l(e,t[o]);s<i&&(i=s,a=o)}return a},a.keyword.rgb=function(e){return t[e]},a.rgb.xyz=function(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255;return[100*(.4124*(t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*t+.7152*r+.0722*n),100*(.0193*t+.1192*r+.9505*n)]},a.rgb.lab=function(e){var t=a.rgb.xyz(e),r=t[0],n=t[1],i=t[2];return n/=100,i/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.hsl.rgb=function(e){var t,r,n,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-(r=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var u=0;u<3;u++)(n=o+1/3*-(u-1))<0&&n++,n>1&&n--,a[u]=255*(i=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t);return a},a.hsl.hsv=function(e){var t=e[0],r=e[1]/100,n=e[2]/100,a=r,i=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,a*=i<=1?i:2-i,[t,100*(0===n?2*a/(i+a):2*r/(n+r)),(n+r)/2*100]},a.hsv.rgb=function(e){var t=e[0]/60,r=e[1]/100,n=e[2]/100,a=Math.floor(t)%6,i=t-Math.floor(t),o=255*n*(1-r),s=255*n*(1-r*i),l=255*n*(1-r*(1-i));switch(n*=255,a){case 0:return[n,l,o];case 1:return[s,n,o];case 2:return[o,n,l];case 3:return[o,s,n];case 4:return[l,o,n];case 5:return[n,o,s]}},a.hsv.hsl=function(e){var t,r,n,a=e[0],i=e[1]/100,o=e[2]/100,s=Math.max(o,.01);return n=(2-i)*o,r=i*s,[a,100*(r=(r/=(t=(2-i)*s)<=1?t:2-t)||0),100*(n/=2)]},a.hwb.rgb=function(e){var t,r,n,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),n=6*l-(t=Math.floor(6*l)),1&t&&(n=1-n),a=u+n*((r=1-c)-u),t){default:case 6:case 0:i=r,o=a,s=u;break;case 1:i=a,o=r,s=u;break;case 2:i=u,o=r,s=a;break;case 3:i=u,o=a,s=r;break;case 4:i=a,o=u,s=r;break;case 5:i=r,o=u,s=a}return[255*i,255*o,255*s]},a.cmyk.rgb=function(e){var t=e[1]/100,r=e[2]/100,n=e[3]/100;return[255*(1-Math.min(1,e[0]/100*(1-n)+n)),255*(1-Math.min(1,t*(1-n)+n)),255*(1-Math.min(1,r*(1-n)+n))]},a.xyz.rgb=function(e){var t,r,n,a=e[0]/100,i=e[1]/100,o=e[2]/100;return r=-.9689*a+1.8758*i+.0415*o,n=.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,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(t=Math.min(Math.max(0,t),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},a.xyz.lab=function(e){var t=e[0],r=e[1],n=e[2];return r/=100,n/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(t-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},a.lab.xyz=function(e){var t,r,n;t=e[1]/500+(r=(e[0]+16)/116),n=r-e[2]/200;var a=Math.pow(r,3),i=Math.pow(t,3),o=Math.pow(n,3);return r=a>.008856?a:(r-16/116)/7.787,t=i>.008856?i:(t-16/116)/7.787,n=o>.008856?o:(n-16/116)/7.787,[t*=95.047,r*=100,n*=108.883]},a.lab.lch=function(e){var t,r=e[0],n=e[1],a=e[2];return(t=360*Math.atan2(a,n)/2/Math.PI)<0&&(t+=360),[r,Math.sqrt(n*n+a*a),t]},a.lch.lab=function(e){var t,r=e[1];return t=e[2]/360*2*Math.PI,[e[0],r*Math.cos(t),r*Math.sin(t)]},a.rgb.ansi16=function(e){var t=e[0],r=e[1],n=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(n/255)<<2|Math.round(r/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],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/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 r=.5*(1+~~(e>50));return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},a.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var r;return e-=16,[Math.floor(e/36)/5*255,Math.floor((r=e%36)/6)/5*255,r%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 r=t[0];3===t[0].length&&(r=r.split("").map(function(e){return e+e}).join(""));var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},a.rgb.hcg=function(e){var t,r=e[0]/255,n=e[1]/255,a=e[2]/255,i=Math.max(Math.max(r,n),a),o=Math.min(Math.min(r,n),a),s=i-o;return t=s<=0?0:i===r?(n-a)/s%6:i===n?2+(a-r)/s:4+(r-n)/s+4,t/=6,[360*(t%=1),100*s,100*(s<1?o/(1-s):0)]},a.hsl.hcg=function(e){var t,r=e[1]/100,n=e[2]/100,a=0;return(t=n<.5?2*r*n:2*r*(1-n))<1&&(a=(n-.5*t)/(1-t)),[e[0],100*t,100*a]},a.hsv.hcg=function(e){var t=e[2]/100,r=e[1]/100*t,n=0;return r<1&&(n=(t-r)/(1-r)),[e[0],100*r,100*n]},a.hcg.rgb=function(e){var t=e[1]/100,r=e[2]/100;if(0===t)return[255*r,255*r,255*r];var n,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]+(n=(1-t)*r)),255*(t*a[1]+n),255*(t*a[2]+n)]},a.hcg.hsv=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t),n=0;return r>0&&(n=t/r),[e[0],100*n,100*r]},a.hcg.hsl=function(e){var t=e[1]/100,r=e[2]/100*(1-t)+.5*t,n=0;return r>0&&r<.5?n=t/(2*r):r>=.5&&r<1&&(n=t/(2*(1-r))),[e[0],100*n,100*r]},a.hcg.hwb=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],100*(r-t),100*(1-r)]},a.hwb.hcg=function(e){var t=1-e[2]/100,r=t-e[1]/100,n=0;return r<1&&(n=(t-r)/(1-r)),[e[0],100*r,100*n]},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),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},a.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}}(r={exports:{}}),r.exports}();function n(e,t){return function(r){return t(e(r))}}function a(e,t){for(var a=[t[e].parent,e],i=r[t[e].parent][e],o=t[e].parent;t[o].parent;)a.unshift(t[o].parent),i=n(r[t[o].parent][o],i),o=t[o].parent;return i.conversion=a,i}var i={};Object.keys(r).forEach(function(e){i[e]={},Object.defineProperty(i[e],"channels",{value:r[e].channels}),Object.defineProperty(i[e],"labels",{value:r[e].labels});var t=function(e){for(var t=function(e){var t=function(){for(var e={},t=Object.keys(r),n=t.length,a=0;a<n;a++)e[t[a]]={distance:-1,parent:null};return e}(),n=[e];for(t[e].distance=0;n.length;)for(var a=n.pop(),i=Object.keys(r[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,n.unshift(l))}return t}(e),n={},i=Object.keys(t),o=i.length,s=0;s<o;s++){var l=i[s];null!==t[l].parent&&(n[l]=a(l,t))}return n}(e);Object.keys(t).forEach(function(r){var n=t[r];i[e][r]=function(e){var t=function(t){if(null==t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var r=e(t);if("object"==typeof r)for(var n=r.length,a=0;a<n;a++)r[a]=Math.round(r[a]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}(n),i[e][r].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}(n)})});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 y[e.slice(0,3)]}};function u(e){if(e){var t=[0,0,0],r=1,n=e.match(/^#([a-fA-F0-9]{3,4})$/i),a="";if(n){a=(n=n[1])[3];for(var i=0;i<t.length;i++)t[i]=parseInt(n[i]+n[i],16);a&&(r=Math.round(parseInt(a+a,16)/255*100)/100)}else if(n=e.match(/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i)){for(a=n[2],n=n[1],i=0;i<t.length;i++)t[i]=parseInt(n.slice(2*i,2*i+2),16);a&&(r=Math.round(parseInt(a,16)/255*100)/100)}else if(n=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(n[i+1]);r=parseFloat(n[4])}else if(n=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(n[i+1]));r=parseFloat(n[4])}else if(n=e.match(/(\w+)/)){if("transparent"==n[1])return[0,0,0,0];if(!(t=s[n[1]]))return}for(i=0;i<t.length;i++)t[i]=g(t[i],0,255);return r=r||0==r?g(r,0,1):1,t[3]=r,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 r=parseFloat(t[4]);return[g(parseInt(t[1]),0,360),g(parseFloat(t[2]),0,100),g(parseFloat(t[3]),0,100),g(isNaN(r)?1:r,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 r=parseFloat(t[4]);return[g(parseInt(t[1]),0,360),g(parseFloat(t[2]),0,100),g(parseFloat(t[3]),0,100),g(isNaN(r)?1:r,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,r){return Math.min(Math.max(t,e),r)}function m(e){var t=e.toString(16).toUpperCase();return t.length<2?"0"+t:t}var y={};for(var v in s)y[s[v]]=v;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=[],r=0;r<e.length;r++){var n=e[r]/255;t[r]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast:function(e){var t=this.luminosity(),r=e.luminosity();return t>r?(t+.05)/(r+.05):(r+.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,r=(t[0]+e)%360;return t[0]=r<0?360+r:r,this.setValues("hsl",t),this},mix:function(e,t){var r=this,n=e,a=void 0===t?.5:t,i=2*a-1,o=r.alpha()-n.alpha(),s=((i*o===-1?i:(i+o)/(1+i*o))+1)/2,l=1-s;return this.rgb(s*r.red()+l*n.red(),s*r.green()+l*n.green(),s*r.blue()+l*n.blue()).alpha(r.alpha()*a+n.alpha()*(1-a))},toJSON:function(){return this.rgb()},clone:function(){var e,t,r=new b,n=this.values,a=r.values;for(var i in n)n.hasOwnProperty(i)&&("[object Array]"===(t={}.toString.call(e=n[i]))?a[i]=e.slice(0):"[object Number]"===t?a[i]=e:console.error("unexpected color value:",e));return r}},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,r={},n=0;n<e.length;n++)r[e.charAt(n)]=t[e][n];return 1!==t.alpha&&(r.a=t.alpha),r},b.prototype.setValues=function(e,t){var r,n,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(r=0;r<e.length;r++)a[e][r]=t[e.charAt(r)];l=t.a}else if(void 0!==t[i[e][0]]){var u=i[e];for(r=0;r<e.length;r++)a[e][r]=t[u[r]];l=t.alpha}if(a.alpha=Math.max(0,Math.min(1,void 0===l?a.alpha:l)),"alpha"===e)return!1;for(r=0;r<e.length;r++)n=Math.max(0,Math.min(s[e][r],a[e][r])),a[e][r]=Math.round(n);for(var c in i)c!==e&&(a[c]=o[e][c](a[e]));return!0},b.prototype.setSpace=function(e,t){var r=t[0];return void 0===r?this.getValues(e):("number"==typeof r&&(r=Array.prototype.slice.call(t)),this.setValues(e,r),this)},b.prototype.setChannel=function(e,t,r){var n=this.values[e];return void 0===r?n[t]:(r===n[t]||(n[t]=r,this.setValues(e,n)),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,r){return k.valueOrDefault(k.isArray(e)?e[t]:e,r)},callback:function(e,t,r){if(e&&"function"==typeof e.call)return e.apply(r,t)},each:function(e,t,r,n){var a,i,o;if(k.isArray(e))if(i=e.length,n)for(a=i-1;a>=0;a--)t.call(r,e[a],a);else for(a=0;a<i;a++)t.call(r,e[a],a);else if(k.isObject(e))for(i=(o=Object.keys(e)).length,a=0;a<i;a++)t.call(r,e[o[a]],o[a])},arrayEquals:function(e,t){var r,n,a,i;if(!e||!t||e.length!==t.length)return!1;for(r=0,n=e.length;r<n;++r)if(i=t[r],(a=e[r])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),r=Object.keys(e),n=r.length,a=0;a<n;++a)t[r[a]]=k.clone(e[r[a]]);return t}return e},_merger:function(e,t,r,n){if(_(e)){var a=t[e],i=r[e];k.isObject(a)&&k.isObject(i)?k.merge(a,i,n):t[e]=k.clone(i)}},_mergerIf:function(e,t,r){if(_(e)){var n=t[e],a=r[e];k.isObject(n)&&k.isObject(a)?k.mergeIf(n,a):t.hasOwnProperty(e)||(t[e]=k.clone(a))}},merge:function(e,t,r){var n,a,i,o,s,l=k.isArray(t)?t:[t],u=l.length;if(!k.isObject(e))return e;for(n=(r=r||{}).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)n(i[s],e,t,r);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,r){t[e]=r[e]}})},inherits:function(e){var t=this,r=e&&e.hasOwnProperty("constructor")?e.constructor:function(){return t.apply(this,arguments)},n=function(){this.constructor=r};return n.prototype=t.prototype,r.prototype=new n,r.extend=k.inherits,e&&k.extend(r.prototype,e),r.__super__=t.prototype,r},_deprecated:function(e,t,r,n){void 0!==t&&console.warn(e+': "'+r+'" is deprecated. Please use "'+n+'" instead')}},S=k;k.callCallback=k.callback,k.indexOf=function(e,t,r){return Array.prototype.indexOf.call(e,t,r)},k.getValueOrDefault=k.valueOrDefault,k.getValueAtIndexOrDefault=k.valueAtIndexOrDefault;var T={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,r=0;return 0===e?0:1===e?1:(r||(r=.3),t=r/(2*Math.PI)*Math.asin(1),-1*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r))},easeOutElastic:function(e){var t=1.70158,r=0;return 0===e?0:1===e?1:(r||(r=.3),t=r/(2*Math.PI)*Math.asin(1),1*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/r)+1)},easeInOutElastic:function(e){var t=1.70158,r=0;return 0===e?0:2==(e/=.5)?1:(r||(r=.45),t=r/(2*Math.PI)*Math.asin(1),e<1?1*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)*-.5:1*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)*.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-T.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*T.easeInBounce(2*e):.5*T.easeOutBounce(2*e-1)+.5}},M={effects:T};S.easingEffects=T;var O=Math.PI,A=O/180,C=2*O,P=O/2,D=O/4,E=2*O/3,$={clear:function(e){e.ctx.clearRect(0,0,e.width,e.height)},roundedRect:function(e,t,r,n,a,i){if(i){var o=Math.min(i,a/2,n/2),s=t+o,l=r+o,u=t+n-o,c=r+a-o;e.moveTo(t,l),s<u&&l<c?(e.arc(s,l,o,-O,-P),e.arc(u,l,o,-P,0),e.arc(u,c,o,0,P),e.arc(s,c,o,P,O)):s<u?(e.moveTo(s,r),e.arc(u,l,o,-P,P),e.arc(s,l,o,P,O+P)):l<c?(e.arc(s,l,o,-O,0),e.arc(s,c,o,0,O)):e.arc(s,l,o,-O,O),e.closePath(),e.moveTo(t,r)}else e.rect(t,r,n,a)},drawPoint:function(e,t,r,n,a,i){var o,s,l,u,c,d=(i||0)*A;if(t&&"object"==typeof t&&("[object HTMLImageElement]"===(o=t.toString())||"[object HTMLCanvasElement]"===o))return e.save(),e.translate(n,a),e.rotate(d),e.drawImage(t,-t.width/2,-t.height/2,t.width,t.height),void e.restore();if(!(isNaN(r)||r<=0)){switch(e.beginPath(),t){default:e.arc(n,a,r,0,C),e.closePath();break;case"triangle":e.moveTo(n+Math.sin(d)*r,a-Math.cos(d)*r),d+=E,e.lineTo(n+Math.sin(d)*r,a-Math.cos(d)*r),d+=E,e.lineTo(n+Math.sin(d)*r,a-Math.cos(d)*r),e.closePath();break;case"rectRounded":u=r-(c=.516*r),s=Math.cos(d+D)*u,l=Math.sin(d+D)*u,e.arc(n-s,a-l,c,d-O,d-P),e.arc(n+l,a-s,c,d-P,d),e.arc(n+s,a+l,c,d,d+P),e.arc(n-l,a+s,c,d+P,d+O),e.closePath();break;case"rect":if(!i){u=Math.SQRT1_2*r,e.rect(n-u,a-u,2*u,2*u);break}d+=D;case"rectRot":s=Math.cos(d)*r,l=Math.sin(d)*r,e.moveTo(n-s,a-l),e.lineTo(n+l,a-s),e.lineTo(n+s,a+l),e.lineTo(n-l,a+s),e.closePath();break;case"crossRot":d+=D;case"cross":s=Math.cos(d)*r,l=Math.sin(d)*r,e.moveTo(n-s,a-l),e.lineTo(n+s,a+l),e.moveTo(n+l,a-s),e.lineTo(n-l,a+s);break;case"star":s=Math.cos(d)*r,l=Math.sin(d)*r,e.moveTo(n-s,a-l),e.lineTo(n+s,a+l),e.moveTo(n+l,a-s),e.lineTo(n-l,a+s),d+=D,s=Math.cos(d)*r,l=Math.sin(d)*r,e.moveTo(n-s,a-l),e.lineTo(n+s,a+l),e.moveTo(n+l,a-s),e.lineTo(n-l,a+s);break;case"line":s=Math.cos(d)*r,l=Math.sin(d)*r,e.moveTo(n-s,a-l),e.lineTo(n+s,a+l);break;case"dash":e.moveTo(n,a),e.lineTo(n+Math.cos(d)*r,a+Math.sin(d)*r)}e.fill(),e.stroke()}},_isPointInArea:function(e,t){var r=1e-6;return e.x>t.left-r&&e.x<t.right+r&&e.y>t.top-r&&e.y<t.bottom+r},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,r,n){var a=r.steppedLine;if(a){if("middle"===a){var i=(t.x+r.x)/2;e.lineTo(i,n?r.y:t.y),e.lineTo(i,n?t.y:r.y)}else"after"===a&&!n||"after"!==a&&n?e.lineTo(t.x,r.y):e.lineTo(r.x,t.y);e.lineTo(r.x,r.y)}else r.tension?e.bezierCurveTo(n?t.controlPointPreviousX:t.controlPointNextX,n?t.controlPointPreviousY:t.controlPointNextY,n?r.controlPointNextX:r.controlPointPreviousX,n?r.controlPointNextY:r.controlPointPreviousY,r.x,r.y):e.lineTo(r.x,r.y)}},F=$;S.clear=$.clear,S.drawRoundedRectangle=function(e){e.beginPath(),$.roundedRect.apply($,arguments)};var I={_set:function(e,t){return S.merge(this[e]||(this[e]={}),t)}};I._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 R=I,N=S.valueOrDefault,j={toLineHeight:function(e,t){var r=(""+e).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!r||"normal"===r[1])return 1.2*t;switch(e=+r[2],r[3]){case"px":return e;case"%":e/=100}return t*e},toPadding:function(e){var t,r,n,a;return S.isObject(e)?(t=+e.top||0,r=+e.right||0,n=+e.bottom||0,a=+e.left||0):t=r=n=a=+e||0,{top:t,right:r,bottom:n,left:a,height:t+n,width:a+r}},_parseFont:function(e){var t=R.global,r=N(e.fontSize,t.defaultFontSize),n={family:N(e.fontFamily,t.defaultFontFamily),lineHeight:S.options.toLineHeight(N(e.lineHeight,t.defaultLineHeight),r),size:r,style:N(e.fontStyle,t.defaultFontStyle),weight:null,string:""};return n.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}(n),n},resolve:function(e,t,r,n){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!==r&&S.isArray(o)&&(o=o[r],s=!1),void 0!==o))return n&&!s&&(n.cacheable=!1),o}},L={_factorize:function(e){var t,r=[],n=Math.sqrt(e);for(t=1;t<n;t++)e%t===0&&(r.push(t),r.push(e/t));return n===(0|n)&&r.push(n),r.sort(function(e,t){return e-t}).pop(),r},log10:Math.log10||function(e){var t=Math.log(e)*Math.LOG10E,r=Math.round(t);return e===Math.pow(10,r)?r:t}},V=L;S.log10=L.log10;var z=S,W=F,B=j,Y=V;z.easing=M,z.canvas=W,z.options=B,z.math=Y,z.rtl={getRtlAdapter:function(e,t,r){return e?function(e,t){return{x:function(r){return e+e+t-r},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,r):{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 r,n;"ltr"!==t&&"rtl"!==t||(n=[(r=e.canvas.style).getPropertyValue("direction"),r.getPropertyPriority("direction")],r.setProperty("direction",t,"important"),e.prevTextDirection=n)},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){z.extend(this,e),this.initialize.apply(this,arguments)};z.extend(U.prototype,{_type:void 0,initialize:function(){this.hidden=!1},pivot:function(){var e=this;return e._view||(e._view=z.extend({},e._model)),e._start={},e},transition:function(e){var t=this,r=t._model,n=t._start,a=t._view;return r&&1!==e?(a||(a=t._view={}),n||(n=t._start={}),function(e,t,r,n){var a,i,o,s,l,u,c,d,h,f=Object.keys(r);for(a=0,i=f.length;a<i;++a)if(u=r[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,n).rgbString();continue}}else if(z.isFinite(l)&&z.isFinite(u)){t[o]=l+(u-l)*n;continue}t[o]=u}}(n,a,r,e),t):(t._view=z.extend({},r),t._start=null,t)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return z.isNumber(this._model.x)&&z.isNumber(this._model.y)}}),U.extend=z.inherits;var H=U,q=H.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}}),R._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:z.noop,onComplete:z.noop}});var Q={animations:[],request:null,addAnimation:function(e,t,r,n){var a,i,o=this.animations;for(t.chart=e,t.startTime=Date.now(),t.duration=r,n||(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=z.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=z.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,r,n,a=this.animations,i=0;i<a.length;)t=(e=a[i]).chart,r=e.numSteps,n=Math.floor((Date.now()-e.startTime)/e.duration*r)+1,e.currentStep=Math.min(n,r),z.callback(e.render,[t,e],t),z.callback(e.onAnimationProgress,[e],t),e.currentStep>=r?(z.callback(e.onAnimationComplete,[e],t),t.animating=!1,a.splice(i,1)):++i}},Z=z.options.resolve,J=["push","pop","shift","splice","unshift"];function K(e,t){var r=e._chartjs;if(r){var n=r.listeners,a=n.indexOf(t);-1!==a&&n.splice(a,1),n.length>0||(J.forEach(function(t){delete e[t]}),delete e._chartjs)}}var X=function(e,t){this.initialize(e,t)};z.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 r=this;r.chart=e,r.index=t,r.linkScales(),r.addElements(),r._type=r.getMeta().type},updateIndex:function(e){this.index=e},linkScales:function(){var e=this,t=e.getMeta(),r=e.chart,n=r.scales,a=e.getDataset(),i=r.options.scales;null!==t.xAxisID&&t.xAxisID in n&&!a.xAxisID||(t.xAxisID=a.xAxisID||i.xAxes[0].id),null!==t.yAxisID&&t.yAxisID in n&&!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&&K(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,r=t.dataElementType;return r&&new r({_chart:t.chart,_datasetIndex:t.index,_index:e})},addElements:function(){var e,t,r=this,n=r.getMeta(),a=r.getDataset().data||[],i=n.data;for(e=0,t=a.length;e<t;++e)i[e]=i[e]||r.createMetaData(e);n.dataset=n.dataset||r.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=this,t=e.getDataset(),r=t.data||(t.data=[]);e._data!==r&&(e._data&&K(e._data,e),r&&Object.isExtensible(r)&&function(e,t){e._chartjs?e._chartjs.listeners.push(t):(Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),J.forEach(function(t){var r="onData"+t.charAt(0).toUpperCase()+t.slice(1),n=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:function(){var t=Array.prototype.slice.call(arguments),a=n.apply(this,t);return z.each(e._chartjs.listeners,function(e){"function"==typeof e[r]&&e[r].apply(e,t)}),a}})}))}(r,e),e._data=r),e.resyncElements()},_configure:function(){var e=this;e._config=z.merge(Object.create(null),[e.chart.options.datasets[e._type],e.getDataset()],{merger:function(e,t,r){"_meta"!==e&&"data"!==e&&z._merger(e,t,r)}})},_update:function(e){var t=this;t._configure(),t._cachedDataOpts=null,t.update(e)},update:z.noop,transition:function(e){for(var t=this.getMeta(),r=t.data||[],n=r.length,a=0;a<n;++a)r[a].transition(e);t.dataset&&t.dataset.transition(e)},draw:function(){var e=this.getMeta(),t=e.data||[],r=t.length,n=0;for(e.dataset&&e.dataset.draw();n<r;++n)t[n].draw()},getStyle:function(e){var t,r=this,n=r.getMeta(),a=n.dataset;return r._configure(),!1!==(t=a&&void 0===e?r._resolveDatasetElementOptions(a||{}):r._resolveDataElementOptions(n.data[e=e||0]||{},e)).fill&&null!==t.fill||(t.backgroundColor=t.borderColor),t},_resolveDatasetElementOptions:function(e,t){var r,n,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(r=0,n=d.length;r<n;++r)a=d[r],i=t?"hover"+a.charAt(0).toUpperCase()+a.slice(1):a,h[a]=Z([u[i],l[i],c[i]],f);return h},_resolveDataElementOptions:function(e,t){var r=this,n=e&&e.custom,a=r._cachedDataOpts;if(a&&!n)return a;var i,o,s,l,u=r.chart,c=r._config,d=u.options.elements[r.dataElementType.prototype._type]||{},h=r._dataElementOptions,f={},p={chart:u,dataIndex:t,dataset:r.getDataset(),datasetIndex:r.index},g={cacheable:!n};if(n=n||{},z.isArray(h))for(o=0,s=h.length;o<s;++o)f[l=h[o]]=Z([n[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]]=Z([n[l],c[h[l]],c[l],d[l]],p,t,g);return g.cacheable&&(r._cachedDataOpts=Object.freeze(f)),f},removeHoverStyle:function(e){z.merge(e._model,e.$previousStyle||{}),delete e.$previousStyle},setHoverStyle:function(e){var t=this.chart.data.datasets[e._datasetIndex],r=e._index,n=e.custom||{},a=e._model,i=z.getHoverColor;e.$previousStyle={backgroundColor:a.backgroundColor,borderColor:a.borderColor,borderWidth:a.borderWidth},a.backgroundColor=Z([n.hoverBackgroundColor,t.hoverBackgroundColor,i(a.backgroundColor)],void 0,r),a.borderColor=Z([n.hoverBorderColor,t.hoverBorderColor,i(a.borderColor)],void 0,r),a.borderWidth=Z([n.hoverBorderWidth,t.hoverBorderWidth,a.borderWidth],void 0,r)},_removeDatasetHoverStyle:function(){var e=this.getMeta().dataset;e&&this.removeHoverStyle(e)},_setDatasetHoverStyle:function(){var e,t,r,n,a,i,o=this.getMeta().dataset,s={};if(o){for(i=o._model,a=this._resolveDatasetElementOptions(o,!0),e=0,t=(n=Object.keys(a)).length;e<t;++e)s[r=n[e]]=i[r],i[r]=a[r];o.$previousStyle=s}},resyncElements:function(){var e=this,t=e.getMeta(),r=e.getDataset().data,n=t.data.length,a=r.length;a<n?t.data.splice(a,n-a):a>n&&e.insertElements(n,a-n)},insertElements:function(e,t){for(var r=0;r<t;++r)this.addElementAndReset(e+r)},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=z.inherits;var ee=X,te=2*Math.PI;function re(e,t){var r=t.startAngle,n=t.endAngle,a=t.pixelMargin,i=a/t.outerRadius,o=t.x,s=t.y;e.beginPath(),e.arc(o,s,t.outerRadius,r-i,n+i),t.innerRadius>a?e.arc(o,s,t.innerRadius-a,n+(i=a/t.innerRadius),r-i,!0):e.arc(o,s,a,n+Math.PI/2,r-Math.PI/2),e.closePath(),e.clip()}R._set("global",{elements:{arc:{backgroundColor:R.global.defaultColor,borderColor:"#fff",borderWidth:2,borderAlign:"center"}}});var ne=H.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 r=this._view;if(r){for(var n=z.getAngleFromPoint(r,{x:e,y:t}),a=n.angle,i=n.distance,o=r.startAngle,s=r.endAngle;s<o;)s+=te;for(;a>s;)a-=te;for(;a<o;)a+=te;return a>=o&&a<=s&&i>=r.innerRadius&&i<=r.outerRadius}return!1},getCenterPoint:function(){var e=this._view,t=(e.startAngle+e.endAngle)/2,r=(e.innerRadius+e.outerRadius)/2;return{x:e.x+Math.cos(t)*r,y:e.y+Math.sin(t)*r}},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,r=(e.outerRadius-e.innerRadius)/2+e.innerRadius;return{x:e.x+Math.cos(t)*r,y:e.y+Math.sin(t)*r}},draw:function(){var e,t=this._chart.ctx,r=this._view,n="inner"===r.borderAlign?.33:0,a={x:r.x,y:r.y,innerRadius:r.innerRadius,outerRadius:Math.max(r.outerRadius-n,0),pixelMargin:n,startAngle:r.startAngle,endAngle:r.endAngle,fullCircles:Math.floor(r.circumference/te)};if(t.save(),t.fillStyle=r.backgroundColor,t.strokeStyle=r.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+r.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(),r.borderWidth&&function(e,t,r){var n="inner"===t.borderAlign;n?(e.lineWidth=2*t.borderWidth,e.lineJoin="round"):(e.lineWidth=t.borderWidth,e.lineJoin="bevel"),r.fullCircles&&function(e,t,r,n){var a,i=r.endAngle;for(n&&(r.endAngle=r.startAngle+te,re(e,r),r.endAngle=i,r.endAngle===r.startAngle&&r.fullCircles&&(r.endAngle+=te,r.fullCircles--)),e.beginPath(),e.arc(r.x,r.y,r.innerRadius,r.startAngle+te,r.startAngle,!0),a=0;a<r.fullCircles;++a)e.stroke();for(e.beginPath(),e.arc(r.x,r.y,t.outerRadius,r.startAngle,r.startAngle+te),a=0;a<r.fullCircles;++a)e.stroke()}(e,t,r,n),n&&re(e,r),e.beginPath(),e.arc(r.x,r.y,t.outerRadius,r.startAngle,r.endAngle),e.arc(r.x,r.y,r.innerRadius,r.endAngle,r.startAngle,!0),e.closePath(),e.stroke()}(t,r,a),t.restore()}}),ae=z.valueOrDefault,ie=R.global.defaultColor;R._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=H.extend({_type:"line",draw:function(){var e,t,r,n=this,a=n._view,i=n._chart.ctx,o=a.spanGaps,s=n._children.slice(),l=R.global,u=l.elements.line,c=-1,d=n._loop;if(s.length){if(n._loop){for(e=0;e<s.length;++e)if(t=z.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(),(r=s[0]._view).skip||(i.moveTo(r.x,r.y),c=0),e=1;e<s.length;++e)r=s[e]._view,t=-1===c?z.previousItem(s,e):s[c],r.skip||(c!==e-1&&!o||-1===c?i.moveTo(r.x,r.y):z.canvas.lineTo(i,t._view,r),c=e);d&&i.closePath(),i.stroke(),i.restore()}}}),se=z.valueOrDefault,le=R.global.defaultColor;function ue(e){var t=this._view;return!!t&&Math.abs(e-t.x)<t.radius+t.hitRadius}R._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:le,borderColor:le,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}});var ce=H.extend({_type:"point",inRange:function(e,t){var r=this._view;return!!r&&Math.pow(e-r.x,2)+Math.pow(t-r.y,2)<Math.pow(r.hitRadius+r.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,r=this._chart.ctx,n=t.pointStyle,a=t.rotation,i=t.radius,o=t.x,s=t.y,l=R.global,u=l.defaultColor;t.skip||(void 0===e||z.canvas._isPointInArea(t,e))&&(r.strokeStyle=t.borderColor||u,r.lineWidth=se(t.borderWidth,l.elements.point.borderWidth),r.fillStyle=t.backgroundColor||u,z.canvas.drawPoint(r,n,i,o,s,a))}}),de=R.global.defaultColor;function he(e){return e&&void 0!==e.width}function fe(e){var t,r,n,a,i;return he(e)?(t=e.x-(i=e.width/2),r=e.x+i,n=Math.min(e.y,e.base),a=Math.max(e.y,e.base)):(i=e.height/2,t=Math.min(e.x,e.base),r=Math.max(e.x,e.base),n=e.y-i,a=e.y+i),{left:t,top:n,right:r,bottom:a}}function pe(e,t,r){return e===t?r:e===r?t:e}function ge(e,t,r){var n=null===t,a=null===r,i=!(!e||n&&a)&&fe(e);return i&&(n||t>=i.left&&t<=i.right)&&(a||r>=i.top&&r<=i.bottom)}R._set("global",{elements:{rectangle:{backgroundColor:de,borderColor:de,borderSkipped:"bottom",borderWidth:0}}});var me=H.extend({_type:"rectangle",draw:function(){var e=this._chart.ctx,t=this._view,r=function(e){var t=fe(e),r=t.right-t.left,n=t.bottom-t.top,a=function(e,t,r){var n,a,i,o,s=e.borderWidth,l=function(e){var t=e.borderSkipped,r={};return t?(e.horizontal?e.base>e.x&&(t=pe(t,"left","right")):e.base<e.y&&(t=pe(t,"bottom","top")),r[t]=!0,r):r}(e);return z.isObject(s)?(n=+s.top||0,a=+s.right||0,i=+s.bottom||0,o=+s.left||0):n=a=i=o=+s||0,{t:l.top||n<0?0:n>r?r:n,r:l.right||a<0?0:a>t?t:a,b:l.bottom||i<0?0:i>r?r:i,l:l.left||o<0?0:o>t?t:o}}(e,r/2,n/2);return{outer:{x:t.left,y:t.top,w:r,h:n},inner:{x:t.left+a.l,y:t.top+a.t,w:r-a.l-a.r,h:n-a.t-a.b}}}(t),n=r.outer,a=r.inner;e.fillStyle=t.backgroundColor,e.fillRect(n.x,n.y,n.w,n.h),n.w===a.w&&n.h===a.h||(e.save(),e.beginPath(),e.rect(n.x,n.y,n.w,n.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 r=this._view;return he(r)?ge(r,e,null):ge(r,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,r=this._view;return he(r)?(e=r.x,t=(r.y+r.base)/2):(e=(r.x+r.base)/2,t=r.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}}}),ye={},ve=oe,be=ce,xe=me;ye.Arc=ne,ye.Line=ve,ye.Point=be,ye.Rectangle=xe;var _e=z._deprecated,we=z.valueOrDefault;R._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),R._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var ke=ee.extend({dataElementType:ye.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var e,t,r=this;ee.prototype.initialize.apply(r,arguments),(e=r.getMeta()).stack=r.getDataset().stack,e.bar=!0,t=r._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",r._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,r,n=this,a=n.getMeta().data;for(n._ruler=n.getRuler(),t=0,r=a.length;t<r;++t)n.updateElement(a[t],t,e)},updateElement:function(e,t,r){var n=this,a=n.getMeta(),i=n.getDataset(),o=n._resolveDataElementOptions(e,t);e._xScale=n.getScaleForId(a.xAxisID),e._yScale=n.getScaleForId(a.yAxisID),e._datasetIndex=n.index,e._index=t,e._model={backgroundColor:o.backgroundColor,borderColor:o.borderColor,borderSkipped:o.borderSkipped,borderWidth:o.borderWidth,datasetLabel:i.label,label:n.chart.data.labels[t]},z.isArray(i.data[t])&&(e._model.borderSkipped=null),n._updateElementGeometry(e,t,r,o),e.pivot()},_updateElementGeometry:function(e,t,r,n){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,n),d=a.calculateBarIndexPixels(a.index,t,u,n);i.horizontal=l,i.base=r?s:c.base,i.x=l?r?s:c.head:d.center,i.y=l?d.center:r?s:c.head,i.height=l?d.size:void 0,i.width=l?void 0:d.size},_getStacks:function(e){var t,r,n=this._getIndexScale(),a=n._getMatchingVisibleMetas(this._type),i=n.options.stacked,o=a.length,s=[];for(t=0;t<o&&(r=a[t],(!1===i||-1===s.indexOf(r.stack)||void 0===i&&void 0===r.stack)&&s.push(r.stack),r.index!==e);++t);return s},getStackCount:function(){return this._getStacks().length},getStackIndex:function(e,t){var r=this._getStacks(e),n=void 0!==t?r.indexOf(t):-1;return-1===n?r.length-1:n},getRuler:function(){var e,t,r=this,n=r._getIndexScale(),a=[];for(e=0,t=r.getMeta().data.length;e<t;++e)a.push(n.getPixelForValue(null,e,r.index));return{pixels:a,start:n._startPixel,end:n._endPixel,stackCount:r.getStackCount(),scale:n}},calculateBarValuePixels:function(e,t,r){var n,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]),y=r.minBarLength,v=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(v||void 0===v&&void 0!==b)for(n=0;n<w&&(a=g[n]).index!==e;++n)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!==y&&Math.abs(l)<y&&(l=y,s=_>=0&&!f||_<0&&f?o-y:o+y),{size:l,base:o,head:s,center:s+l/2}},calculateBarIndexPixels:function(e,t,r,n){var a="flex"===n.barThickness?function(e,t,r){var n,a=t.pixels,i=a[e],o=e>0?a[e-1]:null,s=e<a.length-1?a[e+1]:null,l=r.categoryPercentage;return null===o&&(o=i-(null===s?t.end-t.start:s-i)),null===s&&(s=i+i-o),n=i-(i-Math.min(o,s))/2*l,{chunk:Math.abs(s-o)/2*l/t.stackCount,ratio:r.barPercentage,start:n}}(t,r,n):function(e,t,r){var n,a,i=r.barThickness,o=t.stackCount,s=t.pixels[e],l=z.isNullOrUndef(i)?function(e,t){var r,n,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)n=e.getPixelForTick(a),o=a>0?Math.min(o,Math.abs(n-r)):o,r=n;return o}(t.scale,t.pixels):-1;return z.isNullOrUndef(i)?(n=l*r.categoryPercentage,a=r.barPercentage):(n=i*o,a=1),{chunk:n/o,ratio:a,start:s-n/2}}(t,r,n),i=this.getStackIndex(e,this.getMeta().stack),o=a.start+a.chunk*i+a.chunk/2,s=Math.min(we(n.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,r=e._getValueScale(),n=e.getMeta().data,a=e.getDataset(),i=n.length,o=0;for(z.canvas.clipArea(t.ctx,t.chartArea);o<i;++o){var s=r._parseValue(a.data[o]);isNaN(s.min)||isNaN(s.max)||n[o].draw()}z.canvas.unclipArea(t.ctx)},_resolveDataElementOptions:function(){var e=this,t=z.extend({},ee.prototype._resolveDataElementOptions.apply(e,arguments)),r=e._getIndexScale().options,n=e._getValueScale().options;return t.barPercentage=we(r.barPercentage,t.barPercentage),t.barThickness=we(r.barThickness,t.barThickness),t.categoryPercentage=we(r.categoryPercentage,t.categoryPercentage),t.maxBarThickness=we(r.maxBarThickness,t.maxBarThickness),t.minBarLength=we(n.minBarLength,t.minBarLength),t}}),Se=z.valueOrDefault,Te=z.options.resolve;R._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:ye.Point,_dataElementOptions:["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle","rotation"],update:function(e){var t=this,r=t.getMeta();z.each(r.data,function(r,n){t.updateElement(r,n,e)})},updateElement:function(e,t,r){var n=this,a=n.getMeta(),i=e.custom||{},o=n.getScaleForId(a.xAxisID),s=n.getScaleForId(a.yAxisID),l=n._resolveDataElementOptions(e,t),u=n.getDataset().data[t],c=n.index,d=r?o.getPixelForDecimal(.5):o.getPixelForValue("object"==typeof u?u:NaN,t,c),h=r?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:r?0:l.radius,skip:i.skip||isNaN(d)||isNaN(h),x:d,y:h},e.pivot()},setHoverStyle:function(e){var t=e._model,r=e._options,n=z.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth,radius:t.radius},t.backgroundColor=Se(r.hoverBackgroundColor,n(r.backgroundColor)),t.borderColor=Se(r.hoverBorderColor,n(r.borderColor)),t.borderWidth=Se(r.hoverBorderWidth,r.borderWidth),t.radius=r.radius+r.hoverRadius},_resolveDataElementOptions:function(e,t){var r=this,n=r.chart,a=r.getDataset(),i=e.custom||{},o=a.data[t]||{},s=ee.prototype._resolveDataElementOptions.apply(r,arguments),l={chart:n,dataIndex:t,dataset:a,datasetIndex:r.index};return r._cachedDataOpts===s&&(s=z.extend({},s)),s.radius=Te([i.radius,o.r,r._config.radius,n.options.elements.point.radius],l,t),s}}),Oe=z.valueOrDefault,Ae=Math.PI,Ce=2*Ae,Pe=Ae/2;R._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(e){var t,r,n,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,r=o[0].data.length;t<r;++t)(n=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=o[0].backgroundColor[t],s[t]&&n.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(r,n){var a=e.getDatasetMeta(0),i=a.controller.getStyle(n);return{text:r,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,lineWidth:i.borderWidth,hidden:isNaN(t.datasets[0].data[n])||a.data[n].hidden,index:n}}):[]}},onClick:function(e,t){var r,n,a,i=t.index,o=this.chart;for(r=0,n=(o.data.datasets||[]).length;r<n;++r)(a=o.getDatasetMeta(r)).data[i]&&(a.data[i].hidden=!a.data[i].hidden);o.update()}},cutoutPercentage:50,rotation:-Pe,circumference:Ce,tooltips:{callbacks:{title:function(){return""},label:function(e,t){var r=t.labels[e.index],n=": "+t.datasets[e.datasetIndex].data[e.index];return z.isArray(r)?(r=r.slice())[0]+=n:r+=n,r}}}});var De=ee.extend({dataElementType:ye.Arc,linkScales:z.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],getRingIndex:function(e){for(var t=0,r=0;r<e;++r)this.chart.isDatasetVisible(r)&&++t;return t},update:function(e){var t,r,n=this,a=n.chart,i=a.chartArea,o=a.options,s=1,l=1,u=0,c=0,d=n.getMeta(),h=d.data,f=o.cutoutPercentage/100||0,p=o.circumference,g=n._getRingWeight(n.index);if(p<Ce){var m=o.rotation%Ce,y=(m+=m>=Ae?-Ce:m<-Ae?Ce:0)+p,v=Math.cos(m),b=Math.sin(m),x=Math.cos(y),_=Math.sin(y),w=m<=0&&y>=0||y>=Ce,k=m<=Pe&&y>=Pe||y>=Ce+Pe,S=m<=-Pe&&y>=-Pe||y>=Ae+Pe,T=m===-Ae||y>=Ae?-1:Math.min(v,v*f,x,x*f),M=S?-1:Math.min(b,b*f,_,_*f),O=w?1:Math.max(v,v*f,x,x*f),A=k?1:Math.max(b,b*f,_,_*f);s=(O-T)/2,l=(A-M)/2,u=-(O+T)/2,c=-(A+M)/2}for(t=0,r=h.length;t<r;++t)h[t]._options=n._resolveDataElementOptions(h[t],t);for(a.borderWidth=n.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)/(n._getVisibleDatasetWeightTotal()||1),a.offsetX=u*a.outerRadius,a.offsetY=c*a.outerRadius,d.total=n.calculateTotal(),n.outerRadius=a.outerRadius-a.radiusLength*n._getRingWeightOffset(n.index),n.innerRadius=Math.max(n.outerRadius-a.radiusLength*g,0),t=0,r=h.length;t<r;++t)n.updateElement(h[t],t,e)},updateElement:function(e,t,r){var n=this,a=n.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=n.getDataset(),f=r&&s.animateRotate||e.hidden?0:n.calculateCircumference(h.data[t])*(o.circumference/Ce),p=e._options||{};z.extend(e,{_datasetIndex:n.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:r&&s.animateScale?0:n.outerRadius,innerRadius:r&&s.animateScale?0:n.innerRadius,label:z.valueAtIndexOrDefault(h.label,t,a.data.labels[t])}});var g=e._model;r&&s.animateRotate||(g.startAngle=0===t?o.rotation:n.getMeta().data[t-1]._model.endAngle,g.endAngle=g.startAngle+g.circumference),e.pivot()},calculateTotal:function(){var e,t=this.getDataset(),r=this.getMeta(),n=0;return z.each(r.data,function(r,a){e=t.data[a],isNaN(e)||r.hidden||(n+=Math.abs(e))}),n},calculateCircumference:function(e){var t=this.getMeta().total;return t>0&&!isNaN(e)?Ce*(Math.abs(e)/t):0},getMaxBorderWidth:function(e){var t,r,n,a,i,o,s,l,u=0,c=this.chart;if(!e)for(t=0,r=c.data.datasets.length;t<r;++t)if(c.isDatasetVisible(t)){e=(n=c.getDatasetMeta(t)).data,t!==this.index&&(i=n.controller);break}if(!e)return 0;for(t=0,r=e.length;t<r;++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,r=e._options,n=z.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth},t.backgroundColor=Oe(r.hoverBackgroundColor,n(r.backgroundColor)),t.borderColor=Oe(r.hoverBorderColor,n(r.borderColor)),t.borderWidth=Oe(r.hoverBorderWidth,r.borderWidth)},_getRingWeightOffset:function(e){for(var t=0,r=0;r<e;++r)this.chart.isDatasetVisible(r)&&(t+=this._getRingWeight(r));return t},_getRingWeight:function(e){return Math.max(Oe(this.chart.data.datasets[e].weight,1),0)},_getVisibleDatasetWeightTotal:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)}});R._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"}}),R._set("global",{datasets:{horizontalBar:{categoryPercentage:.8,barPercentage:.9}}});var Ee=ke.extend({_getValueScaleId:function(){return this.getMeta().xAxisID},_getIndexScaleId:function(){return this.getMeta().yAxisID}}),$e=z.valueOrDefault,Fe=z.options.resolve,Ie=z.canvas._isPointInArea;function Re(e,t){var r=e&&e.options.ticks||{},n=r.reverse,a=void 0===r.min?t:0,i=void 0===r.max?t:0;return{start:n?i:a,end:n?a:i}}R._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 Ne=ee.extend({datasetElementType:ye.Line,dataElementType:ye.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,r,n=this,a=n.getMeta(),i=a.dataset,o=a.data||[],s=n._config,l=n._showLine=$e(s.showLine,n.chart.options.showLines);for(n._xScale=n.getScaleForId(a.xAxisID),n._yScale=n.getScaleForId(a.yAxisID),l&&(void 0!==s.tension&&void 0===s.lineTension&&(s.lineTension=s.tension),i._scale=n._yScale,i._datasetIndex=n.index,i._children=o,i._model=n._resolveDatasetElementOptions(i),i.pivot()),t=0,r=o.length;t<r;++t)n.updateElement(o[t],t,e);for(l&&0!==i._model.tension&&n.updateBezierControlPoints(),t=0,r=o.length;t<r;++t)o[t].pivot()},updateElement:function(e,t,r){var n,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);n=d.getPixelForValue("object"==typeof c?c:NaN,t,u),a=r?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:n,y:a,skip:s.skip||isNaN(n)||isNaN(a),radius:p.radius,pointStyle:p.pointStyle,rotation:p.rotation,backgroundColor:p.backgroundColor,borderColor:p.borderColor,borderWidth:p.borderWidth,tension:$e(s.tension,f?f.tension:0),steppedLine:!!f&&f.steppedLine,hitRadius:p.hitRadius}},_resolveDatasetElementOptions:function(e){var t,r,n,a,i,o,s,l,u,c=this,d=c._config,h=e.custom||{},f=c.chart.options,p=f.elements.line,g=ee.prototype._resolveDatasetElementOptions.apply(c,arguments);return g.spanGaps=$e(d.spanGaps,f.spanGaps),g.tension=$e(d.lineTension,p.tension),g.steppedLine=Fe([h.steppedLine,d.steppedLine,p.stepped]),g.clip=(t=$e(d.clip,(o=c._yScale,l=Re(c._xScale,s=g.borderWidth/2),{top:(u=Re(o,s)).end,right:l.end,bottom:u.start,left:l.start})),z.isObject(t)?(r=t.top,n=t.right,a=t.bottom,i=t.left):r=n=a=i=t,{top:r,right:n,bottom:a,left:i}),g},calculatePointY:function(e,t,r){var n,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,n=0;n<l&&(a=s[n]).index!==r;++n)"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,r,n,a=this.chart,i=this.getMeta(),o=i.dataset._model,s=a.chartArea,l=i.data||[];function u(e,t,r){return Math.max(Math.min(e,r),t)}if(o.spanGaps&&(l=l.filter(function(e){return!e._model.skip})),"monotone"===o.cubicInterpolationMode)z.splineCurveMonotone(l);else for(e=0,t=l.length;e<t;++e)r=l[e]._model,n=z.splineCurve(z.previousItem(l,e)._model,r,z.nextItem(l,e)._model,o.tension),r.controlPointPreviousX=n.previous.x,r.controlPointPreviousY=n.previous.y,r.controlPointNextX=n.next.x,r.controlPointNextY=n.next.y;if(a.options.elements.line.capBezierPoints)for(e=0,t=l.length;e<t;++e)Ie(r=l[e]._model,s)&&(e>0&&Ie(l[e-1]._model,s)&&(r.controlPointPreviousX=u(r.controlPointPreviousX,s.left,s.right),r.controlPointPreviousY=u(r.controlPointPreviousY,s.top,s.bottom)),e<l.length-1&&Ie(l[e+1]._model,s)&&(r.controlPointNextX=u(r.controlPointNextX,s.left,s.right),r.controlPointNextY=u(r.controlPointNextY,s.top,s.bottom)))},draw:function(){var e,t=this,r=t.chart,n=t.getMeta(),a=n.data||[],i=r.chartArea,o=r.canvas,s=0,l=a.length;for(t._showLine&&(z.canvas.clipArea(r.ctx,{left:!1===(e=n.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}),n.dataset.draw(),z.canvas.unclipArea(r.ctx));s<l;++s)a[s].draw(i)},setHoverStyle:function(e){var t=e._model,r=e._options,n=z.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth,radius:t.radius},t.backgroundColor=$e(r.hoverBackgroundColor,n(r.backgroundColor)),t.borderColor=$e(r.hoverBorderColor,n(r.borderColor)),t.borderWidth=$e(r.hoverBorderWidth,r.borderWidth),t.radius=$e(r.hoverRadius,r.radius)}}),je=z.options.resolve;R._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,r,n,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,r=o[0].data.length;t<r;++t)(n=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=o[0].backgroundColor[t],s[t]&&n.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(r,n){var a=e.getDatasetMeta(0),i=a.controller.getStyle(n);return{text:r,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,lineWidth:i.borderWidth,hidden:isNaN(t.datasets[0].data[n])||a.data[n].hidden,index:n}}):[]}},onClick:function(e,t){var r,n,a,i=t.index,o=this.chart;for(r=0,n=(o.data.datasets||[]).length;r<n;++r)(a=o.getDatasetMeta(r)).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 Le=ee.extend({dataElementType:ye.Arc,linkScales:z.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,r,n,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,r=i.data.length;t<r;t++)l[t]=s,n=a._computeAngle(t),u[t]=n,s+=n;for(t=0,r=c.length;t<r;++t)c[t]._options=a._resolveDataElementOptions(c[t],t),a.updateElement(c[t],t,e)},_updateRadius:function(){var e=this,t=e.chart,r=t.chartArea,n=t.options,a=Math.min(r.right-r.left,r.bottom-r.top);t.outerRadius=Math.max(a/2,0),t.innerRadius=Math.max(n.cutoutPercentage?t.outerRadius/100*n.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,r){var n=this,a=n.chart,i=n.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=n._starts[t],g=p+(e.hidden?0:n._angles[t]),m=s.animateScale?0:l.getDistanceFromCenterForValue(i.data[t]),y=e._options||{};z.extend(e,{_datasetIndex:n.index,_index:t,_scale:l,_model:{backgroundColor:y.backgroundColor,borderColor:y.borderColor,borderWidth:y.borderWidth,borderAlign:y.borderAlign,x:c,y:d,innerRadius:0,outerRadius:r?m:f,startAngle:r&&s.animateRotate?h:p,endAngle:r&&s.animateRotate?h:g,label:z.valueAtIndexOrDefault(u,t,u[t])}}),e.pivot()},countVisibleElements:function(){var e=this.getDataset(),t=this.getMeta(),r=0;return z.each(t.data,function(t,n){isNaN(e.data[n])||t.hidden||r++}),r},setHoverStyle:function(e){var t=e._model,r=e._options,n=z.getHoverColor,a=z.valueOrDefault;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth},t.backgroundColor=a(r.hoverBackgroundColor,n(r.backgroundColor)),t.borderColor=a(r.hoverBorderColor,n(r.borderColor)),t.borderWidth=a(r.hoverBorderWidth,r.borderWidth)},_computeAngle:function(e){var t=this,r=this.getMeta().count,n=t.getDataset(),a=t.getMeta();return isNaN(n.data[e])||a.data[e].hidden?0:je([t.chart.options.elements.arc.angle,2*Math.PI/r],{chart:t.chart,dataIndex:e,dataset:n,datasetIndex:t.index},e)}});R._set("pie",z.clone(R.doughnut)),R._set("pie",{cutoutPercentage:0});var Ve=De,ze=z.valueOrDefault;R._set("radar",{spanGaps:!1,scale:{type:"radialLinear"},elements:{line:{fill:"start",tension:0}}});var We=ee.extend({datasetElementType:ye.Line,dataElementType:ye.Point,linkScales:z.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,r,n=this,a=n.getMeta(),i=a.dataset,o=a.data||[],s=n.chart.scale,l=n._config;for(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),i._scale=s,i._datasetIndex=n.index,i._children=o,i._loop=!0,i._model=n._resolveDatasetElementOptions(i),i.pivot(),t=0,r=o.length;t<r;++t)n.updateElement(o[t],t,e);for(n.updateBezierControlPoints(),t=0,r=o.length;t<r;++t)o[t].pivot()},updateElement:function(e,t,r){var n=this,a=e.custom||{},i=n.getDataset(),o=n.chart.scale,s=o.getPointPositionForValue(t,i.data[t]),l=n._resolveDataElementOptions(e,t),u=n.getMeta().dataset._model,c=r?o.xCenter:s.x,d=r?o.yCenter:s.y;e._scale=o,e._options=l,e._datasetIndex=n.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:ze(a.tension,u?u.tension:0),hitRadius:l.hitRadius}},_resolveDatasetElementOptions:function(){var e=this,t=e._config,r=e.chart.options,n=ee.prototype._resolveDatasetElementOptions.apply(e,arguments);return n.spanGaps=ze(t.spanGaps,r.spanGaps),n.tension=ze(t.lineTension,r.elements.line.tension),n},updateBezierControlPoints:function(){var e,t,r,n,a=this.getMeta(),i=this.chart.chartArea,o=a.data||[];function s(e,t,r){return Math.max(Math.min(e,r),t)}for(a.dataset._model.spanGaps&&(o=o.filter(function(e){return!e._model.skip})),e=0,t=o.length;e<t;++e)r=o[e]._model,n=z.splineCurve(z.previousItem(o,e,!0)._model,r,z.nextItem(o,e,!0)._model,r.tension),r.controlPointPreviousX=s(n.previous.x,i.left,i.right),r.controlPointPreviousY=s(n.previous.y,i.top,i.bottom),r.controlPointNextX=s(n.next.x,i.left,i.right),r.controlPointNextY=s(n.next.y,i.top,i.bottom)},setHoverStyle:function(e){var t=e._model,r=e._options,n=z.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth,radius:t.radius},t.backgroundColor=ze(r.hoverBackgroundColor,n(r.backgroundColor)),t.borderColor=ze(r.hoverBorderColor,n(r.borderColor)),t.borderWidth=ze(r.hoverBorderWidth,r.borderWidth),t.radius=ze(r.hoverRadius,r.radius)}});R._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+")"}}}}),R._set("global",{datasets:{scatter:{showLine:!1}}});var Be={bar:ke,bubble:Me,doughnut:De,horizontalBar:Ee,line:Ne,polarArea:Le,pie:Ve,radar:We,scatter:Ne};function Ye(e,t){return e.native?{x:e.x,y:e.y}:z.getRelativePosition(e,t)}function Ue(e,t){var r,n,a,i,o,s,l=e._getSortedVisibleDatasetMetas();for(n=0,i=l.length;n<i;++n)for(a=0,o=(r=l[n].data).length;a<o;++a)(s=r[a])._view.skip||t(s)}function He(e,t){var r=[];return Ue(e,function(e){e.inRange(t.x,t.y)&&r.push(e)}),r}function qe(e,t,r,n){var a=Number.POSITIVE_INFINITY,i=[];return Ue(e,function(e){if(!r||e.inRange(t.x,t.y)){var o=e.getCenterPoint(),s=n(t,o);s<a?(i=[e],a=s):s===a&&i.push(e)}}),i}function Ge(e){var t=-1!==e.indexOf("x"),r=-1!==e.indexOf("y");return function(e,n){var a=t?Math.abs(e.x-n.x):0,i=r?Math.abs(e.y-n.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(i,2))}}function Qe(e,t,r){var n=Ye(t,e);r.axis=r.axis||"x";var a=Ge(r.axis),i=r.intersect?He(e,n):qe(e,n,!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 r=Ye(t,e),n=[];return Ue(e,function(e){if(e.inRange(r.x,r.y))return n.push(e),n}),n.slice(0,1)},label:Qe,index:Qe,dataset:function(e,t,r){var n=Ye(t,e);r.axis=r.axis||"xy";var a=Ge(r.axis),i=r.intersect?He(e,n):qe(e,n,!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 He(e,Ye(t,e))},nearest:function(e,t,r){var n=Ye(t,e);r.axis=r.axis||"xy";var a=Ge(r.axis);return qe(e,n,r.intersect,a)},x:function(e,t,r){var n=Ye(t,e),a=[],i=!1;return Ue(e,function(e){e.inXRange(n.x)&&a.push(e),e.inRange(n.x,n.y)&&(i=!0)}),r.intersect&&!i&&(a=[]),a},y:function(e,t,r){var n=Ye(t,e),a=[],i=!1;return Ue(e,function(e){e.inYRange(n.y)&&a.push(e),e.inRange(n.x,n.y)&&(i=!0)}),r.intersect&&!i&&(a=[]),a}}},Je=z.extend;function Ke(e,t){return z.where(e,function(e){return e.pos===t})}function Xe(e,t){return e.sort(function(e,r){var n=t?r:e,a=t?e:r;return n.weight===a.weight?n.index-a.index:n.weight-a.weight})}function et(e,t,r,n){return Math.max(e[r],t[r])+Math.max(e[n],t[n])}function tt(e,t,r){var n,a,i=r.box,o=e.maxPadding;if(r.size&&(e[r.pos]-=r.size),r.size=r.horizontal?i.height:i.width,e[r.pos]+=r.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(n=t.outerWidth-et(o,e,"left","right"),a=t.outerHeight-et(o,e,"top","bottom"),n!==e.w||a!==e.h){e.w=n,e.h=a;var l=r.horizontal?[n,e.w]:[a,e.h];return!(l[0]===l[1]||isNaN(l[0])&&isNaN(l[1]))}}function rt(e,t){var r,n=t.maxPadding;return r={left:0,top:0,right:0,bottom:0},(e?["left","right"]:["top","bottom"]).forEach(function(e){r[e]=Math.max(t[e],n[e])}),r}function nt(e,t,r){var n,a,i,o,s,l,u=[];for(n=0,a=e.length;n<a;++n)(o=(i=e[n]).box).update(i.width||t.w,i.height||t.h,rt(i.horizontal,t)),tt(t,r,i)&&(l=!0,u.length&&(s=!0)),o.fullWidth||u.push(i);return s&&nt(u,t,r)||l}function at(e,t,r){var n,a,i,o,s=r.padding,l=t.x,u=t.y;for(n=0,a=e.length;n<a;++n)o=(i=e[n]).box,i.horizontal?(o.left=o.fullWidth?s.left:t.left,o.right=o.fullWidth?r.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}R._set("global",{layout:{padding:{top:0,right:0,bottom:0,left:0}}});var it,ot={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 r=e.boxes?e.boxes.indexOf(t):-1;-1!==r&&e.boxes.splice(r,1)},configure:function(e,t,r){for(var n,a=["fullWidth","position","weight"],i=a.length,o=0;o<i;++o)r.hasOwnProperty(n=a[o])&&(t[n]=r[n])},update:function(e,t,r){if(e){var n=z.options.toPadding((e.options.layout||{}).padding),a=t-n.width,i=r-n.height,o=function(e){var t=function(e){var t,r,n,a=[];for(t=0,r=(e||[]).length;t<r;++t)a.push({index:t,box:n=e[t],pos:n.position,horizontal:n.isHorizontal(),weight:n.weight});return a}(e),r=Xe(Ke(t,"left"),!0),n=Xe(Ke(t,"right")),a=Xe(Ke(t,"top"),!0),i=Xe(Ke(t,"bottom"));return{leftAndTop:r.concat(a),rightAndBottom:n.concat(i),chartArea:Ke(t,"chartArea"),vertical:r.concat(n),horizontal:a.concat(i)}}(e.boxes),s=o.vertical,l=o.horizontal,u=Object.freeze({outerWidth:t,outerHeight:r,padding:n,availableWidth:a,vBoxMaxWidth:a/2/s.length,hBoxMaxHeight:i/2}),c=Je({maxPadding:Je({},n),w:a,h:i,x:n.left,y:n.top},n);(function(e,t){var r,n,a;for(r=0,n=e.length;r<n;++r)(a=e[r]).width=a.horizontal?a.box.fullWidth&&t.availableWidth:t.vBoxMaxWidth,a.height=a.horizontal&&t.hBoxMaxHeight})(s.concat(l),u),nt(s,c,u),nt(l,c,u)&&nt(s,c,u),function(e){var t=e.maxPadding;function r(r){var n=Math.max(t[r]-e[r],0);return e[r]+=n,n}e.y+=r("top"),e.x+=r("left"),r("right"),r("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},z.each(o.chartArea,function(t){var r=t.box;Je(r,e.chartArea),r.update(c.w,c.h)})}}},st=(it=/*#__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"}))&&it.default||it,lt="$chartjs",ut="chartjs-",ct=ut+"size-monitor",dt=ut+"render-monitor",ht=ut+"render-animation",ft=["animationstart","webkitAnimationStart"],pt={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function gt(e,t){var r=z.getStyle(e,t),n=r&&r.match(/^(\d+)(\.\d+)?px$/);return n?Number(n[1]):void 0}var mt=!!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,r){e.addEventListener(t,r,mt)}function vt(e,t,r){e.removeEventListener(t,r,mt)}function bt(e,t,r,n,a){return{type:e,chart:t,native:a||null,x:void 0!==r?r:null,y:void 0!==n?n:null}}function xt(e){var t=document.createElement("div");return t.className=e||"",t}var _t={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 r=e[lt]||(e[lt]={});if(!r.containsStyles){r.containsStyles=!0,t="/* Chart.js */\n"+t;var n=document.createElement("style");n.setAttribute("type","text/css"),n.appendChild(document.createTextNode(t)),e.appendChild(n)}}(t.host?t:document.head,st)}},acquireContext:function(e,t){"string"==typeof e?e=document.getElementById(e):e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas);var r=e&&e.getContext&&e.getContext("2d");return r&&r.canvas===e?(this._ensureLoaded(e),function(e,t){var r=e.style,n=e.getAttribute("height"),a=e.getAttribute("width");if(e[lt]={initial:{height:n,width:a,style:{display:r.display,height:r.height,width:r.width}}},r.display=r.display||"block",null===a||""===a){var i=gt(e,"width");void 0!==i&&(e.width=i)}if(null===n||""===n)if(""===e.style.height)e.height=e.width/(t.options.aspectRatio||2);else{var o=gt(e,"height");void 0!==i&&(e.height=o)}}(e,t),r):null},releaseContext:function(e){var t=e.canvas;if(t[lt]){var r=t[lt].initial;["height","width"].forEach(function(e){var n=r[e];z.isNullOrUndef(n)?t.removeAttribute(e):t.setAttribute(e,n)}),z.each(r.style||{},function(e,r){t.style[r]=e}),t.width=t.width,delete t[lt]}},addEventListener:function(e,t,r){var n=e.canvas;if("resize"!==t){var a=r[lt]||(r[lt]={});yt(n,t,(a.proxies||(a.proxies={}))[e.id+"_"+t]=function(t){r(function(e,t){var r=pt[e.type]||e.type,n=z.getRelativePosition(e,t);return bt(r,t,n.x,n.y,e)}(t,e))})}else!function(e,t,r){var n,a,i,o,s=e[lt]||(e[lt]={}),l=s.resizer=function(e){var t=1e6,r=xt(ct),n=xt(ct+"-expand"),a=xt(ct+"-shrink");n.appendChild(xt()),a.appendChild(xt()),r.appendChild(n),r.appendChild(a),r._reset=function(){n.scrollLeft=t,n.scrollTop=t,a.scrollLeft=t,a.scrollTop=t};var i=function(){r._reset(),e()};return yt(n,"scroll",i.bind(n,"expand")),yt(a,"scroll",i.bind(a,"shrink")),r}((n=function(){if(s.resizer){var n=r.options.maintainAspectRatio&&e.parentNode,a=n?n.clientWidth:0;t(bt("resize",r)),n&&n.clientWidth<a&&r.canvas&&t(bt("resize",r))}},i=!1,o=[],function(){o=Array.prototype.slice.call(arguments),a=a||this,i||(i=!0,z.requestAnimFrame.call(window,function(){i=!1,n.apply(a,o)}))}));!function(e,t){var r=e[lt]||(e[lt]={}),n=r.renderProxy=function(e){e.animationName===ht&&t()};z.each(ft,function(t){yt(e,t,n)}),r.reflow=!!e.offsetParent,e.classList.add(dt)}(e,function(){if(s.resizer){var t=e.parentNode;t&&t!==l.parentNode&&t.insertBefore(l,t.firstChild),l._reset()}})}(n,r,e)},removeEventListener:function(e,t,r){var n,a,i,o=e.canvas;if("resize"!==t){var s=((r[lt]||{}).proxies||{})[e.id+"_"+t];s&&vt(o,t,s)}else i=(a=(n=o)[lt]||{}).resizer,delete a.resizer,function(e){var t=e[lt]||{},r=t.renderProxy;r&&(z.each(ft,function(t){vt(e,t,r)}),delete t.renderProxy),e.classList.remove(dt)}(n),i&&i.parentNode&&i.parentNode.removeChild(i)}};z.addEvent=yt,z.removeEvent=vt;var wt=z.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},_t._enabled?_t:{acquireContext:function(e){return e&&e.canvas&&(e=e.canvas),e&&e.getContext("2d")||null}});R._set("global",{plugins:{}});var kt={_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 r=t.indexOf(e);-1!==r&&t.splice(r,1)}),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(e,t,r){var n,a,i,o,s,l=this.descriptors(e),u=l.length;for(n=0;n<u;++n)if("function"==typeof(s=(i=(a=l[n]).plugin)[t])&&((o=[e].concat(r||[])).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 r=[],n=[],a=e&&e.config||{},i=a.options&&a.options.plugins||{};return this._plugins.concat(a.plugins||[]).forEach(function(e){if(-1===r.indexOf(e)){var t=e.id,a=i[t];!1!==a&&(!0===a&&(a=z.clone(R.global.plugins[t])),r.push(e),n.push({plugin:e,options:a||{}}))}}),t.descriptors=n,t.id=this._cacheId,n},_invalidate:function(e){delete e.$plugins}},St={constructors:{},defaults:{},registerScaleType:function(e,t,r){this.constructors[e]=t,this.defaults[e]=z.clone(r)},getScaleConstructor:function(e){return this.constructors.hasOwnProperty(e)?this.constructors[e]:void 0},getScaleDefaults:function(e){return this.defaults.hasOwnProperty(e)?z.merge(Object.create(null),[R.scale,this.defaults[e]]):{}},updateScaleDefaults:function(e,t){var r=this;r.defaults.hasOwnProperty(e)&&(r.defaults[e]=z.extend(r.defaults[e],t))},addScalesToLayout:function(e){z.each(e.scales,function(t){t.fullWidth=t.options.fullWidth,t.position=t.options.position,t.weight=t.options.weight,ot.addBox(e,t)})}},Tt=z.valueOrDefault,Mt=z.rtl.getRtlAdapter;R._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:z.noop,title:function(e,t){var r="",n=t.labels,a=n?n.length:0;if(e.length>0){var i=e[0];i.label?r=i.label:i.xLabel?r=i.xLabel:a>0&&i.index<a&&(r=n[i.index])}return r},afterTitle:z.noop,beforeBody:z.noop,beforeLabel:z.noop,label:function(e,t){var r=t.datasets[e.datasetIndex].label||"";return r&&(r+=": "),z.isNullOrUndef(e.value)?r+=e.yLabel:r+=e.value,r},labelColor:function(e,t){var r=t.getDatasetMeta(e.datasetIndex).data[e.index]._view;return{borderColor:r.borderColor,backgroundColor:r.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:z.noop,afterBody:z.noop,beforeFooter:z.noop,footer:z.noop,afterFooter:z.noop}}});var Ot={average:function(e){if(!e.length)return!1;var t,r,n=0,a=0,i=0;for(t=0,r=e.length;t<r;++t){var o=e[t];if(o&&o.hasValue()){var s=o.tooltipPosition();n+=s.x,a+=s.y,++i}}return{x:n/i,y:a/i}},nearest:function(e,t){var r,n,a,i=t.x,o=t.y,s=Number.POSITIVE_INFINITY;for(r=0,n=e.length;r<n;++r){var l=e[r];if(l&&l.hasValue()){var u=l.getCenterPoint(),c=z.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 At(e,t){return t&&(z.isArray(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Ct(e){return("string"==typeof e||e instanceof String)&&e.indexOf("\n")>-1?e.split("\n"):e}function Pt(e){var t=e._xScale,r=e._yScale||e._scale,n=e._index,a=e._datasetIndex,i=e._chart.getDatasetMeta(a).controller,o=i._getIndexScale(),s=i._getValueScale();return{xLabel:t?t.getLabelForIndex(n,a):"",yLabel:r?r.getLabelForIndex(n,a):"",label:o?""+o.getLabelForIndex(n,a):"",value:s?""+s.getLabelForIndex(n,a):"",index:n,datasetIndex:a,x:e._model.x,y:e._model.y}}function Dt(e){var t=R.global;return{xPadding:e.xPadding,yPadding:e.yPadding,xAlign:e.xAlign,yAlign:e.yAlign,rtl:e.rtl,textDirection:e.textDirection,bodyFontColor:e.bodyFontColor,_bodyFontFamily:Tt(e.bodyFontFamily,t.defaultFontFamily),_bodyFontStyle:Tt(e.bodyFontStyle,t.defaultFontStyle),_bodyAlign:e.bodyAlign,bodyFontSize:Tt(e.bodyFontSize,t.defaultFontSize),bodySpacing:e.bodySpacing,titleFontColor:e.titleFontColor,_titleFontFamily:Tt(e.titleFontFamily,t.defaultFontFamily),_titleFontStyle:Tt(e.titleFontStyle,t.defaultFontStyle),titleFontSize:Tt(e.titleFontSize,t.defaultFontSize),_titleAlign:e.titleAlign,titleSpacing:e.titleSpacing,titleMarginBottom:e.titleMarginBottom,footerFontColor:e.footerFontColor,_footerFontFamily:Tt(e.footerFontFamily,t.defaultFontFamily),_footerFontStyle:Tt(e.footerFontStyle,t.defaultFontStyle),footerFontSize:Tt(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 Et(e,t){return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-e.xPadding:e.x+e.xPadding}function $t(e){return At([],Ct(e))}var Ft=H.extend({initialize:function(){this._model=Dt(this._options),this._lastActive=[]},getTitle:function(){var e=this,t=e._options.callbacks,r=t.beforeTitle.apply(e,arguments),n=t.title.apply(e,arguments),a=t.afterTitle.apply(e,arguments),i=[];return i=At(i,Ct(r)),i=At(i,Ct(n)),At(i,Ct(a))},getBeforeBody:function(){return $t(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(e,t){var r=this,n=r._options.callbacks,a=[];return z.each(e,function(e){var i={before:[],lines:[],after:[]};At(i.before,Ct(n.beforeLabel.call(r,e,t))),At(i.lines,n.label.call(r,e,t)),At(i.after,Ct(n.afterLabel.call(r,e,t))),a.push(i)}),a},getAfterBody:function(){return $t(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var e=this,t=e._options.callbacks,r=t.beforeFooter.apply(e,arguments),n=t.footer.apply(e,arguments),a=t.afterFooter.apply(e,arguments),i=[];return i=At(i,Ct(r)),i=At(i,Ct(n)),At(i,Ct(a))},update:function(e){var t,r,n=this,a=n._options,i=n._model,o=n._model=Dt(a),s=n._active,l=n._data,u={xAlign:i.xAlign,yAlign:i.yAlign},c={x:i.x,y:i.y},d={width:i.width,height:i.height},h={x:i.caretX,y:i.caretY};if(s.length){o.opacity=1;var f=[],p=[];h=Ot[a.position].call(n,s,n._eventPosition);var g=[];for(t=0,r=s.length;t<r;++t)g.push(Pt(s[t]));a.filter&&(g=g.filter(function(e){return a.filter(e,l)})),a.itemSort&&(g=g.sort(function(e,t){return a.itemSort(e,t,l)})),z.each(g,function(e){f.push(a.callbacks.labelColor.call(n,e,n._chart)),p.push(a.callbacks.labelTextColor.call(n,e,n._chart))}),o.title=n.getTitle(g,l),o.beforeBody=n.getBeforeBody(g,l),o.body=n.getBody(g,l),o.afterBody=n.getAfterBody(g,l),o.footer=n.getFooter(g,l),o.x=h.x,o.y=h.y,o.caretPadding=a.caretPadding,o.labelColors=f,o.labelTextColors=p,o.dataPoints=g,c=function(e,t,r,n){var a=e.x,i=e.y,o=e.caretPadding,s=r.xAlign,l=r.yAlign,u=e.caretSize+o,c=e.cornerRadius+o;return"right"===s?a-=t.width:"center"===s&&((a-=t.width/2)+t.width>n.width&&(a=n.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}}(o,d=function(e,t){var r=e._chart.ctx,n=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;n+=s*u,n+=s?(s-1)*t.titleSpacing:0,n+=s?t.titleMarginBottom:0,n+=(o+=t.beforeBody.length+t.afterBody.length)*c,n+=o?(o-1)*t.bodySpacing:0,n+=l?t.footerMarginTop:0,n+=l*d,n+=l?(l-1)*t.footerSpacing:0;var h=0,f=function(e){a=Math.max(a,r.measureText(e).width+h)};return r.font=z.fontString(u,t._titleFontStyle,t._titleFontFamily),z.each(t.title,f),r.font=z.fontString(c,t._bodyFontStyle,t._bodyFontFamily),z.each(t.beforeBody.concat(t.afterBody),f),h=t.displayColors?c+2:0,z.each(i,function(e){z.each(e.before,f),z.each(e.lines,f),z.each(e.after,f)}),h=0,r.font=z.fontString(d,t._footerFontStyle,t._footerFontFamily),z.each(t.footer,f),{width:a+=2*t.xPadding,height:n}}(this,o),u=function(e,t){var r,n,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?(r=function(e){return e<=h},n=function(e){return e>h}):(r=function(e){return e<=t.width/2},n=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"},r(s.x)?(c="left",a(s.x)&&(c="center",d=o(s.y))):n(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,d),n._chart)}else o.opacity=0;return o.xAlign=u.xAlign,o.yAlign=u.yAlign,o.x=c.x,o.y=c.y,o.width=d.width,o.height=d.height,o.caretX=h.x,o.caretY=h.y,n._model=o,e&&a.custom&&a.custom.call(n,o),n},drawCaret:function(e,t){var r=this._chart.ctx,n=this.getCaretPosition(e,t,this._view);r.lineTo(n.x1,n.y1),r.lineTo(n.x2,n.y2),r.lineTo(n.x3,n.y3)},getCaretPosition:function(e,t,r){var n,a,i,o,s,l,u=r.caretSize,c=r.cornerRadius,d=r.xAlign,h=r.yAlign,f=e.x,p=e.y,g=t.width,m=t.height;if("center"===h)s=p+m/2,"left"===d?(a=(n=f)-u,i=n,o=s+u,l=s-u):(a=(n=f+g)+u,i=n,o=s-u,l=s+u);else if("left"===d?(n=(a=f+c+u)-u,i=a+u):"right"===d?(n=(a=f+g-c-u)-u,i=a+u):(n=(a=r.caretX)-u,i=a+u),"top"===h)s=(o=p)-u,l=o;else{s=(o=p+m)+u,l=o;var y=i;i=n,n=y}return{x1:n,x2:a,x3:i,y1:o,y2:s,y3:l}},drawTitle:function(e,t,r){var n,a,i,o=t.title,s=o.length;if(s){var l=Mt(t.rtl,t.x,t.width);for(e.x=Et(t,t._titleAlign),r.textAlign=l.textAlign(t._titleAlign),r.textBaseline="middle",n=t.titleFontSize,a=t.titleSpacing,r.fillStyle=t.titleFontColor,r.font=z.fontString(n,t._titleFontStyle,t._titleFontFamily),i=0;i<s;++i)r.fillText(o[i],l.x(e.x),e.y+n/2),e.y+=n+a,i+1===s&&(e.y+=t.titleMarginBottom-a)}},drawBody:function(e,t,r){var n,a,i,o,s,l,u,c,d=t.bodyFontSize,h=t.bodySpacing,f=t._bodyAlign,p=t.body,g=t.displayColors,m=0,y=g?Et(t,"left"):0,v=Mt(t.rtl,t.x,t.width),b=function(t){r.fillText(t,v.x(e.x+m),e.y+d/2),e.y+=d+h},x=v.textAlign(f);for(r.textAlign=f,r.textBaseline="middle",r.font=z.fontString(d,t._bodyFontStyle,t._bodyFontFamily),e.x=Et(t,x),r.fillStyle=t.bodyFontColor,z.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(n=p[s],i=t.labelColors[s],r.fillStyle=a=t.labelTextColors[s],z.each(n.before,b),l=0,c=(o=n.lines).length;l<c;++l){if(g){var _=v.x(y);r.fillStyle=t.legendColorBackground,r.fillRect(v.leftForLtr(_,d),e.y,d,d),r.lineWidth=1,r.strokeStyle=i.borderColor,r.strokeRect(v.leftForLtr(_,d),e.y,d,d),r.fillStyle=i.backgroundColor,r.fillRect(v.leftForLtr(v.xPlus(_,1),d-2),e.y+1,d-2,d-2),r.fillStyle=a}b(o[l])}z.each(n.after,b)}m=0,z.each(t.afterBody,b),e.y-=h},drawFooter:function(e,t,r){var n,a,i=t.footer,o=i.length;if(o){var s=Mt(t.rtl,t.x,t.width);for(e.x=Et(t,t._footerAlign),e.y+=t.footerMarginTop,r.textAlign=s.textAlign(t._footerAlign),r.textBaseline="middle",n=t.footerFontSize,r.fillStyle=t.footerFontColor,r.font=z.fontString(n,t._footerFontStyle,t._footerFontFamily),a=0;a<o;++a)r.fillText(i[a],s.x(e.x),e.y+n/2),e.y+=n+t.footerSpacing}},drawBackground:function(e,t,r,n){r.fillStyle=t.backgroundColor,r.strokeStyle=t.borderColor,r.lineWidth=t.borderWidth;var a=t.xAlign,i=t.yAlign,o=e.x,s=e.y,l=n.width,u=n.height,c=t.cornerRadius;r.beginPath(),r.moveTo(o+c,s),"top"===i&&this.drawCaret(e,n),r.lineTo(o+l-c,s),r.quadraticCurveTo(o+l,s,o+l,s+c),"center"===i&&"right"===a&&this.drawCaret(e,n),r.lineTo(o+l,s+u-c),r.quadraticCurveTo(o+l,s+u,o+l-c,s+u),"bottom"===i&&this.drawCaret(e,n),r.lineTo(o+c,s+u),r.quadraticCurveTo(o,s+u,o,s+u-c),"center"===i&&"left"===a&&this.drawCaret(e,n),r.lineTo(o,s+c),r.quadraticCurveTo(o,s,o+c,s),r.closePath(),r.fill(),t.borderWidth>0&&r.stroke()},draw:function(){var e=this._chart.ctx,t=this._view;if(0!==t.opacity){var r={width:t.width,height:t.height},n={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(n,t,e,r),n.y+=t.yPadding,z.rtl.overrideTextDirection(e,t.textDirection),this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),z.rtl.restoreTextDirection(e,t.textDirection),e.restore())}},handleEvent:function(e){var t,r=this,n=r._options;return r._lastActive=r._lastActive||[],"mouseout"===e.type?r._active=[]:(r._active=r._chart.getElementsAtEventForMode(e,n.mode,n),n.reverse&&r._active.reverse()),(t=!z.arrayEquals(r._active,r._lastActive))&&(r._lastActive=r._active,(n.enabled||n.custom)&&(r._eventPosition={x:e.x,y:e.y},r.update(!0),r.pivot())),t}}),It=Ft;It.positioners=Ot;var Rt=z.valueOrDefault;function Nt(){return z.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,r,n){if("xAxes"===e||"yAxes"===e){var a,i,o,s=r[e].length;for(t[e]||(t[e]=[]),a=0;a<s;++a)i=Rt((o=r[e][a]).type,"xAxes"===e?"category":"linear"),a>=t[e].length&&t[e].push({}),z.merge(t[e][a],!t[e][a].type||o.type&&o.type!==t[e][a].type?[St.getScaleDefaults(i),o]:o)}else z._merger(e,t,r,n)}})}function jt(){return z.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,r,n){var a=t[e]||Object.create(null),i=r[e];"scales"===e?t[e]=Nt(a,i):"scale"===e?t[e]=z.merge(a,[St.getScaleDefaults(i.type),i]):z._merger(e,t,r,n)}})}function Lt(e,t,r){var n,a=function(e){return e.id===n};do{n=t+r++}while(z.findIndex(e,a)>=0);return n}function Vt(e){return"top"===e||"bottom"===e}function zt(e,t){return function(r,n){return r[e]===n[e]?r[t]-n[t]:r[e]-n[e]}}R._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 Wt=function(e,t){return this.construct(e,t),this};z.extend(Wt.prototype,{construct:function(e,t){var r=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=jt(R.global,R[e.type],e.options||{}),e}(t);var n=wt.acquireContext(e,t),a=n&&n.canvas,i=a&&a.height,o=a&&a.width;r.id=z.uid(),r.ctx=n,r.canvas=a,r.config=t,r.width=o,r.height=i,r.aspectRatio=i?o/i:null,r.options=t.options,r._bufferedRender=!1,r._layers=[],r.chart=r,r.controller=r,Wt.instances[r.id]=r,Object.defineProperty(r,"data",{get:function(){return r.config.data},set:function(e){r.config.data=e}}),n&&a?(r.initialize(),r.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var e=this;return kt.notify(e,"beforeInit"),z.retinaScale(e,e.options.devicePixelRatio),e.bindEvents(),e.options.responsive&&e.resize(!0),e.initToolTip(),kt.notify(e,"afterInit"),e},clear:function(){return z.canvas.clear(this),this},stop:function(){return Q.cancelAnimation(this),this},resize:function(e){var t=this,r=t.options,n=t.canvas,a=r.maintainAspectRatio&&t.aspectRatio||null,i=Math.max(0,Math.floor(z.getMaximumWidth(n))),o=Math.max(0,Math.floor(a?i/a:z.getMaximumHeight(n)));if((t.width!==i||t.height!==o)&&(n.width=t.width=i,n.height=t.height=o,n.style.width=i+"px",n.style.height=o+"px",z.retinaScale(t,r.devicePixelRatio),!e)){var s={width:i,height:o};kt.notify(t,"resize",[s]),r.onResize&&r.onResize(t,s),t.stop(),t.update({duration:r.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var e=this.options,t=e.scales||{},r=e.scale;z.each(t.xAxes,function(e,r){e.id||(e.id=Lt(t.xAxes,"x-axis-",r))}),z.each(t.yAxes,function(e,r){e.id||(e.id=Lt(t.yAxes,"y-axis-",r))}),r&&(r.id=r.id||"scale")},buildOrUpdateScales:function(){var e=this,t=e.options,r=e.scales||{},n=[],a=Object.keys(r).reduce(function(e,t){return e[t]=!1,e},{});t.scales&&(n=n.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&&n.push({options:t.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),z.each(n,function(t){var n=t.options,i=n.id,o=Rt(n.type,t.dtype);Vt(n.position)!==Vt(t.dposition)&&(n.position=t.dposition),a[i]=!0;var s=null;if(i in r&&r[i].type===o)(s=r[i]).options=n,s.ctx=e.ctx,s.chart=e;else{var l=St.getScaleConstructor(o);if(!l)return;s=new l({id:i,type:o,options:n,ctx:e.ctx,chart:e}),r[s.id]=s}s.mergeTicksOptions(),t.isDefault&&(e.scale=s)}),z.each(a,function(e,t){e||delete r[t]}),e.scales=r,St.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e,t,r=this,n=[],a=r.data.datasets;for(e=0,t=a.length;e<t;e++){var i=a[e],o=r.getDatasetMeta(e),s=i.type||r.config.type;if(o.type&&o.type!==s&&(r.destroyDatasetMeta(e),o=r.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(r,e),n.push(o.controller)}}return n},resetElements:function(){var e=this;z.each(e.data.datasets,function(t,r){e.getDatasetMeta(r).controller.reset()},e)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(e){var t,r,n,a,i=this;if(e&&"object"==typeof e||(e={duration:e,lazy:arguments[1]}),a=(n=i).options,z.each(n.scales,function(e){ot.removeBox(n,e)}),a=jt(R.global,R[n.config.type],a),n.options=n.config.options=a,n.ensureScalesHaveIDs(),n.buildOrUpdateScales(),n.tooltip._options=a.tooltips,n.tooltip.initialize(),kt._invalidate(i),!1!==kt.notify(i,"beforeUpdate")){i.tooltip._data=i.data;var o=i.buildOrUpdateControllers();for(t=0,r=i.data.datasets.length;t<r;t++)i.getDatasetMeta(t).controller.buildOrUpdateElements();i.updateLayout(),i.options.animation&&i.options.animation.duration&&z.each(o,function(e){e.reset()}),i.updateDatasets(),i.tooltip.initialize(),i.lastActive=[],kt.notify(i,"afterUpdate"),i._layers.sort(zt("z","_idx")),i._bufferedRender?i._bufferedRequest={duration:e.duration,easing:e.easing,lazy:e.lazy}:i.render(e)}},updateLayout:function(){var e=this;!1!==kt.notify(e,"beforeLayout")&&(ot.update(this,this.width,this.height),e._layers=[],z.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}),kt.notify(e,"afterScaleUpdate"),kt.notify(e,"afterLayout"))},updateDatasets:function(){var e=this;if(!1!==kt.notify(e,"beforeDatasetsUpdate")){for(var t=0,r=e.data.datasets.length;t<r;++t)e.updateDataset(t);kt.notify(e,"afterDatasetsUpdate")}},updateDataset:function(e){var t=this,r=t.getDatasetMeta(e),n={meta:r,index:e};!1!==kt.notify(t,"beforeDatasetUpdate",[n])&&(r.controller._update(),kt.notify(t,"afterDatasetUpdate",[n]))},render:function(e){var t=this;e&&"object"==typeof e||(e={duration:e,lazy:arguments[1]});var r=t.options.animation,n=Rt(e.duration,r&&r.duration),a=e.lazy;if(!1!==kt.notify(t,"beforeRender")){var i=function(e){kt.notify(t,"afterRender"),z.callback(r&&r.onComplete,[e],t)};if(r&&n){var o=new G({numSteps:n/16.66,easing:e.easing||r.easing,render:function(e,t){var r=t.currentStep,n=r/t.numSteps;e.draw((0,z.easing.effects[t.easing])(n),n,r)},onAnimationProgress:r.onProgress,onAnimationComplete:i});Q.addAnimation(t,o,n,a)}else t.draw(),i(new G({numSteps:0,chart:t}));return t}},draw:function(e){var t,r,n=this;if(n.clear(),z.isNullOrUndef(e)&&(e=1),n.transition(e),!(n.width<=0||n.height<=0)&&!1!==kt.notify(n,"beforeDraw",[e])){for(r=n._layers,t=0;t<r.length&&r[t].z<=0;++t)r[t].draw(n.chartArea);for(n.drawDatasets(e);t<r.length;++t)r[t].draw(n.chartArea);n._drawTooltip(e),kt.notify(n,"afterDraw",[e])}},transition:function(e){for(var t=this,r=0,n=(t.data.datasets||[]).length;r<n;++r)t.isDatasetVisible(r)&&t.getDatasetMeta(r).controller.transition(e);t.tooltip.transition(e)},_getSortedDatasetMetas:function(e){var t,r,n=this,a=[];for(t=0,r=(n.data.datasets||[]).length;t<r;++t)e&&!n.isDatasetVisible(t)||a.push(n.getDatasetMeta(t));return a.sort(zt("order","index")),a},_getSortedVisibleDatasetMetas:function(){return this._getSortedDatasetMetas(!0)},drawDatasets:function(e){var t,r,n=this;if(!1!==kt.notify(n,"beforeDatasetsDraw",[e])){for(r=(t=n._getSortedVisibleDatasetMetas()).length-1;r>=0;--r)n.drawDataset(t[r],e);kt.notify(n,"afterDatasetsDraw",[e])}},drawDataset:function(e,t){var r={meta:e,index:e.index,easingValue:t};!1!==kt.notify(this,"beforeDatasetDraw",[r])&&(e.controller.draw(t),kt.notify(this,"afterDatasetDraw",[r]))},_drawTooltip:function(e){var t=this,r=t.tooltip,n={tooltip:r,easingValue:e};!1!==kt.notify(t,"beforeTooltipDraw",[n])&&(r.draw(),kt.notify(t,"afterTooltipDraw",[n]))},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,r){var n=Ze.modes[t];return"function"==typeof n?n(this,e,r):[]},getDatasetAtEvent:function(e){return Ze.modes.dataset(this,e,{intersect:!0})},getDatasetMeta:function(e){var t=this,r=t.data.datasets[e];r._meta||(r._meta={});var n=r._meta[t.id];return n||(n=r._meta[t.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:r.order||0,index:e}),n},getVisibleDatasetCount:function(){for(var e=0,t=0,r=this.data.datasets.length;t<r;++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,r=this.data.datasets[e],n=r._meta&&r._meta[t];n&&(n.controller.destroy(),delete r._meta[t])},destroy:function(){var e,t,r=this,n=r.canvas;for(r.stop(),e=0,t=r.data.datasets.length;e<t;++e)r.destroyDatasetMeta(e);n&&(r.unbindEvents(),z.canvas.clear(r),wt.releaseContext(r.ctx),r.canvas=null,r.ctx=null),kt.notify(r,"destroy"),delete Wt.instances[r.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={},r=function(){e.eventHandler.apply(e,arguments)};z.each(e.options.events,function(n){wt.addEventListener(e,n,r),t[n]=r}),e.options.responsive&&(r=function(){e.resize()},wt.addEventListener(e,"resize",r),t.resize=r)},unbindEvents:function(){var e=this,t=e._listeners;t&&(delete e._listeners,z.each(t,function(t,r){wt.removeEventListener(e,r,t)}))},updateHoverStyle:function(e,t,r){var n,a,i,o=r?"set":"remove";for(a=0,i=e.length;a<i;++a)(n=e[a])&&this.getDatasetMeta(n._datasetIndex).controller[o+"HoverStyle"](n);"dataset"===t&&this.getDatasetMeta(e[0]._datasetIndex).controller["_"+o+"DatasetHoverStyle"]()},eventHandler:function(e){var t=this,r=t.tooltip;if(!1!==kt.notify(t,"beforeEvent",[e])){t._bufferedRender=!0,t._bufferedRequest=null;var n=t.handleEvent(e);r&&(n=r._start?r.handleEvent(e):n|r.handleEvent(e)),kt.notify(t,"afterEvent",[e]);var a=t._bufferedRequest;return a?t.render(a):n&&!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,r=this,n=r.options||{},a=n.hover;return r.lastActive=r.lastActive||[],r.active="mouseout"===e.type?[]:r.getElementsAtEventForMode(e,a.mode,a),z.callback(n.onHover||n.hover.onHover,[e.native,r.active],r),"mouseup"!==e.type&&"click"!==e.type||n.onClick&&n.onClick.call(r,e.native,r.active),r.lastActive.length&&r.updateHoverStyle(r.lastActive,a.mode,!1),r.active.length&&a.mode&&r.updateHoverStyle(r.active,a.mode,!0),t=!z.arrayEquals(r.active,r.lastActive),r.lastActive=r.active,t}}),Wt.instances={};var Bt=Wt;function Yt(){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||{}}Wt.Controller=Wt,Wt.types={},z.configMerge=jt,z.scaleMerge=Nt,z.extend(Ut.prototype,{formats:Yt,parse:Yt,format:Yt,add:Yt,diff:Yt,startOf:Yt,endOf:Yt,_create:function(e){return e}}),Ut.override=function(e){z.extend(Ut.prototype,e)};var Ht={_date:Ut},qt={formatters:{values:function(e){return z.isArray(e)?e:""+e},linear:function(e,t,r){var n=r.length>3?r[2]-r[1]:r[1]-r[0];Math.abs(n)>1&&e!==Math.floor(e)&&(n=e-Math.floor(e));var a=z.log10(Math.abs(n)),i="";if(0!==e)if(Math.max(Math.abs(r[0]),Math.abs(r[r.length-1]))<1e-4){var o=z.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,r){var n=e/Math.pow(10,Math.floor(z.log10(e)));return 0===e?"0":1===n||2===n||5===n||0===t||t===r.length-1?e.toExponential():""}}},Gt=z.isArray,Qt=z.isNullOrUndef,Zt=z.valueOrDefault,Jt=z.valueAtIndexOrDefault;function Kt(e,t,r){var n,a=e.getTicks().length,i=Math.min(t,a-1),o=e.getPixelForTick(i),s=e._startPixel,l=e._endPixel,u=1e-6;if(!(r&&(n=1===a?Math.max(o-s,l-o):0===t?(e.getPixelForTick(1)-o)/2:(o-e.getPixelForTick(i-1))/2,(o+=i<t?n:-n)<s-u||o>l+u)))return o}function Xt(e){return e.drawTicks?e.tickMarkLength:0}function er(e){var t,r;return e.display?(t=z.options._parseFont(e),r=z.options.toPadding(e.padding),t.lineHeight+r.height):0}function tr(e,t){return z.extend(z.options._parseFont({fontFamily:Zt(t.fontFamily,e.fontFamily),fontSize:Zt(t.fontSize,e.fontSize),fontStyle:Zt(t.fontStyle,e.fontStyle),lineHeight:Zt(t.lineHeight,e.lineHeight)}),{color:z.options.resolve([t.fontColor,e.fontColor,R.global.defaultFontColor])})}function rr(e){var t=tr(e,e.minor);return{minor:t,major:e.major.enabled?tr(e,e.major):t}}function nr(e){var t,r,n,a=[];for(r=0,n=e.length;r<n;++r)void 0!==(t=e[r])._index&&a.push(t);return a}function ar(e,t,r,n){var a,i,o,s,l=Zt(r,0),u=Math.min(Zt(n,e.length),e.length),c=0;for(t=Math.ceil(t),n&&(t=(a=n-r)/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}R._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:qt.formatters.values,minor:{},major:{}}});var ir=H.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(){z.callback(this.options.beforeUpdate,[this])},update:function(e,t,r){var n,a,i,o,s,l=this,u=l.options.ticks,c=u.sampleSize;if(l.beforeUpdate(),l.maxWidth=e,l.maxHeight=t,l.margins=z.extend({left:0,right:0,top:0,bottom:0},r),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=[],n=0,a=l.ticks.length;n<a;++n)o.push({value:l.ticks[n],major:!1});return l._ticks=o,i=l._convertTicksToLabels((s=c<o.length)?function(e,t){for(var r=[],n=e.length/t,a=0,i=e.length;a<i;a+=n)r.push(e[Math.floor(a)]);return r}(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,r=this,n=r.options.ticks.reverse;r.isHorizontal()?(e=r.left,t=r.right):(e=r.top,t=r.bottom,n=!n),r._startPixel=e,r._endPixel=t,r._reversePixels=n,r._length=t-e},afterUpdate:function(){z.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){z.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(){z.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){z.callback(this.options.beforeDataLimits,[this])},determineDataLimits:z.noop,afterDataLimits:function(){z.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){z.callback(this.options.beforeBuildTicks,[this])},buildTicks:z.noop,afterBuildTicks:function(e){var t=this;return Gt(e)&&e.length?z.callback(t.options.afterBuildTicks,[t,e]):(t.ticks=z.callback(t.options.afterBuildTicks,[t,t.ticks])||t.ticks,e)},beforeTickToLabelConversion:function(){z.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(){z.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){z.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var e,t,r,n,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,r=e.highest.height-e.highest.offset,n=Math.min(s.maxWidth,s.chart.width-t),t+6>(a=l.offset?s.maxWidth/c:n/(c-1))&&(a=n/(c-(l.offset?.5:1)),i=s.maxHeight-Xt(l.gridLines)-u.padding-er(l.scaleLabel),o=Math.sqrt(t*t+r*r),f=z.toDegrees(Math.min(Math.asin(Math.min((e.highest.height+6)/a,1)),Math.asin(Math.min(i/o,1))-Math.asin(r/o))),f=Math.max(d,Math.min(h,f))),s.labelRotation=f)},afterCalculateTickRotation:function(){z.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){z.callback(this.options.beforeFit,[this])},fit:function(){var e=this,t=e.minSize={width:0,height:0},r=e.chart,n=e.options,a=n.ticks,i=n.scaleLabel,o=n.gridLines,s=e._isVisible(),l="bottom"===n.position,u=e.isHorizontal();if(u?t.width=e.maxWidth:s&&(t.width=Xt(o)+er(i)),u?s&&(t.height=Xt(o)+er(i)):t.height=e.maxHeight,a.display&&s){var c=rr(a),d=e._getLabelSizes(),h=d.first,f=d.last,p=d.widest,g=d.highest,m=.4*c.minor.lineHeight,y=a.padding;if(u){var v=0!==e.labelRotation,b=z.toRadians(e.labelRotation),x=Math.cos(b),_=Math.sin(b);t.height=Math.min(e.maxHeight,t.height+(_*p.width+x*(g.height-(v?g.offset:0))+(v?0:m))+y);var w,k,S=e.getPixelForTick(0)-e.left,T=e.right-e.getPixelForTick(e.getTicks().length-1);v?(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-T)*e.width/(e.width-T),0)+3}else t.width=Math.min(e.maxWidth,t.width+(a.mirror?0:p.width+y+m)),e.paddingTop=h.height/2,e.paddingBottom=f.height/2}e.handleMargins(),u?(e.width=e._length=r.width-e.margins.left-e.margins.right,e.height=t.height):(e.width=t.width,e.height=e._length=r.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(){z.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(Qt(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,r,n,a=this;for(a.ticks=e.map(function(e){return e.value}),a.beforeTickToLabelConversion(),t=a.convertTicksToLabels(e)||a.ticks,a.afterTickToLabelConversion(),r=0,n=e.length;r<n;++r)e[r].label=t[r];return t},_getLabelSizes:function(){var e=this,t=e._labelSizes;return t||(e._labelSizes=t=function(e,t,r,n){var a,i,o,s,l,u,c,d,h,f,p,g,m,y=r.length,v=[],b=[],x=[],_=0,w=0;for(a=0;a<y;++a){if(s=r[a].label,e.font=u=(l=r[a].major?t.major:t.minor).string,c=n[u]=n[u]||{data:{},gc:[]},d=l.lineHeight,h=f=0,Qt(s)||Gt(s)){if(Gt(s))for(i=0,o=s.length;i<o;++i)Qt(p=s[i])||Gt(p)||(h=z.measureText(e,c.data,c.gc,h,p),f+=d)}else h=z.measureText(e,c.data,c.gc,h,s),f=d;v.push(h),b.push(f),x.push(d/2),_=Math.max(h,_),w=Math.max(f,w)}function k(e){return{width:v[e]||0,height:b[e]||0,offset:x[e]||0}}return function(e,t){z.each(e,function(e){var r,n=e.gc,a=n.length/2;if(a>t){for(r=0;r<a;++r)delete e.data[n[r]];n.splice(0,a)}})}(n,y),g=v.indexOf(_),m=b.indexOf(w),{first:k(0),last:k(y-1),widest:k(g),highest:k(m)}}(e.ctx,rr(e.options.ticks),e.getTicks(),e.longestTextCache),e.longestLabelWidth=t.widest.width),t},_parseValue:function(e){var t,r,n,a;return Gt(e)?(t=+this.getRightValue(e[0]),r=+this.getRightValue(e[1]),n=Math.min(t,r),a=Math.max(t,r)):(t=void 0,r=e=+this.getRightValue(e),n=e,a=e),{min:n,max:a,start:t,end:r}},_getScaleLabel:function(e){var t=this._parseValue(e);return void 0!==t.start?"["+t.start+", "+t.end+"]":+this.getRightValue(e)},getLabelForIndex:z.noop,getPixelForValue:z.noop,getValueForPixel:z.noop,getPixelForTick:function(e){var t=this,r=t.options.offset,n=t._ticks.length,a=1/Math.max(n-(r?0:1),1);return e<0||e>n-1?null:t.getPixelForDecimal(e*a+(r?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,r=e.max;return e.beginAtZero?0:t<0&&r<0?r:t>0&&r>0?t:0},_autoSkip:function(e){var t,r,n,a,i=this,o=i.options.ticks,s=o.maxTicksLimit||i._length/i._tickSize()+1,l=o.major.enabled?function(e){var t,r,n=[];for(t=0,r=e.length;t<r;t++)e[t].major&&n.push(t);return n}(e):[],u=l.length,c=l[0],d=l[u-1];if(u>s)return function(e,t,r){var n,a,i=0,o=t[0];for(r=Math.ceil(r),n=0;n<e.length;n++)a=e[n],n===o?(a._index=n,o=t[++i*r]):delete a.label}(e,l,u/s),nr(e);if(n=function(e,t,r,n){var a,i,o,s,l=function(e){var t,r,n=e.length;if(n<2)return!1;for(r=e[0],t=1;t<n;++t)if(e[t]-e[t-1]!==r)return!1;return r}(e),u=(t.length-1)/n;if(!l)return Math.max(u,1);for(o=0,s=(a=z.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,r=u-1;t<r;t++)ar(e,n,l[t],l[t+1]);return ar(e,n,z.isNullOrUndef(a=u>1?(d-c)/(u-1):null)?0:c-a,c),ar(e,n,d,z.isNullOrUndef(a)?e.length:d+a),nr(e)}return ar(e,n),nr(e)},_tickSize:function(){var e=this,t=e.options.ticks,r=z.toRadians(e.labelRotation),n=Math.abs(Math.cos(r)),a=Math.abs(Math.sin(r)),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*n>s*a?s/n:l/a:l*a<s*n?l/n:s/a},_isVisible:function(){var e,t,r,n=this,a=n.chart,i=n.options.display;if("auto"!==i)return!!i;for(e=0,t=a.data.datasets.length;e<t;++e)if(a.isDatasetVisible(e)&&((r=a.getDatasetMeta(e)).xAxisID===n.id||r.yAxisID===n.id))return!0;return!1},_computeGridLineItems:function(e){var t,r,n,a,i,o,s,l,u,c,d,h,f,p,g,m,y,v=this,b=v.chart,x=v.options,_=x.gridLines,w=x.position,k=_.offsetGridLines,S=v.isHorizontal(),T=v._ticksToDraw,M=T.length+(k?1:0),O=Xt(_),A=[],C=_.drawBorder?Jt(_.lineWidth,0,0):0,P=C/2,D=z._alignPixel,E=function(e){return D(b,e,C)};for("top"===w?(t=E(v.bottom),s=v.bottom-O,u=t-P,d=E(e.top)+P,f=e.bottom):"bottom"===w?(t=E(v.top),d=e.top,f=E(e.bottom)-P,s=t+P,u=v.top+O):"left"===w?(t=E(v.right),o=v.right-O,l=t-P,c=E(e.left)+P,h=e.right):(t=E(v.left),c=e.left,h=E(e.right)-P,o=t+P,l=v.left+O),r=0;r<M;++r)Qt((n=T[r]||{}).label)&&r<T.length||(r===v.zeroLineIndex&&x.offset===k?(p=_.zeroLineWidth,g=_.zeroLineColor,m=_.zeroLineBorderDash||[],y=_.zeroLineBorderDashOffset||0):(p=Jt(_.lineWidth,r,1),g=Jt(_.color,r,"rgba(0,0,0,0.1)"),m=_.borderDash||[],y=_.borderDashOffset||0),void 0!==(a=Kt(v,n._index||r,k))&&(i=D(b,a,p),S?o=l=c=h=i:s=u=d=f=i,A.push({tx1:o,ty1:s,tx2:l,ty2:u,x1:c,y1:d,x2:h,y2:f,width:p,color:g,borderDash:m,borderDashOffset:y})));return A.ticksLength=M,A.borderValue=t,A},_computeLabelItems:function(){var e,t,r,n,a,i,o,s,l,u,c,d,h=this,f=h.options,p=f.ticks,g=f.position,m=p.mirror,y=h.isHorizontal(),v=h._ticksToDraw,b=rr(p),x=p.padding,_=Xt(f.gridLines),w=-z.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=v.length;e<t;++e)Qt(n=(r=v[e]).label)||(s=h.getPixelForTick(r._index||e)+p.labelOffset,u=(l=r.major?b.major:b.minor).lineHeight,c=Gt(n)?n.length:1,y?(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:n,font:l,textOffset:d,textAlign:o}));return k},_drawGrid:function(e){var t=this,r=t.options.gridLines;if(r.display){var n,a,i,o,s,l=t.ctx,u=t.chart,c=z._alignPixel,d=r.drawBorder?Jt(r.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,(n=s.width)&&a&&(l.save(),l.lineWidth=n,l.strokeStyle=a,l.setLineDash&&(l.setLineDash(s.borderDash),l.lineDashOffset=s.borderDashOffset),l.beginPath(),r.drawTicks&&(l.moveTo(s.tx1,s.ty1),l.lineTo(s.tx2,s.ty2)),r.drawOnChartArea&&(l.moveTo(s.x1,s.y1),l.lineTo(s.x2,s.y2)),l.stroke(),l.restore());if(d){var f,p,g,m,y=d,v=Jt(r.lineWidth,h.ticksLength-1,1),b=h.borderValue;t.isHorizontal()?(f=c(u,t.left,y)-y/2,p=c(u,t.right,v)+v/2,g=m=b):(g=c(u,t.top,y)-y/2,m=c(u,t.bottom,v)+v/2,f=p=b),l.lineWidth=d,l.strokeStyle=Jt(r.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,r,n,a,i,o,s,l,u=e.ctx,c=e._labelItems||(e._labelItems=e._computeLabelItems());for(t=0,n=c.length;t<n;++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,Gt(s=i.label))for(r=0,a=s.length;r<a;++r)u.fillText(""+s[r],0,l),l+=o.lineHeight;else u.fillText(s,0,l);u.restore()}}},_drawTitle:function(){var e=this,t=e.ctx,r=e.options,n=r.scaleLabel;if(n.display){var a,i,o=Zt(n.fontColor,R.global.defaultFontColor),s=z.options._parseFont(n),l=z.options.toPadding(n.padding),u=s.lineHeight/2,c=r.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(n.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,r=t.ticks&&t.ticks.z||0,n=t.gridLines&&t.gridLines.z||0;return e._isVisible()&&r!==n&&e.draw===e._draw?[{z:n,draw:function(){e._drawGrid.apply(e,arguments),e._drawTitle.apply(e,arguments)}},{z:r,draw:function(){e._drawLabels.apply(e,arguments)}}]:[{z:r,draw:function(){e.draw.apply(e,arguments)}}]},_getMatchingVisibleMetas:function(e){var t=this,r=t.isHorizontal();return t.chart._getSortedVisibleDatasetMetas().filter(function(n){return(!e||n.type===e)&&(r?n.xAxisID===t.id:n.yAxisID===t.id)})}});ir.prototype._draw=ir.prototype.draw;var or=ir,sr=z.isNullOrUndef,lr=or.extend({determineDataLimits:function(){var e,t=this,r=t._getLabels(),n=t.options.ticks,a=n.min,i=n.max,o=0,s=r.length-1;void 0!==a&&(e=r.indexOf(a))>=0&&(o=e),void 0!==i&&(e=r.indexOf(i))>=0&&(s=e),t.minIndex=o,t.maxIndex=s,t.min=r[o],t.max=r[s]},buildTicks:function(){var e=this,t=e._getLabels(),r=e.minIndex,n=e.maxIndex;e.ticks=0===r&&n===t.length-1?t:t.slice(r,n+1)},getLabelForIndex:function(e,t){var r=this,n=r.chart;return n.getDatasetMeta(t).controller._getValueScaleId()===r.id?r.getRightValue(n.data.datasets[t].data[e]):r._getLabels()[e]},_configure:function(){var e=this,t=e.options.offset,r=e.ticks;or.prototype._configure.call(e),e.isHorizontal()||(e._reversePixels=!e._reversePixels),r&&(e._startValue=e.minIndex-(t?.5:0),e._valueRange=Math.max(r.length-(t?0:1),1))},getPixelForValue:function(e,t,r){var n,a,i,o=this;return sr(t)||sr(r)||(e=o.chart.data.datasets[r].data[t]),sr(e)||(n=o.isHorizontal()?e.x:e.y),(void 0!==n||void 0!==e&&isNaN(t))&&(a=o._getLabels(),e=z.valueOrDefault(n,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,r=Math.round(t._startValue+t.getDecimalForPixel(e)*t._valueRange);return Math.min(Math.max(r,0),t.ticks.length-1)},getBasePixel:function(){return this.bottom}});lr._defaults={position:"bottom"};var ur=z.isNullOrUndef,cr=or.extend({getRightValue:function(e){return"string"==typeof e?+e:or.prototype.getRightValue.call(this,e)},handleTickRangeOptions:function(){var e=this,t=e.options.ticks;if(t.beginAtZero){var r=z.sign(e.min),n=z.sign(e.max);r<0&&n<0?e.max=0:r>0&&n>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,r=t.options.ticks,n=r.stepSize,a=r.maxTicksLimit;return n?e=Math.ceil(t.max/n)-Math.floor(t.min/n)+1:(e=t._computeTickLimit(),a=a||11),a&&(e=Math.min(a,e)),e},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:z.noop,buildTicks:function(){var e=this,t=e.options.ticks,r=e.getTickLimit(),n={maxTicks:r=Math.max(2,r),min:t.min,max:t.max,precision:t.precision,stepSize:z.valueOrDefault(t.fixedStepSize,t.stepSize)},a=e.ticks=function(e,t){var r,n,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=z.niceNum((p-f)/u/l)*l;if(g<1e-14&&ur(c)&&ur(d))return[f,p];(i=Math.ceil(p/g)-Math.floor(f/g))>u&&(g=z.niceNum(i*g/u/l)*l),s||ur(h)?r=Math.pow(10,z._decimalPlaces(g)):(r=Math.pow(10,h),g=Math.ceil(g*r)/r),n=Math.floor(f/g)*g,a=Math.ceil(p/g)*g,s&&(!ur(c)&&z.almostWhole(c/g,g/1e3)&&(n=c),!ur(d)&&z.almostWhole(d/g,g/1e3)&&(a=d)),i=z.almostEquals(i=(a-n)/g,Math.round(i),g/1e3)?Math.round(i):Math.ceil(i),n=Math.round(n*r)/r,a=Math.round(a*r)/r,o.push(ur(c)?n:c);for(var m=1;m<i;++m)o.push(Math.round((n+m*g)*r)/r);return o.push(ur(d)?a:d),o}(n,e);e.handleDirectionalChanges(),e.max=z.max(a),e.min=z.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),or.prototype.convertTicksToLabels.call(e)},_configure:function(){var e,t=this,r=t.getTicks(),n=t.min,a=t.max;or.prototype._configure.call(t),t.options.offset&&r.length&&(n-=e=(a-n)/Math.max(r.length-1,1)/2,a+=e),t._startValue=n,t._endValue=a,t._valueRange=a-n}}),dr={position:"left",ticks:{callback:qt.formatters.linear}};function hr(e,t,r,n){var a,i,o=e.options,s=function(e,t,r){var n=[r.type,void 0===t&&void 0===r.stack?r.index:"",r.stack].join(".");return void 0===e[n]&&(e[n]={pos:[],neg:[]}),e[n]}(t,o.stacked,r),l=s.pos,u=s.neg,c=n.length;for(a=0;a<c;++a)i=e._parseValue(n[a]),isNaN(i.min)||isNaN(i.max)||r.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 fr(e,t,r){var n,a,i=r.length;for(n=0;n<i;++n)a=e._parseValue(r[n]),isNaN(a.min)||isNaN(a.max)||t.data[n].hidden||(e.min=Math.min(e.min,a.min),e.max=Math.max(e.max,a.max))}var pr=cr.extend({determineDataLimits:function(){var e,t,r,n,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)r=o[(t=s[e]).index].data,l?hr(a,u,t,r):fr(a,t,r);z.each(u,function(e){n=e.pos.concat(e.neg),a.min=Math.min(a.min,z.min(n)),a.max=Math.max(a.max,z.max(n))}),a.min=z.isFinite(a.min)&&!isNaN(a.min)?a.min:0,a.max=z.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=z.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])}});pr._defaults=dr;var gr=z.valueOrDefault,mr=z.math.log10,yr={position:"left",ticks:{callback:qt.formatters.logarithmic}};function vr(e,t){return z.isFinite(e)&&e>=0?e:t}var br=or.extend({determineDataLimits:function(){var e,t,r,n,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=(n=u[e].data).length;a<i;a++){var g=f[p];r=o._parseValue(n[a]),isNaN(r.min)||isNaN(r.max)||t.data[a].hidden||r.min<0||r.max<0||(g[a]=g[a]||0,g[a]+=r.max)}}z.each(f,function(e){if(e.length>0){var t=z.min(e),r=z.max(e);o.min=Math.min(o.min,t),o.max=Math.max(o.max,r)}})}else for(e=0;e<u.length;e++)if(t=l.getDatasetMeta(e),l.isDatasetVisible(e)&&d(t))for(a=0,i=(n=u[e].data).length;a<i;a++)r=o._parseValue(n[a]),isNaN(r.min)||isNaN(r.max)||t.data[a].hidden||r.min<0||r.max<0||(o.min=Math.min(r.min,o.min),o.max=Math.max(r.max,o.max),0!==r.min&&(o.minNotZero=Math.min(r.min,o.minNotZero)));o.min=z.isFinite(o.min)?o.min:null,o.max=z.isFinite(o.max)?o.max:null,o.minNotZero=z.isFinite(o.minNotZero)?o.minNotZero:null,this.handleTickRangeOptions()},handleTickRangeOptions:function(){var e=this,t=e.options.ticks;e.min=vr(t.min,e.min),e.max=vr(t.max,e.max),e.min===e.max&&(0!==e.min&&null!==e.min?(e.min=Math.pow(10,Math.floor(mr(e.min))-1),e.max=Math.pow(10,Math.floor(mr(e.max))+1)):(e.min=1,e.max=10)),null===e.min&&(e.min=Math.pow(10,Math.floor(mr(e.max))-1)),null===e.max&&(e.max=0!==e.min?Math.pow(10,Math.floor(mr(e.min))+1):10),null===e.minNotZero&&(e.minNotZero=e.min>0?e.min:e.max<1?Math.pow(10,Math.floor(mr(e.max))):1)},buildTicks:function(){var e=this,t=e.options.ticks,r=!e.isHorizontal(),n={min:vr(t.min),max:vr(t.max)},a=e.ticks=function(e,t){var r,n,a=[],i=gr(e.min,Math.pow(10,Math.floor(mr(t.min)))),o=Math.floor(mr(t.max)),s=Math.ceil(t.max/Math.pow(10,o));0===i?(r=Math.floor(mr(t.minNotZero)),n=Math.floor(t.minNotZero/Math.pow(10,r)),a.push(i),i=n*Math.pow(10,r)):(r=Math.floor(mr(i)),n=Math.floor(i/Math.pow(10,r)));var l=r<0?Math.pow(10,Math.abs(r)):1;do{a.push(i),10===++n&&(n=1,l=++r>=0?1:l),i=Math.round(n*Math.pow(10,r)*l)/l}while(r<o||r===o&&n<s);var u=gr(e.max,i);return a.push(u),a}(n,e);e.max=z.max(a),e.min=z.min(a),t.reverse?(r=!r,e.start=e.max,e.end=e.min):(e.start=e.min,e.end=e.max),r&&a.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),or.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(mr(e));return Math.floor(e/Math.pow(10,t))*Math.pow(10,t)},_configure:function(){var e=this,t=e.min,r=0;or.prototype._configure.call(e),0===t&&(t=e._getFirstTickValue(e.minNotZero),r=gr(e.options.ticks.fontSize,R.global.defaultFontSize)/e._length),e._startValue=mr(t),e._valueOffset=r,e._valueRange=(mr(e.max)-mr(t))/(1-r)},getPixelForValue:function(e){var t=this,r=0;return(e=+t.getRightValue(e))>t.min&&e>0&&(r=(mr(e)-t._startValue)/t._valueRange+t._valueOffset),t.getPixelForDecimal(r)},getValueForPixel:function(e){var t=this,r=t.getDecimalForPixel(e);return 0===r&&0===t.min?0:Math.pow(10,t._startValue+(r-t._valueOffset)*t._valueRange)}});br._defaults=yr;var xr=z.valueOrDefault,_r=z.valueAtIndexOrDefault,wr=z.options.resolve,kr={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:qt.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(e){return e}}};function Sr(e){var t=e.ticks;return t.display&&e.display?xr(t.fontSize,R.global.defaultFontSize)+2*t.backdropPaddingY:0}function Tr(e,t,r){return z.isArray(r)?{w:z.longestText(e,e.font,r),h:r.length*t}:{w:e.measureText(r).width,h:t}}function Mr(e,t,r,n,a){return e===n||e===a?{start:t-r/2,end:t+r/2}:e<n||e>a?{start:t-r,end:t}:{start:t,end:t+r}}function Or(e){return 0===e||180===e?"center":e<180?"left":"right"}function Ar(e,t,r,n){var a,i,o=r.y+n/2;if(z.isArray(t))for(a=0,i=t.length;a<i;++a)e.fillText(t[a],r.x,o),o+=n;else e.fillText(t,r.x,o)}function Cr(e,t,r){90===e||270===e?r.y-=t.h/2:(e>270||e<90)&&(r.y-=t.h)}function Pr(e){return z.isNumber(e)?e:0}var Dr=cr.extend({setDimensions:function(){var e=this;e.width=e.maxWidth,e.height=e.maxHeight,e.paddingTop=Sr(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,r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;z.each(t.data.datasets,function(a,i){if(t.isDatasetVisible(i)){var o=t.getDatasetMeta(i);z.each(a.data,function(t,a){var i=+e.getRightValue(t);isNaN(i)||o.data[a].hidden||(r=Math.min(i,r),n=Math.max(i,n))})}}),e.min=r===Number.POSITIVE_INFINITY?0:r,e.max=n===Number.NEGATIVE_INFINITY?0:n,e.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/Sr(this.options))},convertTicksToLabels:function(){var e=this;cr.prototype.convertTicksToLabels.call(e),e.pointLabels=e.chart.data.labels.map(function(){var t=z.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,r,n,a=z.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=e.chart.data.labels.length;for(t=0;t<s;t++){n=e.getPointPosition(t,e.drawingArea+5),r=Tr(e.ctx,a.lineHeight,e.pointLabels[t]),e._pointLabelSizes[t]=r;var l=e.getIndexAngle(t),u=z.toDegrees(l)%360,c=Mr(u,n.x,r.w,0,180),d=Mr(u,n.y,r.h,90,270);c.start<i.l&&(i.l=c.start,o.l=l),c.end>i.r&&(i.r=c.end,o.r=l),d.start<i.t&&(i.t=d.start,o.t=l),d.end>i.b&&(i.b=d.end,o.b=l)}e.setReductions(e.drawingArea,i,o)}(e):e.setCenterPoint(0,0,0,0)},setReductions:function(e,t,r){var n=this,a=t.l/Math.sin(r.l),i=Math.max(t.r-n.width,0)/Math.sin(r.r),o=-t.t/Math.cos(r.t),s=-Math.max(t.b-(n.height-n.paddingTop),0)/Math.cos(r.b);a=Pr(a),i=Pr(i),o=Pr(o),s=Pr(s),n.drawingArea=Math.min(Math.floor(e-(a+i)/2),Math.floor(e-(o+s)/2)),n.setCenterPoint(a,i,o,s)},setCenterPoint:function(e,t,r,n){var a=this,i=r+a.drawingArea,o=a.height-a.paddingTop-n-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,r=(e*(360/t.data.labels.length)+((t.options||{}).startAngle||0))%360;return(r<0?r+360:r)*Math.PI*2/360},getDistanceFromCenterForValue:function(e){var t=this;if(z.isNullOrUndef(e))return NaN;var r=t.drawingArea/(t.max-t.min);return t.options.ticks.reverse?(t.max-e)*r:(e-t.min)*r},getPointPosition:function(e,t){var r=this,n=r.getIndexAngle(e)-Math.PI/2;return{x:Math.cos(n)*t+r.xCenter,y:Math.sin(n)*t+r.yCenter}},getPointPositionForValue:function(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))},getBasePosition:function(e){var t=this,r=t.min,n=t.max;return t.getPointPositionForValue(e||0,t.beginAtZero?0:r<0&&n<0?n:r>0&&n>0?r:0)},_drawGrid:function(){var e,t,r,n=this,a=n.ctx,i=n.options,o=i.gridLines,s=i.angleLines,l=xr(s.lineWidth,o.lineWidth),u=xr(s.color,o.color);if(i.pointLabels.display&&function(e){var t=e.ctx,r=e.options,n=r.pointLabels,a=Sr(r),i=e.getDistanceFromCenterForValue(r.ticks.reverse?e.min:e.max),o=z.options._parseFont(n);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=_r(n.fontColor,s,R.global.defaultFontColor);t.fillStyle=u;var c=e.getIndexAngle(s),d=z.toDegrees(c);t.textAlign=Or(d),Cr(d,e._pointLabelSizes[s],l),Ar(t,e.pointLabels[s],l,o.lineHeight)}t.restore()}(n),o.display&&z.each(n.ticks,function(e,r){0!==r&&(t=n.getDistanceFromCenterForValue(n.ticksAsNumbers[r]),function(e,t,r,n){var a,i=e.ctx,o=t.circular,s=e.chart.data.labels.length,l=_r(t.color,n-1),u=_r(t.lineWidth,n-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,r,0,2*Math.PI);else{a=e.getPointPosition(0,r),i.moveTo(a.x,a.y);for(var c=1;c<s;c++)a=e.getPointPosition(c,r),i.lineTo(a.x,a.y)}i.closePath(),i.stroke(),i.restore()}}(n,o,t,r))}),s.display&&l&&u){for(a.save(),a.lineWidth=l,a.strokeStyle=u,a.setLineDash&&(a.setLineDash(wr([s.borderDash,o.borderDash,[]])),a.lineDashOffset=wr([s.borderDashOffset,o.borderDashOffset,0])),e=n.chart.data.labels.length-1;e>=0;e--)t=n.getDistanceFromCenterForValue(i.ticks.reverse?n.min:n.max),r=n.getPointPosition(e,t),a.beginPath(),a.moveTo(n.xCenter,n.yCenter),a.lineTo(r.x,r.y),a.stroke();a.restore()}},_drawLabels:function(){var e=this,t=e.ctx,r=e.options.ticks;if(r.display){var n,a,i=e.getIndexAngle(0),o=z.options._parseFont(r),s=xr(r.fontColor,R.global.defaultFontColor);t.save(),t.font=o.string,t.translate(e.xCenter,e.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",z.each(e.ticks,function(i,l){(0!==l||r.reverse)&&(n=e.getDistanceFromCenterForValue(e.ticksAsNumbers[l]),r.showLabelBackdrop&&(a=t.measureText(i).width,t.fillStyle=r.backdropColor,t.fillRect(-a/2-r.backdropPaddingX,-n-o.size/2-r.backdropPaddingY,a+2*r.backdropPaddingX,o.size+2*r.backdropPaddingY)),t.fillStyle=s,t.fillText(i,0,-n))}),t.restore()}},_drawTitle:z.noop});Dr._defaults=kr;var Er=z._deprecated,$r=z.options.resolve,Fr=z.valueOrDefault,Ir=Number.MIN_SAFE_INTEGER||-9007199254740991,Rr=Number.MAX_SAFE_INTEGER||9007199254740991,Nr={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}},jr=Object.keys(Nr);function Lr(e,t){return e-t}function Vr(e){return z.valueOrDefault(e.time.min,e.ticks.min)}function zr(e){return z.valueOrDefault(e.time.max,e.ticks.max)}function Wr(e,t,r,n){var a=function(e,t,r){for(var n,a,i,o=0,s=e.length-1;o>=0&&o<=s;){if(i=e[n=o+s>>1],!(a=e[n-1]||null))return{lo:null,hi:i};if(i[t]<r)o=n+1;else{if(!(a[t]>r))return{lo:a,hi:i};s=n-1}}return{lo:i,hi:null}}(e,t,r),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[n]+(o[n]-i[n])*(s?(r-i[t])/s:0)}function Br(e,t){var r=e._adapter,n=e.options.time,a=n.parser,i=a||n.format,o=t;return"function"==typeof a&&(o=a(o)),z.isFinite(o)||(o="string"==typeof i?r.parse(o,i):r.parse(o)),null!==o?+o:(a||"function"!=typeof i||(o=i(t),z.isFinite(o)||(o=r.parse(o))),o)}function Yr(e,t){if(z.isNullOrUndef(t))return null;var r=e.options.time,n=Br(e,e.getRightValue(t));return null===n||r.round&&(n=+e._adapter.startOf(n,r.round)),n}function Ur(e,t,r,n){var a,i,o=jr.length;for(a=jr.indexOf(e);a<o-1;++a)if((i=Nr[jr[a]]).common&&Math.ceil((r-t)/((i.steps?i.steps:Rr)*i.size))<=n)return jr[a];return jr[o-1]}function Hr(e,t,r){var n,a,i=[],o={},s=t.length;for(n=0;n<s;++n)o[a=t[n]]=n,i.push({value:a,major:!1});return 0!==s&&r?function(e,t,r,n){var a,i,o=e._adapter,s=+o.startOf(t[0].value,n),l=t[t.length-1].value;for(a=s;a<=l;a=+o.add(a,1,n))(i=r[a])>=0&&(t[i].major=!0);return t}(e,i,o,r):i}var qr=or.extend({initialize:function(){this.mergeTicksOptions(),or.prototype.initialize.call(this)},update:function(){var e=this,t=e.options,r=t.time||(t.time={}),n=e._adapter=new Ht._date(t.adapters.date);return Er("time scale",r.format,"time.format","time.parser"),Er("time scale",r.min,"time.min","ticks.min"),Er("time scale",r.max,"time.max","ticks.max"),z.mergeIf(r.displayFormats,n.formats()),or.prototype.update.apply(e,arguments)},getRightValue:function(e){return e&&void 0!==e.t&&(e=e.t),or.prototype.getRightValue.call(this,e)},determineDataLimits:function(){var e,t,r,n,a,i,o,s=this,l=s.chart,u=s._adapter,c=s.options,d=c.time.unit||"day",h=Rr,f=Ir,p=[],g=[],m=[],y=s._getLabels();for(e=0,r=y.length;e<r;++e)m.push(Yr(s,y[e]));for(e=0,r=(l.data.datasets||[]).length;e<r;++e)if(l.isDatasetVisible(e))if(z.isObject((a=l.data.datasets[e].data)[0]))for(g[e]=[],t=0,n=a.length;t<n;++t)i=Yr(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=r>1?function(e){var t,r,n,a={},i=[];for(t=0,r=e.length;t<r;++t)a[n=e[t]]||(a[n]=!0,i.push(n));return i}(p).sort(Lr):p.sort(Lr),h=Math.min(h,p[0]),f=Math.max(f,p[p.length-1])),h=Yr(s,Vr(c))||h,f=Yr(s,zr(c))||f,h=h===Rr?+u.startOf(Date.now(),d):h,f=f===Ir?+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,r,n=this,a=n.min,i=n.max,o=n.options,s=o.ticks,l=o.time,u=n._timestamps,c=[],d=n.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,r,n){var a,i=e._adapter,o=e.options,s=o.time,l=s.unit||Ur(s.minUnit,t,r,n),u=$r([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(r,t,l)>1e5*u)throw t+" and "+r+" are too far apart with stepSize of "+u+" "+l;for(a=d;a<r;a=+i.add(a,u,l))h.push(a);return a!==r&&"ticks"!==o.bounds||h.push(a),h}(n,a,i,d),"ticks"===o.bounds&&u.length&&(a=u[0],i=u[u.length-1]),a=Yr(n,Vr(o))||a,i=Yr(n,zr(o))||i,e=0,t=u.length;e<t;++e)(r=u[e])>=a&&r<=i&&c.push(r);return n.min=a,n.max=i,n._unit=l.unit||(s.autoSkip?Ur(l.minUnit,n.min,n.max,d):function(e,t,r,n,a){var i,o;for(i=jr.length-1;i>=jr.indexOf(r);i--)if(Nr[o=jr[i]].common&&e._adapter.diff(a,n,o)>=t-1)return o;return jr[r?jr.indexOf(r):0]}(n,c.length,l.minUnit,n.min,n.max)),n._majorUnit=s.major.enabled&&"year"!==n._unit?function(e){for(var t=jr.indexOf(e)+1,r=jr.length;t<r;++t)if(Nr[jr[t]].common)return jr[t]}(n._unit):void 0,n._table=function(e,t,r,n){if("linear"===n||!e.length)return[{time:t,pos:0},{time:r,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<r&&c.push(s);for(c.push(r),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}(n._timestamps.data,a,i,f),n._offsets=function(e,t,r,n,a){var i,o,s=0,l=0;return a.offset&&t.length&&(i=Wr(e,"time",t[0],"pos"),s=1===t.length?1-i:(Wr(e,"time",t[1],"pos")-i)/2,o=Wr(e,"time",t[t.length-1],"pos"),l=1===t.length?o:(o-Wr(e,"time",t[t.length-2],"pos"))/2),{start:s,end:l,factor:1/(s+1+l)}}(n._table,c,0,0,o),s.reverse&&c.reverse(),Hr(n,c,n._majorUnit)},getLabelForIndex:function(e,t){var r=this,n=r._adapter,a=r.chart.data,i=r.options.time,o=a.labels&&e<a.labels.length?a.labels[e]:"",s=a.datasets[t].data[e];return z.isObject(s)&&(o=r.getRightValue(s)),i.tooltipFormat?n.format(Br(r,o),i.tooltipFormat):"string"==typeof o?o:n.format(Br(r,o),i.displayFormats.datetime)},tickFormatFunction:function(e,t,r,n){var a=this,i=a.options,o=i.time.displayFormats,s=a._majorUnit,l=o[s],u=r[t],c=i.ticks,d=s&&l&&u&&u.major,h=a._adapter.format(e,n||(d?l:o[a._unit])),f=d?c.major:c.minor,p=$r([f.callback,f.userCallback,c.callback,c.userCallback]);return p?p(h,t,r):h},convertTicksToLabels:function(e){var t,r,n=[];for(t=0,r=e.length;t<r;++t)n.push(this.tickFormatFunction(e[t].value,t,e));return n},getPixelForOffset:function(e){var t=this,r=t._offsets,n=Wr(t._table,"time",e,"pos");return t.getPixelForDecimal((r.start+n)*r.factor)},getPixelForValue:function(e,t,r){var n=this,a=null;if(void 0!==t&&void 0!==r&&(a=n._timestamps.datasets[r][t]),null===a&&(a=Yr(n,e)),null!==a)return n.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,r=t._offsets,n=t.getDecimalForPixel(e)/r.factor-r.end,a=Wr(t._table,"pos",n,"time");return t._adapter._create(a)},_getLabelSize:function(e){var t=this,r=t.options.ticks,n=t.ctx.measureText(e).width,a=z.toRadians(t.isHorizontal()?r.maxRotation:r.minRotation),i=Math.cos(a),o=Math.sin(a),s=Fr(r.fontSize,R.global.defaultFontSize);return{w:n*i+s*o,h:n*o+s*i}},getLabelWidth:function(e){return this._getLabelSize(e).w},getLabelCapacity:function(e){var t=this,r=t.options.time,n=r.displayFormats,a=n[r.unit]||n.millisecond,i=t.tickFormatFunction(e,0,Hr(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}});qr._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 Gr={category:lr,linear:pr,logarithmic:br,radialLinear:Dr,time:qr},Qr={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 Qr},parse:function(t,r){return"string"==typeof t&&"string"==typeof r?t=e(t,r):t instanceof e||(t=e(t)),t.isValid()?t.valueOf():null},format:function(t,r){return e(t).format(r)},add:function(t,r,n){return e(t).add(r,n).valueOf()},diff:function(t,r,n){return e(t).diff(e(r),n)},startOf:function(t,r,n){return t=e(t),"isoWeek"===r?t.isoWeekday(n).valueOf():t.startOf(r).valueOf()},endOf:function(t,r){return e(t).endOf(r).valueOf()},_create:function(t){return e(t)}}:{}),R._set("global",{plugins:{filler:{propagate:!0}}});var Zr={dataset:function(e){var t=e.fill,r=e.chart,n=r.getDatasetMeta(t),a=n&&r.isDatasetVisible(t)&&n.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,r=t?t.x:null,n=t?t.y:null;return z.isArray(t)?function(e,r){return t[r]}:function(e){return{x:null===r?e.x:r,y:null===n?e.y:n}}}};function Jr(e,t,r){var n,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(n=parseFloat(i,10),isFinite(n)&&Math.floor(n)===n)return"-"!==i[0]&&"+"!==i[0]||(n=t+n),!(n===t||n<0||n>=r)&&n;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 Kr(e){return(e.el._scale||{}).getPointPositionForValue?function(e){var t,r,n,a,i,o=e.el._scale,s=o.options,l=o.chart.data.labels.length,u=e.fill,c=[];if(!l)return null;for(r=s.ticks.reverse?o.min:o.max,n=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:r):o.getBasePosition(a),s.gridLines.circular&&(i.cx=n.x,i.cy=n.y,i.angle=o.getIndexAngle(a)-Math.PI/2),c.push(i);return c}(e):function(e){var t,r=e.el._model||{},n=e.el._scale||{},a=e.fill,i=null;if(isFinite(a))return null;if("start"===a?i=void 0===r.scaleBottom?n.bottom:r.scaleBottom:"end"===a?i=void 0===r.scaleTop?n.top:r.scaleTop:void 0!==r.scaleZero?i=r.scaleZero:n.getBasePixel&&(i=n.getBasePixel()),null!=i){if(void 0!==i.x&&void 0!==i.y)return i;if(z.isFinite(i))return{x:(t=n.isHorizontal())?i:null,y:t?null:i}}return null}(e)}function Xr(e,t,r){var n,a=e[t].fill,i=[t];if(!r)return a;for(;!1!==a&&-1===i.indexOf(a);){if(!isFinite(a))return a;if(!(n=e[a]))return!1;if(n.visible)return a;i.push(a),a=n.fill}return!1}function en(e){var t=e.fill,r="dataset";return!1===t?null:(isFinite(t)||(r="boundary"),Zr[r](e))}function tn(e){return e&&!e.skip}function rn(e,t,r,n,a){var i,o,s,l;if(n&&a){for(e.moveTo(t[0].x,t[0].y),i=1;i<n;++i)z.canvas.lineTo(e,t[i-1],t[i]);if(void 0===r[0].angle)for(e.lineTo(r[a-1].x,r[a-1].y),i=a-1;i>0;--i)z.canvas.lineTo(e,r[i],r[i-1],!0);else for(o=r[0].cx,s=r[0].cy,l=Math.sqrt(Math.pow(r[0].x-o,2)+Math.pow(r[0].y-s,2)),i=a-1;i>0;--i)e.arc(o,s,l,r[i].angle,r[i-1].angle,!0)}}function nn(e,t,r,n,a,i){var o,s,l,u,c,d,h,f,p=t.length,g=n.spanGaps,m=[],y=[],v=0,b=0;for(e.beginPath(),o=0,s=p;o<s;++o)c=r(u=t[l=o%p]._view,l,n),d=tn(u),h=tn(c),i&&void 0===f&&d&&(s=p+(f=o+1)),d&&h?(v=m.push(u),b=y.push(c)):v&&b&&(g?(d&&m.push(u),h&&y.push(c)):(rn(e,m,y,v,b),v=b=0,m=[],y=[]));rn(e,m,y,v,b),e.closePath(),e.fillStyle=a,e.fill()}var an={id:"filler",afterDatasetsUpdate:function(e,t){var r,n,a,i,o=(e.data.datasets||[]).length,s=t.propagate,l=[];for(n=0;n<o;++n)i=null,(a=(r=e.getDatasetMeta(n)).dataset)&&a._model&&a instanceof ye.Line&&(i={visible:e.isDatasetVisible(n),fill:Jr(a,n,o),chart:e,el:a}),r.$filler=i,l.push(i);for(n=0;n<o;++n)(i=l[n])&&(i.fill=Xr(l,n,s),i.boundary=Kr(i),i.mapper=en(i))},beforeDatasetsDraw:function(e){var t,r,n,a,i,o,s,l=e._getSortedVisibleDatasetMetas(),u=e.ctx;for(r=l.length-1;r>=0;--r)(t=l[r].$filler)&&t.visible&&(i=(n=t.el)._children||[],s=(a=n._view).backgroundColor||R.global.defaultColor,(o=t.mapper)&&s&&i.length&&(z.canvas.clipArea(u,e.chartArea),nn(u,i,o,a,s,n._loop),z.canvas.unclipArea(u)))}},on=z.rtl.getRtlAdapter,sn=z.noop,ln=z.valueOrDefault;function un(e,t){return e.usePointStyle&&e.boxWidth>t?t:e.boxWidth}R._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(e,t){var r=t.datasetIndex,n=this.chart,a=n.getDatasetMeta(r);a.hidden=null===a.hidden?!n.data.datasets[r].hidden:null,n.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(e){var t=e.data.datasets,r=e.options.legend||{},n=r.labels&&r.labels.usePointStyle;return e._getSortedDatasetMetas().map(function(r){var a=r.controller.getStyle(n?0:void 0);return{text:t[r.index].label,fillStyle:a.backgroundColor,hidden:!e.isDatasetVisible(r.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:r.index}},this)}}},legendCallback:function(e){var t,r,n,a=document.createElement("ul"),i=e.data.datasets;for(a.setAttribute("class",e.id+"-legend"),t=0,r=i.length;t<r;t++)(n=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=i[t].backgroundColor,i[t].label&&n.appendChild(document.createTextNode(i[t].label));return a.outerHTML}});var cn=H.extend({initialize:function(e){var t=this;z.extend(t,e),t.legendHitBoxes=[],t._hoveredItem=null,t.doughnutMode=!1},beforeUpdate:sn,update:function(e,t,r){var n=this;return n.beforeUpdate(),n.maxWidth=e,n.maxHeight=t,n.margins=r,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n.beforeBuildLabels(),n.buildLabels(),n.afterBuildLabels(),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate(),n.minSize},afterUpdate:sn,beforeSetDimensions:sn,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:sn,beforeBuildLabels:sn,buildLabels:function(){var e=this,t=e.options.labels||{},r=z.callback(t.generateLabels,[e.chart],e)||[];t.filter&&(r=r.filter(function(r){return t.filter(r,e.chart.data)})),e.options.reverse&&r.reverse(),e.legendItems=r},afterBuildLabels:sn,beforeFit:sn,fit:function(){var e=this,t=e.options,r=t.labels,n=t.display,a=e.ctx,i=z.options._parseFont(r),o=i.size,s=e.legendHitBoxes=[],l=e.minSize,u=e.isHorizontal();if(u?(l.width=e.maxWidth,l.height=n?10:0):(l.width=n?10:0,l.height=e.maxHeight),n){if(a.font=i.string,u){var c=e.lineWidths=[0],d=0;a.textAlign="left",a.textBaseline="middle",z.each(e.legendItems,function(e,t){var n=un(r,o)+o/2+a.measureText(e.text).width;(0===t||c[c.length-1]+n+2*r.padding>l.width)&&(d+=o+r.padding,c[c.length-(t>0?0:1)]=0),s[t]={left:0,top:0,width:n,height:o},c[c.length-1]+=n+r.padding}),l.height+=d}else{var h=r.padding,f=e.columnWidths=[],p=e.columnHeights=[],g=r.padding,m=0,y=0;z.each(e.legendItems,function(e,t){var n=un(r,o)+o/2+a.measureText(e.text).width;t>0&&y+o+2*h>l.height&&(g+=m+r.padding,f.push(m),p.push(y),m=0,y=0),m=Math.max(m,n),y+=o+h,s[t]={left:0,top:0,width:n,height:o}}),g+=m,f.push(m),p.push(y),l.width+=g}e.width=l.width,e.height=l.height}else e.width=l.width=e.height=l.height=0},afterFit:sn,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var e=this,t=e.options,r=t.labels,n=R.global,a=n.defaultColor,i=n.elements.line,o=e.height,s=e.columnHeights,l=e.width,u=e.lineWidths;if(t.display){var c,d=on(t.rtl,e.left,e.minSize.width),h=e.ctx,f=ln(r.fontColor,n.defaultFontColor),p=z.options._parseFont(r),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=un(r,g),y=e.legendHitBoxes,v=function(e,n){switch(t.align){case"start":return r.padding;case"end":return e-n;default:return(e-n+r.padding)/2}},b=e.isHorizontal();c=b?{x:e.left+v(l,u[0]),y:e.top+r.padding,line:0}:{x:e.left+r.padding,y:e.top+v(o,s[0]),line:0},z.rtl.overrideTextDirection(e.ctx,t.textDirection);var x=g+r.padding;z.each(e.legendItems,function(t,n){var f=h.measureText(t.text).width,p=m+g/2+f,_=c.x,w=c.y;d.setWidth(e.minSize.width),b?n>0&&_+p+r.padding>e.left+e.minSize.width&&(w=c.y+=x,c.line++,_=c.x=e.left+v(l,u[c.line])):n>0&&w+x>e.top+e.minSize.height&&(_=c.x=_+e.columnWidths[c.line]+r.padding,c.line++,w=c.y=e.top+v(o,s[c.line]));var k=d.x(_);(function(e,t,n){if(!(isNaN(m)||m<=0)){h.save();var o=ln(n.lineWidth,i.borderWidth);if(h.fillStyle=ln(n.fillStyle,a),h.lineCap=ln(n.lineCap,i.borderCapStyle),h.lineDashOffset=ln(n.lineDashOffset,i.borderDashOffset),h.lineJoin=ln(n.lineJoin,i.borderJoinStyle),h.lineWidth=o,h.strokeStyle=ln(n.strokeStyle,a),h.setLineDash&&h.setLineDash(ln(n.lineDash,i.borderDash)),r&&r.usePointStyle){var s=m*Math.SQRT2/2,l=d.xPlus(e,m/2);z.canvas.drawPoint(h,n.pointStyle,s,l,t+g/2,n.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),y[n].left=d.leftForLtr(k,y[n].width),y[n].top=w,function(e,t,r,n){var a=g/2,i=d.xPlus(e,m+a),o=t+a;h.fillText(r.text,i,o),r.hidden&&(h.beginPath(),h.lineWidth=2,h.moveTo(i,o),h.lineTo(d.xPlus(i,n),o),h.stroke())}(k,w,t,f),b?c.x+=p+r.padding:c.y+=x}),z.rtl.restoreTextDirection(e.ctx,t.textDirection)}},_getLegendItemAt:function(e,t){var r,n,a,i=this;if(e>=i.left&&e<=i.right&&t>=i.top&&t<=i.bottom)for(a=i.legendHitBoxes,r=0;r<a.length;++r)if(e>=(n=a[r]).left&&e<=n.left+n.width&&t>=n.top&&t<=n.top+n.height)return i.legendItems[r];return null},handleEvent:function(e){var t,r=this,n=r.options,a="mouseup"===e.type?"click":e.type;if("mousemove"===a){if(!n.onHover&&!n.onLeave)return}else{if("click"!==a)return;if(!n.onClick)return}t=r._getLegendItemAt(e.x,e.y),"click"===a?t&&n.onClick&&n.onClick.call(r,e.native,t):(n.onLeave&&t!==r._hoveredItem&&(r._hoveredItem&&n.onLeave.call(r,e.native,r._hoveredItem),r._hoveredItem=t),n.onHover&&t&&n.onHover.call(r,e.native,t))}});function dn(e,t){var r=new cn({ctx:e.ctx,options:t,chart:e});ot.configure(e,r,t),ot.addBox(e,r),e.legend=r}var hn={id:"legend",_element:cn,beforeInit:function(e){var t=e.options.legend;t&&dn(e,t)},beforeUpdate:function(e){var t=e.options.legend,r=e.legend;t?(z.mergeIf(t,R.global.legend),r?(ot.configure(e,r,t),r.options=t):dn(e,t)):r&&(ot.removeBox(e,r),delete e.legend)},afterEvent:function(e,t){var r=e.legend;r&&r.handleEvent(t)}},fn=z.noop;R._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var pn=H.extend({initialize:function(e){z.extend(this,e),this.legendHitBoxes=[]},beforeUpdate:fn,update:function(e,t,r){var n=this;return n.beforeUpdate(),n.maxWidth=e,n.maxHeight=t,n.margins=r,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n.beforeBuildLabels(),n.buildLabels(),n.afterBuildLabels(),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate(),n.minSize},afterUpdate:fn,beforeSetDimensions:fn,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:fn,beforeBuildLabels:fn,buildLabels:fn,afterBuildLabels:fn,beforeFit:fn,fit:function(){var e,t=this,r=t.options,n=t.minSize={},a=t.isHorizontal();r.display?(e=(z.isArray(r.text)?r.text.length:1)*z.options._parseFont(r).lineHeight+2*r.padding,t.width=n.width=a?t.maxWidth:e,t.height=n.height=a?e:t.maxHeight):t.width=n.width=t.height=n.height=0},afterFit:fn,isHorizontal:function(){var e=this.options.position;return"top"===e||"bottom"===e},draw:function(){var e=this,t=e.ctx,r=e.options;if(r.display){var n,a,i,o=z.options._parseFont(r),s=o.lineHeight,l=s/2+r.padding,u=0,c=e.top,d=e.left,h=e.bottom,f=e.right;t.fillStyle=z.valueOrDefault(r.fontColor,R.global.defaultFontColor),t.font=o.string,e.isHorizontal()?(a=d+(f-d)/2,i=c+l,n=f-d):(a="left"===r.position?d+l:f-l,i=c+(h-c)/2,n=h-c,u=Math.PI*("left"===r.position?-.5:.5)),t.save(),t.translate(a,i),t.rotate(u),t.textAlign="center",t.textBaseline="middle";var p=r.text;if(z.isArray(p))for(var g=0,m=0;m<p.length;++m)t.fillText(p[m],0,g,n),g+=s;else t.fillText(p,0,0,n);t.restore()}}});function gn(e,t){var r=new pn({ctx:e.ctx,options:t,chart:e});ot.configure(e,r,t),ot.addBox(e,r),e.titleBlock=r}var mn={},yn=an,vn=hn,bn={id:"title",_element:pn,beforeInit:function(e){var t=e.options.title;t&&gn(e,t)},beforeUpdate:function(e){var t=e.options.title,r=e.titleBlock;t?(z.mergeIf(t,R.global.title),r?(ot.configure(e,r,t),r.options=t):gn(e,t)):r&&(ot.removeBox(e,r),delete e.titleBlock)}};for(var xn in mn.filler=yn,mn.legend=vn,mn.title=bn,Bt.helpers=z,function(){function e(e,t,r){var n;return"string"==typeof e?(n=parseInt(e,10),-1!==e.indexOf("%")&&(n=n/100*t.parentNode[r])):n=e,n}function t(e){return null!=e&&"none"!==e}function r(r,n,a){var i=document.defaultView,o=z._getParentNode(r),s=i.getComputedStyle(r)[n],l=i.getComputedStyle(o)[n],u=t(s),c=t(l),d=Number.POSITIVE_INFINITY;return u||c?Math.min(u?e(s,r,a):d,c?e(l,o,a):d):"none"}z.where=function(e,t){if(z.isArray(e)&&Array.prototype.filter)return e.filter(t);var r=[];return z.each(e,function(e){t(e)&&r.push(e)}),r},z.findIndex=Array.prototype.findIndex?function(e,t,r){return e.findIndex(t,r)}:function(e,t,r){r=void 0===r?e:r;for(var n=0,a=e.length;n<a;++n)if(t.call(r,e[n],n,e))return n;return-1},z.findNextWhere=function(e,t,r){z.isNullOrUndef(r)&&(r=-1);for(var n=r+1;n<e.length;n++){var a=e[n];if(t(a))return a}},z.findPreviousWhere=function(e,t,r){z.isNullOrUndef(r)&&(r=e.length);for(var n=r-1;n>=0;n--){var a=e[n];if(t(a))return a}},z.isNumber=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},z.almostEquals=function(e,t,r){return Math.abs(e-t)<r},z.almostWhole=function(e,t){var r=Math.round(e);return r-t<=e&&r+t>=e},z.max=function(e){return e.reduce(function(e,t){return isNaN(t)?e:Math.max(e,t)},Number.NEGATIVE_INFINITY)},z.min=function(e){return e.reduce(function(e,t){return isNaN(t)?e:Math.min(e,t)},Number.POSITIVE_INFINITY)},z.sign=Math.sign?function(e){return Math.sign(e)}:function(e){return 0===(e=+e)||isNaN(e)?e:e>0?1:-1},z.toRadians=function(e){return e*(Math.PI/180)},z.toDegrees=function(e){return e*(180/Math.PI)},z._decimalPlaces=function(e){if(z.isFinite(e)){for(var t=1,r=0;Math.round(e*t)/t!==e;)t*=10,r++;return r}},z.getAngleFromPoint=function(e,t){var r=t.x-e.x,n=t.y-e.y,a=Math.sqrt(r*r+n*n),i=Math.atan2(n,r);return i<-.5*Math.PI&&(i+=2*Math.PI),{angle:i,distance:a}},z.distanceBetweenPoints=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},z.aliasPixel=function(e){return e%2==0?0:.5},z._alignPixel=function(e,t,r){var n=e.currentDevicePixelRatio,a=r/2;return Math.round((t-a)*n)/n+a},z.splineCurve=function(e,t,r,n){var a=e.skip?t:e,i=t,o=r.skip?t:r,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=n*(u=isNaN(u)?0:u),h=n*(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)}}},z.EPSILON=Number.EPSILON||1e-14,z.splineCurveMonotone=function(e){var t,r,n,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(!(n=c[t]).model.skip){if(r=t>0?c[t-1]:null,(a=t<d-1?c[t+1]:null)&&!a.model.skip){var h=a.model.x-n.model.x;n.deltaK=0!==h?(a.model.y-n.model.y)/h:0}n.mK=!r||r.model.skip?n.deltaK:!a||a.model.skip?r.deltaK:this.sign(r.deltaK)!==this.sign(n.deltaK)?0:(r.deltaK+n.deltaK)/2}for(t=0;t<d-1;++t)a=c[t+1],(n=c[t]).model.skip||a.model.skip||(z.almostEquals(n.deltaK,0,this.EPSILON)?n.mK=a.mK=0:(i=n.mK/n.deltaK,o=a.mK/n.deltaK,(l=Math.pow(i,2)+Math.pow(o,2))<=9||(s=3/Math.sqrt(l),n.mK=i*s*n.deltaK,a.mK=o*s*n.deltaK)));for(t=0;t<d;++t)(n=c[t]).model.skip||(a=t<d-1?c[t+1]:null,(r=t>0?c[t-1]:null)&&!r.model.skip&&(n.model.controlPointPreviousX=n.model.x-(u=(n.model.x-r.model.x)/3),n.model.controlPointPreviousY=n.model.y-u*n.mK),a&&!a.model.skip&&(n.model.controlPointNextX=n.model.x+(u=(a.model.x-n.model.x)/3),n.model.controlPointNextY=n.model.y+u*n.mK))},z.nextItem=function(e,t,r){return r?t>=e.length-1?e[0]:e[t+1]:t>=e.length-1?e[e.length-1]:e[t+1]},z.previousItem=function(e,t,r){return r?t<=0?e[e.length-1]:e[t-1]:t<=0?e[0]:e[t-1]},z.niceNum=function(e,t){var r=Math.floor(z.log10(e)),n=e/Math.pow(10,r);return(t?n<1.5?1:n<3?2:n<7?5:10:n<=1?1:n<=2?2:n<=5?5:10)*Math.pow(10,r)},z.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)},z.getRelativePosition=function(e,t){var r,n,a=e.originalEvent||e,i=e.target||e.srcElement,o=i.getBoundingClientRect(),s=a.touches;s&&s.length>0?(r=s[0].clientX,n=s[0].clientY):(r=a.clientX,n=a.clientY);var l=parseFloat(z.getStyle(i,"padding-left")),u=parseFloat(z.getStyle(i,"padding-top")),c=parseFloat(z.getStyle(i,"padding-right")),d=parseFloat(z.getStyle(i,"padding-bottom")),h=o.bottom-o.top-u-d;return{x:r=Math.round((r-o.left-l)/(o.right-o.left-l-c)*i.width/t.currentDevicePixelRatio),y:n=Math.round((n-o.top-u)/h*i.height/t.currentDevicePixelRatio)}},z.getConstraintWidth=function(e){return r(e,"max-width","clientWidth")},z.getConstraintHeight=function(e){return r(e,"max-height","clientHeight")},z._calculatePadding=function(e,t,r){return(t=z.getStyle(e,t)).indexOf("%")>-1?r*parseInt(t,10)/100:parseInt(t,10)},z._getParentNode=function(e){var t=e.parentNode;return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t},z.getMaximumWidth=function(e){var t=z._getParentNode(e);if(!t)return e.clientWidth;var r=t.clientWidth,n=r-z._calculatePadding(t,"padding-left",r)-z._calculatePadding(t,"padding-right",r),a=z.getConstraintWidth(e);return isNaN(a)?n:Math.min(n,a)},z.getMaximumHeight=function(e){var t=z._getParentNode(e);if(!t)return e.clientHeight;var r=t.clientHeight,n=r-z._calculatePadding(t,"padding-top",r)-z._calculatePadding(t,"padding-bottom",r),a=z.getConstraintHeight(e);return isNaN(a)?n:Math.min(n,a)},z.getStyle=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,null).getPropertyValue(t)},z.retinaScale=function(e,t){var r=e.currentDevicePixelRatio=t||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==r){var n=e.canvas,a=e.height,i=e.width;n.height=a*r,n.width=i*r,e.ctx.scale(r,r),n.style.height||n.style.width||(n.style.height=a+"px",n.style.width=i+"px")}},z.fontString=function(e,t,r){return t+" "+e+"px "+r},z.longestText=function(e,t,r,n){var a=(n=n||{}).data=n.data||{},i=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(a=n.data={},i=n.garbageCollect=[],n.font=t),e.font=t;var o,s,l,u,c,d=0,h=r.length;for(o=0;o<h;o++)if(null!=(u=r[o])&&!0!==z.isArray(u))d=z.measureText(e,a,i,d,u);else if(z.isArray(u))for(s=0,l=u.length;s<l;s++)null==(c=u[s])||z.isArray(c)||(d=z.measureText(e,a,i,d,c));var f=i.length/2;if(f>r.length){for(o=0;o<f;o++)delete a[i[o]];i.splice(0,f)}return d},z.measureText=function(e,t,r,n,a){var i=t[a];return i||(i=t[a]=e.measureText(a).width,r.push(a)),i>n&&(n=i),n},z.numberOfLabelLines=function(e){var t=1;return z.each(e,function(e){z.isArray(e)&&e.length>t&&(t=e.length)}),t},z.color=x?function(e){return e instanceof CanvasGradient&&(e=R.global.defaultColor),x(e)}:function(e){return console.error("Color.js not found!"),e},z.getHoverColor=function(e){return e instanceof CanvasPattern||e instanceof CanvasGradient?e:z.color(e).saturate(.5).darken(.1).rgbString()}}(),Bt._adapters=Ht,Bt.Animation=G,Bt.animationService=Q,Bt.controllers=Be,Bt.DatasetController=ee,Bt.defaults=R,Bt.Element=H,Bt.elements=ye,Bt.Interaction=Ze,Bt.layouts=ot,Bt.platform=wt,Bt.plugins=kt,Bt.Scale=or,Bt.scaleService=St,Bt.Ticks=qt,Bt.Tooltip=It,Bt.helpers.each(Gr,function(e,t){Bt.scaleService.registerScaleType(t,e,e._defaults)}),mn)mn.hasOwnProperty(xn)&&Bt.plugins.register(mn[xn]);Bt.platform.initialize();var _n=Bt;return"undefined"!=typeof window&&(window.Chart=Bt),Bt.Chart=Bt,Bt.Legend=mn.legend._element,Bt.Title=mn.title._element,Bt.pluginService=Bt.plugins,Bt.PluginBase=Bt.Element.extend({}),Bt.canvasHelpers=Bt.helpers.canvas,Bt.layoutService=Bt.layouts,Bt.LinearScaleBase=cr,Bt.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],function(e){Bt[e]=function(t,r){return new Bt(t,Bt.helpers.merge(r||{},{type:e.charAt(0).toLowerCase()+e.slice(1)}))}}),_n}(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 r=e.options;r&&t&&Object.assign(r,t)}function setLabels(e,t){e.labels=t}function setDatasets(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:defaultDatasetIdKey;const n=[];e.datasets=t.map(t=>{const a=e.datasets.find(e=>e[r]===t[r]);return a&&t.data&&!n.includes(a)?(n.push(a),Object.assign(a,t),a):{...t}})}function cloneData(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:defaultDatasetIdKey;const r={labels:[],datasets:[]};return setLabels(r,e.labels),setDatasets(r,e.datasets,t),r}function ChartComponent(e,t){const{height:r=150,width:n=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(null),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",{ref:f,role:"img",height:r,width:n,...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:{}},r=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}},n=r,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 r=0,n=e.length;r<n;r++)t.call(null,e[r],r,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 r(r,n){t[n]=u(t[n])&&u(r)?e(t[n],r):u(r)?e({},r):i(r)?r.slice():r}for(var n=0,a=arguments.length;n<a;n++)d(arguments[n],r);return t},extend:function(e,t,r){return d(t,function(t,a){e[a]=r&&"function"==typeof t?n(t,r):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,r){if(!t)return e;var n;if(r)n=r(t);else if(f.isURLSearchParams(t))n=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))}))}),n=a.join("&")}if(n){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e},m=h;function y(){this.handlers=[]}y.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},y.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},y.prototype.forEach=function(e){m.forEach(this.handlers,function(t){null!==t&&e(t)})};var v=y,b=h,x=function(e,t,r,n,a){return e.config=t,r&&(e.code=r),e.request=n,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,r,n,a){var i=new Error(e);return w(i,t,r,n,a)},S=k,T=h,M=T.isStandardBrowserEnv()?{write:function(e,t,r,n,a,i){var o=[];o.push(e+"="+encodeURIComponent(t)),T.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),T.isString(n)&&o.push("path="+n),T.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(){}},O=h,A=["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,P=C.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=n(window.location.href),function(t){var r=C.isString(t)?n(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0};function D(e){this.message=e}D.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},D.prototype.__CANCEL__=!0;var E=D,$=h,F=M,I=g,R=P,N=k,j=_,L=E,V=h,z=function(e,t){b.forEach(e,function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])})},W=x,B={"Content-Type":"application/x-www-form-urlencoded"};function Y(e,t){!V.isUndefined(e)&&V.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var U,H={transitional:_,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(U=function(e){return new Promise(function(t,r){var n,a=e.data,i=e.headers,o=e.responseType;function s(){e.cancelToken&&e.cancelToken.unsubscribe(n),e.signal&&e.signal.removeEventListener("abort",n)}$.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 n="getAllResponseHeaders"in l?function(e){var t,r,n,a={};return e?(O.forEach(e.split("\n"),function(e){if(n=e.indexOf(":"),t=O.trim(e.substr(0,n)).toLowerCase(),r=O.trim(e.substr(n+1)),t){if(a[t]&&A.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([r]):a[t]?a[t]+", "+r:r}}),a):a}(l.getAllResponseHeaders()):null;(function(e,t,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(S("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)})(function(e){t(e),s()},function(e){r(e),s()},{data:o&&"text"!==o&&"json"!==o?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:n,config:e,request:l}),l=null}}if(l.open(e.method.toUpperCase(),I(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&&(r(N("Request aborted",e,"ECONNABORTED",l)),l=null)},l.onerror=function(){r(N("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),r(N(t,e,(e.transitional||j).clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",l)),l=null},$.isStandardBrowserEnv()){var f=(e.withCredentials||R(d))&&e.xsrfCookieName?F.read(e.xsrfCookieName):void 0;f&&(i[e.xsrfHeaderName]=f)}"setRequestHeader"in l&&$.forEach(i,function(e,t){void 0===a&&"content-type"===t.toLowerCase()?delete i[t]:l.setRequestHeader(t,e)}),$.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)&&(n=function(e){l&&(r(!e||e&&e.type?new L("canceled"):e),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(n),e.signal&&(e.signal.aborted?n():e.signal.addEventListener("abort",n))),a||(a=null),l.send(a)})}),U),transformRequest:[function(e,t){return z(t,"Accept"),z(t,"Content-Type"),V.isFormData(e)||V.isArrayBuffer(e)||V.isBuffer(e)||V.isStream(e)||V.isFile(e)||V.isBlob(e)?e:V.isArrayBufferView(e)?e.buffer:V.isURLSearchParams(e)?(Y(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):V.isObject(e)||t&&"application/json"===t["Content-Type"]?(Y(t,"application/json"),function(e){if(V.isString(e))try{return(0,JSON.parse)(e),V.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||H.transitional,r=!(t&&t.silentJSONParsing)&&"json"===this.responseType;if(r||t&&t.forcedJSONParsing&&V.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw W(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, */*"}}};V.forEach(["delete","get","head"],function(e){H.headers[e]={}}),V.forEach(["post","put","patch"],function(e){H.headers[e]=V.merge(B)});var q=H,G=h,Q=q,Z=function(e){return!(!e||!e.__CANCEL__)},J=h,K=function(e,t,r){var n=this||Q;return G.forEach(r,function(r){e=r.call(n,e,t)}),e},X=Z,ee=q,te=E;function re(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new te("canceled")}var ne=h,ae=function(e,t){t=t||{};var r={};function n(e,t){return ne.isPlainObject(e)&&ne.isPlainObject(t)?ne.merge(e,t):ne.isPlainObject(t)?ne.merge({},t):ne.isArray(t)?t.slice():t}function a(r){return ne.isUndefined(t[r])?ne.isUndefined(e[r])?void 0:n(void 0,e[r]):n(e[r],t[r])}function i(e){if(!ne.isUndefined(t[e]))return n(void 0,t[e])}function o(r){return ne.isUndefined(t[r])?ne.isUndefined(e[r])?void 0:n(void 0,e[r]):n(void 0,t[r])}function s(r){return r in t?n(e[r],t[r]):r in e?n(void 0,e[r]):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 ne.forEach(Object.keys(e).concat(Object.keys(t)),function(e){var t=l[e]||a,n=t(e);ne.isUndefined(n)&&t!==s||(r[e]=n)}),r},ie="0.26.1",oe=ie,se={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){se[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});var le={};se.transitional=function(e,t,r){function n(e,t){return"[Axios v"+oe+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,a,i){if(!1===e)throw new Error(n(a," has been removed"+(t?" in "+t:"")));return t&&!le[a]&&(le[a]=!0,console.warn(n(a," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,a,i)}};var ue={assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),a=n.length;a-- >0;){var i=n[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!==r)throw Error("Unknown option "+i)}},validators:se},ce=h,de=g,he=v,fe=function(e){return re(e),e.headers=e.headers||{},e.data=K.call(e,e.data,e.headers,e.transformRequest),e.headers=J.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),J.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||ee.adapter)(e).then(function(t){return re(e),t.data=K.call(e,t.data,t.headers,e.transformResponse),t},function(t){return X(t)||(re(e),t&&t.response&&(t.response.data=K.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})},pe=ae,ge=ue,me=ge.validators;function ye(e){this.defaults=e,this.interceptors={request:new he,response:new he}}ye.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 r=t.transitional;void 0!==r&&ge.assertOptions(r,{silentJSONParsing:me.transitional(me.boolean),forcedJSONParsing:me.transitional(me.boolean),clarifyTimeoutError:me.transitional(me.boolean)},!1);var n=[],a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,n.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,n),s=s.concat(o),i=Promise.resolve(t);s.length;)i=i.then(s.shift(),s.shift());return i}for(var l=t;n.length;){var u=n.shift(),c=n.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},ye.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){ye.prototype[e]=function(t,r){return this.request(pe(r||{},{method:e,url:t,data:(r||{}).data}))}}),ce.forEach(["post","put","patch"],function(e){ye.prototype[e]=function(t,r,n){return this.request(pe(n||{},{method:e,url:t,data:r}))}});var ve=ye,be=E;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 r=this;this.promise.then(function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}}),this.promise.then=function(e){var t,n=new Promise(function(e){r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e){r.reason||(r.reason=new be(e),t(r.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=r,Te=ve,Me=ae,Oe=function e(t){var r=new Te(t),n=Se(Te.prototype.request,r);return ke.extend(n,Te.prototype,r),ke.extend(n,r),n.create=function(r){return e(Me(t,r))},n}(q);Oe.Axios=Te,Oe.Cancel=E,Oe.CancelToken=_e,Oe.isCancel=Z,Oe.VERSION=ie,Oe.all=function(e){return Promise.all(e)},Oe.spread=function(e){return function(t){return e.apply(null,t)}},Oe.isAxiosError=function(e){return we.isObject(e)&&!0===e.isAxiosError},t.exports=Oe,t.exports.default=Oe;var Ae,Ce=t.exports;e.ResponseType=void 0,(Ae=e.ResponseType||(e.ResponseType={})).MATRIX="matrix",Ae.VECTOR="vector",Ae.SCALAR="scalar",Ae.STRING="string";class Pe{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__,r=Object.assign({},e);return delete r.__name__,new Pe(t,r)}toString(){return(this.name?this.name:"")+"{"+Object.keys(this.labels).map(e=>e+'="'+this.labels[e]+'"').join(", ")+"}"}}class De{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]),r=parseFloat(e[1]);return new De(t,r)}toString(){return this.time+": "+this.value}}class Ee{constructor(e,t){this.metric=e,this.values=t}static fromJSON(e){const t=e.metric?Pe.fromJSON(e.metric):null,r=e.values.map(De.fromJSON);return new Ee(t,r)}}class $e{constructor(e,t){this.metric=e,this.value=t}static fromJSON(e){const t=e.metric?Pe.fromJSON(e.metric):null,r=De.fromJSON(e.value);return new $e(t,r)}}class Fe{constructor(e,t){this.resultType=e,this.result=t}static fromJSON(t){const r=t.resultType;let n=null;switch(r){case e.ResponseType.MATRIX:n=t.result.map(Ee.fromJSON);break;case e.ResponseType.VECTOR:n=t.result.map($e.fromJSON);break;case e.ResponseType.SCALAR:case e.ResponseType.STRING:n=t.result;break;default:throw new Error(`Unexpected resultType: ${r}`)}return new Fe(r,n)}}class Ie{constructor(e,t,r,n,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(r&&"string"!=typeof r)throw new Error(`Unexpected format for scrapePool. Got ${typeof r} instead of string`);if(n&&"string"!=typeof n)throw new Error(`Unexpected format for scrapeUrl. Got ${typeof n} 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=r,this.scrapeUrl=n,this.lastError=a,this.lastScrape=i,this.lastScrapeDuration=o,this.health=s}static fromJSON(e){return new Ie(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 Re{constructor(e,t,r,n,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(r&&"object"!=typeof r)throw new Error(`Unexpected format for labels. Got ${typeof r} 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=r,this.state=n,this.value=a}static fromJSON(e){return new Re(e.activeAt?new Date(e.activeAt):null,e.annotations,e.labels,e.state,e.value?parseFloat(e.value):null)}}class Ne{constructor(e,t,r,n,a,i,o,s){this.alerts=e,this.annotations=t,this.duration=r,this.health=n,this.labels=a,this.name=i,this.query=o,this.type=s}static fromJSON(e){return new Ne(e.alerts?e.alerts.map(Re.fromJSON):[],e.annotations,e.duration,e.health,e.labels,e.name,e.query,e.type)}}class je{constructor(e,t,r,n){this.rules=e,this.file=t,this.interval=r,this.name=n}static fromJSON(e){return new je(e.rules?e.rules.map(Ne.fromJSON):[],e.file,e.interval,e.name)}}class Le{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=Re,e.InstantVector=$e,e.Metric=Pe,e.PrometheusConnectionOptions=Le,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,r])=>(null!=r&&(r instanceof Array?r.filter(e=>null!=e).forEach(r=>e.append(`${t}[]`,r)):e.append(t,r)),e),new URLSearchParams),!(e=e||new Le).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,r,n){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(r),data:this.formatPromQlParams(n),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 r=e.data;if(!r||null==r.status)throw{status:"error",errorType:"client_error",error:"unexpected client error"};if(t)throw e;return r.data}formatTimeToPrometheus(e,t){var r;if(e||(e=t),"number"==typeof e)return e/1e3;if("object"==typeof e&&"Date"==(null===(r=null==e?void 0:e.constructor)||void 0===r?void 0:r.name))return e.getTime()/1e3;throw new Error("Wrong time format. Expected number or Date.")}instantQuery(e,t,r){const n={query:e,time:this.formatTimeToPrometheus(t,new Date),timeout:r};return(this.options.preferPost?this.request("POST","query",null,n):this.request("GET","query",n)).then(e=>Fe.fromJSON(e))}rangeQuery(e,t,r,n,a){const i={query:e,start:this.formatTimeToPrometheus(t),end:this.formatTimeToPrometheus(r),step:n,timeout:a};return(this.options.preferPost?this.request("POST","query_range",null,i):this.request("GET","query_range",i)).then(e=>Fe.fromJSON(e))}series(e,t,r){const n={match:this.listifyIfNeeded(e),start:this.formatTimeToPrometheus(t),end:this.formatTimeToPrometheus(r)};return(this.options.preferPost?this.request("POST","series",null,n):this.request("GET","series",n)).then(e=>e.map(Pe.fromJSON))}labelNames(e,t,r){const n={match:this.listifyIfNeeded(e),start:this.formatTimeToPrometheus(t),end:this.formatTimeToPrometheus(r)};return this.options.preferPost?this.request("POST","labels",null,n):this.request("GET","labels",n)}labelValues(e,t,r,n){const a={match:this.listifyIfNeeded(t),start:this.formatTimeToPrometheus(r,new Date),end:this.formatTimeToPrometheus(n,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(Ie.fromJSON):[],droppedTargets:e.droppedTargets?e.droppedTargets.map(Ie.fromJSON):[]}))}targetsMetadata(e,t,r){return this.request("GET","targets/metadata",{match_target:e,metric:t,limit:r})}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(je.fromJSON))}alerts(){return this.request("GET","alerts").then(e=>(e.alerts?e.alerts:[]).map(Re.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,r){const n={match:this.listifyIfNeeded(e),start:this.formatTimeToPrometheus(t),end:this.formatTimeToPrometheus(r)};return this.request("POST","admin/tsdb/delete_series",n)}adminCleanTombstones(){return this.request("POST","admin/tsdb/clean_tombstones")}},e.QueryResult=Fe,e.RangeVector=Ee,e.Rule=Ne,e.RuleGroup=je,e.SampleValue=De,e.Target=Ie,Object.defineProperty(e,"__esModule",{value:!0})}(t)}(0,e.exports);var t={getPrometheusStepAuto:(e,t,r)=>{const n=(t.getTime()-e.getTime())/1e3,a=25*Math.floor(n/r);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,r,n,a,i)=>{const o=null!=r.find(e=>"string"==typeof e),s=t&&o?new e.exports.PrometheusDriver(t):null;return r.map(t=>"string"==typeof t?s.rangeQuery(t,n,a,i):t(n,a,i).then(t=>e.exports.QueryResult.fromJSON(t)))}};class r{constructor(){this.message="No data to display",this.font="16px normal 'Helvetica Nueue'",this.textAlign="center",this.textBaseline="middle",this.direction="ltr"}}class n{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 r,this.errorMsg=new n,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,r){const n=t.metric.toString();return e.findInLabelMap&&e.findInLabelMap(t.metric)||n}function s(e,t,r){const n=e.fill?e.backgroundColor[r%e.backgroundColor.length]:"transparent";return e.findInBackgroundColorMap&&e.findInBackgroundColorMap(t.metric)||n}function l(e,t,r){const n=e.borderColor[r%e.borderColor.length];return e.findInBorderColorMap&&e.findInBorderColorMap(t.metric)||n}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 r=Object.assign(new a,t);r.assertPluginOptions(),r&&r.timeRange&&(r.timeRange.msUpdateInterval?e["datasource-prometheus"].updateInterval=setInterval(()=>{e.update()},r.timeRange.msUpdateInterval):e.update())}beforeUpdate(e,r){if(e["datasource-prometheus"]&&1==e["datasource-prometheus"].loading)return;const n=Object.assign(new a,r),u=n.prometheus,c=n.getQueries(),{start:d,end:h}=t.getStartAndEndDates(n.timeRange),f=n.timeRange.step||t.getPrometheusStepAuto(d,h,e.width),p=n.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 y={};if(e.data.datasets.length>0)for(let t in e.data.datasets){const r=e.data.datasets[t];let n=0;for(let e in r._meta)n=e;y[r.label]=!e.isDatasetVisible(r._meta[n].index)}const v=e.config.options.scales.yAxes;return e["datasource-prometheus"].loading=!0,Promise.all(m).then(t=>{const r=t.reduce((e,t,r)=>{const a=e.length,i=t.result.map((e,t)=>({yAxisID:v&&v.length>0?v[r%v.length].id:null,tension:n.tension,cubicInterpolationMode:n.cubicInterpolationMode||"default",stepped:n.stepped,fill:n.fill||!1,label:o(n,e),data:e.values.map((e,t)=>({t:e.time,y:e.value})),backgroundColor:s(n,e,a+t),borderColor:l(n,e,a+t),borderWidth:n.borderWidth,hidden:y[o(n,e)]||!1}));return e.concat(...i)},[]);e.data.datasets=r,e.data.datasets.length>0&&(n.fillGaps&&function(e,t,r,n,a){let i=a.timeRange.minStep||n;i=i>=n?i:n,e.data.datasets.forEach((n,a)=>{for(let e=n.data.length-2;e>0;e--)if(n.data[e+1].t-n.data[e].t>1100*i)for(let t=(n.data[e+1].t-n.data[e].t)/(1e3*i);t>1;t--){const t={t:new Date(n.data[e+1].t.getTime()-1e3*i),v:Number.NaN};n.data.splice(e+1,0,t)}if(Math.abs(t.getTime()-n.data[0].t)>1100*i)for(let r=Math.abs(t.getTime()-n.data[0].t)/(1e3*i);r>1;r--)e.data.datasets[a].data.unshift({t:new Date(n.data[0].t.getTime()-1e3*i),v:Number.NaN});if(Math.abs(r.getTime()-n.data[n.data.length-1].t)>1100*i)for(let t=Math.abs(r.getTime()-n.data[n.data.length-1].t)/(1e3*i);t>1;t--)e.data.datasets[a].data.push({t:new Date(n.data[e.data.datasets[a].data.length-1].t.getTime()+1e3*i),v:Number.NaN})})}(e,d,h,g,n),n.dataSetHook&&(e.data.datasets=n.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 r;const n=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=n.errorMsg.direction,t.textAlign=n.errorMsg.textAlign,t.textBaseline=n.errorMsg.textBaseline,t.font="16px normal 'Helvetica Nueue'",t.fillText((null===(r=n.errorMsg)||void 0===r?void 0:r.message)||e["datasource-prometheus"].error,a/2,i/2),void t.restore()}if(0==e.data.datasets.length){const t=e.ctx,r=e.width,a=e.height;return e.clear(),t.save(),t.direction=n.noDataMsg.direction,t.textAlign=n.noDataMsg.textAlign,t.textBaseline=n.noDataMsg.textBaseline,t.font=n.noDataMsg.font,t.fillText(n.noDataMsg.message,r/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,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function arrayMap(e,t){for(var r=-1,n=e?e.length:0,a=Array(n);++r<n;)a[r]=t(e[r],r,e);return a}function arrayPush(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];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,r,n,a){var i=-1,o=e.length;for(r||(r=isFlattenable),a||(a=[]);++i<o;){var s=e[i];t>0&&r(s)?t>1?baseFlatten(s,t-1,r,n,a):arrayPush(a,s):n||(a[a.length]=s)}return a}function basePick(e,t){return basePickBy(e=Object(e),t,function(t,r){return r in e})}function basePickBy(e,t,r){for(var n=-1,a=t.length,i={};++n<a;){var o=t[n],s=e[o];r(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 r=arguments,n=-1,a=nativeMax(r.length-t,0),i=Array(a);++n<a;)i[n]=r[t+n];n=-1;for(var o=Array(t+1);++n<t;)o[n]=r[n];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$1(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$1(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){var r;e.exports=(r=moment$1,function(e){function t(n){if(r[n])return r[n].exports;var a=r[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=3)}([function(e,t,r){var n=r(5)();e.exports=function(e){return e!==n&&null!==e}},function(e,t,r){e.exports=r(18)()?Symbol:r(20)},function(e,t){e.exports=r},function(e,t,r){function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,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 r=[],n=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){a=!0,i=e}finally{try{!n&&s.return&&s.return()}finally{if(a)throw i}}return r}(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 r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();t.extendMoment=function(e){return e.range=function(t,r){return"string"==typeof t&&d.hasOwnProperty(t)?new h(e(this).startOf(t),e(this).endOf(t)):new h(t,r)},e.rangeFromInterval=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e();if(e.isMoment(n)||(n=e(n)),!n.isValid())throw new Error("Invalid date.");var a=n.clone().add(r,t),i=[];return i.push(e.min(n,a)),i.push(e.max(n,a)),new h(i)},e.rangeFromISOString=function(t){var r=i(t),n=e.parseZone(r[0]),a=e.parseZone(r[1]);return new h(n,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=n(r(2)),c=n(r(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,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=t,a=r;if(1===arguments.length||void 0===r)if("object"===(void 0===t?"undefined":s(t))&&2===t.length){var l=o(t,2);n=l[0],a=l[1]}else if("string"==typeof t){var c=i(t),d=o(c,2);n=d[0],a=d[1]}this.start=(0,u.default)(n||0===n?n:-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),r=this.end.isSame(e.start);return t&&e.start.valueOf()<=this.start.valueOf()||r&&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},r=this;return a({},c.default.iterator,function(){var n=t.step||1,a=Math.abs(r.start.diff(r.end,e))/n,i=t.excludeEnd||!1,o=0;return t.hasOwnProperty("exclusive")&&(i=t.exclusive),{next:function(){var t=r.start.clone().add(o*n,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},r=this,n=t.step||1,i=this.valueOf()/e.valueOf()/n,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)(r.start.valueOf()+e.valueOf()*l*n),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 r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{excludeStart:!1,excludeEnd:!1},n=this.start.valueOf(),a=this.end.valueOf(),i=t.valueOf(),o=t.valueOf(),s=r.excludeStart||!1,l=r.excludeEnd||!1;return r.hasOwnProperty("exclusive")&&(s=l=r.exclusive),t instanceof e&&(i=t.start.valueOf(),o=t.end.valueOf()),(n<i||n<=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(),r=this.end.valueOf(),n=e.start.valueOf(),a=e.end.valueOf(),i=n==a;if(t==r){if(t==n||t==a)return null;if(t>n&&t<a)return this.clone()}else if(i){if(n==t||n==r)return null;if(n>t&&n<r)return new this.constructor(n,n)}return t<=n&&n<r&&r<a?new this.constructor(n,r):n<t&&t<a&&a<=r?new this.constructor(t,a):n<t&&t<=r&&r<a?this.clone():t<=n&&n<=a&&a<=r?new this.constructor(n,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},r=null!==this.intersect(e);return t.adjacent&&!r?this.adjacent(e):r}},{key:"reverseBy",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{excludeStart:!1,step:1},r=this;return a({},c.default.iterator,function(){var n=t.step||1,a=Math.abs(r.start.diff(r.end,e))/n,i=t.excludeStart||!1,o=0;return t.hasOwnProperty("exclusive")&&(i=t.exclusive),{next:function(){var t=r.end.clone().subtract(o*n,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},r=this,n=t.step||1,i=this.valueOf()/e.valueOf()/n,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)(r.end.valueOf()-e.valueOf()*l*n),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(),r=this.end.valueOf(),n=e.start.valueOf(),a=e.end.valueOf();return null===this.intersect(e)?[this]:n<=t&&t<r&&r<=a?[]:n<=t&&t<a&&a<r?[new this.constructor(a,r)]:t<n&&n<r&&r<=a?[new this.constructor(t,n)]:t<n&&n<a&&a<r?[new this.constructor(t,n),new this.constructor(a,r)]:t<n&&n<r&&a<r?[new this.constructor(t,n),new this.constructor(n,r)]:[]}},{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,r){var n,a=r(6),i=r(13),o=r(9),s=r(15);n=e.exports=function(e,t){var r,n,o,l,u;return arguments.length<2||"string"!=typeof e?(l=t,t=e,e=null):l=arguments[2],null==e?(r=o=!0,n=!1):(r=s.call(e,"c"),n=s.call(e,"e"),o=s.call(e,"w")),u={value:t,configurable:r,enumerable:n,writable:o},l?a(i(l),u):u},n.gs=function(e,t,r){var n,l,u,c;return"string"!=typeof e?(u=r,r=t,t=e,e=null):u=arguments[3],null==t?t=void 0:o(t)?null==r?r=void 0:o(r)||(u=r,r=void 0):(u=t,t=r=void 0),null==e?(n=!0,l=!1):(n=s.call(e,"c"),l=s.call(e,"e")),c={get:t,set:r,configurable:n,enumerable:l},u?a(i(u),c):c}},function(e,t,r){e.exports=function(){}},function(e,t,r){e.exports=r(7)()?Object.assign:r(8)},function(e,t,r){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,r){var n=r(10),a=r(14),i=Math.max;e.exports=function(e,t){var r,o,s,l=i(arguments.length,2);for(e=Object(a(e)),s=function(n){try{e[n]=t[n]}catch(e){r||(r=e)}},o=1;o<l;++o)n(t=arguments[o]).forEach(s);if(void 0!==r)throw r;return e}},function(e,t,r){e.exports=function(e){return"function"==typeof e}},function(e,t,r){e.exports=r(11)()?Object.keys:r(12)},function(e,t,r){e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},function(e,t,r){var n=r(0),a=Object.keys;e.exports=function(e){return a(n(e)?Object(e):e)}},function(e,t,r){var n=r(0),a=Array.prototype.forEach,i=Object.create;e.exports=function(e){var t=i(null);return a.call(arguments,function(e){n(e)&&function(e,t){var r;for(r in e)t[r]=e[r]}(Object(e),t)}),t}},function(e,t,r){var n=r(0);e.exports=function(e){if(!n(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,r){e.exports=r(16)()?String.prototype.contains:r(17)},function(e,t,r){var n="razdwatrzy";e.exports=function(){return"function"==typeof n.contains&&!0===n.contains("dwa")&&!1===n.contains("foo")}},function(e,t,r){var n=String.prototype.indexOf;e.exports=function(e){return n.call(this,e,arguments[1])>-1}},function(e,t,r){var n={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!!n[typeof Symbol.iterator]&&!!n[typeof Symbol.toPrimitive]&&!!n[typeof Symbol.toStringTag]}},function(e,t,r){e.exports=function(e){return!!e&&("symbol"==typeof e||!!e.constructor&&"Symbol"===e.constructor.name&&"Symbol"===e[e.constructor.toStringTag])}},function(e,t,r){var n,a,i,o,s=r(4),l=r(21),u=Object.create,c=Object.defineProperties,d=Object.defineProperty,h=Object.prototype,f=u(null);if("function"==typeof Symbol){n=Symbol;try{String(n()),o=!0}catch(e){}}var p=function(){var e=u(null);return function(t){for(var r,n,a=0;e[t+(a||"")];)++a;return e[t+=a||""]=!0,d(h,r="@@"+t,s.gs(null,function(e){n||(n=!0,d(this,r,s(e)),n=!1)})),r}}();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 r;if(this instanceof e)throw new TypeError("Symbol is not a constructor");return o?n(t):(r=u(i.prototype),t=void 0===t?"":String(t),c(r,{__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("",n&&n.hasInstance||a("hasInstance")),isConcatSpreadable:s("",n&&n.isConcatSpreadable||a("isConcatSpreadable")),iterator:s("",n&&n.iterator||a("iterator")),match:s("",n&&n.match||a("match")),replace:s("",n&&n.replace||a("replace")),search:s("",n&&n.search||a("search")),species:s("",n&&n.species||a("species")),split:s("",n&&n.split||a("split")),toPrimitive:s("",n&&n.toPrimitive||a("toPrimitive")),toStringTag:s("",n&&n.toStringTag||a("toStringTag")),unscopables:s("",n&&n.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,r){var n=r(19);e.exports=function(e){if(!n(e))throw new TypeError(e+" is not a symbol");return e}}]))}),moment=momentRange.extendMoment(moment$1),getQueriesTimeRange=function(e,t){var r=moment(),n=andoncloudDashboardToolkit.normalizeShifts(null==t?void 0:t.shifts,r),a=andoncloudDashboardToolkit.getCurrentShift(r,n),i=andoncloudDashboardToolkit.getRecentShift(r,n);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}},colorNames={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]};const reverseNames=Object.create(null);for(const e in colorNames)Object.hasOwn(colorNames,e)&&(reverseNames[colorNames[e]]=e);const cs={to:{},get:{}};function clamp(e,t,r){return Math.min(Math.max(t,e),r)}function hexDouble(e){const t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}cs.get=function(e){let t,r;switch(e.slice(0,3).toLowerCase()){case"hsl":t=cs.get.hsl(e),r="hsl";break;case"hwb":t=cs.get.hwb(e),r="hwb";break;default:t=cs.get.rgb(e),r="rgb"}return t?{model:r,value:t}:null},cs.get.rgb=function(e){if(!e)return null;let t,r,n,a=[0,0,0,1];if(t=e.match(/^#([a-f\d]{6})([a-f\d]{2})?$/i)){for(n=t[2],t=t[1],r=0;r<3;r++){const e=2*r;a[r]=Number.parseInt(t.slice(e,e+2),16)}n&&(a[3]=Number.parseInt(n,16)/255)}else if(t=e.match(/^#([a-f\d]{3,4})$/i)){for(t=t[1],n=t[3],r=0;r<3;r++)a[r]=Number.parseInt(t[r]+t[r],16);n&&(a[3]=Number.parseInt(n+n,16)/255)}else if(t=e.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/)){for(r=0;r<3;r++)a[r]=Number.parseInt(t[r+1],10);t[4]&&(a[3]=t[5]?.01*Number.parseFloat(t[4]):Number.parseFloat(t[4]))}else{if(!(t=e.match(/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/)))return(t=e.match(/^(\w+)$/))?"transparent"===t[1]?[0,0,0,0]:Object.hasOwn(colorNames,t[1])?(a=colorNames[t[1]],a[3]=1,a):null:null;for(r=0;r<3;r++)a[r]=Math.round(2.55*Number.parseFloat(t[r+1]));t[4]&&(a[3]=t[5]?.01*Number.parseFloat(t[4]):Number.parseFloat(t[4]))}for(r=0;r<3;r++)a[r]=clamp(a[r],0,255);return a[3]=clamp(a[3],0,1),a},cs.get.hsl=function(e){if(!e)return null;const 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){const e=Number.parseFloat(t[4]);return[(Number.parseFloat(t[1])%360+360)%360,clamp(Number.parseFloat(t[2]),0,100),clamp(Number.parseFloat(t[3]),0,100),clamp(Number.isNaN(e)?1:e,0,1)]}return null},cs.get.hwb=function(e){if(!e)return null;const t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){const e=Number.parseFloat(t[4]);return[(Number.parseFloat(t[1])%360+360)%360,clamp(Number.parseFloat(t[2]),0,100),clamp(Number.parseFloat(t[3]),0,100),clamp(Number.isNaN(e)?1:e,0,1)]}return null},cs.to.hex=function(...e){return"#"+hexDouble(e[0])+hexDouble(e[1])+hexDouble(e[2])+(e[3]<1?hexDouble(Math.round(255*e[3])):"")},cs.to.rgb=function(...e){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]+")"},cs.to.rgb.percent=function(...e){const t=Math.round(e[0]/255*100),r=Math.round(e[1]/255*100),n=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+t+"%, "+r+"%, "+n+"%)":"rgba("+t+"%, "+r+"%, "+n+"%, "+e[3]+")"},cs.to.hsl=function(...e){return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},cs.to.hwb=function(...e){let t="";return e.length>=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},cs.to.keyword=function(...e){return reverseNames[e.slice(0,3)]};var cssKeywords={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]};const reverseKeywords={};for(const e of Object.keys(cssKeywords))reverseKeywords[cssKeywords[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"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},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"]}},LAB_FT=(6/29)**3;function srgbNonlinearTransform(e){return Math.min(Math.max(0,e>.0031308?1.055*e**(1/2.4)-.055:12.92*e),1)}function srgbNonlinearTransformInv(e){return e>.04045?((e+.055)/1.055)**2.4:e/12.92}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:r}=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:r})}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(convert$1);for(let{length:r}=t,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}function deriveBFS(e){const t=buildGraph(),r=[e];for(t[e].distance=0;r.length>0;){const e=r.pop(),n=Object.keys(convert$1[e]);for(let{length:a}=n,i=0;i<a;i++){const a=n[i],o=t[a];-1===o.distance&&(o.distance=t[e].distance+1,o.parent=e,r.unshift(a))}}return t}function link(e,t){return function(r){return t(e(r))}}function wrapConversion(e,t){const r=[t[e].parent,e];let n=convert$1[t[e].parent][e],a=t[e].parent;for(;t[a].parent;)r.unshift(t[a].parent),n=link(convert$1[t[a].parent][a],n),a=t[a].parent;return n.conversion=r,n}function route(e){const t=deriveBFS(e),r={},n=Object.keys(t);for(let{length:e}=n,a=0;a<e;a++){const e=n[a];null!==t[e].parent&&(r[e]=wrapConversion(e,t))}return r}convert$1.rgb.hsl=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,a=Math.min(t,r,n),i=Math.max(t,r,n),o=i-a;let s,l;switch(i){case a:s=0;break;case t:s=(r-n)/o;break;case r:s=2+(n-t)/o;break;case n:s=4+(t-r)/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,r,n,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};if(0===c)a=0,i=0;else{switch(i=c/u,t=d(o),r=d(s),n=d(l),u){case o:a=n-r;break;case s:a=1/3+t-n;break;case l:a=2/3+r-t}a<0?a+=1:a>1&&(a-=1)}return[360*a,100*i,100*u]},convert$1.rgb.hwb=function(e){const t=e[0],r=e[1];let n=e[2];const a=convert$1.rgb.hsl(e)[0],i=1/255*Math.min(t,Math.min(r,n));return n=1-1/255*Math.max(t,Math.max(r,n)),[a,100*i,100*n]},convert$1.rgb.oklab=function(e){const t=srgbNonlinearTransformInv(e[0]/255),r=srgbNonlinearTransformInv(e[1]/255),n=srgbNonlinearTransformInv(e[2]/255),a=Math.cbrt(.4122214708*t+.5363325363*r+.0514459929*n),i=Math.cbrt(.2119034982*t+.6806995451*r+.1073969566*n),o=Math.cbrt(.0883024619*t+.2817188376*r+.6299787005*n);return[100*(.2104542553*a+.793617785*i-.0040720468*o),100*(1.9779984951*a-2.428592205*i+.4505937099*o),100*(.0259040371*a+.7827717662*i-.808675766*o)]},convert$1.rgb.cmyk=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,a=Math.min(1-t,1-r,1-n);return[100*((1-t-a)/(1-a)||0),100*((1-r-a)/(1-a)||0),100*((1-n-a)/(1-a)||0),100*a]},convert$1.rgb.keyword=function(e){const t=reverseKeywords[e];if(t)return t;let r,n=Number.POSITIVE_INFINITY;for(const t of Object.keys(cssKeywords)){const a=comparativeDistance(e,cssKeywords[t]);a<n&&(n=a,r=t)}return r},convert$1.keyword.rgb=function(e){return cssKeywords[e]},convert$1.rgb.xyz=function(e){const t=srgbNonlinearTransformInv(e[0]/255),r=srgbNonlinearTransformInv(e[1]/255),n=srgbNonlinearTransformInv(e[2]/255);return[100*(.4124564*t+.3575761*r+.1804375*n),100*(.2126729*t+.7151522*r+.072175*n),100*(.0193339*t+.119192*r+.9503041*n)]},convert$1.rgb.lab=function(e){const t=convert$1.rgb.xyz(e);let r=t[0],n=t[1],a=t[2];return r/=95.047,n/=100,a/=108.883,r=r>LAB_FT?r**(1/3):7.787*r+16/116,n=n>LAB_FT?n**(1/3):7.787*n+16/116,a=a>LAB_FT?a**(1/3):7.787*a+16/116,[116*n-16,500*(r-n),200*(n-a)]},convert$1.hsl.rgb=function(e){const t=e[0]/360,r=e[1]/100,n=e[2]/100;let a,i;if(0===r)return i=255*n,[i,i,i];const o=n<.5?n*(1+r):n+r-n*r,s=2*n-o,l=[0,0,0];for(let e=0;e<3;e++)a=t+1/3*-(e-1),a<0&&a++,a>1&&a--,i=6*a<1?s+6*(o-s)*a:2*a<1?o:3*a<2?s+(o-s)*(2/3-a)*6:s,l[e]=255*i;return l},convert$1.hsl.hsv=function(e){const t=e[0];let r=e[1]/100,n=e[2]/100,a=r;const i=Math.max(n,.01);return n*=2,r*=n<=1?n:2-n,a*=i<=1?i:2-i,[t,100*(0===n?2*a/(i+a):2*r/(n+r)),(n+r)/2*100]},convert$1.hsv.rgb=function(e){const t=e[0]/60,r=e[1]/100;let n=e[2]/100;const a=Math.floor(t)%6,i=t-Math.floor(t),o=255*n*(1-r),s=255*n*(1-r*i),l=255*n*(1-r*(1-i));switch(n*=255,a){case 0:return[n,l,o];case 1:return[s,n,o];case 2:return[o,n,l];case 3:return[o,s,n];case 4:return[l,o,n];case 5:return[n,o,s]}},convert$1.hsv.hsl=function(e){const t=e[0],r=e[1]/100,n=e[2]/100,a=Math.max(n,.01);let i,o;o=(2-r)*n;const s=(2-r)*a;return i=r*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 r=e[1]/100,n=e[2]/100;const a=r+n;let i;a>1&&(r/=a,n/=a);const o=Math.floor(6*t),s=1-n;i=6*t-o,1&o&&(i=1-i);const l=r+i*(s-r);let u,c,d;switch(o){default:case 6:case 0:u=s,c=l,d=r;break;case 1:u=l,c=s,d=r;break;case 2:u=r,c=s,d=l;break;case 3:u=r,c=l,d=s;break;case 4:u=l,c=r,d=s;break;case 5:u=s,c=r,d=l}return[255*u,255*c,255*d]},convert$1.cmyk.rgb=function(e){const t=e[1]/100,r=e[2]/100,n=e[3]/100;return[255*(1-Math.min(1,e[0]/100*(1-n)+n)),255*(1-Math.min(1,t*(1-n)+n)),255*(1-Math.min(1,r*(1-n)+n))]},convert$1.xyz.rgb=function(e){const t=e[0]/100,r=e[1]/100,n=e[2]/100;let a,i,o;return a=3.2404542*t+-1.5371385*r+-.4985314*n,i=-.969266*t+1.8760108*r+.041556*n,o=.0556434*t+-.2040259*r+1.0572252*n,a=srgbNonlinearTransform(a),i=srgbNonlinearTransform(i),o=srgbNonlinearTransform(o),[255*a,255*i,255*o]},convert$1.xyz.lab=function(e){let t=e[0],r=e[1],n=e[2];return t/=95.047,r/=100,n/=108.883,t=t>LAB_FT?t**(1/3):7.787*t+16/116,r=r>LAB_FT?r**(1/3):7.787*r+16/116,n=n>LAB_FT?n**(1/3):7.787*n+16/116,[116*r-16,500*(t-r),200*(r-n)]},convert$1.xyz.oklab=function(e){const t=e[0]/100,r=e[1]/100,n=e[2]/100,a=Math.cbrt(.8189330101*t+.3618667424*r-.1288597137*n),i=Math.cbrt(.0329845436*t+.9293118715*r+.0361456387*n),o=Math.cbrt(.0482003018*t+.2643662691*r+.633851707*n);return[100*(.2104542553*a+.793617785*i-.0040720468*o),100*(1.9779984951*a-2.428592205*i+.4505937099*o),100*(.0259040371*a+.7827717662*i-.808675766*o)]},convert$1.oklab.oklch=function(e){return convert$1.lab.lch(e)},convert$1.oklab.xyz=function(e){const t=e[0]/100,r=e[1]/100,n=e[2]/100,a=(.999999998*t+.396337792*r+.215803758*n)**3,i=(1.000000008*t-.105561342*r-.063854175*n)**3,o=(1.000000055*t-.089484182*r-1.291485538*n)**3;return[100*(1.227013851*a-.55779998*i+.281256149*o),100*(-.040580178*a+1.11225687*i-.071676679*o),100*(-.076381285*a-.421481978*i+1.58616322*o)]},convert$1.oklab.rgb=function(e){const t=e[0]/100,r=e[1]/100,n=e[2]/100,a=(t+.3963377774*r+.2158037573*n)**3,i=(t-.1055613458*r-.0638541728*n)**3,o=(t-.0894841775*r-1.291485548*n)**3;return[255*srgbNonlinearTransform(4.0767416621*a-3.3077115913*i+.2309699292*o),255*srgbNonlinearTransform(-1.2684380046*a+2.6097574011*i-.3413193965*o),255*srgbNonlinearTransform(-.0041960863*a-.7034186147*i+1.707614701*o)]},convert$1.oklch.oklab=function(e){return convert$1.lch.lab(e)},convert$1.lab.xyz=function(e){let t,r,n;r=(e[0]+16)/116,t=e[1]/500+r,n=r-e[2]/200;const a=r**3,i=t**3,o=n**3;return r=a>LAB_FT?a:(r-16/116)/7.787,t=i>LAB_FT?i:(t-16/116)/7.787,n=o>LAB_FT?o:(n-16/116)/7.787,t*=95.047,r*=100,n*=108.883,[t,r,n]},convert$1.lab.lch=function(e){const t=e[0],r=e[1],n=e[2];let a;return a=360*Math.atan2(n,r)/2/Math.PI,a<0&&(a+=360),[t,Math.sqrt(r*r+n*n),a]},convert$1.lch.lab=function(e){const t=e[1],r=e[2]/360*2*Math.PI;return[e[0],t*Math.cos(r),t*Math.sin(r)]},convert$1.rgb.ansi16=function(e,t=null){const[r,n,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(n/255)<<1|Math.round(r/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],r=e[1],n=e[2];return t>>4==r>>4&&r>>4==n>>4?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},convert$1.ansi16.rgb=function(e){let t=(e=e[0])%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const r=.5*(Math.trunc(e>50)+1);return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},convert$1.ansi256.rgb=function(e){if((e=e[0])>=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".slice(t.length)+t},convert$1.hex.rgb=function(e){const t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let r=t[0];3===t[0].length&&(r=[...r].map(e=>e+e).join(""));const n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},convert$1.rgb.hcg=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,a=Math.max(Math.max(t,r),n),i=Math.min(Math.min(t,r),n),o=a-i;let s;return s=o<=0?0:a===t?(r-n)/o%6:a===r?2+(n-t)/o:4+(t-r)/o,s/=6,s%=1,[360*s,100*o,100*(o<1?i/(1-o):0)]},convert$1.hsl.hcg=function(e){const t=e[1]/100,r=e[2]/100,n=r<.5?2*t*r:2*t*(1-r);let a=0;return n<1&&(a=(r-.5*n)/(1-n)),[e[0],100*n,100*a]},convert$1.hsv.hcg=function(e){const t=e[2]/100,r=e[1]/100*t;let n=0;return r<1&&(n=(t-r)/(1-r)),[e[0],100*r,100*n]},convert$1.hcg.rgb=function(e){const t=e[1]/100,r=e[2]/100;if(0===t)return[255*r,255*r,255*r];const n=[0,0,0],a=e[0]/360%1*6,i=a%1,o=1-i;let s=0;switch(Math.floor(a)){case 0:n[0]=1,n[1]=i,n[2]=0;break;case 1:n[0]=o,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=i;break;case 3:n[0]=0,n[1]=o,n[2]=1;break;case 4:n[0]=i,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=o}return s=(1-t)*r,[255*(t*n[0]+s),255*(t*n[1]+s),255*(t*n[2]+s)]},convert$1.hcg.hsv=function(e){const t=e[1]/100,r=t+e[2]/100*(1-t);let n=0;return r>0&&(n=t/r),[e[0],100*n,100*r]},convert$1.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let n=0;return r>0&&r<.5?n=t/(2*r):r>=.5&&r<1&&(n=t/(2*(1-r))),[e[0],100*n,100*r]},convert$1.hcg.hwb=function(e){const t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],100*(r-t),100*(1-r)]},convert$1.hwb.hcg=function(e){const t=1-e[2]/100,r=t-e[1]/100;let n=0;return r<1&&(n=(t-r)/(1-r)),[e[0],100*r,100*n]},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),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(r.length)+r},convert$1.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const convert={},models=Object.keys(convert$1);function wrapRaw(e){const t=function(...t){const r=t[0];return null==r?r:(r.length>1&&(t=r),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}function wrapRounded(e){const t=function(...t){const r=t[0];if(null==r)return r;r.length>1&&(t=r);const n=e(t);if("object"==typeof n)for(let{length:e}=n,t=0;t<e;t++)n[t]=Math.round(n[t]);return n};return"conversion"in e&&(t.conversion=e.conversion),t}for(const e of models){convert[e]={},Object.defineProperty(convert[e],"channels",{value:convert$1[e].channels}),Object.defineProperty(convert[e],"labels",{value:convert$1[e].labels});const t=route(e),r=Object.keys(t);for(const n of r){const r=t[n];convert[e][n]=wrapRounded(r),convert[e][n].raw=wrapRaw(r)}}const skippedModels=["keyword","gray","hex"],hashedModelKeys={};for(const e of Object.keys(convert))hashedModelKeys[[...convert[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 convert))throw new Error("Unknown model: "+t);let r,n;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=cs.get(e);if(null===t)throw new Error("Unable to parse color from string: "+e);this.model=t.model,n=convert[this.model].channels,this.color=t.value.slice(0,n),this.valpha="number"==typeof t.value[n]?t.value[n]:1}else if(e.length>0){this.model=t||"rgb",n=convert[this.model].channels;const r=Array.prototype.slice.call(e,0,n);this.color=zeroArray(r,n),this.valpha="number"==typeof e[n]?e[n]: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 n=t.sort().join("");if(!(n in hashedModelKeys))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=hashedModelKeys[n];const{labels:a}=convert[this.model],i=[];for(r=0;r<a.length;r++)i.push(e[a[r]]);this.color=zeroArray(i)}if(limiters[this.model])for(n=convert[this.model].channels,r=0;r<n;r++){const e=limiters[this.model][r];e&&(this.color[r]=e(this.color[r]))}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 cs.to?this:this.rgb();t=t.round("number"==typeof e?e:1);const r=1===t.valpha?t.color:[...t.color,this.valpha];return cs.to[t.model](...r)},percentString(e){const t=this.rgb().round("number"==typeof e?e:1),r=1===t.valpha?t.color:[...t.color,this.valpha];return cs.to.rgb.percent(...r)},array(){return 1===this.valpha?[...this.color]:[...this.color,this.valpha]},object(){const e={},{channels:t}=convert[this.model],{labels:r}=convert[this.model];for(let n=0;n<t;n++)e[r[n]]=this.color[n];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):convert[this.model].keyword(this.color)},hex(e){return void 0!==e?new Color(e):cs.to.hex(...this.rgb().round().color)},hexa(e){if(void 0!==e)return new Color(e);const t=this.rgb().round().color;let r=Math.round(255*this.valpha).toString(16).toUpperCase();return 1===r.length&&(r="0"+r),cs.to.hex(...t)+r},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[r,n]of e.entries()){const e=n/255;t[r]=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(),r=e.luminosity();return t>r?(t+.05)/(r+.05):(r+.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 r=t.color[0];return r=(r+e)%360,r=r<0?360+r:r,t.color[0]=r,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 r=e.rgb(),n=this.rgb(),a=void 0===t?.5:t,i=2*a-1,o=r.alpha()-n.alpha(),s=((i*o===-1?i:(i+o)/(1+i*o))+1)/2,l=1-s;return Color.rgb(s*r.red()+l*n.red(),s*r.green()+l*n.green(),s*r.blue()+l*n.blue(),r.alpha()*a+n.alpha()*(1-a))}};for(const e of Object.keys(convert)){if(skippedModels.includes(e))continue;const{channels:t}=convert[e];Color.prototype[e]=function(...t){return this.model===e?new Color(this):new Color(t.length>0?t:[...assertArray(convert[this.model][e].raw(this.color)),this.valpha],e)},Color[e]=function(...r){let n=r[0];return"number"==typeof n&&(n=zeroArray(r,t)),new Color(n,e)}}function roundTo(e,t){return Number(e.toFixed(t))}function roundToPlace(e){return function(t){return roundTo(t,e)}}function getset(e,t,r){e=Array.isArray(e)?e:[e];for(const n of e)(limiters[n]||=[])[t]=r;return e=e[0],function(n){let a;return void 0!==n?(r&&(n=r(n)),a=this[e](),a.color[t]=n,a):(a=this[e]().color[t],r&&(a=r(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 r=0;r<t;r++)"number"!=typeof e[r]&&(e[r]=0);return e}var createGradient=function(e,t){return e.createLinearGradient(0,t.bottom,0,t.top)},getScale=function(e,t){var r=e.getDatasetMeta(t);return r.controller._yScale||r.controller.chart.scales[r.yAxisID]},GradientPlugin={id:"gradient",beforeDatasetsUpdate:function(e){var t=e.ctx,r=e.data.datasets;if(t&&r)for(var n=0;n<r.length;n++){var a=r[n],i=getScale(e,n);if(i){var o=createGradient(t,i),s=Color(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(null),_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),r=moment.range(e,t);setTimeLabels(function(){return e.isBefore(t)?Array.from(r.by("minutes",{step:15})):Array.from(r.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$1({},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$1({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$1({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.map(function(e){return e.query}),timeRange:{type:"absolute",start:queriesTimeRange.startedAt,end:queriesTimeRange.finishedAt,step:30},fillGaps:!0,fill:!0}},legend:{labels:{filter:function filter(item){var _settings$prometheusQ,regex=/{(?:[^{}]*)*}/,paramsMatch=item.text.match(regex),queryDisplayName=null==settings||null==(_settings$prometheusQ=settings.prometheusQueries[item.datasetIndex])?void 0:_settings$prometheusQ.displayName;if(queryDisplayName){if(paramsMatch&&0!==paramsMatch.index){var queryParams=eval("("+paramsMatch[0].replaceAll("=",":")+")"),queryParamsValues=Object.values(lodash_pick(queryParams,settings.displayedQueryParams)).join(" - ");item.text=queryParamsValues?queryDisplayName+" - "+queryParamsValues:queryDisplayName}}else{var replaceAfter=function(e,t,r){return e.substring(0,t)+r};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].query}return item}}}}})},WidgetView=function(e){var t=e.settings;return React__default.default.createElement(material.Box,{display:"flex",width:"100%",minWidth:"500px",height:"100%",minHeight:"250px",p:2},t&&React__default.default.createElement(PrometheusChart,{data:e.data,settings:t}))};const semver=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,validateAndParse=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(semver);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},isWildcard=e=>"*"===e||"x"===e||"X"===e,tryParse=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},forceType=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],compareStrings=(e,t)=>{if(isWildcard(e)||isWildcard(t))return 0;const[r,n]=forceType(tryParse(e),tryParse(t));return r>n?1:r<n?-1:0},compareSegments=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const n=compareStrings(e[r]||"0",t[r]||"0");if(0!==n)return n}return 0},compareVersions=(e,t)=>{const r=validateAndParse(e),n=validateAndParse(t),a=r.pop(),i=n.pop(),o=compareSegments(r,n);return 0!==o?o:a&&i?compareSegments(a.split("."),i.split(".")):a||i?a?-1:1:0},compare=(e,t,r)=>{assertValidOperator(r);const n=compareVersions(e,t);return operatorResMap[r].includes(n)},operatorResMap={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},allowedOperators=Object.keys(operatorResMap),assertValidOperator=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===allowedOperators.indexOf(e))throw new Error(`Invalid operator, expected one of ${allowedOperators.join("|")}`)},satisfies=(e,t)=>{if((t=t.replace(/([><=]+)\s+/g,"$1")).includes("||"))return t.split("||").some(t=>satisfies(e,t));if(t.includes(" - ")){const[r,n]=t.split(" - ",2);return satisfies(e,`>=${r} <=${n}`)}if(t.includes(" "))return t.trim().replace(/\s{2,}/g," ").split(" ").every(t=>satisfies(e,t));const r=t.match(/^([<>=~^]+)/),n=r?r[1]:"=";if("^"!==n&&"~"!==n)return compare(e,t,n);const[a,i,o,,s]=validateAndParse(e),[l,u,c,,d]=validateAndParse(t),h=[a,i,o],f=[l,null!=u?u:"x",null!=c?c:"x"];if(d){if(!s)return!1;if(0!==compareSegments(h,f))return!1;if(-1===compareSegments(s.split("."),d.split(".")))return!1}const p=f.findIndex(e=>"0"!==e)+1,g="~"===n?2:p>1?p:1;return 0===compareSegments(h.slice(0,g),f.slice(0,g))&&-1!==compareSegments(h.slice(g),f.slice(g))};function Cache(e){this._maxSize=e,this.clear()}Cache.prototype.clear=function(){this._size=0,this._values=Object.create(null)},Cache.prototype.get=function(e){return this._values[e]},Cache.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var SPLIT_REGEX=/[^.^\]^[]+|(?=\[\]|\.\.)/g,DIGIT_REGEX=/^\d+$/,LEAD_DIGIT_REGEX=/^\d/,SPEC_CHAR_REGEX=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,CLEAN_QUOTES_REGEX=/^\s*(['"]?)(.*?)(\1)\s*$/,MAX_CACHE_SIZE=512,pathCache=new Cache(MAX_CACHE_SIZE),setCache=new Cache(MAX_CACHE_SIZE),getCache=new Cache(MAX_CACHE_SIZE),propertyExpr={Cache:Cache,split:split,normalizePath:normalizePath,setter:function(e){var t=normalizePath(e);return setCache.get(e)||setCache.set(e,function(e,r){for(var n=0,a=t.length,i=e;n<a-1;){var o=t[n];if("__proto__"===o||"constructor"===o||"prototype"===o)return e;i=i[t[n++]]}i[t[n]]=r})},getter:function(e,t){var r=normalizePath(e);return getCache.get(e)||getCache.set(e,function(e){for(var n=0,a=r.length;n<a;){if(null==e&&t)return;e=e[r[n++]]}return e})},join:function(e){return e.reduce(function(e,t){return e+(isQuoted(t)||DIGIT_REGEX.test(t)?"["+t+"]":(e?".":"")+t)},"")},forEach:function(e,t,r){forEach(Array.isArray(e)?e:split(e),t,r)}};function normalizePath(e){return pathCache.get(e)||pathCache.set(e,split(e).map(function(e){return e.replace(CLEAN_QUOTES_REGEX,"$2")}))}function split(e){return e.match(SPLIT_REGEX)||[""]}function forEach(e,t,r){var n,a,i,o,s=e.length;for(a=0;a<s;a++)(n=e[a])&&(shouldBeQuoted(n)&&(n='"'+n+'"'),i=!(o=isQuoted(n))&&/^\d+$/.test(n),t.call(r,n,o,i,a,e))}function isQuoted(e){return"string"==typeof e&&e&&-1!==["'",'"'].indexOf(e.charAt(0))}function hasLeadingNumber(e){return e.match(LEAD_DIGIT_REGEX)&&!e.match(DIGIT_REGEX)}function hasSpecialChars(e){return SPEC_CHAR_REGEX.test(e)}function shouldBeQuoted(e){return!isQuoted(e)&&(hasLeadingNumber(e)||hasSpecialChars(e))}const reWords=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,words=e=>e.match(reWords)||[],upperFirst=e=>e[0].toUpperCase()+e.slice(1),join=(e,t)=>words(e).join(t).toLowerCase(),camelCase=e=>words(e).reduce((e,t)=>`${e}${e?t[0].toUpperCase()+t.slice(1).toLowerCase():t.toLowerCase()}`,""),pascalCase=e=>upperFirst(camelCase(e)),snakeCase=e=>join(e,"_"),kebabCase=e=>join(e,"-"),sentenceCase=e=>upperFirst(join(e," ")),titleCase=e=>words(e).map(upperFirst).join(" ");var tinyCase={words:words,upperFirst:upperFirst,camelCase:camelCase,pascalCase:pascalCase,snakeCase:snakeCase,kebabCase:kebabCase,sentenceCase:sentenceCase,titleCase:titleCase},toposort_1=function(e){return toposort(uniqueNodes(e),e)},array$1=toposort;function toposort(e,t){var r=e.length,n=new Array(r),a={},i=r,o=makeOutgoingEdges(t),s=makeNodesHash(e);for(t.forEach(function(e){if(!s.has(e[0])||!s.has(e[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});i--;)a[i]||l(e[i],i,new Set);return n;function l(e,t,i){if(i.has(e)){var u;try{u=", node was:"+JSON.stringify(e)}catch(e){u=""}throw new Error("Cyclic dependency"+u)}if(!s.has(e))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(e));if(!a[t]){a[t]=!0;var c=o.get(e)||new Set;if(t=(c=Array.from(c)).length){i.add(e);do{var d=c[--t];l(d,s.get(d),i)}while(t);i.delete(e)}n[--r]=e}}}function uniqueNodes(e){for(var t=new Set,r=0,n=e.length;r<n;r++){var a=e[r];t.add(a[0]),t.add(a[1])}return Array.from(t)}function makeOutgoingEdges(e){for(var t=new Map,r=0,n=e.length;r<n;r++){var a=e[r];t.has(a[0])||t.set(a[0],new Set),t.has(a[1])||t.set(a[1],new Set),t.get(a[0]).add(a[1])}return t}function makeNodesHash(e){for(var t=new Map,r=0,n=e.length;r<n;r++)t.set(e[r],r);return t}toposort_1.array=array$1;const toString=Object.prototype.toString,errorToString=Error.prototype.toString,regExpToString=RegExp.prototype.toString,symbolToString="undefined"!=typeof Symbol?Symbol.prototype.toString:()=>"",SYMBOL_REGEXP=/^Symbol\((.*)\)(.*)$/;function printNumber(e){return e!=+e?"NaN":0===e&&1/e<0?"-0":""+e}function printSimpleValue(e,t=!1){if(null==e||!0===e||!1===e)return""+e;const r=typeof e;if("number"===r)return printNumber(e);if("string"===r)return t?`"${e}"`:e;if("function"===r)return"[Function "+(e.name||"anonymous")+"]";if("symbol"===r)return symbolToString.call(e).replace(SYMBOL_REGEXP,"Symbol($1)");const n=toString.call(e).slice(8,-1);return"Date"===n?isNaN(e.getTime())?""+e:e.toISOString(e):"Error"===n||e instanceof Error?"["+errorToString.call(e)+"]":"RegExp"===n?regExpToString.call(e):null}function printValue(e,t){let r=printSimpleValue(e,t);return null!==r?r:JSON.stringify(e,function(e,r){let n=printSimpleValue(this[e],t);return null!==n?n:r},2)}function toArray(e){return null==e?[]:[].concat(e)}let _Symbol$toStringTag,_Symbol$hasInstance,_Symbol$toStringTag2,strReg=/\$\{\s*(\w+)\s*\}/g;_Symbol$toStringTag=Symbol.toStringTag;class ValidationErrorNoStack{constructor(e,t,r,n){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[_Symbol$toStringTag]="Error",this.name="ValidationError",this.value=t,this.path=r,this.type=n,this.errors=[],this.inner=[],toArray(e).forEach(e=>{ValidationError.isError(e)?(this.errors.push(...e.errors),this.inner.push(...e.inner.length?e.inner:[e])):this.errors.push(e)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}_Symbol$hasInstance=Symbol.hasInstance,_Symbol$toStringTag2=Symbol.toStringTag;class ValidationError extends Error{static formatError(e,t){return t=Object.assign({},t,{path:t.label||t.path||"this",originalPath:t.path}),"string"==typeof e?e.replace(strReg,(e,r)=>printValue(t[r])):"function"==typeof e?e(t):e}static isError(e){return e&&"ValidationError"===e.name}constructor(e,t,r,n,a){const i=new ValidationErrorNoStack(e,t,r,n);if(a)return i;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[_Symbol$toStringTag2]="Error",this.name=i.name,this.message=i.message,this.type=i.type,this.value=i.value,this.path=i.path,this.errors=i.errors,this.inner=i.inner,Error.captureStackTrace&&Error.captureStackTrace(this,ValidationError)}static[_Symbol$hasInstance](e){return ValidationErrorNoStack[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let mixed={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:r,originalValue:n})=>{const a=null!=n&&n!==r?` (cast from the value \`${printValue(n,!0)}\`).`:".";return"mixed"!==t?`${e} must be a \`${t}\` type, but the final value was: \`${printValue(r,!0)}\``+a:`${e} must match the configured type. The validated value was: \`${printValue(r,!0)}\``+a}},string={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},number={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},date={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},boolean={isValue:"${path} field must be ${value}"},object={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},array={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},tuple={notType:e=>{const{path:t,value:r,spec:n}=e,a=n.types.length;if(Array.isArray(r)){if(r.length<a)return`${t} tuple value has too few items, expected a length of ${a} but got ${r.length} for value: \`${printValue(r,!0)}\``;if(r.length>a)return`${t} tuple value has too many items, expected a length of ${a} but got ${r.length} for value: \`${printValue(r,!0)}\``}return ValidationError.formatError(mixed.notType,e)}};var locale=Object.assign(Object.create(null),{mixed:mixed,string:string,number:number,date:date,object:object,array:array,boolean:boolean,tuple:tuple});const isSchema=e=>e&&e.__isYupSchema__;class Condition{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:n,otherwise:a}=t,i="function"==typeof r?r:(...e)=>e.every(e=>e===r);return new Condition(e,(e,t)=>{var r;let o=i(...e)?n:a;return null!=(r=null==o?void 0:o(t))?r:t})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let r=this.refs.map(e=>e.getValue(null==t?void 0:t.value,null==t?void 0:t.parent,null==t?void 0:t.context)),n=this.fn(r,e,t);if(void 0===n||n===e)return e;if(!isSchema(n))throw new TypeError("conditions must return a schema object");return n.resolve(t)}}const prefixes={context:"$",value:"."};class Reference{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,"string"!=typeof e)throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),""===e)throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===prefixes.context,this.isValue=this.key[0]===prefixes.value,this.isSibling=!this.isContext&&!this.isValue,this.path=this.key.slice((this.isContext?prefixes.context:this.isValue?prefixes.value:"").length),this.getter=this.path&&propertyExpr.getter(this.path,!0),this.map=t.map}getValue(e,t,r){let n=this.isContext?r:this.isValue?e:t;return this.getter&&(n=this.getter(n||{})),this.map&&(n=this.map(n)),n}cast(e,t){return this.getValue(e,null==t?void 0:t.parent,null==t?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}Reference.prototype.__isYupRef=!0;const isAbsent=e=>null==e;function createValidation(e){function t({value:t,path:r="",options:n,originalValue:a,schema:i},o,s){const{name:l,test:u,params:c,message:d,skipAbsent:h}=e;let{parent:f,context:p,abortEarly:g=i.spec.abortEarly,disableStackTrace:m=i.spec.disableStackTrace}=n;const y={value:t,parent:f,context:p};function v(e={}){const n=resolveParams(Object.assign({value:t,originalValue:a,label:i.spec.label,path:e.path||r,spec:i.spec,disableStackTrace:e.disableStackTrace||m},c,e.params),y),o=new ValidationError(ValidationError.formatError(e.message||d,n),t,n.path,e.type||l,n.disableStackTrace);return o.params=n,o}const b=g?o:s;let x={path:r,parent:f,type:l,from:n.from,createError:v,resolve:e=>resolveMaybeRef(e,y),options:n,originalValue:a,schema:i};const _=e=>{ValidationError.isError(e)?b(e):e?s(null):b(v())},w=e=>{ValidationError.isError(e)?b(e):o(e)};if(h&&isAbsent(t))return _(!0);let k;try{var S;if(k=u.call(x,t,x),"function"==typeof(null==(S=k)?void 0:S.then)){if(n.sync)throw new Error(`Validation test of type: "${x.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(k).then(_,w)}}catch(e){return void w(e)}_(k)}return t.OPTIONS=e,t}function resolveParams(e,t){if(!e)return e;for(const r of Object.keys(e))e[r]=resolveMaybeRef(e[r],t);return e}function resolveMaybeRef(e,t){return Reference.isRef(e)?e.getValue(t.value,t.parent,t.context):e}function getIn(e,t,r,n=r){let a,i,o;return t?(propertyExpr.forEach(t,(s,l,u)=>{let c=l?s.slice(1,s.length-1):s,d="tuple"===(e=e.resolve({context:n,parent:a,value:r})).type,h=u?parseInt(c,10):0;if(e.innerType||d){if(d&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(r&&h>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);a=r,r=r&&r[h],e=d?e.spec.types[h]:e.innerType}if(!u){if(!e.fields||!e.fields[c])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e.type}")`);a=r,r=r&&r[c],e=e.fields[c]}i=c,o=l?"["+s+"]":"."+s}),{schema:e,parent:a,parentPath:i}):{parent:a,parentPath:t,schema:e}}class ReferenceSet extends Set{describe(){const e=[];for(const t of this.values())e.push(Reference.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(const r of this.values())t.push(e(r));return t}clone(){return new ReferenceSet(this.values())}merge(e,t){const r=this.clone();return e.forEach(e=>r.add(e)),t.forEach(e=>r.delete(e)),r}}function clone(e,t=new Map){if(isSchema(e)||!e||"object"!=typeof e)return e;if(t.has(e))return t.get(e);let r;if(e instanceof Date)r=new Date(e.getTime()),t.set(e,r);else if(e instanceof RegExp)r=new RegExp(e),t.set(e,r);else if(Array.isArray(e)){r=new Array(e.length),t.set(e,r);for(let n=0;n<e.length;n++)r[n]=clone(e[n],t)}else if(e instanceof Map){r=new Map,t.set(e,r);for(const[n,a]of e.entries())r.set(n,clone(a,t))}else if(e instanceof Set){r=new Set,t.set(e,r);for(const n of e)r.add(clone(n,t))}else{if(!(e instanceof Object))throw Error(`Unable to clone ${e}`);r={},t.set(e,r);for(const[n,a]of Object.entries(e))r[n]=clone(a,t)}return r}function createStandardPath(e){if(null==e||!e.length)return;const t=[];let r="",n=!1,a=!1;for(let i=0;i<e.length;i++){const o=e[i];"["!==o||a?"]"!==o||a?'"'!==o?"."!==o||n||a?r+=o:r&&(t.push(r),r=""):a=!a:(r&&(/^\d+$/.test(r)?t.push(r):t.push(r.replace(/^"|"$/g,"")),r=""),n=!1):(r&&(t.push(...r.split(".").filter(Boolean)),r=""),n=!0)}return r&&t.push(...r.split(".").filter(Boolean)),t}function createStandardIssues(e,t){const r=t?`${t}.${e.path}`:e.path;return e.errors.map(e=>({message:e,path:createStandardPath(r)}))}function issuesFromValidationError(e,t){var r;if((null==(r=e.inner)||!r.length)&&e.errors.length)return createStandardIssues(e,t);const n=t?`${t}.${e.path}`:e.path;return e.inner.flatMap(e=>issuesFromValidationError(e,n))}class Schema{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new ReferenceSet,this._blacklist=new ReferenceSet,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(mixed.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},null==e?void 0:e.spec),this.withMutation(e=>{e.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=clone(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let r=e(this);return this._mutate=t,r}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&"mixed"!==this.type)throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,r=e.clone();const n=Object.assign({},t.spec,r.spec);return r.spec=n,r.internalTests=Object.assign({},t.internalTests,r.internalTests),r._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),r._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),r.tests=t.tests,r.exclusiveTests=t.exclusiveTests,r.withMutation(t=>{e.tests.forEach(e=>{t.test(e.OPTIONS)})}),r.transforms=[...t.transforms,...r.transforms],r}isType(e){return null==e?!(!this.spec.nullable||null!==e)||!(!this.spec.optional||void 0!==e):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let r=t.conditions;t=t.clone(),t.conditions=[],t=r.reduce((t,r)=>r.resolve(t,e),t),t=t.resolve(e)}return t}resolveOptions(e){var t,r,n,a;return Object.assign({},e,{from:e.from||[],strict:null!=(t=e.strict)?t:this.spec.strict,abortEarly:null!=(r=e.abortEarly)?r:this.spec.abortEarly,recursive:null!=(n=e.recursive)?n:this.spec.recursive,disableStackTrace:null!=(a=e.disableStackTrace)?a:this.spec.disableStackTrace})}cast(e,t={}){let r=this.resolve(Object.assign({value:e},t)),n="ignore-optionality"===t.assert,a=r._cast(e,t);if(!1!==t.assert&&!r.isType(a)){if(n&&isAbsent(a))return a;let i=printValue(e),o=printValue(a);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}". \n\nattempted value: ${i} \n`+(o!==i?`result of cast: ${o}`:""))}return a}_cast(e,t){let r=void 0===e?e:this.transforms.reduce((t,r)=>r.call(this,t,e,this),e);return void 0===r&&(r=this.getDefault(t)),r}_validate(e,t={},r,n){let{path:a,originalValue:i=e,strict:o=this.spec.strict}=t,s=e;o||(s=this._cast(s,Object.assign({assert:!1},t)));let l=[];for(let e of Object.values(this.internalTests))e&&l.push(e);this.runTests({path:a,value:s,originalValue:i,options:t,tests:l},r,e=>{if(e.length)return n(e,s);this.runTests({path:a,value:s,originalValue:i,options:t,tests:this.tests},r,n)})}runTests(e,t,r){let n=!1,{tests:a,value:i,originalValue:o,path:s,options:l}=e,u=e=>{n||(n=!0,t(e,i))},c=e=>{n||(n=!0,r(e,i))},d=a.length,h=[];if(!d)return c([]);let f={value:i,originalValue:o,path:s,options:l,schema:this};for(let e=0;e<a.length;e++)(0,a[e])(f,u,function(e){e&&(Array.isArray(e)?h.push(...e):h.push(e)),--d<=0&&c(h)})}asNestedTest({key:e,index:t,parent:r,parentPath:n,originalParent:a,options:i}){const o=null!=e?e:t;if(null==o)throw TypeError("Must include `key` or `index` for nested validations");const s="number"==typeof o;let l=r[o];const u=Object.assign({},i,{strict:!0,parent:r,value:l,originalValue:a[o],key:void 0,[s?"index":"key"]:o,path:s||o.includes(".")?`${n||""}[${s?o:`"${o}"`}]`:(n?`${n}.`:"")+e});return(e,t,r)=>this.resolve(u)._validate(l,u,t,r)}validate(e,t){var r;let n=this.resolve(Object.assign({},t,{value:e})),a=null!=(r=null==t?void 0:t.disableStackTrace)?r:n.spec.disableStackTrace;return new Promise((r,i)=>n._validate(e,t,(e,t)=>{ValidationError.isError(e)&&(e.value=t),i(e)},(e,t)=>{e.length?i(new ValidationError(e,t,void 0,void 0,a)):r(t)}))}validateSync(e,t){var r;let n,a=this.resolve(Object.assign({},t,{value:e})),i=null!=(r=null==t?void 0:t.disableStackTrace)?r:a.spec.disableStackTrace;return a._validate(e,Object.assign({},t,{sync:!0}),(e,t)=>{throw ValidationError.isError(e)&&(e.value=t),e},(t,r)=>{if(t.length)throw new ValidationError(t,e,void 0,void 0,i);n=r}),n}isValid(e,t){return this.validate(e,t).then(()=>!0,e=>{if(ValidationError.isError(e))return!1;throw e})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(e){if(ValidationError.isError(e))return!1;throw e}}_getDefault(e){let t=this.spec.default;return null==t?t:"function"==typeof t?t.call(this,e):clone(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return 0===arguments.length?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){const r=this.clone({nullable:e});return r.internalTests.nullable=createValidation({message:t,name:"nullable",test(e){return null!==e||this.schema.spec.nullable}}),r}optionality(e,t){const r=this.clone({optional:e});return r.internalTests.optionality=createValidation({message:t,name:"optionality",test(e){return void 0!==e||this.schema.spec.optional}}),r}optional(){return this.optionality(!0)}defined(e=mixed.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=mixed.notNull){return this.nullability(!1,e)}required(e=mixed.required){return this.clone().withMutation(t=>t.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(t=1===e.length?"function"==typeof e[0]?{test:e[0]}:e[0]:2===e.length?{name:e[0],test:e[1]}:{name:e[0],message:e[1],test:e[2]},void 0===t.message&&(t.message=mixed.default),"function"!=typeof t.test)throw new TypeError("`test` is a required parameters");let r=this.clone(),n=createValidation(t),a=t.exclusive||t.name&&!0===r.exclusiveTests[t.name];if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(r.exclusiveTests[t.name]=!!t.exclusive),r.tests=r.tests.filter(e=>{if(e.OPTIONS.name===t.name){if(a)return!1;if(e.OPTIONS.test===n.OPTIONS.test)return!1}return!0}),r.tests.push(n),r}when(e,t){Array.isArray(e)||"string"==typeof e||(t=e,e=".");let r=this.clone(),n=toArray(e).map(e=>new Reference(e));return n.forEach(e=>{e.isSibling&&r.deps.push(e.key)}),r.conditions.push("function"==typeof t?new Condition(n,t):Condition.fromOptions(n,t)),r}typeError(e){let t=this.clone();return t.internalTests.typeError=createValidation({message:e,name:"typeError",skipAbsent:!0,test(e){return!!this.schema._typeCheck(e)||this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=mixed.oneOf){let r=this.clone();return e.forEach(e=>{r._whitelist.add(e),r._blacklist.delete(e)}),r.internalTests.whiteList=createValidation({message:t,name:"oneOf",skipAbsent:!0,test(e){let t=this.schema._whitelist,r=t.resolveAll(this.resolve);return!!r.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:r}})}}),r}notOneOf(e,t=mixed.notOneOf){let r=this.clone();return e.forEach(e=>{r._blacklist.add(e),r._whitelist.delete(e)}),r.internalTests.blacklist=createValidation({message:t,name:"notOneOf",test(e){let t=this.schema._blacklist,r=t.resolveAll(this.resolve);return!r.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:r}})}}),r}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){const t=(e?this.resolve(e):this).clone(),{label:r,meta:n,optional:a,nullable:i}=t.spec;return{meta:n,label:r,optional:a,nullable:i,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.filter((e,t,r)=>r.findIndex(t=>t.OPTIONS.name===e.OPTIONS.name)===t).map(t=>{const r=t.OPTIONS.params&&e?resolveParams(Object.assign({},t.OPTIONS.params),e):t.OPTIONS.params;return{name:t.OPTIONS.name,params:r}})}}get"~standard"(){const e=this;return{version:1,vendor:"yup",async validate(t){try{return{value:await e.validate(t,{abortEarly:!1})}}catch(e){if(e instanceof ValidationError)return{issues:issuesFromValidationError(e)};throw e}}}}}Schema.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Schema.prototype[`${e}At`]=function(t,r,n={}){const{parent:a,parentPath:i,schema:o}=getIn(this,t,r,n.context);return o[e](a&&a[i],Object.assign({},n,{parent:a,path:t}))};for(const e of["equals","is"])Schema.prototype[e]=Schema.prototype.oneOf;for(const e of["not","nope"])Schema.prototype[e]=Schema.prototype.notOneOf;const isoReg=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function parseIsoDate(e){const t=parseDateStruct(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(void 0===t.z&&void 0===t.plusMinus)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let r=0;return"Z"!==t.z&&void 0!==t.plusMinus&&(r=60*t.hourOffset+t.minuteOffset,"+"===t.plusMinus&&(r=0-r)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+r,t.second,t.millisecond)}function parseDateStruct(e){var t,r;const n=isoReg.exec(e);return n?{year:toNumber(n[1]),month:toNumber(n[2],1)-1,day:toNumber(n[3],1),hour:toNumber(n[4]),minute:toNumber(n[5]),second:toNumber(n[6]),millisecond:n[7]?toNumber(n[7].substring(0,3)):0,precision:null!=(t=null==(r=n[7])?void 0:r.length)?t:void 0,z:n[8]||void 0,plusMinus:n[9]||void 0,hourOffset:toNumber(n[10]),minuteOffset:toNumber(n[11])}:null}function toNumber(e,t=0){return Number(e)||t}let rEmail=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,rUrl=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,rUUID=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,yearMonthDay="^\\d{4}-\\d{2}-\\d{2}",hourMinuteSecond="\\d{2}:\\d{2}:\\d{2}",zOrOffset="(([+-]\\d{2}(:?\\d{2})?)|Z)",rIsoDateTime=new RegExp(`${yearMonthDay}T${hourMinuteSecond}(\\.\\d+)?${zOrOffset}$`),isTrimmed=e=>isAbsent(e)||e===e.trim(),objStringTag={}.toString();function create$6(){return new StringSchema}class StringSchema extends Schema{constructor(){super({type:"string",check:e=>(e instanceof String&&(e=e.valueOf()),"string"==typeof e)}),this.withMutation(()=>{this.transform((e,t,r)=>{if(!r.spec.coerce||r.isType(e))return e;if(Array.isArray(e))return e;const n=null!=e&&e.toString?e.toString():e;return n===objStringTag?e:n})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||mixed.required,name:"required",skipAbsent:!0,test:e=>!!e.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(e=>"required"!==e.OPTIONS.name),e))}length(e,t=string.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(t){return t.length===this.resolve(e)}})}min(e,t=string.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(t){return t.length>=this.resolve(e)}})}max(e,t=string.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(t){return t.length<=this.resolve(e)}})}matches(e,t){let r,n,a=!1;return t&&("object"==typeof t?({excludeEmptyString:a=!1,message:r,name:n}=t):r=t),this.test({name:n||"matches",message:r||string.matches,params:{regex:e},skipAbsent:!0,test:t=>""===t&&a||-1!==t.search(e)})}email(e=string.email){return this.matches(rEmail,{name:"email",message:e,excludeEmptyString:!0})}url(e=string.url){return this.matches(rUrl,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=string.uuid){return this.matches(rUUID,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let t,r,n="";return e&&("object"==typeof e?({message:n="",allowOffset:t=!1,precision:r}=e):n=e),this.matches(rIsoDateTime,{name:"datetime",message:n||string.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||string.datetime_offset,params:{allowOffset:t},skipAbsent:!0,test:e=>{if(!e||t)return!0;const r=parseDateStruct(e);return!!r&&!!r.z}}).test({name:"datetime_precision",message:n||string.datetime_precision,params:{precision:r},skipAbsent:!0,test:e=>{if(!e||null==r)return!0;const t=parseDateStruct(e);return!!t&&t.precision===r}})}ensure(){return this.default("").transform(e=>null===e?"":e)}trim(e=string.trim){return this.transform(e=>null!=e?e.trim():e).test({message:e,name:"trim",test:isTrimmed})}lowercase(e=string.lowercase){return this.transform(e=>isAbsent(e)?e:e.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>isAbsent(e)||e===e.toLowerCase()})}uppercase(e=string.uppercase){return this.transform(e=>isAbsent(e)?e:e.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>isAbsent(e)||e===e.toUpperCase()})}}create$6.prototype=StringSchema.prototype;let invalidDate=new Date(""),isDate=e=>"[object Date]"===Object.prototype.toString.call(e);class DateSchema extends Schema{constructor(){super({type:"date",check:e=>isDate(e)&&!isNaN(e.getTime())}),this.withMutation(()=>{this.transform((e,t,r)=>!r.spec.coerce||r.isType(e)||null===e?e:(e=parseIsoDate(e),isNaN(e)?DateSchema.INVALID_DATE:new Date(e)))})}prepareParam(e,t){let r;if(Reference.isRef(e))r=e;else{let n=this.cast(e);if(!this._typeCheck(n))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);r=n}return r}min(e,t=date.min){let r=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(e){return e>=this.resolve(r)}})}max(e,t=date.max){let r=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(e){return e<=this.resolve(r)}})}}function sortFields(e,t=[]){let r=[],n=new Set,a=new Set(t.map(([e,t])=>`${e}-${t}`));function i(e,t){let i=propertyExpr.split(e)[0];n.add(i),a.has(`${t}-${i}`)||r.push([t,i])}for(const t of Object.keys(e)){let r=e[t];n.add(t),Reference.isRef(r)&&r.isSibling?i(r.path,t):isSchema(r)&&"deps"in r&&r.deps.forEach(e=>i(e,t))}return toposort_1.array(Array.from(n),r).reverse()}function findIndex(e,t){let r=Infinity;return e.some((e,n)=>{var a;if(null!=(a=t.path)&&a.includes(e))return r=n,!0}),r}function sortByKeyOrder(e){return(t,r)=>findIndex(e,t)-findIndex(e,r)}DateSchema.INVALID_DATE=invalidDate;const parseJson=(e,t,r)=>{if("string"!=typeof e)return e;let n=e;try{n=JSON.parse(e)}catch(e){}return r.isType(n)?n:e};function deepPartial(e){if("fields"in e){const t={};for(const[r,n]of Object.entries(e.fields))t[r]=deepPartial(n);return e.setFields(t)}if("array"===e.type){const t=e.optional();return t.innerType&&(t.innerType=deepPartial(t.innerType)),t}return"tuple"===e.type?e.optional().clone({types:e.spec.types.map(deepPartial)}):"optional"in e?e.optional():e}const deepHas=(e,t)=>{const r=[...propertyExpr.normalizePath(t)];if(1===r.length)return r[0]in e;let n=r.pop(),a=propertyExpr.getter(propertyExpr.join(r),!0)(e);return!(!a||!(n in a))};let isObject=e=>"[object Object]"===Object.prototype.toString.call(e);function unknown(e,t){let r=Object.keys(e.fields);return Object.keys(t).filter(e=>-1===r.indexOf(e))}const defaultSort=sortByKeyOrder([]);function create$3(e){return new ObjectSchema(e)}class ObjectSchema extends Schema{constructor(e){super({type:"object",check:e=>isObject(e)||"function"==typeof e}),this.fields=Object.create(null),this._sortErrors=defaultSort,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,t={}){var r;let n=super._cast(e,t);if(void 0===n)return this.getDefault(t);if(!this._typeCheck(n))return n;let a=this.fields,i=null!=(r=t.stripUnknown)?r:this.spec.noUnknown,o=[].concat(this._nodes,Object.keys(n).filter(e=>!this._nodes.includes(e))),s={},l=Object.assign({},t,{parent:s,__validating:t.__validating||!1}),u=!1;for(const e of o){let r=a[e],o=e in n;if(r){let a,i=n[e];l.path=(t.path?`${t.path}.`:"")+e,r=r.resolve({value:i,context:t.context,parent:s});let o=r instanceof Schema?r.spec:void 0,c=null==o?void 0:o.strict;if(null!=o&&o.strip){u=u||e in n;continue}a=t.__validating&&c?n[e]:r.cast(n[e],l),void 0!==a&&(s[e]=a)}else o&&!i&&(s[e]=n[e]);o===e in s&&s[e]===n[e]||(u=!0)}return u?s:n}_validate(e,t={},r,n){let{from:a=[],originalValue:i=e,recursive:o=this.spec.recursive}=t;t.from=[{schema:this,value:i},...a],t.__validating=!0,t.originalValue=i,super._validate(e,t,r,(e,a)=>{if(!o||!isObject(a))return void n(e,a);i=i||a;let s=[];for(let e of this._nodes){let r=this.fields[e];r&&!Reference.isRef(r)&&s.push(r.asNestedTest({options:t,key:e,parent:a,parentPath:t.path,originalParent:i}))}this.runTests({tests:s,value:a,originalValue:i,options:t},r,t=>{n(t.sort(this._sortErrors).concat(e),a)})})}clone(e){const t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),r=t.fields;for(let[e,t]of Object.entries(this.fields)){const n=r[e];r[e]=void 0===n?t:n}return t.withMutation(t=>t.setFields(r,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach(r=>{var n;const a=this.fields[r];let i=e;null!=(n=i)&&n.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[r]})),t[r]=a&&"getDefault"in a?a.getDefault(i):void 0}),t}setFields(e,t){let r=this.clone();return r.fields=e,r._nodes=sortFields(e,t),r._sortErrors=sortByKeyOrder(Object.keys(e)),t&&(r._excludedEdges=t),r}shape(e,t=[]){return this.clone().withMutation(r=>{let n=r._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),n=[...r._excludedEdges,...t]),r.setFields(Object.assign(r.fields,e),n)})}partial(){const e={};for(const[t,r]of Object.entries(this.fields))e[t]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(e)}deepPartial(){return deepPartial(this)}pick(e){const t={};for(const r of e)this.fields[r]&&(t[r]=this.fields[r]);return this.setFields(t,this._excludedEdges.filter(([t,r])=>e.includes(t)&&e.includes(r)))}omit(e){const t=[];for(const r of Object.keys(this.fields))e.includes(r)||t.push(r);return this.pick(t)}from(e,t,r){let n=propertyExpr.getter(e,!0);return this.transform(a=>{if(!a)return a;let i=a;return deepHas(a,e)&&(i=Object.assign({},a),r||delete i[e],i[t]=n(a)),i})}json(){return this.transform(parseJson)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||object.exact,test(e){if(null==e)return!0;const t=unknown(this.schema,e);return 0===t.length||this.createError({params:{properties:t.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,t=object.noUnknown){"boolean"!=typeof e&&(t=e,e=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:t,test(t){if(null==t)return!0;const r=unknown(this.schema,t);return!e||0===r.length||this.createError({params:{unknown:r.join(", ")}})}});return r.spec.noUnknown=e,r}unknown(e=!0,t=object.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>{if(!t)return t;const r={};for(const n of Object.keys(t))r[e(n)]=t[n];return r})}camelCase(){return this.transformKeys(tinyCase.camelCase)}snakeCase(){return this.transformKeys(tinyCase.snakeCase)}constantCase(){return this.transformKeys(e=>tinyCase.snakeCase(e).toUpperCase())}describe(e){const t=(e?this.resolve(e):this).clone(),r=super.describe(e);r.fields={};for(const[a,i]of Object.entries(t.fields)){var n;let t=e;null!=(n=t)&&n.value&&(t=Object.assign({},t,{parent:t.value,value:t.value[a]})),r.fields[a]=i.describe(t)}return r}}function create$2(e){return new ArraySchema(e)}create$3.prototype=ObjectSchema.prototype;class ArraySchema extends Schema{constructor(e){super({type:"array",spec:{types:e},check:e=>Array.isArray(e)}),this.innerType=void 0,this.innerType=e}_cast(e,t){const r=super._cast(e,t);if(!this._typeCheck(r)||!this.innerType)return r;let n=!1;const a=r.map((e,r)=>{const a=this.innerType.cast(e,Object.assign({},t,{path:`${t.path||""}[${r}]`}));return a!==e&&(n=!0),a});return n?a:r}_validate(e,t={},r,n){var a;let i=this.innerType,o=null!=(a=t.recursive)?a:this.spec.recursive;super._validate(e,t,r,(a,s)=>{var l;if(!o||!i||!this._typeCheck(s))return void n(a,s);let u=new Array(s.length);for(let r=0;r<s.length;r++){var c;u[r]=i.asNestedTest({options:t,index:r,parent:s,parentPath:t.path,originalParent:null!=(c=t.originalValue)?c:e})}this.runTests({value:s,tests:u,originalValue:null!=(l=t.originalValue)?l:e,options:t},r,e=>n(e.concat(a),s))})}clone(e){const t=super.clone(e);return t.innerType=this.innerType,t}json(){return this.transform(parseJson)}concat(e){let t=super.concat(e);return t.innerType=this.innerType,e.innerType&&(t.innerType=t.innerType?t.innerType.concat(e.innerType):e.innerType),t}of(e){let t=this.clone();if(!isSchema(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+printValue(e));return t.innerType=e,t.spec=Object.assign({},t.spec,{types:e}),t}length(e,t=array.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(t){return t.length===this.resolve(e)}})}min(e,t){return this.test({message:t=t||array.min,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(t){return t.length>=this.resolve(e)}})}max(e,t){return this.test({message:t=t||array.max,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(t){return t.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,t)=>this._typeCheck(e)?e:null==t?[]:[].concat(t))}compact(e){let t=e?(t,r,n)=>!e(t,r,n):e=>!!e;return this.transform(e=>null!=e?e.filter(t):e)}describe(e){const t=(e?this.resolve(e):this).clone(),r=super.describe(e);if(t.innerType){var n;let a=e;null!=(n=a)&&n.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[0]})),r.innerType=t.innerType.describe(a)}return r}}function setLocale(e){Object.keys(e).forEach(t=>{Object.keys(e[t]).forEach(r=>{locale[t][r]=e[t][r]})})}create$2.prototype=ArraySchema.prototype;var getSettingsFormProps=function(e){return setLocale({mixed:{required:e("This field is required")}}),{initialValues:{endpointUrl:"",queriesPeriod:QueriesPeriod.CURRENT_SHIFT,prometheusQueries:[],displayedQueryParams:[],xAxisUnit:"",yAxisUnit:""},validationSchema:create$3({endpointUrl:create$6().required(),queriesPeriod:create$6().required(),prometheusQueries:create$2().of(create$3().shape({query:create$6().required(),displayName:create$6().required()})),displayedQueryParams:create$2().of(create$6().required()),xAxisUnit:create$6().required(),yAxisUnit:create$6().required()})}},migrateSettings=function(e){return satisfies(e.version||"1.0.0",">=1.2.5")?e:_extends$1({},e,{prometheusQueries:e.prometheusQueries.map(function(e){return{query:e,displayName:""}})})},_excluded=["url","wsUrl","lang","data"],Widget=function(e){var t=e.url,r=e.wsUrl,n=e.lang,a=e.data,i=_objectWithoutPropertiesLoose$1(e,_excluded),o=andoncloudDashboardToolkit.useGqlClients({url:t,wsUrl:r,lang:n}),s=o.graphqlSdk,l=o.gqlWsClient,u=React.useState(a),c=u[0],d=u[1];return React.useEffect(function(){!a&&s&&s.shifts().then(function(e){var t=e.shifts;return d(function(e){return _extends$1({},e||{},{shifts:t})})}).catch(function(){})},[a,s]),React__default.default.createElement(andoncloudWidgetBase.BaseWidget,_extends$1({url:t,lang:n,locales:resources,data:c,gqlClients:{graphqlSdk:s,gqlWsClient:l},WidgetView:WidgetView,getSettingsFormProps:getSettingsFormProps,SettingsFormContent:SettingsFormContent,migrateSettings:migrateSettings,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;
1
+ var React=require("react"),andoncloudDashboardToolkit=require("andoncloud-dashboard-toolkit"),andoncloudWidgetBase=require("andoncloud-widget-base"),reactI18next=require("react-i18next"),iconsMaterial=require("@mui/icons-material"),material=require("@mui/material");require("react-is");var jsxRuntime=require("react/jsx-runtime");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var React__default=/*#__PURE__*/_interopDefaultLegacy(React);function _extends$1(){return _extends$1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_extends$1.apply(null,arguments)}function _objectWithoutPropertiesLoose$1(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}var Period$1="Period",Query$1="Query",Name$1="Name",en={"Previous shift":"Previous shift","Current shift":"Current shift","Endpoint URL":"Endpoint URL",Period:Period$1,Query:Query$1,Name:Name$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"},Period="Okres",Query="Zapytanie",Name="Nazwa",pl={"Previous shift":"Poprzednia zmiana","Current shift":"Obecna zmiana","Endpoint URL":"Adres URL",Period:Period,Query:Query,Name:Name,"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"},resources={en:{translation:en},pl:{translation:pl}},LIBRARY_VERSION="1.3.3",freeGlobal$1="object"==typeof global&&global&&global.Object===Object&&global,freeGlobal$2=freeGlobal$1,freeSelf$1="object"==typeof self&&self&&self.Object===Object&&self,root$1=freeGlobal$2||freeSelf$1||Function("return this")(),root$2=root$1,Symbol$2=root$2.Symbol,Symbol$3=Symbol$2,objectProto$d=Object.prototype,hasOwnProperty$a=objectProto$d.hasOwnProperty,nativeObjectToString$1=objectProto$d.toString,symToStringTag$1=Symbol$3?Symbol$3.toStringTag:void 0;function getRawTag(e){var t=hasOwnProperty$a.call(e,symToStringTag$1),r=e[symToStringTag$1];try{e[symToStringTag$1]=void 0;var n=!0}catch(e){}var a=nativeObjectToString$1.call(e);return n&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),a}var objectProto$c=Object.prototype,nativeObjectToString=objectProto$c.toString;function objectToString$1(e){return nativeObjectToString.call(e)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=Symbol$3?Symbol$3.toStringTag:void 0;function baseGetTag(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString$1(e)}function overArg(e,t){return function(r){return e(t(r))}}var getPrototype=overArg(Object.getPrototypeOf,Object),getPrototype$1=getPrototype;function isObjectLike$1(e){return null!=e&&"object"==typeof e}function listCacheClear(){this.__data__=[],this.size=0}function eq(e,t){return e===t||e!=e&&t!=t}function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}var arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(e){var t=this.__data__,r=assocIndexOf(t,e);return!(r<0||(r==t.length-1?t.pop():splice.call(t,r,1),--this.size,0))}function listCacheGet(e){var t=this.__data__,r=assocIndexOf(t,e);return r<0?void 0:t[r][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function ListCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function stackClear(){this.__data__=new ListCache,this.size=0}function stackDelete(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function stackGet(e){return this.__data__.get(e)}function stackHas(e){return this.__data__.has(e)}function isObject$3(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}ListCache.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet;var asyncTag="[object AsyncFunction]",funcTag$3="[object Function]",genTag$2="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction$2(e){if(!isObject$3(e))return!1;var t=baseGetTag(e);return t==funcTag$3||t==genTag$2||t==asyncTag||t==proxyTag}var coreJsData=root$2["__core-js_shared__"],coreJsData$1=coreJsData,maskSrcKey=(uid=/[^.]+$/.exec(coreJsData$1&&coreJsData$1.keys&&coreJsData$1.keys.IE_PROTO||""),uid?"Symbol(src)_1."+uid:""),uid;function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}var funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource(e){if(null!=e){try{return funcToString$1.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto=Function.prototype,objectProto$b=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$9=objectProto$b.hasOwnProperty,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$9).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative(e){return!(!isObject$3(e)||isMasked(e))&&(isFunction$2(e)?reIsNative:reIsHostCtor).test(toSource(e))}function getValue(e,t){return null==e?void 0:e[t]}function getNative(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}var Map$1=getNative(root$2,"Map"),Map$2=Map$1,nativeCreate=getNative(Object,"create"),nativeCreate$1=nativeCreate;function hashClear(){this.__data__=nativeCreate$1?nativeCreate$1(null):{},this.size=0}function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var HASH_UNDEFINED$1="__lodash_hash_undefined__",objectProto$a=Object.prototype,hasOwnProperty$8=objectProto$a.hasOwnProperty;function hashGet(e){var t=this.__data__;if(nativeCreate$1){var r=t[e];return r===HASH_UNDEFINED$1?void 0:r}return hasOwnProperty$8.call(t,e)?t[e]:void 0}var objectProto$9=Object.prototype,hasOwnProperty$7=objectProto$9.hasOwnProperty;function hashHas(e){var t=this.__data__;return nativeCreate$1?void 0!==t[e]:hasOwnProperty$7.call(t,e)}var HASH_UNDEFINED="__lodash_hash_undefined__";function hashSet(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=nativeCreate$1&&void 0===t?HASH_UNDEFINED:t,this}function Hash(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$2||ListCache),string:new Hash}}function isKeyable(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function getMapData(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=t?1:0,t}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){var r=getMapData(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function MapCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var LARGE_ARRAY_SIZE=200;function stackSet(e,t){var r=this.__data__;if(r instanceof ListCache){var n=r.__data__;if(!Map$2||n.length<LARGE_ARRAY_SIZE-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new MapCache(n)}return r.set(e,t),this.size=r.size,this}function Stack(e){var t=this.__data__=new ListCache(e);this.size=t.size}function arrayEach(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}Stack.prototype.clear=stackClear,Stack.prototype.delete=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var defineProperty=function(){try{var e=getNative(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),defineProperty$1=defineProperty;function baseAssignValue(e,t,r){"__proto__"==t&&defineProperty$1?defineProperty$1(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var objectProto$8=Object.prototype,hasOwnProperty$6=objectProto$8.hasOwnProperty;function assignValue(e,t,r){var n=e[t];hasOwnProperty$6.call(e,t)&&eq(n,r)&&(void 0!==r||t in e)||baseAssignValue(e,t,r)}function copyObject(e,t,r,n){var a=!r;r||(r={});for(var i=-1,o=t.length;++i<o;){var s=t[i],l=n?n(r[s],e[s],s,r,e):void 0;void 0===l&&(l=e[s]),a?baseAssignValue(r,s,l):assignValue(r,s,l)}return r}function baseTimes(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var argsTag$3="[object Arguments]";function baseIsArguments(e){return isObjectLike$1(e)&&baseGetTag(e)==argsTag$3}var objectProto$7=Object.prototype,hasOwnProperty$5=objectProto$7.hasOwnProperty,propertyIsEnumerable$2=objectProto$7.propertyIsEnumerable,isArguments$1=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike$1(e)&&hasOwnProperty$5.call(e,"callee")&&!propertyIsEnumerable$2.call(e,"callee")},isArguments$2=isArguments$1,isArray$2=Array.isArray,isArray$3=isArray$2;function stubFalse(){return!1}var freeExports$2="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule$2=freeExports$2&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports$2=freeModule$2&&freeModule$2.exports===freeExports$2,Buffer$1=moduleExports$2?root$2.Buffer:void 0,nativeIsBuffer=Buffer$1?Buffer$1.isBuffer:void 0,isBuffer=nativeIsBuffer||stubFalse,isBuffer$1=isBuffer,MAX_SAFE_INTEGER$2=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex(e,t){var r=typeof e;return!!(t=null==t?MAX_SAFE_INTEGER$2:t)&&("number"==r||"symbol"!=r&&reIsUint.test(e))&&e>-1&&e%1==0&&e<t}var MAX_SAFE_INTEGER$1=9007199254740991;function isLength$1(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=MAX_SAFE_INTEGER$1}var argsTag$2="[object Arguments]",arrayTag$1="[object Array]",boolTag$2="[object Boolean]",dateTag$2="[object Date]",errorTag$1="[object Error]",funcTag$2="[object Function]",mapTag$4="[object Map]",numberTag$2="[object Number]",objectTag$2="[object Object]",regexpTag$2="[object RegExp]",setTag$4="[object Set]",stringTag$2="[object String]",weakMapTag$2="[object WeakMap]",arrayBufferTag$2="[object ArrayBuffer]",dataViewTag$3="[object DataView]",float32Tag$2="[object Float32Array]",float64Tag$2="[object Float64Array]",int8Tag$2="[object Int8Array]",int16Tag$2="[object Int16Array]",int32Tag$2="[object Int32Array]",uint8Tag$2="[object Uint8Array]",uint8ClampedTag$2="[object Uint8ClampedArray]",uint16Tag$2="[object Uint16Array]",uint32Tag$2="[object Uint32Array]",typedArrayTags={};function baseIsTypedArray(e){return isObjectLike$1(e)&&isLength$1(e.length)&&!!typedArrayTags[baseGetTag(e)]}function baseUnary(e){return function(t){return e(t)}}typedArrayTags[float32Tag$2]=typedArrayTags[float64Tag$2]=typedArrayTags[int8Tag$2]=typedArrayTags[int16Tag$2]=typedArrayTags[int32Tag$2]=typedArrayTags[uint8Tag$2]=typedArrayTags[uint8ClampedTag$2]=typedArrayTags[uint16Tag$2]=typedArrayTags[uint32Tag$2]=!0,typedArrayTags[argsTag$2]=typedArrayTags[arrayTag$1]=typedArrayTags[arrayBufferTag$2]=typedArrayTags[boolTag$2]=typedArrayTags[dataViewTag$3]=typedArrayTags[dateTag$2]=typedArrayTags[errorTag$1]=typedArrayTags[funcTag$2]=typedArrayTags[mapTag$4]=typedArrayTags[numberTag$2]=typedArrayTags[objectTag$2]=typedArrayTags[regexpTag$2]=typedArrayTags[setTag$4]=typedArrayTags[stringTag$2]=typedArrayTags[weakMapTag$2]=!1;var freeExports$1="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule$1=freeExports$1&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports$1=freeModule$1&&freeModule$1.exports===freeExports$1,freeProcess=moduleExports$1&&freeGlobal$2.process,nodeUtil=function(){try{return freeModule$1&&freeModule$1.require&&freeModule$1.require("util").types||freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e){}}(),nodeUtil$1=nodeUtil,nodeIsTypedArray=nodeUtil$1&&nodeUtil$1.isTypedArray,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray,isTypedArray$1=isTypedArray,objectProto$6=Object.prototype,hasOwnProperty$4=objectProto$6.hasOwnProperty;function arrayLikeKeys(e,t){var r=isArray$3(e),n=!r&&isArguments$2(e),a=!r&&!n&&isBuffer$1(e),i=!r&&!n&&!a&&isTypedArray$1(e),o=r||n||a||i,s=o?baseTimes(e.length,String):[],l=s.length;for(var u in e)!t&&!hasOwnProperty$4.call(e,u)||o&&("length"==u||a&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||isIndex(u,l))||s.push(u);return s}var objectProto$5=Object.prototype;function isPrototype(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||objectProto$5)}var nativeKeys=overArg(Object.keys,Object),nativeKeys$1=nativeKeys,objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty;function baseKeys(e){if(!isPrototype(e))return nativeKeys$1(e);var t=[];for(var r in Object(e))hasOwnProperty$3.call(e,r)&&"constructor"!=r&&t.push(r);return t}function isArrayLike$1(e){return null!=e&&isLength$1(e.length)&&!isFunction$2(e)}function keys(e){return isArrayLike$1(e)?arrayLikeKeys(e):baseKeys(e)}function baseAssign(e,t){return e&&copyObject(t,keys(t),e)}function nativeKeysIn(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}var objectProto$3=Object.prototype,hasOwnProperty$2=objectProto$3.hasOwnProperty;function baseKeysIn(e){if(!isObject$3(e))return nativeKeysIn(e);var t=isPrototype(e),r=[];for(var n in e)("constructor"!=n||!t&&hasOwnProperty$2.call(e,n))&&r.push(n);return r}function keysIn(e){return isArrayLike$1(e)?arrayLikeKeys(e,!0):baseKeysIn(e)}function baseAssignIn(e,t){return e&&copyObject(t,keysIn(t),e)}var freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,Buffer=moduleExports?root$2.Buffer:void 0,allocUnsafe=Buffer?Buffer.allocUnsafe:void 0;function cloneBuffer(e,t){if(t)return e.slice();var r=e.length,n=allocUnsafe?allocUnsafe(r):new e.constructor(r);return e.copy(n),n}function copyArray(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function arrayFilter(e,t){for(var r=-1,n=null==e?0:e.length,a=0,i=[];++r<n;){var o=e[r];t(o,r,e)&&(i[a++]=o)}return i}function stubArray(){return[]}var objectProto$2=Object.prototype,propertyIsEnumerable$1=objectProto$2.propertyIsEnumerable,nativeGetSymbols$1=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols$1?function(e){return null==e?[]:(e=Object(e),arrayFilter(nativeGetSymbols$1(e),function(t){return propertyIsEnumerable$1.call(e,t)}))}:stubArray,getSymbols$1=getSymbols;function copySymbols(e,t){return copyObject(e,getSymbols$1(e),t)}function arrayPush$1(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}var nativeGetSymbols=Object.getOwnPropertySymbols,getSymbolsIn=nativeGetSymbols?function(e){for(var t=[];e;)arrayPush$1(t,getSymbols$1(e)),e=getPrototype$1(e);return t}:stubArray,getSymbolsIn$1=getSymbolsIn;function copySymbolsIn(e,t){return copyObject(e,getSymbolsIn$1(e),t)}function baseGetAllKeys(e,t,r){var n=t(e);return isArray$3(e)?n:arrayPush$1(n,r(e))}function getAllKeys(e){return baseGetAllKeys(e,keys,getSymbols$1)}function getAllKeysIn(e){return baseGetAllKeys(e,keysIn,getSymbolsIn$1)}var DataView=getNative(root$2,"DataView"),DataView$1=DataView,Promise$1=getNative(root$2,"Promise"),Promise$2=Promise$1,Set$1=getNative(root$2,"Set"),Set$2=Set$1,WeakMap=getNative(root$2,"WeakMap"),WeakMap$1=WeakMap,mapTag$3="[object Map]",objectTag$1="[object Object]",promiseTag="[object Promise]",setTag$3="[object Set]",weakMapTag$1="[object WeakMap]",dataViewTag$2="[object DataView]",dataViewCtorString=toSource(DataView$1),mapCtorString=toSource(Map$2),promiseCtorString=toSource(Promise$2),setCtorString=toSource(Set$2),weakMapCtorString=toSource(WeakMap$1),getTag=baseGetTag;(DataView$1&&getTag(new DataView$1(new ArrayBuffer(1)))!=dataViewTag$2||Map$2&&getTag(new Map$2)!=mapTag$3||Promise$2&&getTag(Promise$2.resolve())!=promiseTag||Set$2&&getTag(new Set$2)!=setTag$3||WeakMap$1&&getTag(new WeakMap$1)!=weakMapTag$1)&&(getTag=function(e){var t=baseGetTag(e),r=t==objectTag$1?e.constructor:void 0,n=r?toSource(r):"";if(n)switch(n){case dataViewCtorString:return dataViewTag$2;case mapCtorString:return mapTag$3;case promiseCtorString:return promiseTag;case setCtorString:return setTag$3;case weakMapCtorString:return weakMapTag$1}return t});var getTag$1=getTag,objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function initCloneArray(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&hasOwnProperty$1.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var Uint8Array=root$2.Uint8Array,Uint8Array$1=Uint8Array;function cloneArrayBuffer(e){var t=new e.constructor(e.byteLength);return new Uint8Array$1(t).set(new Uint8Array$1(e)),t}function cloneDataView(e,t){var r=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var reFlags=/\w*$/;function cloneRegExp(e){var t=new e.constructor(e.source,reFlags.exec(e));return t.lastIndex=e.lastIndex,t}var symbolProto$1=Symbol$3?Symbol$3.prototype:void 0,symbolValueOf=symbolProto$1?symbolProto$1.valueOf:void 0;function cloneSymbol(e){return symbolValueOf?Object(symbolValueOf.call(e)):{}}function cloneTypedArray(e,t){var r=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var boolTag$1="[object Boolean]",dateTag$1="[object Date]",mapTag$2="[object Map]",numberTag$1="[object Number]",regexpTag$1="[object RegExp]",setTag$2="[object Set]",stringTag$1="[object String]",symbolTag$3="[object Symbol]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$1="[object DataView]",float32Tag$1="[object Float32Array]",float64Tag$1="[object Float64Array]",int8Tag$1="[object Int8Array]",int16Tag$1="[object Int16Array]",int32Tag$1="[object Int32Array]",uint8Tag$1="[object Uint8Array]",uint8ClampedTag$1="[object Uint8ClampedArray]",uint16Tag$1="[object Uint16Array]",uint32Tag$1="[object Uint32Array]";function initCloneByTag(e,t,r){var n=e.constructor;switch(t){case arrayBufferTag$1:return cloneArrayBuffer(e);case boolTag$1:case dateTag$1:return new n(+e);case dataViewTag$1:return cloneDataView(e,r);case float32Tag$1:case float64Tag$1:case int8Tag$1:case int16Tag$1:case int32Tag$1:case uint8Tag$1:case uint8ClampedTag$1:case uint16Tag$1:case uint32Tag$1:return cloneTypedArray(e,r);case mapTag$2:return new n;case numberTag$1:case stringTag$1:return new n(e);case regexpTag$1:return cloneRegExp(e);case setTag$2:return new n;case symbolTag$3:return cloneSymbol(e)}}var objectCreate=Object.create,baseCreate=function(){function e(){}return function(t){if(!isObject$3(t))return{};if(objectCreate)return objectCreate(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),baseCreate$1=baseCreate;function initCloneObject(e){return"function"!=typeof e.constructor||isPrototype(e)?{}:baseCreate$1(getPrototype$1(e))}var mapTag$1="[object Map]";function baseIsMap(e){return isObjectLike$1(e)&&getTag$1(e)==mapTag$1}var nodeIsMap=nodeUtil$1&&nodeUtil$1.isMap,isMap=nodeIsMap?baseUnary(nodeIsMap):baseIsMap,isMap$1=isMap,setTag$1="[object Set]";function baseIsSet(e){return isObjectLike$1(e)&&getTag$1(e)==setTag$1}var nodeIsSet=nodeUtil$1&&nodeUtil$1.isSet,isSet=nodeIsSet?baseUnary(nodeIsSet):baseIsSet,isSet$1=isSet,CLONE_DEEP_FLAG$1=1,CLONE_FLAT_FLAG=2,CLONE_SYMBOLS_FLAG$2=4,argsTag$1="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag$1="[object Function]",genTag$1="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag$2="[object Symbol]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",cloneableTags={};function baseClone(e,t,r,n,a,i){var o,s=t&CLONE_DEEP_FLAG$1,l=t&CLONE_FLAT_FLAG,u=t&CLONE_SYMBOLS_FLAG$2;if(r&&(o=a?r(e,n,a,i):r(e)),void 0!==o)return o;if(!isObject$3(e))return e;var c=isArray$3(e);if(c){if(o=initCloneArray(e),!s)return copyArray(e,o)}else{var d=getTag$1(e),h=d==funcTag$1||d==genTag$1;if(isBuffer$1(e))return cloneBuffer(e,s);if(d==objectTag||d==argsTag$1||h&&!a){if(o=l||h?{}:initCloneObject(e),!s)return l?copySymbolsIn(e,baseAssignIn(o,e)):copySymbols(e,baseAssign(o,e))}else{if(!cloneableTags[d])return a?e:{};o=initCloneByTag(e,d,s)}}i||(i=new Stack);var f=i.get(e);if(f)return f;i.set(e,o),isSet$1(e)?e.forEach(function(n){o.add(baseClone(n,t,r,n,e,i))}):isMap$1(e)&&e.forEach(function(n,a){o.set(a,baseClone(n,t,r,a,e,i))});var p=c?void 0:(u?l?getAllKeysIn:getAllKeys:l?keysIn:keys)(e);return arrayEach(p||e,function(n,a){p&&(n=e[a=n]),assignValue(o,a,baseClone(n,t,r,a,e,i))}),o}cloneableTags[argsTag$1]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[dataViewTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[setTag]=cloneableTags[stringTag]=cloneableTags[symbolTag$2]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=!0,cloneableTags[errorTag]=cloneableTags[funcTag$1]=cloneableTags[weakMapTag]=!1;var CLONE_DEEP_FLAG=1,CLONE_SYMBOLS_FLAG$1=4;function cloneDeep(e){return baseClone(e,CLONE_DEEP_FLAG|CLONE_SYMBOLS_FLAG$1)}var isArray$1=Array.isArray,keyList=Object.keys,hasProp=Object.prototype.hasOwnProperty,hasElementType="undefined"!=typeof Element;function equal(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var r,n,a,i=isArray$1(e),o=isArray$1(t);if(i&&o){if((n=e.length)!=t.length)return!1;for(r=n;0!==r--;)if(!equal(e[r],t[r]))return!1;return!0}if(i!=o)return!1;var s=e instanceof Date,l=t instanceof Date;if(s!=l)return!1;if(s&&l)return e.getTime()==t.getTime();var u=e instanceof RegExp,c=t instanceof RegExp;if(u!=c)return!1;if(u&&c)return e.toString()==t.toString();var d=keyList(e);if((n=d.length)!==keyList(t).length)return!1;for(r=n;0!==r--;)if(!hasProp.call(t,d[r]))return!1;if(hasElementType&&e instanceof Element&&t instanceof Element)return e===t;for(r=n;0!==r--;)if(!("_owner"===(a=d[r])&&e.$$typeof||equal(e[a],t[a])))return!1;return!0}return e!=e&&t!=t}var reactFastCompare=function(e,t){try{return equal(e,t)}catch(e){if(e.message&&e.message.match(/stack|recursion/i)||-2146828260===e.number)return console.warn("Warning: react-fast-compare does not handle circular references.",e.name,e.message),!1;throw e}},isProduction="production"==='{NODE_ENV:"production"}'.NODE_ENV;function warning(e,t){if(!isProduction){if(e)return;var r="Warning: "+t;"undefined"!=typeof console&&console.warn(r);try{throw Error(r)}catch(e){}}}var CLONE_SYMBOLS_FLAG=4;function clone$1(e){return baseClone(e,CLONE_SYMBOLS_FLAG)}function arrayMap$1(e,t){for(var r=-1,n=null==e?0:e.length,a=Array(n);++r<n;)a[r]=t(e[r],r,e);return a}var symbolTag$1="[object Symbol]";function isSymbol$1(e){return"symbol"==typeof e||isObjectLike$1(e)&&baseGetTag(e)==symbolTag$1}var FUNC_ERROR_TEXT="Expected a function";function memoize(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=e.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(memoize.Cache||MapCache),r}memoize.Cache=MapCache;var MAX_MEMOIZE_SIZE=500;function memoizeCapped(e){var t=memoize(e,function(e){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),e}),r=t.cache;return t}var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=memoizeCapped(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,function(e,r,n,a){t.push(n?a.replace(reEscapeChar,"$1"):r||e)}),t}),stringToPath$1=stringToPath,INFINITY$2=1/0;function toKey$1(e){if("string"==typeof e||isSymbol$1(e))return e;var t=e+"";return"0"==t&&1/e==-INFINITY$2?"-0":t}var INFINITY$1=1/0,symbolProto=Symbol$3?Symbol$3.prototype:void 0,symbolToString$1=symbolProto?symbolProto.toString:void 0;function baseToString(e){if("string"==typeof e)return e;if(isArray$3(e))return arrayMap$1(e,baseToString)+"";if(isSymbol$1(e))return symbolToString$1?symbolToString$1.call(e):"";var t=e+"";return"0"==t&&1/e==-INFINITY$1?"-0":t}function toString$1(e){return null==e?"":baseToString(e)}function toPath(e){return isArray$3(e)?arrayMap$1(e,toKey$1):isSymbol$1(e)?[e]:copyArray(stringToPath$1(toString$1(e)))}function _extends(){return _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_extends.apply(this,arguments)}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)t.indexOf(r=i[n])>=0||(a[r]=e[r]);return a}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var FormikContext=/*#__PURE__*/React.createContext(void 0);function useFormikContext(){var e=React.useContext(FormikContext);return e||("production"!=='{NODE_ENV:"production"}'.NODE_ENV?warning(!1,"Formik context is undefined, please verify you are calling useFormikContext() as child of a <Formik> component."):warning(!1)),e}FormikContext.displayName="FormikContext";var isEmptyArray=function(e){return Array.isArray(e)&&0===e.length},isFunction$1=function(e){return"function"==typeof e},isObject$2=function(e){return null!==e&&"object"==typeof e},isInteger=function(e){return String(Math.floor(Number(e)))===e},isEmptyChildren=function(e){return 0===React.Children.count(e)};function getIn$1(e,t,r,n){void 0===n&&(n=0);for(var a=toPath(t);e&&n<a.length;)e=e[a[n++]];return n===a.length||e?void 0===e?r:e:r}function setIn(e,t,r){for(var n=clone$1(e),a=n,i=0,o=toPath(t);i<o.length-1;i++){var s=o[i],l=getIn$1(e,o.slice(0,i+1));if(l&&(isObject$2(l)||Array.isArray(l)))a=a[s]=clone$1(l);else{var u=o[i+1];a=a[s]=isInteger(u)&&Number(u)>=0?[]:{}}}return(0===i?e:a)[o[i]]===r?e:(void 0===r?delete a[o[i]]:a[o[i]]=r,0===i&&void 0===r&&delete n[o[i]],n)}var Form=/*#__PURE__*/React.forwardRef(function(e,t){var r=e.action,n=_objectWithoutPropertiesLoose(e,["action"]),a=null!=r?r:"#",i=useFormikContext();return React.createElement("form",_extends({onSubmit:i.handleSubmit,ref:t,onReset:i.handleReset,action:a},n))});Form.displayName="Form";var move=function(e,t,r){var n=copyArrayLike(e),a=n[t];return n.splice(t,1),n.splice(r,0,a),n},swap=function(e,t,r){var n=copyArrayLike(e),a=n[t];return n[t]=n[r],n[r]=a,n},insert=function(e,t,r){var n=copyArrayLike(e);return n.splice(t,0,r),n},replace=function(e,t,r){var n=copyArrayLike(e);return n[t]=r,n},copyArrayLike=function(e){if(e){if(Array.isArray(e))return[].concat(e);var t=Object.keys(e).map(function(e){return parseInt(e)}).reduce(function(e,t){return t>e?t:e},0);return Array.from(_extends({},e,{length:t+1}))}return[]},createAlterationHandler=function(e,t){var r="function"==typeof e?e:t;return function(e){if(Array.isArray(e)||isObject$2(e)){var t=copyArrayLike(e);return r(t)}return e}},FieldArrayInner=/*#__PURE__*/function(e){function t(t){var r;return(r=e.call(this,t)||this).updateArrayField=function(e,t,n){var a=r.props,i=a.name;(0,a.formik.setFormikState)(function(r){var a=createAlterationHandler(n,e),o=createAlterationHandler(t,e),s=setIn(r.values,i,e(getIn$1(r.values,i))),l=n?a(getIn$1(r.errors,i)):void 0,u=t?o(getIn$1(r.touched,i)):void 0;return isEmptyArray(l)&&(l=void 0),isEmptyArray(u)&&(u=void 0),_extends({},r,{values:s,errors:n?setIn(r.errors,i,l):r.errors,touched:t?setIn(r.touched,i,u):r.touched})})},r.push=function(e){return r.updateArrayField(function(t){return[].concat(copyArrayLike(t),[cloneDeep(e)])},!1,!1)},r.handlePush=function(e){return function(){return r.push(e)}},r.swap=function(e,t){return r.updateArrayField(function(r){return swap(r,e,t)},!0,!0)},r.handleSwap=function(e,t){return function(){return r.swap(e,t)}},r.move=function(e,t){return r.updateArrayField(function(r){return move(r,e,t)},!0,!0)},r.handleMove=function(e,t){return function(){return r.move(e,t)}},r.insert=function(e,t){return r.updateArrayField(function(r){return insert(r,e,t)},function(t){return insert(t,e,null)},function(t){return insert(t,e,null)})},r.handleInsert=function(e,t){return function(){return r.insert(e,t)}},r.replace=function(e,t){return r.updateArrayField(function(r){return replace(r,e,t)},!1,!1)},r.handleReplace=function(e,t){return function(){return r.replace(e,t)}},r.unshift=function(e){var t=-1;return r.updateArrayField(function(r){var n=r?[e].concat(r):[e];return t=n.length,n},function(e){return e?[null].concat(e):[null]},function(e){return e?[null].concat(e):[null]}),t},r.handleUnshift=function(e){return function(){return r.unshift(e)}},r.handleRemove=function(e){return function(){return r.remove(e)}},r.handlePop=function(){return function(){return r.pop()}},r.remove=r.remove.bind(_assertThisInitialized(r)),r.pop=r.pop.bind(_assertThisInitialized(r)),r}_inheritsLoose(t,e);var r=t.prototype;return r.componentDidUpdate=function(e){this.props.validateOnChange&&this.props.formik.validateOnChange&&!reactFastCompare(getIn$1(e.formik.values,e.name),getIn$1(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},r.remove=function(e){var t;return this.updateArrayField(function(r){var n=r?copyArrayLike(r):[];return t||(t=n[e]),isFunction$1(n.splice)&&n.splice(e,1),isFunction$1(n.every)&&n.every(function(e){return void 0===e})?[]:n},!0,!0),t},r.pop=function(){var e;return this.updateArrayField(function(t){var r=t.slice();return e||(e=r&&r.pop&&r.pop()),r},!0,!0),e},r.render=function(){var e=this.props,t=e.component,r=e.render,n=e.children,a=e.name,i=_extends({},{push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},{form:_objectWithoutPropertiesLoose(e.formik,["validate","validationSchema"]),name:a});return t?React.createElement(t,i):r?r(i):n?"function"==typeof n?n(i):isEmptyChildren(n)?null:React.Children.only(n):null},t}(React.Component),QueriesPeriod;FieldArrayInner.defaultProps={validateOnChange:!0},function(e){e.CURRENT_SHIFT="CURRENT_SHIFT",e.PREVIOUS_SHIFT="PREVIOUS_SHIFT"}(QueriesPeriod||(QueriesPeriod={}));var SettingsFormContent=function(e){var t=e.formProps,r=reactI18next.useTranslation().t,n={query:"",displayName:""},a={mt:2},i=function(e,r){var a=[].concat(t.values.prometheusQueries||[n]);a[e]=_extends$1({},a[e],r),t.setFieldValue("prometheusQueries",a)};return React__default.default.createElement(material.Box,{mb:2},React__default.default.createElement(material.FormControl,{sx:a,fullWidth:!0},React__default.default.createElement(material.TextField,{name:"endpointUrl",label:r("Endpoint URL"),value:t.values.endpointUrl,onChange:t.handleChange,onBlur:t.handleBlur,error:t.touched.endpointUrl&&Boolean(t.errors.endpointUrl),helperText:t.touched.endpointUrl&&t.errors.endpointUrl,fullWidth:!0})),React__default.default.createElement(material.FormControl,{sx:a,fullWidth:!0},React__default.default.createElement(material.InputLabel,{id:"queries-period-label"},r("Period")),React__default.default.createElement(material.Select,{variant:"outlined",name:"queriesPeriod",labelId:"queries-period-label",value:t.values.queriesPeriod||QueriesPeriod.CURRENT_SHIFT,onChange:t.handleChange,onBlur:t.handleBlur,error:t.touched.queriesPeriod&&Boolean(t.errors.queriesPeriod),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"))})),React__default.default.createElement(material.FormHelperText,{error:!0},t.touched.queriesPeriod&&t.errors.queriesPeriod)),(t.values.prometheusQueries||[n]).map(function(e,o){var s,l,u,c,d=e.query,h=e.displayName;return React__default.default.createElement(material.FormControl,{key:o,sx:a,fullWidth:!0},React__default.default.createElement(material.Stack,{direction:"row",width:"100%",gap:1},React__default.default.createElement(material.TextField,{label:r("Query"),value:d,onChange:function(e){return i(o,{query:e.target.value})},onBlur:t.handleBlur,error:(null==(s=t.touched.prometheusQueries)||null==(s=s[o])?void 0:s.query)&&Boolean(getIn$1(t.errors,"prometheusQueries.["+o+"].query")),helperText:(null==(l=t.touched.prometheusQueries)||null==(l=l[o])?void 0:l.query)&&getIn$1(t.errors,"prometheusQueries.["+o+"].query"),fullWidth:!0}),React__default.default.createElement(material.TextField,{label:r("Name"),value:h,onChange:function(e){return i(o,{query:d,displayName:e.target.value})},onBlur:t.handleBlur,error:(null==(u=t.touched.prometheusQueries)||null==(u=u[o])?void 0:u.displayName)&&Boolean(getIn$1(t.errors,"prometheusQueries.["+o+"].displayName")),helperText:(null==(c=t.touched.prometheusQueries)||null==(c=c[o])?void 0:c.displayName)&&getIn$1(t.errors,"prometheusQueries.["+o+"].displayName"),fullWidth:!0}),React__default.default.createElement(material.IconButton,{color:"error",onClick:function(){return function(e){var r=[].concat(t.values.prometheusQueries||[n]);r.splice(e,1),t.setFieldValue("prometheusQueries",r)}(o)}},React__default.default.createElement(iconsMaterial.Clear,null))))}),React__default.default.createElement(material.Button,{color:"secondary",onClick:function(){var e=[].concat(t.values.prometheusQueries||[n]);t.setFieldValue("prometheusQueries",[].concat(e,[n]))},sx:{mt:function(e){return e.spacing(2)}},fullWidth:!0},React__default.default.createElement(reactI18next.Trans,{t:r},"Add another query")),(t.values.displayedQueryParams||[""]).map(function(e,n){var i,o;return React__default.default.createElement(material.FormControl,{key:n,sx:a,fullWidth:!0},React__default.default.createElement(material.Stack,{direction:"row",width:"100%"},React__default.default.createElement(material.TextField,{label:r("Displayed query parameter"),value:e,onChange:function(e){return function(e,r){var n=[].concat(t.values.displayedQueryParams||[""]);n[e]=r,t.setFieldValue("displayedQueryParams",n)}(n,e.target.value)},error:(null==(i=t.touched.displayedQueryParams)?void 0:i[n])&&Boolean(getIn$1(t.errors,"displayedQueryParams.["+n+"]")),helperText:(null==(o=t.touched.displayedQueryParams)?void 0:o[n])&&getIn$1(t.errors,"displayedQueryParams.["+n+"]"),fullWidth:!0}),React__default.default.createElement(material.IconButton,{color:"error",onClick:function(){return function(e){var r=[].concat(t.values.displayedQueryParams||[""]);r.splice(e,1),t.setFieldValue("displayedQueryParams",r)}(n)}},React__default.default.createElement(iconsMaterial.Clear,null))))}),React__default.default.createElement(material.Button,{color:"secondary",onClick:function(){var e=[].concat(t.values.displayedQueryParams||[""]);t.setFieldValue("displayedQueryParams",[].concat(e,[""]))},sx:{mt:function(e){return e.spacing(2)}},fullWidth:!0},React__default.default.createElement(reactI18next.Trans,{t:r},"Add another displayed query parameter")),React__default.default.createElement(material.FormControl,{sx:a,fullWidth:!0},React__default.default.createElement(material.TextField,{name:"xAxisUnit",label:r("X axis unit"),value:t.values.xAxisUnit||"",onChange:t.handleChange,onBlur:t.handleBlur,error:t.touched.xAxisUnit&&Boolean(t.errors.xAxisUnit),helperText:t.touched.xAxisUnit&&t.errors.xAxisUnit,fullWidth:!0})),React__default.default.createElement(material.FormControl,{sx:a,fullWidth:!0},React__default.default.createElement(material.TextField,{name:"yAxisUnit",label:r("Y axis unit"),value:t.values.yAxisUnit||"",onChange:t.handleChange,onBlur:t.handleBlur,error:t.touched.yAxisUnit&&Boolean(t.errors.yAxisUnit),helperText:t.touched.yAxisUnit&&t.errors.yAxisUnit,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,r;function n(){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 r,n=[],a=e.length;for(r=0;r<a;++r)n.push(t(e[r],r));return n}function h(e,t){for(var r in t)o(t,r)&&(e[r]=t[r]);return o(t,"toString")&&(e.toString=t.toString),o(t,"valueOf")&&(e.valueOf=t.valueOf),e}function f(e,t,r,n){return $t(e,t,r,n,!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){var t=null,n=!1,a=e._d&&!isNaN(e._d.getTime());return a&&(t=p(e),n=r.call(t.parsedDateParts,function(e){return null!=e}),a=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict&&(a=a&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour)),null!=Object.isFrozen&&Object.isFrozen(e)?a:(e._isValid=a,e._isValid)}function m(e){var t=f(NaN);return null!=e?h(p(t),e):p(t).userInvalidated=!0,t}r=Array.prototype.some?Array.prototype.some:function(e){var t,r=Object(this),n=r.length>>>0;for(t=0;t<n;t++)if(t in r&&e.call(this,r[t],t,r))return!0;return!1};var y=n.momentProperties=[],v=!1;function b(e,t){var r,n,a,i=y.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(r=0;r<i;r++)l(a=t[n=y[r]])||(e[n]=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===v&&(v=!0,n.updateOffset(this),v=!1)}function _(e){return e instanceof x||null!=e&&null!=e._isAMomentObject}function w(e){!1===n.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function k(e,t){var r=!0;return h(function(){if(null!=n.deprecationHandler&&n.deprecationHandler(null,e),r){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),r=!1}return t.apply(this,arguments)},t)}var S,T={};function M(e,t){null!=n.deprecationHandler&&n.deprecationHandler(e,t),T[e]||(w(t),T[e]=!0)}function O(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function A(e,t){var r,n=h({},e);for(r in t)o(t,r)&&(i(e[r])&&i(t[r])?(n[r]={},h(n[r],e[r]),h(n[r],t[r])):null!=t[r]?n[r]=t[r]:delete n[r]);for(r in e)o(e,r)&&!o(t,r)&&i(e[r])&&(n[r]=h({},n[r]));return n}function C(e){null!=e&&this.set(e)}function P(e,t,r){var n=""+Math.abs(e);return(e>=0?r?"+":"":"-")+Math.pow(10,Math.max(0,t-n.length)).toString().substr(1)+n}n.suppressDeprecationWarnings=!1,n.deprecationHandler=null,S=Object.keys?Object.keys:function(e){var t,r=[];for(t in e)o(e,t)&&r.push(t);return r};var D=/(\[[^\[]*\])|(\\)?([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,E=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,$={},F={};function I(e,t,r,n){var a=n;"string"==typeof n&&(a=function(){return this[n]()}),e&&(F[e]=a),t&&(F[t[0]]=function(){return P(a.apply(this,arguments),t[1],t[2])}),r&&(F[r]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function R(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function N(e,t){return e.isValid()?(t=j(t,e.localeData()),$[t]=$[t]||function(e){var t,r,n=e.match(D);for(t=0,r=n.length;t<r;t++)n[t]=F[n[t]]?F[n[t]]:R(n[t]);return function(t){var a,i="";for(a=0;a<r;a++)i+=O(n[a])?n[a].call(t,e):n[a];return i}}(t),$[t](e)):e.localeData().invalidDate()}function j(e,t){var r=5;function n(e){return t.longDateFormat(e)||e}for(E.lastIndex=0;r>=0&&E.test(e);)e=e.replace(E,n),E.lastIndex=0,r-=1;return e}var L={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function V(e){return"string"==typeof e?L[e]||L[e.toLowerCase()]:void 0}function z(e){var t,r,n={};for(r in e)o(e,r)&&(t=V(r))&&(n[t]=e[r]);return n}var W,B={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1},Y=/\d/,U=/\d\d/,H=/\d{3}/,q=/\d{4}/,G=/[+-]?\d{6}/,Q=/\d\d?/,Z=/\d\d\d\d?/,J=/\d\d\d\d\d\d?/,K=/\d{1,3}/,X=/\d{1,4}/,ee=/[+-]?\d{1,6}/,te=/\d+/,re=/[+-]?\d+/,ne=/Z|[+-]\d\d:?\d\d/gi,ae=/Z|[+-]\d\d(?::?\d\d)?/gi,ie=/[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,oe=/^[1-9]\d?/,se=/^([1-9]\d|\d)/;function le(e,t,r){W[e]=O(t)?t:function(e,n){return e&&r?r:t}}function ue(e,t){return o(W,e)?W[e](t._strict,t._locale):new RegExp(ce(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,r,n,a){return t||r||n||a})))}function ce(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function de(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function he(e){var t=+e,r=0;return 0!==t&&isFinite(t)&&(r=de(t)),r}W={};var fe={};function pe(e,t){var r,n,a=t;for("string"==typeof e&&(e=[e]),u(t)&&(a=function(e,r){r[t]=he(e)}),n=e.length,r=0;r<n;r++)fe[e[r]]=a}function ge(e,t){pe(e,function(e,r,n,a){n._w=n._w||{},t(e,n._w,n,a)})}function me(e,t,r){null!=t&&o(fe,e)&&fe[e](t,r._a,r,e)}function ye(e){return e%4==0&&e%100!=0||e%400==0}var ve=0,be=1,xe=2,_e=3,we=4,ke=5,Se=6,Te=7,Me=8;function Oe(e){return ye(e)?366:365}I("Y",0,0,function(){var e=this.year();return e<=9999?P(e,4):"+"+e}),I(0,["YY",2],0,function(){return this.year()%100}),I(0,["YYYY",4],0,"year"),I(0,["YYYYY",5],0,"year"),I(0,["YYYYYY",6,!0],0,"year"),le("Y",re),le("YY",Q,U),le("YYYY",X,q),le("YYYYY",ee,G),le("YYYYYY",ee,G),pe(["YYYYY","YYYYYY"],ve),pe("YYYY",function(e,t){t[ve]=2===e.length?n.parseTwoDigitYear(e):he(e)}),pe("YY",function(e,t){t[ve]=n.parseTwoDigitYear(e)}),pe("Y",function(e,t){t[ve]=parseInt(e,10)}),n.parseTwoDigitYear=function(e){return he(e)+(he(e)>68?1900:2e3)};var Ae,Ce=Pe("FullYear",!0);function Pe(e,t){return function(r){return null!=r?(Ee(this,e,r),n.updateOffset(this,t),this):De(this,e)}}function De(e,t){if(!e.isValid())return NaN;var r=e._d,n=e._isUTC;switch(t){case"Milliseconds":return n?r.getUTCMilliseconds():r.getMilliseconds();case"Seconds":return n?r.getUTCSeconds():r.getSeconds();case"Minutes":return n?r.getUTCMinutes():r.getMinutes();case"Hours":return n?r.getUTCHours():r.getHours();case"Date":return n?r.getUTCDate():r.getDate();case"Day":return n?r.getUTCDay():r.getDay();case"Month":return n?r.getUTCMonth():r.getMonth();case"FullYear":return n?r.getUTCFullYear():r.getFullYear();default:return NaN}}function Ee(e,t,r){var n,a,i,o,s;if(e.isValid()&&!isNaN(r)){switch(n=e._d,a=e._isUTC,t){case"Milliseconds":return void(a?n.setUTCMilliseconds(r):n.setMilliseconds(r));case"Seconds":return void(a?n.setUTCSeconds(r):n.setSeconds(r));case"Minutes":return void(a?n.setUTCMinutes(r):n.setMinutes(r));case"Hours":return void(a?n.setUTCHours(r):n.setHours(r));case"Date":return void(a?n.setUTCDate(r):n.setDate(r));case"FullYear":break;default:return}i=r,o=e.month(),s=29!==(s=e.date())||1!==o||ye(i)?s:28,a?n.setUTCFullYear(i,o,s):n.setFullYear(i,o,s)}}function $e(e,t){if(isNaN(e)||isNaN(t))return NaN;var r=(t%12+12)%12;return e+=(t-r)/12,1===r?ye(e)?29:28:31-r%7%2}Ae=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},I("M",["MM",2],"Mo",function(){return this.month()+1}),I("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),I("MMMM",0,0,function(e){return this.localeData().months(this,e)}),le("M",Q,oe),le("MM",Q,U),le("MMM",function(e,t){return t.monthsShortRegex(e)}),le("MMMM",function(e,t){return t.monthsRegex(e)}),pe(["M","MM"],function(e,t){t[be]=he(e)-1}),pe(["MMM","MMMM"],function(e,t,r,n){var a=r._locale.monthsParse(e,n,r._strict);null!=a?t[be]=a:p(r).invalidMonth=e});var Fe="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Ie="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Re=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Ne=ie,je=ie;function Le(e,t,r){var n,a,i,o=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)i=f([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(i,"").toLocaleLowerCase();return r?"MMM"===t?-1!==(a=Ae.call(this._shortMonthsParse,o))?a:null:-1!==(a=Ae.call(this._longMonthsParse,o))?a:null:"MMM"===t?-1!==(a=Ae.call(this._shortMonthsParse,o))||-1!==(a=Ae.call(this._longMonthsParse,o))?a:null:-1!==(a=Ae.call(this._longMonthsParse,o))||-1!==(a=Ae.call(this._shortMonthsParse,o))?a:null}function Ve(e,t){if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=he(t);else if(!u(t=e.localeData().monthsParse(t)))return e;var r=t,n=e.date();return n=n<29?n:Math.min(n,$e(e.year(),r)),e._isUTC?e._d.setUTCMonth(r,n):e._d.setMonth(r,n),e}function ze(e){return null!=e?(Ve(this,e),n.updateOffset(this,!0),this):De(this,"Month")}function We(){function e(e,t){return t.length-e.length}var t,r,n,a,i=[],o=[],s=[];for(t=0;t<12;t++)r=f([2e3,t]),n=ce(this.monthsShort(r,"")),a=ce(this.months(r,"")),i.push(n),o.push(a),s.push(a),s.push(n);i.sort(e),o.sort(e),s.sort(e),this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")","i")}function Be(e,t,r,n,a,i,o){var s;return e<100&&e>=0?(s=new Date(e+400,t,r,n,a,i,o),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,r,n,a,i,o),s}function Ye(e){var t,r;return e<100&&e>=0?((r=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,r)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Ue(e,t,r){var n=7+t-r;return-(7+Ye(e,0,n).getUTCDay()-t)%7+n-1}function He(e,t,r,n,a){var i,o,s=1+7*(t-1)+(7+r-n)%7+Ue(e,n,a);return s<=0?o=Oe(i=e-1)+s:s>Oe(e)?(i=e+1,o=s-Oe(e)):(i=e,o=s),{year:i,dayOfYear:o}}function qe(e,t,r){var n,a,i=Ue(e.year(),t,r),o=Math.floor((e.dayOfYear()-i-1)/7)+1;return o<1?n=o+Ge(a=e.year()-1,t,r):o>Ge(e.year(),t,r)?(n=o-Ge(e.year(),t,r),a=e.year()+1):(a=e.year(),n=o),{week:n,year:a}}function Ge(e,t,r){var n=Ue(e,t,r),a=Ue(e+1,t,r);return(Oe(e)-n+a)/7}function Qe(e,t){return e.slice(t,7).concat(e.slice(0,t))}I("w",["ww",2],"wo","week"),I("W",["WW",2],"Wo","isoWeek"),le("w",Q,oe),le("ww",Q,U),le("W",Q,oe),le("WW",Q,U),ge(["w","ww","W","WW"],function(e,t,r,n){t[n.substr(0,1)]=he(e)}),I("d",0,"do","day"),I("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),I("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),I("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),I("e",0,0,"weekday"),I("E",0,0,"isoWeekday"),le("d",Q),le("e",Q),le("E",Q),le("dd",function(e,t){return t.weekdaysMinRegex(e)}),le("ddd",function(e,t){return t.weekdaysShortRegex(e)}),le("dddd",function(e,t){return t.weekdaysRegex(e)}),ge(["dd","ddd","dddd"],function(e,t,r,n){var a=r._locale.weekdaysParse(e,n,r._strict);null!=a?t.d=a:p(r).invalidWeekday=e}),ge(["d","e","E"],function(e,t,r,n){t[n]=he(e)});var Ze="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("_"),Xe=ie,et=ie,tt=ie;function rt(e,t,r){var n,a,i,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)i=f([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(i,"").toLocaleLowerCase();return r?"dddd"===t?-1!==(a=Ae.call(this._weekdaysParse,o))?a:null:"ddd"===t?-1!==(a=Ae.call(this._shortWeekdaysParse,o))?a:null:-1!==(a=Ae.call(this._minWeekdaysParse,o))?a:null:"dddd"===t?-1!==(a=Ae.call(this._weekdaysParse,o))||-1!==(a=Ae.call(this._shortWeekdaysParse,o))||-1!==(a=Ae.call(this._minWeekdaysParse,o))?a:null:"ddd"===t?-1!==(a=Ae.call(this._shortWeekdaysParse,o))||-1!==(a=Ae.call(this._weekdaysParse,o))||-1!==(a=Ae.call(this._minWeekdaysParse,o))?a:null:-1!==(a=Ae.call(this._minWeekdaysParse,o))||-1!==(a=Ae.call(this._weekdaysParse,o))||-1!==(a=Ae.call(this._shortWeekdaysParse,o))?a:null}function nt(){function e(e,t){return t.length-e.length}var t,r,n,a,i,o=[],s=[],l=[],u=[];for(t=0;t<7;t++)r=f([2e3,1]).day(t),n=ce(this.weekdaysMin(r,"")),a=ce(this.weekdaysShort(r,"")),i=ce(this.weekdays(r,"")),o.push(n),s.push(a),l.push(i),u.push(n),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 at(){return this.hours()%12||12}function it(e,t){I(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function ot(e,t){return t._meridiemParse}I("H",["HH",2],0,"hour"),I("h",["hh",2],0,at),I("k",["kk",2],0,function(){return this.hours()||24}),I("hmm",0,0,function(){return""+at.apply(this)+P(this.minutes(),2)}),I("hmmss",0,0,function(){return""+at.apply(this)+P(this.minutes(),2)+P(this.seconds(),2)}),I("Hmm",0,0,function(){return""+this.hours()+P(this.minutes(),2)}),I("Hmmss",0,0,function(){return""+this.hours()+P(this.minutes(),2)+P(this.seconds(),2)}),it("a",!0),it("A",!1),le("a",ot),le("A",ot),le("H",Q,se),le("h",Q,oe),le("k",Q,oe),le("HH",Q,U),le("hh",Q,U),le("kk",Q,U),le("hmm",Z),le("hmmss",J),le("Hmm",Z),le("Hmmss",J),pe(["H","HH"],_e),pe(["k","kk"],function(e,t,r){var n=he(e);t[_e]=24===n?0:n}),pe(["a","A"],function(e,t,r){r._isPm=r._locale.isPM(e),r._meridiem=e}),pe(["h","hh"],function(e,t,r){t[_e]=he(e),p(r).bigHour=!0}),pe("hmm",function(e,t,r){var n=e.length-2;t[_e]=he(e.substr(0,n)),t[we]=he(e.substr(n)),p(r).bigHour=!0}),pe("hmmss",function(e,t,r){var n=e.length-4,a=e.length-2;t[_e]=he(e.substr(0,n)),t[we]=he(e.substr(n,2)),t[ke]=he(e.substr(a)),p(r).bigHour=!0}),pe("Hmm",function(e,t,r){var n=e.length-2;t[_e]=he(e.substr(0,n)),t[we]=he(e.substr(n))}),pe("Hmmss",function(e,t,r){var n=e.length-4,a=e.length-2;t[_e]=he(e.substr(0,n)),t[we]=he(e.substr(n,2)),t[ke]=he(e.substr(a))});var st,lt=Pe("Hours",!0),ut={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:Fe,monthsShort:Ie,week:{dow:0,doy:6},weekdays:Ze,weekdaysMin:Ke,weekdaysShort:Je,meridiemParse:/[ap]\.?m?\.?/i},ct={},dt={};function ht(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r<n;r+=1)if(e[r]!==t[r])return r;return n}function ft(e){return e?e.toLowerCase().replace("_","-"):e}function pt(t){var r=null;if(void 0===ct[t]&&e&&e.exports&&function(e){return!(!e||!e.match("^[^/\\\\]*$"))}(t))try{r=st._abbr,commonjsRequire("./locale/"+t),gt(r)}catch(e){ct[t]=null}return ct[t]}function gt(e,t){var r;return e&&((r=l(t)?yt(e):mt(e,t))?st=r:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),st._abbr}function mt(e,t){if(null!==t){var r,n=ut;if(t.abbr=e,null!=ct[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."),n=ct[e]._config;else if(null!=t.parentLocale)if(null!=ct[t.parentLocale])n=ct[t.parentLocale]._config;else{if(null==(r=pt(t.parentLocale)))return dt[t.parentLocale]||(dt[t.parentLocale]=[]),dt[t.parentLocale].push({name:e,config:t}),null;n=r._config}return ct[e]=new C(A(n,t)),dt[e]&&dt[e].forEach(function(e){mt(e.name,e.config)}),gt(e),ct[e]}return delete ct[e],null}function yt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return st;if(!a(e)){if(t=pt(e))return t;e=[e]}return function(e){for(var t,r,n,a,i=0;i<e.length;){for(t=(a=ft(e[i]).split("-")).length,r=(r=ft(e[i+1]))?r.split("-"):null;t>0;){if(n=pt(a.slice(0,t).join("-")))return n;if(r&&r.length>=t&&ht(a,r)>=t-1)break;t--}i++}return st}(e)}function vt(e){var t,r=e._a;return r&&-2===p(e).overflow&&(t=r[be]<0||r[be]>11?be:r[xe]<1||r[xe]>$e(r[ve],r[be])?xe:r[_e]<0||r[_e]>24||24===r[_e]&&(0!==r[we]||0!==r[ke]||0!==r[Se])?_e:r[we]<0||r[we]>59?we:r[ke]<0||r[ke]>59?ke:r[Se]<0||r[Se]>999?Se:-1,p(e)._overflowDayOfYear&&(t<ve||t>xe)&&(t=xe),p(e)._overflowWeeks&&-1===t&&(t=Te),p(e)._overflowWeekday&&-1===t&&(t=Me),p(e).overflow=t),e}var 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=/^\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)?)?$/,_t=/Z|[+-]\d\d(?::?\d\d)?/,wt=[["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]],kt=[["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/]],St=/^\/?Date\((-?\d+)/i,Tt=/^(?:(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,r,n,a,i,o,s=e._i,l=bt.exec(s)||xt.exec(s),u=wt.length,c=kt.length;if(l){for(p(e).iso=!0,t=0,r=u;t<r;t++)if(wt[t][1].exec(l[1])){a=wt[t][0],n=!1!==wt[t][2];break}if(null==a)return void(e._isValid=!1);if(l[3]){for(t=0,r=c;t<r;t++)if(kt[t][1].exec(l[3])){i=(l[2]||" ")+kt[t][0];break}if(null==i)return void(e._isValid=!1)}if(!n&&null!=i)return void(e._isValid=!1);if(l[4]){if(!_t.exec(l[4]))return void(e._isValid=!1);o="Z"}e._f=a+(i||"")+(o||""),Dt(e)}else e._isValid=!1}function At(e){var t,r,n,a,i,o,s,l,u,c=Tt.exec(e._i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(c){if(r=c[3],n=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),Ie.indexOf(r),parseInt(n,10),parseInt(a,10),parseInt(i,10)],o&&s.push(parseInt(o,10)),!function(e,t,r){return!e||Je.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(p(r).weekdayMismatch=!0,r._isValid=!1,!1)}(c[1],t=s,e))return;e._a=t,e._tzm=function(e,t,r){if(e)return Mt[e];if(t)return 0;var n=parseInt(r,10),a=n%100;return(n-a)/100*60+a}(c[8],c[9],c[10]),e._d=Ye.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),p(e).rfc2822=!0}else e._isValid=!1}function Ct(e,t,r){return null!=e?e:null!=t?t:r}function Pt(e){var t,r,a,i,o,s=[];if(!e._d){for(a=function(e){var t=new Date(n.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[xe]&&null==e._a[be]&&function(e){var t,r,n,a,i,o,s,l,u;null!=(t=e._w).GG||null!=t.W||null!=t.E?(i=1,o=4,r=Ct(t.GG,e._a[ve],qe(Ft(),1,4).year),n=Ct(t.W,1),((a=Ct(t.E,1))<1||a>7)&&(l=!0)):(i=e._locale._week.dow,o=e._locale._week.doy,u=qe(Ft(),i,o),r=Ct(t.gg,e._a[ve],u.year),n=Ct(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),n<1||n>Ge(r,i,o)?p(e)._overflowWeeks=!0:null!=l?p(e)._overflowWeekday=!0:(s=He(r,n,a,i,o),e._a[ve]=s.year,e._dayOfYear=s.dayOfYear)}(e),null!=e._dayOfYear&&(o=Ct(e._a[ve],a[ve]),(e._dayOfYear>Oe(o)||0===e._dayOfYear)&&(p(e)._overflowDayOfYear=!0),r=Ye(o,0,e._dayOfYear),e._a[be]=r.getUTCMonth(),e._a[xe]=r.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[_e]&&0===e._a[we]&&0===e._a[ke]&&0===e._a[Se]&&(e._nextDay=!0,e._a[_e]=0),e._d=(e._useUTC?Ye:Be).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[_e]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(p(e).weekdayMismatch=!0)}}function Dt(e){if(e._f!==n.ISO_8601)if(e._f!==n.RFC_2822){e._a=[],p(e).empty=!0;var t,r,a,i,o,s,l,u=""+e._i,c=u.length,d=0;for(l=(a=j(e._f,e._locale).match(D)||[]).length,t=0;t<l;t++)(r=(u.match(ue(i=a[t],e))||[])[0])&&((o=u.substr(0,u.indexOf(r))).length>0&&p(e).unusedInput.push(o),u=u.slice(u.indexOf(r)+r.length),d+=r.length),F[i]?(r?p(e).empty=!1:p(e).unusedTokens.push(i),me(i,r,e)):e._strict&&!r&&p(e).unusedTokens.push(i);p(e).charsLeftOver=c-d,u.length>0&&p(e).unusedInput.push(u),e._a[_e]<=12&&!0===p(e).bigHour&&e._a[_e]>0&&(p(e).bigHour=void 0),p(e).parsedDateParts=e._a.slice(0),p(e).meridiem=e._meridiem,e._a[_e]=function(e,t,r){var n;return null==r?t:null!=e.meridiemHour?e.meridiemHour(t,r):null!=e.isPM?((n=e.isPM(r))&&t<12&&(t+=12),n||12!==t||(t=0),t):t}(e._locale,e._a[_e],e._meridiem),null!==(s=p(e).era)&&(e._a[ve]=e._locale.erasConvertYear(s,e._a[ve])),Pt(e),vt(e)}else At(e);else Ot(e)}function Et(e){var t=e._i,r=e._f;return e._locale=e._locale||yt(e._l),null===t||void 0===r&&""===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(r)?function(e){var t,r,n,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],Dt(t),g(t)&&(o=!0),i+=p(t).charsLeftOver,i+=10*p(t).unusedTokens.length,p(t).score=i,s?i<n&&(n=i,r=t):(null==n||i<n||o)&&(n=i,r=t,o&&(s=!0));h(e,r||t)}(e):r?Dt(e):function(e){var t=e._i;l(t)?e._d=new Date(n.now()):c(t)?e._d=new Date(t.valueOf()):"string"==typeof t?function(e){var t=St.exec(e._i);null===t?(Ot(e),!1===e._isValid&&(delete e._isValid,At(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:n.createFromInputFallback(e)))):e._d=new Date(+t[1])}(e):a(t)?(e._a=d(t.slice(0),function(e){return parseInt(e,10)}),Pt(e)):i(t)?function(e){if(!e._d){var t=z(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)}),Pt(e)}}(e):u(t)?e._d=new Date(t):n.createFromInputFallback(e)}(e),g(e)||(e._d=null),e))}function $t(e,t,r,n,o){var l,u={};return!0!==t&&!1!==t||(n=t,t=void 0),!0!==r&&!1!==r||(n=r,r=void 0),(i(e)&&s(e)||a(e)&&0===e.length)&&(e=void 0),u._isAMomentObject=!0,u._useUTC=u._isUTC=o,u._l=r,u._i=e,u._f=t,u._strict=n,(l=new x(vt(Et(u))))._nextDay&&(l.add(1,"d"),l._nextDay=void 0),l}function Ft(e,t,r,n){return $t(e,t,r,n,!1)}n.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":""))}),n.ISO_8601=function(){},n.RFC_2822=function(){};var It=k("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ft.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:m()}),Rt=k("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ft.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:m()});function Nt(e,t){var r,n;if(1===t.length&&a(t[0])&&(t=t[0]),!t.length)return Ft();for(r=t[0],n=1;n<t.length;++n)t[n].isValid()&&!t[n][e](r)||(r=t[n]);return r}var jt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Lt(e){var t=z(e),r=t.year||0,n=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,r,n=!1,a=jt.length;for(t in e)if(o(e,t)&&(-1===Ae.call(jt,t)||null!=e[t]&&isNaN(e[t])))return!1;for(r=0;r<a;++r)if(e[jt[r]]){if(n)return!1;parseFloat(e[jt[r]])!==he(e[jt[r]])&&(n=!0)}return!0}(t),this._milliseconds=+d+1e3*c+6e4*u+1e3*l*60*60,this._days=+s+7*i,this._months=+a+3*n+12*r,this._data={},this._locale=yt(),this._bubble()}function Vt(e){return e instanceof Lt}function zt(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Wt(e,t){I(e,0,0,function(){var e=this.utcOffset(),r="+";return e<0&&(e=-e,r="-"),r+P(~~(e/60),2)+t+P(~~e%60,2)})}Wt("Z",":"),Wt("ZZ",""),le("Z",ae),le("ZZ",ae),pe(["Z","ZZ"],function(e,t,r){r._useUTC=!0,r._tzm=Yt(ae,e)});var Bt=/([\+\-]|\d\d)/gi;function Yt(e,t){var r,n,a=(t||"").match(e);return null===a?null:0===(n=60*(r=((a[a.length-1]||[])+"").match(Bt)||["-",0,0])[1]+he(r[2]))?0:"+"===r[0]?n:-n}function Ut(e,t){var r,a;return t._isUTC?(r=t.clone(),a=(_(e)||c(e)?e.valueOf():Ft(e).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+a),n.updateOffset(r,!1),r):Ft(e).local()}function Ht(e){return-Math.round(e._d.getTimezoneOffset())}function qt(){return!!this.isValid()&&this._isUTC&&0===this._offset}n.updateOffset=function(){};var Gt=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Qt=/^(-|\+)?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 r,n,a,i,s,l,c=e,d=null;return Vt(e)?c={ms:e._milliseconds,d:e._days,M:e._months}:u(e)||!isNaN(+e)?(c={},t?c[t]=+e:c.milliseconds=+e):(d=Gt.exec(e))?(r="-"===d[1]?-1:1,c={y:0,d:he(d[xe])*r,h:he(d[_e])*r,m:he(d[we])*r,s:he(d[ke])*r,ms:he(zt(1e3*d[Se]))*r}):(d=Qt.exec(e))?c={y:Jt(d[2],r="-"===d[1]?-1:1),M:Jt(d[3],r),w:Jt(d[4],r),d:Jt(d[5],r),h:Jt(d[6],r),m:Jt(d[7],r),s:Jt(d[8],r)}:null==c?c={}:"object"==typeof c&&("from"in c||"to"in c)&&(i=Ft(c.from),s=Ft(c.to),a=i.isValid()&&s.isValid()?(s=Ut(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),n=new Lt(c),Vt(e)&&o(e,"_locale")&&(n._locale=e._locale),Vt(e)&&o(e,"_isValid")&&(n._isValid=e._isValid),n}function Jt(e,t){var r=e&&parseFloat(e.replace(",","."));return(isNaN(r)?0:r)*t}function Kt(e,t){var r={};return r.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(r.months,"M").isAfter(t)&&--r.months,r.milliseconds=+t-+e.clone().add(r.months,"M"),r}function Xt(e,t){return function(r,n){var a;return null===n||isNaN(+n)||(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=r,r=n,n=a),er(this,Zt(r,n),e),this}}function er(e,t,r,a){var i=t._milliseconds,o=zt(t._days),s=zt(t._months);e.isValid()&&(a=null==a||a,s&&Ve(e,De(e,"Month")+s*r),o&&Ee(e,"Date",De(e,"Date")+o*r),i&&e._d.setTime(e._d.valueOf()+i*r),a&&n.updateOffset(e,o||s))}Zt.fn=Lt.prototype,Zt.invalid=function(){return Zt(NaN)};var tr=Xt(1,"add"),rr=Xt(-1,"subtract");function nr(e){return"string"==typeof e||e instanceof String}function ar(e,t){if(e.date()<t.date())return-ar(t,e);var r=12*(t.year()-e.year())+(t.month()-e.month()),n=e.clone().add(r,"months");return-(r+(t-n<0?(t-n)/(n-e.clone().add(r-1,"months")):(t-n)/(e.clone().add(r+1,"months")-n)))||0}function ir(e){var t;return void 0===e?this._locale._abbr:(null!=(t=yt(e))&&(this._locale=t),this)}n.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",n.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var or=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 sr(){return this._locale}var lr=1e3,ur=6e4,cr=36e5,dr=126227808e5;function hr(e,t){return(e%t+t)%t}function fr(e,t,r){return e<100&&e>=0?new Date(e+400,t,r)-dr:new Date(e,t,r).valueOf()}function pr(e,t,r){return e<100&&e>=0?Date.UTC(e+400,t,r)-dr:Date.UTC(e,t,r)}function gr(e,t){return t.erasAbbrRegex(e)}function mr(){var e,t,r,n,a,i=[],o=[],s=[],l=[],u=this.eras();for(e=0,t=u.length;e<t;++e)r=ce(u[e].name),n=ce(u[e].abbr),a=ce(u[e].narrow),o.push(r),i.push(n),s.push(a),l.push(r),l.push(n),l.push(a);this._erasRegex=new RegExp("^("+l.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+o.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+i.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+s.join("|")+")","i")}function yr(e,t){I(0,[e,e.length],0,t)}function vr(e,t,r,n,a){var i;return null==e?qe(this,n,a).year:(t>(i=Ge(e,n,a))&&(t=i),br.call(this,e,t,r,n,a))}function br(e,t,r,n,a){var i=He(e,t,r,n,a),o=Ye(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}I("N",0,0,"eraAbbr"),I("NN",0,0,"eraAbbr"),I("NNN",0,0,"eraAbbr"),I("NNNN",0,0,"eraName"),I("NNNNN",0,0,"eraNarrow"),I("y",["y",1],"yo","eraYear"),I("y",["yy",2],0,"eraYear"),I("y",["yyy",3],0,"eraYear"),I("y",["yyyy",4],0,"eraYear"),le("N",gr),le("NN",gr),le("NNN",gr),le("NNNN",function(e,t){return t.erasNameRegex(e)}),le("NNNNN",function(e,t){return t.erasNarrowRegex(e)}),pe(["N","NN","NNN","NNNN","NNNNN"],function(e,t,r,n){var a=r._locale.erasParse(e,n,r._strict);a?p(r).era=a:p(r).invalidEra=e}),le("y",te),le("yy",te),le("yyy",te),le("yyyy",te),le("yo",function(e,t){return t._eraYearOrdinalRegex||te}),pe(["y","yy","yyy","yyyy"],ve),pe(["yo"],function(e,t,r,n){var a;r._locale._eraYearOrdinalRegex&&(a=e.match(r._locale._eraYearOrdinalRegex)),t[ve]=r._locale.eraYearOrdinalParse?r._locale.eraYearOrdinalParse(e,a):parseInt(e,10)}),I(0,["gg",2],0,function(){return this.weekYear()%100}),I(0,["GG",2],0,function(){return this.isoWeekYear()%100}),yr("gggg","weekYear"),yr("ggggg","weekYear"),yr("GGGG","isoWeekYear"),yr("GGGGG","isoWeekYear"),le("G",re),le("g",re),le("GG",Q,U),le("gg",Q,U),le("GGGG",X,q),le("gggg",X,q),le("GGGGG",ee,G),le("ggggg",ee,G),ge(["gggg","ggggg","GGGG","GGGGG"],function(e,t,r,n){t[n.substr(0,2)]=he(e)}),ge(["gg","GG"],function(e,t,r,a){t[a]=n.parseTwoDigitYear(e)}),I("Q",0,"Qo","quarter"),le("Q",Y),pe("Q",function(e,t){t[be]=3*(he(e)-1)}),I("D",["DD",2],"Do","date"),le("D",Q,oe),le("DD",Q,U),le("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),pe(["D","DD"],xe),pe("Do",function(e,t){t[xe]=he(e.match(Q)[0])});var xr=Pe("Date",!0);I("DDD",["DDDD",3],"DDDo","dayOfYear"),le("DDD",K),le("DDDD",H),pe(["DDD","DDDD"],function(e,t,r){r._dayOfYear=he(e)}),I("m",["mm",2],0,"minute"),le("m",Q,se),le("mm",Q,U),pe(["m","mm"],we);var _r=Pe("Minutes",!1);I("s",["ss",2],0,"second"),le("s",Q,se),le("ss",Q,U),pe(["s","ss"],ke);var wr,kr,Sr=Pe("Seconds",!1);for(I("S",0,0,function(){return~~(this.millisecond()/100)}),I(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),I(0,["SSS",3],0,"millisecond"),I(0,["SSSS",4],0,function(){return 10*this.millisecond()}),I(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),I(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),I(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),I(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),I(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),le("S",K,Y),le("SS",K,U),le("SSS",K,H),wr="SSSS";wr.length<=9;wr+="S")le(wr,te);function Tr(e,t){t[Se]=he(1e3*("0."+e))}for(wr="S";wr.length<=9;wr+="S")pe(wr,Tr);kr=Pe("Milliseconds",!1),I("z",0,0,"zoneAbbr"),I("zz",0,0,"zoneName");var Mr=x.prototype;function Or(e){return e}Mr.add=tr,Mr.calendar=function(e,t){var r;1===arguments.length&&(arguments[0]?_(r=arguments[0])||c(r)||nr(r)||u(r)||function(e){var t=a(e),r=!1;return t&&(r=0===e.filter(function(t){return!u(t)&&nr(e)}).length),t&&r}(r)||function(e){var t,r=i(e)&&!s(e),n=!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)n=n||o(e,a[t]);return r&&n}(r)||null==r?(e=arguments[0],t=void 0):function(e){var t,r=i(e)&&!s(e),n=!1,a=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<a.length;t+=1)n=n||o(e,a[t]);return r&&n}(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var l=e||Ft(),d=Ut(l,this).startOf("day"),h=n.calendarFormat(this,d)||"sameElse",f=t&&(O(t[h])?t[h].call(this,l):t[h]);return this.format(f||this.localeData().calendar(h,this,Ft(l)))},Mr.clone=function(){return new x(this)},Mr.diff=function(e,t,r){var n,a,i;if(!this.isValid())return NaN;if(!(n=Ut(e,this)).isValid())return NaN;switch(a=6e4*(n.utcOffset()-this.utcOffset()),t=V(t)){case"year":i=ar(this,n)/12;break;case"month":i=ar(this,n);break;case"quarter":i=ar(this,n)/3;break;case"second":i=(this-n)/1e3;break;case"minute":i=(this-n)/6e4;break;case"hour":i=(this-n)/36e5;break;case"day":i=(this-n-a)/864e5;break;case"week":i=(this-n-a)/6048e5;break;default:i=this-n}return r?i:de(i)},Mr.endOf=function(e){var t,r;if(void 0===(e=V(e))||"millisecond"===e||!this.isValid())return this;switch(r=this._isUTC?pr:fr,e){case"year":t=r(this.year()+1,0,1)-1;break;case"quarter":t=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=r(this.year(),this.month()+1,1)-1;break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=cr-hr(t+(this._isUTC?0:this.utcOffset()*ur),cr)-1;break;case"minute":t=this._d.valueOf(),t+=ur-hr(t,ur)-1;break;case"second":t=this._d.valueOf(),t+=lr-hr(t,lr)-1}return this._d.setTime(t),n.updateOffset(this,!0),this},Mr.format=function(e){e||(e=this.isUtc()?n.defaultFormatUtc:n.defaultFormat);var t=N(this,e);return this.localeData().postformat(t)},Mr.from=function(e,t){return this.isValid()&&(_(e)&&e.isValid()||Ft(e).isValid())?Zt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Mr.fromNow=function(e){return this.from(Ft(),e)},Mr.to=function(e,t){return this.isValid()&&(_(e)&&e.isValid()||Ft(e).isValid())?Zt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Mr.toNow=function(e){return this.to(Ft(),e)},Mr.get=function(e){return O(this[e=V(e)])?this[e]():this},Mr.invalidAt=function(){return p(this).overflow},Mr.isAfter=function(e,t){var r=_(e)?e:Ft(e);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=V(t)||"millisecond")?this.valueOf()>r.valueOf():r.valueOf()<this.clone().startOf(t).valueOf())},Mr.isBefore=function(e,t){var r=_(e)?e:Ft(e);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=V(t)||"millisecond")?this.valueOf()<r.valueOf():this.clone().endOf(t).valueOf()<r.valueOf())},Mr.isBetween=function(e,t,r,n){var a=_(e)?e:Ft(e),i=_(t)?t:Ft(t);return!!(this.isValid()&&a.isValid()&&i.isValid())&&("("===(n=n||"()")[0]?this.isAfter(a,r):!this.isBefore(a,r))&&(")"===n[1]?this.isBefore(i,r):!this.isAfter(i,r))},Mr.isSame=function(e,t){var r,n=_(e)?e:Ft(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=V(t)||"millisecond")?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(t).valueOf()<=r&&r<=this.clone().endOf(t).valueOf()))},Mr.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},Mr.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},Mr.isValid=function(){return g(this)},Mr.lang=or,Mr.locale=ir,Mr.localeData=sr,Mr.max=Rt,Mr.min=It,Mr.parsingFlags=function(){return h({},p(this))},Mr.set=function(e,t){if("object"==typeof e){var r,n=function(e){var t,r=[];for(t in e)o(e,t)&&r.push({unit:t,priority:B[t]});return r.sort(function(e,t){return e.priority-t.priority}),r}(e=z(e)),a=n.length;for(r=0;r<a;r++)this[n[r].unit](e[n[r].unit])}else if(O(this[e=V(e)]))return this[e](t);return this},Mr.startOf=function(e){var t,r;if(void 0===(e=V(e))||"millisecond"===e||!this.isValid())return this;switch(r=this._isUTC?pr:fr,e){case"year":t=r(this.year(),0,1);break;case"quarter":t=r(this.year(),this.month()-this.month()%3,1);break;case"month":t=r(this.year(),this.month(),1);break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=r(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=hr(t+(this._isUTC?0:this.utcOffset()*ur),cr);break;case"minute":t=this._d.valueOf(),t-=hr(t,ur);break;case"second":t=this._d.valueOf(),t-=hr(t,lr)}return this._d.setTime(t),n.updateOffset(this,!0),this},Mr.subtract=rr,Mr.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},Mr.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()}},Mr.toDate=function(){return new Date(this.valueOf())},Mr.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,r=t?this.clone().utc():this;return r.year()<0||r.year()>9999?N(r,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):O(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",N(r,"Z")):N(r,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},Mr.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,r="moment",n="";return this.isLocal()||(r=0===this.utcOffset()?"moment.utc":"moment.parseZone",n="Z"),e="["+r+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+n+'[")]')},"undefined"!=typeof Symbol&&null!=Symbol.for&&(Mr[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Mr.toJSON=function(){return this.isValid()?this.toISOString():null},Mr.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},Mr.unix=function(){return Math.floor(this.valueOf()/1e3)},Mr.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},Mr.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},Mr.eraName=function(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e){if(r=this.clone().startOf("day").valueOf(),n[e].since<=r&&r<=n[e].until)return n[e].name;if(n[e].until<=r&&r<=n[e].since)return n[e].name}return""},Mr.eraNarrow=function(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e){if(r=this.clone().startOf("day").valueOf(),n[e].since<=r&&r<=n[e].until)return n[e].narrow;if(n[e].until<=r&&r<=n[e].since)return n[e].narrow}return""},Mr.eraAbbr=function(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e){if(r=this.clone().startOf("day").valueOf(),n[e].since<=r&&r<=n[e].until)return n[e].abbr;if(n[e].until<=r&&r<=n[e].since)return n[e].abbr}return""},Mr.eraYear=function(){var e,t,r,a,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e)if(r=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()-n(i[e].since).year())*r+i[e].offset;return this.year()},Mr.year=Ce,Mr.isLeapYear=function(){return ye(this.year())},Mr.weekYear=function(e){return vr.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)},Mr.isoWeekYear=function(e){return vr.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},Mr.quarter=Mr.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},Mr.month=ze,Mr.daysInMonth=function(){return $e(this.year(),this.month())},Mr.week=Mr.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},Mr.isoWeek=Mr.isoWeeks=function(e){var t=qe(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},Mr.weeksInYear=function(){var e=this.localeData()._week;return Ge(this.year(),e.dow,e.doy)},Mr.weeksInWeekYear=function(){var e=this.localeData()._week;return Ge(this.weekYear(),e.dow,e.doy)},Mr.isoWeeksInYear=function(){return Ge(this.year(),1,4)},Mr.isoWeeksInISOWeekYear=function(){return Ge(this.isoWeekYear(),1,4)},Mr.date=xr,Mr.day=Mr.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=De(this,"Day");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},Mr.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")},Mr.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},Mr.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")},Mr.hour=Mr.hours=lt,Mr.minute=Mr.minutes=_r,Mr.second=Mr.seconds=Sr,Mr.millisecond=Mr.milliseconds=kr,Mr.utcOffset=function(e,t,r){var a,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=Yt(ae,e)))return this}else Math.abs(e)<16&&!r&&(e*=60);return!this._isUTC&&t&&(a=Ht(this)),this._offset=e,this._isUTC=!0,null!=a&&this.add(a,"m"),i!==e&&(!t||this._changeInProgress?er(this,Zt(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:Ht(this)},Mr.utc=function(e){return this.utcOffset(0,e)},Mr.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Ht(this),"m")),this},Mr.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Yt(ne,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},Mr.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Ft(e).utcOffset():0,(this.utcOffset()-e)%60==0)},Mr.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Mr.isLocal=function(){return!!this.isValid()&&!this._isUTC},Mr.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},Mr.isUtc=qt,Mr.isUTC=qt,Mr.zoneAbbr=function(){return this._isUTC?"UTC":""},Mr.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},Mr.dates=k("dates accessor is deprecated. Use date instead.",xr),Mr.months=k("months accessor is deprecated. Use month instead",ze),Mr.years=k("years accessor is deprecated. Use year instead",Ce),Mr.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()}),Mr.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=Et(t))._a?(e=t._isUTC?f(t._a):Ft(t._a),this._isDSTShifted=this.isValid()&&function(e,t){var r,n=Math.min(e.length,t.length),a=Math.abs(e.length-t.length),i=0;for(r=0;r<n;r++)he(e[r])!==he(t[r])&&i++;return i+a}(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted});var Ar=C.prototype;function Cr(e,t,r,n){var a=yt(),i=f().set(n,t);return a[r](i,e)}function Pr(e,t,r){if(u(e)&&(t=e,e=void 0),e=e||"",null!=t)return Cr(e,t,r,"month");var n,a=[];for(n=0;n<12;n++)a[n]=Cr(e,n,r,"month");return a}function Dr(e,t,r,n){"boolean"==typeof e?(u(t)&&(r=t,t=void 0),t=t||""):(r=t=e,e=!1,u(t)&&(r=t,t=void 0),t=t||"");var a,i=yt(),o=e?i._week.dow:0,s=[];if(null!=r)return Cr(t,(r+o)%7,n,"day");for(a=0;a<7;a++)s[a]=Cr(t,(a+o)%7,n,"day");return s}Ar.calendar=function(e,t,r){var n=this._calendar[e]||this._calendar.sameElse;return O(n)?n.call(t,r):n},Ar.longDateFormat=function(e){var t=this._longDateFormat[e],r=this._longDateFormat[e.toUpperCase()];return t||!r?t:(this._longDateFormat[e]=r.match(D).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])},Ar.invalidDate=function(){return this._invalidDate},Ar.ordinal=function(e){return this._ordinal.replace("%d",e)},Ar.preparse=Or,Ar.postformat=Or,Ar.relativeTime=function(e,t,r,n){var a=this._relativeTime[r];return O(a)?a(e,t,r,n):a.replace(/%d/i,e)},Ar.pastFuture=function(e,t){var r=this._relativeTime[e>0?"future":"past"];return O(r)?r(t):r.replace(/%s/i,t)},Ar.set=function(e){var t,r;for(r in e)o(e,r)&&(O(t=e[r])?this[r]=t:this["_"+r]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Ar.eras=function(e,t){var r,a,i,o=this._eras||yt("en")._eras;for(r=0,a=o.length;r<a;++r)switch("string"==typeof o[r].since&&(i=n(o[r].since).startOf("day"),o[r].since=i.valueOf()),typeof o[r].until){case"undefined":o[r].until=Infinity;break;case"string":i=n(o[r].until).startOf("day").valueOf(),o[r].until=i.valueOf()}return o},Ar.erasParse=function(e,t,r){var n,a,i,o,s,l=this.eras();for(e=e.toUpperCase(),n=0,a=l.length;n<a;++n)if(i=l[n].name.toUpperCase(),o=l[n].abbr.toUpperCase(),s=l[n].narrow.toUpperCase(),r)switch(t){case"N":case"NN":case"NNN":if(o===e)return l[n];break;case"NNNN":if(i===e)return l[n];break;case"NNNNN":if(s===e)return l[n]}else if([i,o,s].indexOf(e)>=0)return l[n]},Ar.erasConvertYear=function(e,t){var r=e.since<=e.until?1:-1;return void 0===t?n(e.since).year():n(e.since).year()+(t-e.offset)*r},Ar.erasAbbrRegex=function(e){return o(this,"_erasAbbrRegex")||mr.call(this),e?this._erasAbbrRegex:this._erasRegex},Ar.erasNameRegex=function(e){return o(this,"_erasNameRegex")||mr.call(this),e?this._erasNameRegex:this._erasRegex},Ar.erasNarrowRegex=function(e){return o(this,"_erasNarrowRegex")||mr.call(this),e?this._erasNarrowRegex:this._erasRegex},Ar.months=function(e,t){return e?a(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Re).test(t)?"format":"standalone"][e.month()]:a(this._months)?this._months:this._months.standalone},Ar.monthsShort=function(e,t){return e?a(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Re.test(t)?"format":"standalone"][e.month()]:a(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Ar.monthsParse=function(e,t,r){var n,a,i;if(this._monthsParseExact)return Le.call(this,e,t,r);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(a=f([2e3,n]),r&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),r||this._monthsParse[n]||(i="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[n]=new RegExp(i.replace(".",""),"i")),r&&"MMMM"===t&&this._longMonthsParse[n].test(e))return n;if(r&&"MMM"===t&&this._shortMonthsParse[n].test(e))return n;if(!r&&this._monthsParse[n].test(e))return n}},Ar.monthsRegex=function(e){return this._monthsParseExact?(o(this,"_monthsRegex")||We.call(this),e?this._monthsStrictRegex:this._monthsRegex):(o(this,"_monthsRegex")||(this._monthsRegex=je),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},Ar.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)},Ar.week=function(e){return qe(e,this._week.dow,this._week.doy).week},Ar.firstDayOfYear=function(){return this._week.doy},Ar.firstDayOfWeek=function(){return this._week.dow},Ar.weekdays=function(e,t){var r=a(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Qe(r,this._week.dow):e?r[e.day()]:r},Ar.weekdaysMin=function(e){return!0===e?Qe(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},Ar.weekdaysShort=function(e){return!0===e?Qe(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},Ar.weekdaysParse=function(e,t,r){var n,a,i;if(this._weekdaysParseExact)return rt.call(this,e,t,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(a=f([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(i="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[n]=new RegExp(i.replace(".",""),"i")),r&&"dddd"===t&&this._fullWeekdaysParse[n].test(e))return n;if(r&&"ddd"===t&&this._shortWeekdaysParse[n].test(e))return n;if(r&&"dd"===t&&this._minWeekdaysParse[n].test(e))return n;if(!r&&this._weekdaysParse[n].test(e))return n}},Ar.weekdaysRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(o(this,"_weekdaysRegex")||(this._weekdaysRegex=Xe),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},Ar.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(o(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=et),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Ar.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(o(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=tt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Ar.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},Ar.meridiem=function(e,t,r){return e>11?r?"pm":"PM":r?"am":"AM"},gt("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===he(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),n.lang=k("moment.lang is deprecated. Use moment.locale instead.",gt),n.langData=k("moment.langData is deprecated. Use moment.localeData instead.",yt);var Er=Math.abs;function $r(e,t,r,n){var a=Zt(t,r);return e._milliseconds+=n*a._milliseconds,e._days+=n*a._days,e._months+=n*a._months,e._bubble()}function Fr(e){return e<0?Math.floor(e):Math.ceil(e)}function Ir(e){return 4800*e/146097}function Rr(e){return 146097*e/4800}function Nr(e){return function(){return this.as(e)}}var jr=Nr("ms"),Lr=Nr("s"),Vr=Nr("m"),zr=Nr("h"),Wr=Nr("d"),Br=Nr("w"),Yr=Nr("M"),Ur=Nr("Q"),Hr=Nr("y"),qr=jr;function Gr(e){return function(){return this.isValid()?this._data[e]:NaN}}var Qr=Gr("milliseconds"),Zr=Gr("seconds"),Jr=Gr("minutes"),Kr=Gr("hours"),Xr=Gr("days"),en=Gr("months"),tn=Gr("years"),rn=Math.round,nn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function an(e,t,r,n,a){return a.relativeTime(t||1,!!r,e,n)}var on=Math.abs;function sn(e){return(e>0)-(e<0)||+e}function ln(){if(!this.isValid())return this.localeData().invalidDate();var e,t,r,n,a,i,o,s,l=on(this._milliseconds)/1e3,u=on(this._days),c=on(this._months),d=this.asSeconds();return d?(e=de(l/60),t=de(e/60),l%=60,e%=60,r=de(c/12),c%=12,n=l?l.toFixed(3).replace(/\.?0+$/,""):"",a=d<0?"-":"",i=sn(this._months)!==sn(d)?"-":"",o=sn(this._days)!==sn(d)?"-":"",s=sn(this._milliseconds)!==sn(d)?"-":"",a+"P"+(r?i+r+"Y":"")+(c?i+c+"M":"")+(u?o+u+"D":"")+(t||e||l?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(l?s+n+"S":"")):"P0D"}var un=Lt.prototype;return un.isValid=function(){return this._isValid},un.abs=function(){var e=this._data;return this._milliseconds=Er(this._milliseconds),this._days=Er(this._days),this._months=Er(this._months),e.milliseconds=Er(e.milliseconds),e.seconds=Er(e.seconds),e.minutes=Er(e.minutes),e.hours=Er(e.hours),e.months=Er(e.months),e.years=Er(e.years),this},un.add=function(e,t){return $r(this,e,t,1)},un.subtract=function(e,t){return $r(this,e,t,-1)},un.as=function(e){if(!this.isValid())return NaN;var t,r,n=this._milliseconds;if("month"===(e=V(e))||"quarter"===e||"year"===e)switch(r=this._months+Ir(t=this._days+n/864e5),e){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(t=this._days+Math.round(Rr(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return 24*t+n/36e5;case"minute":return 1440*t+n/6e4;case"second":return 86400*t+n/1e3;case"millisecond":return Math.floor(864e5*t)+n;default:throw new Error("Unknown unit "+e)}},un.asMilliseconds=jr,un.asSeconds=Lr,un.asMinutes=Vr,un.asHours=zr,un.asDays=Wr,un.asWeeks=Br,un.asMonths=Yr,un.asQuarters=Ur,un.asYears=Hr,un.valueOf=qr,un._bubble=function(){var e,t,r,n,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*Fr(Rr(s)+o),o=0,s=0),l.milliseconds=i%1e3,e=de(i/1e3),l.seconds=e%60,t=de(e/60),l.minutes=t%60,r=de(t/60),l.hours=r%24,o+=de(r/24),s+=a=de(Ir(o)),o-=Fr(Rr(a)),n=de(s/12),s%=12,l.days=o,l.months=s,l.years=n,this},un.clone=function(){return Zt(this)},un.get=function(e){return e=V(e),this.isValid()?this[e+"s"]():NaN},un.milliseconds=Qr,un.seconds=Zr,un.minutes=Jr,un.hours=Kr,un.days=Xr,un.weeks=function(){return de(this.days()/7)},un.months=en,un.years=tn,un.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var r,n,a=!1,i=nn;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(a=e),"object"==typeof t&&(i=Object.assign({},nn,t),null!=t.s&&null==t.ss&&(i.ss=t.s-1)),n=function(e,t,r,n){var a=Zt(e).abs(),i=rn(a.as("s")),o=rn(a.as("m")),s=rn(a.as("h")),l=rn(a.as("d")),u=rn(a.as("M")),c=rn(a.as("w")),d=rn(a.as("y")),h=i<=r.ss&&["s",i]||i<r.s&&["ss",i]||o<=1&&["m"]||o<r.m&&["mm",o]||s<=1&&["h"]||s<r.h&&["hh",s]||l<=1&&["d"]||l<r.d&&["dd",l];return null!=r.w&&(h=h||c<=1&&["w"]||c<r.w&&["ww",c]),(h=h||u<=1&&["M"]||u<r.M&&["MM",u]||d<=1&&["y"]||["yy",d])[2]=t,h[3]=+e>0,h[4]=n,an.apply(null,h)}(this,!a,i,r=this.localeData()),a&&(n=r.pastFuture(+this,n)),r.postformat(n)},un.toISOString=ln,un.toString=ln,un.toJSON=ln,un.locale=ir,un.localeData=sr,un.toIsoString=k("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ln),un.lang=or,I("X",0,0,"unix"),I("x",0,0,"valueOf"),le("x",re),le("X",/[+-]?\d+(\.\d{1,3})?/),pe("X",function(e,t,r){r._d=new Date(1e3*parseFloat(e))}),pe("x",function(e,t,r){r._d=new Date(he(e))}),n.version="2.30.1",t=Ft,n.fn=Mr,n.min=function(){return Nt("isBefore",[].slice.call(arguments,0))},n.max=function(){return Nt("isAfter",[].slice.call(arguments,0))},n.now=function(){return Date.now?Date.now():+new Date},n.utc=f,n.unix=function(e){return Ft(1e3*e)},n.months=function(e,t){return Pr(e,t,"months")},n.isDate=c,n.locale=gt,n.invalid=m,n.duration=Zt,n.isMoment=_,n.weekdays=function(e,t,r){return Dr(e,t,r,"weekdays")},n.parseZone=function(){return Ft.apply(null,arguments).parseZone()},n.localeData=yt,n.isDuration=Vt,n.monthsShort=function(e,t){return Pr(e,t,"monthsShort")},n.weekdaysMin=function(e,t,r){return Dr(e,t,r,"weekdaysMin")},n.defineLocale=mt,n.updateLocale=function(e,t){if(null!=t){var r,n,a=ut;null!=ct[e]&&null!=ct[e].parentLocale?ct[e].set(A(ct[e]._config,t)):(null!=(n=pt(e))&&(a=n._config),t=A(a,t),null==n&&(t.abbr=e),(r=new C(t)).parentLocale=ct[e],ct[e]=r),gt(e)}else null!=ct[e]&&(null!=ct[e].parentLocale?(ct[e]=ct[e].parentLocale,e===gt()&&gt(e)):null!=ct[e]&&delete ct[e]);return ct[e]},n.locales=function(){return S(ct)},n.weekdaysShort=function(e,t,r){return Dr(e,t,r,"weekdaysShort")},n.normalizeUnits=V,n.relativeTimeRounding=function(e){return void 0===e?rn:"function"==typeof e&&(rn=e,!0)},n.relativeTimeThreshold=function(e,t){return void 0!==nn[e]&&(void 0===t?nn[e]:(nn[e]=t,"s"===e&&(nn.ss=t-1),!0))},n.calendarFormat=function(e,t){var r=e.diff(t,"days",!0);return r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse"},n.prototype=Mr,n.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"},n}()}),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]},r=function(e,r){return function(e){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[t[n]]=n);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})}function l(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}a.rgb.hsl=function(e){var t,r,n=e[0]/255,a=e[1]/255,i=e[2]/255,o=Math.min(n,a,i),s=Math.max(n,a,i),l=s-o;return s===o?t=0:n===s?t=(a-i)/l:a===s?t=2+(i-n)/l:i===s&&(t=4+(n-a)/l),(t=Math.min(60*t,360))<0&&(t+=360),r=(o+s)/2,[t,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]},a.rgb.hsv=function(e){var t,r,n,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),r=d(s),n=d(l),o===u?a=n-r:s===u?a=1/3+t-n:l===u&&(a=2/3+r-t),a<0?a+=1:a>1&&(a-=1)),[360*a,100*i,100*u]},a.rgb.hwb=function(e){var t=e[0],r=e[1],n=e[2];return[a.rgb.hsl(e)[0],1/255*Math.min(t,Math.min(r,n))*100,100*(n=1-1/255*Math.max(t,Math.max(r,n)))]},a.rgb.cmyk=function(e){var t,r=e[0]/255,n=e[1]/255,a=e[2]/255;return[100*((1-r-(t=Math.min(1-r,1-n,1-a)))/(1-t)||0),100*((1-n-t)/(1-t)||0),100*((1-a-t)/(1-t)||0),100*t]},a.rgb.keyword=function(e){var n=r[e];if(n)return n;var a,i=Infinity;for(var o in t)if(t.hasOwnProperty(o)){var s=l(e,t[o]);s<i&&(i=s,a=o)}return a},a.keyword.rgb=function(e){return t[e]},a.rgb.xyz=function(e){var t=e[0]/255,r=e[1]/255,n=e[2]/255;return[100*(.4124*(t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*t+.7152*r+.0722*n),100*(.0193*t+.1192*r+.9505*n)]},a.rgb.lab=function(e){var t=a.rgb.xyz(e),r=t[0],n=t[1],i=t[2];return n/=100,i/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.hsl.rgb=function(e){var t,r,n,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-(r=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var u=0;u<3;u++)(n=o+1/3*-(u-1))<0&&n++,n>1&&n--,a[u]=255*(i=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t);return a},a.hsl.hsv=function(e){var t=e[0],r=e[1]/100,n=e[2]/100,a=r,i=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,a*=i<=1?i:2-i,[t,100*(0===n?2*a/(i+a):2*r/(n+r)),(n+r)/2*100]},a.hsv.rgb=function(e){var t=e[0]/60,r=e[1]/100,n=e[2]/100,a=Math.floor(t)%6,i=t-Math.floor(t),o=255*n*(1-r),s=255*n*(1-r*i),l=255*n*(1-r*(1-i));switch(n*=255,a){case 0:return[n,l,o];case 1:return[s,n,o];case 2:return[o,n,l];case 3:return[o,s,n];case 4:return[l,o,n];case 5:return[n,o,s]}},a.hsv.hsl=function(e){var t,r,n,a=e[0],i=e[1]/100,o=e[2]/100,s=Math.max(o,.01);return n=(2-i)*o,r=i*s,[a,100*(r=(r/=(t=(2-i)*s)<=1?t:2-t)||0),100*(n/=2)]},a.hwb.rgb=function(e){var t,r,n,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),n=6*l-(t=Math.floor(6*l)),1&t&&(n=1-n),a=u+n*((r=1-c)-u),t){default:case 6:case 0:i=r,o=a,s=u;break;case 1:i=a,o=r,s=u;break;case 2:i=u,o=r,s=a;break;case 3:i=u,o=a,s=r;break;case 4:i=a,o=u,s=r;break;case 5:i=r,o=u,s=a}return[255*i,255*o,255*s]},a.cmyk.rgb=function(e){var t=e[1]/100,r=e[2]/100,n=e[3]/100;return[255*(1-Math.min(1,e[0]/100*(1-n)+n)),255*(1-Math.min(1,t*(1-n)+n)),255*(1-Math.min(1,r*(1-n)+n))]},a.xyz.rgb=function(e){var t,r,n,a=e[0]/100,i=e[1]/100,o=e[2]/100;return r=-.9689*a+1.8758*i+.0415*o,n=.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,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(t=Math.min(Math.max(0,t),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},a.xyz.lab=function(e){var t=e[0],r=e[1],n=e[2];return r/=100,n/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(t-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},a.lab.xyz=function(e){var t,r,n;t=e[1]/500+(r=(e[0]+16)/116),n=r-e[2]/200;var a=Math.pow(r,3),i=Math.pow(t,3),o=Math.pow(n,3);return r=a>.008856?a:(r-16/116)/7.787,t=i>.008856?i:(t-16/116)/7.787,n=o>.008856?o:(n-16/116)/7.787,[t*=95.047,r*=100,n*=108.883]},a.lab.lch=function(e){var t,r=e[0],n=e[1],a=e[2];return(t=360*Math.atan2(a,n)/2/Math.PI)<0&&(t+=360),[r,Math.sqrt(n*n+a*a),t]},a.lch.lab=function(e){var t,r=e[1];return t=e[2]/360*2*Math.PI,[e[0],r*Math.cos(t),r*Math.sin(t)]},a.rgb.ansi16=function(e){var t=e[0],r=e[1],n=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(n/255)<<2|Math.round(r/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],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/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 r=.5*(1+~~(e>50));return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},a.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var r;return e-=16,[Math.floor(e/36)/5*255,Math.floor((r=e%36)/6)/5*255,r%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 r=t[0];3===t[0].length&&(r=r.split("").map(function(e){return e+e}).join(""));var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},a.rgb.hcg=function(e){var t,r=e[0]/255,n=e[1]/255,a=e[2]/255,i=Math.max(Math.max(r,n),a),o=Math.min(Math.min(r,n),a),s=i-o;return t=s<=0?0:i===r?(n-a)/s%6:i===n?2+(a-r)/s:4+(r-n)/s+4,t/=6,[360*(t%=1),100*s,100*(s<1?o/(1-s):0)]},a.hsl.hcg=function(e){var t,r=e[1]/100,n=e[2]/100,a=0;return(t=n<.5?2*r*n:2*r*(1-n))<1&&(a=(n-.5*t)/(1-t)),[e[0],100*t,100*a]},a.hsv.hcg=function(e){var t=e[2]/100,r=e[1]/100*t,n=0;return r<1&&(n=(t-r)/(1-r)),[e[0],100*r,100*n]},a.hcg.rgb=function(e){var t=e[1]/100,r=e[2]/100;if(0===t)return[255*r,255*r,255*r];var n,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]+(n=(1-t)*r)),255*(t*a[1]+n),255*(t*a[2]+n)]},a.hcg.hsv=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t),n=0;return r>0&&(n=t/r),[e[0],100*n,100*r]},a.hcg.hsl=function(e){var t=e[1]/100,r=e[2]/100*(1-t)+.5*t,n=0;return r>0&&r<.5?n=t/(2*r):r>=.5&&r<1&&(n=t/(2*(1-r))),[e[0],100*n,100*r]},a.hcg.hwb=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],100*(r-t),100*(1-r)]},a.hwb.hcg=function(e){var t=1-e[2]/100,r=t-e[1]/100,n=0;return r<1&&(n=(t-r)/(1-r)),[e[0],100*r,100*n]},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),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},a.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}}(r={exports:{}}),r.exports}();function n(e,t){return function(r){return t(e(r))}}function a(e,t){for(var a=[t[e].parent,e],i=r[t[e].parent][e],o=t[e].parent;t[o].parent;)a.unshift(t[o].parent),i=n(r[t[o].parent][o],i),o=t[o].parent;return i.conversion=a,i}var i={};Object.keys(r).forEach(function(e){i[e]={},Object.defineProperty(i[e],"channels",{value:r[e].channels}),Object.defineProperty(i[e],"labels",{value:r[e].labels});var t=function(e){for(var t=function(e){var t=function(){for(var e={},t=Object.keys(r),n=t.length,a=0;a<n;a++)e[t[a]]={distance:-1,parent:null};return e}(),n=[e];for(t[e].distance=0;n.length;)for(var a=n.pop(),i=Object.keys(r[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,n.unshift(l))}return t}(e),n={},i=Object.keys(t),o=i.length,s=0;s<o;s++){var l=i[s];null!==t[l].parent&&(n[l]=a(l,t))}return n}(e);Object.keys(t).forEach(function(r){var n=t[r];i[e][r]=function(e){var t=function(t){if(null==t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var r=e(t);if("object"==typeof r)for(var n=r.length,a=0;a<n;a++)r[a]=Math.round(r[a]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}(n),i[e][r].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}(n)})});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 y[e.slice(0,3)]}};function u(e){if(e){var t=[0,0,0],r=1,n=e.match(/^#([a-fA-F0-9]{3,4})$/i),a="";if(n){a=(n=n[1])[3];for(var i=0;i<t.length;i++)t[i]=parseInt(n[i]+n[i],16);a&&(r=Math.round(parseInt(a+a,16)/255*100)/100)}else if(n=e.match(/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i)){for(a=n[2],n=n[1],i=0;i<t.length;i++)t[i]=parseInt(n.slice(2*i,2*i+2),16);a&&(r=Math.round(parseInt(a,16)/255*100)/100)}else if(n=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(n[i+1]);r=parseFloat(n[4])}else if(n=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(n[i+1]));r=parseFloat(n[4])}else if(n=e.match(/(\w+)/)){if("transparent"==n[1])return[0,0,0,0];if(!(t=s[n[1]]))return}for(i=0;i<t.length;i++)t[i]=g(t[i],0,255);return r=r||0==r?g(r,0,1):1,t[3]=r,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 r=parseFloat(t[4]);return[g(parseInt(t[1]),0,360),g(parseFloat(t[2]),0,100),g(parseFloat(t[3]),0,100),g(isNaN(r)?1:r,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 r=parseFloat(t[4]);return[g(parseInt(t[1]),0,360),g(parseFloat(t[2]),0,100),g(parseFloat(t[3]),0,100),g(isNaN(r)?1:r,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,r){return Math.min(Math.max(t,e),r)}function m(e){var t=e.toString(16).toUpperCase();return t.length<2?"0"+t:t}var y={};for(var v in s)y[s[v]]=v;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=[],r=0;r<e.length;r++){var n=e[r]/255;t[r]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast:function(e){var t=this.luminosity(),r=e.luminosity();return t>r?(t+.05)/(r+.05):(r+.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,r=(t[0]+e)%360;return t[0]=r<0?360+r:r,this.setValues("hsl",t),this},mix:function(e,t){var r=this,n=e,a=void 0===t?.5:t,i=2*a-1,o=r.alpha()-n.alpha(),s=((i*o===-1?i:(i+o)/(1+i*o))+1)/2,l=1-s;return this.rgb(s*r.red()+l*n.red(),s*r.green()+l*n.green(),s*r.blue()+l*n.blue()).alpha(r.alpha()*a+n.alpha()*(1-a))},toJSON:function(){return this.rgb()},clone:function(){var e,t,r=new b,n=this.values,a=r.values;for(var i in n)n.hasOwnProperty(i)&&("[object Array]"===(t={}.toString.call(e=n[i]))?a[i]=e.slice(0):"[object Number]"===t?a[i]=e:console.error("unexpected color value:",e));return r}},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,r={},n=0;n<e.length;n++)r[e.charAt(n)]=t[e][n];return 1!==t.alpha&&(r.a=t.alpha),r},b.prototype.setValues=function(e,t){var r,n,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(r=0;r<e.length;r++)a[e][r]=t[e.charAt(r)];l=t.a}else if(void 0!==t[i[e][0]]){var u=i[e];for(r=0;r<e.length;r++)a[e][r]=t[u[r]];l=t.alpha}if(a.alpha=Math.max(0,Math.min(1,void 0===l?a.alpha:l)),"alpha"===e)return!1;for(r=0;r<e.length;r++)n=Math.max(0,Math.min(s[e][r],a[e][r])),a[e][r]=Math.round(n);for(var c in i)c!==e&&(a[c]=o[e][c](a[e]));return!0},b.prototype.setSpace=function(e,t){var r=t[0];return void 0===r?this.getValues(e):("number"==typeof r&&(r=Array.prototype.slice.call(t)),this.setValues(e,r),this)},b.prototype.setChannel=function(e,t,r){var n=this.values[e];return void 0===r?n[t]:(r===n[t]||(n[t]=r,this.setValues(e,n)),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,r){return k.valueOrDefault(k.isArray(e)?e[t]:e,r)},callback:function(e,t,r){if(e&&"function"==typeof e.call)return e.apply(r,t)},each:function(e,t,r,n){var a,i,o;if(k.isArray(e))if(i=e.length,n)for(a=i-1;a>=0;a--)t.call(r,e[a],a);else for(a=0;a<i;a++)t.call(r,e[a],a);else if(k.isObject(e))for(i=(o=Object.keys(e)).length,a=0;a<i;a++)t.call(r,e[o[a]],o[a])},arrayEquals:function(e,t){var r,n,a,i;if(!e||!t||e.length!==t.length)return!1;for(r=0,n=e.length;r<n;++r)if(i=t[r],(a=e[r])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),r=Object.keys(e),n=r.length,a=0;a<n;++a)t[r[a]]=k.clone(e[r[a]]);return t}return e},_merger:function(e,t,r,n){if(_(e)){var a=t[e],i=r[e];k.isObject(a)&&k.isObject(i)?k.merge(a,i,n):t[e]=k.clone(i)}},_mergerIf:function(e,t,r){if(_(e)){var n=t[e],a=r[e];k.isObject(n)&&k.isObject(a)?k.mergeIf(n,a):t.hasOwnProperty(e)||(t[e]=k.clone(a))}},merge:function(e,t,r){var n,a,i,o,s,l=k.isArray(t)?t:[t],u=l.length;if(!k.isObject(e))return e;for(n=(r=r||{}).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)n(i[s],e,t,r);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,r){t[e]=r[e]}})},inherits:function(e){var t=this,r=e&&e.hasOwnProperty("constructor")?e.constructor:function(){return t.apply(this,arguments)},n=function(){this.constructor=r};return n.prototype=t.prototype,r.prototype=new n,r.extend=k.inherits,e&&k.extend(r.prototype,e),r.__super__=t.prototype,r},_deprecated:function(e,t,r,n){void 0!==t&&console.warn(e+': "'+r+'" is deprecated. Please use "'+n+'" instead')}},S=k;k.callCallback=k.callback,k.indexOf=function(e,t,r){return Array.prototype.indexOf.call(e,t,r)},k.getValueOrDefault=k.valueOrDefault,k.getValueAtIndexOrDefault=k.valueAtIndexOrDefault;var T={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,r=0;return 0===e?0:1===e?1:(r||(r=.3),t=r/(2*Math.PI)*Math.asin(1),-1*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r))},easeOutElastic:function(e){var t=1.70158,r=0;return 0===e?0:1===e?1:(r||(r=.3),t=r/(2*Math.PI)*Math.asin(1),1*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/r)+1)},easeInOutElastic:function(e){var t=1.70158,r=0;return 0===e?0:2==(e/=.5)?1:(r||(r=.45),t=r/(2*Math.PI)*Math.asin(1),e<1?1*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)*-.5:1*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)*.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-T.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*T.easeInBounce(2*e):.5*T.easeOutBounce(2*e-1)+.5}},M={effects:T};S.easingEffects=T;var O=Math.PI,A=O/180,C=2*O,P=O/2,D=O/4,E=2*O/3,$={clear:function(e){e.ctx.clearRect(0,0,e.width,e.height)},roundedRect:function(e,t,r,n,a,i){if(i){var o=Math.min(i,a/2,n/2),s=t+o,l=r+o,u=t+n-o,c=r+a-o;e.moveTo(t,l),s<u&&l<c?(e.arc(s,l,o,-O,-P),e.arc(u,l,o,-P,0),e.arc(u,c,o,0,P),e.arc(s,c,o,P,O)):s<u?(e.moveTo(s,r),e.arc(u,l,o,-P,P),e.arc(s,l,o,P,O+P)):l<c?(e.arc(s,l,o,-O,0),e.arc(s,c,o,0,O)):e.arc(s,l,o,-O,O),e.closePath(),e.moveTo(t,r)}else e.rect(t,r,n,a)},drawPoint:function(e,t,r,n,a,i){var o,s,l,u,c,d=(i||0)*A;if(t&&"object"==typeof t&&("[object HTMLImageElement]"===(o=t.toString())||"[object HTMLCanvasElement]"===o))return e.save(),e.translate(n,a),e.rotate(d),e.drawImage(t,-t.width/2,-t.height/2,t.width,t.height),void e.restore();if(!(isNaN(r)||r<=0)){switch(e.beginPath(),t){default:e.arc(n,a,r,0,C),e.closePath();break;case"triangle":e.moveTo(n+Math.sin(d)*r,a-Math.cos(d)*r),d+=E,e.lineTo(n+Math.sin(d)*r,a-Math.cos(d)*r),d+=E,e.lineTo(n+Math.sin(d)*r,a-Math.cos(d)*r),e.closePath();break;case"rectRounded":u=r-(c=.516*r),s=Math.cos(d+D)*u,l=Math.sin(d+D)*u,e.arc(n-s,a-l,c,d-O,d-P),e.arc(n+l,a-s,c,d-P,d),e.arc(n+s,a+l,c,d,d+P),e.arc(n-l,a+s,c,d+P,d+O),e.closePath();break;case"rect":if(!i){u=Math.SQRT1_2*r,e.rect(n-u,a-u,2*u,2*u);break}d+=D;case"rectRot":s=Math.cos(d)*r,l=Math.sin(d)*r,e.moveTo(n-s,a-l),e.lineTo(n+l,a-s),e.lineTo(n+s,a+l),e.lineTo(n-l,a+s),e.closePath();break;case"crossRot":d+=D;case"cross":s=Math.cos(d)*r,l=Math.sin(d)*r,e.moveTo(n-s,a-l),e.lineTo(n+s,a+l),e.moveTo(n+l,a-s),e.lineTo(n-l,a+s);break;case"star":s=Math.cos(d)*r,l=Math.sin(d)*r,e.moveTo(n-s,a-l),e.lineTo(n+s,a+l),e.moveTo(n+l,a-s),e.lineTo(n-l,a+s),d+=D,s=Math.cos(d)*r,l=Math.sin(d)*r,e.moveTo(n-s,a-l),e.lineTo(n+s,a+l),e.moveTo(n+l,a-s),e.lineTo(n-l,a+s);break;case"line":s=Math.cos(d)*r,l=Math.sin(d)*r,e.moveTo(n-s,a-l),e.lineTo(n+s,a+l);break;case"dash":e.moveTo(n,a),e.lineTo(n+Math.cos(d)*r,a+Math.sin(d)*r)}e.fill(),e.stroke()}},_isPointInArea:function(e,t){var r=1e-6;return e.x>t.left-r&&e.x<t.right+r&&e.y>t.top-r&&e.y<t.bottom+r},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,r,n){var a=r.steppedLine;if(a){if("middle"===a){var i=(t.x+r.x)/2;e.lineTo(i,n?r.y:t.y),e.lineTo(i,n?t.y:r.y)}else"after"===a&&!n||"after"!==a&&n?e.lineTo(t.x,r.y):e.lineTo(r.x,t.y);e.lineTo(r.x,r.y)}else r.tension?e.bezierCurveTo(n?t.controlPointPreviousX:t.controlPointNextX,n?t.controlPointPreviousY:t.controlPointNextY,n?r.controlPointNextX:r.controlPointPreviousX,n?r.controlPointNextY:r.controlPointPreviousY,r.x,r.y):e.lineTo(r.x,r.y)}},F=$;S.clear=$.clear,S.drawRoundedRectangle=function(e){e.beginPath(),$.roundedRect.apply($,arguments)};var I={_set:function(e,t){return S.merge(this[e]||(this[e]={}),t)}};I._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 R=I,N=S.valueOrDefault,j={toLineHeight:function(e,t){var r=(""+e).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!r||"normal"===r[1])return 1.2*t;switch(e=+r[2],r[3]){case"px":return e;case"%":e/=100}return t*e},toPadding:function(e){var t,r,n,a;return S.isObject(e)?(t=+e.top||0,r=+e.right||0,n=+e.bottom||0,a=+e.left||0):t=r=n=a=+e||0,{top:t,right:r,bottom:n,left:a,height:t+n,width:a+r}},_parseFont:function(e){var t=R.global,r=N(e.fontSize,t.defaultFontSize),n={family:N(e.fontFamily,t.defaultFontFamily),lineHeight:S.options.toLineHeight(N(e.lineHeight,t.defaultLineHeight),r),size:r,style:N(e.fontStyle,t.defaultFontStyle),weight:null,string:""};return n.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}(n),n},resolve:function(e,t,r,n){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!==r&&S.isArray(o)&&(o=o[r],s=!1),void 0!==o))return n&&!s&&(n.cacheable=!1),o}},L={_factorize:function(e){var t,r=[],n=Math.sqrt(e);for(t=1;t<n;t++)e%t===0&&(r.push(t),r.push(e/t));return n===(0|n)&&r.push(n),r.sort(function(e,t){return e-t}).pop(),r},log10:Math.log10||function(e){var t=Math.log(e)*Math.LOG10E,r=Math.round(t);return e===Math.pow(10,r)?r:t}},V=L;S.log10=L.log10;var z=S,W=F,B=j,Y=V;z.easing=M,z.canvas=W,z.options=B,z.math=Y,z.rtl={getRtlAdapter:function(e,t,r){return e?function(e,t){return{x:function(r){return e+e+t-r},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,r):{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 r,n;"ltr"!==t&&"rtl"!==t||(n=[(r=e.canvas.style).getPropertyValue("direction"),r.getPropertyPriority("direction")],r.setProperty("direction",t,"important"),e.prevTextDirection=n)},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){z.extend(this,e),this.initialize.apply(this,arguments)};z.extend(U.prototype,{_type:void 0,initialize:function(){this.hidden=!1},pivot:function(){var e=this;return e._view||(e._view=z.extend({},e._model)),e._start={},e},transition:function(e){var t=this,r=t._model,n=t._start,a=t._view;return r&&1!==e?(a||(a=t._view={}),n||(n=t._start={}),function(e,t,r,n){var a,i,o,s,l,u,c,d,h,f=Object.keys(r);for(a=0,i=f.length;a<i;++a)if(u=r[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,n).rgbString();continue}}else if(z.isFinite(l)&&z.isFinite(u)){t[o]=l+(u-l)*n;continue}t[o]=u}}(n,a,r,e),t):(t._view=z.extend({},r),t._start=null,t)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return z.isNumber(this._model.x)&&z.isNumber(this._model.y)}}),U.extend=z.inherits;var H=U,q=H.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}}),R._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:z.noop,onComplete:z.noop}});var Q={animations:[],request:null,addAnimation:function(e,t,r,n){var a,i,o=this.animations;for(t.chart=e,t.startTime=Date.now(),t.duration=r,n||(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=z.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=z.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,r,n,a=this.animations,i=0;i<a.length;)t=(e=a[i]).chart,r=e.numSteps,n=Math.floor((Date.now()-e.startTime)/e.duration*r)+1,e.currentStep=Math.min(n,r),z.callback(e.render,[t,e],t),z.callback(e.onAnimationProgress,[e],t),e.currentStep>=r?(z.callback(e.onAnimationComplete,[e],t),t.animating=!1,a.splice(i,1)):++i}},Z=z.options.resolve,J=["push","pop","shift","splice","unshift"];function K(e,t){var r=e._chartjs;if(r){var n=r.listeners,a=n.indexOf(t);-1!==a&&n.splice(a,1),n.length>0||(J.forEach(function(t){delete e[t]}),delete e._chartjs)}}var X=function(e,t){this.initialize(e,t)};z.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 r=this;r.chart=e,r.index=t,r.linkScales(),r.addElements(),r._type=r.getMeta().type},updateIndex:function(e){this.index=e},linkScales:function(){var e=this,t=e.getMeta(),r=e.chart,n=r.scales,a=e.getDataset(),i=r.options.scales;null!==t.xAxisID&&t.xAxisID in n&&!a.xAxisID||(t.xAxisID=a.xAxisID||i.xAxes[0].id),null!==t.yAxisID&&t.yAxisID in n&&!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&&K(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,r=t.dataElementType;return r&&new r({_chart:t.chart,_datasetIndex:t.index,_index:e})},addElements:function(){var e,t,r=this,n=r.getMeta(),a=r.getDataset().data||[],i=n.data;for(e=0,t=a.length;e<t;++e)i[e]=i[e]||r.createMetaData(e);n.dataset=n.dataset||r.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=this,t=e.getDataset(),r=t.data||(t.data=[]);e._data!==r&&(e._data&&K(e._data,e),r&&Object.isExtensible(r)&&function(e,t){e._chartjs?e._chartjs.listeners.push(t):(Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),J.forEach(function(t){var r="onData"+t.charAt(0).toUpperCase()+t.slice(1),n=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:function(){var t=Array.prototype.slice.call(arguments),a=n.apply(this,t);return z.each(e._chartjs.listeners,function(e){"function"==typeof e[r]&&e[r].apply(e,t)}),a}})}))}(r,e),e._data=r),e.resyncElements()},_configure:function(){var e=this;e._config=z.merge(Object.create(null),[e.chart.options.datasets[e._type],e.getDataset()],{merger:function(e,t,r){"_meta"!==e&&"data"!==e&&z._merger(e,t,r)}})},_update:function(e){var t=this;t._configure(),t._cachedDataOpts=null,t.update(e)},update:z.noop,transition:function(e){for(var t=this.getMeta(),r=t.data||[],n=r.length,a=0;a<n;++a)r[a].transition(e);t.dataset&&t.dataset.transition(e)},draw:function(){var e=this.getMeta(),t=e.data||[],r=t.length,n=0;for(e.dataset&&e.dataset.draw();n<r;++n)t[n].draw()},getStyle:function(e){var t,r=this,n=r.getMeta(),a=n.dataset;return r._configure(),!1!==(t=a&&void 0===e?r._resolveDatasetElementOptions(a||{}):r._resolveDataElementOptions(n.data[e=e||0]||{},e)).fill&&null!==t.fill||(t.backgroundColor=t.borderColor),t},_resolveDatasetElementOptions:function(e,t){var r,n,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(r=0,n=d.length;r<n;++r)a=d[r],i=t?"hover"+a.charAt(0).toUpperCase()+a.slice(1):a,h[a]=Z([u[i],l[i],c[i]],f);return h},_resolveDataElementOptions:function(e,t){var r=this,n=e&&e.custom,a=r._cachedDataOpts;if(a&&!n)return a;var i,o,s,l,u=r.chart,c=r._config,d=u.options.elements[r.dataElementType.prototype._type]||{},h=r._dataElementOptions,f={},p={chart:u,dataIndex:t,dataset:r.getDataset(),datasetIndex:r.index},g={cacheable:!n};if(n=n||{},z.isArray(h))for(o=0,s=h.length;o<s;++o)f[l=h[o]]=Z([n[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]]=Z([n[l],c[h[l]],c[l],d[l]],p,t,g);return g.cacheable&&(r._cachedDataOpts=Object.freeze(f)),f},removeHoverStyle:function(e){z.merge(e._model,e.$previousStyle||{}),delete e.$previousStyle},setHoverStyle:function(e){var t=this.chart.data.datasets[e._datasetIndex],r=e._index,n=e.custom||{},a=e._model,i=z.getHoverColor;e.$previousStyle={backgroundColor:a.backgroundColor,borderColor:a.borderColor,borderWidth:a.borderWidth},a.backgroundColor=Z([n.hoverBackgroundColor,t.hoverBackgroundColor,i(a.backgroundColor)],void 0,r),a.borderColor=Z([n.hoverBorderColor,t.hoverBorderColor,i(a.borderColor)],void 0,r),a.borderWidth=Z([n.hoverBorderWidth,t.hoverBorderWidth,a.borderWidth],void 0,r)},_removeDatasetHoverStyle:function(){var e=this.getMeta().dataset;e&&this.removeHoverStyle(e)},_setDatasetHoverStyle:function(){var e,t,r,n,a,i,o=this.getMeta().dataset,s={};if(o){for(i=o._model,a=this._resolveDatasetElementOptions(o,!0),e=0,t=(n=Object.keys(a)).length;e<t;++e)s[r=n[e]]=i[r],i[r]=a[r];o.$previousStyle=s}},resyncElements:function(){var e=this,t=e.getMeta(),r=e.getDataset().data,n=t.data.length,a=r.length;a<n?t.data.splice(a,n-a):a>n&&e.insertElements(n,a-n)},insertElements:function(e,t){for(var r=0;r<t;++r)this.addElementAndReset(e+r)},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=z.inherits;var ee=X,te=2*Math.PI;function re(e,t){var r=t.startAngle,n=t.endAngle,a=t.pixelMargin,i=a/t.outerRadius,o=t.x,s=t.y;e.beginPath(),e.arc(o,s,t.outerRadius,r-i,n+i),t.innerRadius>a?e.arc(o,s,t.innerRadius-a,n+(i=a/t.innerRadius),r-i,!0):e.arc(o,s,a,n+Math.PI/2,r-Math.PI/2),e.closePath(),e.clip()}R._set("global",{elements:{arc:{backgroundColor:R.global.defaultColor,borderColor:"#fff",borderWidth:2,borderAlign:"center"}}});var ne=H.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 r=this._view;if(r){for(var n=z.getAngleFromPoint(r,{x:e,y:t}),a=n.angle,i=n.distance,o=r.startAngle,s=r.endAngle;s<o;)s+=te;for(;a>s;)a-=te;for(;a<o;)a+=te;return a>=o&&a<=s&&i>=r.innerRadius&&i<=r.outerRadius}return!1},getCenterPoint:function(){var e=this._view,t=(e.startAngle+e.endAngle)/2,r=(e.innerRadius+e.outerRadius)/2;return{x:e.x+Math.cos(t)*r,y:e.y+Math.sin(t)*r}},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,r=(e.outerRadius-e.innerRadius)/2+e.innerRadius;return{x:e.x+Math.cos(t)*r,y:e.y+Math.sin(t)*r}},draw:function(){var e,t=this._chart.ctx,r=this._view,n="inner"===r.borderAlign?.33:0,a={x:r.x,y:r.y,innerRadius:r.innerRadius,outerRadius:Math.max(r.outerRadius-n,0),pixelMargin:n,startAngle:r.startAngle,endAngle:r.endAngle,fullCircles:Math.floor(r.circumference/te)};if(t.save(),t.fillStyle=r.backgroundColor,t.strokeStyle=r.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+r.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(),r.borderWidth&&function(e,t,r){var n="inner"===t.borderAlign;n?(e.lineWidth=2*t.borderWidth,e.lineJoin="round"):(e.lineWidth=t.borderWidth,e.lineJoin="bevel"),r.fullCircles&&function(e,t,r,n){var a,i=r.endAngle;for(n&&(r.endAngle=r.startAngle+te,re(e,r),r.endAngle=i,r.endAngle===r.startAngle&&r.fullCircles&&(r.endAngle+=te,r.fullCircles--)),e.beginPath(),e.arc(r.x,r.y,r.innerRadius,r.startAngle+te,r.startAngle,!0),a=0;a<r.fullCircles;++a)e.stroke();for(e.beginPath(),e.arc(r.x,r.y,t.outerRadius,r.startAngle,r.startAngle+te),a=0;a<r.fullCircles;++a)e.stroke()}(e,t,r,n),n&&re(e,r),e.beginPath(),e.arc(r.x,r.y,t.outerRadius,r.startAngle,r.endAngle),e.arc(r.x,r.y,r.innerRadius,r.endAngle,r.startAngle,!0),e.closePath(),e.stroke()}(t,r,a),t.restore()}}),ae=z.valueOrDefault,ie=R.global.defaultColor;R._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=H.extend({_type:"line",draw:function(){var e,t,r,n=this,a=n._view,i=n._chart.ctx,o=a.spanGaps,s=n._children.slice(),l=R.global,u=l.elements.line,c=-1,d=n._loop;if(s.length){if(n._loop){for(e=0;e<s.length;++e)if(t=z.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(),(r=s[0]._view).skip||(i.moveTo(r.x,r.y),c=0),e=1;e<s.length;++e)r=s[e]._view,t=-1===c?z.previousItem(s,e):s[c],r.skip||(c!==e-1&&!o||-1===c?i.moveTo(r.x,r.y):z.canvas.lineTo(i,t._view,r),c=e);d&&i.closePath(),i.stroke(),i.restore()}}}),se=z.valueOrDefault,le=R.global.defaultColor;function ue(e){var t=this._view;return!!t&&Math.abs(e-t.x)<t.radius+t.hitRadius}R._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:le,borderColor:le,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}});var ce=H.extend({_type:"point",inRange:function(e,t){var r=this._view;return!!r&&Math.pow(e-r.x,2)+Math.pow(t-r.y,2)<Math.pow(r.hitRadius+r.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,r=this._chart.ctx,n=t.pointStyle,a=t.rotation,i=t.radius,o=t.x,s=t.y,l=R.global,u=l.defaultColor;t.skip||(void 0===e||z.canvas._isPointInArea(t,e))&&(r.strokeStyle=t.borderColor||u,r.lineWidth=se(t.borderWidth,l.elements.point.borderWidth),r.fillStyle=t.backgroundColor||u,z.canvas.drawPoint(r,n,i,o,s,a))}}),de=R.global.defaultColor;function he(e){return e&&void 0!==e.width}function fe(e){var t,r,n,a,i;return he(e)?(t=e.x-(i=e.width/2),r=e.x+i,n=Math.min(e.y,e.base),a=Math.max(e.y,e.base)):(i=e.height/2,t=Math.min(e.x,e.base),r=Math.max(e.x,e.base),n=e.y-i,a=e.y+i),{left:t,top:n,right:r,bottom:a}}function pe(e,t,r){return e===t?r:e===r?t:e}function ge(e,t,r){var n=null===t,a=null===r,i=!(!e||n&&a)&&fe(e);return i&&(n||t>=i.left&&t<=i.right)&&(a||r>=i.top&&r<=i.bottom)}R._set("global",{elements:{rectangle:{backgroundColor:de,borderColor:de,borderSkipped:"bottom",borderWidth:0}}});var me=H.extend({_type:"rectangle",draw:function(){var e=this._chart.ctx,t=this._view,r=function(e){var t=fe(e),r=t.right-t.left,n=t.bottom-t.top,a=function(e,t,r){var n,a,i,o,s=e.borderWidth,l=function(e){var t=e.borderSkipped,r={};return t?(e.horizontal?e.base>e.x&&(t=pe(t,"left","right")):e.base<e.y&&(t=pe(t,"bottom","top")),r[t]=!0,r):r}(e);return z.isObject(s)?(n=+s.top||0,a=+s.right||0,i=+s.bottom||0,o=+s.left||0):n=a=i=o=+s||0,{t:l.top||n<0?0:n>r?r:n,r:l.right||a<0?0:a>t?t:a,b:l.bottom||i<0?0:i>r?r:i,l:l.left||o<0?0:o>t?t:o}}(e,r/2,n/2);return{outer:{x:t.left,y:t.top,w:r,h:n},inner:{x:t.left+a.l,y:t.top+a.t,w:r-a.l-a.r,h:n-a.t-a.b}}}(t),n=r.outer,a=r.inner;e.fillStyle=t.backgroundColor,e.fillRect(n.x,n.y,n.w,n.h),n.w===a.w&&n.h===a.h||(e.save(),e.beginPath(),e.rect(n.x,n.y,n.w,n.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 r=this._view;return he(r)?ge(r,e,null):ge(r,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,r=this._view;return he(r)?(e=r.x,t=(r.y+r.base)/2):(e=(r.x+r.base)/2,t=r.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}}}),ye={},ve=oe,be=ce,xe=me;ye.Arc=ne,ye.Line=ve,ye.Point=be,ye.Rectangle=xe;var _e=z._deprecated,we=z.valueOrDefault;R._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),R._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var ke=ee.extend({dataElementType:ye.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var e,t,r=this;ee.prototype.initialize.apply(r,arguments),(e=r.getMeta()).stack=r.getDataset().stack,e.bar=!0,t=r._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",r._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,r,n=this,a=n.getMeta().data;for(n._ruler=n.getRuler(),t=0,r=a.length;t<r;++t)n.updateElement(a[t],t,e)},updateElement:function(e,t,r){var n=this,a=n.getMeta(),i=n.getDataset(),o=n._resolveDataElementOptions(e,t);e._xScale=n.getScaleForId(a.xAxisID),e._yScale=n.getScaleForId(a.yAxisID),e._datasetIndex=n.index,e._index=t,e._model={backgroundColor:o.backgroundColor,borderColor:o.borderColor,borderSkipped:o.borderSkipped,borderWidth:o.borderWidth,datasetLabel:i.label,label:n.chart.data.labels[t]},z.isArray(i.data[t])&&(e._model.borderSkipped=null),n._updateElementGeometry(e,t,r,o),e.pivot()},_updateElementGeometry:function(e,t,r,n){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,n),d=a.calculateBarIndexPixels(a.index,t,u,n);i.horizontal=l,i.base=r?s:c.base,i.x=l?r?s:c.head:d.center,i.y=l?d.center:r?s:c.head,i.height=l?d.size:void 0,i.width=l?void 0:d.size},_getStacks:function(e){var t,r,n=this._getIndexScale(),a=n._getMatchingVisibleMetas(this._type),i=n.options.stacked,o=a.length,s=[];for(t=0;t<o&&(r=a[t],(!1===i||-1===s.indexOf(r.stack)||void 0===i&&void 0===r.stack)&&s.push(r.stack),r.index!==e);++t);return s},getStackCount:function(){return this._getStacks().length},getStackIndex:function(e,t){var r=this._getStacks(e),n=void 0!==t?r.indexOf(t):-1;return-1===n?r.length-1:n},getRuler:function(){var e,t,r=this,n=r._getIndexScale(),a=[];for(e=0,t=r.getMeta().data.length;e<t;++e)a.push(n.getPixelForValue(null,e,r.index));return{pixels:a,start:n._startPixel,end:n._endPixel,stackCount:r.getStackCount(),scale:n}},calculateBarValuePixels:function(e,t,r){var n,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]),y=r.minBarLength,v=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(v||void 0===v&&void 0!==b)for(n=0;n<w&&(a=g[n]).index!==e;++n)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!==y&&Math.abs(l)<y&&(l=y,s=_>=0&&!f||_<0&&f?o-y:o+y),{size:l,base:o,head:s,center:s+l/2}},calculateBarIndexPixels:function(e,t,r,n){var a="flex"===n.barThickness?function(e,t,r){var n,a=t.pixels,i=a[e],o=e>0?a[e-1]:null,s=e<a.length-1?a[e+1]:null,l=r.categoryPercentage;return null===o&&(o=i-(null===s?t.end-t.start:s-i)),null===s&&(s=i+i-o),n=i-(i-Math.min(o,s))/2*l,{chunk:Math.abs(s-o)/2*l/t.stackCount,ratio:r.barPercentage,start:n}}(t,r,n):function(e,t,r){var n,a,i=r.barThickness,o=t.stackCount,s=t.pixels[e],l=z.isNullOrUndef(i)?function(e,t){var r,n,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)n=e.getPixelForTick(a),o=a>0?Math.min(o,Math.abs(n-r)):o,r=n;return o}(t.scale,t.pixels):-1;return z.isNullOrUndef(i)?(n=l*r.categoryPercentage,a=r.barPercentage):(n=i*o,a=1),{chunk:n/o,ratio:a,start:s-n/2}}(t,r,n),i=this.getStackIndex(e,this.getMeta().stack),o=a.start+a.chunk*i+a.chunk/2,s=Math.min(we(n.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,r=e._getValueScale(),n=e.getMeta().data,a=e.getDataset(),i=n.length,o=0;for(z.canvas.clipArea(t.ctx,t.chartArea);o<i;++o){var s=r._parseValue(a.data[o]);isNaN(s.min)||isNaN(s.max)||n[o].draw()}z.canvas.unclipArea(t.ctx)},_resolveDataElementOptions:function(){var e=this,t=z.extend({},ee.prototype._resolveDataElementOptions.apply(e,arguments)),r=e._getIndexScale().options,n=e._getValueScale().options;return t.barPercentage=we(r.barPercentage,t.barPercentage),t.barThickness=we(r.barThickness,t.barThickness),t.categoryPercentage=we(r.categoryPercentage,t.categoryPercentage),t.maxBarThickness=we(r.maxBarThickness,t.maxBarThickness),t.minBarLength=we(n.minBarLength,t.minBarLength),t}}),Se=z.valueOrDefault,Te=z.options.resolve;R._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:ye.Point,_dataElementOptions:["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle","rotation"],update:function(e){var t=this,r=t.getMeta();z.each(r.data,function(r,n){t.updateElement(r,n,e)})},updateElement:function(e,t,r){var n=this,a=n.getMeta(),i=e.custom||{},o=n.getScaleForId(a.xAxisID),s=n.getScaleForId(a.yAxisID),l=n._resolveDataElementOptions(e,t),u=n.getDataset().data[t],c=n.index,d=r?o.getPixelForDecimal(.5):o.getPixelForValue("object"==typeof u?u:NaN,t,c),h=r?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:r?0:l.radius,skip:i.skip||isNaN(d)||isNaN(h),x:d,y:h},e.pivot()},setHoverStyle:function(e){var t=e._model,r=e._options,n=z.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth,radius:t.radius},t.backgroundColor=Se(r.hoverBackgroundColor,n(r.backgroundColor)),t.borderColor=Se(r.hoverBorderColor,n(r.borderColor)),t.borderWidth=Se(r.hoverBorderWidth,r.borderWidth),t.radius=r.radius+r.hoverRadius},_resolveDataElementOptions:function(e,t){var r=this,n=r.chart,a=r.getDataset(),i=e.custom||{},o=a.data[t]||{},s=ee.prototype._resolveDataElementOptions.apply(r,arguments),l={chart:n,dataIndex:t,dataset:a,datasetIndex:r.index};return r._cachedDataOpts===s&&(s=z.extend({},s)),s.radius=Te([i.radius,o.r,r._config.radius,n.options.elements.point.radius],l,t),s}}),Oe=z.valueOrDefault,Ae=Math.PI,Ce=2*Ae,Pe=Ae/2;R._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(e){var t,r,n,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,r=o[0].data.length;t<r;++t)(n=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=o[0].backgroundColor[t],s[t]&&n.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(r,n){var a=e.getDatasetMeta(0),i=a.controller.getStyle(n);return{text:r,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,lineWidth:i.borderWidth,hidden:isNaN(t.datasets[0].data[n])||a.data[n].hidden,index:n}}):[]}},onClick:function(e,t){var r,n,a,i=t.index,o=this.chart;for(r=0,n=(o.data.datasets||[]).length;r<n;++r)(a=o.getDatasetMeta(r)).data[i]&&(a.data[i].hidden=!a.data[i].hidden);o.update()}},cutoutPercentage:50,rotation:-Pe,circumference:Ce,tooltips:{callbacks:{title:function(){return""},label:function(e,t){var r=t.labels[e.index],n=": "+t.datasets[e.datasetIndex].data[e.index];return z.isArray(r)?(r=r.slice())[0]+=n:r+=n,r}}}});var De=ee.extend({dataElementType:ye.Arc,linkScales:z.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],getRingIndex:function(e){for(var t=0,r=0;r<e;++r)this.chart.isDatasetVisible(r)&&++t;return t},update:function(e){var t,r,n=this,a=n.chart,i=a.chartArea,o=a.options,s=1,l=1,u=0,c=0,d=n.getMeta(),h=d.data,f=o.cutoutPercentage/100||0,p=o.circumference,g=n._getRingWeight(n.index);if(p<Ce){var m=o.rotation%Ce,y=(m+=m>=Ae?-Ce:m<-Ae?Ce:0)+p,v=Math.cos(m),b=Math.sin(m),x=Math.cos(y),_=Math.sin(y),w=m<=0&&y>=0||y>=Ce,k=m<=Pe&&y>=Pe||y>=Ce+Pe,S=m<=-Pe&&y>=-Pe||y>=Ae+Pe,T=m===-Ae||y>=Ae?-1:Math.min(v,v*f,x,x*f),M=S?-1:Math.min(b,b*f,_,_*f),O=w?1:Math.max(v,v*f,x,x*f),A=k?1:Math.max(b,b*f,_,_*f);s=(O-T)/2,l=(A-M)/2,u=-(O+T)/2,c=-(A+M)/2}for(t=0,r=h.length;t<r;++t)h[t]._options=n._resolveDataElementOptions(h[t],t);for(a.borderWidth=n.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)/(n._getVisibleDatasetWeightTotal()||1),a.offsetX=u*a.outerRadius,a.offsetY=c*a.outerRadius,d.total=n.calculateTotal(),n.outerRadius=a.outerRadius-a.radiusLength*n._getRingWeightOffset(n.index),n.innerRadius=Math.max(n.outerRadius-a.radiusLength*g,0),t=0,r=h.length;t<r;++t)n.updateElement(h[t],t,e)},updateElement:function(e,t,r){var n=this,a=n.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=n.getDataset(),f=r&&s.animateRotate||e.hidden?0:n.calculateCircumference(h.data[t])*(o.circumference/Ce),p=e._options||{};z.extend(e,{_datasetIndex:n.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:r&&s.animateScale?0:n.outerRadius,innerRadius:r&&s.animateScale?0:n.innerRadius,label:z.valueAtIndexOrDefault(h.label,t,a.data.labels[t])}});var g=e._model;r&&s.animateRotate||(g.startAngle=0===t?o.rotation:n.getMeta().data[t-1]._model.endAngle,g.endAngle=g.startAngle+g.circumference),e.pivot()},calculateTotal:function(){var e,t=this.getDataset(),r=this.getMeta(),n=0;return z.each(r.data,function(r,a){e=t.data[a],isNaN(e)||r.hidden||(n+=Math.abs(e))}),n},calculateCircumference:function(e){var t=this.getMeta().total;return t>0&&!isNaN(e)?Ce*(Math.abs(e)/t):0},getMaxBorderWidth:function(e){var t,r,n,a,i,o,s,l,u=0,c=this.chart;if(!e)for(t=0,r=c.data.datasets.length;t<r;++t)if(c.isDatasetVisible(t)){e=(n=c.getDatasetMeta(t)).data,t!==this.index&&(i=n.controller);break}if(!e)return 0;for(t=0,r=e.length;t<r;++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,r=e._options,n=z.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth},t.backgroundColor=Oe(r.hoverBackgroundColor,n(r.backgroundColor)),t.borderColor=Oe(r.hoverBorderColor,n(r.borderColor)),t.borderWidth=Oe(r.hoverBorderWidth,r.borderWidth)},_getRingWeightOffset:function(e){for(var t=0,r=0;r<e;++r)this.chart.isDatasetVisible(r)&&(t+=this._getRingWeight(r));return t},_getRingWeight:function(e){return Math.max(Oe(this.chart.data.datasets[e].weight,1),0)},_getVisibleDatasetWeightTotal:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)}});R._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"}}),R._set("global",{datasets:{horizontalBar:{categoryPercentage:.8,barPercentage:.9}}});var Ee=ke.extend({_getValueScaleId:function(){return this.getMeta().xAxisID},_getIndexScaleId:function(){return this.getMeta().yAxisID}}),$e=z.valueOrDefault,Fe=z.options.resolve,Ie=z.canvas._isPointInArea;function Re(e,t){var r=e&&e.options.ticks||{},n=r.reverse,a=void 0===r.min?t:0,i=void 0===r.max?t:0;return{start:n?i:a,end:n?a:i}}R._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 Ne=ee.extend({datasetElementType:ye.Line,dataElementType:ye.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,r,n=this,a=n.getMeta(),i=a.dataset,o=a.data||[],s=n._config,l=n._showLine=$e(s.showLine,n.chart.options.showLines);for(n._xScale=n.getScaleForId(a.xAxisID),n._yScale=n.getScaleForId(a.yAxisID),l&&(void 0!==s.tension&&void 0===s.lineTension&&(s.lineTension=s.tension),i._scale=n._yScale,i._datasetIndex=n.index,i._children=o,i._model=n._resolveDatasetElementOptions(i),i.pivot()),t=0,r=o.length;t<r;++t)n.updateElement(o[t],t,e);for(l&&0!==i._model.tension&&n.updateBezierControlPoints(),t=0,r=o.length;t<r;++t)o[t].pivot()},updateElement:function(e,t,r){var n,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);n=d.getPixelForValue("object"==typeof c?c:NaN,t,u),a=r?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:n,y:a,skip:s.skip||isNaN(n)||isNaN(a),radius:p.radius,pointStyle:p.pointStyle,rotation:p.rotation,backgroundColor:p.backgroundColor,borderColor:p.borderColor,borderWidth:p.borderWidth,tension:$e(s.tension,f?f.tension:0),steppedLine:!!f&&f.steppedLine,hitRadius:p.hitRadius}},_resolveDatasetElementOptions:function(e){var t,r,n,a,i,o,s,l,u,c=this,d=c._config,h=e.custom||{},f=c.chart.options,p=f.elements.line,g=ee.prototype._resolveDatasetElementOptions.apply(c,arguments);return g.spanGaps=$e(d.spanGaps,f.spanGaps),g.tension=$e(d.lineTension,p.tension),g.steppedLine=Fe([h.steppedLine,d.steppedLine,p.stepped]),g.clip=(t=$e(d.clip,(o=c._yScale,l=Re(c._xScale,s=g.borderWidth/2),{top:(u=Re(o,s)).end,right:l.end,bottom:u.start,left:l.start})),z.isObject(t)?(r=t.top,n=t.right,a=t.bottom,i=t.left):r=n=a=i=t,{top:r,right:n,bottom:a,left:i}),g},calculatePointY:function(e,t,r){var n,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,n=0;n<l&&(a=s[n]).index!==r;++n)"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,r,n,a=this.chart,i=this.getMeta(),o=i.dataset._model,s=a.chartArea,l=i.data||[];function u(e,t,r){return Math.max(Math.min(e,r),t)}if(o.spanGaps&&(l=l.filter(function(e){return!e._model.skip})),"monotone"===o.cubicInterpolationMode)z.splineCurveMonotone(l);else for(e=0,t=l.length;e<t;++e)r=l[e]._model,n=z.splineCurve(z.previousItem(l,e)._model,r,z.nextItem(l,e)._model,o.tension),r.controlPointPreviousX=n.previous.x,r.controlPointPreviousY=n.previous.y,r.controlPointNextX=n.next.x,r.controlPointNextY=n.next.y;if(a.options.elements.line.capBezierPoints)for(e=0,t=l.length;e<t;++e)Ie(r=l[e]._model,s)&&(e>0&&Ie(l[e-1]._model,s)&&(r.controlPointPreviousX=u(r.controlPointPreviousX,s.left,s.right),r.controlPointPreviousY=u(r.controlPointPreviousY,s.top,s.bottom)),e<l.length-1&&Ie(l[e+1]._model,s)&&(r.controlPointNextX=u(r.controlPointNextX,s.left,s.right),r.controlPointNextY=u(r.controlPointNextY,s.top,s.bottom)))},draw:function(){var e,t=this,r=t.chart,n=t.getMeta(),a=n.data||[],i=r.chartArea,o=r.canvas,s=0,l=a.length;for(t._showLine&&(z.canvas.clipArea(r.ctx,{left:!1===(e=n.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}),n.dataset.draw(),z.canvas.unclipArea(r.ctx));s<l;++s)a[s].draw(i)},setHoverStyle:function(e){var t=e._model,r=e._options,n=z.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth,radius:t.radius},t.backgroundColor=$e(r.hoverBackgroundColor,n(r.backgroundColor)),t.borderColor=$e(r.hoverBorderColor,n(r.borderColor)),t.borderWidth=$e(r.hoverBorderWidth,r.borderWidth),t.radius=$e(r.hoverRadius,r.radius)}}),je=z.options.resolve;R._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,r,n,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,r=o[0].data.length;t<r;++t)(n=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=o[0].backgroundColor[t],s[t]&&n.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(r,n){var a=e.getDatasetMeta(0),i=a.controller.getStyle(n);return{text:r,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,lineWidth:i.borderWidth,hidden:isNaN(t.datasets[0].data[n])||a.data[n].hidden,index:n}}):[]}},onClick:function(e,t){var r,n,a,i=t.index,o=this.chart;for(r=0,n=(o.data.datasets||[]).length;r<n;++r)(a=o.getDatasetMeta(r)).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 Le=ee.extend({dataElementType:ye.Arc,linkScales:z.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,r,n,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,r=i.data.length;t<r;t++)l[t]=s,n=a._computeAngle(t),u[t]=n,s+=n;for(t=0,r=c.length;t<r;++t)c[t]._options=a._resolveDataElementOptions(c[t],t),a.updateElement(c[t],t,e)},_updateRadius:function(){var e=this,t=e.chart,r=t.chartArea,n=t.options,a=Math.min(r.right-r.left,r.bottom-r.top);t.outerRadius=Math.max(a/2,0),t.innerRadius=Math.max(n.cutoutPercentage?t.outerRadius/100*n.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,r){var n=this,a=n.chart,i=n.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=n._starts[t],g=p+(e.hidden?0:n._angles[t]),m=s.animateScale?0:l.getDistanceFromCenterForValue(i.data[t]),y=e._options||{};z.extend(e,{_datasetIndex:n.index,_index:t,_scale:l,_model:{backgroundColor:y.backgroundColor,borderColor:y.borderColor,borderWidth:y.borderWidth,borderAlign:y.borderAlign,x:c,y:d,innerRadius:0,outerRadius:r?m:f,startAngle:r&&s.animateRotate?h:p,endAngle:r&&s.animateRotate?h:g,label:z.valueAtIndexOrDefault(u,t,u[t])}}),e.pivot()},countVisibleElements:function(){var e=this.getDataset(),t=this.getMeta(),r=0;return z.each(t.data,function(t,n){isNaN(e.data[n])||t.hidden||r++}),r},setHoverStyle:function(e){var t=e._model,r=e._options,n=z.getHoverColor,a=z.valueOrDefault;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth},t.backgroundColor=a(r.hoverBackgroundColor,n(r.backgroundColor)),t.borderColor=a(r.hoverBorderColor,n(r.borderColor)),t.borderWidth=a(r.hoverBorderWidth,r.borderWidth)},_computeAngle:function(e){var t=this,r=this.getMeta().count,n=t.getDataset(),a=t.getMeta();return isNaN(n.data[e])||a.data[e].hidden?0:je([t.chart.options.elements.arc.angle,2*Math.PI/r],{chart:t.chart,dataIndex:e,dataset:n,datasetIndex:t.index},e)}});R._set("pie",z.clone(R.doughnut)),R._set("pie",{cutoutPercentage:0});var Ve=De,ze=z.valueOrDefault;R._set("radar",{spanGaps:!1,scale:{type:"radialLinear"},elements:{line:{fill:"start",tension:0}}});var We=ee.extend({datasetElementType:ye.Line,dataElementType:ye.Point,linkScales:z.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,r,n=this,a=n.getMeta(),i=a.dataset,o=a.data||[],s=n.chart.scale,l=n._config;for(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),i._scale=s,i._datasetIndex=n.index,i._children=o,i._loop=!0,i._model=n._resolveDatasetElementOptions(i),i.pivot(),t=0,r=o.length;t<r;++t)n.updateElement(o[t],t,e);for(n.updateBezierControlPoints(),t=0,r=o.length;t<r;++t)o[t].pivot()},updateElement:function(e,t,r){var n=this,a=e.custom||{},i=n.getDataset(),o=n.chart.scale,s=o.getPointPositionForValue(t,i.data[t]),l=n._resolveDataElementOptions(e,t),u=n.getMeta().dataset._model,c=r?o.xCenter:s.x,d=r?o.yCenter:s.y;e._scale=o,e._options=l,e._datasetIndex=n.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:ze(a.tension,u?u.tension:0),hitRadius:l.hitRadius}},_resolveDatasetElementOptions:function(){var e=this,t=e._config,r=e.chart.options,n=ee.prototype._resolveDatasetElementOptions.apply(e,arguments);return n.spanGaps=ze(t.spanGaps,r.spanGaps),n.tension=ze(t.lineTension,r.elements.line.tension),n},updateBezierControlPoints:function(){var e,t,r,n,a=this.getMeta(),i=this.chart.chartArea,o=a.data||[];function s(e,t,r){return Math.max(Math.min(e,r),t)}for(a.dataset._model.spanGaps&&(o=o.filter(function(e){return!e._model.skip})),e=0,t=o.length;e<t;++e)r=o[e]._model,n=z.splineCurve(z.previousItem(o,e,!0)._model,r,z.nextItem(o,e,!0)._model,r.tension),r.controlPointPreviousX=s(n.previous.x,i.left,i.right),r.controlPointPreviousY=s(n.previous.y,i.top,i.bottom),r.controlPointNextX=s(n.next.x,i.left,i.right),r.controlPointNextY=s(n.next.y,i.top,i.bottom)},setHoverStyle:function(e){var t=e._model,r=e._options,n=z.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth,radius:t.radius},t.backgroundColor=ze(r.hoverBackgroundColor,n(r.backgroundColor)),t.borderColor=ze(r.hoverBorderColor,n(r.borderColor)),t.borderWidth=ze(r.hoverBorderWidth,r.borderWidth),t.radius=ze(r.hoverRadius,r.radius)}});R._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+")"}}}}),R._set("global",{datasets:{scatter:{showLine:!1}}});var Be={bar:ke,bubble:Me,doughnut:De,horizontalBar:Ee,line:Ne,polarArea:Le,pie:Ve,radar:We,scatter:Ne};function Ye(e,t){return e.native?{x:e.x,y:e.y}:z.getRelativePosition(e,t)}function Ue(e,t){var r,n,a,i,o,s,l=e._getSortedVisibleDatasetMetas();for(n=0,i=l.length;n<i;++n)for(a=0,o=(r=l[n].data).length;a<o;++a)(s=r[a])._view.skip||t(s)}function He(e,t){var r=[];return Ue(e,function(e){e.inRange(t.x,t.y)&&r.push(e)}),r}function qe(e,t,r,n){var a=Number.POSITIVE_INFINITY,i=[];return Ue(e,function(e){if(!r||e.inRange(t.x,t.y)){var o=e.getCenterPoint(),s=n(t,o);s<a?(i=[e],a=s):s===a&&i.push(e)}}),i}function Ge(e){var t=-1!==e.indexOf("x"),r=-1!==e.indexOf("y");return function(e,n){var a=t?Math.abs(e.x-n.x):0,i=r?Math.abs(e.y-n.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(i,2))}}function Qe(e,t,r){var n=Ye(t,e);r.axis=r.axis||"x";var a=Ge(r.axis),i=r.intersect?He(e,n):qe(e,n,!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 r=Ye(t,e),n=[];return Ue(e,function(e){if(e.inRange(r.x,r.y))return n.push(e),n}),n.slice(0,1)},label:Qe,index:Qe,dataset:function(e,t,r){var n=Ye(t,e);r.axis=r.axis||"xy";var a=Ge(r.axis),i=r.intersect?He(e,n):qe(e,n,!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 He(e,Ye(t,e))},nearest:function(e,t,r){var n=Ye(t,e);r.axis=r.axis||"xy";var a=Ge(r.axis);return qe(e,n,r.intersect,a)},x:function(e,t,r){var n=Ye(t,e),a=[],i=!1;return Ue(e,function(e){e.inXRange(n.x)&&a.push(e),e.inRange(n.x,n.y)&&(i=!0)}),r.intersect&&!i&&(a=[]),a},y:function(e,t,r){var n=Ye(t,e),a=[],i=!1;return Ue(e,function(e){e.inYRange(n.y)&&a.push(e),e.inRange(n.x,n.y)&&(i=!0)}),r.intersect&&!i&&(a=[]),a}}},Je=z.extend;function Ke(e,t){return z.where(e,function(e){return e.pos===t})}function Xe(e,t){return e.sort(function(e,r){var n=t?r:e,a=t?e:r;return n.weight===a.weight?n.index-a.index:n.weight-a.weight})}function et(e,t,r,n){return Math.max(e[r],t[r])+Math.max(e[n],t[n])}function tt(e,t,r){var n,a,i=r.box,o=e.maxPadding;if(r.size&&(e[r.pos]-=r.size),r.size=r.horizontal?i.height:i.width,e[r.pos]+=r.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(n=t.outerWidth-et(o,e,"left","right"),a=t.outerHeight-et(o,e,"top","bottom"),n!==e.w||a!==e.h){e.w=n,e.h=a;var l=r.horizontal?[n,e.w]:[a,e.h];return!(l[0]===l[1]||isNaN(l[0])&&isNaN(l[1]))}}function rt(e,t){var r,n=t.maxPadding;return r={left:0,top:0,right:0,bottom:0},(e?["left","right"]:["top","bottom"]).forEach(function(e){r[e]=Math.max(t[e],n[e])}),r}function nt(e,t,r){var n,a,i,o,s,l,u=[];for(n=0,a=e.length;n<a;++n)(o=(i=e[n]).box).update(i.width||t.w,i.height||t.h,rt(i.horizontal,t)),tt(t,r,i)&&(l=!0,u.length&&(s=!0)),o.fullWidth||u.push(i);return s&&nt(u,t,r)||l}function at(e,t,r){var n,a,i,o,s=r.padding,l=t.x,u=t.y;for(n=0,a=e.length;n<a;++n)o=(i=e[n]).box,i.horizontal?(o.left=o.fullWidth?s.left:t.left,o.right=o.fullWidth?r.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}R._set("global",{layout:{padding:{top:0,right:0,bottom:0,left:0}}});var it,ot={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 r=e.boxes?e.boxes.indexOf(t):-1;-1!==r&&e.boxes.splice(r,1)},configure:function(e,t,r){for(var n,a=["fullWidth","position","weight"],i=a.length,o=0;o<i;++o)r.hasOwnProperty(n=a[o])&&(t[n]=r[n])},update:function(e,t,r){if(e){var n=z.options.toPadding((e.options.layout||{}).padding),a=t-n.width,i=r-n.height,o=function(e){var t=function(e){var t,r,n,a=[];for(t=0,r=(e||[]).length;t<r;++t)a.push({index:t,box:n=e[t],pos:n.position,horizontal:n.isHorizontal(),weight:n.weight});return a}(e),r=Xe(Ke(t,"left"),!0),n=Xe(Ke(t,"right")),a=Xe(Ke(t,"top"),!0),i=Xe(Ke(t,"bottom"));return{leftAndTop:r.concat(a),rightAndBottom:n.concat(i),chartArea:Ke(t,"chartArea"),vertical:r.concat(n),horizontal:a.concat(i)}}(e.boxes),s=o.vertical,l=o.horizontal,u=Object.freeze({outerWidth:t,outerHeight:r,padding:n,availableWidth:a,vBoxMaxWidth:a/2/s.length,hBoxMaxHeight:i/2}),c=Je({maxPadding:Je({},n),w:a,h:i,x:n.left,y:n.top},n);(function(e,t){var r,n,a;for(r=0,n=e.length;r<n;++r)(a=e[r]).width=a.horizontal?a.box.fullWidth&&t.availableWidth:t.vBoxMaxWidth,a.height=a.horizontal&&t.hBoxMaxHeight})(s.concat(l),u),nt(s,c,u),nt(l,c,u)&&nt(s,c,u),function(e){var t=e.maxPadding;function r(r){var n=Math.max(t[r]-e[r],0);return e[r]+=n,n}e.y+=r("top"),e.x+=r("left"),r("right"),r("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},z.each(o.chartArea,function(t){var r=t.box;Je(r,e.chartArea),r.update(c.w,c.h)})}}},st=(it=/*#__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"}))&&it.default||it,lt="$chartjs",ut="chartjs-",ct=ut+"size-monitor",dt=ut+"render-monitor",ht=ut+"render-animation",ft=["animationstart","webkitAnimationStart"],pt={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function gt(e,t){var r=z.getStyle(e,t),n=r&&r.match(/^(\d+)(\.\d+)?px$/);return n?Number(n[1]):void 0}var mt=!!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,r){e.addEventListener(t,r,mt)}function vt(e,t,r){e.removeEventListener(t,r,mt)}function bt(e,t,r,n,a){return{type:e,chart:t,native:a||null,x:void 0!==r?r:null,y:void 0!==n?n:null}}function xt(e){var t=document.createElement("div");return t.className=e||"",t}var _t={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 r=e[lt]||(e[lt]={});if(!r.containsStyles){r.containsStyles=!0,t="/* Chart.js */\n"+t;var n=document.createElement("style");n.setAttribute("type","text/css"),n.appendChild(document.createTextNode(t)),e.appendChild(n)}}(t.host?t:document.head,st)}},acquireContext:function(e,t){"string"==typeof e?e=document.getElementById(e):e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas);var r=e&&e.getContext&&e.getContext("2d");return r&&r.canvas===e?(this._ensureLoaded(e),function(e,t){var r=e.style,n=e.getAttribute("height"),a=e.getAttribute("width");if(e[lt]={initial:{height:n,width:a,style:{display:r.display,height:r.height,width:r.width}}},r.display=r.display||"block",null===a||""===a){var i=gt(e,"width");void 0!==i&&(e.width=i)}if(null===n||""===n)if(""===e.style.height)e.height=e.width/(t.options.aspectRatio||2);else{var o=gt(e,"height");void 0!==i&&(e.height=o)}}(e,t),r):null},releaseContext:function(e){var t=e.canvas;if(t[lt]){var r=t[lt].initial;["height","width"].forEach(function(e){var n=r[e];z.isNullOrUndef(n)?t.removeAttribute(e):t.setAttribute(e,n)}),z.each(r.style||{},function(e,r){t.style[r]=e}),t.width=t.width,delete t[lt]}},addEventListener:function(e,t,r){var n=e.canvas;if("resize"!==t){var a=r[lt]||(r[lt]={});yt(n,t,(a.proxies||(a.proxies={}))[e.id+"_"+t]=function(t){r(function(e,t){var r=pt[e.type]||e.type,n=z.getRelativePosition(e,t);return bt(r,t,n.x,n.y,e)}(t,e))})}else!function(e,t,r){var n,a,i,o,s=e[lt]||(e[lt]={}),l=s.resizer=function(e){var t=1e6,r=xt(ct),n=xt(ct+"-expand"),a=xt(ct+"-shrink");n.appendChild(xt()),a.appendChild(xt()),r.appendChild(n),r.appendChild(a),r._reset=function(){n.scrollLeft=t,n.scrollTop=t,a.scrollLeft=t,a.scrollTop=t};var i=function(){r._reset(),e()};return yt(n,"scroll",i.bind(n,"expand")),yt(a,"scroll",i.bind(a,"shrink")),r}((n=function(){if(s.resizer){var n=r.options.maintainAspectRatio&&e.parentNode,a=n?n.clientWidth:0;t(bt("resize",r)),n&&n.clientWidth<a&&r.canvas&&t(bt("resize",r))}},i=!1,o=[],function(){o=Array.prototype.slice.call(arguments),a=a||this,i||(i=!0,z.requestAnimFrame.call(window,function(){i=!1,n.apply(a,o)}))}));!function(e,t){var r=e[lt]||(e[lt]={}),n=r.renderProxy=function(e){e.animationName===ht&&t()};z.each(ft,function(t){yt(e,t,n)}),r.reflow=!!e.offsetParent,e.classList.add(dt)}(e,function(){if(s.resizer){var t=e.parentNode;t&&t!==l.parentNode&&t.insertBefore(l,t.firstChild),l._reset()}})}(n,r,e)},removeEventListener:function(e,t,r){var n,a,i,o=e.canvas;if("resize"!==t){var s=((r[lt]||{}).proxies||{})[e.id+"_"+t];s&&vt(o,t,s)}else i=(a=(n=o)[lt]||{}).resizer,delete a.resizer,function(e){var t=e[lt]||{},r=t.renderProxy;r&&(z.each(ft,function(t){vt(e,t,r)}),delete t.renderProxy),e.classList.remove(dt)}(n),i&&i.parentNode&&i.parentNode.removeChild(i)}};z.addEvent=yt,z.removeEvent=vt;var wt=z.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},_t._enabled?_t:{acquireContext:function(e){return e&&e.canvas&&(e=e.canvas),e&&e.getContext("2d")||null}});R._set("global",{plugins:{}});var kt={_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 r=t.indexOf(e);-1!==r&&t.splice(r,1)}),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(e,t,r){var n,a,i,o,s,l=this.descriptors(e),u=l.length;for(n=0;n<u;++n)if("function"==typeof(s=(i=(a=l[n]).plugin)[t])&&((o=[e].concat(r||[])).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 r=[],n=[],a=e&&e.config||{},i=a.options&&a.options.plugins||{};return this._plugins.concat(a.plugins||[]).forEach(function(e){if(-1===r.indexOf(e)){var t=e.id,a=i[t];!1!==a&&(!0===a&&(a=z.clone(R.global.plugins[t])),r.push(e),n.push({plugin:e,options:a||{}}))}}),t.descriptors=n,t.id=this._cacheId,n},_invalidate:function(e){delete e.$plugins}},St={constructors:{},defaults:{},registerScaleType:function(e,t,r){this.constructors[e]=t,this.defaults[e]=z.clone(r)},getScaleConstructor:function(e){return this.constructors.hasOwnProperty(e)?this.constructors[e]:void 0},getScaleDefaults:function(e){return this.defaults.hasOwnProperty(e)?z.merge(Object.create(null),[R.scale,this.defaults[e]]):{}},updateScaleDefaults:function(e,t){var r=this;r.defaults.hasOwnProperty(e)&&(r.defaults[e]=z.extend(r.defaults[e],t))},addScalesToLayout:function(e){z.each(e.scales,function(t){t.fullWidth=t.options.fullWidth,t.position=t.options.position,t.weight=t.options.weight,ot.addBox(e,t)})}},Tt=z.valueOrDefault,Mt=z.rtl.getRtlAdapter;R._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:z.noop,title:function(e,t){var r="",n=t.labels,a=n?n.length:0;if(e.length>0){var i=e[0];i.label?r=i.label:i.xLabel?r=i.xLabel:a>0&&i.index<a&&(r=n[i.index])}return r},afterTitle:z.noop,beforeBody:z.noop,beforeLabel:z.noop,label:function(e,t){var r=t.datasets[e.datasetIndex].label||"";return r&&(r+=": "),z.isNullOrUndef(e.value)?r+=e.yLabel:r+=e.value,r},labelColor:function(e,t){var r=t.getDatasetMeta(e.datasetIndex).data[e.index]._view;return{borderColor:r.borderColor,backgroundColor:r.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:z.noop,afterBody:z.noop,beforeFooter:z.noop,footer:z.noop,afterFooter:z.noop}}});var Ot={average:function(e){if(!e.length)return!1;var t,r,n=0,a=0,i=0;for(t=0,r=e.length;t<r;++t){var o=e[t];if(o&&o.hasValue()){var s=o.tooltipPosition();n+=s.x,a+=s.y,++i}}return{x:n/i,y:a/i}},nearest:function(e,t){var r,n,a,i=t.x,o=t.y,s=Number.POSITIVE_INFINITY;for(r=0,n=e.length;r<n;++r){var l=e[r];if(l&&l.hasValue()){var u=l.getCenterPoint(),c=z.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 At(e,t){return t&&(z.isArray(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Ct(e){return("string"==typeof e||e instanceof String)&&e.indexOf("\n")>-1?e.split("\n"):e}function Pt(e){var t=e._xScale,r=e._yScale||e._scale,n=e._index,a=e._datasetIndex,i=e._chart.getDatasetMeta(a).controller,o=i._getIndexScale(),s=i._getValueScale();return{xLabel:t?t.getLabelForIndex(n,a):"",yLabel:r?r.getLabelForIndex(n,a):"",label:o?""+o.getLabelForIndex(n,a):"",value:s?""+s.getLabelForIndex(n,a):"",index:n,datasetIndex:a,x:e._model.x,y:e._model.y}}function Dt(e){var t=R.global;return{xPadding:e.xPadding,yPadding:e.yPadding,xAlign:e.xAlign,yAlign:e.yAlign,rtl:e.rtl,textDirection:e.textDirection,bodyFontColor:e.bodyFontColor,_bodyFontFamily:Tt(e.bodyFontFamily,t.defaultFontFamily),_bodyFontStyle:Tt(e.bodyFontStyle,t.defaultFontStyle),_bodyAlign:e.bodyAlign,bodyFontSize:Tt(e.bodyFontSize,t.defaultFontSize),bodySpacing:e.bodySpacing,titleFontColor:e.titleFontColor,_titleFontFamily:Tt(e.titleFontFamily,t.defaultFontFamily),_titleFontStyle:Tt(e.titleFontStyle,t.defaultFontStyle),titleFontSize:Tt(e.titleFontSize,t.defaultFontSize),_titleAlign:e.titleAlign,titleSpacing:e.titleSpacing,titleMarginBottom:e.titleMarginBottom,footerFontColor:e.footerFontColor,_footerFontFamily:Tt(e.footerFontFamily,t.defaultFontFamily),_footerFontStyle:Tt(e.footerFontStyle,t.defaultFontStyle),footerFontSize:Tt(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 Et(e,t){return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-e.xPadding:e.x+e.xPadding}function $t(e){return At([],Ct(e))}var Ft=H.extend({initialize:function(){this._model=Dt(this._options),this._lastActive=[]},getTitle:function(){var e=this,t=e._options.callbacks,r=t.beforeTitle.apply(e,arguments),n=t.title.apply(e,arguments),a=t.afterTitle.apply(e,arguments),i=[];return i=At(i,Ct(r)),i=At(i,Ct(n)),At(i,Ct(a))},getBeforeBody:function(){return $t(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(e,t){var r=this,n=r._options.callbacks,a=[];return z.each(e,function(e){var i={before:[],lines:[],after:[]};At(i.before,Ct(n.beforeLabel.call(r,e,t))),At(i.lines,n.label.call(r,e,t)),At(i.after,Ct(n.afterLabel.call(r,e,t))),a.push(i)}),a},getAfterBody:function(){return $t(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var e=this,t=e._options.callbacks,r=t.beforeFooter.apply(e,arguments),n=t.footer.apply(e,arguments),a=t.afterFooter.apply(e,arguments),i=[];return i=At(i,Ct(r)),i=At(i,Ct(n)),At(i,Ct(a))},update:function(e){var t,r,n=this,a=n._options,i=n._model,o=n._model=Dt(a),s=n._active,l=n._data,u={xAlign:i.xAlign,yAlign:i.yAlign},c={x:i.x,y:i.y},d={width:i.width,height:i.height},h={x:i.caretX,y:i.caretY};if(s.length){o.opacity=1;var f=[],p=[];h=Ot[a.position].call(n,s,n._eventPosition);var g=[];for(t=0,r=s.length;t<r;++t)g.push(Pt(s[t]));a.filter&&(g=g.filter(function(e){return a.filter(e,l)})),a.itemSort&&(g=g.sort(function(e,t){return a.itemSort(e,t,l)})),z.each(g,function(e){f.push(a.callbacks.labelColor.call(n,e,n._chart)),p.push(a.callbacks.labelTextColor.call(n,e,n._chart))}),o.title=n.getTitle(g,l),o.beforeBody=n.getBeforeBody(g,l),o.body=n.getBody(g,l),o.afterBody=n.getAfterBody(g,l),o.footer=n.getFooter(g,l),o.x=h.x,o.y=h.y,o.caretPadding=a.caretPadding,o.labelColors=f,o.labelTextColors=p,o.dataPoints=g,c=function(e,t,r,n){var a=e.x,i=e.y,o=e.caretPadding,s=r.xAlign,l=r.yAlign,u=e.caretSize+o,c=e.cornerRadius+o;return"right"===s?a-=t.width:"center"===s&&((a-=t.width/2)+t.width>n.width&&(a=n.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}}(o,d=function(e,t){var r=e._chart.ctx,n=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;n+=s*u,n+=s?(s-1)*t.titleSpacing:0,n+=s?t.titleMarginBottom:0,n+=(o+=t.beforeBody.length+t.afterBody.length)*c,n+=o?(o-1)*t.bodySpacing:0,n+=l?t.footerMarginTop:0,n+=l*d,n+=l?(l-1)*t.footerSpacing:0;var h=0,f=function(e){a=Math.max(a,r.measureText(e).width+h)};return r.font=z.fontString(u,t._titleFontStyle,t._titleFontFamily),z.each(t.title,f),r.font=z.fontString(c,t._bodyFontStyle,t._bodyFontFamily),z.each(t.beforeBody.concat(t.afterBody),f),h=t.displayColors?c+2:0,z.each(i,function(e){z.each(e.before,f),z.each(e.lines,f),z.each(e.after,f)}),h=0,r.font=z.fontString(d,t._footerFontStyle,t._footerFontFamily),z.each(t.footer,f),{width:a+=2*t.xPadding,height:n}}(this,o),u=function(e,t){var r,n,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?(r=function(e){return e<=h},n=function(e){return e>h}):(r=function(e){return e<=t.width/2},n=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"},r(s.x)?(c="left",a(s.x)&&(c="center",d=o(s.y))):n(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,d),n._chart)}else o.opacity=0;return o.xAlign=u.xAlign,o.yAlign=u.yAlign,o.x=c.x,o.y=c.y,o.width=d.width,o.height=d.height,o.caretX=h.x,o.caretY=h.y,n._model=o,e&&a.custom&&a.custom.call(n,o),n},drawCaret:function(e,t){var r=this._chart.ctx,n=this.getCaretPosition(e,t,this._view);r.lineTo(n.x1,n.y1),r.lineTo(n.x2,n.y2),r.lineTo(n.x3,n.y3)},getCaretPosition:function(e,t,r){var n,a,i,o,s,l,u=r.caretSize,c=r.cornerRadius,d=r.xAlign,h=r.yAlign,f=e.x,p=e.y,g=t.width,m=t.height;if("center"===h)s=p+m/2,"left"===d?(a=(n=f)-u,i=n,o=s+u,l=s-u):(a=(n=f+g)+u,i=n,o=s-u,l=s+u);else if("left"===d?(n=(a=f+c+u)-u,i=a+u):"right"===d?(n=(a=f+g-c-u)-u,i=a+u):(n=(a=r.caretX)-u,i=a+u),"top"===h)s=(o=p)-u,l=o;else{s=(o=p+m)+u,l=o;var y=i;i=n,n=y}return{x1:n,x2:a,x3:i,y1:o,y2:s,y3:l}},drawTitle:function(e,t,r){var n,a,i,o=t.title,s=o.length;if(s){var l=Mt(t.rtl,t.x,t.width);for(e.x=Et(t,t._titleAlign),r.textAlign=l.textAlign(t._titleAlign),r.textBaseline="middle",n=t.titleFontSize,a=t.titleSpacing,r.fillStyle=t.titleFontColor,r.font=z.fontString(n,t._titleFontStyle,t._titleFontFamily),i=0;i<s;++i)r.fillText(o[i],l.x(e.x),e.y+n/2),e.y+=n+a,i+1===s&&(e.y+=t.titleMarginBottom-a)}},drawBody:function(e,t,r){var n,a,i,o,s,l,u,c,d=t.bodyFontSize,h=t.bodySpacing,f=t._bodyAlign,p=t.body,g=t.displayColors,m=0,y=g?Et(t,"left"):0,v=Mt(t.rtl,t.x,t.width),b=function(t){r.fillText(t,v.x(e.x+m),e.y+d/2),e.y+=d+h},x=v.textAlign(f);for(r.textAlign=f,r.textBaseline="middle",r.font=z.fontString(d,t._bodyFontStyle,t._bodyFontFamily),e.x=Et(t,x),r.fillStyle=t.bodyFontColor,z.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(n=p[s],i=t.labelColors[s],r.fillStyle=a=t.labelTextColors[s],z.each(n.before,b),l=0,c=(o=n.lines).length;l<c;++l){if(g){var _=v.x(y);r.fillStyle=t.legendColorBackground,r.fillRect(v.leftForLtr(_,d),e.y,d,d),r.lineWidth=1,r.strokeStyle=i.borderColor,r.strokeRect(v.leftForLtr(_,d),e.y,d,d),r.fillStyle=i.backgroundColor,r.fillRect(v.leftForLtr(v.xPlus(_,1),d-2),e.y+1,d-2,d-2),r.fillStyle=a}b(o[l])}z.each(n.after,b)}m=0,z.each(t.afterBody,b),e.y-=h},drawFooter:function(e,t,r){var n,a,i=t.footer,o=i.length;if(o){var s=Mt(t.rtl,t.x,t.width);for(e.x=Et(t,t._footerAlign),e.y+=t.footerMarginTop,r.textAlign=s.textAlign(t._footerAlign),r.textBaseline="middle",n=t.footerFontSize,r.fillStyle=t.footerFontColor,r.font=z.fontString(n,t._footerFontStyle,t._footerFontFamily),a=0;a<o;++a)r.fillText(i[a],s.x(e.x),e.y+n/2),e.y+=n+t.footerSpacing}},drawBackground:function(e,t,r,n){r.fillStyle=t.backgroundColor,r.strokeStyle=t.borderColor,r.lineWidth=t.borderWidth;var a=t.xAlign,i=t.yAlign,o=e.x,s=e.y,l=n.width,u=n.height,c=t.cornerRadius;r.beginPath(),r.moveTo(o+c,s),"top"===i&&this.drawCaret(e,n),r.lineTo(o+l-c,s),r.quadraticCurveTo(o+l,s,o+l,s+c),"center"===i&&"right"===a&&this.drawCaret(e,n),r.lineTo(o+l,s+u-c),r.quadraticCurveTo(o+l,s+u,o+l-c,s+u),"bottom"===i&&this.drawCaret(e,n),r.lineTo(o+c,s+u),r.quadraticCurveTo(o,s+u,o,s+u-c),"center"===i&&"left"===a&&this.drawCaret(e,n),r.lineTo(o,s+c),r.quadraticCurveTo(o,s,o+c,s),r.closePath(),r.fill(),t.borderWidth>0&&r.stroke()},draw:function(){var e=this._chart.ctx,t=this._view;if(0!==t.opacity){var r={width:t.width,height:t.height},n={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(n,t,e,r),n.y+=t.yPadding,z.rtl.overrideTextDirection(e,t.textDirection),this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),z.rtl.restoreTextDirection(e,t.textDirection),e.restore())}},handleEvent:function(e){var t,r=this,n=r._options;return r._lastActive=r._lastActive||[],"mouseout"===e.type?r._active=[]:(r._active=r._chart.getElementsAtEventForMode(e,n.mode,n),n.reverse&&r._active.reverse()),(t=!z.arrayEquals(r._active,r._lastActive))&&(r._lastActive=r._active,(n.enabled||n.custom)&&(r._eventPosition={x:e.x,y:e.y},r.update(!0),r.pivot())),t}}),It=Ft;It.positioners=Ot;var Rt=z.valueOrDefault;function Nt(){return z.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,r,n){if("xAxes"===e||"yAxes"===e){var a,i,o,s=r[e].length;for(t[e]||(t[e]=[]),a=0;a<s;++a)i=Rt((o=r[e][a]).type,"xAxes"===e?"category":"linear"),a>=t[e].length&&t[e].push({}),z.merge(t[e][a],!t[e][a].type||o.type&&o.type!==t[e][a].type?[St.getScaleDefaults(i),o]:o)}else z._merger(e,t,r,n)}})}function jt(){return z.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,r,n){var a=t[e]||Object.create(null),i=r[e];"scales"===e?t[e]=Nt(a,i):"scale"===e?t[e]=z.merge(a,[St.getScaleDefaults(i.type),i]):z._merger(e,t,r,n)}})}function Lt(e,t,r){var n,a=function(e){return e.id===n};do{n=t+r++}while(z.findIndex(e,a)>=0);return n}function Vt(e){return"top"===e||"bottom"===e}function zt(e,t){return function(r,n){return r[e]===n[e]?r[t]-n[t]:r[e]-n[e]}}R._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 Wt=function(e,t){return this.construct(e,t),this};z.extend(Wt.prototype,{construct:function(e,t){var r=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=jt(R.global,R[e.type],e.options||{}),e}(t);var n=wt.acquireContext(e,t),a=n&&n.canvas,i=a&&a.height,o=a&&a.width;r.id=z.uid(),r.ctx=n,r.canvas=a,r.config=t,r.width=o,r.height=i,r.aspectRatio=i?o/i:null,r.options=t.options,r._bufferedRender=!1,r._layers=[],r.chart=r,r.controller=r,Wt.instances[r.id]=r,Object.defineProperty(r,"data",{get:function(){return r.config.data},set:function(e){r.config.data=e}}),n&&a?(r.initialize(),r.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var e=this;return kt.notify(e,"beforeInit"),z.retinaScale(e,e.options.devicePixelRatio),e.bindEvents(),e.options.responsive&&e.resize(!0),e.initToolTip(),kt.notify(e,"afterInit"),e},clear:function(){return z.canvas.clear(this),this},stop:function(){return Q.cancelAnimation(this),this},resize:function(e){var t=this,r=t.options,n=t.canvas,a=r.maintainAspectRatio&&t.aspectRatio||null,i=Math.max(0,Math.floor(z.getMaximumWidth(n))),o=Math.max(0,Math.floor(a?i/a:z.getMaximumHeight(n)));if((t.width!==i||t.height!==o)&&(n.width=t.width=i,n.height=t.height=o,n.style.width=i+"px",n.style.height=o+"px",z.retinaScale(t,r.devicePixelRatio),!e)){var s={width:i,height:o};kt.notify(t,"resize",[s]),r.onResize&&r.onResize(t,s),t.stop(),t.update({duration:r.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var e=this.options,t=e.scales||{},r=e.scale;z.each(t.xAxes,function(e,r){e.id||(e.id=Lt(t.xAxes,"x-axis-",r))}),z.each(t.yAxes,function(e,r){e.id||(e.id=Lt(t.yAxes,"y-axis-",r))}),r&&(r.id=r.id||"scale")},buildOrUpdateScales:function(){var e=this,t=e.options,r=e.scales||{},n=[],a=Object.keys(r).reduce(function(e,t){return e[t]=!1,e},{});t.scales&&(n=n.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&&n.push({options:t.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),z.each(n,function(t){var n=t.options,i=n.id,o=Rt(n.type,t.dtype);Vt(n.position)!==Vt(t.dposition)&&(n.position=t.dposition),a[i]=!0;var s=null;if(i in r&&r[i].type===o)(s=r[i]).options=n,s.ctx=e.ctx,s.chart=e;else{var l=St.getScaleConstructor(o);if(!l)return;s=new l({id:i,type:o,options:n,ctx:e.ctx,chart:e}),r[s.id]=s}s.mergeTicksOptions(),t.isDefault&&(e.scale=s)}),z.each(a,function(e,t){e||delete r[t]}),e.scales=r,St.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e,t,r=this,n=[],a=r.data.datasets;for(e=0,t=a.length;e<t;e++){var i=a[e],o=r.getDatasetMeta(e),s=i.type||r.config.type;if(o.type&&o.type!==s&&(r.destroyDatasetMeta(e),o=r.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(r,e),n.push(o.controller)}}return n},resetElements:function(){var e=this;z.each(e.data.datasets,function(t,r){e.getDatasetMeta(r).controller.reset()},e)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(e){var t,r,n,a,i=this;if(e&&"object"==typeof e||(e={duration:e,lazy:arguments[1]}),a=(n=i).options,z.each(n.scales,function(e){ot.removeBox(n,e)}),a=jt(R.global,R[n.config.type],a),n.options=n.config.options=a,n.ensureScalesHaveIDs(),n.buildOrUpdateScales(),n.tooltip._options=a.tooltips,n.tooltip.initialize(),kt._invalidate(i),!1!==kt.notify(i,"beforeUpdate")){i.tooltip._data=i.data;var o=i.buildOrUpdateControllers();for(t=0,r=i.data.datasets.length;t<r;t++)i.getDatasetMeta(t).controller.buildOrUpdateElements();i.updateLayout(),i.options.animation&&i.options.animation.duration&&z.each(o,function(e){e.reset()}),i.updateDatasets(),i.tooltip.initialize(),i.lastActive=[],kt.notify(i,"afterUpdate"),i._layers.sort(zt("z","_idx")),i._bufferedRender?i._bufferedRequest={duration:e.duration,easing:e.easing,lazy:e.lazy}:i.render(e)}},updateLayout:function(){var e=this;!1!==kt.notify(e,"beforeLayout")&&(ot.update(this,this.width,this.height),e._layers=[],z.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}),kt.notify(e,"afterScaleUpdate"),kt.notify(e,"afterLayout"))},updateDatasets:function(){var e=this;if(!1!==kt.notify(e,"beforeDatasetsUpdate")){for(var t=0,r=e.data.datasets.length;t<r;++t)e.updateDataset(t);kt.notify(e,"afterDatasetsUpdate")}},updateDataset:function(e){var t=this,r=t.getDatasetMeta(e),n={meta:r,index:e};!1!==kt.notify(t,"beforeDatasetUpdate",[n])&&(r.controller._update(),kt.notify(t,"afterDatasetUpdate",[n]))},render:function(e){var t=this;e&&"object"==typeof e||(e={duration:e,lazy:arguments[1]});var r=t.options.animation,n=Rt(e.duration,r&&r.duration),a=e.lazy;if(!1!==kt.notify(t,"beforeRender")){var i=function(e){kt.notify(t,"afterRender"),z.callback(r&&r.onComplete,[e],t)};if(r&&n){var o=new G({numSteps:n/16.66,easing:e.easing||r.easing,render:function(e,t){var r=t.currentStep,n=r/t.numSteps;e.draw((0,z.easing.effects[t.easing])(n),n,r)},onAnimationProgress:r.onProgress,onAnimationComplete:i});Q.addAnimation(t,o,n,a)}else t.draw(),i(new G({numSteps:0,chart:t}));return t}},draw:function(e){var t,r,n=this;if(n.clear(),z.isNullOrUndef(e)&&(e=1),n.transition(e),!(n.width<=0||n.height<=0)&&!1!==kt.notify(n,"beforeDraw",[e])){for(r=n._layers,t=0;t<r.length&&r[t].z<=0;++t)r[t].draw(n.chartArea);for(n.drawDatasets(e);t<r.length;++t)r[t].draw(n.chartArea);n._drawTooltip(e),kt.notify(n,"afterDraw",[e])}},transition:function(e){for(var t=this,r=0,n=(t.data.datasets||[]).length;r<n;++r)t.isDatasetVisible(r)&&t.getDatasetMeta(r).controller.transition(e);t.tooltip.transition(e)},_getSortedDatasetMetas:function(e){var t,r,n=this,a=[];for(t=0,r=(n.data.datasets||[]).length;t<r;++t)e&&!n.isDatasetVisible(t)||a.push(n.getDatasetMeta(t));return a.sort(zt("order","index")),a},_getSortedVisibleDatasetMetas:function(){return this._getSortedDatasetMetas(!0)},drawDatasets:function(e){var t,r,n=this;if(!1!==kt.notify(n,"beforeDatasetsDraw",[e])){for(r=(t=n._getSortedVisibleDatasetMetas()).length-1;r>=0;--r)n.drawDataset(t[r],e);kt.notify(n,"afterDatasetsDraw",[e])}},drawDataset:function(e,t){var r={meta:e,index:e.index,easingValue:t};!1!==kt.notify(this,"beforeDatasetDraw",[r])&&(e.controller.draw(t),kt.notify(this,"afterDatasetDraw",[r]))},_drawTooltip:function(e){var t=this,r=t.tooltip,n={tooltip:r,easingValue:e};!1!==kt.notify(t,"beforeTooltipDraw",[n])&&(r.draw(),kt.notify(t,"afterTooltipDraw",[n]))},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,r){var n=Ze.modes[t];return"function"==typeof n?n(this,e,r):[]},getDatasetAtEvent:function(e){return Ze.modes.dataset(this,e,{intersect:!0})},getDatasetMeta:function(e){var t=this,r=t.data.datasets[e];r._meta||(r._meta={});var n=r._meta[t.id];return n||(n=r._meta[t.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:r.order||0,index:e}),n},getVisibleDatasetCount:function(){for(var e=0,t=0,r=this.data.datasets.length;t<r;++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,r=this.data.datasets[e],n=r._meta&&r._meta[t];n&&(n.controller.destroy(),delete r._meta[t])},destroy:function(){var e,t,r=this,n=r.canvas;for(r.stop(),e=0,t=r.data.datasets.length;e<t;++e)r.destroyDatasetMeta(e);n&&(r.unbindEvents(),z.canvas.clear(r),wt.releaseContext(r.ctx),r.canvas=null,r.ctx=null),kt.notify(r,"destroy"),delete Wt.instances[r.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={},r=function(){e.eventHandler.apply(e,arguments)};z.each(e.options.events,function(n){wt.addEventListener(e,n,r),t[n]=r}),e.options.responsive&&(r=function(){e.resize()},wt.addEventListener(e,"resize",r),t.resize=r)},unbindEvents:function(){var e=this,t=e._listeners;t&&(delete e._listeners,z.each(t,function(t,r){wt.removeEventListener(e,r,t)}))},updateHoverStyle:function(e,t,r){var n,a,i,o=r?"set":"remove";for(a=0,i=e.length;a<i;++a)(n=e[a])&&this.getDatasetMeta(n._datasetIndex).controller[o+"HoverStyle"](n);"dataset"===t&&this.getDatasetMeta(e[0]._datasetIndex).controller["_"+o+"DatasetHoverStyle"]()},eventHandler:function(e){var t=this,r=t.tooltip;if(!1!==kt.notify(t,"beforeEvent",[e])){t._bufferedRender=!0,t._bufferedRequest=null;var n=t.handleEvent(e);r&&(n=r._start?r.handleEvent(e):n|r.handleEvent(e)),kt.notify(t,"afterEvent",[e]);var a=t._bufferedRequest;return a?t.render(a):n&&!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,r=this,n=r.options||{},a=n.hover;return r.lastActive=r.lastActive||[],r.active="mouseout"===e.type?[]:r.getElementsAtEventForMode(e,a.mode,a),z.callback(n.onHover||n.hover.onHover,[e.native,r.active],r),"mouseup"!==e.type&&"click"!==e.type||n.onClick&&n.onClick.call(r,e.native,r.active),r.lastActive.length&&r.updateHoverStyle(r.lastActive,a.mode,!1),r.active.length&&a.mode&&r.updateHoverStyle(r.active,a.mode,!0),t=!z.arrayEquals(r.active,r.lastActive),r.lastActive=r.active,t}}),Wt.instances={};var Bt=Wt;function Yt(){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||{}}Wt.Controller=Wt,Wt.types={},z.configMerge=jt,z.scaleMerge=Nt,z.extend(Ut.prototype,{formats:Yt,parse:Yt,format:Yt,add:Yt,diff:Yt,startOf:Yt,endOf:Yt,_create:function(e){return e}}),Ut.override=function(e){z.extend(Ut.prototype,e)};var Ht={_date:Ut},qt={formatters:{values:function(e){return z.isArray(e)?e:""+e},linear:function(e,t,r){var n=r.length>3?r[2]-r[1]:r[1]-r[0];Math.abs(n)>1&&e!==Math.floor(e)&&(n=e-Math.floor(e));var a=z.log10(Math.abs(n)),i="";if(0!==e)if(Math.max(Math.abs(r[0]),Math.abs(r[r.length-1]))<1e-4){var o=z.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,r){var n=e/Math.pow(10,Math.floor(z.log10(e)));return 0===e?"0":1===n||2===n||5===n||0===t||t===r.length-1?e.toExponential():""}}},Gt=z.isArray,Qt=z.isNullOrUndef,Zt=z.valueOrDefault,Jt=z.valueAtIndexOrDefault;function Kt(e,t,r){var n,a=e.getTicks().length,i=Math.min(t,a-1),o=e.getPixelForTick(i),s=e._startPixel,l=e._endPixel,u=1e-6;if(!(r&&(n=1===a?Math.max(o-s,l-o):0===t?(e.getPixelForTick(1)-o)/2:(o-e.getPixelForTick(i-1))/2,(o+=i<t?n:-n)<s-u||o>l+u)))return o}function Xt(e){return e.drawTicks?e.tickMarkLength:0}function er(e){var t,r;return e.display?(t=z.options._parseFont(e),r=z.options.toPadding(e.padding),t.lineHeight+r.height):0}function tr(e,t){return z.extend(z.options._parseFont({fontFamily:Zt(t.fontFamily,e.fontFamily),fontSize:Zt(t.fontSize,e.fontSize),fontStyle:Zt(t.fontStyle,e.fontStyle),lineHeight:Zt(t.lineHeight,e.lineHeight)}),{color:z.options.resolve([t.fontColor,e.fontColor,R.global.defaultFontColor])})}function rr(e){var t=tr(e,e.minor);return{minor:t,major:e.major.enabled?tr(e,e.major):t}}function nr(e){var t,r,n,a=[];for(r=0,n=e.length;r<n;++r)void 0!==(t=e[r])._index&&a.push(t);return a}function ar(e,t,r,n){var a,i,o,s,l=Zt(r,0),u=Math.min(Zt(n,e.length),e.length),c=0;for(t=Math.ceil(t),n&&(t=(a=n-r)/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}R._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:qt.formatters.values,minor:{},major:{}}});var ir=H.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(){z.callback(this.options.beforeUpdate,[this])},update:function(e,t,r){var n,a,i,o,s,l=this,u=l.options.ticks,c=u.sampleSize;if(l.beforeUpdate(),l.maxWidth=e,l.maxHeight=t,l.margins=z.extend({left:0,right:0,top:0,bottom:0},r),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=[],n=0,a=l.ticks.length;n<a;++n)o.push({value:l.ticks[n],major:!1});return l._ticks=o,i=l._convertTicksToLabels((s=c<o.length)?function(e,t){for(var r=[],n=e.length/t,a=0,i=e.length;a<i;a+=n)r.push(e[Math.floor(a)]);return r}(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,r=this,n=r.options.ticks.reverse;r.isHorizontal()?(e=r.left,t=r.right):(e=r.top,t=r.bottom,n=!n),r._startPixel=e,r._endPixel=t,r._reversePixels=n,r._length=t-e},afterUpdate:function(){z.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){z.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(){z.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){z.callback(this.options.beforeDataLimits,[this])},determineDataLimits:z.noop,afterDataLimits:function(){z.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){z.callback(this.options.beforeBuildTicks,[this])},buildTicks:z.noop,afterBuildTicks:function(e){var t=this;return Gt(e)&&e.length?z.callback(t.options.afterBuildTicks,[t,e]):(t.ticks=z.callback(t.options.afterBuildTicks,[t,t.ticks])||t.ticks,e)},beforeTickToLabelConversion:function(){z.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(){z.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){z.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var e,t,r,n,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,r=e.highest.height-e.highest.offset,n=Math.min(s.maxWidth,s.chart.width-t),t+6>(a=l.offset?s.maxWidth/c:n/(c-1))&&(a=n/(c-(l.offset?.5:1)),i=s.maxHeight-Xt(l.gridLines)-u.padding-er(l.scaleLabel),o=Math.sqrt(t*t+r*r),f=z.toDegrees(Math.min(Math.asin(Math.min((e.highest.height+6)/a,1)),Math.asin(Math.min(i/o,1))-Math.asin(r/o))),f=Math.max(d,Math.min(h,f))),s.labelRotation=f)},afterCalculateTickRotation:function(){z.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){z.callback(this.options.beforeFit,[this])},fit:function(){var e=this,t=e.minSize={width:0,height:0},r=e.chart,n=e.options,a=n.ticks,i=n.scaleLabel,o=n.gridLines,s=e._isVisible(),l="bottom"===n.position,u=e.isHorizontal();if(u?t.width=e.maxWidth:s&&(t.width=Xt(o)+er(i)),u?s&&(t.height=Xt(o)+er(i)):t.height=e.maxHeight,a.display&&s){var c=rr(a),d=e._getLabelSizes(),h=d.first,f=d.last,p=d.widest,g=d.highest,m=.4*c.minor.lineHeight,y=a.padding;if(u){var v=0!==e.labelRotation,b=z.toRadians(e.labelRotation),x=Math.cos(b),_=Math.sin(b);t.height=Math.min(e.maxHeight,t.height+(_*p.width+x*(g.height-(v?g.offset:0))+(v?0:m))+y);var w,k,S=e.getPixelForTick(0)-e.left,T=e.right-e.getPixelForTick(e.getTicks().length-1);v?(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-T)*e.width/(e.width-T),0)+3}else t.width=Math.min(e.maxWidth,t.width+(a.mirror?0:p.width+y+m)),e.paddingTop=h.height/2,e.paddingBottom=f.height/2}e.handleMargins(),u?(e.width=e._length=r.width-e.margins.left-e.margins.right,e.height=t.height):(e.width=t.width,e.height=e._length=r.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(){z.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(Qt(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,r,n,a=this;for(a.ticks=e.map(function(e){return e.value}),a.beforeTickToLabelConversion(),t=a.convertTicksToLabels(e)||a.ticks,a.afterTickToLabelConversion(),r=0,n=e.length;r<n;++r)e[r].label=t[r];return t},_getLabelSizes:function(){var e=this,t=e._labelSizes;return t||(e._labelSizes=t=function(e,t,r,n){var a,i,o,s,l,u,c,d,h,f,p,g,m,y=r.length,v=[],b=[],x=[],_=0,w=0;for(a=0;a<y;++a){if(s=r[a].label,e.font=u=(l=r[a].major?t.major:t.minor).string,c=n[u]=n[u]||{data:{},gc:[]},d=l.lineHeight,h=f=0,Qt(s)||Gt(s)){if(Gt(s))for(i=0,o=s.length;i<o;++i)Qt(p=s[i])||Gt(p)||(h=z.measureText(e,c.data,c.gc,h,p),f+=d)}else h=z.measureText(e,c.data,c.gc,h,s),f=d;v.push(h),b.push(f),x.push(d/2),_=Math.max(h,_),w=Math.max(f,w)}function k(e){return{width:v[e]||0,height:b[e]||0,offset:x[e]||0}}return function(e,t){z.each(e,function(e){var r,n=e.gc,a=n.length/2;if(a>t){for(r=0;r<a;++r)delete e.data[n[r]];n.splice(0,a)}})}(n,y),g=v.indexOf(_),m=b.indexOf(w),{first:k(0),last:k(y-1),widest:k(g),highest:k(m)}}(e.ctx,rr(e.options.ticks),e.getTicks(),e.longestTextCache),e.longestLabelWidth=t.widest.width),t},_parseValue:function(e){var t,r,n,a;return Gt(e)?(t=+this.getRightValue(e[0]),r=+this.getRightValue(e[1]),n=Math.min(t,r),a=Math.max(t,r)):(t=void 0,r=e=+this.getRightValue(e),n=e,a=e),{min:n,max:a,start:t,end:r}},_getScaleLabel:function(e){var t=this._parseValue(e);return void 0!==t.start?"["+t.start+", "+t.end+"]":+this.getRightValue(e)},getLabelForIndex:z.noop,getPixelForValue:z.noop,getValueForPixel:z.noop,getPixelForTick:function(e){var t=this,r=t.options.offset,n=t._ticks.length,a=1/Math.max(n-(r?0:1),1);return e<0||e>n-1?null:t.getPixelForDecimal(e*a+(r?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,r=e.max;return e.beginAtZero?0:t<0&&r<0?r:t>0&&r>0?t:0},_autoSkip:function(e){var t,r,n,a,i=this,o=i.options.ticks,s=o.maxTicksLimit||i._length/i._tickSize()+1,l=o.major.enabled?function(e){var t,r,n=[];for(t=0,r=e.length;t<r;t++)e[t].major&&n.push(t);return n}(e):[],u=l.length,c=l[0],d=l[u-1];if(u>s)return function(e,t,r){var n,a,i=0,o=t[0];for(r=Math.ceil(r),n=0;n<e.length;n++)a=e[n],n===o?(a._index=n,o=t[++i*r]):delete a.label}(e,l,u/s),nr(e);if(n=function(e,t,r,n){var a,i,o,s,l=function(e){var t,r,n=e.length;if(n<2)return!1;for(r=e[0],t=1;t<n;++t)if(e[t]-e[t-1]!==r)return!1;return r}(e),u=(t.length-1)/n;if(!l)return Math.max(u,1);for(o=0,s=(a=z.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,r=u-1;t<r;t++)ar(e,n,l[t],l[t+1]);return ar(e,n,z.isNullOrUndef(a=u>1?(d-c)/(u-1):null)?0:c-a,c),ar(e,n,d,z.isNullOrUndef(a)?e.length:d+a),nr(e)}return ar(e,n),nr(e)},_tickSize:function(){var e=this,t=e.options.ticks,r=z.toRadians(e.labelRotation),n=Math.abs(Math.cos(r)),a=Math.abs(Math.sin(r)),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*n>s*a?s/n:l/a:l*a<s*n?l/n:s/a},_isVisible:function(){var e,t,r,n=this,a=n.chart,i=n.options.display;if("auto"!==i)return!!i;for(e=0,t=a.data.datasets.length;e<t;++e)if(a.isDatasetVisible(e)&&((r=a.getDatasetMeta(e)).xAxisID===n.id||r.yAxisID===n.id))return!0;return!1},_computeGridLineItems:function(e){var t,r,n,a,i,o,s,l,u,c,d,h,f,p,g,m,y,v=this,b=v.chart,x=v.options,_=x.gridLines,w=x.position,k=_.offsetGridLines,S=v.isHorizontal(),T=v._ticksToDraw,M=T.length+(k?1:0),O=Xt(_),A=[],C=_.drawBorder?Jt(_.lineWidth,0,0):0,P=C/2,D=z._alignPixel,E=function(e){return D(b,e,C)};for("top"===w?(t=E(v.bottom),s=v.bottom-O,u=t-P,d=E(e.top)+P,f=e.bottom):"bottom"===w?(t=E(v.top),d=e.top,f=E(e.bottom)-P,s=t+P,u=v.top+O):"left"===w?(t=E(v.right),o=v.right-O,l=t-P,c=E(e.left)+P,h=e.right):(t=E(v.left),c=e.left,h=E(e.right)-P,o=t+P,l=v.left+O),r=0;r<M;++r)Qt((n=T[r]||{}).label)&&r<T.length||(r===v.zeroLineIndex&&x.offset===k?(p=_.zeroLineWidth,g=_.zeroLineColor,m=_.zeroLineBorderDash||[],y=_.zeroLineBorderDashOffset||0):(p=Jt(_.lineWidth,r,1),g=Jt(_.color,r,"rgba(0,0,0,0.1)"),m=_.borderDash||[],y=_.borderDashOffset||0),void 0!==(a=Kt(v,n._index||r,k))&&(i=D(b,a,p),S?o=l=c=h=i:s=u=d=f=i,A.push({tx1:o,ty1:s,tx2:l,ty2:u,x1:c,y1:d,x2:h,y2:f,width:p,color:g,borderDash:m,borderDashOffset:y})));return A.ticksLength=M,A.borderValue=t,A},_computeLabelItems:function(){var e,t,r,n,a,i,o,s,l,u,c,d,h=this,f=h.options,p=f.ticks,g=f.position,m=p.mirror,y=h.isHorizontal(),v=h._ticksToDraw,b=rr(p),x=p.padding,_=Xt(f.gridLines),w=-z.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=v.length;e<t;++e)Qt(n=(r=v[e]).label)||(s=h.getPixelForTick(r._index||e)+p.labelOffset,u=(l=r.major?b.major:b.minor).lineHeight,c=Gt(n)?n.length:1,y?(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:n,font:l,textOffset:d,textAlign:o}));return k},_drawGrid:function(e){var t=this,r=t.options.gridLines;if(r.display){var n,a,i,o,s,l=t.ctx,u=t.chart,c=z._alignPixel,d=r.drawBorder?Jt(r.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,(n=s.width)&&a&&(l.save(),l.lineWidth=n,l.strokeStyle=a,l.setLineDash&&(l.setLineDash(s.borderDash),l.lineDashOffset=s.borderDashOffset),l.beginPath(),r.drawTicks&&(l.moveTo(s.tx1,s.ty1),l.lineTo(s.tx2,s.ty2)),r.drawOnChartArea&&(l.moveTo(s.x1,s.y1),l.lineTo(s.x2,s.y2)),l.stroke(),l.restore());if(d){var f,p,g,m,y=d,v=Jt(r.lineWidth,h.ticksLength-1,1),b=h.borderValue;t.isHorizontal()?(f=c(u,t.left,y)-y/2,p=c(u,t.right,v)+v/2,g=m=b):(g=c(u,t.top,y)-y/2,m=c(u,t.bottom,v)+v/2,f=p=b),l.lineWidth=d,l.strokeStyle=Jt(r.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,r,n,a,i,o,s,l,u=e.ctx,c=e._labelItems||(e._labelItems=e._computeLabelItems());for(t=0,n=c.length;t<n;++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,Gt(s=i.label))for(r=0,a=s.length;r<a;++r)u.fillText(""+s[r],0,l),l+=o.lineHeight;else u.fillText(s,0,l);u.restore()}}},_drawTitle:function(){var e=this,t=e.ctx,r=e.options,n=r.scaleLabel;if(n.display){var a,i,o=Zt(n.fontColor,R.global.defaultFontColor),s=z.options._parseFont(n),l=z.options.toPadding(n.padding),u=s.lineHeight/2,c=r.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(n.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,r=t.ticks&&t.ticks.z||0,n=t.gridLines&&t.gridLines.z||0;return e._isVisible()&&r!==n&&e.draw===e._draw?[{z:n,draw:function(){e._drawGrid.apply(e,arguments),e._drawTitle.apply(e,arguments)}},{z:r,draw:function(){e._drawLabels.apply(e,arguments)}}]:[{z:r,draw:function(){e.draw.apply(e,arguments)}}]},_getMatchingVisibleMetas:function(e){var t=this,r=t.isHorizontal();return t.chart._getSortedVisibleDatasetMetas().filter(function(n){return(!e||n.type===e)&&(r?n.xAxisID===t.id:n.yAxisID===t.id)})}});ir.prototype._draw=ir.prototype.draw;var or=ir,sr=z.isNullOrUndef,lr=or.extend({determineDataLimits:function(){var e,t=this,r=t._getLabels(),n=t.options.ticks,a=n.min,i=n.max,o=0,s=r.length-1;void 0!==a&&(e=r.indexOf(a))>=0&&(o=e),void 0!==i&&(e=r.indexOf(i))>=0&&(s=e),t.minIndex=o,t.maxIndex=s,t.min=r[o],t.max=r[s]},buildTicks:function(){var e=this,t=e._getLabels(),r=e.minIndex,n=e.maxIndex;e.ticks=0===r&&n===t.length-1?t:t.slice(r,n+1)},getLabelForIndex:function(e,t){var r=this,n=r.chart;return n.getDatasetMeta(t).controller._getValueScaleId()===r.id?r.getRightValue(n.data.datasets[t].data[e]):r._getLabels()[e]},_configure:function(){var e=this,t=e.options.offset,r=e.ticks;or.prototype._configure.call(e),e.isHorizontal()||(e._reversePixels=!e._reversePixels),r&&(e._startValue=e.minIndex-(t?.5:0),e._valueRange=Math.max(r.length-(t?0:1),1))},getPixelForValue:function(e,t,r){var n,a,i,o=this;return sr(t)||sr(r)||(e=o.chart.data.datasets[r].data[t]),sr(e)||(n=o.isHorizontal()?e.x:e.y),(void 0!==n||void 0!==e&&isNaN(t))&&(a=o._getLabels(),e=z.valueOrDefault(n,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,r=Math.round(t._startValue+t.getDecimalForPixel(e)*t._valueRange);return Math.min(Math.max(r,0),t.ticks.length-1)},getBasePixel:function(){return this.bottom}});lr._defaults={position:"bottom"};var ur=z.isNullOrUndef,cr=or.extend({getRightValue:function(e){return"string"==typeof e?+e:or.prototype.getRightValue.call(this,e)},handleTickRangeOptions:function(){var e=this,t=e.options.ticks;if(t.beginAtZero){var r=z.sign(e.min),n=z.sign(e.max);r<0&&n<0?e.max=0:r>0&&n>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,r=t.options.ticks,n=r.stepSize,a=r.maxTicksLimit;return n?e=Math.ceil(t.max/n)-Math.floor(t.min/n)+1:(e=t._computeTickLimit(),a=a||11),a&&(e=Math.min(a,e)),e},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:z.noop,buildTicks:function(){var e=this,t=e.options.ticks,r=e.getTickLimit(),n={maxTicks:r=Math.max(2,r),min:t.min,max:t.max,precision:t.precision,stepSize:z.valueOrDefault(t.fixedStepSize,t.stepSize)},a=e.ticks=function(e,t){var r,n,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=z.niceNum((p-f)/u/l)*l;if(g<1e-14&&ur(c)&&ur(d))return[f,p];(i=Math.ceil(p/g)-Math.floor(f/g))>u&&(g=z.niceNum(i*g/u/l)*l),s||ur(h)?r=Math.pow(10,z._decimalPlaces(g)):(r=Math.pow(10,h),g=Math.ceil(g*r)/r),n=Math.floor(f/g)*g,a=Math.ceil(p/g)*g,s&&(!ur(c)&&z.almostWhole(c/g,g/1e3)&&(n=c),!ur(d)&&z.almostWhole(d/g,g/1e3)&&(a=d)),i=z.almostEquals(i=(a-n)/g,Math.round(i),g/1e3)?Math.round(i):Math.ceil(i),n=Math.round(n*r)/r,a=Math.round(a*r)/r,o.push(ur(c)?n:c);for(var m=1;m<i;++m)o.push(Math.round((n+m*g)*r)/r);return o.push(ur(d)?a:d),o}(n,e);e.handleDirectionalChanges(),e.max=z.max(a),e.min=z.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),or.prototype.convertTicksToLabels.call(e)},_configure:function(){var e,t=this,r=t.getTicks(),n=t.min,a=t.max;or.prototype._configure.call(t),t.options.offset&&r.length&&(n-=e=(a-n)/Math.max(r.length-1,1)/2,a+=e),t._startValue=n,t._endValue=a,t._valueRange=a-n}}),dr={position:"left",ticks:{callback:qt.formatters.linear}};function hr(e,t,r,n){var a,i,o=e.options,s=function(e,t,r){var n=[r.type,void 0===t&&void 0===r.stack?r.index:"",r.stack].join(".");return void 0===e[n]&&(e[n]={pos:[],neg:[]}),e[n]}(t,o.stacked,r),l=s.pos,u=s.neg,c=n.length;for(a=0;a<c;++a)i=e._parseValue(n[a]),isNaN(i.min)||isNaN(i.max)||r.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 fr(e,t,r){var n,a,i=r.length;for(n=0;n<i;++n)a=e._parseValue(r[n]),isNaN(a.min)||isNaN(a.max)||t.data[n].hidden||(e.min=Math.min(e.min,a.min),e.max=Math.max(e.max,a.max))}var pr=cr.extend({determineDataLimits:function(){var e,t,r,n,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)r=o[(t=s[e]).index].data,l?hr(a,u,t,r):fr(a,t,r);z.each(u,function(e){n=e.pos.concat(e.neg),a.min=Math.min(a.min,z.min(n)),a.max=Math.max(a.max,z.max(n))}),a.min=z.isFinite(a.min)&&!isNaN(a.min)?a.min:0,a.max=z.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=z.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])}});pr._defaults=dr;var gr=z.valueOrDefault,mr=z.math.log10,yr={position:"left",ticks:{callback:qt.formatters.logarithmic}};function vr(e,t){return z.isFinite(e)&&e>=0?e:t}var br=or.extend({determineDataLimits:function(){var e,t,r,n,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=(n=u[e].data).length;a<i;a++){var g=f[p];r=o._parseValue(n[a]),isNaN(r.min)||isNaN(r.max)||t.data[a].hidden||r.min<0||r.max<0||(g[a]=g[a]||0,g[a]+=r.max)}}z.each(f,function(e){if(e.length>0){var t=z.min(e),r=z.max(e);o.min=Math.min(o.min,t),o.max=Math.max(o.max,r)}})}else for(e=0;e<u.length;e++)if(t=l.getDatasetMeta(e),l.isDatasetVisible(e)&&d(t))for(a=0,i=(n=u[e].data).length;a<i;a++)r=o._parseValue(n[a]),isNaN(r.min)||isNaN(r.max)||t.data[a].hidden||r.min<0||r.max<0||(o.min=Math.min(r.min,o.min),o.max=Math.max(r.max,o.max),0!==r.min&&(o.minNotZero=Math.min(r.min,o.minNotZero)));o.min=z.isFinite(o.min)?o.min:null,o.max=z.isFinite(o.max)?o.max:null,o.minNotZero=z.isFinite(o.minNotZero)?o.minNotZero:null,this.handleTickRangeOptions()},handleTickRangeOptions:function(){var e=this,t=e.options.ticks;e.min=vr(t.min,e.min),e.max=vr(t.max,e.max),e.min===e.max&&(0!==e.min&&null!==e.min?(e.min=Math.pow(10,Math.floor(mr(e.min))-1),e.max=Math.pow(10,Math.floor(mr(e.max))+1)):(e.min=1,e.max=10)),null===e.min&&(e.min=Math.pow(10,Math.floor(mr(e.max))-1)),null===e.max&&(e.max=0!==e.min?Math.pow(10,Math.floor(mr(e.min))+1):10),null===e.minNotZero&&(e.minNotZero=e.min>0?e.min:e.max<1?Math.pow(10,Math.floor(mr(e.max))):1)},buildTicks:function(){var e=this,t=e.options.ticks,r=!e.isHorizontal(),n={min:vr(t.min),max:vr(t.max)},a=e.ticks=function(e,t){var r,n,a=[],i=gr(e.min,Math.pow(10,Math.floor(mr(t.min)))),o=Math.floor(mr(t.max)),s=Math.ceil(t.max/Math.pow(10,o));0===i?(r=Math.floor(mr(t.minNotZero)),n=Math.floor(t.minNotZero/Math.pow(10,r)),a.push(i),i=n*Math.pow(10,r)):(r=Math.floor(mr(i)),n=Math.floor(i/Math.pow(10,r)));var l=r<0?Math.pow(10,Math.abs(r)):1;do{a.push(i),10===++n&&(n=1,l=++r>=0?1:l),i=Math.round(n*Math.pow(10,r)*l)/l}while(r<o||r===o&&n<s);var u=gr(e.max,i);return a.push(u),a}(n,e);e.max=z.max(a),e.min=z.min(a),t.reverse?(r=!r,e.start=e.max,e.end=e.min):(e.start=e.min,e.end=e.max),r&&a.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),or.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(mr(e));return Math.floor(e/Math.pow(10,t))*Math.pow(10,t)},_configure:function(){var e=this,t=e.min,r=0;or.prototype._configure.call(e),0===t&&(t=e._getFirstTickValue(e.minNotZero),r=gr(e.options.ticks.fontSize,R.global.defaultFontSize)/e._length),e._startValue=mr(t),e._valueOffset=r,e._valueRange=(mr(e.max)-mr(t))/(1-r)},getPixelForValue:function(e){var t=this,r=0;return(e=+t.getRightValue(e))>t.min&&e>0&&(r=(mr(e)-t._startValue)/t._valueRange+t._valueOffset),t.getPixelForDecimal(r)},getValueForPixel:function(e){var t=this,r=t.getDecimalForPixel(e);return 0===r&&0===t.min?0:Math.pow(10,t._startValue+(r-t._valueOffset)*t._valueRange)}});br._defaults=yr;var xr=z.valueOrDefault,_r=z.valueAtIndexOrDefault,wr=z.options.resolve,kr={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:qt.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(e){return e}}};function Sr(e){var t=e.ticks;return t.display&&e.display?xr(t.fontSize,R.global.defaultFontSize)+2*t.backdropPaddingY:0}function Tr(e,t,r){return z.isArray(r)?{w:z.longestText(e,e.font,r),h:r.length*t}:{w:e.measureText(r).width,h:t}}function Mr(e,t,r,n,a){return e===n||e===a?{start:t-r/2,end:t+r/2}:e<n||e>a?{start:t-r,end:t}:{start:t,end:t+r}}function Or(e){return 0===e||180===e?"center":e<180?"left":"right"}function Ar(e,t,r,n){var a,i,o=r.y+n/2;if(z.isArray(t))for(a=0,i=t.length;a<i;++a)e.fillText(t[a],r.x,o),o+=n;else e.fillText(t,r.x,o)}function Cr(e,t,r){90===e||270===e?r.y-=t.h/2:(e>270||e<90)&&(r.y-=t.h)}function Pr(e){return z.isNumber(e)?e:0}var Dr=cr.extend({setDimensions:function(){var e=this;e.width=e.maxWidth,e.height=e.maxHeight,e.paddingTop=Sr(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,r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;z.each(t.data.datasets,function(a,i){if(t.isDatasetVisible(i)){var o=t.getDatasetMeta(i);z.each(a.data,function(t,a){var i=+e.getRightValue(t);isNaN(i)||o.data[a].hidden||(r=Math.min(i,r),n=Math.max(i,n))})}}),e.min=r===Number.POSITIVE_INFINITY?0:r,e.max=n===Number.NEGATIVE_INFINITY?0:n,e.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/Sr(this.options))},convertTicksToLabels:function(){var e=this;cr.prototype.convertTicksToLabels.call(e),e.pointLabels=e.chart.data.labels.map(function(){var t=z.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,r,n,a=z.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=e.chart.data.labels.length;for(t=0;t<s;t++){n=e.getPointPosition(t,e.drawingArea+5),r=Tr(e.ctx,a.lineHeight,e.pointLabels[t]),e._pointLabelSizes[t]=r;var l=e.getIndexAngle(t),u=z.toDegrees(l)%360,c=Mr(u,n.x,r.w,0,180),d=Mr(u,n.y,r.h,90,270);c.start<i.l&&(i.l=c.start,o.l=l),c.end>i.r&&(i.r=c.end,o.r=l),d.start<i.t&&(i.t=d.start,o.t=l),d.end>i.b&&(i.b=d.end,o.b=l)}e.setReductions(e.drawingArea,i,o)}(e):e.setCenterPoint(0,0,0,0)},setReductions:function(e,t,r){var n=this,a=t.l/Math.sin(r.l),i=Math.max(t.r-n.width,0)/Math.sin(r.r),o=-t.t/Math.cos(r.t),s=-Math.max(t.b-(n.height-n.paddingTop),0)/Math.cos(r.b);a=Pr(a),i=Pr(i),o=Pr(o),s=Pr(s),n.drawingArea=Math.min(Math.floor(e-(a+i)/2),Math.floor(e-(o+s)/2)),n.setCenterPoint(a,i,o,s)},setCenterPoint:function(e,t,r,n){var a=this,i=r+a.drawingArea,o=a.height-a.paddingTop-n-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,r=(e*(360/t.data.labels.length)+((t.options||{}).startAngle||0))%360;return(r<0?r+360:r)*Math.PI*2/360},getDistanceFromCenterForValue:function(e){var t=this;if(z.isNullOrUndef(e))return NaN;var r=t.drawingArea/(t.max-t.min);return t.options.ticks.reverse?(t.max-e)*r:(e-t.min)*r},getPointPosition:function(e,t){var r=this,n=r.getIndexAngle(e)-Math.PI/2;return{x:Math.cos(n)*t+r.xCenter,y:Math.sin(n)*t+r.yCenter}},getPointPositionForValue:function(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))},getBasePosition:function(e){var t=this,r=t.min,n=t.max;return t.getPointPositionForValue(e||0,t.beginAtZero?0:r<0&&n<0?n:r>0&&n>0?r:0)},_drawGrid:function(){var e,t,r,n=this,a=n.ctx,i=n.options,o=i.gridLines,s=i.angleLines,l=xr(s.lineWidth,o.lineWidth),u=xr(s.color,o.color);if(i.pointLabels.display&&function(e){var t=e.ctx,r=e.options,n=r.pointLabels,a=Sr(r),i=e.getDistanceFromCenterForValue(r.ticks.reverse?e.min:e.max),o=z.options._parseFont(n);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=_r(n.fontColor,s,R.global.defaultFontColor);t.fillStyle=u;var c=e.getIndexAngle(s),d=z.toDegrees(c);t.textAlign=Or(d),Cr(d,e._pointLabelSizes[s],l),Ar(t,e.pointLabels[s],l,o.lineHeight)}t.restore()}(n),o.display&&z.each(n.ticks,function(e,r){0!==r&&(t=n.getDistanceFromCenterForValue(n.ticksAsNumbers[r]),function(e,t,r,n){var a,i=e.ctx,o=t.circular,s=e.chart.data.labels.length,l=_r(t.color,n-1),u=_r(t.lineWidth,n-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,r,0,2*Math.PI);else{a=e.getPointPosition(0,r),i.moveTo(a.x,a.y);for(var c=1;c<s;c++)a=e.getPointPosition(c,r),i.lineTo(a.x,a.y)}i.closePath(),i.stroke(),i.restore()}}(n,o,t,r))}),s.display&&l&&u){for(a.save(),a.lineWidth=l,a.strokeStyle=u,a.setLineDash&&(a.setLineDash(wr([s.borderDash,o.borderDash,[]])),a.lineDashOffset=wr([s.borderDashOffset,o.borderDashOffset,0])),e=n.chart.data.labels.length-1;e>=0;e--)t=n.getDistanceFromCenterForValue(i.ticks.reverse?n.min:n.max),r=n.getPointPosition(e,t),a.beginPath(),a.moveTo(n.xCenter,n.yCenter),a.lineTo(r.x,r.y),a.stroke();a.restore()}},_drawLabels:function(){var e=this,t=e.ctx,r=e.options.ticks;if(r.display){var n,a,i=e.getIndexAngle(0),o=z.options._parseFont(r),s=xr(r.fontColor,R.global.defaultFontColor);t.save(),t.font=o.string,t.translate(e.xCenter,e.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",z.each(e.ticks,function(i,l){(0!==l||r.reverse)&&(n=e.getDistanceFromCenterForValue(e.ticksAsNumbers[l]),r.showLabelBackdrop&&(a=t.measureText(i).width,t.fillStyle=r.backdropColor,t.fillRect(-a/2-r.backdropPaddingX,-n-o.size/2-r.backdropPaddingY,a+2*r.backdropPaddingX,o.size+2*r.backdropPaddingY)),t.fillStyle=s,t.fillText(i,0,-n))}),t.restore()}},_drawTitle:z.noop});Dr._defaults=kr;var Er=z._deprecated,$r=z.options.resolve,Fr=z.valueOrDefault,Ir=Number.MIN_SAFE_INTEGER||-9007199254740991,Rr=Number.MAX_SAFE_INTEGER||9007199254740991,Nr={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}},jr=Object.keys(Nr);function Lr(e,t){return e-t}function Vr(e){return z.valueOrDefault(e.time.min,e.ticks.min)}function zr(e){return z.valueOrDefault(e.time.max,e.ticks.max)}function Wr(e,t,r,n){var a=function(e,t,r){for(var n,a,i,o=0,s=e.length-1;o>=0&&o<=s;){if(i=e[n=o+s>>1],!(a=e[n-1]||null))return{lo:null,hi:i};if(i[t]<r)o=n+1;else{if(!(a[t]>r))return{lo:a,hi:i};s=n-1}}return{lo:i,hi:null}}(e,t,r),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[n]+(o[n]-i[n])*(s?(r-i[t])/s:0)}function Br(e,t){var r=e._adapter,n=e.options.time,a=n.parser,i=a||n.format,o=t;return"function"==typeof a&&(o=a(o)),z.isFinite(o)||(o="string"==typeof i?r.parse(o,i):r.parse(o)),null!==o?+o:(a||"function"!=typeof i||(o=i(t),z.isFinite(o)||(o=r.parse(o))),o)}function Yr(e,t){if(z.isNullOrUndef(t))return null;var r=e.options.time,n=Br(e,e.getRightValue(t));return null===n||r.round&&(n=+e._adapter.startOf(n,r.round)),n}function Ur(e,t,r,n){var a,i,o=jr.length;for(a=jr.indexOf(e);a<o-1;++a)if((i=Nr[jr[a]]).common&&Math.ceil((r-t)/((i.steps?i.steps:Rr)*i.size))<=n)return jr[a];return jr[o-1]}function Hr(e,t,r){var n,a,i=[],o={},s=t.length;for(n=0;n<s;++n)o[a=t[n]]=n,i.push({value:a,major:!1});return 0!==s&&r?function(e,t,r,n){var a,i,o=e._adapter,s=+o.startOf(t[0].value,n),l=t[t.length-1].value;for(a=s;a<=l;a=+o.add(a,1,n))(i=r[a])>=0&&(t[i].major=!0);return t}(e,i,o,r):i}var qr=or.extend({initialize:function(){this.mergeTicksOptions(),or.prototype.initialize.call(this)},update:function(){var e=this,t=e.options,r=t.time||(t.time={}),n=e._adapter=new Ht._date(t.adapters.date);return Er("time scale",r.format,"time.format","time.parser"),Er("time scale",r.min,"time.min","ticks.min"),Er("time scale",r.max,"time.max","ticks.max"),z.mergeIf(r.displayFormats,n.formats()),or.prototype.update.apply(e,arguments)},getRightValue:function(e){return e&&void 0!==e.t&&(e=e.t),or.prototype.getRightValue.call(this,e)},determineDataLimits:function(){var e,t,r,n,a,i,o,s=this,l=s.chart,u=s._adapter,c=s.options,d=c.time.unit||"day",h=Rr,f=Ir,p=[],g=[],m=[],y=s._getLabels();for(e=0,r=y.length;e<r;++e)m.push(Yr(s,y[e]));for(e=0,r=(l.data.datasets||[]).length;e<r;++e)if(l.isDatasetVisible(e))if(z.isObject((a=l.data.datasets[e].data)[0]))for(g[e]=[],t=0,n=a.length;t<n;++t)i=Yr(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=r>1?function(e){var t,r,n,a={},i=[];for(t=0,r=e.length;t<r;++t)a[n=e[t]]||(a[n]=!0,i.push(n));return i}(p).sort(Lr):p.sort(Lr),h=Math.min(h,p[0]),f=Math.max(f,p[p.length-1])),h=Yr(s,Vr(c))||h,f=Yr(s,zr(c))||f,h=h===Rr?+u.startOf(Date.now(),d):h,f=f===Ir?+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,r,n=this,a=n.min,i=n.max,o=n.options,s=o.ticks,l=o.time,u=n._timestamps,c=[],d=n.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,r,n){var a,i=e._adapter,o=e.options,s=o.time,l=s.unit||Ur(s.minUnit,t,r,n),u=$r([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(r,t,l)>1e5*u)throw t+" and "+r+" are too far apart with stepSize of "+u+" "+l;for(a=d;a<r;a=+i.add(a,u,l))h.push(a);return a!==r&&"ticks"!==o.bounds||h.push(a),h}(n,a,i,d),"ticks"===o.bounds&&u.length&&(a=u[0],i=u[u.length-1]),a=Yr(n,Vr(o))||a,i=Yr(n,zr(o))||i,e=0,t=u.length;e<t;++e)(r=u[e])>=a&&r<=i&&c.push(r);return n.min=a,n.max=i,n._unit=l.unit||(s.autoSkip?Ur(l.minUnit,n.min,n.max,d):function(e,t,r,n,a){var i,o;for(i=jr.length-1;i>=jr.indexOf(r);i--)if(Nr[o=jr[i]].common&&e._adapter.diff(a,n,o)>=t-1)return o;return jr[r?jr.indexOf(r):0]}(n,c.length,l.minUnit,n.min,n.max)),n._majorUnit=s.major.enabled&&"year"!==n._unit?function(e){for(var t=jr.indexOf(e)+1,r=jr.length;t<r;++t)if(Nr[jr[t]].common)return jr[t]}(n._unit):void 0,n._table=function(e,t,r,n){if("linear"===n||!e.length)return[{time:t,pos:0},{time:r,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<r&&c.push(s);for(c.push(r),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}(n._timestamps.data,a,i,f),n._offsets=function(e,t,r,n,a){var i,o,s=0,l=0;return a.offset&&t.length&&(i=Wr(e,"time",t[0],"pos"),s=1===t.length?1-i:(Wr(e,"time",t[1],"pos")-i)/2,o=Wr(e,"time",t[t.length-1],"pos"),l=1===t.length?o:(o-Wr(e,"time",t[t.length-2],"pos"))/2),{start:s,end:l,factor:1/(s+1+l)}}(n._table,c,0,0,o),s.reverse&&c.reverse(),Hr(n,c,n._majorUnit)},getLabelForIndex:function(e,t){var r=this,n=r._adapter,a=r.chart.data,i=r.options.time,o=a.labels&&e<a.labels.length?a.labels[e]:"",s=a.datasets[t].data[e];return z.isObject(s)&&(o=r.getRightValue(s)),i.tooltipFormat?n.format(Br(r,o),i.tooltipFormat):"string"==typeof o?o:n.format(Br(r,o),i.displayFormats.datetime)},tickFormatFunction:function(e,t,r,n){var a=this,i=a.options,o=i.time.displayFormats,s=a._majorUnit,l=o[s],u=r[t],c=i.ticks,d=s&&l&&u&&u.major,h=a._adapter.format(e,n||(d?l:o[a._unit])),f=d?c.major:c.minor,p=$r([f.callback,f.userCallback,c.callback,c.userCallback]);return p?p(h,t,r):h},convertTicksToLabels:function(e){var t,r,n=[];for(t=0,r=e.length;t<r;++t)n.push(this.tickFormatFunction(e[t].value,t,e));return n},getPixelForOffset:function(e){var t=this,r=t._offsets,n=Wr(t._table,"time",e,"pos");return t.getPixelForDecimal((r.start+n)*r.factor)},getPixelForValue:function(e,t,r){var n=this,a=null;if(void 0!==t&&void 0!==r&&(a=n._timestamps.datasets[r][t]),null===a&&(a=Yr(n,e)),null!==a)return n.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,r=t._offsets,n=t.getDecimalForPixel(e)/r.factor-r.end,a=Wr(t._table,"pos",n,"time");return t._adapter._create(a)},_getLabelSize:function(e){var t=this,r=t.options.ticks,n=t.ctx.measureText(e).width,a=z.toRadians(t.isHorizontal()?r.maxRotation:r.minRotation),i=Math.cos(a),o=Math.sin(a),s=Fr(r.fontSize,R.global.defaultFontSize);return{w:n*i+s*o,h:n*o+s*i}},getLabelWidth:function(e){return this._getLabelSize(e).w},getLabelCapacity:function(e){var t=this,r=t.options.time,n=r.displayFormats,a=n[r.unit]||n.millisecond,i=t.tickFormatFunction(e,0,Hr(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}});qr._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 Gr={category:lr,linear:pr,logarithmic:br,radialLinear:Dr,time:qr},Qr={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 Qr},parse:function(t,r){return"string"==typeof t&&"string"==typeof r?t=e(t,r):t instanceof e||(t=e(t)),t.isValid()?t.valueOf():null},format:function(t,r){return e(t).format(r)},add:function(t,r,n){return e(t).add(r,n).valueOf()},diff:function(t,r,n){return e(t).diff(e(r),n)},startOf:function(t,r,n){return t=e(t),"isoWeek"===r?t.isoWeekday(n).valueOf():t.startOf(r).valueOf()},endOf:function(t,r){return e(t).endOf(r).valueOf()},_create:function(t){return e(t)}}:{}),R._set("global",{plugins:{filler:{propagate:!0}}});var Zr={dataset:function(e){var t=e.fill,r=e.chart,n=r.getDatasetMeta(t),a=n&&r.isDatasetVisible(t)&&n.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,r=t?t.x:null,n=t?t.y:null;return z.isArray(t)?function(e,r){return t[r]}:function(e){return{x:null===r?e.x:r,y:null===n?e.y:n}}}};function Jr(e,t,r){var n,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(n=parseFloat(i,10),isFinite(n)&&Math.floor(n)===n)return"-"!==i[0]&&"+"!==i[0]||(n=t+n),!(n===t||n<0||n>=r)&&n;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 Kr(e){return(e.el._scale||{}).getPointPositionForValue?function(e){var t,r,n,a,i,o=e.el._scale,s=o.options,l=o.chart.data.labels.length,u=e.fill,c=[];if(!l)return null;for(r=s.ticks.reverse?o.min:o.max,n=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:r):o.getBasePosition(a),s.gridLines.circular&&(i.cx=n.x,i.cy=n.y,i.angle=o.getIndexAngle(a)-Math.PI/2),c.push(i);return c}(e):function(e){var t,r=e.el._model||{},n=e.el._scale||{},a=e.fill,i=null;if(isFinite(a))return null;if("start"===a?i=void 0===r.scaleBottom?n.bottom:r.scaleBottom:"end"===a?i=void 0===r.scaleTop?n.top:r.scaleTop:void 0!==r.scaleZero?i=r.scaleZero:n.getBasePixel&&(i=n.getBasePixel()),null!=i){if(void 0!==i.x&&void 0!==i.y)return i;if(z.isFinite(i))return{x:(t=n.isHorizontal())?i:null,y:t?null:i}}return null}(e)}function Xr(e,t,r){var n,a=e[t].fill,i=[t];if(!r)return a;for(;!1!==a&&-1===i.indexOf(a);){if(!isFinite(a))return a;if(!(n=e[a]))return!1;if(n.visible)return a;i.push(a),a=n.fill}return!1}function en(e){var t=e.fill,r="dataset";return!1===t?null:(isFinite(t)||(r="boundary"),Zr[r](e))}function tn(e){return e&&!e.skip}function rn(e,t,r,n,a){var i,o,s,l;if(n&&a){for(e.moveTo(t[0].x,t[0].y),i=1;i<n;++i)z.canvas.lineTo(e,t[i-1],t[i]);if(void 0===r[0].angle)for(e.lineTo(r[a-1].x,r[a-1].y),i=a-1;i>0;--i)z.canvas.lineTo(e,r[i],r[i-1],!0);else for(o=r[0].cx,s=r[0].cy,l=Math.sqrt(Math.pow(r[0].x-o,2)+Math.pow(r[0].y-s,2)),i=a-1;i>0;--i)e.arc(o,s,l,r[i].angle,r[i-1].angle,!0)}}function nn(e,t,r,n,a,i){var o,s,l,u,c,d,h,f,p=t.length,g=n.spanGaps,m=[],y=[],v=0,b=0;for(e.beginPath(),o=0,s=p;o<s;++o)c=r(u=t[l=o%p]._view,l,n),d=tn(u),h=tn(c),i&&void 0===f&&d&&(s=p+(f=o+1)),d&&h?(v=m.push(u),b=y.push(c)):v&&b&&(g?(d&&m.push(u),h&&y.push(c)):(rn(e,m,y,v,b),v=b=0,m=[],y=[]));rn(e,m,y,v,b),e.closePath(),e.fillStyle=a,e.fill()}var an={id:"filler",afterDatasetsUpdate:function(e,t){var r,n,a,i,o=(e.data.datasets||[]).length,s=t.propagate,l=[];for(n=0;n<o;++n)i=null,(a=(r=e.getDatasetMeta(n)).dataset)&&a._model&&a instanceof ye.Line&&(i={visible:e.isDatasetVisible(n),fill:Jr(a,n,o),chart:e,el:a}),r.$filler=i,l.push(i);for(n=0;n<o;++n)(i=l[n])&&(i.fill=Xr(l,n,s),i.boundary=Kr(i),i.mapper=en(i))},beforeDatasetsDraw:function(e){var t,r,n,a,i,o,s,l=e._getSortedVisibleDatasetMetas(),u=e.ctx;for(r=l.length-1;r>=0;--r)(t=l[r].$filler)&&t.visible&&(i=(n=t.el)._children||[],s=(a=n._view).backgroundColor||R.global.defaultColor,(o=t.mapper)&&s&&i.length&&(z.canvas.clipArea(u,e.chartArea),nn(u,i,o,a,s,n._loop),z.canvas.unclipArea(u)))}},on=z.rtl.getRtlAdapter,sn=z.noop,ln=z.valueOrDefault;function un(e,t){return e.usePointStyle&&e.boxWidth>t?t:e.boxWidth}R._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(e,t){var r=t.datasetIndex,n=this.chart,a=n.getDatasetMeta(r);a.hidden=null===a.hidden?!n.data.datasets[r].hidden:null,n.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(e){var t=e.data.datasets,r=e.options.legend||{},n=r.labels&&r.labels.usePointStyle;return e._getSortedDatasetMetas().map(function(r){var a=r.controller.getStyle(n?0:void 0);return{text:t[r.index].label,fillStyle:a.backgroundColor,hidden:!e.isDatasetVisible(r.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:r.index}},this)}}},legendCallback:function(e){var t,r,n,a=document.createElement("ul"),i=e.data.datasets;for(a.setAttribute("class",e.id+"-legend"),t=0,r=i.length;t<r;t++)(n=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=i[t].backgroundColor,i[t].label&&n.appendChild(document.createTextNode(i[t].label));return a.outerHTML}});var cn=H.extend({initialize:function(e){var t=this;z.extend(t,e),t.legendHitBoxes=[],t._hoveredItem=null,t.doughnutMode=!1},beforeUpdate:sn,update:function(e,t,r){var n=this;return n.beforeUpdate(),n.maxWidth=e,n.maxHeight=t,n.margins=r,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n.beforeBuildLabels(),n.buildLabels(),n.afterBuildLabels(),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate(),n.minSize},afterUpdate:sn,beforeSetDimensions:sn,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:sn,beforeBuildLabels:sn,buildLabels:function(){var e=this,t=e.options.labels||{},r=z.callback(t.generateLabels,[e.chart],e)||[];t.filter&&(r=r.filter(function(r){return t.filter(r,e.chart.data)})),e.options.reverse&&r.reverse(),e.legendItems=r},afterBuildLabels:sn,beforeFit:sn,fit:function(){var e=this,t=e.options,r=t.labels,n=t.display,a=e.ctx,i=z.options._parseFont(r),o=i.size,s=e.legendHitBoxes=[],l=e.minSize,u=e.isHorizontal();if(u?(l.width=e.maxWidth,l.height=n?10:0):(l.width=n?10:0,l.height=e.maxHeight),n){if(a.font=i.string,u){var c=e.lineWidths=[0],d=0;a.textAlign="left",a.textBaseline="middle",z.each(e.legendItems,function(e,t){var n=un(r,o)+o/2+a.measureText(e.text).width;(0===t||c[c.length-1]+n+2*r.padding>l.width)&&(d+=o+r.padding,c[c.length-(t>0?0:1)]=0),s[t]={left:0,top:0,width:n,height:o},c[c.length-1]+=n+r.padding}),l.height+=d}else{var h=r.padding,f=e.columnWidths=[],p=e.columnHeights=[],g=r.padding,m=0,y=0;z.each(e.legendItems,function(e,t){var n=un(r,o)+o/2+a.measureText(e.text).width;t>0&&y+o+2*h>l.height&&(g+=m+r.padding,f.push(m),p.push(y),m=0,y=0),m=Math.max(m,n),y+=o+h,s[t]={left:0,top:0,width:n,height:o}}),g+=m,f.push(m),p.push(y),l.width+=g}e.width=l.width,e.height=l.height}else e.width=l.width=e.height=l.height=0},afterFit:sn,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var e=this,t=e.options,r=t.labels,n=R.global,a=n.defaultColor,i=n.elements.line,o=e.height,s=e.columnHeights,l=e.width,u=e.lineWidths;if(t.display){var c,d=on(t.rtl,e.left,e.minSize.width),h=e.ctx,f=ln(r.fontColor,n.defaultFontColor),p=z.options._parseFont(r),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=un(r,g),y=e.legendHitBoxes,v=function(e,n){switch(t.align){case"start":return r.padding;case"end":return e-n;default:return(e-n+r.padding)/2}},b=e.isHorizontal();c=b?{x:e.left+v(l,u[0]),y:e.top+r.padding,line:0}:{x:e.left+r.padding,y:e.top+v(o,s[0]),line:0},z.rtl.overrideTextDirection(e.ctx,t.textDirection);var x=g+r.padding;z.each(e.legendItems,function(t,n){var f=h.measureText(t.text).width,p=m+g/2+f,_=c.x,w=c.y;d.setWidth(e.minSize.width),b?n>0&&_+p+r.padding>e.left+e.minSize.width&&(w=c.y+=x,c.line++,_=c.x=e.left+v(l,u[c.line])):n>0&&w+x>e.top+e.minSize.height&&(_=c.x=_+e.columnWidths[c.line]+r.padding,c.line++,w=c.y=e.top+v(o,s[c.line]));var k=d.x(_);(function(e,t,n){if(!(isNaN(m)||m<=0)){h.save();var o=ln(n.lineWidth,i.borderWidth);if(h.fillStyle=ln(n.fillStyle,a),h.lineCap=ln(n.lineCap,i.borderCapStyle),h.lineDashOffset=ln(n.lineDashOffset,i.borderDashOffset),h.lineJoin=ln(n.lineJoin,i.borderJoinStyle),h.lineWidth=o,h.strokeStyle=ln(n.strokeStyle,a),h.setLineDash&&h.setLineDash(ln(n.lineDash,i.borderDash)),r&&r.usePointStyle){var s=m*Math.SQRT2/2,l=d.xPlus(e,m/2);z.canvas.drawPoint(h,n.pointStyle,s,l,t+g/2,n.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),y[n].left=d.leftForLtr(k,y[n].width),y[n].top=w,function(e,t,r,n){var a=g/2,i=d.xPlus(e,m+a),o=t+a;h.fillText(r.text,i,o),r.hidden&&(h.beginPath(),h.lineWidth=2,h.moveTo(i,o),h.lineTo(d.xPlus(i,n),o),h.stroke())}(k,w,t,f),b?c.x+=p+r.padding:c.y+=x}),z.rtl.restoreTextDirection(e.ctx,t.textDirection)}},_getLegendItemAt:function(e,t){var r,n,a,i=this;if(e>=i.left&&e<=i.right&&t>=i.top&&t<=i.bottom)for(a=i.legendHitBoxes,r=0;r<a.length;++r)if(e>=(n=a[r]).left&&e<=n.left+n.width&&t>=n.top&&t<=n.top+n.height)return i.legendItems[r];return null},handleEvent:function(e){var t,r=this,n=r.options,a="mouseup"===e.type?"click":e.type;if("mousemove"===a){if(!n.onHover&&!n.onLeave)return}else{if("click"!==a)return;if(!n.onClick)return}t=r._getLegendItemAt(e.x,e.y),"click"===a?t&&n.onClick&&n.onClick.call(r,e.native,t):(n.onLeave&&t!==r._hoveredItem&&(r._hoveredItem&&n.onLeave.call(r,e.native,r._hoveredItem),r._hoveredItem=t),n.onHover&&t&&n.onHover.call(r,e.native,t))}});function dn(e,t){var r=new cn({ctx:e.ctx,options:t,chart:e});ot.configure(e,r,t),ot.addBox(e,r),e.legend=r}var hn={id:"legend",_element:cn,beforeInit:function(e){var t=e.options.legend;t&&dn(e,t)},beforeUpdate:function(e){var t=e.options.legend,r=e.legend;t?(z.mergeIf(t,R.global.legend),r?(ot.configure(e,r,t),r.options=t):dn(e,t)):r&&(ot.removeBox(e,r),delete e.legend)},afterEvent:function(e,t){var r=e.legend;r&&r.handleEvent(t)}},fn=z.noop;R._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var pn=H.extend({initialize:function(e){z.extend(this,e),this.legendHitBoxes=[]},beforeUpdate:fn,update:function(e,t,r){var n=this;return n.beforeUpdate(),n.maxWidth=e,n.maxHeight=t,n.margins=r,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n.beforeBuildLabels(),n.buildLabels(),n.afterBuildLabels(),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate(),n.minSize},afterUpdate:fn,beforeSetDimensions:fn,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:fn,beforeBuildLabels:fn,buildLabels:fn,afterBuildLabels:fn,beforeFit:fn,fit:function(){var e,t=this,r=t.options,n=t.minSize={},a=t.isHorizontal();r.display?(e=(z.isArray(r.text)?r.text.length:1)*z.options._parseFont(r).lineHeight+2*r.padding,t.width=n.width=a?t.maxWidth:e,t.height=n.height=a?e:t.maxHeight):t.width=n.width=t.height=n.height=0},afterFit:fn,isHorizontal:function(){var e=this.options.position;return"top"===e||"bottom"===e},draw:function(){var e=this,t=e.ctx,r=e.options;if(r.display){var n,a,i,o=z.options._parseFont(r),s=o.lineHeight,l=s/2+r.padding,u=0,c=e.top,d=e.left,h=e.bottom,f=e.right;t.fillStyle=z.valueOrDefault(r.fontColor,R.global.defaultFontColor),t.font=o.string,e.isHorizontal()?(a=d+(f-d)/2,i=c+l,n=f-d):(a="left"===r.position?d+l:f-l,i=c+(h-c)/2,n=h-c,u=Math.PI*("left"===r.position?-.5:.5)),t.save(),t.translate(a,i),t.rotate(u),t.textAlign="center",t.textBaseline="middle";var p=r.text;if(z.isArray(p))for(var g=0,m=0;m<p.length;++m)t.fillText(p[m],0,g,n),g+=s;else t.fillText(p,0,0,n);t.restore()}}});function gn(e,t){var r=new pn({ctx:e.ctx,options:t,chart:e});ot.configure(e,r,t),ot.addBox(e,r),e.titleBlock=r}var mn={},yn=an,vn=hn,bn={id:"title",_element:pn,beforeInit:function(e){var t=e.options.title;t&&gn(e,t)},beforeUpdate:function(e){var t=e.options.title,r=e.titleBlock;t?(z.mergeIf(t,R.global.title),r?(ot.configure(e,r,t),r.options=t):gn(e,t)):r&&(ot.removeBox(e,r),delete e.titleBlock)}};for(var xn in mn.filler=yn,mn.legend=vn,mn.title=bn,Bt.helpers=z,function(){function e(e,t,r){var n;return"string"==typeof e?(n=parseInt(e,10),-1!==e.indexOf("%")&&(n=n/100*t.parentNode[r])):n=e,n}function t(e){return null!=e&&"none"!==e}function r(r,n,a){var i=document.defaultView,o=z._getParentNode(r),s=i.getComputedStyle(r)[n],l=i.getComputedStyle(o)[n],u=t(s),c=t(l),d=Number.POSITIVE_INFINITY;return u||c?Math.min(u?e(s,r,a):d,c?e(l,o,a):d):"none"}z.where=function(e,t){if(z.isArray(e)&&Array.prototype.filter)return e.filter(t);var r=[];return z.each(e,function(e){t(e)&&r.push(e)}),r},z.findIndex=Array.prototype.findIndex?function(e,t,r){return e.findIndex(t,r)}:function(e,t,r){r=void 0===r?e:r;for(var n=0,a=e.length;n<a;++n)if(t.call(r,e[n],n,e))return n;return-1},z.findNextWhere=function(e,t,r){z.isNullOrUndef(r)&&(r=-1);for(var n=r+1;n<e.length;n++){var a=e[n];if(t(a))return a}},z.findPreviousWhere=function(e,t,r){z.isNullOrUndef(r)&&(r=e.length);for(var n=r-1;n>=0;n--){var a=e[n];if(t(a))return a}},z.isNumber=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},z.almostEquals=function(e,t,r){return Math.abs(e-t)<r},z.almostWhole=function(e,t){var r=Math.round(e);return r-t<=e&&r+t>=e},z.max=function(e){return e.reduce(function(e,t){return isNaN(t)?e:Math.max(e,t)},Number.NEGATIVE_INFINITY)},z.min=function(e){return e.reduce(function(e,t){return isNaN(t)?e:Math.min(e,t)},Number.POSITIVE_INFINITY)},z.sign=Math.sign?function(e){return Math.sign(e)}:function(e){return 0===(e=+e)||isNaN(e)?e:e>0?1:-1},z.toRadians=function(e){return e*(Math.PI/180)},z.toDegrees=function(e){return e*(180/Math.PI)},z._decimalPlaces=function(e){if(z.isFinite(e)){for(var t=1,r=0;Math.round(e*t)/t!==e;)t*=10,r++;return r}},z.getAngleFromPoint=function(e,t){var r=t.x-e.x,n=t.y-e.y,a=Math.sqrt(r*r+n*n),i=Math.atan2(n,r);return i<-.5*Math.PI&&(i+=2*Math.PI),{angle:i,distance:a}},z.distanceBetweenPoints=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},z.aliasPixel=function(e){return e%2==0?0:.5},z._alignPixel=function(e,t,r){var n=e.currentDevicePixelRatio,a=r/2;return Math.round((t-a)*n)/n+a},z.splineCurve=function(e,t,r,n){var a=e.skip?t:e,i=t,o=r.skip?t:r,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=n*(u=isNaN(u)?0:u),h=n*(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)}}},z.EPSILON=Number.EPSILON||1e-14,z.splineCurveMonotone=function(e){var t,r,n,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(!(n=c[t]).model.skip){if(r=t>0?c[t-1]:null,(a=t<d-1?c[t+1]:null)&&!a.model.skip){var h=a.model.x-n.model.x;n.deltaK=0!==h?(a.model.y-n.model.y)/h:0}n.mK=!r||r.model.skip?n.deltaK:!a||a.model.skip?r.deltaK:this.sign(r.deltaK)!==this.sign(n.deltaK)?0:(r.deltaK+n.deltaK)/2}for(t=0;t<d-1;++t)a=c[t+1],(n=c[t]).model.skip||a.model.skip||(z.almostEquals(n.deltaK,0,this.EPSILON)?n.mK=a.mK=0:(i=n.mK/n.deltaK,o=a.mK/n.deltaK,(l=Math.pow(i,2)+Math.pow(o,2))<=9||(s=3/Math.sqrt(l),n.mK=i*s*n.deltaK,a.mK=o*s*n.deltaK)));for(t=0;t<d;++t)(n=c[t]).model.skip||(a=t<d-1?c[t+1]:null,(r=t>0?c[t-1]:null)&&!r.model.skip&&(n.model.controlPointPreviousX=n.model.x-(u=(n.model.x-r.model.x)/3),n.model.controlPointPreviousY=n.model.y-u*n.mK),a&&!a.model.skip&&(n.model.controlPointNextX=n.model.x+(u=(a.model.x-n.model.x)/3),n.model.controlPointNextY=n.model.y+u*n.mK))},z.nextItem=function(e,t,r){return r?t>=e.length-1?e[0]:e[t+1]:t>=e.length-1?e[e.length-1]:e[t+1]},z.previousItem=function(e,t,r){return r?t<=0?e[e.length-1]:e[t-1]:t<=0?e[0]:e[t-1]},z.niceNum=function(e,t){var r=Math.floor(z.log10(e)),n=e/Math.pow(10,r);return(t?n<1.5?1:n<3?2:n<7?5:10:n<=1?1:n<=2?2:n<=5?5:10)*Math.pow(10,r)},z.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)},z.getRelativePosition=function(e,t){var r,n,a=e.originalEvent||e,i=e.target||e.srcElement,o=i.getBoundingClientRect(),s=a.touches;s&&s.length>0?(r=s[0].clientX,n=s[0].clientY):(r=a.clientX,n=a.clientY);var l=parseFloat(z.getStyle(i,"padding-left")),u=parseFloat(z.getStyle(i,"padding-top")),c=parseFloat(z.getStyle(i,"padding-right")),d=parseFloat(z.getStyle(i,"padding-bottom")),h=o.bottom-o.top-u-d;return{x:r=Math.round((r-o.left-l)/(o.right-o.left-l-c)*i.width/t.currentDevicePixelRatio),y:n=Math.round((n-o.top-u)/h*i.height/t.currentDevicePixelRatio)}},z.getConstraintWidth=function(e){return r(e,"max-width","clientWidth")},z.getConstraintHeight=function(e){return r(e,"max-height","clientHeight")},z._calculatePadding=function(e,t,r){return(t=z.getStyle(e,t)).indexOf("%")>-1?r*parseInt(t,10)/100:parseInt(t,10)},z._getParentNode=function(e){var t=e.parentNode;return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t},z.getMaximumWidth=function(e){var t=z._getParentNode(e);if(!t)return e.clientWidth;var r=t.clientWidth,n=r-z._calculatePadding(t,"padding-left",r)-z._calculatePadding(t,"padding-right",r),a=z.getConstraintWidth(e);return isNaN(a)?n:Math.min(n,a)},z.getMaximumHeight=function(e){var t=z._getParentNode(e);if(!t)return e.clientHeight;var r=t.clientHeight,n=r-z._calculatePadding(t,"padding-top",r)-z._calculatePadding(t,"padding-bottom",r),a=z.getConstraintHeight(e);return isNaN(a)?n:Math.min(n,a)},z.getStyle=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,null).getPropertyValue(t)},z.retinaScale=function(e,t){var r=e.currentDevicePixelRatio=t||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==r){var n=e.canvas,a=e.height,i=e.width;n.height=a*r,n.width=i*r,e.ctx.scale(r,r),n.style.height||n.style.width||(n.style.height=a+"px",n.style.width=i+"px")}},z.fontString=function(e,t,r){return t+" "+e+"px "+r},z.longestText=function(e,t,r,n){var a=(n=n||{}).data=n.data||{},i=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(a=n.data={},i=n.garbageCollect=[],n.font=t),e.font=t;var o,s,l,u,c,d=0,h=r.length;for(o=0;o<h;o++)if(null!=(u=r[o])&&!0!==z.isArray(u))d=z.measureText(e,a,i,d,u);else if(z.isArray(u))for(s=0,l=u.length;s<l;s++)null==(c=u[s])||z.isArray(c)||(d=z.measureText(e,a,i,d,c));var f=i.length/2;if(f>r.length){for(o=0;o<f;o++)delete a[i[o]];i.splice(0,f)}return d},z.measureText=function(e,t,r,n,a){var i=t[a];return i||(i=t[a]=e.measureText(a).width,r.push(a)),i>n&&(n=i),n},z.numberOfLabelLines=function(e){var t=1;return z.each(e,function(e){z.isArray(e)&&e.length>t&&(t=e.length)}),t},z.color=x?function(e){return e instanceof CanvasGradient&&(e=R.global.defaultColor),x(e)}:function(e){return console.error("Color.js not found!"),e},z.getHoverColor=function(e){return e instanceof CanvasPattern||e instanceof CanvasGradient?e:z.color(e).saturate(.5).darken(.1).rgbString()}}(),Bt._adapters=Ht,Bt.Animation=G,Bt.animationService=Q,Bt.controllers=Be,Bt.DatasetController=ee,Bt.defaults=R,Bt.Element=H,Bt.elements=ye,Bt.Interaction=Ze,Bt.layouts=ot,Bt.platform=wt,Bt.plugins=kt,Bt.Scale=or,Bt.scaleService=St,Bt.Ticks=qt,Bt.Tooltip=It,Bt.helpers.each(Gr,function(e,t){Bt.scaleService.registerScaleType(t,e,e._defaults)}),mn)mn.hasOwnProperty(xn)&&Bt.plugins.register(mn[xn]);Bt.platform.initialize();var _n=Bt;return"undefined"!=typeof window&&(window.Chart=Bt),Bt.Chart=Bt,Bt.Legend=mn.legend._element,Bt.Title=mn.title._element,Bt.pluginService=Bt.plugins,Bt.PluginBase=Bt.Element.extend({}),Bt.canvasHelpers=Bt.helpers.canvas,Bt.layoutService=Bt.layouts,Bt.LinearScaleBase=cr,Bt.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],function(e){Bt[e]=function(t,r){return new Bt(t,Bt.helpers.merge(r||{},{type:e.charAt(0).toLowerCase()+e.slice(1)}))}}),_n}(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 r=e.options;r&&t&&Object.assign(r,t)}function setLabels(e,t){e.labels=t}function setDatasets(e,t,r=defaultDatasetIdKey){const n=[];e.datasets=t.map(t=>{const a=e.datasets.find(e=>e[r]===t[r]);return a&&t.data&&!n.includes(a)?(n.push(a),Object.assign(a,t),a):{...t}})}function cloneData(e,t=defaultDatasetIdKey){const r={labels:[],datasets:[]};return setLabels(r,e.labels),setDatasets(r,e.datasets,t),r}function ChartComponent(e,t){const{height:r=150,width:n=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(null),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__*/jsxRuntime.jsx("canvas",{ref:f,role:"img",height:r,width:n,...h,children: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:{}},r=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}},n=r,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 r=0,n=e.length;r<n;r++)t.call(null,e[r],r,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 r(r,n){t[n]=u(t[n])&&u(r)?e(t[n],r):u(r)?e({},r):i(r)?r.slice():r}for(var n=0,a=arguments.length;n<a;n++)d(arguments[n],r);return t},extend:function(e,t,r){return d(t,function(t,a){e[a]=r&&"function"==typeof t?n(t,r):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,r){if(!t)return e;var n;if(r)n=r(t);else if(f.isURLSearchParams(t))n=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))}))}),n=a.join("&")}if(n){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e},m=h;function y(){this.handlers=[]}y.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},y.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},y.prototype.forEach=function(e){m.forEach(this.handlers,function(t){null!==t&&e(t)})};var v=y,b=h,x=function(e,t,r,n,a){return e.config=t,r&&(e.code=r),e.request=n,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,r,n,a){var i=new Error(e);return w(i,t,r,n,a)},S=k,T=h,M=T.isStandardBrowserEnv()?{write:function(e,t,r,n,a,i){var o=[];o.push(e+"="+encodeURIComponent(t)),T.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),T.isString(n)&&o.push("path="+n),T.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(){}},O=h,A=["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,P=C.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=n(window.location.href),function(t){var r=C.isString(t)?n(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0};function D(e){this.message=e}D.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},D.prototype.__CANCEL__=!0;var E=D,$=h,F=M,I=g,R=P,N=k,j=_,L=E,V=h,z=function(e,t){b.forEach(e,function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])})},W=x,B={"Content-Type":"application/x-www-form-urlencoded"};function Y(e,t){!V.isUndefined(e)&&V.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var U,H={transitional:_,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(U=function(e){return new Promise(function(t,r){var n,a=e.data,i=e.headers,o=e.responseType;function s(){e.cancelToken&&e.cancelToken.unsubscribe(n),e.signal&&e.signal.removeEventListener("abort",n)}$.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 n="getAllResponseHeaders"in l?function(e){var t,r,n,a={};return e?(O.forEach(e.split("\n"),function(e){if(n=e.indexOf(":"),t=O.trim(e.substr(0,n)).toLowerCase(),r=O.trim(e.substr(n+1)),t){if(a[t]&&A.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([r]):a[t]?a[t]+", "+r:r}}),a):a}(l.getAllResponseHeaders()):null;(function(e,t,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(S("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)})(function(e){t(e),s()},function(e){r(e),s()},{data:o&&"text"!==o&&"json"!==o?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:n,config:e,request:l}),l=null}}if(l.open(e.method.toUpperCase(),I(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&&(r(N("Request aborted",e,"ECONNABORTED",l)),l=null)},l.onerror=function(){r(N("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),r(N(t,e,(e.transitional||j).clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",l)),l=null},$.isStandardBrowserEnv()){var f=(e.withCredentials||R(d))&&e.xsrfCookieName?F.read(e.xsrfCookieName):void 0;f&&(i[e.xsrfHeaderName]=f)}"setRequestHeader"in l&&$.forEach(i,function(e,t){void 0===a&&"content-type"===t.toLowerCase()?delete i[t]:l.setRequestHeader(t,e)}),$.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)&&(n=function(e){l&&(r(!e||e&&e.type?new L("canceled"):e),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(n),e.signal&&(e.signal.aborted?n():e.signal.addEventListener("abort",n))),a||(a=null),l.send(a)})}),U),transformRequest:[function(e,t){return z(t,"Accept"),z(t,"Content-Type"),V.isFormData(e)||V.isArrayBuffer(e)||V.isBuffer(e)||V.isStream(e)||V.isFile(e)||V.isBlob(e)?e:V.isArrayBufferView(e)?e.buffer:V.isURLSearchParams(e)?(Y(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):V.isObject(e)||t&&"application/json"===t["Content-Type"]?(Y(t,"application/json"),function(e){if(V.isString(e))try{return(0,JSON.parse)(e),V.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||H.transitional,r=!(t&&t.silentJSONParsing)&&"json"===this.responseType;if(r||t&&t.forcedJSONParsing&&V.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw W(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, */*"}}};V.forEach(["delete","get","head"],function(e){H.headers[e]={}}),V.forEach(["post","put","patch"],function(e){H.headers[e]=V.merge(B)});var q=H,G=h,Q=q,Z=function(e){return!(!e||!e.__CANCEL__)},J=h,K=function(e,t,r){var n=this||Q;return G.forEach(r,function(r){e=r.call(n,e,t)}),e},X=Z,ee=q,te=E;function re(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new te("canceled")}var ne=h,ae=function(e,t){t=t||{};var r={};function n(e,t){return ne.isPlainObject(e)&&ne.isPlainObject(t)?ne.merge(e,t):ne.isPlainObject(t)?ne.merge({},t):ne.isArray(t)?t.slice():t}function a(r){return ne.isUndefined(t[r])?ne.isUndefined(e[r])?void 0:n(void 0,e[r]):n(e[r],t[r])}function i(e){if(!ne.isUndefined(t[e]))return n(void 0,t[e])}function o(r){return ne.isUndefined(t[r])?ne.isUndefined(e[r])?void 0:n(void 0,e[r]):n(void 0,t[r])}function s(r){return r in t?n(e[r],t[r]):r in e?n(void 0,e[r]):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 ne.forEach(Object.keys(e).concat(Object.keys(t)),function(e){var t=l[e]||a,n=t(e);ne.isUndefined(n)&&t!==s||(r[e]=n)}),r},ie="0.26.1",oe=ie,se={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){se[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});var le={};se.transitional=function(e,t,r){function n(e,t){return"[Axios v"+oe+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,a,i){if(!1===e)throw new Error(n(a," has been removed"+(t?" in "+t:"")));return t&&!le[a]&&(le[a]=!0,console.warn(n(a," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,a,i)}};var ue={assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),a=n.length;a-- >0;){var i=n[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!==r)throw Error("Unknown option "+i)}},validators:se},ce=h,de=g,he=v,fe=function(e){return re(e),e.headers=e.headers||{},e.data=K.call(e,e.data,e.headers,e.transformRequest),e.headers=J.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),J.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||ee.adapter)(e).then(function(t){return re(e),t.data=K.call(e,t.data,t.headers,e.transformResponse),t},function(t){return X(t)||(re(e),t&&t.response&&(t.response.data=K.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})},pe=ae,ge=ue,me=ge.validators;function ye(e){this.defaults=e,this.interceptors={request:new he,response:new he}}ye.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 r=t.transitional;void 0!==r&&ge.assertOptions(r,{silentJSONParsing:me.transitional(me.boolean),forcedJSONParsing:me.transitional(me.boolean),clarifyTimeoutError:me.transitional(me.boolean)},!1);var n=[],a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,n.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,n),s=s.concat(o),i=Promise.resolve(t);s.length;)i=i.then(s.shift(),s.shift());return i}for(var l=t;n.length;){var u=n.shift(),c=n.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},ye.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){ye.prototype[e]=function(t,r){return this.request(pe(r||{},{method:e,url:t,data:(r||{}).data}))}}),ce.forEach(["post","put","patch"],function(e){ye.prototype[e]=function(t,r,n){return this.request(pe(n||{},{method:e,url:t,data:r}))}});var ve=ye,be=E;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 r=this;this.promise.then(function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}}),this.promise.then=function(e){var t,n=new Promise(function(e){r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e){r.reason||(r.reason=new be(e),t(r.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=r,Te=ve,Me=ae,Oe=function e(t){var r=new Te(t),n=Se(Te.prototype.request,r);return ke.extend(n,Te.prototype,r),ke.extend(n,r),n.create=function(r){return e(Me(t,r))},n}(q);Oe.Axios=Te,Oe.Cancel=E,Oe.CancelToken=_e,Oe.isCancel=Z,Oe.VERSION=ie,Oe.all=function(e){return Promise.all(e)},Oe.spread=function(e){return function(t){return e.apply(null,t)}},Oe.isAxiosError=function(e){return we.isObject(e)&&!0===e.isAxiosError},t.exports=Oe,t.exports.default=Oe;var Ae,Ce=t.exports;e.ResponseType=void 0,(Ae=e.ResponseType||(e.ResponseType={})).MATRIX="matrix",Ae.VECTOR="vector",Ae.SCALAR="scalar",Ae.STRING="string";class Pe{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__,r=Object.assign({},e);return delete r.__name__,new Pe(t,r)}toString(){return(this.name?this.name:"")+"{"+Object.keys(this.labels).map(e=>e+'="'+this.labels[e]+'"').join(", ")+"}"}}class De{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]),r=parseFloat(e[1]);return new De(t,r)}toString(){return this.time+": "+this.value}}class Ee{constructor(e,t){this.metric=e,this.values=t}static fromJSON(e){const t=e.metric?Pe.fromJSON(e.metric):null,r=e.values.map(De.fromJSON);return new Ee(t,r)}}class $e{constructor(e,t){this.metric=e,this.value=t}static fromJSON(e){const t=e.metric?Pe.fromJSON(e.metric):null,r=De.fromJSON(e.value);return new $e(t,r)}}class Fe{constructor(e,t){this.resultType=e,this.result=t}static fromJSON(t){const r=t.resultType;let n=null;switch(r){case e.ResponseType.MATRIX:n=t.result.map(Ee.fromJSON);break;case e.ResponseType.VECTOR:n=t.result.map($e.fromJSON);break;case e.ResponseType.SCALAR:case e.ResponseType.STRING:n=t.result;break;default:throw new Error(`Unexpected resultType: ${r}`)}return new Fe(r,n)}}class Ie{constructor(e,t,r,n,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(r&&"string"!=typeof r)throw new Error(`Unexpected format for scrapePool. Got ${typeof r} instead of string`);if(n&&"string"!=typeof n)throw new Error(`Unexpected format for scrapeUrl. Got ${typeof n} 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=r,this.scrapeUrl=n,this.lastError=a,this.lastScrape=i,this.lastScrapeDuration=o,this.health=s}static fromJSON(e){return new Ie(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 Re{constructor(e,t,r,n,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(r&&"object"!=typeof r)throw new Error(`Unexpected format for labels. Got ${typeof r} 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=r,this.state=n,this.value=a}static fromJSON(e){return new Re(e.activeAt?new Date(e.activeAt):null,e.annotations,e.labels,e.state,e.value?parseFloat(e.value):null)}}class Ne{constructor(e,t,r,n,a,i,o,s){this.alerts=e,this.annotations=t,this.duration=r,this.health=n,this.labels=a,this.name=i,this.query=o,this.type=s}static fromJSON(e){return new Ne(e.alerts?e.alerts.map(Re.fromJSON):[],e.annotations,e.duration,e.health,e.labels,e.name,e.query,e.type)}}class je{constructor(e,t,r,n){this.rules=e,this.file=t,this.interval=r,this.name=n}static fromJSON(e){return new je(e.rules?e.rules.map(Ne.fromJSON):[],e.file,e.interval,e.name)}}class Le{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=Re,e.InstantVector=$e,e.Metric=Pe,e.PrometheusConnectionOptions=Le,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,r])=>(null!=r&&(r instanceof Array?r.filter(e=>null!=e).forEach(r=>e.append(`${t}[]`,r)):e.append(t,r)),e),new URLSearchParams),!(e=e||new Le).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,r,n){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(r),data:this.formatPromQlParams(n),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 r=e.data;if(!r||null==r.status)throw{status:"error",errorType:"client_error",error:"unexpected client error"};if(t)throw e;return r.data}formatTimeToPrometheus(e,t){var r;if(e||(e=t),"number"==typeof e)return e/1e3;if("object"==typeof e&&"Date"==(null===(r=null==e?void 0:e.constructor)||void 0===r?void 0:r.name))return e.getTime()/1e3;throw new Error("Wrong time format. Expected number or Date.")}instantQuery(e,t,r){const n={query:e,time:this.formatTimeToPrometheus(t,new Date),timeout:r};return(this.options.preferPost?this.request("POST","query",null,n):this.request("GET","query",n)).then(e=>Fe.fromJSON(e))}rangeQuery(e,t,r,n,a){const i={query:e,start:this.formatTimeToPrometheus(t),end:this.formatTimeToPrometheus(r),step:n,timeout:a};return(this.options.preferPost?this.request("POST","query_range",null,i):this.request("GET","query_range",i)).then(e=>Fe.fromJSON(e))}series(e,t,r){const n={match:this.listifyIfNeeded(e),start:this.formatTimeToPrometheus(t),end:this.formatTimeToPrometheus(r)};return(this.options.preferPost?this.request("POST","series",null,n):this.request("GET","series",n)).then(e=>e.map(Pe.fromJSON))}labelNames(e,t,r){const n={match:this.listifyIfNeeded(e),start:this.formatTimeToPrometheus(t),end:this.formatTimeToPrometheus(r)};return this.options.preferPost?this.request("POST","labels",null,n):this.request("GET","labels",n)}labelValues(e,t,r,n){const a={match:this.listifyIfNeeded(t),start:this.formatTimeToPrometheus(r,new Date),end:this.formatTimeToPrometheus(n,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(Ie.fromJSON):[],droppedTargets:e.droppedTargets?e.droppedTargets.map(Ie.fromJSON):[]}))}targetsMetadata(e,t,r){return this.request("GET","targets/metadata",{match_target:e,metric:t,limit:r})}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(je.fromJSON))}alerts(){return this.request("GET","alerts").then(e=>(e.alerts?e.alerts:[]).map(Re.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,r){const n={match:this.listifyIfNeeded(e),start:this.formatTimeToPrometheus(t),end:this.formatTimeToPrometheus(r)};return this.request("POST","admin/tsdb/delete_series",n)}adminCleanTombstones(){return this.request("POST","admin/tsdb/clean_tombstones")}},e.QueryResult=Fe,e.RangeVector=Ee,e.Rule=Ne,e.RuleGroup=je,e.SampleValue=De,e.Target=Ie,Object.defineProperty(e,"__esModule",{value:!0})}(t)}(0,e.exports);var t={getPrometheusStepAuto:(e,t,r)=>{const n=(t.getTime()-e.getTime())/1e3,a=25*Math.floor(n/r);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,r,n,a,i)=>{const o=null!=r.find(e=>"string"==typeof e),s=t&&o?new e.exports.PrometheusDriver(t):null;return r.map(t=>"string"==typeof t?s.rangeQuery(t,n,a,i):t(n,a,i).then(t=>e.exports.QueryResult.fromJSON(t)))}};class r{constructor(){this.message="No data to display",this.font="16px normal 'Helvetica Nueue'",this.textAlign="center",this.textBaseline="middle",this.direction="ltr"}}class n{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 r,this.errorMsg=new n,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,r){const n=t.metric.toString();return e.findInLabelMap&&e.findInLabelMap(t.metric)||n}function s(e,t,r){const n=e.fill?e.backgroundColor[r%e.backgroundColor.length]:"transparent";return e.findInBackgroundColorMap&&e.findInBackgroundColorMap(t.metric)||n}function l(e,t,r){const n=e.borderColor[r%e.borderColor.length];return e.findInBorderColorMap&&e.findInBorderColorMap(t.metric)||n}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 r=Object.assign(new a,t);r.assertPluginOptions(),r&&r.timeRange&&(r.timeRange.msUpdateInterval?e["datasource-prometheus"].updateInterval=setInterval(()=>{e.update()},r.timeRange.msUpdateInterval):e.update())}beforeUpdate(e,r){if(e["datasource-prometheus"]&&1==e["datasource-prometheus"].loading)return;const n=Object.assign(new a,r),u=n.prometheus,c=n.getQueries(),{start:d,end:h}=t.getStartAndEndDates(n.timeRange),f=n.timeRange.step||t.getPrometheusStepAuto(d,h,e.width),p=n.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 y={};if(e.data.datasets.length>0)for(let t in e.data.datasets){const r=e.data.datasets[t];let n=0;for(let e in r._meta)n=e;y[r.label]=!e.isDatasetVisible(r._meta[n].index)}const v=e.config.options.scales.yAxes;return e["datasource-prometheus"].loading=!0,Promise.all(m).then(t=>{const r=t.reduce((e,t,r)=>{const a=e.length,i=t.result.map((e,t)=>({yAxisID:v&&v.length>0?v[r%v.length].id:null,tension:n.tension,cubicInterpolationMode:n.cubicInterpolationMode||"default",stepped:n.stepped,fill:n.fill||!1,label:o(n,e),data:e.values.map((e,t)=>({t:e.time,y:e.value})),backgroundColor:s(n,e,a+t),borderColor:l(n,e,a+t),borderWidth:n.borderWidth,hidden:y[o(n,e)]||!1}));return e.concat(...i)},[]);e.data.datasets=r,e.data.datasets.length>0&&(n.fillGaps&&function(e,t,r,n,a){let i=a.timeRange.minStep||n;i=i>=n?i:n,e.data.datasets.forEach((n,a)=>{for(let e=n.data.length-2;e>0;e--)if(n.data[e+1].t-n.data[e].t>1100*i)for(let t=(n.data[e+1].t-n.data[e].t)/(1e3*i);t>1;t--){const t={t:new Date(n.data[e+1].t.getTime()-1e3*i),v:Number.NaN};n.data.splice(e+1,0,t)}if(Math.abs(t.getTime()-n.data[0].t)>1100*i)for(let r=Math.abs(t.getTime()-n.data[0].t)/(1e3*i);r>1;r--)e.data.datasets[a].data.unshift({t:new Date(n.data[0].t.getTime()-1e3*i),v:Number.NaN});if(Math.abs(r.getTime()-n.data[n.data.length-1].t)>1100*i)for(let t=Math.abs(r.getTime()-n.data[n.data.length-1].t)/(1e3*i);t>1;t--)e.data.datasets[a].data.push({t:new Date(n.data[e.data.datasets[a].data.length-1].t.getTime()+1e3*i),v:Number.NaN})})}(e,d,h,g,n),n.dataSetHook&&(e.data.datasets=n.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 r;const n=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=n.errorMsg.direction,t.textAlign=n.errorMsg.textAlign,t.textBaseline=n.errorMsg.textBaseline,t.font="16px normal 'Helvetica Nueue'",t.fillText((null===(r=n.errorMsg)||void 0===r?void 0:r.message)||e["datasource-prometheus"].error,a/2,i/2),void t.restore()}if(0==e.data.datasets.length){const t=e.ctx,r=e.width,a=e.height;return e.clear(),t.save(),t.direction=n.noDataMsg.direction,t.textAlign=n.noDataMsg.textAlign,t.textBaseline=n.noDataMsg.textBaseline,t.font=n.noDataMsg.font,t.fillText(n.noDataMsg.message,r/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,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function arrayMap(e,t){for(var r=-1,n=e?e.length:0,a=Array(n);++r<n;)a[r]=t(e[r],r,e);return a}function arrayPush(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];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,r,n,a){var i=-1,o=e.length;for(r||(r=isFlattenable),a||(a=[]);++i<o;){var s=e[i];t>0&&r(s)?t>1?baseFlatten(s,t-1,r,n,a):arrayPush(a,s):n||(a[a.length]=s)}return a}function basePick(e,t){return basePickBy(e=Object(e),t,function(t,r){return r in e})}function basePickBy(e,t,r){for(var n=-1,a=t.length,i={};++n<a;){var o=t[n],s=e[o];r(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 r=arguments,n=-1,a=nativeMax(r.length-t,0),i=Array(a);++n<a;)i[n]=r[t+n];n=-1;for(var o=Array(t+1);++n<t;)o[n]=r[n];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$1(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$1(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){var r;e.exports=(r=moment$1,function(e){function t(n){if(r[n])return r[n].exports;var a=r[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=3)}([function(e,t,r){var n=r(5)();e.exports=function(e){return e!==n&&null!==e}},function(e,t,r){e.exports=r(18)()?Symbol:r(20)},function(e,t){e.exports=r},function(e,t,r){function n(e){return e&&e.__esModule?e:{default:e}}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,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 r=[],n=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(e){a=!0,i=e}finally{try{!n&&s.return&&s.return()}finally{if(a)throw i}}return r}(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 r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();t.extendMoment=function(e){return e.range=function(t,r){return"string"==typeof t&&d.hasOwnProperty(t)?new h(e(this).startOf(t),e(this).endOf(t)):new h(t,r)},e.rangeFromInterval=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e();if(e.isMoment(n)||(n=e(n)),!n.isValid())throw new Error("Invalid date.");var a=n.clone().add(r,t),i=[];return i.push(e.min(n,a)),i.push(e.max(n,a)),new h(i)},e.rangeFromISOString=function(t){var r=i(t),n=e.parseZone(r[0]),a=e.parseZone(r[1]);return new h(n,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=n(r(2)),c=n(r(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,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=t,a=r;if(1===arguments.length||void 0===r)if("object"===(void 0===t?"undefined":s(t))&&2===t.length){var l=o(t,2);n=l[0],a=l[1]}else if("string"==typeof t){var c=i(t),d=o(c,2);n=d[0],a=d[1]}this.start=(0,u.default)(n||0===n?n:-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),r=this.end.isSame(e.start);return t&&e.start.valueOf()<=this.start.valueOf()||r&&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},r=this;return a({},c.default.iterator,function(){var n=t.step||1,a=Math.abs(r.start.diff(r.end,e))/n,i=t.excludeEnd||!1,o=0;return t.hasOwnProperty("exclusive")&&(i=t.exclusive),{next:function(){var t=r.start.clone().add(o*n,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},r=this,n=t.step||1,i=this.valueOf()/e.valueOf()/n,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)(r.start.valueOf()+e.valueOf()*l*n),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 r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{excludeStart:!1,excludeEnd:!1},n=this.start.valueOf(),a=this.end.valueOf(),i=t.valueOf(),o=t.valueOf(),s=r.excludeStart||!1,l=r.excludeEnd||!1;return r.hasOwnProperty("exclusive")&&(s=l=r.exclusive),t instanceof e&&(i=t.start.valueOf(),o=t.end.valueOf()),(n<i||n<=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(),r=this.end.valueOf(),n=e.start.valueOf(),a=e.end.valueOf(),i=n==a;if(t==r){if(t==n||t==a)return null;if(t>n&&t<a)return this.clone()}else if(i){if(n==t||n==r)return null;if(n>t&&n<r)return new this.constructor(n,n)}return t<=n&&n<r&&r<a?new this.constructor(n,r):n<t&&t<a&&a<=r?new this.constructor(t,a):n<t&&t<=r&&r<a?this.clone():t<=n&&n<=a&&a<=r?new this.constructor(n,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},r=null!==this.intersect(e);return t.adjacent&&!r?this.adjacent(e):r}},{key:"reverseBy",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{excludeStart:!1,step:1},r=this;return a({},c.default.iterator,function(){var n=t.step||1,a=Math.abs(r.start.diff(r.end,e))/n,i=t.excludeStart||!1,o=0;return t.hasOwnProperty("exclusive")&&(i=t.exclusive),{next:function(){var t=r.end.clone().subtract(o*n,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},r=this,n=t.step||1,i=this.valueOf()/e.valueOf()/n,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)(r.end.valueOf()-e.valueOf()*l*n),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(),r=this.end.valueOf(),n=e.start.valueOf(),a=e.end.valueOf();return null===this.intersect(e)?[this]:n<=t&&t<r&&r<=a?[]:n<=t&&t<a&&a<r?[new this.constructor(a,r)]:t<n&&n<r&&r<=a?[new this.constructor(t,n)]:t<n&&n<a&&a<r?[new this.constructor(t,n),new this.constructor(a,r)]:t<n&&n<r&&a<r?[new this.constructor(t,n),new this.constructor(n,r)]:[]}},{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,r){var n,a=r(6),i=r(13),o=r(9),s=r(15);n=e.exports=function(e,t){var r,n,o,l,u;return arguments.length<2||"string"!=typeof e?(l=t,t=e,e=null):l=arguments[2],null==e?(r=o=!0,n=!1):(r=s.call(e,"c"),n=s.call(e,"e"),o=s.call(e,"w")),u={value:t,configurable:r,enumerable:n,writable:o},l?a(i(l),u):u},n.gs=function(e,t,r){var n,l,u,c;return"string"!=typeof e?(u=r,r=t,t=e,e=null):u=arguments[3],null==t?t=void 0:o(t)?null==r?r=void 0:o(r)||(u=r,r=void 0):(u=t,t=r=void 0),null==e?(n=!0,l=!1):(n=s.call(e,"c"),l=s.call(e,"e")),c={get:t,set:r,configurable:n,enumerable:l},u?a(i(u),c):c}},function(e,t,r){e.exports=function(){}},function(e,t,r){e.exports=r(7)()?Object.assign:r(8)},function(e,t,r){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,r){var n=r(10),a=r(14),i=Math.max;e.exports=function(e,t){var r,o,s,l=i(arguments.length,2);for(e=Object(a(e)),s=function(n){try{e[n]=t[n]}catch(e){r||(r=e)}},o=1;o<l;++o)n(t=arguments[o]).forEach(s);if(void 0!==r)throw r;return e}},function(e,t,r){e.exports=function(e){return"function"==typeof e}},function(e,t,r){e.exports=r(11)()?Object.keys:r(12)},function(e,t,r){e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},function(e,t,r){var n=r(0),a=Object.keys;e.exports=function(e){return a(n(e)?Object(e):e)}},function(e,t,r){var n=r(0),a=Array.prototype.forEach,i=Object.create;e.exports=function(e){var t=i(null);return a.call(arguments,function(e){n(e)&&function(e,t){var r;for(r in e)t[r]=e[r]}(Object(e),t)}),t}},function(e,t,r){var n=r(0);e.exports=function(e){if(!n(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,r){e.exports=r(16)()?String.prototype.contains:r(17)},function(e,t,r){var n="razdwatrzy";e.exports=function(){return"function"==typeof n.contains&&!0===n.contains("dwa")&&!1===n.contains("foo")}},function(e,t,r){var n=String.prototype.indexOf;e.exports=function(e){return n.call(this,e,arguments[1])>-1}},function(e,t,r){var n={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!!n[typeof Symbol.iterator]&&!!n[typeof Symbol.toPrimitive]&&!!n[typeof Symbol.toStringTag]}},function(e,t,r){e.exports=function(e){return!!e&&("symbol"==typeof e||!!e.constructor&&"Symbol"===e.constructor.name&&"Symbol"===e[e.constructor.toStringTag])}},function(e,t,r){var n,a,i,o,s=r(4),l=r(21),u=Object.create,c=Object.defineProperties,d=Object.defineProperty,h=Object.prototype,f=u(null);if("function"==typeof Symbol){n=Symbol;try{String(n()),o=!0}catch(e){}}var p=function(){var e=u(null);return function(t){for(var r,n,a=0;e[t+(a||"")];)++a;return e[t+=a||""]=!0,d(h,r="@@"+t,s.gs(null,function(e){n||(n=!0,d(this,r,s(e)),n=!1)})),r}}();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 r;if(this instanceof e)throw new TypeError("Symbol is not a constructor");return o?n(t):(r=u(i.prototype),t=void 0===t?"":String(t),c(r,{__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("",n&&n.hasInstance||a("hasInstance")),isConcatSpreadable:s("",n&&n.isConcatSpreadable||a("isConcatSpreadable")),iterator:s("",n&&n.iterator||a("iterator")),match:s("",n&&n.match||a("match")),replace:s("",n&&n.replace||a("replace")),search:s("",n&&n.search||a("search")),species:s("",n&&n.species||a("species")),split:s("",n&&n.split||a("split")),toPrimitive:s("",n&&n.toPrimitive||a("toPrimitive")),toStringTag:s("",n&&n.toStringTag||a("toStringTag")),unscopables:s("",n&&n.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,r){var n=r(19);e.exports=function(e){if(!n(e))throw new TypeError(e+" is not a symbol");return e}}]))}),moment=momentRange.extendMoment(moment$1),getQueriesTimeRange=function(e,t){var r=moment(),n=andoncloudDashboardToolkit.normalizeShifts(null==t?void 0:t.shifts,r),a=andoncloudDashboardToolkit.getCurrentShift(r,n),i=andoncloudDashboardToolkit.getRecentShift(r,n);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}};const colors$1={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]};for(const e in colors$1)Object.freeze(colors$1[e]);var colorNames=Object.freeze(colors$1);const reverseNames=Object.create(null);for(const e in colorNames)Object.hasOwn(colorNames,e)&&(reverseNames[colorNames[e]]=e);const cs={to:{},get:{}};function clamp(e,t,r){return Math.min(Math.max(t,e),r)}function hexDouble(e){const t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}cs.get=function(e){let t,r;switch(e.slice(0,3).toLowerCase()){case"hsl":t=cs.get.hsl(e),r="hsl";break;case"hwb":t=cs.get.hwb(e),r="hwb";break;default:t=cs.get.rgb(e),r="rgb"}return t?{model:r,value:t}:null},cs.get.rgb=function(e){if(!e)return null;let t,r,n,a=[0,0,0,1];if(t=e.match(/^#([a-f\d]{6})([a-f\d]{2})?$/i)){for(n=t[2],t=t[1],r=0;r<3;r++){const e=2*r;a[r]=Number.parseInt(t.slice(e,e+2),16)}n&&(a[3]=Number.parseInt(n,16)/255)}else if(t=e.match(/^#([a-f\d]{3,4})$/i)){for(t=t[1],n=t[3],r=0;r<3;r++)a[r]=Number.parseInt(t[r]+t[r],16);n&&(a[3]=Number.parseInt(n+n,16)/255)}else if(t=e.match(/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i)){for(r=0;r<3;r++)a[r]=Number.parseFloat(t[r+1]);t[4]&&(a[3]=t[5]?.01*Number.parseFloat(t[4]):Number.parseFloat(t[4]))}else{if(!(t=e.match(/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i)))return(t=e.toLowerCase().match(/^(\w+)$/))?"transparent"===t[1]?[0,0,0,0]:Object.hasOwn(colorNames,t[1])?(a=colorNames[t[1]].slice(),a[3]=1,a):null:null;for(r=0;r<3;r++)a[r]=Math.round(2.55*Number.parseFloat(t[r+1]));t[4]&&(a[3]=t[5]?.01*Number.parseFloat(t[4]):Number.parseFloat(t[4]))}for(r=0;r<3;r++)a[r]=clamp(a[r],0,255);return a[3]=clamp(a[3],0,1),a},cs.get.hsl=function(e){if(!e)return null;const 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*)?(?:e[+-]?\d+)?)\s*)?\)$/i);if(t){const e=Number.parseFloat(t[4]);return[(Number.parseFloat(t[1])%360+360)%360,clamp(Number.parseFloat(t[2]),0,100),clamp(Number.parseFloat(t[3]),0,100),clamp(Number.isNaN(e)?1:e,0,1)]}return null},cs.get.hwb=function(e){if(!e)return null;const t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i);if(t){const e=Number.parseFloat(t[4]);return[(Number.parseFloat(t[1])%360+360)%360,clamp(Number.parseFloat(t[2]),0,100),clamp(Number.parseFloat(t[3]),0,100),clamp(Number.isNaN(e)?1:e,0,1)]}return null},cs.to.hex=function(...e){return"#"+hexDouble(e[0])+hexDouble(e[1])+hexDouble(e[2])+(e[3]<1?hexDouble(Math.round(255*e[3])):"")},cs.to.rgb=function(...e){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]+")"},cs.to.rgb.percent=function(...e){const t=Math.round(e[0]/255*100),r=Math.round(e[1]/255*100),n=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+t+"%, "+r+"%, "+n+"%)":"rgba("+t+"%, "+r+"%, "+n+"%, "+e[3]+")"},cs.to.hsl=function(...e){return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},cs.to.hwb=function(...e){let t="";return e.length>=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},cs.to.keyword=function(...e){return reverseNames[e.slice(0,3)]};const colors={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]};for(const e in colors)Object.freeze(colors[e]);var cssKeywords=Object.freeze(colors);const reverseKeywords={};for(const e of Object.keys(cssKeywords))reverseKeywords[cssKeywords[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"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},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"]}},LAB_FT=(6/29)**3;function srgbNonlinearTransform(e){return Math.min(Math.max(0,e>.0031308?1.055*e**(1/2.4)-.055:12.92*e),1)}function srgbNonlinearTransformInv(e){return e>.04045?((e+.055)/1.055)**2.4:e/12.92}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:r}=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:r})}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(convert$1);for(let{length:r}=t,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}function deriveBFS(e){const t=buildGraph(),r=[e];for(t[e].distance=0;r.length>0;){const e=r.pop(),n=Object.keys(convert$1[e]);for(let{length:a}=n,i=0;i<a;i++){const a=n[i],o=t[a];-1===o.distance&&(o.distance=t[e].distance+1,o.parent=e,r.unshift(a))}}return t}function link(e,t){return function(r){return t(e(r))}}function wrapConversion(e,t){const r=[t[e].parent,e];let n=convert$1[t[e].parent][e],a=t[e].parent;for(;t[a].parent;)r.unshift(t[a].parent),n=link(convert$1[t[a].parent][a],n),a=t[a].parent;return n.conversion=r,n}function route(e){const t=deriveBFS(e),r={},n=Object.keys(t);for(let{length:e}=n,a=0;a<e;a++){const e=n[a];null!==t[e].parent&&(r[e]=wrapConversion(e,t))}return r}convert$1.rgb.hsl=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,a=Math.min(t,r,n),i=Math.max(t,r,n),o=i-a;let s,l;switch(i){case a:s=0;break;case t:s=(r-n)/o;break;case r:s=2+(n-t)/o;break;case n:s=4+(t-r)/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,r,n,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};if(0===c)a=0,i=0;else{switch(i=c/u,t=d(o),r=d(s),n=d(l),u){case o:a=n-r;break;case s:a=1/3+t-n;break;case l:a=2/3+r-t}a<0?a+=1:a>1&&(a-=1)}return[360*a,100*i,100*u]},convert$1.rgb.hwb=function(e){const t=e[0],r=e[1];let n=e[2];const a=convert$1.rgb.hsl(e)[0],i=1/255*Math.min(t,Math.min(r,n));return n=1-1/255*Math.max(t,Math.max(r,n)),[a,100*i,100*n]},convert$1.rgb.oklab=function(e){const t=srgbNonlinearTransformInv(e[0]/255),r=srgbNonlinearTransformInv(e[1]/255),n=srgbNonlinearTransformInv(e[2]/255),a=Math.cbrt(.4122214708*t+.5363325363*r+.0514459929*n),i=Math.cbrt(.2119034982*t+.6806995451*r+.1073969566*n),o=Math.cbrt(.0883024619*t+.2817188376*r+.6299787005*n);return[100*(.2104542553*a+.793617785*i-.0040720468*o),100*(1.9779984951*a-2.428592205*i+.4505937099*o),100*(.0259040371*a+.7827717662*i-.808675766*o)]},convert$1.rgb.cmyk=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,a=Math.min(1-t,1-r,1-n);return[100*((1-t-a)/(1-a)||0),100*((1-r-a)/(1-a)||0),100*((1-n-a)/(1-a)||0),100*a]},convert$1.rgb.keyword=function(e){const t=reverseKeywords[e];if(t)return t;let r,n=Number.POSITIVE_INFINITY;for(const t of Object.keys(cssKeywords)){const a=comparativeDistance(e,cssKeywords[t]);a<n&&(n=a,r=t)}return r},convert$1.keyword.rgb=function(e){return[...cssKeywords[e]]},convert$1.rgb.xyz=function(e){const t=srgbNonlinearTransformInv(e[0]/255),r=srgbNonlinearTransformInv(e[1]/255),n=srgbNonlinearTransformInv(e[2]/255);return[100*(.4124564*t+.3575761*r+.1804375*n),100*(.2126729*t+.7151522*r+.072175*n),100*(.0193339*t+.119192*r+.9503041*n)]},convert$1.rgb.lab=function(e){const t=convert$1.rgb.xyz(e);let r=t[0],n=t[1],a=t[2];return r/=95.047,n/=100,a/=108.883,r=r>LAB_FT?r**(1/3):7.787*r+16/116,n=n>LAB_FT?n**(1/3):7.787*n+16/116,a=a>LAB_FT?a**(1/3):7.787*a+16/116,[116*n-16,500*(r-n),200*(n-a)]},convert$1.hsl.rgb=function(e){const t=e[0]/360,r=e[1]/100,n=e[2]/100;let a,i;if(0===r)return i=255*n,[i,i,i];const o=n<.5?n*(1+r):n+r-n*r,s=2*n-o,l=[0,0,0];for(let e=0;e<3;e++)a=t+1/3*-(e-1),a<0&&a++,a>1&&a--,i=6*a<1?s+6*(o-s)*a:2*a<1?o:3*a<2?s+(o-s)*(2/3-a)*6:s,l[e]=255*i;return l},convert$1.hsl.hsv=function(e){const t=e[0];let r=e[1]/100,n=e[2]/100,a=r;const i=Math.max(n,.01);return n*=2,r*=n<=1?n:2-n,a*=i<=1?i:2-i,[t,100*(0===n?2*a/(i+a):2*r/(n+r)),(n+r)/2*100]},convert$1.hsv.rgb=function(e){const t=e[0]/60,r=e[1]/100;let n=e[2]/100;const a=Math.floor(t)%6,i=t-Math.floor(t),o=255*n*(1-r),s=255*n*(1-r*i),l=255*n*(1-r*(1-i));switch(n*=255,a){case 0:return[n,l,o];case 1:return[s,n,o];case 2:return[o,n,l];case 3:return[o,s,n];case 4:return[l,o,n];case 5:return[n,o,s]}},convert$1.hsv.hsl=function(e){const t=e[0],r=e[1]/100,n=e[2]/100,a=Math.max(n,.01);let i,o;o=(2-r)*n;const s=(2-r)*a;return i=r*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 r=e[1]/100,n=e[2]/100;const a=r+n;let i;a>1&&(r/=a,n/=a);const o=Math.floor(6*t),s=1-n;i=6*t-o,1&o&&(i=1-i);const l=r+i*(s-r);let u,c,d;switch(o){default:case 6:case 0:u=s,c=l,d=r;break;case 1:u=l,c=s,d=r;break;case 2:u=r,c=s,d=l;break;case 3:u=r,c=l,d=s;break;case 4:u=l,c=r,d=s;break;case 5:u=s,c=r,d=l}return[255*u,255*c,255*d]},convert$1.cmyk.rgb=function(e){const t=e[1]/100,r=e[2]/100,n=e[3]/100;return[255*(1-Math.min(1,e[0]/100*(1-n)+n)),255*(1-Math.min(1,t*(1-n)+n)),255*(1-Math.min(1,r*(1-n)+n))]},convert$1.xyz.rgb=function(e){const t=e[0]/100,r=e[1]/100,n=e[2]/100;let a,i,o;return a=3.2404542*t+-1.5371385*r+-.4985314*n,i=-.969266*t+1.8760108*r+.041556*n,o=.0556434*t+-.2040259*r+1.0572252*n,a=srgbNonlinearTransform(a),i=srgbNonlinearTransform(i),o=srgbNonlinearTransform(o),[255*a,255*i,255*o]},convert$1.xyz.lab=function(e){let t=e[0],r=e[1],n=e[2];return t/=95.047,r/=100,n/=108.883,t=t>LAB_FT?t**(1/3):7.787*t+16/116,r=r>LAB_FT?r**(1/3):7.787*r+16/116,n=n>LAB_FT?n**(1/3):7.787*n+16/116,[116*r-16,500*(t-r),200*(r-n)]},convert$1.xyz.oklab=function(e){const t=e[0]/100,r=e[1]/100,n=e[2]/100,a=Math.cbrt(.8189330101*t+.3618667424*r-.1288597137*n),i=Math.cbrt(.0329845436*t+.9293118715*r+.0361456387*n),o=Math.cbrt(.0482003018*t+.2643662691*r+.633851707*n);return[100*(.2104542553*a+.793617785*i-.0040720468*o),100*(1.9779984951*a-2.428592205*i+.4505937099*o),100*(.0259040371*a+.7827717662*i-.808675766*o)]},convert$1.oklab.oklch=function(e){return convert$1.lab.lch(e)},convert$1.oklab.xyz=function(e){const t=e[0]/100,r=e[1]/100,n=e[2]/100,a=(.999999998*t+.396337792*r+.215803758*n)**3,i=(1.000000008*t-.105561342*r-.063854175*n)**3,o=(1.000000055*t-.089484182*r-1.291485538*n)**3;return[100*(1.227013851*a-.55779998*i+.281256149*o),100*(-.040580178*a+1.11225687*i-.071676679*o),100*(-.076381285*a-.421481978*i+1.58616322*o)]},convert$1.oklab.rgb=function(e){const t=e[0]/100,r=e[1]/100,n=e[2]/100,a=(t+.3963377774*r+.2158037573*n)**3,i=(t-.1055613458*r-.0638541728*n)**3,o=(t-.0894841775*r-1.291485548*n)**3;return[255*srgbNonlinearTransform(4.0767416621*a-3.3077115913*i+.2309699292*o),255*srgbNonlinearTransform(-1.2684380046*a+2.6097574011*i-.3413193965*o),255*srgbNonlinearTransform(-.0041960863*a-.7034186147*i+1.707614701*o)]},convert$1.oklch.oklab=function(e){return convert$1.lch.lab(e)},convert$1.lab.xyz=function(e){let t,r,n;r=(e[0]+16)/116,t=e[1]/500+r,n=r-e[2]/200;const a=r**3,i=t**3,o=n**3;return r=a>LAB_FT?a:(r-16/116)/7.787,t=i>LAB_FT?i:(t-16/116)/7.787,n=o>LAB_FT?o:(n-16/116)/7.787,t*=95.047,r*=100,n*=108.883,[t,r,n]},convert$1.lab.lch=function(e){const t=e[0],r=e[1],n=e[2];let a;return a=360*Math.atan2(n,r)/2/Math.PI,a<0&&(a+=360),[t,Math.sqrt(r*r+n*n),a]},convert$1.lch.lab=function(e){const t=e[1],r=e[2]/360*2*Math.PI;return[e[0],t*Math.cos(r),t*Math.sin(r)]},convert$1.rgb.ansi16=function(e,t=null){const[r,n,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(n/255)<<1|Math.round(r/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],r=e[1],n=e[2];return t>>4==r>>4&&r>>4==n>>4?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},convert$1.ansi16.rgb=function(e){let t=(e=e[0])%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const r=.5*(Math.trunc(e>50)+1);return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},convert$1.ansi256.rgb=function(e){if((e=e[0])>=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".slice(t.length)+t},convert$1.hex.rgb=function(e){const t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let r=t[0];3===t[0].length&&(r=[...r].map(e=>e+e).join(""));const n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},convert$1.rgb.hcg=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,a=Math.max(Math.max(t,r),n),i=Math.min(Math.min(t,r),n),o=a-i;let s;return s=o<=0?0:a===t?(r-n)/o%6:a===r?2+(n-t)/o:4+(t-r)/o,s/=6,s%=1,[360*s,100*o,100*(o<1?i/(1-o):0)]},convert$1.hsl.hcg=function(e){const t=e[1]/100,r=e[2]/100,n=r<.5?2*t*r:2*t*(1-r);let a=0;return n<1&&(a=(r-.5*n)/(1-n)),[e[0],100*n,100*a]},convert$1.hsv.hcg=function(e){const t=e[2]/100,r=e[1]/100*t;let n=0;return r<1&&(n=(t-r)/(1-r)),[e[0],100*r,100*n]},convert$1.hcg.rgb=function(e){const t=e[1]/100,r=e[2]/100;if(0===t)return[255*r,255*r,255*r];const n=[0,0,0],a=e[0]/360%1*6,i=a%1,o=1-i;let s=0;switch(Math.floor(a)){case 0:n[0]=1,n[1]=i,n[2]=0;break;case 1:n[0]=o,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=i;break;case 3:n[0]=0,n[1]=o,n[2]=1;break;case 4:n[0]=i,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=o}return s=(1-t)*r,[255*(t*n[0]+s),255*(t*n[1]+s),255*(t*n[2]+s)]},convert$1.hcg.hsv=function(e){const t=e[1]/100,r=t+e[2]/100*(1-t);let n=0;return r>0&&(n=t/r),[e[0],100*n,100*r]},convert$1.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let n=0;return r>0&&r<.5?n=t/(2*r):r>=.5&&r<1&&(n=t/(2*(1-r))),[e[0],100*n,100*r]},convert$1.hcg.hwb=function(e){const t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],100*(r-t),100*(1-r)]},convert$1.hwb.hcg=function(e){const t=1-e[2]/100,r=t-e[1]/100;let n=0;return r<1&&(n=(t-r)/(1-r)),[e[0],100*r,100*n]},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),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(r.length)+r},convert$1.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const convert={},models=Object.keys(convert$1);function wrapRaw(e){const t=function(...t){const r=t[0];return null==r?r:(r.length>1&&(t=r),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}function wrapRounded(e){const t=function(...t){const r=t[0];if(null==r)return r;r.length>1&&(t=r);const n=e(t);if("object"==typeof n)for(let{length:e}=n,t=0;t<e;t++)n[t]=Math.round(n[t]);return n};return"conversion"in e&&(t.conversion=e.conversion),t}for(const e of models){convert[e]={},Object.defineProperty(convert[e],"channels",{value:convert$1[e].channels}),Object.defineProperty(convert[e],"labels",{value:convert$1[e].labels});const t=route(e),r=Object.keys(t);for(const n of r){const r=t[n];convert[e][n]=wrapRounded(r),convert[e][n].raw=wrapRaw(r)}}const skippedModels=["keyword","gray","hex"],hashedModelKeys={};for(const e of Object.keys(convert))hashedModelKeys[[...convert[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 convert))throw new Error("Unknown model: "+t);let r,n;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=cs.get(e);if(null===t)throw new Error("Unable to parse color from string: "+e);this.model=t.model,n=convert[this.model].channels,this.color=t.value.slice(0,n),this.valpha="number"==typeof t.value[n]?t.value[n]:1}else if(e.length>0){this.model=t||"rgb",n=convert[this.model].channels;const r=Array.prototype.slice.call(e,0,n);this.color=zeroArray(r,n),this.valpha="number"==typeof e[n]?e[n]: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 n=t.sort().join("");if(!(n in hashedModelKeys))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=hashedModelKeys[n];const{labels:a}=convert[this.model],i=[];for(r=0;r<a.length;r++)i.push(e[a[r]]);this.color=zeroArray(i)}if(limiters[this.model])for(n=convert[this.model].channels,r=0;r<n;r++){const e=limiters[this.model][r];e&&(this.color[r]=e(this.color[r]))}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 cs.to?this:this.rgb();t=t.round("number"==typeof e?e:1);const r=1===t.valpha?t.color:[...t.color,this.valpha];return cs.to[t.model](...r)},percentString(e){const t=this.rgb().round("number"==typeof e?e:1),r=1===t.valpha?t.color:[...t.color,this.valpha];return cs.to.rgb.percent(...r)},array(){return 1===this.valpha?[...this.color]:[...this.color,this.valpha]},object(){const e={},{channels:t}=convert[this.model],{labels:r}=convert[this.model];for(let n=0;n<t;n++)e[r[n]]=this.color[n];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):convert[this.model].keyword(this.color)},hex(e){return void 0!==e?new Color(e):cs.to.hex(...this.rgb().round().color)},hexa(e){if(void 0!==e)return new Color(e);const t=this.rgb().round().color;let r=Math.round(255*this.valpha).toString(16).toUpperCase();return 1===r.length&&(r="0"+r),cs.to.hex(...t)+r},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[r,n]of e.entries()){const e=n/255;t[r]=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(),r=e.luminosity();return t>r?(t+.05)/(r+.05):(r+.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 r=t.color[0];return r=(r+e)%360,r=r<0?360+r:r,t.color[0]=r,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 r=e.rgb(),n=this.rgb(),a=void 0===t?.5:t,i=2*a-1,o=r.alpha()-n.alpha(),s=((i*o===-1?i:(i+o)/(1+i*o))+1)/2,l=1-s;return Color.rgb(s*r.red()+l*n.red(),s*r.green()+l*n.green(),s*r.blue()+l*n.blue(),r.alpha()*a+n.alpha()*(1-a))}};for(const e of Object.keys(convert)){if(skippedModels.includes(e))continue;const{channels:t}=convert[e];Color.prototype[e]=function(...t){return this.model===e?new Color(this):new Color(t.length>0?t:[...assertArray(convert[this.model][e].raw(this.color)),this.valpha],e)},Color[e]=function(...r){let n=r[0];return"number"==typeof n&&(n=zeroArray(r,t)),new Color(n,e)}}function roundTo(e,t){return Number(e.toFixed(t))}function roundToPlace(e){return function(t){return roundTo(t,e)}}function getset(e,t,r){e=Array.isArray(e)?e:[e];for(const n of e)(limiters[n]||=[])[t]=r;return e=e[0],function(n){let a;return void 0!==n?(r&&(n=r(n)),a=this[e](),a.color[t]=n,a):(a=this[e]().color[t],r&&(a=r(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 r=0;r<t;r++)"number"!=typeof e[r]&&(e[r]=0);return e}var createGradient=function(e,t){return e.createLinearGradient(0,t.bottom,0,t.top)},getScale=function(e,t){var r=e.getDatasetMeta(t);return r.controller._yScale||r.controller.chart.scales[r.yAxisID]},GradientPlugin={id:"gradient",beforeDatasetsUpdate:function(e){var t=e.ctx,r=e.data.datasets;if(t&&r)for(var n=0;n<r.length;n++){var a=r[n],i=getScale(e,n);if(i){var o=createGradient(t,i),s=Color(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(null),_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),r=moment.range(e,t);setTimeLabels(function(){return e.isBefore(t)?Array.from(r.by("minutes",{step:15})):Array.from(r.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$1({},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$1({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$1({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.map(function(e){return e.query}),timeRange:{type:"absolute",start:queriesTimeRange.startedAt,end:queriesTimeRange.finishedAt,step:30},fillGaps:!0,fill:!0}},legend:{labels:{filter:function filter(item){var _settings$prometheusQ,regex=/{(?:[^{}]*)*}/,paramsMatch=item.text.match(regex),queryDisplayName=null==settings||null==(_settings$prometheusQ=settings.prometheusQueries[item.datasetIndex])?void 0:_settings$prometheusQ.displayName;if(queryDisplayName){if(paramsMatch&&0!==paramsMatch.index){var queryParams=eval("("+paramsMatch[0].replaceAll("=",":")+")"),queryParamsValues=Object.values(lodash_pick(queryParams,settings.displayedQueryParams)).join(" - ");item.text=queryParamsValues?queryDisplayName+" - "+queryParamsValues:queryDisplayName}}else{var replaceAfter=function(e,t,r){return e.substring(0,t)+r};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].query}return item}}}}})},WidgetView=function(e){var t=e.settings;return React__default.default.createElement(material.Box,{display:"flex",width:"100%",minWidth:"500px",height:"100%",minHeight:"250px",p:2},t&&React__default.default.createElement(PrometheusChart,{data:e.data,settings:t}))};const semver=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,validateAndParse=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(semver);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},isWildcard=e=>"*"===e||"x"===e||"X"===e,tryParse=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},forceType=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],compareStrings=(e,t)=>{if(isWildcard(e)||isWildcard(t))return 0;const[r,n]=forceType(tryParse(e),tryParse(t));return r>n?1:r<n?-1:0},compareSegments=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const n=compareStrings(e[r]||"0",t[r]||"0");if(0!==n)return n}return 0},compareVersions=(e,t)=>{const r=validateAndParse(e),n=validateAndParse(t),a=r.pop(),i=n.pop(),o=compareSegments(r,n);return 0!==o?o:a&&i?compareSegments(a.split("."),i.split(".")):a||i?a?-1:1:0},compare=(e,t,r)=>{assertValidOperator(r);const n=compareVersions(e,t);return operatorResMap[r].includes(n)},operatorResMap={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},allowedOperators=Object.keys(operatorResMap),assertValidOperator=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===allowedOperators.indexOf(e))throw new Error(`Invalid operator, expected one of ${allowedOperators.join("|")}`)},satisfies=(e,t)=>{if((t=t.replace(/([><=]+)\s+/g,"$1")).includes("||"))return t.split("||").some(t=>satisfies(e,t));if(t.includes(" - ")){const[r,n]=t.split(" - ",2);return satisfies(e,`>=${r} <=${n}`)}if(t.includes(" "))return t.trim().replace(/\s{2,}/g," ").split(" ").every(t=>satisfies(e,t));const r=t.match(/^([<>=~^]+)/),n=r?r[1]:"=";if("^"!==n&&"~"!==n)return compare(e,t,n);const[a,i,o,,s]=validateAndParse(e),[l,u,c,,d]=validateAndParse(t),h=[a,i,o],f=[l,null!=u?u:"x",null!=c?c:"x"];if(d){if(!s)return!1;if(0!==compareSegments(h,f))return!1;if(-1===compareSegments(s.split("."),d.split(".")))return!1}const p=f.findIndex(e=>"0"!==e)+1,g="~"===n?2:p>1?p:1;return 0===compareSegments(h.slice(0,g),f.slice(0,g))&&-1!==compareSegments(h.slice(g),f.slice(g))};function Cache(e){this._maxSize=e,this.clear()}Cache.prototype.clear=function(){this._size=0,this._values=Object.create(null)},Cache.prototype.get=function(e){return this._values[e]},Cache.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var SPLIT_REGEX=/[^.^\]^[]+|(?=\[\]|\.\.)/g,DIGIT_REGEX=/^\d+$/,LEAD_DIGIT_REGEX=/^\d/,SPEC_CHAR_REGEX=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,CLEAN_QUOTES_REGEX=/^\s*(['"]?)(.*?)(\1)\s*$/,MAX_CACHE_SIZE=512,pathCache=new Cache(MAX_CACHE_SIZE),setCache=new Cache(MAX_CACHE_SIZE),getCache=new Cache(MAX_CACHE_SIZE),propertyExpr={Cache:Cache,split:split,normalizePath:normalizePath,setter:function(e){var t=normalizePath(e);return setCache.get(e)||setCache.set(e,function(e,r){for(var n=0,a=t.length,i=e;n<a-1;){var o=t[n];if("__proto__"===o||"constructor"===o||"prototype"===o)return e;i=i[t[n++]]}i[t[n]]=r})},getter:function(e,t){var r=normalizePath(e);return getCache.get(e)||getCache.set(e,function(e){for(var n=0,a=r.length;n<a;){if(null==e&&t)return;e=e[r[n++]]}return e})},join:function(e){return e.reduce(function(e,t){return e+(isQuoted(t)||DIGIT_REGEX.test(t)?"["+t+"]":(e?".":"")+t)},"")},forEach:function(e,t,r){forEach(Array.isArray(e)?e:split(e),t,r)}};function normalizePath(e){return pathCache.get(e)||pathCache.set(e,split(e).map(function(e){return e.replace(CLEAN_QUOTES_REGEX,"$2")}))}function split(e){return e.match(SPLIT_REGEX)||[""]}function forEach(e,t,r){var n,a,i,o,s=e.length;for(a=0;a<s;a++)(n=e[a])&&(shouldBeQuoted(n)&&(n='"'+n+'"'),i=!(o=isQuoted(n))&&/^\d+$/.test(n),t.call(r,n,o,i,a,e))}function isQuoted(e){return"string"==typeof e&&e&&-1!==["'",'"'].indexOf(e.charAt(0))}function hasLeadingNumber(e){return e.match(LEAD_DIGIT_REGEX)&&!e.match(DIGIT_REGEX)}function hasSpecialChars(e){return SPEC_CHAR_REGEX.test(e)}function shouldBeQuoted(e){return!isQuoted(e)&&(hasLeadingNumber(e)||hasSpecialChars(e))}const reWords=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,words=e=>e.match(reWords)||[],upperFirst=e=>e[0].toUpperCase()+e.slice(1),join=(e,t)=>words(e).join(t).toLowerCase(),camelCase=e=>words(e).reduce((e,t)=>`${e}${e?t[0].toUpperCase()+t.slice(1).toLowerCase():t.toLowerCase()}`,""),pascalCase=e=>upperFirst(camelCase(e)),snakeCase=e=>join(e,"_"),kebabCase=e=>join(e,"-"),sentenceCase=e=>upperFirst(join(e," ")),titleCase=e=>words(e).map(upperFirst).join(" ");var tinyCase={words:words,upperFirst:upperFirst,camelCase:camelCase,pascalCase:pascalCase,snakeCase:snakeCase,kebabCase:kebabCase,sentenceCase:sentenceCase,titleCase:titleCase},toposort_1=function(e){return toposort(uniqueNodes(e),e)},array$1=toposort;function toposort(e,t){var r=e.length,n=new Array(r),a={},i=r,o=makeOutgoingEdges(t),s=makeNodesHash(e);for(t.forEach(function(e){if(!s.has(e[0])||!s.has(e[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});i--;)a[i]||l(e[i],i,new Set);return n;function l(e,t,i){if(i.has(e)){var u;try{u=", node was:"+JSON.stringify(e)}catch(e){u=""}throw new Error("Cyclic dependency"+u)}if(!s.has(e))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(e));if(!a[t]){a[t]=!0;var c=o.get(e)||new Set;if(t=(c=Array.from(c)).length){i.add(e);do{var d=c[--t];l(d,s.get(d),i)}while(t);i.delete(e)}n[--r]=e}}}function uniqueNodes(e){for(var t=new Set,r=0,n=e.length;r<n;r++){var a=e[r];t.add(a[0]),t.add(a[1])}return Array.from(t)}function makeOutgoingEdges(e){for(var t=new Map,r=0,n=e.length;r<n;r++){var a=e[r];t.has(a[0])||t.set(a[0],new Set),t.has(a[1])||t.set(a[1],new Set),t.get(a[0]).add(a[1])}return t}function makeNodesHash(e){for(var t=new Map,r=0,n=e.length;r<n;r++)t.set(e[r],r);return t}toposort_1.array=array$1;const toString=Object.prototype.toString,errorToString=Error.prototype.toString,regExpToString=RegExp.prototype.toString,symbolToString="undefined"!=typeof Symbol?Symbol.prototype.toString:()=>"",SYMBOL_REGEXP=/^Symbol\((.*)\)(.*)$/;function printNumber(e){return e!=+e?"NaN":0===e&&1/e<0?"-0":""+e}function printSimpleValue(e,t=!1){if(null==e||!0===e||!1===e)return""+e;const r=typeof e;if("number"===r)return printNumber(e);if("string"===r)return t?`"${e}"`:e;if("function"===r)return"[Function "+(e.name||"anonymous")+"]";if("symbol"===r)return symbolToString.call(e).replace(SYMBOL_REGEXP,"Symbol($1)");const n=toString.call(e).slice(8,-1);return"Date"===n?isNaN(e.getTime())?""+e:e.toISOString(e):"Error"===n||e instanceof Error?"["+errorToString.call(e)+"]":"RegExp"===n?regExpToString.call(e):null}function printValue(e,t){let r=printSimpleValue(e,t);return null!==r?r:JSON.stringify(e,function(e,r){let n=printSimpleValue(this[e],t);return null!==n?n:r},2)}function toArray(e){return null==e?[]:[].concat(e)}let _Symbol$toStringTag,_Symbol$hasInstance,_Symbol$toStringTag2,strReg=/\$\{\s*(\w+)\s*\}/g;_Symbol$toStringTag=Symbol.toStringTag;class ValidationErrorNoStack{constructor(e,t,r,n){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[_Symbol$toStringTag]="Error",this.name="ValidationError",this.value=t,this.path=r,this.type=n,this.errors=[],this.inner=[],toArray(e).forEach(e=>{ValidationError.isError(e)?(this.errors.push(...e.errors),this.inner.push(...e.inner.length?e.inner:[e])):this.errors.push(e)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}_Symbol$hasInstance=Symbol.hasInstance,_Symbol$toStringTag2=Symbol.toStringTag;class ValidationError extends Error{static formatError(e,t){return t=Object.assign({},t,{path:t.label||t.path||"this",originalPath:t.path}),"string"==typeof e?e.replace(strReg,(e,r)=>printValue(t[r])):"function"==typeof e?e(t):e}static isError(e){return e&&"ValidationError"===e.name}constructor(e,t,r,n,a){const i=new ValidationErrorNoStack(e,t,r,n);if(a)return i;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[_Symbol$toStringTag2]="Error",this.name=i.name,this.message=i.message,this.type=i.type,this.value=i.value,this.path=i.path,this.errors=i.errors,this.inner=i.inner,Error.captureStackTrace&&Error.captureStackTrace(this,ValidationError)}static[_Symbol$hasInstance](e){return ValidationErrorNoStack[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let mixed={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:r,originalValue:n})=>{const a=null!=n&&n!==r?` (cast from the value \`${printValue(n,!0)}\`).`:".";return"mixed"!==t?`${e} must be a \`${t}\` type, but the final value was: \`${printValue(r,!0)}\``+a:`${e} must match the configured type. The validated value was: \`${printValue(r,!0)}\``+a}},string={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},number={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},date={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},boolean={isValue:"${path} field must be ${value}"},object={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},array={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},tuple={notType:e=>{const{path:t,value:r,spec:n}=e,a=n.types.length;if(Array.isArray(r)){if(r.length<a)return`${t} tuple value has too few items, expected a length of ${a} but got ${r.length} for value: \`${printValue(r,!0)}\``;if(r.length>a)return`${t} tuple value has too many items, expected a length of ${a} but got ${r.length} for value: \`${printValue(r,!0)}\``}return ValidationError.formatError(mixed.notType,e)}};var locale=Object.assign(Object.create(null),{mixed:mixed,string:string,number:number,date:date,object:object,array:array,boolean:boolean,tuple:tuple});const isSchema=e=>e&&e.__isYupSchema__;class Condition{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:n,otherwise:a}=t,i="function"==typeof r?r:(...e)=>e.every(e=>e===r);return new Condition(e,(e,t)=>{var r;let o=i(...e)?n:a;return null!=(r=null==o?void 0:o(t))?r:t})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let r=this.refs.map(e=>e.getValue(null==t?void 0:t.value,null==t?void 0:t.parent,null==t?void 0:t.context)),n=this.fn(r,e,t);if(void 0===n||n===e)return e;if(!isSchema(n))throw new TypeError("conditions must return a schema object");return n.resolve(t)}}const prefixes={context:"$",value:"."};class Reference{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,"string"!=typeof e)throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),""===e)throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===prefixes.context,this.isValue=this.key[0]===prefixes.value,this.isSibling=!this.isContext&&!this.isValue,this.path=this.key.slice((this.isContext?prefixes.context:this.isValue?prefixes.value:"").length),this.getter=this.path&&propertyExpr.getter(this.path,!0),this.map=t.map}getValue(e,t,r){let n=this.isContext?r:this.isValue?e:t;return this.getter&&(n=this.getter(n||{})),this.map&&(n=this.map(n)),n}cast(e,t){return this.getValue(e,null==t?void 0:t.parent,null==t?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}Reference.prototype.__isYupRef=!0;const isAbsent=e=>null==e;function createValidation(e){function t({value:t,path:r="",options:n,originalValue:a,schema:i},o,s){const{name:l,test:u,params:c,message:d,skipAbsent:h}=e;let{parent:f,context:p,abortEarly:g=i.spec.abortEarly,disableStackTrace:m=i.spec.disableStackTrace}=n;const y={value:t,parent:f,context:p};function v(e={}){const n=resolveParams(Object.assign({value:t,originalValue:a,label:i.spec.label,path:e.path||r,spec:i.spec,disableStackTrace:e.disableStackTrace||m},c,e.params),y),o=new ValidationError(ValidationError.formatError(e.message||d,n),t,n.path,e.type||l,n.disableStackTrace);return o.params=n,o}const b=g?o:s;let x={path:r,parent:f,type:l,from:n.from,createError:v,resolve:e=>resolveMaybeRef(e,y),options:n,originalValue:a,schema:i};const _=e=>{ValidationError.isError(e)?b(e):e?s(null):b(v())},w=e=>{ValidationError.isError(e)?b(e):o(e)};if(h&&isAbsent(t))return _(!0);let k;try{var S;if(k=u.call(x,t,x),"function"==typeof(null==(S=k)?void 0:S.then)){if(n.sync)throw new Error(`Validation test of type: "${x.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(k).then(_,w)}}catch(e){return void w(e)}_(k)}return t.OPTIONS=e,t}function resolveParams(e,t){if(!e)return e;for(const r of Object.keys(e))e[r]=resolveMaybeRef(e[r],t);return e}function resolveMaybeRef(e,t){return Reference.isRef(e)?e.getValue(t.value,t.parent,t.context):e}function getIn(e,t,r,n=r){let a,i,o;return t?(propertyExpr.forEach(t,(s,l,u)=>{let c=l?s.slice(1,s.length-1):s,d="tuple"===(e=e.resolve({context:n,parent:a,value:r})).type,h=u?parseInt(c,10):0;if(e.innerType||d){if(d&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(r&&h>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);a=r,r=r&&r[h],e=d?e.spec.types[h]:e.innerType}if(!u){if(!e.fields||!e.fields[c])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e.type}")`);a=r,r=r&&r[c],e=e.fields[c]}i=c,o=l?"["+s+"]":"."+s}),{schema:e,parent:a,parentPath:i}):{parent:a,parentPath:t,schema:e}}class ReferenceSet extends Set{describe(){const e=[];for(const t of this.values())e.push(Reference.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(const r of this.values())t.push(e(r));return t}clone(){return new ReferenceSet(this.values())}merge(e,t){const r=this.clone();return e.forEach(e=>r.add(e)),t.forEach(e=>r.delete(e)),r}}function clone(e,t=new Map){if(isSchema(e)||!e||"object"!=typeof e)return e;if(t.has(e))return t.get(e);let r;if(e instanceof Date)r=new Date(e.getTime()),t.set(e,r);else if(e instanceof RegExp)r=new RegExp(e),t.set(e,r);else if(Array.isArray(e)){r=new Array(e.length),t.set(e,r);for(let n=0;n<e.length;n++)r[n]=clone(e[n],t)}else if(e instanceof Map){r=new Map,t.set(e,r);for(const[n,a]of e.entries())r.set(n,clone(a,t))}else if(e instanceof Set){r=new Set,t.set(e,r);for(const n of e)r.add(clone(n,t))}else{if(!(e instanceof Object))throw Error(`Unable to clone ${e}`);r={},t.set(e,r);for(const[n,a]of Object.entries(e))r[n]=clone(a,t)}return r}function createStandardPath(e){if(null==e||!e.length)return;const t=[];let r="",n=!1,a=!1;for(let i=0;i<e.length;i++){const o=e[i];"["!==o||a?"]"!==o||a?'"'!==o?"."!==o||n||a?r+=o:r&&(t.push(r),r=""):a=!a:(r&&(/^\d+$/.test(r)?t.push(r):t.push(r.replace(/^"|"$/g,"")),r=""),n=!1):(r&&(t.push(...r.split(".").filter(Boolean)),r=""),n=!0)}return r&&t.push(...r.split(".").filter(Boolean)),t}function createStandardIssues(e,t){const r=t?`${t}.${e.path}`:e.path;return e.errors.map(e=>({message:e,path:createStandardPath(r)}))}function issuesFromValidationError(e,t){var r;if((null==(r=e.inner)||!r.length)&&e.errors.length)return createStandardIssues(e,t);const n=t?`${t}.${e.path}`:e.path;return e.inner.flatMap(e=>issuesFromValidationError(e,n))}class Schema{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new ReferenceSet,this._blacklist=new ReferenceSet,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(mixed.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},null==e?void 0:e.spec),this.withMutation(e=>{e.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=clone(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let r=e(this);return this._mutate=t,r}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&"mixed"!==this.type)throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,r=e.clone();const n=Object.assign({},t.spec,r.spec);return r.spec=n,r.internalTests=Object.assign({},t.internalTests,r.internalTests),r._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),r._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),r.tests=t.tests,r.exclusiveTests=t.exclusiveTests,r.withMutation(t=>{e.tests.forEach(e=>{t.test(e.OPTIONS)})}),r.transforms=[...t.transforms,...r.transforms],r}isType(e){return null==e?!(!this.spec.nullable||null!==e)||!(!this.spec.optional||void 0!==e):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let r=t.conditions;t=t.clone(),t.conditions=[],t=r.reduce((t,r)=>r.resolve(t,e),t),t=t.resolve(e)}return t}resolveOptions(e){var t,r,n,a;return Object.assign({},e,{from:e.from||[],strict:null!=(t=e.strict)?t:this.spec.strict,abortEarly:null!=(r=e.abortEarly)?r:this.spec.abortEarly,recursive:null!=(n=e.recursive)?n:this.spec.recursive,disableStackTrace:null!=(a=e.disableStackTrace)?a:this.spec.disableStackTrace})}cast(e,t={}){let r=this.resolve(Object.assign({},t,{value:e})),n="ignore-optionality"===t.assert,a=r._cast(e,t);if(!1!==t.assert&&!r.isType(a)){if(n&&isAbsent(a))return a;let i=printValue(e),o=printValue(a);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}". \n\nattempted value: ${i} \n`+(o!==i?`result of cast: ${o}`:""))}return a}_cast(e,t){let r=void 0===e?e:this.transforms.reduce((r,n)=>n.call(this,r,e,this,t),e);return void 0===r&&(r=this.getDefault(t)),r}_validate(e,t={},r,n){let{path:a,originalValue:i=e,strict:o=this.spec.strict}=t,s=e;o||(s=this._cast(s,Object.assign({assert:!1},t)));let l=[];for(let e of Object.values(this.internalTests))e&&l.push(e);this.runTests({path:a,value:s,originalValue:i,options:t,tests:l},r,e=>{if(e.length)return n(e,s);this.runTests({path:a,value:s,originalValue:i,options:t,tests:this.tests},r,n)})}runTests(e,t,r){let n=!1,{tests:a,value:i,originalValue:o,path:s,options:l}=e,u=e=>{n||(n=!0,t(e,i))},c=e=>{n||(n=!0,r(e,i))},d=a.length,h=[];if(!d)return c([]);let f={value:i,originalValue:o,path:s,options:l,schema:this};for(let e=0;e<a.length;e++)(0,a[e])(f,u,function(e){e&&(Array.isArray(e)?h.push(...e):h.push(e)),--d<=0&&c(h)})}asNestedTest({key:e,index:t,parent:r,parentPath:n,originalParent:a,options:i}){const o=null!=e?e:t;if(null==o)throw TypeError("Must include `key` or `index` for nested validations");const s="number"==typeof o;let l=r[o];const u=Object.assign({},i,{strict:!0,parent:r,value:l,originalValue:a[o],key:void 0,[s?"index":"key"]:o,path:s||o.includes(".")?`${n||""}[${s?o:`"${o}"`}]`:(n?`${n}.`:"")+e});return(e,t,r)=>this.resolve(u)._validate(l,u,t,r)}validate(e,t){var r;let n=this.resolve(Object.assign({},t,{value:e})),a=null!=(r=null==t?void 0:t.disableStackTrace)?r:n.spec.disableStackTrace;return new Promise((r,i)=>n._validate(e,t,(e,t)=>{ValidationError.isError(e)&&(e.value=t),i(e)},(e,t)=>{e.length?i(new ValidationError(e,t,void 0,void 0,a)):r(t)}))}validateSync(e,t){var r;let n,a=this.resolve(Object.assign({},t,{value:e})),i=null!=(r=null==t?void 0:t.disableStackTrace)?r:a.spec.disableStackTrace;return a._validate(e,Object.assign({},t,{sync:!0}),(e,t)=>{throw ValidationError.isError(e)&&(e.value=t),e},(t,r)=>{if(t.length)throw new ValidationError(t,e,void 0,void 0,i);n=r}),n}isValid(e,t){return this.validate(e,t).then(()=>!0,e=>{if(ValidationError.isError(e))return!1;throw e})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(e){if(ValidationError.isError(e))return!1;throw e}}_getDefault(e){let t=this.spec.default;return null==t?t:"function"==typeof t?t.call(this,e):clone(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return 0===arguments.length?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){const r=this.clone({nullable:e});return r.internalTests.nullable=createValidation({message:t,name:"nullable",test(e){return null!==e||this.schema.spec.nullable}}),r}optionality(e,t){const r=this.clone({optional:e});return r.internalTests.optionality=createValidation({message:t,name:"optionality",test(e){return void 0!==e||this.schema.spec.optional}}),r}optional(){return this.optionality(!0)}defined(e=mixed.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=mixed.notNull){return this.nullability(!1,e)}required(e=mixed.required){return this.clone().withMutation(t=>t.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(t=1===e.length?"function"==typeof e[0]?{test:e[0]}:e[0]:2===e.length?{name:e[0],test:e[1]}:{name:e[0],message:e[1],test:e[2]},void 0===t.message&&(t.message=mixed.default),"function"!=typeof t.test)throw new TypeError("`test` is a required parameters");let r=this.clone(),n=createValidation(t),a=t.exclusive||t.name&&!0===r.exclusiveTests[t.name];if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(r.exclusiveTests[t.name]=!!t.exclusive),r.tests=r.tests.filter(e=>{if(e.OPTIONS.name===t.name){if(a)return!1;if(e.OPTIONS.test===n.OPTIONS.test)return!1}return!0}),r.tests.push(n),r}when(e,t){Array.isArray(e)||"string"==typeof e||(t=e,e=".");let r=this.clone(),n=toArray(e).map(e=>new Reference(e));return n.forEach(e=>{e.isSibling&&r.deps.push(e.key)}),r.conditions.push("function"==typeof t?new Condition(n,t):Condition.fromOptions(n,t)),r}typeError(e){let t=this.clone();return t.internalTests.typeError=createValidation({message:e,name:"typeError",skipAbsent:!0,test(e){return!!this.schema._typeCheck(e)||this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=mixed.oneOf){let r=this.clone();return e.forEach(e=>{r._whitelist.add(e),r._blacklist.delete(e)}),r.internalTests.whiteList=createValidation({message:t,name:"oneOf",skipAbsent:!0,test(e){let t=this.schema._whitelist,r=t.resolveAll(this.resolve);return!!r.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:r}})}}),r}notOneOf(e,t=mixed.notOneOf){let r=this.clone();return e.forEach(e=>{r._blacklist.add(e),r._whitelist.delete(e)}),r.internalTests.blacklist=createValidation({message:t,name:"notOneOf",test(e){let t=this.schema._blacklist,r=t.resolveAll(this.resolve);return!r.includes(e)||this.createError({params:{values:Array.from(t).join(", "),resolved:r}})}}),r}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){const t=(e?this.resolve(e):this).clone(),{label:r,meta:n,optional:a,nullable:i}=t.spec;return{meta:n,label:r,optional:a,nullable:i,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.filter((e,t,r)=>r.findIndex(t=>t.OPTIONS.name===e.OPTIONS.name)===t).map(t=>{const r=t.OPTIONS.params&&e?resolveParams(Object.assign({},t.OPTIONS.params),e):t.OPTIONS.params;return{name:t.OPTIONS.name,params:r}})}}get"~standard"(){const e=this;return{version:1,vendor:"yup",async validate(t){try{return{value:await e.validate(t,{abortEarly:!1})}}catch(e){if(e instanceof ValidationError)return{issues:issuesFromValidationError(e)};throw e}}}}}Schema.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Schema.prototype[`${e}At`]=function(t,r,n={}){const{parent:a,parentPath:i,schema:o}=getIn(this,t,r,n.context);return o[e](a&&a[i],Object.assign({},n,{parent:a,path:t}))};for(const e of["equals","is"])Schema.prototype[e]=Schema.prototype.oneOf;for(const e of["not","nope"])Schema.prototype[e]=Schema.prototype.notOneOf;const isoReg=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function parseIsoDate(e){const t=parseDateStruct(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(void 0===t.z&&void 0===t.plusMinus)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let r=0;return"Z"!==t.z&&void 0!==t.plusMinus&&(r=60*t.hourOffset+t.minuteOffset,"+"===t.plusMinus&&(r=0-r)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+r,t.second,t.millisecond)}function parseDateStruct(e){var t,r;const n=isoReg.exec(e);return n?{year:toNumber(n[1]),month:toNumber(n[2],1)-1,day:toNumber(n[3],1),hour:toNumber(n[4]),minute:toNumber(n[5]),second:toNumber(n[6]),millisecond:n[7]?toNumber(n[7].substring(0,3)):0,precision:null!=(t=null==(r=n[7])?void 0:r.length)?t:void 0,z:n[8]||void 0,plusMinus:n[9]||void 0,hourOffset:toNumber(n[10]),minuteOffset:toNumber(n[11])}:null}function toNumber(e,t=0){return Number(e)||t}let rEmail=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,rUrl=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,rUUID=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,yearMonthDay="^\\d{4}-\\d{2}-\\d{2}",hourMinuteSecond="\\d{2}:\\d{2}:\\d{2}",zOrOffset="(([+-]\\d{2}(:?\\d{2})?)|Z)",rIsoDateTime=new RegExp(`${yearMonthDay}T${hourMinuteSecond}(\\.\\d+)?${zOrOffset}$`),isTrimmed=e=>isAbsent(e)||e===e.trim(),objStringTag={}.toString();function create$6(){return new StringSchema}class StringSchema extends Schema{constructor(){super({type:"string",check:e=>(e instanceof String&&(e=e.valueOf()),"string"==typeof e)}),this.withMutation(()=>{this.transform((e,t)=>{if(!this.spec.coerce||this.isType(e))return e;if(Array.isArray(e))return e;const r=null!=e&&e.toString?e.toString():e;return r===objStringTag?e:r})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||mixed.required,name:"required",skipAbsent:!0,test:e=>!!e.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(e=>"required"!==e.OPTIONS.name),e))}length(e,t=string.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(t){return t.length===this.resolve(e)}})}min(e,t=string.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(t){return t.length>=this.resolve(e)}})}max(e,t=string.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(t){return t.length<=this.resolve(e)}})}matches(e,t){let r,n,a=!1;return t&&("object"==typeof t?({excludeEmptyString:a=!1,message:r,name:n}=t):r=t),this.test({name:n||"matches",message:r||string.matches,params:{regex:e},skipAbsent:!0,test:t=>""===t&&a||-1!==t.search(e)})}email(e=string.email){return this.matches(rEmail,{name:"email",message:e,excludeEmptyString:!0})}url(e=string.url){return this.matches(rUrl,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=string.uuid){return this.matches(rUUID,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let t,r,n="";return e&&("object"==typeof e?({message:n="",allowOffset:t=!1,precision:r}=e):n=e),this.matches(rIsoDateTime,{name:"datetime",message:n||string.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||string.datetime_offset,params:{allowOffset:t},skipAbsent:!0,test:e=>{if(!e||t)return!0;const r=parseDateStruct(e);return!!r&&!!r.z}}).test({name:"datetime_precision",message:n||string.datetime_precision,params:{precision:r},skipAbsent:!0,test:e=>{if(!e||null==r)return!0;const t=parseDateStruct(e);return!!t&&t.precision===r}})}ensure(){return this.default("").transform(e=>null===e?"":e)}trim(e=string.trim){return this.transform(e=>null!=e?e.trim():e).test({message:e,name:"trim",test:isTrimmed})}lowercase(e=string.lowercase){return this.transform(e=>isAbsent(e)?e:e.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>isAbsent(e)||e===e.toLowerCase()})}uppercase(e=string.uppercase){return this.transform(e=>isAbsent(e)?e:e.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:e=>isAbsent(e)||e===e.toUpperCase()})}}create$6.prototype=StringSchema.prototype;let invalidDate=new Date(""),isDate=e=>"[object Date]"===Object.prototype.toString.call(e);class DateSchema extends Schema{constructor(){super({type:"date",check:e=>isDate(e)&&!isNaN(e.getTime())}),this.withMutation(()=>{this.transform((e,t)=>!this.spec.coerce||this.isType(e)||null===e?e:(e=parseIsoDate(e),isNaN(e)?DateSchema.INVALID_DATE:new Date(e)))})}prepareParam(e,t){let r;if(Reference.isRef(e))r=e;else{let n=this.cast(e);if(!this._typeCheck(n))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);r=n}return r}min(e,t=date.min){let r=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(e){return e>=this.resolve(r)}})}max(e,t=date.max){let r=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(e){return e<=this.resolve(r)}})}}function sortFields(e,t=[]){let r=[],n=new Set,a=new Set(t.map(([e,t])=>`${e}-${t}`));function i(e,t){let i=propertyExpr.split(e)[0];n.add(i),a.has(`${t}-${i}`)||r.push([t,i])}for(const t of Object.keys(e)){let r=e[t];n.add(t),Reference.isRef(r)&&r.isSibling?i(r.path,t):isSchema(r)&&"deps"in r&&r.deps.forEach(e=>i(e,t))}return toposort_1.array(Array.from(n),r).reverse()}function findIndex(e,t){let r=Infinity;return e.some((e,n)=>{var a;if(null!=(a=t.path)&&a.includes(e))return r=n,!0}),r}function sortByKeyOrder(e){return(t,r)=>findIndex(e,t)-findIndex(e,r)}DateSchema.INVALID_DATE=invalidDate;const parseJson=(e,t,r)=>{if("string"!=typeof e)return e;let n=e;try{n=JSON.parse(e)}catch(e){}return r.isType(n)?n:e};function deepPartial(e){if("fields"in e){const t={};for(const[r,n]of Object.entries(e.fields))t[r]=deepPartial(n);return e.setFields(t)}if("array"===e.type){const t=e.optional();return t.innerType&&(t.innerType=deepPartial(t.innerType)),t}return"tuple"===e.type?e.optional().clone({types:e.spec.types.map(deepPartial)}):"optional"in e?e.optional():e}const deepHas=(e,t)=>{const r=[...propertyExpr.normalizePath(t)];if(1===r.length)return r[0]in e;let n=r.pop(),a=propertyExpr.getter(propertyExpr.join(r),!0)(e);return!(!a||!(n in a))};let isObject=e=>"[object Object]"===Object.prototype.toString.call(e);function unknown(e,t){let r=Object.keys(e.fields);return Object.keys(t).filter(e=>-1===r.indexOf(e))}const defaultSort=sortByKeyOrder([]);function create$3(e){return new ObjectSchema(e)}class ObjectSchema extends Schema{constructor(e){super({type:"object",check:e=>isObject(e)||"function"==typeof e}),this.fields=Object.create(null),this._sortErrors=defaultSort,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,t={}){var r;let n=super._cast(e,t);if(void 0===n)return this.getDefault(t);if(!this._typeCheck(n))return n;let a=this.fields,i=null!=(r=t.stripUnknown)?r:this.spec.noUnknown,o=[].concat(this._nodes,Object.keys(n).filter(e=>!this._nodes.includes(e))),s={},l=Object.assign({},t,{parent:s,__validating:t.__validating||!1}),u=!1;for(const e of o){let r=a[e],o=e in n,c=n[e];if(r){let a;l.path=(t.path?`${t.path}.`:"")+e,r=r.resolve({value:c,context:t.context,parent:s});let i=r instanceof Schema?r.spec:void 0,o=null==i?void 0:i.strict;if(null!=i&&i.strip){u=u||e in n;continue}a=t.__validating&&o?c:r.cast(c,l),void 0!==a&&(s[e]=a)}else o&&!i&&(s[e]=c);o===e in s&&s[e]===c||(u=!0)}return u?s:n}_validate(e,t={},r,n){let{from:a=[],originalValue:i=e,recursive:o=this.spec.recursive}=t;t.from=[{schema:this,value:i},...a],t.__validating=!0,t.originalValue=i,super._validate(e,t,r,(e,a)=>{if(!o||!isObject(a))return void n(e,a);i=i||a;let s=[];for(let e of this._nodes){let r=this.fields[e];r&&!Reference.isRef(r)&&s.push(r.asNestedTest({options:t,key:e,parent:a,parentPath:t.path,originalParent:i}))}this.runTests({tests:s,value:a,originalValue:i,options:t},r,t=>{n(t.sort(this._sortErrors).concat(e),a)})})}clone(e){const t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),r=t.fields;for(let[e,t]of Object.entries(this.fields)){const n=r[e];r[e]=void 0===n?t:n}return t.withMutation(t=>t.setFields(r,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach(r=>{var n;const a=this.fields[r];let i=e;null!=(n=i)&&n.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[r]})),t[r]=a&&"getDefault"in a?a.getDefault(i):void 0}),t}setFields(e,t){let r=this.clone();return r.fields=e,r._nodes=sortFields(e,t),r._sortErrors=sortByKeyOrder(Object.keys(e)),t&&(r._excludedEdges=t),r}shape(e,t=[]){return this.clone().withMutation(r=>{let n=r._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),n=[...r._excludedEdges,...t]),r.setFields(Object.assign(r.fields,e),n)})}partial(){const e={};for(const[t,r]of Object.entries(this.fields))e[t]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(e)}deepPartial(){return deepPartial(this)}pick(e){const t={};for(const r of e)this.fields[r]&&(t[r]=this.fields[r]);return this.setFields(t,this._excludedEdges.filter(([t,r])=>e.includes(t)&&e.includes(r)))}omit(e){const t=[];for(const r of Object.keys(this.fields))e.includes(r)||t.push(r);return this.pick(t)}from(e,t,r){let n=propertyExpr.getter(e,!0);return this.transform(a=>{if(!a)return a;let i=a;return deepHas(a,e)&&(i=Object.assign({},a),r||delete i[e],i[t]=n(a)),i})}json(){return this.transform(parseJson)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||object.exact,test(e){if(null==e)return!0;const t=unknown(this.schema,e);return 0===t.length||this.createError({params:{properties:t.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,t=object.noUnknown){"boolean"!=typeof e&&(t=e,e=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:t,test(t){if(null==t)return!0;const r=unknown(this.schema,t);return!e||0===r.length||this.createError({params:{unknown:r.join(", ")}})}});return r.spec.noUnknown=e,r}unknown(e=!0,t=object.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>{if(!t)return t;const r={};for(const n of Object.keys(t))r[e(n)]=t[n];return r})}camelCase(){return this.transformKeys(tinyCase.camelCase)}snakeCase(){return this.transformKeys(tinyCase.snakeCase)}constantCase(){return this.transformKeys(e=>tinyCase.snakeCase(e).toUpperCase())}describe(e){const t=(e?this.resolve(e):this).clone(),r=super.describe(e);r.fields={};for(const[a,i]of Object.entries(t.fields)){var n;let t=e;null!=(n=t)&&n.value&&(t=Object.assign({},t,{parent:t.value,value:t.value[a]})),r.fields[a]=i.describe(t)}return r}}function create$2(e){return new ArraySchema(e)}create$3.prototype=ObjectSchema.prototype;class ArraySchema extends Schema{constructor(e){super({type:"array",spec:{types:e},check:e=>Array.isArray(e)}),this.innerType=void 0,this.innerType=e}_cast(e,t){const r=super._cast(e,t);if(!this._typeCheck(r)||!this.innerType)return r;let n=!1;const a=r.map((e,a)=>{const i=this.innerType.cast(e,Object.assign({},t,{path:`${t.path||""}[${a}]`,parent:r,originalValue:e,value:e,index:a}));return i!==e&&(n=!0),i});return n?a:r}_validate(e,t={},r,n){var a;let i=this.innerType,o=null!=(a=t.recursive)?a:this.spec.recursive;super._validate(e,t,r,(a,s)=>{var l;if(!o||!i||!this._typeCheck(s))return void n(a,s);let u=new Array(s.length);for(let r=0;r<s.length;r++){var c;u[r]=i.asNestedTest({options:t,index:r,parent:s,parentPath:t.path,originalParent:null!=(c=t.originalValue)?c:e})}this.runTests({value:s,tests:u,originalValue:null!=(l=t.originalValue)?l:e,options:t},r,e=>n(e.concat(a),s))})}clone(e){const t=super.clone(e);return t.innerType=this.innerType,t}json(){return this.transform(parseJson)}concat(e){let t=super.concat(e);return t.innerType=this.innerType,e.innerType&&(t.innerType=t.innerType?t.innerType.concat(e.innerType):e.innerType),t}of(e){let t=this.clone();if(!isSchema(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+printValue(e));return t.innerType=e,t.spec=Object.assign({},t.spec,{types:e}),t}length(e,t=array.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(t){return t.length===this.resolve(e)}})}min(e,t){return this.test({message:t=t||array.min,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(t){return t.length>=this.resolve(e)}})}max(e,t){return this.test({message:t=t||array.max,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(t){return t.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,t)=>this._typeCheck(e)?e:null==t?[]:[].concat(t))}compact(e){let t=e?(t,r,n)=>!e(t,r,n):e=>!!e;return this.transform(e=>null!=e?e.filter(t):e)}describe(e){const t=(e?this.resolve(e):this).clone(),r=super.describe(e);if(t.innerType){var n;let a=e;null!=(n=a)&&n.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[0]})),r.innerType=t.innerType.describe(a)}return r}}function setLocale(e){Object.keys(e).forEach(t=>{Object.keys(e[t]).forEach(r=>{locale[t][r]=e[t][r]})})}create$2.prototype=ArraySchema.prototype;var getSettingsFormProps=function(e){return setLocale({mixed:{required:e("This field is required")}}),{initialValues:{endpointUrl:"",queriesPeriod:QueriesPeriod.CURRENT_SHIFT,prometheusQueries:[],displayedQueryParams:[],xAxisUnit:"",yAxisUnit:""},validationSchema:create$3({endpointUrl:create$6().required(),queriesPeriod:create$6().required(),prometheusQueries:create$2().of(create$3().shape({query:create$6().required(),displayName:create$6().required()})),displayedQueryParams:create$2().of(create$6().required()),xAxisUnit:create$6().required(),yAxisUnit:create$6().required()})}},migrateSettings=function(e){return satisfies(e.version||"1.0.0",">=1.2.5")?e:_extends$1({},e,{prometheusQueries:e.prometheusQueries.map(function(e){return{query:e,displayName:""}})})},_excluded=["url","wsUrl","lang","data"],Widget=function(e){var t=e.url,r=e.wsUrl,n=e.lang,a=e.data,i=_objectWithoutPropertiesLoose$1(e,_excluded),o=andoncloudDashboardToolkit.useGqlClients({url:t,wsUrl:r,lang:n}),s=o.graphqlSdk,l=o.gqlWsClient,u=React.useState(a),c=u[0],d=u[1];return React.useEffect(function(){!a&&s&&s.shifts().then(function(e){var t=e.shifts;return d(function(e){return _extends$1({},e||{},{shifts:t})})}).catch(function(){})},[a,s]),React__default.default.createElement(andoncloudWidgetBase.BaseWidget,_extends$1({url:t,lang:n,locales:resources,data:c,gqlClients:{graphqlSdk:s,gqlWsClient:l},WidgetView:WidgetView,getSettingsFormProps:getSettingsFormProps,SettingsFormContent:SettingsFormContent,migrateSettings:migrateSettings,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"}},requiredFeatures=["feature.prometheus-widget"],extraPermissions=[];exports.Widget=Widget,exports.extraPermissions=extraPermissions,exports.getDisplayName=getDisplayName,exports.requiredFeatures=requiredFeatures,exports.version=LIBRARY_VERSION;
2
2
  //# sourceMappingURL=index.js.map