diff --git a/CHANGELOG.md b/CHANGELOG.md index d0204a2c..18077e31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## v0.7.4 (2021-04-25) +### Added +- Added `env` functions for default drivers in the `bazar.php` config file + +### Fixed +- Fixed shipping driver issue ([#148](https://github.com/conedevelopment/bazar/issues/148)) +- Fixed `addressable` column type to `uuidMorphs` ([#157](https://github.com/conedevelopment/bazar/pull/147)) +- Fixed `shippable` column type to `uuidMorphs` ([a4b150a](https://github.com/conedevelopment/bazar/commit/a4b150abde9a7bf2e55519807c49e8e6997afb4f)) + ## v0.7.3 (2021-04-19) ### Fixed - Fixed proxy based route-model binding diff --git a/public/app.js b/public/app.js index 547b721b..dbfe4b1f 100644 --- a/public/app.js +++ b/public/app.js @@ -1,3 +1,3 @@ /*! For license information please see app.js.LICENSE.txt */ -(()=>{var e,t={9038:(e,t,n)=>{var r,o=n(9812),i=(r=n(3465))&&"object"==typeof r&&"default"in r?r.default:r,a=n(9680);function l(){return(l=Object.assign||function(e){for(var t=1;t0&&!t.includes(r)?((o={})[r]=e.errors[r],o):{})}),{}),this.hasErrors=Object.keys(this.errors).length>0,this},submit:function(e,t,n){var r=this;void 0===n&&(n={});var o=c(this.data()),i=l({},n,{onBefore:function(e){if(r.wasSuccessful=!1,r.recentlySuccessful=!1,clearTimeout(u),n.onBefore)return n.onBefore(e)},onStart:function(e){if(r.processing=!0,n.onStart)return n.onStart(e)},onProgress:function(e){if(r.progress=e,n.onProgress)return n.onProgress(e)},onBeforeRender:function(e){if(r.errors=e.resolvedErrors,r.hasErrors=Object.keys(r.errors).length>0,r.wasSuccessful=!r.hasErrors,r.recentlySuccessful=!r.hasErrors,n.onBeforeRender)return n.onBeforeRender(e)},onSuccess:function(e){if(u=setTimeout((function(){return r.recentlySuccessful=!1}),2e3),n.onSuccess)return n.onSuccess(e)},onFinish:function(){if(r.processing=!1,r.progress=null,n.onFinish)return n.onFinish()}});"delete"===e?a.Inertia.delete(t,l({},i,{data:o})):a.Inertia[e](t,o,i)},get:function(e,t){this.submit("get",e,t)},post:function(e,t){this.submit("post",e,t)},put:function(e,t){this.submit("put",e,t)},patch:function(e,t){this.submit("patch",e,t)},delete:function(e,t){this.submit("delete",e,t)},__rememberable:null===t,__remember:function(){return{data:this.data(),errors:this.errors}},__restore:function(e){Object.assign(this,e.data),Object.assign(this.errors,e.errors),this.hasErrors=Object.keys(this.errors).length>0}}));return t&&o.watch(d,(function(e){a.Inertia.remember(i(e.__remember()),t)}),{immediate:!0,deep:!0}),d}var u={props:{as:{type:String,default:"a"},data:{type:Object,default:function(){return{}}},href:{type:String,required:!0},method:{type:String,default:"get"},replace:{type:Boolean,default:!1},preserveScroll:{type:Boolean,default:!1},preserveState:{type:Boolean,default:null},only:{type:Array,default:function(){return[]}},headers:{type:Object,default:function(){return{}}}},setup:function(e,t){var n=t.slots,r=t.attrs;return function(e){var t=e.as.toLowerCase(),i=e.method.toLowerCase(),s=a.mergeDataIntoQueryString(i,a.hrefToUrl(e.href),e.data),u=s[0],c=s[1];return"a"===t&&"get"!==i&&console.warn('Creating POST/PUT/PATCH/DELETE links is discouraged as it causes "Open Link in New Tab/Window" accessibility issues.\n\nPlease specify a more appropriate element using the "as" attribute. For example:\n\n...'),o.h(e.as,l({},r,"a"===t?{href:u.href}:{},{onClick:function(t){var n;a.shouldIntercept(t)&&(t.preventDefault(),a.Inertia.visit(u.href,{data:c,method:i,replace:e.replace,preserveScroll:e.preserveScroll,preserveState:null!=(n=e.preserveState)?n:"get"!==i,only:e.only,headers:e.headers,onCancelToken:r.onCancelToken||function(){return{}},onBefore:r.onBefore||function(){return{}},onStart:r.onStart||function(){return{}},onProgress:r.onProgress||function(){return{}},onFinish:r.onFinish||function(){return{}},onCancel:r.onCancel||function(){return{}},onSuccess:r.onSuccess||function(){return{}},onError:r.onError||function(){return{}}}))}}),n)}}},c={created:function(){var e=this;if(this.$options.remember){Array.isArray(this.$options.remember)&&(this.$options.remember={data:this.$options.remember}),"string"==typeof this.$options.remember&&(this.$options.remember={data:[this.$options.remember]}),"string"==typeof this.$options.remember.data&&(this.$options.remember={data:[this.$options.remember.data]});var t=this.$options.remember.key instanceof Function?this.$options.remember.key.call(this):this.$options.remember.key,n=a.Inertia.restore(t),r=this.$options.remember.data.filter((function(t){return!("object"==typeof e[t]&&null!==e[t]&&!1===e[t].__rememberable)}));r.forEach((function(o){var s="function"==typeof e[o].__remember&&"function"==typeof e[o].__restore;void 0!==e[o]&&void 0!==n&&void 0!==n[o]&&(s?e[o].__restore(n[o]):e[o]=n[o]),e.$watch(o,(function(){a.Inertia.remember(r.reduce((function(t,n){var r;return l({},t,((r={})[n]=i(s?e[n].__remember():e[n]),r))}),{}),t)}),{immediate:!0,deep:!0})}))}}},d=o.ref(null),f=o.ref({}),p=o.ref(null),h={name:"Inertia",props:{initialPage:{type:Object,required:!0},resolveComponent:{type:Function,required:!0},resolveErrors:{type:Function,required:!1},transformProps:{type:Function,required:!1}},setup:function(e){return a.Inertia.init({initialPage:e.initialPage,resolveComponent:e.resolveComponent,resolveErrors:e.resolveErrors,transformProps:e.transformProps,swapComponent:function(e){try{return d.value=o.markRaw(e.component),f.value=e.page,p.value=e.preserveState?p.value:Date.now(),Promise.resolve()}catch(e){return Promise.reject(e)}}}),function(){if(d.value){var e=o.h(d.value,l({},f.value.props,{key:p.value}));return d.value.layout?"function"==typeof d.value.layout?d.value.layout(o.h,e):Array.isArray(d.value.layout)?d.value.layout.concat(e).reverse().reduce((function(e,t){return o.h(t,(function(){return e}))})):o.h(d.value.layout,(function(){return e})):e}}}},m={install:function(e){a.Inertia.form=s,Object.defineProperty(e.config.globalProperties,"$inertia",{get:function(){return a.Inertia}}),Object.defineProperty(e.config.globalProperties,"$page",{get:function(){return f.value}}),e.mixin(c),e.component("InertiaLink",u)}};t.gV=h,t.BA=m},9680:(e,t,n)=>{function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var o=r(n(9669)),i=r(n(3454)),a=r(n(9996));function l(){return(l=Object.assign||function(e){for(var t=1;t0?(u("error",{detail:{errors:n.page.resolvedErrors}}),Y(n.page.resolvedErrors)):(u("success",{detail:{page:n.page}}),$(n.page))})).catch((function(t){if(n.isInertiaResponse(t.response))return n.setPage(t.response.data,{visitId:X});if(n.isLocationVisitResponse(t.response)){var r=f(t.response.headers["x-inertia-location"]);e.hash&&!r.hash&&h(e).href===r.href&&(r.hash=e.hash),n.locationVisit(r,b)}else{if(!t.response)return Promise.reject(t);u("invalid",{cancelable:!0,detail:{response:t.response}})&&s.show(t.response.data)}})).then((function(){n.finishVisit(J)})).catch((function(e){if(!o.isCancel(e)){var t=u("exception",{cancelable:!0,detail:{exception:e}});if(n.finishVisit(J),t)return Promise.reject(e)}})),{get:function(e,t){return["then","catch","finally"].includes(t)&&console.warn("Inertia.js visit promises have been deprecated and will be removed in a future release. Please use the new visit event callbacks instead.\n\nLearn more at https://inertiajs.com/manual-visits#promise-deprecation"),"function"==typeof e[t]?e[t].bind(e):e[t]}})}},setPage:function(e,t){var n=this,r=void 0===t?{}:t,o=r.visitId,i=void 0===o?this.createVisitId():o,a=r.replace,l=void 0!==a&&a,s=r.preserveScroll,u=void 0!==s&&s,c=r.preserveState,p=void 0!==c&&c;return Promise.resolve(this.resolveComponent(e.component)).then((function(t){if(i===n.visitId){e.scrollRegions=e.scrollRegions||[],e.rememberedState=e.rememberedState||{},p="function"==typeof p?p(e):p,u="function"==typeof u?u(e):u,(l=l||f(e.url).href===window.location.href)?n.replaceState(e):n.pushState(e);var r=JSON.parse(JSON.stringify(e));r.props=n.transformProps(r.props),n.swapComponent({component:t,page:r,preserveState:p}).then((function(){u||n.resetScrollPositions(),l||d(e)}))}}))},pushState:function(e){this.page=e,window.history.pushState(e,"",e.url)},replaceState:function(e){this.page=e,window.history.replaceState(e,"",e.url)},handlePopstateEvent:function(e){var t=this;if(null!==e.state){var n=e.state,r=this.createVisitId();return Promise.resolve(this.resolveComponent(n.component)).then((function(e){r===t.visitId&&(t.page=n,t.swapComponent({component:e,page:n,preserveState:!1}).then((function(){t.restoreScrollPositions(),d(n)})))}))}var o=f(this.page.url);o.hash=window.location.hash,this.replaceState(l({},this.page,{url:o.href})),this.resetScrollPositions()},get:function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),this.visit(e,l({},n,{method:"get",data:t}))},reload:function(e){return void 0===e&&(e={}),this.visit(window.location.href,l({},e,{preserveScroll:!0,preserveState:!0}))},replace:function(e,t){var n;return void 0===t&&(t={}),console.warn("Inertia.replace() has been deprecated and will be removed in a future release. Please use Inertia."+(null!=(n=t.method)?n:"get")+"() instead."),this.visit(e,l({preserveState:!0},t,{replace:!0}))},post:function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),this.visit(e,l({preserveState:!0},n,{method:"post",data:t}))},put:function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),this.visit(e,l({preserveState:!0},n,{method:"put",data:t}))},patch:function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),this.visit(e,l({preserveState:!0},n,{method:"patch",data:t}))},delete:function(e,t){return void 0===t&&(t={}),this.visit(e,l({preserveState:!0},t,{method:"delete"}))},remember:function(e,t){var n;void 0===t&&(t="default"),this.replaceState(l({},this.page,{rememberedState:l({},this.page.rememberedState,(n={},n[t]=e,n))}))},restore:function(e){var t,n;return void 0===e&&(e="default"),null==(t=window.history.state)||null==(n=t.rememberedState)?void 0:n[e]},on:function(e,t){var n=function(e){var n=t(e);e.cancelable&&!e.defaultPrevented&&!1===n&&e.preventDefault()};return document.addEventListener("inertia:"+e,n),function(){return document.removeEventListener("inertia:"+e,n)}}},t.hrefToUrl=f,t.mergeDataIntoQueryString=p,t.shouldIntercept=function(e){var t="a"===e.currentTarget.tagName.toLowerCase();return!(e.target&&e.target.isContentEditable||e.defaultPrevented||t&&e.which>1||t&&e.altKey||t&&e.ctrlKey||t&&e.metaKey||t&&e.shiftKey)},t.urlWithoutHash=h},6497:e=>{"use strict";var t=String.prototype.replace,n=/%20/g,r="RFC1738",o="RFC3986";e.exports={default:o,formatters:{RFC1738:function(e){return t.call(e,n,"+")},RFC3986:function(e){return String(e)}},RFC1738:r,RFC3986:o}},3454:(e,t,n)=>{"use strict";var r=n(8250),o=n(2621),i=n(6497);e.exports={formats:i,parse:o,stringify:r}},2621:(e,t,n)=>{"use strict";var r=n(2982),o=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},l=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},s=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},u=function(e,t,n,r){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,l=n.depth>0&&/(\[[^[\]]*])/.exec(i),u=l?i.slice(0,l.index):i,c=[];if(u){if(!n.plainObjects&&o.call(Object.prototype,u)&&!n.allowPrototypes)return;c.push(u)}for(var d=0;n.depth>0&&null!==(l=a.exec(i))&&d=0;--i){var a,l=e[i];if("[]"===l&&n.parseArrays)a=[].concat(o);else{a=n.plainObjects?Object.create(null):{};var u="["===l.charAt(0)&&"]"===l.charAt(l.length-1)?l.slice(1,-1):l,c=parseInt(u,10);n.parseArrays||""!==u?!isNaN(c)&&l!==u&&String(c)===u&&c>=0&&n.parseArrays&&c<=n.arrayLimit?(a=[])[c]=o:a[u]=o:a={0:o}}o=a}return o}(c,t,n,r)}};e.exports=function(e,t){var n=function(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?a.charset:e.charset;return{allowDots:void 0===e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:a.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:a.comma,decoder:"function"==typeof e.decoder?e.decoder:a.decoder,delimiter:"string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var c="string"==typeof e?function(e,t){var n,u={},c=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,d=t.parameterLimit===1/0?void 0:t.parameterLimit,f=c.split(t.delimiter,d),p=-1,h=t.charset;if(t.charsetSentinel)for(n=0;n-1&&(g=i(g)?[g]:g),o.call(u,m)?u[m]=r.combine(u[m],g):u[m]=g}return u}(e,n):e,d=n.plainObjects?Object.create(null):{},f=Object.keys(c),p=0;p{"use strict";var r=n(7478),o=n(2982),i=n(6497),a=Object.prototype.hasOwnProperty,l={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},s=Array.isArray,u=Array.prototype.push,c=function(e,t){u.apply(e,s(t)?t:[t])},d=Date.prototype.toISOString,f=i.default,p={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:o.encode,encodeValuesOnly:!1,format:f,formatter:i.formatters[f],indices:!1,serializeDate:function(e){return d.call(e)},skipNulls:!1,strictNullHandling:!1},h=function e(t,n,i,a,l,u,d,f,h,m,g,y,v,b,_){var w,x=t;if(_.has(t))throw new RangeError("Cyclic object value");if("function"==typeof d?x=d(n,x):x instanceof Date?x=m(x):"comma"===i&&s(x)&&(x=o.maybeMap(x,(function(e){return e instanceof Date?m(e):e}))),null===x){if(a)return u&&!v?u(n,p.encoder,b,"key",g):n;x=""}if("string"==typeof(w=x)||"number"==typeof w||"boolean"==typeof w||"symbol"==typeof w||"bigint"==typeof w||o.isBuffer(x))return u?[y(v?n:u(n,p.encoder,b,"key",g))+"="+y(u(x,p.encoder,b,"value",g))]:[y(n)+"="+y(String(x))];var k,O=[];if(void 0===x)return O;if("comma"===i&&s(x))k=[{value:x.length>0?x.join(",")||null:void 0}];else if(s(d))k=d;else{var S=Object.keys(x);k=f?S.sort(f):S}for(var E=0;E0?_+b:""}},2982:(e,t,n)=>{"use strict";var r=n(6497),o=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),l=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r1;){var t=e.pop(),n=t.obj[t.prop];if(i(n)){for(var r=[],o=0;o=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||i===r.RFC1738&&(40===c||41===c)?s+=l.charAt(u):c<128?s+=a[c]:c<2048?s+=a[192|c>>6]+a[128|63&c]:c<55296||c>=57344?s+=a[224|c>>12]+a[128|c>>6&63]+a[128|63&c]:(u+=1,c=65536+((1023&c)<<10|1023&l.charCodeAt(u)),s+=a[240|c>>18]+a[128|c>>12&63]+a[128|c>>6&63]+a[128|63&c])}return s},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var n=[],r=0;r{var r,o=(r=n(4865))&&"object"==typeof r&&"default"in r?r.default:r,i=null;function a(e){document.addEventListener("inertia:start",l.bind(null,e)),document.addEventListener("inertia:progress",s),document.addEventListener("inertia:finish",u)}function l(e){i=setTimeout((function(){return o.start()}),e)}function s(e){o.isStarted()&&e.detail.progress.percentage&&o.set(Math.max(o.status,e.detail.progress.percentage/100*.9))}function u(e){clearTimeout(i),o.isStarted()&&(e.detail.visit.completed?o.done():e.detail.visit.interrupted?o.set(0):e.detail.visit.cancelled&&(o.done(),o.remove()))}t.I={init:function(e){var t=void 0===e?{}:e,n=t.delay,r=t.color,i=void 0===r?"#29d":r,l=t.includeCSS,s=void 0===l||l,u=t.showSpinner,c=void 0!==u&&u;a(void 0===n?250:n),o.configure({showSpinner:c}),s&&function(e){var t=document.createElement("style");t.type="text/css",t.textContent="\n #nprogress {\n pointer-events: none;\n }\n\n #nprogress .bar {\n background: "+e+";\n\n position: fixed;\n z-index: 1031;\n top: 0;\n left: 0;\n\n width: 100%;\n height: 2px;\n }\n\n #nprogress .peg {\n display: block;\n position: absolute;\n right: 0px;\n width: 100px;\n height: 100%;\n box-shadow: 0 0 10px "+e+", 0 0 5px "+e+";\n opacity: 1.0;\n\n -webkit-transform: rotate(3deg) translate(0px, -4px);\n -ms-transform: rotate(3deg) translate(0px, -4px);\n transform: rotate(3deg) translate(0px, -4px);\n }\n\n #nprogress .spinner {\n display: block;\n position: fixed;\n z-index: 1031;\n top: 15px;\n right: 15px;\n }\n\n #nprogress .spinner-icon {\n width: 18px;\n height: 18px;\n box-sizing: border-box;\n\n border: solid 2px transparent;\n border-top-color: "+e+";\n border-left-color: "+e+";\n border-radius: 50%;\n\n -webkit-animation: nprogress-spinner 400ms linear infinite;\n animation: nprogress-spinner 400ms linear infinite;\n }\n\n .nprogress-custom-parent {\n overflow: hidden;\n position: relative;\n }\n\n .nprogress-custom-parent #nprogress .spinner,\n .nprogress-custom-parent #nprogress .bar {\n position: absolute;\n }\n\n @-webkit-keyframes nprogress-spinner {\n 0% { -webkit-transform: rotate(0deg); }\n 100% { -webkit-transform: rotate(360deg); }\n }\n @keyframes nprogress-spinner {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n ",document.head.appendChild(t)}(i)}}},2262:(e,t,n)=>{"use strict";n.d(t,{Fl:()=>Me,ZM:()=>Ce,cE:()=>u,X3:()=>he,PG:()=>fe,$y:()=>pe,dq:()=>ve,Xl:()=>ge,Jd:()=>m,WL:()=>Ee,qj:()=>le,OT:()=>ue,iH:()=>be,lk:()=>g,Um:()=>se,YS:()=>ce,XI:()=>_e,sT:()=>c,IU:()=>me,Vh:()=>Te,BK:()=>je,j:()=>y,X$:()=>v,oR:()=>ke,SU:()=>Oe});var r=n(3577);const o=new WeakMap,i=[];let a;const l=Symbol(""),s=Symbol("");function u(e,t=r.kT){(function(e){return e&&!0===e._isEffect})(e)&&(e=e.raw);const n=function(e,t){const n=function(){if(!n.active)return t.scheduler?void 0:e();if(!i.includes(n)){f(n);try{return h.push(p),p=!0,i.push(n),a=n,e()}finally{i.pop(),g(),a=i[i.length-1]}}};return n.id=d++,n.allowRecurse=!!t.allowRecurse,n._isEffect=!0,n.active=!0,n.raw=e,n.deps=[],n.options=t,n}(e,t);return t.lazy||n(),n}function c(e){e.active&&(f(e),e.options.onStop&&e.options.onStop(),e.active=!1)}let d=0;function f(e){const{deps:t}=e;if(t.length){for(let n=0;n{e&&e.forEach((e=>{(e!==a||e.allowRecurse)&&f.add(e)}))};if("clear"===t)d.forEach(p);else if("length"===n&&(0,r.kJ)(e))d.forEach(((e,t)=>{("length"===t||t>=i)&&p(e)}));else switch(void 0!==n&&p(d.get(n)),t){case"add":(0,r.kJ)(e)?(0,r.S0)(n)&&p(d.get("length")):(p(d.get(l)),(0,r._N)(e)&&p(d.get(s)));break;case"delete":(0,r.kJ)(e)||(p(d.get(l)),(0,r._N)(e)&&p(d.get(s)));break;case"set":(0,r._N)(e)&&p(d.get(l))}f.forEach((e=>{e.options.scheduler?e.options.scheduler(e):e()}))}const b=(0,r.fY)("__proto__,__v_isRef,__isVue"),_=new Set(Object.getOwnPropertyNames(Symbol).map((e=>Symbol[e])).filter(r.yk)),w=E(),x=E(!1,!0),k=E(!0),O=E(!0,!0),S={};function E(e=!1,t=!1){return function(n,o,i){if("__v_isReactive"===o)return!e;if("__v_isReadonly"===o)return e;if("__v_raw"===o&&i===(e?t?ae:ie:t?oe:re).get(n))return n;const a=(0,r.kJ)(n);if(!e&&a&&(0,r.RI)(S,o))return Reflect.get(S,o,i);const l=Reflect.get(n,o,i);if((0,r.yk)(o)?_.has(o):b(o))return l;if(e||y(n,0,o),t)return l;if(ve(l)){return!a||!(0,r.S0)(o)?l.value:l}return(0,r.Kn)(l)?e?ue(l):le(l):l}}["includes","indexOf","lastIndexOf"].forEach((e=>{const t=Array.prototype[e];S[e]=function(...e){const n=me(this);for(let e=0,t=this.length;e{const t=Array.prototype[e];S[e]=function(...e){m();const n=t.apply(this,e);return g(),n}}));const A=j(),C=j(!0);function j(e=!1){return function(t,n,o,i){let a=t[n];if(!e&&(o=me(o),a=me(a),!(0,r.kJ)(t)&&ve(a)&&!ve(o)))return a.value=o,!0;const l=(0,r.kJ)(t)&&(0,r.S0)(n)?Number(n)!0,deleteProperty:(e,t)=>!0},W=(0,r.l7)({},P,{get:x,set:C}),M=(0,r.l7)({},T,{get:O}),N=e=>(0,r.Kn)(e)?le(e):e,V=e=>(0,r.Kn)(e)?ue(e):e,L=e=>e,R=e=>Reflect.getPrototypeOf(e);function I(e,t,n=!1,r=!1){const o=me(e=e.__v_raw),i=me(t);t!==i&&!n&&y(o,0,t),!n&&y(o,0,i);const{has:a}=R(o),l=r?L:n?V:N;return a.call(o,t)?l(e.get(t)):a.call(o,i)?l(e.get(i)):void 0}function U(e,t=!1){const n=this.__v_raw,r=me(n),o=me(e);return e!==o&&!t&&y(r,0,e),!t&&y(r,0,o),e===o?n.has(e):n.has(e)||n.has(o)}function D(e,t=!1){return e=e.__v_raw,!t&&y(me(e),0,l),Reflect.get(e,"size",e)}function q(e){e=me(e);const t=me(this);return R(t).has.call(t,e)||(t.add(e),v(t,"add",e,e)),this}function z(e,t){t=me(t);const n=me(this),{has:o,get:i}=R(n);let a=o.call(n,e);a||(e=me(e),a=o.call(n,e));const l=i.call(n,e);return n.set(e,t),a?(0,r.aU)(t,l)&&v(n,"set",e,t):v(n,"add",e,t),this}function F(e){const t=me(this),{has:n,get:r}=R(t);let o=n.call(t,e);o||(e=me(e),o=n.call(t,e));r&&r.call(t,e);const i=t.delete(e);return o&&v(t,"delete",e,void 0),i}function B(){const e=me(this),t=0!==e.size,n=e.clear();return t&&v(e,"clear",void 0,void 0),n}function $(e,t){return function(n,r){const o=this,i=o.__v_raw,a=me(i),s=t?L:e?V:N;return!e&&y(a,0,l),i.forEach(((e,t)=>n.call(r,s(e),s(t),o)))}}function H(e,t,n){return function(...o){const i=this.__v_raw,a=me(i),u=(0,r._N)(a),c="entries"===e||e===Symbol.iterator&&u,d="keys"===e&&u,f=i[e](...o),p=n?L:t?V:N;return!t&&y(a,0,d?s:l),{next(){const{value:e,done:t}=f.next();return t?{value:e,done:t}:{value:c?[p(e[0]),p(e[1])]:p(e),done:t}},[Symbol.iterator](){return this}}}}function Y(e){return function(...t){return"delete"!==e&&this}}const K={get(e){return I(this,e)},get size(){return D(this)},has:U,add:q,set:z,delete:F,clear:B,forEach:$(!1,!1)},G={get(e){return I(this,e,!1,!0)},get size(){return D(this)},has:U,add:q,set:z,delete:F,clear:B,forEach:$(!1,!0)},J={get(e){return I(this,e,!0)},get size(){return D(this,!0)},has(e){return U.call(this,e,!0)},add:Y("add"),set:Y("set"),delete:Y("delete"),clear:Y("clear"),forEach:$(!0,!1)},X={get(e){return I(this,e,!0,!0)},get size(){return D(this,!0)},has(e){return U.call(this,e,!0)},add:Y("add"),set:Y("set"),delete:Y("delete"),clear:Y("clear"),forEach:$(!0,!0)};function Z(e,t){const n=t?e?X:G:e?J:K;return(t,o,i)=>"__v_isReactive"===o?!e:"__v_isReadonly"===o?e:"__v_raw"===o?t:Reflect.get((0,r.RI)(n,o)&&o in t?n:t,o,i)}["keys","values","entries",Symbol.iterator].forEach((e=>{K[e]=H(e,!1,!1),J[e]=H(e,!0,!1),G[e]=H(e,!1,!0),X[e]=H(e,!0,!0)}));const Q={get:Z(!1,!1)},ee={get:Z(!1,!0)},te={get:Z(!0,!1)},ne={get:Z(!0,!0)};const re=new WeakMap,oe=new WeakMap,ie=new WeakMap,ae=new WeakMap;function le(e){return e&&e.__v_isReadonly?e:de(e,!1,P,Q,re)}function se(e){return de(e,!1,W,ee,oe)}function ue(e){return de(e,!0,T,te,ie)}function ce(e){return de(e,!0,M,ne,ae)}function de(e,t,n,o,i){if(!(0,r.Kn)(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const a=i.get(e);if(a)return a;const l=(s=e).__v_skip||!Object.isExtensible(s)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((0,r.W7)(s));var s;if(0===l)return e;const u=new Proxy(e,2===l?o:n);return i.set(e,u),u}function fe(e){return pe(e)?fe(e.__v_raw):!(!e||!e.__v_isReactive)}function pe(e){return!(!e||!e.__v_isReadonly)}function he(e){return fe(e)||pe(e)}function me(e){return e&&me(e.__v_raw)||e}function ge(e){return(0,r.Nj)(e,"__v_skip",!0),e}const ye=e=>(0,r.Kn)(e)?le(e):e;function ve(e){return Boolean(e&&!0===e.__v_isRef)}function be(e){return xe(e)}function _e(e){return xe(e,!0)}class we{constructor(e,t=!1){this._rawValue=e,this._shallow=t,this.__v_isRef=!0,this._value=t?e:ye(e)}get value(){return y(me(this),0,"value"),this._value}set value(e){(0,r.aU)(me(e),this._rawValue)&&(this._rawValue=e,this._value=this._shallow?e:ye(e),v(me(this),"set","value",e))}}function xe(e,t=!1){return ve(e)?e:new we(e,t)}function ke(e){v(me(e),"set","value",void 0)}function Oe(e){return ve(e)?e.value:e}const Se={get:(e,t,n)=>Oe(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return ve(o)&&!ve(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function Ee(e){return fe(e)?e:new Proxy(e,Se)}class Ae{constructor(e){this.__v_isRef=!0;const{get:t,set:n}=e((()=>y(this,0,"value")),(()=>v(this,"set","value")));this._get=t,this._set=n}get value(){return this._get()}set value(e){this._set(e)}}function Ce(e){return new Ae(e)}function je(e){const t=(0,r.kJ)(e)?new Array(e.length):{};for(const n in e)t[n]=Te(e,n);return t}class Pe{constructor(e,t){this._object=e,this._key=t,this.__v_isRef=!0}get value(){return this._object[this._key]}set value(e){this._object[this._key]=e}}function Te(e,t){return ve(e[t])?e[t]:new Pe(e,t)}class We{constructor(e,t,n){this._setter=t,this._dirty=!0,this.__v_isRef=!0,this.effect=u(e,{lazy:!0,scheduler:()=>{this._dirty||(this._dirty=!0,v(me(this),"set","value"))}}),this.__v_isReadonly=n}get value(){const e=me(this);return e._dirty&&(e._value=this.effect(),e._dirty=!1),y(e,0,"value"),e._value}set value(e){this._setter(e)}}function Me(e){let t,n;return(0,r.mf)(e)?(t=e,n=r.dG):(t=e.get,n=e.set),new We(t,n,(0,r.mf)(e)||!e.set)}},6252:(e,t,n)=>{"use strict";n.d(t,{ZM:()=>r.ZM,X3:()=>r.X3,PG:()=>r.PG,$y:()=>r.$y,dq:()=>r.dq,Xl:()=>r.Xl,WL:()=>r.WL,qj:()=>r.qj,OT:()=>r.OT,iH:()=>r.iH,Um:()=>r.Um,YS:()=>r.YS,XI:()=>r.XI,IU:()=>r.IU,Vh:()=>r.Vh,BK:()=>r.BK,oR:()=>r.oR,SU:()=>r.SU,_A:()=>o._A,kC:()=>o.kC,zw:()=>o.zw,hR:()=>o.hR,P$:()=>Re,sv:()=>It,HY:()=>Lt,Ob:()=>$e,qG:()=>Ut,n4:()=>ae,lR:()=>Ct,xv:()=>Rt,$d:()=>c,KU:()=>u,Ho:()=>nn,Fl:()=>Fn,j4:()=>Yt,ry:()=>an,Eo:()=>_t,Us:()=>bt,Nv:()=>Qn,uE:()=>on,Uk:()=>rn,Wm:()=>en,RC:()=>ht,aZ:()=>pt,zX:()=>$n,MW:()=>Bn,mW:()=>N,FN:()=>Cn,Q6:()=>Fe,h:()=>Yn,S3:()=>d,Mr:()=>Jn,f3:()=>fn,of:()=>Nn,lA:()=>Kt,dG:()=>cn,Y3:()=>S,dl:()=>Ye,wF:()=>_e,Jd:()=>Oe,Xn:()=>xe,se:()=>Ke,d1:()=>Ce,bv:()=>we,bT:()=>Ae,Yq:()=>Ee,Ah:()=>Se,ic:()=>ke,wg:()=>zt,Cn:()=>X,JJ:()=>dn,dD:()=>J,qb:()=>j,Y1:()=>Vn,Ko:()=>Xn,WI:()=>$,up:()=>Pt,Q2:()=>Mt,LL:()=>Wt,U2:()=>Ue,qZ:()=>Ht,ec:()=>V,nK:()=>ze,Uc:()=>Kn,G:()=>tr,mx:()=>Zn,C3:()=>Jt,qp:()=>Hn,Zq:()=>Gn,Y8:()=>Ve,i8:()=>er,ZK:()=>a,YP:()=>Te,m0:()=>je,w5:()=>Q,wy:()=>ot,HX:()=>Z});var r=n(2262),o=n(3577);const i=[];function a(e,...t){(0,r.Jd)();const n=i.length?i[i.length-1].component:null,o=n&&n.appContext.config.warnHandler,a=function(){let e=i[i.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const r=e.component&&e.component.parent;e=r&&r.vnode}return t}();if(o)u(o,n,11,[e+t.join(""),n&&n.proxy,a.map((({vnode:e})=>`at <${qn(n,e.type)}>`)).join("\n"),a]);else{const n=[`[Vue warn]: ${e}`,...t];a.length&&n.push("\n",...function(e){const t=[];return e.forEach(((e,n)=>{t.push(...0===n?[]:["\n"],...function({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",r=!!e.component&&null==e.component.parent,o=` at <${qn(e.component,e.type,r)}`,i=">"+n;return e.props?[o,...l(e.props),i]:[o+i]}(e))})),t}(a)),console.warn(...n)}(0,r.lk)()}function l(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach((n=>{t.push(...s(n,e[n]))})),n.length>3&&t.push(" ..."),t}function s(e,t,n){return(0,o.HD)(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):"number"==typeof t||"boolean"==typeof t||null==t?n?t:[`${e}=${t}`]:(0,r.dq)(t)?(t=s(e,(0,r.IU)(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):(0,o.mf)(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=(0,r.IU)(t),n?t:[`${e}=`,t])}function u(e,t,n,r){let o;try{o=r?e(...r):e()}catch(e){d(e,t,n)}return o}function c(e,t,n,r){if((0,o.mf)(e)){const i=u(e,t,n,r);return i&&(0,o.tI)(i)&&i.catch((e=>{d(e,t,n)})),i}const i=[];for(let o=0;o>>1;W(h[e])-1?h.splice(t,0,e):h.push(e),A()}}function A(){f||p||(p=!0,k=x.then(M))}function C(e,t,n,r){(0,o.kJ)(e)?n.push(...e):t&&t.includes(e,e.allowRecurse?r+1:r)||n.push(e),A()}function j(e){C(e,_,b,w)}function P(e,t=null){if(g.length){for(O=t,y=[...new Set(g)],g.length=0,v=0;vW(e)-W(t))),w=0;w<_.length;w++)_[w]();_=null,w=0}}const W=e=>null==e.id?1/0:e.id;function M(e){p=!1,f=!0,P(e),h.sort(((e,t)=>W(e)-W(t)));try{for(m=0;m{N&&N.emit(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}function D(e,t,...n){const r=e.vnode.props||o.kT;let i=n;const a=t.startsWith("update:"),l=a&&t.slice(7);if(l&&l in r){const e=`${"modelValue"===l?"model":l}Modifiers`,{number:t,trim:a}=r[e]||o.kT;a?i=n.map((e=>e.trim())):t&&(i=n.map(o.He))}let s;__VUE_PROD_DEVTOOLS__&&function(e,t,n){N&&N.emit("component:emit",e.appContext.app,e,t,n)}(e,t,i);let u=r[s=(0,o.hR)(t)]||r[s=(0,o.hR)((0,o._A)(t))];!u&&a&&(u=r[s=(0,o.hR)((0,o.rs)(t))]),u&&c(u,e,6,i);const d=r[s+"Once"];if(d){if(e.emitted){if(e.emitted[s])return}else(e.emitted={})[s]=!0;c(d,e,6,i)}}function q(e,t,n=!1){if(!t.deopt&&void 0!==e.__emits)return e.__emits;const r=e.emits;let i={},a=!1;if(__VUE_OPTIONS_API__&&!(0,o.mf)(e)){const r=e=>{const n=q(e,t,!0);n&&(a=!0,(0,o.l7)(i,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return r||a?((0,o.kJ)(r)?r.forEach((e=>i[e]=null)):(0,o.l7)(i,r),e.__emits=i):e.__emits=null}function z(e,t){return!(!e||!(0,o.F7)(t))&&(t=t.slice(2).replace(/Once$/,""),(0,o.RI)(e,t[0].toLowerCase()+t.slice(1))||(0,o.RI)(e,(0,o.rs)(t))||(0,o.RI)(e,t))}let F=0;const B=e=>F+=e;function $(e,t,n={},r,o){let i=e[t];F++,zt();const a=i&&H(i(n)),l=Yt(Lt,{key:n.key||`_${t}`},a||(r?r():[]),a&&1===e._?64:-2);return!o&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),F--,l}function H(e){return e.some((e=>!Kt(e)||e.type!==It&&!(e.type===Lt&&!H(e.children))))?e:null}let Y=null,K=null;function G(e){const t=Y;return Y=e,K=e&&e.type.__scopeId||null,t}function J(e){K=e}function X(){K=null}const Z=e=>Q;function Q(e,t=Y){if(!t)return e;const n=(...n)=>{F||zt(!0);const r=G(t),o=e(...n);return G(r),F||Ft(),o};return n._c=!0,n}function ee(e){const{type:t,vnode:n,proxy:r,withProxy:i,props:a,propsOptions:[l],slots:s,attrs:u,emit:c,render:f,renderCache:p,data:h,setupState:m,ctx:g}=e;let y;const v=G(e);try{let e;if(4&n.shapeFlag){const t=i||r;y=ln(f.call(t,t,p,a,m,h,g)),e=u}else{const n=t;0,y=ln(n.length>1?n(a,{attrs:u,slots:s,emit:c}):n(a,null)),e=t.props?u:ne(u)}let d=y;if(!1!==t.inheritAttrs&&e){const t=Object.keys(e),{shapeFlag:n}=d;t.length&&(1&n||6&n)&&(l&&t.some(o.tR)&&(e=re(e,l)),d=nn(d,e))}n.dirs&&(d.dirs=d.dirs?d.dirs.concat(n.dirs):n.dirs),n.transition&&(d.transition=n.transition),y=d}catch(t){Dt.length=0,d(t,e,1),y=en(It)}return G(v),y}function te(e){let t;for(let n=0;n{let t;for(const n in e)("class"===n||"style"===n||(0,o.F7)(n))&&((t||(t={}))[n]=e[n]);return t},re=(e,t)=>{const n={};for(const r in e)(0,o.tR)(r)&&r.slice(9)in t||(n[r]=e[r]);return n};function oe(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let o=0;o0?(u(null,e.ssFallback,t,n,r,null,i,a),ce(f,e.ssFallback)):f.resolve()}(t,n,r,i,a,l,s,u,c):function(e,t,n,r,i,a,l,s,{p:u,um:c,o:{createElement:d}}){const f=t.suspense=e.suspense;f.vnode=t,t.el=e.el;const p=t.ssContent,h=t.ssFallback,{activeBranch:m,pendingBranch:g,isInFallback:y,isHydrating:v}=f;if(g)f.pendingBranch=p,Gt(p,g)?(u(g,p,f.hiddenContainer,null,i,f,a,l,s),f.deps<=0?f.resolve():y&&(u(m,h,n,r,i,null,a,l,s),ce(f,h))):(f.pendingId++,v?(f.isHydrating=!1,f.activeBranch=g):c(g,i,f),f.deps=0,f.effects.length=0,f.hiddenContainer=d("div"),y?(u(null,p,f.hiddenContainer,null,i,f,a,l,s),f.deps<=0?f.resolve():(u(m,h,n,r,i,null,a,l,s),ce(f,h))):m&&Gt(p,m)?(u(m,p,n,r,i,f,a,l,s),f.resolve(!0)):(u(null,p,f.hiddenContainer,null,i,f,a,l,s),f.deps<=0&&f.resolve()));else if(m&&Gt(p,m))u(m,p,n,r,i,f,a,l,s),ce(f,p);else{const e=t.props&&t.props.onPending;if((0,o.mf)(e)&&e(),f.pendingBranch=p,f.pendingId++,u(null,p,f.hiddenContainer,null,i,f,a,l,s),f.deps<=0)f.resolve();else{const{timeout:e,pendingId:t}=f;e>0?setTimeout((()=>{f.pendingId===t&&f.fallback(h)}),e):0===e&&f.fallback(h)}}}(e,t,n,r,i,l,s,u,c)},hydrate:function(e,t,n,r,o,i,a,l,s){const u=t.suspense=le(t,r,n,e.parentNode,document.createElement("div"),null,o,i,a,l,!0),c=s(e,u.pendingBranch=t.ssContent,n,u,i,a);0===u.deps&&u.resolve();return c},create:le};function le(e,t,n,r,i,a,l,s,u,c,f=!1){const{p,m:h,um:m,n:g,o:{parentNode:y,remove:v}}=c,b=(0,o.He)(e.props&&e.props.timeout),_={vnode:e,parent:t,parentComponent:n,isSVG:l,container:r,hiddenContainer:i,anchor:a,deps:0,pendingId:0,timeout:"number"==typeof b?b:-1,activeBranch:null,pendingBranch:null,isInFallback:!0,isHydrating:f,isUnmounted:!1,effects:[],resolve(e=!1){const{vnode:t,activeBranch:n,pendingBranch:r,pendingId:i,effects:a,parentComponent:l,container:s}=_;if(_.isHydrating)_.isHydrating=!1;else if(!e){const e=n&&r.transition&&"out-in"===r.transition.mode;e&&(n.transition.afterLeave=()=>{i===_.pendingId&&h(r,s,t,0)});let{anchor:t}=_;n&&(t=g(n),m(n,l,_,!0)),e||h(r,s,t,0)}ce(_,r),_.pendingBranch=null,_.isInFallback=!1;let u=_.parent,c=!1;for(;u;){if(u.pendingBranch){u.effects.push(...a),c=!0;break}u=u.parent}c||j(a),_.effects=[];const d=t.props&&t.props.onResolve;(0,o.mf)(d)&&d()},fallback(e){if(!_.pendingBranch)return;const{vnode:t,activeBranch:n,parentComponent:r,container:i,isSVG:a}=_,l=t.props&&t.props.onFallback;(0,o.mf)(l)&&l();const c=g(n),d=()=>{_.isInFallback&&(p(null,e,i,c,r,null,a,s,u),ce(_,e))},f=e.transition&&"out-in"===e.transition.mode;f&&(n.transition.afterLeave=d),m(n,r,null,!0),_.isInFallback=!0,f||d()},move(e,t,n){_.activeBranch&&h(_.activeBranch,e,t,n),_.container=e},next:()=>_.activeBranch&&g(_.activeBranch),registerDep(e,t){const n=!!_.pendingBranch;n&&_.deps++;const r=e.vnode.el;e.asyncDep.catch((t=>{d(t,e,0)})).then((o=>{if(e.isUnmounted||_.isUnmounted||_.pendingId!==e.suspenseId)return;e.asyncResolved=!0;const{vnode:i}=e;Mn(e,o,!1),r&&(i.el=r);const a=!r&&e.subTree.el;t(e,i,y(r||e.subTree.el),r?null:g(e.subTree),_,l,u),a&&v(a),ie(e,i.el),n&&0==--_.deps&&_.resolve()}))},unmount(e,t){_.isUnmounted=!0,_.activeBranch&&m(_.activeBranch,n,e,t),_.pendingBranch&&m(_.pendingBranch,n,e,t)}};return _}function se(e){if((0,o.mf)(e)&&(e=e()),(0,o.kJ)(e)){0,e=te(e)}return ln(e)}function ue(e,t){t&&t.pendingBranch?(0,o.kJ)(e)?t.effects.push(...e):t.effects.push(e):j(e)}function ce(e,t){e.activeBranch=t;const{vnode:n,parentComponent:r}=e,o=n.el=t.el;r&&r.subTree===n&&(r.vnode.el=o,ie(r,o))}function de(e,t,n,i){const[a,l]=e.propsOptions;if(t)for(const r in t){const l=t[r];if((0,o.Gg)(r))continue;let s;a&&(0,o.RI)(a,s=(0,o._A)(r))?n[s]=l:z(e.emitsOptions,r)||(i[r]=l)}if(l){const t=(0,r.IU)(n);for(let r=0;r{l=!0;const[n,r]=pe(e,t,!0);(0,o.l7)(i,n),r&&a.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!r&&!l)return e.__props=o.Z6;if((0,o.kJ)(r))for(let e=0;e-1,l[1]=n<0||e-1||(0,o.RI)(l,"default"))&&a.push(t)}}}}return e.__props=[i,a]}function he(e){return"$"!==e[0]}function me(e){const t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:""}function ge(e,t){return me(e)===me(t)}function ye(e,t){return(0,o.kJ)(t)?t.findIndex((t=>ge(t,e))):(0,o.mf)(t)&&ge(t,e)?0:-1}function ve(e,t,n=An,o=!1){if(n){const i=n[e]||(n[e]=[]),a=t.__weh||(t.__weh=(...o)=>{if(n.isUnmounted)return;(0,r.Jd)(),jn(n);const i=c(t,n,e,o);return jn(null),(0,r.lk)(),i});return o?i.unshift(a):i.push(a),a}}const be=e=>(t,n=An)=>!Wn&&ve(e,t,n),_e=be("bm"),we=be("m"),xe=be("bu"),ke=be("u"),Oe=be("bum"),Se=be("um"),Ee=be("rtg"),Ae=be("rtc"),Ce=(e,t=An)=>{ve("ec",e,t)};function je(e,t){return We(e,null,t)}const Pe={};function Te(e,t,n){return We(e,t,n)}function We(e,t,{immediate:n,deep:i,flush:a,onTrack:l,onTrigger:s}=o.kT,d=An){let f,p,h=!1;if((0,r.dq)(e)?(f=()=>e.value,h=!!e._shallow):(0,r.PG)(e)?(f=()=>e,i=!0):f=(0,o.kJ)(e)?()=>e.map((e=>(0,r.dq)(e)?e.value:(0,r.PG)(e)?Ne(e):(0,o.mf)(e)?u(e,d,2,[d&&d.proxy]):void 0)):(0,o.mf)(e)?t?()=>u(e,d,2,[d&&d.proxy]):()=>{if(!d||!d.isUnmounted)return p&&p(),c(e,d,3,[m])}:o.dG,t&&i){const e=f;f=()=>Ne(e())}let m=e=>{p=x.options.onStop=()=>{u(e,d,4)}},b=(0,o.kJ)(e)?[]:Pe;const _=()=>{if(x.active)if(t){const e=x();(i||h||(0,o.aU)(e,b))&&(p&&p(),c(t,d,3,[e,b===Pe?void 0:b,m]),b=e)}else x()};let w;_.allowRecurse=!!t,w="sync"===a?_:"post"===a?()=>yt(_,d&&d.suspense):()=>{!d||d.isMounted?function(e){C(e,y,g,v)}(_):_()};const x=(0,r.cE)(f,{lazy:!0,onTrack:l,onTrigger:s,scheduler:w});return In(x,d),t?n?_():b=x():"post"===a?yt(x,d&&d.suspense):x(),()=>{(0,r.sT)(x),d&&(0,o.Od)(d.effects,x)}}function Me(e,t,n){const r=this.proxy;return We((0,o.HD)(e)?()=>r[e]:e.bind(r),t.bind(r),n,this)}function Ne(e,t=new Set){if(!(0,o.Kn)(e)||t.has(e))return e;if(t.add(e),(0,r.dq)(e))Ne(e.value,t);else if((0,o.kJ)(e))for(let n=0;n{Ne(e,t)}));else for(const n in e)Ne(e[n],t);return e}function Ve(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return we((()=>{e.isMounted=!0})),Oe((()=>{e.isUnmounting=!0})),e}const Le=[Function,Array],Re={name:"BaseTransition",props:{mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Le,onEnter:Le,onAfterEnter:Le,onEnterCancelled:Le,onBeforeLeave:Le,onLeave:Le,onAfterLeave:Le,onLeaveCancelled:Le,onBeforeAppear:Le,onAppear:Le,onAfterAppear:Le,onAppearCancelled:Le},setup(e,{slots:t}){const n=Cn(),o=Ve();let i;return()=>{const a=t.default&&Fe(t.default(),!0);if(!a||!a.length)return;const l=(0,r.IU)(e),{mode:s}=l;const u=a[0];if(o.isLeaving)return De(u);const c=qe(u);if(!c)return De(u);const d=Ue(c,l,o,n);ze(c,d);const f=n.subTree,p=f&&qe(f);let h=!1;const{getTransitionKey:m}=c.type;if(m){const e=m();void 0===i?i=e:e!==i&&(i=e,h=!0)}if(p&&p.type!==It&&(!Gt(c,p)||h)){const e=Ue(p,l,o,n);if(ze(p,e),"out-in"===s)return o.isLeaving=!0,e.afterLeave=()=>{o.isLeaving=!1,n.update()},De(u);"in-out"===s&&c.type!==It&&(e.delayLeave=(e,t,n)=>{Ie(o,p)[String(p.key)]=p,e._leaveCb=()=>{t(),e._leaveCb=void 0,delete d.delayedLeave},d.delayedLeave=n})}return u}}};function Ie(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function Ue(e,t,n,r){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:s,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:p,onAfterLeave:h,onLeaveCancelled:m,onBeforeAppear:g,onAppear:y,onAfterAppear:v,onAppearCancelled:b}=t,_=String(e.key),w=Ie(n,e),x=(e,t)=>{e&&c(e,r,9,t)},k={mode:i,persisted:a,beforeEnter(t){let r=l;if(!n.isMounted){if(!o)return;r=g||l}t._leaveCb&&t._leaveCb(!0);const i=w[_];i&&Gt(e,i)&&i.el._leaveCb&&i.el._leaveCb(),x(r,[t])},enter(e){let t=s,r=u,i=d;if(!n.isMounted){if(!o)return;t=y||s,r=v||u,i=b||d}let a=!1;const l=e._enterCb=t=>{a||(a=!0,x(t?i:r,[e]),k.delayedLeave&&k.delayedLeave(),e._enterCb=void 0)};t?(t(e,l),t.length<=1&&l()):l()},leave(t,r){const o=String(e.key);if(t._enterCb&&t._enterCb(!0),n.isUnmounting)return r();x(f,[t]);let i=!1;const a=t._leaveCb=n=>{i||(i=!0,r(),x(n?m:h,[t]),t._leaveCb=void 0,w[o]===e&&delete w[o])};w[o]=e,p?(p(t,a),p.length<=1&&a()):a()},clone:e=>Ue(e,t,n,r)};return k}function De(e){if(Be(e))return(e=nn(e)).children=null,e}function qe(e){return Be(e)?e.children?e.children[0]:void 0:e}function ze(e,t){6&e.shapeFlag&&e.component?ze(e.component.subTree,t):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Fe(e,t=!1){let n=[],r=0;for(let o=0;o1)for(let e=0;ee.type.__isKeepAlive,$e={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Cn(),r=n.ctx;if(!r.renderer)return t.default;const i=new Map,a=new Set;let l=null;const s=n.suspense,{renderer:{p:u,m:c,um:d,o:{createElement:f}}}=r,p=f("div");function h(e){Xe(e),d(e,n,s)}function m(e){i.forEach(((t,n)=>{const r=Dn(t.type);!r||e&&e(r)||g(n)}))}function g(e){const t=i.get(e);l&&t.type===l.type?l&&Xe(l):h(t),i.delete(e),a.delete(e)}r.activate=(e,t,n,r,i)=>{const a=e.component;c(e,t,n,0,s),u(a.vnode,e,t,n,a,s,r,e.slotScopeIds,i),yt((()=>{a.isDeactivated=!1,a.a&&(0,o.ir)(a.a);const t=e.props&&e.props.onVnodeMounted;t&&xt(t,a.parent,e)}),s)},r.deactivate=e=>{const t=e.component;c(e,p,null,1,s),yt((()=>{t.da&&(0,o.ir)(t.da);const n=e.props&&e.props.onVnodeUnmounted;n&&xt(n,t.parent,e),t.isDeactivated=!0}),s)},Te((()=>[e.include,e.exclude]),(([e,t])=>{e&&m((t=>He(e,t))),t&&m((e=>!He(t,e)))}),{flush:"post",deep:!0});let y=null;const v=()=>{null!=y&&i.set(y,Ze(n.subTree))};return we(v),ke(v),Oe((()=>{i.forEach((e=>{const{subTree:t,suspense:r}=n,o=Ze(t);if(e.type!==o.type)h(e);else{Xe(o);const e=o.component.da;e&&yt(e,r)}}))})),()=>{if(y=null,!t.default)return null;const n=t.default(),r=n[0];if(n.length>1)return l=null,n;if(!(Kt(r)&&(4&r.shapeFlag||128&r.shapeFlag)))return l=null,r;let o=Ze(r);const s=o.type,u=Dn(s),{include:c,exclude:d,max:f}=e;if(c&&(!u||!He(c,u))||d&&u&&He(d,u))return l=o,r;const p=null==o.key?s:o.key,h=i.get(p);return o.el&&(o=nn(o),128&r.shapeFlag&&(r.ssContent=o)),y=p,h?(o.el=h.el,o.component=h.component,o.transition&&ze(o,o.transition),o.shapeFlag|=512,a.delete(p),a.add(p)):(a.add(p),f&&a.size>parseInt(f,10)&&g(a.values().next().value)),o.shapeFlag|=256,l=o,r}}};function He(e,t){return(0,o.kJ)(e)?e.some((e=>He(e,t))):(0,o.HD)(e)?e.split(",").indexOf(t)>-1:!!e.test&&e.test(t)}function Ye(e,t){Ge(e,"a",t)}function Ke(e,t){Ge(e,"da",t)}function Ge(e,t,n=An){const r=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}e()});if(ve(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Be(e.parent.vnode)&&Je(r,t,n,e),e=e.parent}}function Je(e,t,n,r){const i=ve(t,e,r,!0);Se((()=>{(0,o.Od)(r[t],i)}),n)}function Xe(e){let t=e.shapeFlag;256&t&&(t-=256),512&t&&(t-=512),e.shapeFlag=t}function Ze(e){return 128&e.shapeFlag?e.ssContent:e}const Qe=e=>"_"===e[0]||"$stable"===e,et=e=>(0,o.kJ)(e)?e.map(ln):[ln(e)],tt=(e,t,n)=>Q((e=>et(t(e))),n),nt=(e,t)=>{const n=e._ctx;for(const r in e){if(Qe(r))continue;const i=e[r];if((0,o.mf)(i))t[r]=tt(0,i,n);else if(null!=i){0;const e=et(i);t[r]=()=>e}}},rt=(e,t)=>{const n=et(t);e.slots.default=()=>n};function ot(e,t){if(null===Y)return e;const n=Y.proxy,r=e.dirs||(e.dirs=[]);for(let e=0;e(a.has(e)||(e&&(0,o.mf)(e.install)?(a.add(e),e.install(s,...t)):(0,o.mf)(e)&&(a.add(e),e(s,...t))),s),mixin:e=>(__VUE_OPTIONS_API__&&(i.mixins.includes(e)||(i.mixins.push(e),(e.props||e.emits)&&(i.deopt=!0))),s),component:(e,t)=>t?(i.components[e]=t,s):i.components[e],directive:(e,t)=>t?(i.directives[e]=t,s):i.directives[e],mount(o,a,u){if(!l){const c=en(n,r);return c.appContext=i,a&&t?t(c,o):e(c,o,u),l=!0,s._container=o,o.__vue_app__=s,__VUE_PROD_DEVTOOLS__&&function(e,t){N&&N.emit("app:init",e,t,{Fragment:Lt,Text:Rt,Comment:It,Static:Ut})}(s,er),c.component.proxy}},unmount(){l&&(e(null,s._container),__VUE_PROD_DEVTOOLS__&&function(e){N&&N.emit("app:unmount",e)}(s),delete s._container.__vue_app__)},provide:(e,t)=>(i.provides[e]=t,s)};return s}}let ut=!1;const ct=e=>/svg/.test(e.namespaceURI)&&"foreignObject"!==e.tagName,dt=e=>8===e.nodeType;function ft(e){const{mt:t,p:n,o:{patchProp:r,nextSibling:i,parentNode:a,remove:l,insert:s,createComment:u}}=e,c=(n,r,o,l,s,u=!1)=>{const g=dt(n)&&"["===n.data,y=()=>h(n,r,o,l,s,g),{type:v,ref:b,shapeFlag:_}=r,w=n.nodeType;r.el=n;let x=null;switch(v){case Rt:3!==w?x=y():(n.data!==r.children&&(ut=!0,n.data=r.children),x=i(n));break;case It:x=8!==w||g?y():i(n);break;case Ut:if(1===w){x=n;const e=!r.children.length;for(let t=0;t{t(r,e,null,o,l,ct(e),u)},d=r.type.__asyncLoader;d?d().then(c):c(),x=g?m(n):i(n)}else 64&_?x=8!==w?y():r.type.hydrate(n,r,o,l,s,u,e,f):128&_&&(x=r.type.hydrate(n,r,o,l,ct(a(n)),s,u,e,c))}return null!=b&&vt(b,null,l,r),x},d=(e,t,n,i,a,s)=>{s=s||!!t.dynamicChildren;const{props:u,patchFlag:c,shapeFlag:d,dirs:p}=t;if(-1!==c){if(p&&it(t,null,n,"created"),u)if(!s||16&c||32&c)for(const t in u)!(0,o.Gg)(t)&&(0,o.F7)(t)&&r(e,t,null,u[t]);else u.onClick&&r(e,"onClick",null,u.onClick);let h;if((h=u&&u.onVnodeBeforeMount)&&xt(h,n,t),p&&it(t,null,n,"beforeMount"),((h=u&&u.onVnodeMounted)||p)&&ue((()=>{h&&xt(h,n,t),p&&it(t,null,n,"mounted")}),i),16&d&&(!u||!u.innerHTML&&!u.textContent)){let r=f(e.firstChild,t,e,n,i,a,s);for(;r;){ut=!0;const e=r;r=r.nextSibling,l(e)}}else 8&d&&e.textContent!==t.children&&(ut=!0,e.textContent=t.children)}return e.nextSibling},f=(e,t,r,o,i,a,l)=>{l=l||!!t.dynamicChildren;const s=t.children,u=s.length;for(let t=0;t{const{slotScopeIds:c}=t;c&&(o=o?o.concat(c):c);const d=a(e),p=f(i(e),t,d,n,r,o,l);return p&&dt(p)&&"]"===p.data?i(t.anchor=p):(ut=!0,s(t.anchor=u("]"),d,p),p)},h=(e,t,r,o,s,u)=>{if(ut=!0,t.el=null,u){const t=m(e);for(;;){const n=i(e);if(!n||n===t)break;l(n)}}const c=i(e),d=a(e);return l(e),n(null,t,d,c,r,o,ct(d),s),c},m=e=>{let t=0;for(;e;)if((e=i(e))&&dt(e)&&("["===e.data&&t++,"]"===e.data)){if(0===t)return i(e);t--}return e};return[(e,t)=>{ut=!1,c(t.firstChild,e,null,null,null),T(),ut&&console.error("Hydration completed but contains mismatches.")},c]}function pt(e){return(0,o.mf)(e)?{setup:e,name:e.name}:e}function ht(e){(0,o.mf)(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:i,delay:a=200,timeout:l,suspensible:s=!0,onError:u}=e;let c,f=null,p=0;const h=()=>{let e;return f||(e=f=t().catch((e=>{if(e=e instanceof Error?e:new Error(String(e)),u)return new Promise(((t,n)=>{u(e,(()=>t((p++,f=null,h()))),(()=>n(e)),p+1)}));throw e})).then((t=>e!==f&&f?f:(t&&(t.__esModule||"Module"===t[Symbol.toStringTag])&&(t=t.default),c=t,t))))};return pt({__asyncLoader:h,name:"AsyncComponentWrapper",setup(){const e=An;if(c)return()=>mt(c,e);const t=t=>{f=null,d(t,e,13,!i)};if(s&&e.suspense)return h().then((t=>()=>mt(t,e))).catch((e=>(t(e),()=>i?en(i,{error:e}):null)));const o=(0,r.iH)(!1),u=(0,r.iH)(),p=(0,r.iH)(!!a);return a&&setTimeout((()=>{p.value=!1}),a),null!=l&&setTimeout((()=>{if(!o.value&&!u.value){const e=new Error(`Async component timed out after ${l}ms.`);t(e),u.value=e}}),l),h().then((()=>{o.value=!0})).catch((e=>{t(e),u.value=e})),()=>o.value&&c?mt(c,e):u.value&&i?en(i,{error:u.value}):n&&!p.value?en(n):void 0}})}function mt(e,{vnode:{ref:t,props:n,children:r}}){const o=en(e,n,r);return o.ref=t,o}const gt={scheduler:E,allowRecurse:!0};const yt=ue,vt=(e,t,n,i)=>{if((0,o.kJ)(e))return void e.forEach(((e,r)=>vt(e,t&&((0,o.kJ)(t)?t[r]:t),n,i)));let a;if(i){if(i.type.__asyncLoader)return;a=4&i.shapeFlag?i.component.exposed||i.component.proxy:i.el}else a=null;const{i:l,r:s}=e;const c=t&&t.r,d=l.refs===o.kT?l.refs={}:l.refs,f=l.setupState;if(null!=c&&c!==s&&((0,o.HD)(c)?(d[c]=null,(0,o.RI)(f,c)&&(f[c]=null)):(0,r.dq)(c)&&(c.value=null)),(0,o.HD)(s)){const e=()=>{d[s]=a,(0,o.RI)(f,s)&&(f[s]=a)};a?(e.id=-1,yt(e,n)):e()}else if((0,r.dq)(s)){const e=()=>{s.value=a};a?(e.id=-1,yt(e,n)):e()}else(0,o.mf)(s)&&u(s,l,12,[a,d])};function bt(e){return wt(e)}function _t(e){return wt(e,ft)}function wt(e,t){if(function(){let e=!1;"boolean"!=typeof __VUE_OPTIONS_API__&&(e=!0,(0,o.E9)().__VUE_OPTIONS_API__=!0),"boolean"!=typeof __VUE_PROD_DEVTOOLS__&&(e=!0,(0,o.E9)().__VUE_PROD_DEVTOOLS__=!1)}(),__VUE_PROD_DEVTOOLS__){const e=(0,o.E9)();e.__VUE__=!0,V(e.__VUE_DEVTOOLS_GLOBAL_HOOK__)}const{insert:n,remove:i,patchProp:a,forcePatchProp:l,createElement:s,createText:c,createComment:f,setText:p,setElementText:g,parentNode:y,nextSibling:v,setScopeId:b=o.dG,cloneNode:_,insertStaticContent:w}=e,x=(e,t,n,r=null,o=null,i=null,a=!1,l=null,s=!1)=>{e&&!Gt(e,t)&&(r=le(e),Q(e,o,i,!0),e=null),-2===t.patchFlag&&(s=!1,t.dynamicChildren=null);const{type:u,ref:c,shapeFlag:d}=t;switch(u){case Rt:k(e,t,n,r);break;case It:O(e,t,n,r);break;case Ut:null==e&&S(t,n,r,a);break;case Lt:F(e,t,n,r,o,i,a,l,s);break;default:1&d?A(e,t,n,r,o,i,a,l,s):6&d?B(e,t,n,r,o,i,a,l,s):(64&d||128&d)&&u.process(e,t,n,r,o,i,a,l,s,ue)}null!=c&&o&&vt(c,e&&e.ref,i,t)},k=(e,t,r,o)=>{if(null==e)n(t.el=c(t.children),r,o);else{const n=t.el=e.el;t.children!==e.children&&p(n,t.children)}},O=(e,t,r,o)=>{null==e?n(t.el=f(t.children||""),r,o):t.el=e.el},S=(e,t,n,r)=>{[e.el,e.anchor]=w(e.children,t,n,r)},E=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=v(e),i(e),e=n;i(t)},A=(e,t,n,r,o,i,a,l,s)=>{a=a||"svg"===t.type,null==e?C(t,n,r,o,i,a,l,s):M(e,t,o,i,a,l,s)},C=(e,t,r,i,l,u,c,d)=>{let f,p;const{type:h,props:m,shapeFlag:y,transition:v,patchFlag:b,dirs:w}=e;if(e.el&&void 0!==_&&-1===b)f=e.el=_(e.el);else{if(f=e.el=s(e.type,u,m&&m.is,m),8&y?g(f,e.children):16&y&&W(e.children,f,null,i,l,u&&"foreignObject"!==h,c,d||!!e.dynamicChildren),w&&it(e,null,i,"created"),m){for(const t in m)(0,o.Gg)(t)||a(f,t,null,m[t],u,e.children,i,l,ae);(p=m.onVnodeBeforeMount)&&xt(p,i,e)}j(f,e,e.scopeId,c,i)}__VUE_PROD_DEVTOOLS__&&(Object.defineProperty(f,"__vnode",{value:e,enumerable:!1}),Object.defineProperty(f,"__vueParentComponent",{value:i,enumerable:!1})),w&&it(e,null,i,"beforeMount");const x=(!l||l&&!l.pendingBranch)&&v&&!v.persisted;x&&v.beforeEnter(f),n(f,t,r),((p=m&&m.onVnodeMounted)||x||w)&&yt((()=>{p&&xt(p,i,e),x&&v.enter(f),w&&it(e,null,i,"mounted")}),l)},j=(e,t,n,r,o)=>{if(n&&b(e,n),r)for(let t=0;t{for(let u=s;u{const c=t.el=e.el;let{patchFlag:d,dynamicChildren:f,dirs:p}=t;d|=16&e.patchFlag;const h=e.props||o.kT,m=t.props||o.kT;let y;if((y=m.onVnodeBeforeUpdate)&&xt(y,n,t,e),p&&it(t,e,n,"beforeUpdate"),d>0){if(16&d)U(c,t,h,m,n,r,i);else if(2&d&&h.class!==m.class&&a(c,"class",null,m.class,i),4&d&&a(c,"style",h.style,m.style,i),8&d){const o=t.dynamicProps;for(let t=0;t{y&&xt(y,n,t,e),p&&it(t,e,n,"updated")}),r)},N=(e,t,n,r,o,i,a)=>{for(let l=0;l{if(n!==r){for(const c in r){if((0,o.Gg)(c))continue;const d=r[c],f=n[c];(d!==f||l&&l(e,c))&&a(e,c,f,d,u,t.children,i,s,ae)}if(n!==o.kT)for(const l in n)(0,o.Gg)(l)||l in r||a(e,l,n[l],null,u,t.children,i,s,ae)}},F=(e,t,r,o,i,a,l,s,u)=>{const d=t.el=e?e.el:c(""),f=t.anchor=e?e.anchor:c("");let{patchFlag:p,dynamicChildren:h,slotScopeIds:m}=t;p>0&&(u=!0),m&&(s=s?s.concat(m):m),null==e?(n(d,r,o),n(f,r,o),W(t.children,r,f,i,a,l,s,u)):p>0&&64&p&&h&&e.dynamicChildren?(N(e.dynamicChildren,h,r,i,a,l,s),(null!=t.key||i&&t===i.subTree)&&kt(e,t,!0)):G(e,t,r,f,i,a,l,s,u)},B=(e,t,n,r,o,i,a,l,s)=>{t.slotScopeIds=l,null==e?512&t.shapeFlag?o.ctx.activate(t,n,r,a,s):$(t,n,r,o,i,a,s):H(e,t,s)},$=(e,t,n,i,a,l,s)=>{const c=e.component=function(e,t,n){const r=e.type,i=(t?t.appContext:e.appContext)||Sn,a={uid:En++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,update:null,render:null,proxy:null,exposed:null,withProxy:null,effects:null,provides:t?t.provides:Object.create(i.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:pe(r,i),emitsOptions:q(r,i),emit:null,emitted:null,propsDefaults:o.kT,ctx:o.kT,data:o.kT,props:o.kT,attrs:o.kT,slots:o.kT,refs:o.kT,setupState:o.kT,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null};a.ctx={_:a};return a.root=t?t.root:a,a.emit=D.bind(null,a),a}(e,i,a);if(Be(e)&&(c.ctx.renderer=ue),function(e,t=!1){Wn=t;const{props:n,children:i}=e.vnode,a=Pn(e);(function(e,t,n,i=!1){const a={},l={};(0,o.Nj)(l,Xt,1),e.propsDefaults=Object.create(null),de(e,t,a,l),n?e.props=i?a:(0,r.Um)(a):e.type.props?e.props=a:e.props=l,e.attrs=l})(e,n,a,t),((e,t)=>{if(32&e.vnode.shapeFlag){const n=t._;n?(e.slots=t,(0,o.Nj)(t,"_",n)):nt(t,e.slots={})}else e.slots={},t&&rt(e,t);(0,o.Nj)(e.slots,Xt,1)})(e,i);const l=a?function(e,t){const n=e.type;0;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,kn),!1;const{setup:i}=n;if(i){const n=e.setupContext=i.length>1?Rn(e):null;An=e,(0,r.Jd)();const a=u(i,e,0,[e.props,n]);if((0,r.lk)(),An=null,(0,o.tI)(a)){if(t)return a.then((n=>{Mn(e,n,t)})).catch((t=>{d(t,e,0)}));e.asyncDep=a}else Mn(e,a,t)}else Ln(e,t)}(e,t):void 0;Wn=!1}(c),c.asyncDep){if(a&&a.registerDep(c,Y),!e.el){const e=c.subTree=en(It);O(null,e,t,n)}}else Y(c,e,t,n,a,l,s)},H=(e,t,n)=>{const r=t.component=e.component;if(function(e,t,n){const{props:r,children:o,component:i}=e,{props:a,children:l,patchFlag:s}=t,u=i.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&s>=0))return!(!o&&!l||l&&l.$stable)||r!==a&&(r?!a||oe(r,a,u):!!a);if(1024&s)return!0;if(16&s)return r?oe(r,a,u):!!a;if(8&s){const e=t.dynamicProps;for(let t=0;tm&&h.splice(t,1)}(r.update),r.update()}else t.component=e.component,t.el=e.el,r.vnode=t},Y=(e,t,n,i,a,l,s)=>{e.update=(0,r.cE)((function(){if(e.isMounted){let t,{next:n,bu:r,u:i,parent:u,vnode:c}=e,d=n;0,n?(n.el=c.el,K(e,n,s)):n=c,r&&(0,o.ir)(r),(t=n.props&&n.props.onVnodeBeforeUpdate)&&xt(t,u,n,c);const f=ee(e);0;const p=e.subTree;e.subTree=f,x(p,f,y(p.el),le(p),e,a,l),n.el=f.el,null===d&&ie(e,f.el),i&&yt(i,a),(t=n.props&&n.props.onVnodeUpdated)&&yt((()=>{xt(t,u,n,c)}),a),__VUE_PROD_DEVTOOLS__&&R(e)}else{let r;const{el:s,props:u}=t,{bm:c,m:d,parent:f}=e;c&&(0,o.ir)(c),(r=u&&u.onVnodeBeforeMount)&&xt(r,f,t);const p=e.subTree=ee(e);if(s&&he?he(t.el,p,e,a,null):(x(null,p,n,i,e,a,l),t.el=p.el),d&&yt(d,a),r=u&&u.onVnodeMounted){const e=t;yt((()=>{xt(r,f,e)}),a)}const{a:h}=e;h&&256&t.shapeFlag&&yt(h,a),e.isMounted=!0,__VUE_PROD_DEVTOOLS__&&L(e),t=n=i=null}}),gt)},K=(e,t,n)=>{t.component=e;const i=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,i){const{props:a,attrs:l,vnode:{patchFlag:s}}=e,u=(0,r.IU)(a),[c]=e.propsOptions;if(!(i||s>0)||16&s){let r;de(e,t,a,l);for(const i in u)t&&((0,o.RI)(t,i)||(r=(0,o.rs)(i))!==i&&(0,o.RI)(t,r))||(c?!n||void 0===n[i]&&void 0===n[r]||(a[i]=fe(c,t||o.kT,i,void 0,e)):delete a[i]);if(l!==u)for(const e in l)t&&(0,o.RI)(t,e)||delete l[e]}else if(8&s){const n=e.vnode.dynamicProps;for(let r=0;r{const{vnode:r,slots:i}=e;let a=!0,l=o.kT;if(32&r.shapeFlag){const e=t._;e?n&&1===e?a=!1:((0,o.l7)(i,t),n||1!==e||delete i._):(a=!t.$stable,nt(t,i)),l=t}else t&&(rt(e,t),l={default:1});if(a)for(const e in i)Qe(e)||e in l||delete i[e]})(e,t.children,n),(0,r.Jd)(),P(void 0,e.update),(0,r.lk)()},G=(e,t,n,r,o,i,a,l,s=!1)=>{const u=e&&e.children,c=e?e.shapeFlag:0,d=t.children,{patchFlag:f,shapeFlag:p}=t;if(f>0){if(128&f)return void X(u,d,n,r,o,i,a,l,s);if(256&f)return void J(u,d,n,r,o,i,a,l,s)}8&p?(16&c&&ae(u,o,i),d!==u&&g(n,d)):16&c?16&p?X(u,d,n,r,o,i,a,l,s):ae(u,o,i,!0):(8&c&&g(n,""),16&p&&W(d,n,r,o,i,a,l,s))},J=(e,t,n,r,i,a,l,s,u)=>{e=e||o.Z6,t=t||o.Z6;const c=e.length,d=t.length,f=Math.min(c,d);let p;for(p=0;pd?ae(e,i,a,!0,!1,f):W(t,n,r,i,a,l,s,u,f)},X=(e,t,n,r,i,a,l,s,u)=>{let c=0;const d=t.length;let f=e.length-1,p=d-1;for(;c<=f&&c<=p;){const r=e[c],o=t[c]=u?sn(t[c]):ln(t[c]);if(!Gt(r,o))break;x(r,o,n,null,i,a,l,s,u),c++}for(;c<=f&&c<=p;){const r=e[f],o=t[p]=u?sn(t[p]):ln(t[p]);if(!Gt(r,o))break;x(r,o,n,null,i,a,l,s,u),f--,p--}if(c>f){if(c<=p){const e=p+1,o=ep)for(;c<=f;)Q(e[c],i,a,!0),c++;else{const h=c,m=c,g=new Map;for(c=m;c<=p;c++){const e=t[c]=u?sn(t[c]):ln(t[c]);null!=e.key&&g.set(e.key,c)}let y,v=0;const b=p-m+1;let _=!1,w=0;const k=new Array(b);for(c=0;c=b){Q(r,i,a,!0);continue}let o;if(null!=r.key)o=g.get(r.key);else for(y=m;y<=p;y++)if(0===k[y-m]&&Gt(r,t[y])){o=y;break}void 0===o?Q(r,i,a,!0):(k[o-m]=c+1,o>=w?w=o:_=!0,x(r,t[o],n,null,i,a,l,s,u),v++)}const O=_?function(e){const t=e.slice(),n=[0];let r,o,i,a,l;const s=e.length;for(r=0;r0&&(t[r]=n[i-1]),n[i]=r)}}i=n.length,a=n[i-1];for(;i-- >0;)n[i]=a,a=t[a];return n}(k):o.Z6;for(y=O.length-1,c=b-1;c>=0;c--){const e=m+c,o=t[e],f=e+1{const{el:a,type:l,transition:s,children:u,shapeFlag:c}=e;if(6&c)return void Z(e.component.subTree,t,r,o);if(128&c)return void e.suspense.move(t,r,o);if(64&c)return void l.move(e,t,r,ue);if(l===Lt){n(a,t,r);for(let e=0;e{let i;for(;e&&e!==t;)i=v(e),n(e,r,o),e=i;n(t,r,o)})(e,t,r);if(2!==o&&1&c&&s)if(0===o)s.beforeEnter(a),n(a,t,r),yt((()=>s.enter(a)),i);else{const{leave:e,delayLeave:o,afterLeave:i}=s,l=()=>n(a,t,r),u=()=>{e(a,(()=>{l(),i&&i()}))};o?o(a,l,u):u()}else n(a,t,r)},Q=(e,t,n,r=!1,o=!1)=>{const{type:i,props:a,ref:l,children:s,dynamicChildren:u,shapeFlag:c,patchFlag:d,dirs:f}=e;if(null!=l&&vt(l,null,n,null),256&c)return void t.ctx.deactivate(e);const p=1&c&&f;let h;if((h=a&&a.onVnodeBeforeUnmount)&&xt(h,t,e),6&c)re(e.component,n,r);else{if(128&c)return void e.suspense.unmount(n,r);p&&it(e,null,t,"beforeUnmount"),64&c?e.type.remove(e,t,n,o,ue,r):u&&(i!==Lt||d>0&&64&d)?ae(u,t,n,!1,!0):(i===Lt&&(128&d||256&d)||!o&&16&c)&&ae(s,t,n),r&&te(e)}((h=a&&a.onVnodeUnmounted)||p)&&yt((()=>{h&&xt(h,t,e),p&&it(e,null,t,"unmounted")}),n)},te=e=>{const{type:t,el:n,anchor:r,transition:o}=e;if(t===Lt)return void ne(n,r);if(t===Ut)return void E(e);const a=()=>{i(n),o&&!o.persisted&&o.afterLeave&&o.afterLeave()};if(1&e.shapeFlag&&o&&!o.persisted){const{leave:t,delayLeave:r}=o,i=()=>t(n,a);r?r(e.el,a,i):i()}else a()},ne=(e,t)=>{let n;for(;e!==t;)n=v(e),i(e),e=n;i(t)},re=(e,t,n)=>{const{bum:i,effects:a,update:l,subTree:s,um:u}=e;if(i&&(0,o.ir)(i),a)for(let e=0;e{e.isUnmounted=!0}),t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve()),__VUE_PROD_DEVTOOLS__&&I(e)},ae=(e,t,n,r=!1,o=!1,i=0)=>{for(let a=i;a6&e.shapeFlag?le(e.component.subTree):128&e.shapeFlag?e.suspense.next():v(e.anchor||e.el),se=(e,t,n)=>{null==e?t._vnode&&Q(t._vnode,null,null,!0):x(t._vnode||null,e,t,null,null,null,n),T(),t._vnode=e},ue={p:x,um:Q,m:Z,r:te,mt:$,mc:W,pc:G,pbc:N,n:le,o:e};let ce,he;return t&&([ce,he]=t(ue)),{render:se,hydrate:ce,createApp:st(se,ce)}}function xt(e,t,n,r=null){c(e,t,7,[n,r])}function kt(e,t,n=!1){const r=e.children,i=t.children;if((0,o.kJ)(r)&&(0,o.kJ)(i))for(let e=0;ee&&(e.disabled||""===e.disabled),St=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,Et=(e,t)=>{const n=e&&e.to;if((0,o.HD)(n)){if(t){const e=t(n);return e}return null}return n};function At(e,t,n,{o:{insert:r},m:o},i=2){0===i&&r(e.targetAnchor,t,n);const{el:a,anchor:l,shapeFlag:s,children:u,props:c}=e,d=2===i;if(d&&r(a,t,n),(!d||Ot(c))&&16&s)for(let e=0;e{16&v&&c(b,e,t,o,i,a,l,s)};y?g(n,u):d&&g(d,f)}else{t.el=e.el;const r=t.anchor=e.anchor,c=t.target=e.target,p=t.targetAnchor=e.targetAnchor,m=Ot(e.props),g=m?n:c,v=m?r:p;if(a=a||St(c),t.dynamicChildren?(f(e.dynamicChildren,t.dynamicChildren,g,o,i,a,l),kt(e,t,!0)):s||d(e,t,g,v,o,i,a,l,!1),y)m||At(t,n,r,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const e=t.target=Et(t.props,h);e&&At(t,e,null,u,0)}else m&&At(t,c,p,u,1)}},remove(e,t,n,r,{um:o,o:{remove:i}},a){const{shapeFlag:l,children:s,anchor:u,targetAnchor:c,target:d,props:f}=e;if(d&&i(c),(a||!Ot(f))&&(i(u),16&l))for(let e=0;e0&&qt&&qt.push(a),a}function Kt(e){return!!e&&!0===e.__v_isVNode}function Gt(e,t){return e.type===t.type&&e.key===t.key}function Jt(e){Bt=e}const Xt="__vInternal",Zt=({key:e})=>null!=e?e:null,Qt=({ref:e})=>null!=e?(0,o.HD)(e)||(0,r.dq)(e)||(0,o.mf)(e)?{i:Y,r:e}:e:null,en=tn;function tn(e,t=null,n=null,i=0,a=null,l=!1){if(e&&e!==Tt||(e=It),Kt(e)){const r=nn(e,t,!0);return n&&un(r,n),r}if(zn(e)&&(e=e.__vccOpts),t){((0,r.X3)(t)||Xt in t)&&(t=(0,o.l7)({},t));let{class:e,style:n}=t;e&&!(0,o.HD)(e)&&(t.class=(0,o.C_)(e)),(0,o.Kn)(n)&&((0,r.X3)(n)&&!(0,o.kJ)(n)&&(n=(0,o.l7)({},n)),t.style=(0,o.j5)(n))}const s=(0,o.HD)(e)?1:(e=>e.__isSuspense)(e)?128:(e=>e.__isTeleport)(e)?64:(0,o.Kn)(e)?4:(0,o.mf)(e)?2:0;const u={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Zt(t),ref:t&&Qt(t),scopeId:K,slotScopeIds:null,children:null,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:i,dynamicProps:a,dynamicChildren:null,appContext:null};if(un(u,n),128&s){const{content:e,fallback:t}=function(e){const{shapeFlag:t,children:n}=e;let r,o;return 32&t?(r=se(n.default),o=se(n.fallback)):(r=se(n),o=ln(null)),{content:r,fallback:o}}(u);u.ssContent=e,u.ssFallback=t}return $t>0&&!l&&qt&&(i>0||6&s)&&32!==i&&qt.push(u),u}function nn(e,t,n=!1){const{props:r,ref:i,patchFlag:a,children:l}=e,s=t?cn(r||{},t):r;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:s,key:s&&Zt(s),ref:t&&t.ref?n&&i?(0,o.kJ)(i)?i.concat(Qt(t)):[i,Qt(t)]:Qt(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Lt?-1===a?16:16|a:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&nn(e.ssContent),ssFallback:e.ssFallback&&nn(e.ssFallback),el:e.el,anchor:e.anchor}}function rn(e=" ",t=0){return en(Rt,null,e,t)}function on(e,t){const n=en(Ut,null,e);return n.staticCount=t,n}function an(e="",t=!1){return t?(zt(),Yt(It,null,e)):en(It,null,e)}function ln(e){return null==e||"boolean"==typeof e?en(It):(0,o.kJ)(e)?en(Lt,null,e):"object"==typeof e?null===e.el?e:nn(e):en(Rt,null,String(e))}function sn(e){return null===e.el?e:nn(e)}function un(e,t){let n=0;const{shapeFlag:r}=e;if(null==t)t=null;else if((0,o.kJ)(t))n=16;else if("object"==typeof t){if(1&r||64&r){const n=t.default;return void(n&&(n._c&&B(1),un(e,n()),n._c&&B(-1)))}{n=32;const r=t._;r||Xt in t?3===r&&Y&&(1024&Y.vnode.patchFlag?(t._=2,e.patchFlag|=1024):t._=1):t._ctx=Y}}else(0,o.mf)(t)?(t={default:t,_ctx:Y},n=32):(t=String(t),64&r?(n=16,t=[rn(t)]):n=8);e.children=t,e.shapeFlag|=n}function cn(...e){const t=(0,o.l7)({},e[0]);for(let n=1;n1)return n&&(0,o.mf)(t)?t():t}else 0}let pn=!0;function hn(e,t,n=[],i=[],a=[],l=!1){const{mixins:s,extends:u,data:c,computed:d,methods:f,watch:p,provide:h,inject:m,components:g,directives:y,beforeMount:v,mounted:b,beforeUpdate:_,updated:w,activated:x,deactivated:k,beforeDestroy:O,beforeUnmount:S,destroyed:E,unmounted:A,render:C,renderTracked:j,renderTriggered:P,errorCaptured:T,expose:W}=t,M=e.proxy,N=e.ctx,V=e.appContext.mixins;l&&C&&e.render===o.dG&&(e.render=C),l||(pn=!1,mn("beforeCreate","bc",t,e,V),pn=!0,yn(e,V,n,i,a)),u&&hn(e,u,n,i,a,!0),s&&yn(e,s,n,i,a);if(m)if((0,o.kJ)(m))for(let e=0;evn(e,t,M))),c&&vn(e,c,M)),d)for(const e in d){const t=d[e];0;const n=Fn({get:(0,o.mf)(t)?t.bind(M,M):(0,o.mf)(t.get)?t.get.bind(M,M):o.dG,set:!(0,o.mf)(t)&&(0,o.mf)(t.set)?t.set.bind(M):o.dG});Object.defineProperty(N,e,{enumerable:!0,configurable:!0,get:()=>n.value,set:e=>n.value=e})}if(p&&i.push(p),!l&&i.length&&i.forEach((e=>{for(const t in e)bn(e[t],N,M,t)})),h&&a.push(h),!l&&a.length&&a.forEach((e=>{const t=(0,o.mf)(e)?e.call(M):e;Reflect.ownKeys(t).forEach((e=>{dn(e,t[e])}))})),l&&(g&&(0,o.l7)(e.components||(e.components=(0,o.l7)({},e.type.components)),g),y&&(0,o.l7)(e.directives||(e.directives=(0,o.l7)({},e.type.directives)),y)),l||mn("created","c",t,e,V),v&&_e(v.bind(M)),b&&we(b.bind(M)),_&&xe(_.bind(M)),w&&ke(w.bind(M)),x&&Ye(x.bind(M)),k&&Ke(k.bind(M)),T&&Ce(T.bind(M)),j&&Ae(j.bind(M)),P&&Ee(P.bind(M)),S&&Oe(S.bind(M)),A&&Se(A.bind(M)),(0,o.kJ)(W))if(l)0;else if(W.length){const t=e.exposed||(e.exposed=(0,r.WL)({}));W.forEach((e=>{t[e]=(0,r.Vh)(M,e)}))}else e.exposed||(e.exposed=o.kT)}function mn(e,t,n,r,o){for(let n=0;n{let t=e;for(let e=0;en[r];if((0,o.HD)(e)){const n=t[e];(0,o.mf)(n)&&Te(i,n)}else if((0,o.mf)(e))Te(i,e.bind(n));else if((0,o.Kn)(e))if((0,o.kJ)(e))e.forEach((e=>bn(e,t,n,r)));else{const r=(0,o.mf)(e.handler)?e.handler.bind(n):t[e.handler];(0,o.mf)(r)&&Te(i,r,e)}else 0}function _n(e,t,n){const r=n.appContext.config.optionMergeStrategies,{mixins:i,extends:a}=t;a&&_n(e,a,n),i&&i.forEach((t=>_n(e,t,n)));for(const i in t)r&&(0,o.RI)(r,i)?e[i]=r[i](e[i],t[i],n.proxy,i):e[i]=t[i]}const wn=e=>e?Pn(e)?e.exposed?e.exposed:e.proxy:wn(e.parent):null,xn=(0,o.l7)(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>wn(e.parent),$root:e=>wn(e.root),$emit:e=>e.emit,$options:e=>__VUE_OPTIONS_API__?function(e){const t=e.type,{__merged:n,mixins:r,extends:o}=t;if(n)return n;const i=e.appContext.mixins;if(!i.length&&!r&&!o)return t;const a={};return i.forEach((t=>_n(a,t,e))),_n(a,t,e),t.__merged=a}(e):e.type,$forceUpdate:e=>()=>E(e.update),$nextTick:e=>S.bind(e.proxy),$watch:e=>__VUE_OPTIONS_API__?Me.bind(e):o.dG}),kn={get({_:e},t){const{ctx:n,setupState:i,data:a,props:l,accessCache:s,type:u,appContext:c}=e;if("__v_skip"===t)return!0;let d;if("$"!==t[0]){const r=s[t];if(void 0!==r)switch(r){case 0:return i[t];case 1:return a[t];case 3:return n[t];case 2:return l[t]}else{if(i!==o.kT&&(0,o.RI)(i,t))return s[t]=0,i[t];if(a!==o.kT&&(0,o.RI)(a,t))return s[t]=1,a[t];if((d=e.propsOptions[0])&&(0,o.RI)(d,t))return s[t]=2,l[t];if(n!==o.kT&&(0,o.RI)(n,t))return s[t]=3,n[t];__VUE_OPTIONS_API__&&!pn||(s[t]=4)}}const f=xn[t];let p,h;return f?("$attrs"===t&&(0,r.j)(e,"get",t),f(e)):(p=u.__cssModules)&&(p=p[t])?p:n!==o.kT&&(0,o.RI)(n,t)?(s[t]=3,n[t]):(h=c.config.globalProperties,(0,o.RI)(h,t)?h[t]:void 0)},set({_:e},t,n){const{data:r,setupState:i,ctx:a}=e;if(i!==o.kT&&(0,o.RI)(i,t))i[t]=n;else if(r!==o.kT&&(0,o.RI)(r,t))r[t]=n;else if((0,o.RI)(e.props,t))return!1;return("$"!==t[0]||!(t.slice(1)in e))&&(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,propsOptions:a}},l){let s;return void 0!==n[l]||e!==o.kT&&(0,o.RI)(e,l)||t!==o.kT&&(0,o.RI)(t,l)||(s=a[0])&&(0,o.RI)(s,l)||(0,o.RI)(r,l)||(0,o.RI)(xn,l)||(0,o.RI)(i.config.globalProperties,l)}};const On=(0,o.l7)({},kn,{get(e,t){if(t!==Symbol.unscopables)return kn.get(e,t,e)},has:(e,t)=>"_"!==t[0]&&!(0,o.e1)(t)});const Sn=at();let En=0;let An=null;const Cn=()=>An||Y,jn=e=>{An=e};function Pn(e){return 4&e.vnode.shapeFlag}let Tn,Wn=!1;function Mn(e,t,n){(0,o.mf)(t)?e.render=t:(0,o.Kn)(t)&&(__VUE_PROD_DEVTOOLS__&&(e.devtoolsRawSetupState=t),e.setupState=(0,r.WL)(t)),Ln(e,n)}const Nn=()=>!Tn;function Vn(e){Tn=e}function Ln(e,t){const n=e.type;e.render||(Tn&&n.template&&!n.render&&(n.render=Tn(n.template,{isCustomElement:e.appContext.config.isCustomElement,delimiters:n.delimiters})),e.render=n.render||o.dG,e.render._rc&&(e.withProxy=new Proxy(e.ctx,On))),__VUE_OPTIONS_API__&&(An=e,(0,r.Jd)(),hn(e,n),(0,r.lk)(),An=null)}function Rn(e){const t=t=>{e.exposed=(0,r.WL)(t)};return{attrs:e.attrs,slots:e.slots,emit:e.emit,expose:t}}function In(e,t=An){t&&(t.effects||(t.effects=[])).push(e)}const Un=/(?:^|[-_])(\w)/g;function Dn(e){return(0,o.mf)(e)&&e.displayName||e.name}function qn(e,t,n=!1){let r=Dn(t);if(!r&&t.__file){const e=t.__file.match(/([^/\\]+)\.\w+$/);e&&(r=e[1])}if(!r&&e&&e.parent){const n=e=>{for(const n in e)if(e[n]===t)return n};r=n(e.components||e.parent.type.components)||n(e.appContext.components)}return r?r.replace(Un,(e=>e.toUpperCase())).replace(/[-_]/g,""):n?"App":"Anonymous"}function zn(e){return(0,o.mf)(e)&&"__vccOpts"in e}function Fn(e){const t=(0,r.Fl)(e);return In(t.effect),t}function Bn(){return null}function $n(){return null}function Hn(){const e=Cn();return e.setupContext||(e.setupContext=Rn(e))}function Yn(e,t,n){const r=arguments.length;return 2===r?(0,o.Kn)(t)&&!(0,o.kJ)(t)?Kt(t)?en(e,null,[t]):en(e,t):en(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):3===r&&Kt(n)&&(n=[n]),en(e,t,n))}const Kn=Symbol(""),Gn=()=>{{const e=fn(Kn);return e||a("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function Jn(){return void 0}function Xn(e,t){let n;if((0,o.kJ)(e)||(0,o.HD)(e)){n=new Array(e.length);for(let r=0,o=e.length;r{"use strict";n.d(t,{P$:()=>o.P$,sv:()=>o.sv,HY:()=>o.HY,Ob:()=>o.Ob,qG:()=>o.qG,n4:()=>o.n4,lR:()=>o.lR,xv:()=>o.xv,$d:()=>o.$d,KU:()=>o.KU,_A:()=>o._A,kC:()=>o.kC,Ho:()=>o.Ho,Fl:()=>o.Fl,j4:()=>o.j4,ry:()=>o.ry,Eo:()=>o.Eo,Us:()=>o.Us,Nv:()=>o.Nv,uE:()=>o.uE,Uk:()=>o.Uk,Wm:()=>o.Wm,ZM:()=>o.ZM,RC:()=>o.RC,aZ:()=>o.aZ,zX:()=>o.zX,MW:()=>o.MW,mW:()=>o.mW,FN:()=>o.FN,Q6:()=>o.Q6,h:()=>o.h,S3:()=>o.S3,Mr:()=>o.Mr,f3:()=>o.f3,X3:()=>o.X3,PG:()=>o.PG,$y:()=>o.$y,dq:()=>o.dq,of:()=>o.of,lA:()=>o.lA,Xl:()=>o.Xl,dG:()=>o.dG,Y3:()=>o.Y3,dl:()=>o.dl,wF:()=>o.wF,Jd:()=>o.Jd,Xn:()=>o.Xn,se:()=>o.se,d1:()=>o.d1,bv:()=>o.bv,bT:()=>o.bT,Yq:()=>o.Yq,Ah:()=>o.Ah,ic:()=>o.ic,wg:()=>o.wg,Cn:()=>o.Cn,JJ:()=>o.JJ,WL:()=>o.WL,dD:()=>o.dD,qb:()=>o.qb,qj:()=>o.qj,OT:()=>o.OT,iH:()=>o.iH,Y1:()=>o.Y1,Ko:()=>o.Ko,WI:()=>o.WI,up:()=>o.up,Q2:()=>o.Q2,LL:()=>o.LL,U2:()=>o.U2,qZ:()=>o.qZ,ec:()=>o.ec,nK:()=>o.nK,Um:()=>o.Um,YS:()=>o.YS,XI:()=>o.XI,Uc:()=>o.Uc,G:()=>o.G,zw:()=>o.zw,hR:()=>o.hR,mx:()=>o.mx,IU:()=>o.IU,Vh:()=>o.Vh,BK:()=>o.BK,C3:()=>o.C3,oR:()=>o.oR,SU:()=>o.SU,qp:()=>o.qp,Zq:()=>o.Zq,Y8:()=>o.Y8,i8:()=>o.i8,ZK:()=>o.ZK,YP:()=>o.YP,m0:()=>o.m0,w5:()=>o.w5,wy:()=>o.wy,HX:()=>o.HX,uT:()=>P,W3:()=>H,ri:()=>ke,vr:()=>Oe,ZB:()=>xe,sY:()=>we,fb:()=>S,sj:()=>E,e8:()=>ee,YZ:()=>le,G2:()=>ne,bM:()=>re,nr:()=>Q,F8:()=>he,D2:()=>pe,iM:()=>de});var r=n(3577),o=n(6252),i=n(2262);const a="http://www.w3.org/2000/svg",l="undefined"!=typeof document?document:null;let s,u;const c={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const o=t?l.createElementNS(a,e):l.createElement(e,n?{is:n}:void 0);return"select"===e&&r&&null!=r.multiple&&o.setAttribute("multiple",r.multiple),o},createText:e=>l.createTextNode(e),createComment:e=>l.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>l.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},cloneNode(e){const t=e.cloneNode(!0);return"_value"in e&&(t._value=e._value),t},insertStaticContent(e,t,n,r){const o=r?u||(u=l.createElementNS(a,"svg")):s||(s=l.createElement("div"));o.innerHTML=e;const i=o.firstChild;let d=i,f=d;for(;d;)f=d,c.insert(d,t,n),d=o.firstChild;return[i,f]}};const d=/\s*!important$/;function f(e,t,n){if((0,r.kJ)(n))n.forEach((n=>f(e,t,n)));else if(t.startsWith("--"))e.setProperty(t,n);else{const o=function(e,t){const n=h[t];if(n)return n;let o=(0,r._A)(t);if("filter"!==o&&o in e)return h[t]=o;o=(0,r.kC)(o);for(let n=0;ndocument.createEvent("Event").timeStamp&&(g=()=>performance.now());const e=navigator.userAgent.match(/firefox\/(\d+)/i);y=!!(e&&Number(e[1])<=53)}let v=0;const b=Promise.resolve(),_=()=>{v=0};function w(e,t,n,r){e.addEventListener(t,n,r)}function x(e,t,n,i,a=null){const l=e._vei||(e._vei={}),s=l[t];if(i&&s)s.value=i;else{const[n,u]=function(e){let t;if(k.test(e)){let n;for(t={};n=e.match(k);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[(0,r.rs)(e.slice(2)),t]}(t);if(i){w(e,n,l[t]=function(e,t){const n=e=>{const i=e.timeStamp||g();(y||i>=n.attached-1)&&(0,o.$d)(function(e,t){if((0,r.kJ)(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map((e=>t=>!t._stopped&&e(t)))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=(()=>v||(b.then(_),v=g()))(),n}(i,a),u)}else s&&(!function(e,t,n,r){e.removeEventListener(t,n,r)}(e,n,s,u),l[t]=void 0)}}const k=/(?:Once|Passive|Capture)$/;const O=/^on[a-z]/;function S(e="$style"){{const t=(0,o.FN)();if(!t)return r.kT;const n=t.type.__cssModules;if(!n)return r.kT;const i=n[e];return i||r.kT}}function E(e){const t=(0,o.FN)();if(!t)return;const n=()=>A(t.subTree,e(t.proxy));(0,o.bv)((()=>(0,o.m0)(n,{flush:"post"}))),(0,o.ic)(n)}function A(e,t){if(128&e.shapeFlag){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push((()=>{A(n.activeBranch,t)}))}for(;e.component;)e=e.component.subTree;if(1&e.shapeFlag&&e.el){const n=e.el.style;for(const e in t)n.setProperty(`--${e}`,t[e])}else e.type===o.HY&&e.children.forEach((e=>A(e,t)))}const C="transition",j="animation",P=(e,{slots:t})=>(0,o.h)(o.P$,M(e),t);P.displayName="Transition";const T={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},W=P.props=(0,r.l7)({},o.P$.props,T);function M(e){let{name:t="v",type:n,css:o=!0,duration:i,enterFromClass:a=`${t}-enter-from`,enterActiveClass:l=`${t}-enter-active`,enterToClass:s=`${t}-enter-to`,appearFromClass:u=a,appearActiveClass:c=l,appearToClass:d=s,leaveFromClass:f=`${t}-leave-from`,leaveActiveClass:p=`${t}-leave-active`,leaveToClass:h=`${t}-leave-to`}=e;const m={};for(const t in e)t in T||(m[t]=e[t]);if(!o)return m;const g=function(e){if(null==e)return null;if((0,r.Kn)(e))return[N(e.enter),N(e.leave)];{const t=N(e);return[t,t]}}(i),y=g&&g[0],v=g&&g[1],{onBeforeEnter:b,onEnter:_,onEnterCancelled:w,onLeave:x,onLeaveCancelled:k,onBeforeAppear:O=b,onAppear:S=_,onAppearCancelled:E=w}=m,A=(e,t,n)=>{L(e,t?d:s),L(e,t?c:l),n&&n()},C=(e,t)=>{L(e,h),L(e,p),t&&t()},j=e=>(t,r)=>{const o=e?S:_,i=()=>A(t,e,r);o&&o(t,i),R((()=>{L(t,e?u:a),V(t,e?d:s),o&&o.length>1||U(t,n,y,i)}))};return(0,r.l7)(m,{onBeforeEnter(e){b&&b(e),V(e,a),V(e,l)},onBeforeAppear(e){O&&O(e),V(e,u),V(e,c)},onEnter:j(!1),onAppear:j(!0),onLeave(e,t){const r=()=>C(e,t);V(e,f),F(),V(e,p),R((()=>{L(e,f),V(e,h),x&&x.length>1||U(e,n,v,r)})),x&&x(e,r)},onEnterCancelled(e){A(e,!1),w&&w(e)},onAppearCancelled(e){A(e,!0),E&&E(e)},onLeaveCancelled(e){C(e),k&&k(e)}})}function N(e){return(0,r.He)(e)}function V(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.add(t))),(e._vtc||(e._vtc=new Set)).add(t)}function L(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.remove(t)));const{_vtc:n}=e;n&&(n.delete(t),n.size||(e._vtc=void 0))}function R(e){requestAnimationFrame((()=>{requestAnimationFrame(e)}))}let I=0;function U(e,t,n,r){const o=e._endId=++I,i=()=>{o===e._endId&&r()};if(n)return setTimeout(i,n);const{type:a,timeout:l,propCount:s}=D(e,t);if(!a)return r();const u=a+"end";let c=0;const d=()=>{e.removeEventListener(u,f),i()},f=t=>{t.target===e&&++c>=s&&d()};setTimeout((()=>{c(n[e]||"").split(", "),o=r("transitionDelay"),i=r("transitionDuration"),a=q(o,i),l=r("animationDelay"),s=r("animationDuration"),u=q(l,s);let c=null,d=0,f=0;t===C?a>0&&(c=C,d=a,f=i.length):t===j?u>0&&(c=j,d=u,f=s.length):(d=Math.max(a,u),c=d>0?a>u?C:j:null,f=c?c===C?i.length:s.length:0);return{type:c,timeout:d,propCount:f,hasTransform:c===C&&/\b(transform|all)(,|$)/.test(n.transitionProperty)}}function q(e,t){for(;e.lengthz(t)+z(e[n]))))}function z(e){return 1e3*Number(e.slice(0,-1).replace(",","."))}function F(){return document.body.offsetHeight}const B=new WeakMap,$=new WeakMap,H={name:"TransitionGroup",props:(0,r.l7)({},W,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=(0,o.FN)(),r=(0,o.Y8)();let a,l;return(0,o.ic)((()=>{if(!a.length)return;const t=e.moveClass||`${e.name||"v"}-move`;if(!function(e,t,n){const r=e.cloneNode();e._vtc&&e._vtc.forEach((e=>{e.split(/\s+/).forEach((e=>e&&r.classList.remove(e)))}));n.split(/\s+/).forEach((e=>e&&r.classList.add(e))),r.style.display="none";const o=1===t.nodeType?t:t.parentNode;o.appendChild(r);const{hasTransform:i}=D(r);return o.removeChild(r),i}(a[0].el,n.vnode.el,t))return;a.forEach(Y),a.forEach(K);const r=a.filter(G);F(),r.forEach((e=>{const n=e.el,r=n.style;V(n,t),r.transform=r.webkitTransform=r.transitionDuration="";const o=n._moveCb=e=>{e&&e.target!==n||e&&!/transform$/.test(e.propertyName)||(n.removeEventListener("transitionend",o),n._moveCb=null,L(n,t))};n.addEventListener("transitionend",o)}))})),()=>{const s=(0,i.IU)(e),u=M(s),c=s.tag||o.HY;a=l,l=t.default?(0,o.Q6)(t.default()):[];for(let e=0;e{const t=e.props["onUpdate:modelValue"];return(0,r.kJ)(t)?e=>(0,r.ir)(t,e):t};function X(e){e.target.composing=!0}function Z(e){const t=e.target;t.composing&&(t.composing=!1,function(e,t){const n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}(t,"input"))}const Q={created(e,{modifiers:{lazy:t,trim:n,number:o}},i){e._assign=J(i);const a=o||"number"===e.type;w(e,t?"change":"input",(t=>{if(t.target.composing)return;let o=e.value;n?o=o.trim():a&&(o=(0,r.He)(o)),e._assign(o)})),n&&w(e,"change",(()=>{e.value=e.value.trim()})),t||(w(e,"compositionstart",X),w(e,"compositionend",Z),w(e,"change",Z))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,modifiers:{trim:n,number:o}},i){if(e._assign=J(i),e.composing)return;if(document.activeElement===e){if(n&&e.value.trim()===t)return;if((o||"number"===e.type)&&(0,r.He)(e.value)===t)return}const a=null==t?"":t;e.value!==a&&(e.value=a)}},ee={created(e,t,n){e._assign=J(n),w(e,"change",(()=>{const t=e._modelValue,n=ie(e),o=e.checked,i=e._assign;if((0,r.kJ)(t)){const e=(0,r.hq)(t,n),a=-1!==e;if(o&&!a)i(t.concat(n));else if(!o&&a){const n=[...t];n.splice(e,1),i(n)}}else if((0,r.DM)(t)){const e=new Set(t);o?e.add(n):e.delete(n),i(e)}else i(ae(e,o))}))},mounted:te,beforeUpdate(e,t,n){e._assign=J(n),te(e,t,n)}};function te(e,{value:t,oldValue:n},o){e._modelValue=t,(0,r.kJ)(t)?e.checked=(0,r.hq)(t,o.props.value)>-1:(0,r.DM)(t)?e.checked=t.has(o.props.value):t!==n&&(e.checked=(0,r.WV)(t,ae(e,!0)))}const ne={created(e,{value:t},n){e.checked=(0,r.WV)(t,n.props.value),e._assign=J(n),w(e,"change",(()=>{e._assign(ie(e))}))},beforeUpdate(e,{value:t,oldValue:n},o){e._assign=J(o),t!==n&&(e.checked=(0,r.WV)(t,o.props.value))}},re={created(e,{value:t,modifiers:{number:n}},o){const i=(0,r.DM)(t);w(e,"change",(()=>{const t=Array.prototype.filter.call(e.options,(e=>e.selected)).map((e=>n?(0,r.He)(ie(e)):ie(e)));e._assign(e.multiple?i?new Set(t):t:t[0])})),e._assign=J(o)},mounted(e,{value:t}){oe(e,t)},beforeUpdate(e,t,n){e._assign=J(n)},updated(e,{value:t}){oe(e,t)}};function oe(e,t){const n=e.multiple;if(!n||(0,r.kJ)(t)||(0,r.DM)(t)){for(let o=0,i=e.options.length;o-1:i.selected=t.has(a);else if((0,r.WV)(ie(i),t))return void(e.selectedIndex=o)}n||(e.selectedIndex=-1)}}function ie(e){return"_value"in e?e._value:e.value}function ae(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const le={created(e,t,n){se(e,t,n,null,"created")},mounted(e,t,n){se(e,t,n,null,"mounted")},beforeUpdate(e,t,n,r){se(e,t,n,r,"beforeUpdate")},updated(e,t,n,r){se(e,t,n,r,"updated")}};function se(e,t,n,r,o){let i;switch(e.tagName){case"SELECT":i=re;break;case"TEXTAREA":i=Q;break;default:switch(n.props&&n.props.type){case"checkbox":i=ee;break;case"radio":i=ne;break;default:i=Q}}const a=i[o];a&&a(e,t,n,r)}const ue=["ctrl","shift","alt","meta"],ce={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>ue.some((n=>e[`${n}Key`]&&!t.includes(n)))},de=(e,t)=>(n,...r)=>{for(let e=0;en=>{if(!("key"in n))return;const o=(0,r.rs)(n.key);return t.some((e=>e===o||fe[e]===o))?e(n):void 0},he={beforeMount(e,{value:t},{transition:n}){e._vod="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):me(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),me(e,!0),r.enter(e)):r.leave(e,(()=>{me(e,!1)})):me(e,t))},beforeUnmount(e,{value:t}){me(e,t)}};function me(e,t){e.style.display=t?e._vod:"none"}const ge=(0,r.l7)({patchProp:(e,t,n,o,i=!1,a,l,s,u)=>{switch(t){case"class":!function(e,t,n){if(null==t&&(t=""),n)e.setAttribute("class",t);else{const n=e._vtc;n&&(t=(t?[t,...n]:[...n]).join(" ")),e.className=t}}(e,o,i);break;case"style":!function(e,t,n){const o=e.style;if(n)if((0,r.HD)(n)){if(t!==n){const t=o.display;o.cssText=n,"_vod"in e&&(o.display=t)}}else{for(const e in n)f(o,e,n[e]);if(t&&!(0,r.HD)(t))for(const e in t)null==n[e]&&f(o,e,"")}else e.removeAttribute("style")}(e,n,o);break;default:(0,r.F7)(t)?(0,r.tR)(t)||x(e,t,0,o,l):function(e,t,n,o){if(o)return"innerHTML"===t||!!(t in e&&O.test(t)&&(0,r.mf)(n));if("spellcheck"===t||"draggable"===t)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if(O.test(t)&&(0,r.HD)(n))return!1;return t in e}(e,t,o,i)?function(e,t,n,r,o,i,a){if("innerHTML"===t||"textContent"===t)return r&&a(r,o,i),void(e[t]=null==n?"":n);if("value"!==t||"PROGRESS"===e.tagName){if(""===n||null==n){const r=typeof e[t];if(""===n&&"boolean"===r)return void(e[t]=!0);if(null==n&&"string"===r)return e[t]="",void e.removeAttribute(t);if("number"===r)return e[t]=0,void e.removeAttribute(t)}try{e[t]=n}catch(e){}}else{e._value=n;const t=null==n?"":n;e.value!==t&&(e.value=t)}}(e,t,o,a,l,s,u):("true-value"===t?e._trueValue=o:"false-value"===t&&(e._falseValue=o),function(e,t,n,o){if(o&&t.startsWith("xlink:"))null==n?e.removeAttributeNS(m,t.slice(6,t.length)):e.setAttributeNS(m,t,n);else{const o=(0,r.Pq)(t);null==n||o&&!1===n?e.removeAttribute(t):e.setAttribute(t,o?"":n)}}(e,t,o,i))}},forcePatchProp:(e,t)=>"value"===t},c);let ye,ve=!1;function be(){return ye||(ye=(0,o.Us)(ge))}function _e(){return ye=ve?ye:(0,o.Eo)(ge),ve=!0,ye}const we=(...e)=>{be().render(...e)},xe=(...e)=>{_e().hydrate(...e)},ke=(...e)=>{const t=be().createApp(...e);const{mount:n}=t;return t.mount=e=>{const o=Se(e);if(!o)return;const i=t._component;(0,r.mf)(i)||i.render||i.template||(i.template=o.innerHTML),o.innerHTML="";const a=n(o,!1,o instanceof SVGElement);return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),a},t},Oe=(...e)=>{const t=_e().createApp(...e);const{mount:n}=t;return t.mount=e=>{const t=Se(e);if(t)return n(t,!0,t instanceof SVGElement)},t};function Se(e){if((0,r.HD)(e)){return document.querySelector(e)}return e}},3577:(e,t,n)=>{"use strict";function r(e,t){const n=Object.create(null),r=e.split(",");for(let e=0;e!!n[e.toLowerCase()]:e=>!!n[e]}n.d(t,{Z6:()=>y,kT:()=>g,NO:()=>b,dG:()=>v,_A:()=>B,kC:()=>Y,Nj:()=>X,l7:()=>k,E9:()=>ee,aU:()=>G,RI:()=>E,rs:()=>H,ir:()=>J,kJ:()=>A,mf:()=>T,e1:()=>o,S0:()=>D,_N:()=>C,tR:()=>x,Kn:()=>N,F7:()=>w,tI:()=>V,Gg:()=>q,DM:()=>j,Pq:()=>a,HD:()=>W,yk:()=>M,WV:()=>f,hq:()=>p,fY:()=>r,C_:()=>d,j5:()=>l,Od:()=>O,zw:()=>h,hR:()=>K,He:()=>Z,W7:()=>I});const o=r("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt");const i="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",a=r(i);function l(e){if(A(e)){const t={};for(let n=0;n{if(e){const n=e.split(u);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function d(e){let t="";if(W(e))t=e;else if(A(e))for(let n=0;nf(e,t)))}const h=e=>null==e?"":N(e)?JSON.stringify(e,m,2):String(e),m=(e,t)=>C(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,n])=>(e[`${t} =>`]=n,e)),{})}:j(t)?{[`Set(${t.size})`]:[...t.values()]}:!N(t)||A(t)||U(t)?t:String(t),g={},y=[],v=()=>{},b=()=>!1,_=/^on[^a-z]/,w=e=>_.test(e),x=e=>e.startsWith("onUpdate:"),k=Object.assign,O=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},S=Object.prototype.hasOwnProperty,E=(e,t)=>S.call(e,t),A=Array.isArray,C=e=>"[object Map]"===R(e),j=e=>"[object Set]"===R(e),P=e=>e instanceof Date,T=e=>"function"==typeof e,W=e=>"string"==typeof e,M=e=>"symbol"==typeof e,N=e=>null!==e&&"object"==typeof e,V=e=>N(e)&&T(e.then)&&T(e.catch),L=Object.prototype.toString,R=e=>L.call(e),I=e=>R(e).slice(8,-1),U=e=>"[object Object]"===R(e),D=e=>W(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,q=r(",key,ref,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),z=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},F=/-(\w)/g,B=z((e=>e.replace(F,((e,t)=>t?t.toUpperCase():"")))),$=/\B([A-Z])/g,H=z((e=>e.replace($,"-$1").toLowerCase())),Y=z((e=>e.charAt(0).toUpperCase()+e.slice(1))),K=z((e=>e?`on${Y(e)}`:"")),G=(e,t)=>e!==t&&(e==e||t==t),J=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},Z=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Q;const ee=()=>Q||(Q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{})},9669:(e,t,n)=>{e.exports=n(1609)},5448:(e,t,n)=>{"use strict";var r=n(4867),o=n(6026),i=n(4372),a=n(5327),l=n(4097),s=n(4109),u=n(7985),c=n(5061);e.exports=function(e){return new Promise((function(t,n){var d=e.data,f=e.headers;r.isFormData(d)&&delete f["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";f.Authorization="Basic "+btoa(h+":"+m)}var g=l(e.baseURL,e.url);if(p.open(e.method.toUpperCase(),a(g,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in p?s(p.getAllResponseHeaders()):null,i={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:e,request:p};o(t,n,i),p=null}},p.onabort=function(){p&&(n(c("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){n(c("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(c(t,e,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var y=(e.withCredentials||u(g))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;y&&(f[e.xsrfHeaderName]=y)}if("setRequestHeader"in p&&r.forEach(f,(function(e,t){void 0===d&&"content-type"===t.toLowerCase()?delete f[t]:p.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),e.responseType)try{p.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),n(e),p=null)})),d||(d=null),p.send(d)}))}},1609:(e,t,n)=>{"use strict";var r=n(4867),o=n(1849),i=n(321),a=n(7185);function l(e){var t=new i(e),n=o(i.prototype.request,t);return r.extend(n,i.prototype,t),r.extend(n,t),n}var s=l(n(5655));s.Axios=i,s.create=function(e){return l(a(s.defaults,e))},s.Cancel=n(5263),s.CancelToken=n(4972),s.isCancel=n(6502),s.all=function(e){return Promise.all(e)},s.spread=n(8713),s.isAxiosError=n(6268),e.exports=s,e.exports.default=s},5263:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},4972:(e,t,n)=>{"use strict";var r=n(5263);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},6502:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:(e,t,n)=>{"use strict";var r=n(4867),o=n(5327),i=n(782),a=n(3572),l=n(7185);function s(e){this.defaults=e,this.interceptors={request:new i,response:new i}}s.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=l(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[a,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},s.prototype.getUri=function(e){return e=l(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){s.prototype[e]=function(t,n){return this.request(l(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){s.prototype[e]=function(t,n,r){return this.request(l(r||{},{method:e,url:t,data:n}))}})),e.exports=s},782:(e,t,n)=>{"use strict";var r=n(4867);function o(){this.handlers=[]}o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},4097:(e,t,n)=>{"use strict";var r=n(1793),o=n(7303);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},5061:(e,t,n)=>{"use strict";var r=n(481);e.exports=function(e,t,n,o,i){var a=new Error(e);return r(a,t,n,o,i)}},3572:(e,t,n)=>{"use strict";var r=n(4867),o=n(8527),i=n(6502),a=n(5655);function l(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return l(e),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return l(e),t.data=o(t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(l(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:e=>{"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,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}},e}},7185:(e,t,n)=>{"use strict";var r=n(4867);e.exports=function(e,t){t=t||{};var n={},o=["url","method","data"],i=["headers","auth","proxy","params"],a=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],l=["validateStatus"];function s(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function u(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(n[o]=s(void 0,e[o])):n[o]=s(e[o],t[o])}r.forEach(o,(function(e){r.isUndefined(t[e])||(n[e]=s(void 0,t[e]))})),r.forEach(i,u),r.forEach(a,(function(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(n[o]=s(void 0,e[o])):n[o]=s(void 0,t[o])})),r.forEach(l,(function(r){r in t?n[r]=s(e[r],t[r]):r in e&&(n[r]=s(void 0,e[r]))}));var c=o.concat(i).concat(a).concat(l),d=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===c.indexOf(e)}));return r.forEach(d,u),n}},6026:(e,t,n)=>{"use strict";var r=n(5061);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},8527:(e,t,n)=>{"use strict";var r=n(4867);e.exports=function(e,t,n){return r.forEach(n,(function(n){e=n(e,t)})),e}},5655:(e,t,n)=>{"use strict";var r=n(4155),o=n(4867),i=n(6016),a={"Content-Type":"application/x-www-form-urlencoded"};function l(e,t){!o.isUndefined(e)&&o.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var s,u={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==r&&"[object process]"===Object.prototype.toString.call(r))&&(s=n(5448)),s),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),o.isFormData(e)||o.isArrayBuffer(e)||o.isBuffer(e)||o.isStream(e)||o.isFile(e)||o.isBlob(e)?e:o.isArrayBufferView(e)?e.buffer:o.isURLSearchParams(e)?(l(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):o.isObject(e)?(l(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},o.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),o.forEach(["post","put","patch"],(function(e){u.headers[e]=o.merge(a)})),e.exports=u},1849:e=>{"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r{"use strict";var r=n(4867);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(r.isURLSearchParams(t))i=t.toString();else{var a=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),a.push(o(t)+"="+o(e))})))})),i=a.join("&")}if(i){var l=e.indexOf("#");-1!==l&&(e=e.slice(0,l)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},7303:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},4372:(e,t,n)=>{"use strict";var r=n(4867);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,i,a){var l=[];l.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),r.isString(o)&&l.push("path="+o),r.isString(i)&&l.push("domain="+i),!0===a&&l.push("secure"),document.cookie=l.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(){}}},1793:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},6268:e=>{"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},7985:(e,t,n)=>{"use strict";var r=n(4867);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},6016:(e,t,n)=>{"use strict";var r=n(4867);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},4109:(e,t,n)=>{"use strict";var r=n(4867),o=["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"];e.exports=function(e){var t,n,i,a={};return e?(r.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(a[t]&&o.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}})),a):a}},8713:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},4867:(e,t,n)=>{"use strict";var r=n(1849),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function a(e){return void 0===e}function l(e){return null!==e&&"object"==typeof e}function s(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===o.call(e)}function c(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n{"use strict";var r=n(9963),o=n(6252),i=n(9038),a=n(1966),l=n(3577),s={class:"app"},u={class:"app__main"},c={class:"app__body"},d={class:"app-mobile-header"},f=(0,o.Wm)("img",{src:"/vendor/bazar/img/bazar-logo.svg",alt:""},null,-1),p={class:"app__messages"};var h={class:"app-header"},m={class:"row justify-content-between align-items-center"},g={class:"col"},y={class:"app-header__title mt-3 mt-md-2"},v=(0,o.Wm)("div",{class:"app-header__actions col-auto"},null,-1);var b={class:"breadcrumb"},_={key:0};const w={computed:{breadcrumbs:function(){return this.$page.props.breadcrumbs},paths:function(){return Object.keys(this.breadcrumbs).sort((function(e,t){return e.length-t.length}))}},methods:{isLast:function(e){return this.paths.indexOf(e)===this.paths.length-1}},render:function(e,t,n,r,i,a){var s=(0,o.up)("inertia-link");return(0,o.wg)(),(0,o.j4)("nav",{class:"app-header__breadcrumb","aria-label":e.__("Breadcrumbs")},[(0,o.Wm)("ol",b,[((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(a.paths,(function(e,t){return(0,o.wg)(),(0,o.j4)("li",{key:t,class:["breadcrumb-item",{"is-active":a.isLast(e)}]},[a.isLast(e)?((0,o.wg)(),(0,o.j4)("span",_,(0,l.zw)(a.breadcrumbs[e]),1)):((0,o.wg)(),(0,o.j4)(s,{key:1,href:e},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(a.breadcrumbs[e]),1)]})),_:2},1032,["href"]))],2)})),128))])],8,["aria-label"])}},x={components:{Breadcrumbs:w},render:function(e,t,n,r,i,a){var s=(0,o.up)("breadcrumbs"),u=(0,o.up)("icon");return(0,o.wg)(),(0,o.j4)("header",h,[(0,o.Wm)("div",m,[(0,o.Wm)("div",g,[(0,o.Wm)(s),(0,o.Wm)("h1",y,[(0,o.Wm)(u,{name:e.$parent.icon},null,8,["name"]),(0,o.Wm)("span",null,(0,l.zw)(e.$parent.title),1)])]),v])])}},k=x;var O={class:"app__sidebar"},S={class:"app-logo-wrapper"},E=(0,o.Wm)("img",{src:"/vendor/bazar/img/bazar-logo.svg",alt:""},null,-1),A={id:"app-sidebar-inside",class:"app-sidebar__inside","data-simplebar":""},C={class:"app-sidebar-menu"},j={class:"app-sidebar-menu-item"},P={class:"app-sidebar-menu-link__icon"},T={class:"app-sidebar-menu-link__caption"},W={class:"app-sidebar__title"},M={class:"app-sidebar-menu"},N={class:"app-sidebar-menu-link__icon"},V={class:"app-sidebar-menu-link__caption"},L={key:0,class:"app-sidebar-submenu"},R={class:"app-sidebar__footer"},I={class:"loggedin-user dropdown-toggle",type:"button",style:{"max-width":"100%"}},U={class:"loggedin-user__welcome"},D={class:"loggedin-user__name",style:{"max-width":"100%",overflow:"hidden","text-overflow":"ellipsis"}},q={class:"dropdown-header"},z=(0,o.Wm)("div",{class:"dropdown-divider"},null,-1),F={type:"submit",form:"logout-form",class:"dropdown-item"},B={id:"logout-form",action:"/logout",method:"POST",style:{display:"none"}};const $={data:function(){return{isOpen:!1}},methods:{open:function(){this.isOpen||(this.isOpen=!0,this.$dispatcher.emit("open"))},close:function(){this.isOpen&&(this.isOpen=!1,this.$dispatcher.emit("close"))},toggle:function(){this.isOpen?this.close():this.open()}}},H={mixins:[$],mounted:function(){var e=this;this.setActiveLinks(),this.$inertia.on("success",(function(t){e.setActiveLinks()}))},computed:{groups:function(){return window.Bazar.menu}},methods:{setActiveLinks:function(){var e=window.location.pathname.replace(/\/$/,"");this.$el.querySelectorAll("a.app-sidebar-menu-link").forEach((function(t){"/bazar"!==t.pathname&&e.includes(t.pathname)?t.closest(".app-sidebar-menu-item").classList.add("is-open","is-active"):t.closest(".app-sidebar-menu-item").classList.remove("is-open","is-active")})),this.$el.querySelectorAll(".app-sidebar__inside a").forEach((function(t){e===t.pathname?t.classList.add("is-active"):t.classList.remove("is-active")}))}},render:function(e,t,n,i,a,s){var u=(0,o.up)("inertia-link"),c=(0,o.up)("icon"),d=(0,o.up)("dropdown");return(0,o.wg)(),(0,o.j4)("div",O,[(0,o.wy)((0,o.Wm)("div",{class:"modal app-sidebar-overlay",onClick:t[1]||(t[1]=(0,r.iM)((function(){return e.close&&e.close.apply(e,arguments)}),["self"]))},null,512),[[r.F8,e.isOpen]]),(0,o.Wm)("aside",{class:["app-sidebar",{"is-open":e.isOpen}]},[(0,o.Wm)("div",S,[(0,o.Wm)(u,{href:"/bazar",class:"app-logo"},{default:(0,o.w5)((function(){return[E]})),_:1})]),(0,o.Wm)("div",A,[(0,o.Wm)("section",null,[(0,o.Wm)("ul",C,[(0,o.Wm)("li",j,[(0,o.Wm)(u,{href:"/bazar",class:"app-sidebar-menu-link"},{default:(0,o.w5)((function(){return[(0,o.Wm)("span",P,[(0,o.Wm)(c,{name:"dashboard"})]),(0,o.Wm)("span",T,(0,l.zw)(e.__("Dashboard")),1)]})),_:1})])])]),((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(s.groups,(function(e,t){return(0,o.wg)(),(0,o.j4)("section",{key:t,class:"mt-4"},[(0,o.Wm)("h2",W,(0,l.zw)(t),1),(0,o.Wm)("ul",M,[((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(e,(function(e,t){return(0,o.wg)(),(0,o.j4)("li",{key:t,class:"app-sidebar-menu-item"},[(0,o.Wm)(u,{href:t,class:"app-sidebar-menu-link"},{default:(0,o.w5)((function(){return[(0,o.Wm)("span",N,[(0,o.Wm)(c,{name:e.icon},null,8,["name"])]),(0,o.Wm)("span",V,(0,l.zw)(e.label),1)]})),_:2},1032,["href"]),Object.keys(e.items).length>0?((0,o.wg)(),(0,o.j4)("ul",L,[((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(e.items,(function(e,t){return(0,o.wg)(),(0,o.j4)("li",{key:t,class:"app-sidebar-submenu-item"},[(0,o.Wm)(u,{href:t,class:"app-sidebar-submenu-link"},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e),1)]})),_:2},1032,["href"])])})),128))])):(0,o.ry)("",!0)])})),128))])])})),128))]),(0,o.Wm)("div",R,[(0,o.Wm)(d,{direction:"up",style:{"max-width":"100%"}},{trigger:(0,o.w5)((function(){return[(0,o.Wm)("button",I,[(0,o.Wm)("span",U,(0,l.zw)(e.__("Hi"))+",",1),(0,o.Wm)("span",D,(0,l.zw)(e.$parent.user.name),1),(0,o.Wm)("img",{class:"loggedin-user__avatar",src:e.$parent.user.avatar,alt:e.$parent.user.name},null,8,["src","alt"])])]})),default:(0,o.w5)((function(){return[(0,o.Wm)("h6",q,(0,l.zw)(e.__("User")),1),(0,o.Wm)(u,{href:"/bazar/profile",class:"dropdown-item"},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.__("Profile")),1)]})),_:1}),(0,o.Wm)(u,{href:"/bazar/password",class:"dropdown-item"},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.__("Password")),1)]})),_:1}),z,(0,o.Wm)("button",F,(0,l.zw)(e.__("Logout")),1)]})),_:1}),(0,o.Wm)("form",B,[(0,o.Wm)("input",{type:"hidden",name:"_token",value:e.$page.props.csrf_token},null,8,["value"])])])],2)])}},Y={components:{AppHeader:k,AppSidebar:H},mounted:function(){var e=this;document.title="Bazar | ".concat(this.title),this.$inertia.on("success",(function(t){e.key=(new Date).getTime()}))},watch:{title:function(e,t){document.title="Bazar | ".concat(e)}},data:function(){return{icon:"dashboard",key:(new Date).getTime(),title:this.__("Dashboard")}},computed:{user:function(){return window.Bazar.user},message:function(){return this.$page.props.message},hasErrors:function(){return Object.keys(this.$page.props.errors).length>0}},render:function(e,t,n,r,i,a){var h=(0,o.up)("app-sidebar"),m=(0,o.up)("inertia-link"),g=(0,o.up)("icon"),y=(0,o.up)("app-header"),v=(0,o.up)("alert");return(0,o.wg)(),(0,o.j4)("div",s,[(0,o.Wm)(h,{ref:"sidebar"},null,512),(0,o.Wm)("div",u,[(0,o.Wm)("div",c,[(0,o.Wm)("div",d,[(0,o.Wm)(m,{href:"/bazar",class:"app-mobile-header__logo"},{default:(0,o.w5)((function(){return[f]})),_:1}),(0,o.Wm)("button",{type:"button",class:"app-mobile-header__menu-toggle",onClick:t[1]||(t[1]=function(){var t;return e.$refs.sidebar.toggle&&(t=e.$refs.sidebar).toggle.apply(t,arguments)})},[(0,o.Wm)(g,{name:"menu"})])]),(0,o.Wm)(y),(0,o.Wm)("div",p,[a.message?((0,o.wg)(),(0,o.j4)(v,{key:"message-".concat(e.$parent.key),closable:""},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(a.message),1)]})),_:1})):(0,o.ry)("",!0),a.hasErrors?((0,o.wg)(),(0,o.j4)(v,{type:"danger",key:"error-".concat(e.$parent.key),closable:""},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.__("There is an error!")),1)]})),_:1})):(0,o.ry)("",!0)]),(0,o.WI)(e.$slots,"default")])])])}},K=Y;n(9554),n(4747);var G=n(1807),J=n.n(G),X=(n(7327),n(6992),n(9601),n(1539),n(1058),n(8783),n(4129),n(3948),n(3096)),Z=n.n(X),Q=n(1296),ee=n.n(Q),te=n(773),ne=n.n(te),re=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,r){return e[0]===t&&(n=r,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n0},e.prototype.connect_=function(){oe&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),se?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){oe&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;le.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),ce=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),xe="undefined"!=typeof WeakMap?new WeakMap:new re,ke=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=ue.getInstance(),r=new we(t,n,this);xe.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){ke.prototype[e]=function(){var t;return(t=xe.get(this))[e].apply(t,arguments)}}));const Oe=void 0!==ie.ResizeObserver?ie.ResizeObserver:ke;n(5827),n(8309),n(4916),n(4723),n(5306);var Se=null,Ee=null;function Ae(){if(null===Se){if("undefined"==typeof document)return Se=0;var e=document.body,t=document.createElement("div");t.classList.add("simplebar-hide-scrollbar"),e.appendChild(t);var n=t.getBoundingClientRect().right;e.removeChild(t),Se=n}return Se}J()&&window.addEventListener("resize",(function(){Ee!==window.devicePixelRatio&&(Ee=window.devicePixelRatio,Se=null)}));var Ce=function(e){return Array.prototype.reduce.call(e,(function(e,t){var n=t.name.match(/data-simplebar-(.+)/);if(n){var r=n[1].replace(/\W+(.)/g,(function(e,t){return t.toUpperCase()}));switch(t.value){case"true":e[r]=!0;break;case"false":e[r]=!1;break;case void 0:e[r]=!0;break;default:e[r]=t.value}}return e}),{})};function je(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window}function Pe(e){return e&&e.ownerDocument?e.ownerDocument:document}var Te=function(){function e(t,n){var r=this;this.onScroll=function(){var e=je(r.el);r.scrollXTicking||(e.requestAnimationFrame(r.scrollX),r.scrollXTicking=!0),r.scrollYTicking||(e.requestAnimationFrame(r.scrollY),r.scrollYTicking=!0)},this.scrollX=function(){r.axis.x.isOverflowing&&(r.showScrollbar("x"),r.positionScrollbar("x")),r.scrollXTicking=!1},this.scrollY=function(){r.axis.y.isOverflowing&&(r.showScrollbar("y"),r.positionScrollbar("y")),r.scrollYTicking=!1},this.onMouseEnter=function(){r.showScrollbar("x"),r.showScrollbar("y")},this.onMouseMove=function(e){r.mouseX=e.clientX,r.mouseY=e.clientY,(r.axis.x.isOverflowing||r.axis.x.forceVisible)&&r.onMouseMoveForAxis("x"),(r.axis.y.isOverflowing||r.axis.y.forceVisible)&&r.onMouseMoveForAxis("y")},this.onMouseLeave=function(){r.onMouseMove.cancel(),(r.axis.x.isOverflowing||r.axis.x.forceVisible)&&r.onMouseLeaveForAxis("x"),(r.axis.y.isOverflowing||r.axis.y.forceVisible)&&r.onMouseLeaveForAxis("y"),r.mouseX=-1,r.mouseY=-1},this.onWindowResize=function(){r.scrollbarWidth=r.getScrollbarWidth(),r.hideNativeScrollbar()},this.hideScrollbars=function(){r.axis.x.track.rect=r.axis.x.track.el.getBoundingClientRect(),r.axis.y.track.rect=r.axis.y.track.el.getBoundingClientRect(),r.isWithinBounds(r.axis.y.track.rect)||(r.axis.y.scrollbar.el.classList.remove(r.classNames.visible),r.axis.y.isVisible=!1),r.isWithinBounds(r.axis.x.track.rect)||(r.axis.x.scrollbar.el.classList.remove(r.classNames.visible),r.axis.x.isVisible=!1)},this.onPointerEvent=function(e){var t,n;r.axis.x.track.rect=r.axis.x.track.el.getBoundingClientRect(),r.axis.y.track.rect=r.axis.y.track.el.getBoundingClientRect(),(r.axis.x.isOverflowing||r.axis.x.forceVisible)&&(t=r.isWithinBounds(r.axis.x.track.rect)),(r.axis.y.isOverflowing||r.axis.y.forceVisible)&&(n=r.isWithinBounds(r.axis.y.track.rect)),(t||n)&&(e.preventDefault(),e.stopPropagation(),"mousedown"===e.type&&(t&&(r.axis.x.scrollbar.rect=r.axis.x.scrollbar.el.getBoundingClientRect(),r.isWithinBounds(r.axis.x.scrollbar.rect)?r.onDragStart(e,"x"):r.onTrackClick(e,"x")),n&&(r.axis.y.scrollbar.rect=r.axis.y.scrollbar.el.getBoundingClientRect(),r.isWithinBounds(r.axis.y.scrollbar.rect)?r.onDragStart(e,"y"):r.onTrackClick(e,"y"))))},this.drag=function(t){var n=r.axis[r.draggedAxis].track,o=n.rect[r.axis[r.draggedAxis].sizeAttr],i=r.axis[r.draggedAxis].scrollbar,a=r.contentWrapperEl[r.axis[r.draggedAxis].scrollSizeAttr],l=parseInt(r.elStyles[r.axis[r.draggedAxis].sizeAttr],10);t.preventDefault(),t.stopPropagation();var s=(("y"===r.draggedAxis?t.pageY:t.pageX)-n.rect[r.axis[r.draggedAxis].offsetAttr]-r.axis[r.draggedAxis].dragOffset)/(o-i.size)*(a-l);"x"===r.draggedAxis&&(s=r.isRtl&&e.getRtlHelpers().isRtlScrollbarInverted?s-(o+i.size):s,s=r.isRtl&&e.getRtlHelpers().isRtlScrollingInverted?-s:s),r.contentWrapperEl[r.axis[r.draggedAxis].scrollOffsetAttr]=s},this.onEndDrag=function(e){var t=Pe(r.el),n=je(r.el);e.preventDefault(),e.stopPropagation(),r.el.classList.remove(r.classNames.dragging),t.removeEventListener("mousemove",r.drag,!0),t.removeEventListener("mouseup",r.onEndDrag,!0),r.removePreventClickId=n.setTimeout((function(){t.removeEventListener("click",r.preventClick,!0),t.removeEventListener("dblclick",r.preventClick,!0),r.removePreventClickId=null}))},this.preventClick=function(e){e.preventDefault(),e.stopPropagation()},this.el=t,this.minScrollbarWidth=20,this.options=Object.assign({},e.defaultOptions,{},n),this.classNames=Object.assign({},e.defaultOptions.classNames,{},this.options.classNames),this.axis={x:{scrollOffsetAttr:"scrollLeft",sizeAttr:"width",scrollSizeAttr:"scrollWidth",offsetSizeAttr:"offsetWidth",offsetAttr:"left",overflowAttr:"overflowX",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}},y:{scrollOffsetAttr:"scrollTop",sizeAttr:"height",scrollSizeAttr:"scrollHeight",offsetSizeAttr:"offsetHeight",offsetAttr:"top",overflowAttr:"overflowY",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}}},this.removePreventClickId=null,e.instances.has(this.el)||(this.recalculate=Z()(this.recalculate.bind(this),64),this.onMouseMove=Z()(this.onMouseMove.bind(this),64),this.hideScrollbars=ee()(this.hideScrollbars.bind(this),this.options.timeout),this.onWindowResize=ee()(this.onWindowResize.bind(this),64,{leading:!0}),e.getRtlHelpers=ne()(e.getRtlHelpers),this.init())}e.getRtlHelpers=function(){var t=document.createElement("div");t.innerHTML='
';var n=t.firstElementChild;document.body.appendChild(n);var r=n.firstElementChild;n.scrollLeft=0;var o=e.getOffset(n),i=e.getOffset(r);n.scrollLeft=999;var a=e.getOffset(r);return{isRtlScrollingInverted:o.left!==i.left&&i.left-a.left!=0,isRtlScrollbarInverted:o.left!==i.left}},e.getOffset=function(e){var t=e.getBoundingClientRect(),n=Pe(e),r=je(e);return{top:t.top+(r.pageYOffset||n.documentElement.scrollTop),left:t.left+(r.pageXOffset||n.documentElement.scrollLeft)}};var t=e.prototype;return t.init=function(){e.instances.set(this.el,this),J()&&(this.initDOM(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())},t.initDOM=function(){var e=this;if(Array.prototype.filter.call(this.el.children,(function(t){return t.classList.contains(e.classNames.wrapper)})).length)this.wrapperEl=this.el.querySelector("."+this.classNames.wrapper),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector("."+this.classNames.contentWrapper),this.contentEl=this.options.contentNode||this.el.querySelector("."+this.classNames.contentEl),this.offsetEl=this.el.querySelector("."+this.classNames.offset),this.maskEl=this.el.querySelector("."+this.classNames.mask),this.placeholderEl=this.findChild(this.wrapperEl,"."+this.classNames.placeholder),this.heightAutoObserverWrapperEl=this.el.querySelector("."+this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl=this.el.querySelector("."+this.classNames.heightAutoObserverEl),this.axis.x.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.horizontal),this.axis.y.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.vertical);else{for(this.wrapperEl=document.createElement("div"),this.contentWrapperEl=document.createElement("div"),this.offsetEl=document.createElement("div"),this.maskEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.placeholderEl=document.createElement("div"),this.heightAutoObserverWrapperEl=document.createElement("div"),this.heightAutoObserverEl=document.createElement("div"),this.wrapperEl.classList.add(this.classNames.wrapper),this.contentWrapperEl.classList.add(this.classNames.contentWrapper),this.offsetEl.classList.add(this.classNames.offset),this.maskEl.classList.add(this.classNames.mask),this.contentEl.classList.add(this.classNames.contentEl),this.placeholderEl.classList.add(this.classNames.placeholder),this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.contentWrapperEl.appendChild(this.contentEl),this.offsetEl.appendChild(this.contentWrapperEl),this.maskEl.appendChild(this.offsetEl),this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl),this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl),this.wrapperEl.appendChild(this.maskEl),this.wrapperEl.appendChild(this.placeholderEl),this.el.appendChild(this.wrapperEl)}if(!this.axis.x.track.el||!this.axis.y.track.el){var t=document.createElement("div"),n=document.createElement("div");t.classList.add(this.classNames.track),n.classList.add(this.classNames.scrollbar),t.appendChild(n),this.axis.x.track.el=t.cloneNode(!0),this.axis.x.track.el.classList.add(this.classNames.horizontal),this.axis.y.track.el=t.cloneNode(!0),this.axis.y.track.el.classList.add(this.classNames.vertical),this.el.appendChild(this.axis.x.track.el),this.el.appendChild(this.axis.y.track.el)}this.axis.x.scrollbar.el=this.axis.x.track.el.querySelector("."+this.classNames.scrollbar),this.axis.y.scrollbar.el=this.axis.y.track.el.querySelector("."+this.classNames.scrollbar),this.options.autoHide||(this.axis.x.scrollbar.el.classList.add(this.classNames.visible),this.axis.y.scrollbar.el.classList.add(this.classNames.visible)),this.el.setAttribute("data-simplebar","init")},t.initListeners=function(){var e=this,t=je(this.el);this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach((function(t){e.el.addEventListener(t,e.onPointerEvent,!0)})),["touchstart","touchend","touchmove"].forEach((function(t){e.el.addEventListener(t,e.onPointerEvent,{capture:!0,passive:!0})})),this.el.addEventListener("mousemove",this.onMouseMove),this.el.addEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl.addEventListener("scroll",this.onScroll),t.addEventListener("resize",this.onWindowResize);var n=!1,r=t.ResizeObserver||Oe;this.resizeObserver=new r((function(){n&&e.recalculate()})),this.resizeObserver.observe(this.el),this.resizeObserver.observe(this.contentEl),t.requestAnimationFrame((function(){n=!0})),this.mutationObserver=new t.MutationObserver(this.recalculate),this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})},t.recalculate=function(){var e=je(this.el);this.elStyles=e.getComputedStyle(this.el),this.isRtl="rtl"===this.elStyles.direction;var t=this.heightAutoObserverEl.offsetHeight<=1,n=this.heightAutoObserverEl.offsetWidth<=1,r=this.contentEl.offsetWidth,o=this.contentWrapperEl.offsetWidth,i=this.elStyles.overflowX,a=this.elStyles.overflowY;this.contentEl.style.padding=this.elStyles.paddingTop+" "+this.elStyles.paddingRight+" "+this.elStyles.paddingBottom+" "+this.elStyles.paddingLeft,this.wrapperEl.style.margin="-"+this.elStyles.paddingTop+" -"+this.elStyles.paddingRight+" -"+this.elStyles.paddingBottom+" -"+this.elStyles.paddingLeft;var l=this.contentEl.scrollHeight,s=this.contentEl.scrollWidth;this.contentWrapperEl.style.height=t?"auto":"100%",this.placeholderEl.style.width=n?r+"px":"auto",this.placeholderEl.style.height=l+"px";var u=this.contentWrapperEl.offsetHeight;this.axis.x.isOverflowing=s>r,this.axis.y.isOverflowing=l>u,this.axis.x.isOverflowing="hidden"!==i&&this.axis.x.isOverflowing,this.axis.y.isOverflowing="hidden"!==a&&this.axis.y.isOverflowing,this.axis.x.forceVisible="x"===this.options.forceVisible||!0===this.options.forceVisible,this.axis.y.forceVisible="y"===this.options.forceVisible||!0===this.options.forceVisible,this.hideNativeScrollbar();var c=this.axis.x.isOverflowing?this.scrollbarWidth:0,d=this.axis.y.isOverflowing?this.scrollbarWidth:0;this.axis.x.isOverflowing=this.axis.x.isOverflowing&&s>o-d,this.axis.y.isOverflowing=this.axis.y.isOverflowing&&l>u-c,this.axis.x.scrollbar.size=this.getScrollbarSize("x"),this.axis.y.scrollbar.size=this.getScrollbarSize("y"),this.axis.x.scrollbar.el.style.width=this.axis.x.scrollbar.size+"px",this.axis.y.scrollbar.el.style.height=this.axis.y.scrollbar.size+"px",this.positionScrollbar("x"),this.positionScrollbar("y"),this.toggleTrackVisibility("x"),this.toggleTrackVisibility("y")},t.getScrollbarSize=function(e){if(void 0===e&&(e="y"),!this.axis[e].isOverflowing)return 0;var t,n=this.contentEl[this.axis[e].scrollSizeAttr],r=this.axis[e].track.el[this.axis[e].offsetSizeAttr],o=r/n;return t=Math.max(~~(o*r),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(t=Math.min(t,this.options.scrollbarMaxSize)),t},t.positionScrollbar=function(t){if(void 0===t&&(t="y"),this.axis[t].isOverflowing){var n=this.contentWrapperEl[this.axis[t].scrollSizeAttr],r=this.axis[t].track.el[this.axis[t].offsetSizeAttr],o=parseInt(this.elStyles[this.axis[t].sizeAttr],10),i=this.axis[t].scrollbar,a=this.contentWrapperEl[this.axis[t].scrollOffsetAttr],l=(a="x"===t&&this.isRtl&&e.getRtlHelpers().isRtlScrollingInverted?-a:a)/(n-o),s=~~((r-i.size)*l);s="x"===t&&this.isRtl&&e.getRtlHelpers().isRtlScrollbarInverted?s+(r-i.size):s,i.el.style.transform="x"===t?"translate3d("+s+"px, 0, 0)":"translate3d(0, "+s+"px, 0)"}},t.toggleTrackVisibility=function(e){void 0===e&&(e="y");var t=this.axis[e].track.el,n=this.axis[e].scrollbar.el;this.axis[e].isOverflowing||this.axis[e].forceVisible?(t.style.visibility="visible",this.contentWrapperEl.style[this.axis[e].overflowAttr]="scroll"):(t.style.visibility="hidden",this.contentWrapperEl.style[this.axis[e].overflowAttr]="hidden"),this.axis[e].isOverflowing?n.style.display="block":n.style.display="none"},t.hideNativeScrollbar=function(){this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?"-"+this.scrollbarWidth+"px":0,this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?"-"+this.scrollbarWidth+"px":0},t.onMouseMoveForAxis=function(e){void 0===e&&(e="y"),this.axis[e].track.rect=this.axis[e].track.el.getBoundingClientRect(),this.axis[e].scrollbar.rect=this.axis[e].scrollbar.el.getBoundingClientRect(),this.isWithinBounds(this.axis[e].scrollbar.rect)?this.axis[e].scrollbar.el.classList.add(this.classNames.hover):this.axis[e].scrollbar.el.classList.remove(this.classNames.hover),this.isWithinBounds(this.axis[e].track.rect)?(this.showScrollbar(e),this.axis[e].track.el.classList.add(this.classNames.hover)):this.axis[e].track.el.classList.remove(this.classNames.hover)},t.onMouseLeaveForAxis=function(e){void 0===e&&(e="y"),this.axis[e].track.el.classList.remove(this.classNames.hover),this.axis[e].scrollbar.el.classList.remove(this.classNames.hover)},t.showScrollbar=function(e){void 0===e&&(e="y");var t=this.axis[e].scrollbar.el;this.axis[e].isVisible||(t.classList.add(this.classNames.visible),this.axis[e].isVisible=!0),this.options.autoHide&&this.hideScrollbars()},t.onDragStart=function(e,t){void 0===t&&(t="y");var n=Pe(this.el),r=je(this.el),o=this.axis[t].scrollbar,i="y"===t?e.pageY:e.pageX;this.axis[t].dragOffset=i-o.rect[this.axis[t].offsetAttr],this.draggedAxis=t,this.el.classList.add(this.classNames.dragging),n.addEventListener("mousemove",this.drag,!0),n.addEventListener("mouseup",this.onEndDrag,!0),null===this.removePreventClickId?(n.addEventListener("click",this.preventClick,!0),n.addEventListener("dblclick",this.preventClick,!0)):(r.clearTimeout(this.removePreventClickId),this.removePreventClickId=null)},t.onTrackClick=function(e,t){var n=this;if(void 0===t&&(t="y"),this.options.clickOnTrack){var r=je(this.el);this.axis[t].scrollbar.rect=this.axis[t].scrollbar.el.getBoundingClientRect();var o=this.axis[t].scrollbar.rect[this.axis[t].offsetAttr],i=parseInt(this.elStyles[this.axis[t].sizeAttr],10),a=this.contentWrapperEl[this.axis[t].scrollOffsetAttr],l=("y"===t?this.mouseY-o:this.mouseX-o)<0?-1:1,s=-1===l?a-i:a+i;!function e(){var o,i;-1===l?a>s&&(a-=n.options.clickOnTrackSpeed,n.contentWrapperEl.scrollTo(((o={})[n.axis[t].offsetAttr]=a,o)),r.requestAnimationFrame(e)):a=e.left&&this.mouseX<=e.left+e.width&&this.mouseY>=e.top&&this.mouseY<=e.top+e.height},t.findChild=function(e,t){var n=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector;return Array.prototype.filter.call(e.children,(function(e){return n.call(e,t)}))[0]},e}();Te.defaultOptions={autoHide:!0,forceVisible:!1,clickOnTrack:!0,clickOnTrackSpeed:40,classNames:{contentEl:"simplebar-content",contentWrapper:"simplebar-content-wrapper",offset:"simplebar-offset",mask:"simplebar-mask",wrapper:"simplebar-wrapper",placeholder:"simplebar-placeholder",scrollbar:"simplebar-scrollbar",track:"simplebar-track",heightAutoObserverWrapperEl:"simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"simplebar-height-auto-observer",visible:"simplebar-visible",horizontal:"simplebar-horizontal",vertical:"simplebar-vertical",hover:"simplebar-hover",dragging:"simplebar-dragging"},scrollbarMinSize:25,scrollbarMaxSize:0,timeout:1e3},Te.instances=new WeakMap,Te.initDOMLoadedElements=function(){document.removeEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.removeEventListener("load",this.initDOMLoadedElements),Array.prototype.forEach.call(document.querySelectorAll("[data-simplebar]"),(function(e){"init"===e.getAttribute("data-simplebar")||Te.instances.has(e)||new Te(e,Ce(e.attributes))}))},Te.removeObserver=function(){this.globalObserver.disconnect()},Te.initHtmlApi=function(){this.initDOMLoadedElements=this.initDOMLoadedElements.bind(this),"undefined"!=typeof MutationObserver&&(this.globalObserver=new MutationObserver(Te.handleMutations),this.globalObserver.observe(document,{childList:!0,subtree:!0})),"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?window.setTimeout(this.initDOMLoadedElements):(document.addEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.addEventListener("load",this.initDOMLoadedElements))},Te.handleMutations=function(e){e.forEach((function(e){Array.prototype.forEach.call(e.addedNodes,(function(e){1===e.nodeType&&(e.hasAttribute("data-simplebar")?!Te.instances.has(e)&&new Te(e,Ce(e.attributes)):Array.prototype.forEach.call(e.querySelectorAll("[data-simplebar]"),(function(e){"init"===e.getAttribute("data-simplebar")||Te.instances.has(e)||new Te(e,Ce(e.attributes))})))})),Array.prototype.forEach.call(e.removedNodes,(function(e){1===e.nodeType&&(e.hasAttribute('[data-simplebar="init"]')?Te.instances.has(e)&&Te.instances.get(e).unMount():Array.prototype.forEach.call(e.querySelectorAll('[data-simplebar="init"]'),(function(e){Te.instances.has(e)&&Te.instances.get(e).unMount()})))}))}))},Te.getOptions=Ce,J()&&Te.initHtmlApi();var We={class:"row"},Me={class:"col-12"},Ne={class:"col-6"},Ve={class:"col-6"};var Le={class:"card"},Re={class:"card__header"},Ie={class:"card__title"},Ue={class:"card__inner"},De={key:0,class:"alert alert-light mb-0"};var qe={width:"600",height:"300"};var ze=n(7757),Fe=n.n(ze);const Be={props:{labels:{type:Array,default:function(){return[]}},data:{type:Array,default:function(){return[]}}},mounted:function(){new(Fe())(this.$el.getContext("2d"),{data:{labels:this.labels,datasets:this.datasets},type:"line",options:this.options})},computed:{options:function(){return{tooltips:{backgroundColor:"#fff",displayColors:!1,titleFontColor:"#000",bodyFontColor:"#000"},legend:{display:!1},scales:{xAxes:[{gridLines:{display:!1}}],yAxes:[{ticks:{stepSize:1}}]}}},datasets:function(){return[{data:this.data,backgroundColor:"rgba(19, 130, 249, 0.07)",borderColor:"#1382f9",borderWidth:3,pointRadius:0,pointBackgroundColor:"#1382f9",pointBorderColor:"#1382f9",pointHoverRadius:4,pointHoverBackgroundColor:"rgba(0, 97, 242, 1)",pointHoverBorderColor:"rgba(0, 97, 242, 1)",pointBorderWidth:3,pointHitRadius:16}]}},render:function(e,t,n,r,i,a){return(0,o.wg)(),(0,o.j4)("canvas",qe)}},$e={components:{DataChart:Be},mounted:function(){this.fetch()},data:function(){return{busy:!1,sales:{}}},methods:{fetch:function(){var e=this;this.busy=!0,this.$http.get("/bazar/widgets/sales").then((function(t){e.sales=t.data})).catch((function(e){})).finally((function(){e.busy=!1}))}},render:function(e,t,n,r,i,a){var s=(0,o.up)("data-chart");return(0,o.wg)(),(0,o.j4)("section",Le,[(0,o.Wm)("div",Re,[(0,o.Wm)("h2",Ie,(0,l.zw)(e.__("Sales")),1)]),(0,o.Wm)("div",Ue,[i.busy?((0,o.wg)(),(0,o.j4)("div",De,(0,l.zw)(e.__("Loading"))+"... ",1)):((0,o.wg)(),(0,o.j4)(s,{key:1,labels:i.sales.labels,data:i.sales.data},null,8,["labels","data"]))])])}};var He={class:"col-12 col-sm-6 col-xl-4 mb-5"},Ye={class:"card is-widget has-full-height"},Ke={class:"card__inner"},Ge={class:"card__inner-title"},Je={key:0},Xe={class:"card__inner-data"},Ze={class:"card__footer d-flex justify-content-end"},Qe={class:"col-12 col-sm-6 col-xl-4 mb-5"},et={class:"card is-widget has-full-height"},tt={class:"card__inner"},nt={class:"card__inner-title"},rt={key:0},ot={key:1,class:"card__inner-data"},it={class:"card__footer d-flex justify-content-end"},at={class:"col-12 col-sm-6 col-xl-4 mb-5"},lt={class:"card is-widget has-full-height"},st={class:"card__inner"},ut={class:"card__inner-title"},ct={key:0},dt={key:1,class:"card__inner-data"},ft={class:"card__footer d-flex justify-content-end"};const pt={mounted:function(){this.fetch()},data:function(){return{busy:!1,metrics:{}}},methods:{fetch:function(){var e=this;this.busy=!0,this.$http.get("/bazar/widgets/metrics").then((function(t){e.metrics=t.data})).catch((function(e){})).finally((function(){e.busy=!1}))}},render:function(e,t,n,r,i,a){var s=(0,o.up)("inertia-link");return(0,o.wg)(),(0,o.j4)("div",null,[(0,o.Wm)("div",He,[(0,o.Wm)("section",Ye,[(0,o.Wm)("div",Ke,[(0,o.Wm)("h2",Ge,(0,l.zw)(e.__("Orders")),1),i.busy?((0,o.wg)(),(0,o.j4)("span",Je,(0,l.zw)(e.__("Loading...")),1)):(0,o.ry)("",!0),(0,o.Wm)("p",Xe,(0,l.zw)(i.metrics.orders),1)]),(0,o.Wm)("div",Ze,[(0,o.Wm)(s,{href:"/bazar/orders"},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.__("View Orders")),1)]})),_:1})])])]),(0,o.Wm)("div",Qe,[(0,o.Wm)("section",et,[(0,o.Wm)("div",tt,[(0,o.Wm)("h2",nt,(0,l.zw)(e.__("Products")),1),i.busy?((0,o.wg)(),(0,o.j4)("span",rt,(0,l.zw)(e.__("Loading...")),1)):((0,o.wg)(),(0,o.j4)("p",ot,(0,l.zw)(i.metrics.products),1))]),(0,o.Wm)("div",it,[(0,o.Wm)(s,{href:"/bazar/products"},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.__("View Products")),1)]})),_:1})])])]),(0,o.Wm)("div",at,[(0,o.Wm)("section",lt,[(0,o.Wm)("div",st,[(0,o.Wm)("h2",ut,(0,l.zw)(e.__("Users")),1),i.busy?((0,o.wg)(),(0,o.j4)("span",ct,(0,l.zw)(e.__("Loading...")),1)):((0,o.wg)(),(0,o.j4)("p",dt,(0,l.zw)(i.metrics.users),1))]),(0,o.Wm)("div",ft,[(0,o.Wm)(s,{href:"/bazar/users"},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.__("View Users")),1)]})),_:1})])])])])}};var ht={class:"card"},mt={class:"card__header"},gt={class:"card__title"},yt={class:"card__inner"},vt={key:0,class:"activities-scroll-helper","data-simplebar":""},bt={class:"activities"},_t={class:"activity__icon-helper"},wt={class:"activity__icon"},xt={class:"activity__content"},kt={class:"activity__title"},Ot={class:"activity__description"},St={class:"activity__meta"},Et={key:1,class:"alert alert-light mb-0"},At={key:2,class:"alert alert-info mb-0"};const Ct={mounted:function(){this.fetch()},data:function(){return{busy:!1,activities:[]}},methods:{fetch:function(){var e=this;this.busy=!0,this.$http.get("/bazar/widgets/activities").then((function(t){e.activities=t.data})).catch((function(e){})).finally((function(){e.busy=!1}))}},render:function(e,t,n,r,i,a){var s=(0,o.up)("icon"),u=(0,o.up)("inertia-link");return(0,o.wg)(),(0,o.j4)("section",ht,[(0,o.Wm)("div",mt,[(0,o.Wm)("h2",gt,(0,l.zw)(e.__("Recent Activity")),1)]),(0,o.Wm)("div",yt,[i.activities.length?((0,o.wg)(),(0,o.j4)("div",vt,[(0,o.Wm)("div",bt,[((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(i.activities,(function(e,t){return(0,o.wg)(),(0,o.j4)("div",{key:t,class:"activity"},[(0,o.Wm)("div",_t,[(0,o.Wm)("div",wt,[(0,o.Wm)(s,{name:e.icon},null,8,["name"])])]),(0,o.Wm)("div",xt,[(0,o.Wm)("h3",kt,[(0,o.Wm)(u,{href:e.url},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.title),1)]})),_:2},1032,["href"])]),(0,o.Wm)("p",Ot,(0,l.zw)(e.description),1),(0,o.Wm)("div",St,[(0,o.Wm)("time",{datetime:e.created_at},(0,l.zw)(e.formatted_created_at),9,["datetime"])])])])})),128))])])):i.busy&&!i.activities.length?((0,o.wg)(),(0,o.j4)("div",Et,(0,l.zw)(e.__("Loading"))+"... ",1)):((0,o.wg)(),(0,o.j4)("div",At,(0,l.zw)(e.__("No recent activities.")),1))])])}},jt={components:{Sales:$e,Metrics:pt,Activities:Ct},inheritAttrs:!1,mounted:function(){this.$parent.icon="dashboard",this.$parent.title=this.__("Dashboard")},render:function(e,t,n,r,i,a){var l=(0,o.up)("metrics"),s=(0,o.up)("activities"),u=(0,o.up)("sales");return(0,o.wg)(),(0,o.j4)("div",We,[(0,o.Wm)("div",Me,[(0,o.Wm)(l,{class:"row"})]),(0,o.Wm)("div",Ne,[(0,o.Wm)(s)]),(0,o.Wm)("div",Ve,[(0,o.Wm)(u)])])}},Pt=jt;var Tt={class:"row"},Wt={class:"col-12"},Mt={class:"table table-sm is-headless mb-0"},Nt={class:"badge badge-light"},Vt=(0,o.Wm)("tr",null,[(0,o.Wm)("th",null,"GitHub:"),(0,o.Wm)("td",null,[(0,o.Wm)("a",{href:"https://github.com/conedevelopment/bazar"}," https://github.com/conedevelopment/bazar ")])],-1),Lt=(0,o.Wm)("tr",null,[(0,o.Wm)("th",null,"Docs:"),(0,o.Wm)("td",null,[(0,o.Wm)("a",{href:"https://bazar.condevelopment.com"}," https://bazar.condevelopment.com ")])],-1);const Rt={props:{version:{type:String,required:!0}},inheritAttrs:!1,mounted:function(){this.$parent.icon="support",this.$parent.title=this.__("Support")},render:function(e,t,n,r,i,a){var s=(0,o.up)("card");return(0,o.wg)(),(0,o.j4)("div",Tt,[(0,o.Wm)("div",Wt,[(0,o.Wm)(s,{title:e.__("Package Information")},{default:(0,o.w5)((function(){return[(0,o.Wm)("table",Mt,[(0,o.Wm)("tr",null,[(0,o.Wm)("th",null,(0,l.zw)(e.__("Version"))+":",1),(0,o.Wm)("td",null,[(0,o.Wm)("span",Nt,"v"+(0,l.zw)(n.version),1)])]),Vt,Lt])]})),_:1},8,["title"])])])}},It=Rt;var Ut={class:"col-12 col-lg-7 col-xl-8 form__body"},Dt={class:"col-12 col-lg-5 col-xl-4 mt-5 mt-lg-0 form__sidebar"},qt={class:"sticky-helper"},zt={class:"form-group d-flex justify-content-between mb-0"};const Ft={inheritAttrs:!1,mounted:function(){this.$parent.icon="customer",this.$parent.title=this.__("Profile")},computed:{action:function(){return"/bazar/profile"}},render:function(e,t,n,r,i,a){var s=(0,o.up)("data-form-input"),u=(0,o.up)("card"),c=(0,o.up)("data-form");return(0,o.wg)(),(0,o.j4)(c,{class:"row",method:"PATCH",action:a.action,data:e.$parent.user},{default:(0,o.w5)((function(t){return[(0,o.Wm)("div",Ut,[(0,o.Wm)(u,{title:e.__("Profile")},{default:(0,o.w5)((function(){return[(0,o.Wm)(s,{type:"text",name:"name",label:e.__("Name"),modelValue:t.data.name,"onUpdate:modelValue":function(e){return t.data.name=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.Wm)(s,{type:"email",name:"email",label:e.__("Email"),modelValue:t.data.email,"onUpdate:modelValue":function(e){return t.data.email=e}},null,8,["label","modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"])]),(0,o.Wm)("div",Dt,[(0,o.Wm)("div",qt,[(0,o.Wm)(u,{title:e.__("Actions")},{default:(0,o.w5)((function(){return[(0,o.Wm)("div",zt,[(0,o.Wm)("button",{type:"submit",class:"btn btn-primary",disabled:t.busy},(0,l.zw)(e.__("Save")),9,["disabled"])])]})),_:2},1032,["title"])])])]})),_:1},8,["action","data"])}},Bt=Ft;var $t={class:"col-12 col-lg-7 col-xl-8 form__body"},Ht={class:"col-12 col-lg-5 col-xl-4 mt-5 mt-lg-0 form__sidebar"},Yt={class:"sticky-helper"},Kt={class:"form-group d-flex justify-content-between mb-0"};const Gt={inheritAttrs:!1,mounted:function(){this.$parent.icon="customer",this.$parent.title=this.__("Password")},data:function(){return{passwords:{current_password:null,password:null,password_confirmation:null}}},computed:{action:function(){return"/bazar/password"}},render:function(e,t,n,r,i,a){var s=(0,o.up)("data-form-input"),u=(0,o.up)("card"),c=(0,o.up)("data-form");return(0,o.wg)(),(0,o.j4)(c,{class:"row",method:"PATCH",action:a.action,data:i.passwords},{default:(0,o.w5)((function(t){return[(0,o.Wm)("div",$t,[(0,o.Wm)(u,{title:e.__("Password")},{default:(0,o.w5)((function(){return[(0,o.Wm)(s,{type:"password",name:"current_password",label:e.__("Current Password"),modelValue:t.data.current_password,"onUpdate:modelValue":function(e){return t.data.current_password=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.Wm)(s,{type:"password",name:"password",label:e.__("New Password"),modelValue:t.data.password,"onUpdate:modelValue":function(e){return t.data.password=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.Wm)(s,{type:"password",name:"password_confirmation",label:e.__("New Password Confirmation"),modelValue:t.data.password_confirmation,"onUpdate:modelValue":function(e){return t.data.password_confirmation=e}},null,8,["label","modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"])]),(0,o.Wm)("div",Ht,[(0,o.Wm)("div",Yt,[(0,o.Wm)(u,{title:e.__("Actions")},{default:(0,o.w5)((function(){return[(0,o.Wm)("div",Kt,[(0,o.Wm)("button",{type:"submit",class:"btn btn-primary",disabled:t.busy},(0,l.zw)(e.__("Save")),9,["disabled"])])]})),_:2},1032,["title"])])])]})),_:1},8,["action","data"])}},Jt=Gt;var Xt=(0,o.Wm)("br",null,null,-1),Zt=(0,o.Wm)("br",null,null,-1);const Qt={mounted:function(){this.mounted=!0},data:function(){return{mounted:!1}}},en={mixins:[Qt],props:{response:{type:Object,required:!0}},inheritAttrs:!1,mounted:function(){this.$parent.icon="address",this.$parent.title=this.__("Addresses")},computed:{url:function(){return window.location.href.replace(window.location.search,"").replace(/\/$/,"")}},methods:{formatDate:function(e){return e.substr(0,16).replace("T"," ")}},render:function(e,t,n,r,i,a){var s=(0,o.up)("inertia-link"),u=(0,o.up)("data-table-column"),c=(0,o.up)("data-table");return(0,o.wg)(),(0,o.j4)("div",null,[e.mounted?((0,o.wg)(),(0,o.j4)(o.lR,{key:0,to:".app-header__actions"},[(0,o.Wm)(s,{href:"".concat(a.url,"/create"),class:"btn btn-primary btn-sm"},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.__("Create Address")),1)]})),_:1},8,["href"])])):(0,o.ry)("",!0),(0,o.Wm)(c,{response:n.response},{default:(0,o.w5)((function(){return[(0,o.Wm)(u,{label:e.__("Alias"),sort:"alias"},{default:(0,o.w5)((function(e){return[(0,o.Wm)(s,{href:"".concat(a.url,"/").concat(e.id)},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.alias),1)]})),_:2},1032,["href"])]})),_:1},8,["label"]),(0,o.Wm)(u,{label:e.__("Name")},{default:(0,o.w5)((function(e){return[(0,o.Uk)((0,l.zw)(e.name),1)]})),_:1},8,["label"]),(0,o.Wm)(u,{label:e.__("Address")},{default:(0,o.w5)((function(e){return[(0,o.Uk)((0,l.zw)(e.country_name),1),Xt,(0,o.Uk)(" "+(0,l.zw)(e.postcode)+", "+(0,l.zw)(e.city),1),Zt,(0,o.Uk)(" "+(0,l.zw)(e.address),1)]})),_:1},8,["label"]),(0,o.Wm)(u,{label:e.__("Created at"),sort:"created_at"},{default:(0,o.w5)((function(e){return[(0,o.Uk)((0,l.zw)(a.formatDate(e.created_at)),1)]})),_:1},8,["label"])]})),_:1},8,["response"])])}},tn=en;var nn={class:"col-12 col-lg-7 col-xl-8 form__body"},rn={class:"row"},on={class:"col-12 col-sm-6"},an={class:"col-12 col-sm-6"},ln={class:"row"},sn={class:"col-12 col-sm-6"},un={class:"col-12 col-sm-6"},cn={class:"row"},dn={class:"col-12 col-sm-6"},fn={class:"col-12 col-sm-6"},pn={class:"row"},hn={class:"col-12 col-sm-6"},mn={class:"col-12 col-sm-6"},gn={class:"col-12 col-lg-5 col-xl-4 mt-5 mt-lg-0 form__sidebar"},yn={class:"sticky-helper"},vn={class:"form-group d-flex justify-content-between mb-0"};const bn={props:{address:{type:Object,required:!0},user:{type:Object,required:!0},countries:{type:Object,required:!0}},inheritAttrs:!1,mounted:function(){this.$parent.icon="address",this.$parent.title=this.address.alias},computed:{action:function(){return"/bazar/users/".concat(this.user.id,"/addresses/").concat(this.address.id)}},render:function(e,t,n,r,i,a){var s=(0,o.up)("data-form-input"),u=(0,o.up)("card"),c=(0,o.up)("inertia-link"),d=(0,o.up)("data-form");return(0,o.wg)(),(0,o.j4)(d,{class:"row",method:"PATCH",action:a.action,data:n.address},{default:(0,o.w5)((function(t){return[(0,o.Wm)("div",nn,[(0,o.Wm)(u,{title:e.__("General")},{default:(0,o.w5)((function(){return[(0,o.Wm)("div",rn,[(0,o.Wm)("div",on,[(0,o.Wm)(s,{type:"text",name:"first_name",label:e.__("First Name"),modelValue:t.data.first_name,"onUpdate:modelValue":function(e){return t.data.first_name=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",an,[(0,o.Wm)(s,{type:"text",name:"last_name",label:e.__("Last Name"),modelValue:t.data.last_name,"onUpdate:modelValue":function(e){return t.data.last_name=e}},null,8,["label","modelValue","onUpdate:modelValue"])])]),(0,o.Wm)(s,{type:"text",name:"company",label:e.__("Company"),modelValue:t.data.company,"onUpdate:modelValue":function(e){return t.data.company=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.Wm)("div",ln,[(0,o.Wm)("div",sn,[(0,o.Wm)(s,{type:"email",name:"email",label:e.__("Email"),modelValue:t.data.email,"onUpdate:modelValue":function(e){return t.data.email=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",un,[(0,o.Wm)(s,{type:"tel",name:"phone",label:e.__("Phone"),modelValue:t.data.phone,"onUpdate:modelValue":function(e){return t.data.phone=e}},null,8,["label","modelValue","onUpdate:modelValue"])])]),(0,o.Wm)("div",cn,[(0,o.Wm)("div",dn,[(0,o.Wm)(s,{handler:"select",name:"country",label:e.__("Country"),options:n.countries,modelValue:t.data.country,"onUpdate:modelValue":function(e){return t.data.country=e}},null,8,["label","options","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",fn,[(0,o.Wm)(s,{type:"text",name:"state",label:e.__("State"),modelValue:t.data.state,"onUpdate:modelValue":function(e){return t.data.state=e}},null,8,["label","modelValue","onUpdate:modelValue"])])]),(0,o.Wm)("div",pn,[(0,o.Wm)("div",hn,[(0,o.Wm)(s,{type:"text",name:"city",label:e.__("City"),modelValue:t.data.city,"onUpdate:modelValue":function(e){return t.data.city=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",mn,[(0,o.Wm)(s,{type:"text",name:"postcode",label:e.__("Postcode"),modelValue:t.data.postcode,"onUpdate:modelValue":function(e){return t.data.postcode=e}},null,8,["label","modelValue","onUpdate:modelValue"])])]),(0,o.Wm)(s,{type:"text",name:"address",label:e.__("Address"),modelValue:t.data.address,"onUpdate:modelValue":function(e){return t.data.address=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.Wm)(s,{type:"text",name:"address_secondary",label:e.__("Secondary Address"),modelValue:t.data.address_secondary,"onUpdate:modelValue":function(e){return t.data.address_secondary=e}},null,8,["label","modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"])]),(0,o.Wm)("div",gn,[(0,o.Wm)("div",yn,[(0,o.Wm)(u,{title:e.__("Settings"),class:"mb-5"},{default:(0,o.w5)((function(){return[(0,o.Wm)(s,{type:"text",name:"alias",label:e.__("Alias"),modelValue:t.data.alias,"onUpdate:modelValue":function(e){return t.data.alias=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.Wm)(s,{handler:"checkbox",name:"default",label:e.__("Default Address"),modelValue:t.data.default,"onUpdate:modelValue":function(e){return t.data.default=e}},null,8,["label","modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"]),(0,o.Wm)(u,{title:e.__("Actions")},{default:(0,o.w5)((function(){return[(0,o.Wm)("div",vn,[(0,o.Wm)(c,{as:"button",method:"DELETE",class:"btn btn-outline-danger",href:a.action,disabled:t.busy},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.__("Delete")),1)]})),_:2},1032,["href","disabled"]),(0,o.Wm)("button",{type:"submit",class:"btn btn-primary",disabled:t.busy},(0,l.zw)(e.__("Save")),9,["disabled"])])]})),_:2},1032,["title"])])])]})),_:1},8,["action","data"])}},_n=bn;var wn={class:"col-12 col-lg-7 col-xl-8 form__body"},xn={class:"row"},kn={class:"col-12 col-sm-6"},On={class:"col-12 col-sm-6"},Sn={class:"row"},En={class:"col-12 col-sm-6"},An={class:"col-12 col-sm-6"},Cn={class:"row"},jn={class:"col-12 col-sm-6"},Pn={class:"col-12 col-sm-6"},Tn={class:"row"},Wn={class:"col-12 col-sm-6"},Mn={class:"col-12 col-sm-6"},Nn={class:"col-12 col-lg-5 col-xl-4 mt-5 mt-lg-0 form__sidebar"},Vn={class:"sticky-helper"},Ln={class:"form-group d-flex justify-content-between mb-0"};const Rn={props:{address:{type:Object,required:!0},user:{type:Object,required:!0},countries:{type:Object,required:!0}},inheritAttrs:!1,mounted:function(){this.$parent.icon="address",this.$parent.title=this.__("Create Address")},computed:{action:function(){return"/bazar/users/".concat(this.user.id,"/addresses")}},render:function(e,t,n,r,i,a){var s=(0,o.up)("data-form-input"),u=(0,o.up)("card"),c=(0,o.up)("data-form");return(0,o.wg)(),(0,o.j4)(c,{class:"row",action:a.action,data:n.address},{default:(0,o.w5)((function(t){return[(0,o.Wm)("div",wn,[(0,o.Wm)(u,{title:e.__("General")},{default:(0,o.w5)((function(){return[(0,o.Wm)("div",xn,[(0,o.Wm)("div",kn,[(0,o.Wm)(s,{type:"text",name:"first_name",label:e.__("First Name"),modelValue:t.data.first_name,"onUpdate:modelValue":function(e){return t.data.first_name=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",On,[(0,o.Wm)(s,{type:"text",name:"last_name",label:e.__("Last Name"),modelValue:t.data.last_name,"onUpdate:modelValue":function(e){return t.data.last_name=e}},null,8,["label","modelValue","onUpdate:modelValue"])])]),(0,o.Wm)(s,{type:"text",name:"company",label:e.__("Company"),modelValue:t.data.company,"onUpdate:modelValue":function(e){return t.data.company=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.Wm)("div",Sn,[(0,o.Wm)("div",En,[(0,o.Wm)(s,{type:"email",name:"email",label:e.__("Email"),modelValue:t.data.email,"onUpdate:modelValue":function(e){return t.data.email=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",An,[(0,o.Wm)(s,{type:"tel",name:"phone",label:e.__("Phone"),modelValue:t.data.phone,"onUpdate:modelValue":function(e){return t.data.phone=e}},null,8,["label","modelValue","onUpdate:modelValue"])])]),(0,o.Wm)("div",Cn,[(0,o.Wm)("div",jn,[(0,o.Wm)(s,{handler:"select",name:"country",label:e.__("Country"),options:n.countries,modelValue:t.data.country,"onUpdate:modelValue":function(e){return t.data.country=e}},null,8,["label","options","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",Pn,[(0,o.Wm)(s,{type:"text",name:"state",label:e.__("State"),modelValue:t.data.state,"onUpdate:modelValue":function(e){return t.data.state=e}},null,8,["label","modelValue","onUpdate:modelValue"])])]),(0,o.Wm)("div",Tn,[(0,o.Wm)("div",Wn,[(0,o.Wm)(s,{type:"text",name:"city",label:e.__("City"),modelValue:t.data.city,"onUpdate:modelValue":function(e){return t.data.city=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",Mn,[(0,o.Wm)(s,{type:"text",name:"postcode",label:e.__("Postcode"),modelValue:t.data.postcode,"onUpdate:modelValue":function(e){return t.data.postcode=e}},null,8,["label","modelValue","onUpdate:modelValue"])])]),(0,o.Wm)(s,{type:"text",name:"address",label:e.__("Address"),modelValue:t.data.address,"onUpdate:modelValue":function(e){return t.data.address=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.Wm)(s,{type:"text",name:"address_secondary",label:e.__("Secondary Address"),modelValue:t.data.address_secondary,"onUpdate:modelValue":function(e){return t.data.address_secondary=e}},null,8,["label","modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"])]),(0,o.Wm)("div",Nn,[(0,o.Wm)("div",Vn,[(0,o.Wm)(u,{title:e.__("Settings"),class:"mb-5"},{default:(0,o.w5)((function(){return[(0,o.Wm)(s,{type:"text",name:"alias",label:e.__("Alias"),modelValue:t.data.alias,"onUpdate:modelValue":function(e){return t.data.alias=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.Wm)(s,{handler:"checkbox",name:"default",label:e.__("Default Address"),modelValue:t.data.default,"onUpdate:modelValue":function(e){return t.data.default=e}},null,8,["label","modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"]),(0,o.Wm)(u,{title:e.__("Actions")},{default:(0,o.w5)((function(){return[(0,o.Wm)("div",Ln,[(0,o.Wm)("button",{type:"submit",class:"btn btn-primary",disabled:t.busy},(0,l.zw)(e.__("Save")),9,["disabled"])])]})),_:2},1032,["title"])])])]})),_:1},8,["action","data"])}},In=Rn;const Un={mixins:[Qt],props:{response:{type:Object,require:!0},filters:{type:Object,require:!0}},mounted:function(){this.$parent.icon="category",this.$parent.title=this.__("Categories")},computed:{url:function(){return window.location.href.replace(window.location.search,"").replace(/\/$/,"")}},methods:{formatDate:function(e){return e.substr(0,16).replace("T"," ")}},render:function(e,t,n,r,i,a){var s=(0,o.up)("inertia-link"),u=(0,o.up)("data-table-column"),c=(0,o.up)("data-table");return(0,o.wg)(),(0,o.j4)("div",null,[e.mounted?((0,o.wg)(),(0,o.j4)(o.lR,{key:0,to:".app-header__actions"},[(0,o.Wm)(s,{href:"".concat(a.url,"/create"),class:"btn btn-primary btn-sm"},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.__("Create Category")),1)]})),_:1},8,["href"])])):(0,o.ry)("",!0),(0,o.Wm)(c,{response:n.response,filters:n.filters},{default:(0,o.w5)((function(){return[(0,o.Wm)(u,{label:e.__("Photo")},{default:(0,o.w5)((function(e){return[(0,o.Wm)("img",{class:"table-preview-image",src:e.media[0]?e.media[0].urls.thumb:"/vendor/bazar/img/placeholder.svg",alt:e.name},null,8,["src","alt"])]})),_:1},8,["label"]),(0,o.Wm)(u,{label:e.__("Name"),sort:"name"},{default:(0,o.w5)((function(e){return[(0,o.Wm)(s,{href:"".concat(a.url,"/").concat(e.id)},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.name),1)]})),_:2},1032,["href"])]})),_:1},8,["label"]),(0,o.Wm)(u,{label:e.__("Created at"),sort:"created_at"},{default:(0,o.w5)((function(e){return[(0,o.Uk)((0,l.zw)(a.formatDate(e.created_at)),1)]})),_:1},8,["label"])]})),_:1},8,["response","filters"])])}},Dn=Un;var qn={class:"col-12 col-lg-7 col-xl-8 form__body"},zn={class:"col-12 col-lg-5 col-xl-4 mt-5 mt-lg-0 form__sidebar"},Fn={class:"sticky-helper"},Bn={class:"form-group d-flex justify-content-between mb-0"};const $n={props:{category:{type:Object,required:!0}},mounted:function(){this.$parent.icon="category",this.$parent.title=this.category.name},computed:{action:function(){return"/bazar/categories/".concat(this.category.id)}},render:function(e,t,n,r,i,a){var s=(0,o.up)("data-form-input"),u=(0,o.up)("card"),c=(0,o.up)("inertia-link"),d=(0,o.up)("data-form");return(0,o.wg)(),(0,o.j4)(d,{class:"row",method:"PATCH",action:a.action,data:n.category},{default:(0,o.w5)((function(t){return[(0,o.Wm)("div",qn,[(0,o.Wm)(u,{title:e.__("General")},{default:(0,o.w5)((function(){return[(0,o.Wm)(s,{type:"text",name:"name",label:e.__("Name"),modelValue:t.data.name,"onUpdate:modelValue":function(e){return t.data.name=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.Wm)(s,{type:"text",name:"slug",label:e.__("Slug"),modelValue:t.data.slug,"onUpdate:modelValue":function(e){return t.data.slug=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.Wm)(s,{handler:"editor",name:"description",label:e.__("Description"),modelValue:t.data.description,"onUpdate:modelValue":function(e){return t.data.description=e}},null,8,["label","modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"])]),(0,o.Wm)("div",zn,[(0,o.Wm)("div",Fn,[(0,o.Wm)(u,{title:e.__("Media"),class:"mb-5"},{default:(0,o.w5)((function(){return[(0,o.Wm)(s,{handler:"media",name:"media",modelValue:t.data.media,"onUpdate:modelValue":function(e){return t.data.media=e}},null,8,["modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"]),(0,o.Wm)(u,{title:e.__("Actions")},{default:(0,o.w5)((function(){return[(0,o.Wm)("div",Bn,[(0,o.Wm)(c,{as:"button",method:"DELETE",class:"btn btn-outline-danger",href:a.action,disabled:t.busy},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(n.category.deleted_at?e.__("Delete"):e.__("Trash")),1)]})),_:2},1032,["href","disabled"]),n.category.deleted_at?((0,o.wg)(),(0,o.j4)(c,{key:0,as:"button",method:"PATCH",class:"btn btn-warning",href:"".concat(a.action,"/restore"),disabled:t.busy},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.__("Restore")),1)]})),_:2},1032,["href","disabled"])):((0,o.wg)(),(0,o.j4)("button",{key:1,type:"submit",class:"btn btn-primary",disabled:t.busy},(0,l.zw)(e.__("Save")),9,["disabled"]))])]})),_:2},1032,["title"])])])]})),_:1},8,["action","data"])}},Hn=$n;var Yn={class:"col-12 col-lg-7 col-xl-8 form__body"},Kn={class:"col-12 col-lg-5 col-xl-4 mt-5 mt-lg-0 form__sidebar"},Gn={class:"sticky-helper"},Jn={class:"form-group d-flex justify-content-between mb-0"};const Xn={props:{category:{type:Object,required:!0}},mounted:function(){this.$parent.icon="category",this.$parent.title=this.__("Create Category")},computed:{action:function(){return"/bazar/categories"}},render:function(e,t,n,r,i,a){var s=(0,o.up)("data-form-input"),u=(0,o.up)("card"),c=(0,o.up)("data-form");return(0,o.wg)(),(0,o.j4)(c,{class:"row",action:a.action,data:n.category},{default:(0,o.w5)((function(t){return[(0,o.Wm)("div",Yn,[(0,o.Wm)(u,{title:e.__("General")},{default:(0,o.w5)((function(){return[(0,o.Wm)(s,{type:"text",name:"name",label:e.__("Name"),modelValue:t.data.name,"onUpdate:modelValue":function(e){return t.data.name=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.Wm)(s,{type:"text",name:"slug",label:e.__("Slug"),modelValue:t.data.slug,"onUpdate:modelValue":function(e){return t.data.slug=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.Wm)(s,{handler:"editor",name:"description",label:e.__("Description"),modelValue:t.data.description,"onUpdate:modelValue":function(e){return t.data.description=e}},null,8,["label","modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"])]),(0,o.Wm)("div",Kn,[(0,o.Wm)("div",Gn,[(0,o.Wm)(u,{title:e.__("Media"),class:"mb-5"},{default:(0,o.w5)((function(){return[(0,o.Wm)(s,{handler:"media",name:"media",modelValue:t.data.media,"onUpdate:modelValue":function(e){return t.data.media=e}},null,8,["modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"]),(0,o.Wm)(u,{title:e.__("Actions")},{default:(0,o.w5)((function(){return[(0,o.Wm)("div",Jn,[(0,o.Wm)("button",{type:"submit",class:"btn btn-primary",disabled:t.busy},(0,l.zw)(e.__("Save")),9,["disabled"])])]})),_:2},1032,["title"])])])]})),_:1},8,["action","data"])}},Zn=Xn;const Qn={mixins:[Qt],props:{response:{type:Object,required:!0},filters:{type:Object,required:!0}},inheritAttrs:!1,mounted:function(){this.$parent.icon="order",this.$parent.title=this.__("Orders")},computed:{url:function(){return window.location.href.replace(window.location.search,"").replace(/\/$/,"")}},methods:{badgeClass:function(e){switch(e){case"completed":return"badge-success";case"failed":case"cancelled":return"badge-danger";case"on_hold":return"badge-light";default:return"badge-warning"}},formatDate:function(e){return e.substr(0,16).replace("T"," ")}},render:function(e,t,n,r,i,a){var s=(0,o.up)("inertia-link"),u=(0,o.up)("data-table-column"),c=(0,o.up)("data-table");return(0,o.wg)(),(0,o.j4)("div",null,[e.mounted?((0,o.wg)(),(0,o.j4)(o.lR,{key:0,to:".app-header__actions"},[(0,o.Wm)(s,{href:"".concat(a.url,"/create"),class:"btn btn-primary btn-sm"},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.__("Create Order")),1)]})),_:1},8,["href"])])):(0,o.ry)("",!0),(0,o.Wm)(c,{response:n.response,filters:n.filters},{default:(0,o.w5)((function(){return[(0,o.Wm)(u,{label:e.__("ID"),sort:"id"},{default:(0,o.w5)((function(e){return[(0,o.Wm)(s,{href:"".concat(a.url,"/").concat(e.id)},{default:(0,o.w5)((function(){return[(0,o.Uk)(" #"+(0,l.zw)(e.id),1)]})),_:2},1032,["href"])]})),_:1},8,["label"]),(0,o.Wm)(u,{label:e.__("Total")},{default:(0,o.w5)((function(e){return[(0,o.Uk)((0,l.zw)(e.formatted_total),1)]})),_:1},8,["label"]),(0,o.Wm)(u,{label:e.__("Customer")},{default:(0,o.w5)((function(e){return[(0,o.Uk)((0,l.zw)(e.address.name),1)]})),_:1},8,["label"]),(0,o.Wm)(u,{label:e.__("Status"),sort:"status"},{default:(0,o.w5)((function(e){return[(0,o.Wm)("span",{class:["badge",a.badgeClass(e.status)]},(0,l.zw)(e.status_name),3)]})),_:1},8,["label"]),(0,o.Wm)(u,{label:e.__("Created at"),sort:"created_at"},{default:(0,o.w5)((function(e){return[(0,o.Uk)((0,l.zw)(a.formatDate(e.created_at)),1)]})),_:1},8,["label"])]})),_:1},8,["response","filters"])])}},er=Qn;var tr={class:"col-12 col-lg-7 col-xl-8 form__body"},nr={key:0,class:"alert alert-info mb-0"},rr={class:"col-12 col-lg-5 col-xl-4 mt-5 mt-lg-0 form__sidebar"},or={class:"sticky-helper"},ir={class:"form-group d-flex justify-content-between mb-0"},ar={class:"row"},lr={class:"col-12 col-lg-7 col-xl-8 mt-5"};var sr={class:"table table-sm is-headless mb-0 vertical-align-top"},ur={key:0},cr={key:1},dr={key:0},fr={key:1};const pr={props:{order:{type:Object,required:!0}},computed:{createdAt:function(){return this.order.created_at.substr(0,16).replace("T"," ")}},render:function(e,t,n,r,i,a){return(0,o.wg)(),(0,o.j4)("table",sr,[(0,o.Wm)("tr",null,[(0,o.Wm)("th",null,(0,l.zw)(e.__("ID"))+":",1),(0,o.Wm)("td",null,"#"+(0,l.zw)(n.order.id),1)]),(0,o.Wm)("tr",null,[(0,o.Wm)("th",null,(0,l.zw)(e.__("Date"))+":",1),(0,o.Wm)("td",null,(0,l.zw)(a.createdAt),1)]),(0,o.Wm)("tr",null,[(0,o.Wm)("th",null,(0,l.zw)(e.__("Customer"))+":",1),(0,o.Wm)("td",null,(0,l.zw)(n.order.address.name),1)]),(0,o.Wm)("tr",null,[(0,o.Wm)("th",null,(0,l.zw)(e.__("Tax"))+":",1),(0,o.Wm)("td",null,(0,l.zw)(n.order.formatted_tax),1)]),(0,o.Wm)("tr",null,[(0,o.Wm)("th",null,(0,l.zw)(e.__("Shipping"))+":",1),(0,o.Wm)("td",null,(0,l.zw)(n.order.shipping.formatted_total)+" ("+(0,l.zw)(n.order.shipping.driver_name)+") ",1)]),(0,o.Wm)("tr",null,[(0,o.Wm)("th",null,(0,l.zw)(e.__("Discount"))+":",1),(0,o.Wm)("td",null,(0,l.zw)(n.order.formatted_discount),1)]),(0,o.Wm)("tr",null,[(0,o.Wm)("th",null,(0,l.zw)(e.__("Total"))+":",1),(0,o.Wm)("td",null,(0,l.zw)(n.order.formatted_total),1)]),(0,o.Wm)("tr",null,[(0,o.Wm)("th",null,(0,l.zw)(e.__("Billing Address"))+":",1),(0,o.Wm)("td",null,[(0,o.Wm)("address",null,[(0,o.Wm)("div",null,(0,l.zw)(n.order.address.name),1),n.order.address.company?((0,o.wg)(),(0,o.j4)("div",ur,(0,l.zw)(n.order.address.company),1)):(0,o.ry)("",!0),(0,o.Wm)("div",null,(0,l.zw)(n.order.address.address),1),n.order.address.address_second?((0,o.wg)(),(0,o.j4)("div",cr,(0,l.zw)(n.order.address.address_second),1)):(0,o.ry)("",!0),(0,o.Wm)("div",null,(0,l.zw)(n.order.address.postcode)+", "+(0,l.zw)(n.order.address.city)+", "+(0,l.zw)(n.order.address.state),1),(0,o.Wm)("div",null,(0,l.zw)(n.order.address.country_name),1),(0,o.Wm)("div",null,(0,l.zw)(n.order.address.phone),1),(0,o.Wm)("div",null,(0,l.zw)(n.order.address.email),1)])])]),(0,o.Wm)("tr",null,[(0,o.Wm)("th",null,(0,l.zw)(e.__("Shipping Address"))+":",1),(0,o.Wm)("td",null,[(0,o.Wm)("address",null,[(0,o.Wm)("div",null,(0,l.zw)(n.order.shipping.address.name),1),n.order.shipping.address.company?((0,o.wg)(),(0,o.j4)("div",dr,(0,l.zw)(n.order.shipping.address.company),1)):(0,o.ry)("",!0),(0,o.Wm)("div",null,(0,l.zw)(n.order.shipping.address.address),1),n.order.shipping.address.address_second?((0,o.wg)(),(0,o.j4)("div",fr,(0,l.zw)(n.order.shipping.address.address_second),1)):(0,o.ry)("",!0),(0,o.Wm)("div",null,(0,l.zw)(n.order.shipping.address.postcode)+", "+(0,l.zw)(n.order.shipping.address.city)+", "+(0,l.zw)(n.order.shipping.address.state),1),(0,o.Wm)("div",null,(0,l.zw)(n.order.shipping.address.country_name),1),(0,o.Wm)("div",null,(0,l.zw)(n.order.shipping.address.phone),1),(0,o.Wm)("div",null,(0,l.zw)(n.order.shipping.address.email),1)])])])])}},hr=pr;var mr={key:0,class:"table-responsive"},gr={class:"table table-hover has-filled-header mb-0"},yr={scope:"col"},vr={class:"badge badge-light text-uppercase"},br={scope:"col"},_r={scope:"col"},wr=(0,o.Wm)("th",{scope:"col"},null,-1),xr={key:1,class:"alert alert-info mb-0"};var kr={key:0},Or=(0,o.Uk)(" ("),Sr=(0,o.Uk)(") "),Er={key:0},Ar={key:1,class:"badge badge-warning"},Cr={class:"d-flex"};const jr={props:{transaction:{type:Object,required:!0}},emits:["delete"],data:function(){return{busy:!1}},computed:{className:function(){return"text-"+("refund"===this.transaction.type?"danger":"success")},icon:function(){return this.completed?"retry":"done"},sign:function(){return"refund"===this.transaction.type?"-":"+"},amount:function(){return new Number(this.transaction.amount).toFixed(2)},completed:function(){return!!this.transaction.completed_at},action:function(){return"/bazar/orders/".concat(this.transaction.order_id,"/transactions/").concat(this.transaction.id)},completedAt:function(){return this.transaction.completed_at.substr(0,16).replace("T"," ")}},methods:{update:function(){var e=this;this.busy=!0,this.$http.patch(this.action).then((function(t){e.transaction.completed_at=e.completed?null:(new Date).toISOString()})).catch((function(e){})).finally((function(){e.busy=!1}))},destroy:function(){var e=this;this.busy=!0,this.$http.delete(this.action).then((function(t){e.$emit("delete")})).catch((function(e){})).finally((function(){e.busy=!1}))}},render:function(e,t,n,r,i,a){var s=(0,o.up)("icon");return(0,o.wg)(),(0,o.j4)("tr",null,[(0,o.Wm)("td",null,[(0,o.Wm)("span",{class:a.className},(0,l.zw)("".concat(a.sign," ").concat(a.amount)),3)]),(0,o.Wm)("td",null,[(0,o.Wm)("span",null,(0,l.zw)(n.transaction.driver_name),1),n.transaction.url?((0,o.wg)(),(0,o.j4)("small",kr,[Or,(0,o.Wm)("a",{href:n.transaction.url,target:"_blank"},(0,l.zw)(n.transaction.key),9,["href"]),Sr])):(0,o.ry)("",!0)]),(0,o.Wm)("td",null,[n.transaction.completed_at?((0,o.wg)(),(0,o.j4)("span",Er,(0,l.zw)(a.completedAt),1)):((0,o.wg)(),(0,o.j4)("span",Ar,(0,l.zw)(e.__("Pending")),1))]),(0,o.Wm)("td",null,[(0,o.Wm)("div",Cr,[(0,o.Wm)("button",{type:"button",class:["icon-btn",{"icon-btn-success":!a.completed,"icon-btn-warning":a.completed}],disabled:i.busy,"aria-label":a.completed?e.__("Mark pending"):e.__("Mark completed"),onClick:t[1]||(t[1]=function(){return a.update&&a.update.apply(a,arguments)})},[(0,o.Wm)(s,{name:a.icon},null,8,["name"])],10,["disabled","aria-label"]),(0,o.Wm)("button",{type:"button",class:"icon-btn icon-btn-danger ml-1",disabled:i.busy,"aria-label":e.__("Delete"),onClick:t[2]||(t[2]=function(){return a.destroy&&a.destroy.apply(a,arguments)})},[(0,o.Wm)(s,{name:"close"})],8,["disabled","aria-label"])])])])}},Pr=jr;var Tr={class:"form-group"},Wr={for:"type"},Mr={value:null,disabled:""},Nr={key:0,class:"form-text text-danger"},Vr={class:"form-group"},Lr={for:"driver"},Rr={value:null,disabled:""},Ir={key:0,class:"form-text text-danger"},Ur={class:"form-group"},Dr={for:"amount"},qr={key:0,class:"form-text text-danger"},zr={key:1,class:"form-text"};function Fr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Br(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $r(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};Br(this,e),this.fill(t)}var t,n,r;return t=e,(n=[{key:"all",value:function(){return this.items}},{key:"any",value:function(){return Object.keys(this.items).length>0}},{key:"has",value:function(e){return this.items.hasOwnProperty(e)}},{key:"get",value:function(e){if(this.has(e))return this.items[e]}},{key:"set",value:function(e,t){Object.assign(this.items,Fr({},e,t))}},{key:"clear",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.items=t?Object.keys(this.items).reduce((function(n,r){return r===t?n:Object.assign(n,Fr({},r,e.items[r]))}),{}):{}}},{key:"fill",value:function(e){this.items=JSON.parse(JSON.stringify(e))}}])&&$r(t.prototype,n),r&&$r(t,r),e}();const Yr={props:{order:{type:Object,reqired:!0}},watch:{"transaction.type":function(e,t){"payment"===e&&(this.transaction.driver="manual")}},data:function(){return{busy:!1,errors:new Hr,transaction:{amount:null,type:"refund",driver:"manual"}}},computed:{types:function(){return{payment:this.__("Payment"),refund:this.__("Refund")}},drivers:function(){var e={manual:this.__("Manual")};return"refund"===this.transaction.type?this.order.transactions.reduce((function(e,t){return Object.assign(e,(n={},r=t.driver,o=t.driver_name,r in n?Object.defineProperty(n,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[r]=o,n));var n,r,o}),e):e}},methods:{submit:function(){var e=this;this.busy=!0,this.$http.post("/bazar/orders/".concat(this.order.id,"/transactions"),this.transaction).then((function(t){e.add(t.data)})).catch((function(t){e.errors.fill(t.response.data.errors)})).finally((function(){e.busy=!1}))},add:function(e){this.order.transactions.push(e),this.$refs.refund.close(),this.transaction={amount:null,type:"refund",driver:"manual"}}},render:function(e,t,n,i,a,s){var u=(0,o.up)("alert"),c=(0,o.up)("modal");return(0,o.wg)(),(0,o.j4)("div",null,[(0,o.Wm)("button",{type:"button",class:"btn btn-sm btn-primary",onClick:t[1]||(t[1]=function(){var t;return e.$refs.refund.open&&(t=e.$refs.refund).open.apply(t,arguments)})},(0,l.zw)(e.__("Create Transaction")),1),(0,o.Wm)(c,{ref:"refund",title:e.__("Create Transaction")},{default:(0,o.w5)((function(){return[a.errors.any()?((0,o.wg)(),(0,o.j4)(u,{key:0,type:"danger",closable:""},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.__("Something went wrong!")),1)]})),_:1})):(0,o.ry)("",!0),(0,o.Wm)("div",Tr,[(0,o.Wm)("label",Wr,(0,l.zw)(e.__("Type")),1),(0,o.wy)((0,o.Wm)("select",{class:["form-control custom-select",{"is-invalid":a.errors.has("type")}],id:"type",name:"type","onUpdate:modelValue":t[2]||(t[2]=function(e){return a.transaction.type=e}),onChange:t[3]||(t[3]=function(e){return a.errors.clear("type")})},[(0,o.Wm)("option",Mr,"--- "+(0,l.zw)(e.__("Type"))+" ---",1),((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(s.types,(function(e,t){return(0,o.wg)(),(0,o.j4)("option",{key:t,value:t},(0,l.zw)(e),9,["value"])})),128))],34),[[r.bM,a.transaction.type]]),a.errors.has("type")?((0,o.wg)(),(0,o.j4)("span",Nr,(0,l.zw)(a.errors.get("type")),1)):(0,o.ry)("",!0)]),(0,o.Wm)("div",Vr,[(0,o.Wm)("label",Lr,(0,l.zw)(e.__("Driver")),1),(0,o.wy)((0,o.Wm)("select",{class:["form-control custom-select",{"is-invalid":a.errors.has("driver")}],id:"driver",name:"driver","onUpdate:modelValue":t[4]||(t[4]=function(e){return a.transaction.driver=e}),onChange:t[5]||(t[5]=function(e){return a.errors.clear("driver")})},[(0,o.Wm)("option",Rr,"--- "+(0,l.zw)(e.__("Driver"))+" ---",1),((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(s.drivers,(function(e,t){return(0,o.wg)(),(0,o.j4)("option",{key:t,value:t},(0,l.zw)(e),9,["value"])})),128))],34),[[r.bM,a.transaction.driver]]),a.errors.has("driver")?((0,o.wg)(),(0,o.j4)("span",Ir,(0,l.zw)(a.errors.get("driver")),1)):(0,o.ry)("",!0)]),(0,o.Wm)("div",Ur,[(0,o.Wm)("label",Dr,(0,l.zw)(e.__("Amount (:CURRENCY)",{currency:n.order.currency})),1),(0,o.wy)((0,o.Wm)("input",{class:["form-control",{"is-invalid":a.errors.has("amount")}],type:"number",min:"0",step:"0.01",id:"amount",name:"amount","onUpdate:modelValue":t[6]||(t[6]=function(e){return a.transaction.amount=e}),onInput:t[7]||(t[7]=function(e){return a.errors.clear("amount")})},null,34),[[r.nr,a.transaction.amount]]),a.errors.has("amount")?((0,o.wg)(),(0,o.j4)("span",qr,(0,l.zw)(a.errors.get("amount")),1)):((0,o.wg)(),(0,o.j4)("span",zr,(0,l.zw)(e.__("Leave it empty to apply the remaining amount automatically.")),1))])]})),footer:(0,o.w5)((function(){return[(0,o.Wm)("button",{type:"button",class:"btn btn-primary",disabled:a.busy,onClick:t[8]||(t[8]=function(){return s.submit&&s.submit.apply(s,arguments)})},(0,l.zw)(e.__("Create")),9,["disabled"]),(0,o.Wm)("button",{type:"button",class:"btn btn-outline-primary",disabled:a.busy,onClick:t[9]||(t[9]=function(){var t;return e.$refs.refund.close&&(t=e.$refs.refund).close.apply(t,arguments)})},(0,l.zw)(e.__("Cancel")),9,["disabled"])]})),_:1},8,["title"])])}},Kr={components:{Transaction:Pr,CreateTransaction:Yr},props:{order:{type:Object,required:!0}},methods:{remove:function(e){this.order.transactions.splice(e,1)}},render:function(e,t,n,r,i,a){var s=(0,o.up)("create-transaction"),u=(0,o.up)("transaction"),c=(0,o.up)("card");return(0,o.wg)(),(0,o.j4)(c,{title:e.__("Transactions")},{header:(0,o.w5)((function(){return[(0,o.Wm)(s,{order:n.order},null,8,["order"])]})),default:(0,o.w5)((function(){return[n.order.transactions.length?((0,o.wg)(),(0,o.j4)("div",mr,[(0,o.Wm)("table",gr,[(0,o.Wm)("thead",null,[(0,o.Wm)("tr",null,[(0,o.Wm)("th",yr,[(0,o.Uk)((0,l.zw)(e.__("Amount"))+" ",1),(0,o.Wm)("span",vr,(0,l.zw)(n.order.currency),1)]),(0,o.Wm)("th",br,(0,l.zw)(e.__("Driver")),1),(0,o.Wm)("th",_r,(0,l.zw)(e.__("Completed at")),1),wr])]),(0,o.Wm)("tbody",null,[((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(n.order.transactions,(function(e,t){return(0,o.wg)(),(0,o.j4)(u,{key:t,transaction:e,onDelete:function(e){return a.remove(t)}},null,8,["transaction","onDelete"])})),128))])])])):((0,o.wg)(),(0,o.j4)("div",xr,(0,l.zw)(e.__("There are no transactions yet.")),1))]})),_:1},8,["title"])}};var Gr={class:"table-responsive"},Jr={class:"table table-hover has-filled-header mb-0"},Xr={scope:"col"},Zr={scope:"col"},Qr={class:"badge badge-light text-uppercase"},eo={scope:"col"},to={class:"badge badge-light text-uppercase"},no={scope:"col"},ro={scope:"col"},oo={class:"badge badge-light text-uppercase"};const io={props:{order:{type:Object,required:!0}},methods:{total:function(e){return new Number(e).toFixed(2)}},render:function(e,t,n,r,i,a){return(0,o.wg)(),(0,o.j4)("div",Gr,[(0,o.Wm)("table",Jr,[(0,o.Wm)("thead",null,[(0,o.Wm)("tr",null,[(0,o.Wm)("th",Xr,(0,l.zw)(e.__("Name")),1),(0,o.Wm)("th",Zr,[(0,o.Uk)((0,l.zw)(e.__("Price"))+" ",1),(0,o.Wm)("span",Qr,(0,l.zw)(n.order.currency),1)]),(0,o.Wm)("th",eo,[(0,o.Uk)((0,l.zw)(e.__("Tax"))+" ",1),(0,o.Wm)("span",to,(0,l.zw)(n.order.currency),1)]),(0,o.Wm)("th",no,(0,l.zw)(e.__("Qty")),1),(0,o.Wm)("th",ro,[(0,o.Uk)((0,l.zw)(e.__("Total"))+" ",1),(0,o.Wm)("span",oo,(0,l.zw)(n.order.currency),1)])])]),(0,o.Wm)("tbody",null,[((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(n.order.products,(function(e,t){return(0,o.wg)(),(0,o.j4)("tr",{key:t},[(0,o.Wm)("td",null,(0,l.zw)(e.name),1),(0,o.Wm)("td",null,(0,l.zw)(e.item.price),1),(0,o.Wm)("td",null,(0,l.zw)(e.item.tax),1),(0,o.Wm)("td",null,(0,l.zw)(e.item.quantity),1),(0,o.Wm)("td",null,(0,l.zw)(a.total(e.item.total)),1)])})),128))])])])}},ao={components:{OrderInfo:hr,Transactions:Kr,ProductsTable:io},props:{order:{type:Object,required:!0},statuses:{type:Object,required:!0}},mounted:function(){this.$parent.icon="order",this.$parent.title=this.__("Order #:id",{id:this.order.id})},computed:{action:function(){return"/bazar/orders/".concat(this.order.id)}},render:function(e,t,n,r,i,a){var s=(0,o.up)("order-info"),u=(0,o.up)("card"),c=(0,o.up)("products-table"),d=(0,o.up)("data-form-input"),f=(0,o.up)("inertia-link"),p=(0,o.up)("data-form"),h=(0,o.up)("transactions");return(0,o.wg)(),(0,o.j4)("div",null,[(0,o.Wm)(p,{class:"row",method:"PATCH",action:a.action,data:n.order},{default:(0,o.w5)((function(t){return[(0,o.Wm)("div",tr,[(0,o.Wm)(u,{title:e.__("General"),class:"mb-5"},{default:(0,o.w5)((function(){return[(0,o.Wm)(s,{order:n.order},null,8,["order"])]})),_:1},8,["title"]),(0,o.Wm)(u,{title:e.__("Products")},{default:(0,o.w5)((function(){return[n.order.products.length?((0,o.wg)(),(0,o.j4)(c,{key:1,order:n.order},null,8,["order"])):((0,o.wg)(),(0,o.j4)("div",nr,(0,l.zw)(e.__("There are no products yet.")),1))]})),_:1},8,["title"])]),(0,o.Wm)("div",rr,[(0,o.Wm)("div",or,[(0,o.Wm)(u,{title:e.__("Settings"),class:"mb-5"},{default:(0,o.w5)((function(){return[(0,o.Wm)(d,{handler:"select",name:"status",label:e.__("Status"),options:n.statuses,modelValue:t.data.status,"onUpdate:modelValue":function(e){return t.data.status=e}},null,8,["label","options","modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"]),(0,o.Wm)(u,{title:e.__("Actions")},{default:(0,o.w5)((function(){return[(0,o.Wm)("div",ir,[(0,o.Wm)(f,{as:"button",method:"DELETE",class:"btn btn-outline-danger",href:a.action,disabled:t.busy},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(n.order.deleted_at?e.__("Delete"):e.__("Trash")),1)]})),_:2},1032,["href","disabled"]),n.order.deleted_at?((0,o.wg)(),(0,o.j4)(f,{key:0,as:"button",method:"PATCH",class:"btn btn-warning",href:"".concat(a.action,"/restore"),disabled:t.busy},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.__("Restore")),1)]})),_:2},1032,["href","disabled"])):((0,o.wg)(),(0,o.j4)("button",{key:1,type:"submit",class:"btn btn-primary",disabled:t.busy},(0,l.zw)(e.__("Save")),9,["disabled"]))])]})),_:2},1032,["title"])])])]})),_:1},8,["action","data"]),(0,o.Wm)("div",ar,[(0,o.Wm)("div",lr,[(0,o.Wm)(h,{order:n.order},null,8,["order"])])])])}},lo=ao;var so={class:"col-12 col-lg-7 col-xl-8 form__body"},uo=(0,o.Wm)("br",null,null,-1),co={key:0,class:"form-group mt-0"},fo={class:"input-group"},po={class:"input-group-append"},ho={class:"form-group"},mo={value:null,selected:""},go={class:"row"},yo={class:"col-12 col-sm-6"},vo={class:"col-12 col-sm-6"},bo={class:"row"},_o={class:"col-12 col-sm-6"},wo={class:"col-12 col-sm-6"},xo={class:"row"},ko={class:"col-12 col-sm-6"},Oo={class:"col-12 col-sm-6"},So={class:"row"},Eo={class:"col-12 col-sm-6"},Ao={class:"col-12 col-sm-6"},Co={class:"form-group"},jo={value:null,selected:""},Po={class:"row"},To={class:"col"},Wo={class:"col"},Mo={class:"col"},No={class:"row"},Vo={class:"col-12 col-sm-6"},Lo={class:"col-12 col-sm-6"},Ro={class:"row"},Io={class:"col-12 col-sm-6"},Uo={class:"col-12 col-sm-6"},Do={class:"row"},qo={class:"col-12 col-sm-6"},zo={class:"col-12 col-sm-6"},Fo={class:"row"},Bo={class:"col-12 col-sm-6"},$o={class:"col-12 col-sm-6"},Ho={class:"col-12 col-lg-5 col-xl-4 mt-5 mt-lg-0 form__sidebar"},Yo={class:"sticky-helper"},Ko={class:"form-group d-flex justify-content-between mb-0"};var Go={class:"table-responsive"},Jo={class:"table table-hover has-filled-header mb-0 mt-3"},Xo={scope:"col"},Zo={scope:"col"},Qo={class:"badge badge-light text-uppercase"},ei={scope:"col"},ti={class:"badge badge-light text-uppercase"},ni={scope:"col"},ri={scope:"col"},oi={class:"badge badge-light text-uppercase"},ii=(0,o.Wm)("th",{scope:"col"},null,-1);const ai={props:{modelValue:{type:Array,default:function(){return[]}},currency:{type:String,required:!0}},emits:["update:modelValue"],watch:{products:{handler:function(e,t){this.$emit("update:modelValue",e)},deep:!0}},data:function(){return{products:Array.from(this.modelValue)}},methods:{price:function(e){return e.prices[this.currency].default||0},total:function(e){var t=(Number(e.item.price)+Number(e.item.tax||0))*Number(e.item.quantity||1);return Number(t).toFixed(2)},remove:function(e){this.products.splice(e,1)},update:function(e){var t=this;this.products=e.map((function(e){return Object.assign({item:{tax:0,quantity:1,price:t.price(e)}},e)}))}},render:function(e,t,n,i,a,s){var u=(0,o.up)("data-form-input"),c=(0,o.up)("icon");return(0,o.wg)(),(0,o.j4)("div",null,[(0,o.Wm)(u,{handler:"autocomplete",name:"products",endpoint:"/bazar/products",placeholder:"Hoodie",multiple:"",modelValue:a.products,"onUpdate:modelValue":s.update},{default:(0,o.w5)((function(e){return[(0,o.Wm)("span",null,(0,l.zw)(e.name),1)]})),_:1},8,["modelValue","onUpdate:modelValue"]),(0,o.Wm)("div",Go,[(0,o.wy)((0,o.Wm)("table",Jo,[(0,o.Wm)("thead",null,[(0,o.Wm)("tr",null,[(0,o.Wm)("th",Xo,(0,l.zw)(e.__("Name")),1),(0,o.Wm)("th",Zo,[(0,o.Uk)((0,l.zw)(e.__("Price"))+" ",1),(0,o.Wm)("span",Qo,(0,l.zw)(n.currency),1)]),(0,o.Wm)("th",ei,[(0,o.Uk)((0,l.zw)(e.__("Tax"))+" ",1),(0,o.Wm)("span",ti,(0,l.zw)(n.currency),1)]),(0,o.Wm)("th",ni,(0,l.zw)(e.__("Qty")),1),(0,o.Wm)("th",ri,[(0,o.Uk)((0,l.zw)(e.__("Total"))+" ",1),(0,o.Wm)("span",oi,(0,l.zw)(n.currency),1)]),ii])]),(0,o.Wm)("tbody",null,[((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(a.products,(function(t,n){return(0,o.wg)(),(0,o.j4)("tr",{key:n},[(0,o.Wm)("td",null,(0,l.zw)(t.name),1),(0,o.Wm)("td",null,[(0,o.Wm)(u,{class:"mb-0 form-group-sm",type:"number",placeholder:"0",step:"0.01",min:"0",size:"3",name:"products.".concat(n,".price"),modelValue:t.item.price,"onUpdate:modelValue":function(e){return t.item.price=e}},null,8,["name","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("td",null,[(0,o.Wm)(u,{class:"mb-0 form-group-sm",type:"number",placeholder:"0",step:"0.01",min:"0",size:"3",name:"products.".concat(n,".tax"),modelValue:t.item.tax,"onUpdate:modelValue":function(e){return t.item.tax=e}},null,8,["name","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("td",null,[(0,o.Wm)(u,{class:"mb-0 form-group-sm",type:"number",placeholder:"1",step:"0.01",min:"0",size:"3",name:"products.".concat(n,".quantity"),modelValue:t.item.quantity,"onUpdate:modelValue":function(e){return t.item.quantity=e}},null,8,["name","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("td",null,(0,l.zw)(s.total(t)),1),(0,o.Wm)("td",null,[(0,o.Wm)("button",{type:"button",class:"icon-btn icon-btn-danger","aria-label":e.__("Remove"),onClick:function(e){return s.remove(n)}},[(0,o.Wm)(c,{name:"close"})],8,["aria-label","onClick"])])])})),128))])],512),[[r.F8,a.products.length]])])])}},li={components:{Products:ai},props:{order:{type:Object,required:!0},countries:{type:Object,required:!0},drivers:{type:Object,required:!0},currencies:{type:Object,required:!0},statuses:{type:Object,required:!0}},mounted:function(){this.$parent.icon="order",this.$parent.title=this.__("Create Order")},computed:{action:function(){return"/bazar/categories"}},methods:{clear:function(){this.$refs.form.fields.user={addresses:[]}},copy:function(e,t){"billing"===t?Object.assign(this.$refs.form.fields.address,JSON.parse(e)):"shipping"===t&&Object.assign(this.$refs.form.fields.shipping.address,JSON.parse(e))}},render:function(e,t,n,i,a,s){var u=(0,o.up)("data-form-input"),c=(0,o.up)("card"),d=(0,o.up)("products"),f=(0,o.up)("data-form");return(0,o.wg)(),(0,o.j4)(f,{class:"row",ref:"form",action:s.action,data:n.order},{default:(0,o.w5)((function(i){return[(0,o.Wm)("div",so,[(0,o.Wm)(c,{title:e.__("User"),class:"mb-5"},{default:(0,o.w5)((function(){return[(0,o.wy)((0,o.Wm)(u,{handler:"autocomplete",name:"user",endpoint:"/bazar/users",placeholder:"Jane Doe",modelValue:i.data.user?[i.data.user]:[],"onUpdate:modelValue":function(e){return i.data.user=e[0]||{}}},{default:(0,o.w5)((function(e){return[(0,o.Wm)("span",null,(0,l.zw)(e.name),1),uo,(0,o.Wm)("small",null,(0,l.zw)(e.email),1)]})),_:2},1032,["modelValue","onUpdate:modelValue"]),[[r.F8,!i.data.user.id]]),i.data.user.id?((0,o.wg)(),(0,o.j4)("div",co,[(0,o.Wm)("label",null,(0,l.zw)(e.__("User")),1),(0,o.Wm)("div",fo,[(0,o.Wm)("input",{type:"text",class:"form-control",disabled:"",value:i.data.user.name},null,8,["value"]),(0,o.Wm)("div",po,[(0,o.Wm)("button",{type:"button",class:"btn btn-secondary",onClick:t[1]||(t[1]=(0,r.iM)((function(){return s.clear&&s.clear.apply(s,arguments)}),["prevent"]))},(0,l.zw)(e.__("Remove")),1)])])])):(0,o.ry)("",!0)]})),_:2},1032,["title"]),(0,o.Wm)(c,{title:e.__("Billing"),class:"mb-5"},{header:(0,o.w5)((function(){return[(0,o.Wm)("div",ho,[(0,o.Wm)("select",{class:"custom-select custom-select-sm",disabled:!i.data.user.addresses.length,onInput:t[2]||(t[2]=(0,r.iM)((function(e){return s.copy(e.target.value,"billing")}),["prevent"]))},[(0,o.Wm)("option",mo,"--- "+(0,l.zw)(e.__("Address"))+" ---",1),((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(i.data.user.addresses,(function(e){return(0,o.wg)(),(0,o.j4)("option",{key:e.id,value:JSON.stringify(e)},(0,l.zw)(e.alias),9,["value"])})),128))],40,["disabled"])])]})),default:(0,o.w5)((function(){return[(0,o.Wm)("div",go,[(0,o.Wm)("div",yo,[(0,o.Wm)(u,{type:"text",name:"address.first_name",label:e.__("First Name"),modelValue:i.data.address.first_name,"onUpdate:modelValue":function(e){return i.data.address.first_name=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",vo,[(0,o.Wm)(u,{type:"text",name:"address.last_name",label:e.__("Last Name"),modelValue:i.data.address.last_name,"onUpdate:modelValue":function(e){return i.data.address.last_name=e}},null,8,["label","modelValue","onUpdate:modelValue"])])]),(0,o.Wm)(u,{type:"text",name:"address.company",label:e.__("Company"),modelValue:i.data.address.company,"onUpdate:modelValue":function(e){return i.data.address.company=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.Wm)("div",bo,[(0,o.Wm)("div",_o,[(0,o.Wm)(u,{type:"email",name:"address.email",label:e.__("Email"),modelValue:i.data.address.email,"onUpdate:modelValue":function(e){return i.data.address.email=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",wo,[(0,o.Wm)(u,{type:"tel",name:"address.phone",label:e.__("Phone"),modelValue:i.data.address.phone,"onUpdate:modelValue":function(e){return i.data.address.phone=e}},null,8,["label","modelValue","onUpdate:modelValue"])])]),(0,o.Wm)("div",xo,[(0,o.Wm)("div",ko,[(0,o.Wm)(u,{handler:"select",name:"address.country",label:e.__("Country"),options:n.countries,modelValue:i.data.address.country,"onUpdate:modelValue":function(e){return i.data.address.country=e}},null,8,["label","options","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",Oo,[(0,o.Wm)(u,{label:e.__("State"),name:"address.state",type:"text",modelValue:i.data.address.state,"onUpdate:modelValue":function(e){return i.data.address.state=e}},null,8,["label","modelValue","onUpdate:modelValue"])])]),(0,o.Wm)("div",So,[(0,o.Wm)("div",Eo,[(0,o.Wm)(u,{type:"text",name:"address.city",label:e.__("City"),modelValue:i.data.address.city,"onUpdate:modelValue":function(e){return i.data.address.city=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",Ao,[(0,o.Wm)(u,{type:"text",name:"address.postcode",label:e.__("Postcode"),modelValue:i.data.address.postcode,"onUpdate:modelValue":function(e){return i.data.address.postcode=e}},null,8,["label","modelValue","onUpdate:modelValue"])])]),(0,o.Wm)(u,{type:"text",name:"address.address",label:e.__("Address"),modelValue:i.data.address.address,"onUpdate:modelValue":function(e){return i.data.address.address=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.Wm)(u,{type:"text",name:"address.secondary_address",label:e.__("Secondary Address"),modelValue:i.data.address.secondary_address,"onUpdate:modelValue":function(e){return i.data.address.secondary_address=e}},null,8,["label","modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"]),(0,o.Wm)(c,{title:e.__("Shipping"),class:"mb-5"},{header:(0,o.w5)((function(){return[(0,o.Wm)("div",Co,[(0,o.Wm)("select",{class:"custom-select custom-select-sm",disabled:!i.data.user.addresses.length,onInput:t[3]||(t[3]=(0,r.iM)((function(e){return s.copy(e.target.value,"shipping")}),["prevent"]))},[(0,o.Wm)("option",jo,"--- "+(0,l.zw)(e.__("Address"))+" ---",1),((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(i.data.user.addresses,(function(e){return(0,o.wg)(),(0,o.j4)("option",{key:e.id,value:JSON.stringify(e)},(0,l.zw)(e.alias),9,["value"])})),128))],40,["disabled"])])]})),default:(0,o.w5)((function(){return[(0,o.Wm)("div",Po,[(0,o.Wm)("div",To,[(0,o.Wm)(u,{handler:"select",name:"shipping.driver",label:e.__("Driver"),options:n.drivers,modelValue:i.data.shipping.driver,"onUpdate:modelValue":function(e){return i.data.shipping.driver=e}},null,8,["label","options","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",Wo,[(0,o.Wm)(u,{type:"number",name:"shipping.cost",placeholder:"0.00",min:"0",step:"0.01",label:e.__("Cost (:UNIT)",{unit:i.data.currency}),modelValue:i.data.shipping.cost,"onUpdate:modelValue":function(e){return i.data.shipping.cost=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",Mo,[(0,o.Wm)(u,{type:"number",name:"shipping.tax",placeholder:"0.00",min:"0",step:"0.01",label:e.__("Tax (:UNIT)",{unit:i.data.currency}),modelValue:i.data.shipping.tax,"onUpdate:modelValue":function(e){return i.data.shipping.tax=e}},null,8,["label","modelValue","onUpdate:modelValue"])])]),(0,o.Wm)("div",No,[(0,o.Wm)("div",Vo,[(0,o.Wm)(u,{type:"text",name:"shipping.address.first_name",label:e.__("First Name"),modelValue:i.data.shipping.address.first_name,"onUpdate:modelValue":function(e){return i.data.shipping.address.first_name=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",Lo,[(0,o.Wm)(u,{type:"text",name:"shipping.address.last_name",label:e.__("Last Name"),modelValue:i.data.shipping.address.last_name,"onUpdate:modelValue":function(e){return i.data.shipping.address.last_name=e}},null,8,["label","modelValue","onUpdate:modelValue"])])]),(0,o.Wm)(u,{type:"text",name:"shipping.address.company",label:e.__("Company"),modelValue:i.data.shipping.address.company,"onUpdate:modelValue":function(e){return i.data.shipping.address.company=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.Wm)("div",Ro,[(0,o.Wm)("div",Io,[(0,o.Wm)(u,{type:"email",name:"shipping.address.email",label:e.__("Email"),modelValue:i.data.shipping.address.email,"onUpdate:modelValue":function(e){return i.data.shipping.address.email=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",Uo,[(0,o.Wm)(u,{type:"tel",name:"shipping.address.phone",label:e.__("Phone"),modelValue:i.data.shipping.address.phone,"onUpdate:modelValue":function(e){return i.data.shipping.address.phone=e}},null,8,["label","modelValue","onUpdate:modelValue"])])]),(0,o.Wm)("div",Do,[(0,o.Wm)("div",qo,[(0,o.Wm)(u,{handler:"select",name:"shipping.address.country",label:e.__("Country"),options:n.countries,modelValue:i.data.shipping.address.country,"onUpdate:modelValue":function(e){return i.data.shipping.address.country=e}},null,8,["label","options","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",zo,[(0,o.Wm)(u,{label:e.__("State"),name:"shipping.address.state",type:"text",modelValue:i.data.shipping.address.state,"onUpdate:modelValue":function(e){return i.data.shipping.address.state=e}},null,8,["label","modelValue","onUpdate:modelValue"])])]),(0,o.Wm)("div",Fo,[(0,o.Wm)("div",Bo,[(0,o.Wm)(u,{type:"text",name:"shipping.address.city",label:e.__("City"),modelValue:i.data.shipping.address.city,"onUpdate:modelValue":function(e){return i.data.shipping.address.city=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",$o,[(0,o.Wm)(u,{type:"text",name:"shipping.address.postcode",label:e.__("Postcode"),modelValue:i.data.shipping.address.postcode,"onUpdate:modelValue":function(e){return i.data.shipping.address.postcode=e}},null,8,["label","modelValue","onUpdate:modelValue"])])]),(0,o.Wm)(u,{type:"text",name:"shipping.address.address",label:e.__("Address"),modelValue:i.data.shipping.address.address,"onUpdate:modelValue":function(e){return i.data.shipping.address.address=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.Wm)(u,{type:"text",name:"shipping.address.secondary_address",label:e.__("Secondary Address"),modelValue:i.data.shipping.address.secondary_address,"onUpdate:modelValue":function(e){return i.data.shipping.address.secondary_address=e}},null,8,["label","modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"]),(0,o.Wm)(c,{title:e.__("Products")},{default:(0,o.w5)((function(){return[(0,o.Wm)(d,{currency:i.data.currency,modelValue:i.data.products,"onUpdate:modelValue":function(e){return i.data.products=e}},null,8,["currency","modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"])]),(0,o.Wm)("div",Ho,[(0,o.Wm)("div",Yo,[(0,o.Wm)(c,{title:e.__("Settings"),class:"mb-5"},{default:(0,o.w5)((function(){return[(0,o.Wm)(u,{type:"number",name:"discount",placeholder:"0.00",min:"0",step:"0.01",label:e.__("Discount"),modelValue:i.data.discount,"onUpdate:modelValue":function(e){return i.data.discount=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.Wm)(u,{handler:"select",name:"currency",label:e.__("Currency"),options:n.currencies,modelValue:i.data.currency,"onUpdate:modelValue":function(e){return i.data.currency=e}},null,8,["label","options","modelValue","onUpdate:modelValue"]),(0,o.Wm)(u,{handler:"select",name:"status",label:e.__("Status"),options:n.statuses,modelValue:i.data.status,"onUpdate:modelValue":function(e){return i.data.status=e}},null,8,["label","options","modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"]),(0,o.Wm)(c,{title:e.__("Actions")},{default:(0,o.w5)((function(){return[(0,o.Wm)("div",Ko,[(0,o.Wm)("button",{type:"submit",class:"btn btn-primary",disabled:i.busy},(0,l.zw)(e.__("Save")),9,["disabled"])])]})),_:2},1032,["title"])])])]})),_:1},8,["action","data"])}},si=li;const ui={mixins:[Qt],props:{response:{type:Object,required:!0},filters:{type:Object,required:!0}},inheritAttrs:!1,mounted:function(){this.$parent.icon="product",this.$parent.title=this.__("Products")},computed:{url:function(){return window.location.href.replace(window.location.search,"").replace(/\/$/,"")}},methods:{formatDate:function(e){return e.substr(0,16).replace("T"," ")}},render:function(e,t,n,r,i,a){var s=(0,o.up)("inertia-link"),u=(0,o.up)("data-table-column"),c=(0,o.up)("data-table");return(0,o.wg)(),(0,o.j4)("div",null,[e.mounted?((0,o.wg)(),(0,o.j4)(o.lR,{key:0,to:".app-header__actions"},[(0,o.Wm)(s,{href:"".concat(a.url,"/create"),class:"btn btn-primary btn-sm"},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.__("Create Product")),1)]})),_:1},8,["href"])])):(0,o.ry)("",!0),(0,o.Wm)(c,{response:n.response,filters:n.filters},{default:(0,o.w5)((function(){return[(0,o.Wm)(u,{label:e.__("Photo")},{default:(0,o.w5)((function(e){return[(0,o.Wm)("img",{class:"table-preview-image",src:e.media[0]?e.media[0].urls.thumb:"/vendor/bazar/img/placeholder.svg",alt:e.name},null,8,["src","alt"])]})),_:1},8,["label"]),(0,o.Wm)(u,{label:e.__("Name"),sort:"name"},{default:(0,o.w5)((function(e){return[(0,o.Wm)(s,{href:"".concat(a.url,"/").concat(e.id)},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.name),1)]})),_:2},1032,["href"])]})),_:1},8,["label"]),(0,o.Wm)(u,{label:e.__("SKU"),sort:"inventory->sku"},{default:(0,o.w5)((function(e){return[(0,o.Uk)((0,l.zw)(e.inventory.sku),1)]})),_:1},8,["label"]),(0,o.Wm)(u,{label:e.__("Price")},{default:(0,o.w5)((function(e){return[(0,o.Uk)((0,l.zw)(e.formatted_price),1)]})),_:1},8,["label"]),(0,o.Wm)(u,{label:e.__("Created at"),sort:"created_at"},{default:(0,o.w5)((function(e){return[(0,o.Uk)((0,l.zw)(a.formatDate(e.created_at)),1)]})),_:1},8,["label"])]})),_:1},8,["response","filters"])])}},ci=ui;var di={class:"col-12 col-lg-7 col-xl-8 form__body"},fi={class:"form-group",style:{"max-width":"200px"}},pi={class:"input-group input-group-sm"},hi={class:"input-group-append"},mi={class:"d-flex"},gi={key:0,class:"mb-0 alert alert-info"},yi={class:"col"},vi={class:"col"},bi={class:"row align-items-end"},_i={class:"col"},wi={class:"col"},xi={class:"col"},ki={class:"form-group"},Oi={class:"col-12 col-lg-5 col-xl-4 mt-5 mt-lg-0 form__sidebar"},Si={class:"sticky-helper"},Ei={class:"form-group is-checkbox-list"},Ai={key:0,class:"form-text text-danger"},Ci={class:"form-group d-flex justify-content-between mb-0"};var ji={class:"form-group"},Pi={class:"form-group"},Ti={class:"table table-hover has-filled-header mb-0"},Wi={scope:"col"},Mi={scope:"col"},Ni={scope:"col"},Vi=(0,o.Wm)("th",{scope:"col"},null,-1);const Li={props:{modelValue:{type:Array,default:function(){return[]}}},emits:["update:modelValue"],computed:{empty:function(){return 0===this.modelValue.length}},methods:{addMedia:function(e){var t=Array.from(this.modelValue);t.push({name:e[0].name,url:e[0].urls.original}),this.$emit("update:modelValue",t)},addCustom:function(){var e=Array.from(this.modelValue);e.push({name:null,url:null}),this.$emit("update:modelValue",e)},remove:function(e){var t=Array.from(this.modelValue);t.splice(e,1),this.$emit("update:modelValue",t)}},render:function(e,t,n,i,a,s){var u=(0,o.up)("data-form-input"),c=(0,o.up)("icon"),d=(0,o.up)("media-manager");return(0,o.wg)(),(0,o.j4)("div",null,[(0,o.Wm)("div",ji,[(0,o.Wm)("button",{type:"button",class:"btn btn-primary mr-2",onClick:t[1]||(t[1]=function(){return s.addCustom&&s.addCustom.apply(s,arguments)})},(0,l.zw)(e.__("Add Custom")),1),(0,o.Wm)("button",{type:"button",class:"btn btn-outline-primary",onClick:t[2]||(t[2]=function(){var t;return e.$refs.media.open&&(t=e.$refs.media).open.apply(t,arguments)})},(0,l.zw)(e.__("Add Media")),1)]),(0,o.wy)((0,o.Wm)("div",Pi,[(0,o.Wm)("table",Ti,[(0,o.Wm)("thead",null,[(0,o.Wm)("tr",null,[(0,o.Wm)("th",Wi,(0,l.zw)(e.__("Name")),1),(0,o.Wm)("th",Mi,(0,l.zw)(e.__("URL")),1),(0,o.Wm)("th",Ni,(0,l.zw)(e.__("Expiration Days")),1),Vi])]),(0,o.Wm)("tbody",null,[((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(n.modelValue,(function(t,n){return(0,o.wg)(),(0,o.j4)("tr",{key:n},[(0,o.Wm)("td",null,[(0,o.Wm)(u,{type:"text",class:"mb-0 form-group-sm",size:"10",modelValue:t.name,"onUpdate:modelValue":function(e){return t.name=e},name:"inventory.files.".concat(n,".name")},null,8,["modelValue","onUpdate:modelValue","name"])]),(0,o.Wm)("td",null,[(0,o.Wm)(u,{type:"text",class:"mb-0 form-group-sm",size:"10",name:"inventory.files.".concat(n,".url"),modelValue:t.url,"onUpdate:modelValue":function(e){return t.url=e}},null,8,["name","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("td",null,[(0,o.Wm)(u,{type:"number",class:"mb-0 form-group-sm",min:"0",size:"1",placeholder:"0",name:"inventory.files.".concat(n,".expiration"),modelValue:t.expiration,"onUpdate:modelValue":function(e){return t.expiration=e}},null,8,["name","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("td",null,[(0,o.Wm)("button",{type:"button",class:"icon-btn icon-btn-danger","aria-label":e.__("Remove"),onClick:function(e){return s.remove(n)}},[(0,o.Wm)(c,{name:"close"})],8,["aria-label","onClick"])])])})),128))])])],512),[[r.F8,!s.empty]]),(0,o.Wm)(d,{ref:"media","onUpdate:modelValue":s.addMedia},null,8,["onUpdate:modelValue"])])}};function Ri(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ii={components:{Files:Li},props:{product:{type:Object,required:!0},currencies:{type:Object,required:!0},categories:{type:Object,required:!0}},inheritAttrs:!1,mounted:function(){this.$parent.icon="product",this.$parent.title=this.product.name},data:function(){return{property:null}},computed:{config:function(){return window.Bazar.config},action:function(){return"/bazar/products/".concat(this.product.id)}},methods:{addProperty:function(){this.property&&!this.$refs.form.fields.properties.hasOwnProperty(this.property)&&(Object.assign(this.$refs.form.fields,{properties:Object.assign({},this.$refs.form.fields.properties,Ri({},this.property,[]))}),this.property=null)},removeProperty:function(e){var t=Object.assign({},this.$refs.form.fields.properties);t=Object.keys(t).reduce((function(n,r){return r===e?n:Object.assign(n,Ri({},r,t[r]))}),{}),Object.assign(this.$refs.form.fields,{properties:t})}},render:function(e,t,n,i,a,s){var u=(0,o.up)("data-form-input"),c=(0,o.up)("card"),d=(0,o.up)("inertia-link"),f=(0,o.up)("icon"),p=(0,o.up)("files"),h=(0,o.up)("data-form");return(0,o.wg)(),(0,o.j4)(h,{class:"row",ref:"form",method:"PATCH",action:s.action,data:n.product},{default:(0,o.w5)((function(i){return[(0,o.Wm)("div",di,[(0,o.Wm)(c,{title:e.__("General"),class:"mb-5"},{default:(0,o.w5)((function(){return[(0,o.Wm)(u,{type:"text",name:"name",label:e.__("Name"),modelValue:i.data.name,"onUpdate:modelValue":function(e){return i.data.name=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.Wm)(u,{type:"text",name:"slug",label:e.__("Slug"),modelValue:i.data.slug,"onUpdate:modelValue":function(e){return i.data.slug=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.Wm)(u,{handler:"editor",name:"description",label:e.__("Description"),modelValue:i.data.description,"onUpdate:modelValue":function(e){return i.data.description=e}},null,8,["label","modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"]),(0,o.Wm)(c,{title:e.__("Properties"),class:"mb-5"},{header:(0,o.w5)((function(){return[(0,o.Wm)("div",fi,[(0,o.Wm)("div",pi,[(0,o.wy)((0,o.Wm)("input",{type:"text",class:"form-control",placeholder:e.__("Property"),"onUpdate:modelValue":t[1]||(t[1]=function(e){return a.property=e}),onKeydown:t[2]||(t[2]=(0,r.D2)((function(){return s.addProperty&&s.addProperty.apply(s,arguments)}),["enter"]))},null,40,["placeholder"]),[[r.nr,a.property]]),(0,o.Wm)("div",hi,[(0,o.Wm)("button",{type:"button",class:"btn btn-outline-primary",disabled:!a.property,onClick:t[3]||(t[3]=function(){return s.addProperty&&s.addProperty.apply(s,arguments)})},(0,l.zw)(e.__("Add")),9,["disabled"])])])]),(0,o.Wm)(d,{href:"/bazar/products/".concat(n.product.id,"/variants"),class:"btn btn-primary btn-sm"},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.__("Variants")),1)]})),_:1},8,["href"])]})),default:(0,o.w5)((function(){return[((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(i.data.properties,(function(t,n){return(0,o.wg)(),(0,o.j4)("div",{class:"form-group",key:n},[(0,o.Wm)("div",mi,[(0,o.Wm)("label",{for:"properties.".concat(n)},(0,l.zw)(e.__(n)),9,["for"]),(0,o.Wm)("button",{type:"button",class:"ml-2 icon-btn icon-btn-danger",onClick:function(e){return s.removeProperty(n)}},[(0,o.Wm)(f,{name:"close"})],8,["onClick"])]),(0,o.Wm)(u,{handler:"tag",name:"properties.".concat(n),modelValue:i.data.properties[n],"onUpdate:modelValue":function(e){return i.data.properties[n]=e}},null,8,["name","modelValue","onUpdate:modelValue"])])})),128)),0===i.data.properties.length?((0,o.wg)(),(0,o.j4)("div",gi,(0,l.zw)(e.__("No properties.")),1)):(0,o.ry)("",!0)]})),_:2},1032,["title"]),(0,o.Wm)(c,{title:e.__("Pricing"),class:"mb-5"},{default:(0,o.w5)((function(){return[((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(n.currencies,(function(t,n){return(0,o.wg)(),(0,o.j4)("div",{key:n,class:"row"},[(0,o.Wm)("div",yi,[(0,o.Wm)(u,{type:"number",min:"0",step:"0.1",name:"form.data.prices.".concat(n,".default"),label:e.__("Price (:CURRENCY)",{currency:n}),modelValue:i.data.prices[n].default,"onUpdate:modelValue":function(e){return i.data.prices[n].default=e}},null,8,["name","label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",vi,[(0,o.Wm)(u,{type:"number",min:"0",step:"0.1",name:"form.data.prices.".concat(n,".sale"),label:e.__("Sale Price (:CURRENCY)",{currency:n}),modelValue:i.data.prices[n].sale,"onUpdate:modelValue":function(e){return i.data.prices[n].sale=e}},null,8,["name","label","modelValue","onUpdate:modelValue"])])])})),128))]})),_:2},1032,["title"]),(0,o.Wm)(c,{title:e.__("Inventory")},{header:(0,o.w5)((function(){return[(0,o.Wm)(u,{handler:"checkbox",name:"inventory.virtual",label:e.__("Virtual"),modelValue:i.data.inventory.virtual,"onUpdate:modelValue":function(e){return i.data.inventory.virtual=e}},null,8,["label","modelValue","onUpdate:modelValue"])]})),default:(0,o.w5)((function(){return[(0,o.Wm)(u,{type:"text",name:"inventory.sku",label:e.__("SKU"),modelValue:i.data.inventory.sku,"onUpdate:modelValue":function(e){return i.data.inventory.sku=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.wy)((0,o.Wm)(u,{name:"inventory.quantity",min:"0",type:"number",label:e.__("Quantity"),help:e.__("Leave it empty for disabling quantity tracking."),modelValue:i.data.inventory.quantity,"onUpdate:modelValue":function(e){return i.data.inventory.quantity=e}},null,8,["label","help","modelValue","onUpdate:modelValue"]),[[r.F8,!i.data.inventory.virtual]]),(0,o.wy)((0,o.Wm)(u,{name:"inventory.weight",min:"0",type:"number",label:e.__("Weight (:unit)",{unit:s.config.weight_unit}),modelValue:i.data.inventory.weight,"onUpdate:modelValue":function(e){return i.data.inventory.weight=e}},null,8,["label","modelValue","onUpdate:modelValue"]),[[r.F8,!i.data.inventory.virtual]]),(0,o.wy)((0,o.Wm)("div",bi,[(0,o.Wm)("div",_i,[(0,o.Wm)(u,{name:"inventory.length",min:"0",type:"number",label:e.__("Length (:unit)",{unit:s.config.dimension_unit}),modelValue:i.data.inventory.length,"onUpdate:modelValue":function(e){return i.data.inventory.length=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",wi,[(0,o.Wm)(u,{name:"inventory.width",min:"0",type:"number",label:e.__("Width (:unit)",{unit:s.config.dimension_unit}),modelValue:i.data.inventory.width,"onUpdate:modelValue":function(e){return i.data.inventory.width=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",xi,[(0,o.Wm)(u,{name:"inventory.height",min:"0",type:"number",label:e.__("Height (:unit)",{unit:s.config.dimension_unit}),modelValue:i.data.inventory.height,"onUpdate:modelValue":function(e){return i.data.inventory.height=e}},null,8,["label","modelValue","onUpdate:modelValue"])])],512),[[r.F8,!i.data.inventory.virtual]]),(0,o.Wm)("div",ki,[(0,o.Wm)(u,{handler:"checkbox",name:"inventory.virtual",label:e.__("Downloadable"),modelValue:i.data.inventory.downloadable,"onUpdate:modelValue":function(e){return i.data.inventory.downloadable=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.wy)((0,o.Wm)(p,{modelValue:i.data.inventory.files,"onUpdate:modelValue":function(e){return i.data.inventory.files=e}},null,8,["modelValue","onUpdate:modelValue"]),[[r.F8,i.data.inventory.downloadable]])]})),_:2},1032,["title"])]),(0,o.Wm)("div",Oi,[(0,o.Wm)("div",Si,[(0,o.Wm)(c,{title:e.__("Categories"),class:"mb-5"},{default:(0,o.w5)((function(){return[(0,o.Wm)("div",Ei,[((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(n.categories,(function(e,t){return(0,o.wg)(),(0,o.j4)(u,{handler:"checkbox",name:"categories",key:t,label:e.name,value:e,modelValue:i.data.categories,"onUpdate:modelValue":function(e){return i.data.categories=e}},null,8,["label","value","modelValue","onUpdate:modelValue"])})),128)),i.errors.has("categories")?((0,o.wg)(),(0,o.j4)("span",Ai,(0,l.zw)(i.errors.get("categories")),1)):(0,o.ry)("",!0)])]})),_:2},1032,["title"]),(0,o.Wm)(c,{title:e.__("Media"),class:"mb-5"},{default:(0,o.w5)((function(){return[(0,o.Wm)(u,{handler:"media",name:"media",multiple:"",modelValue:i.data.media,"onUpdate:modelValue":function(e){return i.data.media=e}},null,8,["modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"]),(0,o.Wm)(c,{title:e.__("Actions")},{default:(0,o.w5)((function(){return[(0,o.Wm)("div",Ci,[(0,o.Wm)(d,{as:"button",method:"DELETE",class:"btn btn-outline-danger",href:s.action,disabled:i.busy},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(n.product.deleted_at?e.__("Delete"):e.__("Trash")),1)]})),_:2},1032,["href","disabled"]),n.product.deleted_at?((0,o.wg)(),(0,o.j4)(d,{key:0,as:"button",method:"PATCH",class:"btn btn-warning",href:"".concat(s.action,"/restore"),disabled:i.busy},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.__("Restore")),1)]})),_:2},1032,["href","disabled"])):((0,o.wg)(),(0,o.j4)("button",{key:1,type:"submit",class:"btn btn-primary",disabled:i.busy},(0,l.zw)(e.__("Save")),9,["disabled"]))])]})),_:2},1032,["title"])])])]})),_:1},8,["action","data"])}},Ui=Ii;var Di={class:"col-12 col-lg-7 col-xl-8 form__body"},qi={class:"form-group",style:{"max-width":"200px"}},zi={class:"input-group input-group-sm"},Fi={class:"input-group-append"},Bi={class:"d-flex"},$i={key:0,class:"mb-0 alert alert-info"},Hi={class:"col"},Yi={class:"col"},Ki={class:"row align-items-end"},Gi={class:"col"},Ji={class:"col"},Xi={class:"col"},Zi={class:"form-group"},Qi={class:"col-12 col-lg-5 col-xl-4 mt-5 mt-lg-0 form__sidebar"},ea={class:"sticky-helper"},ta={class:"form-group is-checkbox-list"},na={key:0,class:"form-text text-danger"},ra={class:"form-group d-flex justify-content-between mb-0"};function oa(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ia={components:{Files:Li},props:{product:{type:Object,required:!0},currencies:{type:Object,required:!0},categories:{type:Object,required:!0}},inheritAttrs:!1,mounted:function(){this.$parent.icon="product",this.$parent.title=this.__("Create Product")},data:function(){return{property:null}},computed:{config:function(){return window.Bazar.config},action:function(){return"/bazar/products"}},methods:{addProperty:function(){this.property&&!this.$refs.form.fields.properties.hasOwnProperty(this.property)&&(Object.assign(this.$refs.form.fields,{properties:Object.assign({},this.$refs.form.fields.properties,oa({},this.property,[]))}),this.property=null)},removeProperty:function(e){var t=Object.assign({},this.$refs.form.fields.properties);t=Object.keys(t).reduce((function(n,r){return r===e?n:Object.assign(n,oa({},r,t[r]))}),{}),Object.assign(this.$refs.form.fields,{properties:t})}},render:function(e,t,n,i,a,s){var u=(0,o.up)("data-form-input"),c=(0,o.up)("card"),d=(0,o.up)("icon"),f=(0,o.up)("files"),p=(0,o.up)("data-form");return(0,o.wg)(),(0,o.j4)(p,{class:"row",ref:"form",action:s.action,data:n.product},{default:(0,o.w5)((function(i){return[(0,o.Wm)("div",Di,[(0,o.Wm)(c,{title:e.__("General"),class:"mb-5"},{default:(0,o.w5)((function(){return[(0,o.Wm)(u,{type:"text",name:"name",label:e.__("Name"),modelValue:i.data.name,"onUpdate:modelValue":function(e){return i.data.name=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.Wm)(u,{type:"text",name:"slug",label:e.__("Slug"),modelValue:i.data.slug,"onUpdate:modelValue":function(e){return i.data.slug=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.Wm)(u,{handler:"editor",name:"description",label:e.__("Description"),modelValue:i.data.description,"onUpdate:modelValue":function(e){return i.data.description=e}},null,8,["label","modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"]),(0,o.Wm)(c,{title:e.__("Properties"),class:"mb-5"},{header:(0,o.w5)((function(){return[(0,o.Wm)("div",qi,[(0,o.Wm)("div",zi,[(0,o.wy)((0,o.Wm)("input",{type:"text",class:"form-control",placeholder:e.__("Property"),"onUpdate:modelValue":t[1]||(t[1]=function(e){return a.property=e}),onKeydown:t[2]||(t[2]=(0,r.D2)((function(){return s.addProperty&&s.addProperty.apply(s,arguments)}),["enter"]))},null,40,["placeholder"]),[[r.nr,a.property]]),(0,o.Wm)("div",Fi,[(0,o.Wm)("button",{type:"button",class:"btn btn-outline-primary",disabled:!a.property,onClick:t[3]||(t[3]=function(){return s.addProperty&&s.addProperty.apply(s,arguments)})},(0,l.zw)(e.__("Add")),9,["disabled"])])])])]})),default:(0,o.w5)((function(){return[((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(i.data.properties,(function(t,n){return(0,o.wg)(),(0,o.j4)("div",{class:"form-group",key:n},[(0,o.Wm)("div",Bi,[(0,o.Wm)("label",{for:"properties.".concat(n)},(0,l.zw)(e.__(n)),9,["for"]),(0,o.Wm)("button",{type:"button",class:"ml-2 icon-btn icon-btn-danger",onClick:function(e){return s.removeProperty(n)}},[(0,o.Wm)(d,{name:"close"})],8,["onClick"])]),(0,o.Wm)(u,{handler:"tag",name:"properties.".concat(n),modelValue:i.data.properties[n],"onUpdate:modelValue":function(e){return i.data.properties[n]=e}},null,8,["name","modelValue","onUpdate:modelValue"])])})),128)),0===i.data.properties.length?((0,o.wg)(),(0,o.j4)("div",$i,(0,l.zw)(e.__("No properties.")),1)):(0,o.ry)("",!0)]})),_:2},1032,["title"]),(0,o.Wm)(c,{title:e.__("Pricing"),class:"mb-5"},{default:(0,o.w5)((function(){return[((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(n.currencies,(function(t,n){return(0,o.wg)(),(0,o.j4)("div",{key:n,class:"row"},[(0,o.Wm)("div",Hi,[(0,o.Wm)(u,{type:"number",min:"0",step:"0.1",name:"form.data.prices.".concat(n,".default"),label:e.__("Price (:CURRENCY)",{currency:n}),modelValue:i.data.prices[n].default,"onUpdate:modelValue":function(e){return i.data.prices[n].default=e}},null,8,["name","label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",Yi,[(0,o.Wm)(u,{type:"number",min:"0",step:"0.1",name:"form.data.prices.".concat(n,".sale"),label:e.__("Sale Price (:CURRENCY)",{currency:n}),modelValue:i.data.prices[n].sale,"onUpdate:modelValue":function(e){return i.data.prices[n].sale=e}},null,8,["name","label","modelValue","onUpdate:modelValue"])])])})),128))]})),_:2},1032,["title"]),(0,o.Wm)(c,{title:e.__("Inventory")},{header:(0,o.w5)((function(){return[(0,o.Wm)(u,{handler:"checkbox",name:"inventory.virtual",label:e.__("Virtual"),modelValue:i.data.inventory.virtual,"onUpdate:modelValue":function(e){return i.data.inventory.virtual=e}},null,8,["label","modelValue","onUpdate:modelValue"])]})),default:(0,o.w5)((function(){return[(0,o.Wm)(u,{type:"text",name:"inventory.sku",label:e.__("SKU"),modelValue:i.data.inventory.sku,"onUpdate:modelValue":function(e){return i.data.inventory.sku=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.wy)((0,o.Wm)(u,{name:"inventory.quantity",min:"0",type:"number",label:e.__("Quantity"),help:e.__("Leave it empty for disabling quantity tracking."),modelValue:i.data.inventory.quantity,"onUpdate:modelValue":function(e){return i.data.inventory.quantity=e}},null,8,["label","help","modelValue","onUpdate:modelValue"]),[[r.F8,!i.data.inventory.virtual]]),(0,o.wy)((0,o.Wm)(u,{name:"inventory.weight",min:"0",type:"number",label:e.__("Weight (:unit)",{unit:s.config.weight_unit}),modelValue:i.data.inventory.weight,"onUpdate:modelValue":function(e){return i.data.inventory.weight=e}},null,8,["label","modelValue","onUpdate:modelValue"]),[[r.F8,!i.data.inventory.virtual]]),(0,o.wy)((0,o.Wm)("div",Ki,[(0,o.Wm)("div",Gi,[(0,o.Wm)(u,{name:"inventory.length",min:"0",type:"number",label:e.__("Length (:unit)",{unit:s.config.dimension_unit}),modelValue:i.data.inventory.length,"onUpdate:modelValue":function(e){return i.data.inventory.length=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",Ji,[(0,o.Wm)(u,{name:"inventory.width",min:"0",type:"number",label:e.__("Width (:unit)",{unit:s.config.dimension_unit}),modelValue:i.data.inventory.width,"onUpdate:modelValue":function(e){return i.data.inventory.width=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",Xi,[(0,o.Wm)(u,{name:"inventory.height",min:"0",type:"number",label:e.__("Height (:unit)",{unit:s.config.dimension_unit}),modelValue:i.data.inventory.height,"onUpdate:modelValue":function(e){return i.data.inventory.height=e}},null,8,["label","modelValue","onUpdate:modelValue"])])],512),[[r.F8,!i.data.inventory.virtual]]),(0,o.Wm)("div",Zi,[(0,o.Wm)(u,{handler:"checkbox",name:"inventory.virtual",label:e.__("Downloadable"),modelValue:i.data.inventory.downloadable,"onUpdate:modelValue":function(e){return i.data.inventory.downloadable=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.wy)((0,o.Wm)(f,{modelValue:i.data.inventory.files,"onUpdate:modelValue":function(e){return i.data.inventory.files=e}},null,8,["modelValue","onUpdate:modelValue"]),[[r.F8,i.data.inventory.downloadable]])]})),_:2},1032,["title"])]),(0,o.Wm)("div",Qi,[(0,o.Wm)("div",ea,[(0,o.Wm)(c,{title:e.__("Categories"),class:"mb-5"},{default:(0,o.w5)((function(){return[(0,o.Wm)("div",ta,[((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(n.categories,(function(e,t){return(0,o.wg)(),(0,o.j4)(u,{handler:"checkbox",name:"categories",key:t,label:e.name,value:e,modelValue:i.data.categories,"onUpdate:modelValue":function(e){return i.data.categories=e}},null,8,["label","value","modelValue","onUpdate:modelValue"])})),128)),i.errors.has("categories")?((0,o.wg)(),(0,o.j4)("span",na,(0,l.zw)(i.errors.get("categories")),1)):(0,o.ry)("",!0)])]})),_:2},1032,["title"]),(0,o.Wm)(c,{title:e.__("Media"),class:"mb-5"},{default:(0,o.w5)((function(){return[(0,o.Wm)(u,{handler:"media",name:"media",multiple:"",modelValue:i.data.media,"onUpdate:modelValue":function(e){return i.data.media=e}},null,8,["modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"]),(0,o.Wm)(c,{title:e.__("Actions")},{default:(0,o.w5)((function(){return[(0,o.Wm)("div",ra,[(0,o.Wm)("button",{type:"submit",class:"btn btn-primary",disabled:i.busy},(0,l.zw)(e.__("Save")),9,["disabled"])])]})),_:2},1032,["title"])])])]})),_:1},8,["action","data"])}},aa=ia;const la={mixins:[Qt],props:{response:{type:Object,required:!0},filters:{type:Object,required:!0}},inheritAttrs:!1,mounted:function(){this.$parent.icon="customer",this.$parent.title=this.__("Users")},computed:{url:function(){return window.location.href.replace(window.location.search,"").replace(/\/$/,"")}},methods:{formatDate:function(e){return e.substr(0,16).replace("T"," ")}},render:function(e,t,n,r,i,a){var s=(0,o.up)("inertia-link"),u=(0,o.up)("data-table-column"),c=(0,o.up)("data-table");return(0,o.wg)(),(0,o.j4)("div",null,[e.mounted?((0,o.wg)(),(0,o.j4)(o.lR,{key:0,to:".app-header__actions"},[(0,o.Wm)(s,{href:"".concat(a.url,"/create"),class:"btn btn-primary btn-sm"},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.__("Create User")),1)]})),_:1},8,["href"])])):(0,o.ry)("",!0),(0,o.Wm)(c,{response:n.response,filters:n.filters},{default:(0,o.w5)((function(){return[(0,o.Wm)(u,{label:e.__("Avatar")},{default:(0,o.w5)((function(e){return[(0,o.Wm)("img",{class:"table-preview-image",src:e.avatar,alt:e.name},null,8,["src","alt"])]})),_:1},8,["label"]),(0,o.Wm)(u,{label:e.__("Name"),sort:"name"},{default:(0,o.w5)((function(e){return[(0,o.Wm)(s,{href:"".concat(a.url,"/").concat(e.id)},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.name),1)]})),_:2},1032,["href"])]})),_:1},8,["label"]),(0,o.Wm)(u,{label:e.__("Email"),sort:"email"},{default:(0,o.w5)((function(e){return[(0,o.Uk)((0,l.zw)(e.email),1)]})),_:1},8,["label"]),(0,o.Wm)(u,{label:e.__("Created at"),sort:"created_at"},{default:(0,o.w5)((function(e){return[(0,o.Uk)((0,l.zw)(a.formatDate(e.created_at)),1)]})),_:1},8,["label"])]})),_:1},8,["response","filters"])])}},sa=la;var ua={class:"col-12 col-lg-7 col-xl-8 form__body"},ca={class:"col-12 col-lg-5 col-xl-4 mt-5 mt-lg-0 form__sidebar"},da={class:"sticky-helper"},fa={class:"form-group d-flex justify-content-between mb-0"};const pa={props:{user:{type:Object,required:!0}},inheritAttrs:!1,mounted:function(){this.$parent.icon="customer",this.$parent.title=this.user.name},computed:{action:function(){return"/bazar/users/".concat(this.user.id)}},render:function(e,t,n,r,i,a){var s=(0,o.up)("data-form-input"),u=(0,o.up)("card"),c=(0,o.up)("inertia-link"),d=(0,o.up)("data-form");return(0,o.wg)(),(0,o.j4)(d,{class:"row",method:"PATCH",action:a.action,data:n.user},{default:(0,o.w5)((function(t){return[(0,o.Wm)("div",ua,[(0,o.Wm)(u,{title:e.__("General")},{default:(0,o.w5)((function(){return[(0,o.Wm)(s,{type:"text",name:"name",label:e.__("Name"),modelValue:t.data.name,"onUpdate:modelValue":function(e){return t.data.name=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.Wm)(s,{name:"email",type:"email",label:e.__("Email"),modelValue:t.data.email,"onUpdate:modelValue":function(e){return t.data.email=e}},null,8,["label","modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"])]),(0,o.Wm)("div",ca,[(0,o.Wm)("div",da,[(0,o.Wm)(u,{title:e.__("Addresses"),class:"mb-5"},{default:(0,o.w5)((function(){return[(0,o.Wm)(c,{href:"/bazar/users/".concat(n.user.id,"/addresses"),class:"btn btn-primary"},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.__("Manage Addresses")),1)]})),_:1},8,["href"])]})),_:1},8,["title"]),(0,o.Wm)(u,{title:e.__("Actions")},{default:(0,o.w5)((function(){return[(0,o.Wm)("div",fa,[(0,o.Wm)(c,{as:"button",method:"DELETE",class:"btn btn-outline-danger",href:a.action,disabled:t.busy||e.$parent.user.id===n.user.id},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(n.user.deleted_at?e.__("Delete"):e.__("Trash")),1)]})),_:2},1032,["href","disabled"]),n.user.deleted_at?((0,o.wg)(),(0,o.j4)(c,{key:0,as:"button",method:"PATCH",class:"btn btn-warning",href:"".concat(a.action,"/restore"),disabled:t.busy},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.__("Restore")),1)]})),_:2},1032,["href","disabled"])):((0,o.wg)(),(0,o.j4)("button",{key:1,type:"submit",class:"btn btn-primary",disabled:t.busy},(0,l.zw)(e.__("Save")),9,["disabled"]))])]})),_:2},1032,["title"])])])]})),_:1},8,["action","data"])}},ha=pa;var ma={class:"col-12 col-lg-7 col-xl-8 form__body"},ga={class:"col-12 col-lg-5 col-xl-4 mt-5 mt-lg-0 form__sidebar"},ya={class:"sticky-helper"},va={class:"form-group d-flex justify-content-between mb-0"};const ba={props:{user:{type:Object,required:!0}},inheritAttrs:!1,mounted:function(){this.$parent.icon="customer",this.$parent.title=this.__("Create User")},computed:{action:function(){return"/bazar/users"}},render:function(e,t,n,r,i,a){var s=(0,o.up)("data-form-input"),u=(0,o.up)("card"),c=(0,o.up)("data-form");return(0,o.wg)(),(0,o.j4)(c,{class:"row",action:a.action,data:n.user},{default:(0,o.w5)((function(t){return[(0,o.Wm)("div",ma,[(0,o.Wm)(u,{title:e.__("General")},{default:(0,o.w5)((function(){return[(0,o.Wm)(s,{type:"text",name:"name",label:e.__("Name"),modelValue:t.data.name,"onUpdate:modelValue":function(e){return t.data.name=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.Wm)(s,{name:"email",type:"email",label:e.__("Email"),modelValue:t.data.email,"onUpdate:modelValue":function(e){return t.data.email=e}},null,8,["label","modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"])]),(0,o.Wm)("div",ga,[(0,o.Wm)("div",ya,[(0,o.Wm)(u,{title:e.__("Actions")},{default:(0,o.w5)((function(){return[(0,o.Wm)("div",va,[(0,o.Wm)("button",{type:"submit",class:"btn btn-primary",disabled:t.busy},(0,l.zw)(e.__("Save")),9,["disabled"])])]})),_:2},1032,["title"])])])]})),_:1},8,["action","data"])}},_a=ba;const wa={mixins:[Qt],props:{response:{type:Object,required:!0},filters:{type:Object,required:!0}},mounted:function(){this.$parent.icon="product",this.$parent.title=this.__("Variants")},computed:{url:function(){return window.location.href.replace(window.location.search,"").replace(/\/$/,"")}},methods:{formatDate:function(e){return e.substr(0,16).replace("T"," ")}},render:function(e,t,n,r,i,a){var s=(0,o.up)("inertia-link"),u=(0,o.up)("data-table-column"),c=(0,o.up)("data-table");return(0,o.wg)(),(0,o.j4)("div",null,[e.mounted?((0,o.wg)(),(0,o.j4)(o.lR,{key:0,to:".app-header__actions"},[(0,o.Wm)(s,{href:"".concat(a.url,"/create"),class:"btn btn-primary btn-sm"},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.__("Create Variant")),1)]})),_:1},8,["href"])])):(0,o.ry)("",!0),(0,o.Wm)(c,{response:n.response,filters:n.filters},{default:(0,o.w5)((function(){return[(0,o.Wm)(u,{label:e.__("Photo")},{default:(0,o.w5)((function(e){return[(0,o.Wm)("img",{class:"table-preview-image",src:e.media[0]?e.media[0].urls.thumb:"/vendor/bazar/img/placeholder.svg",alt:""},null,8,["src"])]})),_:1},8,["label"]),(0,o.Wm)(u,{label:e.__("Alias"),sort:"alias"},{default:(0,o.w5)((function(e){return[(0,o.Wm)(s,{href:"".concat(a.url,"/").concat(e.id)},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.alias),1)]})),_:2},1032,["href"])]})),_:1},8,["label"]),(0,o.Wm)(u,{label:e.__("Price")},{default:(0,o.w5)((function(e){return[(0,o.Uk)((0,l.zw)(e.price?e.formatted_price:e.product.formatted_price),1)]})),_:1},8,["label"]),(0,o.Wm)(u,{label:e.__("Variation")},{default:(0,o.w5)((function(t){return[((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(t.variation,(function(t,n){return(0,o.wg)(),(0,o.j4)("span",{key:n,class:"badge badge-primary mr-1"},(0,l.zw)(e.__(n))+": "+(0,l.zw)(e.__(t)),1)})),128))]})),_:1},8,["label"]),(0,o.Wm)(u,{label:e.__("Created at"),sort:"created_at"},{default:(0,o.w5)((function(e){return[(0,o.Uk)((0,l.zw)(a.formatDate(e.created_at)),1)]})),_:1},8,["label"])]})),_:1},8,["response","filters"])])}},xa=wa;var ka={class:"col-12 col-lg-7 col-xl-8 form__body"},Oa={key:0},Sa={class:"row"},Ea={key:0,class:"row"},Aa={class:"col"},Ca={class:"form-text text-danger"},ja={key:1,class:"alert alert-info mb-0"},Pa={class:"col"},Ta={class:"col"},Wa={class:"row align-items-end"},Ma={class:"col"},Na={class:"col"},Va={class:"col"},La={class:"form-group"},Ra={class:"col-12 col-lg-5 col-xl-4 mt-5 mt-lg-0 form__sidebar"},Ia={class:"sticky-helper"},Ua={class:"form-group d-flex justify-content-between mb-0"};function Da(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const qa={components:{Files:Li},props:{variant:{type:Object,required:!0},currencies:{type:Object,required:!0}},inheritAttrs:!1,mounted:function(){this.$parent.icon="product",this.$parent.title=this.variant.alias},computed:{config:function(){return window.Bazar.config},hasProperties:function(){return Object.keys(this.variant.product.properties).length},action:function(){return"/bazar/products/".concat(this.variant.product.id,"/variants/").concat(this.variant.id)}},methods:{selection:function(e){var t=this;return e.reduce((function(e,n){return Object.assign(e,Da({},t.__(n),n))}),Da({},this.__("Any"),"*"))}},render:function(e,t,n,i,a,s){var u=(0,o.up)("data-form-input"),c=(0,o.up)("card"),d=(0,o.up)("files"),f=(0,o.up)("inertia-link"),p=(0,o.up)("data-form");return(0,o.wg)(),(0,o.j4)(p,{class:"row",method:"PATCH",action:s.action,data:n.variant},{default:(0,o.w5)((function(t){return[(0,o.Wm)("div",ka,[(0,o.Wm)(c,{title:e.__("Variation"),class:"mb-5"},{default:(0,o.w5)((function(){return[s.hasProperties?((0,o.wg)(),(0,o.j4)("div",Oa,[(0,o.Wm)("div",Sa,[((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(n.variant.product.properties,(function(n,r){return(0,o.wg)(),(0,o.j4)("div",{key:r,class:"col"},[(0,o.Wm)(u,{handler:"select",name:"variation.".concat(r),label:e.__(r),options:s.selection(n),modelValue:t.data.variation[r],"onUpdate:modelValue":function(e){return t.data.variation[r]=e}},null,8,["name","label","options","modelValue","onUpdate:modelValue"])])})),128))]),t.errors.has("variation")?((0,o.wg)(),(0,o.j4)("div",Ea,[(0,o.Wm)("div",Aa,[(0,o.Wm)("span",Ca,(0,l.zw)(t.errors.get("variation")),1)])])):(0,o.ry)("",!0)])):((0,o.wg)(),(0,o.j4)("div",ja,(0,l.zw)(e.__("No variable properties are available for the product.")),1))]})),_:2},1032,["title"]),(0,o.Wm)(c,{title:e.__("Pricing"),class:"mb-5"},{default:(0,o.w5)((function(){return[((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(n.currencies,(function(n,r){return(0,o.wg)(),(0,o.j4)("div",{key:r,class:"row"},[(0,o.Wm)("div",Pa,[(0,o.Wm)(u,{type:"number",min:"0",step:"0.1",name:"form.data.prices.".concat(r,".default"),label:e.__("Price (:CURRENCY)",{currency:r}),modelValue:t.data.prices[r].default,"onUpdate:modelValue":function(e){return t.data.prices[r].default=e}},null,8,["name","label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",Ta,[(0,o.Wm)(u,{type:"number",min:"0",step:"0.1",name:"form.data.prices.".concat(r,".sale"),label:e.__("Sale Price (:CURRENCY)",{currency:r}),modelValue:t.data.prices[r].sale,"onUpdate:modelValue":function(e){return t.data.prices[r].sale=e}},null,8,["name","label","modelValue","onUpdate:modelValue"])])])})),128))]})),_:2},1032,["title"]),(0,o.Wm)(c,{title:e.__("Inventory")},{header:(0,o.w5)((function(){return[(0,o.Wm)(u,{handler:"checkbox",name:"inventory.virtual",label:e.__("Virtual"),modelValue:t.data.inventory.virtual,"onUpdate:modelValue":function(e){return t.data.inventory.virtual=e}},null,8,["label","modelValue","onUpdate:modelValue"])]})),default:(0,o.w5)((function(){return[(0,o.Wm)(u,{type:"text",name:"inventory.sku",label:e.__("SKU"),modelValue:t.data.inventory.sku,"onUpdate:modelValue":function(e){return t.data.inventory.sku=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.wy)((0,o.Wm)(u,{type:"number",name:"inventory.quantity",min:"0",label:e.__("Quantity"),help:e.__("Leave it empty for disabling quantity tracking."),modelValue:t.data.inventory.quantity,"onUpdate:modelValue":function(e){return t.data.inventory.quantity=e}},null,8,["label","help","modelValue","onUpdate:modelValue"]),[[r.F8,!t.data.inventory.virtual]]),(0,o.wy)((0,o.Wm)(u,{name:"inventory.weight",min:"0",type:"number",label:e.__("Weight (:unit)",{unit:s.config.weight_unit}),modelValue:t.data.inventory.weight,"onUpdate:modelValue":function(e){return t.data.inventory.weight=e}},null,8,["label","modelValue","onUpdate:modelValue"]),[[r.F8,!t.data.inventory.virtual]]),(0,o.wy)((0,o.Wm)("div",Wa,[(0,o.Wm)("div",Ma,[(0,o.Wm)(u,{type:"number",name:"inventory.length",min:"0",label:e.__("Length (:unit)",{unit:s.config.dimension_unit}),modelValue:t.data.inventory.length,"onUpdate:modelValue":function(e){return t.data.inventory.length=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",Na,[(0,o.Wm)(u,{type:"number",name:"inventory.width",min:"0",label:e.__("Width (:unit)",{unit:s.config.dimension_unit}),modelValue:t.data.inventory.width,"onUpdate:modelValue":function(e){return t.data.inventory.width=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",Va,[(0,o.Wm)(u,{name:"inventory.height",min:"0",type:"number",label:e.__("Height (:unit)",{unit:s.config.dimension_unit}),modelValue:t.data.inventory.height,"onUpdate:modelValue":function(e){return t.data.inventory.height=e}},null,8,["label","modelValue","onUpdate:modelValue"])])],512),[[r.F8,!t.data.inventory.virtual]]),(0,o.Wm)("div",La,[(0,o.Wm)(u,{handler:"checkbox",name:"inventory.virtual",label:e.__("Downloadable"),modelValue:t.data.inventory.downloadable,"onUpdate:modelValue":function(e){return t.data.inventory.downloadable=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.wy)((0,o.Wm)(d,{modelValue:t.data.inventory.files,"onUpdate:modelValue":function(e){return t.data.inventory.files=e}},null,8,["modelValue","onUpdate:modelValue"]),[[r.F8,t.data.inventory.downloadable]])]})),_:2},1032,["title"])]),(0,o.Wm)("div",Ra,[(0,o.Wm)("div",Ia,[(0,o.Wm)(c,{title:e.__("General"),class:"mb-5"},{default:(0,o.w5)((function(){return[(0,o.Wm)(u,{type:"text",name:"alias",label:e.__("Alias"),modelValue:t.data.alias,"onUpdate:modelValue":function(e){return t.data.alias=e}},null,8,["label","modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"]),(0,o.Wm)(c,{title:e.__("Media"),class:"mb-5"},{default:(0,o.w5)((function(){return[(0,o.Wm)(u,{handler:"media",name:"media",multiple:"",modelValue:t.data.media,"onUpdate:modelValue":function(e){return t.data.media=e}},null,8,["modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"]),(0,o.Wm)(c,{title:e.__("Actions")},{default:(0,o.w5)((function(){return[(0,o.Wm)("div",Ua,[(0,o.Wm)(f,{as:"button",method:"DELETE",class:"btn btn-outline-danger",href:s.action,disabled:t.busy},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(n.variant.deleted_at?e.__("Delete"):e.__("Trash")),1)]})),_:2},1032,["href","disabled"]),n.variant.deleted_at?((0,o.wg)(),(0,o.j4)(f,{key:0,as:"button",method:"PATCH",class:"btn btn-warning",href:"".concat(s.action,"/restore"),disabled:t.busy},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.__("Restore")),1)]})),_:2},1032,["href","disabled"])):((0,o.wg)(),(0,o.j4)("button",{key:1,type:"submit",class:"btn btn-primary",disabled:t.busy},(0,l.zw)(e.__("Save")),9,["disabled"]))])]})),_:2},1032,["title"])])])]})),_:1},8,["action","data"])}},za=qa;var Fa={class:"col-12 col-lg-7 col-xl-8 form__body"},Ba={key:0},$a={class:"row"},Ha={key:0,class:"row"},Ya={class:"col"},Ka={class:"form-text text-danger"},Ga={key:1,class:"alert alert-info mb-0"},Ja={class:"col"},Xa={class:"col"},Za={class:"row align-items-end"},Qa={class:"col"},el={class:"col"},tl={class:"col"},nl={class:"form-group"},rl={class:"col-12 col-lg-5 col-xl-4 mt-5 mt-lg-0 form__sidebar"},ol={class:"sticky-helper"},il={class:"form-group d-flex justify-content-between mb-0"};function al(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ll={components:{Files:Li},props:{variant:{type:Object,required:!0},product:{type:Object,required:!0},currencies:{type:Object,required:!0}},inheritAttrs:!1,mounted:function(){this.$parent.icon="product",this.$parent.title=this.__("Create Variant")},computed:{config:function(){return window.Bazar.config},hasProperties:function(){return Object.keys(this.variant.product.properties).length},action:function(){return"/bazar/products/".concat(this.product.id,"/variants")}},methods:{selection:function(e){var t=this;return e.reduce((function(e,n){return Object.assign(e,al({},t.__(n),n))}),al({},this.__("Any"),"*"))}},render:function(e,t,n,i,a,s){var u=(0,o.up)("data-form-input"),c=(0,o.up)("card"),d=(0,o.up)("files"),f=(0,o.up)("data-form");return(0,o.wg)(),(0,o.j4)(f,{class:"row",action:s.action,data:n.variant},{default:(0,o.w5)((function(t){return[(0,o.Wm)("div",Fa,[(0,o.Wm)(c,{title:e.__("Variation"),class:"mb-5"},{default:(0,o.w5)((function(){return[s.hasProperties?((0,o.wg)(),(0,o.j4)("div",Ba,[(0,o.Wm)("div",$a,[((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(n.variant.product.properties,(function(n,r){return(0,o.wg)(),(0,o.j4)("div",{key:r,class:"col"},[(0,o.Wm)(u,{handler:"select",name:"variation.".concat(r),label:e.__(r),options:s.selection(n),modelValue:t.data.variation[r],"onUpdate:modelValue":function(e){return t.data.variation[r]=e}},null,8,["name","label","options","modelValue","onUpdate:modelValue"])])})),128))]),t.errors.has("variation")?((0,o.wg)(),(0,o.j4)("div",Ha,[(0,o.Wm)("div",Ya,[(0,o.Wm)("span",Ka,(0,l.zw)(t.errors.get("variation")),1)])])):(0,o.ry)("",!0)])):((0,o.wg)(),(0,o.j4)("div",Ga,(0,l.zw)(e.__("No variable properties are available for the product.")),1))]})),_:2},1032,["title"]),(0,o.Wm)(c,{title:e.__("Pricing"),class:"mb-5"},{default:(0,o.w5)((function(){return[((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(n.currencies,(function(n,r){return(0,o.wg)(),(0,o.j4)("div",{key:r,class:"row"},[(0,o.Wm)("div",Ja,[(0,o.Wm)(u,{type:"number",min:"0",step:"0.1",name:"form.data.prices.".concat(r,".default"),label:e.__("Price (:CURRENCY)",{currency:r}),modelValue:t.data.prices[r].default,"onUpdate:modelValue":function(e){return t.data.prices[r].default=e}},null,8,["name","label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",Xa,[(0,o.Wm)(u,{type:"number",min:"0",step:"0.1",name:"form.data.prices.".concat(r,".sale"),label:e.__("Sale Price (:CURRENCY)",{currency:r}),modelValue:t.data.prices[r].sale,"onUpdate:modelValue":function(e){return t.data.prices[r].sale=e}},null,8,["name","label","modelValue","onUpdate:modelValue"])])])})),128))]})),_:2},1032,["title"]),(0,o.Wm)(c,{title:e.__("Inventory")},{header:(0,o.w5)((function(){return[(0,o.Wm)(u,{handler:"checkbox",name:"inventory.virtual",label:e.__("Virtual"),modelValue:t.data.inventory.virtual,"onUpdate:modelValue":function(e){return t.data.inventory.virtual=e}},null,8,["label","modelValue","onUpdate:modelValue"])]})),default:(0,o.w5)((function(){return[(0,o.Wm)(u,{type:"text",name:"inventory.sku",label:e.__("SKU"),modelValue:t.data.inventory.sku,"onUpdate:modelValue":function(e){return t.data.inventory.sku=e}},null,8,["label","modelValue","onUpdate:modelValue"]),(0,o.wy)((0,o.Wm)(u,{type:"number",name:"inventory.quantity",min:"0",label:e.__("Quantity"),help:e.__("Leave it empty for disabling quantity tracking."),modelValue:t.data.inventory.quantity,"onUpdate:modelValue":function(e){return t.data.inventory.quantity=e}},null,8,["label","help","modelValue","onUpdate:modelValue"]),[[r.F8,!t.data.inventory.virtual]]),(0,o.wy)((0,o.Wm)(u,{name:"inventory.weight",min:"0",type:"number",label:e.__("Weight (:unit)",{unit:s.config.weight_unit}),modelValue:t.data.inventory.weight,"onUpdate:modelValue":function(e){return t.data.inventory.weight=e}},null,8,["label","modelValue","onUpdate:modelValue"]),[[r.F8,!t.data.inventory.virtual]]),(0,o.wy)((0,o.Wm)("div",Za,[(0,o.Wm)("div",Qa,[(0,o.Wm)(u,{type:"number",name:"inventory.length",min:"0",label:e.__("Length (:unit)",{unit:s.config.dimension_unit}),modelValue:t.data.inventory.length,"onUpdate:modelValue":function(e){return t.data.inventory.length=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",el,[(0,o.Wm)(u,{type:"number",name:"inventory.width",min:"0",label:e.__("Width (:unit)",{unit:s.config.dimension_unit}),modelValue:t.data.inventory.width,"onUpdate:modelValue":function(e){return t.data.inventory.width=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.Wm)("div",tl,[(0,o.Wm)(u,{name:"inventory.height",min:"0",type:"number",label:e.__("Height (:unit)",{unit:s.config.dimension_unit}),modelValue:t.data.inventory.height,"onUpdate:modelValue":function(e){return t.data.inventory.height=e}},null,8,["label","modelValue","onUpdate:modelValue"])])],512),[[r.F8,!t.data.inventory.virtual]]),(0,o.Wm)("div",nl,[(0,o.Wm)(u,{handler:"checkbox",name:"inventory.virtual",label:e.__("Downloadable"),modelValue:t.data.inventory.downloadable,"onUpdate:modelValue":function(e){return t.data.inventory.downloadable=e}},null,8,["label","modelValue","onUpdate:modelValue"])]),(0,o.wy)((0,o.Wm)(d,{modelValue:t.data.inventory.files,"onUpdate:modelValue":function(e){return t.data.inventory.files=e}},null,8,["modelValue","onUpdate:modelValue"]),[[r.F8,t.data.inventory.downloadable]])]})),_:2},1032,["title"])]),(0,o.Wm)("div",rl,[(0,o.Wm)("div",ol,[(0,o.Wm)(c,{title:e.__("General"),class:"mb-5"},{default:(0,o.w5)((function(){return[(0,o.Wm)(u,{type:"text",name:"alias",label:e.__("Alias"),modelValue:t.data.alias,"onUpdate:modelValue":function(e){return t.data.alias=e}},null,8,["label","modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"]),(0,o.Wm)(c,{title:e.__("Media"),class:"mb-5"},{default:(0,o.w5)((function(){return[(0,o.Wm)(u,{handler:"media",name:"media",multiple:"",modelValue:t.data.media,"onUpdate:modelValue":function(e){return t.data.media=e}},null,8,["modelValue","onUpdate:modelValue"])]})),_:2},1032,["title"]),(0,o.Wm)(c,{title:e.__("Actions")},{default:(0,o.w5)((function(){return[(0,o.Wm)("div",il,[(0,o.Wm)("button",{type:"submit",class:"btn btn-primary",disabled:t.busy},(0,l.zw)(e.__("Save")),9,["disabled"])])]})),_:2},1032,["title"])])])]})),_:1},8,["action","data"])}},sl=ll,ul={install:function(e){window.Bazar.pages=Object.assign({Dashboard:Pt,Support:It,Profile:Bt,Password:Jt,"Addresses/Index":tn,"Addresses/Show":_n,"Addresses/Create":In,"Categories/Index":Dn,"Categories/Show":Hn,"Categories/Create":Zn,"Orders/Index":er,"Orders/Show":lo,"Orders/Create":si,"Products/Index":ci,"Products/Show":Ui,"Products/Create":aa,"Users/Index":sa,"Users/Show":ha,"Users/Create":_a,"Variants/Index":xa,"Variants/Show":za,"Variants/Create":sl},window.Bazar.pages)}};var cl=n(9669),dl=n.n(cl);const fl={install:function(e){e.config.globalProperties.$http=dl().create({headers:{Accept:"application/json","Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}})}};function pl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hl(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};pl(this,e),this.translations=t}var t,n,r;return t=e,(n=[{key:"__",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var n in e=this.translations[e]||e,t)e=e.toString().replace(":".concat(n),t[n]).replace(":".concat(n.toUpperCase()),t[n].toString().toUpperCase()).replace(":".concat(n.charAt(0).toUpperCase()).concat(n.slice(1)),t[n].toString().charAt(0).toUpperCase()+t[n].toString().slice(1));return e.toString().trim()}}])&&hl(t.prototype,n),r&&hl(t,r),e}();const gl={install:function(e,t){var n=new ml(t.translations);e.config.globalProperties.__=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n.__(e,t)}}};var yl={class:"icon","aria-hidden":"true",role:"img",fill:"currentColor",viewBox:"0 0 24 24",width:"24",height:"24"};const vl={props:{name:{type:String,required:!0}},render:function(e,t,n,r,i,a){return(0,o.wg)(),(0,o.j4)("svg",yl,[(0,o.Wm)("use",{"xlink:href":"#icon-".concat(n.name)},null,8,["xlink:href"])])}},bl=vl;const _l={mixins:[$],props:{direction:{type:String,default:"down"},align:{type:String,default:"left"}},mounted:function(){var e=this;window.addEventListener("keyup",(function(t){e.isOpen&&"Escape"===t.code&&e.close()})),window.addEventListener("click",(function(t){e.isOpen&&!e.$el.contains(t.target)&&e.close()}))},render:function(e,t,n,i,a,l){var s=(0,o.up)("icon");return(0,o.wg)(),(0,o.j4)("div",{class:["drop".concat(n.direction),{"more-actions":!e.$slots.trigger}]},[(0,o.Wm)("div",{onClick:t[2]||(t[2]=function(){return e.toggle&&e.toggle.apply(e,arguments)})},[(0,o.WI)(e.$slots,"trigger",{},(function(){return[(0,o.Wm)("button",{type:"button",class:"btn btn-link dropdown-ellipses px-0 py-0",onClick:t[1]||(t[1]=(0,r.iM)((function(){}),["prevent"]))},[(0,o.Wm)(s,{name:"more-vertical"})])]}))]),(0,o.Wm)("div",{class:["dropdown-menu","dropdown-menu-".concat(n.align)],style:{display:e.isOpen?"block":"none"}},[(0,o.WI)(e.$slots,"default")],6)],2)}},wl=_l;var xl=(0,o.Wm)("span",{"aria-hidden":"true"},"×",-1);const kl={mixins:[$],props:{type:{type:String,default:"primary"},closable:{type:Boolean,default:!1}},data:function(){return{isOpen:!0}},render:function(e,t,n,i,a,l){return(0,o.wy)(((0,o.wg)(),(0,o.j4)("div",{class:["alert mb-5",["alert-".concat(n.type),{"alert-dismissible":n.closable}]],role:"alert"},[(0,o.WI)(e.$slots,"default"),n.closable?((0,o.wg)(),(0,o.j4)("button",{key:0,type:"button",class:"close","aria-label":e.__("Close"),onClick:t[1]||(t[1]=function(){return e.close&&e.close.apply(e,arguments)})},[xl],8,["aria-label"])):(0,o.ry)("",!0)],2)),[[r.F8,a.isOpen]])}},Ol=kl;var Sl={class:"card"},El={key:0,class:"card__header"},Al={class:"card__title"},Cl={class:"card__inner"},jl={key:1,class:"card__footer"};const Pl={props:{title:{type:String,default:null}},computed:{hasHeader:function(){return!!this.title||this.$slots.hasOwnProperty("header")},hasFooter:function(){return this.$slots.hasOwnProperty("footer")}},render:function(e,t,n,r,i,a){return(0,o.wg)(),(0,o.j4)("section",Sl,[a.hasHeader?((0,o.wg)(),(0,o.j4)("div",El,[(0,o.Wm)("h2",Al,(0,l.zw)(n.title),1),(0,o.WI)(e.$slots,"header")])):(0,o.ry)("",!0),(0,o.Wm)("div",Cl,[(0,o.WI)(e.$slots,"default")]),a.hasFooter?((0,o.wg)(),(0,o.j4)("div",jl,[(0,o.WI)(e.$slots,"footer")])):(0,o.ry)("",!0)])}},Tl=Pl;var Wl={role:"document",class:"modal-dialog modal-dialog-scrollable modal-dialog-centered"},Ml={class:"modal-content"},Nl={class:"modal-header"},Vl={key:0,class:"modal-title"},Ll=(0,o.Wm)("span",{"aria-hidden":"true"},"×",-1),Rl={class:"modal-body flex-column"},Il={class:"modal-footer"};const Ul={mixins:[$],props:{title:{type:String,default:null}},mounted:function(){var e=this;window.addEventListener("keyup",(function(t){e.isOpen&&"Escape"===t.code&&e.close()}))},watch:{isOpen:function(e,t){var n=this.$el.closest(".form__sidebar")?"sidebar":"body";e?this.$root.$el.classList.add("has-modal-open--".concat(n)):this.$root.$el.classList.remove("has-modal-open--".concat(n))}},render:function(e,t,n,i,a,s){return(0,o.wy)(((0,o.wg)(),(0,o.j4)("div",{class:"modal",tabindex:"-1",role:"dialog","aria-hidden":"true",onClick:t[3]||(t[3]=(0,r.iM)((function(){return e.close&&e.close.apply(e,arguments)}),["self"]))},[(0,o.Wm)("div",Wl,[(0,o.Wm)("div",Ml,[(0,o.Wm)("div",Nl,[n.title?((0,o.wg)(),(0,o.j4)("h3",Vl,(0,l.zw)(n.title),1)):(0,o.ry)("",!0),(0,o.Wm)("button",{type:"button",class:"close","aria-label":e.__("Close"),onClick:t[1]||(t[1]=(0,r.iM)((function(){return e.close&&e.close.apply(e,arguments)}),["prevent"]))},[Ll],8,["aria-label"])]),(0,o.Wm)("div",Rl,[(0,o.WI)(e.$slots,"default")]),(0,o.Wm)("div",Il,[(0,o.WI)(e.$slots,"footer",{},(function(){return[(0,o.Wm)("button",{type:"button",class:"btn btn-outline-primary",onClick:t[2]||(t[2]=(0,r.iM)((function(){return e.close&&e.close.apply(e,arguments)}),["prevent"]))},(0,l.zw)(e.__("Close")),1)]}))])])])],512)),[[r.F8,e.isOpen]])}},Dl=Ul;var ql={class:"modal-media modal-dialog modal-dialog-scrollable modal-dialog-centered modal-full-screen"},zl={class:"modal-header"},Fl={class:"modal-title"},Bl=(0,o.Wm)("span",null,"×",-1),$l={class:"modal-body"},Hl={class:"container-fluid p-0"},Yl={class:"row mb-3",style:{"border-bottom":"1px solid #dee2e6"}},Kl={class:"col-8"},Gl={class:"col-4"},Jl={key:0,class:"form-row"},Xl={class:"form-row"},Zl={class:"col-3"},Ql={key:1,class:"row"},es={class:"col-12"},ts={class:"alert alert-info"},ns={class:"modal-footer"};var rs={class:"col-6 col-sm-4 col-md-3 col-lg-2 mb-3"},os={key:1,class:"media-item__caption"},is={style:{"text-overflow":"ellipsis"}};const as={props:{item:{type:Object,required:!0}},data:function(){return{tries:0,loading:!1,url:this.item.urls.thumb}},computed:{selected:function(){var e=this;return this.$parent.selection.some((function(t){return t.id===e.item.id}))}},methods:{select:function(){this.$parent.multiple?this.$parent.selection.push(this.item):this.$parent.selection=[this.item]},deselect:function(){var e=this,t=this.$parent.selection.findIndex((function(t){return t.id===e.item.id}));this.$parent.selection.splice(t,1)},toggle:function(){this.$parent.processing||(this.selected?this.deselect():this.select())},reload:function(){var e=this;if(!(this.tries>=5)){this.loading=!0;var t=setInterval((function(){var n=new URL(e.url);n.searchParams.set("key",(new Date).getTime()),e.url=n.toString(),e.tries++,clearInterval(t)}),5e3)}}},render:function(e,t,n,i,a,s){var u=(0,o.up)("icon");return(0,o.wg)(),(0,o.j4)("div",rs,[(0,o.Wm)("div",{class:["media-item",{"is-image":n.item.is_image,"is-document":!n.item.is_image,"is-selected":s.selected,"is-loading":a.loading}],style:{cursor:"pointer"},onClick:t[3]||(t[3]=(0,r.iM)((function(){return s.toggle&&s.toggle.apply(s,arguments)}),["prevent"]))},[n.item.is_image?((0,o.wg)(),(0,o.j4)("img",{key:0,src:a.url,alt:n.item.name,onError:t[1]||(t[1]=function(){return s.reload&&s.reload.apply(s,arguments)}),onLoad:t[2]||(t[2]=function(e){return a.loading=!1})},null,40,["src","alt"])):((0,o.wg)(),(0,o.j4)("span",os,[(0,o.Wm)(u,{name:"file"}),(0,o.Wm)("span",is,(0,l.zw)(n.item.file_name),1)]))],2)])}},ls=as;var ss={class:"row"},us={class:"col-12 d-flex align-items-center"},cs={class:"form-group mr-3"},ds={for:"media-search",class:"sr-only"},fs={class:"form-group mr-3"},ps={class:"input-group input-group-sm"},hs={for:"media-type",class:"input-group-prepend mb-0"},ms={class:"input-group-text"},gs={value:null},ys={value:"file"},vs={value:"image"},bs={class:"form-group"},_s={class:"input-group input-group-sm"},ws={for:"media-date",class:"input-group-prepend mb-0"},xs={class:"input-group-text"},ks={value:"name"},Os={value:"created_at"},Ss={value:"updated_at"},Es={class:"input-group-append"};const As={computed:{isDesc:function(){return"desc"===this.$parent.query["sort[order]"]},icon:function(){return this.isDesc?"keyboard-arrow-down":"keyboard-arrow-up"}},methods:{toggle:function(){this.$parent.query["sort[order]"]=this.isDesc?"asc":"desc"}},render:function(e,t,n,i,a,s){var u=(0,o.up)("icon"),c=(0,o.Q2)("debounce");return(0,o.wg)(),(0,o.j4)("div",ss,[(0,o.Wm)("div",us,[(0,o.Wm)("div",cs,[(0,o.Wm)("label",ds,(0,l.zw)(e.__("Search")),1),(0,o.wy)((0,o.Wm)("input",{id:"media-search",type:"text",class:"form-control form-control-sm",placeholder:e.__("Search"),disabled:e.$parent.busy,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.$parent.query.search=t})},null,8,["placeholder","disabled"]),[[r.nr,e.$parent.query.search,void 0,{lazy:!0}],[c,300]])]),(0,o.Wm)("div",fs,[(0,o.Wm)("div",ps,[(0,o.Wm)("label",hs,[(0,o.Wm)("span",ms,(0,l.zw)(e.__("Type")),1)]),(0,o.wy)((0,o.Wm)("select",{id:"media-type",class:"custom-select form-control","onUpdate:modelValue":t[2]||(t[2]=function(t){return e.$parent.query.type=t}),disabled:e.$parent.busy},[(0,o.Wm)("option",gs,(0,l.zw)(e.__("Any")),1),(0,o.Wm)("option",ys,(0,l.zw)(e.__("File")),1),(0,o.Wm)("option",vs,(0,l.zw)(e.__("Image")),1)],8,["disabled"]),[[r.bM,e.$parent.query.type]])])]),(0,o.Wm)("div",bs,[(0,o.Wm)("div",_s,[(0,o.Wm)("label",ws,[(0,o.Wm)("span",xs,(0,l.zw)(e.__("Sort")),1)]),(0,o.Wm)("select",{id:"media-date",class:"custom-select form-control",disabled:e.$parent.busy,modelValue:e.$parent.query["sort[by]"],"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.$parent.query["sort[by]"]=t})},[(0,o.Wm)("option",ks,(0,l.zw)(e.__("Name")),1),(0,o.Wm)("option",Os,(0,l.zw)(e.__("Created at")),1),(0,o.Wm)("option",Ss,(0,l.zw)(e.__("Updated at")),1)],8,["disabled","modelValue"]),(0,o.Wm)("div",Es,[(0,o.Wm)("button",{type:"button",class:"btn btn-primary p-0",onClick:t[4]||(t[4]=function(){return s.toggle&&s.toggle.apply(s,arguments)})},[(0,o.Wm)(u,{name:s.icon},null,8,["name"])])])])])])])}},Cs=As;var js={class:"media-sidebar"},Ps={class:"media-sidebar__section"},Ts={class:"media-sidebar__title"},Ws={class:"media-accordions"};var Ms={class:"media-accordion"},Ns={class:"media-accordion__title d-flex align-items-center"},Vs={style:{"text-overflow":"ellipsis","max-width":"190px",display:"inline-block",overflow:"hidden","white-space":"nowrap"}},Ls={class:"media-sidebar__list mt-3 mb-3"};const Rs={props:{item:{type:Object,required:!0}},data:function(){return{tries:0,isOpen:!1,loading:!1,busy:!1,url:this.item.urls.thumb}},computed:{action:function(){return"/admin/media/".concat(this.item.id)},size:function(){var e=Math.floor(Math.log(this.item.size)/Math.log(1024));return 1*(this.item.size/Math.pow(1024,e)).toFixed(2)+" "+["KB","MB","GB","TB"][e]},dimensions:function(){return"".concat(this.item.width,"×").concat(this.item.height," px")},createdAt:function(){return this.item.created_at.substr(0,16).replace("T"," ")}},methods:{toggle:function(){this.isOpen=!this.isOpen},remove:function(){var e=this;this.$parent.$parent.selection.splice(this.$parent.$parent.selection.findIndex((function(t){return t.id===e.item.id})),1)},destroy:function(){var e=this;this.busy=!0,this.$http.delete(this.action).then((function(t){e.$parent.$parent.response.data.splice(e.$parent.$parent.response.data.findIndex((function(t){return t.id===e.item.id})),1),e.remove()})).catch((function(e){})).finally((function(){e.busy=!1}))},reload:function(){var e=this;if(this.tries>=5)this.loading=!1;else{this.loading=!0;var t=setInterval((function(){var n=new URL(e.url);n.searchParams.set("key",(new Date).getTime()),e.url=n.toString(),e.tries++,clearInterval(t)}),5e3)}}},render:function(e,t,n,r,i,a){var s=(0,o.up)("icon");return(0,o.wg)(),(0,o.j4)("div",Ms,[(0,o.Wm)("div",{class:"media-accordion__heading",onClick:t[4]||(t[4]=function(){return a.toggle&&a.toggle.apply(a,arguments)})},[(0,o.Wm)("h3",Ns,[n.item.is_image?((0,o.wg)(),(0,o.j4)("div",{key:0,class:["media-accordion__image-wrapper",{"is-loading":i.loading}]},[(0,o.Wm)("img",{src:i.url,class:"media-accordion__image",alt:"",onError:t[1]||(t[1]=function(){return a.reload&&a.reload.apply(a,arguments)}),onLoad:t[2]||(t[2]=function(e){return i.loading=!1})},null,40,["src"])],2)):((0,o.wg)(),(0,o.j4)(s,{key:1,name:"file",class:"media-accordion__icon"})),(0,o.Wm)("span",Vs,(0,l.zw)(n.item.file_name),1)]),(0,o.Wm)("button",{type:"button",class:"icon-btn icon-btn-danger","aria-label":e.__("Remove"),onClick:t[3]||(t[3]=function(){return a.remove&&a.remove.apply(a,arguments)})},[(0,o.Wm)(s,{name:"close"})],8,["aria-label"])]),(0,o.Wm)("div",{class:["media-accordion__content",{"is-open":i.isOpen}]},[(0,o.Wm)("ul",Ls,[(0,o.Wm)("li",null,(0,l.zw)(a.createdAt),1),(0,o.Wm)("li",null,(0,l.zw)(a.size),1),n.item.is_image?((0,o.wg)(),(0,o.j4)("li",{key:0,innerHTML:a.dimensions},null,8,["innerHTML"])):(0,o.ry)("",!0)]),(0,o.Wm)("button",{type:"button",class:"btn btn-sm btn-outline-danger",disabled:i.busy,onClick:t[5]||(t[5]=function(){return a.destroy&&a.destroy.apply(a,arguments)})},(0,l.zw)(e.__("Delete")),9,["disabled"])],2)])}},Is={components:{Item:Rs},render:function(e,t,n,r,i,a){var s=(0,o.up)("item");return(0,o.wg)(),(0,o.j4)("div",js,[(0,o.Wm)("div",Ps,[(0,o.Wm)("h3",Ts,(0,l.zw)(e.__(":count selected",{count:e.$parent.selection.length})),1),(0,o.Wm)("div",Ws,[((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(e.$parent.selection,(function(e){return(0,o.wg)(),(0,o.j4)(s,{key:e.id,item:e},null,8,["item"])})),128))])])])}},Us=Is;var Ds={class:"d-flex justify-content-between w-100"};const qs={computed:{id:function(){return this.$parent.selection.map((function(e){return e.id}))}},methods:{select:function(){this.$parent.$emit("update:modelValue",this.$parent.selection),this.$parent.close()},destroy:function(){var e=this;this.$parent.busy=!0,this.$http.delete("/admin/media/batch-destroy",{data:{id:this.id}}).then((function(t){e.refresh()})).catch((function(e){})).finally((function(){e.$parent.busy=!1}))},refresh:function(){this.$parent.selection=[],this.$parent.fetch()}},render:function(e,t,n,i,a,s){return(0,o.wg)(),(0,o.j4)("div",Ds,[(0,o.Wm)("div",null,[(0,o.Wm)("button",{type:"button",class:"btn btn-danger",disabled:0===s.id.length||e.$parent.busy,onClick:t[1]||(t[1]=function(){return s.destroy&&s.destroy.apply(s,arguments)})},(0,l.zw)(e.__("Delete")),9,["disabled"]),(0,o.wy)((0,o.Wm)("span",{class:"modal-help-text ml-3"},(0,l.zw)(e.__(":files items selected",{files:s.id.length})),513),[[r.F8,s.id.length]])]),(0,o.Wm)("div",null,[(0,o.Wm)("button",{type:"button",disabled:e.$parent.busy,class:"btn btn-primary",onClick:t[2]||(t[2]=function(){return s.select&&s.select.apply(s,arguments)})},(0,l.zw)(e.__("Select")),9,["disabled"]),(0,o.Wm)("button",{type:"button",class:"btn btn-outline-primary ml-2",disabled:e.$parent.busy,onClick:t[3]||(t[3]=function(){var t;return e.$parent.close&&(t=e.$parent).close.apply(t,arguments)})},(0,l.zw)(e.__("Close")),9,["disabled"])])])}},zs=qs;var Fs={class:"col-sm-4 col-md-3 col-lg-2 mb-3"},Bs={class:"uploader-item"},$s={key:1};const Hs={props:{file:{type:File,required:!0}},beforeMount:function(){this.generateHash(),this.createChunks()},watch:{chunks:{handler:function(e,t){e.length>0&&this.upload()},deep:!0}},data:function(){return{chunks:[],hash:null,error:null,uploaded:0}},computed:{progress:function(){return Math.floor(100*this.uploaded/this.file.size)},formData:function(){var e=new FormData;return e.set("is_last",1===this.chunks.length),e.set("file",this.chunks[0],"".concat(this.hash,"__").concat(this.file.name,".chunk")),e},config:function(){var e=this;return{method:"POST",data:this.formData,url:this.$parent.endpoint,headers:{"Content-Type":"multipart/form-data"},onUploadProgress:function(t){e.uploaded+=t.loaded}}}},methods:{upload:function(){var e=this;this.$http(this.config).then((function(t){e.onSuccess(t.data)})).catch((function(t){e.error=e.__("An error occured!")}))},retry:function(){this.chunks=[],this.error=null,this.uploaded=0,this.generateHash(),this.createChunks()},onSuccess:function(e){this.chunks.shift(),0===this.chunks.length&&(this.$parent.response.data.unshift(e),this.$parent.queue.splice(this.$parent.queue.indexOf(this.file),1))},generateHash:function(){this.hash=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)},createChunks:function(){for(var e=[],t=1048576,n=Math.ceil(this.file.size/t),r=0;r=this.response.data.length?0:this.active+1)},highlightPrev:function(){this.isOpen&&this.highlight(0===this.active?this.response.data.length-1:this.active-1)},clear:function(){this.$emit("update:modelValue",[])}},render:function(e,t,n,i,a,s){var u=(0,o.Q2)("debounce");return(0,o.wg)(),(0,o.j4)("div",Hu,[e.$attrs.label?((0,o.wg)(),(0,o.j4)("label",{key:0,for:e.$attrs.name},(0,l.zw)(e.$attrs.label),9,["for"])):(0,o.ry)("",!0),(0,o.wy)((0,o.Wm)("input",(0,o.dG)({class:["form-control",{"is-invalid":e.$attrs.invalid}],type:"text",autocomplete:"off",name:e.$attrs.name,id:e.$attrs.name},e.$attrs,{"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.query.search=t}),onFocus:t[2]||(t[2]=function(){return e.open&&e.open.apply(e,arguments)}),onKeydown:[t[3]||(t[3]=(0,r.D2)((function(){return s.highlightPrev&&s.highlightPrev.apply(s,arguments)}),["up"])),t[4]||(t[4]=(0,r.D2)((function(){return s.highlightNext&&s.highlightNext.apply(s,arguments)}),["down"])),t[5]||(t[5]=(0,r.D2)((0,r.iM)((function(){return s.commit&&s.commit.apply(s,arguments)}),["prevent"]),["enter"]))]}),null,16,["name","id"]),[[r.nr,e.query.search,void 0,{lazy:!0}],[u,300]]),e.$attrs.invalid?((0,o.wg)(),(0,o.j4)("span",Yu,(0,l.zw)(e.$attrs.error),1)):(0,o.ry)("",!0),(0,o.Wm)("div",Ku,[(0,o.wy)((0,o.Wm)("div",Gu,[(0,o.Wm)("div",Ju,[((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(e.response.data,(function(t,n){return(0,o.wg)(),(0,o.j4)("div",{class:["list-group-item list-group-item-action",[n===a.active?"active":""]],key:n,ref:"option-".concat(n),onMousedown:function(e){return s.select(n)}},[(0,o.WI)(e.$slots,"default",t)],42,["onMousedown"])})),128)),0===e.response.data.length?((0,o.wg)(),(0,o.j4)("div",Xu,(0,l.zw)(e.__("No items found for the given keyword.")),1)):e.errors.any()?((0,o.wg)(),(0,o.j4)("div",Zu,(0,l.zw)(e.errors.get("*")),1)):(0,o.ry)("",!0)])],512),[[r.F8,e.isOpen]])])])}},ec=Qu,tc={name:"FormInput",props:{modelValue:{default:null},name:{type:String,required:!0},handler:{type:String,default:"input"}},inheritAttrs:!1,emits:["update:modelValue"],inject:["form"],render:function(){var e=this;return(0,o.h)(this.getComponent(this.handler),Object.assign({},this.$attrs,{name:this.name,error:this.error,invalid:this.invalid,modelValue:this.modelValue,"onUpdate:modelValue":function(t){e.update(t)}}),this.$slots.default)},computed:{invalid:function(){return this.form.errors.has(this.name)},error:function(){return this.invalid?this.form.errors.get(this.name):null}},methods:{update:function(e){this.$emit("update:modelValue",e),this.invalid&&this.form.errors.clear(this.name)},getComponent:function(e){switch(e){case"autocomplete":return ec;case"select":return qu;case"editor":return Lu;case"tag":return gu;case"checkbox":return $u;case"media":return Ou;case"radio":return ju;default:return _u}}}};var nc={class:"card"},rc={class:"card__inner"},oc={class:"table-responsive"},ic={key:0,class:"table table-hover"},ac={key:1,class:"alert alert-info mb-0"},lc={style:{display:"none"}};var sc={scope:"row",style:{width:"40px"}},uc=(0,o.Wm)("span",{class:"custom-control-label"},null,-1),cc={style:{width:"40px"}};const dc={computed:{url:function(){return window.location.pathname.replace(/\/?$/,"/".concat(this.$parent.item.id))},deletable:function(){return this.$parent.item.hasOwnProperty("deleted_at")},restorable:function(){return this.$parent.item.hasOwnProperty("deleted_at")&&this.$parent.item.deleted_at}},methods:{destroy:function(){this.$inertia.delete(this.url,{only:["results","message"]})},restore:function(){this.$inertia.patch("".concat(this.url,"/restore"),{only:["results","message"]})}},render:function(e,t,n,r,i,a){var s=(0,o.up)("inertia-link"),u=(0,o.up)("dropdown");return(0,o.wg)(),(0,o.j4)(u,{ref:"dropdown",align:"right"},{default:(0,o.w5)((function(){return[(0,o.Wm)(s,{href:a.url,class:"dropdown-item"},{default:(0,o.w5)((function(){return[(0,o.Uk)((0,l.zw)(e.__("Edit")),1)]})),_:1},8,["href"]),(0,o.Wm)("button",{type:"button",class:"dropdown-item",disabled:!a.deletable,onClick:t[1]||(t[1]=function(){return a.destroy&&a.destroy.apply(a,arguments)})},(0,l.zw)(e.__("Delete")),9,["disabled"]),(0,o.Wm)("button",{type:"button",class:"dropdown-item",disabled:!a.restorable,onClick:t[2]||(t[2]=function(){return a.restore&&a.restore.apply(a,arguments)})},(0,l.zw)(e.__("Restore")),9,["disabled"])]})),_:1},512)}},fc={components:{Cell:{props:{column:{type:Object,required:!0}},functional:!0,render:function(){return(0,o.h)("div",{},this.column.$slots.default(this.$parent.item))}},Actions:dc},props:{item:{type:Object,required:!0}},computed:{selected:function(){var e=JSON.stringify(this.item);return this.$parent.selection.some((function(t){return JSON.stringify(t)===e}))},trashed:function(){return!!this.item.deleted_at}},methods:{select:function(){this.$parent.selection.push(this.item)},deselect:function(){var e=this.$parent.selection.indexOf(this.item);this.$parent.selection.splice(e,1)},toggle:function(){this.$parent.busy||(this.selected?this.deselect():this.select())}},render:function(e,t,n,i,a,l){var s=(0,o.up)("cell"),u=(0,o.up)("actions");return(0,o.wg)(),(0,o.j4)("tr",{class:{"table-active":l.selected,"table-danger":l.trashed}},[(0,o.Wm)("th",sc,[(0,o.Wm)("label",{class:"custom-control custom-checkbox mb-0",onClick:t[1]||(t[1]=(0,r.iM)((function(){return l.toggle&&l.toggle.apply(l,arguments)}),["prevent"]))},[(0,o.Wm)("input",{handler:"checkbox",class:"custom-control-input",checked:l.selected,disabled:e.$parent.busy},null,8,["checked","disabled"]),uc])]),((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(e.$parent.columns,(function(e,t){return(0,o.wg)(),(0,o.j4)("td",{key:t,class:e.$attrs.class,style:e.$attrs.style},[(0,o.Wm)(s,{column:e},null,8,["column"])],6)})),128)),(0,o.Wm)("td",cc,[(0,o.Wm)(u)])],2)}},pc=fc;var hc={class:"row mb-4"},mc={class:"col-12 d-md-flex flex-wrap col-xl-9"},gc={class:"input-group input-group-sm"},yc={class:"input-group-text"},vc={value:void 0},bc={class:"col-12 col-md-4 col-lg-3 d-md-flex justify-content-end"},_c={class:"d-md-inline-flex align-items-center"},wc={for:"filter-search",class:"sr-only"};const xc={methods:{capitalize:function(e){return(e=e.toString()).charAt(0).toUpperCase()+e.slice(1)}},render:function(e,t,n,i,a,s){var u=(0,o.Q2)("debounce");return(0,o.wg)(),(0,o.j4)("div",hc,[(0,o.Wm)("div",mc,[((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(e.$parent.filters,(function(t,n){return(0,o.wg)(),(0,o.j4)("div",{key:n,class:"form-group mb-3 mr-3 mb-md-0"},[(0,o.Wm)("div",gc,[(0,o.Wm)("label",{for:"filter-".concat(n),class:"input-group-prepend mb-0"},[(0,o.Wm)("span",yc,(0,l.zw)(e.__(s.capitalize(n))),1)],8,["for"]),(0,o.wy)((0,o.Wm)("select",{"onUpdate:modelValue":function(t){return e.$parent.query[n]=t},class:"custom-select form-control",id:"filter-".concat(n),disabled:e.$parent.busy},[(0,o.Wm)("option",vc,(0,l.zw)(e.__("Any")),1),((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(t,(function(e,t){return(0,o.wg)(),(0,o.j4)("option",{key:t,value:e},(0,l.zw)(t),9,["value"])})),128))],8,["onUpdate:modelValue","id","disabled"]),[[r.bM,e.$parent.query[n]]])])])})),128))]),(0,o.Wm)("div",bc,[(0,o.Wm)("div",_c,[(0,o.Wm)("label",wc,(0,l.zw)(e.__("Search")),1),(0,o.wy)((0,o.Wm)("input",{id:"filter-search",type:"text",class:"form-control form-control-sm","onUpdate:modelValue":t[1]||(t[1]=function(t){return e.$parent.query.search=t}),placeholder:e.__("Search"),readonly:e.$parent.busy},null,8,["placeholder","readonly"]),[[r.nr,e.$parent.query.search,void 0,{lazy:!0}],[u,300]])])])])}},kc=xc;var Oc={scope:"col",style:{width:"80px"}},Sc={class:"d-flex"},Ec={class:"custom-control custom-checkbox mb-0"},Ac=(0,o.Wm)("span",{class:"custom-control-label"},null,-1),Cc={key:0,type:"button",class:"table-sort-btn"},jc=(0,o.Wm)("th",{scope:"col",style:{width:"40px"}},null,-1);var Pc={class:"dropdown-header"};const Tc={computed:{url:function(){return window.location.pathname.replace(/\/$/,"")},deletable:function(){return this.$parent.$parent.selection.some((function(e){return e.hasOwnProperty("deleted_at")}))},restorable:function(){return this.$parent.$parent.selection.some((function(e){return e.hasOwnProperty("deleted_at")&&e.deleted_at}))},id:function(){return this.$parent.$parent.selection.map((function(e){return e.id}))}},methods:{destroy:function(){this.$inertia.visit("".concat(this.url,"/batch-destroy"),{method:"DELETE",data:{id:this.id},only:["results","message"]})},restore:function(){this.$inertia.visit("".concat(this.url,"/batch-restore"),{method:"PATCH",data:{id:this.id},only:["results","message"]})}},render:function(e,t,n,r,i,a){var s=this,u=(0,o.up)("dropdown");return(0,o.wg)(),(0,o.j4)(u,{ref:"dropdown"},{default:(0,o.w5)((function(){return[(0,o.Wm)("h6",Pc,(0,l.zw)(e.__(":items selected",{items:s.id.length})),1),(0,o.Wm)("button",{type:"button",class:"dropdown-item",disabled:!a.deletable,onClick:t[1]||(t[1]=function(){return a.destroy&&a.destroy.apply(a,arguments)})},(0,l.zw)(e.__("Delete")),9,["disabled"]),(0,o.Wm)("button",{type:"button",class:"dropdown-item",disabled:!a.restorable,onClick:t[2]||(t[2]=function(){return a.restore&&a.restore.apply(a,arguments)})},(0,l.zw)(e.__("Restore")),9,["disabled"])]})),_:1},512)}},Wc={components:{Actions:Tc},watch:{indeterminate:function(e,t){this.$refs.input.indeterminate=e}},computed:{selected:function(){return this.$parent.selection.length>0&&this.$parent.selection.length===this.$parent.response.data.length},indeterminate:function(){return this.$parent.selection.length>0&&this.$parent.selection.lengthe.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?((0,o.wg)(),(0,o.j4)("table",ic,[(0,o.Wm)("thead",null,[(0,o.Wm)(u)]),(0,o.Wm)("tbody",null,[((0,o.wg)(!0),(0,o.j4)(o.HY,null,(0,o.Ko)(n.response.data,(function(e,t){return(0,o.wg)(),(0,o.j4)(c,{key:t,item:e},null,8,["item"])})),128))]),(0,o.Wm)("tfoot",null,[(0,o.Wm)(u)])])):((0,o.wg)(),(0,o.j4)("div",ac,(0,l.zw)(e.__("No results found.")),1))]),n.response.data.length>0?((0,o.wg)(),(0,o.j4)(d,{key:0})):(0,o.ry)("",!0),(0,o.Wm)("div",lc,[(0,o.WI)(e.$slots,"default")])])])}},Zc=Xc;const Qc={props:{label:{type:String,default:""},sort:{type:String,default:null}},mounted:function(){this.$parent.columns.push(this)},render:function(e,t,n,r,i,a){return(0,o.ry)("",!0)}},ed=Qc;function td(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{};this.dispatcher.addEventListener(e,t,n)}},{key:"removeEventListener",value:function(e,t){this.dispatcher.removeEventListener(e,t)}},{key:"dispatchEvent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.dispatcher.dispatchEvent(new CustomEvent(e,{detail:t}))}}])&&td(t.prototype,n),r&&td(t,r),e}();function rd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function od(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};return e.addEventListener(t,n,od({once:!0},r))},off:function(){return e.removeEventListener.apply(e,arguments)},emit:function(){return e.dispatchEvent.apply(e,arguments)}}}};a.I.init({delay:250,color:"#1382f9",includeCSS:!0});var ld=document.getElementById("app"),sd=(0,r.ri)({render:function(){return(0,o.h)(i.gV,{initialPage:JSON.parse(ld.dataset.page),resolveComponent:function(e){var t=window.Bazar.pages[e];if(!t)throw"Page is not registered.";return t instanceof Promise?t=t.then((function(e){return e.layout=K,e})):t.layout=K,t}})}});sd.use(i.BA),sd.use(ul),sd.use(fl),sd.use(gl,{translations:ul.translations}),sd.component("icon",bl),sd.component("dropdown",wl),sd.component("alert",Ol),sd.component("card",Tl),sd.component("modal",Dl),sd.component("media-manager",uu),sd.component("data-form",du),sd.component("data-form-input",tc),sd.component("data-table",Zc),sd.component("data-table-column",ed),sd.directive("debounce",(function(e,t){t.value!==t.oldValue&&(e.oninput=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300,n=null;return function(){clearTimeout(n);var r=arguments,o=this;n=setTimeout((function(){e.apply(o,r)}),t)}}((function(t){e.dispatchEvent(new Event("change"))}),parseInt(t.value)||300))})),sd.mixin(ad),document.addEventListener("bazar:boot",(function(){document.dispatchEvent(new CustomEvent("bazar:booting",{detail:sd})),sd.mount(ld),ld.removeAttribute("data-page"),document.dispatchEvent(new CustomEvent("bazar:booted",{detail:sd}))}))},9742:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,i=s(e),a=i[0],l=i[1],u=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,l)),c=0,d=l>0?a-4:a;for(n=0;n>16&255,u[c++]=t>>8&255,u[c++]=255&t;2===l&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,u[c++]=255&t);1===l&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],a=16383,l=0,s=r-o;ls?s:l+a));1===o?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return i.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=i.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,r){for(var o,i,a=[],l=t;l>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},8764:(e,t,n)=>{"use strict";var r=n(9742),o=n(645),i=n(5826);function a(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function l(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function h(e,t){if(s.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return q(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return C(this,t,n);case"latin1":case"binary":return j(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=s.from(t,r)),s.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,o);if("number"==typeof t)return t&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,o){var i,a=1,l=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,l/=2,s/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var c=-1;for(i=n;il&&(n=l-s),i=n;i>=0;i--){for(var d=!0,f=0;fo&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function S(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function E(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o239?4:u>223?3:u>191?2:1;if(o+d<=n)switch(d){case 1:u<128&&(c=u);break;case 2:128==(192&(i=e[o+1]))&&(s=(31&u)<<6|63&i)>127&&(c=s);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(s=(15&u)<<12|(63&i)<<6|63&a)>2047&&(s<55296||s>57343)&&(c=s);break;case 4:i=e[o+1],a=e[o+2],l=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&l)&&(s=(15&u)<<18|(63&i)<<12|(63&a)<<6|63&l)>65535&&s<1114112&&(c=s)}null===c?(c=65533,d=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),o+=d}return function(e){var t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},s.prototype.compare=function(e,t,n,r,o){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),l=Math.min(i,a),u=this.slice(r,o),c=e.slice(t,n),d=0;do)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return x(this,e,t,n);case"base64":return k(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function C(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;or)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,r,o,i){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function N(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o>>8*(r?o:1-o)}function V(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o>>8*(r?o:3-o)&255}function L(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function R(e,t,n,r,i){return i||L(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function I(e,t,n,r,i){return i||L(e,0,n,8),o.write(e,t,n,r,52,8),n+8}s.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(o*=256);)r+=this[e+--t]*o;return r},s.prototype.readUInt8=function(e,t){return t||W(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return t||W(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return t||W(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return t||W(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return t||W(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||W(e,t,this.length);for(var r=this[e],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*t)),r},s.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||W(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},s.prototype.readInt8=function(e,t){return t||W(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){t||W(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(e,t){t||W(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(e,t){return t||W(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return t||W(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return t||W(e,4,this.length),o.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return t||W(e,4,this.length),o.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return t||W(e,8,this.length),o.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return t||W(e,8,this.length),o.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||M(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+o]=e/i&255;return t+n},s.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,255,0),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):V(this,e,t,!0),t+4},s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):V(this,e,t,!1),t+4},s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);M(this,e,t,n,o-1,-o)}var i=0,a=1,l=0;for(this[t]=255&e;++i>0)-l&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);M(this,e,t,n,o-1,-o)}var i=n-1,a=1,l=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===l&&0!==this[t+i+1]&&(l=1),this[t+i]=(e/a>>0)-l&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,127,-128),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):V(this,e,t,!0),t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):V(this,e,t,!1),t+4},s.prototype.writeFloatLE=function(e,t,n){return R(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return R(this,e,t,!1,n)},s.prototype.writeDoubleLE=function(e,t,n){return I(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return I(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else if(i<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function z(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function F(e,t,n,r){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}},1924:(e,t,n)=>{"use strict";var r=n(210),o=n(5559),i=o(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&i(e,".prototype.")>-1?o(n):n}},5559:(e,t,n)=>{"use strict";var r=n(8612),o=n(210),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),l=o("%Reflect.apply%",!0)||r.call(a,i),s=o("%Object.getOwnPropertyDescriptor%",!0),u=o("%Object.defineProperty%",!0),c=o("%Math.max%");if(u)try{u({},"a",{value:1})}catch(e){u=null}e.exports=function(e){var t=l(r,a,arguments);if(s&&u){var n=s(t,"length");n.configurable&&u(t,"length",{value:1+c(0,e.length-(arguments.length-1))})}return t};var d=function(){return l(r,i,arguments)};u?u(e.exports,"apply",{value:d}):e.exports.apply=d},1807:e=>{var t=!("undefined"==typeof window||!window.document||!window.document.createElement);e.exports=t},7757:function(e,t,n){e.exports=function(e){"use strict";function t(e,t){return e(t={exports:{}},t.exports),t.exports}function n(e){return e&&e.default||e}e=e&&e.hasOwnProperty("default")?e.default:e;var r={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]},o=t((function(e){var t={};for(var n in r)r.hasOwnProperty(n)&&(t[r[n]]=n);var o=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 o)if(o.hasOwnProperty(i)){if(!("channels"in o[i]))throw new Error("missing channels property: "+i);if(!("labels"in o[i]))throw new Error("missing channel labels property: "+i);if(o[i].labels.length!==o[i].channels)throw new Error("channel and label counts mismatch: "+i);var a=o[i].channels,l=o[i].labels;delete o[i].channels,delete o[i].labels,Object.defineProperty(o[i],"channels",{value:a}),Object.defineProperty(o[i],"labels",{value:l})}function s(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}o.rgb.hsl=function(e){var t,n,r=e[0]/255,o=e[1]/255,i=e[2]/255,a=Math.min(r,o,i),l=Math.max(r,o,i),s=l-a;return l===a?t=0:r===l?t=(o-i)/s:o===l?t=2+(i-r)/s:i===l&&(t=4+(r-o)/s),(t=Math.min(60*t,360))<0&&(t+=360),n=(a+l)/2,[t,100*(l===a?0:n<=.5?s/(l+a):s/(2-l-a)),100*n]},o.rgb.hsv=function(e){var t,n,r,o,i,a=e[0]/255,l=e[1]/255,s=e[2]/255,u=Math.max(a,l,s),c=u-Math.min(a,l,s),d=function(e){return(u-e)/6/c+.5};return 0===c?o=i=0:(i=c/u,t=d(a),n=d(l),r=d(s),a===u?o=r-n:l===u?o=1/3+t-r:s===u&&(o=2/3+n-t),o<0?o+=1:o>1&&(o-=1)),[360*o,100*i,100*u]},o.rgb.hwb=function(e){var t=e[0],n=e[1],r=e[2];return[o.rgb.hsl(e)[0],1/255*Math.min(t,Math.min(n,r))*100,100*(r=1-1/255*Math.max(t,Math.max(n,r)))]},o.rgb.cmyk=function(e){var t,n=e[0]/255,r=e[1]/255,o=e[2]/255;return[100*((1-n-(t=Math.min(1-n,1-r,1-o)))/(1-t)||0),100*((1-r-t)/(1-t)||0),100*((1-o-t)/(1-t)||0),100*t]},o.rgb.keyword=function(e){var n=t[e];if(n)return n;var o,i=1/0;for(var a in r)if(r.hasOwnProperty(a)){var l=s(e,r[a]);l.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},o.rgb.lab=function(e){var t=o.rgb.xyz(e),n=t[0],r=t[1],i=t[2];return r/=100,i/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(n-r),200*(r-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},o.hsl.rgb=function(e){var t,n,r,o,i,a=e[0]/360,l=e[1]/100,s=e[2]/100;if(0===l)return[i=255*s,i,i];t=2*s-(n=s<.5?s*(1+l):s+l-s*l),o=[0,0,0];for(var u=0;u<3;u++)(r=a+1/3*-(u-1))<0&&r++,r>1&&r--,i=6*r<1?t+6*(n-t)*r:2*r<1?n:3*r<2?t+(n-t)*(2/3-r)*6:t,o[u]=255*i;return o},o.hsl.hsv=function(e){var t=e[0],n=e[1]/100,r=e[2]/100,o=n,i=Math.max(r,.01);return n*=(r*=2)<=1?r:2-r,o*=i<=1?i:2-i,[t,100*(0===r?2*o/(i+o):2*n/(r+n)),(r+n)/2*100]},o.hsv.rgb=function(e){var t=e[0]/60,n=e[1]/100,r=e[2]/100,o=Math.floor(t)%6,i=t-Math.floor(t),a=255*r*(1-n),l=255*r*(1-n*i),s=255*r*(1-n*(1-i));switch(r*=255,o){case 0:return[r,s,a];case 1:return[l,r,a];case 2:return[a,r,s];case 3:return[a,l,r];case 4:return[s,a,r];case 5:return[r,a,l]}},o.hsv.hsl=function(e){var t,n,r,o=e[0],i=e[1]/100,a=e[2]/100,l=Math.max(a,.01);return r=(2-i)*a,n=i*l,[o,100*(n=(n/=(t=(2-i)*l)<=1?t:2-t)||0),100*(r/=2)]},o.hwb.rgb=function(e){var t,n,r,o,i,a,l,s=e[0]/360,u=e[1]/100,c=e[2]/100,d=u+c;switch(d>1&&(u/=d,c/=d),r=6*s-(t=Math.floor(6*s)),0!=(1&t)&&(r=1-r),o=u+r*((n=1-c)-u),t){default:case 6:case 0:i=n,a=o,l=u;break;case 1:i=o,a=n,l=u;break;case 2:i=u,a=n,l=o;break;case 3:i=u,a=o,l=n;break;case 4:i=o,a=u,l=n;break;case 5:i=n,a=u,l=o}return[255*i,255*a,255*l]},o.cmyk.rgb=function(e){var t=e[0]/100,n=e[1]/100,r=e[2]/100,o=e[3]/100;return[255*(1-Math.min(1,t*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o)),255*(1-Math.min(1,r*(1-o)+o))]},o.xyz.rgb=function(e){var t,n,r,o=e[0]/100,i=e[1]/100,a=e[2]/100;return n=-.9689*o+1.8758*i+.0415*a,r=.0557*o+-.204*i+1.057*a,t=(t=3.2406*o+-1.5372*i+-.4986*a)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,[255*(t=Math.min(Math.max(0,t),1)),255*(n=Math.min(Math.max(0,n),1)),255*(r=Math.min(Math.max(0,r),1))]},o.xyz.lab=function(e){var t=e[0],n=e[1],r=e[2];return n/=100,r/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(t-n),200*(n-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},o.lab.xyz=function(e){var t,n,r,o=e[0];t=e[1]/500+(n=(o+16)/116),r=n-e[2]/200;var i=Math.pow(n,3),a=Math.pow(t,3),l=Math.pow(r,3);return n=i>.008856?i:(n-16/116)/7.787,t=a>.008856?a:(t-16/116)/7.787,r=l>.008856?l:(r-16/116)/7.787,[t*=95.047,n*=100,r*=108.883]},o.lab.lch=function(e){var t,n=e[0],r=e[1],o=e[2];return(t=360*Math.atan2(o,r)/2/Math.PI)<0&&(t+=360),[n,Math.sqrt(r*r+o*o),t]},o.lch.lab=function(e){var t,n=e[0],r=e[1];return t=e[2]/360*2*Math.PI,[n,r*Math.cos(t),r*Math.sin(t)]},o.rgb.ansi16=function(e){var t=e[0],n=e[1],r=e[2],i=1 in arguments?arguments[1]:o.rgb.hsv(e)[2];if(0===(i=Math.round(i/50)))return 30;var a=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return 2===i&&(a+=60),a},o.hsv.ansi16=function(e){return o.rgb.ansi16(o.hsv.rgb(e),e[2])},o.rgb.ansi256=function(e){var t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},o.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},o.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var n;return e-=16,[Math.floor(e/36)/5*255,Math.floor((n=e%36)/6)/5*255,n%6/5*255]},o.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},o.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var n=t[0];3===t[0].length&&(n=n.split("").map((function(e){return e+e})).join(""));var r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},o.rgb.hcg=function(e){var t,n=e[0]/255,r=e[1]/255,o=e[2]/255,i=Math.max(Math.max(n,r),o),a=Math.min(Math.min(n,r),o),l=i-a;return t=l<=0?0:i===n?(r-o)/l%6:i===r?2+(o-n)/l:4+(n-r)/l+4,t/=6,[360*(t%=1),100*l,100*(l<1?a/(1-l):0)]},o.hsl.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=1,o=0;return(r=n<.5?2*t*n:2*t*(1-n))<1&&(o=(n-.5*r)/(1-r)),[e[0],100*r,100*o]},o.hsv.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=t*n,o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],100*r,100*o]},o.hcg.rgb=function(e){var t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];var o=[0,0,0],i=t%1*6,a=i%1,l=1-a,s=0;switch(Math.floor(i)){case 0:o[0]=1,o[1]=a,o[2]=0;break;case 1:o[0]=l,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=a;break;case 3:o[0]=0,o[1]=l,o[2]=1;break;case 4:o[0]=a,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=l}return s=(1-n)*r,[255*(n*o[0]+s),255*(n*o[1]+s),255*(n*o[2]+s)]},o.hcg.hsv=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t),r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},o.hcg.hsl=function(e){var t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},o.hcg.hwb=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},o.hwb.hcg=function(e){var t=e[1]/100,n=1-e[2]/100,r=n-t,o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],100*r,100*o]},o.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},o.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},o.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},o.gray.hsl=o.gray.hsv=function(e){return[0,0,e[0]]},o.gray.hwb=function(e){return[0,100,e[0]]},o.gray.cmyk=function(e){return[0,0,0,e[0]]},o.gray.lab=function(e){return[e[0],0,0]},o.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},o.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}}));function i(){for(var e={},t=Object.keys(o),n=t.length,r=0;r1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}function f(e){var t=function(t){if(null==t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=e(t);if("object"==typeof n)for(var r=n.length,o=0;o=0&&t<1?W(Math.round(255*t)):"")}function k(e,t){return t<1||e[3]&&e[3]<1?O(e,t):"rgb("+e[0]+", "+e[1]+", "+e[2]+")"}function O(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+t+")"}function S(e,t){return t<1||e[3]&&e[3]<1?E(e,t):"rgb("+Math.round(e[0]/255*100)+"%, "+Math.round(e[1]/255*100)+"%, "+Math.round(e[2]/255*100)+"%)"}function E(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 A(e,t){return t<1||e[3]&&e[3]<1?C(e,t):"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)"}function C(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+t+")"}function j(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:"")+")"}function P(e){return M[e.slice(0,3)]}function T(e,t,n){return Math.min(Math.max(t,e),n)}function W(e){var t=e.toString(16).toUpperCase();return t.length<2?"0"+t:t}var M={};for(var N in h)M[h[N]]=N;var V=function(e){return e instanceof V?e:this instanceof V?(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=m.getRgba(e))?this.setValues("rgb",t):(t=m.getHsla(e))?this.setValues("hsl",t):(t=m.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 V(e);var t};V.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 m.hexString(this.values.rgb)},rgbString:function(){return m.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return m.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return m.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return m.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return m.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return m.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return m.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var e=this.values.rgb;return e[0]<<16|e[1]<<8|e[2]},luminosity:function(){for(var e=this.values.rgb,t=[],n=0;nn?(t+.05)/(n+.05):(n+.05)/(t+.05)},level:function(e){var t=this.contrast(e);return t>=7.1?"AAA":t>=4.5?"AA":""},dark:function(){var e=this.values.rgb;return(299*e[0]+587*e[1]+114*e[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var e=[],t=0;t<3;t++)e[t]=255-this.values.rgb[t];return this.setValues("rgb",e),this},lighten:function(e){var t=this.values.hsl;return t[2]+=t[2]*e,this.setValues("hsl",t),this},darken:function(e){var t=this.values.hsl;return t[2]-=t[2]*e,this.setValues("hsl",t),this},saturate:function(e){var t=this.values.hsl;return t[1]+=t[1]*e,this.setValues("hsl",t),this},desaturate:function(e){var t=this.values.hsl;return t[1]-=t[1]*e,this.setValues("hsl",t),this},whiten:function(e){var t=this.values.hwb;return t[1]+=t[1]*e,this.setValues("hwb",t),this},blacken:function(e){var t=this.values.hwb;return t[2]+=t[2]*e,this.setValues("hwb",t),this},greyscale:function(){var e=this.values.rgb,t=.3*e[0]+.59*e[1]+.11*e[2];return this.setValues("rgb",[t,t,t]),this},clearer:function(e){var t=this.values.alpha;return this.setValues("alpha",t-t*e),this},opaquer:function(e){var t=this.values.alpha;return this.setValues("alpha",t+t*e),this},rotate:function(e){var t=this.values.hsl,n=(t[0]+e)%360;return t[0]=n<0?360+n:n,this.setValues("hsl",t),this},mix:function(e,t){var n=this,r=e,o=void 0===t?.5:t,i=2*o-1,a=n.alpha()-r.alpha(),l=((i*a==-1?i:(i+a)/(1+i*a))+1)/2,s=1-l;return this.rgb(l*n.red()+s*r.red(),l*n.green()+s*r.green(),l*n.blue()+s*r.blue()).alpha(n.alpha()*o+r.alpha()*(1-o))},toJSON:function(){return this.rgb()},clone:function(){var e,t,n=new V,r=this.values,o=n.values;for(var i in r)r.hasOwnProperty(i)&&(e=r[i],"[object Array]"===(t={}.toString.call(e))?o[i]=e.slice(0):"[object Number]"===t?o[i]=e:console.error("unexpected color value:",e));return n}},V.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},V.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},V.prototype.getValues=function(e){for(var t=this.values,n={},r=0;r=0;o--)t.call(n,e[o],o);else for(o=0;o=1?e:-(Math.sqrt(1-e*e)-1)},easeOutCirc:function(e){return Math.sqrt(1-(e-=1)*e)},easeInOutCirc:function(e){return(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},easeInElastic:function(e){var t=1.70158,n=0,r=1;return 0===e?0:1===e?1:(n||(n=.3),r<1?(r=1,t=n/4):t=n/(2*Math.PI)*Math.asin(1/r),-r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n))},easeOutElastic:function(e){var t=1.70158,n=0,r=1;return 0===e?0:1===e?1:(n||(n=.3),r<1?(r=1,t=n/4):t=n/(2*Math.PI)*Math.asin(1/r),r*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/n)+1)},easeInOutElastic:function(e){var t=1.70158,n=0,r=1;return 0===e?0:2==(e/=.5)?1:(n||(n=.45),r<1?(r=1,t=n/4):t=n/(2*Math.PI)*Math.asin(1/r),e<1?r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*-.5:r*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*.5+1)},easeInBack:function(e){var t=1.70158;return e*e*((t+1)*e-t)},easeOutBack:function(e){var t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},easeInOutBack:function(e){var t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},easeInBounce:function(e){return 1-q.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*q.easeInBounce(2*e):.5*q.easeOutBounce(2*e-1)+.5}},z={effects:q};D.easingEffects=q;var F=Math.PI,B=F/180,$=2*F,H=F/2,Y=F/4,K=2*F/3,G={clear:function(e){e.ctx.clearRect(0,0,e.width,e.height)},roundedRect:function(e,t,n,r,o,i){if(i){var a=Math.min(i,o/2,r/2),l=t+a,s=n+a,u=t+r-a,c=n+o-a;e.moveTo(t,s),lt.left-n&&e.xt.top-n&&e.y0&&e.requestAnimationFrame()},advance:function(){for(var e,t,n,r,o=this.animations,i=0;i=n?(ae.callback(e.onAnimationComplete,[e],t),t.animating=!1,o.splice(i,1)):++i}},ve=ae.options.resolve,be=["push","pop","shift","splice","unshift"];function _e(e,t){e._chartjs?e._chartjs.listeners.push(t):(Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),be.forEach((function(t){var n="onData"+t.charAt(0).toUpperCase()+t.slice(1),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:function(){var t=Array.prototype.slice.call(arguments),o=r.apply(this,t);return ae.each(e._chartjs.listeners,(function(e){"function"==typeof e[n]&&e[n].apply(e,t)})),o}})})))}function we(e,t){var n=e._chartjs;if(n){var r=n.listeners,o=r.indexOf(t);-1!==o&&r.splice(o,1),r.length>0||(be.forEach((function(t){delete e[t]})),delete e._chartjs)}}var xe=function(e,t){this.initialize(e,t)};ae.extend(xe.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(e,t){var n=this;n.chart=e,n.index=t,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(e){this.index=e},linkScales:function(){var e=this,t=e.getMeta(),n=e.chart,r=n.scales,o=e.getDataset(),i=n.options.scales;null!==t.xAxisID&&t.xAxisID in r&&!o.xAxisID||(t.xAxisID=o.xAxisID||i.xAxes[0].id),null!==t.yAxisID&&t.yAxisID in r&&!o.yAxisID||(t.yAxisID=o.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&&we(this._data,this)},createMetaDataset:function(){var e=this,t=e.datasetElementType;return t&&new t({_chart:e.chart,_datasetIndex:e.index})},createMetaData:function(e){var t=this,n=t.dataElementType;return n&&new n({_chart:t.chart,_datasetIndex:t.index,_index:e})},addElements:function(){var e,t,n=this,r=n.getMeta(),o=n.getDataset().data||[],i=r.data;for(e=0,t=o.length;er&&e.insertElements(r,o-r)},insertElements:function(e,t){for(var n=0;no?(i=o/t.innerRadius,e.arc(a,l,t.innerRadius-o,r+i,n-i,!0)):e.arc(a,l,o,r+Math.PI/2,n-Math.PI/2),e.closePath(),e.clip()}function Ee(e,t,n,r){var o,i=n.endAngle;for(r&&(n.endAngle=n.startAngle+Oe,Se(e,n),n.endAngle=i,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=Oe,n.fullCircles--)),e.beginPath(),e.arc(n.x,n.y,n.innerRadius,n.startAngle+Oe,n.startAngle,!0),o=0;ol;)o-=Oe;for(;o=a&&o<=l,u=i>=n.innerRadius&&i<=n.outerRadius;return s&&u}return!1},getCenterPoint:function(){var e=this._view,t=(e.startAngle+e.endAngle)/2,n=(e.innerRadius+e.outerRadius)/2;return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}},getArea:function(){var e=this._view;return Math.PI*((e.endAngle-e.startAngle)/(2*Math.PI))*(Math.pow(e.outerRadius,2)-Math.pow(e.innerRadius,2))},tooltipPosition:function(){var e=this._view,t=e.startAngle+(e.endAngle-e.startAngle)/2,n=(e.outerRadius-e.innerRadius)/2+e.innerRadius;return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}},draw:function(){var e,t=this._chart.ctx,n=this._view,r="inner"===n.borderAlign?.33:0,o={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-r,0),pixelMargin:r,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/Oe)};if(t.save(),t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,o.fullCircles){for(o.endAngle=o.startAngle+Oe,t.beginPath(),t.arc(o.x,o.y,o.outerRadius,o.startAngle,o.endAngle),t.arc(o.x,o.y,o.innerRadius,o.endAngle,o.startAngle,!0),t.closePath(),e=0;ee.x&&(t=De(t,"left","right")):e.basen?n:r,r:s.right||o<0?0:o>t?t:o,b:s.bottom||i<0?0:i>n?n:i,l:s.left||a<0?0:a>t?t:a}}function Fe(e){var t=Ue(e),n=t.right-t.left,r=t.bottom-t.top,o=ze(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r},inner:{x:t.left+o.l,y:t.top+o.t,w:n-o.l-o.r,h:r-o.t-o.b}}}function Be(e,t,n){var r=null===t,o=null===n,i=!(!e||r&&o)&&Ue(e);return i&&(r||t>=i.left&&t<=i.right)&&(o||n>=i.top&&n<=i.bottom)}Z._set("global",{elements:{rectangle:{backgroundColor:Re,borderColor:Re,borderSkipped:"bottom",borderWidth:0}}});var $e=he.extend({_type:"rectangle",draw:function(){var e=this._chart.ctx,t=this._view,n=Fe(t),r=n.outer,o=n.inner;e.fillStyle=t.backgroundColor,e.fillRect(r.x,r.y,r.w,r.h),r.w===o.w&&r.h===o.h||(e.save(),e.beginPath(),e.rect(r.x,r.y,r.w,r.h),e.clip(),e.fillStyle=t.borderColor,e.rect(o.x,o.y,o.w,o.h),e.fill("evenodd"),e.restore())},height:function(){var e=this._view;return e.base-e.y},inRange:function(e,t){return Be(this._view,e,t)},inLabelRange:function(e,t){var n=this._view;return Ie(n)?Be(n,e,null):Be(n,null,t)},inXRange:function(e){return Be(this._view,e,null)},inYRange:function(e){return Be(this._view,null,e)},getCenterPoint:function(){var e,t,n=this._view;return Ie(n)?(e=n.x,t=(n.y+n.base)/2):(e=(n.x+n.base)/2,t=n.y),{x:e,y:t}},getArea:function(){var e=this._view;return Ie(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}}}),He={},Ye=Ce,Ke=Te,Ge=Le,Je=$e;He.Arc=Ye,He.Line=Ke,He.Point=Ge,He.Rectangle=Je;var Xe=ae._deprecated,Ze=ae.valueOrDefault;function Qe(e,t){var n,r,o,i,a=e._length;for(o=1,i=t.length;o0?Math.min(a,Math.abs(r-n)):a,n=r;return a}function et(e,t,n){var r,o,i=n.barThickness,a=t.stackCount,l=t.pixels[e],s=ae.isNullOrUndef(i)?Qe(t.scale,t.pixels):-1;return ae.isNullOrUndef(i)?(r=s*n.categoryPercentage,o=n.barPercentage):(r=i*a,o=1),{chunk:r/a,ratio:o,start:l-r/2}}function tt(e,t,n){var r,o=t.pixels,i=o[e],a=e>0?o[e-1]:null,l=e=0&&g.min>=0?g.min:g.max,w=void 0===g.start?g.end:g.max>=0&&g.min>=0?g.max-g.min:g.min-g.max,x=m.length;if(v||void 0===v&&void 0!==b)for(r=0;r=0&&u.max>=0?u.max:u.min,(g.min<0&&i<0||g.max>=0&&i>0)&&(_+=i));return a=f.getPixelForValue(_),s=(l=f.getPixelForValue(_+w))-a,void 0!==y&&Math.abs(s)=0&&!p||w<0&&p?a-y:a+y),{size:s,base:a,head:l,center:l+s/2}},calculateBarIndexPixels:function(e,t,n,r){var o=this,i="flex"===r.barThickness?tt(t,n,r):et(t,n,r),a=o.getStackIndex(e,o.getMeta().stack),l=i.start+i.chunk*a+i.chunk/2,s=Math.min(Ze(r.maxBarThickness,1/0),i.chunk*i.ratio);return{base:l-s/2,head:l+s/2,center:l,size:s}},draw:function(){var e=this,t=e.chart,n=e._getValueScale(),r=e.getMeta().data,o=e.getDataset(),i=r.length,a=0;for(ae.canvas.clipArea(t.ctx,t.chartArea);a=lt?-st:v<-lt?st:0)+g,_=Math.cos(v),w=Math.sin(v),x=Math.cos(b),k=Math.sin(b),O=v<=0&&b>=0||b>=st,S=v<=ut&&b>=ut||b>=st+ut,E=v<=-ut&&b>=-ut||b>=lt+ut,A=v===-lt||b>=lt?-1:Math.min(_,_*m,x,x*m),C=E?-1:Math.min(w,w*m,k,k*m),j=O?1:Math.max(_,_*m,x,x*m),P=S?1:Math.max(w,w*m,k,k*m);u=(j-A)/2,c=(P-C)/2,d=-(j+A)/2,f=-(P+C)/2}for(r=0,o=h.length;r0&&!isNaN(e)?st*(Math.abs(e)/t):0},getMaxBorderWidth:function(e){var t,n,r,o,i,a,l,s,u=this,c=0,d=u.chart;if(!e)for(t=0,n=d.data.datasets.length;t(c=l>c?l:c)?s:c);return c},setHoverStyle:function(e){var t=e._model,n=e._options,r=ae.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth},t.backgroundColor=at(n.hoverBackgroundColor,r(n.backgroundColor)),t.borderColor=at(n.hoverBorderColor,r(n.borderColor)),t.borderWidth=at(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(e){for(var t=0,n=0;n0&&ht(u[e-1]._model,s)&&(n.controlPointPreviousX=c(n.controlPointPreviousX,s.left,s.right),n.controlPointPreviousY=c(n.controlPointPreviousY,s.top,s.bottom)),e0&&(i=e.getDatasetMeta(i[0]._datasetIndex).data),i},"x-axis":function(e,t){return Pt(e,t,{intersect:!1})},point:function(e,t){return At(e,St(t,e))},nearest:function(e,t,n){var r=St(t,e);n.axis=n.axis||"xy";var o=jt(n.axis);return Ct(e,r,n.intersect,o)},x:function(e,t,n){var r=St(t,e),o=[],i=!1;return Et(e,(function(e){e.inXRange(r.x)&&o.push(e),e.inRange(r.x,r.y)&&(i=!0)})),n.intersect&&!i&&(o=[]),o},y:function(e,t,n){var r=St(t,e),o=[],i=!1;return Et(e,(function(e){e.inYRange(r.y)&&o.push(e),e.inRange(r.x,r.y)&&(i=!0)})),n.intersect&&!i&&(o=[]),o}}},Wt=ae.extend;function Mt(e,t){return ae.where(e,(function(e){return e.pos===t}))}function Nt(e,t){return e.sort((function(e,n){var r=t?n:e,o=t?e:n;return r.weight===o.weight?r.index-o.index:r.weight-o.weight}))}function Vt(e){var t,n,r,o=[];for(t=0,n=(e||[]).length;t 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",Yt=n(Object.freeze({__proto__:null,default:Ht})),Kt="$chartjs",Gt="chartjs-",Jt=Gt+"size-monitor",Xt=Gt+"render-monitor",Zt=Gt+"render-animation",Qt=["animationstart","webkitAnimationStart"],en={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function tn(e,t){var n=ae.getStyle(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?Number(r[1]):void 0}function nn(e,t){var n=e.style,r=e.getAttribute("height"),o=e.getAttribute("width");if(e[Kt]={initial:{height:r,width:o,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===o||""===o){var i=tn(e,"width");void 0!==i&&(e.width=i)}if(null===r||""===r)if(""===e.style.height)e.height=e.width/(t.options.aspectRatio||2);else{var a=tn(e,"height");void 0!==i&&(e.height=a)}return e}var rn=!!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 on(e,t,n){e.addEventListener(t,n,rn)}function an(e,t,n){e.removeEventListener(t,n,rn)}function ln(e,t,n,r,o){return{type:e,chart:t,native:o||null,x:void 0!==n?n:null,y:void 0!==r?r:null}}function sn(e,t){var n=en[e.type]||e.type,r=ae.getRelativePosition(e,t);return ln(n,t,r.x,r.y,e)}function un(e,t){var n=!1,r=[];return function(){r=Array.prototype.slice.call(arguments),t=t||this,n||(n=!0,ae.requestAnimFrame.call(window,(function(){n=!1,e.apply(t,r)})))}}function cn(e){var t=document.createElement("div");return t.className=e||"",t}function dn(e){var t=1e6,n=cn(Jt),r=cn(Jt+"-expand"),o=cn(Jt+"-shrink");r.appendChild(cn()),o.appendChild(cn()),n.appendChild(r),n.appendChild(o),n._reset=function(){r.scrollLeft=t,r.scrollTop=t,o.scrollLeft=t,o.scrollTop=t};var i=function(){n._reset(),e()};return on(r,"scroll",i.bind(r,"expand")),on(o,"scroll",i.bind(o,"shrink")),n}function fn(e,t){var n=e[Kt]||(e[Kt]={}),r=n.renderProxy=function(e){e.animationName===Zt&&t()};ae.each(Qt,(function(t){on(e,t,r)})),n.reflow=!!e.offsetParent,e.classList.add(Xt)}function pn(e){var t=e[Kt]||{},n=t.renderProxy;n&&(ae.each(Qt,(function(t){an(e,t,n)})),delete t.renderProxy),e.classList.remove(Xt)}function hn(e,t,n){var r=e[Kt]||(e[Kt]={}),o=r.resizer=dn(un((function(){if(r.resizer){var o=n.options.maintainAspectRatio&&e.parentNode,i=o?o.clientWidth:0;t(ln("resize",n)),o&&o.clientWidth0){var i=e[0];i.label?n=i.label:i.xLabel?n=i.xLabel:o>0&&i.index-1?e.split("\n"):e}function An(e){var t=e._xScale,n=e._yScale||e._scale,r=e._index,o=e._datasetIndex,i=e._chart.getDatasetMeta(o).controller,a=i._getIndexScale(),l=i._getValueScale();return{xLabel:t?t.getLabelForIndex(r,o):"",yLabel:n?n.getLabelForIndex(r,o):"",label:a?""+a.getLabelForIndex(r,o):"",value:l?""+l.getLabelForIndex(r,o):"",index:r,datasetIndex:o,x:e._model.x,y:e._model.y}}function Cn(e){var t=Z.global;return{xPadding:e.xPadding,yPadding:e.yPadding,xAlign:e.xAlign,yAlign:e.yAlign,rtl:e.rtl,textDirection:e.textDirection,bodyFontColor:e.bodyFontColor,_bodyFontFamily:xn(e.bodyFontFamily,t.defaultFontFamily),_bodyFontStyle:xn(e.bodyFontStyle,t.defaultFontStyle),_bodyAlign:e.bodyAlign,bodyFontSize:xn(e.bodyFontSize,t.defaultFontSize),bodySpacing:e.bodySpacing,titleFontColor:e.titleFontColor,_titleFontFamily:xn(e.titleFontFamily,t.defaultFontFamily),_titleFontStyle:xn(e.titleFontStyle,t.defaultFontStyle),titleFontSize:xn(e.titleFontSize,t.defaultFontSize),_titleAlign:e.titleAlign,titleSpacing:e.titleSpacing,titleMarginBottom:e.titleMarginBottom,footerFontColor:e.footerFontColor,_footerFontFamily:xn(e.footerFontFamily,t.defaultFontFamily),_footerFontStyle:xn(e.footerFontStyle,t.defaultFontStyle),footerFontSize:xn(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 jn(e,t){var n=e._chart.ctx,r=2*t.yPadding,o=0,i=t.body,a=i.reduce((function(e,t){return e+t.before.length+t.lines.length+t.after.length}),0);a+=t.beforeBody.length+t.afterBody.length;var l=t.title.length,s=t.footer.length,u=t.titleFontSize,c=t.bodyFontSize,d=t.footerFontSize;r+=l*u,r+=l?(l-1)*t.titleSpacing:0,r+=l?t.titleMarginBottom:0,r+=a*c,r+=a?(a-1)*t.bodySpacing:0,r+=s?t.footerMarginTop:0,r+=s*d,r+=s?(s-1)*t.footerSpacing:0;var f=0,p=function(e){o=Math.max(o,n.measureText(e).width+f)};return n.font=ae.fontString(u,t._titleFontStyle,t._titleFontFamily),ae.each(t.title,p),n.font=ae.fontString(c,t._bodyFontStyle,t._bodyFontFamily),ae.each(t.beforeBody.concat(t.afterBody),p),f=t.displayColors?c+2:0,ae.each(i,(function(e){ae.each(e.before,p),ae.each(e.lines,p),ae.each(e.after,p)})),f=0,n.font=ae.fontString(d,t._footerFontStyle,t._footerFontFamily),ae.each(t.footer,p),{width:o+=2*t.xPadding,height:r}}function Pn(e,t){var n,r,o,i,a,l=e._model,s=e._chart,u=e._chart.chartArea,c="center",d="center";l.ys.height-t.height&&(d="bottom");var f=(u.left+u.right)/2,p=(u.top+u.bottom)/2;"center"===d?(n=function(e){return e<=f},r=function(e){return e>f}):(n=function(e){return e<=t.width/2},r=function(e){return e>=s.width-t.width/2}),o=function(e){return e+t.width+l.caretSize+l.caretPadding>s.width},i=function(e){return e-t.width-l.caretSize-l.caretPadding<0},a=function(e){return e<=p?"top":"bottom"},n(l.x)?(c="left",o(l.x)&&(c="center",d=a(l.y))):r(l.x)&&(c="right",i(l.x)&&(c="center",d=a(l.y)));var h=e._options;return{xAlign:h.xAlign?h.xAlign:c,yAlign:h.yAlign?h.yAlign:d}}function Tn(e,t,n,r){var o=e.x,i=e.y,a=e.caretSize,l=e.caretPadding,s=e.cornerRadius,u=n.xAlign,c=n.yAlign,d=a+l,f=s+l;return"right"===u?o-=t.width:"center"===u&&((o-=t.width/2)+t.width>r.width&&(o=r.width-t.width),o<0&&(o=0)),"top"===c?i+=d:i-="bottom"===c?t.height+d:t.height/2,"center"===c?"left"===u?o+=d:"right"===u&&(o-=d):"left"===u?o-=f:"right"===u&&(o+=f),{x:o,y:i}}function Wn(e,t){return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-e.xPadding:e.x+e.xPadding}function Mn(e){return Sn([],En(e))}var Nn=he.extend({initialize:function(){this._model=Cn(this._options),this._lastActive=[]},getTitle:function(){var e=this,t=e._options.callbacks,n=t.beforeTitle.apply(e,arguments),r=t.title.apply(e,arguments),o=t.afterTitle.apply(e,arguments),i=[];return i=Sn(i,En(n)),i=Sn(i,En(r)),i=Sn(i,En(o))},getBeforeBody:function(){return Mn(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(e,t){var n=this,r=n._options.callbacks,o=[];return ae.each(e,(function(e){var i={before:[],lines:[],after:[]};Sn(i.before,En(r.beforeLabel.call(n,e,t))),Sn(i.lines,r.label.call(n,e,t)),Sn(i.after,En(r.afterLabel.call(n,e,t))),o.push(i)})),o},getAfterBody:function(){return Mn(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var e=this,t=e._options.callbacks,n=t.beforeFooter.apply(e,arguments),r=t.footer.apply(e,arguments),o=t.afterFooter.apply(e,arguments),i=[];return i=Sn(i,En(n)),i=Sn(i,En(r)),i=Sn(i,En(o))},update:function(e){var t,n,r=this,o=r._options,i=r._model,a=r._model=Cn(o),l=r._active,s=r._data,u={xAlign:i.xAlign,yAlign:i.yAlign},c={x:i.x,y:i.y},d={width:i.width,height:i.height},f={x:i.caretX,y:i.caretY};if(l.length){a.opacity=1;var p=[],h=[];f=On[o.position].call(r,l,r._eventPosition);var m=[];for(t=0,n=l.length;t0&&n.stroke()},draw:function(){var e=this._chart.ctx,t=this._view;if(0!==t.opacity){var n={width:t.width,height:t.height},r={x:t.x,y:t.y},o=Math.abs(t.opacity<.001)?0:t.opacity,i=t.title.length||t.beforeBody.length||t.body.length||t.afterBody.length||t.footer.length;this._options.enabled&&i&&(e.save(),e.globalAlpha=o,this.drawBackground(r,t,e,n),r.y+=t.yPadding,ae.rtl.overrideTextDirection(e,t.textDirection),this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),ae.rtl.restoreTextDirection(e,t.textDirection),e.restore())}},handleEvent:function(e){var t=this,n=t._options,r=!1;return t._lastActive=t._lastActive||[],"mouseout"===e.type?t._active=[]:(t._active=t._chart.getElementsAtEventForMode(e,n.mode,n),n.reverse&&t._active.reverse()),(r=!ae.arrayEquals(t._active,t._lastActive))&&(t._lastActive=t._active,(n.enabled||n.custom)&&(t._eventPosition={x:e.x,y:e.y},t.update(!0),t.pivot())),r}}),Vn=On,Ln=Nn;Ln.positioners=Vn;var Rn=ae.valueOrDefault;function In(){return ae.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,n,r){if("xAxes"===e||"yAxes"===e){var o,i,a,l=n[e].length;for(t[e]||(t[e]=[]),o=0;o=t[e].length&&t[e].push({}),!t[e][o].type||a.type&&a.type!==t[e][o].type?ae.merge(t[e][o],[wn.getScaleDefaults(i),a]):ae.merge(t[e][o],a)}else ae._merger(e,t,n,r)}})}function Un(){return ae.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,n,r){var o=t[e]||Object.create(null),i=n[e];"scales"===e?t[e]=In(o,i):"scale"===e?t[e]=ae.merge(o,[wn.getScaleDefaults(i.type),i]):ae._merger(e,t,n,r)}})}function Dn(e){var t=(e=e||Object.create(null)).data=e.data||{};return t.datasets=t.datasets||[],t.labels=t.labels||[],e.options=Un(Z.global,Z[e.type],e.options||{}),e}function qn(e){var t=e.options;ae.each(e.scales,(function(t){Bt.removeBox(e,t)})),t=Un(Z.global,Z[e.config.type],t),e.options=e.config.options=t,e.ensureScalesHaveIDs(),e.buildOrUpdateScales(),e.tooltip._options=t.tooltips,e.tooltip.initialize()}function zn(e,t,n){var r,o=function(e){return e.id===r};do{r=t+n++}while(ae.findIndex(e,o)>=0);return r}function Fn(e){return"top"===e||"bottom"===e}function Bn(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}Z._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 $n=function(e,t){return this.construct(e,t),this};ae.extend($n.prototype,{construct:function(e,t){var n=this;t=Dn(t);var r=bn.acquireContext(e,t),o=r&&r.canvas,i=o&&o.height,a=o&&o.width;n.id=ae.uid(),n.ctx=r,n.canvas=o,n.config=t,n.width=a,n.height=i,n.aspectRatio=i?a/i:null,n.options=t.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,$n.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(e){n.config.data=e}}),r&&o?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var e=this;return _n.notify(e,"beforeInit"),ae.retinaScale(e,e.options.devicePixelRatio),e.bindEvents(),e.options.responsive&&e.resize(!0),e.initToolTip(),_n.notify(e,"afterInit"),e},clear:function(){return ae.canvas.clear(this),this},stop:function(){return ye.cancelAnimation(this),this},resize:function(e){var t=this,n=t.options,r=t.canvas,o=n.maintainAspectRatio&&t.aspectRatio||null,i=Math.max(0,Math.floor(ae.getMaximumWidth(r))),a=Math.max(0,Math.floor(o?i/o:ae.getMaximumHeight(r)));if((t.width!==i||t.height!==a)&&(r.width=t.width=i,r.height=t.height=a,r.style.width=i+"px",r.style.height=a+"px",ae.retinaScale(t,n.devicePixelRatio),!e)){var l={width:i,height:a};_n.notify(t,"resize",[l]),n.onResize&&n.onResize(t,l),t.stop(),t.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var e=this.options,t=e.scales||{},n=e.scale;ae.each(t.xAxes,(function(e,n){e.id||(e.id=zn(t.xAxes,"x-axis-",n))})),ae.each(t.yAxes,(function(e,n){e.id||(e.id=zn(t.yAxes,"y-axis-",n))})),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var e=this,t=e.options,n=e.scales||{},r=[],o=Object.keys(n).reduce((function(e,t){return e[t]=!1,e}),{});t.scales&&(r=r.concat((t.scales.xAxes||[]).map((function(e){return{options:e,dtype:"category",dposition:"bottom"}})),(t.scales.yAxes||[]).map((function(e){return{options:e,dtype:"linear",dposition:"left"}})))),t.scale&&r.push({options:t.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),ae.each(r,(function(t){var r=t.options,i=r.id,a=Rn(r.type,t.dtype);Fn(r.position)!==Fn(t.dposition)&&(r.position=t.dposition),o[i]=!0;var l=null;if(i in n&&n[i].type===a)(l=n[i]).options=r,l.ctx=e.ctx,l.chart=e;else{var s=wn.getScaleConstructor(a);if(!s)return;l=new s({id:i,type:a,options:r,ctx:e.ctx,chart:e}),n[l.id]=l}l.mergeTicksOptions(),t.isDefault&&(e.scale=l)})),ae.each(o,(function(e,t){e||delete n[t]})),e.scales=n,wn.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e,t,n=this,r=[],o=n.data.datasets;for(e=0,t=o.length;e=0;--n)r.drawDataset(t[n],e);_n.notify(r,"afterDatasetsDraw",[e])}},drawDataset:function(e,t){var n=this,r={meta:e,index:e.index,easingValue:t};!1!==_n.notify(n,"beforeDatasetDraw",[r])&&(e.controller.draw(t),_n.notify(n,"afterDatasetDraw",[r]))},_drawTooltip:function(e){var t=this,n=t.tooltip,r={tooltip:n,easingValue:e};!1!==_n.notify(t,"beforeTooltipDraw",[r])&&(n.draw(),_n.notify(t,"afterTooltipDraw",[r]))},getElementAtEvent:function(e){return Tt.modes.single(this,e)},getElementsAtEvent:function(e){return Tt.modes.label(this,e,{intersect:!0})},getElementsAtXAxis:function(e){return Tt.modes["x-axis"](this,e,{intersect:!0})},getElementsAtEventForMode:function(e,t,n){var r=Tt.modes[t];return"function"==typeof r?r(this,e,n):[]},getDatasetAtEvent:function(e){return Tt.modes.dataset(this,e,{intersect:!0})},getDatasetMeta:function(e){var t=this,n=t.data.datasets[e];n._meta||(n._meta={});var r=n._meta[t.id];return r||(r=n._meta[t.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n.order||0,index:e}),r},getVisibleDatasetCount:function(){for(var e=0,t=0,n=this.data.datasets.length;t=0;r--){var o=e[r];if(t(o))return o}},ae.isNumber=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},ae.almostEquals=function(e,t,n){return Math.abs(e-t)=e},ae.max=function(e){return e.reduce((function(e,t){return isNaN(t)?e:Math.max(e,t)}),Number.NEGATIVE_INFINITY)},ae.min=function(e){return e.reduce((function(e,t){return isNaN(t)?e:Math.min(e,t)}),Number.POSITIVE_INFINITY)},ae.sign=Math.sign?function(e){return Math.sign(e)}:function(e){return 0==(e=+e)||isNaN(e)?e:e>0?1:-1},ae.toRadians=function(e){return e*(Math.PI/180)},ae.toDegrees=function(e){return e*(180/Math.PI)},ae._decimalPlaces=function(e){if(ae.isFinite(e)){for(var t=1,n=0;Math.round(e*t)/t!==e;)t*=10,n++;return n}},ae.getAngleFromPoint=function(e,t){var n=t.x-e.x,r=t.y-e.y,o=Math.sqrt(n*n+r*r),i=Math.atan2(r,n);return i<-.5*Math.PI&&(i+=2*Math.PI),{angle:i,distance:o}},ae.distanceBetweenPoints=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},ae.aliasPixel=function(e){return e%2==0?0:.5},ae._alignPixel=function(e,t,n){var r=e.currentDevicePixelRatio,o=n/2;return Math.round((t-o)*r)/r+o},ae.splineCurve=function(e,t,n,r){var o=e.skip?t:e,i=t,a=n.skip?t:n,l=Math.sqrt(Math.pow(i.x-o.x,2)+Math.pow(i.y-o.y,2)),s=Math.sqrt(Math.pow(a.x-i.x,2)+Math.pow(a.y-i.y,2)),u=l/(l+s),c=s/(l+s),d=r*(u=isNaN(u)?0:u),f=r*(c=isNaN(c)?0:c);return{previous:{x:i.x-d*(a.x-o.x),y:i.y-d*(a.y-o.y)},next:{x:i.x+f*(a.x-o.x),y:i.y+f*(a.y-o.y)}}},ae.EPSILON=Number.EPSILON||1e-14,ae.splineCurveMonotone=function(e){var t,n,r,o,i,a,l,s,u,c=(e||[]).map((function(e){return{model:e._model,deltaK:0,mK:0}})),d=c.length;for(t=0;t0?c[t-1]:null,(o=t0?c[t-1]:null,o=t=e.length-1?e[0]:e[t+1]:t>=e.length-1?e[e.length-1]:e[t+1]},ae.previousItem=function(e,t,n){return n?t<=0?e[e.length-1]:e[t-1]:t<=0?e[0]:e[t-1]},ae.niceNum=function(e,t){var n=Math.floor(ae.log10(e)),r=e/Math.pow(10,n);return(t?r<1.5?1:r<3?2:r<7?5:10:r<=1?1:r<=2?2:r<=5?5:10)*Math.pow(10,n)},ae.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)},ae.getRelativePosition=function(e,t){var n,r,o=e.originalEvent||e,i=e.target||e.srcElement,a=i.getBoundingClientRect(),l=o.touches;l&&l.length>0?(n=l[0].clientX,r=l[0].clientY):(n=o.clientX,r=o.clientY);var s=parseFloat(ae.getStyle(i,"padding-left")),u=parseFloat(ae.getStyle(i,"padding-top")),c=parseFloat(ae.getStyle(i,"padding-right")),d=parseFloat(ae.getStyle(i,"padding-bottom")),f=a.right-a.left-s-c,p=a.bottom-a.top-u-d;return{x:n=Math.round((n-a.left-s)/f*i.width/t.currentDevicePixelRatio),y:r=Math.round((r-a.top-u)/p*i.height/t.currentDevicePixelRatio)}},ae.getConstraintWidth=function(e){return n(e,"max-width","clientWidth")},ae.getConstraintHeight=function(e){return n(e,"max-height","clientHeight")},ae._calculatePadding=function(e,t,n){return(t=ae.getStyle(e,t)).indexOf("%")>-1?n*parseInt(t,10)/100:parseInt(t,10)},ae._getParentNode=function(e){var t=e.parentNode;return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t},ae.getMaximumWidth=function(e){var t=ae._getParentNode(e);if(!t)return e.clientWidth;var n=t.clientWidth,r=n-ae._calculatePadding(t,"padding-left",n)-ae._calculatePadding(t,"padding-right",n),o=ae.getConstraintWidth(e);return isNaN(o)?r:Math.min(r,o)},ae.getMaximumHeight=function(e){var t=ae._getParentNode(e);if(!t)return e.clientHeight;var n=t.clientHeight,r=n-ae._calculatePadding(t,"padding-top",n)-ae._calculatePadding(t,"padding-bottom",n),o=ae.getConstraintHeight(e);return isNaN(o)?r:Math.min(r,o)},ae.getStyle=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,null).getPropertyValue(t)},ae.retinaScale=function(e,t){var n=e.currentDevicePixelRatio=t||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var r=e.canvas,o=e.height,i=e.width;r.height=o*n,r.width=i*n,e.ctx.scale(n,n),r.style.height||r.style.width||(r.style.height=o+"px",r.style.width=i+"px")}},ae.fontString=function(e,t,n){return t+" "+e+"px "+n},ae.longestText=function(e,t,n,r){var o=(r=r||{}).data=r.data||{},i=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(o=r.data={},i=r.garbageCollect=[],r.font=t),e.font=t;var a,l,s,u,c,d=0,f=n.length;for(a=0;an.length){for(a=0;ar&&(r=i),r},ae.numberOfLabelLines=function(e){var t=1;return ae.each(e,(function(e){ae.isArray(e)&&e.length>t&&(t=e.length)})),t},ae.color=L?function(e){return e instanceof CanvasGradient&&(e=Z.global.defaultColor),L(e)}:function(e){return console.error("Color.js not found!"),e},ae.getHoverColor=function(e){return e instanceof CanvasPattern||e instanceof CanvasGradient?e:ae.color(e).saturate(.5).darken(.1).rgbString()}};function Kn(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function Gn(e){this.options=e||{}}ae.extend(Gn.prototype,{formats:Kn,parse:Kn,format:Kn,add:Kn,diff:Kn,startOf:Kn,endOf:Kn,_create:function(e){return e}}),Gn.override=function(e){ae.extend(Gn.prototype,e)};var Jn={_date:Gn},Xn={formatters:{values:function(e){return ae.isArray(e)?e:""+e},linear:function(e,t,n){var r=n.length>3?n[2]-n[1]:n[1]-n[0];Math.abs(r)>1&&e!==Math.floor(e)&&(r=e-Math.floor(e));var o=ae.log10(Math.abs(r)),i="";if(0!==e)if(Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]))<1e-4){var a=ae.log10(Math.abs(e)),l=Math.floor(a)-Math.floor(o);l=Math.max(Math.min(l,20),0),i=e.toExponential(l)}else{var s=-1*Math.floor(o);s=Math.max(Math.min(s,20),0),i=e.toFixed(s)}else i="0";return i},logarithmic:function(e,t,n){var r=e/Math.pow(10,Math.floor(ae.log10(e)));return 0===e?"0":1===r||2===r||5===r||0===t||t===n.length-1?e.toExponential():""}}},Zn=ae.isArray,Qn=ae.isNullOrUndef,er=ae.valueOrDefault,tr=ae.valueAtIndexOrDefault;function nr(e,t){for(var n=[],r=e.length/t,o=0,i=e.length;os+u)))return a}function or(e,t){ae.each(e,(function(e){var n,r=e.gc,o=r.length/2;if(o>t){for(n=0;nu)return i;return Math.max(u,1)}function pr(e){var t,n,r=[];for(t=0,n=e.length;t=f||c<=1||!l.isHorizontal()?l.labelRotation=d:(t=(e=l._getLabelSizes()).widest.width,n=e.highest.height-e.highest.offset,r=Math.min(l.maxWidth,l.chart.width-t),t+6>(o=s.offset?l.maxWidth/c:r/(c-1))&&(o=r/(c-(s.offset?.5:1)),i=l.maxHeight-ar(s.gridLines)-u.padding-lr(s.scaleLabel),a=Math.sqrt(t*t+n*n),p=ae.toDegrees(Math.min(Math.asin(Math.min((e.highest.height+6)/o,1)),Math.asin(Math.min(i/a,1))-Math.asin(n/a))),p=Math.max(d,Math.min(f,p))),l.labelRotation=p)},afterCalculateTickRotation:function(){ae.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){ae.callback(this.options.beforeFit,[this])},fit:function(){var e=this,t=e.minSize={width:0,height:0},n=e.chart,r=e.options,o=r.ticks,i=r.scaleLabel,a=r.gridLines,l=e._isVisible(),s="bottom"===r.position,u=e.isHorizontal();if(u?t.width=e.maxWidth:l&&(t.width=ar(a)+lr(i)),u?l&&(t.height=ar(a)+lr(i)):t.height=e.maxHeight,o.display&&l){var c=ur(o),d=e._getLabelSizes(),f=d.first,p=d.last,h=d.widest,m=d.highest,g=.4*c.minor.lineHeight,y=o.padding;if(u){var v=0!==e.labelRotation,b=ae.toRadians(e.labelRotation),_=Math.cos(b),w=Math.sin(b),x=w*h.width+_*(m.height-(v?m.offset:0))+(v?0:g);t.height=Math.min(e.maxHeight,t.height+x+y);var k,O,S=e.getPixelForTick(0)-e.left,E=e.right-e.getPixelForTick(e.getTicks().length-1);v?(k=s?_*f.width+w*f.offset:w*(f.height-f.offset),O=s?w*(p.height-p.offset):_*p.width+w*p.offset):(k=f.width/2,O=p.width/2),e.paddingLeft=Math.max((k-S)*e.width/(e.width-S),0)+3,e.paddingRight=Math.max((O-E)*e.width/(e.width-E),0)+3}else{var A=o.mirror?0:h.width+y+g;t.width=Math.min(e.maxWidth,t.width+A),e.paddingTop=f.height/2,e.paddingBottom=p.height/2}}e.handleMargins(),u?(e.width=e._length=n.width-e.margins.left-e.margins.right,e.height=t.height):(e.width=t.width,e.height=e._length=n.height-e.margins.top-e.margins.bottom)},handleMargins:function(){var e=this;e.margins&&(e.margins.left=Math.max(e.paddingLeft,e.margins.left),e.margins.top=Math.max(e.paddingTop,e.margins.top),e.margins.right=Math.max(e.paddingRight,e.margins.right),e.margins.bottom=Math.max(e.paddingBottom,e.margins.bottom))},afterFit:function(){ae.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(Qn(e))return NaN;if(("number"==typeof e||e instanceof Number)&&!isFinite(e))return NaN;if(e)if(this.isHorizontal()){if(void 0!==e.x)return this.getRightValue(e.x)}else if(void 0!==e.y)return this.getRightValue(e.y);return e},_convertTicksToLabels:function(e){var t,n,r,o=this;for(o.ticks=e.map((function(e){return e.value})),o.beforeTickToLabelConversion(),t=o.convertTicksToLabels(e)||o.ticks,o.afterTickToLabelConversion(),n=0,r=e.length;nr-1?null:t.getPixelForDecimal(e*o+(n?o/2:0))},getPixelForDecimal:function(e){var t=this;return t._reversePixels&&(e=1-e),t._startPixel+e*t._length},getDecimalForPixel:function(e){var t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var e=this,t=e.min,n=e.max;return e.beginAtZero?0:t<0&&n<0?n:t>0&&n>0?t:0},_autoSkip:function(e){var t,n,r,o,i=this,a=i.options.ticks,l=i._length,s=a.maxTicksLimit||l/i._tickSize()+1,u=a.major.enabled?pr(e):[],c=u.length,d=u[0],f=u[c-1];if(c>s)return hr(e,u,c/s),cr(e);if(r=fr(u,e,l,s),c>0){for(t=0,n=c-1;t1?(f-d)/(c-1):null,mr(e,r,ae.isNullOrUndef(o)?0:d-o,d),mr(e,r,f,ae.isNullOrUndef(o)?e.length:f+o),cr(e)}return mr(e,r),cr(e)},_tickSize:function(){var e=this,t=e.options.ticks,n=ae.toRadians(e.labelRotation),r=Math.abs(Math.cos(n)),o=Math.abs(Math.sin(n)),i=e._getLabelSizes(),a=t.autoSkipPadding||0,l=i?i.widest.width+a:0,s=i?i.highest.height+a:0;return e.isHorizontal()?s*r>l*o?l/r:s/o:s*o=0&&(a=e),void 0!==i&&(e=n.indexOf(i))>=0&&(l=e),t.minIndex=a,t.maxIndex=l,t.min=n[a],t.max=n[l]},buildTicks:function(){var e=this,t=e._getLabels(),n=e.minIndex,r=e.maxIndex;e.ticks=0===n&&r===t.length-1?t:t.slice(n,r+1)},getLabelForIndex:function(e,t){var n=this,r=n.chart;return r.getDatasetMeta(t).controller._getValueScaleId()===n.id?n.getRightValue(r.data.datasets[t].data[e]):n._getLabels()[e]},_configure:function(){var e=this,t=e.options.offset,n=e.ticks;yr.prototype._configure.call(e),e.isHorizontal()||(e._reversePixels=!e._reversePixels),n&&(e._startValue=e.minIndex-(t?.5:0),e._valueRange=Math.max(n.length-(t?0:1),1))},getPixelForValue:function(e,t,n){var r,o,i,a=this;return vr(t)||vr(n)||(e=a.chart.data.datasets[n].data[t]),vr(e)||(r=a.isHorizontal()?e.x:e.y),(void 0!==r||void 0!==e&&isNaN(t))&&(o=a._getLabels(),e=ae.valueOrDefault(r,e),t=-1!==(i=o.indexOf(e))?i:t,isNaN(t)&&(t=e)),a.getPixelForDecimal((t-a._startValue)/a._valueRange)},getPixelForTick:function(e){var t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e],e+this.minIndex)},getValueForPixel:function(e){var t=this,n=Math.round(t._startValue+t.getDecimalForPixel(e)*t._valueRange);return Math.min(Math.max(n,0),t.ticks.length-1)},getBasePixel:function(){return this.bottom}}),wr=br;_r._defaults=wr;var xr=ae.noop,kr=ae.isNullOrUndef;function Or(e,t){var n,r,o,i,a=[],l=1e-14,s=e.stepSize,u=s||1,c=e.maxTicks-1,d=e.min,f=e.max,p=e.precision,h=t.min,m=t.max,g=ae.niceNum((m-h)/c/u)*u;if(gc&&(g=ae.niceNum(i*g/c/u)*u),s||kr(p)?n=Math.pow(10,ae._decimalPlaces(g)):(n=Math.pow(10,p),g=Math.ceil(g*n)/n),r=Math.floor(h/g)*g,o=Math.ceil(m/g)*g,s&&(!kr(d)&&ae.almostWhole(d/g,g/1e3)&&(r=d),!kr(f)&&ae.almostWhole(f/g,g/1e3)&&(o=f)),i=(o-r)/g,i=ae.almostEquals(i,Math.round(i),g/1e3)?Math.round(i):Math.ceil(i),r=Math.round(r*n)/n,o=Math.round(o*n)/n,a.push(kr(d)?r:d);for(var y=1;y0&&r>0&&(e.min=0)}var o=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&&(null===e.min?e.min=t.suggestedMin:e.min=Math.min(e.min,t.suggestedMin)),void 0!==t.max?e.max=t.max:void 0!==t.suggestedMax&&(null===e.max?e.max=t.suggestedMax:e.max=Math.max(e.max,t.suggestedMax)),o!==i&&e.min>=e.max&&(o?e.max=e.min+1:e.min=e.max-1),e.min===e.max&&(e.max++,t.beginAtZero||e.min--)},getTickLimit:function(){var e,t=this,n=t.options.ticks,r=n.stepSize,o=n.maxTicksLimit;return r?e=Math.ceil(t.max/r)-Math.floor(t.min/r)+1:(e=t._computeTickLimit(),o=o||11),o&&(e=Math.min(o,e)),e},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:xr,buildTicks:function(){var e=this,t=e.options.ticks,n=e.getTickLimit(),r={maxTicks:n=Math.max(2,n),min:t.min,max:t.max,precision:t.precision,stepSize:ae.valueOrDefault(t.fixedStepSize,t.stepSize)},o=e.ticks=Or(r,e);e.handleDirectionalChanges(),e.max=ae.max(o),e.min=ae.min(o),t.reverse?(o.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),yr.prototype.convertTicksToLabels.call(e)},_configure:function(){var e,t=this,n=t.getTicks(),r=t.min,o=t.max;yr.prototype._configure.call(t),t.options.offset&&n.length&&(r-=e=(o-r)/Math.max(n.length-1,1)/2,o+=e),t._startValue=r,t._endValue=o,t._valueRange=o-r}}),Er={position:"left",ticks:{callback:Xn.formatters.linear}},Ar=0,Cr=1;function jr(e,t,n){var r=[n.type,void 0===t&&void 0===n.stack?n.index:"",n.stack].join(".");return void 0===e[r]&&(e[r]={pos:[],neg:[]}),e[r]}function Pr(e,t,n,r){var o,i,a=e.options,l=jr(t,a.stacked,n),s=l.pos,u=l.neg,c=r.length;for(o=0;ot.length-1?null:this.getPixelForValue(t[e])}}),Mr=Er;Wr._defaults=Mr;var Nr=ae.valueOrDefault,Vr=ae.math.log10;function Lr(e,t){var n,r,o=[],i=Nr(e.min,Math.pow(10,Math.floor(Vr(t.min)))),a=Math.floor(Vr(t.max)),l=Math.ceil(t.max/Math.pow(10,a));0===i?(n=Math.floor(Vr(t.minNotZero)),r=Math.floor(t.minNotZero/Math.pow(10,n)),o.push(i),i=r*Math.pow(10,n)):(n=Math.floor(Vr(i)),r=Math.floor(i/Math.pow(10,n)));var s=n<0?Math.pow(10,Math.abs(n)):1;do{o.push(i),10==++r&&(r=1,s=++n>=0?1:s),i=Math.round(r*Math.pow(10,n)*s)/s}while(n=0?e:t}var Ur=yr.extend({determineDataLimits:function(){var e,t,n,r,o,i,a=this,l=a.options,s=a.chart,u=s.data.datasets,c=a.isHorizontal();function d(e){return c?e.xAxisID===a.id:e.yAxisID===a.id}a.min=Number.POSITIVE_INFINITY,a.max=Number.NEGATIVE_INFINITY,a.minNotZero=Number.POSITIVE_INFINITY;var f=l.stacked;if(void 0===f)for(e=0;e0){var t=ae.min(e),n=ae.max(e);a.min=Math.min(a.min,t),a.max=Math.max(a.max,n)}}))}else for(e=0;e0?e.minNotZero=e.min:e.max<1?e.minNotZero=Math.pow(10,Math.floor(Vr(e.max))):e.minNotZero=n)},buildTicks:function(){var e=this,t=e.options.ticks,n=!e.isHorizontal(),r={min:Ir(t.min),max:Ir(t.max)},o=e.ticks=Lr(r,e);e.max=ae.max(o),e.min=ae.min(o),t.reverse?(n=!n,e.start=e.max,e.end=e.min):(e.start=e.min,e.end=e.max),n&&o.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),yr.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(Vr(e));return Math.floor(e/Math.pow(10,t))*Math.pow(10,t)},_configure:function(){var e=this,t=e.min,n=0;yr.prototype._configure.call(e),0===t&&(t=e._getFirstTickValue(e.minNotZero),n=Nr(e.options.ticks.fontSize,Z.global.defaultFontSize)/e._length),e._startValue=Vr(t),e._valueOffset=n,e._valueRange=(Vr(e.max)-Vr(t))/(1-n)},getPixelForValue:function(e){var t=this,n=0;return(e=+t.getRightValue(e))>t.min&&e>0&&(n=(Vr(e)-t._startValue)/t._valueRange+t._valueOffset),t.getPixelForDecimal(n)},getValueForPixel:function(e){var t=this,n=t.getDecimalForPixel(e);return 0===n&&0===t.min?0:Math.pow(10,t._startValue+(n-t._valueOffset)*t._valueRange)}}),Dr=Rr;Ur._defaults=Dr;var qr=ae.valueOrDefault,zr=ae.valueAtIndexOrDefault,Fr=ae.options.resolve,Br={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:Xn.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(e){return e}}};function $r(e){var t=e.ticks;return t.display&&e.display?qr(t.fontSize,Z.global.defaultFontSize)+2*t.backdropPaddingY:0}function Hr(e,t,n){return ae.isArray(n)?{w:ae.longestText(e,e.font,n),h:n.length*t}:{w:e.measureText(n).width,h:t}}function Yr(e,t,n,r,o){return e===r||e===o?{start:t-n/2,end:t+n/2}:eo?{start:t-n,end:t}:{start:t,end:t+n}}function Kr(e){var t,n,r,o=ae.options._parseFont(e.options.pointLabels),i={l:0,r:e.width,t:0,b:e.height-e.paddingTop},a={};e.ctx.font=o.string,e._pointLabelSizes=[];var l=e.chart.data.labels.length;for(t=0;ti.r&&(i.r=c.end,a.r=s),d.starti.b&&(i.b=d.end,a.b=s)}e.setReductions(e.drawingArea,i,a)}function Gr(e){return 0===e||180===e?"center":e<180?"left":"right"}function Jr(e,t,n,r){var o,i,a=n.y+r/2;if(ae.isArray(t))for(o=0,i=t.length;o270||e<90)&&(n.y-=t.h)}function Zr(e){var t=e.ctx,n=e.options,r=n.pointLabels,o=$r(n),i=e.getDistanceFromCenterForValue(n.ticks.reverse?e.min:e.max),a=ae.options._parseFont(r);t.save(),t.font=a.string,t.textBaseline="middle";for(var l=e.chart.data.labels.length-1;l>=0;l--){var s=0===l?o/2:0,u=e.getPointPosition(l,i+s+5),c=zr(r.fontColor,l,Z.global.defaultFontColor);t.fillStyle=c;var d=e.getIndexAngle(l),f=ae.toDegrees(d);t.textAlign=Gr(f),Xr(f,e._pointLabelSizes[l],u),Jr(t,e.pointLabels[l],u,a.lineHeight)}t.restore()}function Qr(e,t,n,r){var o,i=e.ctx,a=t.circular,l=e.chart.data.labels.length,s=zr(t.color,r-1),u=zr(t.lineWidth,r-1);if((a||l)&&s&&u){if(i.save(),i.strokeStyle=s,i.lineWidth=u,i.setLineDash&&(i.setLineDash(t.borderDash||[]),i.lineDashOffset=t.borderDashOffset||0),i.beginPath(),a)i.arc(e.xCenter,e.yCenter,n,0,2*Math.PI);else{o=e.getPointPosition(0,n),i.moveTo(o.x,o.y);for(var c=1;c0&&r>0?n:0)},_drawGrid:function(){var e,t,n,r=this,o=r.ctx,i=r.options,a=i.gridLines,l=i.angleLines,s=qr(l.lineWidth,a.lineWidth),u=qr(l.color,a.color);if(i.pointLabels.display&&Zr(r),a.display&&ae.each(r.ticks,(function(e,n){0!==n&&(t=r.getDistanceFromCenterForValue(r.ticksAsNumbers[n]),Qr(r,a,t,n))})),l.display&&s&&u){for(o.save(),o.lineWidth=s,o.strokeStyle=u,o.setLineDash&&(o.setLineDash(Fr([l.borderDash,a.borderDash,[]])),o.lineDashOffset=Fr([l.borderDashOffset,a.borderDashOffset,0])),e=r.chart.data.labels.length-1;e>=0;e--)t=r.getDistanceFromCenterForValue(i.ticks.reverse?r.min:r.max),n=r.getPointPosition(e,t),o.beginPath(),o.moveTo(r.xCenter,r.yCenter),o.lineTo(n.x,n.y),o.stroke();o.restore()}},_drawLabels:function(){var e=this,t=e.ctx,n=e.options.ticks;if(n.display){var r,o,i=e.getIndexAngle(0),a=ae.options._parseFont(n),l=qr(n.fontColor,Z.global.defaultFontColor);t.save(),t.font=a.string,t.translate(e.xCenter,e.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",ae.each(e.ticks,(function(i,s){(0!==s||n.reverse)&&(r=e.getDistanceFromCenterForValue(e.ticksAsNumbers[s]),n.showLabelBackdrop&&(o=t.measureText(i).width,t.fillStyle=n.backdropColor,t.fillRect(-o/2-n.backdropPaddingX,-r-a.size/2-n.backdropPaddingY,o+2*n.backdropPaddingX,a.size+2*n.backdropPaddingY)),t.fillStyle=l,t.fillText(i,0,-r))})),t.restore()}},_drawTitle:ae.noop}),no=Br;to._defaults=no;var ro=ae._deprecated,oo=ae.options.resolve,io=ae.valueOrDefault,ao=Number.MIN_SAFE_INTEGER||-9007199254740991,lo=Number.MAX_SAFE_INTEGER||9007199254740991,so={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}},uo=Object.keys(so);function co(e,t){return e-t}function fo(e){var t,n,r,o={},i=[];for(t=0,n=e.length;tt&&l=0&&a<=l;){if(o=e[(r=a+l>>1)-1]||null,i=e[r],!o)return{lo:null,hi:i};if(i[t]n))return{lo:o,hi:i};l=r-1}}return{lo:i,hi:null}}function yo(e,t,n,r){var o=go(e,t,n),i=o.lo?o.hi?o.lo:e[e.length-2]:e[0],a=o.lo?o.hi?o.hi:e[e.length-1]:e[1],l=a[t]-i[t],s=l?(n-i[t])/l:0,u=(a[r]-i[r])*s;return i[r]+u}function vo(e,t){var n=e._adapter,r=e.options.time,o=r.parser,i=o||r.format,a=t;return"function"==typeof o&&(a=o(a)),ae.isFinite(a)||(a="string"==typeof i?n.parse(a,i):n.parse(a)),null!==a?+a:(o||"function"!=typeof i||(a=i(t),ae.isFinite(a)||(a=n.parse(a))),a)}function bo(e,t){if(ae.isNullOrUndef(t))return null;var n=e.options.time,r=vo(e,e.getRightValue(t));return null===r||n.round&&(r=+e._adapter.startOf(r,n.round)),r}function _o(e,t,n,r){var o,i,a,l=uo.length;for(o=uo.indexOf(e);o=uo.indexOf(n);i--)if(a=uo[i],so[a].common&&e._adapter.diff(o,r,a)>=t-1)return a;return uo[n?uo.indexOf(n):0]}function xo(e){for(var t=uo.indexOf(e)+1,n=uo.length;t1e5*u)throw t+" and "+n+" are too far apart with stepSize of "+u+" "+s;for(o=d;o=0&&(t[i].major=!0);return t}function Eo(e,t,n){var r,o,i=[],a={},l=t.length;for(r=0;r1?fo(h).sort(co):h.sort(co),f=Math.min(f,h[0]),p=Math.max(p,h[h.length-1])),f=bo(l,po(c))||f,p=bo(l,ho(c))||p,f=f===lo?+u.startOf(Date.now(),d):f,p=p===ao?+u.endOf(Date.now(),d)+1:p,l.min=Math.min(f,p),l.max=Math.max(f+1,p),l._table=[],l._timestamps={data:h,datasets:m,labels:g}},buildTicks:function(){var e,t,n,r=this,o=r.min,i=r.max,a=r.options,l=a.ticks,s=a.time,u=r._timestamps,c=[],d=r.getLabelCapacity(o),f=l.source,p=a.distribution;for(u="data"===f||"auto"===f&&"series"===p?u.data:"labels"===f?u.labels:ko(r,o,i,d),"ticks"===a.bounds&&u.length&&(o=u[0],i=u[u.length-1]),o=bo(r,po(a))||o,i=bo(r,ho(a))||i,e=0,t=u.length;e=o&&n<=i&&c.push(n);return r.min=o,r.max=i,r._unit=s.unit||(l.autoSkip?_o(s.minUnit,r.min,r.max,d):wo(r,c.length,s.minUnit,r.min,r.max)),r._majorUnit=l.major.enabled&&"year"!==r._unit?xo(r._unit):void 0,r._table=mo(r._timestamps.data,o,i,p),r._offsets=Oo(r._table,c,o,i,a),l.reverse&&c.reverse(),Eo(r,c,r._majorUnit)},getLabelForIndex:function(e,t){var n=this,r=n._adapter,o=n.chart.data,i=n.options.time,a=o.labels&&e=0&&e0?l:1}}),jo=Ao;Co._defaults=jo;var Po={category:_r,linear:Wr,logarithmic:Ur,radialLinear:to,time:Co},To={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"};Jn._date.override("function"==typeof e?{_id:"moment",formats:function(){return To},parse:function(t,n){return"string"==typeof t&&"string"==typeof n?t=e(t,n):t instanceof e||(t=e(t)),t.isValid()?t.valueOf():null},format:function(t,n){return e(t).format(n)},add:function(t,n,r){return e(t).add(n,r).valueOf()},diff:function(t,n,r){return e(t).diff(e(n),r)},startOf:function(t,n,r){return t=e(t),"isoWeek"===n?t.isoWeekday(r).valueOf():t.startOf(n).valueOf()},endOf:function(t,n){return e(t).endOf(n).valueOf()},_create:function(t){return e(t)}}:{}),Z._set("global",{plugins:{filler:{propagate:!0}}});var Wo={dataset:function(e){var t=e.fill,n=e.chart,r=n.getDatasetMeta(t),o=r&&n.isDatasetVisible(t)&&r.dataset._children||[],i=o.length||0;return i?function(e,t){return t=n)&&r;switch(i){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return i;default:return!1}}function No(e){var t,n=e.el._model||{},r=e.el._scale||{},o=e.fill,i=null;if(isFinite(o))return null;if("start"===o?i=void 0===n.scaleBottom?r.bottom:n.scaleBottom:"end"===o?i=void 0===n.scaleTop?r.top:n.scaleTop:void 0!==n.scaleZero?i=n.scaleZero:r.getBasePixel&&(i=r.getBasePixel()),null!=i){if(void 0!==i.x&&void 0!==i.y)return i;if(ae.isFinite(i))return{x:(t=r.isHorizontal())?i:null,y:t?null:i}}return null}function Vo(e){var t,n,r,o,i,a=e.el._scale,l=a.options,s=a.chart.data.labels.length,u=e.fill,c=[];if(!s)return null;for(t=l.ticks.reverse?a.max:a.min,n=l.ticks.reverse?a.min:a.max,r=a.getPointPositionForValue(0,t),o=0;o0;--i)ae.canvas.lineTo(e,n[i],n[i-1],!0);else for(a=n[0].cx,l=n[0].cy,s=Math.sqrt(Math.pow(n[0].x-a,2)+Math.pow(n[0].y-l,2)),i=o-1;i>0;--i)e.arc(a,l,s,n[i].angle,n[i-1].angle,!0)}}function qo(e,t,n,r,o,i){var a,l,s,u,c,d,f,p,h=t.length,m=r.spanGaps,g=[],y=[],v=0,b=0;for(e.beginPath(),a=0,l=h;a=0;--n)(t=s[n].$filler)&&t.visible&&(o=(r=t.el)._view,i=r._children||[],a=t.mapper,l=o.backgroundColor||Z.global.defaultColor,a&&l&&i.length&&(ae.canvas.clipArea(u,e.chartArea),qo(u,i,a,o,l,r._loop),ae.canvas.unclipArea(u)))}},Fo=ae.rtl.getRtlAdapter,Bo=ae.noop,$o=ae.valueOrDefault;function Ho(e,t){return e.usePointStyle&&e.boxWidth>t?t:e.boxWidth}Z._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(e,t){var n=t.datasetIndex,r=this.chart,o=r.getDatasetMeta(n);o.hidden=null===o.hidden?!r.data.datasets[n].hidden:null,r.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(e){var t=e.data.datasets,n=e.options.legend||{},r=n.labels&&n.labels.usePointStyle;return e._getSortedDatasetMetas().map((function(n){var o=n.controller.getStyle(r?0:void 0);return{text:t[n.index].label,fillStyle:o.backgroundColor,hidden:!e.isDatasetVisible(n.index),lineCap:o.borderCapStyle,lineDash:o.borderDash,lineDashOffset:o.borderDashOffset,lineJoin:o.borderJoinStyle,lineWidth:o.borderWidth,strokeStyle:o.borderColor,pointStyle:o.pointStyle,rotation:o.rotation,datasetIndex:n.index}}),this)}}},legendCallback:function(e){var t,n,r,o=document.createElement("ul"),i=e.data.datasets;for(o.setAttribute("class",e.id+"-legend"),t=0,n=i.length;ts.width)&&(d+=a+n.padding,c[c.length-(t>0?0:1)]=0),l[t]={left:0,top:0,width:r,height:a},c[c.length-1]+=r+n.padding})),s.height+=d}else{var f=n.padding,p=e.columnWidths=[],h=e.columnHeights=[],m=n.padding,g=0,y=0;ae.each(e.legendItems,(function(e,t){var r=Ho(n,a)+a/2+o.measureText(e.text).width;t>0&&y+a+2*f>s.height&&(m+=g+n.padding,p.push(g),h.push(y),g=0,y=0),g=Math.max(g,r),y+=a+f,l[t]={left:0,top:0,width:r,height:a}})),m+=g,p.push(g),h.push(y),s.width+=m}e.width=s.width,e.height=s.height}else e.width=s.width=e.height=s.height=0},afterFit:Bo,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var e=this,t=e.options,n=t.labels,r=Z.global,o=r.defaultColor,i=r.elements.line,a=e.height,l=e.columnHeights,s=e.width,u=e.lineWidths;if(t.display){var c,d=Fo(t.rtl,e.left,e.minSize.width),f=e.ctx,p=$o(n.fontColor,r.defaultFontColor),h=ae.options._parseFont(n),m=h.size;f.textAlign=d.textAlign("left"),f.textBaseline="middle",f.lineWidth=.5,f.strokeStyle=p,f.fillStyle=p,f.font=h.string;var g=Ho(n,m),y=e.legendHitBoxes,v=function(e,t,r){if(!(isNaN(g)||g<=0)){f.save();var a=$o(r.lineWidth,i.borderWidth);if(f.fillStyle=$o(r.fillStyle,o),f.lineCap=$o(r.lineCap,i.borderCapStyle),f.lineDashOffset=$o(r.lineDashOffset,i.borderDashOffset),f.lineJoin=$o(r.lineJoin,i.borderJoinStyle),f.lineWidth=a,f.strokeStyle=$o(r.strokeStyle,o),f.setLineDash&&f.setLineDash($o(r.lineDash,i.borderDash)),n&&n.usePointStyle){var l=g*Math.SQRT2/2,s=d.xPlus(e,g/2),u=t+m/2;ae.canvas.drawPoint(f,r.pointStyle,l,s,u,r.rotation)}else f.fillRect(d.leftForLtr(e,g),t,g,m),0!==a&&f.strokeRect(d.leftForLtr(e,g),t,g,m);f.restore()}},b=function(e,t,n,r){var o=m/2,i=d.xPlus(e,g+o),a=t+o;f.fillText(n.text,i,a),n.hidden&&(f.beginPath(),f.lineWidth=2,f.moveTo(i,a),f.lineTo(d.xPlus(i,r),a),f.stroke())},_=function(e,r){switch(t.align){case"start":return n.padding;case"end":return e-r;default:return(e-r+n.padding)/2}},w=e.isHorizontal();c=w?{x:e.left+_(s,u[0]),y:e.top+n.padding,line:0}:{x:e.left+n.padding,y:e.top+_(a,l[0]),line:0},ae.rtl.overrideTextDirection(e.ctx,t.textDirection);var x=m+n.padding;ae.each(e.legendItems,(function(t,r){var o=f.measureText(t.text).width,i=g+m/2+o,p=c.x,h=c.y;d.setWidth(e.minSize.width),w?r>0&&p+i+n.padding>e.left+e.minSize.width&&(h=c.y+=x,c.line++,p=c.x=e.left+_(s,u[c.line])):r>0&&h+x>e.top+e.minSize.height&&(p=c.x=p+e.columnWidths[c.line]+n.padding,c.line++,h=c.y=e.top+_(a,l[c.line]));var k=d.x(p);v(k,h,t),y[r].left=d.leftForLtr(k,y[r].width),y[r].top=h,b(k,h,t,o),w?c.x+=i+n.padding:c.y+=x})),ae.rtl.restoreTextDirection(e.ctx,t.textDirection)}},_getLegendItemAt:function(e,t){var n,r,o,i=this;if(e>=i.left&&e<=i.right&&t>=i.top&&t<=i.bottom)for(o=i.legendHitBoxes,n=0;n=(r=o[n]).left&&e<=r.left+r.width&&t>=r.top&&t<=r.top+r.height)return i.legendItems[n];return null},handleEvent:function(e){var t,n=this,r=n.options,o="mouseup"===e.type?"click":e.type;if("mousemove"===o){if(!r.onHover&&!r.onLeave)return}else{if("click"!==o)return;if(!r.onClick)return}t=n._getLegendItemAt(e.x,e.y),"click"===o?t&&r.onClick&&r.onClick.call(n,e.native,t):(r.onLeave&&t!==n._hoveredItem&&(n._hoveredItem&&r.onLeave.call(n,e.native,n._hoveredItem),n._hoveredItem=t),r.onHover&&t&&r.onHover.call(n,e.native,t))}});function Ko(e,t){var n=new Yo({ctx:e.ctx,options:t,chart:e});Bt.configure(e,n,t),Bt.addBox(e,n),e.legend=n}var Go={id:"legend",_element:Yo,beforeInit:function(e){var t=e.options.legend;t&&Ko(e,t)},beforeUpdate:function(e){var t=e.options.legend,n=e.legend;t?(ae.mergeIf(t,Z.global.legend),n?(Bt.configure(e,n,t),n.options=t):Ko(e,t)):n&&(Bt.removeBox(e,n),delete e.legend)},afterEvent:function(e,t){var n=e.legend;n&&n.handleEvent(t)}},Jo=ae.noop;Z._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var Xo=he.extend({initialize:function(e){var t=this;ae.extend(t,e),t.legendHitBoxes=[]},beforeUpdate:Jo,update:function(e,t,n){var r=this;return r.beforeUpdate(),r.maxWidth=e,r.maxHeight=t,r.margins=n,r.beforeSetDimensions(),r.setDimensions(),r.afterSetDimensions(),r.beforeBuildLabels(),r.buildLabels(),r.afterBuildLabels(),r.beforeFit(),r.fit(),r.afterFit(),r.afterUpdate(),r.minSize},afterUpdate:Jo,beforeSetDimensions:Jo,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:Jo,beforeBuildLabels:Jo,buildLabels:Jo,afterBuildLabels:Jo,beforeFit:Jo,fit:function(){var e,t=this,n=t.options,r=t.minSize={},o=t.isHorizontal();n.display?(e=(ae.isArray(n.text)?n.text.length:1)*ae.options._parseFont(n).lineHeight+2*n.padding,t.width=r.width=o?t.maxWidth:e,t.height=r.height=o?e:t.maxHeight):t.width=r.width=t.height=r.height=0},afterFit:Jo,isHorizontal:function(){var e=this.options.position;return"top"===e||"bottom"===e},draw:function(){var e=this,t=e.ctx,n=e.options;if(n.display){var r,o,i,a=ae.options._parseFont(n),l=a.lineHeight,s=l/2+n.padding,u=0,c=e.top,d=e.left,f=e.bottom,p=e.right;t.fillStyle=ae.valueOrDefault(n.fontColor,Z.global.defaultFontColor),t.font=a.string,e.isHorizontal()?(o=d+(p-d)/2,i=c+s,r=p-d):(o="left"===n.position?d+s:p-s,i=c+(f-c)/2,r=f-c,u=Math.PI*("left"===n.position?-.5:.5)),t.save(),t.translate(o,i),t.rotate(u),t.textAlign="center",t.textBaseline="middle";var h=n.text;if(ae.isArray(h))for(var m=0,g=0;g{e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},6077:(e,t,n)=>{var r=n(111);e.exports=function(e){if(!r(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},1223:(e,t,n)=>{var r=n(5112),o=n(30),i=n(3070),a=r("unscopables"),l=Array.prototype;null==l[a]&&i.f(l,a,{configurable:!0,value:o(null)}),e.exports=function(e){l[a][e]=!0}},1530:(e,t,n)=>{"use strict";var r=n(8710).charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},5787:e=>{e.exports=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e}},9670:(e,t,n)=>{var r=n(111);e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},8533:(e,t,n)=>{"use strict";var r=n(2092).forEach,o=n(9341)("forEach");e.exports=o?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},1318:(e,t,n)=>{var r=n(5656),o=n(7466),i=n(1400),a=function(e){return function(t,n,a){var l,s=r(t),u=o(s.length),c=i(a,u);if(e&&n!=n){for(;u>c;)if((l=s[c++])!=l)return!0}else for(;u>c;c++)if((e||c in s)&&s[c]===n)return e||c||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},2092:(e,t,n)=>{var r=n(9974),o=n(8361),i=n(7908),a=n(7466),l=n(5417),s=[].push,u=function(e){var t=1==e,n=2==e,u=3==e,c=4==e,d=6==e,f=7==e,p=5==e||d;return function(h,m,g,y){for(var v,b,_=i(h),w=o(_),x=r(m,g,3),k=a(w.length),O=0,S=y||l,E=t?S(h,k):n||f?S(h,0):void 0;k>O;O++)if((p||O in w)&&(b=x(v=w[O],O,_),e))if(t)E[O]=b;else if(b)switch(e){case 3:return!0;case 5:return v;case 6:return O;case 2:s.call(E,v)}else switch(e){case 4:return!1;case 7:s.call(E,v)}return d?-1:u||c?c:E}};e.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterOut:u(7)}},1194:(e,t,n)=>{var r=n(7293),o=n(5112),i=n(7392),a=o("species");e.exports=function(e){return i>=51||!r((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},9341:(e,t,n)=>{"use strict";var r=n(7293);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){throw 1},1)}))}},3671:(e,t,n)=>{var r=n(3099),o=n(7908),i=n(8361),a=n(7466),l=function(e){return function(t,n,l,s){r(n);var u=o(t),c=i(u),d=a(u.length),f=e?d-1:0,p=e?-1:1;if(l<2)for(;;){if(f in c){s=c[f],f+=p;break}if(f+=p,e?f<0:d<=f)throw TypeError("Reduce of empty array with no initial value")}for(;e?f>=0:d>f;f+=p)f in c&&(s=n(s,c[f],f,u));return s}};e.exports={left:l(!1),right:l(!0)}},5417:(e,t,n)=>{var r=n(111),o=n(3157),i=n(5112)("species");e.exports=function(e,t){var n;return o(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!o(n.prototype)?r(n)&&null===(n=n[i])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)}},7072:(e,t,n)=>{var r=n(5112)("iterator"),o=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){o=!0}};a[r]=function(){return this},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i={};i[r]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(e){}return n}},4326:e=>{var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},648:(e,t,n)=>{var r=n(1694),o=n(4326),i=n(5112)("toStringTag"),a="Arguments"==o(function(){return arguments}());e.exports=r?o:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?n:a?o(t):"Object"==(r=o(t))&&"function"==typeof t.callee?"Arguments":r}},9320:(e,t,n)=>{"use strict";var r=n(2248),o=n(2423).getWeakData,i=n(9670),a=n(111),l=n(5787),s=n(408),u=n(2092),c=n(6656),d=n(9909),f=d.set,p=d.getterFor,h=u.find,m=u.findIndex,g=0,y=function(e){return e.frozen||(e.frozen=new v)},v=function(){this.entries=[]},b=function(e,t){return h(e.entries,(function(e){return e[0]===t}))};v.prototype={get:function(e){var t=b(this,e);if(t)return t[1]},has:function(e){return!!b(this,e)},set:function(e,t){var n=b(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=m(this.entries,(function(t){return t[0]===e}));return~t&&this.entries.splice(t,1),!!~t}},e.exports={getConstructor:function(e,t,n,u){var d=e((function(e,r){l(e,d,t),f(e,{type:t,id:g++,frozen:void 0}),null!=r&&s(r,e[u],{that:e,AS_ENTRIES:n})})),h=p(t),m=function(e,t,n){var r=h(e),a=o(i(t),!0);return!0===a?y(r).set(t,n):a[r.id]=n,e};return r(d.prototype,{delete:function(e){var t=h(this);if(!a(e))return!1;var n=o(e);return!0===n?y(t).delete(e):n&&c(n,t.id)&&delete n[t.id]},has:function(e){var t=h(this);if(!a(e))return!1;var n=o(e);return!0===n?y(t).has(e):n&&c(n,t.id)}}),r(d.prototype,n?{get:function(e){var t=h(this);if(a(e)){var n=o(e);return!0===n?y(t).get(e):n?n[t.id]:void 0}},set:function(e,t){return m(this,e,t)}}:{add:function(e){return m(this,e,!0)}}),d}}},7710:(e,t,n)=>{"use strict";var r=n(2109),o=n(7854),i=n(4705),a=n(1320),l=n(2423),s=n(408),u=n(5787),c=n(111),d=n(7293),f=n(7072),p=n(8003),h=n(9587);e.exports=function(e,t,n){var m=-1!==e.indexOf("Map"),g=-1!==e.indexOf("Weak"),y=m?"set":"add",v=o[e],b=v&&v.prototype,_=v,w={},x=function(e){var t=b[e];a(b,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(g&&!c(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return g&&!c(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return!(g&&!c(e))&&t.call(this,0===e?0:e)}:function(e,n){return t.call(this,0===e?0:e,n),this})};if(i(e,"function"!=typeof v||!(g||b.forEach&&!d((function(){(new v).entries().next()})))))_=n.getConstructor(t,e,m,y),l.REQUIRED=!0;else if(i(e,!0)){var k=new _,O=k[y](g?{}:-0,1)!=k,S=d((function(){k.has(1)})),E=f((function(e){new v(e)})),A=!g&&d((function(){for(var e=new v,t=5;t--;)e[y](t,t);return!e.has(-0)}));E||((_=t((function(t,n){u(t,_,e);var r=h(new v,t,_);return null!=n&&s(n,r[y],{that:r,AS_ENTRIES:m}),r}))).prototype=b,b.constructor=_),(S||A)&&(x("delete"),x("has"),m&&x("get")),(A||O)&&x(y),g&&b.clear&&delete b.clear}return w[e]=_,r({global:!0,forced:_!=v},w),p(_,e),g||n.setStrong(_,e,m),_}},9920:(e,t,n)=>{var r=n(6656),o=n(3887),i=n(1236),a=n(3070);e.exports=function(e,t){for(var n=o(t),l=a.f,s=i.f,u=0;u{var r=n(7293);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},4994:(e,t,n)=>{"use strict";var r=n(3383).IteratorPrototype,o=n(30),i=n(9114),a=n(8003),l=n(7497),s=function(){return this};e.exports=function(e,t,n){var u=t+" Iterator";return e.prototype=o(r,{next:i(1,n)}),a(e,u,!1,!0),l[u]=s,e}},8880:(e,t,n)=>{var r=n(9781),o=n(3070),i=n(9114);e.exports=r?function(e,t,n){return o.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},9114:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},654:(e,t,n)=>{"use strict";var r=n(2109),o=n(4994),i=n(9518),a=n(7674),l=n(8003),s=n(8880),u=n(1320),c=n(5112),d=n(1913),f=n(7497),p=n(3383),h=p.IteratorPrototype,m=p.BUGGY_SAFARI_ITERATORS,g=c("iterator"),y="keys",v="values",b="entries",_=function(){return this};e.exports=function(e,t,n,c,p,w,x){o(n,t,c);var k,O,S,E=function(e){if(e===p&&T)return T;if(!m&&e in j)return j[e];switch(e){case y:case v:case b:return function(){return new n(this,e)}}return function(){return new n(this)}},A=t+" Iterator",C=!1,j=e.prototype,P=j[g]||j["@@iterator"]||p&&j[p],T=!m&&P||E(p),W="Array"==t&&j.entries||P;if(W&&(k=i(W.call(new e)),h!==Object.prototype&&k.next&&(d||i(k)===h||(a?a(k,h):"function"!=typeof k[g]&&s(k,g,_)),l(k,A,!0,!0),d&&(f[A]=_))),p==v&&P&&P.name!==v&&(C=!0,T=function(){return P.call(this)}),d&&!x||j[g]===T||s(j,g,T),f[t]=T,p)if(O={values:E(v),keys:w?T:E(y),entries:E(b)},x)for(S in O)(m||C||!(S in j))&&u(j,S,O[S]);else r({target:t,proto:!0,forced:m||C},O);return O}},9781:(e,t,n)=>{var r=n(7293);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},317:(e,t,n)=>{var r=n(7854),o=n(111),i=r.document,a=o(i)&&o(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},8324:e=>{e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},5268:(e,t,n)=>{var r=n(4326),o=n(7854);e.exports="process"==r(o.process)},8113:(e,t,n)=>{var r=n(5005);e.exports=r("navigator","userAgent")||""},7392:(e,t,n)=>{var r,o,i=n(7854),a=n(8113),l=i.process,s=l&&l.versions,u=s&&s.v8;u?o=(r=u.split("."))[0]+r[1]:a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(o=r[1]),e.exports=o&&+o},748:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:(e,t,n)=>{var r=n(7854),o=n(1236).f,i=n(8880),a=n(1320),l=n(3505),s=n(9920),u=n(4705);e.exports=function(e,t){var n,c,d,f,p,h=e.target,m=e.global,g=e.stat;if(n=m?r:g?r[h]||l(h,{}):(r[h]||{}).prototype)for(c in t){if(f=t[c],d=e.noTargetGet?(p=o(n,c))&&p.value:n[c],!u(m?c:h+(g?".":"#")+c,e.forced)&&void 0!==d){if(typeof f==typeof d)continue;s(f,d)}(e.sham||d&&d.sham)&&i(f,"sham",!0),a(n,c,f,e)}}},7293:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},7007:(e,t,n)=>{"use strict";n(4916);var r=n(1320),o=n(7293),i=n(5112),a=n(2261),l=n(8880),s=i("species"),u=!o((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$
")})),c="$0"==="a".replace(/./,"$0"),d=i("replace"),f=!!/./[d]&&""===/./[d]("a","$0"),p=!o((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));e.exports=function(e,t,n,d){var h=i(e),m=!o((function(){var t={};return t[h]=function(){return 7},7!=""[e](t)})),g=m&&!o((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[s]=function(){return n},n.flags="",n[h]=/./[h]),n.exec=function(){return t=!0,null},n[h](""),!t}));if(!m||!g||"replace"===e&&(!u||!c||f)||"split"===e&&!p){var y=/./[h],v=n(h,""[e],(function(e,t,n,r,o){return t.exec===a?m&&!o?{done:!0,value:y.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),{REPLACE_KEEPS_$0:c,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:f}),b=v[0],_=v[1];r(String.prototype,e,b),r(RegExp.prototype,h,2==t?function(e,t){return _.call(e,this,t)}:function(e){return _.call(e,this)})}d&&l(RegExp.prototype[h],"sham",!0)}},6677:(e,t,n)=>{var r=n(7293);e.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},9974:(e,t,n)=>{var r=n(3099);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},5005:(e,t,n)=>{var r=n(857),o=n(7854),i=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?i(r[e])||i(o[e]):r[e]&&r[e][t]||o[e]&&o[e][t]}},1246:(e,t,n)=>{var r=n(648),o=n(7497),i=n(5112)("iterator");e.exports=function(e){if(null!=e)return e[i]||e["@@iterator"]||o[r(e)]}},647:(e,t,n)=>{var r=n(7908),o=Math.floor,i="".replace,a=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,l=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,n,s,u,c){var d=n+e.length,f=s.length,p=l;return void 0!==u&&(u=r(u),p=a),i.call(c,p,(function(r,i){var a;switch(i.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(d);case"<":a=u[i.slice(1,-1)];break;default:var l=+i;if(0===l)return r;if(l>f){var c=o(l/10);return 0===c?r:c<=f?void 0===s[c-1]?i.charAt(1):s[c-1]+i.charAt(1):r}a=s[l-1]}return void 0===a?"":a}))}},7854:(e,t,n)=>{var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},6656:e=>{var t={}.hasOwnProperty;e.exports=function(e,n){return t.call(e,n)}},3501:e=>{e.exports={}},490:(e,t,n)=>{var r=n(5005);e.exports=r("document","documentElement")},4664:(e,t,n)=>{var r=n(9781),o=n(7293),i=n(317);e.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},8361:(e,t,n)=>{var r=n(7293),o=n(4326),i="".split;e.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?i.call(e,""):Object(e)}:Object},9587:(e,t,n)=>{var r=n(111),o=n(7674);e.exports=function(e,t,n){var i,a;return o&&"function"==typeof(i=t.constructor)&&i!==n&&r(a=i.prototype)&&a!==n.prototype&&o(e,a),e}},2788:(e,t,n)=>{var r=n(5465),o=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(e){return o.call(e)}),e.exports=r.inspectSource},2423:(e,t,n)=>{var r=n(3501),o=n(111),i=n(6656),a=n(3070).f,l=n(9711),s=n(6677),u=l("meta"),c=0,d=Object.isExtensible||function(){return!0},f=function(e){a(e,u,{value:{objectID:"O"+ ++c,weakData:{}}})},p=e.exports={REQUIRED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,u)){if(!d(e))return"F";if(!t)return"E";f(e)}return e[u].objectID},getWeakData:function(e,t){if(!i(e,u)){if(!d(e))return!0;if(!t)return!1;f(e)}return e[u].weakData},onFreeze:function(e){return s&&p.REQUIRED&&d(e)&&!i(e,u)&&f(e),e}};r[u]=!0},9909:(e,t,n)=>{var r,o,i,a=n(8536),l=n(7854),s=n(111),u=n(8880),c=n(6656),d=n(5465),f=n(6200),p=n(3501),h=l.WeakMap;if(a){var m=d.state||(d.state=new h),g=m.get,y=m.has,v=m.set;r=function(e,t){return t.facade=e,v.call(m,e,t),t},o=function(e){return g.call(m,e)||{}},i=function(e){return y.call(m,e)}}else{var b=f("state");p[b]=!0,r=function(e,t){return t.facade=e,u(e,b,t),t},o=function(e){return c(e,b)?e[b]:{}},i=function(e){return c(e,b)}}e.exports={set:r,get:o,has:i,enforce:function(e){return i(e)?o(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!s(t)||(n=o(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},7659:(e,t,n)=>{var r=n(5112),o=n(7497),i=r("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||a[i]===e)}},3157:(e,t,n)=>{var r=n(4326);e.exports=Array.isArray||function(e){return"Array"==r(e)}},4705:(e,t,n)=>{var r=n(7293),o=/#|\.prototype\./,i=function(e,t){var n=l[a(e)];return n==u||n!=s&&("function"==typeof t?r(t):!!t)},a=i.normalize=function(e){return String(e).replace(o,".").toLowerCase()},l=i.data={},s=i.NATIVE="N",u=i.POLYFILL="P";e.exports=i},111:e=>{e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},1913:e=>{e.exports=!1},408:(e,t,n)=>{var r=n(9670),o=n(7659),i=n(7466),a=n(9974),l=n(1246),s=n(9212),u=function(e,t){this.stopped=e,this.result=t};e.exports=function(e,t,n){var c,d,f,p,h,m,g,y=n&&n.that,v=!(!n||!n.AS_ENTRIES),b=!(!n||!n.IS_ITERATOR),_=!(!n||!n.INTERRUPTED),w=a(t,y,1+v+_),x=function(e){return c&&s(c),new u(!0,e)},k=function(e){return v?(r(e),_?w(e[0],e[1],x):w(e[0],e[1])):_?w(e,x):w(e)};if(b)c=e;else{if("function"!=typeof(d=l(e)))throw TypeError("Target is not iterable");if(o(d)){for(f=0,p=i(e.length);p>f;f++)if((h=k(e[f]))&&h instanceof u)return h;return new u(!1)}c=d.call(e)}for(m=c.next;!(g=m.call(c)).done;){try{h=k(g.value)}catch(e){throw s(c),e}if("object"==typeof h&&h&&h instanceof u)return h}return new u(!1)}},9212:(e,t,n)=>{var r=n(9670);e.exports=function(e){var t=e.return;if(void 0!==t)return r(t.call(e)).value}},3383:(e,t,n)=>{"use strict";var r,o,i,a=n(7293),l=n(9518),s=n(8880),u=n(6656),c=n(5112),d=n(1913),f=c("iterator"),p=!1;[].keys&&("next"in(i=[].keys())?(o=l(l(i)))!==Object.prototype&&(r=o):p=!0);var h=null==r||a((function(){var e={};return r[f].call(e)!==e}));h&&(r={}),d&&!h||u(r,f)||s(r,f,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:p}},7497:e=>{e.exports={}},133:(e,t,n)=>{var r=n(5268),o=n(7392),i=n(7293);e.exports=!!Object.getOwnPropertySymbols&&!i((function(){return!Symbol.sham&&(r?38===o:o>37&&o<41)}))},8536:(e,t,n)=>{var r=n(7854),o=n(2788),i=r.WeakMap;e.exports="function"==typeof i&&/native code/.test(o(i))},3009:(e,t,n)=>{var r=n(7854),o=n(3111).trim,i=n(1361),a=r.parseInt,l=/^[+-]?0[Xx]/,s=8!==a(i+"08")||22!==a(i+"0x16");e.exports=s?function(e,t){var n=o(String(e));return a(n,t>>>0||(l.test(n)?16:10))}:a},1574:(e,t,n)=>{"use strict";var r=n(9781),o=n(7293),i=n(1956),a=n(5181),l=n(5296),s=n(7908),u=n(8361),c=Object.assign,d=Object.defineProperty;e.exports=!c||o((function(){if(r&&1!==c({b:1},c(d({},"a",{enumerable:!0,get:function(){d(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),o="abcdefghijklmnopqrst";return e[n]=7,o.split("").forEach((function(e){t[e]=e})),7!=c({},e)[n]||i(c({},t)).join("")!=o}))?function(e,t){for(var n=s(e),o=arguments.length,c=1,d=a.f,f=l.f;o>c;)for(var p,h=u(arguments[c++]),m=d?i(h).concat(d(h)):i(h),g=m.length,y=0;g>y;)p=m[y++],r&&!f.call(h,p)||(n[p]=h[p]);return n}:c},30:(e,t,n)=>{var r,o=n(9670),i=n(6048),a=n(748),l=n(3501),s=n(490),u=n(317),c=n(6200),d=c("IE_PROTO"),f=function(){},p=function(e){return"\n","\n\n\n","\n\n\n","import { render } from \"./Breadcrumbs.vue?vue&type=template&id=5917afb5\"\nimport script from \"./Breadcrumbs.vue?vue&type=script&lang=js\"\nexport * from \"./Breadcrumbs.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","import { render } from \"./Header.vue?vue&type=template&id=2cfbcf58\"\nimport script from \"./Header.vue?vue&type=script&lang=js\"\nexport * from \"./Header.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","export default {\n data() {\n return {\n isOpen: false,\n };\n },\n\n methods: {\n open() {\n if (! this.isOpen) {\n this.isOpen = true;\n this.$dispatcher.emit('open');\n }\n },\n close() {\n if (this.isOpen) {\n this.isOpen = false;\n this.$dispatcher.emit('close');\n }\n },\n toggle() {\n this.isOpen ? this.close() : this.open();\n },\n },\n}\n","import { render } from \"./Sidebar.vue?vue&type=template&id=d3b9352e\"\nimport script from \"./Sidebar.vue?vue&type=script&lang=js\"\nexport * from \"./Sidebar.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","import { render } from \"./Layout.vue?vue&type=template&id=20d109c3\"\nimport script from \"./Layout.vue?vue&type=script&lang=js\"\nexport * from \"./Layout.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","/**\r\n * A collection of shims that provide minimal functionality of the ES6 collections.\r\n *\r\n * These implementations are not meant to be used outside of the ResizeObserver\r\n * modules as they cover only a limited range of use cases.\r\n */\r\n/* eslint-disable require-jsdoc, valid-jsdoc */\r\nvar MapShim = (function () {\r\n if (typeof Map !== 'undefined') {\r\n return Map;\r\n }\r\n /**\r\n * Returns index in provided array that matches the specified key.\r\n *\r\n * @param {Array} arr\r\n * @param {*} key\r\n * @returns {number}\r\n */\r\n function getIndex(arr, key) {\r\n var result = -1;\r\n arr.some(function (entry, index) {\r\n if (entry[0] === key) {\r\n result = index;\r\n return true;\r\n }\r\n return false;\r\n });\r\n return result;\r\n }\r\n return /** @class */ (function () {\r\n function class_1() {\r\n this.__entries__ = [];\r\n }\r\n Object.defineProperty(class_1.prototype, \"size\", {\r\n /**\r\n * @returns {boolean}\r\n */\r\n get: function () {\r\n return this.__entries__.length;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @param {*} key\r\n * @returns {*}\r\n */\r\n class_1.prototype.get = function (key) {\r\n var index = getIndex(this.__entries__, key);\r\n var entry = this.__entries__[index];\r\n return entry && entry[1];\r\n };\r\n /**\r\n * @param {*} key\r\n * @param {*} value\r\n * @returns {void}\r\n */\r\n class_1.prototype.set = function (key, value) {\r\n var index = getIndex(this.__entries__, key);\r\n if (~index) {\r\n this.__entries__[index][1] = value;\r\n }\r\n else {\r\n this.__entries__.push([key, value]);\r\n }\r\n };\r\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\r\n class_1.prototype.delete = function (key) {\r\n var entries = this.__entries__;\r\n var index = getIndex(entries, key);\r\n if (~index) {\r\n entries.splice(index, 1);\r\n }\r\n };\r\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\r\n class_1.prototype.has = function (key) {\r\n return !!~getIndex(this.__entries__, key);\r\n };\r\n /**\r\n * @returns {void}\r\n */\r\n class_1.prototype.clear = function () {\r\n this.__entries__.splice(0);\r\n };\r\n /**\r\n * @param {Function} callback\r\n * @param {*} [ctx=null]\r\n * @returns {void}\r\n */\r\n class_1.prototype.forEach = function (callback, ctx) {\r\n if (ctx === void 0) { ctx = null; }\r\n for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {\r\n var entry = _a[_i];\r\n callback.call(ctx, entry[1], entry[0]);\r\n }\r\n };\r\n return class_1;\r\n }());\r\n})();\n\n/**\r\n * Detects whether window and document objects are available in current environment.\r\n */\r\nvar isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;\n\n// Returns global object of a current environment.\r\nvar global$1 = (function () {\r\n if (typeof global !== 'undefined' && global.Math === Math) {\r\n return global;\r\n }\r\n if (typeof self !== 'undefined' && self.Math === Math) {\r\n return self;\r\n }\r\n if (typeof window !== 'undefined' && window.Math === Math) {\r\n return window;\r\n }\r\n // eslint-disable-next-line no-new-func\r\n return Function('return this')();\r\n})();\n\n/**\r\n * A shim for the requestAnimationFrame which falls back to the setTimeout if\r\n * first one is not supported.\r\n *\r\n * @returns {number} Requests' identifier.\r\n */\r\nvar requestAnimationFrame$1 = (function () {\r\n if (typeof requestAnimationFrame === 'function') {\r\n // It's required to use a bounded function because IE sometimes throws\r\n // an \"Invalid calling object\" error if rAF is invoked without the global\r\n // object on the left hand side.\r\n return requestAnimationFrame.bind(global$1);\r\n }\r\n return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };\r\n})();\n\n// Defines minimum timeout before adding a trailing call.\r\nvar trailingTimeout = 2;\r\n/**\r\n * Creates a wrapper function which ensures that provided callback will be\r\n * invoked only once during the specified delay period.\r\n *\r\n * @param {Function} callback - Function to be invoked after the delay period.\r\n * @param {number} delay - Delay after which to invoke callback.\r\n * @returns {Function}\r\n */\r\nfunction throttle (callback, delay) {\r\n var leadingCall = false, trailingCall = false, lastCallTime = 0;\r\n /**\r\n * Invokes the original callback function and schedules new invocation if\r\n * the \"proxy\" was called during current request.\r\n *\r\n * @returns {void}\r\n */\r\n function resolvePending() {\r\n if (leadingCall) {\r\n leadingCall = false;\r\n callback();\r\n }\r\n if (trailingCall) {\r\n proxy();\r\n }\r\n }\r\n /**\r\n * Callback invoked after the specified delay. It will further postpone\r\n * invocation of the original function delegating it to the\r\n * requestAnimationFrame.\r\n *\r\n * @returns {void}\r\n */\r\n function timeoutCallback() {\r\n requestAnimationFrame$1(resolvePending);\r\n }\r\n /**\r\n * Schedules invocation of the original function.\r\n *\r\n * @returns {void}\r\n */\r\n function proxy() {\r\n var timeStamp = Date.now();\r\n if (leadingCall) {\r\n // Reject immediately following calls.\r\n if (timeStamp - lastCallTime < trailingTimeout) {\r\n return;\r\n }\r\n // Schedule new call to be in invoked when the pending one is resolved.\r\n // This is important for \"transitions\" which never actually start\r\n // immediately so there is a chance that we might miss one if change\r\n // happens amids the pending invocation.\r\n trailingCall = true;\r\n }\r\n else {\r\n leadingCall = true;\r\n trailingCall = false;\r\n setTimeout(timeoutCallback, delay);\r\n }\r\n lastCallTime = timeStamp;\r\n }\r\n return proxy;\r\n}\n\n// Minimum delay before invoking the update of observers.\r\nvar REFRESH_DELAY = 20;\r\n// A list of substrings of CSS properties used to find transition events that\r\n// might affect dimensions of observed elements.\r\nvar transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];\r\n// Check if MutationObserver is available.\r\nvar mutationObserverSupported = typeof MutationObserver !== 'undefined';\r\n/**\r\n * Singleton controller class which handles updates of ResizeObserver instances.\r\n */\r\nvar ResizeObserverController = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserverController.\r\n *\r\n * @private\r\n */\r\n function ResizeObserverController() {\r\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\r\n this.connected_ = false;\r\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\r\n this.mutationEventsAdded_ = false;\r\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\r\n this.mutationsObserver_ = null;\r\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array}\r\n */\r\n this.observers_ = [];\r\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\r\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\r\n }\r\n /**\r\n * Adds observer to observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be added.\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.addObserver = function (observer) {\r\n if (!~this.observers_.indexOf(observer)) {\r\n this.observers_.push(observer);\r\n }\r\n // Add listeners if they haven't been added yet.\r\n if (!this.connected_) {\r\n this.connect_();\r\n }\r\n };\r\n /**\r\n * Removes observer from observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be removed.\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.removeObserver = function (observer) {\r\n var observers = this.observers_;\r\n var index = observers.indexOf(observer);\r\n // Remove observer if it's present in registry.\r\n if (~index) {\r\n observers.splice(index, 1);\r\n }\r\n // Remove listeners if controller has no connected observers.\r\n if (!observers.length && this.connected_) {\r\n this.disconnect_();\r\n }\r\n };\r\n /**\r\n * Invokes the update of observers. It will continue running updates insofar\r\n * it detects changes.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.refresh = function () {\r\n var changesDetected = this.updateObservers_();\r\n // Continue running updates if changes have been detected as there might\r\n // be future ones caused by CSS transitions.\r\n if (changesDetected) {\r\n this.refresh();\r\n }\r\n };\r\n /**\r\n * Updates every observer from observers list and notifies them of queued\r\n * entries.\r\n *\r\n * @private\r\n * @returns {boolean} Returns \"true\" if any observer has detected changes in\r\n * dimensions of it's elements.\r\n */\r\n ResizeObserverController.prototype.updateObservers_ = function () {\r\n // Collect observers that have active observations.\r\n var activeObservers = this.observers_.filter(function (observer) {\r\n return observer.gatherActive(), observer.hasActive();\r\n });\r\n // Deliver notifications in a separate cycle in order to avoid any\r\n // collisions between observers, e.g. when multiple instances of\r\n // ResizeObserver are tracking the same element and the callback of one\r\n // of them changes content dimensions of the observed target. Sometimes\r\n // this may result in notifications being blocked for the rest of observers.\r\n activeObservers.forEach(function (observer) { return observer.broadcastActive(); });\r\n return activeObservers.length > 0;\r\n };\r\n /**\r\n * Initializes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.connect_ = function () {\r\n // Do nothing if running in a non-browser environment or if listeners\r\n // have been already added.\r\n if (!isBrowser || this.connected_) {\r\n return;\r\n }\r\n // Subscription to the \"Transitionend\" event is used as a workaround for\r\n // delayed transitions. This way it's possible to capture at least the\r\n // final state of an element.\r\n document.addEventListener('transitionend', this.onTransitionEnd_);\r\n window.addEventListener('resize', this.refresh);\r\n if (mutationObserverSupported) {\r\n this.mutationsObserver_ = new MutationObserver(this.refresh);\r\n this.mutationsObserver_.observe(document, {\r\n attributes: true,\r\n childList: true,\r\n characterData: true,\r\n subtree: true\r\n });\r\n }\r\n else {\r\n document.addEventListener('DOMSubtreeModified', this.refresh);\r\n this.mutationEventsAdded_ = true;\r\n }\r\n this.connected_ = true;\r\n };\r\n /**\r\n * Removes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.disconnect_ = function () {\r\n // Do nothing if running in a non-browser environment or if listeners\r\n // have been already removed.\r\n if (!isBrowser || !this.connected_) {\r\n return;\r\n }\r\n document.removeEventListener('transitionend', this.onTransitionEnd_);\r\n window.removeEventListener('resize', this.refresh);\r\n if (this.mutationsObserver_) {\r\n this.mutationsObserver_.disconnect();\r\n }\r\n if (this.mutationEventsAdded_) {\r\n document.removeEventListener('DOMSubtreeModified', this.refresh);\r\n }\r\n this.mutationsObserver_ = null;\r\n this.mutationEventsAdded_ = false;\r\n this.connected_ = false;\r\n };\r\n /**\r\n * \"Transitionend\" event handler.\r\n *\r\n * @private\r\n * @param {TransitionEvent} event\r\n * @returns {void}\r\n */\r\n ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {\r\n var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;\r\n // Detect whether transition may affect dimensions of an element.\r\n var isReflowProperty = transitionKeys.some(function (key) {\r\n return !!~propertyName.indexOf(key);\r\n });\r\n if (isReflowProperty) {\r\n this.refresh();\r\n }\r\n };\r\n /**\r\n * Returns instance of the ResizeObserverController.\r\n *\r\n * @returns {ResizeObserverController}\r\n */\r\n ResizeObserverController.getInstance = function () {\r\n if (!this.instance_) {\r\n this.instance_ = new ResizeObserverController();\r\n }\r\n return this.instance_;\r\n };\r\n /**\r\n * Holds reference to the controller's instance.\r\n *\r\n * @private {ResizeObserverController}\r\n */\r\n ResizeObserverController.instance_ = null;\r\n return ResizeObserverController;\r\n}());\n\n/**\r\n * Defines non-writable/enumerable properties of the provided target object.\r\n *\r\n * @param {Object} target - Object for which to define properties.\r\n * @param {Object} props - Properties to be defined.\r\n * @returns {Object} Target object.\r\n */\r\nvar defineConfigurable = (function (target, props) {\r\n for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {\r\n var key = _a[_i];\r\n Object.defineProperty(target, key, {\r\n value: props[key],\r\n enumerable: false,\r\n writable: false,\r\n configurable: true\r\n });\r\n }\r\n return target;\r\n});\n\n/**\r\n * Returns the global object associated with provided element.\r\n *\r\n * @param {Object} target\r\n * @returns {Object}\r\n */\r\nvar getWindowOf = (function (target) {\r\n // Assume that the element is an instance of Node, which means that it\r\n // has the \"ownerDocument\" property from which we can retrieve a\r\n // corresponding global object.\r\n var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;\r\n // Return the local global object if it's not possible extract one from\r\n // provided element.\r\n return ownerGlobal || global$1;\r\n});\n\n// Placeholder of an empty content rectangle.\r\nvar emptyRect = createRectInit(0, 0, 0, 0);\r\n/**\r\n * Converts provided string to a number.\r\n *\r\n * @param {number|string} value\r\n * @returns {number}\r\n */\r\nfunction toFloat(value) {\r\n return parseFloat(value) || 0;\r\n}\r\n/**\r\n * Extracts borders size from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @param {...string} positions - Borders positions (top, right, ...)\r\n * @returns {number}\r\n */\r\nfunction getBordersSize(styles) {\r\n var positions = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n positions[_i - 1] = arguments[_i];\r\n }\r\n return positions.reduce(function (size, position) {\r\n var value = styles['border-' + position + '-width'];\r\n return size + toFloat(value);\r\n }, 0);\r\n}\r\n/**\r\n * Extracts paddings sizes from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @returns {Object} Paddings box.\r\n */\r\nfunction getPaddings(styles) {\r\n var positions = ['top', 'right', 'bottom', 'left'];\r\n var paddings = {};\r\n for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {\r\n var position = positions_1[_i];\r\n var value = styles['padding-' + position];\r\n paddings[position] = toFloat(value);\r\n }\r\n return paddings;\r\n}\r\n/**\r\n * Calculates content rectangle of provided SVG element.\r\n *\r\n * @param {SVGGraphicsElement} target - Element content rectangle of which needs\r\n * to be calculated.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getSVGContentRect(target) {\r\n var bbox = target.getBBox();\r\n return createRectInit(0, 0, bbox.width, bbox.height);\r\n}\r\n/**\r\n * Calculates content rectangle of provided HTMLElement.\r\n *\r\n * @param {HTMLElement} target - Element for which to calculate the content rectangle.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getHTMLElementContentRect(target) {\r\n // Client width & height properties can't be\r\n // used exclusively as they provide rounded values.\r\n var clientWidth = target.clientWidth, clientHeight = target.clientHeight;\r\n // By this condition we can catch all non-replaced inline, hidden and\r\n // detached elements. Though elements with width & height properties less\r\n // than 0.5 will be discarded as well.\r\n //\r\n // Without it we would need to implement separate methods for each of\r\n // those cases and it's not possible to perform a precise and performance\r\n // effective test for hidden elements. E.g. even jQuery's ':visible' filter\r\n // gives wrong results for elements with width & height less than 0.5.\r\n if (!clientWidth && !clientHeight) {\r\n return emptyRect;\r\n }\r\n var styles = getWindowOf(target).getComputedStyle(target);\r\n var paddings = getPaddings(styles);\r\n var horizPad = paddings.left + paddings.right;\r\n var vertPad = paddings.top + paddings.bottom;\r\n // Computed styles of width & height are being used because they are the\r\n // only dimensions available to JS that contain non-rounded values. It could\r\n // be possible to utilize the getBoundingClientRect if only it's data wasn't\r\n // affected by CSS transformations let alone paddings, borders and scroll bars.\r\n var width = toFloat(styles.width), height = toFloat(styles.height);\r\n // Width & height include paddings and borders when the 'border-box' box\r\n // model is applied (except for IE).\r\n if (styles.boxSizing === 'border-box') {\r\n // Following conditions are required to handle Internet Explorer which\r\n // doesn't include paddings and borders to computed CSS dimensions.\r\n //\r\n // We can say that if CSS dimensions + paddings are equal to the \"client\"\r\n // properties then it's either IE, and thus we don't need to subtract\r\n // anything, or an element merely doesn't have paddings/borders styles.\r\n if (Math.round(width + horizPad) !== clientWidth) {\r\n width -= getBordersSize(styles, 'left', 'right') + horizPad;\r\n }\r\n if (Math.round(height + vertPad) !== clientHeight) {\r\n height -= getBordersSize(styles, 'top', 'bottom') + vertPad;\r\n }\r\n }\r\n // Following steps can't be applied to the document's root element as its\r\n // client[Width/Height] properties represent viewport area of the window.\r\n // Besides, it's as well not necessary as the itself neither has\r\n // rendered scroll bars nor it can be clipped.\r\n if (!isDocumentElement(target)) {\r\n // In some browsers (only in Firefox, actually) CSS width & height\r\n // include scroll bars size which can be removed at this step as scroll\r\n // bars are the only difference between rounded dimensions + paddings\r\n // and \"client\" properties, though that is not always true in Chrome.\r\n var vertScrollbar = Math.round(width + horizPad) - clientWidth;\r\n var horizScrollbar = Math.round(height + vertPad) - clientHeight;\r\n // Chrome has a rather weird rounding of \"client\" properties.\r\n // E.g. for an element with content width of 314.2px it sometimes gives\r\n // the client width of 315px and for the width of 314.7px it may give\r\n // 314px. And it doesn't happen all the time. So just ignore this delta\r\n // as a non-relevant.\r\n if (Math.abs(vertScrollbar) !== 1) {\r\n width -= vertScrollbar;\r\n }\r\n if (Math.abs(horizScrollbar) !== 1) {\r\n height -= horizScrollbar;\r\n }\r\n }\r\n return createRectInit(paddings.left, paddings.top, width, height);\r\n}\r\n/**\r\n * Checks whether provided element is an instance of the SVGGraphicsElement.\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\r\nvar isSVGGraphicsElement = (function () {\r\n // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement\r\n // interface.\r\n if (typeof SVGGraphicsElement !== 'undefined') {\r\n return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };\r\n }\r\n // If it's so, then check that element is at least an instance of the\r\n // SVGElement and that it has the \"getBBox\" method.\r\n // eslint-disable-next-line no-extra-parens\r\n return function (target) { return (target instanceof getWindowOf(target).SVGElement &&\r\n typeof target.getBBox === 'function'); };\r\n})();\r\n/**\r\n * Checks whether provided element is a document element ().\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\r\nfunction isDocumentElement(target) {\r\n return target === getWindowOf(target).document.documentElement;\r\n}\r\n/**\r\n * Calculates an appropriate content rectangle for provided html or svg element.\r\n *\r\n * @param {Element} target - Element content rectangle of which needs to be calculated.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction getContentRect(target) {\r\n if (!isBrowser) {\r\n return emptyRect;\r\n }\r\n if (isSVGGraphicsElement(target)) {\r\n return getSVGContentRect(target);\r\n }\r\n return getHTMLElementContentRect(target);\r\n}\r\n/**\r\n * Creates rectangle with an interface of the DOMRectReadOnly.\r\n * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly\r\n *\r\n * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.\r\n * @returns {DOMRectReadOnly}\r\n */\r\nfunction createReadOnlyRect(_a) {\r\n var x = _a.x, y = _a.y, width = _a.width, height = _a.height;\r\n // If DOMRectReadOnly is available use it as a prototype for the rectangle.\r\n var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;\r\n var rect = Object.create(Constr.prototype);\r\n // Rectangle's properties are not writable and non-enumerable.\r\n defineConfigurable(rect, {\r\n x: x, y: y, width: width, height: height,\r\n top: y,\r\n right: x + width,\r\n bottom: height + y,\r\n left: x\r\n });\r\n return rect;\r\n}\r\n/**\r\n * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.\r\n * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit\r\n *\r\n * @param {number} x - X coordinate.\r\n * @param {number} y - Y coordinate.\r\n * @param {number} width - Rectangle's width.\r\n * @param {number} height - Rectangle's height.\r\n * @returns {DOMRectInit}\r\n */\r\nfunction createRectInit(x, y, width, height) {\r\n return { x: x, y: y, width: width, height: height };\r\n}\n\n/**\r\n * Class that is responsible for computations of the content rectangle of\r\n * provided DOM element and for keeping track of it's changes.\r\n */\r\nvar ResizeObservation = /** @class */ (function () {\r\n /**\r\n * Creates an instance of ResizeObservation.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n */\r\n function ResizeObservation(target) {\r\n /**\r\n * Broadcasted width of content rectangle.\r\n *\r\n * @type {number}\r\n */\r\n this.broadcastWidth = 0;\r\n /**\r\n * Broadcasted height of content rectangle.\r\n *\r\n * @type {number}\r\n */\r\n this.broadcastHeight = 0;\r\n /**\r\n * Reference to the last observed content rectangle.\r\n *\r\n * @private {DOMRectInit}\r\n */\r\n this.contentRect_ = createRectInit(0, 0, 0, 0);\r\n this.target = target;\r\n }\r\n /**\r\n * Updates content rectangle and tells whether it's width or height properties\r\n * have changed since the last broadcast.\r\n *\r\n * @returns {boolean}\r\n */\r\n ResizeObservation.prototype.isActive = function () {\r\n var rect = getContentRect(this.target);\r\n this.contentRect_ = rect;\r\n return (rect.width !== this.broadcastWidth ||\r\n rect.height !== this.broadcastHeight);\r\n };\r\n /**\r\n * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data\r\n * from the corresponding properties of the last observed content rectangle.\r\n *\r\n * @returns {DOMRectInit} Last observed content rectangle.\r\n */\r\n ResizeObservation.prototype.broadcastRect = function () {\r\n var rect = this.contentRect_;\r\n this.broadcastWidth = rect.width;\r\n this.broadcastHeight = rect.height;\r\n return rect;\r\n };\r\n return ResizeObservation;\r\n}());\n\nvar ResizeObserverEntry = /** @class */ (function () {\r\n /**\r\n * Creates an instance of ResizeObserverEntry.\r\n *\r\n * @param {Element} target - Element that is being observed.\r\n * @param {DOMRectInit} rectInit - Data of the element's content rectangle.\r\n */\r\n function ResizeObserverEntry(target, rectInit) {\r\n var contentRect = createReadOnlyRect(rectInit);\r\n // According to the specification following properties are not writable\r\n // and are also not enumerable in the native implementation.\r\n //\r\n // Property accessors are not being used as they'd require to define a\r\n // private WeakMap storage which may cause memory leaks in browsers that\r\n // don't support this type of collections.\r\n defineConfigurable(this, { target: target, contentRect: contentRect });\r\n }\r\n return ResizeObserverEntry;\r\n}());\n\nvar ResizeObserverSPI = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserver.\r\n *\r\n * @param {ResizeObserverCallback} callback - Callback function that is invoked\r\n * when one of the observed elements changes it's content dimensions.\r\n * @param {ResizeObserverController} controller - Controller instance which\r\n * is responsible for the updates of observer.\r\n * @param {ResizeObserver} callbackCtx - Reference to the public\r\n * ResizeObserver instance which will be passed to callback function.\r\n */\r\n function ResizeObserverSPI(callback, controller, callbackCtx) {\r\n /**\r\n * Collection of resize observations that have detected changes in dimensions\r\n * of elements.\r\n *\r\n * @private {Array}\r\n */\r\n this.activeObservations_ = [];\r\n /**\r\n * Registry of the ResizeObservation instances.\r\n *\r\n * @private {Map}\r\n */\r\n this.observations_ = new MapShim();\r\n if (typeof callback !== 'function') {\r\n throw new TypeError('The callback provided as parameter 1 is not a function.');\r\n }\r\n this.callback_ = callback;\r\n this.controller_ = controller;\r\n this.callbackCtx_ = callbackCtx;\r\n }\r\n /**\r\n * Starts observing provided element.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.observe = function (target) {\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n // Do nothing if current environment doesn't have the Element interface.\r\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\r\n return;\r\n }\r\n if (!(target instanceof getWindowOf(target).Element)) {\r\n throw new TypeError('parameter 1 is not of type \"Element\".');\r\n }\r\n var observations = this.observations_;\r\n // Do nothing if element is already being observed.\r\n if (observations.has(target)) {\r\n return;\r\n }\r\n observations.set(target, new ResizeObservation(target));\r\n this.controller_.addObserver(this);\r\n // Force the update of observations.\r\n this.controller_.refresh();\r\n };\r\n /**\r\n * Stops observing provided element.\r\n *\r\n * @param {Element} target - Element to stop observing.\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.unobserve = function (target) {\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n // Do nothing if current environment doesn't have the Element interface.\r\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\r\n return;\r\n }\r\n if (!(target instanceof getWindowOf(target).Element)) {\r\n throw new TypeError('parameter 1 is not of type \"Element\".');\r\n }\r\n var observations = this.observations_;\r\n // Do nothing if element is not being observed.\r\n if (!observations.has(target)) {\r\n return;\r\n }\r\n observations.delete(target);\r\n if (!observations.size) {\r\n this.controller_.removeObserver(this);\r\n }\r\n };\r\n /**\r\n * Stops observing all elements.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.disconnect = function () {\r\n this.clearActive();\r\n this.observations_.clear();\r\n this.controller_.removeObserver(this);\r\n };\r\n /**\r\n * Collects observation instances the associated element of which has changed\r\n * it's content rectangle.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.gatherActive = function () {\r\n var _this = this;\r\n this.clearActive();\r\n this.observations_.forEach(function (observation) {\r\n if (observation.isActive()) {\r\n _this.activeObservations_.push(observation);\r\n }\r\n });\r\n };\r\n /**\r\n * Invokes initial callback function with a list of ResizeObserverEntry\r\n * instances collected from active resize observations.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.broadcastActive = function () {\r\n // Do nothing if observer doesn't have active observations.\r\n if (!this.hasActive()) {\r\n return;\r\n }\r\n var ctx = this.callbackCtx_;\r\n // Create ResizeObserverEntry instance for every active observation.\r\n var entries = this.activeObservations_.map(function (observation) {\r\n return new ResizeObserverEntry(observation.target, observation.broadcastRect());\r\n });\r\n this.callback_.call(ctx, entries, ctx);\r\n this.clearActive();\r\n };\r\n /**\r\n * Clears the collection of active observations.\r\n *\r\n * @returns {void}\r\n */\r\n ResizeObserverSPI.prototype.clearActive = function () {\r\n this.activeObservations_.splice(0);\r\n };\r\n /**\r\n * Tells whether observer has active observations.\r\n *\r\n * @returns {boolean}\r\n */\r\n ResizeObserverSPI.prototype.hasActive = function () {\r\n return this.activeObservations_.length > 0;\r\n };\r\n return ResizeObserverSPI;\r\n}());\n\n// Registry of internal observers. If WeakMap is not available use current shim\r\n// for the Map collection as it has all required methods and because WeakMap\r\n// can't be fully polyfilled anyway.\r\nvar observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();\r\n/**\r\n * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation\r\n * exposing only those methods and properties that are defined in the spec.\r\n */\r\nvar ResizeObserver = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of ResizeObserver.\r\n *\r\n * @param {ResizeObserverCallback} callback - Callback that is invoked when\r\n * dimensions of the observed elements change.\r\n */\r\n function ResizeObserver(callback) {\r\n if (!(this instanceof ResizeObserver)) {\r\n throw new TypeError('Cannot call a class as a function.');\r\n }\r\n if (!arguments.length) {\r\n throw new TypeError('1 argument required, but only 0 present.');\r\n }\r\n var controller = ResizeObserverController.getInstance();\r\n var observer = new ResizeObserverSPI(callback, controller, this);\r\n observers.set(this, observer);\r\n }\r\n return ResizeObserver;\r\n}());\r\n// Expose public methods of ResizeObserver.\r\n[\r\n 'observe',\r\n 'unobserve',\r\n 'disconnect'\r\n].forEach(function (method) {\r\n ResizeObserver.prototype[method] = function () {\r\n var _a;\r\n return (_a = observers.get(this))[method].apply(_a, arguments);\r\n };\r\n});\n\nvar index = (function () {\r\n // Export existing implementation if available.\r\n if (typeof global$1.ResizeObserver !== 'undefined') {\r\n return global$1.ResizeObserver;\r\n }\r\n return ResizeObserver;\r\n})();\n\nexport default index;\n","/**\n * SimpleBar.js - v5.3.0\n * Scrollbars, simpler.\n * https://grsmto.github.io/simplebar/\n *\n * Made by Adrien Denat from a fork by Jonathan Nicol\n * Under MIT License\n */\n\nimport 'core-js/modules/es.array.for-each';\nimport 'core-js/modules/web.dom-collections.for-each';\nimport canUseDOM from 'can-use-dom';\nimport 'core-js/modules/es.array.filter';\nimport 'core-js/modules/es.array.iterator';\nimport 'core-js/modules/es.object.assign';\nimport 'core-js/modules/es.object.to-string';\nimport 'core-js/modules/es.parse-int';\nimport 'core-js/modules/es.string.iterator';\nimport 'core-js/modules/es.weak-map';\nimport 'core-js/modules/web.dom-collections.iterator';\nimport throttle from 'lodash.throttle';\nimport debounce from 'lodash.debounce';\nimport memoize from 'lodash.memoize';\nimport ResizeObserver from 'resize-observer-polyfill';\nimport 'core-js/modules/es.array.reduce';\nimport 'core-js/modules/es.function.name';\nimport 'core-js/modules/es.regexp.exec';\nimport 'core-js/modules/es.string.match';\nimport 'core-js/modules/es.string.replace';\n\nvar cachedScrollbarWidth = null;\nvar cachedDevicePixelRatio = null;\n\nif (canUseDOM) {\n window.addEventListener('resize', function () {\n if (cachedDevicePixelRatio !== window.devicePixelRatio) {\n cachedDevicePixelRatio = window.devicePixelRatio;\n cachedScrollbarWidth = null;\n }\n });\n}\n\nfunction scrollbarWidth() {\n if (cachedScrollbarWidth === null) {\n if (typeof document === 'undefined') {\n cachedScrollbarWidth = 0;\n return cachedScrollbarWidth;\n }\n\n var body = document.body;\n var box = document.createElement('div');\n box.classList.add('simplebar-hide-scrollbar');\n body.appendChild(box);\n var width = box.getBoundingClientRect().right;\n body.removeChild(box);\n cachedScrollbarWidth = width;\n }\n\n return cachedScrollbarWidth;\n}\n\n// Helper function to retrieve options from element attributes\nvar getOptions = function getOptions(obj) {\n var options = Array.prototype.reduce.call(obj, function (acc, attribute) {\n var option = attribute.name.match(/data-simplebar-(.+)/);\n\n if (option) {\n var key = option[1].replace(/\\W+(.)/g, function (x, chr) {\n return chr.toUpperCase();\n });\n\n switch (attribute.value) {\n case 'true':\n acc[key] = true;\n break;\n\n case 'false':\n acc[key] = false;\n break;\n\n case undefined:\n acc[key] = true;\n break;\n\n default:\n acc[key] = attribute.value;\n }\n }\n\n return acc;\n }, {});\n return options;\n};\nfunction getElementWindow(element) {\n if (!element || !element.ownerDocument || !element.ownerDocument.defaultView) {\n return window;\n }\n\n return element.ownerDocument.defaultView;\n}\nfunction getElementDocument(element) {\n if (!element || !element.ownerDocument) {\n return document;\n }\n\n return element.ownerDocument;\n}\n\nvar SimpleBar =\n/*#__PURE__*/\nfunction () {\n function SimpleBar(element, options) {\n var _this = this;\n\n this.onScroll = function () {\n var elWindow = getElementWindow(_this.el);\n\n if (!_this.scrollXTicking) {\n elWindow.requestAnimationFrame(_this.scrollX);\n _this.scrollXTicking = true;\n }\n\n if (!_this.scrollYTicking) {\n elWindow.requestAnimationFrame(_this.scrollY);\n _this.scrollYTicking = true;\n }\n };\n\n this.scrollX = function () {\n if (_this.axis.x.isOverflowing) {\n _this.showScrollbar('x');\n\n _this.positionScrollbar('x');\n }\n\n _this.scrollXTicking = false;\n };\n\n this.scrollY = function () {\n if (_this.axis.y.isOverflowing) {\n _this.showScrollbar('y');\n\n _this.positionScrollbar('y');\n }\n\n _this.scrollYTicking = false;\n };\n\n this.onMouseEnter = function () {\n _this.showScrollbar('x');\n\n _this.showScrollbar('y');\n };\n\n this.onMouseMove = function (e) {\n _this.mouseX = e.clientX;\n _this.mouseY = e.clientY;\n\n if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) {\n _this.onMouseMoveForAxis('x');\n }\n\n if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) {\n _this.onMouseMoveForAxis('y');\n }\n };\n\n this.onMouseLeave = function () {\n _this.onMouseMove.cancel();\n\n if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) {\n _this.onMouseLeaveForAxis('x');\n }\n\n if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) {\n _this.onMouseLeaveForAxis('y');\n }\n\n _this.mouseX = -1;\n _this.mouseY = -1;\n };\n\n this.onWindowResize = function () {\n // Recalculate scrollbarWidth in case it's a zoom\n _this.scrollbarWidth = _this.getScrollbarWidth();\n\n _this.hideNativeScrollbar();\n };\n\n this.hideScrollbars = function () {\n _this.axis.x.track.rect = _this.axis.x.track.el.getBoundingClientRect();\n _this.axis.y.track.rect = _this.axis.y.track.el.getBoundingClientRect();\n\n if (!_this.isWithinBounds(_this.axis.y.track.rect)) {\n _this.axis.y.scrollbar.el.classList.remove(_this.classNames.visible);\n\n _this.axis.y.isVisible = false;\n }\n\n if (!_this.isWithinBounds(_this.axis.x.track.rect)) {\n _this.axis.x.scrollbar.el.classList.remove(_this.classNames.visible);\n\n _this.axis.x.isVisible = false;\n }\n };\n\n this.onPointerEvent = function (e) {\n var isWithinTrackXBounds, isWithinTrackYBounds;\n _this.axis.x.track.rect = _this.axis.x.track.el.getBoundingClientRect();\n _this.axis.y.track.rect = _this.axis.y.track.el.getBoundingClientRect();\n\n if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) {\n isWithinTrackXBounds = _this.isWithinBounds(_this.axis.x.track.rect);\n }\n\n if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) {\n isWithinTrackYBounds = _this.isWithinBounds(_this.axis.y.track.rect);\n } // If any pointer event is called on the scrollbar\n\n\n if (isWithinTrackXBounds || isWithinTrackYBounds) {\n // Preventing the event's default action stops text being\n // selectable during the drag.\n e.preventDefault(); // Prevent event leaking\n\n e.stopPropagation();\n\n if (e.type === 'mousedown') {\n if (isWithinTrackXBounds) {\n _this.axis.x.scrollbar.rect = _this.axis.x.scrollbar.el.getBoundingClientRect();\n\n if (_this.isWithinBounds(_this.axis.x.scrollbar.rect)) {\n _this.onDragStart(e, 'x');\n } else {\n _this.onTrackClick(e, 'x');\n }\n }\n\n if (isWithinTrackYBounds) {\n _this.axis.y.scrollbar.rect = _this.axis.y.scrollbar.el.getBoundingClientRect();\n\n if (_this.isWithinBounds(_this.axis.y.scrollbar.rect)) {\n _this.onDragStart(e, 'y');\n } else {\n _this.onTrackClick(e, 'y');\n }\n }\n }\n }\n };\n\n this.drag = function (e) {\n var eventOffset;\n var track = _this.axis[_this.draggedAxis].track;\n var trackSize = track.rect[_this.axis[_this.draggedAxis].sizeAttr];\n var scrollbar = _this.axis[_this.draggedAxis].scrollbar;\n var contentSize = _this.contentWrapperEl[_this.axis[_this.draggedAxis].scrollSizeAttr];\n var hostSize = parseInt(_this.elStyles[_this.axis[_this.draggedAxis].sizeAttr], 10);\n e.preventDefault();\n e.stopPropagation();\n\n if (_this.draggedAxis === 'y') {\n eventOffset = e.pageY;\n } else {\n eventOffset = e.pageX;\n } // Calculate how far the user's mouse is from the top/left of the scrollbar (minus the dragOffset).\n\n\n var dragPos = eventOffset - track.rect[_this.axis[_this.draggedAxis].offsetAttr] - _this.axis[_this.draggedAxis].dragOffset; // Convert the mouse position into a percentage of the scrollbar height/width.\n\n var dragPerc = dragPos / (trackSize - scrollbar.size); // Scroll the content by the same percentage.\n\n var scrollPos = dragPerc * (contentSize - hostSize); // Fix browsers inconsistency on RTL\n\n if (_this.draggedAxis === 'x') {\n scrollPos = _this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollbarInverted ? scrollPos - (trackSize + scrollbar.size) : scrollPos;\n scrollPos = _this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollingInverted ? -scrollPos : scrollPos;\n }\n\n _this.contentWrapperEl[_this.axis[_this.draggedAxis].scrollOffsetAttr] = scrollPos;\n };\n\n this.onEndDrag = function (e) {\n var elDocument = getElementDocument(_this.el);\n var elWindow = getElementWindow(_this.el);\n e.preventDefault();\n e.stopPropagation();\n\n _this.el.classList.remove(_this.classNames.dragging);\n\n elDocument.removeEventListener('mousemove', _this.drag, true);\n elDocument.removeEventListener('mouseup', _this.onEndDrag, true);\n _this.removePreventClickId = elWindow.setTimeout(function () {\n // Remove these asynchronously so we still suppress click events\n // generated simultaneously with mouseup.\n elDocument.removeEventListener('click', _this.preventClick, true);\n elDocument.removeEventListener('dblclick', _this.preventClick, true);\n _this.removePreventClickId = null;\n });\n };\n\n this.preventClick = function (e) {\n e.preventDefault();\n e.stopPropagation();\n };\n\n this.el = element;\n this.minScrollbarWidth = 20;\n this.options = Object.assign({}, SimpleBar.defaultOptions, {}, options);\n this.classNames = Object.assign({}, SimpleBar.defaultOptions.classNames, {}, this.options.classNames);\n this.axis = {\n x: {\n scrollOffsetAttr: 'scrollLeft',\n sizeAttr: 'width',\n scrollSizeAttr: 'scrollWidth',\n offsetSizeAttr: 'offsetWidth',\n offsetAttr: 'left',\n overflowAttr: 'overflowX',\n dragOffset: 0,\n isOverflowing: true,\n isVisible: false,\n forceVisible: false,\n track: {},\n scrollbar: {}\n },\n y: {\n scrollOffsetAttr: 'scrollTop',\n sizeAttr: 'height',\n scrollSizeAttr: 'scrollHeight',\n offsetSizeAttr: 'offsetHeight',\n offsetAttr: 'top',\n overflowAttr: 'overflowY',\n dragOffset: 0,\n isOverflowing: true,\n isVisible: false,\n forceVisible: false,\n track: {},\n scrollbar: {}\n }\n };\n this.removePreventClickId = null; // Don't re-instantiate over an existing one\n\n if (SimpleBar.instances.has(this.el)) {\n return;\n }\n\n this.recalculate = throttle(this.recalculate.bind(this), 64);\n this.onMouseMove = throttle(this.onMouseMove.bind(this), 64);\n this.hideScrollbars = debounce(this.hideScrollbars.bind(this), this.options.timeout);\n this.onWindowResize = debounce(this.onWindowResize.bind(this), 64, {\n leading: true\n });\n SimpleBar.getRtlHelpers = memoize(SimpleBar.getRtlHelpers);\n this.init();\n }\n /**\n * Static properties\n */\n\n /**\n * Helper to fix browsers inconsistency on RTL:\n * - Firefox inverts the scrollbar initial position\n * - IE11 inverts both scrollbar position and scrolling offset\n * Directly inspired by @KingSora's OverlayScrollbars https://github.com/KingSora/OverlayScrollbars/blob/master/js/OverlayScrollbars.js#L1634\n */\n\n\n SimpleBar.getRtlHelpers = function getRtlHelpers() {\n var dummyDiv = document.createElement('div');\n dummyDiv.innerHTML = '
';\n var scrollbarDummyEl = dummyDiv.firstElementChild;\n document.body.appendChild(scrollbarDummyEl);\n var dummyContainerChild = scrollbarDummyEl.firstElementChild;\n scrollbarDummyEl.scrollLeft = 0;\n var dummyContainerOffset = SimpleBar.getOffset(scrollbarDummyEl);\n var dummyContainerChildOffset = SimpleBar.getOffset(dummyContainerChild);\n scrollbarDummyEl.scrollLeft = 999;\n var dummyContainerScrollOffsetAfterScroll = SimpleBar.getOffset(dummyContainerChild);\n return {\n // determines if the scrolling is responding with negative values\n isRtlScrollingInverted: dummyContainerOffset.left !== dummyContainerChildOffset.left && dummyContainerChildOffset.left - dummyContainerScrollOffsetAfterScroll.left !== 0,\n // determines if the origin scrollbar position is inverted or not (positioned on left or right)\n isRtlScrollbarInverted: dummyContainerOffset.left !== dummyContainerChildOffset.left\n };\n };\n\n SimpleBar.getOffset = function getOffset(el) {\n var rect = el.getBoundingClientRect();\n var elDocument = getElementDocument(el);\n var elWindow = getElementWindow(el);\n return {\n top: rect.top + (elWindow.pageYOffset || elDocument.documentElement.scrollTop),\n left: rect.left + (elWindow.pageXOffset || elDocument.documentElement.scrollLeft)\n };\n };\n\n var _proto = SimpleBar.prototype;\n\n _proto.init = function init() {\n // Save a reference to the instance, so we know this DOM node has already been instancied\n SimpleBar.instances.set(this.el, this); // We stop here on server-side\n\n if (canUseDOM) {\n this.initDOM();\n this.scrollbarWidth = this.getScrollbarWidth();\n this.recalculate();\n this.initListeners();\n }\n };\n\n _proto.initDOM = function initDOM() {\n var _this2 = this;\n\n // make sure this element doesn't have the elements yet\n if (Array.prototype.filter.call(this.el.children, function (child) {\n return child.classList.contains(_this2.classNames.wrapper);\n }).length) {\n // assume that element has his DOM already initiated\n this.wrapperEl = this.el.querySelector(\".\" + this.classNames.wrapper);\n this.contentWrapperEl = this.options.scrollableNode || this.el.querySelector(\".\" + this.classNames.contentWrapper);\n this.contentEl = this.options.contentNode || this.el.querySelector(\".\" + this.classNames.contentEl);\n this.offsetEl = this.el.querySelector(\".\" + this.classNames.offset);\n this.maskEl = this.el.querySelector(\".\" + this.classNames.mask);\n this.placeholderEl = this.findChild(this.wrapperEl, \".\" + this.classNames.placeholder);\n this.heightAutoObserverWrapperEl = this.el.querySelector(\".\" + this.classNames.heightAutoObserverWrapperEl);\n this.heightAutoObserverEl = this.el.querySelector(\".\" + this.classNames.heightAutoObserverEl);\n this.axis.x.track.el = this.findChild(this.el, \".\" + this.classNames.track + \".\" + this.classNames.horizontal);\n this.axis.y.track.el = this.findChild(this.el, \".\" + this.classNames.track + \".\" + this.classNames.vertical);\n } else {\n // Prepare DOM\n this.wrapperEl = document.createElement('div');\n this.contentWrapperEl = document.createElement('div');\n this.offsetEl = document.createElement('div');\n this.maskEl = document.createElement('div');\n this.contentEl = document.createElement('div');\n this.placeholderEl = document.createElement('div');\n this.heightAutoObserverWrapperEl = document.createElement('div');\n this.heightAutoObserverEl = document.createElement('div');\n this.wrapperEl.classList.add(this.classNames.wrapper);\n this.contentWrapperEl.classList.add(this.classNames.contentWrapper);\n this.offsetEl.classList.add(this.classNames.offset);\n this.maskEl.classList.add(this.classNames.mask);\n this.contentEl.classList.add(this.classNames.contentEl);\n this.placeholderEl.classList.add(this.classNames.placeholder);\n this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl);\n this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);\n\n while (this.el.firstChild) {\n this.contentEl.appendChild(this.el.firstChild);\n }\n\n this.contentWrapperEl.appendChild(this.contentEl);\n this.offsetEl.appendChild(this.contentWrapperEl);\n this.maskEl.appendChild(this.offsetEl);\n this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl);\n this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl);\n this.wrapperEl.appendChild(this.maskEl);\n this.wrapperEl.appendChild(this.placeholderEl);\n this.el.appendChild(this.wrapperEl);\n }\n\n if (!this.axis.x.track.el || !this.axis.y.track.el) {\n var track = document.createElement('div');\n var scrollbar = document.createElement('div');\n track.classList.add(this.classNames.track);\n scrollbar.classList.add(this.classNames.scrollbar);\n track.appendChild(scrollbar);\n this.axis.x.track.el = track.cloneNode(true);\n this.axis.x.track.el.classList.add(this.classNames.horizontal);\n this.axis.y.track.el = track.cloneNode(true);\n this.axis.y.track.el.classList.add(this.classNames.vertical);\n this.el.appendChild(this.axis.x.track.el);\n this.el.appendChild(this.axis.y.track.el);\n }\n\n this.axis.x.scrollbar.el = this.axis.x.track.el.querySelector(\".\" + this.classNames.scrollbar);\n this.axis.y.scrollbar.el = this.axis.y.track.el.querySelector(\".\" + this.classNames.scrollbar);\n\n if (!this.options.autoHide) {\n this.axis.x.scrollbar.el.classList.add(this.classNames.visible);\n this.axis.y.scrollbar.el.classList.add(this.classNames.visible);\n }\n\n this.el.setAttribute('data-simplebar', 'init');\n };\n\n _proto.initListeners = function initListeners() {\n var _this3 = this;\n\n var elWindow = getElementWindow(this.el); // Event listeners\n\n if (this.options.autoHide) {\n this.el.addEventListener('mouseenter', this.onMouseEnter);\n }\n\n ['mousedown', 'click', 'dblclick'].forEach(function (e) {\n _this3.el.addEventListener(e, _this3.onPointerEvent, true);\n });\n ['touchstart', 'touchend', 'touchmove'].forEach(function (e) {\n _this3.el.addEventListener(e, _this3.onPointerEvent, {\n capture: true,\n passive: true\n });\n });\n this.el.addEventListener('mousemove', this.onMouseMove);\n this.el.addEventListener('mouseleave', this.onMouseLeave);\n this.contentWrapperEl.addEventListener('scroll', this.onScroll); // Browser zoom triggers a window resize\n\n elWindow.addEventListener('resize', this.onWindowResize); // Hack for https://github.com/WICG/ResizeObserver/issues/38\n\n var resizeObserverStarted = false;\n var resizeObserver = elWindow.ResizeObserver || ResizeObserver;\n this.resizeObserver = new resizeObserver(function () {\n if (!resizeObserverStarted) return;\n\n _this3.recalculate();\n });\n this.resizeObserver.observe(this.el);\n this.resizeObserver.observe(this.contentEl);\n elWindow.requestAnimationFrame(function () {\n resizeObserverStarted = true;\n }); // This is required to detect horizontal scroll. Vertical scroll only needs the resizeObserver.\n\n this.mutationObserver = new elWindow.MutationObserver(this.recalculate);\n this.mutationObserver.observe(this.contentEl, {\n childList: true,\n subtree: true,\n characterData: true\n });\n };\n\n _proto.recalculate = function recalculate() {\n var elWindow = getElementWindow(this.el);\n this.elStyles = elWindow.getComputedStyle(this.el);\n this.isRtl = this.elStyles.direction === 'rtl';\n var isHeightAuto = this.heightAutoObserverEl.offsetHeight <= 1;\n var isWidthAuto = this.heightAutoObserverEl.offsetWidth <= 1;\n var contentElOffsetWidth = this.contentEl.offsetWidth;\n var contentWrapperElOffsetWidth = this.contentWrapperEl.offsetWidth;\n var elOverflowX = this.elStyles.overflowX;\n var elOverflowY = this.elStyles.overflowY;\n this.contentEl.style.padding = this.elStyles.paddingTop + \" \" + this.elStyles.paddingRight + \" \" + this.elStyles.paddingBottom + \" \" + this.elStyles.paddingLeft;\n this.wrapperEl.style.margin = \"-\" + this.elStyles.paddingTop + \" -\" + this.elStyles.paddingRight + \" -\" + this.elStyles.paddingBottom + \" -\" + this.elStyles.paddingLeft;\n var contentElScrollHeight = this.contentEl.scrollHeight;\n var contentElScrollWidth = this.contentEl.scrollWidth;\n this.contentWrapperEl.style.height = isHeightAuto ? 'auto' : '100%'; // Determine placeholder size\n\n this.placeholderEl.style.width = isWidthAuto ? contentElOffsetWidth + \"px\" : 'auto';\n this.placeholderEl.style.height = contentElScrollHeight + \"px\";\n var contentWrapperElOffsetHeight = this.contentWrapperEl.offsetHeight;\n this.axis.x.isOverflowing = contentElScrollWidth > contentElOffsetWidth;\n this.axis.y.isOverflowing = contentElScrollHeight > contentWrapperElOffsetHeight; // Set isOverflowing to false if user explicitely set hidden overflow\n\n this.axis.x.isOverflowing = elOverflowX === 'hidden' ? false : this.axis.x.isOverflowing;\n this.axis.y.isOverflowing = elOverflowY === 'hidden' ? false : this.axis.y.isOverflowing;\n this.axis.x.forceVisible = this.options.forceVisible === 'x' || this.options.forceVisible === true;\n this.axis.y.forceVisible = this.options.forceVisible === 'y' || this.options.forceVisible === true;\n this.hideNativeScrollbar(); // Set isOverflowing to false if scrollbar is not necessary (content is shorter than offset)\n\n var offsetForXScrollbar = this.axis.x.isOverflowing ? this.scrollbarWidth : 0;\n var offsetForYScrollbar = this.axis.y.isOverflowing ? this.scrollbarWidth : 0;\n this.axis.x.isOverflowing = this.axis.x.isOverflowing && contentElScrollWidth > contentWrapperElOffsetWidth - offsetForYScrollbar;\n this.axis.y.isOverflowing = this.axis.y.isOverflowing && contentElScrollHeight > contentWrapperElOffsetHeight - offsetForXScrollbar;\n this.axis.x.scrollbar.size = this.getScrollbarSize('x');\n this.axis.y.scrollbar.size = this.getScrollbarSize('y');\n this.axis.x.scrollbar.el.style.width = this.axis.x.scrollbar.size + \"px\";\n this.axis.y.scrollbar.el.style.height = this.axis.y.scrollbar.size + \"px\";\n this.positionScrollbar('x');\n this.positionScrollbar('y');\n this.toggleTrackVisibility('x');\n this.toggleTrackVisibility('y');\n }\n /**\n * Calculate scrollbar size\n */\n ;\n\n _proto.getScrollbarSize = function getScrollbarSize(axis) {\n if (axis === void 0) {\n axis = 'y';\n }\n\n if (!this.axis[axis].isOverflowing) {\n return 0;\n }\n\n var contentSize = this.contentEl[this.axis[axis].scrollSizeAttr];\n var trackSize = this.axis[axis].track.el[this.axis[axis].offsetSizeAttr];\n var scrollbarSize;\n var scrollbarRatio = trackSize / contentSize; // Calculate new height/position of drag handle.\n\n scrollbarSize = Math.max(~~(scrollbarRatio * trackSize), this.options.scrollbarMinSize);\n\n if (this.options.scrollbarMaxSize) {\n scrollbarSize = Math.min(scrollbarSize, this.options.scrollbarMaxSize);\n }\n\n return scrollbarSize;\n };\n\n _proto.positionScrollbar = function positionScrollbar(axis) {\n if (axis === void 0) {\n axis = 'y';\n }\n\n if (!this.axis[axis].isOverflowing) {\n return;\n }\n\n var contentSize = this.contentWrapperEl[this.axis[axis].scrollSizeAttr];\n var trackSize = this.axis[axis].track.el[this.axis[axis].offsetSizeAttr];\n var hostSize = parseInt(this.elStyles[this.axis[axis].sizeAttr], 10);\n var scrollbar = this.axis[axis].scrollbar;\n var scrollOffset = this.contentWrapperEl[this.axis[axis].scrollOffsetAttr];\n scrollOffset = axis === 'x' && this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollingInverted ? -scrollOffset : scrollOffset;\n var scrollPourcent = scrollOffset / (contentSize - hostSize);\n var handleOffset = ~~((trackSize - scrollbar.size) * scrollPourcent);\n handleOffset = axis === 'x' && this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollbarInverted ? handleOffset + (trackSize - scrollbar.size) : handleOffset;\n scrollbar.el.style.transform = axis === 'x' ? \"translate3d(\" + handleOffset + \"px, 0, 0)\" : \"translate3d(0, \" + handleOffset + \"px, 0)\";\n };\n\n _proto.toggleTrackVisibility = function toggleTrackVisibility(axis) {\n if (axis === void 0) {\n axis = 'y';\n }\n\n var track = this.axis[axis].track.el;\n var scrollbar = this.axis[axis].scrollbar.el;\n\n if (this.axis[axis].isOverflowing || this.axis[axis].forceVisible) {\n track.style.visibility = 'visible';\n this.contentWrapperEl.style[this.axis[axis].overflowAttr] = 'scroll';\n } else {\n track.style.visibility = 'hidden';\n this.contentWrapperEl.style[this.axis[axis].overflowAttr] = 'hidden';\n } // Even if forceVisible is enabled, scrollbar itself should be hidden\n\n\n if (this.axis[axis].isOverflowing) {\n scrollbar.style.display = 'block';\n } else {\n scrollbar.style.display = 'none';\n }\n };\n\n _proto.hideNativeScrollbar = function hideNativeScrollbar() {\n this.offsetEl.style[this.isRtl ? 'left' : 'right'] = this.axis.y.isOverflowing || this.axis.y.forceVisible ? \"-\" + this.scrollbarWidth + \"px\" : 0;\n this.offsetEl.style.bottom = this.axis.x.isOverflowing || this.axis.x.forceVisible ? \"-\" + this.scrollbarWidth + \"px\" : 0;\n }\n /**\n * On scroll event handling\n */\n ;\n\n _proto.onMouseMoveForAxis = function onMouseMoveForAxis(axis) {\n if (axis === void 0) {\n axis = 'y';\n }\n\n this.axis[axis].track.rect = this.axis[axis].track.el.getBoundingClientRect();\n this.axis[axis].scrollbar.rect = this.axis[axis].scrollbar.el.getBoundingClientRect();\n var isWithinScrollbarBoundsX = this.isWithinBounds(this.axis[axis].scrollbar.rect);\n\n if (isWithinScrollbarBoundsX) {\n this.axis[axis].scrollbar.el.classList.add(this.classNames.hover);\n } else {\n this.axis[axis].scrollbar.el.classList.remove(this.classNames.hover);\n }\n\n if (this.isWithinBounds(this.axis[axis].track.rect)) {\n this.showScrollbar(axis);\n this.axis[axis].track.el.classList.add(this.classNames.hover);\n } else {\n this.axis[axis].track.el.classList.remove(this.classNames.hover);\n }\n };\n\n _proto.onMouseLeaveForAxis = function onMouseLeaveForAxis(axis) {\n if (axis === void 0) {\n axis = 'y';\n }\n\n this.axis[axis].track.el.classList.remove(this.classNames.hover);\n this.axis[axis].scrollbar.el.classList.remove(this.classNames.hover);\n };\n\n /**\n * Show scrollbar\n */\n _proto.showScrollbar = function showScrollbar(axis) {\n if (axis === void 0) {\n axis = 'y';\n }\n\n var scrollbar = this.axis[axis].scrollbar.el;\n\n if (!this.axis[axis].isVisible) {\n scrollbar.classList.add(this.classNames.visible);\n this.axis[axis].isVisible = true;\n }\n\n if (this.options.autoHide) {\n this.hideScrollbars();\n }\n }\n /**\n * Hide Scrollbar\n */\n ;\n\n /**\n * on scrollbar handle drag movement starts\n */\n _proto.onDragStart = function onDragStart(e, axis) {\n if (axis === void 0) {\n axis = 'y';\n }\n\n var elDocument = getElementDocument(this.el);\n var elWindow = getElementWindow(this.el);\n var scrollbar = this.axis[axis].scrollbar; // Measure how far the user's mouse is from the top of the scrollbar drag handle.\n\n var eventOffset = axis === 'y' ? e.pageY : e.pageX;\n this.axis[axis].dragOffset = eventOffset - scrollbar.rect[this.axis[axis].offsetAttr];\n this.draggedAxis = axis;\n this.el.classList.add(this.classNames.dragging);\n elDocument.addEventListener('mousemove', this.drag, true);\n elDocument.addEventListener('mouseup', this.onEndDrag, true);\n\n if (this.removePreventClickId === null) {\n elDocument.addEventListener('click', this.preventClick, true);\n elDocument.addEventListener('dblclick', this.preventClick, true);\n } else {\n elWindow.clearTimeout(this.removePreventClickId);\n this.removePreventClickId = null;\n }\n }\n /**\n * Drag scrollbar handle\n */\n ;\n\n _proto.onTrackClick = function onTrackClick(e, axis) {\n var _this4 = this;\n\n if (axis === void 0) {\n axis = 'y';\n }\n\n if (!this.options.clickOnTrack) return;\n var elWindow = getElementWindow(this.el);\n this.axis[axis].scrollbar.rect = this.axis[axis].scrollbar.el.getBoundingClientRect();\n var scrollbar = this.axis[axis].scrollbar;\n var scrollbarOffset = scrollbar.rect[this.axis[axis].offsetAttr];\n var hostSize = parseInt(this.elStyles[this.axis[axis].sizeAttr], 10);\n var scrolled = this.contentWrapperEl[this.axis[axis].scrollOffsetAttr];\n var t = axis === 'y' ? this.mouseY - scrollbarOffset : this.mouseX - scrollbarOffset;\n var dir = t < 0 ? -1 : 1;\n var scrollSize = dir === -1 ? scrolled - hostSize : scrolled + hostSize;\n\n var scrollTo = function scrollTo() {\n if (dir === -1) {\n if (scrolled > scrollSize) {\n var _this4$contentWrapper;\n\n scrolled -= _this4.options.clickOnTrackSpeed;\n\n _this4.contentWrapperEl.scrollTo((_this4$contentWrapper = {}, _this4$contentWrapper[_this4.axis[axis].offsetAttr] = scrolled, _this4$contentWrapper));\n\n elWindow.requestAnimationFrame(scrollTo);\n }\n } else {\n if (scrolled < scrollSize) {\n var _this4$contentWrapper2;\n\n scrolled += _this4.options.clickOnTrackSpeed;\n\n _this4.contentWrapperEl.scrollTo((_this4$contentWrapper2 = {}, _this4$contentWrapper2[_this4.axis[axis].offsetAttr] = scrolled, _this4$contentWrapper2));\n\n elWindow.requestAnimationFrame(scrollTo);\n }\n }\n };\n\n scrollTo();\n }\n /**\n * Getter for content element\n */\n ;\n\n _proto.getContentElement = function getContentElement() {\n return this.contentEl;\n }\n /**\n * Getter for original scrolling element\n */\n ;\n\n _proto.getScrollElement = function getScrollElement() {\n return this.contentWrapperEl;\n };\n\n _proto.getScrollbarWidth = function getScrollbarWidth() {\n // Try/catch for FF 56 throwing on undefined computedStyles\n try {\n // Detect browsers supporting CSS scrollbar styling and do not calculate\n if (getComputedStyle(this.contentWrapperEl, '::-webkit-scrollbar').display === 'none' || 'scrollbarWidth' in document.documentElement.style || '-ms-overflow-style' in document.documentElement.style) {\n return 0;\n } else {\n return scrollbarWidth();\n }\n } catch (e) {\n return scrollbarWidth();\n }\n };\n\n _proto.removeListeners = function removeListeners() {\n var _this5 = this;\n\n var elWindow = getElementWindow(this.el); // Event listeners\n\n if (this.options.autoHide) {\n this.el.removeEventListener('mouseenter', this.onMouseEnter);\n }\n\n ['mousedown', 'click', 'dblclick'].forEach(function (e) {\n _this5.el.removeEventListener(e, _this5.onPointerEvent, true);\n });\n ['touchstart', 'touchend', 'touchmove'].forEach(function (e) {\n _this5.el.removeEventListener(e, _this5.onPointerEvent, {\n capture: true,\n passive: true\n });\n });\n this.el.removeEventListener('mousemove', this.onMouseMove);\n this.el.removeEventListener('mouseleave', this.onMouseLeave);\n\n if (this.contentWrapperEl) {\n this.contentWrapperEl.removeEventListener('scroll', this.onScroll);\n }\n\n elWindow.removeEventListener('resize', this.onWindowResize);\n\n if (this.mutationObserver) {\n this.mutationObserver.disconnect();\n }\n\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n } // Cancel all debounced functions\n\n\n this.recalculate.cancel();\n this.onMouseMove.cancel();\n this.hideScrollbars.cancel();\n this.onWindowResize.cancel();\n }\n /**\n * UnMount mutation observer and delete SimpleBar instance from DOM element\n */\n ;\n\n _proto.unMount = function unMount() {\n this.removeListeners();\n SimpleBar.instances.delete(this.el);\n }\n /**\n * Check if mouse is within bounds\n */\n ;\n\n _proto.isWithinBounds = function isWithinBounds(bbox) {\n return this.mouseX >= bbox.left && this.mouseX <= bbox.left + bbox.width && this.mouseY >= bbox.top && this.mouseY <= bbox.top + bbox.height;\n }\n /**\n * Find element children matches query\n */\n ;\n\n _proto.findChild = function findChild(el, query) {\n var matches = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector;\n return Array.prototype.filter.call(el.children, function (child) {\n return matches.call(child, query);\n })[0];\n };\n\n return SimpleBar;\n}();\n\nSimpleBar.defaultOptions = {\n autoHide: true,\n forceVisible: false,\n clickOnTrack: true,\n clickOnTrackSpeed: 40,\n classNames: {\n contentEl: 'simplebar-content',\n contentWrapper: 'simplebar-content-wrapper',\n offset: 'simplebar-offset',\n mask: 'simplebar-mask',\n wrapper: 'simplebar-wrapper',\n placeholder: 'simplebar-placeholder',\n scrollbar: 'simplebar-scrollbar',\n track: 'simplebar-track',\n heightAutoObserverWrapperEl: 'simplebar-height-auto-observer-wrapper',\n heightAutoObserverEl: 'simplebar-height-auto-observer',\n visible: 'simplebar-visible',\n horizontal: 'simplebar-horizontal',\n vertical: 'simplebar-vertical',\n hover: 'simplebar-hover',\n dragging: 'simplebar-dragging'\n },\n scrollbarMinSize: 25,\n scrollbarMaxSize: 0,\n timeout: 1000\n};\nSimpleBar.instances = new WeakMap();\n\nSimpleBar.initDOMLoadedElements = function () {\n document.removeEventListener('DOMContentLoaded', this.initDOMLoadedElements);\n window.removeEventListener('load', this.initDOMLoadedElements);\n Array.prototype.forEach.call(document.querySelectorAll('[data-simplebar]'), function (el) {\n if (el.getAttribute('data-simplebar') !== 'init' && !SimpleBar.instances.has(el)) new SimpleBar(el, getOptions(el.attributes));\n });\n};\n\nSimpleBar.removeObserver = function () {\n this.globalObserver.disconnect();\n};\n\nSimpleBar.initHtmlApi = function () {\n this.initDOMLoadedElements = this.initDOMLoadedElements.bind(this); // MutationObserver is IE11+\n\n if (typeof MutationObserver !== 'undefined') {\n // Mutation observer to observe dynamically added elements\n this.globalObserver = new MutationObserver(SimpleBar.handleMutations);\n this.globalObserver.observe(document, {\n childList: true,\n subtree: true\n });\n } // Taken from jQuery `ready` function\n // Instantiate elements already present on the page\n\n\n if (document.readyState === 'complete' || document.readyState !== 'loading' && !document.documentElement.doScroll) {\n // Handle it asynchronously to allow scripts the opportunity to delay init\n window.setTimeout(this.initDOMLoadedElements);\n } else {\n document.addEventListener('DOMContentLoaded', this.initDOMLoadedElements);\n window.addEventListener('load', this.initDOMLoadedElements);\n }\n};\n\nSimpleBar.handleMutations = function (mutations) {\n mutations.forEach(function (mutation) {\n Array.prototype.forEach.call(mutation.addedNodes, function (addedNode) {\n if (addedNode.nodeType === 1) {\n if (addedNode.hasAttribute('data-simplebar')) {\n !SimpleBar.instances.has(addedNode) && new SimpleBar(addedNode, getOptions(addedNode.attributes));\n } else {\n Array.prototype.forEach.call(addedNode.querySelectorAll('[data-simplebar]'), function (el) {\n if (el.getAttribute('data-simplebar') !== 'init' && !SimpleBar.instances.has(el)) new SimpleBar(el, getOptions(el.attributes));\n });\n }\n }\n });\n Array.prototype.forEach.call(mutation.removedNodes, function (removedNode) {\n if (removedNode.nodeType === 1) {\n if (removedNode.hasAttribute('[data-simplebar=\"init\"]')) {\n SimpleBar.instances.has(removedNode) && SimpleBar.instances.get(removedNode).unMount();\n } else {\n Array.prototype.forEach.call(removedNode.querySelectorAll('[data-simplebar=\"init\"]'), function (el) {\n SimpleBar.instances.has(el) && SimpleBar.instances.get(el).unMount();\n });\n }\n }\n });\n });\n};\n\nSimpleBar.getOptions = getOptions;\n/**\n * HTML API\n * Called only in a browser env.\n */\n\nif (canUseDOM) {\n SimpleBar.initHtmlApi();\n}\n\nexport default SimpleBar;\n//# sourceMappingURL=simplebar.esm.js.map\n","\n\n\n","\n\n\n","\n\n\n","import { render } from \"./Chart.vue?vue&type=template&id=e0ad4266\"\nimport script from \"./Chart.vue?vue&type=script&lang=js\"\nexport * from \"./Chart.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","import { render } from \"./Sales.vue?vue&type=template&id=b6e2a610\"\nimport script from \"./Sales.vue?vue&type=script&lang=js\"\nexport * from \"./Sales.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Metrics.vue?vue&type=template&id=ef43a9b8\"\nimport script from \"./Metrics.vue?vue&type=script&lang=js\"\nexport * from \"./Metrics.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Activities.vue?vue&type=template&id=b08e19ec\"\nimport script from \"./Activities.vue?vue&type=script&lang=js\"\nexport * from \"./Activities.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","import { render } from \"./Dashboard.vue?vue&type=template&id=d8df3014\"\nimport script from \"./Dashboard.vue?vue&type=script&lang=js\"\nexport * from \"./Dashboard.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Support.vue?vue&type=template&id=581ae5c7\"\nimport script from \"./Support.vue?vue&type=script&lang=js\"\nexport * from \"./Support.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Profile.vue?vue&type=template&id=9e68b306\"\nimport script from \"./Profile.vue?vue&type=script&lang=js\"\nexport * from \"./Profile.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Password.vue?vue&type=template&id=223a0c46\"\nimport script from \"./Password.vue?vue&type=script&lang=js\"\nexport * from \"./Password.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","export default {\n mounted() {\n this.mounted = true;\n },\n\n data() {\n return {\n mounted: false,\n };\n },\n}\n","import { render } from \"./Index.vue?vue&type=template&id=f960416e\"\nimport script from \"./Index.vue?vue&type=script&lang=js\"\nexport * from \"./Index.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Show.vue?vue&type=template&id=604128f5\"\nimport script from \"./Show.vue?vue&type=script&lang=js\"\nexport * from \"./Show.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Create.vue?vue&type=template&id=8a689a18\"\nimport script from \"./Create.vue?vue&type=script&lang=js\"\nexport * from \"./Create.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Index.vue?vue&type=template&id=30241f49\"\nimport script from \"./Index.vue?vue&type=script&lang=js\"\nexport * from \"./Index.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Show.vue?vue&type=template&id=0dec84e4\"\nimport script from \"./Show.vue?vue&type=script&lang=js\"\nexport * from \"./Show.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Create.vue?vue&type=template&id=28480c49\"\nimport script from \"./Create.vue?vue&type=script&lang=js\"\nexport * from \"./Create.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Index.vue?vue&type=template&id=98013dc0\"\nimport script from \"./Index.vue?vue&type=script&lang=js\"\nexport * from \"./Index.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","\n\n\n","import { render } from \"./OrderInfo.vue?vue&type=template&id=42789aed\"\nimport script from \"./OrderInfo.vue?vue&type=script&lang=js\"\nexport * from \"./OrderInfo.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","\n\n\n","import { render } from \"./Transaction.vue?vue&type=template&id=0c3df6fa\"\nimport script from \"./Transaction.vue?vue&type=script&lang=js\"\nexport * from \"./Transaction.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","export default class Errors\n{\n /**\n * Create a new errors instance.\n *\n * @param {object} items\n * @return {void}\n */\n constructor(items = {})\n {\n this.fill(items);\n }\n\n /**\n * Get all the errors.\n *\n * @return {object}\n */\n all()\n {\n return this.items;\n }\n\n /**\n * Determine if we have any errors.\n *\n * @return {bool}\n */\n any()\n {\n return Object.keys(this.items).length > 0;\n }\n\n /**\n * Determine if an errors exists for the given field.\n *\n * @param {string} field\n * @return {bool}\n */\n has(field)\n {\n return this.items.hasOwnProperty(field);\n }\n\n /**\n * Retrieve the error message for a field.\n *\n * @param {string} field\n * @return {mixed}\n */\n get(field)\n {\n if (this.has(field)) {\n return this.items[field];\n }\n }\n\n /**\n * Set the errors.\n *\n * @param {string} field\n * @param {string} message\n * @return {void}\n */\n set(field, message)\n {\n Object.assign(this.items, { [field]: message });\n }\n\n /**\n * Clear the given errors.\n *\n * @param {string|null} field\n * @return {void}\n */\n clear(field = null)\n {\n if (field) {\n this.items = Object.keys(this.items).reduce((items, key) => {\n return key === field ? items : Object.assign(items, { [key]: this.items[key] });\n }, {});\n } else {\n this.items = {};\n }\n }\n\n /**\n * Fill the errors by the given values.\n *\n * @param {object} items\n * @return {void}\n */\n fill(items)\n {\n this.items = JSON.parse(JSON.stringify(items));\n }\n}\n","import { render } from \"./CreateTransaction.vue?vue&type=template&id=4f329b0a\"\nimport script from \"./CreateTransaction.vue?vue&type=script&lang=js\"\nexport * from \"./CreateTransaction.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","import { render } from \"./Transactions.vue?vue&type=template&id=2bf9c386\"\nimport script from \"./Transactions.vue?vue&type=script&lang=js\"\nexport * from \"./Transactions.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./ProductsTable.vue?vue&type=template&id=9ff8a940\"\nimport script from \"./ProductsTable.vue?vue&type=script&lang=js\"\nexport * from \"./ProductsTable.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","import { render } from \"./Show.vue?vue&type=template&id=a5cd7338\"\nimport script from \"./Show.vue?vue&type=script&lang=js\"\nexport * from \"./Show.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","\n\n\n","import { render } from \"./Products.vue?vue&type=template&id=088d6bb1\"\nimport script from \"./Products.vue?vue&type=script&lang=js\"\nexport * from \"./Products.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","import { render } from \"./Create.vue?vue&type=template&id=f85b5d00\"\nimport script from \"./Create.vue?vue&type=script&lang=js\"\nexport * from \"./Create.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Index.vue?vue&type=template&id=442be58a\"\nimport script from \"./Index.vue?vue&type=script&lang=js\"\nexport * from \"./Index.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","\n\n\n","import { render } from \"./Files.vue?vue&type=template&id=49515392\"\nimport script from \"./Files.vue?vue&type=script&lang=js\"\nexport * from \"./Files.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","import { render } from \"./Show.vue?vue&type=template&id=c699ca44\"\nimport script from \"./Show.vue?vue&type=script&lang=js\"\nexport * from \"./Show.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Create.vue?vue&type=template&id=2a72798f\"\nimport script from \"./Create.vue?vue&type=script&lang=js\"\nexport * from \"./Create.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Index.vue?vue&type=template&id=3cf75fc7\"\nimport script from \"./Index.vue?vue&type=script&lang=js\"\nexport * from \"./Index.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Show.vue?vue&type=template&id=682ceb2d\"\nimport script from \"./Show.vue?vue&type=script&lang=js\"\nexport * from \"./Show.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Create.vue?vue&type=template&id=18c23190\"\nimport script from \"./Create.vue?vue&type=script&lang=js\"\nexport * from \"./Create.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Index.vue?vue&type=template&id=1e4c2a9a\"\nimport script from \"./Index.vue?vue&type=script&lang=js\"\nexport * from \"./Index.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Show.vue?vue&type=template&id=0aa5d0f6\"\nimport script from \"./Show.vue?vue&type=script&lang=js\"\nexport * from \"./Show.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Create.vue?vue&type=template&id=3ee31c92\"\nimport script from \"./Create.vue?vue&type=script&lang=js\"\nexport * from \"./Create.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","import Dashboard from './../Pages/Dashboard';\nimport Support from './../Pages/Support';\nimport Profile from './../Pages/Profile';\nimport Password from './../Pages/Password';\nimport AddressesIndex from './../Pages/Addresses/Index';\nimport AddressesShow from './../Pages/Addresses/Show';\nimport AddressesCreate from './../Pages/Addresses/Create';\nimport CategoriesIndex from './../Pages/Categories/Index';\nimport CategoriesShow from './../Pages/Categories/Show';\nimport CategoriesCreate from './../Pages/Categories/Create';\nimport OrdersIndex from './../Pages/Orders/Index';\nimport OrdersShow from './../Pages/Orders/Show';\nimport OrdersCreate from './../Pages/Orders/Create';\nimport ProductsIndex from './../Pages/Products/Index';\nimport ProductsShow from './../Pages/Products/Show';\nimport ProductsCreate from './../Pages/Products/Create';\nimport UsersIndex from './../Pages/Users/Index';\nimport UsersShow from './../Pages/Users/Show';\nimport UsersCreate from './../Pages/Users/Create';\nimport VariantsIndex from './../Pages/Variants/Index';\nimport VariantsShow from './../Pages/Variants/Show';\nimport VariantsCreate from './../Pages/Variants/Create';\n\nexport default {\n install(app) {\n window.Bazar.pages = Object.assign({\n 'Dashboard': Dashboard,\n 'Support': Support,\n 'Profile': Profile,\n 'Password': Password,\n 'Addresses/Index': AddressesIndex,\n 'Addresses/Show': AddressesShow,\n 'Addresses/Create': AddressesCreate,\n 'Categories/Index': CategoriesIndex,\n 'Categories/Show': CategoriesShow,\n 'Categories/Create': CategoriesCreate,\n 'Orders/Index': OrdersIndex,\n 'Orders/Show': OrdersShow,\n 'Orders/Create': OrdersCreate,\n 'Products/Index': ProductsIndex,\n 'Products/Show': ProductsShow,\n 'Products/Create': ProductsCreate,\n 'Users/Index': UsersIndex,\n 'Users/Show': UsersShow,\n 'Users/Create': UsersCreate,\n 'Variants/Index': VariantsIndex,\n 'Variants/Show': VariantsShow,\n 'Variants/Create': VariantsCreate,\n }, window.Bazar.pages);\n },\n}\n","import Axios from 'axios';\n\nexport default {\n install(app) {\n app.config.globalProperties.$http = Axios.create({\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'X-Requested-With': 'XMLHttpRequest',\n },\n });\n },\n}\n","export default class Translator\n{\n /**\n * Create a new translator instance.\n *\n * @param {object} translations\n * @return {void}\n */\n constructor(translations = {})\n {\n this.translations = translations;\n }\n\n /**\n * Get and replace the string of the given string.\n *\n * @param {object} translations\n * @param {string} string\n * @param {object} replace\n * @return {string}\n */\n __(string, replace = {})\n {\n string = this.translations[string] || string;\n\n for (let placeholder in replace) {\n string = string.toString()\n .replace(`:${placeholder}`, replace[placeholder])\n .replace(`:${placeholder.toUpperCase()}`, replace[placeholder].toString().toUpperCase())\n .replace(\n `:${placeholder.charAt(0).toUpperCase()}${placeholder.slice(1)}`,\n replace[placeholder].toString().charAt(0).toUpperCase() + replace[placeholder].toString().slice(1)\n );\n }\n\n return string.toString().trim();\n }\n}\n","import Translator from './../Support/Translator';\n\nexport default {\n install(app, options) {\n const translator = new Translator(options.translations);\n\n app.config.globalProperties.__ = (string, replace = {}) => {\n return translator.__(string, replace);\n };\n },\n}\n","\n\n\n","import { render } from \"./Icon.vue?vue&type=template&id=95898a82\"\nimport script from \"./Icon.vue?vue&type=script&lang=js\"\nexport * from \"./Icon.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Dropdown.vue?vue&type=template&id=21b36890\"\nimport script from \"./Dropdown.vue?vue&type=script&lang=js\"\nexport * from \"./Dropdown.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Alert.vue?vue&type=template&id=4a88b38e\"\nimport script from \"./Alert.vue?vue&type=script&lang=js\"\nexport * from \"./Alert.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Card.vue?vue&type=template&id=06c3381c\"\nimport script from \"./Card.vue?vue&type=script&lang=js\"\nexport * from \"./Card.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Modal.vue?vue&type=template&id=695bb2d4\"\nimport script from \"./Modal.vue?vue&type=script&lang=js\"\nexport * from \"./Modal.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","\n\n\n","import { render } from \"./Item.vue?vue&type=template&id=abdd38a4\"\nimport script from \"./Item.vue?vue&type=script&lang=js\"\nexport * from \"./Item.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Filters.vue?vue&type=template&id=62f44a33\"\nimport script from \"./Filters.vue?vue&type=script&lang=js\"\nexport * from \"./Filters.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","\n\n\n","import { render } from \"./SidebarItem.vue?vue&type=template&id=096071b3\"\nimport script from \"./SidebarItem.vue?vue&type=script&lang=js\"\nexport * from \"./SidebarItem.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","import { render } from \"./Sidebar.vue?vue&type=template&id=e5ced200\"\nimport script from \"./Sidebar.vue?vue&type=script&lang=js\"\nexport * from \"./Sidebar.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Toolbar.vue?vue&type=template&id=435d560f\"\nimport script from \"./Toolbar.vue?vue&type=script&lang=js\"\nexport * from \"./Toolbar.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Uploader.vue?vue&type=template&id=31e7435e\"\nimport script from \"./Uploader.vue?vue&type=script&lang=js\"\nexport * from \"./Uploader.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","export default {\n computed: {\n hasNext() {\n return !! this.$parent.response.next_page_url;\n },\n hasPrev() {\n return !! this.$parent.response.prev_page_url;\n },\n pages() {\n return this.$parent.response.last_page || 0;\n },\n total() {\n return this.$parent.response.total || 0;\n },\n },\n\n methods: {\n next() {\n this.$parent.query.page++;\n },\n prev() {\n this.$parent.query.page--;\n },\n to(page) {\n this.$parent.query.page = page;\n },\n isCurrent(page) {\n return this.$parent.response.current_page === page;\n },\n },\n}\n","import { render } from \"./Pagination.vue?vue&type=template&id=69d4e2a6\"\nimport script from \"./Pagination.vue?vue&type=script&lang=js\"\nexport * from \"./Pagination.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","import Errors from '../Components/Form/Errors';\n\nexport default {\n props: {\n endpoint: {\n type: String,\n required: true,\n },\n },\n\n mounted() {\n this.$watch('query', (newValue, oldValue) => {\n this.fetch();\n }, { deep: true });\n },\n\n data() {\n return {\n busy: false,\n errors: new Errors(),\n response: { data: [] },\n query: {\n 'sort[by]': 'created_at',\n 'sort[order]': 'desc',\n page: 1,\n per_page: null,\n search: null,\n },\n };\n },\n\n methods: {\n fetch() {\n this.busy = true;\n this.errors.clear();\n\n this.$http.get(this.endpoint, { params: this.query }).then((response) => {\n this.response = response.data;\n }).catch((error) => {\n this.errors.fill(error.response.data.errors);\n }).finally(() => {\n this.busy = false;\n });\n },\n },\n}\n","import { render } from \"./Manager.vue?vue&type=template&id=771fc624\"\nimport script from \"./Manager.vue?vue&type=script&lang=js\"\nexport * from \"./Manager.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Form.vue?vue&type=template&id=9ce241ba\"\nimport script from \"./Form.vue?vue&type=script&lang=js\"\nexport * from \"./Form.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Tag.vue?vue&type=template&id=ef4b3a70\"\nimport script from \"./Tag.vue?vue&type=script&lang=js\"\nexport * from \"./Tag.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Input.vue?vue&type=template&id=739dae03\"\nimport script from \"./Input.vue?vue&type=script&lang=js\"\nexport * from \"./Input.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Media.vue?vue&type=template&id=73cfef8f\"\nimport script from \"./Media.vue?vue&type=script&lang=js\"\nexport * from \"./Media.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Radio.vue?vue&type=template&id=37d1d6aa\"\nimport script from \"./Radio.vue?vue&type=script&lang=js\"\nexport * from \"./Radio.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Editor.vue?vue&type=template&id=7bf09480\"\nimport script from \"./Editor.vue?vue&type=script&lang=js\"\nexport * from \"./Editor.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Select.vue?vue&type=template&id=65fc6284\"\nimport script from \"./Select.vue?vue&type=script&lang=js\"\nexport * from \"./Select.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Checkbox.vue?vue&type=template&id=747ead7c\"\nimport script from \"./Checkbox.vue?vue&type=script&lang=js\"\nexport * from \"./Checkbox.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Autocomplete.vue?vue&type=template&id=e7248756\"\nimport script from \"./Autocomplete.vue?vue&type=script&lang=js\"\nexport * from \"./Autocomplete.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","import { h } from 'vue';\nimport Tag from './Tag';\nimport Input from './Input';\nimport Media from './Media';\nimport Radio from './Radio';\nimport Editor from './Editor';\nimport Select from './Select';\nimport Checkbox from './Checkbox';\nimport Autocomplete from './Autocomplete';\n\nexport default {\n name: 'FormInput',\n\n props: {\n modelValue: {\n default: null,\n },\n name: {\n type: String,\n required: true,\n },\n handler: {\n type: String,\n default: 'input',\n },\n },\n\n inheritAttrs: false,\n\n emits: ['update:modelValue'],\n\n inject: ['form'],\n\n render() {\n return h(this.getComponent(this.handler), Object.assign({}, this.$attrs, {\n name: this.name,\n error: this.error,\n invalid: this.invalid,\n modelValue: this.modelValue,\n 'onUpdate:modelValue': (value) => {\n this.update(value);\n },\n }), this.$slots.default);\n },\n\n computed: {\n invalid() {\n return this.form.errors.has(this.name);\n },\n error() {\n return this.invalid ? this.form.errors.get(this.name) : null;\n },\n },\n\n methods: {\n update(value) {\n this.$emit('update:modelValue', value);\n\n if (this.invalid) {\n this.form.errors.clear(this.name);\n }\n },\n getComponent(handler) {\n switch (handler) {\n case 'autocomplete':\n return Autocomplete;\n case 'select':\n return Select;\n case 'editor':\n return Editor;\n case 'tag':\n return Tag;\n case 'checkbox':\n return Checkbox;\n case 'media':\n return Media;\n case 'radio':\n return Radio;\n default:\n return Input;\n }\n },\n },\n}\n","\n\n\n","\n\n\n","\n\n\n","import { render } from \"./RowActions.vue?vue&type=template&id=5c0eeb57\"\nimport script from \"./RowActions.vue?vue&type=script&lang=js\"\nexport * from \"./RowActions.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","import { h } from 'vue';\n\nexport default {\n props: {\n column: {\n type: Object,\n required: true,\n },\n },\n\n functional: true,\n\n render() {\n return h('div', {}, this.column.$slots.default(this.$parent.item));\n },\n}\n","import { render } from \"./Row.vue?vue&type=template&id=443a2da2\"\nimport script from \"./Row.vue?vue&type=script&lang=js\"\nexport * from \"./Row.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Filters.vue?vue&type=template&id=d563278a\"\nimport script from \"./Filters.vue?vue&type=script&lang=js\"\nexport * from \"./Filters.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","\n\n\n","import { render } from \"./HeadingActions.vue?vue&type=template&id=c8e78acc\"\nimport script from \"./HeadingActions.vue?vue&type=script&lang=js\"\nexport * from \"./HeadingActions.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","import { render } from \"./Heading.vue?vue&type=template&id=19083c9e\"\nimport script from \"./Heading.vue?vue&type=script&lang=js\"\nexport * from \"./Heading.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Pagination.vue?vue&type=template&id=53fe8562\"\nimport script from \"./Pagination.vue?vue&type=script&lang=js\"\nexport * from \"./Pagination.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","import { render } from \"./Table.vue?vue&type=template&id=34ec2d6f\"\nimport script from \"./Table.vue?vue&type=script&lang=js\"\nexport * from \"./Table.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","\n\n\n","import { render } from \"./Column.vue?vue&type=template&id=404b9fa8\"\nimport script from \"./Column.vue?vue&type=script&lang=js\"\nexport * from \"./Column.vue?vue&type=script&lang=js\"\nscript.render = render\n\nexport default script","export default class Dispatcher\n{\n /**\n * Initialize a new event dispatcher instance.\n *\n * @return {void}\n */\n constructor()\n {\n this.dispatcher = document.createElement('dispatcher');\n }\n\n /**\n * Add an event listener.\n *\n * @param {string} event\n * @param {function} callback\n * @param {object} options\n * @return {void}\n */\n addEventListener(event, callback, options = {})\n {\n this.dispatcher.addEventListener(event, callback, options);\n }\n\n /**\n * Remove an event listener.\n *\n * @param {string} event\n * @param {function} callback\n * @return {void}\n */\n removeEventListener(event, callback)\n {\n this.dispatcher.removeEventListener(event, callback);\n }\n\n /**\n * Dispatch an event.\n *\n * @param {string} event\n * @param {object} detail\n * @return {void}\n */\n dispatchEvent(event, detail = {})\n {\n this.dispatcher.dispatchEvent(new CustomEvent(event, { detail }));\n }\n}\n","import Dispatcher from './../Support/Dispatcher';\n\nexport default {\n beforeCreate() {\n const dispatcher = new Dispatcher();\n\n this.$dispatcher = {\n on: (...args) => dispatcher.addEventListener(...args),\n once: (event, callback, options = {}) => dispatcher.addEventListener(event, callback, { once: true, ...options }),\n off: (...args) => dispatcher.removeEventListener(...args),\n emit: (...args) => dispatcher.dispatchEvent(...args),\n };\n },\n}\n","import { createApp, h } from 'vue';\nimport { App, plugin } from '@inertiajs/inertia-vue3'\nimport { InertiaProgress } from '@inertiajs/progress';\nimport Layout from './Components/Layout';\nimport 'simplebar';\nimport Bazar from './Plugins/Bazar';\nimport Http from './Plugins/Http';\nimport Translator from './Plugins/Translator';\n\nInertiaProgress.init({\n delay: 250,\n color: '#1382f9',\n includeCSS: true,\n});\n\nconst el = document.getElementById('app');\n\nconst app = createApp({\n render() {\n return h(App, {\n initialPage: JSON.parse(el.dataset.page),\n resolveComponent: (name) => {\n let page = window.Bazar.pages[name];\n\n if (! page) {\n throw 'Page is not registered.';\n } else if (page instanceof Promise) {\n page = page.then((component) => {\n component.layout = Layout;\n\n return component;\n });\n } else {\n page.layout = Layout;\n }\n\n return page;\n },\n });\n },\n});\n\n// Plugins\napp.use(plugin);\napp.use(Bazar);\napp.use(Http);\napp.use(Translator, { translations: Bazar.translations });\n\n// Components\nimport Icon from './Components/Icon';\napp.component('icon', Icon);\nimport Dropdown from './Components/Dropdown';\napp.component('dropdown', Dropdown);\nimport Alert from './Components/Alert';\napp.component('alert', Alert);\nimport Card from './Components/Card';\napp.component('card', Card);\nimport Modal from './Components/Modal';\napp.component('modal', Modal);\nimport MediaManager from './Components/Media/Manager';\napp.component('media-manager', MediaManager);\n\nimport Form from './Components/Form/Form';\napp.component('data-form', Form);\nimport Handler from './Components/Form/Handler';\napp.component('data-form-input', Handler);\n\nimport Table from './Components/Table/Table';\napp.component('data-table', Table);\nimport Column from './Components/Table/Column';\napp.component('data-table-column', Column);\n\n// Directives\nimport Debounce from './Directives/Debounce';\napp.directive('debounce', Debounce);\n\n// Mixins\nimport DispatchesEvents from './Mixins/DispatchesEvents';\napp.mixin(DispatchesEvents);\n\n// Mount\ndocument.addEventListener('bazar:boot', () => {\n document.dispatchEvent(new CustomEvent('bazar:booting', { detail: app }));\n\n app.mount(el);\n el.removeAttribute('data-page');\n\n document.dispatchEvent(new CustomEvent('bazar:booted', { detail: app }));\n});\n","const debounce = (callback, delay = 300) => {\n var timeoutID = null;\n\n return function () {\n clearTimeout(timeoutID);\n\n var args = arguments;\n var that = this;\n\n timeoutID = setTimeout(function () {\n callback.apply(that, args);\n }, delay);\n };\n};\n\nexport default (el, binding) => {\n if (binding.value !== binding.oldValue) {\n el.oninput = debounce((event) => {\n el.dispatchEvent(new Event('change'));\n }, parseInt(binding.value) || 300);\n }\n}\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBind = require('./');\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tvar func = $reflectApply(bind, $call, arguments);\n\tif ($gOPD && $defineProperty) {\n\t\tvar desc = $gOPD(func, 'length');\n\t\tif (desc.configurable) {\n\t\t\t// original length, plus the receiver, minus any additional arguments (after the receiver)\n\t\t\t$defineProperty(\n\t\t\t\tfunc,\n\t\t\t\t'length',\n\t\t\t\t{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }\n\t\t\t);\n\t\t}\n\t}\n\treturn func;\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","var canUseDOM = !!(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n);\n\nmodule.exports = canUseDOM;","/*!\n * Chart.js v2.9.4\n * https://www.chartjs.org\n * (c) 2020 Chart.js Contributors\n * Released under the MIT License\n */\n(function (global, factory) {\ntypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(function() { try { return require('moment'); } catch(e) { } }()) :\ntypeof define === 'function' && define.amd ? define(['require'], function(require) { return factory(function() { try { return require('moment'); } catch(e) { } }()); }) :\n(global = global || self, global.Chart = factory(global.moment));\n}(this, (function (moment) { 'use strict';\n\nmoment = moment && moment.hasOwnProperty('default') ? moment['default'] : moment;\n\nfunction createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nfunction getCjsExportFromNamespace (n) {\n\treturn n && n['default'] || n;\n}\n\nvar colorName = {\r\n\t\"aliceblue\": [240, 248, 255],\r\n\t\"antiquewhite\": [250, 235, 215],\r\n\t\"aqua\": [0, 255, 255],\r\n\t\"aquamarine\": [127, 255, 212],\r\n\t\"azure\": [240, 255, 255],\r\n\t\"beige\": [245, 245, 220],\r\n\t\"bisque\": [255, 228, 196],\r\n\t\"black\": [0, 0, 0],\r\n\t\"blanchedalmond\": [255, 235, 205],\r\n\t\"blue\": [0, 0, 255],\r\n\t\"blueviolet\": [138, 43, 226],\r\n\t\"brown\": [165, 42, 42],\r\n\t\"burlywood\": [222, 184, 135],\r\n\t\"cadetblue\": [95, 158, 160],\r\n\t\"chartreuse\": [127, 255, 0],\r\n\t\"chocolate\": [210, 105, 30],\r\n\t\"coral\": [255, 127, 80],\r\n\t\"cornflowerblue\": [100, 149, 237],\r\n\t\"cornsilk\": [255, 248, 220],\r\n\t\"crimson\": [220, 20, 60],\r\n\t\"cyan\": [0, 255, 255],\r\n\t\"darkblue\": [0, 0, 139],\r\n\t\"darkcyan\": [0, 139, 139],\r\n\t\"darkgoldenrod\": [184, 134, 11],\r\n\t\"darkgray\": [169, 169, 169],\r\n\t\"darkgreen\": [0, 100, 0],\r\n\t\"darkgrey\": [169, 169, 169],\r\n\t\"darkkhaki\": [189, 183, 107],\r\n\t\"darkmagenta\": [139, 0, 139],\r\n\t\"darkolivegreen\": [85, 107, 47],\r\n\t\"darkorange\": [255, 140, 0],\r\n\t\"darkorchid\": [153, 50, 204],\r\n\t\"darkred\": [139, 0, 0],\r\n\t\"darksalmon\": [233, 150, 122],\r\n\t\"darkseagreen\": [143, 188, 143],\r\n\t\"darkslateblue\": [72, 61, 139],\r\n\t\"darkslategray\": [47, 79, 79],\r\n\t\"darkslategrey\": [47, 79, 79],\r\n\t\"darkturquoise\": [0, 206, 209],\r\n\t\"darkviolet\": [148, 0, 211],\r\n\t\"deeppink\": [255, 20, 147],\r\n\t\"deepskyblue\": [0, 191, 255],\r\n\t\"dimgray\": [105, 105, 105],\r\n\t\"dimgrey\": [105, 105, 105],\r\n\t\"dodgerblue\": [30, 144, 255],\r\n\t\"firebrick\": [178, 34, 34],\r\n\t\"floralwhite\": [255, 250, 240],\r\n\t\"forestgreen\": [34, 139, 34],\r\n\t\"fuchsia\": [255, 0, 255],\r\n\t\"gainsboro\": [220, 220, 220],\r\n\t\"ghostwhite\": [248, 248, 255],\r\n\t\"gold\": [255, 215, 0],\r\n\t\"goldenrod\": [218, 165, 32],\r\n\t\"gray\": [128, 128, 128],\r\n\t\"green\": [0, 128, 0],\r\n\t\"greenyellow\": [173, 255, 47],\r\n\t\"grey\": [128, 128, 128],\r\n\t\"honeydew\": [240, 255, 240],\r\n\t\"hotpink\": [255, 105, 180],\r\n\t\"indianred\": [205, 92, 92],\r\n\t\"indigo\": [75, 0, 130],\r\n\t\"ivory\": [255, 255, 240],\r\n\t\"khaki\": [240, 230, 140],\r\n\t\"lavender\": [230, 230, 250],\r\n\t\"lavenderblush\": [255, 240, 245],\r\n\t\"lawngreen\": [124, 252, 0],\r\n\t\"lemonchiffon\": [255, 250, 205],\r\n\t\"lightblue\": [173, 216, 230],\r\n\t\"lightcoral\": [240, 128, 128],\r\n\t\"lightcyan\": [224, 255, 255],\r\n\t\"lightgoldenrodyellow\": [250, 250, 210],\r\n\t\"lightgray\": [211, 211, 211],\r\n\t\"lightgreen\": [144, 238, 144],\r\n\t\"lightgrey\": [211, 211, 211],\r\n\t\"lightpink\": [255, 182, 193],\r\n\t\"lightsalmon\": [255, 160, 122],\r\n\t\"lightseagreen\": [32, 178, 170],\r\n\t\"lightskyblue\": [135, 206, 250],\r\n\t\"lightslategray\": [119, 136, 153],\r\n\t\"lightslategrey\": [119, 136, 153],\r\n\t\"lightsteelblue\": [176, 196, 222],\r\n\t\"lightyellow\": [255, 255, 224],\r\n\t\"lime\": [0, 255, 0],\r\n\t\"limegreen\": [50, 205, 50],\r\n\t\"linen\": [250, 240, 230],\r\n\t\"magenta\": [255, 0, 255],\r\n\t\"maroon\": [128, 0, 0],\r\n\t\"mediumaquamarine\": [102, 205, 170],\r\n\t\"mediumblue\": [0, 0, 205],\r\n\t\"mediumorchid\": [186, 85, 211],\r\n\t\"mediumpurple\": [147, 112, 219],\r\n\t\"mediumseagreen\": [60, 179, 113],\r\n\t\"mediumslateblue\": [123, 104, 238],\r\n\t\"mediumspringgreen\": [0, 250, 154],\r\n\t\"mediumturquoise\": [72, 209, 204],\r\n\t\"mediumvioletred\": [199, 21, 133],\r\n\t\"midnightblue\": [25, 25, 112],\r\n\t\"mintcream\": [245, 255, 250],\r\n\t\"mistyrose\": [255, 228, 225],\r\n\t\"moccasin\": [255, 228, 181],\r\n\t\"navajowhite\": [255, 222, 173],\r\n\t\"navy\": [0, 0, 128],\r\n\t\"oldlace\": [253, 245, 230],\r\n\t\"olive\": [128, 128, 0],\r\n\t\"olivedrab\": [107, 142, 35],\r\n\t\"orange\": [255, 165, 0],\r\n\t\"orangered\": [255, 69, 0],\r\n\t\"orchid\": [218, 112, 214],\r\n\t\"palegoldenrod\": [238, 232, 170],\r\n\t\"palegreen\": [152, 251, 152],\r\n\t\"paleturquoise\": [175, 238, 238],\r\n\t\"palevioletred\": [219, 112, 147],\r\n\t\"papayawhip\": [255, 239, 213],\r\n\t\"peachpuff\": [255, 218, 185],\r\n\t\"peru\": [205, 133, 63],\r\n\t\"pink\": [255, 192, 203],\r\n\t\"plum\": [221, 160, 221],\r\n\t\"powderblue\": [176, 224, 230],\r\n\t\"purple\": [128, 0, 128],\r\n\t\"rebeccapurple\": [102, 51, 153],\r\n\t\"red\": [255, 0, 0],\r\n\t\"rosybrown\": [188, 143, 143],\r\n\t\"royalblue\": [65, 105, 225],\r\n\t\"saddlebrown\": [139, 69, 19],\r\n\t\"salmon\": [250, 128, 114],\r\n\t\"sandybrown\": [244, 164, 96],\r\n\t\"seagreen\": [46, 139, 87],\r\n\t\"seashell\": [255, 245, 238],\r\n\t\"sienna\": [160, 82, 45],\r\n\t\"silver\": [192, 192, 192],\r\n\t\"skyblue\": [135, 206, 235],\r\n\t\"slateblue\": [106, 90, 205],\r\n\t\"slategray\": [112, 128, 144],\r\n\t\"slategrey\": [112, 128, 144],\r\n\t\"snow\": [255, 250, 250],\r\n\t\"springgreen\": [0, 255, 127],\r\n\t\"steelblue\": [70, 130, 180],\r\n\t\"tan\": [210, 180, 140],\r\n\t\"teal\": [0, 128, 128],\r\n\t\"thistle\": [216, 191, 216],\r\n\t\"tomato\": [255, 99, 71],\r\n\t\"turquoise\": [64, 224, 208],\r\n\t\"violet\": [238, 130, 238],\r\n\t\"wheat\": [245, 222, 179],\r\n\t\"white\": [255, 255, 255],\r\n\t\"whitesmoke\": [245, 245, 245],\r\n\t\"yellow\": [255, 255, 0],\r\n\t\"yellowgreen\": [154, 205, 50]\r\n};\n\nvar conversions = createCommonjsModule(function (module) {\n/* MIT license */\n\n\n// NOTE: conversions should only return primitive values (i.e. arrays, or\n// values that give correct `typeof` results).\n// do not use box values types (i.e. Number(), String(), etc.)\n\nvar reverseKeywords = {};\nfor (var key in colorName) {\n\tif (colorName.hasOwnProperty(key)) {\n\t\treverseKeywords[colorName[key]] = key;\n\t}\n}\n\nvar convert = module.exports = {\n\trgb: {channels: 3, labels: 'rgb'},\n\thsl: {channels: 3, labels: 'hsl'},\n\thsv: {channels: 3, labels: 'hsv'},\n\thwb: {channels: 3, labels: 'hwb'},\n\tcmyk: {channels: 4, labels: 'cmyk'},\n\txyz: {channels: 3, labels: 'xyz'},\n\tlab: {channels: 3, labels: 'lab'},\n\tlch: {channels: 3, labels: 'lch'},\n\thex: {channels: 1, labels: ['hex']},\n\tkeyword: {channels: 1, labels: ['keyword']},\n\tansi16: {channels: 1, labels: ['ansi16']},\n\tansi256: {channels: 1, labels: ['ansi256']},\n\thcg: {channels: 3, labels: ['h', 'c', 'g']},\n\tapple: {channels: 3, labels: ['r16', 'g16', 'b16']},\n\tgray: {channels: 1, labels: ['gray']}\n};\n\n// hide .channels and .labels properties\nfor (var model in convert) {\n\tif (convert.hasOwnProperty(model)) {\n\t\tif (!('channels' in convert[model])) {\n\t\t\tthrow new Error('missing channels property: ' + model);\n\t\t}\n\n\t\tif (!('labels' in convert[model])) {\n\t\t\tthrow new Error('missing channel labels property: ' + model);\n\t\t}\n\n\t\tif (convert[model].labels.length !== convert[model].channels) {\n\t\t\tthrow new Error('channel and label counts mismatch: ' + model);\n\t\t}\n\n\t\tvar channels = convert[model].channels;\n\t\tvar labels = convert[model].labels;\n\t\tdelete convert[model].channels;\n\t\tdelete convert[model].labels;\n\t\tObject.defineProperty(convert[model], 'channels', {value: channels});\n\t\tObject.defineProperty(convert[model], 'labels', {value: labels});\n\t}\n}\n\nconvert.rgb.hsl = function (rgb) {\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\tvar min = Math.min(r, g, b);\n\tvar max = Math.max(r, g, b);\n\tvar delta = max - min;\n\tvar h;\n\tvar s;\n\tvar l;\n\n\tif (max === min) {\n\t\th = 0;\n\t} else if (r === max) {\n\t\th = (g - b) / delta;\n\t} else if (g === max) {\n\t\th = 2 + (b - r) / delta;\n\t} else if (b === max) {\n\t\th = 4 + (r - g) / delta;\n\t}\n\n\th = Math.min(h * 60, 360);\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tl = (min + max) / 2;\n\n\tif (max === min) {\n\t\ts = 0;\n\t} else if (l <= 0.5) {\n\t\ts = delta / (max + min);\n\t} else {\n\t\ts = delta / (2 - max - min);\n\t}\n\n\treturn [h, s * 100, l * 100];\n};\n\nconvert.rgb.hsv = function (rgb) {\n\tvar rdif;\n\tvar gdif;\n\tvar bdif;\n\tvar h;\n\tvar s;\n\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\tvar v = Math.max(r, g, b);\n\tvar diff = v - Math.min(r, g, b);\n\tvar diffc = function (c) {\n\t\treturn (v - c) / 6 / diff + 1 / 2;\n\t};\n\n\tif (diff === 0) {\n\t\th = s = 0;\n\t} else {\n\t\ts = diff / v;\n\t\trdif = diffc(r);\n\t\tgdif = diffc(g);\n\t\tbdif = diffc(b);\n\n\t\tif (r === v) {\n\t\t\th = bdif - gdif;\n\t\t} else if (g === v) {\n\t\t\th = (1 / 3) + rdif - bdif;\n\t\t} else if (b === v) {\n\t\t\th = (2 / 3) + gdif - rdif;\n\t\t}\n\t\tif (h < 0) {\n\t\t\th += 1;\n\t\t} else if (h > 1) {\n\t\t\th -= 1;\n\t\t}\n\t}\n\n\treturn [\n\t\th * 360,\n\t\ts * 100,\n\t\tv * 100\n\t];\n};\n\nconvert.rgb.hwb = function (rgb) {\n\tvar r = rgb[0];\n\tvar g = rgb[1];\n\tvar b = rgb[2];\n\tvar h = convert.rgb.hsl(rgb)[0];\n\tvar w = 1 / 255 * Math.min(r, Math.min(g, b));\n\n\tb = 1 - 1 / 255 * Math.max(r, Math.max(g, b));\n\n\treturn [h, w * 100, b * 100];\n};\n\nconvert.rgb.cmyk = function (rgb) {\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\tvar c;\n\tvar m;\n\tvar y;\n\tvar k;\n\n\tk = Math.min(1 - r, 1 - g, 1 - b);\n\tc = (1 - r - k) / (1 - k) || 0;\n\tm = (1 - g - k) / (1 - k) || 0;\n\ty = (1 - b - k) / (1 - k) || 0;\n\n\treturn [c * 100, m * 100, y * 100, k * 100];\n};\n\n/**\n * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance\n * */\nfunction comparativeDistance(x, y) {\n\treturn (\n\t\tMath.pow(x[0] - y[0], 2) +\n\t\tMath.pow(x[1] - y[1], 2) +\n\t\tMath.pow(x[2] - y[2], 2)\n\t);\n}\n\nconvert.rgb.keyword = function (rgb) {\n\tvar reversed = reverseKeywords[rgb];\n\tif (reversed) {\n\t\treturn reversed;\n\t}\n\n\tvar currentClosestDistance = Infinity;\n\tvar currentClosestKeyword;\n\n\tfor (var keyword in colorName) {\n\t\tif (colorName.hasOwnProperty(keyword)) {\n\t\t\tvar value = colorName[keyword];\n\n\t\t\t// Compute comparative distance\n\t\t\tvar distance = comparativeDistance(rgb, value);\n\n\t\t\t// Check if its less, if so set as closest\n\t\t\tif (distance < currentClosestDistance) {\n\t\t\t\tcurrentClosestDistance = distance;\n\t\t\t\tcurrentClosestKeyword = keyword;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn currentClosestKeyword;\n};\n\nconvert.keyword.rgb = function (keyword) {\n\treturn colorName[keyword];\n};\n\nconvert.rgb.xyz = function (rgb) {\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\n\t// assume sRGB\n\tr = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);\n\tg = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);\n\tb = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);\n\n\tvar x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);\n\tvar y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);\n\tvar z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);\n\n\treturn [x * 100, y * 100, z * 100];\n};\n\nconvert.rgb.lab = function (rgb) {\n\tvar xyz = convert.rgb.xyz(rgb);\n\tvar x = xyz[0];\n\tvar y = xyz[1];\n\tvar z = xyz[2];\n\tvar l;\n\tvar a;\n\tvar b;\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);\n\ty = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);\n\tz = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);\n\n\tl = (116 * y) - 16;\n\ta = 500 * (x - y);\n\tb = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.hsl.rgb = function (hsl) {\n\tvar h = hsl[0] / 360;\n\tvar s = hsl[1] / 100;\n\tvar l = hsl[2] / 100;\n\tvar t1;\n\tvar t2;\n\tvar t3;\n\tvar rgb;\n\tvar val;\n\n\tif (s === 0) {\n\t\tval = l * 255;\n\t\treturn [val, val, val];\n\t}\n\n\tif (l < 0.5) {\n\t\tt2 = l * (1 + s);\n\t} else {\n\t\tt2 = l + s - l * s;\n\t}\n\n\tt1 = 2 * l - t2;\n\n\trgb = [0, 0, 0];\n\tfor (var i = 0; i < 3; i++) {\n\t\tt3 = h + 1 / 3 * -(i - 1);\n\t\tif (t3 < 0) {\n\t\t\tt3++;\n\t\t}\n\t\tif (t3 > 1) {\n\t\t\tt3--;\n\t\t}\n\n\t\tif (6 * t3 < 1) {\n\t\t\tval = t1 + (t2 - t1) * 6 * t3;\n\t\t} else if (2 * t3 < 1) {\n\t\t\tval = t2;\n\t\t} else if (3 * t3 < 2) {\n\t\t\tval = t1 + (t2 - t1) * (2 / 3 - t3) * 6;\n\t\t} else {\n\t\t\tval = t1;\n\t\t}\n\n\t\trgb[i] = val * 255;\n\t}\n\n\treturn rgb;\n};\n\nconvert.hsl.hsv = function (hsl) {\n\tvar h = hsl[0];\n\tvar s = hsl[1] / 100;\n\tvar l = hsl[2] / 100;\n\tvar smin = s;\n\tvar lmin = Math.max(l, 0.01);\n\tvar sv;\n\tvar v;\n\n\tl *= 2;\n\ts *= (l <= 1) ? l : 2 - l;\n\tsmin *= lmin <= 1 ? lmin : 2 - lmin;\n\tv = (l + s) / 2;\n\tsv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);\n\n\treturn [h, sv * 100, v * 100];\n};\n\nconvert.hsv.rgb = function (hsv) {\n\tvar h = hsv[0] / 60;\n\tvar s = hsv[1] / 100;\n\tvar v = hsv[2] / 100;\n\tvar hi = Math.floor(h) % 6;\n\n\tvar f = h - Math.floor(h);\n\tvar p = 255 * v * (1 - s);\n\tvar q = 255 * v * (1 - (s * f));\n\tvar t = 255 * v * (1 - (s * (1 - f)));\n\tv *= 255;\n\n\tswitch (hi) {\n\t\tcase 0:\n\t\t\treturn [v, t, p];\n\t\tcase 1:\n\t\t\treturn [q, v, p];\n\t\tcase 2:\n\t\t\treturn [p, v, t];\n\t\tcase 3:\n\t\t\treturn [p, q, v];\n\t\tcase 4:\n\t\t\treturn [t, p, v];\n\t\tcase 5:\n\t\t\treturn [v, p, q];\n\t}\n};\n\nconvert.hsv.hsl = function (hsv) {\n\tvar h = hsv[0];\n\tvar s = hsv[1] / 100;\n\tvar v = hsv[2] / 100;\n\tvar vmin = Math.max(v, 0.01);\n\tvar lmin;\n\tvar sl;\n\tvar l;\n\n\tl = (2 - s) * v;\n\tlmin = (2 - s) * vmin;\n\tsl = s * vmin;\n\tsl /= (lmin <= 1) ? lmin : 2 - lmin;\n\tsl = sl || 0;\n\tl /= 2;\n\n\treturn [h, sl * 100, l * 100];\n};\n\n// http://dev.w3.org/csswg/css-color/#hwb-to-rgb\nconvert.hwb.rgb = function (hwb) {\n\tvar h = hwb[0] / 360;\n\tvar wh = hwb[1] / 100;\n\tvar bl = hwb[2] / 100;\n\tvar ratio = wh + bl;\n\tvar i;\n\tvar v;\n\tvar f;\n\tvar n;\n\n\t// wh + bl cant be > 1\n\tif (ratio > 1) {\n\t\twh /= ratio;\n\t\tbl /= ratio;\n\t}\n\n\ti = Math.floor(6 * h);\n\tv = 1 - bl;\n\tf = 6 * h - i;\n\n\tif ((i & 0x01) !== 0) {\n\t\tf = 1 - f;\n\t}\n\n\tn = wh + f * (v - wh); // linear interpolation\n\n\tvar r;\n\tvar g;\n\tvar b;\n\tswitch (i) {\n\t\tdefault:\n\t\tcase 6:\n\t\tcase 0: r = v; g = n; b = wh; break;\n\t\tcase 1: r = n; g = v; b = wh; break;\n\t\tcase 2: r = wh; g = v; b = n; break;\n\t\tcase 3: r = wh; g = n; b = v; break;\n\t\tcase 4: r = n; g = wh; b = v; break;\n\t\tcase 5: r = v; g = wh; b = n; break;\n\t}\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.cmyk.rgb = function (cmyk) {\n\tvar c = cmyk[0] / 100;\n\tvar m = cmyk[1] / 100;\n\tvar y = cmyk[2] / 100;\n\tvar k = cmyk[3] / 100;\n\tvar r;\n\tvar g;\n\tvar b;\n\n\tr = 1 - Math.min(1, c * (1 - k) + k);\n\tg = 1 - Math.min(1, m * (1 - k) + k);\n\tb = 1 - Math.min(1, y * (1 - k) + k);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.rgb = function (xyz) {\n\tvar x = xyz[0] / 100;\n\tvar y = xyz[1] / 100;\n\tvar z = xyz[2] / 100;\n\tvar r;\n\tvar g;\n\tvar b;\n\n\tr = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);\n\tg = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);\n\tb = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);\n\n\t// assume sRGB\n\tr = r > 0.0031308\n\t\t? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)\n\t\t: r * 12.92;\n\n\tg = g > 0.0031308\n\t\t? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)\n\t\t: g * 12.92;\n\n\tb = b > 0.0031308\n\t\t? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)\n\t\t: b * 12.92;\n\n\tr = Math.min(Math.max(0, r), 1);\n\tg = Math.min(Math.max(0, g), 1);\n\tb = Math.min(Math.max(0, b), 1);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.lab = function (xyz) {\n\tvar x = xyz[0];\n\tvar y = xyz[1];\n\tvar z = xyz[2];\n\tvar l;\n\tvar a;\n\tvar b;\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);\n\ty = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);\n\tz = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);\n\n\tl = (116 * y) - 16;\n\ta = 500 * (x - y);\n\tb = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.lab.xyz = function (lab) {\n\tvar l = lab[0];\n\tvar a = lab[1];\n\tvar b = lab[2];\n\tvar x;\n\tvar y;\n\tvar z;\n\n\ty = (l + 16) / 116;\n\tx = a / 500 + y;\n\tz = y - b / 200;\n\n\tvar y2 = Math.pow(y, 3);\n\tvar x2 = Math.pow(x, 3);\n\tvar z2 = Math.pow(z, 3);\n\ty = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;\n\tx = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;\n\tz = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;\n\n\tx *= 95.047;\n\ty *= 100;\n\tz *= 108.883;\n\n\treturn [x, y, z];\n};\n\nconvert.lab.lch = function (lab) {\n\tvar l = lab[0];\n\tvar a = lab[1];\n\tvar b = lab[2];\n\tvar hr;\n\tvar h;\n\tvar c;\n\n\thr = Math.atan2(b, a);\n\th = hr * 360 / 2 / Math.PI;\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tc = Math.sqrt(a * a + b * b);\n\n\treturn [l, c, h];\n};\n\nconvert.lch.lab = function (lch) {\n\tvar l = lch[0];\n\tvar c = lch[1];\n\tvar h = lch[2];\n\tvar a;\n\tvar b;\n\tvar hr;\n\n\thr = h / 360 * 2 * Math.PI;\n\ta = c * Math.cos(hr);\n\tb = c * Math.sin(hr);\n\n\treturn [l, a, b];\n};\n\nconvert.rgb.ansi16 = function (args) {\n\tvar r = args[0];\n\tvar g = args[1];\n\tvar b = args[2];\n\tvar value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization\n\n\tvalue = Math.round(value / 50);\n\n\tif (value === 0) {\n\t\treturn 30;\n\t}\n\n\tvar ansi = 30\n\t\t+ ((Math.round(b / 255) << 2)\n\t\t| (Math.round(g / 255) << 1)\n\t\t| Math.round(r / 255));\n\n\tif (value === 2) {\n\t\tansi += 60;\n\t}\n\n\treturn ansi;\n};\n\nconvert.hsv.ansi16 = function (args) {\n\t// optimization here; we already know the value and don't need to get\n\t// it converted for us.\n\treturn convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);\n};\n\nconvert.rgb.ansi256 = function (args) {\n\tvar r = args[0];\n\tvar g = args[1];\n\tvar b = args[2];\n\n\t// we use the extended greyscale palette here, with the exception of\n\t// black and white. normal palette only has 4 greyscale shades.\n\tif (r === g && g === b) {\n\t\tif (r < 8) {\n\t\t\treturn 16;\n\t\t}\n\n\t\tif (r > 248) {\n\t\t\treturn 231;\n\t\t}\n\n\t\treturn Math.round(((r - 8) / 247) * 24) + 232;\n\t}\n\n\tvar ansi = 16\n\t\t+ (36 * Math.round(r / 255 * 5))\n\t\t+ (6 * Math.round(g / 255 * 5))\n\t\t+ Math.round(b / 255 * 5);\n\n\treturn ansi;\n};\n\nconvert.ansi16.rgb = function (args) {\n\tvar color = args % 10;\n\n\t// handle greyscale\n\tif (color === 0 || color === 7) {\n\t\tif (args > 50) {\n\t\t\tcolor += 3.5;\n\t\t}\n\n\t\tcolor = color / 10.5 * 255;\n\n\t\treturn [color, color, color];\n\t}\n\n\tvar mult = (~~(args > 50) + 1) * 0.5;\n\tvar r = ((color & 1) * mult) * 255;\n\tvar g = (((color >> 1) & 1) * mult) * 255;\n\tvar b = (((color >> 2) & 1) * mult) * 255;\n\n\treturn [r, g, b];\n};\n\nconvert.ansi256.rgb = function (args) {\n\t// handle greyscale\n\tif (args >= 232) {\n\t\tvar c = (args - 232) * 10 + 8;\n\t\treturn [c, c, c];\n\t}\n\n\targs -= 16;\n\n\tvar rem;\n\tvar r = Math.floor(args / 36) / 5 * 255;\n\tvar g = Math.floor((rem = args % 36) / 6) / 5 * 255;\n\tvar b = (rem % 6) / 5 * 255;\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hex = function (args) {\n\tvar integer = ((Math.round(args[0]) & 0xFF) << 16)\n\t\t+ ((Math.round(args[1]) & 0xFF) << 8)\n\t\t+ (Math.round(args[2]) & 0xFF);\n\n\tvar string = integer.toString(16).toUpperCase();\n\treturn '000000'.substring(string.length) + string;\n};\n\nconvert.hex.rgb = function (args) {\n\tvar match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);\n\tif (!match) {\n\t\treturn [0, 0, 0];\n\t}\n\n\tvar colorString = match[0];\n\n\tif (match[0].length === 3) {\n\t\tcolorString = colorString.split('').map(function (char) {\n\t\t\treturn char + char;\n\t\t}).join('');\n\t}\n\n\tvar integer = parseInt(colorString, 16);\n\tvar r = (integer >> 16) & 0xFF;\n\tvar g = (integer >> 8) & 0xFF;\n\tvar b = integer & 0xFF;\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hcg = function (rgb) {\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\tvar max = Math.max(Math.max(r, g), b);\n\tvar min = Math.min(Math.min(r, g), b);\n\tvar chroma = (max - min);\n\tvar grayscale;\n\tvar hue;\n\n\tif (chroma < 1) {\n\t\tgrayscale = min / (1 - chroma);\n\t} else {\n\t\tgrayscale = 0;\n\t}\n\n\tif (chroma <= 0) {\n\t\thue = 0;\n\t} else\n\tif (max === r) {\n\t\thue = ((g - b) / chroma) % 6;\n\t} else\n\tif (max === g) {\n\t\thue = 2 + (b - r) / chroma;\n\t} else {\n\t\thue = 4 + (r - g) / chroma + 4;\n\t}\n\n\thue /= 6;\n\thue %= 1;\n\n\treturn [hue * 360, chroma * 100, grayscale * 100];\n};\n\nconvert.hsl.hcg = function (hsl) {\n\tvar s = hsl[1] / 100;\n\tvar l = hsl[2] / 100;\n\tvar c = 1;\n\tvar f = 0;\n\n\tif (l < 0.5) {\n\t\tc = 2.0 * s * l;\n\t} else {\n\t\tc = 2.0 * s * (1.0 - l);\n\t}\n\n\tif (c < 1.0) {\n\t\tf = (l - 0.5 * c) / (1.0 - c);\n\t}\n\n\treturn [hsl[0], c * 100, f * 100];\n};\n\nconvert.hsv.hcg = function (hsv) {\n\tvar s = hsv[1] / 100;\n\tvar v = hsv[2] / 100;\n\n\tvar c = s * v;\n\tvar f = 0;\n\n\tif (c < 1.0) {\n\t\tf = (v - c) / (1 - c);\n\t}\n\n\treturn [hsv[0], c * 100, f * 100];\n};\n\nconvert.hcg.rgb = function (hcg) {\n\tvar h = hcg[0] / 360;\n\tvar c = hcg[1] / 100;\n\tvar g = hcg[2] / 100;\n\n\tif (c === 0.0) {\n\t\treturn [g * 255, g * 255, g * 255];\n\t}\n\n\tvar pure = [0, 0, 0];\n\tvar hi = (h % 1) * 6;\n\tvar v = hi % 1;\n\tvar w = 1 - v;\n\tvar mg = 0;\n\n\tswitch (Math.floor(hi)) {\n\t\tcase 0:\n\t\t\tpure[0] = 1; pure[1] = v; pure[2] = 0; break;\n\t\tcase 1:\n\t\t\tpure[0] = w; pure[1] = 1; pure[2] = 0; break;\n\t\tcase 2:\n\t\t\tpure[0] = 0; pure[1] = 1; pure[2] = v; break;\n\t\tcase 3:\n\t\t\tpure[0] = 0; pure[1] = w; pure[2] = 1; break;\n\t\tcase 4:\n\t\t\tpure[0] = v; pure[1] = 0; pure[2] = 1; break;\n\t\tdefault:\n\t\t\tpure[0] = 1; pure[1] = 0; pure[2] = w;\n\t}\n\n\tmg = (1.0 - c) * g;\n\n\treturn [\n\t\t(c * pure[0] + mg) * 255,\n\t\t(c * pure[1] + mg) * 255,\n\t\t(c * pure[2] + mg) * 255\n\t];\n};\n\nconvert.hcg.hsv = function (hcg) {\n\tvar c = hcg[1] / 100;\n\tvar g = hcg[2] / 100;\n\n\tvar v = c + g * (1.0 - c);\n\tvar f = 0;\n\n\tif (v > 0.0) {\n\t\tf = c / v;\n\t}\n\n\treturn [hcg[0], f * 100, v * 100];\n};\n\nconvert.hcg.hsl = function (hcg) {\n\tvar c = hcg[1] / 100;\n\tvar g = hcg[2] / 100;\n\n\tvar l = g * (1.0 - c) + 0.5 * c;\n\tvar s = 0;\n\n\tif (l > 0.0 && l < 0.5) {\n\t\ts = c / (2 * l);\n\t} else\n\tif (l >= 0.5 && l < 1.0) {\n\t\ts = c / (2 * (1 - l));\n\t}\n\n\treturn [hcg[0], s * 100, l * 100];\n};\n\nconvert.hcg.hwb = function (hcg) {\n\tvar c = hcg[1] / 100;\n\tvar g = hcg[2] / 100;\n\tvar v = c + g * (1.0 - c);\n\treturn [hcg[0], (v - c) * 100, (1 - v) * 100];\n};\n\nconvert.hwb.hcg = function (hwb) {\n\tvar w = hwb[1] / 100;\n\tvar b = hwb[2] / 100;\n\tvar v = 1 - b;\n\tvar c = v - w;\n\tvar g = 0;\n\n\tif (c < 1) {\n\t\tg = (v - c) / (1 - c);\n\t}\n\n\treturn [hwb[0], c * 100, g * 100];\n};\n\nconvert.apple.rgb = function (apple) {\n\treturn [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];\n};\n\nconvert.rgb.apple = function (rgb) {\n\treturn [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];\n};\n\nconvert.gray.rgb = function (args) {\n\treturn [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];\n};\n\nconvert.gray.hsl = convert.gray.hsv = function (args) {\n\treturn [0, 0, args[0]];\n};\n\nconvert.gray.hwb = function (gray) {\n\treturn [0, 100, gray[0]];\n};\n\nconvert.gray.cmyk = function (gray) {\n\treturn [0, 0, 0, gray[0]];\n};\n\nconvert.gray.lab = function (gray) {\n\treturn [gray[0], 0, 0];\n};\n\nconvert.gray.hex = function (gray) {\n\tvar val = Math.round(gray[0] / 100 * 255) & 0xFF;\n\tvar integer = (val << 16) + (val << 8) + val;\n\n\tvar string = integer.toString(16).toUpperCase();\n\treturn '000000'.substring(string.length) + string;\n};\n\nconvert.rgb.gray = function (rgb) {\n\tvar val = (rgb[0] + rgb[1] + rgb[2]) / 3;\n\treturn [val / 255 * 100];\n};\n});\nvar conversions_1 = conversions.rgb;\nvar conversions_2 = conversions.hsl;\nvar conversions_3 = conversions.hsv;\nvar conversions_4 = conversions.hwb;\nvar conversions_5 = conversions.cmyk;\nvar conversions_6 = conversions.xyz;\nvar conversions_7 = conversions.lab;\nvar conversions_8 = conversions.lch;\nvar conversions_9 = conversions.hex;\nvar conversions_10 = conversions.keyword;\nvar conversions_11 = conversions.ansi16;\nvar conversions_12 = conversions.ansi256;\nvar conversions_13 = conversions.hcg;\nvar conversions_14 = conversions.apple;\nvar conversions_15 = conversions.gray;\n\n/*\n\tthis function routes a model to all other models.\n\n\tall functions that are routed have a property `.conversion` attached\n\tto the returned synthetic function. This property is an array\n\tof strings, each with the steps in between the 'from' and 'to'\n\tcolor models (inclusive).\n\n\tconversions that are not possible simply are not included.\n*/\n\nfunction buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}\n\n// https://en.wikipedia.org/wiki/Breadth-first_search\nfunction deriveBFS(fromModel) {\n\tvar graph = buildGraph();\n\tvar queue = [fromModel]; // unshift -> queue -> pop\n\n\tgraph[fromModel].distance = 0;\n\n\twhile (queue.length) {\n\t\tvar current = queue.pop();\n\t\tvar adjacents = Object.keys(conversions[current]);\n\n\t\tfor (var len = adjacents.length, i = 0; i < len; i++) {\n\t\t\tvar adjacent = adjacents[i];\n\t\t\tvar node = graph[adjacent];\n\n\t\t\tif (node.distance === -1) {\n\t\t\t\tnode.distance = graph[current].distance + 1;\n\t\t\t\tnode.parent = current;\n\t\t\t\tqueue.unshift(adjacent);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn graph;\n}\n\nfunction link(from, to) {\n\treturn function (args) {\n\t\treturn to(from(args));\n\t};\n}\n\nfunction wrapConversion(toModel, graph) {\n\tvar path = [graph[toModel].parent, toModel];\n\tvar fn = conversions[graph[toModel].parent][toModel];\n\n\tvar cur = graph[toModel].parent;\n\twhile (graph[cur].parent) {\n\t\tpath.unshift(graph[cur].parent);\n\t\tfn = link(conversions[graph[cur].parent][cur], fn);\n\t\tcur = graph[cur].parent;\n\t}\n\n\tfn.conversion = path;\n\treturn fn;\n}\n\nvar route = function (fromModel) {\n\tvar graph = deriveBFS(fromModel);\n\tvar conversion = {};\n\n\tvar models = Object.keys(graph);\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tvar toModel = models[i];\n\t\tvar node = graph[toModel];\n\n\t\tif (node.parent === null) {\n\t\t\t// no possible conversion, or this node is the source model.\n\t\t\tcontinue;\n\t\t}\n\n\t\tconversion[toModel] = wrapConversion(toModel, graph);\n\t}\n\n\treturn conversion;\n};\n\nvar convert = {};\n\nvar models = Object.keys(conversions);\n\nfunction wrapRaw(fn) {\n\tvar wrappedFn = function (args) {\n\t\tif (args === undefined || args === null) {\n\t\t\treturn args;\n\t\t}\n\n\t\tif (arguments.length > 1) {\n\t\t\targs = Array.prototype.slice.call(arguments);\n\t\t}\n\n\t\treturn fn(args);\n\t};\n\n\t// preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nfunction wrapRounded(fn) {\n\tvar wrappedFn = function (args) {\n\t\tif (args === undefined || args === null) {\n\t\t\treturn args;\n\t\t}\n\n\t\tif (arguments.length > 1) {\n\t\t\targs = Array.prototype.slice.call(arguments);\n\t\t}\n\n\t\tvar result = fn(args);\n\n\t\t// we're assuming the result is an array here.\n\t\t// see notice in conversions.js; don't use box types\n\t\t// in conversion functions.\n\t\tif (typeof result === 'object') {\n\t\t\tfor (var len = result.length, i = 0; i < len; i++) {\n\t\t\t\tresult[i] = Math.round(result[i]);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t};\n\n\t// preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nmodels.forEach(function (fromModel) {\n\tconvert[fromModel] = {};\n\n\tObject.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});\n\tObject.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});\n\n\tvar routes = route(fromModel);\n\tvar routeModels = Object.keys(routes);\n\n\trouteModels.forEach(function (toModel) {\n\t\tvar fn = routes[toModel];\n\n\t\tconvert[fromModel][toModel] = wrapRounded(fn);\n\t\tconvert[fromModel][toModel].raw = wrapRaw(fn);\n\t});\n});\n\nvar colorConvert = convert;\n\nvar colorName$1 = {\r\n\t\"aliceblue\": [240, 248, 255],\r\n\t\"antiquewhite\": [250, 235, 215],\r\n\t\"aqua\": [0, 255, 255],\r\n\t\"aquamarine\": [127, 255, 212],\r\n\t\"azure\": [240, 255, 255],\r\n\t\"beige\": [245, 245, 220],\r\n\t\"bisque\": [255, 228, 196],\r\n\t\"black\": [0, 0, 0],\r\n\t\"blanchedalmond\": [255, 235, 205],\r\n\t\"blue\": [0, 0, 255],\r\n\t\"blueviolet\": [138, 43, 226],\r\n\t\"brown\": [165, 42, 42],\r\n\t\"burlywood\": [222, 184, 135],\r\n\t\"cadetblue\": [95, 158, 160],\r\n\t\"chartreuse\": [127, 255, 0],\r\n\t\"chocolate\": [210, 105, 30],\r\n\t\"coral\": [255, 127, 80],\r\n\t\"cornflowerblue\": [100, 149, 237],\r\n\t\"cornsilk\": [255, 248, 220],\r\n\t\"crimson\": [220, 20, 60],\r\n\t\"cyan\": [0, 255, 255],\r\n\t\"darkblue\": [0, 0, 139],\r\n\t\"darkcyan\": [0, 139, 139],\r\n\t\"darkgoldenrod\": [184, 134, 11],\r\n\t\"darkgray\": [169, 169, 169],\r\n\t\"darkgreen\": [0, 100, 0],\r\n\t\"darkgrey\": [169, 169, 169],\r\n\t\"darkkhaki\": [189, 183, 107],\r\n\t\"darkmagenta\": [139, 0, 139],\r\n\t\"darkolivegreen\": [85, 107, 47],\r\n\t\"darkorange\": [255, 140, 0],\r\n\t\"darkorchid\": [153, 50, 204],\r\n\t\"darkred\": [139, 0, 0],\r\n\t\"darksalmon\": [233, 150, 122],\r\n\t\"darkseagreen\": [143, 188, 143],\r\n\t\"darkslateblue\": [72, 61, 139],\r\n\t\"darkslategray\": [47, 79, 79],\r\n\t\"darkslategrey\": [47, 79, 79],\r\n\t\"darkturquoise\": [0, 206, 209],\r\n\t\"darkviolet\": [148, 0, 211],\r\n\t\"deeppink\": [255, 20, 147],\r\n\t\"deepskyblue\": [0, 191, 255],\r\n\t\"dimgray\": [105, 105, 105],\r\n\t\"dimgrey\": [105, 105, 105],\r\n\t\"dodgerblue\": [30, 144, 255],\r\n\t\"firebrick\": [178, 34, 34],\r\n\t\"floralwhite\": [255, 250, 240],\r\n\t\"forestgreen\": [34, 139, 34],\r\n\t\"fuchsia\": [255, 0, 255],\r\n\t\"gainsboro\": [220, 220, 220],\r\n\t\"ghostwhite\": [248, 248, 255],\r\n\t\"gold\": [255, 215, 0],\r\n\t\"goldenrod\": [218, 165, 32],\r\n\t\"gray\": [128, 128, 128],\r\n\t\"green\": [0, 128, 0],\r\n\t\"greenyellow\": [173, 255, 47],\r\n\t\"grey\": [128, 128, 128],\r\n\t\"honeydew\": [240, 255, 240],\r\n\t\"hotpink\": [255, 105, 180],\r\n\t\"indianred\": [205, 92, 92],\r\n\t\"indigo\": [75, 0, 130],\r\n\t\"ivory\": [255, 255, 240],\r\n\t\"khaki\": [240, 230, 140],\r\n\t\"lavender\": [230, 230, 250],\r\n\t\"lavenderblush\": [255, 240, 245],\r\n\t\"lawngreen\": [124, 252, 0],\r\n\t\"lemonchiffon\": [255, 250, 205],\r\n\t\"lightblue\": [173, 216, 230],\r\n\t\"lightcoral\": [240, 128, 128],\r\n\t\"lightcyan\": [224, 255, 255],\r\n\t\"lightgoldenrodyellow\": [250, 250, 210],\r\n\t\"lightgray\": [211, 211, 211],\r\n\t\"lightgreen\": [144, 238, 144],\r\n\t\"lightgrey\": [211, 211, 211],\r\n\t\"lightpink\": [255, 182, 193],\r\n\t\"lightsalmon\": [255, 160, 122],\r\n\t\"lightseagreen\": [32, 178, 170],\r\n\t\"lightskyblue\": [135, 206, 250],\r\n\t\"lightslategray\": [119, 136, 153],\r\n\t\"lightslategrey\": [119, 136, 153],\r\n\t\"lightsteelblue\": [176, 196, 222],\r\n\t\"lightyellow\": [255, 255, 224],\r\n\t\"lime\": [0, 255, 0],\r\n\t\"limegreen\": [50, 205, 50],\r\n\t\"linen\": [250, 240, 230],\r\n\t\"magenta\": [255, 0, 255],\r\n\t\"maroon\": [128, 0, 0],\r\n\t\"mediumaquamarine\": [102, 205, 170],\r\n\t\"mediumblue\": [0, 0, 205],\r\n\t\"mediumorchid\": [186, 85, 211],\r\n\t\"mediumpurple\": [147, 112, 219],\r\n\t\"mediumseagreen\": [60, 179, 113],\r\n\t\"mediumslateblue\": [123, 104, 238],\r\n\t\"mediumspringgreen\": [0, 250, 154],\r\n\t\"mediumturquoise\": [72, 209, 204],\r\n\t\"mediumvioletred\": [199, 21, 133],\r\n\t\"midnightblue\": [25, 25, 112],\r\n\t\"mintcream\": [245, 255, 250],\r\n\t\"mistyrose\": [255, 228, 225],\r\n\t\"moccasin\": [255, 228, 181],\r\n\t\"navajowhite\": [255, 222, 173],\r\n\t\"navy\": [0, 0, 128],\r\n\t\"oldlace\": [253, 245, 230],\r\n\t\"olive\": [128, 128, 0],\r\n\t\"olivedrab\": [107, 142, 35],\r\n\t\"orange\": [255, 165, 0],\r\n\t\"orangered\": [255, 69, 0],\r\n\t\"orchid\": [218, 112, 214],\r\n\t\"palegoldenrod\": [238, 232, 170],\r\n\t\"palegreen\": [152, 251, 152],\r\n\t\"paleturquoise\": [175, 238, 238],\r\n\t\"palevioletred\": [219, 112, 147],\r\n\t\"papayawhip\": [255, 239, 213],\r\n\t\"peachpuff\": [255, 218, 185],\r\n\t\"peru\": [205, 133, 63],\r\n\t\"pink\": [255, 192, 203],\r\n\t\"plum\": [221, 160, 221],\r\n\t\"powderblue\": [176, 224, 230],\r\n\t\"purple\": [128, 0, 128],\r\n\t\"rebeccapurple\": [102, 51, 153],\r\n\t\"red\": [255, 0, 0],\r\n\t\"rosybrown\": [188, 143, 143],\r\n\t\"royalblue\": [65, 105, 225],\r\n\t\"saddlebrown\": [139, 69, 19],\r\n\t\"salmon\": [250, 128, 114],\r\n\t\"sandybrown\": [244, 164, 96],\r\n\t\"seagreen\": [46, 139, 87],\r\n\t\"seashell\": [255, 245, 238],\r\n\t\"sienna\": [160, 82, 45],\r\n\t\"silver\": [192, 192, 192],\r\n\t\"skyblue\": [135, 206, 235],\r\n\t\"slateblue\": [106, 90, 205],\r\n\t\"slategray\": [112, 128, 144],\r\n\t\"slategrey\": [112, 128, 144],\r\n\t\"snow\": [255, 250, 250],\r\n\t\"springgreen\": [0, 255, 127],\r\n\t\"steelblue\": [70, 130, 180],\r\n\t\"tan\": [210, 180, 140],\r\n\t\"teal\": [0, 128, 128],\r\n\t\"thistle\": [216, 191, 216],\r\n\t\"tomato\": [255, 99, 71],\r\n\t\"turquoise\": [64, 224, 208],\r\n\t\"violet\": [238, 130, 238],\r\n\t\"wheat\": [245, 222, 179],\r\n\t\"white\": [255, 255, 255],\r\n\t\"whitesmoke\": [245, 245, 245],\r\n\t\"yellow\": [255, 255, 0],\r\n\t\"yellowgreen\": [154, 205, 50]\r\n};\n\n/* MIT license */\n\n\nvar colorString = {\n getRgba: getRgba,\n getHsla: getHsla,\n getRgb: getRgb,\n getHsl: getHsl,\n getHwb: getHwb,\n getAlpha: getAlpha,\n\n hexString: hexString,\n rgbString: rgbString,\n rgbaString: rgbaString,\n percentString: percentString,\n percentaString: percentaString,\n hslString: hslString,\n hslaString: hslaString,\n hwbString: hwbString,\n keyword: keyword\n};\n\nfunction getRgba(string) {\n if (!string) {\n return;\n }\n var abbr = /^#([a-fA-F0-9]{3,4})$/i,\n hex = /^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i,\n rgba = /^rgba?\\(\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)$/i,\n per = /^rgba?\\(\\s*([+-]?[\\d\\.]+)\\%\\s*,\\s*([+-]?[\\d\\.]+)\\%\\s*,\\s*([+-]?[\\d\\.]+)\\%\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)$/i,\n keyword = /(\\w+)/;\n\n var rgb = [0, 0, 0],\n a = 1,\n match = string.match(abbr),\n hexAlpha = \"\";\n if (match) {\n match = match[1];\n hexAlpha = match[3];\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = parseInt(match[i] + match[i], 16);\n }\n if (hexAlpha) {\n a = Math.round((parseInt(hexAlpha + hexAlpha, 16) / 255) * 100) / 100;\n }\n }\n else if (match = string.match(hex)) {\n hexAlpha = match[2];\n match = match[1];\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = parseInt(match.slice(i * 2, i * 2 + 2), 16);\n }\n if (hexAlpha) {\n a = Math.round((parseInt(hexAlpha, 16) / 255) * 100) / 100;\n }\n }\n else if (match = string.match(rgba)) {\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = parseInt(match[i + 1]);\n }\n a = parseFloat(match[4]);\n }\n else if (match = string.match(per)) {\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);\n }\n a = parseFloat(match[4]);\n }\n else if (match = string.match(keyword)) {\n if (match[1] == \"transparent\") {\n return [0, 0, 0, 0];\n }\n rgb = colorName$1[match[1]];\n if (!rgb) {\n return;\n }\n }\n\n for (var i = 0; i < rgb.length; i++) {\n rgb[i] = scale(rgb[i], 0, 255);\n }\n if (!a && a != 0) {\n a = 1;\n }\n else {\n a = scale(a, 0, 1);\n }\n rgb[3] = a;\n return rgb;\n}\n\nfunction getHsla(string) {\n if (!string) {\n return;\n }\n var hsl = /^hsla?\\(\\s*([+-]?\\d+)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)/;\n var match = string.match(hsl);\n if (match) {\n var alpha = parseFloat(match[4]);\n var h = scale(parseInt(match[1]), 0, 360),\n s = scale(parseFloat(match[2]), 0, 100),\n l = scale(parseFloat(match[3]), 0, 100),\n a = scale(isNaN(alpha) ? 1 : alpha, 0, 1);\n return [h, s, l, a];\n }\n}\n\nfunction getHwb(string) {\n if (!string) {\n return;\n }\n var hwb = /^hwb\\(\\s*([+-]?\\d+)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?[\\d\\.]+)\\s*)?\\)/;\n var match = string.match(hwb);\n if (match) {\n var alpha = parseFloat(match[4]);\n var h = scale(parseInt(match[1]), 0, 360),\n w = scale(parseFloat(match[2]), 0, 100),\n b = scale(parseFloat(match[3]), 0, 100),\n a = scale(isNaN(alpha) ? 1 : alpha, 0, 1);\n return [h, w, b, a];\n }\n}\n\nfunction getRgb(string) {\n var rgba = getRgba(string);\n return rgba && rgba.slice(0, 3);\n}\n\nfunction getHsl(string) {\n var hsla = getHsla(string);\n return hsla && hsla.slice(0, 3);\n}\n\nfunction getAlpha(string) {\n var vals = getRgba(string);\n if (vals) {\n return vals[3];\n }\n else if (vals = getHsla(string)) {\n return vals[3];\n }\n else if (vals = getHwb(string)) {\n return vals[3];\n }\n}\n\n// generators\nfunction hexString(rgba, a) {\n var a = (a !== undefined && rgba.length === 3) ? a : rgba[3];\n return \"#\" + hexDouble(rgba[0]) \n + hexDouble(rgba[1])\n + hexDouble(rgba[2])\n + (\n (a >= 0 && a < 1)\n ? hexDouble(Math.round(a * 255))\n : \"\"\n );\n}\n\nfunction rgbString(rgba, alpha) {\n if (alpha < 1 || (rgba[3] && rgba[3] < 1)) {\n return rgbaString(rgba, alpha);\n }\n return \"rgb(\" + rgba[0] + \", \" + rgba[1] + \", \" + rgba[2] + \")\";\n}\n\nfunction rgbaString(rgba, alpha) {\n if (alpha === undefined) {\n alpha = (rgba[3] !== undefined ? rgba[3] : 1);\n }\n return \"rgba(\" + rgba[0] + \", \" + rgba[1] + \", \" + rgba[2]\n + \", \" + alpha + \")\";\n}\n\nfunction percentString(rgba, alpha) {\n if (alpha < 1 || (rgba[3] && rgba[3] < 1)) {\n return percentaString(rgba, alpha);\n }\n var r = Math.round(rgba[0]/255 * 100),\n g = Math.round(rgba[1]/255 * 100),\n b = Math.round(rgba[2]/255 * 100);\n\n return \"rgb(\" + r + \"%, \" + g + \"%, \" + b + \"%)\";\n}\n\nfunction percentaString(rgba, alpha) {\n var r = Math.round(rgba[0]/255 * 100),\n g = Math.round(rgba[1]/255 * 100),\n b = Math.round(rgba[2]/255 * 100);\n return \"rgba(\" + r + \"%, \" + g + \"%, \" + b + \"%, \" + (alpha || rgba[3] || 1) + \")\";\n}\n\nfunction hslString(hsla, alpha) {\n if (alpha < 1 || (hsla[3] && hsla[3] < 1)) {\n return hslaString(hsla, alpha);\n }\n return \"hsl(\" + hsla[0] + \", \" + hsla[1] + \"%, \" + hsla[2] + \"%)\";\n}\n\nfunction hslaString(hsla, alpha) {\n if (alpha === undefined) {\n alpha = (hsla[3] !== undefined ? hsla[3] : 1);\n }\n return \"hsla(\" + hsla[0] + \", \" + hsla[1] + \"%, \" + hsla[2] + \"%, \"\n + alpha + \")\";\n}\n\n// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax\n// (hwb have alpha optional & 1 is default value)\nfunction hwbString(hwb, alpha) {\n if (alpha === undefined) {\n alpha = (hwb[3] !== undefined ? hwb[3] : 1);\n }\n return \"hwb(\" + hwb[0] + \", \" + hwb[1] + \"%, \" + hwb[2] + \"%\"\n + (alpha !== undefined && alpha !== 1 ? \", \" + alpha : \"\") + \")\";\n}\n\nfunction keyword(rgb) {\n return reverseNames[rgb.slice(0, 3)];\n}\n\n// helpers\nfunction scale(num, min, max) {\n return Math.min(Math.max(min, num), max);\n}\n\nfunction hexDouble(num) {\n var str = num.toString(16).toUpperCase();\n return (str.length < 2) ? \"0\" + str : str;\n}\n\n\n//create a list of reverse color names\nvar reverseNames = {};\nfor (var name in colorName$1) {\n reverseNames[colorName$1[name]] = name;\n}\n\n/* MIT license */\n\n\n\nvar Color = function (obj) {\n\tif (obj instanceof Color) {\n\t\treturn obj;\n\t}\n\tif (!(this instanceof Color)) {\n\t\treturn new Color(obj);\n\t}\n\n\tthis.valid = false;\n\tthis.values = {\n\t\trgb: [0, 0, 0],\n\t\thsl: [0, 0, 0],\n\t\thsv: [0, 0, 0],\n\t\thwb: [0, 0, 0],\n\t\tcmyk: [0, 0, 0, 0],\n\t\talpha: 1\n\t};\n\n\t// parse Color() argument\n\tvar vals;\n\tif (typeof obj === 'string') {\n\t\tvals = colorString.getRgba(obj);\n\t\tif (vals) {\n\t\t\tthis.setValues('rgb', vals);\n\t\t} else if (vals = colorString.getHsla(obj)) {\n\t\t\tthis.setValues('hsl', vals);\n\t\t} else if (vals = colorString.getHwb(obj)) {\n\t\t\tthis.setValues('hwb', vals);\n\t\t}\n\t} else if (typeof obj === 'object') {\n\t\tvals = obj;\n\t\tif (vals.r !== undefined || vals.red !== undefined) {\n\t\t\tthis.setValues('rgb', vals);\n\t\t} else if (vals.l !== undefined || vals.lightness !== undefined) {\n\t\t\tthis.setValues('hsl', vals);\n\t\t} else if (vals.v !== undefined || vals.value !== undefined) {\n\t\t\tthis.setValues('hsv', vals);\n\t\t} else if (vals.w !== undefined || vals.whiteness !== undefined) {\n\t\t\tthis.setValues('hwb', vals);\n\t\t} else if (vals.c !== undefined || vals.cyan !== undefined) {\n\t\t\tthis.setValues('cmyk', vals);\n\t\t}\n\t}\n};\n\nColor.prototype = {\n\tisValid: function () {\n\t\treturn this.valid;\n\t},\n\trgb: function () {\n\t\treturn this.setSpace('rgb', arguments);\n\t},\n\thsl: function () {\n\t\treturn this.setSpace('hsl', arguments);\n\t},\n\thsv: function () {\n\t\treturn this.setSpace('hsv', arguments);\n\t},\n\thwb: function () {\n\t\treturn this.setSpace('hwb', arguments);\n\t},\n\tcmyk: function () {\n\t\treturn this.setSpace('cmyk', arguments);\n\t},\n\n\trgbArray: function () {\n\t\treturn this.values.rgb;\n\t},\n\thslArray: function () {\n\t\treturn this.values.hsl;\n\t},\n\thsvArray: function () {\n\t\treturn this.values.hsv;\n\t},\n\thwbArray: function () {\n\t\tvar values = this.values;\n\t\tif (values.alpha !== 1) {\n\t\t\treturn values.hwb.concat([values.alpha]);\n\t\t}\n\t\treturn values.hwb;\n\t},\n\tcmykArray: function () {\n\t\treturn this.values.cmyk;\n\t},\n\trgbaArray: function () {\n\t\tvar values = this.values;\n\t\treturn values.rgb.concat([values.alpha]);\n\t},\n\thslaArray: function () {\n\t\tvar values = this.values;\n\t\treturn values.hsl.concat([values.alpha]);\n\t},\n\talpha: function (val) {\n\t\tif (val === undefined) {\n\t\t\treturn this.values.alpha;\n\t\t}\n\t\tthis.setValues('alpha', val);\n\t\treturn this;\n\t},\n\n\tred: function (val) {\n\t\treturn this.setChannel('rgb', 0, val);\n\t},\n\tgreen: function (val) {\n\t\treturn this.setChannel('rgb', 1, val);\n\t},\n\tblue: function (val) {\n\t\treturn this.setChannel('rgb', 2, val);\n\t},\n\thue: function (val) {\n\t\tif (val) {\n\t\t\tval %= 360;\n\t\t\tval = val < 0 ? 360 + val : val;\n\t\t}\n\t\treturn this.setChannel('hsl', 0, val);\n\t},\n\tsaturation: function (val) {\n\t\treturn this.setChannel('hsl', 1, val);\n\t},\n\tlightness: function (val) {\n\t\treturn this.setChannel('hsl', 2, val);\n\t},\n\tsaturationv: function (val) {\n\t\treturn this.setChannel('hsv', 1, val);\n\t},\n\twhiteness: function (val) {\n\t\treturn this.setChannel('hwb', 1, val);\n\t},\n\tblackness: function (val) {\n\t\treturn this.setChannel('hwb', 2, val);\n\t},\n\tvalue: function (val) {\n\t\treturn this.setChannel('hsv', 2, val);\n\t},\n\tcyan: function (val) {\n\t\treturn this.setChannel('cmyk', 0, val);\n\t},\n\tmagenta: function (val) {\n\t\treturn this.setChannel('cmyk', 1, val);\n\t},\n\tyellow: function (val) {\n\t\treturn this.setChannel('cmyk', 2, val);\n\t},\n\tblack: function (val) {\n\t\treturn this.setChannel('cmyk', 3, val);\n\t},\n\n\thexString: function () {\n\t\treturn colorString.hexString(this.values.rgb);\n\t},\n\trgbString: function () {\n\t\treturn colorString.rgbString(this.values.rgb, this.values.alpha);\n\t},\n\trgbaString: function () {\n\t\treturn colorString.rgbaString(this.values.rgb, this.values.alpha);\n\t},\n\tpercentString: function () {\n\t\treturn colorString.percentString(this.values.rgb, this.values.alpha);\n\t},\n\thslString: function () {\n\t\treturn colorString.hslString(this.values.hsl, this.values.alpha);\n\t},\n\thslaString: function () {\n\t\treturn colorString.hslaString(this.values.hsl, this.values.alpha);\n\t},\n\thwbString: function () {\n\t\treturn colorString.hwbString(this.values.hwb, this.values.alpha);\n\t},\n\tkeyword: function () {\n\t\treturn colorString.keyword(this.values.rgb, this.values.alpha);\n\t},\n\n\trgbNumber: function () {\n\t\tvar rgb = this.values.rgb;\n\t\treturn (rgb[0] << 16) | (rgb[1] << 8) | rgb[2];\n\t},\n\n\tluminosity: function () {\n\t\t// http://www.w3.org/TR/WCAG20/#relativeluminancedef\n\t\tvar rgb = this.values.rgb;\n\t\tvar lum = [];\n\t\tfor (var i = 0; i < rgb.length; i++) {\n\t\t\tvar chan = rgb[i] / 255;\n\t\t\tlum[i] = (chan <= 0.03928) ? chan / 12.92 : Math.pow(((chan + 0.055) / 1.055), 2.4);\n\t\t}\n\t\treturn 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];\n\t},\n\n\tcontrast: function (color2) {\n\t\t// http://www.w3.org/TR/WCAG20/#contrast-ratiodef\n\t\tvar lum1 = this.luminosity();\n\t\tvar lum2 = color2.luminosity();\n\t\tif (lum1 > lum2) {\n\t\t\treturn (lum1 + 0.05) / (lum2 + 0.05);\n\t\t}\n\t\treturn (lum2 + 0.05) / (lum1 + 0.05);\n\t},\n\n\tlevel: function (color2) {\n\t\tvar contrastRatio = this.contrast(color2);\n\t\tif (contrastRatio >= 7.1) {\n\t\t\treturn 'AAA';\n\t\t}\n\n\t\treturn (contrastRatio >= 4.5) ? 'AA' : '';\n\t},\n\n\tdark: function () {\n\t\t// YIQ equation from http://24ways.org/2010/calculating-color-contrast\n\t\tvar rgb = this.values.rgb;\n\t\tvar yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;\n\t\treturn yiq < 128;\n\t},\n\n\tlight: function () {\n\t\treturn !this.dark();\n\t},\n\n\tnegate: function () {\n\t\tvar rgb = [];\n\t\tfor (var i = 0; i < 3; i++) {\n\t\t\trgb[i] = 255 - this.values.rgb[i];\n\t\t}\n\t\tthis.setValues('rgb', rgb);\n\t\treturn this;\n\t},\n\n\tlighten: function (ratio) {\n\t\tvar hsl = this.values.hsl;\n\t\thsl[2] += hsl[2] * ratio;\n\t\tthis.setValues('hsl', hsl);\n\t\treturn this;\n\t},\n\n\tdarken: function (ratio) {\n\t\tvar hsl = this.values.hsl;\n\t\thsl[2] -= hsl[2] * ratio;\n\t\tthis.setValues('hsl', hsl);\n\t\treturn this;\n\t},\n\n\tsaturate: function (ratio) {\n\t\tvar hsl = this.values.hsl;\n\t\thsl[1] += hsl[1] * ratio;\n\t\tthis.setValues('hsl', hsl);\n\t\treturn this;\n\t},\n\n\tdesaturate: function (ratio) {\n\t\tvar hsl = this.values.hsl;\n\t\thsl[1] -= hsl[1] * ratio;\n\t\tthis.setValues('hsl', hsl);\n\t\treturn this;\n\t},\n\n\twhiten: function (ratio) {\n\t\tvar hwb = this.values.hwb;\n\t\thwb[1] += hwb[1] * ratio;\n\t\tthis.setValues('hwb', hwb);\n\t\treturn this;\n\t},\n\n\tblacken: function (ratio) {\n\t\tvar hwb = this.values.hwb;\n\t\thwb[2] += hwb[2] * ratio;\n\t\tthis.setValues('hwb', hwb);\n\t\treturn this;\n\t},\n\n\tgreyscale: function () {\n\t\tvar rgb = this.values.rgb;\n\t\t// http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale\n\t\tvar val = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;\n\t\tthis.setValues('rgb', [val, val, val]);\n\t\treturn this;\n\t},\n\n\tclearer: function (ratio) {\n\t\tvar alpha = this.values.alpha;\n\t\tthis.setValues('alpha', alpha - (alpha * ratio));\n\t\treturn this;\n\t},\n\n\topaquer: function (ratio) {\n\t\tvar alpha = this.values.alpha;\n\t\tthis.setValues('alpha', alpha + (alpha * ratio));\n\t\treturn this;\n\t},\n\n\trotate: function (degrees) {\n\t\tvar hsl = this.values.hsl;\n\t\tvar hue = (hsl[0] + degrees) % 360;\n\t\thsl[0] = hue < 0 ? 360 + hue : hue;\n\t\tthis.setValues('hsl', hsl);\n\t\treturn this;\n\t},\n\n\t/**\n\t * Ported from sass implementation in C\n\t * https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209\n\t */\n\tmix: function (mixinColor, weight) {\n\t\tvar color1 = this;\n\t\tvar color2 = mixinColor;\n\t\tvar p = weight === undefined ? 0.5 : weight;\n\n\t\tvar w = 2 * p - 1;\n\t\tvar a = color1.alpha() - color2.alpha();\n\n\t\tvar w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n\t\tvar w2 = 1 - w1;\n\n\t\treturn this\n\t\t\t.rgb(\n\t\t\t\tw1 * color1.red() + w2 * color2.red(),\n\t\t\t\tw1 * color1.green() + w2 * color2.green(),\n\t\t\t\tw1 * color1.blue() + w2 * color2.blue()\n\t\t\t)\n\t\t\t.alpha(color1.alpha() * p + color2.alpha() * (1 - p));\n\t},\n\n\ttoJSON: function () {\n\t\treturn this.rgb();\n\t},\n\n\tclone: function () {\n\t\t// NOTE(SB): using node-clone creates a dependency to Buffer when using browserify,\n\t\t// making the final build way to big to embed in Chart.js. So let's do it manually,\n\t\t// assuming that values to clone are 1 dimension arrays containing only numbers,\n\t\t// except 'alpha' which is a number.\n\t\tvar result = new Color();\n\t\tvar source = this.values;\n\t\tvar target = result.values;\n\t\tvar value, type;\n\n\t\tfor (var prop in source) {\n\t\t\tif (source.hasOwnProperty(prop)) {\n\t\t\t\tvalue = source[prop];\n\t\t\t\ttype = ({}).toString.call(value);\n\t\t\t\tif (type === '[object Array]') {\n\t\t\t\t\ttarget[prop] = value.slice(0);\n\t\t\t\t} else if (type === '[object Number]') {\n\t\t\t\t\ttarget[prop] = value;\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error('unexpected color value:', value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n};\n\nColor.prototype.spaces = {\n\trgb: ['red', 'green', 'blue'],\n\thsl: ['hue', 'saturation', 'lightness'],\n\thsv: ['hue', 'saturation', 'value'],\n\thwb: ['hue', 'whiteness', 'blackness'],\n\tcmyk: ['cyan', 'magenta', 'yellow', 'black']\n};\n\nColor.prototype.maxes = {\n\trgb: [255, 255, 255],\n\thsl: [360, 100, 100],\n\thsv: [360, 100, 100],\n\thwb: [360, 100, 100],\n\tcmyk: [100, 100, 100, 100]\n};\n\nColor.prototype.getValues = function (space) {\n\tvar values = this.values;\n\tvar vals = {};\n\n\tfor (var i = 0; i < space.length; i++) {\n\t\tvals[space.charAt(i)] = values[space][i];\n\t}\n\n\tif (values.alpha !== 1) {\n\t\tvals.a = values.alpha;\n\t}\n\n\t// {r: 255, g: 255, b: 255, a: 0.4}\n\treturn vals;\n};\n\nColor.prototype.setValues = function (space, vals) {\n\tvar values = this.values;\n\tvar spaces = this.spaces;\n\tvar maxes = this.maxes;\n\tvar alpha = 1;\n\tvar i;\n\n\tthis.valid = true;\n\n\tif (space === 'alpha') {\n\t\talpha = vals;\n\t} else if (vals.length) {\n\t\t// [10, 10, 10]\n\t\tvalues[space] = vals.slice(0, space.length);\n\t\talpha = vals[space.length];\n\t} else if (vals[space.charAt(0)] !== undefined) {\n\t\t// {r: 10, g: 10, b: 10}\n\t\tfor (i = 0; i < space.length; i++) {\n\t\t\tvalues[space][i] = vals[space.charAt(i)];\n\t\t}\n\n\t\talpha = vals.a;\n\t} else if (vals[spaces[space][0]] !== undefined) {\n\t\t// {red: 10, green: 10, blue: 10}\n\t\tvar chans = spaces[space];\n\n\t\tfor (i = 0; i < space.length; i++) {\n\t\t\tvalues[space][i] = vals[chans[i]];\n\t\t}\n\n\t\talpha = vals.alpha;\n\t}\n\n\tvalues.alpha = Math.max(0, Math.min(1, (alpha === undefined ? values.alpha : alpha)));\n\n\tif (space === 'alpha') {\n\t\treturn false;\n\t}\n\n\tvar capped;\n\n\t// cap values of the space prior converting all values\n\tfor (i = 0; i < space.length; i++) {\n\t\tcapped = Math.max(0, Math.min(maxes[space][i], values[space][i]));\n\t\tvalues[space][i] = Math.round(capped);\n\t}\n\n\t// convert to all the other color spaces\n\tfor (var sname in spaces) {\n\t\tif (sname !== space) {\n\t\t\tvalues[sname] = colorConvert[space][sname](values[space]);\n\t\t}\n\t}\n\n\treturn true;\n};\n\nColor.prototype.setSpace = function (space, args) {\n\tvar vals = args[0];\n\n\tif (vals === undefined) {\n\t\t// color.rgb()\n\t\treturn this.getValues(space);\n\t}\n\n\t// color.rgb(10, 10, 10)\n\tif (typeof vals === 'number') {\n\t\tvals = Array.prototype.slice.call(args);\n\t}\n\n\tthis.setValues(space, vals);\n\treturn this;\n};\n\nColor.prototype.setChannel = function (space, index, val) {\n\tvar svalues = this.values[space];\n\tif (val === undefined) {\n\t\t// color.red()\n\t\treturn svalues[index];\n\t} else if (val === svalues[index]) {\n\t\t// color.red(color.red())\n\t\treturn this;\n\t}\n\n\t// color.red(100)\n\tsvalues[index] = val;\n\tthis.setValues(space, svalues);\n\n\treturn this;\n};\n\nif (typeof window !== 'undefined') {\n\twindow.Color = Color;\n}\n\nvar chartjsColor = Color;\n\nfunction isValidKey(key) {\r\n\treturn ['__proto__', 'prototype', 'constructor'].indexOf(key) === -1;\r\n}\r\n\r\n/**\r\n * @namespace Chart.helpers\r\n */\r\nvar helpers = {\r\n\t/**\r\n\t * An empty function that can be used, for example, for optional callback.\r\n\t */\r\n\tnoop: function() {},\r\n\r\n\t/**\r\n\t * Returns a unique id, sequentially generated from a global variable.\r\n\t * @returns {number}\r\n\t * @function\r\n\t */\r\n\tuid: (function() {\r\n\t\tvar id = 0;\r\n\t\treturn function() {\r\n\t\t\treturn id++;\r\n\t\t};\r\n\t}()),\r\n\r\n\t/**\r\n\t * Returns true if `value` is neither null nor undefined, else returns false.\r\n\t * @param {*} value - The value to test.\r\n\t * @returns {boolean}\r\n\t * @since 2.7.0\r\n\t */\r\n\tisNullOrUndef: function(value) {\r\n\t\treturn value === null || typeof value === 'undefined';\r\n\t},\r\n\r\n\t/**\r\n\t * Returns true if `value` is an array (including typed arrays), else returns false.\r\n\t * @param {*} value - The value to test.\r\n\t * @returns {boolean}\r\n\t * @function\r\n\t */\r\n\tisArray: function(value) {\r\n\t\tif (Array.isArray && Array.isArray(value)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar type = Object.prototype.toString.call(value);\r\n\t\tif (type.substr(0, 7) === '[object' && type.substr(-6) === 'Array]') {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\r\n\t/**\r\n\t * Returns true if `value` is an object (excluding null), else returns false.\r\n\t * @param {*} value - The value to test.\r\n\t * @returns {boolean}\r\n\t * @since 2.7.0\r\n\t */\r\n\tisObject: function(value) {\r\n\t\treturn value !== null && Object.prototype.toString.call(value) === '[object Object]';\r\n\t},\r\n\r\n\t/**\r\n\t * Returns true if `value` is a finite number, else returns false\r\n\t * @param {*} value - The value to test.\r\n\t * @returns {boolean}\r\n\t */\r\n\tisFinite: function(value) {\r\n\t\treturn (typeof value === 'number' || value instanceof Number) && isFinite(value);\r\n\t},\r\n\r\n\t/**\r\n\t * Returns `value` if defined, else returns `defaultValue`.\r\n\t * @param {*} value - The value to return if defined.\r\n\t * @param {*} defaultValue - The value to return if `value` is undefined.\r\n\t * @returns {*}\r\n\t */\r\n\tvalueOrDefault: function(value, defaultValue) {\r\n\t\treturn typeof value === 'undefined' ? defaultValue : value;\r\n\t},\r\n\r\n\t/**\r\n\t * Returns value at the given `index` in array if defined, else returns `defaultValue`.\r\n\t * @param {Array} value - The array to lookup for value at `index`.\r\n\t * @param {number} index - The index in `value` to lookup for value.\r\n\t * @param {*} defaultValue - The value to return if `value[index]` is undefined.\r\n\t * @returns {*}\r\n\t */\r\n\tvalueAtIndexOrDefault: function(value, index, defaultValue) {\r\n\t\treturn helpers.valueOrDefault(helpers.isArray(value) ? value[index] : value, defaultValue);\r\n\t},\r\n\r\n\t/**\r\n\t * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\r\n\t * value returned by `fn`. If `fn` is not a function, this method returns undefined.\r\n\t * @param {function} fn - The function to call.\r\n\t * @param {Array|undefined|null} args - The arguments with which `fn` should be called.\r\n\t * @param {object} [thisArg] - The value of `this` provided for the call to `fn`.\r\n\t * @returns {*}\r\n\t */\r\n\tcallback: function(fn, args, thisArg) {\r\n\t\tif (fn && typeof fn.call === 'function') {\r\n\t\t\treturn fn.apply(thisArg, args);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Note(SB) for performance sake, this method should only be used when loopable type\r\n\t * is unknown or in none intensive code (not called often and small loopable). Else\r\n\t * it's preferable to use a regular for() loop and save extra function calls.\r\n\t * @param {object|Array} loopable - The object or array to be iterated.\r\n\t * @param {function} fn - The function to call for each item.\r\n\t * @param {object} [thisArg] - The value of `this` provided for the call to `fn`.\r\n\t * @param {boolean} [reverse] - If true, iterates backward on the loopable.\r\n\t */\r\n\teach: function(loopable, fn, thisArg, reverse) {\r\n\t\tvar i, len, keys;\r\n\t\tif (helpers.isArray(loopable)) {\r\n\t\t\tlen = loopable.length;\r\n\t\t\tif (reverse) {\r\n\t\t\t\tfor (i = len - 1; i >= 0; i--) {\r\n\t\t\t\t\tfn.call(thisArg, loopable[i], i);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tfor (i = 0; i < len; i++) {\r\n\t\t\t\t\tfn.call(thisArg, loopable[i], i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else if (helpers.isObject(loopable)) {\r\n\t\t\tkeys = Object.keys(loopable);\r\n\t\t\tlen = keys.length;\r\n\t\t\tfor (i = 0; i < len; i++) {\r\n\t\t\t\tfn.call(thisArg, loopable[keys[i]], keys[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\r\n\t * @see https://stackoverflow.com/a/14853974\r\n\t * @param {Array} a0 - The array to compare\r\n\t * @param {Array} a1 - The array to compare\r\n\t * @returns {boolean}\r\n\t */\r\n\tarrayEquals: function(a0, a1) {\r\n\t\tvar i, ilen, v0, v1;\r\n\r\n\t\tif (!a0 || !a1 || a0.length !== a1.length) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tfor (i = 0, ilen = a0.length; i < ilen; ++i) {\r\n\t\t\tv0 = a0[i];\r\n\t\t\tv1 = a1[i];\r\n\r\n\t\t\tif (v0 instanceof Array && v1 instanceof Array) {\r\n\t\t\t\tif (!helpers.arrayEquals(v0, v1)) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t} else if (v0 !== v1) {\r\n\t\t\t\t// NOTE: two different object instances will never be equal: {x:20} != {x:20}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t},\r\n\r\n\t/**\r\n\t * Returns a deep copy of `source` without keeping references on objects and arrays.\r\n\t * @param {*} source - The value to clone.\r\n\t * @returns {*}\r\n\t */\r\n\tclone: function(source) {\r\n\t\tif (helpers.isArray(source)) {\r\n\t\t\treturn source.map(helpers.clone);\r\n\t\t}\r\n\r\n\t\tif (helpers.isObject(source)) {\r\n\t\t\tvar target = Object.create(source);\r\n\t\t\tvar keys = Object.keys(source);\r\n\t\t\tvar klen = keys.length;\r\n\t\t\tvar k = 0;\r\n\r\n\t\t\tfor (; k < klen; ++k) {\r\n\t\t\t\ttarget[keys[k]] = helpers.clone(source[keys[k]]);\r\n\t\t\t}\r\n\r\n\t\t\treturn target;\r\n\t\t}\r\n\r\n\t\treturn source;\r\n\t},\r\n\r\n\t/**\r\n\t * The default merger when Chart.helpers.merge is called without merger option.\r\n\t * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.\r\n\t * @private\r\n\t */\r\n\t_merger: function(key, target, source, options) {\r\n\t\tif (!isValidKey(key)) {\r\n\t\t\t// We want to ensure we do not copy prototypes over\r\n\t\t\t// as this can pollute global namespaces\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar tval = target[key];\r\n\t\tvar sval = source[key];\r\n\r\n\t\tif (helpers.isObject(tval) && helpers.isObject(sval)) {\r\n\t\t\thelpers.merge(tval, sval, options);\r\n\t\t} else {\r\n\t\t\ttarget[key] = helpers.clone(sval);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Merges source[key] in target[key] only if target[key] is undefined.\r\n\t * @private\r\n\t */\r\n\t_mergerIf: function(key, target, source) {\r\n\t\tif (!isValidKey(key)) {\r\n\t\t\t// We want to ensure we do not copy prototypes over\r\n\t\t\t// as this can pollute global namespaces\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar tval = target[key];\r\n\t\tvar sval = source[key];\r\n\r\n\t\tif (helpers.isObject(tval) && helpers.isObject(sval)) {\r\n\t\t\thelpers.mergeIf(tval, sval);\r\n\t\t} else if (!target.hasOwnProperty(key)) {\r\n\t\t\ttarget[key] = helpers.clone(sval);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Recursively deep copies `source` properties into `target` with the given `options`.\r\n\t * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\r\n\t * @param {object} target - The target object in which all sources are merged into.\r\n\t * @param {object|object[]} source - Object(s) to merge into `target`.\r\n\t * @param {object} [options] - Merging options:\r\n\t * @param {function} [options.merger] - The merge method (key, target, source, options)\r\n\t * @returns {object} The `target` object.\r\n\t */\r\n\tmerge: function(target, source, options) {\r\n\t\tvar sources = helpers.isArray(source) ? source : [source];\r\n\t\tvar ilen = sources.length;\r\n\t\tvar merge, i, keys, klen, k;\r\n\r\n\t\tif (!helpers.isObject(target)) {\r\n\t\t\treturn target;\r\n\t\t}\r\n\r\n\t\toptions = options || {};\r\n\t\tmerge = options.merger || helpers._merger;\r\n\r\n\t\tfor (i = 0; i < ilen; ++i) {\r\n\t\t\tsource = sources[i];\r\n\t\t\tif (!helpers.isObject(source)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tkeys = Object.keys(source);\r\n\t\t\tfor (k = 0, klen = keys.length; k < klen; ++k) {\r\n\t\t\t\tmerge(keys[k], target, source, options);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn target;\r\n\t},\r\n\r\n\t/**\r\n\t * Recursively deep copies `source` properties into `target` *only* if not defined in target.\r\n\t * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\r\n\t * @param {object} target - The target object in which all sources are merged into.\r\n\t * @param {object|object[]} source - Object(s) to merge into `target`.\r\n\t * @returns {object} The `target` object.\r\n\t */\r\n\tmergeIf: function(target, source) {\r\n\t\treturn helpers.merge(target, source, {merger: helpers._mergerIf});\r\n\t},\r\n\r\n\t/**\r\n\t * Applies the contents of two or more objects together into the first object.\r\n\t * @param {object} target - The target object in which all objects are merged into.\r\n\t * @param {object} arg1 - Object containing additional properties to merge in target.\r\n\t * @param {object} argN - Additional objects containing properties to merge in target.\r\n\t * @returns {object} The `target` object.\r\n\t */\r\n\textend: Object.assign || function(target) {\r\n\t\treturn helpers.merge(target, [].slice.call(arguments, 1), {\r\n\t\t\tmerger: function(key, dst, src) {\r\n\t\t\t\tdst[key] = src[key];\r\n\t\t\t}\r\n\t\t});\r\n\t},\r\n\r\n\t/**\r\n\t * Basic javascript inheritance based on the model created in Backbone.js\r\n\t */\r\n\tinherits: function(extensions) {\r\n\t\tvar me = this;\r\n\t\tvar ChartElement = (extensions && extensions.hasOwnProperty('constructor')) ? extensions.constructor : function() {\r\n\t\t\treturn me.apply(this, arguments);\r\n\t\t};\r\n\r\n\t\tvar Surrogate = function() {\r\n\t\t\tthis.constructor = ChartElement;\r\n\t\t};\r\n\r\n\t\tSurrogate.prototype = me.prototype;\r\n\t\tChartElement.prototype = new Surrogate();\r\n\t\tChartElement.extend = helpers.inherits;\r\n\r\n\t\tif (extensions) {\r\n\t\t\thelpers.extend(ChartElement.prototype, extensions);\r\n\t\t}\r\n\r\n\t\tChartElement.__super__ = me.prototype;\r\n\t\treturn ChartElement;\r\n\t},\r\n\r\n\t_deprecated: function(scope, value, previous, current) {\r\n\t\tif (value !== undefined) {\r\n\t\t\tconsole.warn(scope + ': \"' + previous +\r\n\t\t\t\t'\" is deprecated. Please use \"' + current + '\" instead');\r\n\t\t}\r\n\t}\r\n};\r\n\r\nvar helpers_core = helpers;\r\n\r\n// DEPRECATIONS\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.helpers.callback instead.\r\n * @function Chart.helpers.callCallback\r\n * @deprecated since version 2.6.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers.callCallback = helpers.callback;\r\n\r\n/**\r\n * Provided for backward compatibility, use Array.prototype.indexOf instead.\r\n * Array.prototype.indexOf compatibility: Chrome, Opera, Safari, FF1.5+, IE9+\r\n * @function Chart.helpers.indexOf\r\n * @deprecated since version 2.7.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers.indexOf = function(array, item, fromIndex) {\r\n\treturn Array.prototype.indexOf.call(array, item, fromIndex);\r\n};\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.helpers.valueOrDefault instead.\r\n * @function Chart.helpers.getValueOrDefault\r\n * @deprecated since version 2.7.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers.getValueOrDefault = helpers.valueOrDefault;\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.helpers.valueAtIndexOrDefault instead.\r\n * @function Chart.helpers.getValueAtIndexOrDefault\r\n * @deprecated since version 2.7.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers.getValueAtIndexOrDefault = helpers.valueAtIndexOrDefault;\n\n/**\r\n * Easing functions adapted from Robert Penner's easing equations.\r\n * @namespace Chart.helpers.easingEffects\r\n * @see http://www.robertpenner.com/easing/\r\n */\r\nvar effects = {\r\n\tlinear: function(t) {\r\n\t\treturn t;\r\n\t},\r\n\r\n\teaseInQuad: function(t) {\r\n\t\treturn t * t;\r\n\t},\r\n\r\n\teaseOutQuad: function(t) {\r\n\t\treturn -t * (t - 2);\r\n\t},\r\n\r\n\teaseInOutQuad: function(t) {\r\n\t\tif ((t /= 0.5) < 1) {\r\n\t\t\treturn 0.5 * t * t;\r\n\t\t}\r\n\t\treturn -0.5 * ((--t) * (t - 2) - 1);\r\n\t},\r\n\r\n\teaseInCubic: function(t) {\r\n\t\treturn t * t * t;\r\n\t},\r\n\r\n\teaseOutCubic: function(t) {\r\n\t\treturn (t = t - 1) * t * t + 1;\r\n\t},\r\n\r\n\teaseInOutCubic: function(t) {\r\n\t\tif ((t /= 0.5) < 1) {\r\n\t\t\treturn 0.5 * t * t * t;\r\n\t\t}\r\n\t\treturn 0.5 * ((t -= 2) * t * t + 2);\r\n\t},\r\n\r\n\teaseInQuart: function(t) {\r\n\t\treturn t * t * t * t;\r\n\t},\r\n\r\n\teaseOutQuart: function(t) {\r\n\t\treturn -((t = t - 1) * t * t * t - 1);\r\n\t},\r\n\r\n\teaseInOutQuart: function(t) {\r\n\t\tif ((t /= 0.5) < 1) {\r\n\t\t\treturn 0.5 * t * t * t * t;\r\n\t\t}\r\n\t\treturn -0.5 * ((t -= 2) * t * t * t - 2);\r\n\t},\r\n\r\n\teaseInQuint: function(t) {\r\n\t\treturn t * t * t * t * t;\r\n\t},\r\n\r\n\teaseOutQuint: function(t) {\r\n\t\treturn (t = t - 1) * t * t * t * t + 1;\r\n\t},\r\n\r\n\teaseInOutQuint: function(t) {\r\n\t\tif ((t /= 0.5) < 1) {\r\n\t\t\treturn 0.5 * t * t * t * t * t;\r\n\t\t}\r\n\t\treturn 0.5 * ((t -= 2) * t * t * t * t + 2);\r\n\t},\r\n\r\n\teaseInSine: function(t) {\r\n\t\treturn -Math.cos(t * (Math.PI / 2)) + 1;\r\n\t},\r\n\r\n\teaseOutSine: function(t) {\r\n\t\treturn Math.sin(t * (Math.PI / 2));\r\n\t},\r\n\r\n\teaseInOutSine: function(t) {\r\n\t\treturn -0.5 * (Math.cos(Math.PI * t) - 1);\r\n\t},\r\n\r\n\teaseInExpo: function(t) {\r\n\t\treturn (t === 0) ? 0 : Math.pow(2, 10 * (t - 1));\r\n\t},\r\n\r\n\teaseOutExpo: function(t) {\r\n\t\treturn (t === 1) ? 1 : -Math.pow(2, -10 * t) + 1;\r\n\t},\r\n\r\n\teaseInOutExpo: function(t) {\r\n\t\tif (t === 0) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif (t === 1) {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif ((t /= 0.5) < 1) {\r\n\t\t\treturn 0.5 * Math.pow(2, 10 * (t - 1));\r\n\t\t}\r\n\t\treturn 0.5 * (-Math.pow(2, -10 * --t) + 2);\r\n\t},\r\n\r\n\teaseInCirc: function(t) {\r\n\t\tif (t >= 1) {\r\n\t\t\treturn t;\r\n\t\t}\r\n\t\treturn -(Math.sqrt(1 - t * t) - 1);\r\n\t},\r\n\r\n\teaseOutCirc: function(t) {\r\n\t\treturn Math.sqrt(1 - (t = t - 1) * t);\r\n\t},\r\n\r\n\teaseInOutCirc: function(t) {\r\n\t\tif ((t /= 0.5) < 1) {\r\n\t\t\treturn -0.5 * (Math.sqrt(1 - t * t) - 1);\r\n\t\t}\r\n\t\treturn 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);\r\n\t},\r\n\r\n\teaseInElastic: function(t) {\r\n\t\tvar s = 1.70158;\r\n\t\tvar p = 0;\r\n\t\tvar a = 1;\r\n\t\tif (t === 0) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif (t === 1) {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif (!p) {\r\n\t\t\tp = 0.3;\r\n\t\t}\r\n\t\tif (a < 1) {\r\n\t\t\ta = 1;\r\n\t\t\ts = p / 4;\r\n\t\t} else {\r\n\t\t\ts = p / (2 * Math.PI) * Math.asin(1 / a);\r\n\t\t}\r\n\t\treturn -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p));\r\n\t},\r\n\r\n\teaseOutElastic: function(t) {\r\n\t\tvar s = 1.70158;\r\n\t\tvar p = 0;\r\n\t\tvar a = 1;\r\n\t\tif (t === 0) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif (t === 1) {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif (!p) {\r\n\t\t\tp = 0.3;\r\n\t\t}\r\n\t\tif (a < 1) {\r\n\t\t\ta = 1;\r\n\t\t\ts = p / 4;\r\n\t\t} else {\r\n\t\t\ts = p / (2 * Math.PI) * Math.asin(1 / a);\r\n\t\t}\r\n\t\treturn a * Math.pow(2, -10 * t) * Math.sin((t - s) * (2 * Math.PI) / p) + 1;\r\n\t},\r\n\r\n\teaseInOutElastic: function(t) {\r\n\t\tvar s = 1.70158;\r\n\t\tvar p = 0;\r\n\t\tvar a = 1;\r\n\t\tif (t === 0) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tif ((t /= 0.5) === 2) {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif (!p) {\r\n\t\t\tp = 0.45;\r\n\t\t}\r\n\t\tif (a < 1) {\r\n\t\t\ta = 1;\r\n\t\t\ts = p / 4;\r\n\t\t} else {\r\n\t\t\ts = p / (2 * Math.PI) * Math.asin(1 / a);\r\n\t\t}\r\n\t\tif (t < 1) {\r\n\t\t\treturn -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p));\r\n\t\t}\r\n\t\treturn a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p) * 0.5 + 1;\r\n\t},\r\n\teaseInBack: function(t) {\r\n\t\tvar s = 1.70158;\r\n\t\treturn t * t * ((s + 1) * t - s);\r\n\t},\r\n\r\n\teaseOutBack: function(t) {\r\n\t\tvar s = 1.70158;\r\n\t\treturn (t = t - 1) * t * ((s + 1) * t + s) + 1;\r\n\t},\r\n\r\n\teaseInOutBack: function(t) {\r\n\t\tvar s = 1.70158;\r\n\t\tif ((t /= 0.5) < 1) {\r\n\t\t\treturn 0.5 * (t * t * (((s *= (1.525)) + 1) * t - s));\r\n\t\t}\r\n\t\treturn 0.5 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);\r\n\t},\r\n\r\n\teaseInBounce: function(t) {\r\n\t\treturn 1 - effects.easeOutBounce(1 - t);\r\n\t},\r\n\r\n\teaseOutBounce: function(t) {\r\n\t\tif (t < (1 / 2.75)) {\r\n\t\t\treturn 7.5625 * t * t;\r\n\t\t}\r\n\t\tif (t < (2 / 2.75)) {\r\n\t\t\treturn 7.5625 * (t -= (1.5 / 2.75)) * t + 0.75;\r\n\t\t}\r\n\t\tif (t < (2.5 / 2.75)) {\r\n\t\t\treturn 7.5625 * (t -= (2.25 / 2.75)) * t + 0.9375;\r\n\t\t}\r\n\t\treturn 7.5625 * (t -= (2.625 / 2.75)) * t + 0.984375;\r\n\t},\r\n\r\n\teaseInOutBounce: function(t) {\r\n\t\tif (t < 0.5) {\r\n\t\t\treturn effects.easeInBounce(t * 2) * 0.5;\r\n\t\t}\r\n\t\treturn effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5;\r\n\t}\r\n};\r\n\r\nvar helpers_easing = {\r\n\teffects: effects\r\n};\r\n\r\n// DEPRECATIONS\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.helpers.easing.effects instead.\r\n * @function Chart.helpers.easingEffects\r\n * @deprecated since version 2.7.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers_core.easingEffects = effects;\n\nvar PI = Math.PI;\r\nvar RAD_PER_DEG = PI / 180;\r\nvar DOUBLE_PI = PI * 2;\r\nvar HALF_PI = PI / 2;\r\nvar QUARTER_PI = PI / 4;\r\nvar TWO_THIRDS_PI = PI * 2 / 3;\r\n\r\n/**\r\n * @namespace Chart.helpers.canvas\r\n */\r\nvar exports$1 = {\r\n\t/**\r\n\t * Clears the entire canvas associated to the given `chart`.\r\n\t * @param {Chart} chart - The chart for which to clear the canvas.\r\n\t */\r\n\tclear: function(chart) {\r\n\t\tchart.ctx.clearRect(0, 0, chart.width, chart.height);\r\n\t},\r\n\r\n\t/**\r\n\t * Creates a \"path\" for a rectangle with rounded corners at position (x, y) with a\r\n\t * given size (width, height) and the same `radius` for all corners.\r\n\t * @param {CanvasRenderingContext2D} ctx - The canvas 2D Context.\r\n\t * @param {number} x - The x axis of the coordinate for the rectangle starting point.\r\n\t * @param {number} y - The y axis of the coordinate for the rectangle starting point.\r\n\t * @param {number} width - The rectangle's width.\r\n\t * @param {number} height - The rectangle's height.\r\n\t * @param {number} radius - The rounded amount (in pixels) for the four corners.\r\n\t * @todo handle `radius` as top-left, top-right, bottom-right, bottom-left array/object?\r\n\t */\r\n\troundedRect: function(ctx, x, y, width, height, radius) {\r\n\t\tif (radius) {\r\n\t\t\tvar r = Math.min(radius, height / 2, width / 2);\r\n\t\t\tvar left = x + r;\r\n\t\t\tvar top = y + r;\r\n\t\t\tvar right = x + width - r;\r\n\t\t\tvar bottom = y + height - r;\r\n\r\n\t\t\tctx.moveTo(x, top);\r\n\t\t\tif (left < right && top < bottom) {\r\n\t\t\t\tctx.arc(left, top, r, -PI, -HALF_PI);\r\n\t\t\t\tctx.arc(right, top, r, -HALF_PI, 0);\r\n\t\t\t\tctx.arc(right, bottom, r, 0, HALF_PI);\r\n\t\t\t\tctx.arc(left, bottom, r, HALF_PI, PI);\r\n\t\t\t} else if (left < right) {\r\n\t\t\t\tctx.moveTo(left, y);\r\n\t\t\t\tctx.arc(right, top, r, -HALF_PI, HALF_PI);\r\n\t\t\t\tctx.arc(left, top, r, HALF_PI, PI + HALF_PI);\r\n\t\t\t} else if (top < bottom) {\r\n\t\t\t\tctx.arc(left, top, r, -PI, 0);\r\n\t\t\t\tctx.arc(left, bottom, r, 0, PI);\r\n\t\t\t} else {\r\n\t\t\t\tctx.arc(left, top, r, -PI, PI);\r\n\t\t\t}\r\n\t\t\tctx.closePath();\r\n\t\t\tctx.moveTo(x, y);\r\n\t\t} else {\r\n\t\t\tctx.rect(x, y, width, height);\r\n\t\t}\r\n\t},\r\n\r\n\tdrawPoint: function(ctx, style, radius, x, y, rotation) {\r\n\t\tvar type, xOffset, yOffset, size, cornerRadius;\r\n\t\tvar rad = (rotation || 0) * RAD_PER_DEG;\r\n\r\n\t\tif (style && typeof style === 'object') {\r\n\t\t\ttype = style.toString();\r\n\t\t\tif (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\r\n\t\t\t\tctx.save();\r\n\t\t\t\tctx.translate(x, y);\r\n\t\t\t\tctx.rotate(rad);\r\n\t\t\t\tctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\r\n\t\t\t\tctx.restore();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (isNaN(radius) || radius <= 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tctx.beginPath();\r\n\r\n\t\tswitch (style) {\r\n\t\t// Default includes circle\r\n\t\tdefault:\r\n\t\t\tctx.arc(x, y, radius, 0, DOUBLE_PI);\r\n\t\t\tctx.closePath();\r\n\t\t\tbreak;\r\n\t\tcase 'triangle':\r\n\t\t\tctx.moveTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);\r\n\t\t\trad += TWO_THIRDS_PI;\r\n\t\t\tctx.lineTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);\r\n\t\t\trad += TWO_THIRDS_PI;\r\n\t\t\tctx.lineTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);\r\n\t\t\tctx.closePath();\r\n\t\t\tbreak;\r\n\t\tcase 'rectRounded':\r\n\t\t\t// NOTE: the rounded rect implementation changed to use `arc` instead of\r\n\t\t\t// `quadraticCurveTo` since it generates better results when rect is\r\n\t\t\t// almost a circle. 0.516 (instead of 0.5) produces results with visually\r\n\t\t\t// closer proportion to the previous impl and it is inscribed in the\r\n\t\t\t// circle with `radius`. For more details, see the following PRs:\r\n\t\t\t// https://github.com/chartjs/Chart.js/issues/5597\r\n\t\t\t// https://github.com/chartjs/Chart.js/issues/5858\r\n\t\t\tcornerRadius = radius * 0.516;\r\n\t\t\tsize = radius - cornerRadius;\r\n\t\t\txOffset = Math.cos(rad + QUARTER_PI) * size;\r\n\t\t\tyOffset = Math.sin(rad + QUARTER_PI) * size;\r\n\t\t\tctx.arc(x - xOffset, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);\r\n\t\t\tctx.arc(x + yOffset, y - xOffset, cornerRadius, rad - HALF_PI, rad);\r\n\t\t\tctx.arc(x + xOffset, y + yOffset, cornerRadius, rad, rad + HALF_PI);\r\n\t\t\tctx.arc(x - yOffset, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);\r\n\t\t\tctx.closePath();\r\n\t\t\tbreak;\r\n\t\tcase 'rect':\r\n\t\t\tif (!rotation) {\r\n\t\t\t\tsize = Math.SQRT1_2 * radius;\r\n\t\t\t\tctx.rect(x - size, y - size, 2 * size, 2 * size);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\trad += QUARTER_PI;\r\n\t\t\t/* falls through */\r\n\t\tcase 'rectRot':\r\n\t\t\txOffset = Math.cos(rad) * radius;\r\n\t\t\tyOffset = Math.sin(rad) * radius;\r\n\t\t\tctx.moveTo(x - xOffset, y - yOffset);\r\n\t\t\tctx.lineTo(x + yOffset, y - xOffset);\r\n\t\t\tctx.lineTo(x + xOffset, y + yOffset);\r\n\t\t\tctx.lineTo(x - yOffset, y + xOffset);\r\n\t\t\tctx.closePath();\r\n\t\t\tbreak;\r\n\t\tcase 'crossRot':\r\n\t\t\trad += QUARTER_PI;\r\n\t\t\t/* falls through */\r\n\t\tcase 'cross':\r\n\t\t\txOffset = Math.cos(rad) * radius;\r\n\t\t\tyOffset = Math.sin(rad) * radius;\r\n\t\t\tctx.moveTo(x - xOffset, y - yOffset);\r\n\t\t\tctx.lineTo(x + xOffset, y + yOffset);\r\n\t\t\tctx.moveTo(x + yOffset, y - xOffset);\r\n\t\t\tctx.lineTo(x - yOffset, y + xOffset);\r\n\t\t\tbreak;\r\n\t\tcase 'star':\r\n\t\t\txOffset = Math.cos(rad) * radius;\r\n\t\t\tyOffset = Math.sin(rad) * radius;\r\n\t\t\tctx.moveTo(x - xOffset, y - yOffset);\r\n\t\t\tctx.lineTo(x + xOffset, y + yOffset);\r\n\t\t\tctx.moveTo(x + yOffset, y - xOffset);\r\n\t\t\tctx.lineTo(x - yOffset, y + xOffset);\r\n\t\t\trad += QUARTER_PI;\r\n\t\t\txOffset = Math.cos(rad) * radius;\r\n\t\t\tyOffset = Math.sin(rad) * radius;\r\n\t\t\tctx.moveTo(x - xOffset, y - yOffset);\r\n\t\t\tctx.lineTo(x + xOffset, y + yOffset);\r\n\t\t\tctx.moveTo(x + yOffset, y - xOffset);\r\n\t\t\tctx.lineTo(x - yOffset, y + xOffset);\r\n\t\t\tbreak;\r\n\t\tcase 'line':\r\n\t\t\txOffset = Math.cos(rad) * radius;\r\n\t\t\tyOffset = Math.sin(rad) * radius;\r\n\t\t\tctx.moveTo(x - xOffset, y - yOffset);\r\n\t\t\tctx.lineTo(x + xOffset, y + yOffset);\r\n\t\t\tbreak;\r\n\t\tcase 'dash':\r\n\t\t\tctx.moveTo(x, y);\r\n\t\t\tctx.lineTo(x + Math.cos(rad) * radius, y + Math.sin(rad) * radius);\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tctx.fill();\r\n\t\tctx.stroke();\r\n\t},\r\n\r\n\t/**\r\n\t * Returns true if the point is inside the rectangle\r\n\t * @param {object} point - The point to test\r\n\t * @param {object} area - The rectangle\r\n\t * @returns {boolean}\r\n\t * @private\r\n\t */\r\n\t_isPointInArea: function(point, area) {\r\n\t\tvar epsilon = 1e-6; // 1e-6 is margin in pixels for accumulated error.\r\n\r\n\t\treturn point.x > area.left - epsilon && point.x < area.right + epsilon &&\r\n\t\t\tpoint.y > area.top - epsilon && point.y < area.bottom + epsilon;\r\n\t},\r\n\r\n\tclipArea: function(ctx, area) {\r\n\t\tctx.save();\r\n\t\tctx.beginPath();\r\n\t\tctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\r\n\t\tctx.clip();\r\n\t},\r\n\r\n\tunclipArea: function(ctx) {\r\n\t\tctx.restore();\r\n\t},\r\n\r\n\tlineTo: function(ctx, previous, target, flip) {\r\n\t\tvar stepped = target.steppedLine;\r\n\t\tif (stepped) {\r\n\t\t\tif (stepped === 'middle') {\r\n\t\t\t\tvar midpoint = (previous.x + target.x) / 2.0;\r\n\t\t\t\tctx.lineTo(midpoint, flip ? target.y : previous.y);\r\n\t\t\t\tctx.lineTo(midpoint, flip ? previous.y : target.y);\r\n\t\t\t} else if ((stepped === 'after' && !flip) || (stepped !== 'after' && flip)) {\r\n\t\t\t\tctx.lineTo(previous.x, target.y);\r\n\t\t\t} else {\r\n\t\t\t\tctx.lineTo(target.x, previous.y);\r\n\t\t\t}\r\n\t\t\tctx.lineTo(target.x, target.y);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (!target.tension) {\r\n\t\t\tctx.lineTo(target.x, target.y);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tctx.bezierCurveTo(\r\n\t\t\tflip ? previous.controlPointPreviousX : previous.controlPointNextX,\r\n\t\t\tflip ? previous.controlPointPreviousY : previous.controlPointNextY,\r\n\t\t\tflip ? target.controlPointNextX : target.controlPointPreviousX,\r\n\t\t\tflip ? target.controlPointNextY : target.controlPointPreviousY,\r\n\t\t\ttarget.x,\r\n\t\t\ttarget.y);\r\n\t}\r\n};\r\n\r\nvar helpers_canvas = exports$1;\r\n\r\n// DEPRECATIONS\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.helpers.canvas.clear instead.\r\n * @namespace Chart.helpers.clear\r\n * @deprecated since version 2.7.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers_core.clear = exports$1.clear;\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.helpers.canvas.roundedRect instead.\r\n * @namespace Chart.helpers.drawRoundedRectangle\r\n * @deprecated since version 2.7.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers_core.drawRoundedRectangle = function(ctx) {\r\n\tctx.beginPath();\r\n\texports$1.roundedRect.apply(exports$1, arguments);\r\n};\n\nvar defaults = {\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_set: function(scope, values) {\r\n\t\treturn helpers_core.merge(this[scope] || (this[scope] = {}), values);\r\n\t}\r\n};\r\n\r\n// TODO(v3): remove 'global' from namespace. all default are global and\r\n// there's inconsistency around which options are under 'global'\r\ndefaults._set('global', {\r\n\tdefaultColor: 'rgba(0,0,0,0.1)',\r\n\tdefaultFontColor: '#666',\r\n\tdefaultFontFamily: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\r\n\tdefaultFontSize: 12,\r\n\tdefaultFontStyle: 'normal',\r\n\tdefaultLineHeight: 1.2,\r\n\tshowLines: true\r\n});\r\n\r\nvar core_defaults = defaults;\n\nvar valueOrDefault = helpers_core.valueOrDefault;\r\n\r\n/**\r\n * Converts the given font object into a CSS font string.\r\n * @param {object} font - A font object.\r\n * @return {string} The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font\r\n * @private\r\n */\r\nfunction toFontString(font) {\r\n\tif (!font || helpers_core.isNullOrUndef(font.size) || helpers_core.isNullOrUndef(font.family)) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn (font.style ? font.style + ' ' : '')\r\n\t\t+ (font.weight ? font.weight + ' ' : '')\r\n\t\t+ font.size + 'px '\r\n\t\t+ font.family;\r\n}\r\n\r\n/**\r\n * @alias Chart.helpers.options\r\n * @namespace\r\n */\r\nvar helpers_options = {\r\n\t/**\r\n\t * Converts the given line height `value` in pixels for a specific font `size`.\r\n\t * @param {number|string} value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\r\n\t * @param {number} size - The font size (in pixels) used to resolve relative `value`.\r\n\t * @returns {number} The effective line height in pixels (size * 1.2 if value is invalid).\r\n\t * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\r\n\t * @since 2.7.0\r\n\t */\r\n\ttoLineHeight: function(value, size) {\r\n\t\tvar matches = ('' + value).match(/^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/);\r\n\t\tif (!matches || matches[1] === 'normal') {\r\n\t\t\treturn size * 1.2;\r\n\t\t}\r\n\r\n\t\tvalue = +matches[2];\r\n\r\n\t\tswitch (matches[3]) {\r\n\t\tcase 'px':\r\n\t\t\treturn value;\r\n\t\tcase '%':\r\n\t\t\tvalue /= 100;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn size * value;\r\n\t},\r\n\r\n\t/**\r\n\t * Converts the given value into a padding object with pre-computed width/height.\r\n\t * @param {number|object} value - If a number, set the value to all TRBL component,\r\n\t * else, if and object, use defined properties and sets undefined ones to 0.\r\n\t * @returns {object} The padding values (top, right, bottom, left, width, height)\r\n\t * @since 2.7.0\r\n\t */\r\n\ttoPadding: function(value) {\r\n\t\tvar t, r, b, l;\r\n\r\n\t\tif (helpers_core.isObject(value)) {\r\n\t\t\tt = +value.top || 0;\r\n\t\t\tr = +value.right || 0;\r\n\t\t\tb = +value.bottom || 0;\r\n\t\t\tl = +value.left || 0;\r\n\t\t} else {\r\n\t\t\tt = r = b = l = +value || 0;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\ttop: t,\r\n\t\t\tright: r,\r\n\t\t\tbottom: b,\r\n\t\t\tleft: l,\r\n\t\t\theight: t + b,\r\n\t\t\twidth: l + r\r\n\t\t};\r\n\t},\r\n\r\n\t/**\r\n\t * Parses font options and returns the font object.\r\n\t * @param {object} options - A object that contains font options to be parsed.\r\n\t * @return {object} The font object.\r\n\t * @todo Support font.* options and renamed to toFont().\r\n\t * @private\r\n\t */\r\n\t_parseFont: function(options) {\r\n\t\tvar globalDefaults = core_defaults.global;\r\n\t\tvar size = valueOrDefault(options.fontSize, globalDefaults.defaultFontSize);\r\n\t\tvar font = {\r\n\t\t\tfamily: valueOrDefault(options.fontFamily, globalDefaults.defaultFontFamily),\r\n\t\t\tlineHeight: helpers_core.options.toLineHeight(valueOrDefault(options.lineHeight, globalDefaults.defaultLineHeight), size),\r\n\t\t\tsize: size,\r\n\t\t\tstyle: valueOrDefault(options.fontStyle, globalDefaults.defaultFontStyle),\r\n\t\t\tweight: null,\r\n\t\t\tstring: ''\r\n\t\t};\r\n\r\n\t\tfont.string = toFontString(font);\r\n\t\treturn font;\r\n\t},\r\n\r\n\t/**\r\n\t * Evaluates the given `inputs` sequentially and returns the first defined value.\r\n\t * @param {Array} inputs - An array of values, falling back to the last value.\r\n\t * @param {object} [context] - If defined and the current value is a function, the value\r\n\t * is called with `context` as first argument and the result becomes the new input.\r\n\t * @param {number} [index] - If defined and the current value is an array, the value\r\n\t * at `index` become the new input.\r\n\t * @param {object} [info] - object to return information about resolution in\r\n\t * @param {boolean} [info.cacheable] - Will be set to `false` if option is not cacheable.\r\n\t * @since 2.7.0\r\n\t */\r\n\tresolve: function(inputs, context, index, info) {\r\n\t\tvar cacheable = true;\r\n\t\tvar i, ilen, value;\r\n\r\n\t\tfor (i = 0, ilen = inputs.length; i < ilen; ++i) {\r\n\t\t\tvalue = inputs[i];\r\n\t\t\tif (value === undefined) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (context !== undefined && typeof value === 'function') {\r\n\t\t\t\tvalue = value(context);\r\n\t\t\t\tcacheable = false;\r\n\t\t\t}\r\n\t\t\tif (index !== undefined && helpers_core.isArray(value)) {\r\n\t\t\t\tvalue = value[index];\r\n\t\t\t\tcacheable = false;\r\n\t\t\t}\r\n\t\t\tif (value !== undefined) {\r\n\t\t\t\tif (info && !cacheable) {\r\n\t\t\t\t\tinfo.cacheable = false;\r\n\t\t\t\t}\r\n\t\t\t\treturn value;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\n\n/**\r\n * @alias Chart.helpers.math\r\n * @namespace\r\n */\r\nvar exports$2 = {\r\n\t/**\r\n\t * Returns an array of factors sorted from 1 to sqrt(value)\r\n\t * @private\r\n\t */\r\n\t_factorize: function(value) {\r\n\t\tvar result = [];\r\n\t\tvar sqrt = Math.sqrt(value);\r\n\t\tvar i;\r\n\r\n\t\tfor (i = 1; i < sqrt; i++) {\r\n\t\t\tif (value % i === 0) {\r\n\t\t\t\tresult.push(i);\r\n\t\t\t\tresult.push(value / i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (sqrt === (sqrt | 0)) { // if value is a square number\r\n\t\t\tresult.push(sqrt);\r\n\t\t}\r\n\r\n\t\tresult.sort(function(a, b) {\r\n\t\t\treturn a - b;\r\n\t\t}).pop();\r\n\t\treturn result;\r\n\t},\r\n\r\n\tlog10: Math.log10 || function(x) {\r\n\t\tvar exponent = Math.log(x) * Math.LOG10E; // Math.LOG10E = 1 / Math.LN10.\r\n\t\t// Check for whole powers of 10,\r\n\t\t// which due to floating point rounding error should be corrected.\r\n\t\tvar powerOf10 = Math.round(exponent);\r\n\t\tvar isPowerOf10 = x === Math.pow(10, powerOf10);\r\n\r\n\t\treturn isPowerOf10 ? powerOf10 : exponent;\r\n\t}\r\n};\r\n\r\nvar helpers_math = exports$2;\r\n\r\n// DEPRECATIONS\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.helpers.math.log10 instead.\r\n * @namespace Chart.helpers.log10\r\n * @deprecated since version 2.9.0\r\n * @todo remove at version 3\r\n * @private\r\n */\r\nhelpers_core.log10 = exports$2.log10;\n\nvar getRtlAdapter = function(rectX, width) {\r\n\treturn {\r\n\t\tx: function(x) {\r\n\t\t\treturn rectX + rectX + width - x;\r\n\t\t},\r\n\t\tsetWidth: function(w) {\r\n\t\t\twidth = w;\r\n\t\t},\r\n\t\ttextAlign: function(align) {\r\n\t\t\tif (align === 'center') {\r\n\t\t\t\treturn align;\r\n\t\t\t}\r\n\t\t\treturn align === 'right' ? 'left' : 'right';\r\n\t\t},\r\n\t\txPlus: function(x, value) {\r\n\t\t\treturn x - value;\r\n\t\t},\r\n\t\tleftForLtr: function(x, itemWidth) {\r\n\t\t\treturn x - itemWidth;\r\n\t\t},\r\n\t};\r\n};\r\n\r\nvar getLtrAdapter = function() {\r\n\treturn {\r\n\t\tx: function(x) {\r\n\t\t\treturn x;\r\n\t\t},\r\n\t\tsetWidth: function(w) { // eslint-disable-line no-unused-vars\r\n\t\t},\r\n\t\ttextAlign: function(align) {\r\n\t\t\treturn align;\r\n\t\t},\r\n\t\txPlus: function(x, value) {\r\n\t\t\treturn x + value;\r\n\t\t},\r\n\t\tleftForLtr: function(x, _itemWidth) { // eslint-disable-line no-unused-vars\r\n\t\t\treturn x;\r\n\t\t},\r\n\t};\r\n};\r\n\r\nvar getAdapter = function(rtl, rectX, width) {\r\n\treturn rtl ? getRtlAdapter(rectX, width) : getLtrAdapter();\r\n};\r\n\r\nvar overrideTextDirection = function(ctx, direction) {\r\n\tvar style, original;\r\n\tif (direction === 'ltr' || direction === 'rtl') {\r\n\t\tstyle = ctx.canvas.style;\r\n\t\toriginal = [\r\n\t\t\tstyle.getPropertyValue('direction'),\r\n\t\t\tstyle.getPropertyPriority('direction'),\r\n\t\t];\r\n\r\n\t\tstyle.setProperty('direction', direction, 'important');\r\n\t\tctx.prevTextDirection = original;\r\n\t}\r\n};\r\n\r\nvar restoreTextDirection = function(ctx) {\r\n\tvar original = ctx.prevTextDirection;\r\n\tif (original !== undefined) {\r\n\t\tdelete ctx.prevTextDirection;\r\n\t\tctx.canvas.style.setProperty('direction', original[0], original[1]);\r\n\t}\r\n};\r\n\r\nvar helpers_rtl = {\r\n\tgetRtlAdapter: getAdapter,\r\n\toverrideTextDirection: overrideTextDirection,\r\n\trestoreTextDirection: restoreTextDirection,\r\n};\n\nvar helpers$1 = helpers_core;\r\nvar easing = helpers_easing;\r\nvar canvas = helpers_canvas;\r\nvar options = helpers_options;\r\nvar math = helpers_math;\r\nvar rtl = helpers_rtl;\nhelpers$1.easing = easing;\nhelpers$1.canvas = canvas;\nhelpers$1.options = options;\nhelpers$1.math = math;\nhelpers$1.rtl = rtl;\n\nfunction interpolate(start, view, model, ease) {\r\n\tvar keys = Object.keys(model);\r\n\tvar i, ilen, key, actual, origin, target, type, c0, c1;\r\n\r\n\tfor (i = 0, ilen = keys.length; i < ilen; ++i) {\r\n\t\tkey = keys[i];\r\n\r\n\t\ttarget = model[key];\r\n\r\n\t\t// if a value is added to the model after pivot() has been called, the view\r\n\t\t// doesn't contain it, so let's initialize the view to the target value.\r\n\t\tif (!view.hasOwnProperty(key)) {\r\n\t\t\tview[key] = target;\r\n\t\t}\r\n\r\n\t\tactual = view[key];\r\n\r\n\t\tif (actual === target || key[0] === '_') {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tif (!start.hasOwnProperty(key)) {\r\n\t\t\tstart[key] = actual;\r\n\t\t}\r\n\r\n\t\torigin = start[key];\r\n\r\n\t\ttype = typeof target;\r\n\r\n\t\tif (type === typeof origin) {\r\n\t\t\tif (type === 'string') {\r\n\t\t\t\tc0 = chartjsColor(origin);\r\n\t\t\t\tif (c0.valid) {\r\n\t\t\t\t\tc1 = chartjsColor(target);\r\n\t\t\t\t\tif (c1.valid) {\r\n\t\t\t\t\t\tview[key] = c1.mix(c0, ease).rgbString();\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (helpers$1.isFinite(origin) && helpers$1.isFinite(target)) {\r\n\t\t\t\tview[key] = origin + (target - origin) * ease;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tview[key] = target;\r\n\t}\r\n}\r\n\r\nvar Element = function(configuration) {\r\n\thelpers$1.extend(this, configuration);\r\n\tthis.initialize.apply(this, arguments);\r\n};\r\n\r\nhelpers$1.extend(Element.prototype, {\r\n\t_type: undefined,\r\n\r\n\tinitialize: function() {\r\n\t\tthis.hidden = false;\r\n\t},\r\n\r\n\tpivot: function() {\r\n\t\tvar me = this;\r\n\t\tif (!me._view) {\r\n\t\t\tme._view = helpers$1.extend({}, me._model);\r\n\t\t}\r\n\t\tme._start = {};\r\n\t\treturn me;\r\n\t},\r\n\r\n\ttransition: function(ease) {\r\n\t\tvar me = this;\r\n\t\tvar model = me._model;\r\n\t\tvar start = me._start;\r\n\t\tvar view = me._view;\r\n\r\n\t\t// No animation -> No Transition\r\n\t\tif (!model || ease === 1) {\r\n\t\t\tme._view = helpers$1.extend({}, model);\r\n\t\t\tme._start = null;\r\n\t\t\treturn me;\r\n\t\t}\r\n\r\n\t\tif (!view) {\r\n\t\t\tview = me._view = {};\r\n\t\t}\r\n\r\n\t\tif (!start) {\r\n\t\t\tstart = me._start = {};\r\n\t\t}\r\n\r\n\t\tinterpolate(start, view, model, ease);\r\n\r\n\t\treturn me;\r\n\t},\r\n\r\n\ttooltipPosition: function() {\r\n\t\treturn {\r\n\t\t\tx: this._model.x,\r\n\t\t\ty: this._model.y\r\n\t\t};\r\n\t},\r\n\r\n\thasValue: function() {\r\n\t\treturn helpers$1.isNumber(this._model.x) && helpers$1.isNumber(this._model.y);\r\n\t}\r\n});\r\n\r\nElement.extend = helpers$1.inherits;\r\n\r\nvar core_element = Element;\n\nvar exports$3 = core_element.extend({\r\n\tchart: null, // the animation associated chart instance\r\n\tcurrentStep: 0, // the current animation step\r\n\tnumSteps: 60, // default number of steps\r\n\teasing: '', // the easing to use for this animation\r\n\trender: null, // render function used by the animation service\r\n\r\n\tonAnimationProgress: null, // user specified callback to fire on each step of the animation\r\n\tonAnimationComplete: null, // user specified callback to fire when the animation finishes\r\n});\r\n\r\nvar core_animation = exports$3;\r\n\r\n// DEPRECATIONS\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.Animation instead\r\n * @prop Chart.Animation#animationObject\r\n * @deprecated since version 2.6.0\r\n * @todo remove at version 3\r\n */\r\nObject.defineProperty(exports$3.prototype, 'animationObject', {\r\n\tget: function() {\r\n\t\treturn this;\r\n\t}\r\n});\r\n\r\n/**\r\n * Provided for backward compatibility, use Chart.Animation#chart instead\r\n * @prop Chart.Animation#chartInstance\r\n * @deprecated since version 2.6.0\r\n * @todo remove at version 3\r\n */\r\nObject.defineProperty(exports$3.prototype, 'chartInstance', {\r\n\tget: function() {\r\n\t\treturn this.chart;\r\n\t},\r\n\tset: function(value) {\r\n\t\tthis.chart = value;\r\n\t}\r\n});\n\ncore_defaults._set('global', {\r\n\tanimation: {\r\n\t\tduration: 1000,\r\n\t\teasing: 'easeOutQuart',\r\n\t\tonProgress: helpers$1.noop,\r\n\t\tonComplete: helpers$1.noop\r\n\t}\r\n});\r\n\r\nvar core_animations = {\r\n\tanimations: [],\r\n\trequest: null,\r\n\r\n\t/**\r\n\t * @param {Chart} chart - The chart to animate.\r\n\t * @param {Chart.Animation} animation - The animation that we will animate.\r\n\t * @param {number} duration - The animation duration in ms.\r\n\t * @param {boolean} lazy - if true, the chart is not marked as animating to enable more responsive interactions\r\n\t */\r\n\taddAnimation: function(chart, animation, duration, lazy) {\r\n\t\tvar animations = this.animations;\r\n\t\tvar i, ilen;\r\n\r\n\t\tanimation.chart = chart;\r\n\t\tanimation.startTime = Date.now();\r\n\t\tanimation.duration = duration;\r\n\r\n\t\tif (!lazy) {\r\n\t\t\tchart.animating = true;\r\n\t\t}\r\n\r\n\t\tfor (i = 0, ilen = animations.length; i < ilen; ++i) {\r\n\t\t\tif (animations[i].chart === chart) {\r\n\t\t\t\tanimations[i] = animation;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tanimations.push(animation);\r\n\r\n\t\t// If there are no animations queued, manually kickstart a digest, for lack of a better word\r\n\t\tif (animations.length === 1) {\r\n\t\t\tthis.requestAnimationFrame();\r\n\t\t}\r\n\t},\r\n\r\n\tcancelAnimation: function(chart) {\r\n\t\tvar index = helpers$1.findIndex(this.animations, function(animation) {\r\n\t\t\treturn animation.chart === chart;\r\n\t\t});\r\n\r\n\t\tif (index !== -1) {\r\n\t\t\tthis.animations.splice(index, 1);\r\n\t\t\tchart.animating = false;\r\n\t\t}\r\n\t},\r\n\r\n\trequestAnimationFrame: function() {\r\n\t\tvar me = this;\r\n\t\tif (me.request === null) {\r\n\t\t\t// Skip animation frame requests until the active one is executed.\r\n\t\t\t// This can happen when processing mouse events, e.g. 'mousemove'\r\n\t\t\t// and 'mouseout' events will trigger multiple renders.\r\n\t\t\tme.request = helpers$1.requestAnimFrame.call(window, function() {\r\n\t\t\t\tme.request = null;\r\n\t\t\t\tme.startDigest();\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tstartDigest: function() {\r\n\t\tvar me = this;\r\n\r\n\t\tme.advance();\r\n\r\n\t\t// Do we have more stuff to animate?\r\n\t\tif (me.animations.length > 0) {\r\n\t\t\tme.requestAnimationFrame();\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tadvance: function() {\r\n\t\tvar animations = this.animations;\r\n\t\tvar animation, chart, numSteps, nextStep;\r\n\t\tvar i = 0;\r\n\r\n\t\t// 1 animation per chart, so we are looping charts here\r\n\t\twhile (i < animations.length) {\r\n\t\t\tanimation = animations[i];\r\n\t\t\tchart = animation.chart;\r\n\t\t\tnumSteps = animation.numSteps;\r\n\r\n\t\t\t// Make sure that currentStep starts at 1\r\n\t\t\t// https://github.com/chartjs/Chart.js/issues/6104\r\n\t\t\tnextStep = Math.floor((Date.now() - animation.startTime) / animation.duration * numSteps) + 1;\r\n\t\t\tanimation.currentStep = Math.min(nextStep, numSteps);\r\n\r\n\t\t\thelpers$1.callback(animation.render, [chart, animation], chart);\r\n\t\t\thelpers$1.callback(animation.onAnimationProgress, [animation], chart);\r\n\r\n\t\t\tif (animation.currentStep >= numSteps) {\r\n\t\t\t\thelpers$1.callback(animation.onAnimationComplete, [animation], chart);\r\n\t\t\t\tchart.animating = false;\r\n\t\t\t\tanimations.splice(i, 1);\r\n\t\t\t} else {\r\n\t\t\t\t++i;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\n\nvar resolve = helpers$1.options.resolve;\r\n\r\nvar arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift'];\r\n\r\n/**\r\n * Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice',\r\n * 'unshift') and notify the listener AFTER the array has been altered. Listeners are\r\n * called on the 'onData*' callbacks (e.g. onDataPush, etc.) with same arguments.\r\n */\r\nfunction listenArrayEvents(array, listener) {\r\n\tif (array._chartjs) {\r\n\t\tarray._chartjs.listeners.push(listener);\r\n\t\treturn;\r\n\t}\r\n\r\n\tObject.defineProperty(array, '_chartjs', {\r\n\t\tconfigurable: true,\r\n\t\tenumerable: false,\r\n\t\tvalue: {\r\n\t\t\tlisteners: [listener]\r\n\t\t}\r\n\t});\r\n\r\n\tarrayEvents.forEach(function(key) {\r\n\t\tvar method = 'onData' + key.charAt(0).toUpperCase() + key.slice(1);\r\n\t\tvar base = array[key];\r\n\r\n\t\tObject.defineProperty(array, key, {\r\n\t\t\tconfigurable: true,\r\n\t\t\tenumerable: false,\r\n\t\t\tvalue: function() {\r\n\t\t\t\tvar args = Array.prototype.slice.call(arguments);\r\n\t\t\t\tvar res = base.apply(this, args);\r\n\r\n\t\t\t\thelpers$1.each(array._chartjs.listeners, function(object) {\r\n\t\t\t\t\tif (typeof object[method] === 'function') {\r\n\t\t\t\t\t\tobject[method].apply(object, args);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn res;\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n}\r\n\r\n/**\r\n * Removes the given array event listener and cleanup extra attached properties (such as\r\n * the _chartjs stub and overridden methods) if array doesn't have any more listeners.\r\n */\r\nfunction unlistenArrayEvents(array, listener) {\r\n\tvar stub = array._chartjs;\r\n\tif (!stub) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar listeners = stub.listeners;\r\n\tvar index = listeners.indexOf(listener);\r\n\tif (index !== -1) {\r\n\t\tlisteners.splice(index, 1);\r\n\t}\r\n\r\n\tif (listeners.length > 0) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tarrayEvents.forEach(function(key) {\r\n\t\tdelete array[key];\r\n\t});\r\n\r\n\tdelete array._chartjs;\r\n}\r\n\r\n// Base class for all dataset controllers (line, bar, etc)\r\nvar DatasetController = function(chart, datasetIndex) {\r\n\tthis.initialize(chart, datasetIndex);\r\n};\r\n\r\nhelpers$1.extend(DatasetController.prototype, {\r\n\r\n\t/**\r\n\t * Element type used to generate a meta dataset (e.g. Chart.element.Line).\r\n\t * @type {Chart.core.element}\r\n\t */\r\n\tdatasetElementType: null,\r\n\r\n\t/**\r\n\t * Element type used to generate a meta data (e.g. Chart.element.Point).\r\n\t * @type {Chart.core.element}\r\n\t */\r\n\tdataElementType: null,\r\n\r\n\t/**\r\n\t * Dataset element option keys to be resolved in _resolveDatasetElementOptions.\r\n\t * A derived controller may override this to resolve controller-specific options.\r\n\t * The keys defined here are for backward compatibility for legend styles.\r\n\t * @private\r\n\t */\r\n\t_datasetElementOptions: [\r\n\t\t'backgroundColor',\r\n\t\t'borderCapStyle',\r\n\t\t'borderColor',\r\n\t\t'borderDash',\r\n\t\t'borderDashOffset',\r\n\t\t'borderJoinStyle',\r\n\t\t'borderWidth'\r\n\t],\r\n\r\n\t/**\r\n\t * Data element option keys to be resolved in _resolveDataElementOptions.\r\n\t * A derived controller may override this to resolve controller-specific options.\r\n\t * The keys defined here are for backward compatibility for legend styles.\r\n\t * @private\r\n\t */\r\n\t_dataElementOptions: [\r\n\t\t'backgroundColor',\r\n\t\t'borderColor',\r\n\t\t'borderWidth',\r\n\t\t'pointStyle'\r\n\t],\r\n\r\n\tinitialize: function(chart, datasetIndex) {\r\n\t\tvar me = this;\r\n\t\tme.chart = chart;\r\n\t\tme.index = datasetIndex;\r\n\t\tme.linkScales();\r\n\t\tme.addElements();\r\n\t\tme._type = me.getMeta().type;\r\n\t},\r\n\r\n\tupdateIndex: function(datasetIndex) {\r\n\t\tthis.index = datasetIndex;\r\n\t},\r\n\r\n\tlinkScales: function() {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar chart = me.chart;\r\n\t\tvar scales = chart.scales;\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar scalesOpts = chart.options.scales;\r\n\r\n\t\tif (meta.xAxisID === null || !(meta.xAxisID in scales) || dataset.xAxisID) {\r\n\t\t\tmeta.xAxisID = dataset.xAxisID || scalesOpts.xAxes[0].id;\r\n\t\t}\r\n\t\tif (meta.yAxisID === null || !(meta.yAxisID in scales) || dataset.yAxisID) {\r\n\t\t\tmeta.yAxisID = dataset.yAxisID || scalesOpts.yAxes[0].id;\r\n\t\t}\r\n\t},\r\n\r\n\tgetDataset: function() {\r\n\t\treturn this.chart.data.datasets[this.index];\r\n\t},\r\n\r\n\tgetMeta: function() {\r\n\t\treturn this.chart.getDatasetMeta(this.index);\r\n\t},\r\n\r\n\tgetScaleForId: function(scaleID) {\r\n\t\treturn this.chart.scales[scaleID];\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getValueScaleId: function() {\r\n\t\treturn this.getMeta().yAxisID;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getIndexScaleId: function() {\r\n\t\treturn this.getMeta().xAxisID;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getValueScale: function() {\r\n\t\treturn this.getScaleForId(this._getValueScaleId());\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getIndexScale: function() {\r\n\t\treturn this.getScaleForId(this._getIndexScaleId());\r\n\t},\r\n\r\n\treset: function() {\r\n\t\tthis._update(true);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tdestroy: function() {\r\n\t\tif (this._data) {\r\n\t\t\tunlistenArrayEvents(this._data, this);\r\n\t\t}\r\n\t},\r\n\r\n\tcreateMetaDataset: function() {\r\n\t\tvar me = this;\r\n\t\tvar type = me.datasetElementType;\r\n\t\treturn type && new type({\r\n\t\t\t_chart: me.chart,\r\n\t\t\t_datasetIndex: me.index\r\n\t\t});\r\n\t},\r\n\r\n\tcreateMetaData: function(index) {\r\n\t\tvar me = this;\r\n\t\tvar type = me.dataElementType;\r\n\t\treturn type && new type({\r\n\t\t\t_chart: me.chart,\r\n\t\t\t_datasetIndex: me.index,\r\n\t\t\t_index: index\r\n\t\t});\r\n\t},\r\n\r\n\taddElements: function() {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar data = me.getDataset().data || [];\r\n\t\tvar metaData = meta.data;\r\n\t\tvar i, ilen;\r\n\r\n\t\tfor (i = 0, ilen = data.length; i < ilen; ++i) {\r\n\t\t\tmetaData[i] = metaData[i] || me.createMetaData(i);\r\n\t\t}\r\n\r\n\t\tmeta.dataset = meta.dataset || me.createMetaDataset();\r\n\t},\r\n\r\n\taddElementAndReset: function(index) {\r\n\t\tvar element = this.createMetaData(index);\r\n\t\tthis.getMeta().data.splice(index, 0, element);\r\n\t\tthis.updateElement(element, index, true);\r\n\t},\r\n\r\n\tbuildOrUpdateElements: function() {\r\n\t\tvar me = this;\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar data = dataset.data || (dataset.data = []);\r\n\r\n\t\t// In order to correctly handle data addition/deletion animation (an thus simulate\r\n\t\t// real-time charts), we need to monitor these data modifications and synchronize\r\n\t\t// the internal meta data accordingly.\r\n\t\tif (me._data !== data) {\r\n\t\t\tif (me._data) {\r\n\t\t\t\t// This case happens when the user replaced the data array instance.\r\n\t\t\t\tunlistenArrayEvents(me._data, me);\r\n\t\t\t}\r\n\r\n\t\t\tif (data && Object.isExtensible(data)) {\r\n\t\t\t\tlistenArrayEvents(data, me);\r\n\t\t\t}\r\n\t\t\tme._data = data;\r\n\t\t}\r\n\r\n\t\t// Re-sync meta data in case the user replaced the data array or if we missed\r\n\t\t// any updates and so make sure that we handle number of datapoints changing.\r\n\t\tme.resyncElements();\r\n\t},\r\n\r\n\t/**\r\n\t * Returns the merged user-supplied and default dataset-level options\r\n\t * @private\r\n\t */\r\n\t_configure: function() {\r\n\t\tvar me = this;\r\n\t\tme._config = helpers$1.merge(Object.create(null), [\r\n\t\t\tme.chart.options.datasets[me._type],\r\n\t\t\tme.getDataset(),\r\n\t\t], {\r\n\t\t\tmerger: function(key, target, source) {\r\n\t\t\t\tif (key !== '_meta' && key !== 'data') {\r\n\t\t\t\t\thelpers$1._merger(key, target, source);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t},\r\n\r\n\t_update: function(reset) {\r\n\t\tvar me = this;\r\n\t\tme._configure();\r\n\t\tme._cachedDataOpts = null;\r\n\t\tme.update(reset);\r\n\t},\r\n\r\n\tupdate: helpers$1.noop,\r\n\r\n\ttransition: function(easingValue) {\r\n\t\tvar meta = this.getMeta();\r\n\t\tvar elements = meta.data || [];\r\n\t\tvar ilen = elements.length;\r\n\t\tvar i = 0;\r\n\r\n\t\tfor (; i < ilen; ++i) {\r\n\t\t\telements[i].transition(easingValue);\r\n\t\t}\r\n\r\n\t\tif (meta.dataset) {\r\n\t\t\tmeta.dataset.transition(easingValue);\r\n\t\t}\r\n\t},\r\n\r\n\tdraw: function() {\r\n\t\tvar meta = this.getMeta();\r\n\t\tvar elements = meta.data || [];\r\n\t\tvar ilen = elements.length;\r\n\t\tvar i = 0;\r\n\r\n\t\tif (meta.dataset) {\r\n\t\t\tmeta.dataset.draw();\r\n\t\t}\r\n\r\n\t\tfor (; i < ilen; ++i) {\r\n\t\t\telements[i].draw();\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Returns a set of predefined style properties that should be used to represent the dataset\r\n\t * or the data if the index is specified\r\n\t * @param {number} index - data index\r\n\t * @return {IStyleInterface} style object\r\n\t */\r\n\tgetStyle: function(index) {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar dataset = meta.dataset;\r\n\t\tvar style;\r\n\r\n\t\tme._configure();\r\n\t\tif (dataset && index === undefined) {\r\n\t\t\tstyle = me._resolveDatasetElementOptions(dataset || {});\r\n\t\t} else {\r\n\t\t\tindex = index || 0;\r\n\t\t\tstyle = me._resolveDataElementOptions(meta.data[index] || {}, index);\r\n\t\t}\r\n\r\n\t\tif (style.fill === false || style.fill === null) {\r\n\t\t\tstyle.backgroundColor = style.borderColor;\r\n\t\t}\r\n\r\n\t\treturn style;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_resolveDatasetElementOptions: function(element, hover) {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar datasetOpts = me._config;\r\n\t\tvar custom = element.custom || {};\r\n\t\tvar options = chart.options.elements[me.datasetElementType.prototype._type] || {};\r\n\t\tvar elementOptions = me._datasetElementOptions;\r\n\t\tvar values = {};\r\n\t\tvar i, ilen, key, readKey;\r\n\r\n\t\t// Scriptable options\r\n\t\tvar context = {\r\n\t\t\tchart: chart,\r\n\t\t\tdataset: me.getDataset(),\r\n\t\t\tdatasetIndex: me.index,\r\n\t\t\thover: hover\r\n\t\t};\r\n\r\n\t\tfor (i = 0, ilen = elementOptions.length; i < ilen; ++i) {\r\n\t\t\tkey = elementOptions[i];\r\n\t\t\treadKey = hover ? 'hover' + key.charAt(0).toUpperCase() + key.slice(1) : key;\r\n\t\t\tvalues[key] = resolve([\r\n\t\t\t\tcustom[readKey],\r\n\t\t\t\tdatasetOpts[readKey],\r\n\t\t\t\toptions[readKey]\r\n\t\t\t], context);\r\n\t\t}\r\n\r\n\t\treturn values;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_resolveDataElementOptions: function(element, index) {\r\n\t\tvar me = this;\r\n\t\tvar custom = element && element.custom;\r\n\t\tvar cached = me._cachedDataOpts;\r\n\t\tif (cached && !custom) {\r\n\t\t\treturn cached;\r\n\t\t}\r\n\t\tvar chart = me.chart;\r\n\t\tvar datasetOpts = me._config;\r\n\t\tvar options = chart.options.elements[me.dataElementType.prototype._type] || {};\r\n\t\tvar elementOptions = me._dataElementOptions;\r\n\t\tvar values = {};\r\n\r\n\t\t// Scriptable options\r\n\t\tvar context = {\r\n\t\t\tchart: chart,\r\n\t\t\tdataIndex: index,\r\n\t\t\tdataset: me.getDataset(),\r\n\t\t\tdatasetIndex: me.index\r\n\t\t};\r\n\r\n\t\t// `resolve` sets cacheable to `false` if any option is indexed or scripted\r\n\t\tvar info = {cacheable: !custom};\r\n\r\n\t\tvar keys, i, ilen, key;\r\n\r\n\t\tcustom = custom || {};\r\n\r\n\t\tif (helpers$1.isArray(elementOptions)) {\r\n\t\t\tfor (i = 0, ilen = elementOptions.length; i < ilen; ++i) {\r\n\t\t\t\tkey = elementOptions[i];\r\n\t\t\t\tvalues[key] = resolve([\r\n\t\t\t\t\tcustom[key],\r\n\t\t\t\t\tdatasetOpts[key],\r\n\t\t\t\t\toptions[key]\r\n\t\t\t\t], context, index, info);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tkeys = Object.keys(elementOptions);\r\n\t\t\tfor (i = 0, ilen = keys.length; i < ilen; ++i) {\r\n\t\t\t\tkey = keys[i];\r\n\t\t\t\tvalues[key] = resolve([\r\n\t\t\t\t\tcustom[key],\r\n\t\t\t\t\tdatasetOpts[elementOptions[key]],\r\n\t\t\t\t\tdatasetOpts[key],\r\n\t\t\t\t\toptions[key]\r\n\t\t\t\t], context, index, info);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (info.cacheable) {\r\n\t\t\tme._cachedDataOpts = Object.freeze(values);\r\n\t\t}\r\n\r\n\t\treturn values;\r\n\t},\r\n\r\n\tremoveHoverStyle: function(element) {\r\n\t\thelpers$1.merge(element._model, element.$previousStyle || {});\r\n\t\tdelete element.$previousStyle;\r\n\t},\r\n\r\n\tsetHoverStyle: function(element) {\r\n\t\tvar dataset = this.chart.data.datasets[element._datasetIndex];\r\n\t\tvar index = element._index;\r\n\t\tvar custom = element.custom || {};\r\n\t\tvar model = element._model;\r\n\t\tvar getHoverColor = helpers$1.getHoverColor;\r\n\r\n\t\telement.$previousStyle = {\r\n\t\t\tbackgroundColor: model.backgroundColor,\r\n\t\t\tborderColor: model.borderColor,\r\n\t\t\tborderWidth: model.borderWidth\r\n\t\t};\r\n\r\n\t\tmodel.backgroundColor = resolve([custom.hoverBackgroundColor, dataset.hoverBackgroundColor, getHoverColor(model.backgroundColor)], undefined, index);\r\n\t\tmodel.borderColor = resolve([custom.hoverBorderColor, dataset.hoverBorderColor, getHoverColor(model.borderColor)], undefined, index);\r\n\t\tmodel.borderWidth = resolve([custom.hoverBorderWidth, dataset.hoverBorderWidth, model.borderWidth], undefined, index);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_removeDatasetHoverStyle: function() {\r\n\t\tvar element = this.getMeta().dataset;\r\n\r\n\t\tif (element) {\r\n\t\t\tthis.removeHoverStyle(element);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_setDatasetHoverStyle: function() {\r\n\t\tvar element = this.getMeta().dataset;\r\n\t\tvar prev = {};\r\n\t\tvar i, ilen, key, keys, hoverOptions, model;\r\n\r\n\t\tif (!element) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tmodel = element._model;\r\n\t\thoverOptions = this._resolveDatasetElementOptions(element, true);\r\n\r\n\t\tkeys = Object.keys(hoverOptions);\r\n\t\tfor (i = 0, ilen = keys.length; i < ilen; ++i) {\r\n\t\t\tkey = keys[i];\r\n\t\t\tprev[key] = model[key];\r\n\t\t\tmodel[key] = hoverOptions[key];\r\n\t\t}\r\n\r\n\t\telement.$previousStyle = prev;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tresyncElements: function() {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar data = me.getDataset().data;\r\n\t\tvar numMeta = meta.data.length;\r\n\t\tvar numData = data.length;\r\n\r\n\t\tif (numData < numMeta) {\r\n\t\t\tmeta.data.splice(numData, numMeta - numData);\r\n\t\t} else if (numData > numMeta) {\r\n\t\t\tme.insertElements(numMeta, numData - numMeta);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tinsertElements: function(start, count) {\r\n\t\tfor (var i = 0; i < count; ++i) {\r\n\t\t\tthis.addElementAndReset(start + i);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tonDataPush: function() {\r\n\t\tvar count = arguments.length;\r\n\t\tthis.insertElements(this.getDataset().data.length - count, count);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tonDataPop: function() {\r\n\t\tthis.getMeta().data.pop();\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tonDataShift: function() {\r\n\t\tthis.getMeta().data.shift();\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tonDataSplice: function(start, count) {\r\n\t\tthis.getMeta().data.splice(start, count);\r\n\t\tthis.insertElements(start, arguments.length - 2);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tonDataUnshift: function() {\r\n\t\tthis.insertElements(0, arguments.length);\r\n\t}\r\n});\r\n\r\nDatasetController.extend = helpers$1.inherits;\r\n\r\nvar core_datasetController = DatasetController;\n\nvar TAU = Math.PI * 2;\r\n\r\ncore_defaults._set('global', {\r\n\telements: {\r\n\t\tarc: {\r\n\t\t\tbackgroundColor: core_defaults.global.defaultColor,\r\n\t\t\tborderColor: '#fff',\r\n\t\t\tborderWidth: 2,\r\n\t\t\tborderAlign: 'center'\r\n\t\t}\r\n\t}\r\n});\r\n\r\nfunction clipArc(ctx, arc) {\r\n\tvar startAngle = arc.startAngle;\r\n\tvar endAngle = arc.endAngle;\r\n\tvar pixelMargin = arc.pixelMargin;\r\n\tvar angleMargin = pixelMargin / arc.outerRadius;\r\n\tvar x = arc.x;\r\n\tvar y = arc.y;\r\n\r\n\t// Draw an inner border by cliping the arc and drawing a double-width border\r\n\t// Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders\r\n\tctx.beginPath();\r\n\tctx.arc(x, y, arc.outerRadius, startAngle - angleMargin, endAngle + angleMargin);\r\n\tif (arc.innerRadius > pixelMargin) {\r\n\t\tangleMargin = pixelMargin / arc.innerRadius;\r\n\t\tctx.arc(x, y, arc.innerRadius - pixelMargin, endAngle + angleMargin, startAngle - angleMargin, true);\r\n\t} else {\r\n\t\tctx.arc(x, y, pixelMargin, endAngle + Math.PI / 2, startAngle - Math.PI / 2);\r\n\t}\r\n\tctx.closePath();\r\n\tctx.clip();\r\n}\r\n\r\nfunction drawFullCircleBorders(ctx, vm, arc, inner) {\r\n\tvar endAngle = arc.endAngle;\r\n\tvar i;\r\n\r\n\tif (inner) {\r\n\t\tarc.endAngle = arc.startAngle + TAU;\r\n\t\tclipArc(ctx, arc);\r\n\t\tarc.endAngle = endAngle;\r\n\t\tif (arc.endAngle === arc.startAngle && arc.fullCircles) {\r\n\t\t\tarc.endAngle += TAU;\r\n\t\t\tarc.fullCircles--;\r\n\t\t}\r\n\t}\r\n\r\n\tctx.beginPath();\r\n\tctx.arc(arc.x, arc.y, arc.innerRadius, arc.startAngle + TAU, arc.startAngle, true);\r\n\tfor (i = 0; i < arc.fullCircles; ++i) {\r\n\t\tctx.stroke();\r\n\t}\r\n\r\n\tctx.beginPath();\r\n\tctx.arc(arc.x, arc.y, vm.outerRadius, arc.startAngle, arc.startAngle + TAU);\r\n\tfor (i = 0; i < arc.fullCircles; ++i) {\r\n\t\tctx.stroke();\r\n\t}\r\n}\r\n\r\nfunction drawBorder(ctx, vm, arc) {\r\n\tvar inner = vm.borderAlign === 'inner';\r\n\r\n\tif (inner) {\r\n\t\tctx.lineWidth = vm.borderWidth * 2;\r\n\t\tctx.lineJoin = 'round';\r\n\t} else {\r\n\t\tctx.lineWidth = vm.borderWidth;\r\n\t\tctx.lineJoin = 'bevel';\r\n\t}\r\n\r\n\tif (arc.fullCircles) {\r\n\t\tdrawFullCircleBorders(ctx, vm, arc, inner);\r\n\t}\r\n\r\n\tif (inner) {\r\n\t\tclipArc(ctx, arc);\r\n\t}\r\n\r\n\tctx.beginPath();\r\n\tctx.arc(arc.x, arc.y, vm.outerRadius, arc.startAngle, arc.endAngle);\r\n\tctx.arc(arc.x, arc.y, arc.innerRadius, arc.endAngle, arc.startAngle, true);\r\n\tctx.closePath();\r\n\tctx.stroke();\r\n}\r\n\r\nvar element_arc = core_element.extend({\r\n\t_type: 'arc',\r\n\r\n\tinLabelRange: function(mouseX) {\r\n\t\tvar vm = this._view;\r\n\r\n\t\tif (vm) {\r\n\t\t\treturn (Math.pow(mouseX - vm.x, 2) < Math.pow(vm.radius + vm.hoverRadius, 2));\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\r\n\tinRange: function(chartX, chartY) {\r\n\t\tvar vm = this._view;\r\n\r\n\t\tif (vm) {\r\n\t\t\tvar pointRelativePosition = helpers$1.getAngleFromPoint(vm, {x: chartX, y: chartY});\r\n\t\t\tvar angle = pointRelativePosition.angle;\r\n\t\t\tvar distance = pointRelativePosition.distance;\r\n\r\n\t\t\t// Sanitise angle range\r\n\t\t\tvar startAngle = vm.startAngle;\r\n\t\t\tvar endAngle = vm.endAngle;\r\n\t\t\twhile (endAngle < startAngle) {\r\n\t\t\t\tendAngle += TAU;\r\n\t\t\t}\r\n\t\t\twhile (angle > endAngle) {\r\n\t\t\t\tangle -= TAU;\r\n\t\t\t}\r\n\t\t\twhile (angle < startAngle) {\r\n\t\t\t\tangle += TAU;\r\n\t\t\t}\r\n\r\n\t\t\t// Check if within the range of the open/close angle\r\n\t\t\tvar betweenAngles = (angle >= startAngle && angle <= endAngle);\r\n\t\t\tvar withinRadius = (distance >= vm.innerRadius && distance <= vm.outerRadius);\r\n\r\n\t\t\treturn (betweenAngles && withinRadius);\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\r\n\tgetCenterPoint: function() {\r\n\t\tvar vm = this._view;\r\n\t\tvar halfAngle = (vm.startAngle + vm.endAngle) / 2;\r\n\t\tvar halfRadius = (vm.innerRadius + vm.outerRadius) / 2;\r\n\t\treturn {\r\n\t\t\tx: vm.x + Math.cos(halfAngle) * halfRadius,\r\n\t\t\ty: vm.y + Math.sin(halfAngle) * halfRadius\r\n\t\t};\r\n\t},\r\n\r\n\tgetArea: function() {\r\n\t\tvar vm = this._view;\r\n\t\treturn Math.PI * ((vm.endAngle - vm.startAngle) / (2 * Math.PI)) * (Math.pow(vm.outerRadius, 2) - Math.pow(vm.innerRadius, 2));\r\n\t},\r\n\r\n\ttooltipPosition: function() {\r\n\t\tvar vm = this._view;\r\n\t\tvar centreAngle = vm.startAngle + ((vm.endAngle - vm.startAngle) / 2);\r\n\t\tvar rangeFromCentre = (vm.outerRadius - vm.innerRadius) / 2 + vm.innerRadius;\r\n\r\n\t\treturn {\r\n\t\t\tx: vm.x + (Math.cos(centreAngle) * rangeFromCentre),\r\n\t\t\ty: vm.y + (Math.sin(centreAngle) * rangeFromCentre)\r\n\t\t};\r\n\t},\r\n\r\n\tdraw: function() {\r\n\t\tvar ctx = this._chart.ctx;\r\n\t\tvar vm = this._view;\r\n\t\tvar pixelMargin = (vm.borderAlign === 'inner') ? 0.33 : 0;\r\n\t\tvar arc = {\r\n\t\t\tx: vm.x,\r\n\t\t\ty: vm.y,\r\n\t\t\tinnerRadius: vm.innerRadius,\r\n\t\t\touterRadius: Math.max(vm.outerRadius - pixelMargin, 0),\r\n\t\t\tpixelMargin: pixelMargin,\r\n\t\t\tstartAngle: vm.startAngle,\r\n\t\t\tendAngle: vm.endAngle,\r\n\t\t\tfullCircles: Math.floor(vm.circumference / TAU)\r\n\t\t};\r\n\t\tvar i;\r\n\r\n\t\tctx.save();\r\n\r\n\t\tctx.fillStyle = vm.backgroundColor;\r\n\t\tctx.strokeStyle = vm.borderColor;\r\n\r\n\t\tif (arc.fullCircles) {\r\n\t\t\tarc.endAngle = arc.startAngle + TAU;\r\n\t\t\tctx.beginPath();\r\n\t\t\tctx.arc(arc.x, arc.y, arc.outerRadius, arc.startAngle, arc.endAngle);\r\n\t\t\tctx.arc(arc.x, arc.y, arc.innerRadius, arc.endAngle, arc.startAngle, true);\r\n\t\t\tctx.closePath();\r\n\t\t\tfor (i = 0; i < arc.fullCircles; ++i) {\r\n\t\t\t\tctx.fill();\r\n\t\t\t}\r\n\t\t\tarc.endAngle = arc.startAngle + vm.circumference % TAU;\r\n\t\t}\r\n\r\n\t\tctx.beginPath();\r\n\t\tctx.arc(arc.x, arc.y, arc.outerRadius, arc.startAngle, arc.endAngle);\r\n\t\tctx.arc(arc.x, arc.y, arc.innerRadius, arc.endAngle, arc.startAngle, true);\r\n\t\tctx.closePath();\r\n\t\tctx.fill();\r\n\r\n\t\tif (vm.borderWidth) {\r\n\t\t\tdrawBorder(ctx, vm, arc);\r\n\t\t}\r\n\r\n\t\tctx.restore();\r\n\t}\r\n});\n\nvar valueOrDefault$1 = helpers$1.valueOrDefault;\r\n\r\nvar defaultColor = core_defaults.global.defaultColor;\r\n\r\ncore_defaults._set('global', {\r\n\telements: {\r\n\t\tline: {\r\n\t\t\ttension: 0.4,\r\n\t\t\tbackgroundColor: defaultColor,\r\n\t\t\tborderWidth: 3,\r\n\t\t\tborderColor: defaultColor,\r\n\t\t\tborderCapStyle: 'butt',\r\n\t\t\tborderDash: [],\r\n\t\t\tborderDashOffset: 0.0,\r\n\t\t\tborderJoinStyle: 'miter',\r\n\t\t\tcapBezierPoints: true,\r\n\t\t\tfill: true, // do we fill in the area between the line and its base axis\r\n\t\t}\r\n\t}\r\n});\r\n\r\nvar element_line = core_element.extend({\r\n\t_type: 'line',\r\n\r\n\tdraw: function() {\r\n\t\tvar me = this;\r\n\t\tvar vm = me._view;\r\n\t\tvar ctx = me._chart.ctx;\r\n\t\tvar spanGaps = vm.spanGaps;\r\n\t\tvar points = me._children.slice(); // clone array\r\n\t\tvar globalDefaults = core_defaults.global;\r\n\t\tvar globalOptionLineElements = globalDefaults.elements.line;\r\n\t\tvar lastDrawnIndex = -1;\r\n\t\tvar closePath = me._loop;\r\n\t\tvar index, previous, currentVM;\r\n\r\n\t\tif (!points.length) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (me._loop) {\r\n\t\t\tfor (index = 0; index < points.length; ++index) {\r\n\t\t\t\tprevious = helpers$1.previousItem(points, index);\r\n\t\t\t\t// If the line has an open path, shift the point array\r\n\t\t\t\tif (!points[index]._view.skip && previous._view.skip) {\r\n\t\t\t\t\tpoints = points.slice(index).concat(points.slice(0, index));\r\n\t\t\t\t\tclosePath = spanGaps;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// If the line has a close path, add the first point again\r\n\t\t\tif (closePath) {\r\n\t\t\t\tpoints.push(points[0]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tctx.save();\r\n\r\n\t\t// Stroke Line Options\r\n\t\tctx.lineCap = vm.borderCapStyle || globalOptionLineElements.borderCapStyle;\r\n\r\n\t\t// IE 9 and 10 do not support line dash\r\n\t\tif (ctx.setLineDash) {\r\n\t\t\tctx.setLineDash(vm.borderDash || globalOptionLineElements.borderDash);\r\n\t\t}\r\n\r\n\t\tctx.lineDashOffset = valueOrDefault$1(vm.borderDashOffset, globalOptionLineElements.borderDashOffset);\r\n\t\tctx.lineJoin = vm.borderJoinStyle || globalOptionLineElements.borderJoinStyle;\r\n\t\tctx.lineWidth = valueOrDefault$1(vm.borderWidth, globalOptionLineElements.borderWidth);\r\n\t\tctx.strokeStyle = vm.borderColor || globalDefaults.defaultColor;\r\n\r\n\t\t// Stroke Line\r\n\t\tctx.beginPath();\r\n\r\n\t\t// First point moves to it's starting position no matter what\r\n\t\tcurrentVM = points[0]._view;\r\n\t\tif (!currentVM.skip) {\r\n\t\t\tctx.moveTo(currentVM.x, currentVM.y);\r\n\t\t\tlastDrawnIndex = 0;\r\n\t\t}\r\n\r\n\t\tfor (index = 1; index < points.length; ++index) {\r\n\t\t\tcurrentVM = points[index]._view;\r\n\t\t\tprevious = lastDrawnIndex === -1 ? helpers$1.previousItem(points, index) : points[lastDrawnIndex];\r\n\r\n\t\t\tif (!currentVM.skip) {\r\n\t\t\t\tif ((lastDrawnIndex !== (index - 1) && !spanGaps) || lastDrawnIndex === -1) {\r\n\t\t\t\t\t// There was a gap and this is the first point after the gap\r\n\t\t\t\t\tctx.moveTo(currentVM.x, currentVM.y);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Line to next point\r\n\t\t\t\t\thelpers$1.canvas.lineTo(ctx, previous._view, currentVM);\r\n\t\t\t\t}\r\n\t\t\t\tlastDrawnIndex = index;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (closePath) {\r\n\t\t\tctx.closePath();\r\n\t\t}\r\n\r\n\t\tctx.stroke();\r\n\t\tctx.restore();\r\n\t}\r\n});\n\nvar valueOrDefault$2 = helpers$1.valueOrDefault;\r\n\r\nvar defaultColor$1 = core_defaults.global.defaultColor;\r\n\r\ncore_defaults._set('global', {\r\n\telements: {\r\n\t\tpoint: {\r\n\t\t\tradius: 3,\r\n\t\t\tpointStyle: 'circle',\r\n\t\t\tbackgroundColor: defaultColor$1,\r\n\t\t\tborderColor: defaultColor$1,\r\n\t\t\tborderWidth: 1,\r\n\t\t\t// Hover\r\n\t\t\thitRadius: 1,\r\n\t\t\thoverRadius: 4,\r\n\t\t\thoverBorderWidth: 1\r\n\t\t}\r\n\t}\r\n});\r\n\r\nfunction xRange(mouseX) {\r\n\tvar vm = this._view;\r\n\treturn vm ? (Math.abs(mouseX - vm.x) < vm.radius + vm.hitRadius) : false;\r\n}\r\n\r\nfunction yRange(mouseY) {\r\n\tvar vm = this._view;\r\n\treturn vm ? (Math.abs(mouseY - vm.y) < vm.radius + vm.hitRadius) : false;\r\n}\r\n\r\nvar element_point = core_element.extend({\r\n\t_type: 'point',\r\n\r\n\tinRange: function(mouseX, mouseY) {\r\n\t\tvar vm = this._view;\r\n\t\treturn vm ? ((Math.pow(mouseX - vm.x, 2) + Math.pow(mouseY - vm.y, 2)) < Math.pow(vm.hitRadius + vm.radius, 2)) : false;\r\n\t},\r\n\r\n\tinLabelRange: xRange,\r\n\tinXRange: xRange,\r\n\tinYRange: yRange,\r\n\r\n\tgetCenterPoint: function() {\r\n\t\tvar vm = this._view;\r\n\t\treturn {\r\n\t\t\tx: vm.x,\r\n\t\t\ty: vm.y\r\n\t\t};\r\n\t},\r\n\r\n\tgetArea: function() {\r\n\t\treturn Math.PI * Math.pow(this._view.radius, 2);\r\n\t},\r\n\r\n\ttooltipPosition: function() {\r\n\t\tvar vm = this._view;\r\n\t\treturn {\r\n\t\t\tx: vm.x,\r\n\t\t\ty: vm.y,\r\n\t\t\tpadding: vm.radius + vm.borderWidth\r\n\t\t};\r\n\t},\r\n\r\n\tdraw: function(chartArea) {\r\n\t\tvar vm = this._view;\r\n\t\tvar ctx = this._chart.ctx;\r\n\t\tvar pointStyle = vm.pointStyle;\r\n\t\tvar rotation = vm.rotation;\r\n\t\tvar radius = vm.radius;\r\n\t\tvar x = vm.x;\r\n\t\tvar y = vm.y;\r\n\t\tvar globalDefaults = core_defaults.global;\r\n\t\tvar defaultColor = globalDefaults.defaultColor; // eslint-disable-line no-shadow\r\n\r\n\t\tif (vm.skip) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Clipping for Points.\r\n\t\tif (chartArea === undefined || helpers$1.canvas._isPointInArea(vm, chartArea)) {\r\n\t\t\tctx.strokeStyle = vm.borderColor || defaultColor;\r\n\t\t\tctx.lineWidth = valueOrDefault$2(vm.borderWidth, globalDefaults.elements.point.borderWidth);\r\n\t\t\tctx.fillStyle = vm.backgroundColor || defaultColor;\r\n\t\t\thelpers$1.canvas.drawPoint(ctx, pointStyle, radius, x, y, rotation);\r\n\t\t}\r\n\t}\r\n});\n\nvar defaultColor$2 = core_defaults.global.defaultColor;\r\n\r\ncore_defaults._set('global', {\r\n\telements: {\r\n\t\trectangle: {\r\n\t\t\tbackgroundColor: defaultColor$2,\r\n\t\t\tborderColor: defaultColor$2,\r\n\t\t\tborderSkipped: 'bottom',\r\n\t\t\tborderWidth: 0\r\n\t\t}\r\n\t}\r\n});\r\n\r\nfunction isVertical(vm) {\r\n\treturn vm && vm.width !== undefined;\r\n}\r\n\r\n/**\r\n * Helper function to get the bounds of the bar regardless of the orientation\r\n * @param bar {Chart.Element.Rectangle} the bar\r\n * @return {Bounds} bounds of the bar\r\n * @private\r\n */\r\nfunction getBarBounds(vm) {\r\n\tvar x1, x2, y1, y2, half;\r\n\r\n\tif (isVertical(vm)) {\r\n\t\thalf = vm.width / 2;\r\n\t\tx1 = vm.x - half;\r\n\t\tx2 = vm.x + half;\r\n\t\ty1 = Math.min(vm.y, vm.base);\r\n\t\ty2 = Math.max(vm.y, vm.base);\r\n\t} else {\r\n\t\thalf = vm.height / 2;\r\n\t\tx1 = Math.min(vm.x, vm.base);\r\n\t\tx2 = Math.max(vm.x, vm.base);\r\n\t\ty1 = vm.y - half;\r\n\t\ty2 = vm.y + half;\r\n\t}\r\n\r\n\treturn {\r\n\t\tleft: x1,\r\n\t\ttop: y1,\r\n\t\tright: x2,\r\n\t\tbottom: y2\r\n\t};\r\n}\r\n\r\nfunction swap(orig, v1, v2) {\r\n\treturn orig === v1 ? v2 : orig === v2 ? v1 : orig;\r\n}\r\n\r\nfunction parseBorderSkipped(vm) {\r\n\tvar edge = vm.borderSkipped;\r\n\tvar res = {};\r\n\r\n\tif (!edge) {\r\n\t\treturn res;\r\n\t}\r\n\r\n\tif (vm.horizontal) {\r\n\t\tif (vm.base > vm.x) {\r\n\t\t\tedge = swap(edge, 'left', 'right');\r\n\t\t}\r\n\t} else if (vm.base < vm.y) {\r\n\t\tedge = swap(edge, 'bottom', 'top');\r\n\t}\r\n\r\n\tres[edge] = true;\r\n\treturn res;\r\n}\r\n\r\nfunction parseBorderWidth(vm, maxW, maxH) {\r\n\tvar value = vm.borderWidth;\r\n\tvar skip = parseBorderSkipped(vm);\r\n\tvar t, r, b, l;\r\n\r\n\tif (helpers$1.isObject(value)) {\r\n\t\tt = +value.top || 0;\r\n\t\tr = +value.right || 0;\r\n\t\tb = +value.bottom || 0;\r\n\t\tl = +value.left || 0;\r\n\t} else {\r\n\t\tt = r = b = l = +value || 0;\r\n\t}\r\n\r\n\treturn {\r\n\t\tt: skip.top || (t < 0) ? 0 : t > maxH ? maxH : t,\r\n\t\tr: skip.right || (r < 0) ? 0 : r > maxW ? maxW : r,\r\n\t\tb: skip.bottom || (b < 0) ? 0 : b > maxH ? maxH : b,\r\n\t\tl: skip.left || (l < 0) ? 0 : l > maxW ? maxW : l\r\n\t};\r\n}\r\n\r\nfunction boundingRects(vm) {\r\n\tvar bounds = getBarBounds(vm);\r\n\tvar width = bounds.right - bounds.left;\r\n\tvar height = bounds.bottom - bounds.top;\r\n\tvar border = parseBorderWidth(vm, width / 2, height / 2);\r\n\r\n\treturn {\r\n\t\touter: {\r\n\t\t\tx: bounds.left,\r\n\t\t\ty: bounds.top,\r\n\t\t\tw: width,\r\n\t\t\th: height\r\n\t\t},\r\n\t\tinner: {\r\n\t\t\tx: bounds.left + border.l,\r\n\t\t\ty: bounds.top + border.t,\r\n\t\t\tw: width - border.l - border.r,\r\n\t\t\th: height - border.t - border.b\r\n\t\t}\r\n\t};\r\n}\r\n\r\nfunction inRange(vm, x, y) {\r\n\tvar skipX = x === null;\r\n\tvar skipY = y === null;\r\n\tvar bounds = !vm || (skipX && skipY) ? false : getBarBounds(vm);\r\n\r\n\treturn bounds\r\n\t\t&& (skipX || x >= bounds.left && x <= bounds.right)\r\n\t\t&& (skipY || y >= bounds.top && y <= bounds.bottom);\r\n}\r\n\r\nvar element_rectangle = core_element.extend({\r\n\t_type: 'rectangle',\r\n\r\n\tdraw: function() {\r\n\t\tvar ctx = this._chart.ctx;\r\n\t\tvar vm = this._view;\r\n\t\tvar rects = boundingRects(vm);\r\n\t\tvar outer = rects.outer;\r\n\t\tvar inner = rects.inner;\r\n\r\n\t\tctx.fillStyle = vm.backgroundColor;\r\n\t\tctx.fillRect(outer.x, outer.y, outer.w, outer.h);\r\n\r\n\t\tif (outer.w === inner.w && outer.h === inner.h) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tctx.save();\r\n\t\tctx.beginPath();\r\n\t\tctx.rect(outer.x, outer.y, outer.w, outer.h);\r\n\t\tctx.clip();\r\n\t\tctx.fillStyle = vm.borderColor;\r\n\t\tctx.rect(inner.x, inner.y, inner.w, inner.h);\r\n\t\tctx.fill('evenodd');\r\n\t\tctx.restore();\r\n\t},\r\n\r\n\theight: function() {\r\n\t\tvar vm = this._view;\r\n\t\treturn vm.base - vm.y;\r\n\t},\r\n\r\n\tinRange: function(mouseX, mouseY) {\r\n\t\treturn inRange(this._view, mouseX, mouseY);\r\n\t},\r\n\r\n\tinLabelRange: function(mouseX, mouseY) {\r\n\t\tvar vm = this._view;\r\n\t\treturn isVertical(vm)\r\n\t\t\t? inRange(vm, mouseX, null)\r\n\t\t\t: inRange(vm, null, mouseY);\r\n\t},\r\n\r\n\tinXRange: function(mouseX) {\r\n\t\treturn inRange(this._view, mouseX, null);\r\n\t},\r\n\r\n\tinYRange: function(mouseY) {\r\n\t\treturn inRange(this._view, null, mouseY);\r\n\t},\r\n\r\n\tgetCenterPoint: function() {\r\n\t\tvar vm = this._view;\r\n\t\tvar x, y;\r\n\t\tif (isVertical(vm)) {\r\n\t\t\tx = vm.x;\r\n\t\t\ty = (vm.y + vm.base) / 2;\r\n\t\t} else {\r\n\t\t\tx = (vm.x + vm.base) / 2;\r\n\t\t\ty = vm.y;\r\n\t\t}\r\n\r\n\t\treturn {x: x, y: y};\r\n\t},\r\n\r\n\tgetArea: function() {\r\n\t\tvar vm = this._view;\r\n\r\n\t\treturn isVertical(vm)\r\n\t\t\t? vm.width * Math.abs(vm.y - vm.base)\r\n\t\t\t: vm.height * Math.abs(vm.x - vm.base);\r\n\t},\r\n\r\n\ttooltipPosition: function() {\r\n\t\tvar vm = this._view;\r\n\t\treturn {\r\n\t\t\tx: vm.x,\r\n\t\t\ty: vm.y\r\n\t\t};\r\n\t}\r\n});\n\nvar elements = {};\r\nvar Arc = element_arc;\r\nvar Line = element_line;\r\nvar Point = element_point;\r\nvar Rectangle = element_rectangle;\nelements.Arc = Arc;\nelements.Line = Line;\nelements.Point = Point;\nelements.Rectangle = Rectangle;\n\nvar deprecated = helpers$1._deprecated;\r\nvar valueOrDefault$3 = helpers$1.valueOrDefault;\r\n\r\ncore_defaults._set('bar', {\r\n\thover: {\r\n\t\tmode: 'label'\r\n\t},\r\n\r\n\tscales: {\r\n\t\txAxes: [{\r\n\t\t\ttype: 'category',\r\n\t\t\toffset: true,\r\n\t\t\tgridLines: {\r\n\t\t\t\toffsetGridLines: true\r\n\t\t\t}\r\n\t\t}],\r\n\r\n\t\tyAxes: [{\r\n\t\t\ttype: 'linear'\r\n\t\t}]\r\n\t}\r\n});\r\n\r\ncore_defaults._set('global', {\r\n\tdatasets: {\r\n\t\tbar: {\r\n\t\t\tcategoryPercentage: 0.8,\r\n\t\t\tbarPercentage: 0.9\r\n\t\t}\r\n\t}\r\n});\r\n\r\n/**\r\n * Computes the \"optimal\" sample size to maintain bars equally sized while preventing overlap.\r\n * @private\r\n */\r\nfunction computeMinSampleSize(scale, pixels) {\r\n\tvar min = scale._length;\r\n\tvar prev, curr, i, ilen;\r\n\r\n\tfor (i = 1, ilen = pixels.length; i < ilen; ++i) {\r\n\t\tmin = Math.min(min, Math.abs(pixels[i] - pixels[i - 1]));\r\n\t}\r\n\r\n\tfor (i = 0, ilen = scale.getTicks().length; i < ilen; ++i) {\r\n\t\tcurr = scale.getPixelForTick(i);\r\n\t\tmin = i > 0 ? Math.min(min, Math.abs(curr - prev)) : min;\r\n\t\tprev = curr;\r\n\t}\r\n\r\n\treturn min;\r\n}\r\n\r\n/**\r\n * Computes an \"ideal\" category based on the absolute bar thickness or, if undefined or null,\r\n * uses the smallest interval (see computeMinSampleSize) that prevents bar overlapping. This\r\n * mode currently always generates bars equally sized (until we introduce scriptable options?).\r\n * @private\r\n */\r\nfunction computeFitCategoryTraits(index, ruler, options) {\r\n\tvar thickness = options.barThickness;\r\n\tvar count = ruler.stackCount;\r\n\tvar curr = ruler.pixels[index];\r\n\tvar min = helpers$1.isNullOrUndef(thickness)\r\n\t\t? computeMinSampleSize(ruler.scale, ruler.pixels)\r\n\t\t: -1;\r\n\tvar size, ratio;\r\n\r\n\tif (helpers$1.isNullOrUndef(thickness)) {\r\n\t\tsize = min * options.categoryPercentage;\r\n\t\tratio = options.barPercentage;\r\n\t} else {\r\n\t\t// When bar thickness is enforced, category and bar percentages are ignored.\r\n\t\t// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\r\n\t\t// and deprecate barPercentage since this value is ignored when thickness is absolute.\r\n\t\tsize = thickness * count;\r\n\t\tratio = 1;\r\n\t}\r\n\r\n\treturn {\r\n\t\tchunk: size / count,\r\n\t\tratio: ratio,\r\n\t\tstart: curr - (size / 2)\r\n\t};\r\n}\r\n\r\n/**\r\n * Computes an \"optimal\" category that globally arranges bars side by side (no gap when\r\n * percentage options are 1), based on the previous and following categories. This mode\r\n * generates bars with different widths when data are not evenly spaced.\r\n * @private\r\n */\r\nfunction computeFlexCategoryTraits(index, ruler, options) {\r\n\tvar pixels = ruler.pixels;\r\n\tvar curr = pixels[index];\r\n\tvar prev = index > 0 ? pixels[index - 1] : null;\r\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\r\n\tvar percent = options.categoryPercentage;\r\n\tvar start, size;\r\n\r\n\tif (prev === null) {\r\n\t\t// first data: its size is double based on the next point or,\r\n\t\t// if it's also the last data, we use the scale size.\r\n\t\tprev = curr - (next === null ? ruler.end - ruler.start : next - curr);\r\n\t}\r\n\r\n\tif (next === null) {\r\n\t\t// last data: its size is also double based on the previous point.\r\n\t\tnext = curr + curr - prev;\r\n\t}\r\n\r\n\tstart = curr - (curr - Math.min(prev, next)) / 2 * percent;\r\n\tsize = Math.abs(next - prev) / 2 * percent;\r\n\r\n\treturn {\r\n\t\tchunk: size / ruler.stackCount,\r\n\t\tratio: options.barPercentage,\r\n\t\tstart: start\r\n\t};\r\n}\r\n\r\nvar controller_bar = core_datasetController.extend({\r\n\r\n\tdataElementType: elements.Rectangle,\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_dataElementOptions: [\r\n\t\t'backgroundColor',\r\n\t\t'borderColor',\r\n\t\t'borderSkipped',\r\n\t\t'borderWidth',\r\n\t\t'barPercentage',\r\n\t\t'barThickness',\r\n\t\t'categoryPercentage',\r\n\t\t'maxBarThickness',\r\n\t\t'minBarLength'\r\n\t],\r\n\r\n\tinitialize: function() {\r\n\t\tvar me = this;\r\n\t\tvar meta, scaleOpts;\r\n\r\n\t\tcore_datasetController.prototype.initialize.apply(me, arguments);\r\n\r\n\t\tmeta = me.getMeta();\r\n\t\tmeta.stack = me.getDataset().stack;\r\n\t\tmeta.bar = true;\r\n\r\n\t\tscaleOpts = me._getIndexScale().options;\r\n\t\tdeprecated('bar chart', scaleOpts.barPercentage, 'scales.[x/y]Axes.barPercentage', 'dataset.barPercentage');\r\n\t\tdeprecated('bar chart', scaleOpts.barThickness, 'scales.[x/y]Axes.barThickness', 'dataset.barThickness');\r\n\t\tdeprecated('bar chart', scaleOpts.categoryPercentage, 'scales.[x/y]Axes.categoryPercentage', 'dataset.categoryPercentage');\r\n\t\tdeprecated('bar chart', me._getValueScale().options.minBarLength, 'scales.[x/y]Axes.minBarLength', 'dataset.minBarLength');\r\n\t\tdeprecated('bar chart', scaleOpts.maxBarThickness, 'scales.[x/y]Axes.maxBarThickness', 'dataset.maxBarThickness');\r\n\t},\r\n\r\n\tupdate: function(reset) {\r\n\t\tvar me = this;\r\n\t\tvar rects = me.getMeta().data;\r\n\t\tvar i, ilen;\r\n\r\n\t\tme._ruler = me.getRuler();\r\n\r\n\t\tfor (i = 0, ilen = rects.length; i < ilen; ++i) {\r\n\t\t\tme.updateElement(rects[i], i, reset);\r\n\t\t}\r\n\t},\r\n\r\n\tupdateElement: function(rectangle, index, reset) {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar options = me._resolveDataElementOptions(rectangle, index);\r\n\r\n\t\trectangle._xScale = me.getScaleForId(meta.xAxisID);\r\n\t\trectangle._yScale = me.getScaleForId(meta.yAxisID);\r\n\t\trectangle._datasetIndex = me.index;\r\n\t\trectangle._index = index;\r\n\t\trectangle._model = {\r\n\t\t\tbackgroundColor: options.backgroundColor,\r\n\t\t\tborderColor: options.borderColor,\r\n\t\t\tborderSkipped: options.borderSkipped,\r\n\t\t\tborderWidth: options.borderWidth,\r\n\t\t\tdatasetLabel: dataset.label,\r\n\t\t\tlabel: me.chart.data.labels[index]\r\n\t\t};\r\n\r\n\t\tif (helpers$1.isArray(dataset.data[index])) {\r\n\t\t\trectangle._model.borderSkipped = null;\r\n\t\t}\r\n\r\n\t\tme._updateElementGeometry(rectangle, index, reset, options);\r\n\r\n\t\trectangle.pivot();\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_updateElementGeometry: function(rectangle, index, reset, options) {\r\n\t\tvar me = this;\r\n\t\tvar model = rectangle._model;\r\n\t\tvar vscale = me._getValueScale();\r\n\t\tvar base = vscale.getBasePixel();\r\n\t\tvar horizontal = vscale.isHorizontal();\r\n\t\tvar ruler = me._ruler || me.getRuler();\r\n\t\tvar vpixels = me.calculateBarValuePixels(me.index, index, options);\r\n\t\tvar ipixels = me.calculateBarIndexPixels(me.index, index, ruler, options);\r\n\r\n\t\tmodel.horizontal = horizontal;\r\n\t\tmodel.base = reset ? base : vpixels.base;\r\n\t\tmodel.x = horizontal ? reset ? base : vpixels.head : ipixels.center;\r\n\t\tmodel.y = horizontal ? ipixels.center : reset ? base : vpixels.head;\r\n\t\tmodel.height = horizontal ? ipixels.size : undefined;\r\n\t\tmodel.width = horizontal ? undefined : ipixels.size;\r\n\t},\r\n\r\n\t/**\r\n\t * Returns the stacks based on groups and bar visibility.\r\n\t * @param {number} [last] - The dataset index\r\n\t * @returns {string[]} The list of stack IDs\r\n\t * @private\r\n\t */\r\n\t_getStacks: function(last) {\r\n\t\tvar me = this;\r\n\t\tvar scale = me._getIndexScale();\r\n\t\tvar metasets = scale._getMatchingVisibleMetas(me._type);\r\n\t\tvar stacked = scale.options.stacked;\r\n\t\tvar ilen = metasets.length;\r\n\t\tvar stacks = [];\r\n\t\tvar i, meta;\r\n\r\n\t\tfor (i = 0; i < ilen; ++i) {\r\n\t\t\tmeta = metasets[i];\r\n\t\t\t// stacked | meta.stack\r\n\t\t\t// | found | not found | undefined\r\n\t\t\t// false | x | x | x\r\n\t\t\t// true | | x |\r\n\t\t\t// undefined | | x | x\r\n\t\t\tif (stacked === false || stacks.indexOf(meta.stack) === -1 ||\r\n\t\t\t\t(stacked === undefined && meta.stack === undefined)) {\r\n\t\t\t\tstacks.push(meta.stack);\r\n\t\t\t}\r\n\t\t\tif (meta.index === last) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn stacks;\r\n\t},\r\n\r\n\t/**\r\n\t * Returns the effective number of stacks based on groups and bar visibility.\r\n\t * @private\r\n\t */\r\n\tgetStackCount: function() {\r\n\t\treturn this._getStacks().length;\r\n\t},\r\n\r\n\t/**\r\n\t * Returns the stack index for the given dataset based on groups and bar visibility.\r\n\t * @param {number} [datasetIndex] - The dataset index\r\n\t * @param {string} [name] - The stack name to find\r\n\t * @returns {number} The stack index\r\n\t * @private\r\n\t */\r\n\tgetStackIndex: function(datasetIndex, name) {\r\n\t\tvar stacks = this._getStacks(datasetIndex);\r\n\t\tvar index = (name !== undefined)\r\n\t\t\t? stacks.indexOf(name)\r\n\t\t\t: -1; // indexOf returns -1 if element is not present\r\n\r\n\t\treturn (index === -1)\r\n\t\t\t? stacks.length - 1\r\n\t\t\t: index;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tgetRuler: function() {\r\n\t\tvar me = this;\r\n\t\tvar scale = me._getIndexScale();\r\n\t\tvar pixels = [];\r\n\t\tvar i, ilen;\r\n\r\n\t\tfor (i = 0, ilen = me.getMeta().data.length; i < ilen; ++i) {\r\n\t\t\tpixels.push(scale.getPixelForValue(null, i, me.index));\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tpixels: pixels,\r\n\t\t\tstart: scale._startPixel,\r\n\t\t\tend: scale._endPixel,\r\n\t\t\tstackCount: me.getStackCount(),\r\n\t\t\tscale: scale\r\n\t\t};\r\n\t},\r\n\r\n\t/**\r\n\t * Note: pixel values are not clamped to the scale area.\r\n\t * @private\r\n\t */\r\n\tcalculateBarValuePixels: function(datasetIndex, index, options) {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar scale = me._getValueScale();\r\n\t\tvar isHorizontal = scale.isHorizontal();\r\n\t\tvar datasets = chart.data.datasets;\r\n\t\tvar metasets = scale._getMatchingVisibleMetas(me._type);\r\n\t\tvar value = scale._parseValue(datasets[datasetIndex].data[index]);\r\n\t\tvar minBarLength = options.minBarLength;\r\n\t\tvar stacked = scale.options.stacked;\r\n\t\tvar stack = me.getMeta().stack;\r\n\t\tvar start = value.start === undefined ? 0 : value.max >= 0 && value.min >= 0 ? value.min : value.max;\r\n\t\tvar length = value.start === undefined ? value.end : value.max >= 0 && value.min >= 0 ? value.max - value.min : value.min - value.max;\r\n\t\tvar ilen = metasets.length;\r\n\t\tvar i, imeta, ivalue, base, head, size, stackLength;\r\n\r\n\t\tif (stacked || (stacked === undefined && stack !== undefined)) {\r\n\t\t\tfor (i = 0; i < ilen; ++i) {\r\n\t\t\t\timeta = metasets[i];\r\n\r\n\t\t\t\tif (imeta.index === datasetIndex) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (imeta.stack === stack) {\r\n\t\t\t\t\tstackLength = scale._parseValue(datasets[imeta.index].data[index]);\r\n\t\t\t\t\tivalue = stackLength.start === undefined ? stackLength.end : stackLength.min >= 0 && stackLength.max >= 0 ? stackLength.max : stackLength.min;\r\n\r\n\t\t\t\t\tif ((value.min < 0 && ivalue < 0) || (value.max >= 0 && ivalue > 0)) {\r\n\t\t\t\t\t\tstart += ivalue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tbase = scale.getPixelForValue(start);\r\n\t\thead = scale.getPixelForValue(start + length);\r\n\t\tsize = head - base;\r\n\r\n\t\tif (minBarLength !== undefined && Math.abs(size) < minBarLength) {\r\n\t\t\tsize = minBarLength;\r\n\t\t\tif (length >= 0 && !isHorizontal || length < 0 && isHorizontal) {\r\n\t\t\t\thead = base - minBarLength;\r\n\t\t\t} else {\r\n\t\t\t\thead = base + minBarLength;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tsize: size,\r\n\t\t\tbase: base,\r\n\t\t\thead: head,\r\n\t\t\tcenter: head + size / 2\r\n\t\t};\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\tcalculateBarIndexPixels: function(datasetIndex, index, ruler, options) {\r\n\t\tvar me = this;\r\n\t\tvar range = options.barThickness === 'flex'\r\n\t\t\t? computeFlexCategoryTraits(index, ruler, options)\r\n\t\t\t: computeFitCategoryTraits(index, ruler, options);\r\n\r\n\t\tvar stackIndex = me.getStackIndex(datasetIndex, me.getMeta().stack);\r\n\t\tvar center = range.start + (range.chunk * stackIndex) + (range.chunk / 2);\r\n\t\tvar size = Math.min(\r\n\t\t\tvalueOrDefault$3(options.maxBarThickness, Infinity),\r\n\t\t\trange.chunk * range.ratio);\r\n\r\n\t\treturn {\r\n\t\t\tbase: center - size / 2,\r\n\t\t\thead: center + size / 2,\r\n\t\t\tcenter: center,\r\n\t\t\tsize: size\r\n\t\t};\r\n\t},\r\n\r\n\tdraw: function() {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar scale = me._getValueScale();\r\n\t\tvar rects = me.getMeta().data;\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar ilen = rects.length;\r\n\t\tvar i = 0;\r\n\r\n\t\thelpers$1.canvas.clipArea(chart.ctx, chart.chartArea);\r\n\r\n\t\tfor (; i < ilen; ++i) {\r\n\t\t\tvar val = scale._parseValue(dataset.data[i]);\r\n\t\t\tif (!isNaN(val.min) && !isNaN(val.max)) {\r\n\t\t\t\trects[i].draw();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\thelpers$1.canvas.unclipArea(chart.ctx);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_resolveDataElementOptions: function() {\r\n\t\tvar me = this;\r\n\t\tvar values = helpers$1.extend({}, core_datasetController.prototype._resolveDataElementOptions.apply(me, arguments));\r\n\t\tvar indexOpts = me._getIndexScale().options;\r\n\t\tvar valueOpts = me._getValueScale().options;\r\n\r\n\t\tvalues.barPercentage = valueOrDefault$3(indexOpts.barPercentage, values.barPercentage);\r\n\t\tvalues.barThickness = valueOrDefault$3(indexOpts.barThickness, values.barThickness);\r\n\t\tvalues.categoryPercentage = valueOrDefault$3(indexOpts.categoryPercentage, values.categoryPercentage);\r\n\t\tvalues.maxBarThickness = valueOrDefault$3(indexOpts.maxBarThickness, values.maxBarThickness);\r\n\t\tvalues.minBarLength = valueOrDefault$3(valueOpts.minBarLength, values.minBarLength);\r\n\r\n\t\treturn values;\r\n\t}\r\n\r\n});\n\nvar valueOrDefault$4 = helpers$1.valueOrDefault;\r\nvar resolve$1 = helpers$1.options.resolve;\r\n\r\ncore_defaults._set('bubble', {\r\n\thover: {\r\n\t\tmode: 'single'\r\n\t},\r\n\r\n\tscales: {\r\n\t\txAxes: [{\r\n\t\t\ttype: 'linear', // bubble should probably use a linear scale by default\r\n\t\t\tposition: 'bottom',\r\n\t\t\tid: 'x-axis-0' // need an ID so datasets can reference the scale\r\n\t\t}],\r\n\t\tyAxes: [{\r\n\t\t\ttype: 'linear',\r\n\t\t\tposition: 'left',\r\n\t\t\tid: 'y-axis-0'\r\n\t\t}]\r\n\t},\r\n\r\n\ttooltips: {\r\n\t\tcallbacks: {\r\n\t\t\ttitle: function() {\r\n\t\t\t\t// Title doesn't make sense for scatter since we format the data as a point\r\n\t\t\t\treturn '';\r\n\t\t\t},\r\n\t\t\tlabel: function(item, data) {\r\n\t\t\t\tvar datasetLabel = data.datasets[item.datasetIndex].label || '';\r\n\t\t\t\tvar dataPoint = data.datasets[item.datasetIndex].data[item.index];\r\n\t\t\t\treturn datasetLabel + ': (' + item.xLabel + ', ' + item.yLabel + ', ' + dataPoint.r + ')';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n});\r\n\r\nvar controller_bubble = core_datasetController.extend({\r\n\t/**\r\n\t * @protected\r\n\t */\r\n\tdataElementType: elements.Point,\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_dataElementOptions: [\r\n\t\t'backgroundColor',\r\n\t\t'borderColor',\r\n\t\t'borderWidth',\r\n\t\t'hoverBackgroundColor',\r\n\t\t'hoverBorderColor',\r\n\t\t'hoverBorderWidth',\r\n\t\t'hoverRadius',\r\n\t\t'hitRadius',\r\n\t\t'pointStyle',\r\n\t\t'rotation'\r\n\t],\r\n\r\n\t/**\r\n\t * @protected\r\n\t */\r\n\tupdate: function(reset) {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar points = meta.data;\r\n\r\n\t\t// Update Points\r\n\t\thelpers$1.each(points, function(point, index) {\r\n\t\t\tme.updateElement(point, index, reset);\r\n\t\t});\r\n\t},\r\n\r\n\t/**\r\n\t * @protected\r\n\t */\r\n\tupdateElement: function(point, index, reset) {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar custom = point.custom || {};\r\n\t\tvar xScale = me.getScaleForId(meta.xAxisID);\r\n\t\tvar yScale = me.getScaleForId(meta.yAxisID);\r\n\t\tvar options = me._resolveDataElementOptions(point, index);\r\n\t\tvar data = me.getDataset().data[index];\r\n\t\tvar dsIndex = me.index;\r\n\r\n\t\tvar x = reset ? xScale.getPixelForDecimal(0.5) : xScale.getPixelForValue(typeof data === 'object' ? data : NaN, index, dsIndex);\r\n\t\tvar y = reset ? yScale.getBasePixel() : yScale.getPixelForValue(data, index, dsIndex);\r\n\r\n\t\tpoint._xScale = xScale;\r\n\t\tpoint._yScale = yScale;\r\n\t\tpoint._options = options;\r\n\t\tpoint._datasetIndex = dsIndex;\r\n\t\tpoint._index = index;\r\n\t\tpoint._model = {\r\n\t\t\tbackgroundColor: options.backgroundColor,\r\n\t\t\tborderColor: options.borderColor,\r\n\t\t\tborderWidth: options.borderWidth,\r\n\t\t\thitRadius: options.hitRadius,\r\n\t\t\tpointStyle: options.pointStyle,\r\n\t\t\trotation: options.rotation,\r\n\t\t\tradius: reset ? 0 : options.radius,\r\n\t\t\tskip: custom.skip || isNaN(x) || isNaN(y),\r\n\t\t\tx: x,\r\n\t\t\ty: y,\r\n\t\t};\r\n\r\n\t\tpoint.pivot();\r\n\t},\r\n\r\n\t/**\r\n\t * @protected\r\n\t */\r\n\tsetHoverStyle: function(point) {\r\n\t\tvar model = point._model;\r\n\t\tvar options = point._options;\r\n\t\tvar getHoverColor = helpers$1.getHoverColor;\r\n\r\n\t\tpoint.$previousStyle = {\r\n\t\t\tbackgroundColor: model.backgroundColor,\r\n\t\t\tborderColor: model.borderColor,\r\n\t\t\tborderWidth: model.borderWidth,\r\n\t\t\tradius: model.radius\r\n\t\t};\r\n\r\n\t\tmodel.backgroundColor = valueOrDefault$4(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));\r\n\t\tmodel.borderColor = valueOrDefault$4(options.hoverBorderColor, getHoverColor(options.borderColor));\r\n\t\tmodel.borderWidth = valueOrDefault$4(options.hoverBorderWidth, options.borderWidth);\r\n\t\tmodel.radius = options.radius + options.hoverRadius;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_resolveDataElementOptions: function(point, index) {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar custom = point.custom || {};\r\n\t\tvar data = dataset.data[index] || {};\r\n\t\tvar values = core_datasetController.prototype._resolveDataElementOptions.apply(me, arguments);\r\n\r\n\t\t// Scriptable options\r\n\t\tvar context = {\r\n\t\t\tchart: chart,\r\n\t\t\tdataIndex: index,\r\n\t\t\tdataset: dataset,\r\n\t\t\tdatasetIndex: me.index\r\n\t\t};\r\n\r\n\t\t// In case values were cached (and thus frozen), we need to clone the values\r\n\t\tif (me._cachedDataOpts === values) {\r\n\t\t\tvalues = helpers$1.extend({}, values);\r\n\t\t}\r\n\r\n\t\t// Custom radius resolution\r\n\t\tvalues.radius = resolve$1([\r\n\t\t\tcustom.radius,\r\n\t\t\tdata.r,\r\n\t\t\tme._config.radius,\r\n\t\t\tchart.options.elements.point.radius\r\n\t\t], context, index);\r\n\r\n\t\treturn values;\r\n\t}\r\n});\n\nvar valueOrDefault$5 = helpers$1.valueOrDefault;\r\n\r\nvar PI$1 = Math.PI;\r\nvar DOUBLE_PI$1 = PI$1 * 2;\r\nvar HALF_PI$1 = PI$1 / 2;\r\n\r\ncore_defaults._set('doughnut', {\r\n\tanimation: {\r\n\t\t// Boolean - Whether we animate the rotation of the Doughnut\r\n\t\tanimateRotate: true,\r\n\t\t// Boolean - Whether we animate scaling the Doughnut from the centre\r\n\t\tanimateScale: false\r\n\t},\r\n\thover: {\r\n\t\tmode: 'single'\r\n\t},\r\n\tlegendCallback: function(chart) {\r\n\t\tvar list = document.createElement('ul');\r\n\t\tvar data = chart.data;\r\n\t\tvar datasets = data.datasets;\r\n\t\tvar labels = data.labels;\r\n\t\tvar i, ilen, listItem, listItemSpan;\r\n\r\n\t\tlist.setAttribute('class', chart.id + '-legend');\r\n\t\tif (datasets.length) {\r\n\t\t\tfor (i = 0, ilen = datasets[0].data.length; i < ilen; ++i) {\r\n\t\t\t\tlistItem = list.appendChild(document.createElement('li'));\r\n\t\t\t\tlistItemSpan = listItem.appendChild(document.createElement('span'));\r\n\t\t\t\tlistItemSpan.style.backgroundColor = datasets[0].backgroundColor[i];\r\n\t\t\t\tif (labels[i]) {\r\n\t\t\t\t\tlistItem.appendChild(document.createTextNode(labels[i]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn list.outerHTML;\r\n\t},\r\n\tlegend: {\r\n\t\tlabels: {\r\n\t\t\tgenerateLabels: function(chart) {\r\n\t\t\t\tvar data = chart.data;\r\n\t\t\t\tif (data.labels.length && data.datasets.length) {\r\n\t\t\t\t\treturn data.labels.map(function(label, i) {\r\n\t\t\t\t\t\tvar meta = chart.getDatasetMeta(0);\r\n\t\t\t\t\t\tvar style = meta.controller.getStyle(i);\r\n\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\ttext: label,\r\n\t\t\t\t\t\t\tfillStyle: style.backgroundColor,\r\n\t\t\t\t\t\t\tstrokeStyle: style.borderColor,\r\n\t\t\t\t\t\t\tlineWidth: style.borderWidth,\r\n\t\t\t\t\t\t\thidden: isNaN(data.datasets[0].data[i]) || meta.data[i].hidden,\r\n\r\n\t\t\t\t\t\t\t// Extra data used for toggling the correct item\r\n\t\t\t\t\t\t\tindex: i\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\treturn [];\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tonClick: function(e, legendItem) {\r\n\t\t\tvar index = legendItem.index;\r\n\t\t\tvar chart = this.chart;\r\n\t\t\tvar i, ilen, meta;\r\n\r\n\t\t\tfor (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {\r\n\t\t\t\tmeta = chart.getDatasetMeta(i);\r\n\t\t\t\t// toggle visibility of index if exists\r\n\t\t\t\tif (meta.data[index]) {\r\n\t\t\t\t\tmeta.data[index].hidden = !meta.data[index].hidden;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tchart.update();\r\n\t\t}\r\n\t},\r\n\r\n\t// The percentage of the chart that we cut out of the middle.\r\n\tcutoutPercentage: 50,\r\n\r\n\t// The rotation of the chart, where the first data arc begins.\r\n\trotation: -HALF_PI$1,\r\n\r\n\t// The total circumference of the chart.\r\n\tcircumference: DOUBLE_PI$1,\r\n\r\n\t// Need to override these to give a nice default\r\n\ttooltips: {\r\n\t\tcallbacks: {\r\n\t\t\ttitle: function() {\r\n\t\t\t\treturn '';\r\n\t\t\t},\r\n\t\t\tlabel: function(tooltipItem, data) {\r\n\t\t\t\tvar dataLabel = data.labels[tooltipItem.index];\r\n\t\t\t\tvar value = ': ' + data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];\r\n\r\n\t\t\t\tif (helpers$1.isArray(dataLabel)) {\r\n\t\t\t\t\t// show value on first line of multiline label\r\n\t\t\t\t\t// need to clone because we are changing the value\r\n\t\t\t\t\tdataLabel = dataLabel.slice();\r\n\t\t\t\t\tdataLabel[0] += value;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdataLabel += value;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn dataLabel;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n});\r\n\r\nvar controller_doughnut = core_datasetController.extend({\r\n\r\n\tdataElementType: elements.Arc,\r\n\r\n\tlinkScales: helpers$1.noop,\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_dataElementOptions: [\r\n\t\t'backgroundColor',\r\n\t\t'borderColor',\r\n\t\t'borderWidth',\r\n\t\t'borderAlign',\r\n\t\t'hoverBackgroundColor',\r\n\t\t'hoverBorderColor',\r\n\t\t'hoverBorderWidth',\r\n\t],\r\n\r\n\t// Get index of the dataset in relation to the visible datasets. This allows determining the inner and outer radius correctly\r\n\tgetRingIndex: function(datasetIndex) {\r\n\t\tvar ringIndex = 0;\r\n\r\n\t\tfor (var j = 0; j < datasetIndex; ++j) {\r\n\t\t\tif (this.chart.isDatasetVisible(j)) {\r\n\t\t\t\t++ringIndex;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn ringIndex;\r\n\t},\r\n\r\n\tupdate: function(reset) {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar chartArea = chart.chartArea;\r\n\t\tvar opts = chart.options;\r\n\t\tvar ratioX = 1;\r\n\t\tvar ratioY = 1;\r\n\t\tvar offsetX = 0;\r\n\t\tvar offsetY = 0;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar arcs = meta.data;\r\n\t\tvar cutout = opts.cutoutPercentage / 100 || 0;\r\n\t\tvar circumference = opts.circumference;\r\n\t\tvar chartWeight = me._getRingWeight(me.index);\r\n\t\tvar maxWidth, maxHeight, i, ilen;\r\n\r\n\t\t// If the chart's circumference isn't a full circle, calculate size as a ratio of the width/height of the arc\r\n\t\tif (circumference < DOUBLE_PI$1) {\r\n\t\t\tvar startAngle = opts.rotation % DOUBLE_PI$1;\r\n\t\t\tstartAngle += startAngle >= PI$1 ? -DOUBLE_PI$1 : startAngle < -PI$1 ? DOUBLE_PI$1 : 0;\r\n\t\t\tvar endAngle = startAngle + circumference;\r\n\t\t\tvar startX = Math.cos(startAngle);\r\n\t\t\tvar startY = Math.sin(startAngle);\r\n\t\t\tvar endX = Math.cos(endAngle);\r\n\t\t\tvar endY = Math.sin(endAngle);\r\n\t\t\tvar contains0 = (startAngle <= 0 && endAngle >= 0) || endAngle >= DOUBLE_PI$1;\r\n\t\t\tvar contains90 = (startAngle <= HALF_PI$1 && endAngle >= HALF_PI$1) || endAngle >= DOUBLE_PI$1 + HALF_PI$1;\r\n\t\t\tvar contains180 = startAngle === -PI$1 || endAngle >= PI$1;\r\n\t\t\tvar contains270 = (startAngle <= -HALF_PI$1 && endAngle >= -HALF_PI$1) || endAngle >= PI$1 + HALF_PI$1;\r\n\t\t\tvar minX = contains180 ? -1 : Math.min(startX, startX * cutout, endX, endX * cutout);\r\n\t\t\tvar minY = contains270 ? -1 : Math.min(startY, startY * cutout, endY, endY * cutout);\r\n\t\t\tvar maxX = contains0 ? 1 : Math.max(startX, startX * cutout, endX, endX * cutout);\r\n\t\t\tvar maxY = contains90 ? 1 : Math.max(startY, startY * cutout, endY, endY * cutout);\r\n\t\t\tratioX = (maxX - minX) / 2;\r\n\t\t\tratioY = (maxY - minY) / 2;\r\n\t\t\toffsetX = -(maxX + minX) / 2;\r\n\t\t\toffsetY = -(maxY + minY) / 2;\r\n\t\t}\r\n\r\n\t\tfor (i = 0, ilen = arcs.length; i < ilen; ++i) {\r\n\t\t\tarcs[i]._options = me._resolveDataElementOptions(arcs[i], i);\r\n\t\t}\r\n\r\n\t\tchart.borderWidth = me.getMaxBorderWidth();\r\n\t\tmaxWidth = (chartArea.right - chartArea.left - chart.borderWidth) / ratioX;\r\n\t\tmaxHeight = (chartArea.bottom - chartArea.top - chart.borderWidth) / ratioY;\r\n\t\tchart.outerRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\r\n\t\tchart.innerRadius = Math.max(chart.outerRadius * cutout, 0);\r\n\t\tchart.radiusLength = (chart.outerRadius - chart.innerRadius) / (me._getVisibleDatasetWeightTotal() || 1);\r\n\t\tchart.offsetX = offsetX * chart.outerRadius;\r\n\t\tchart.offsetY = offsetY * chart.outerRadius;\r\n\r\n\t\tmeta.total = me.calculateTotal();\r\n\r\n\t\tme.outerRadius = chart.outerRadius - chart.radiusLength * me._getRingWeightOffset(me.index);\r\n\t\tme.innerRadius = Math.max(me.outerRadius - chart.radiusLength * chartWeight, 0);\r\n\r\n\t\tfor (i = 0, ilen = arcs.length; i < ilen; ++i) {\r\n\t\t\tme.updateElement(arcs[i], i, reset);\r\n\t\t}\r\n\t},\r\n\r\n\tupdateElement: function(arc, index, reset) {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar chartArea = chart.chartArea;\r\n\t\tvar opts = chart.options;\r\n\t\tvar animationOpts = opts.animation;\r\n\t\tvar centerX = (chartArea.left + chartArea.right) / 2;\r\n\t\tvar centerY = (chartArea.top + chartArea.bottom) / 2;\r\n\t\tvar startAngle = opts.rotation; // non reset case handled later\r\n\t\tvar endAngle = opts.rotation; // non reset case handled later\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar circumference = reset && animationOpts.animateRotate ? 0 : arc.hidden ? 0 : me.calculateCircumference(dataset.data[index]) * (opts.circumference / DOUBLE_PI$1);\r\n\t\tvar innerRadius = reset && animationOpts.animateScale ? 0 : me.innerRadius;\r\n\t\tvar outerRadius = reset && animationOpts.animateScale ? 0 : me.outerRadius;\r\n\t\tvar options = arc._options || {};\r\n\r\n\t\thelpers$1.extend(arc, {\r\n\t\t\t// Utility\r\n\t\t\t_datasetIndex: me.index,\r\n\t\t\t_index: index,\r\n\r\n\t\t\t// Desired view properties\r\n\t\t\t_model: {\r\n\t\t\t\tbackgroundColor: options.backgroundColor,\r\n\t\t\t\tborderColor: options.borderColor,\r\n\t\t\t\tborderWidth: options.borderWidth,\r\n\t\t\t\tborderAlign: options.borderAlign,\r\n\t\t\t\tx: centerX + chart.offsetX,\r\n\t\t\t\ty: centerY + chart.offsetY,\r\n\t\t\t\tstartAngle: startAngle,\r\n\t\t\t\tendAngle: endAngle,\r\n\t\t\t\tcircumference: circumference,\r\n\t\t\t\touterRadius: outerRadius,\r\n\t\t\t\tinnerRadius: innerRadius,\r\n\t\t\t\tlabel: helpers$1.valueAtIndexOrDefault(dataset.label, index, chart.data.labels[index])\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tvar model = arc._model;\r\n\r\n\t\t// Set correct angles if not resetting\r\n\t\tif (!reset || !animationOpts.animateRotate) {\r\n\t\t\tif (index === 0) {\r\n\t\t\t\tmodel.startAngle = opts.rotation;\r\n\t\t\t} else {\r\n\t\t\t\tmodel.startAngle = me.getMeta().data[index - 1]._model.endAngle;\r\n\t\t\t}\r\n\r\n\t\t\tmodel.endAngle = model.startAngle + model.circumference;\r\n\t\t}\r\n\r\n\t\tarc.pivot();\r\n\t},\r\n\r\n\tcalculateTotal: function() {\r\n\t\tvar dataset = this.getDataset();\r\n\t\tvar meta = this.getMeta();\r\n\t\tvar total = 0;\r\n\t\tvar value;\r\n\r\n\t\thelpers$1.each(meta.data, function(element, index) {\r\n\t\t\tvalue = dataset.data[index];\r\n\t\t\tif (!isNaN(value) && !element.hidden) {\r\n\t\t\t\ttotal += Math.abs(value);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t/* if (total === 0) {\r\n\t\t\ttotal = NaN;\r\n\t\t}*/\r\n\r\n\t\treturn total;\r\n\t},\r\n\r\n\tcalculateCircumference: function(value) {\r\n\t\tvar total = this.getMeta().total;\r\n\t\tif (total > 0 && !isNaN(value)) {\r\n\t\t\treturn DOUBLE_PI$1 * (Math.abs(value) / total);\r\n\t\t}\r\n\t\treturn 0;\r\n\t},\r\n\r\n\t// gets the max border or hover width to properly scale pie charts\r\n\tgetMaxBorderWidth: function(arcs) {\r\n\t\tvar me = this;\r\n\t\tvar max = 0;\r\n\t\tvar chart = me.chart;\r\n\t\tvar i, ilen, meta, arc, controller, options, borderWidth, hoverWidth;\r\n\r\n\t\tif (!arcs) {\r\n\t\t\t// Find the outmost visible dataset\r\n\t\t\tfor (i = 0, ilen = chart.data.datasets.length; i < ilen; ++i) {\r\n\t\t\t\tif (chart.isDatasetVisible(i)) {\r\n\t\t\t\t\tmeta = chart.getDatasetMeta(i);\r\n\t\t\t\t\tarcs = meta.data;\r\n\t\t\t\t\tif (i !== me.index) {\r\n\t\t\t\t\t\tcontroller = meta.controller;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!arcs) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\tfor (i = 0, ilen = arcs.length; i < ilen; ++i) {\r\n\t\t\tarc = arcs[i];\r\n\t\t\tif (controller) {\r\n\t\t\t\tcontroller._configure();\r\n\t\t\t\toptions = controller._resolveDataElementOptions(arc, i);\r\n\t\t\t} else {\r\n\t\t\t\toptions = arc._options;\r\n\t\t\t}\r\n\t\t\tif (options.borderAlign !== 'inner') {\r\n\t\t\t\tborderWidth = options.borderWidth;\r\n\t\t\t\thoverWidth = options.hoverBorderWidth;\r\n\r\n\t\t\t\tmax = borderWidth > max ? borderWidth : max;\r\n\t\t\t\tmax = hoverWidth > max ? hoverWidth : max;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn max;\r\n\t},\r\n\r\n\t/**\r\n\t * @protected\r\n\t */\r\n\tsetHoverStyle: function(arc) {\r\n\t\tvar model = arc._model;\r\n\t\tvar options = arc._options;\r\n\t\tvar getHoverColor = helpers$1.getHoverColor;\r\n\r\n\t\tarc.$previousStyle = {\r\n\t\t\tbackgroundColor: model.backgroundColor,\r\n\t\t\tborderColor: model.borderColor,\r\n\t\t\tborderWidth: model.borderWidth,\r\n\t\t};\r\n\r\n\t\tmodel.backgroundColor = valueOrDefault$5(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));\r\n\t\tmodel.borderColor = valueOrDefault$5(options.hoverBorderColor, getHoverColor(options.borderColor));\r\n\t\tmodel.borderWidth = valueOrDefault$5(options.hoverBorderWidth, options.borderWidth);\r\n\t},\r\n\r\n\t/**\r\n\t * Get radius length offset of the dataset in relation to the visible datasets weights. This allows determining the inner and outer radius correctly\r\n\t * @private\r\n\t */\r\n\t_getRingWeightOffset: function(datasetIndex) {\r\n\t\tvar ringWeightOffset = 0;\r\n\r\n\t\tfor (var i = 0; i < datasetIndex; ++i) {\r\n\t\t\tif (this.chart.isDatasetVisible(i)) {\r\n\t\t\t\tringWeightOffset += this._getRingWeight(i);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn ringWeightOffset;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getRingWeight: function(dataSetIndex) {\r\n\t\treturn Math.max(valueOrDefault$5(this.chart.data.datasets[dataSetIndex].weight, 1), 0);\r\n\t},\r\n\r\n\t/**\r\n\t * Returns the sum of all visibile data set weights. This value can be 0.\r\n\t * @private\r\n\t */\r\n\t_getVisibleDatasetWeightTotal: function() {\r\n\t\treturn this._getRingWeightOffset(this.chart.data.datasets.length);\r\n\t}\r\n});\n\ncore_defaults._set('horizontalBar', {\r\n\thover: {\r\n\t\tmode: 'index',\r\n\t\taxis: 'y'\r\n\t},\r\n\r\n\tscales: {\r\n\t\txAxes: [{\r\n\t\t\ttype: 'linear',\r\n\t\t\tposition: 'bottom'\r\n\t\t}],\r\n\r\n\t\tyAxes: [{\r\n\t\t\ttype: 'category',\r\n\t\t\tposition: 'left',\r\n\t\t\toffset: true,\r\n\t\t\tgridLines: {\r\n\t\t\t\toffsetGridLines: true\r\n\t\t\t}\r\n\t\t}]\r\n\t},\r\n\r\n\telements: {\r\n\t\trectangle: {\r\n\t\t\tborderSkipped: 'left'\r\n\t\t}\r\n\t},\r\n\r\n\ttooltips: {\r\n\t\tmode: 'index',\r\n\t\taxis: 'y'\r\n\t}\r\n});\r\n\r\ncore_defaults._set('global', {\r\n\tdatasets: {\r\n\t\thorizontalBar: {\r\n\t\t\tcategoryPercentage: 0.8,\r\n\t\t\tbarPercentage: 0.9\r\n\t\t}\r\n\t}\r\n});\r\n\r\nvar controller_horizontalBar = controller_bar.extend({\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getValueScaleId: function() {\r\n\t\treturn this.getMeta().xAxisID;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getIndexScaleId: function() {\r\n\t\treturn this.getMeta().yAxisID;\r\n\t}\r\n});\n\nvar valueOrDefault$6 = helpers$1.valueOrDefault;\r\nvar resolve$2 = helpers$1.options.resolve;\r\nvar isPointInArea = helpers$1.canvas._isPointInArea;\r\n\r\ncore_defaults._set('line', {\r\n\tshowLines: true,\r\n\tspanGaps: false,\r\n\r\n\thover: {\r\n\t\tmode: 'label'\r\n\t},\r\n\r\n\tscales: {\r\n\t\txAxes: [{\r\n\t\t\ttype: 'category',\r\n\t\t\tid: 'x-axis-0'\r\n\t\t}],\r\n\t\tyAxes: [{\r\n\t\t\ttype: 'linear',\r\n\t\t\tid: 'y-axis-0'\r\n\t\t}]\r\n\t}\r\n});\r\n\r\nfunction scaleClip(scale, halfBorderWidth) {\r\n\tvar tickOpts = scale && scale.options.ticks || {};\r\n\tvar reverse = tickOpts.reverse;\r\n\tvar min = tickOpts.min === undefined ? halfBorderWidth : 0;\r\n\tvar max = tickOpts.max === undefined ? halfBorderWidth : 0;\r\n\treturn {\r\n\t\tstart: reverse ? max : min,\r\n\t\tend: reverse ? min : max\r\n\t};\r\n}\r\n\r\nfunction defaultClip(xScale, yScale, borderWidth) {\r\n\tvar halfBorderWidth = borderWidth / 2;\r\n\tvar x = scaleClip(xScale, halfBorderWidth);\r\n\tvar y = scaleClip(yScale, halfBorderWidth);\r\n\r\n\treturn {\r\n\t\ttop: y.end,\r\n\t\tright: x.end,\r\n\t\tbottom: y.start,\r\n\t\tleft: x.start\r\n\t};\r\n}\r\n\r\nfunction toClip(value) {\r\n\tvar t, r, b, l;\r\n\r\n\tif (helpers$1.isObject(value)) {\r\n\t\tt = value.top;\r\n\t\tr = value.right;\r\n\t\tb = value.bottom;\r\n\t\tl = value.left;\r\n\t} else {\r\n\t\tt = r = b = l = value;\r\n\t}\r\n\r\n\treturn {\r\n\t\ttop: t,\r\n\t\tright: r,\r\n\t\tbottom: b,\r\n\t\tleft: l\r\n\t};\r\n}\r\n\r\n\r\nvar controller_line = core_datasetController.extend({\r\n\r\n\tdatasetElementType: elements.Line,\r\n\r\n\tdataElementType: elements.Point,\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_datasetElementOptions: [\r\n\t\t'backgroundColor',\r\n\t\t'borderCapStyle',\r\n\t\t'borderColor',\r\n\t\t'borderDash',\r\n\t\t'borderDashOffset',\r\n\t\t'borderJoinStyle',\r\n\t\t'borderWidth',\r\n\t\t'cubicInterpolationMode',\r\n\t\t'fill'\r\n\t],\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_dataElementOptions: {\r\n\t\tbackgroundColor: 'pointBackgroundColor',\r\n\t\tborderColor: 'pointBorderColor',\r\n\t\tborderWidth: 'pointBorderWidth',\r\n\t\thitRadius: 'pointHitRadius',\r\n\t\thoverBackgroundColor: 'pointHoverBackgroundColor',\r\n\t\thoverBorderColor: 'pointHoverBorderColor',\r\n\t\thoverBorderWidth: 'pointHoverBorderWidth',\r\n\t\thoverRadius: 'pointHoverRadius',\r\n\t\tpointStyle: 'pointStyle',\r\n\t\tradius: 'pointRadius',\r\n\t\trotation: 'pointRotation'\r\n\t},\r\n\r\n\tupdate: function(reset) {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar line = meta.dataset;\r\n\t\tvar points = meta.data || [];\r\n\t\tvar options = me.chart.options;\r\n\t\tvar config = me._config;\r\n\t\tvar showLine = me._showLine = valueOrDefault$6(config.showLine, options.showLines);\r\n\t\tvar i, ilen;\r\n\r\n\t\tme._xScale = me.getScaleForId(meta.xAxisID);\r\n\t\tme._yScale = me.getScaleForId(meta.yAxisID);\r\n\r\n\t\t// Update Line\r\n\t\tif (showLine) {\r\n\t\t\t// Compatibility: If the properties are defined with only the old name, use those values\r\n\t\t\tif (config.tension !== undefined && config.lineTension === undefined) {\r\n\t\t\t\tconfig.lineTension = config.tension;\r\n\t\t\t}\r\n\r\n\t\t\t// Utility\r\n\t\t\tline._scale = me._yScale;\r\n\t\t\tline._datasetIndex = me.index;\r\n\t\t\t// Data\r\n\t\t\tline._children = points;\r\n\t\t\t// Model\r\n\t\t\tline._model = me._resolveDatasetElementOptions(line);\r\n\r\n\t\t\tline.pivot();\r\n\t\t}\r\n\r\n\t\t// Update Points\r\n\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\r\n\t\t\tme.updateElement(points[i], i, reset);\r\n\t\t}\r\n\r\n\t\tif (showLine && line._model.tension !== 0) {\r\n\t\t\tme.updateBezierControlPoints();\r\n\t\t}\r\n\r\n\t\t// Now pivot the point for animation\r\n\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\r\n\t\t\tpoints[i].pivot();\r\n\t\t}\r\n\t},\r\n\r\n\tupdateElement: function(point, index, reset) {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar custom = point.custom || {};\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar datasetIndex = me.index;\r\n\t\tvar value = dataset.data[index];\r\n\t\tvar xScale = me._xScale;\r\n\t\tvar yScale = me._yScale;\r\n\t\tvar lineModel = meta.dataset._model;\r\n\t\tvar x, y;\r\n\r\n\t\tvar options = me._resolveDataElementOptions(point, index);\r\n\r\n\t\tx = xScale.getPixelForValue(typeof value === 'object' ? value : NaN, index, datasetIndex);\r\n\t\ty = reset ? yScale.getBasePixel() : me.calculatePointY(value, index, datasetIndex);\r\n\r\n\t\t// Utility\r\n\t\tpoint._xScale = xScale;\r\n\t\tpoint._yScale = yScale;\r\n\t\tpoint._options = options;\r\n\t\tpoint._datasetIndex = datasetIndex;\r\n\t\tpoint._index = index;\r\n\r\n\t\t// Desired view properties\r\n\t\tpoint._model = {\r\n\t\t\tx: x,\r\n\t\t\ty: y,\r\n\t\t\tskip: custom.skip || isNaN(x) || isNaN(y),\r\n\t\t\t// Appearance\r\n\t\t\tradius: options.radius,\r\n\t\t\tpointStyle: options.pointStyle,\r\n\t\t\trotation: options.rotation,\r\n\t\t\tbackgroundColor: options.backgroundColor,\r\n\t\t\tborderColor: options.borderColor,\r\n\t\t\tborderWidth: options.borderWidth,\r\n\t\t\ttension: valueOrDefault$6(custom.tension, lineModel ? lineModel.tension : 0),\r\n\t\t\tsteppedLine: lineModel ? lineModel.steppedLine : false,\r\n\t\t\t// Tooltip\r\n\t\t\thitRadius: options.hitRadius\r\n\t\t};\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_resolveDatasetElementOptions: function(element) {\r\n\t\tvar me = this;\r\n\t\tvar config = me._config;\r\n\t\tvar custom = element.custom || {};\r\n\t\tvar options = me.chart.options;\r\n\t\tvar lineOptions = options.elements.line;\r\n\t\tvar values = core_datasetController.prototype._resolveDatasetElementOptions.apply(me, arguments);\r\n\r\n\t\t// The default behavior of lines is to break at null values, according\r\n\t\t// to https://github.com/chartjs/Chart.js/issues/2435#issuecomment-216718158\r\n\t\t// This option gives lines the ability to span gaps\r\n\t\tvalues.spanGaps = valueOrDefault$6(config.spanGaps, options.spanGaps);\r\n\t\tvalues.tension = valueOrDefault$6(config.lineTension, lineOptions.tension);\r\n\t\tvalues.steppedLine = resolve$2([custom.steppedLine, config.steppedLine, lineOptions.stepped]);\r\n\t\tvalues.clip = toClip(valueOrDefault$6(config.clip, defaultClip(me._xScale, me._yScale, values.borderWidth)));\r\n\r\n\t\treturn values;\r\n\t},\r\n\r\n\tcalculatePointY: function(value, index, datasetIndex) {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar yScale = me._yScale;\r\n\t\tvar sumPos = 0;\r\n\t\tvar sumNeg = 0;\r\n\t\tvar i, ds, dsMeta, stackedRightValue, rightValue, metasets, ilen;\r\n\r\n\t\tif (yScale.options.stacked) {\r\n\t\t\trightValue = +yScale.getRightValue(value);\r\n\t\t\tmetasets = chart._getSortedVisibleDatasetMetas();\r\n\t\t\tilen = metasets.length;\r\n\r\n\t\t\tfor (i = 0; i < ilen; ++i) {\r\n\t\t\t\tdsMeta = metasets[i];\r\n\t\t\t\tif (dsMeta.index === datasetIndex) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tds = chart.data.datasets[dsMeta.index];\r\n\t\t\t\tif (dsMeta.type === 'line' && dsMeta.yAxisID === yScale.id) {\r\n\t\t\t\t\tstackedRightValue = +yScale.getRightValue(ds.data[index]);\r\n\t\t\t\t\tif (stackedRightValue < 0) {\r\n\t\t\t\t\t\tsumNeg += stackedRightValue || 0;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tsumPos += stackedRightValue || 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (rightValue < 0) {\r\n\t\t\t\treturn yScale.getPixelForValue(sumNeg + rightValue);\r\n\t\t\t}\r\n\t\t\treturn yScale.getPixelForValue(sumPos + rightValue);\r\n\t\t}\r\n\t\treturn yScale.getPixelForValue(value);\r\n\t},\r\n\r\n\tupdateBezierControlPoints: function() {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar lineModel = meta.dataset._model;\r\n\t\tvar area = chart.chartArea;\r\n\t\tvar points = meta.data || [];\r\n\t\tvar i, ilen, model, controlPoints;\r\n\r\n\t\t// Only consider points that are drawn in case the spanGaps option is used\r\n\t\tif (lineModel.spanGaps) {\r\n\t\t\tpoints = points.filter(function(pt) {\r\n\t\t\t\treturn !pt._model.skip;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tfunction capControlPoint(pt, min, max) {\r\n\t\t\treturn Math.max(Math.min(pt, max), min);\r\n\t\t}\r\n\r\n\t\tif (lineModel.cubicInterpolationMode === 'monotone') {\r\n\t\t\thelpers$1.splineCurveMonotone(points);\r\n\t\t} else {\r\n\t\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\r\n\t\t\t\tmodel = points[i]._model;\r\n\t\t\t\tcontrolPoints = helpers$1.splineCurve(\r\n\t\t\t\t\thelpers$1.previousItem(points, i)._model,\r\n\t\t\t\t\tmodel,\r\n\t\t\t\t\thelpers$1.nextItem(points, i)._model,\r\n\t\t\t\t\tlineModel.tension\r\n\t\t\t\t);\r\n\t\t\t\tmodel.controlPointPreviousX = controlPoints.previous.x;\r\n\t\t\t\tmodel.controlPointPreviousY = controlPoints.previous.y;\r\n\t\t\t\tmodel.controlPointNextX = controlPoints.next.x;\r\n\t\t\t\tmodel.controlPointNextY = controlPoints.next.y;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (chart.options.elements.line.capBezierPoints) {\r\n\t\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\r\n\t\t\t\tmodel = points[i]._model;\r\n\t\t\t\tif (isPointInArea(model, area)) {\r\n\t\t\t\t\tif (i > 0 && isPointInArea(points[i - 1]._model, area)) {\r\n\t\t\t\t\t\tmodel.controlPointPreviousX = capControlPoint(model.controlPointPreviousX, area.left, area.right);\r\n\t\t\t\t\t\tmodel.controlPointPreviousY = capControlPoint(model.controlPointPreviousY, area.top, area.bottom);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (i < points.length - 1 && isPointInArea(points[i + 1]._model, area)) {\r\n\t\t\t\t\t\tmodel.controlPointNextX = capControlPoint(model.controlPointNextX, area.left, area.right);\r\n\t\t\t\t\t\tmodel.controlPointNextY = capControlPoint(model.controlPointNextY, area.top, area.bottom);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tdraw: function() {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar points = meta.data || [];\r\n\t\tvar area = chart.chartArea;\r\n\t\tvar canvas = chart.canvas;\r\n\t\tvar i = 0;\r\n\t\tvar ilen = points.length;\r\n\t\tvar clip;\r\n\r\n\t\tif (me._showLine) {\r\n\t\t\tclip = meta.dataset._model.clip;\r\n\r\n\t\t\thelpers$1.canvas.clipArea(chart.ctx, {\r\n\t\t\t\tleft: clip.left === false ? 0 : area.left - clip.left,\r\n\t\t\t\tright: clip.right === false ? canvas.width : area.right + clip.right,\r\n\t\t\t\ttop: clip.top === false ? 0 : area.top - clip.top,\r\n\t\t\t\tbottom: clip.bottom === false ? canvas.height : area.bottom + clip.bottom\r\n\t\t\t});\r\n\r\n\t\t\tmeta.dataset.draw();\r\n\r\n\t\t\thelpers$1.canvas.unclipArea(chart.ctx);\r\n\t\t}\r\n\r\n\t\t// Draw the points\r\n\t\tfor (; i < ilen; ++i) {\r\n\t\t\tpoints[i].draw(area);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @protected\r\n\t */\r\n\tsetHoverStyle: function(point) {\r\n\t\tvar model = point._model;\r\n\t\tvar options = point._options;\r\n\t\tvar getHoverColor = helpers$1.getHoverColor;\r\n\r\n\t\tpoint.$previousStyle = {\r\n\t\t\tbackgroundColor: model.backgroundColor,\r\n\t\t\tborderColor: model.borderColor,\r\n\t\t\tborderWidth: model.borderWidth,\r\n\t\t\tradius: model.radius\r\n\t\t};\r\n\r\n\t\tmodel.backgroundColor = valueOrDefault$6(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));\r\n\t\tmodel.borderColor = valueOrDefault$6(options.hoverBorderColor, getHoverColor(options.borderColor));\r\n\t\tmodel.borderWidth = valueOrDefault$6(options.hoverBorderWidth, options.borderWidth);\r\n\t\tmodel.radius = valueOrDefault$6(options.hoverRadius, options.radius);\r\n\t},\r\n});\n\nvar resolve$3 = helpers$1.options.resolve;\r\n\r\ncore_defaults._set('polarArea', {\r\n\tscale: {\r\n\t\ttype: 'radialLinear',\r\n\t\tangleLines: {\r\n\t\t\tdisplay: false\r\n\t\t},\r\n\t\tgridLines: {\r\n\t\t\tcircular: true\r\n\t\t},\r\n\t\tpointLabels: {\r\n\t\t\tdisplay: false\r\n\t\t},\r\n\t\tticks: {\r\n\t\t\tbeginAtZero: true\r\n\t\t}\r\n\t},\r\n\r\n\t// Boolean - Whether to animate the rotation of the chart\r\n\tanimation: {\r\n\t\tanimateRotate: true,\r\n\t\tanimateScale: true\r\n\t},\r\n\r\n\tstartAngle: -0.5 * Math.PI,\r\n\tlegendCallback: function(chart) {\r\n\t\tvar list = document.createElement('ul');\r\n\t\tvar data = chart.data;\r\n\t\tvar datasets = data.datasets;\r\n\t\tvar labels = data.labels;\r\n\t\tvar i, ilen, listItem, listItemSpan;\r\n\r\n\t\tlist.setAttribute('class', chart.id + '-legend');\r\n\t\tif (datasets.length) {\r\n\t\t\tfor (i = 0, ilen = datasets[0].data.length; i < ilen; ++i) {\r\n\t\t\t\tlistItem = list.appendChild(document.createElement('li'));\r\n\t\t\t\tlistItemSpan = listItem.appendChild(document.createElement('span'));\r\n\t\t\t\tlistItemSpan.style.backgroundColor = datasets[0].backgroundColor[i];\r\n\t\t\t\tif (labels[i]) {\r\n\t\t\t\t\tlistItem.appendChild(document.createTextNode(labels[i]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn list.outerHTML;\r\n\t},\r\n\tlegend: {\r\n\t\tlabels: {\r\n\t\t\tgenerateLabels: function(chart) {\r\n\t\t\t\tvar data = chart.data;\r\n\t\t\t\tif (data.labels.length && data.datasets.length) {\r\n\t\t\t\t\treturn data.labels.map(function(label, i) {\r\n\t\t\t\t\t\tvar meta = chart.getDatasetMeta(0);\r\n\t\t\t\t\t\tvar style = meta.controller.getStyle(i);\r\n\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\ttext: label,\r\n\t\t\t\t\t\t\tfillStyle: style.backgroundColor,\r\n\t\t\t\t\t\t\tstrokeStyle: style.borderColor,\r\n\t\t\t\t\t\t\tlineWidth: style.borderWidth,\r\n\t\t\t\t\t\t\thidden: isNaN(data.datasets[0].data[i]) || meta.data[i].hidden,\r\n\r\n\t\t\t\t\t\t\t// Extra data used for toggling the correct item\r\n\t\t\t\t\t\t\tindex: i\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\treturn [];\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tonClick: function(e, legendItem) {\r\n\t\t\tvar index = legendItem.index;\r\n\t\t\tvar chart = this.chart;\r\n\t\t\tvar i, ilen, meta;\r\n\r\n\t\t\tfor (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {\r\n\t\t\t\tmeta = chart.getDatasetMeta(i);\r\n\t\t\t\tmeta.data[index].hidden = !meta.data[index].hidden;\r\n\t\t\t}\r\n\r\n\t\t\tchart.update();\r\n\t\t}\r\n\t},\r\n\r\n\t// Need to override these to give a nice default\r\n\ttooltips: {\r\n\t\tcallbacks: {\r\n\t\t\ttitle: function() {\r\n\t\t\t\treturn '';\r\n\t\t\t},\r\n\t\t\tlabel: function(item, data) {\r\n\t\t\t\treturn data.labels[item.index] + ': ' + item.yLabel;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n});\r\n\r\nvar controller_polarArea = core_datasetController.extend({\r\n\r\n\tdataElementType: elements.Arc,\r\n\r\n\tlinkScales: helpers$1.noop,\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_dataElementOptions: [\r\n\t\t'backgroundColor',\r\n\t\t'borderColor',\r\n\t\t'borderWidth',\r\n\t\t'borderAlign',\r\n\t\t'hoverBackgroundColor',\r\n\t\t'hoverBorderColor',\r\n\t\t'hoverBorderWidth',\r\n\t],\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getIndexScaleId: function() {\r\n\t\treturn this.chart.scale.id;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getValueScaleId: function() {\r\n\t\treturn this.chart.scale.id;\r\n\t},\r\n\r\n\tupdate: function(reset) {\r\n\t\tvar me = this;\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar start = me.chart.options.startAngle || 0;\r\n\t\tvar starts = me._starts = [];\r\n\t\tvar angles = me._angles = [];\r\n\t\tvar arcs = meta.data;\r\n\t\tvar i, ilen, angle;\r\n\r\n\t\tme._updateRadius();\r\n\r\n\t\tmeta.count = me.countVisibleElements();\r\n\r\n\t\tfor (i = 0, ilen = dataset.data.length; i < ilen; i++) {\r\n\t\t\tstarts[i] = start;\r\n\t\t\tangle = me._computeAngle(i);\r\n\t\t\tangles[i] = angle;\r\n\t\t\tstart += angle;\r\n\t\t}\r\n\r\n\t\tfor (i = 0, ilen = arcs.length; i < ilen; ++i) {\r\n\t\t\tarcs[i]._options = me._resolveDataElementOptions(arcs[i], i);\r\n\t\t\tme.updateElement(arcs[i], i, reset);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_updateRadius: function() {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar chartArea = chart.chartArea;\r\n\t\tvar opts = chart.options;\r\n\t\tvar minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\r\n\r\n\t\tchart.outerRadius = Math.max(minSize / 2, 0);\r\n\t\tchart.innerRadius = Math.max(opts.cutoutPercentage ? (chart.outerRadius / 100) * (opts.cutoutPercentage) : 1, 0);\r\n\t\tchart.radiusLength = (chart.outerRadius - chart.innerRadius) / chart.getVisibleDatasetCount();\r\n\r\n\t\tme.outerRadius = chart.outerRadius - (chart.radiusLength * me.index);\r\n\t\tme.innerRadius = me.outerRadius - chart.radiusLength;\r\n\t},\r\n\r\n\tupdateElement: function(arc, index, reset) {\r\n\t\tvar me = this;\r\n\t\tvar chart = me.chart;\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar opts = chart.options;\r\n\t\tvar animationOpts = opts.animation;\r\n\t\tvar scale = chart.scale;\r\n\t\tvar labels = chart.data.labels;\r\n\r\n\t\tvar centerX = scale.xCenter;\r\n\t\tvar centerY = scale.yCenter;\r\n\r\n\t\t// var negHalfPI = -0.5 * Math.PI;\r\n\t\tvar datasetStartAngle = opts.startAngle;\r\n\t\tvar distance = arc.hidden ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]);\r\n\t\tvar startAngle = me._starts[index];\r\n\t\tvar endAngle = startAngle + (arc.hidden ? 0 : me._angles[index]);\r\n\r\n\t\tvar resetRadius = animationOpts.animateScale ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]);\r\n\t\tvar options = arc._options || {};\r\n\r\n\t\thelpers$1.extend(arc, {\r\n\t\t\t// Utility\r\n\t\t\t_datasetIndex: me.index,\r\n\t\t\t_index: index,\r\n\t\t\t_scale: scale,\r\n\r\n\t\t\t// Desired view properties\r\n\t\t\t_model: {\r\n\t\t\t\tbackgroundColor: options.backgroundColor,\r\n\t\t\t\tborderColor: options.borderColor,\r\n\t\t\t\tborderWidth: options.borderWidth,\r\n\t\t\t\tborderAlign: options.borderAlign,\r\n\t\t\t\tx: centerX,\r\n\t\t\t\ty: centerY,\r\n\t\t\t\tinnerRadius: 0,\r\n\t\t\t\touterRadius: reset ? resetRadius : distance,\r\n\t\t\t\tstartAngle: reset && animationOpts.animateRotate ? datasetStartAngle : startAngle,\r\n\t\t\t\tendAngle: reset && animationOpts.animateRotate ? datasetStartAngle : endAngle,\r\n\t\t\t\tlabel: helpers$1.valueAtIndexOrDefault(labels, index, labels[index])\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tarc.pivot();\r\n\t},\r\n\r\n\tcountVisibleElements: function() {\r\n\t\tvar dataset = this.getDataset();\r\n\t\tvar meta = this.getMeta();\r\n\t\tvar count = 0;\r\n\r\n\t\thelpers$1.each(meta.data, function(element, index) {\r\n\t\t\tif (!isNaN(dataset.data[index]) && !element.hidden) {\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn count;\r\n\t},\r\n\r\n\t/**\r\n\t * @protected\r\n\t */\r\n\tsetHoverStyle: function(arc) {\r\n\t\tvar model = arc._model;\r\n\t\tvar options = arc._options;\r\n\t\tvar getHoverColor = helpers$1.getHoverColor;\r\n\t\tvar valueOrDefault = helpers$1.valueOrDefault;\r\n\r\n\t\tarc.$previousStyle = {\r\n\t\t\tbackgroundColor: model.backgroundColor,\r\n\t\t\tborderColor: model.borderColor,\r\n\t\t\tborderWidth: model.borderWidth,\r\n\t\t};\r\n\r\n\t\tmodel.backgroundColor = valueOrDefault(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));\r\n\t\tmodel.borderColor = valueOrDefault(options.hoverBorderColor, getHoverColor(options.borderColor));\r\n\t\tmodel.borderWidth = valueOrDefault(options.hoverBorderWidth, options.borderWidth);\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_computeAngle: function(index) {\r\n\t\tvar me = this;\r\n\t\tvar count = this.getMeta().count;\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar meta = me.getMeta();\r\n\r\n\t\tif (isNaN(dataset.data[index]) || meta.data[index].hidden) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\t// Scriptable options\r\n\t\tvar context = {\r\n\t\t\tchart: me.chart,\r\n\t\t\tdataIndex: index,\r\n\t\t\tdataset: dataset,\r\n\t\t\tdatasetIndex: me.index\r\n\t\t};\r\n\r\n\t\treturn resolve$3([\r\n\t\t\tme.chart.options.elements.arc.angle,\r\n\t\t\t(2 * Math.PI) / count\r\n\t\t], context, index);\r\n\t}\r\n});\n\ncore_defaults._set('pie', helpers$1.clone(core_defaults.doughnut));\r\ncore_defaults._set('pie', {\r\n\tcutoutPercentage: 0\r\n});\r\n\r\n// Pie charts are Doughnut chart with different defaults\r\nvar controller_pie = controller_doughnut;\n\nvar valueOrDefault$7 = helpers$1.valueOrDefault;\r\n\r\ncore_defaults._set('radar', {\r\n\tspanGaps: false,\r\n\tscale: {\r\n\t\ttype: 'radialLinear'\r\n\t},\r\n\telements: {\r\n\t\tline: {\r\n\t\t\tfill: 'start',\r\n\t\t\ttension: 0 // no bezier in radar\r\n\t\t}\r\n\t}\r\n});\r\n\r\nvar controller_radar = core_datasetController.extend({\r\n\tdatasetElementType: elements.Line,\r\n\r\n\tdataElementType: elements.Point,\r\n\r\n\tlinkScales: helpers$1.noop,\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_datasetElementOptions: [\r\n\t\t'backgroundColor',\r\n\t\t'borderWidth',\r\n\t\t'borderColor',\r\n\t\t'borderCapStyle',\r\n\t\t'borderDash',\r\n\t\t'borderDashOffset',\r\n\t\t'borderJoinStyle',\r\n\t\t'fill'\r\n\t],\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_dataElementOptions: {\r\n\t\tbackgroundColor: 'pointBackgroundColor',\r\n\t\tborderColor: 'pointBorderColor',\r\n\t\tborderWidth: 'pointBorderWidth',\r\n\t\thitRadius: 'pointHitRadius',\r\n\t\thoverBackgroundColor: 'pointHoverBackgroundColor',\r\n\t\thoverBorderColor: 'pointHoverBorderColor',\r\n\t\thoverBorderWidth: 'pointHoverBorderWidth',\r\n\t\thoverRadius: 'pointHoverRadius',\r\n\t\tpointStyle: 'pointStyle',\r\n\t\tradius: 'pointRadius',\r\n\t\trotation: 'pointRotation'\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getIndexScaleId: function() {\r\n\t\treturn this.chart.scale.id;\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_getValueScaleId: function() {\r\n\t\treturn this.chart.scale.id;\r\n\t},\r\n\r\n\tupdate: function(reset) {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar line = meta.dataset;\r\n\t\tvar points = meta.data || [];\r\n\t\tvar scale = me.chart.scale;\r\n\t\tvar config = me._config;\r\n\t\tvar i, ilen;\r\n\r\n\t\t// Compatibility: If the properties are defined with only the old name, use those values\r\n\t\tif (config.tension !== undefined && config.lineTension === undefined) {\r\n\t\t\tconfig.lineTension = config.tension;\r\n\t\t}\r\n\r\n\t\t// Utility\r\n\t\tline._scale = scale;\r\n\t\tline._datasetIndex = me.index;\r\n\t\t// Data\r\n\t\tline._children = points;\r\n\t\tline._loop = true;\r\n\t\t// Model\r\n\t\tline._model = me._resolveDatasetElementOptions(line);\r\n\r\n\t\tline.pivot();\r\n\r\n\t\t// Update Points\r\n\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\r\n\t\t\tme.updateElement(points[i], i, reset);\r\n\t\t}\r\n\r\n\t\t// Update bezier control points\r\n\t\tme.updateBezierControlPoints();\r\n\r\n\t\t// Now pivot the point for animation\r\n\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\r\n\t\t\tpoints[i].pivot();\r\n\t\t}\r\n\t},\r\n\r\n\tupdateElement: function(point, index, reset) {\r\n\t\tvar me = this;\r\n\t\tvar custom = point.custom || {};\r\n\t\tvar dataset = me.getDataset();\r\n\t\tvar scale = me.chart.scale;\r\n\t\tvar pointPosition = scale.getPointPositionForValue(index, dataset.data[index]);\r\n\t\tvar options = me._resolveDataElementOptions(point, index);\r\n\t\tvar lineModel = me.getMeta().dataset._model;\r\n\t\tvar x = reset ? scale.xCenter : pointPosition.x;\r\n\t\tvar y = reset ? scale.yCenter : pointPosition.y;\r\n\r\n\t\t// Utility\r\n\t\tpoint._scale = scale;\r\n\t\tpoint._options = options;\r\n\t\tpoint._datasetIndex = me.index;\r\n\t\tpoint._index = index;\r\n\r\n\t\t// Desired view properties\r\n\t\tpoint._model = {\r\n\t\t\tx: x, // value not used in dataset scale, but we want a consistent API between scales\r\n\t\t\ty: y,\r\n\t\t\tskip: custom.skip || isNaN(x) || isNaN(y),\r\n\t\t\t// Appearance\r\n\t\t\tradius: options.radius,\r\n\t\t\tpointStyle: options.pointStyle,\r\n\t\t\trotation: options.rotation,\r\n\t\t\tbackgroundColor: options.backgroundColor,\r\n\t\t\tborderColor: options.borderColor,\r\n\t\t\tborderWidth: options.borderWidth,\r\n\t\t\ttension: valueOrDefault$7(custom.tension, lineModel ? lineModel.tension : 0),\r\n\r\n\t\t\t// Tooltip\r\n\t\t\thitRadius: options.hitRadius\r\n\t\t};\r\n\t},\r\n\r\n\t/**\r\n\t * @private\r\n\t */\r\n\t_resolveDatasetElementOptions: function() {\r\n\t\tvar me = this;\r\n\t\tvar config = me._config;\r\n\t\tvar options = me.chart.options;\r\n\t\tvar values = core_datasetController.prototype._resolveDatasetElementOptions.apply(me, arguments);\r\n\r\n\t\tvalues.spanGaps = valueOrDefault$7(config.spanGaps, options.spanGaps);\r\n\t\tvalues.tension = valueOrDefault$7(config.lineTension, options.elements.line.tension);\r\n\r\n\t\treturn values;\r\n\t},\r\n\r\n\tupdateBezierControlPoints: function() {\r\n\t\tvar me = this;\r\n\t\tvar meta = me.getMeta();\r\n\t\tvar area = me.chart.chartArea;\r\n\t\tvar points = meta.data || [];\r\n\t\tvar i, ilen, model, controlPoints;\r\n\r\n\t\t// Only consider points that are drawn in case the spanGaps option is used\r\n\t\tif (meta.dataset._model.spanGaps) {\r\n\t\t\tpoints = points.filter(function(pt) {\r\n\t\t\t\treturn !pt._model.skip;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tfunction capControlPoint(pt, min, max) {\r\n\t\t\treturn Math.max(Math.min(pt, max), min);\r\n\t\t}\r\n\r\n\t\tfor (i = 0, ilen = points.length; i < ilen; ++i) {\r\n\t\t\tmodel = points[i]._model;\r\n\t\t\tcontrolPoints = helpers$1.splineCurve(\r\n\t\t\t\thelpers$1.previousItem(points, i, true)._model,\r\n\t\t\t\tmodel,\r\n\t\t\t\thelpers$1.nextItem(points, i, true)._model,\r\n\t\t\t\tmodel.tension\r\n\t\t\t);\r\n\r\n\t\t\t// Prevent the bezier going outside of the bounds of the graph\r\n\t\t\tmodel.controlPointPreviousX = capControlPoint(controlPoints.previous.x, area.left, area.right);\r\n\t\t\tmodel.controlPointPreviousY = capControlPoint(controlPoints.previous.y, area.top, area.bottom);\r\n\t\t\tmodel.controlPointNextX = capControlPoint(controlPoints.next.x, area.left, area.right);\r\n\t\t\tmodel.controlPointNextY = capControlPoint(controlPoints.next.y, area.top, area.bottom);\r\n\t\t}\r\n\t},\r\n\r\n\tsetHoverStyle: function(point) {\r\n\t\tvar model = point._model;\r\n\t\tvar options = point._options;\r\n\t\tvar getHoverColor = helpers$1.getHoverColor;\r\n\r\n\t\tpoint.$previousStyle = {\r\n\t\t\tbackgroundColor: model.backgroundColor,\r\n\t\t\tborderColor: model.borderColor,\r\n\t\t\tborderWidth: model.borderWidth,\r\n\t\t\tradius: model.radius\r\n\t\t};\r\n\r\n\t\tmodel.backgroundColor = valueOrDefault$7(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));\r\n\t\tmodel.borderColor = valueOrDefault$7(options.hoverBorderColor, getHoverColor(options.borderColor));\r\n\t\tmodel.borderWidth = valueOrDefault$7(options.hoverBorderWidth, options.borderWidth);\r\n\t\tmodel.radius = valueOrDefault$7(options.hoverRadius, options.radius);\r\n\t}\r\n});\n\ncore_defaults._set('scatter', {\r\n\thover: {\r\n\t\tmode: 'single'\r\n\t},\r\n\r\n\tscales: {\r\n\t\txAxes: [{\r\n\t\t\tid: 'x-axis-1', // need an ID so datasets can reference the scale\r\n\t\t\ttype: 'linear', // scatter should not use a category axis\r\n\t\t\tposition: 'bottom'\r\n\t\t}],\r\n\t\tyAxes: [{\r\n\t\t\tid: 'y-axis-1',\r\n\t\t\ttype: 'linear',\r\n\t\t\tposition: 'left'\r\n\t\t}]\r\n\t},\r\n\r\n\ttooltips: {\r\n\t\tcallbacks: {\r\n\t\t\ttitle: function() {\r\n\t\t\t\treturn ''; // doesn't make sense for scatter since data are formatted as a point\r\n\t\t\t},\r\n\t\t\tlabel: function(item) {\r\n\t\t\t\treturn '(' + item.xLabel + ', ' + item.yLabel + ')';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n});\r\n\r\ncore_defaults._set('global', {\r\n\tdatasets: {\r\n\t\tscatter: {\r\n\t\t\tshowLine: false\r\n\t\t}\r\n\t}\r\n});\r\n\r\n// Scatter charts use line controllers\r\nvar controller_scatter = controller_line;\n\n// NOTE export a map in which the key represents the controller type, not\r\n// the class, and so must be CamelCase in order to be correctly retrieved\r\n// by the controller in core.controller.js (`controllers[meta.type]`).\r\n\r\nvar controllers = {\r\n\tbar: controller_bar,\r\n\tbubble: controller_bubble,\r\n\tdoughnut: controller_doughnut,\r\n\thorizontalBar: controller_horizontalBar,\r\n\tline: controller_line,\r\n\tpolarArea: controller_polarArea,\r\n\tpie: controller_pie,\r\n\tradar: controller_radar,\r\n\tscatter: controller_scatter\r\n};\n\n/**\r\n * Helper function to get relative position for an event\r\n * @param {Event|IEvent} event - The event to get the position for\r\n * @param {Chart} chart - The chart\r\n * @returns {object} the event position\r\n */\r\nfunction getRelativePosition(e, chart) {\r\n\tif (e.native) {\r\n\t\treturn {\r\n\t\t\tx: e.x,\r\n\t\t\ty: e.y\r\n\t\t};\r\n\t}\r\n\r\n\treturn helpers$1.getRelativePosition(e, chart);\r\n}\r\n\r\n/**\r\n * Helper function to traverse all of the visible elements in the chart\r\n * @param {Chart} chart - the chart\r\n * @param {function} handler - the callback to execute for each visible item\r\n */\r\nfunction parseVisibleItems(chart, handler) {\r\n\tvar metasets = chart._getSortedVisibleDatasetMetas();\r\n\tvar metadata, i, j, ilen, jlen, element;\r\n\r\n\tfor (i = 0, ilen = metasets.length; i < ilen; ++i) {\r\n\t\tmetadata = metasets[i].data;\r\n\t\tfor (j = 0, jlen = metadata.length; j < jlen; ++j) {\r\n\t\t\telement = metadata[j];\r\n\t\t\tif (!element._view.skip) {\r\n\t\t\t\thandler(element);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n/**\r\n * Helper function to get the items that intersect the event position\r\n * @param {ChartElement[]} items - elements to filter\r\n * @param {object} position - the point to be nearest to\r\n * @return {ChartElement[]} the nearest items\r\n */\r\nfunction getIntersectItems(chart, position) {\r\n\tvar elements = [];\r\n\r\n\tparseVisibleItems(chart, function(element) {\r\n\t\tif (element.inRange(position.x, position.y)) {\r\n\t\t\telements.push(element);\r\n\t\t}\r\n\t});\r\n\r\n\treturn elements;\r\n}\r\n\r\n/**\r\n * Helper function to get the items nearest to the event position considering all visible items in teh chart\r\n * @param {Chart} chart - the chart to look at elements from\r\n * @param {object} position - the point to be nearest to\r\n * @param {boolean} intersect - if true, only consider items that intersect the position\r\n * @param {function} distanceMetric - function to provide the distance between points\r\n * @return {ChartElement[]} the nearest items\r\n */\r\nfunction getNearestItems(chart, position, intersect, distanceMetric) {\r\n\tvar minDistance = Number.POSITIVE_INFINITY;\r\n\tvar nearestItems = [];\r\n\r\n\tparseVisibleItems(chart, function(element) {\r\n\t\tif (intersect && !element.inRange(position.x, position.y)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar center = element.getCenterPoint();\r\n\t\tvar distance = distanceMetric(position, center);\r\n\t\tif (distance < minDistance) {\r\n\t\t\tnearestItems = [element];\r\n\t\t\tminDistance = distance;\r\n\t\t} else if (distance === minDistance) {\r\n\t\t\t// Can have multiple items at the same distance in which case we sort by size\r\n\t\t\tnearestItems.push(element);\r\n\t\t}\r\n\t});\r\n\r\n\treturn nearestItems;\r\n}\r\n\r\n/**\r\n * Get a distance metric function for two points based on the\r\n * axis mode setting\r\n * @param {string} axis - the axis mode. x|y|xy\r\n */\r\nfunction getDistanceMetricForAxis(axis) {\r\n\tvar useX = axis.indexOf('x') !== -1;\r\n\tvar useY = axis.indexOf('y') !== -1;\r\n\r\n\treturn function(pt1, pt2) {\r\n\t\tvar deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\r\n\t\tvar deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\r\n\t\treturn Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\r\n\t};\r\n}\r\n\r\nfunction indexMode(chart, e, options) {\r\n\tvar position = getRelativePosition(e, chart);\r\n\t// Default axis for index mode is 'x' to match old behaviour\r\n\toptions.axis = options.axis || 'x';\r\n\tvar distanceMetric = getDistanceMetricForAxis(options.axis);\r\n\tvar items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false, distanceMetric);\r\n\tvar elements = [];\r\n\r\n\tif (!items.length) {\r\n\t\treturn [];\r\n\t}\r\n\r\n\tchart._getSortedVisibleDatasetMetas().forEach(function(meta) {\r\n\t\tvar element = meta.data[items[0]._index];\r\n\r\n\t\t// don't count items that are skipped (null data)\r\n\t\tif (element && !element._view.skip) {\r\n\t\t\telements.push(element);\r\n\t\t}\r\n\t});\r\n\r\n\treturn elements;\r\n}\r\n\r\n/**\r\n * @interface IInteractionOptions\r\n */\r\n/**\r\n * If true, only consider items that intersect the point\r\n * @name IInterfaceOptions#boolean\r\n * @type Boolean\r\n */\r\n\r\n/**\r\n * Contains interaction related functions\r\n * @namespace Chart.Interaction\r\n */\r\nvar core_interaction = {\r\n\t// Helper function for different modes\r\n\tmodes: {\r\n\t\tsingle: function(chart, e) {\r\n\t\t\tvar position = getRelativePosition(e, chart);\r\n\t\t\tvar elements = [];\r\n\r\n\t\t\tparseVisibleItems(chart, function(element) {\r\n\t\t\t\tif (element.inRange(position.x, position.y)) {\r\n\t\t\t\t\telements.push(element);\r\n\t\t\t\t\treturn elements;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\treturn elements.slice(0, 1);\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * @function Chart.Interaction.modes.label\r\n\t\t * @deprecated since version 2.4.0\r\n\t\t * @todo remove at version 3\r\n\t\t * @private\r\n\t\t */\r\n\t\tlabel: indexMode,\r\n\r\n\t\t/**\r\n\t\t * Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something\r\n\t\t * If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item\r\n\t\t * @function Chart.Interaction.modes.index\r\n\t\t * @since v2.4.0\r\n\t\t * @param {Chart} chart - the chart we are returning items from\r\n\t\t * @param {Event} e - the event we are find things at\r\n\t\t * @param {IInteractionOptions} options - options to use during interaction\r\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\r\n\t\t */\r\n\t\tindex: indexMode,\r\n\r\n\t\t/**\r\n\t\t * Returns items in the same dataset. If the options.intersect parameter is true, we only return items if we intersect something\r\n\t\t * If the options.intersect is false, we find the nearest item and return the items in that dataset\r\n\t\t * @function Chart.Interaction.modes.dataset\r\n\t\t * @param {Chart} chart - the chart we are returning items from\r\n\t\t * @param {Event} e - the event we are find things at\r\n\t\t * @param {IInteractionOptions} options - options to use during interaction\r\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\r\n\t\t */\r\n\t\tdataset: function(chart, e, options) {\r\n\t\t\tvar position = getRelativePosition(e, chart);\r\n\t\t\toptions.axis = options.axis || 'xy';\r\n\t\t\tvar distanceMetric = getDistanceMetricForAxis(options.axis);\r\n\t\t\tvar items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false, distanceMetric);\r\n\r\n\t\t\tif (items.length > 0) {\r\n\t\t\t\titems = chart.getDatasetMeta(items[0]._datasetIndex).data;\r\n\t\t\t}\r\n\r\n\t\t\treturn items;\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * @function Chart.Interaction.modes.x-axis\r\n\t\t * @deprecated since version 2.4.0. Use index mode and intersect == true\r\n\t\t * @todo remove at version 3\r\n\t\t * @private\r\n\t\t */\r\n\t\t'x-axis': function(chart, e) {\r\n\t\t\treturn indexMode(chart, e, {intersect: false});\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * Point mode returns all elements that hit test based on the event position\r\n\t\t * of the event\r\n\t\t * @function Chart.Interaction.modes.intersect\r\n\t\t * @param {Chart} chart - the chart we are returning items from\r\n\t\t * @param {Event} e - the event we are find things at\r\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\r\n\t\t */\r\n\t\tpoint: function(chart, e) {\r\n\t\t\tvar position = getRelativePosition(e, chart);\r\n\t\t\treturn getIntersectItems(chart, position);\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * nearest mode returns the element closest to the point\r\n\t\t * @function Chart.Interaction.modes.intersect\r\n\t\t * @param {Chart} chart - the chart we are returning items from\r\n\t\t * @param {Event} e - the event we are find things at\r\n\t\t * @param {IInteractionOptions} options - options to use\r\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\r\n\t\t */\r\n\t\tnearest: function(chart, e, options) {\r\n\t\t\tvar position = getRelativePosition(e, chart);\r\n\t\t\toptions.axis = options.axis || 'xy';\r\n\t\t\tvar distanceMetric = getDistanceMetricForAxis(options.axis);\r\n\t\t\treturn getNearestItems(chart, position, options.intersect, distanceMetric);\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * x mode returns the elements that hit-test at the current x coordinate\r\n\t\t * @function Chart.Interaction.modes.x\r\n\t\t * @param {Chart} chart - the chart we are returning items from\r\n\t\t * @param {Event} e - the event we are find things at\r\n\t\t * @param {IInteractionOptions} options - options to use\r\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\r\n\t\t */\r\n\t\tx: function(chart, e, options) {\r\n\t\t\tvar position = getRelativePosition(e, chart);\r\n\t\t\tvar items = [];\r\n\t\t\tvar intersectsItem = false;\r\n\r\n\t\t\tparseVisibleItems(chart, function(element) {\r\n\t\t\t\tif (element.inXRange(position.x)) {\r\n\t\t\t\t\titems.push(element);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (element.inRange(position.x, position.y)) {\r\n\t\t\t\t\tintersectsItem = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t// If we want to trigger on an intersect and we don't have any items\r\n\t\t\t// that intersect the position, return nothing\r\n\t\t\tif (options.intersect && !intersectsItem) {\r\n\t\t\t\titems = [];\r\n\t\t\t}\r\n\t\t\treturn items;\r\n\t\t},\r\n\r\n\t\t/**\r\n\t\t * y mode returns the elements that hit-test at the current y coordinate\r\n\t\t * @function Chart.Interaction.modes.y\r\n\t\t * @param {Chart} chart - the chart we are returning items from\r\n\t\t * @param {Event} e - the event we are find things at\r\n\t\t * @param {IInteractionOptions} options - options to use\r\n\t\t * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\r\n\t\t */\r\n\t\ty: function(chart, e, options) {\r\n\t\t\tvar position = getRelativePosition(e, chart);\r\n\t\t\tvar items = [];\r\n\t\t\tvar intersectsItem = false;\r\n\r\n\t\t\tparseVisibleItems(chart, function(element) {\r\n\t\t\t\tif (element.inYRange(position.y)) {\r\n\t\t\t\t\titems.push(element);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (element.inRange(position.x, position.y)) {\r\n\t\t\t\t\tintersectsItem = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t// If we want to trigger on an intersect and we don't have any items\r\n\t\t\t// that intersect the position, return nothing\r\n\t\t\tif (options.intersect && !intersectsItem) {\r\n\t\t\t\titems = [];\r\n\t\t\t}\r\n\t\t\treturn items;\r\n\t\t}\r\n\t}\r\n};\n\nvar extend = helpers$1.extend;\r\n\r\nfunction filterByPosition(array, position) {\r\n\treturn helpers$1.where(array, function(v) {\r\n\t\treturn v.pos === position;\r\n\t});\r\n}\r\n\r\nfunction sortByWeight(array, reverse) {\r\n\treturn array.sort(function(a, b) {\r\n\t\tvar v0 = reverse ? b : a;\r\n\t\tvar v1 = reverse ? a : b;\r\n\t\treturn v0.weight === v1.weight ?\r\n\t\t\tv0.index - v1.index :\r\n\t\t\tv0.weight - v1.weight;\r\n\t});\r\n}\r\n\r\nfunction wrapBoxes(boxes) {\r\n\tvar layoutBoxes = [];\r\n\tvar i, ilen, box;\r\n\r\n\tfor (i = 0, ilen = (boxes || []).length; i < ilen; ++i) {\r\n\t\tbox = boxes[i];\r\n\t\tlayoutBoxes.push({\r\n\t\t\tindex: i,\r\n\t\t\tbox: box,\r\n\t\t\tpos: box.position,\r\n\t\t\thorizontal: box.isHorizontal(),\r\n\t\t\tweight: box.weight\r\n\t\t});\r\n\t}\r\n\treturn layoutBoxes;\r\n}\r\n\r\nfunction setLayoutDims(layouts, params) {\r\n\tvar i, ilen, layout;\r\n\tfor (i = 0, ilen = layouts.length; i < ilen; ++i) {\r\n\t\tlayout = layouts[i];\r\n\t\t// store width used instead of chartArea.w in fitBoxes\r\n\t\tlayout.width = layout.horizontal\r\n\t\t\t? layout.box.fullWidth && params.availableWidth\r\n\t\t\t: params.vBoxMaxWidth;\r\n\t\t// store height used instead of chartArea.h in fitBoxes\r\n\t\tlayout.height = layout.horizontal && params.hBoxMaxHeight;\r\n\t}\r\n}\r\n\r\nfunction buildLayoutBoxes(boxes) {\r\n\tvar layoutBoxes = wrapBoxes(boxes);\r\n\tvar left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true);\r\n\tvar right = sortByWeight(filterByPosition(layoutBoxes, 'right'));\r\n\tvar top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true);\r\n\tvar bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom'));\r\n\r\n\treturn {\r\n\t\tleftAndTop: left.concat(top),\r\n\t\trightAndBottom: right.concat(bottom),\r\n\t\tchartArea: filterByPosition(layoutBoxes, 'chartArea'),\r\n\t\tvertical: left.concat(right),\r\n\t\thorizontal: top.concat(bottom)\r\n\t};\r\n}\r\n\r\nfunction getCombinedMax(maxPadding, chartArea, a, b) {\r\n\treturn Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\r\n}\r\n\r\nfunction updateDims(chartArea, params, layout) {\r\n\tvar box = layout.box;\r\n\tvar maxPadding = chartArea.maxPadding;\r\n\tvar newWidth, newHeight;\r\n\r\n\tif (layout.size) {\r\n\t\t// this layout was already counted for, lets first reduce old size\r\n\t\tchartArea[layout.pos] -= layout.size;\r\n\t}\r\n\tlayout.size = layout.horizontal ? box.height : box.width;\r\n\tchartArea[layout.pos] += layout.size;\r\n\r\n\tif (box.getPadding) {\r\n\t\tvar boxPadding = box.getPadding();\r\n\t\tmaxPadding.top = Math.max(maxPadding.top, boxPadding.top);\r\n\t\tmaxPadding.left = Math.max(maxPadding.left, boxPadding.left);\r\n\t\tmaxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\r\n\t\tmaxPadding.right = Math.max(maxPadding.right, boxPadding.right);\r\n\t}\r\n\r\n\tnewWidth = params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right');\r\n\tnewHeight = params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom');\r\n\r\n\tif (newWidth !== chartArea.w || newHeight !== chartArea.h) {\r\n\t\tchartArea.w = newWidth;\r\n\t\tchartArea.h = newHeight;\r\n\r\n\t\t// return true if chart area changed in layout's direction\r\n\t\tvar sizes = layout.horizontal ? [newWidth, chartArea.w] : [newHeight, chartArea.h];\r\n\t\treturn sizes[0] !== sizes[1] && (!isNaN(sizes[0]) || !isNaN(sizes[1]));\r\n\t}\r\n}\r\n\r\nfunction handleMaxPadding(chartArea) {\r\n\tvar maxPadding = chartArea.maxPadding;\r\n\r\n\tfunction updatePos(pos) {\r\n\t\tvar change = Math.max(maxPadding[pos] - chartArea[pos], 0);\r\n\t\tchartArea[pos] += change;\r\n\t\treturn change;\r\n\t}\r\n\tchartArea.y += updatePos('top');\r\n\tchartArea.x += updatePos('left');\r\n\tupdatePos('right');\r\n\tupdatePos('bottom');\r\n}\r\n\r\nfunction getMargins(horizontal, chartArea) {\r\n\tvar maxPadding = chartArea.maxPadding;\r\n\r\n\tfunction marginForPositions(positions) {\r\n\t\tvar margin = {left: 0, top: 0, right: 0, bottom: 0};\r\n\t\tpositions.forEach(function(pos) {\r\n\t\t\tmargin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\r\n\t\t});\r\n\t\treturn margin;\r\n\t}\r\n\r\n\treturn horizontal\r\n\t\t? marginForPositions(['left', 'right'])\r\n\t\t: marginForPositions(['top', 'bottom']);\r\n}\r\n\r\nfunction fitBoxes(boxes, chartArea, params) {\r\n\tvar refitBoxes = [];\r\n\tvar i, ilen, layout, box, refit, changed;\r\n\r\n\tfor (i = 0, ilen = boxes.length; i < ilen; ++i) {\r\n\t\tlayout = boxes[i];\r\n\t\tbox = layout.box;\r\n\r\n\t\tbox.update(\r\n\t\t\tlayout.width || chartArea.w,\r\n\t\t\tlayout.height || chartArea.h,\r\n\t\t\tgetMargins(layout.horizontal, chartArea)\r\n\t\t);\r\n\t\tif (updateDims(chartArea, params, layout)) {\r\n\t\t\tchanged = true;\r\n\t\t\tif (refitBoxes.length) {\r\n\t\t\t\t// Dimensions changed and there were non full width boxes before this\r\n\t\t\t\t// -> we have to refit those\r\n\t\t\t\trefit = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (!box.fullWidth) { // fullWidth boxes don't need to be re-fitted in any case\r\n\t\t\trefitBoxes.push(layout);\r\n\t\t}\r\n\t}\r\n\r\n\treturn refit ? fitBoxes(refitBoxes, chartArea, params) || changed : changed;\r\n}\r\n\r\nfunction placeBoxes(boxes, chartArea, params) {\r\n\tvar userPadding = params.padding;\r\n\tvar x = chartArea.x;\r\n\tvar y = chartArea.y;\r\n\tvar i, ilen, layout, box;\r\n\r\n\tfor (i = 0, ilen = boxes.length; i < ilen; ++i) {\r\n\t\tlayout = boxes[i];\r\n\t\tbox = layout.box;\r\n\t\tif (layout.horizontal) {\r\n\t\t\tbox.left = box.fullWidth ? userPadding.left : chartArea.left;\r\n\t\t\tbox.right = box.fullWidth ? params.outerWidth - userPadding.right : chartArea.left + chartArea.w;\r\n\t\t\tbox.top = y;\r\n\t\t\tbox.bottom = y + box.height;\r\n\t\t\tbox.width = box.right - box.left;\r\n\t\t\ty = box.bottom;\r\n\t\t} else {\r\n\t\t\tbox.left = x;\r\n\t\t\tbox.right = x + box.width;\r\n\t\t\tbox.top = chartArea.top;\r\n\t\t\tbox.bottom = chartArea.top + chartArea.h;\r\n\t\t\tbox.height = box.bottom - box.top;\r\n\t\t\tx = box.right;\r\n\t\t}\r\n\t}\r\n\r\n\tchartArea.x = x;\r\n\tchartArea.y = y;\r\n}\r\n\r\ncore_defaults._set('global', {\r\n\tlayout: {\r\n\t\tpadding: {\r\n\t\t\ttop: 0,\r\n\t\t\tright: 0,\r\n\t\t\tbottom: 0,\r\n\t\t\tleft: 0\r\n\t\t}\r\n\t}\r\n});\r\n\r\n/**\r\n * @interface ILayoutItem\r\n * @prop {string} position - The position of the item in the chart layout. Possible values are\r\n * 'left', 'top', 'right', 'bottom', and 'chartArea'\r\n * @prop {number} weight - The weight used to sort the item. Higher weights are further away from the chart area\r\n * @prop {boolean} fullWidth - if true, and the item is horizontal, then push vertical boxes down\r\n * @prop {function} isHorizontal - returns true if the layout item is horizontal (ie. top or bottom)\r\n * @prop {function} update - Takes two parameters: width and height. Returns size of item\r\n * @prop {function} getPadding - Returns an object with padding on the edges\r\n * @prop {number} width - Width of item. Must be valid after update()\r\n * @prop {number} height - Height of item. Must be valid after update()\r\n * @prop {number} left - Left edge of the item. Set by layout system and cannot be used in update\r\n * @prop {number} top - Top edge of the item. Set by layout system and cannot be used in update\r\n * @prop {number} right - Right edge of the item. Set by layout system and cannot be used in update\r\n * @prop {number} bottom - Bottom edge of the item. Set by layout system and cannot be used in update\r\n */\r\n\r\n// The layout service is very self explanatory. It's responsible for the layout within a chart.\r\n// Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need\r\n// It is this service's responsibility of carrying out that layout.\r\nvar core_layouts = {\r\n\tdefaults: {},\r\n\r\n\t/**\r\n\t * Register a box to a chart.\r\n\t * A box is simply a reference to an object that requires layout. eg. Scales, Legend, Title.\r\n\t * @param {Chart} chart - the chart to use\r\n\t * @param {ILayoutItem} item - the item to add to be layed out\r\n\t */\r\n\taddBox: function(chart, item) {\r\n\t\tif (!chart.boxes) {\r\n\t\t\tchart.boxes = [];\r\n\t\t}\r\n\r\n\t\t// initialize item with default values\r\n\t\titem.fullWidth = item.fullWidth || false;\r\n\t\titem.position = item.position || 'top';\r\n\t\titem.weight = item.weight || 0;\r\n\t\titem._layers = item._layers || function() {\r\n\t\t\treturn [{\r\n\t\t\t\tz: 0,\r\n\t\t\t\tdraw: function() {\r\n\t\t\t\t\titem.draw.apply(item, arguments);\r\n\t\t\t\t}\r\n\t\t\t}];\r\n\t\t};\r\n\r\n\t\tchart.boxes.push(item);\r\n\t},\r\n\r\n\t/**\r\n\t * Remove a layoutItem from a chart\r\n\t * @param {Chart} chart - the chart to remove the box from\r\n\t * @param {ILayoutItem} layoutItem - the item to remove from the layout\r\n\t */\r\n\tremoveBox: function(chart, layoutItem) {\r\n\t\tvar index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\r\n\t\tif (index !== -1) {\r\n\t\t\tchart.boxes.splice(index, 1);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Sets (or updates) options on the given `item`.\r\n\t * @param {Chart} chart - the chart in which the item lives (or will be added to)\r\n\t * @param {ILayoutItem} item - the item to configure with the given options\r\n\t * @param {object} options - the new item options.\r\n\t */\r\n\tconfigure: function(chart, item, options) {\r\n\t\tvar props = ['fullWidth', 'position', 'weight'];\r\n\t\tvar ilen = props.length;\r\n\t\tvar i = 0;\r\n\t\tvar prop;\r\n\r\n\t\tfor (; i < ilen; ++i) {\r\n\t\t\tprop = props[i];\r\n\t\t\tif (options.hasOwnProperty(prop)) {\r\n\t\t\t\titem[prop] = options[prop];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Fits boxes of the given chart into the given size by having each box measure itself\r\n\t * then running a fitting algorithm\r\n\t * @param {Chart} chart - the chart\r\n\t * @param {number} width - the width to fit into\r\n\t * @param {number} height - the height to fit into\r\n\t */\r\n\tupdate: function(chart, width, height) {\r\n\t\tif (!chart) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar layoutOptions = chart.options.layout || {};\r\n\t\tvar padding = helpers$1.options.toPadding(layoutOptions.padding);\r\n\r\n\t\tvar availableWidth = width - padding.width;\r\n\t\tvar availableHeight = height - padding.height;\r\n\t\tvar boxes = buildLayoutBoxes(chart.boxes);\r\n\t\tvar verticalBoxes = boxes.vertical;\r\n\t\tvar horizontalBoxes = boxes.horizontal;\r\n\r\n\t\t// Essentially we now have any number of boxes on each of the 4 sides.\r\n\t\t// Our canvas looks like the following.\r\n\t\t// The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and\r\n\t\t// B1 is the bottom axis\r\n\t\t// There are also 4 quadrant-like locations (left to right instead of clockwise) reserved for chart overlays\r\n\t\t// These locations are single-box locations only, when trying to register a chartArea location that is already taken,\r\n\t\t// an error will be thrown.\r\n\t\t//\r\n\t\t// |----------------------------------------------------|\r\n\t\t// | T1 (Full Width) |\r\n\t\t// |----------------------------------------------------|\r\n\t\t// | | | T2 | |\r\n\t\t// | |----|-------------------------------------|----|\r\n\t\t// | | | C1 | | C2 | |\r\n\t\t// | | |----| |----| |\r\n\t\t// | | | | |\r\n\t\t// | L1 | L2 | ChartArea (C0) | R1 |\r\n\t\t// | | | | |\r\n\t\t// | | |----| |----| |\r\n\t\t// | | | C3 | | C4 | |\r\n\t\t// | |----|-------------------------------------|----|\r\n\t\t// | | | B1 | |\r\n\t\t// |----------------------------------------------------|\r\n\t\t// | B2 (Full Width) |\r\n\t\t// |----------------------------------------------------|\r\n\t\t//\r\n\r\n\t\tvar params = Object.freeze({\r\n\t\t\touterWidth: width,\r\n\t\t\touterHeight: height,\r\n\t\t\tpadding: padding,\r\n\t\t\tavailableWidth: availableWidth,\r\n\t\t\tvBoxMaxWidth: availableWidth / 2 / verticalBoxes.length,\r\n\t\t\thBoxMaxHeight: availableHeight / 2\r\n\t\t});\r\n\t\tvar chartArea = extend({\r\n\t\t\tmaxPadding: extend({}, padding),\r\n\t\t\tw: availableWidth,\r\n\t\t\th: availableHeight,\r\n\t\t\tx: padding.left,\r\n\t\t\ty: padding.top\r\n\t\t}, padding);\r\n\r\n\t\tsetLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\r\n\r\n\t\t// First fit vertical boxes\r\n\t\tfitBoxes(verticalBoxes, chartArea, params);\r\n\r\n\t\t// Then fit horizontal boxes\r\n\t\tif (fitBoxes(horizontalBoxes, chartArea, params)) {\r\n\t\t\t// if the area changed, re-fit vertical boxes\r\n\t\t\tfitBoxes(verticalBoxes, chartArea, params);\r\n\t\t}\r\n\r\n\t\thandleMaxPadding(chartArea);\r\n\r\n\t\t// Finally place the boxes to correct coordinates\r\n\t\tplaceBoxes(boxes.leftAndTop, chartArea, params);\r\n\r\n\t\t// Move to opposite side of chart\r\n\t\tchartArea.x += chartArea.w;\r\n\t\tchartArea.y += chartArea.h;\r\n\r\n\t\tplaceBoxes(boxes.rightAndBottom, chartArea, params);\r\n\r\n\t\tchart.chartArea = {\r\n\t\t\tleft: chartArea.left,\r\n\t\t\ttop: chartArea.top,\r\n\t\t\tright: chartArea.left + chartArea.w,\r\n\t\t\tbottom: chartArea.top + chartArea.h\r\n\t\t};\r\n\r\n\t\t// Finally update boxes in chartArea (radial scale for example)\r\n\t\thelpers$1.each(boxes.chartArea, function(layout) {\r\n\t\t\tvar box = layout.box;\r\n\t\t\textend(box, chart.chartArea);\r\n\t\t\tbox.update(chartArea.w, chartArea.h);\r\n\t\t});\r\n\t}\r\n};\n\n/**\r\n * Platform fallback implementation (minimal).\r\n * @see https://github.com/chartjs/Chart.js/pull/4591#issuecomment-319575939\r\n */\r\n\r\nvar platform_basic = {\r\n\tacquireContext: function(item) {\r\n\t\tif (item && item.canvas) {\r\n\t\t\t// Support for any object associated to a canvas (including a context2d)\r\n\t\t\titem = item.canvas;\r\n\t\t}\r\n\r\n\t\treturn item && item.getContext('2d') || null;\r\n\t}\r\n};\n\nvar platform_dom = \"/*\\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\";\n\nvar platform_dom$1 = /*#__PURE__*/Object.freeze({\n__proto__: null,\n'default': platform_dom\n});\n\nvar stylesheet = getCjsExportFromNamespace(platform_dom$1);\n\nvar EXPANDO_KEY = '$chartjs';\r\nvar CSS_PREFIX = 'chartjs-';\r\nvar CSS_SIZE_MONITOR = CSS_PREFIX + 'size-monitor';\r\nvar CSS_RENDER_MONITOR = CSS_PREFIX + 'render-monitor';\r\nvar CSS_RENDER_ANIMATION = CSS_PREFIX + 'render-animation';\r\nvar ANIMATION_START_EVENTS = ['animationstart', 'webkitAnimationStart'];\r\n\r\n/**\r\n * DOM event types -> Chart.js event types.\r\n * Note: only events with different types are mapped.\r\n * @see https://developer.mozilla.org/en-US/docs/Web/Events\r\n */\r\nvar EVENT_TYPES = {\r\n\ttouchstart: 'mousedown',\r\n\ttouchmove: 'mousemove',\r\n\ttouchend: 'mouseup',\r\n\tpointerenter: 'mouseenter',\r\n\tpointerdown: 'mousedown',\r\n\tpointermove: 'mousemove',\r\n\tpointerup: 'mouseup',\r\n\tpointerleave: 'mouseout',\r\n\tpointerout: 'mouseout'\r\n};\r\n\r\n/**\r\n * The \"used\" size is the final value of a dimension property after all calculations have\r\n * been performed. This method uses the computed style of `element` but returns undefined\r\n * if the computed style is not expressed in pixels. That can happen in some cases where\r\n * `element` has a size relative to its parent and this last one is not yet displayed,\r\n * for example because of `display: none` on a parent node.\r\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\r\n * @returns {number} Size in pixels or undefined if unknown.\r\n */\r\nfunction readUsedSize(element, property) {\r\n\tvar value = helpers$1.getStyle(element, property);\r\n\tvar matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\r\n\treturn matches ? Number(matches[1]) : undefined;\r\n}\r\n\r\n/**\r\n * Initializes the canvas style and render size without modifying the canvas display size,\r\n * since responsiveness is handled by the controller.resize() method. The config is used\r\n * to determine the aspect ratio to apply in case no explicit height has been specified.\r\n */\r\nfunction initCanvas(canvas, config) {\r\n\tvar style = canvas.style;\r\n\r\n\t// NOTE(SB) canvas.getAttribute('width') !== canvas.width: in the first case it\r\n\t// returns null or '' if no explicit value has been set to the canvas attribute.\r\n\tvar renderHeight = canvas.getAttribute('height');\r\n\tvar renderWidth = canvas.getAttribute('width');\r\n\r\n\t// Chart.js modifies some canvas values that we want to restore on destroy\r\n\tcanvas[EXPANDO_KEY] = {\r\n\t\tinitial: {\r\n\t\t\theight: renderHeight,\r\n\t\t\twidth: renderWidth,\r\n\t\t\tstyle: {\r\n\t\t\t\tdisplay: style.display,\r\n\t\t\t\theight: style.height,\r\n\t\t\t\twidth: style.width\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// Force canvas to display as block to avoid extra space caused by inline\r\n\t// elements, which would interfere with the responsive resize process.\r\n\t// https://github.com/chartjs/Chart.js/issues/2538\r\n\tstyle.display = style.display || 'block';\r\n\r\n\tif (renderWidth === null || renderWidth === '') {\r\n\t\tvar displayWidth = readUsedSize(canvas, 'width');\r\n\t\tif (displayWidth !== undefined) {\r\n\t\t\tcanvas.width = displayWidth;\r\n\t\t}\r\n\t}\r\n\r\n\tif (renderHeight === null || renderHeight === '') {\r\n\t\tif (canvas.style.height === '') {\r\n\t\t\t// If no explicit render height and style height, let's apply the aspect ratio,\r\n\t\t\t// which one can be specified by the user but also by charts as default option\r\n\t\t\t// (i.e. options.aspectRatio). If not specified, use canvas aspect ratio of 2.\r\n\t\t\tcanvas.height = canvas.width / (config.options.aspectRatio || 2);\r\n\t\t} else {\r\n\t\t\tvar displayHeight = readUsedSize(canvas, 'height');\r\n\t\t\tif (displayWidth !== undefined) {\r\n\t\t\t\tcanvas.height = displayHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn canvas;\r\n}\r\n\r\n/**\r\n * Detects support for options object argument in addEventListener.\r\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\r\n * @private\r\n */\r\nvar supportsEventListenerOptions = (function() {\r\n\tvar supports = false;\r\n\ttry {\r\n\t\tvar options = Object.defineProperty({}, 'passive', {\r\n\t\t\t// eslint-disable-next-line getter-return\r\n\t\t\tget: function() {\r\n\t\t\t\tsupports = true;\r\n\t\t\t}\r\n\t\t});\r\n\t\twindow.addEventListener('e', null, options);\r\n\t} catch (e) {\r\n\t\t// continue regardless of error\r\n\t}\r\n\treturn supports;\r\n}());\r\n\r\n// Default passive to true as expected by Chrome for 'touchstart' and 'touchend' events.\r\n// https://github.com/chartjs/Chart.js/issues/4287\r\nvar eventListenerOptions = supportsEventListenerOptions ? {passive: true} : false;\r\n\r\nfunction addListener(node, type, listener) {\r\n\tnode.addEventListener(type, listener, eventListenerOptions);\r\n}\r\n\r\nfunction removeListener(node, type, listener) {\r\n\tnode.removeEventListener(type, listener, eventListenerOptions);\r\n}\r\n\r\nfunction createEvent(type, chart, x, y, nativeEvent) {\r\n\treturn {\r\n\t\ttype: type,\r\n\t\tchart: chart,\r\n\t\tnative: nativeEvent || null,\r\n\t\tx: x !== undefined ? x : null,\r\n\t\ty: y !== undefined ? y : null,\r\n\t};\r\n}\r\n\r\nfunction fromNativeEvent(event, chart) {\r\n\tvar type = EVENT_TYPES[event.type] || event.type;\r\n\tvar pos = helpers$1.getRelativePosition(event, chart);\r\n\treturn createEvent(type, chart, pos.x, pos.y, event);\r\n}\r\n\r\nfunction throttled(fn, thisArg) {\r\n\tvar ticking = false;\r\n\tvar args = [];\r\n\r\n\treturn function() {\r\n\t\targs = Array.prototype.slice.call(arguments);\r\n\t\tthisArg = thisArg || this;\r\n\r\n\t\tif (!ticking) {\r\n\t\t\tticking = true;\r\n\t\t\thelpers$1.requestAnimFrame.call(window, function() {\r\n\t\t\t\tticking = false;\r\n\t\t\t\tfn.apply(thisArg, args);\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n}\r\n\r\nfunction createDiv(cls) {\r\n\tvar el = document.createElement('div');\r\n\tel.className = cls || '';\r\n\treturn el;\r\n}\r\n\r\n// Implementation based on https://github.com/marcj/css-element-queries\r\nfunction createResizer(handler) {\r\n\tvar maxSize = 1000000;\r\n\r\n\t// NOTE(SB) Don't use innerHTML because it could be considered unsafe.\r\n\t// https://github.com/chartjs/Chart.js/issues/5902\r\n\tvar resizer = createDiv(CSS_SIZE_MONITOR);\r\n\tvar expand = createDiv(CSS_SIZE_MONITOR + '-expand');\r\n\tvar shrink = createDiv(CSS_SIZE_MONITOR + '-shrink');\r\n\r\n\texpand.appendChild(createDiv());\r\n\tshrink.appendChild(createDiv());\r\n\r\n\tresizer.appendChild(expand);\r\n\tresizer.appendChild(shrink);\r\n\tresizer._reset = function() {\r\n\t\texpand.scrollLeft = maxSize;\r\n\t\texpand.scrollTop = maxSize;\r\n\t\tshrink.scrollLeft = maxSize;\r\n\t\tshrink.scrollTop = maxSize;\r\n\t};\r\n\r\n\tvar onScroll = function() {\r\n\t\tresizer._reset();\r\n\t\thandler();\r\n\t};\r\n\r\n\taddListener(expand, 'scroll', onScroll.bind(expand, 'expand'));\r\n\taddListener(shrink, 'scroll', onScroll.bind(shrink, 'shrink'));\r\n\r\n\treturn resizer;\r\n}\r\n\r\n// https://davidwalsh.name/detect-node-insertion\r\nfunction watchForRender(node, handler) {\r\n\tvar expando = node[EXPANDO_KEY] || (node[EXPANDO_KEY] = {});\r\n\tvar proxy = expando.renderProxy = function(e) {\r\n\t\tif (e.animationName === CSS_RENDER_ANIMATION) {\r\n\t\t\thandler();\r\n\t\t}\r\n\t};\r\n\r\n\thelpers$1.each(ANIMATION_START_EVENTS, function(type) {\r\n\t\taddListener(node, type, proxy);\r\n\t});\r\n\r\n\t// #4737: Chrome might skip the CSS animation when the CSS_RENDER_MONITOR class\r\n\t// is removed then added back immediately (same animation frame?). Accessing the\r\n\t// `offsetParent` property will force a reflow and re-evaluate the CSS animation.\r\n\t// https://gist.github.com/paulirish/5d52fb081b3570c81e3a#box-metrics\r\n\t// https://github.com/chartjs/Chart.js/issues/4737\r\n\texpando.reflow = !!node.offsetParent;\r\n\r\n\tnode.classList.add(CSS_RENDER_MONITOR);\r\n}\r\n\r\nfunction unwatchForRender(node) {\r\n\tvar expando = node[EXPANDO_KEY] || {};\r\n\tvar proxy = expando.renderProxy;\r\n\r\n\tif (proxy) {\r\n\t\thelpers$1.each(ANIMATION_START_EVENTS, function(type) {\r\n\t\t\tremoveListener(node, type, proxy);\r\n\t\t});\r\n\r\n\t\tdelete expando.renderProxy;\r\n\t}\r\n\r\n\tnode.classList.remove(CSS_RENDER_MONITOR);\r\n}\r\n\r\nfunction addResizeListener(node, listener, chart) {\r\n\tvar expando = node[EXPANDO_KEY] || (node[EXPANDO_KEY] = {});\r\n\r\n\t// Let's keep track of this added resizer and thus avoid DOM query when removing it.\r\n\tvar resizer = expando.resizer = createResizer(throttled(function() {\r\n\t\tif (expando.resizer) {\r\n\t\t\tvar container = chart.options.maintainAspectRatio && node.parentNode;\r\n\t\t\tvar w = container ? container.clientWidth : 0;\r\n\t\t\tlistener(createEvent('resize', chart));\r\n\t\t\tif (container && container.clientWidth < w && chart.canvas) {\r\n\t\t\t\t// If the container size shrank during chart resize, let's assume\r\n\t\t\t\t// scrollbar appeared. So we resize again with the scrollbar visible -\r\n\t\t\t\t// effectively making chart smaller and the scrollbar hidden again.\r\n\t\t\t\t// Because we are inside `throttled`, and currently `ticking`, scroll\r\n\t\t\t\t// events are ignored during this whole 2 resize process.\r\n\t\t\t\t// If we assumed wrong and something else happened, we are resizing\r\n\t\t\t\t// twice in a frame (potential performance issue)\r\n\t\t\t\tlistener(createEvent('resize', chart));\r\n\t\t\t}\r\n\t\t}\r\n\t}));\r\n\r\n\t// The resizer needs to be attached to the node parent, so we first need to be\r\n\t// sure that `node` is attached to the DOM before injecting the resizer element.\r\n\twatchForRender(node, function() {\r\n\t\tif (expando.resizer) {\r\n\t\t\tvar container = node.parentNode;\r\n\t\t\tif (container && container !== resizer.parentNode) {\r\n\t\t\t\tcontainer.insertBefore(resizer, container.firstChild);\r\n\t\t\t}\r\n\r\n\t\t\t// The container size might have changed, let's reset the resizer state.\r\n\t\t\tresizer._reset();\r\n\t\t}\r\n\t});\r\n}\r\n\r\nfunction removeResizeListener(node) {\r\n\tvar expando = node[EXPANDO_KEY] || {};\r\n\tvar resizer = expando.resizer;\r\n\r\n\tdelete expando.resizer;\r\n\tunwatchForRender(node);\r\n\r\n\tif (resizer && resizer.parentNode) {\r\n\t\tresizer.parentNode.removeChild(resizer);\r\n\t}\r\n}\r\n\r\n/**\r\n * Injects CSS styles inline if the styles are not already present.\r\n * @param {HTMLDocument|ShadowRoot} rootNode - the node to contain the