From b555c151dc9bb1e380d2c4e4094ee2f2ba4437cd Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 21 Nov 2020 15:24:45 +0100 Subject: [PATCH] static: close modal on escape key --- passbook/static/static/passbook/main.js | 155 ++++++++++---------- passbook/static/static/passbook/main.js.map | 2 +- passbook/static/static/src/ModalButton.ts | 9 ++ passbook/static/static/src/main.ts | 8 +- 4 files changed, 92 insertions(+), 82 deletions(-) diff --git a/passbook/static/static/passbook/main.js b/passbook/static/static/passbook/main.js index 2df1dd81d..e7e310b92 100644 --- a/passbook/static/static/passbook/main.js +++ b/passbook/static/static/passbook/main.js @@ -1,4 +1,4 @@ -document.querySelectorAll("input[type=search]").forEach((t=>{t.addEventListener("search",(e=>{""===t.value&&t.parentElement.submit()}))})),document.querySelectorAll("[data-pb-fetch-fill]").forEach((t=>{const e=t.dataset.pbFetchFill,n=t.dataset.pbFetchKey;fetch(e).then((t=>t.json())).then((e=>{t.textContent=e[n],t.value=e[n]}))})),document.querySelectorAll("[data-target='modal']").forEach((t=>{t.addEventListener("click",(t=>{const e=t.target.closest('[data-target="modal"]').attributes["data-modal"].value;document.querySelector("#"+e).removeAttribute("hidden")}))})),document.querySelectorAll(".pf-c-modal-box [data-modal-close]").forEach((t=>{t.addEventListener("click",(t=>{t.target.closest(".pf-c-backdrop").setAttribute("hidden",!0)}))})),document.querySelectorAll(".pf-c-check__label").forEach((t=>{t.addEventListener("click",(t=>{const e=t.target.parentElement.querySelector("input[type=checkbox]");e.checked=!e.checked}))})),document.querySelectorAll(".codemirror").forEach((t=>{let e="xml";"data-cm-mode"in t.attributes&&(e=t.attributes["data-cm-mode"].value),t.removeAttribute("required"),CodeMirror.fromTextArea(t,{mode:e,theme:"monokai",lineNumbers:!1,readOnly:t.readOnly,autoRefresh:!0})})); +document.querySelectorAll("input[type=search]").forEach((e=>{e.addEventListener("search",(t=>{""===e.value&&e.parentElement.submit()}))})),document.querySelectorAll("[data-pb-fetch-fill]").forEach((e=>{const t=e.dataset.pbFetchFill,n=e.dataset.pbFetchKey;fetch(t).then((e=>e.json())).then((t=>{e.textContent=t[n],e.value=t[n]}))})),document.querySelectorAll("[data-target='modal']").forEach((e=>{e.addEventListener("click",(e=>{const t=e.target.closest('[data-target="modal"]').attributes["data-modal"].value;document.querySelector("#"+t).removeAttribute("hidden")}))})),document.querySelectorAll(".pf-c-modal-box [data-modal-close]").forEach((e=>{e.addEventListener("click",(e=>{e.target.closest(".pf-c-backdrop").setAttribute("hidden",!0)}))})),document.querySelectorAll(".pf-c-check__label").forEach((e=>{e.addEventListener("click",(e=>{const t=e.target.parentElement.querySelector("input[type=checkbox]");t.checked=!t.checked}))})); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -13,20 +13,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -function t(t,e,n,i){var r,a=arguments.length,o=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(o=(a<3?r(o):a>3?r(e,n,o):r(e,n))||o);return a>3&&o&&Object.defineProperty(e,n,o),o -/** - * @license - * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. - * This code may only be used under the BSD style license found at - * http://polymer.github.io/LICENSE.txt - * The complete set of authors may be found at - * http://polymer.github.io/AUTHORS.txt - * The complete set of contributors may be found at - * http://polymer.github.io/CONTRIBUTORS.txt - * Code distributed by Google as part of the polymer project is also - * subject to an additional IP rights grant found at - * http://polymer.github.io/PATENTS.txt - */}document.querySelectorAll("input[name=name]").forEach((t=>{t.addEventListener("input",(t=>{const e=t.target.closest("form");if(null===e)return;e.querySelector("input[name=slug]").value=t.target.value.toLowerCase().replace(/ /g,"-").replace(/[^\w-]+/g,"")}))})),document.querySelectorAll(".pf-c-page__header-brand-toggle>button").forEach((t=>{t.addEventListener("click",(t=>{const e=document.querySelector(".pf-c-page__sidebar");e.classList.contains("pf-m-expanded")?(e.classList.remove("pf-m-expanded"),e.style.zIndex=0):(e.classList.add("pf-m-expanded"),e.style.zIndex=200)}))})),document.querySelectorAll(".pf-m-expandable>.pf-c-nav__link").forEach((t=>{t.addEventListener("click",(e=>{e.preventDefault(),t.parentElement.classList.toggle("pf-m-expanded")}))}));const e="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,n=(t,e,n=null)=>{for(;e!==n;){const n=e.nextSibling;t.removeChild(e),e=n}},i=`{{lit-${String(Math.random()).slice(2)}}}`,r=`\x3c!--${i}--\x3e`,a=new RegExp(`${i}|${r}`);class o{constructor(t,e){this.parts=[],this.element=e;const n=[],r=[],o=document.createTreeWalker(e.content,133,null,!1);let l=0,u=-1,h=0;const{strings:f,values:{length:p}}=t;for(;h0;){const e=f[h],n=c.exec(e)[2],i=n.toLowerCase()+"$lit$",r=t.getAttribute(i);t.removeAttribute(i);const o=r.split(a);this.parts.push({type:"attribute",index:u,name:n,strings:o}),h+=o.length-1}}"TEMPLATE"===t.tagName&&(r.push(t),o.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(i)>=0){const i=t.parentNode,r=e.split(a),o=r.length-1;for(let e=0;e{const n=t.length-e.length;return n>=0&&t.slice(n)===e},l=t=>-1!==t.index,d=()=>document.createComment(""),c=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function u(t,e){const{element:{content:n},parts:i}=t,r=document.createTreeWalker(n,133,null,!1);let a=f(i),o=i[a],s=-1,l=0;const d=[];let c=null;for(;r.nextNode();){s++;const t=r.currentNode;for(t.previousSibling===c&&(c=null),e.has(t)&&(d.push(t),null===c&&(c=t)),null!==c&&l++;void 0!==o&&o.index===s;)o.index=null!==c?-1:o.index-l,a=f(i,a),o=i[a]}d.forEach((t=>t.parentNode.removeChild(t)))}const h=t=>{let e=11===t.nodeType?0:1;const n=document.createTreeWalker(t,133,null,!1);for(;n.nextNode();)e++;return e},f=(t,e=-1)=>{for(let n=e+1;n=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}document.querySelectorAll("input[name=name]").forEach((e=>{e.addEventListener("input",(e=>{const t=e.target.closest("form");if(null===t)return;t.querySelector("input[name=slug]").value=e.target.value.toLowerCase().replace(/ /g,"-").replace(/[^\w-]+/g,"")}))})),document.querySelectorAll(".pf-c-page__header-brand-toggle>button").forEach((e=>{e.addEventListener("click",(e=>{const t=document.querySelector(".pf-c-page__sidebar");t.classList.contains("pf-m-expanded")?(t.classList.remove("pf-m-expanded"),t.style.zIndex=0):(t.classList.add("pf-m-expanded"),t.style.zIndex=200)}))})),document.querySelectorAll(".pf-m-expandable>.pf-c-nav__link").forEach((e=>{e.addEventListener("click",(t=>{t.preventDefault(),e.parentElement.classList.toggle("pf-m-expanded")}))})); /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -40,7 +27,7 @@ function t(t,e,n,i){var r,a=arguments.length,o=a<3?e:null===i?i=Object.getOwnPro * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -const p=new WeakMap,g=t=>"function"==typeof t&&p.has(t),m={},v={}; +const t="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,n=(e,t,n=null)=>{for(;t!==n;){const n=t.nextSibling;e.removeChild(t),t=n}},r=`{{lit-${String(Math.random()).slice(2)}}}`,i=`\x3c!--${r}--\x3e`,o=new RegExp(`${r}|${i}`);class a{constructor(e,t){this.parts=[],this.element=t;const n=[],i=[],a=document.createTreeWalker(t.content,133,null,!1);let l=0,d=-1,h=0;const{strings:f,values:{length:p}}=e;for(;h0;){const t=f[h],n=u.exec(t)[2],r=n.toLowerCase()+"$lit$",i=e.getAttribute(r);e.removeAttribute(r);const a=i.split(o);this.parts.push({type:"attribute",index:d,name:n,strings:a}),h+=a.length-1}}"TEMPLATE"===e.tagName&&(i.push(e),a.currentNode=e.content)}else if(3===e.nodeType){const t=e.data;if(t.indexOf(r)>=0){const r=e.parentNode,i=t.split(o),a=i.length-1;for(let t=0;t{const n=e.length-t.length;return n>=0&&e.slice(n)===t},l=e=>-1!==e.index,c=()=>document.createComment(""),u=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function d(e,t){const{element:{content:n},parts:r}=e,i=document.createTreeWalker(n,133,null,!1);let o=f(r),a=r[o],s=-1,l=0;const c=[];let u=null;for(;i.nextNode();){s++;const e=i.currentNode;for(e.previousSibling===u&&(u=null),t.has(e)&&(c.push(e),null===u&&(u=e)),null!==u&&l++;void 0!==a&&a.index===s;)a.index=null!==u?-1:a.index-l,o=f(r,o),a=r[o]}c.forEach((e=>e.parentNode.removeChild(e)))}const h=e=>{let t=11===e.nodeType?0:1;const n=document.createTreeWalker(e,133,null,!1);for(;n.nextNode();)t++;return t},f=(e,t=-1)=>{for(let n=t+1;n"function"==typeof t&&p.has(t),m={},v={}; * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -class b{constructor(t,e,n){this.__parts=[],this.template=t,this.processor=e,this.options=n}update(t){let e=0;for(const n of this.__parts)void 0!==n&&n.setValue(t[e]),e++;for(const t of this.__parts)void 0!==t&&t.commit()}_clone(){const t=e?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),n=[],i=this.template.parts,r=document.createTreeWalker(t,133,null,!1);let a,o=0,s=0,d=r.nextNode();for(;ot}),_=` ${i} `;class x{constructor(t,e,n,i){this.strings=t,this.values=e,this.type=n,this.processor=i}getHTML(){const t=this.strings.length-1;let e="",n=!1;for(let a=0;a-1||n)&&-1===t.indexOf("--\x3e",o+1);const s=c.exec(t);e+=null===s?t+(n?_:r):t.substr(0,s.index)+s[1]+s[2]+"$lit$"+s[3]+i}return e+=this.strings[t],e}getTemplateElement(){const t=document.createElement("template");let e=this.getHTML();return void 0!==y&&(e=y.createHTML(e)),t.innerHTML=e,t}} -/** - * @license - * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. - * This code may only be used under the BSD style license found at - * http://polymer.github.io/LICENSE.txt - * The complete set of authors may be found at - * http://polymer.github.io/AUTHORS.txt - * The complete set of contributors may be found at - * http://polymer.github.io/CONTRIBUTORS.txt - * Code distributed by Google as part of the polymer project is also - * subject to an additional IP rights grant found at - * http://polymer.github.io/PATENTS.txt - */const w=t=>null===t||!("object"==typeof t||"function"==typeof t),k=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class S{constructor(t,e,n){this.dirty=!0,this.element=t,this.name=e,this.strings=n,this.parts=[];for(let t=0;t{try{const t={get capture(){return A=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();class O{constructor(t,e,n){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=n,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;g(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=m,t(this)}if(this.__pendingValue===m)return;const t=this.__pendingValue,e=this.value,n=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),i=null!=t&&(null==e||n);n&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=N(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=m}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const N=t=>t&&(A?{capture:t.capture,passive:t.passive,once:t.once}:t.capture) -/** - * @license - * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. - * This code may only be used under the BSD style license found at - * http://polymer.github.io/LICENSE.txt - * The complete set of authors may be found at - * http://polymer.github.io/AUTHORS.txt - * The complete set of contributors may be found at - * http://polymer.github.io/CONTRIBUTORS.txt - * Code distributed by Google as part of the polymer project is also - * subject to an additional IP rights grant found at - * http://polymer.github.io/PATENTS.txt - */;function F(t){let e=R.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},R.set(t.type,e));let n=e.stringsArray.get(t.strings);if(void 0!==n)return n;const r=t.strings.join(i);return n=e.keyString.get(r),void 0===n&&(n=new o(t,t.getTemplateElement()),e.keyString.set(r,n)),e.stringsArray.set(t.strings,n),n}const R=new Map,L=new WeakMap; -/** - * @license - * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. - * This code may only be used under the BSD style license found at - * http://polymer.github.io/LICENSE.txt - * The complete set of authors may be found at - * http://polymer.github.io/AUTHORS.txt - * The complete set of contributors may be found at - * http://polymer.github.io/CONTRIBUTORS.txt - * Code distributed by Google as part of the polymer project is also - * subject to an additional IP rights grant found at - * http://polymer.github.io/PATENTS.txt - */const I=new +const p=new WeakMap,g=e=>"function"==typeof e&&p.has(e),m={},v={}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -120,7 +55,7 @@ class b{constructor(t,e,n){this.__parts=[],this.template=t,this.processor=e,this * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -class{handleAttributeExpressions(t,e,n,i){const r=e[0];if("."===r){return new P(t,e.slice(1),n).parts}if("@"===r)return[new O(t,e.slice(1),i.eventContext)];if("?"===r)return[new D(t,e.slice(1),n)];return new S(t,e,n).parts}handleTextExpression(t){return new C(t)}}; +class y{constructor(e,t,n){this.__parts=[],this.template=e,this.processor=t,this.options=n}update(e){let t=0;for(const n of this.__parts)void 0!==n&&n.setValue(e[t]),t++;for(const e of this.__parts)void 0!==e&&e.commit()}_clone(){const e=t?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),n=[],r=this.template.parts,i=document.createTreeWalker(e,133,null,!1);let o,a=0,s=0,c=i.nextNode();for(;anew x(t,e,"html",I) + */const b=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:e=>e}),x=` ${r} `;class w{constructor(e,t,n,r){this.strings=e,this.values=t,this.type=n,this.processor=r}getHTML(){const e=this.strings.length-1;let t="",n=!1;for(let o=0;o-1||n)&&-1===e.indexOf("--\x3e",a+1);const s=u.exec(e);t+=null===s?e+(n?x:i):e.substr(0,s.index)+s[1]+s[2]+"$lit$"+s[3]+r}return t+=this.strings[e],t}getTemplateElement(){const e=document.createElement("template");let t=this.getHTML();return void 0!==b&&(t=b.createHTML(t)),e.innerHTML=t,e}} /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -146,7 +81,33 @@ class{handleAttributeExpressions(t,e,n,i){const r=e[0];if("."===r){return new P( * Code distributed by Google as part of the polymer project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt - */,W=(t,e)=>`${t}--${e}`;let Y=!0;void 0===window.ShadyCSS?Y=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),Y=!1);const V=t=>e=>{const n=W(e.type,t);let r=R.get(n);void 0===r&&(r={stringsArray:new WeakMap,keyString:new Map},R.set(n,r));let a=r.stringsArray.get(e.strings);if(void 0!==a)return a;const s=e.strings.join(i);if(a=r.keyString.get(s),void 0===a){const n=e.getTemplateElement();Y&&window.ShadyCSS.prepareTemplateDom(n,t),a=new o(e,n),r.keyString.set(s,a)}return r.stringsArray.set(e.strings,a),a},z=["html","svg"],B=new Set,H=(t,e,n)=>{B.add(t);const i=n?n.element:document.createElement("template"),r=e.querySelectorAll("style"),{length:a}=r;if(0===a)return void window.ShadyCSS.prepareTemplateStyles(i,t);const o=document.createElement("style");for(let t=0;t{z.forEach((e=>{const n=R.get(W(e,t));void 0!==n&&n.keyString.forEach((t=>{const{element:{content:e}}=t,n=new Set;Array.from(e.querySelectorAll("style")).forEach((t=>{n.add(t)})),u(t,n)}))}))})(t);const s=i.content;n?function(t,e,n=null){const{element:{content:i},parts:r}=t;if(null==n)return void i.appendChild(e);const a=document.createTreeWalker(i,133,null,!1);let o=f(r),s=0,l=-1;for(;a.nextNode();)for(l++,a.currentNode===n&&(s=h(e),n.parentNode.insertBefore(e,n));-1!==o&&r[o].index===l;){if(s>0){for(;-1!==o;)r[o].index+=s,o=f(r,o);return}o=f(r,o)}}(n,o,s.firstChild):s.insertBefore(o,s.firstChild),window.ShadyCSS.prepareTemplateStyles(i,t);const l=s.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)e.insertBefore(l.cloneNode(!0),e.firstChild);else if(n){s.insertBefore(o,s.firstChild);const t=new Set;t.add(o),u(n,t)}};window.JSCompiler_renameProperty=(t,e)=>t;const U={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return null!==t;case Number:return null===t?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},j=(t,e)=>e!==t&&(e==e||t==t),q={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:j};class G extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach(((e,n)=>{const i=this._attributeNameForProperty(n,e);void 0!==i&&(this._attributeToPropertyMap.set(i,n),t.push(i))})),t}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach(((t,e)=>this._classProperties.set(e,t)))}}static createProperty(t,e=q){if(this._ensureClassProperties(),this._classProperties.set(t,e),e.noAccessor||this.prototype.hasOwnProperty(t))return;const n="symbol"==typeof t?Symbol():"__"+t,i=this.getPropertyDescriptor(t,n,e);void 0!==i&&Object.defineProperty(this.prototype,t,i)}static getPropertyDescriptor(t,e,n){return{get(){return this[e]},set(i){const r=this[t];this[e]=i,this.requestUpdateInternal(t,r,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this._classProperties&&this._classProperties.get(t)||q}static finalize(){const t=Object.getPrototypeOf(this);if(t.hasOwnProperty("finalized")||t.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const t=this.properties,e=[...Object.getOwnPropertyNames(t),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]];for(const n of e)this.createProperty(n,t[n])}}static _attributeNameForProperty(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}static _valueHasChanged(t,e,n=j){return n(t,e)}static _propertyValueFromAttribute(t,e){const n=e.type,i=e.converter||U,r="function"==typeof i?i:i.fromAttribute;return r?r(t,n):t}static _propertyValueToAttribute(t,e){if(void 0===e.reflect)return;const n=e.type,i=e.converter;return(i&&i.toAttribute||U.toAttribute)(t,n)}initialize(){this._updateState=0,this._updatePromise=new Promise((t=>this._enableUpdatingResolver=t)),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach(((t,e)=>{if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(e,t)}}))}_applyInstanceProperties(){this._instanceProperties.forEach(((t,e)=>this[e]=t)),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(t,e,n){e!==n&&this._attributeToProperty(t,n)}_propertyToAttribute(t,e,n=q){const i=this.constructor,r=i._attributeNameForProperty(t,n);if(void 0!==r){const t=i._propertyValueToAttribute(e,n);if(void 0===t)return;this._updateState=8|this._updateState,null==t?this.removeAttribute(r):this.setAttribute(r,t),this._updateState=-9&this._updateState}}_attributeToProperty(t,e){if(8&this._updateState)return;const n=this.constructor,i=n._attributeToPropertyMap.get(t);if(void 0!==i){const t=n.getPropertyOptions(i);this._updateState=16|this._updateState,this[i]=n._propertyValueFromAttribute(e,t),this._updateState=-17&this._updateState}}requestUpdateInternal(t,e,n){let i=!0;if(void 0!==t){const r=this.constructor;n=n||r.getPropertyOptions(t),r._valueHasChanged(this[t],e,n.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==n.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,n))):i=!1}!this._hasRequestedUpdate&&i&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(t,e){return this.requestUpdateInternal(t,e),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(t){}const t=this.performUpdate();return null!=t&&await t,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let t=!1;const e=this._changedProperties;try{t=this.shouldUpdate(e),t?this.update(e):this._markUpdated()}catch(e){throw t=!1,this._markUpdated(),e}t&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(e)),this.updated(e))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(t){return!0}update(t){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach(((t,e)=>this._propertyToAttribute(e,this[e],t))),this._reflectingProperties=void 0),this._markUpdated()}updated(t){}firstUpdated(t){}}G.finalized=!0; + */const _=e=>null===e||!("object"==typeof e||"function"==typeof e),k=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class S{constructor(e,t,n){this.dirty=!0,this.element=e,this.name=t,this.strings=n,this.parts=[];for(let e=0;e{try{const e={get capture(){return P=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}})();class A{constructor(e,t,n){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=n,this.__boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;g(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=m,e(this)}if(this.__pendingValue===m)return;const e=this.__pendingValue,t=this.value,n=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),r=null!=e&&(null==t||n);n&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),r&&(this.__options=O(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=m}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const O=e=>e&&(P?{capture:e.capture,passive:e.passive,once:e.once}:e.capture) +/** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */;function N(e){let t=F.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},F.set(e.type,t));let n=t.stringsArray.get(e.strings);if(void 0!==n)return n;const i=e.strings.join(r);return n=t.keyString.get(i),void 0===n&&(n=new a(e,e.getTemplateElement()),t.keyString.set(i,n)),t.stringsArray.set(e.strings,n),n}const F=new Map,I=new WeakMap; +/** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */const R=new /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -160,7 +121,47 @@ class{handleAttributeExpressions(t,e,n,i){const r=e[0];if("."===r){return new P( * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -const $=t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:n,elements:i}=e;return{kind:n,elements:i,finisher(e){window.customElements.define(t,e)}}})(t,e),Z=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?Object.assign(Object.assign({},e),{finisher(n){n.createProperty(e.key,t)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(n){n.createProperty(e.key,t)}};function X(t){return(e,n)=>void 0!==n?((t,e,n)=>{e.constructor.createProperty(n,t)})(t,e,n):Z(t,e)} +class{handleAttributeExpressions(e,t,n,r){const i=t[0];if("."===i){return new D(e,t.slice(1),n).parts}if("@"===i)return[new A(e,t.slice(1),r.eventContext)];if("?"===i)return[new T(e,t.slice(1),n)];return new S(e,t,n).parts}handleTextExpression(e){return new C(e)}}; +/** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");const W=(e,...t)=>new w(e,t,"html",R) +/** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */,E=(e,t)=>`${e}--${t}`;let z=!0;void 0===window.ShadyCSS?z=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),z=!1);const H=e=>t=>{const n=E(t.type,e);let i=F.get(n);void 0===i&&(i={stringsArray:new WeakMap,keyString:new Map},F.set(n,i));let o=i.stringsArray.get(t.strings);if(void 0!==o)return o;const s=t.strings.join(r);if(o=i.keyString.get(s),void 0===o){const n=t.getTemplateElement();z&&window.ShadyCSS.prepareTemplateDom(n,e),o=new a(t,n),i.keyString.set(s,o)}return i.stringsArray.set(t.strings,o),o},B=["html","svg"],V=new Set,Y=(e,t,n)=>{V.add(e);const r=n?n.element:document.createElement("template"),i=t.querySelectorAll("style"),{length:o}=i;if(0===o)return void window.ShadyCSS.prepareTemplateStyles(r,e);const a=document.createElement("style");for(let e=0;e{B.forEach((t=>{const n=F.get(E(t,e));void 0!==n&&n.keyString.forEach((e=>{const{element:{content:t}}=e,n=new Set;Array.from(t.querySelectorAll("style")).forEach((e=>{n.add(e)})),d(e,n)}))}))})(e);const s=r.content;n?function(e,t,n=null){const{element:{content:r},parts:i}=e;if(null==n)return void r.appendChild(t);const o=document.createTreeWalker(r,133,null,!1);let a=f(i),s=0,l=-1;for(;o.nextNode();)for(l++,o.currentNode===n&&(s=h(t),n.parentNode.insertBefore(t,n));-1!==a&&i[a].index===l;){if(s>0){for(;-1!==a;)i[a].index+=s,a=f(i,a);return}a=f(i,a)}}(n,a,s.firstChild):s.insertBefore(a,s.firstChild),window.ShadyCSS.prepareTemplateStyles(r,e);const l=s.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)t.insertBefore(l.cloneNode(!0),t.firstChild);else if(n){s.insertBefore(a,s.firstChild);const e=new Set;e.add(a),d(n,e)}};window.JSCompiler_renameProperty=(e,t)=>e;const U={toAttribute(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){switch(t){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},j=(e,t)=>t!==e&&(t==t||e==e),G={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:j};class q extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const e=[];return this._classProperties.forEach(((t,n)=>{const r=this._attributeNameForProperty(n,t);void 0!==r&&(this._attributeToPropertyMap.set(r,n),e.push(r))})),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const e=Object.getPrototypeOf(this)._classProperties;void 0!==e&&e.forEach(((e,t)=>this._classProperties.set(t,e)))}}static createProperty(e,t=G){if(this._ensureClassProperties(),this._classProperties.set(e,t),t.noAccessor||this.prototype.hasOwnProperty(e))return;const n="symbol"==typeof e?Symbol():"__"+e,r=this.getPropertyDescriptor(e,n,t);void 0!==r&&Object.defineProperty(this.prototype,e,r)}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(r){const i=this[e];this[t]=r,this.requestUpdateInternal(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this._classProperties&&this._classProperties.get(e)||G}static finalize(){const e=Object.getPrototypeOf(this);if(e.hasOwnProperty("finalized")||e.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const e=this.properties,t=[...Object.getOwnPropertyNames(e),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]];for(const n of t)this.createProperty(n,e[n])}}static _attributeNameForProperty(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}static _valueHasChanged(e,t,n=j){return n(e,t)}static _propertyValueFromAttribute(e,t){const n=t.type,r=t.converter||U,i="function"==typeof r?r:r.fromAttribute;return i?i(e,n):e}static _propertyValueToAttribute(e,t){if(void 0===t.reflect)return;const n=t.type,r=t.converter;return(r&&r.toAttribute||U.toAttribute)(e,n)}initialize(){this._updateState=0,this._updatePromise=new Promise((e=>this._enableUpdatingResolver=e)),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach(((e,t)=>{if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(t,e)}}))}_applyInstanceProperties(){this._instanceProperties.forEach(((e,t)=>this[t]=e)),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(e,t,n){t!==n&&this._attributeToProperty(e,n)}_propertyToAttribute(e,t,n=G){const r=this.constructor,i=r._attributeNameForProperty(e,n);if(void 0!==i){const e=r._propertyValueToAttribute(t,n);if(void 0===e)return;this._updateState=8|this._updateState,null==e?this.removeAttribute(i):this.setAttribute(i,e),this._updateState=-9&this._updateState}}_attributeToProperty(e,t){if(8&this._updateState)return;const n=this.constructor,r=n._attributeToPropertyMap.get(e);if(void 0!==r){const e=n.getPropertyOptions(r);this._updateState=16|this._updateState,this[r]=n._propertyValueFromAttribute(t,e),this._updateState=-17&this._updateState}}requestUpdateInternal(e,t,n){let r=!0;if(void 0!==e){const i=this.constructor;n=n||i.getPropertyOptions(e),i._valueHasChanged(this[e],t,n.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,t),!0!==n.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,n))):r=!1}!this._hasRequestedUpdate&&r&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(e,t){return this.requestUpdateInternal(e,t),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(e){}const e=this.performUpdate();return null!=e&&await e,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let e=!1;const t=this._changedProperties;try{e=this.shouldUpdate(t),e?this.update(t):this._markUpdated()}catch(t){throw e=!1,this._markUpdated(),t}e&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(t)),this.updated(t))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach(((e,t)=>this._propertyToAttribute(t,this[t],e))),this._reflectingProperties=void 0),this._markUpdated()}updated(e){}firstUpdated(e){}}q.finalized=!0; +/** + * @license + * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. + * This code may only be used under the BSD style license found at + * http://polymer.github.io/LICENSE.txt + * The complete set of authors may be found at + * http://polymer.github.io/AUTHORS.txt + * The complete set of contributors may be found at + * http://polymer.github.io/CONTRIBUTORS.txt + * Code distributed by Google as part of the polymer project is also + * subject to an additional IP rights grant found at + * http://polymer.github.io/PATENTS.txt + */ +const $=e=>t=>"function"==typeof t?((e,t)=>(window.customElements.define(e,t),t))(e,t):((e,t)=>{const{kind:n,elements:r}=t;return{kind:n,elements:r,finisher(t){window.customElements.define(e,t)}}})(e,t),K=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?Object.assign(Object.assign({},t),{finisher(n){n.createProperty(t.key,e)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(n){n.createProperty(t.key,e)}};function Z(e){return(t,n)=>void 0!==n?((e,t,n)=>{t.constructor.createProperty(n,e)})(e,t,n):K(e,t)} /** @license Copyright (c) 2019 The Polymer Project Authors. All rights reserved. @@ -170,7 +171,7 @@ http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt -*/const J=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,K=Symbol();class Q{constructor(t,e){if(e!==K)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){return void 0===this._styleSheet&&(J?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const tt=(t,...e)=>{const n=e.reduce(((e,n,i)=>e+(t=>{if(t instanceof Q)return t.cssText;if("number"==typeof t)return t;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${t}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(n)+t[i+1]),t[0]);return new Q(n,K)}; +*/const X=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,J=Symbol();class Q{constructor(e,t){if(t!==J)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return void 0===this._styleSheet&&(X?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const ee=(e,...t)=>{const n=t.reduce(((t,n,r)=>t+(e=>{if(e instanceof Q)return e.cssText;if("number"==typeof e)return e;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${e}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(n)+e[r+1]),e[0]);return new Q(n,J)}; /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -184,14 +185,14 @@ found at http://polymer.github.io/PATENTS.txt * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");const et={};class nt extends G{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const t=this.getStyles();if(Array.isArray(t)){const e=(t,n)=>t.reduceRight(((t,n)=>Array.isArray(n)?e(n,t):(t.add(n),t)),n),n=e(t,new Set),i=[];n.forEach((t=>i.unshift(t))),this._styles=i}else this._styles=void 0===t?[]:[t];this._styles=this._styles.map((t=>{if(t instanceof CSSStyleSheet&&!J){const e=Array.prototype.slice.call(t.cssRules).reduce(((t,e)=>t+e.cssText),"");return new Q(String(e),K)}return t}))}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?J?this.renderRoot.adoptedStyleSheets=t.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map((t=>t.cssText)),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){const e=this.render();super.update(t),e!==et&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)})))}render(){return et}}nt.finalized=!0,nt.render=(t,e,i)=>{if(!i||"object"!=typeof i||!i.scopeName)throw new Error("The `scopeName` option is required.");const r=i.scopeName,a=L.has(e),o=Y&&11===e.nodeType&&!!e.host,s=o&&!B.has(r),l=s?document.createDocumentFragment():e;if(((t,e,i)=>{let r=L.get(e);void 0===r&&(n(e,e.firstChild),L.set(e,r=new C(Object.assign({templateFactory:F},i))),r.appendInto(e)),r.setValue(t),r.commit()})(t,l,Object.assign({templateFactory:V(r)},i)),s){const t=L.get(l);L.delete(l);const i=t.value instanceof b?t.value.template:void 0;H(r,l,i),n(e,e.firstChild),e.appendChild(l),L.set(e,t)}!a&&o&&window.ShadyCSS.styleElement(e.host)};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function it(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function rt(t,e){return t(e={exports:{}},e.exports),e.exports}var at=rt((function(t,e){t.exports=function(){var e,n;function i(){return e.apply(null,arguments)}function r(t){e=t}function a(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function o(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function s(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function l(t){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(t).length;var e;for(e in t)if(s(t,e))return!1;return!0}function d(t){return void 0===t}function c(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function u(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function h(t,e){var n,i=[];for(n=0;n>>0;for(e=0;e0)for(n=0;n=0?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+i}var I=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,E=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,W={},Y={};function V(t,e,n,i){var r=i;"string"==typeof i&&(r=function(){return this[i]()}),t&&(Y[t]=r),e&&(Y[e[0]]=function(){return L(r.apply(this,arguments),e[1],e[2])}),n&&(Y[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),t)})}function z(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function B(t){var e,n,i=t.match(I);for(e=0,n=i.length;e=0&&E.test(t);)t=t.replace(E,i),E.lastIndex=0,n-=1;return t}var j={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function q(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(I).map((function(t){return"MMMM"===t||"MM"===t||"DD"===t||"dddd"===t?t.slice(1):t})).join(""),this._longDateFormat[t])}var G="Invalid date";function $(){return this._invalidDate}var Z="%d",X=/\d{1,2}/;function J(t){return this._ordinal.replace("%d",t)}var K={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Q(t,e,n,i){var r=this._relativeTime[n];return T(r)?r(t,e,n,i):r.replace(/%d/i,t)}function tt(t,e){var n=this._relativeTime[t>0?"future":"past"];return T(n)?n(e):n.replace(/%s/i,e)}var et={};function nt(t,e){var n=t.toLowerCase();et[n]=et[n+"s"]=et[e]=t}function rt(t){return"string"==typeof t?et[t]||et[t.toLowerCase()]:void 0}function at(t){var e,n,i={};for(n in t)s(t,n)&&(e=rt(n))&&(i[e]=t[n]);return i}var ot={};function st(t,e){ot[t]=e}function lt(t){var e,n=[];for(e in t)s(t,e)&&n.push({unit:e,priority:ot[e]});return n.sort((function(t,e){return t.priority-e.priority})),n}function dt(t){return t%4==0&&t%100!=0||t%400==0}function ct(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function ut(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=ct(e)),n}function ht(t,e){return function(n){return null!=n?(pt(this,t,n),i.updateOffset(this,e),this):ft(this,t)}}function ft(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function pt(t,e,n){t.isValid()&&!isNaN(n)&&("FullYear"===e&&dt(t.year())&&1===t.month()&&29===t.date()?(n=ut(n),t._d["set"+(t._isUTC?"UTC":"")+e](n,t.month(),te(n,t.month()))):t._d["set"+(t._isUTC?"UTC":"")+e](n))}function gt(t){return T(this[t=rt(t)])?this[t]():this}function mt(t,e){if("object"==typeof t){var n,i=lt(t=at(t));for(n=0;n68?1900:2e3)};var ve=ht("FullYear",!0);function be(){return dt(this.year())}function ye(t,e,n,i,r,a,o){var s;return t<100&&t>=0?(s=new Date(t+400,e,n,i,r,a,o),isFinite(s.getFullYear())&&s.setFullYear(t)):s=new Date(t,e,n,i,r,a,o),s}function _e(t){var e,n;return t<100&&t>=0?((n=Array.prototype.slice.call(arguments))[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function xe(t,e,n){var i=7+e-n;return-(7+_e(t,0,i).getUTCDay()-e)%7+i-1}function we(t,e,n,i,r){var a,o,s=1+7*(e-1)+(7+n-i)%7+xe(t,i,r);return s<=0?o=me(a=t-1)+s:s>me(t)?(a=t+1,o=s-me(t)):(a=t,o=s),{year:a,dayOfYear:o}}function ke(t,e,n){var i,r,a=xe(t.year(),e,n),o=Math.floor((t.dayOfYear()-a-1)/7)+1;return o<1?i=o+Se(r=t.year()-1,e,n):o>Se(t.year(),e,n)?(i=o-Se(t.year(),e,n),r=t.year()+1):(r=t.year(),i=o),{week:i,year:r}}function Se(t,e,n){var i=xe(t,e,n),r=xe(t+1,e,n);return(me(t)-i+r)/7}function Me(t){return ke(t,this._week.dow,this._week.doy).week}V("w",["ww",2],"wo","week"),V("W",["WW",2],"Wo","isoWeek"),nt("week","w"),nt("isoWeek","W"),st("week",5),st("isoWeek",5),Lt("w",kt),Lt("ww",kt,yt),Lt("W",kt),Lt("WW",kt,yt),zt(["w","ww","W","WW"],(function(t,e,n,i){e[i.substr(0,1)]=ut(t)}));var Ce={dow:0,doy:6};function De(){return this._week.dow}function Pe(){return this._week.doy}function Te(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Ae(t){var e=ke(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function Oe(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}function Ne(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Fe(t,e){return t.slice(e,7).concat(t.slice(0,e))}V("d",0,"do","day"),V("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),V("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),V("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),V("e",0,0,"weekday"),V("E",0,0,"isoWeekday"),nt("day","d"),nt("weekday","e"),nt("isoWeekday","E"),st("day",11),st("weekday",11),st("isoWeekday",11),Lt("d",kt),Lt("e",kt),Lt("E",kt),Lt("dd",(function(t,e){return e.weekdaysMinRegex(t)})),Lt("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),Lt("dddd",(function(t,e){return e.weekdaysRegex(t)})),zt(["dd","ddd","dddd"],(function(t,e,n,i){var r=n._locale.weekdaysParse(t,i,n._strict);null!=r?e.d=r:m(n).invalidWeekday=t})),zt(["d","e","E"],(function(t,e,n,i){e[i]=ut(t)}));var Re="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Le="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ie="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ee=Rt,We=Rt,Ye=Rt;function Ve(t,e){var n=a(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?Fe(n,this._week.dow):t?n[t.day()]:n}function ze(t){return!0===t?Fe(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function Be(t){return!0===t?Fe(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function He(t,e,n){var i,r,a,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)a=p([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(a,"").toLocaleLowerCase();return n?"dddd"===e?-1!==(r=Ht.call(this._weekdaysParse,o))?r:null:"ddd"===e?-1!==(r=Ht.call(this._shortWeekdaysParse,o))?r:null:-1!==(r=Ht.call(this._minWeekdaysParse,o))?r:null:"dddd"===e?-1!==(r=Ht.call(this._weekdaysParse,o))||-1!==(r=Ht.call(this._shortWeekdaysParse,o))||-1!==(r=Ht.call(this._minWeekdaysParse,o))?r:null:"ddd"===e?-1!==(r=Ht.call(this._shortWeekdaysParse,o))||-1!==(r=Ht.call(this._weekdaysParse,o))||-1!==(r=Ht.call(this._minWeekdaysParse,o))?r:null:-1!==(r=Ht.call(this._minWeekdaysParse,o))||-1!==(r=Ht.call(this._weekdaysParse,o))||-1!==(r=Ht.call(this._shortWeekdaysParse,o))?r:null}function Ue(t,e,n){var i,r,a;if(this._weekdaysParseExact)return He.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(r=p([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[i]||(a="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[i]=new RegExp(a.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[i].test(t))return i;if(n&&"ddd"===e&&this._shortWeekdaysParse[i].test(t))return i;if(n&&"dd"===e&&this._minWeekdaysParse[i].test(t))return i;if(!n&&this._weekdaysParse[i].test(t))return i}}function je(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Oe(t,this.localeData()),this.add(t-e,"d")):e}function qe(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function Ge(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=Ne(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7}function $e(t){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Je.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=Ee),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function Ze(t){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Je.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=We),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Xe(t){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Je.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ye),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Je(){function t(t,e){return e.length-t.length}var e,n,i,r,a,o=[],s=[],l=[],d=[];for(e=0;e<7;e++)n=p([2e3,1]).day(e),i=Wt(this.weekdaysMin(n,"")),r=Wt(this.weekdaysShort(n,"")),a=Wt(this.weekdays(n,"")),o.push(i),s.push(r),l.push(a),d.push(i),d.push(r),d.push(a);o.sort(t),s.sort(t),l.sort(t),d.sort(t),this._weekdaysRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function Ke(){return this.hours()%12||12}function Qe(){return this.hours()||24}function tn(t,e){V(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function en(t,e){return e._meridiemParse}function nn(t){return"p"===(t+"").toLowerCase().charAt(0)}V("H",["HH",2],0,"hour"),V("h",["hh",2],0,Ke),V("k",["kk",2],0,Qe),V("hmm",0,0,(function(){return""+Ke.apply(this)+L(this.minutes(),2)})),V("hmmss",0,0,(function(){return""+Ke.apply(this)+L(this.minutes(),2)+L(this.seconds(),2)})),V("Hmm",0,0,(function(){return""+this.hours()+L(this.minutes(),2)})),V("Hmmss",0,0,(function(){return""+this.hours()+L(this.minutes(),2)+L(this.seconds(),2)})),tn("a",!0),tn("A",!1),nt("hour","h"),st("hour",13),Lt("a",en),Lt("A",en),Lt("H",kt),Lt("h",kt),Lt("k",kt),Lt("HH",kt,yt),Lt("hh",kt,yt),Lt("kk",kt,yt),Lt("hmm",St),Lt("hmmss",Mt),Lt("Hmm",St),Lt("Hmmss",Mt),Vt(["H","HH"],Gt),Vt(["k","kk"],(function(t,e,n){var i=ut(t);e[Gt]=24===i?0:i})),Vt(["a","A"],(function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t})),Vt(["h","hh"],(function(t,e,n){e[Gt]=ut(t),m(n).bigHour=!0})),Vt("hmm",(function(t,e,n){var i=t.length-2;e[Gt]=ut(t.substr(0,i)),e[$t]=ut(t.substr(i)),m(n).bigHour=!0})),Vt("hmmss",(function(t,e,n){var i=t.length-4,r=t.length-2;e[Gt]=ut(t.substr(0,i)),e[$t]=ut(t.substr(i,2)),e[Zt]=ut(t.substr(r)),m(n).bigHour=!0})),Vt("Hmm",(function(t,e,n){var i=t.length-2;e[Gt]=ut(t.substr(0,i)),e[$t]=ut(t.substr(i))})),Vt("Hmmss",(function(t,e,n){var i=t.length-4,r=t.length-2;e[Gt]=ut(t.substr(0,i)),e[$t]=ut(t.substr(i,2)),e[Zt]=ut(t.substr(r))}));var rn=/[ap]\.?m?\.?/i,an=ht("Hours",!0);function on(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var sn,ln={calendar:F,longDateFormat:j,invalidDate:G,ordinal:Z,dayOfMonthOrdinalParse:X,relativeTime:K,months:ee,monthsShort:ne,week:Ce,weekdays:Re,weekdaysMin:Ie,weekdaysShort:Le,meridiemParse:rn},dn={},cn={};function un(t,e){var n,i=Math.min(t.length,e.length);for(n=0;n0;){if(i=pn(r.slice(0,e).join("-")))return i;if(n&&n.length>=e&&un(r,n)>=e-1)break;e--}a++}return sn}function pn(e){var n=null;if(void 0===dn[e]&&t&&t.exports)try{n=sn._abbr,it(),gn(n)}catch(t){dn[e]=null}return dn[e]}function gn(t,e){var n;return t&&((n=d(e)?bn(t):mn(t,e))?sn=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),sn._abbr}function mn(t,e){if(null!==e){var n,i=ln;if(e.abbr=t,null!=dn[t])P("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=dn[t]._config;else if(null!=e.parentLocale)if(null!=dn[e.parentLocale])i=dn[e.parentLocale]._config;else{if(null==(n=pn(e.parentLocale)))return cn[e.parentLocale]||(cn[e.parentLocale]=[]),cn[e.parentLocale].push({name:t,config:e}),null;i=n._config}return dn[t]=new N(O(i,e)),cn[t]&&cn[t].forEach((function(t){mn(t.name,t.config)})),gn(t),dn[t]}return delete dn[t],null}function vn(t,e){if(null!=e){var n,i,r=ln;null!=dn[t]&&null!=dn[t].parentLocale?dn[t].set(O(dn[t]._config,e)):(null!=(i=pn(t))&&(r=i._config),e=O(r,e),null==i&&(e.abbr=t),(n=new N(e)).parentLocale=dn[t],dn[t]=n),gn(t)}else null!=dn[t]&&(null!=dn[t].parentLocale?(dn[t]=dn[t].parentLocale,t===gn()&&gn(t)):null!=dn[t]&&delete dn[t]);return dn[t]}function bn(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return sn;if(!a(t)){if(e=pn(t))return e;t=[t]}return fn(t)}function yn(){return C(dn)}function _n(t){var e,n=t._a;return n&&-2===m(t).overflow&&(e=n[jt]<0||n[jt]>11?jt:n[qt]<1||n[qt]>te(n[Ut],n[jt])?qt:n[Gt]<0||n[Gt]>24||24===n[Gt]&&(0!==n[$t]||0!==n[Zt]||0!==n[Xt])?Gt:n[$t]<0||n[$t]>59?$t:n[Zt]<0||n[Zt]>59?Zt:n[Xt]<0||n[Xt]>999?Xt:-1,m(t)._overflowDayOfYear&&(eqt)&&(e=qt),m(t)._overflowWeeks&&-1===e&&(e=Jt),m(t)._overflowWeekday&&-1===e&&(e=Kt),m(t).overflow=e),t}var xn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,wn=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,kn=/Z|[+-]\d\d(?::?\d\d)?/,Sn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Mn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Cn=/^\/?Date\((-?\d+)/i,Dn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Pn={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Tn(t){var e,n,i,r,a,o,s=t._i,l=xn.exec(s)||wn.exec(s);if(l){for(m(t).iso=!0,e=0,n=Sn.length;eme(a)||0===t._dayOfYear)&&(m(t)._overflowDayOfYear=!0),n=_e(a,0,t._dayOfYear),t._a[jt]=n.getUTCMonth(),t._a[qt]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=o[e]=i[e];for(;e<7;e++)t._a[e]=o[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[Gt]&&0===t._a[$t]&&0===t._a[Zt]&&0===t._a[Xt]&&(t._nextDay=!0,t._a[Gt]=0),t._d=(t._useUTC?_e:ye).apply(null,o),r=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Gt]=24),t._w&&void 0!==t._w.d&&t._w.d!==r&&(m(t).weekdayMismatch=!0)}}function Vn(t){var e,n,i,r,a,o,s,l,d;null!=(e=t._w).GG||null!=e.W||null!=e.E?(a=1,o=4,n=En(e.GG,t._a[Ut],ke(Zn(),1,4).year),i=En(e.W,1),((r=En(e.E,1))<1||r>7)&&(l=!0)):(a=t._locale._week.dow,o=t._locale._week.doy,d=ke(Zn(),a,o),n=En(e.gg,t._a[Ut],d.year),i=En(e.w,d.week),null!=e.d?((r=e.d)<0||r>6)&&(l=!0):null!=e.e?(r=e.e+a,(e.e<0||e.e>6)&&(l=!0)):r=a),i<1||i>Se(n,a,o)?m(t)._overflowWeeks=!0:null!=l?m(t)._overflowWeekday=!0:(s=we(n,i,r,a,o),t._a[Ut]=s.year,t._dayOfYear=s.dayOfYear)}function zn(t){if(t._f!==i.ISO_8601)if(t._f!==i.RFC_2822){t._a=[],m(t).empty=!0;var e,n,r,a,o,s,l=""+t._i,d=l.length,c=0;for(r=U(t._f,t._locale).match(I)||[],e=0;e0&&m(t).unusedInput.push(o),l=l.slice(l.indexOf(n)+n.length),c+=n.length),Y[a]?(n?m(t).empty=!1:m(t).unusedTokens.push(a),Bt(a,n,t)):t._strict&&!n&&m(t).unusedTokens.push(a);m(t).charsLeftOver=d-c,l.length>0&&m(t).unusedInput.push(l),t._a[Gt]<=12&&!0===m(t).bigHour&&t._a[Gt]>0&&(m(t).bigHour=void 0),m(t).parsedDateParts=t._a.slice(0),m(t).meridiem=t._meridiem,t._a[Gt]=Bn(t._locale,t._a[Gt],t._meridiem),null!==(s=m(t).era)&&(t._a[Ut]=t._locale.erasConvertYear(s,t._a[Ut])),Yn(t),_n(t)}else Ln(t);else Tn(t)}function Bn(t,e,n){var i;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?((i=t.isPM(n))&&e<12&&(e+=12),i||12!==e||(e=0),e):e}function Hn(t){var e,n,i,r,a,o,s=!1;if(0===t._f.length)return m(t).invalidFormat=!0,void(t._d=new Date(NaN));for(r=0;rthis?this:t:b()}));function Kn(t,e){var n,i;if(1===e.length&&a(e[0])&&(e=e[0]),!e.length)return Zn();for(n=e[0],i=1;ithis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function wi(){if(!d(this._isDSTShifted))return this._isDSTShifted;var t,e={};return x(e,this),(e=qn(e))._a?(t=e._isUTC?p(e._a):Zn(e._a),this._isDSTShifted=this.isValid()&&di(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function ki(){return!!this.isValid()&&!this._isUTC}function Si(){return!!this.isValid()&&this._isUTC}function Mi(){return!!this.isValid()&&this._isUTC&&0===this._offset}i.updateOffset=function(){};var Ci=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Di=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Pi(t,e){var n,i,r,a=t,o=null;return si(t)?a={ms:t._milliseconds,d:t._days,M:t._months}:c(t)||!isNaN(+t)?(a={},e?a[e]=+t:a.milliseconds=+t):(o=Ci.exec(t))?(n="-"===o[1]?-1:1,a={y:0,d:ut(o[qt])*n,h:ut(o[Gt])*n,m:ut(o[$t])*n,s:ut(o[Zt])*n,ms:ut(li(1e3*o[Xt]))*n}):(o=Di.exec(t))?(n="-"===o[1]?-1:1,a={y:Ti(o[2],n),M:Ti(o[3],n),w:Ti(o[4],n),d:Ti(o[5],n),h:Ti(o[6],n),m:Ti(o[7],n),s:Ti(o[8],n)}):null==a?a={}:"object"==typeof a&&("from"in a||"to"in a)&&(r=Oi(Zn(a.from),Zn(a.to)),(a={}).ms=r.milliseconds,a.M=r.months),i=new oi(a),si(t)&&s(t,"_locale")&&(i._locale=t._locale),si(t)&&s(t,"_isValid")&&(i._isValid=t._isValid),i}function Ti(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Ai(t,e){var n={};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function Oi(t,e){var n;return t.isValid()&&e.isValid()?(e=fi(e,t),t.isBefore(e)?n=Ai(t,e):((n=Ai(e,t)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Ni(t,e){return function(n,i){var r;return null===i||isNaN(+i)||(P(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=n,n=i,i=r),Fi(this,Pi(n,i),t),this}}function Fi(t,e,n,r){var a=e._milliseconds,o=li(e._days),s=li(e._months);t.isValid()&&(r=null==r||r,s&&ce(t,ft(t,"Month")+s*n),o&&pt(t,"Date",ft(t,"Date")+o*n),a&&t._d.setTime(t._d.valueOf()+a*n),r&&i.updateOffset(t,o||s))}Pi.fn=oi.prototype,Pi.invalid=ai;var Ri=Ni(1,"add"),Li=Ni(-1,"subtract");function Ii(t){return"string"==typeof t||t instanceof String}function Ei(t){return k(t)||u(t)||Ii(t)||c(t)||Yi(t)||Wi(t)||null==t}function Wi(t){var e,n,i=o(t)&&!l(t),r=!1,a=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"];for(e=0;en.valueOf():n.valueOf()9999?H(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):T(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",H(n,"Z")):H(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function tr(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t,e,n,i,r="moment",a="";return this.isLocal()||(r=0===this.utcOffset()?"moment.utc":"moment.parseZone",a="Z"),t="["+r+'("]',e=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n="-MM-DD[T]HH:mm:ss.SSS",i=a+'[")]',this.format(t+e+n+i)}function er(t){t||(t=this.isUtc()?i.defaultFormatUtc:i.defaultFormat);var e=H(this,t);return this.localeData().postformat(e)}function nr(t,e){return this.isValid()&&(k(t)&&t.isValid()||Zn(t).isValid())?Pi({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function ir(t){return this.from(Zn(),t)}function rr(t,e){return this.isValid()&&(k(t)&&t.isValid()||Zn(t).isValid())?Pi({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function ar(t){return this.to(Zn(),t)}function or(t){var e;return void 0===t?this._locale._abbr:(null!=(e=bn(t))&&(this._locale=e),this)}i.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",i.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var sr=M("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(t){return void 0===t?this.localeData():this.locale(t)}));function lr(){return this._locale}var dr=1e3,cr=60*dr,ur=60*cr,hr=3506328*ur;function fr(t,e){return(t%e+e)%e}function pr(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-hr:new Date(t,e,n).valueOf()}function gr(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-hr:Date.UTC(t,e,n)}function mr(t){var e,n;if(void 0===(t=rt(t))||"millisecond"===t||!this.isValid())return this;switch(n=this._isUTC?gr:pr,t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=fr(e+(this._isUTC?0:this.utcOffset()*cr),ur);break;case"minute":e=this._d.valueOf(),e-=fr(e,cr);break;case"second":e=this._d.valueOf(),e-=fr(e,dr)}return this._d.setTime(e),i.updateOffset(this,!0),this}function vr(t){var e,n;if(void 0===(t=rt(t))||"millisecond"===t||!this.isValid())return this;switch(n=this._isUTC?gr:pr,t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=ur-fr(e+(this._isUTC?0:this.utcOffset()*cr),ur)-1;break;case"minute":e=this._d.valueOf(),e+=cr-fr(e,cr)-1;break;case"second":e=this._d.valueOf(),e+=dr-fr(e,dr)-1}return this._d.setTime(e),i.updateOffset(this,!0),this}function br(){return this._d.valueOf()-6e4*(this._offset||0)}function yr(){return Math.floor(this.valueOf()/1e3)}function _r(){return new Date(this.valueOf())}function xr(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function wr(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function kr(){return this.isValid()?this.toISOString():null}function Sr(){return v(this)}function Mr(){return f({},m(this))}function Cr(){return m(this).overflow}function Dr(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Pr(t,e){var n,r,a,o=this._eras||bn("en")._eras;for(n=0,r=o.length;n=0)return l[i]}function Ar(t,e){var n=t.since<=t.until?1:-1;return void 0===e?i(t.since).year():i(t.since).year()+(e-t.offset)*n}function Or(){var t,e,n,i=this.localeData().eras();for(t=0,e=i.length;t(a=Se(t,i,r))&&(e=a),Jr.call(this,t,e,n,i,r))}function Jr(t,e,n,i,r){var a=we(t,e,n,i,r),o=_e(a.year,0,a.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}function Kr(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}V("N",0,0,"eraAbbr"),V("NN",0,0,"eraAbbr"),V("NNN",0,0,"eraAbbr"),V("NNNN",0,0,"eraName"),V("NNNNN",0,0,"eraNarrow"),V("y",["y",1],"yo","eraYear"),V("y",["yy",2],0,"eraYear"),V("y",["yyy",3],0,"eraYear"),V("y",["yyyy",4],0,"eraYear"),Lt("N",Wr),Lt("NN",Wr),Lt("NNN",Wr),Lt("NNNN",Yr),Lt("NNNNN",Vr),Vt(["N","NN","NNN","NNNN","NNNNN"],(function(t,e,n,i){var r=n._locale.erasParse(t,i,n._strict);r?m(n).era=r:m(n).invalidEra=t})),Lt("y",Tt),Lt("yy",Tt),Lt("yyy",Tt),Lt("yyyy",Tt),Lt("yo",zr),Vt(["y","yy","yyy","yyyy"],Ut),Vt(["yo"],(function(t,e,n,i){var r;n._locale._eraYearOrdinalRegex&&(r=t.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?e[Ut]=n._locale.eraYearOrdinalParse(t,r):e[Ut]=parseInt(t,10)})),V(0,["gg",2],0,(function(){return this.weekYear()%100})),V(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),Hr("gggg","weekYear"),Hr("ggggg","weekYear"),Hr("GGGG","isoWeekYear"),Hr("GGGGG","isoWeekYear"),nt("weekYear","gg"),nt("isoWeekYear","GG"),st("weekYear",1),st("isoWeekYear",1),Lt("G",At),Lt("g",At),Lt("GG",kt,yt),Lt("gg",kt,yt),Lt("GGGG",Dt,xt),Lt("gggg",Dt,xt),Lt("GGGGG",Pt,wt),Lt("ggggg",Pt,wt),zt(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,n,i){e[i.substr(0,2)]=ut(t)})),zt(["gg","GG"],(function(t,e,n,r){e[r]=i.parseTwoDigitYear(t)})),V("Q",0,"Qo","quarter"),nt("quarter","Q"),st("quarter",7),Lt("Q",bt),Vt("Q",(function(t,e){e[jt]=3*(ut(t)-1)})),V("D",["DD",2],"Do","date"),nt("date","D"),st("date",9),Lt("D",kt),Lt("DD",kt,yt),Lt("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),Vt(["D","DD"],qt),Vt("Do",(function(t,e){e[qt]=ut(t.match(kt)[0])}));var Qr=ht("Date",!0);function ta(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}V("DDD",["DDDD",3],"DDDo","dayOfYear"),nt("dayOfYear","DDD"),st("dayOfYear",4),Lt("DDD",Ct),Lt("DDDD",_t),Vt(["DDD","DDDD"],(function(t,e,n){n._dayOfYear=ut(t)})),V("m",["mm",2],0,"minute"),nt("minute","m"),st("minute",14),Lt("m",kt),Lt("mm",kt,yt),Vt(["m","mm"],$t);var ea=ht("Minutes",!1);V("s",["ss",2],0,"second"),nt("second","s"),st("second",15),Lt("s",kt),Lt("ss",kt,yt),Vt(["s","ss"],Zt);var na,ia,ra=ht("Seconds",!1);for(V("S",0,0,(function(){return~~(this.millisecond()/100)})),V(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),V(0,["SSS",3],0,"millisecond"),V(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),V(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),V(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),V(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),V(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),V(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),nt("millisecond","ms"),st("millisecond",16),Lt("S",Ct,bt),Lt("SS",Ct,yt),Lt("SSS",Ct,_t),na="SSSS";na.length<=9;na+="S")Lt(na,Tt);function aa(t,e){e[Xt]=ut(1e3*("0."+t))}for(na="S";na.length<=9;na+="S")Vt(na,aa);function oa(){return this._isUTC?"UTC":""}function sa(){return this._isUTC?"Coordinated Universal Time":""}ia=ht("Milliseconds",!1),V("z",0,0,"zoneAbbr"),V("zz",0,0,"zoneName");var la=w.prototype;function da(t){return Zn(1e3*t)}function ca(){return Zn.apply(null,arguments).parseZone()}function ua(t){return t}la.add=Ri,la.calendar=Bi,la.clone=Hi,la.diff=Xi,la.endOf=vr,la.format=er,la.from=nr,la.fromNow=ir,la.to=rr,la.toNow=ar,la.get=gt,la.invalidAt=Cr,la.isAfter=Ui,la.isBefore=ji,la.isBetween=qi,la.isSame=Gi,la.isSameOrAfter=$i,la.isSameOrBefore=Zi,la.isValid=Sr,la.lang=sr,la.locale=or,la.localeData=lr,la.max=Jn,la.min=Xn,la.parsingFlags=Mr,la.set=mt,la.startOf=mr,la.subtract=Li,la.toArray=xr,la.toObject=wr,la.toDate=_r,la.toISOString=Qi,la.inspect=tr,"undefined"!=typeof Symbol&&null!=Symbol.for&&(la[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),la.toJSON=kr,la.toString=Ki,la.unix=yr,la.valueOf=br,la.creationData=Dr,la.eraName=Or,la.eraNarrow=Nr,la.eraAbbr=Fr,la.eraYear=Rr,la.year=ve,la.isLeapYear=be,la.weekYear=Ur,la.isoWeekYear=jr,la.quarter=la.quarters=Kr,la.month=ue,la.daysInMonth=he,la.week=la.weeks=Te,la.isoWeek=la.isoWeeks=Ae,la.weeksInYear=$r,la.weeksInWeekYear=Zr,la.isoWeeksInYear=qr,la.isoWeeksInISOWeekYear=Gr,la.date=Qr,la.day=la.days=je,la.weekday=qe,la.isoWeekday=Ge,la.dayOfYear=ta,la.hour=la.hours=an,la.minute=la.minutes=ea,la.second=la.seconds=ra,la.millisecond=la.milliseconds=ia,la.utcOffset=gi,la.utc=vi,la.local=bi,la.parseZone=yi,la.hasAlignedHourOffset=_i,la.isDST=xi,la.isLocal=ki,la.isUtcOffset=Si,la.isUtc=Mi,la.isUTC=Mi,la.zoneAbbr=oa,la.zoneName=sa,la.dates=M("dates accessor is deprecated. Use date instead.",Qr),la.months=M("months accessor is deprecated. Use month instead",ue),la.years=M("years accessor is deprecated. Use year instead",ve),la.zone=M("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",mi),la.isDSTShifted=M("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",wi);var ha=N.prototype;function fa(t,e,n,i){var r=bn(),a=p().set(i,e);return r[n](a,t)}function pa(t,e,n){if(c(t)&&(e=t,t=void 0),t=t||"",null!=e)return fa(t,e,n,"month");var i,r=[];for(i=0;i<12;i++)r[i]=fa(t,i,n,"month");return r}function ga(t,e,n,i){"boolean"==typeof t?(c(e)&&(n=e,e=void 0),e=e||""):(n=e=t,t=!1,c(e)&&(n=e,e=void 0),e=e||"");var r,a=bn(),o=t?a._week.dow:0,s=[];if(null!=n)return fa(e,(n+o)%7,i,"day");for(r=0;r<7;r++)s[r]=fa(e,(r+o)%7,i,"day");return s}function ma(t,e){return pa(t,e,"months")}function va(t,e){return pa(t,e,"monthsShort")}function ba(t,e,n){return ga(t,e,n,"weekdays")}function ya(t,e,n){return ga(t,e,n,"weekdaysShort")}function _a(t,e,n){return ga(t,e,n,"weekdaysMin")}ha.calendar=R,ha.longDateFormat=q,ha.invalidDate=$,ha.ordinal=J,ha.preparse=ua,ha.postformat=ua,ha.relativeTime=Q,ha.pastFuture=tt,ha.set=A,ha.eras=Pr,ha.erasParse=Tr,ha.erasConvertYear=Ar,ha.erasAbbrRegex=Ir,ha.erasNameRegex=Lr,ha.erasNarrowRegex=Er,ha.months=oe,ha.monthsShort=se,ha.monthsParse=de,ha.monthsRegex=pe,ha.monthsShortRegex=fe,ha.week=Me,ha.firstDayOfYear=Pe,ha.firstDayOfWeek=De,ha.weekdays=Ve,ha.weekdaysMin=Be,ha.weekdaysShort=ze,ha.weekdaysParse=Ue,ha.weekdaysRegex=$e,ha.weekdaysShortRegex=Ze,ha.weekdaysMinRegex=Xe,ha.isPM=nn,ha.meridiem=on,gn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===ut(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),i.lang=M("moment.lang is deprecated. Use moment.locale instead.",gn),i.langData=M("moment.langData is deprecated. Use moment.localeData instead.",bn);var xa=Math.abs;function wa(){var t=this._data;return this._milliseconds=xa(this._milliseconds),this._days=xa(this._days),this._months=xa(this._months),t.milliseconds=xa(t.milliseconds),t.seconds=xa(t.seconds),t.minutes=xa(t.minutes),t.hours=xa(t.hours),t.months=xa(t.months),t.years=xa(t.years),this}function ka(t,e,n,i){var r=Pi(e,n);return t._milliseconds+=i*r._milliseconds,t._days+=i*r._days,t._months+=i*r._months,t._bubble()}function Sa(t,e){return ka(this,t,e,1)}function Ma(t,e){return ka(this,t,e,-1)}function Ca(t){return t<0?Math.floor(t):Math.ceil(t)}function Da(){var t,e,n,i,r,a=this._milliseconds,o=this._days,s=this._months,l=this._data;return a>=0&&o>=0&&s>=0||a<=0&&o<=0&&s<=0||(a+=864e5*Ca(Ta(s)+o),o=0,s=0),l.milliseconds=a%1e3,t=ct(a/1e3),l.seconds=t%60,e=ct(t/60),l.minutes=e%60,n=ct(e/60),l.hours=n%24,o+=ct(n/24),s+=r=ct(Pa(o)),o-=Ca(Ta(r)),i=ct(s/12),s%=12,l.days=o,l.months=s,l.years=i,this}function Pa(t){return 4800*t/146097}function Ta(t){return 146097*t/4800}function Aa(t){if(!this.isValid())return NaN;var e,n,i=this._milliseconds;if("month"===(t=rt(t))||"quarter"===t||"year"===t)switch(e=this._days+i/864e5,n=this._months+Pa(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(Ta(this._months)),t){case"week":return e/7+i/6048e5;case"day":return e+i/864e5;case"hour":return 24*e+i/36e5;case"minute":return 1440*e+i/6e4;case"second":return 86400*e+i/1e3;case"millisecond":return Math.floor(864e5*e)+i;default:throw new Error("Unknown unit "+t)}}function Oa(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*ut(this._months/12):NaN}function Na(t){return function(){return this.as(t)}}var Fa=Na("ms"),Ra=Na("s"),La=Na("m"),Ia=Na("h"),Ea=Na("d"),Wa=Na("w"),Ya=Na("M"),Va=Na("Q"),za=Na("y");function Ba(){return Pi(this)}function Ha(t){return t=rt(t),this.isValid()?this[t+"s"]():NaN}function Ua(t){return function(){return this.isValid()?this._data[t]:NaN}}var ja=Ua("milliseconds"),qa=Ua("seconds"),Ga=Ua("minutes"),$a=Ua("hours"),Za=Ua("days"),Xa=Ua("months"),Ja=Ua("years");function Ka(){return ct(this.days()/7)}var Qa=Math.round,to={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function eo(t,e,n,i,r){return r.relativeTime(e||1,!!n,t,i)}function no(t,e,n,i){var r=Pi(t).abs(),a=Qa(r.as("s")),o=Qa(r.as("m")),s=Qa(r.as("h")),l=Qa(r.as("d")),d=Qa(r.as("M")),c=Qa(r.as("w")),u=Qa(r.as("y")),h=a<=n.ss&&["s",a]||a0,h[4]=i,eo.apply(null,h)}function io(t){return void 0===t?Qa:"function"==typeof t&&(Qa=t,!0)}function ro(t,e){return void 0!==to[t]&&(void 0===e?to[t]:(to[t]=e,"s"===t&&(to.ss=e-1),!0))}function ao(t,e){if(!this.isValid())return this.localeData().invalidDate();var n,i,r=!1,a=to;return"object"==typeof t&&(e=t,t=!1),"boolean"==typeof t&&(r=t),"object"==typeof e&&(a=Object.assign({},to,e),null!=e.s&&null==e.ss&&(a.ss=e.s-1)),i=no(this,!r,a,n=this.localeData()),r&&(i=n.pastFuture(+this,i)),n.postformat(i)}var oo=Math.abs;function so(t){return(t>0)-(t<0)||+t}function lo(){if(!this.isValid())return this.localeData().invalidDate();var t,e,n,i,r,a,o,s,l=oo(this._milliseconds)/1e3,d=oo(this._days),c=oo(this._months),u=this.asSeconds();return u?(t=ct(l/60),e=ct(t/60),l%=60,t%=60,n=ct(c/12),c%=12,i=l?l.toFixed(3).replace(/\.?0+$/,""):"",r=u<0?"-":"",a=so(this._months)!==so(u)?"-":"",o=so(this._days)!==so(u)?"-":"",s=so(this._milliseconds)!==so(u)?"-":"",r+"P"+(n?a+n+"Y":"")+(c?a+c+"M":"")+(d?o+d+"D":"")+(e||t||l?"T":"")+(e?s+e+"H":"")+(t?s+t+"M":"")+(l?s+i+"S":"")):"P0D"}var co=oi.prototype;return co.isValid=ri,co.abs=wa,co.add=Sa,co.subtract=Ma,co.as=Aa,co.asMilliseconds=Fa,co.asSeconds=Ra,co.asMinutes=La,co.asHours=Ia,co.asDays=Ea,co.asWeeks=Wa,co.asMonths=Ya,co.asQuarters=Va,co.asYears=za,co.valueOf=Oa,co._bubble=Da,co.clone=Ba,co.get=Ha,co.milliseconds=ja,co.seconds=qa,co.minutes=Ga,co.hours=$a,co.days=Za,co.weeks=Ka,co.months=Xa,co.years=Ja,co.humanize=ao,co.toISOString=lo,co.toString=lo,co.toJSON=lo,co.locale=or,co.localeData=lr,co.toIsoString=M("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",lo),co.lang=sr,V("X",0,0,"unix"),V("x",0,0,"valueOf"),Lt("x",At),Lt("X",Ft),Vt("X",(function(t,e,n){n._d=new Date(1e3*parseFloat(t))})),Vt("x",(function(t,e,n){n._d=new Date(ut(t))})), +(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");const te={};class ne extends q{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const e=this.getStyles();if(Array.isArray(e)){const t=(e,n)=>e.reduceRight(((e,n)=>Array.isArray(n)?t(n,e):(e.add(n),e)),n),n=t(e,new Set),r=[];n.forEach((e=>r.unshift(e))),this._styles=r}else this._styles=void 0===e?[]:[e];this._styles=this._styles.map((e=>{if(e instanceof CSSStyleSheet&&!X){const t=Array.prototype.slice.call(e.cssRules).reduce(((e,t)=>e+t.cssText),"");return new Q(String(t),J)}return e}))}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?X?this.renderRoot.adoptedStyleSheets=e.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet)):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map((e=>e.cssText)),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){const t=this.render();super.update(e),t!==te&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((e=>{const t=document.createElement("style");t.textContent=e.cssText,this.renderRoot.appendChild(t)})))}render(){return te}}ne.finalized=!0,ne.render=(e,t,r)=>{if(!r||"object"!=typeof r||!r.scopeName)throw new Error("The `scopeName` option is required.");const i=r.scopeName,o=I.has(t),a=z&&11===t.nodeType&&!!t.host,s=a&&!V.has(i),l=s?document.createDocumentFragment():t;if(((e,t,r)=>{let i=I.get(t);void 0===i&&(n(t,t.firstChild),I.set(t,i=new C(Object.assign({templateFactory:N},r))),i.appendInto(t)),i.setValue(e),i.commit()})(e,l,Object.assign({templateFactory:H(i)},r)),s){const e=I.get(l);I.delete(l);const r=e.value instanceof y?e.value.template:void 0;Y(i,l,r),n(t,t.firstChild),t.appendChild(l),I.set(t,e)}!o&&a&&window.ShadyCSS.styleElement(t.host)};const re={error:"fas fa-exclamation-circle",warning:"fas fa-exclamation-triangle",success:"fas fa-check-circle",info:"fas fa-info"};function ie(){(null===document||void 0===document?void 0:document.querySelector("pb-messages")).fetchMessages()}let oe=class extends ne{constructor(){super(...arguments),this.url="",this.messages=[]}createRenderRoot(){return this}firstUpdated(){this.fetchMessages()}fetchMessages(){return fetch(this.url).then((e=>e.json())).then((e=>this.messages=e)).then((e=>{const t=this.querySelector(".pf-c-alert-group");e.forEach((e=>{const n=this.renderMessage(e);t.appendChild(n)}))}))}renderMessage(e){const t="pb-message"+Math.random().toString(36).substr(2,9);const n=document.createElement("template");return n.innerHTML=`
  • \n
    \n
    \n \n
    \n

    \n ${e.message}\n

    \n
    \n
  • `,setTimeout((()=>{var e;null===(e=this.querySelector("#"+t))||void 0===e||e.remove()}),1500),n.content.firstChild}render(){return W`
      `}};e([Z()],oe.prototype,"url",void 0),e([Z()],oe.prototype,"messages",void 0),oe=e([$("pb-messages")],oe);const ae=["pf-m-progress","pf-m-in-progress"];let se=class extends ne{constructor(){var e;super(),this.url="",this.isRunning=!1,null===(e=this.querySelector("button"))||void 0===e||e.addEventListener("click",(e=>this.callAction()))}setLoading(){this.isRunning=!0,this.classList.add(...ae)}setDone(e){this.isRunning=!1,this.classList.remove(...ae),this.classList.replace("pf-m-primary",e),ie(),setTimeout((()=>{this.classList.replace(e,"pf-m-primary")}),1e3)}callAction(){if(!0===this.isRunning)return;this.setLoading();const e=function(e){let t=null;if(document.cookie&&""!==document.cookie){const n=document.cookie.split(";");for(let r=0;re.json())).then((e=>{this.setDone("pf-m-success")})).catch((()=>{this.setDone("pf-m-danger")}))}render(){return W``}};e([Z()],se.prototype,"url",void 0),se=e([$("pb-action-button")],se);let le=class extends ne{constructor(){super(),this.paths=[],this.activePath=window.location.hash.slice(1,1/0),window.addEventListener("hashchange",(e=>{this.activePath=window.location.hash.slice(1,1/0)})),this.querySelectorAll(".pf-c-nav__link").forEach((e=>{var t;let n=null===(t=e.attributes.getNamedItem("pb-url-prefix"))||void 0===t?void 0:t.value;if(!n){const t=new URL(e.href);if(""===t.hash)return void console.log("Ignoring "+e);n=`^${t.hash.slice(1,1/0)}$`}const r=RegExp(n);this.paths.push({anchor:e,match:r})}))}render(){return console.log(this.activePath),this.paths.forEach((e=>{e.match.exec(this.activePath)?e.anchor.classList.add("pf-m-current"):e.anchor.classList.remove("pf-m-current")})),W``}};e([Z()],le.prototype,"activePath",void 0),le=e([$("pb-admin-sidebar")],le);const ce=new CSSStyleSheet;ce.replaceSync(".pf-l-bullseye {\n --pf-l-bullseye--Padding: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n padding: var(--pf-l-bullseye--Padding);\n margin: 0; }\n");const ue=new CSSStyleSheet;ue.replaceSync('.pf-c-spinner {\n --pf-c-spinner--AnimationDuration: 1.5s;\n --pf-c-spinner--AnimationTimingFunction: cubic-bezier(.77, .005, .315, 1);\n --pf-c-spinner--diameter: var(--pf-global--icon--FontSize--xl);\n --pf-c-spinner--stroke-width-multiplier: .1;\n --pf-c-spinner--stroke-width: calc(var(--pf-c-spinner--diameter) * var(--pf-c-spinner--stroke-width-multiplier));\n --pf-c-spinner--Width: var(--pf-c-spinner--diameter);\n --pf-c-spinner--Height: var(--pf-c-spinner--diameter);\n --pf-c-spinner--Color: var(--pf-global--primary-color--100);\n --pf-c-spinner--m-sm--diameter: var(--pf-global--icon--FontSize--sm);\n --pf-c-spinner--m-md--diameter: var(--pf-global--icon--FontSize--md);\n --pf-c-spinner--m-lg--diameter: var(--pf-global--icon--FontSize--lg);\n --pf-c-spinner--m-xl--diameter: var(--pf-global--icon--FontSize--xl);\n --pf-c-spinner__clipper--Width: var(--pf-c-spinner--diameter);\n --pf-c-spinner__clipper--Height: var(--pf-c-spinner--diameter);\n --pf-c-spinner__clipper--after--BoxShadowColor: var(--pf-c-spinner--Color);\n --pf-c-spinner__clipper--after--Width: var(--pf-c-spinner--diameter);\n --pf-c-spinner__clipper--after--Height: var(--pf-c-spinner--diameter);\n --pf-c-spinner__clipper--after--BoxShadowSpreadRadius: var(--pf-c-spinner--stroke-width);\n --pf-c-spinner__lead-ball--after--BackgroundColor: var(--pf-c-spinner--Color);\n --pf-c-spinner__ball--after--Width: var(--pf-c-spinner--stroke-width);\n --pf-c-spinner__ball--after--Height: var(--pf-c-spinner--stroke-width);\n --pf-c-spinner__tail-ball--after--BackgroundColor: var(--pf-c-spinner--Color);\n position: relative;\n display: inline-block;\n width: var(--pf-c-spinner--Width);\n height: var(--pf-c-spinner--Height);\n text-align: left;\n animation: pf-animation-spinner-parent calc(var(--pf-c-spinner--AnimationDuration) * 2) var(--pf-c-spinner--AnimationTimingFunction) infinite; }\n .pf-c-spinner.pf-m-sm {\n --pf-c-spinner--diameter: var(--pf-c-spinner--m-sm--diameter); }\n .pf-c-spinner.pf-m-md {\n --pf-c-spinner--diameter: var(--pf-c-spinner--m-md--diameter); }\n .pf-c-spinner.pf-m-lg {\n --pf-c-spinner--diameter: var(--pf-c-spinner--m-lg--diameter); }\n .pf-c-spinner.pf-m-xl {\n --pf-c-spinner--diameter: var(--pf-c-spinner--m-xl--diameter); }\n\n@keyframes pf-animation-spinner-parent {\n 0% {\n transform: rotate(0deg); }\n 50% {\n transform: rotate(-540deg); }\n 100% {\n transform: rotate(-1080deg); } }\n\n.pf-c-spinner__clipper {\n position: absolute;\n width: var(--pf-c-spinner__clipper--Width);\n height: var(--pf-c-spinner__clipper--Height);\n clip-path: inset(0 0 50% 50%);\n animation: pf-animation-spinner__clipper var(--pf-c-spinner--AnimationDuration) linear infinite; }\n\n@keyframes pf-animation-spinner__clipper {\n 0% {\n transform: rotate(0deg); }\n 100% {\n transform: rotate(-270deg); } }\n\n.pf-c-spinner__clipper::after {\n position: absolute;\n width: var(--pf-c-spinner__clipper--after--Width);\n height: var(--pf-c-spinner__clipper--after--Height);\n clip-path: inset(0 0 0 50%);\n content: "";\n border-radius: 50%;\n box-shadow: inset 0 0 0 var(--pf-c-spinner__clipper--after--BoxShadowSpreadRadius) var(--pf-c-spinner__clipper--after--BoxShadowColor);\n animation: pf-animation-spinner__clipper-after var(--pf-c-spinner--AnimationDuration) linear infinite; }\n\n@keyframes pf-animation-spinner__clipper-after {\n 0% {\n transform: rotate(90deg); }\n 100% {\n transform: rotate(-180deg); } }\n\n.pf-c-spinner__lead-ball {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n animation: pf-animation-spinner__lead-ball var(--pf-c-spinner--AnimationDuration) linear infinite; }\n .pf-c-spinner__lead-ball::after {\n position: absolute;\n top: calc(50% - (var(--pf-c-spinner__ball--after--Height) / 2));\n right: 0;\n width: var(--pf-c-spinner__ball--after--Width);\n height: var(--pf-c-spinner__ball--after--Height);\n content: "";\n background-color: var(--pf-c-spinner__lead-ball--after--BackgroundColor);\n border-radius: 50%;\n transform-origin: top right; }\n\n@keyframes pf-animation-spinner__lead-ball {\n 0% {\n transform: rotate(0deg); }\n 34% {\n transform: rotate(-180deg); }\n 100% {\n transform: rotate(-360deg); } }\n\n.pf-c-spinner__tail-ball {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n animation: pf-animation-spinner__tail-ball var(--pf-c-spinner--AnimationDuration) linear infinite; }\n .pf-c-spinner__tail-ball::after {\n position: absolute;\n top: calc(50% - (var(--pf-c-spinner__ball--after--Height) / 2));\n right: 0;\n width: var(--pf-c-spinner__ball--after--Width);\n height: var(--pf-c-spinner__ball--after--Height);\n content: "";\n background-color: var(--pf-c-spinner__tail-ball--after--BackgroundColor);\n border-radius: 50%;\n transform-origin: top right; }\n\n@keyframes pf-animation-spinner__tail-ball {\n 0% {\n transform: rotate(0deg); }\n 67.5% {\n transform: rotate(-180deg); }\n 100% {\n transform: rotate(-360deg); } }\n');let de=class extends ne{constructor(){super(),this.loading=!1,this.loadContent(),window.addEventListener("hashchange",(e=>this.loadContent()))}set defaultUrl(e){""===window.location.hash&&void 0!==e&&(window.location.hash="#"+e)}static get styles(){return[ee`:host{position:relative}:host .pf-l-bullseye{position:absolute;height:100%;width:100%;top:0;left:0}`,ce,ue]}loadContent(){let e=window.location.hash.slice(1,1/0);""!==e&&(this.loading=!0,fetch(e).then((e=>e.text())).then((e=>{this.querySelector("[slot=body]").innerHTML=e})).then((()=>{this.querySelectorAll("a").forEach((e=>{if(""!==e.href)try{const t=new URL(e.href),n=t.search||"";e.href=`#${t.pathname}${n}`}catch(t){e.href="#"+e.href}})),this.querySelectorAll("[role=pb-refresh]").forEach((e=>{e.addEventListener("click",(e=>{this.loadContent()}))})),this.loading=!1})))}render(){return W`${this.loading?W`
      `:""}`}};e([Z()],de.prototype,"defaultUrl",null),e([Z()],de.prototype,"loading",void 0),de=e([$("pb-admin-shell")],de);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function he(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function fe(e,t){return e(t={exports:{}},t.exports),t.exports}var pe=fe((function(e,t){e.exports=function(){var t,n;function r(){return t.apply(null,arguments)}function i(e){t=e}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function a(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(s(e,t))return!1;return!0}function c(e){return void 0===e}function u(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function d(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function h(e,t){var n,r=[];for(n=0;n>>0;for(t=0;t0)for(n=0;n=0?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var R=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,W=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,E={},z={};function H(e,t,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),e&&(z[e]=i),t&&(z[t[0]]=function(){return I(i.apply(this,arguments),t[1],t[2])}),n&&(z[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function B(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function V(e){var t,n,r=e.match(R);for(t=0,n=r.length;t=0&&W.test(e);)e=e.replace(W,r),W.lastIndex=0,n-=1;return e}var j={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function G(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(R).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])}var q="Invalid date";function $(){return this._invalidDate}var K="%d",Z=/\d{1,2}/;function X(e){return this._ordinal.replace("%d",e)}var J={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Q(e,t,n,r){var i=this._relativeTime[n];return L(i)?i(e,t,n,r):i.replace(/%d/i,e)}function ee(e,t){var n=this._relativeTime[e>0?"future":"past"];return L(n)?n(t):n.replace(/%s/i,t)}var te={};function ne(e,t){var n=e.toLowerCase();te[n]=te[n+"s"]=te[t]=e}function re(e){return"string"==typeof e?te[e]||te[e.toLowerCase()]:void 0}function ie(e){var t,n,r={};for(n in e)s(e,n)&&(t=re(n))&&(r[t]=e[n]);return r}var oe={};function ae(e,t){oe[e]=t}function se(e){var t,n=[];for(t in e)s(e,t)&&n.push({unit:t,priority:oe[t]});return n.sort((function(e,t){return e.priority-t.priority})),n}function le(e){return e%4==0&&e%100!=0||e%400==0}function ce(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function ue(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=ce(t)),n}function de(e,t){return function(n){return null!=n?(pe(this,e,n),r.updateOffset(this,t),this):fe(this,e)}}function fe(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function pe(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&le(e.year())&&1===e.month()&&29===e.date()?(n=ue(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),et(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function ge(e){return L(this[e=re(e)])?this[e]():this}function me(e,t){if("object"==typeof e){var n,r=se(e=ie(e));for(n=0;n68?1900:2e3)};var vt=de("FullYear",!0);function yt(){return le(this.year())}function bt(e,t,n,r,i,o,a){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,r,i,o,a),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,r,i,o,a),s}function xt(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function wt(e,t,n){var r=7+t-n;return-(7+xt(e,0,r).getUTCDay()-t)%7+r-1}function _t(e,t,n,r,i){var o,a,s=1+7*(t-1)+(7+n-r)%7+wt(e,r,i);return s<=0?a=mt(o=e-1)+s:s>mt(e)?(o=e+1,a=s-mt(e)):(o=e,a=s),{year:o,dayOfYear:a}}function kt(e,t,n){var r,i,o=wt(e.year(),t,n),a=Math.floor((e.dayOfYear()-o-1)/7)+1;return a<1?r=a+St(i=e.year()-1,t,n):a>St(e.year(),t,n)?(r=a-St(e.year(),t,n),i=e.year()+1):(i=e.year(),r=a),{week:r,year:i}}function St(e,t,n){var r=wt(e,t,n),i=wt(e+1,t,n);return(mt(e)-r+i)/7}function Mt(e){return kt(e,this._week.dow,this._week.doy).week}H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),ne("week","w"),ne("isoWeek","W"),ae("week",5),ae("isoWeek",5),Ie("w",ke),Ie("ww",ke,be),Ie("W",ke),Ie("WW",ke,be),Be(["w","ww","W","WW"],(function(e,t,n,r){t[r.substr(0,1)]=ue(e)}));var Ct={dow:0,doy:6};function Tt(){return this._week.dow}function Dt(){return this._week.doy}function Lt(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function Pt(e){var t=kt(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function At(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}function Ot(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Nt(e,t){return e.slice(t,7).concat(e.slice(0,t))}H("d",0,"do","day"),H("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),H("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),H("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),ne("day","d"),ne("weekday","e"),ne("isoWeekday","E"),ae("day",11),ae("weekday",11),ae("isoWeekday",11),Ie("d",ke),Ie("e",ke),Ie("E",ke),Ie("dd",(function(e,t){return t.weekdaysMinRegex(e)})),Ie("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),Ie("dddd",(function(e,t){return t.weekdaysRegex(e)})),Be(["dd","ddd","dddd"],(function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);null!=i?t.d=i:m(n).invalidWeekday=e})),Be(["d","e","E"],(function(e,t,n,r){t[r]=ue(e)}));var Ft="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),It="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Rt="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Wt=Fe,Et=Fe,zt=Fe;function Ht(e,t){var n=o(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Nt(n,this._week.dow):e?n[e.day()]:n}function Bt(e){return!0===e?Nt(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Vt(e){return!0===e?Nt(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Yt(e,t,n){var r,i,o,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)o=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=Ye.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=Ye.call(this._weekdaysParse,a))||-1!==(i=Ye.call(this._shortWeekdaysParse,a))||-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))||-1!==(i=Ye.call(this._weekdaysParse,a))||-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))||-1!==(i=Ye.call(this._weekdaysParse,a))||-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null}function Ut(e,t,n){var r,i,o;if(this._weekdaysParseExact)return Yt.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function jt(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=At(e,this.localeData()),this.add(e-t,"d")):t}function Gt(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function qt(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=Ot(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function $t(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=Wt),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function Kt(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Et),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Zt(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=zt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Xt(){function e(e,t){return t.length-e.length}var t,n,r,i,o,a=[],s=[],l=[],c=[];for(t=0;t<7;t++)n=p([2e3,1]).day(t),r=Ee(this.weekdaysMin(n,"")),i=Ee(this.weekdaysShort(n,"")),o=Ee(this.weekdays(n,"")),a.push(r),s.push(i),l.push(o),c.push(r),c.push(i),c.push(o);a.sort(e),s.sort(e),l.sort(e),c.sort(e),this._weekdaysRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Jt(){return this.hours()%12||12}function Qt(){return this.hours()||24}function en(e,t){H(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function tn(e,t){return t._meridiemParse}function nn(e){return"p"===(e+"").toLowerCase().charAt(0)}H("H",["HH",2],0,"hour"),H("h",["hh",2],0,Jt),H("k",["kk",2],0,Qt),H("hmm",0,0,(function(){return""+Jt.apply(this)+I(this.minutes(),2)})),H("hmmss",0,0,(function(){return""+Jt.apply(this)+I(this.minutes(),2)+I(this.seconds(),2)})),H("Hmm",0,0,(function(){return""+this.hours()+I(this.minutes(),2)})),H("Hmmss",0,0,(function(){return""+this.hours()+I(this.minutes(),2)+I(this.seconds(),2)})),en("a",!0),en("A",!1),ne("hour","h"),ae("hour",13),Ie("a",tn),Ie("A",tn),Ie("H",ke),Ie("h",ke),Ie("k",ke),Ie("HH",ke,be),Ie("hh",ke,be),Ie("kk",ke,be),Ie("hmm",Se),Ie("hmmss",Me),Ie("Hmm",Se),Ie("Hmmss",Me),He(["H","HH"],qe),He(["k","kk"],(function(e,t,n){var r=ue(e);t[qe]=24===r?0:r})),He(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),He(["h","hh"],(function(e,t,n){t[qe]=ue(e),m(n).bigHour=!0})),He("hmm",(function(e,t,n){var r=e.length-2;t[qe]=ue(e.substr(0,r)),t[$e]=ue(e.substr(r)),m(n).bigHour=!0})),He("hmmss",(function(e,t,n){var r=e.length-4,i=e.length-2;t[qe]=ue(e.substr(0,r)),t[$e]=ue(e.substr(r,2)),t[Ke]=ue(e.substr(i)),m(n).bigHour=!0})),He("Hmm",(function(e,t,n){var r=e.length-2;t[qe]=ue(e.substr(0,r)),t[$e]=ue(e.substr(r))})),He("Hmmss",(function(e,t,n){var r=e.length-4,i=e.length-2;t[qe]=ue(e.substr(0,r)),t[$e]=ue(e.substr(r,2)),t[Ke]=ue(e.substr(i))}));var rn=/[ap]\.?m?\.?/i,on=de("Hours",!0);function an(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var sn,ln={calendar:N,longDateFormat:j,invalidDate:q,ordinal:K,dayOfMonthOrdinalParse:Z,relativeTime:J,months:tt,monthsShort:nt,week:Ct,weekdays:Ft,weekdaysMin:Rt,weekdaysShort:It,meridiemParse:rn},cn={},un={};function dn(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n0;){if(r=pn(i.slice(0,t).join("-")))return r;if(n&&n.length>=t&&dn(i,n)>=t-1)break;t--}o++}return sn}function pn(t){var n=null;if(void 0===cn[t]&&e&&e.exports)try{n=sn._abbr,he(),gn(n)}catch(e){cn[t]=null}return cn[t]}function gn(e,t){var n;return e&&((n=c(t)?yn(e):mn(e,t))?sn=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),sn._abbr}function mn(e,t){if(null!==t){var n,r=ln;if(t.abbr=e,null!=cn[e])D("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=cn[e]._config;else if(null!=t.parentLocale)if(null!=cn[t.parentLocale])r=cn[t.parentLocale]._config;else{if(null==(n=pn(t.parentLocale)))return un[t.parentLocale]||(un[t.parentLocale]=[]),un[t.parentLocale].push({name:e,config:t}),null;r=n._config}return cn[e]=new O(A(r,t)),un[e]&&un[e].forEach((function(e){mn(e.name,e.config)})),gn(e),cn[e]}return delete cn[e],null}function vn(e,t){if(null!=t){var n,r,i=ln;null!=cn[e]&&null!=cn[e].parentLocale?cn[e].set(A(cn[e]._config,t)):(null!=(r=pn(e))&&(i=r._config),t=A(i,t),null==r&&(t.abbr=e),(n=new O(t)).parentLocale=cn[e],cn[e]=n),gn(e)}else null!=cn[e]&&(null!=cn[e].parentLocale?(cn[e]=cn[e].parentLocale,e===gn()&&gn(e)):null!=cn[e]&&delete cn[e]);return cn[e]}function yn(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return sn;if(!o(e)){if(t=pn(e))return t;e=[e]}return fn(e)}function bn(){return C(cn)}function xn(e){var t,n=e._a;return n&&-2===m(e).overflow&&(t=n[je]<0||n[je]>11?je:n[Ge]<1||n[Ge]>et(n[Ue],n[je])?Ge:n[qe]<0||n[qe]>24||24===n[qe]&&(0!==n[$e]||0!==n[Ke]||0!==n[Ze])?qe:n[$e]<0||n[$e]>59?$e:n[Ke]<0||n[Ke]>59?Ke:n[Ze]<0||n[Ze]>999?Ze:-1,m(e)._overflowDayOfYear&&(tGe)&&(t=Ge),m(e)._overflowWeeks&&-1===t&&(t=Xe),m(e)._overflowWeekday&&-1===t&&(t=Je),m(e).overflow=t),e}var wn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_n=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,kn=/Z|[+-]\d\d(?::?\d\d)?/,Sn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Mn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Cn=/^\/?Date\((-?\d+)/i,Tn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Dn={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ln(e){var t,n,r,i,o,a,s=e._i,l=wn.exec(s)||_n.exec(s);if(l){for(m(e).iso=!0,t=0,n=Sn.length;tmt(o)||0===e._dayOfYear)&&(m(e)._overflowDayOfYear=!0),n=xt(o,0,e._dayOfYear),e._a[je]=n.getUTCMonth(),e._a[Ge]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=r[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[qe]&&0===e._a[$e]&&0===e._a[Ke]&&0===e._a[Ze]&&(e._nextDay=!0,e._a[qe]=0),e._d=(e._useUTC?xt:bt).apply(null,a),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[qe]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(m(e).weekdayMismatch=!0)}}function Hn(e){var t,n,r,i,o,a,s,l,c;null!=(t=e._w).GG||null!=t.W||null!=t.E?(o=1,a=4,n=Wn(t.GG,e._a[Ue],kt(Kn(),1,4).year),r=Wn(t.W,1),((i=Wn(t.E,1))<1||i>7)&&(l=!0)):(o=e._locale._week.dow,a=e._locale._week.doy,c=kt(Kn(),o,a),n=Wn(t.gg,e._a[Ue],c.year),r=Wn(t.w,c.week),null!=t.d?((i=t.d)<0||i>6)&&(l=!0):null!=t.e?(i=t.e+o,(t.e<0||t.e>6)&&(l=!0)):i=o),r<1||r>St(n,o,a)?m(e)._overflowWeeks=!0:null!=l?m(e)._overflowWeekday=!0:(s=_t(n,r,i,o,a),e._a[Ue]=s.year,e._dayOfYear=s.dayOfYear)}function Bn(e){if(e._f!==r.ISO_8601)if(e._f!==r.RFC_2822){e._a=[],m(e).empty=!0;var t,n,i,o,a,s,l=""+e._i,c=l.length,u=0;for(i=U(e._f,e._locale).match(R)||[],t=0;t0&&m(e).unusedInput.push(a),l=l.slice(l.indexOf(n)+n.length),u+=n.length),z[o]?(n?m(e).empty=!1:m(e).unusedTokens.push(o),Ve(o,n,e)):e._strict&&!n&&m(e).unusedTokens.push(o);m(e).charsLeftOver=c-u,l.length>0&&m(e).unusedInput.push(l),e._a[qe]<=12&&!0===m(e).bigHour&&e._a[qe]>0&&(m(e).bigHour=void 0),m(e).parsedDateParts=e._a.slice(0),m(e).meridiem=e._meridiem,e._a[qe]=Vn(e._locale,e._a[qe],e._meridiem),null!==(s=m(e).era)&&(e._a[Ue]=e._locale.erasConvertYear(s,e._a[Ue])),zn(e),xn(e)}else In(e);else Ln(e)}function Vn(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((r=e.isPM(n))&&t<12&&(t+=12),r||12!==t||(t=0),t):t}function Yn(e){var t,n,r,i,o,a,s=!1;if(0===e._f.length)return m(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;ithis?this:e:y()}));function Jn(e,t){var n,r;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Kn();for(n=t[0],r=1;rthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function _r(){if(!c(this._isDSTShifted))return this._isDSTShifted;var e,t={};return w(t,this),(t=Gn(t))._a?(e=t._isUTC?p(t._a):Kn(t._a),this._isDSTShifted=this.isValid()&&cr(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function kr(){return!!this.isValid()&&!this._isUTC}function Sr(){return!!this.isValid()&&this._isUTC}function Mr(){return!!this.isValid()&&this._isUTC&&0===this._offset}r.updateOffset=function(){};var Cr=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Tr=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Dr(e,t){var n,r,i,o=e,a=null;return sr(e)?o={ms:e._milliseconds,d:e._days,M:e._months}:u(e)||!isNaN(+e)?(o={},t?o[t]=+e:o.milliseconds=+e):(a=Cr.exec(e))?(n="-"===a[1]?-1:1,o={y:0,d:ue(a[Ge])*n,h:ue(a[qe])*n,m:ue(a[$e])*n,s:ue(a[Ke])*n,ms:ue(lr(1e3*a[Ze]))*n}):(a=Tr.exec(e))?(n="-"===a[1]?-1:1,o={y:Lr(a[2],n),M:Lr(a[3],n),w:Lr(a[4],n),d:Lr(a[5],n),h:Lr(a[6],n),m:Lr(a[7],n),s:Lr(a[8],n)}):null==o?o={}:"object"==typeof o&&("from"in o||"to"in o)&&(i=Ar(Kn(o.from),Kn(o.to)),(o={}).ms=i.milliseconds,o.M=i.months),r=new ar(o),sr(e)&&s(e,"_locale")&&(r._locale=e._locale),sr(e)&&s(e,"_isValid")&&(r._isValid=e._isValid),r}function Lr(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Pr(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Ar(e,t){var n;return e.isValid()&&t.isValid()?(t=fr(t,e),e.isBefore(t)?n=Pr(e,t):((n=Pr(t,e)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Or(e,t){return function(n,r){var i;return null===r||isNaN(+r)||(D(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=n,n=r,r=i),Nr(this,Dr(n,r),e),this}}function Nr(e,t,n,i){var o=t._milliseconds,a=lr(t._days),s=lr(t._months);e.isValid()&&(i=null==i||i,s&&ut(e,fe(e,"Month")+s*n),a&&pe(e,"Date",fe(e,"Date")+a*n),o&&e._d.setTime(e._d.valueOf()+o*n),i&&r.updateOffset(e,a||s))}Dr.fn=ar.prototype,Dr.invalid=or;var Fr=Or(1,"add"),Ir=Or(-1,"subtract");function Rr(e){return"string"==typeof e||e instanceof String}function Wr(e){return k(e)||d(e)||Rr(e)||u(e)||zr(e)||Er(e)||null==e}function Er(e){var t,n,r=a(e)&&!l(e),i=!1,o=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"];for(t=0;tn.valueOf():n.valueOf()9999?Y(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):L(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",Y(n,"Z")):Y(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ei(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,r,i="moment",o="";return this.isLocal()||(i=0===this.utcOffset()?"moment.utc":"moment.parseZone",o="Z"),e="["+i+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n="-MM-DD[T]HH:mm:ss.SSS",r=o+'[")]',this.format(e+t+n+r)}function ti(e){e||(e=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var t=Y(this,e);return this.localeData().postformat(t)}function ni(e,t){return this.isValid()&&(k(e)&&e.isValid()||Kn(e).isValid())?Dr({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function ri(e){return this.from(Kn(),e)}function ii(e,t){return this.isValid()&&(k(e)&&e.isValid()||Kn(e).isValid())?Dr({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function oi(e){return this.to(Kn(),e)}function ai(e){var t;return void 0===e?this._locale._abbr:(null!=(t=yn(e))&&(this._locale=t),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var si=M("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function li(){return this._locale}var ci=1e3,ui=60*ci,di=60*ui,hi=3506328*di;function fi(e,t){return(e%t+t)%t}function pi(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-hi:new Date(e,t,n).valueOf()}function gi(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-hi:Date.UTC(e,t,n)}function mi(e){var t,n;if(void 0===(e=re(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?gi:pi,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=fi(t+(this._isUTC?0:this.utcOffset()*ui),di);break;case"minute":t=this._d.valueOf(),t-=fi(t,ui);break;case"second":t=this._d.valueOf(),t-=fi(t,ci)}return this._d.setTime(t),r.updateOffset(this,!0),this}function vi(e){var t,n;if(void 0===(e=re(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?gi:pi,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=di-fi(t+(this._isUTC?0:this.utcOffset()*ui),di)-1;break;case"minute":t=this._d.valueOf(),t+=ui-fi(t,ui)-1;break;case"second":t=this._d.valueOf(),t+=ci-fi(t,ci)-1}return this._d.setTime(t),r.updateOffset(this,!0),this}function yi(){return this._d.valueOf()-6e4*(this._offset||0)}function bi(){return Math.floor(this.valueOf()/1e3)}function xi(){return new Date(this.valueOf())}function wi(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function _i(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function ki(){return this.isValid()?this.toISOString():null}function Si(){return v(this)}function Mi(){return f({},m(this))}function Ci(){return m(this).overflow}function Ti(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Di(e,t){var n,i,o,a=this._eras||yn("en")._eras;for(n=0,i=a.length;n=0)return l[r]}function Pi(e,t){var n=e.since<=e.until?1:-1;return void 0===t?r(e.since).year():r(e.since).year()+(t-e.offset)*n}function Ai(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e(o=St(e,r,i))&&(t=o),Xi.call(this,e,t,n,r,i))}function Xi(e,t,n,r,i){var o=_t(e,t,n,r,i),a=xt(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Ji(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}H("N",0,0,"eraAbbr"),H("NN",0,0,"eraAbbr"),H("NNN",0,0,"eraAbbr"),H("NNNN",0,0,"eraName"),H("NNNNN",0,0,"eraNarrow"),H("y",["y",1],"yo","eraYear"),H("y",["yy",2],0,"eraYear"),H("y",["yyy",3],0,"eraYear"),H("y",["yyyy",4],0,"eraYear"),Ie("N",Ei),Ie("NN",Ei),Ie("NNN",Ei),Ie("NNNN",zi),Ie("NNNNN",Hi),He(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?m(n).era=i:m(n).invalidEra=e})),Ie("y",Le),Ie("yy",Le),Ie("yyy",Le),Ie("yyyy",Le),Ie("yo",Bi),He(["y","yy","yyy","yyyy"],Ue),He(["yo"],(function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Ue]=n._locale.eraYearOrdinalParse(e,i):t[Ue]=parseInt(e,10)})),H(0,["gg",2],0,(function(){return this.weekYear()%100})),H(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),Yi("gggg","weekYear"),Yi("ggggg","weekYear"),Yi("GGGG","isoWeekYear"),Yi("GGGGG","isoWeekYear"),ne("weekYear","gg"),ne("isoWeekYear","GG"),ae("weekYear",1),ae("isoWeekYear",1),Ie("G",Pe),Ie("g",Pe),Ie("GG",ke,be),Ie("gg",ke,be),Ie("GGGG",Te,we),Ie("gggg",Te,we),Ie("GGGGG",De,_e),Ie("ggggg",De,_e),Be(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,r){t[r.substr(0,2)]=ue(e)})),Be(["gg","GG"],(function(e,t,n,i){t[i]=r.parseTwoDigitYear(e)})),H("Q",0,"Qo","quarter"),ne("quarter","Q"),ae("quarter",7),Ie("Q",ye),He("Q",(function(e,t){t[je]=3*(ue(e)-1)})),H("D",["DD",2],"Do","date"),ne("date","D"),ae("date",9),Ie("D",ke),Ie("DD",ke,be),Ie("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),He(["D","DD"],Ge),He("Do",(function(e,t){t[Ge]=ue(e.match(ke)[0])}));var Qi=de("Date",!0);function eo(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}H("DDD",["DDDD",3],"DDDo","dayOfYear"),ne("dayOfYear","DDD"),ae("dayOfYear",4),Ie("DDD",Ce),Ie("DDDD",xe),He(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=ue(e)})),H("m",["mm",2],0,"minute"),ne("minute","m"),ae("minute",14),Ie("m",ke),Ie("mm",ke,be),He(["m","mm"],$e);var to=de("Minutes",!1);H("s",["ss",2],0,"second"),ne("second","s"),ae("second",15),Ie("s",ke),Ie("ss",ke,be),He(["s","ss"],Ke);var no,ro,io=de("Seconds",!1);for(H("S",0,0,(function(){return~~(this.millisecond()/100)})),H(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),H(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),H(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),H(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),H(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),H(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),ne("millisecond","ms"),ae("millisecond",16),Ie("S",Ce,ye),Ie("SS",Ce,be),Ie("SSS",Ce,xe),no="SSSS";no.length<=9;no+="S")Ie(no,Le);function oo(e,t){t[Ze]=ue(1e3*("0."+e))}for(no="S";no.length<=9;no+="S")He(no,oo);function ao(){return this._isUTC?"UTC":""}function so(){return this._isUTC?"Coordinated Universal Time":""}ro=de("Milliseconds",!1),H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");var lo=_.prototype;function co(e){return Kn(1e3*e)}function uo(){return Kn.apply(null,arguments).parseZone()}function ho(e){return e}lo.add=Fr,lo.calendar=Vr,lo.clone=Yr,lo.diff=Zr,lo.endOf=vi,lo.format=ti,lo.from=ni,lo.fromNow=ri,lo.to=ii,lo.toNow=oi,lo.get=ge,lo.invalidAt=Ci,lo.isAfter=Ur,lo.isBefore=jr,lo.isBetween=Gr,lo.isSame=qr,lo.isSameOrAfter=$r,lo.isSameOrBefore=Kr,lo.isValid=Si,lo.lang=si,lo.locale=ai,lo.localeData=li,lo.max=Xn,lo.min=Zn,lo.parsingFlags=Mi,lo.set=me,lo.startOf=mi,lo.subtract=Ir,lo.toArray=wi,lo.toObject=_i,lo.toDate=xi,lo.toISOString=Qr,lo.inspect=ei,"undefined"!=typeof Symbol&&null!=Symbol.for&&(lo[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),lo.toJSON=ki,lo.toString=Jr,lo.unix=bi,lo.valueOf=yi,lo.creationData=Ti,lo.eraName=Ai,lo.eraNarrow=Oi,lo.eraAbbr=Ni,lo.eraYear=Fi,lo.year=vt,lo.isLeapYear=yt,lo.weekYear=Ui,lo.isoWeekYear=ji,lo.quarter=lo.quarters=Ji,lo.month=dt,lo.daysInMonth=ht,lo.week=lo.weeks=Lt,lo.isoWeek=lo.isoWeeks=Pt,lo.weeksInYear=$i,lo.weeksInWeekYear=Ki,lo.isoWeeksInYear=Gi,lo.isoWeeksInISOWeekYear=qi,lo.date=Qi,lo.day=lo.days=jt,lo.weekday=Gt,lo.isoWeekday=qt,lo.dayOfYear=eo,lo.hour=lo.hours=on,lo.minute=lo.minutes=to,lo.second=lo.seconds=io,lo.millisecond=lo.milliseconds=ro,lo.utcOffset=gr,lo.utc=vr,lo.local=yr,lo.parseZone=br,lo.hasAlignedHourOffset=xr,lo.isDST=wr,lo.isLocal=kr,lo.isUtcOffset=Sr,lo.isUtc=Mr,lo.isUTC=Mr,lo.zoneAbbr=ao,lo.zoneName=so,lo.dates=M("dates accessor is deprecated. Use date instead.",Qi),lo.months=M("months accessor is deprecated. Use month instead",dt),lo.years=M("years accessor is deprecated. Use year instead",vt),lo.zone=M("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",mr),lo.isDSTShifted=M("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",_r);var fo=O.prototype;function po(e,t,n,r){var i=yn(),o=p().set(r,t);return i[n](o,e)}function go(e,t,n){if(u(e)&&(t=e,e=void 0),e=e||"",null!=t)return po(e,t,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=po(e,r,n,"month");return i}function mo(e,t,n,r){"boolean"==typeof e?(u(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,u(t)&&(n=t,t=void 0),t=t||"");var i,o=yn(),a=e?o._week.dow:0,s=[];if(null!=n)return po(t,(n+a)%7,r,"day");for(i=0;i<7;i++)s[i]=po(t,(i+a)%7,r,"day");return s}function vo(e,t){return go(e,t,"months")}function yo(e,t){return go(e,t,"monthsShort")}function bo(e,t,n){return mo(e,t,n,"weekdays")}function xo(e,t,n){return mo(e,t,n,"weekdaysShort")}function wo(e,t,n){return mo(e,t,n,"weekdaysMin")}fo.calendar=F,fo.longDateFormat=G,fo.invalidDate=$,fo.ordinal=X,fo.preparse=ho,fo.postformat=ho,fo.relativeTime=Q,fo.pastFuture=ee,fo.set=P,fo.eras=Di,fo.erasParse=Li,fo.erasConvertYear=Pi,fo.erasAbbrRegex=Ri,fo.erasNameRegex=Ii,fo.erasNarrowRegex=Wi,fo.months=at,fo.monthsShort=st,fo.monthsParse=ct,fo.monthsRegex=pt,fo.monthsShortRegex=ft,fo.week=Mt,fo.firstDayOfYear=Dt,fo.firstDayOfWeek=Tt,fo.weekdays=Ht,fo.weekdaysMin=Vt,fo.weekdaysShort=Bt,fo.weekdaysParse=Ut,fo.weekdaysRegex=$t,fo.weekdaysShortRegex=Kt,fo.weekdaysMinRegex=Zt,fo.isPM=nn,fo.meridiem=an,gn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===ue(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),r.lang=M("moment.lang is deprecated. Use moment.locale instead.",gn),r.langData=M("moment.langData is deprecated. Use moment.localeData instead.",yn);var _o=Math.abs;function ko(){var e=this._data;return this._milliseconds=_o(this._milliseconds),this._days=_o(this._days),this._months=_o(this._months),e.milliseconds=_o(e.milliseconds),e.seconds=_o(e.seconds),e.minutes=_o(e.minutes),e.hours=_o(e.hours),e.months=_o(e.months),e.years=_o(e.years),this}function So(e,t,n,r){var i=Dr(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function Mo(e,t){return So(this,e,t,1)}function Co(e,t){return So(this,e,t,-1)}function To(e){return e<0?Math.floor(e):Math.ceil(e)}function Do(){var e,t,n,r,i,o=this._milliseconds,a=this._days,s=this._months,l=this._data;return o>=0&&a>=0&&s>=0||o<=0&&a<=0&&s<=0||(o+=864e5*To(Po(s)+a),a=0,s=0),l.milliseconds=o%1e3,e=ce(o/1e3),l.seconds=e%60,t=ce(e/60),l.minutes=t%60,n=ce(t/60),l.hours=n%24,a+=ce(n/24),s+=i=ce(Lo(a)),a-=To(Po(i)),r=ce(s/12),s%=12,l.days=a,l.months=s,l.years=r,this}function Lo(e){return 4800*e/146097}function Po(e){return 146097*e/4800}function Ao(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=re(e))||"quarter"===e||"year"===e)switch(t=this._days+r/864e5,n=this._months+Lo(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Po(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}}function Oo(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*ue(this._months/12):NaN}function No(e){return function(){return this.as(e)}}var Fo=No("ms"),Io=No("s"),Ro=No("m"),Wo=No("h"),Eo=No("d"),zo=No("w"),Ho=No("M"),Bo=No("Q"),Vo=No("y");function Yo(){return Dr(this)}function Uo(e){return e=re(e),this.isValid()?this[e+"s"]():NaN}function jo(e){return function(){return this.isValid()?this._data[e]:NaN}}var Go=jo("milliseconds"),qo=jo("seconds"),$o=jo("minutes"),Ko=jo("hours"),Zo=jo("days"),Xo=jo("months"),Jo=jo("years");function Qo(){return ce(this.days()/7)}var ea=Math.round,ta={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function na(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function ra(e,t,n,r){var i=Dr(e).abs(),o=ea(i.as("s")),a=ea(i.as("m")),s=ea(i.as("h")),l=ea(i.as("d")),c=ea(i.as("M")),u=ea(i.as("w")),d=ea(i.as("y")),h=o<=n.ss&&["s",o]||o0,h[4]=r,na.apply(null,h)}function ia(e){return void 0===e?ea:"function"==typeof e&&(ea=e,!0)}function oa(e,t){return void 0!==ta[e]&&(void 0===t?ta[e]:(ta[e]=t,"s"===e&&(ta.ss=t-1),!0))}function aa(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,r,i=!1,o=ta;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(i=e),"object"==typeof t&&(o=Object.assign({},ta,t),null!=t.s&&null==t.ss&&(o.ss=t.s-1)),r=ra(this,!i,o,n=this.localeData()),i&&(r=n.pastFuture(+this,r)),n.postformat(r)}var sa=Math.abs;function la(e){return(e>0)-(e<0)||+e}function ca(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,r,i,o,a,s,l=sa(this._milliseconds)/1e3,c=sa(this._days),u=sa(this._months),d=this.asSeconds();return d?(e=ce(l/60),t=ce(e/60),l%=60,e%=60,n=ce(u/12),u%=12,r=l?l.toFixed(3).replace(/\.?0+$/,""):"",i=d<0?"-":"",o=la(this._months)!==la(d)?"-":"",a=la(this._days)!==la(d)?"-":"",s=la(this._milliseconds)!==la(d)?"-":"",i+"P"+(n?o+n+"Y":"")+(u?o+u+"M":"")+(c?a+c+"D":"")+(t||e||l?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(l?s+r+"S":"")):"P0D"}var ua=ar.prototype;return ua.isValid=ir,ua.abs=ko,ua.add=Mo,ua.subtract=Co,ua.as=Ao,ua.asMilliseconds=Fo,ua.asSeconds=Io,ua.asMinutes=Ro,ua.asHours=Wo,ua.asDays=Eo,ua.asWeeks=zo,ua.asMonths=Ho,ua.asQuarters=Bo,ua.asYears=Vo,ua.valueOf=Oo,ua._bubble=Do,ua.clone=Yo,ua.get=Uo,ua.milliseconds=Go,ua.seconds=qo,ua.minutes=$o,ua.hours=Ko,ua.days=Zo,ua.weeks=Qo,ua.months=Xo,ua.years=Jo,ua.humanize=aa,ua.toISOString=ca,ua.toString=ca,ua.toJSON=ca,ua.locale=ai,ua.localeData=li,ua.toIsoString=M("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ca),ua.lang=si,H("X",0,0,"unix"),H("x",0,0,"valueOf"),Ie("x",Pe),Ie("X",Ne),He("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e))})),He("x",(function(e,t,n){n._d=new Date(ue(e))})), //! moment.js -i.version="2.29.1",r(Zn),i.fn=la,i.min=Qn,i.max=ti,i.now=ei,i.utc=p,i.unix=da,i.months=ma,i.isDate=u,i.locale=gn,i.invalid=b,i.duration=Pi,i.isMoment=k,i.weekdays=ba,i.parseZone=ca,i.localeData=bn,i.isDuration=si,i.monthsShort=va,i.weekdaysMin=_a,i.defineLocale=mn,i.updateLocale=vn,i.locales=yn,i.weekdaysShort=ya,i.normalizeUnits=rt,i.relativeTimeRounding=io,i.relativeTimeThreshold=ro,i.calendarFormat=zi,i.prototype=la,i.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},i}()})),ot=rt((function(t,e){ +r.version="2.29.1",i(Kn),r.fn=lo,r.min=Qn,r.max=er,r.now=tr,r.utc=p,r.unix=co,r.months=vo,r.isDate=d,r.locale=gn,r.invalid=y,r.duration=Dr,r.isMoment=k,r.weekdays=bo,r.parseZone=uo,r.localeData=yn,r.isDuration=sr,r.monthsShort=yo,r.weekdaysMin=wo,r.defineLocale=mn,r.updateLocale=vn,r.locales=bn,r.weekdaysShort=xo,r.normalizeUnits=re,r.relativeTimeRounding=ia,r.relativeTimeThreshold=oa,r.calendarFormat=Br,r.prototype=lo,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r}()})),ge=fe((function(e,t){ /*! * Chart.js v2.9.4 * https://www.chartjs.org * (c) 2020 Chart.js Contributors * Released under the MIT License */ -t.exports=function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}function n(t){return t&&t.default||t}t=t&&t.hasOwnProperty("default")?t.default:t;var i={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},r=e((function(t){var e={};for(var n in i)i.hasOwnProperty(n)&&(e[i[n]]=n);var r=t.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 a in r)if(r.hasOwnProperty(a)){if(!("channels"in r[a]))throw new Error("missing channels property: "+a);if(!("labels"in r[a]))throw new Error("missing channel labels property: "+a);if(r[a].labels.length!==r[a].channels)throw new Error("channel and label counts mismatch: "+a);var o=r[a].channels,s=r[a].labels;delete r[a].channels,delete r[a].labels,Object.defineProperty(r[a],"channels",{value:o}),Object.defineProperty(r[a],"labels",{value:s})}function l(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}r.rgb.hsl=function(t){var e,n,i=t[0]/255,r=t[1]/255,a=t[2]/255,o=Math.min(i,r,a),s=Math.max(i,r,a),l=s-o;return s===o?e=0:i===s?e=(r-a)/l:r===s?e=2+(a-i)/l:a===s&&(e=4+(i-r)/l),(e=Math.min(60*e,360))<0&&(e+=360),n=(o+s)/2,[e,100*(s===o?0:n<=.5?l/(s+o):l/(2-s-o)),100*n]},r.rgb.hsv=function(t){var e,n,i,r,a,o=t[0]/255,s=t[1]/255,l=t[2]/255,d=Math.max(o,s,l),c=d-Math.min(o,s,l),u=function(t){return(d-t)/6/c+.5};return 0===c?r=a=0:(a=c/d,e=u(o),n=u(s),i=u(l),o===d?r=i-n:s===d?r=1/3+e-i:l===d&&(r=2/3+n-e),r<0?r+=1:r>1&&(r-=1)),[360*r,100*a,100*d]},r.rgb.hwb=function(t){var e=t[0],n=t[1],i=t[2];return[r.rgb.hsl(t)[0],1/255*Math.min(e,Math.min(n,i))*100,100*(i=1-1/255*Math.max(e,Math.max(n,i)))]},r.rgb.cmyk=function(t){var e,n=t[0]/255,i=t[1]/255,r=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-i,1-r)))/(1-e)||0),100*((1-i-e)/(1-e)||0),100*((1-r-e)/(1-e)||0),100*e]},r.rgb.keyword=function(t){var n=e[t];if(n)return n;var r,a=1/0;for(var o in i)if(i.hasOwnProperty(o)){var s=l(t,i[o]);s.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)),100*(.2126*e+.7152*n+.0722*i),100*(.0193*e+.1192*n+.9505*i)]},r.rgb.lab=function(t){var e=r.rgb.xyz(t),n=e[0],i=e[1],a=e[2];return i/=100,a/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(n-i),200*(i-(a=a>.008856?Math.pow(a,1/3):7.787*a+16/116))]},r.hsl.rgb=function(t){var e,n,i,r,a,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[a=255*l,a,a];e=2*l-(n=l<.5?l*(1+s):l+s-l*s),r=[0,0,0];for(var d=0;d<3;d++)(i=o+1/3*-(d-1))<0&&i++,i>1&&i--,a=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e,r[d]=255*a;return r},r.hsl.hsv=function(t){var e=t[0],n=t[1]/100,i=t[2]/100,r=n,a=Math.max(i,.01);return n*=(i*=2)<=1?i:2-i,r*=a<=1?a:2-a,[e,100*(0===i?2*r/(a+r):2*n/(i+n)),(i+n)/2*100]},r.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,r=Math.floor(e)%6,a=e-Math.floor(e),o=255*i*(1-n),s=255*i*(1-n*a),l=255*i*(1-n*(1-a));switch(i*=255,r){case 0:return[i,l,o];case 1:return[s,i,o];case 2:return[o,i,l];case 3:return[o,s,i];case 4:return[l,o,i];case 5:return[i,o,s]}},r.hsv.hsl=function(t){var e,n,i,r=t[0],a=t[1]/100,o=t[2]/100,s=Math.max(o,.01);return i=(2-a)*o,n=a*s,[r,100*(n=(n/=(e=(2-a)*s)<=1?e:2-e)||0),100*(i/=2)]},r.hwb.rgb=function(t){var e,n,i,r,a,o,s,l=t[0]/360,d=t[1]/100,c=t[2]/100,u=d+c;switch(u>1&&(d/=u,c/=u),i=6*l-(e=Math.floor(6*l)),0!=(1&e)&&(i=1-i),r=d+i*((n=1-c)-d),e){default:case 6:case 0:a=n,o=r,s=d;break;case 1:a=r,o=n,s=d;break;case 2:a=d,o=n,s=r;break;case 3:a=d,o=r,s=n;break;case 4:a=r,o=d,s=n;break;case 5:a=n,o=d,s=r}return[255*a,255*o,255*s]},r.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,i=t[2]/100,r=t[3]/100;return[255*(1-Math.min(1,e*(1-r)+r)),255*(1-Math.min(1,n*(1-r)+r)),255*(1-Math.min(1,i*(1-r)+r))]},r.xyz.rgb=function(t){var e,n,i,r=t[0]/100,a=t[1]/100,o=t[2]/100;return n=-.9689*r+1.8758*a+.0415*o,i=.0557*r+-.204*a+1.057*o,e=(e=3.2406*r+-1.5372*a+-.4986*o)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(i=Math.min(Math.max(0,i),1))]},r.xyz.lab=function(t){var e=t[0],n=t[1],i=t[2];return n/=100,i/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},r.lab.xyz=function(t){var e,n,i,r=t[0];e=t[1]/500+(n=(r+16)/116),i=n-t[2]/200;var a=Math.pow(n,3),o=Math.pow(e,3),s=Math.pow(i,3);return n=a>.008856?a:(n-16/116)/7.787,e=o>.008856?o:(e-16/116)/7.787,i=s>.008856?s:(i-16/116)/7.787,[e*=95.047,n*=100,i*=108.883]},r.lab.lch=function(t){var e,n=t[0],i=t[1],r=t[2];return(e=360*Math.atan2(r,i)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(i*i+r*r),e]},r.lch.lab=function(t){var e,n=t[0],i=t[1];return e=t[2]/360*2*Math.PI,[n,i*Math.cos(e),i*Math.sin(e)]},r.rgb.ansi16=function(t){var e=t[0],n=t[1],i=t[2],a=1 in arguments?arguments[1]:r.rgb.hsv(t)[2];if(0===(a=Math.round(a/50)))return 30;var o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===a&&(o+=60),o},r.hsv.ansi16=function(t){return r.rgb.ansi16(r.hsv.rgb(t),t[2])},r.rgb.ansi256=function(t){var e=t[0],n=t[1],i=t[2];return e===n&&n===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)},r.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},r.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},r.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},r.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map((function(t){return t+t})).join(""));var i=parseInt(n,16);return[i>>16&255,i>>8&255,255&i]},r.rgb.hcg=function(t){var e,n=t[0]/255,i=t[1]/255,r=t[2]/255,a=Math.max(Math.max(n,i),r),o=Math.min(Math.min(n,i),r),s=a-o;return e=s<=0?0:a===n?(i-r)/s%6:a===i?2+(r-n)/s:4+(n-i)/s+4,e/=6,[360*(e%=1),100*s,100*(s<1?o/(1-s):0)]},r.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=1,r=0;return(i=n<.5?2*e*n:2*e*(1-n))<1&&(r=(n-.5*i)/(1-i)),[t[0],100*i,100*r]},r.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=e*n,r=0;return i<1&&(r=(n-i)/(1-i)),[t[0],100*i,100*r]},r.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,i=t[2]/100;if(0===n)return[255*i,255*i,255*i];var r=[0,0,0],a=e%1*6,o=a%1,s=1-o,l=0;switch(Math.floor(a)){case 0:r[0]=1,r[1]=o,r[2]=0;break;case 1:r[0]=s,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=o;break;case 3:r[0]=0,r[1]=s,r[2]=1;break;case 4:r[0]=o,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=s}return l=(1-n)*i,[255*(n*r[0]+l),255*(n*r[1]+l),255*(n*r[2]+l)]},r.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),i=0;return n>0&&(i=e/n),[t[0],100*i,100*n]},r.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],100*i,100*n]},r.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},r.hwb.hcg=function(t){var e=t[1]/100,n=1-t[2]/100,i=n-e,r=0;return i<1&&(r=(n-i)/(1-i)),[t[0],100*i,100*r]},r.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},r.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},r.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},r.gray.hsl=r.gray.hsv=function(t){return[0,0,t[0]]},r.gray.hwb=function(t){return[0,100,t[0]]},r.gray.cmyk=function(t){return[0,0,0,t[0]]},r.gray.lab=function(t){return[t[0],0,0]},r.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},r.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}}));function a(){for(var t={},e=Object.keys(r),n=e.length,i=0;i1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}function h(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"==typeof n)for(var i=n.length,r=0;r=0&&e<1?N(Math.round(255*e)):"")}function k(t,e){return e<1||t[3]&&t[3]<1?S(t,e):"rgb("+t[0]+", "+t[1]+", "+t[2]+")"}function S(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function M(t,e){return e<1||t[3]&&t[3]<1?C(t,e):"rgb("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%)"}function C(t,e){return"rgba("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%, "+(e||t[3]||1)+")"}function D(t,e){return e<1||t[3]&&t[3]<1?P(t,e):"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"}function P(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function T(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"}function A(t){return F[t.slice(0,3)]}function O(t,e,n){return Math.min(Math.max(e,t),n)}function N(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}var F={};for(var R in p)F[p[R]]=R;var L=function(t){return t instanceof L?t:this instanceof L?(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 t?(e=g.getRgba(t))?this.setValues("rgb",e):(e=g.getHsla(t))?this.setValues("hsl",e):(e=g.getHwb(t))&&this.setValues("hwb",e):"object"==typeof t&&(void 0!==(e=t).r||void 0!==e.red?this.setValues("rgb",e):void 0!==e.l||void 0!==e.lightness?this.setValues("hsl",e):void 0!==e.v||void 0!==e.value?this.setValues("hsv",e):void 0!==e.w||void 0!==e.whiteness?this.setValues("hwb",e):void 0===e.c&&void 0===e.cyan||this.setValues("cmyk",e)))):new L(t);var e};L.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 t=this.values;return 1!==t.alpha?t.hwb.concat([t.alpha]):t.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var t=this.values;return t.rgb.concat([t.alpha])},hslaArray:function(){var t=this.values;return t.hsl.concat([t.alpha])},alpha:function(t){return void 0===t?this.values.alpha:(this.setValues("alpha",t),this)},red:function(t){return this.setChannel("rgb",0,t)},green:function(t){return this.setChannel("rgb",1,t)},blue:function(t){return this.setChannel("rgb",2,t)},hue:function(t){return t&&(t=(t%=360)<0?360+t:t),this.setChannel("hsl",0,t)},saturation:function(t){return this.setChannel("hsl",1,t)},lightness:function(t){return this.setChannel("hsl",2,t)},saturationv:function(t){return this.setChannel("hsv",1,t)},whiteness:function(t){return this.setChannel("hwb",1,t)},blackness:function(t){return this.setChannel("hwb",2,t)},value:function(t){return this.setChannel("hsv",2,t)},cyan:function(t){return this.setChannel("cmyk",0,t)},magenta:function(t){return this.setChannel("cmyk",1,t)},yellow:function(t){return this.setChannel("cmyk",2,t)},black:function(t){return this.setChannel("cmyk",3,t)},hexString:function(){return g.hexString(this.values.rgb)},rgbString:function(){return g.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return g.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return g.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return g.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return g.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return g.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return g.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var t=this.values.rgb;return t[0]<<16|t[1]<<8|t[2]},luminosity:function(){for(var t=this.values.rgb,e=[],n=0;nn?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=this,i=t,r=void 0===e?.5:e,a=2*r-1,o=n.alpha()-i.alpha(),s=((a*o==-1?a:(a+o)/(1+a*o))+1)/2,l=1-s;return this.rgb(s*n.red()+l*i.red(),s*n.green()+l*i.green(),s*n.blue()+l*i.blue()).alpha(n.alpha()*r+i.alpha()*(1-r))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new L,i=this.values,r=n.values;for(var a in i)i.hasOwnProperty(a)&&(t=i[a],"[object Array]"===(e={}.toString.call(t))?r[a]=t.slice(0):"[object Number]"===e?r[a]=t:console.error("unexpected color value:",t));return n}},L.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},L.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},L.prototype.getValues=function(t){for(var e=this.values,n={},i=0;i=0;r--)e.call(n,t[r],r);else for(r=0;r=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),e=n/(2*Math.PI)*Math.asin(1/i),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n))},easeOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),e=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:2==(t/=.5)?1:(n||(n=.45),e=n/(2*Math.PI)*Math.asin(1/i),t<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-z.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*z.easeInBounce(2*t):.5*z.easeOutBounce(2*t-1)+.5}},B={effects:z};V.easingEffects=z;var H=Math.PI,U=H/180,j=2*H,q=H/2,G=H/4,$=2*H/3,Z={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,n,i,r,a){if(a){var o=Math.min(a,r/2,i/2),s=e+o,l=n+o,d=e+i-o,c=n+r-o;t.moveTo(e,l),se.left-n&&t.xe.top-n&&t.y0&&t.requestAnimationFrame()},advance:function(){for(var t,e,n,i,r=this.animations,a=0;a=n?(ot.callback(t.onAnimationComplete,[t],e),e.animating=!1,r.splice(a,1)):++a}},bt=ot.options.resolve,yt=["push","pop","shift","splice","unshift"];function _t(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),yt.forEach((function(e){var n="onData"+e.charAt(0).toUpperCase()+e.slice(1),i=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){var e=Array.prototype.slice.call(arguments),r=i.apply(this,e);return ot.each(t._chartjs.listeners,(function(t){"function"==typeof t[n]&&t[n].apply(t,e)})),r}})})))}function xt(t,e){var n=t._chartjs;if(n){var i=n.listeners,r=i.indexOf(e);-1!==r&&i.splice(r,1),i.length>0||(yt.forEach((function(e){delete t[e]})),delete t._chartjs)}}var wt=function(t,e){this.initialize(t,e)};ot.extend(wt.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),n=t.chart,i=n.scales,r=t.getDataset(),a=n.options.scales;null!==e.xAxisID&&e.xAxisID in i&&!r.xAxisID||(e.xAxisID=r.xAxisID||a.xAxes[0].id),null!==e.yAxisID&&e.yAxisID in i&&!r.yAxisID||(e.yAxisID=r.yAxisID||a.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},_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&&xt(this._data,this)},createMetaDataset:function(){var t=this,e=t.datasetElementType;return e&&new e({_chart:t.chart,_datasetIndex:t.index})},createMetaData:function(t){var e=this,n=e.dataElementType;return n&&new n({_chart:e.chart,_datasetIndex:e.index,_index:t})},addElements:function(){var t,e,n=this,i=n.getMeta(),r=n.getDataset().data||[],a=i.data;for(t=0,e=r.length;ti&&t.insertElements(i,r-i)},insertElements:function(t,e){for(var n=0;nr?(a=r/e.innerRadius,t.arc(o,s,e.innerRadius-r,i+a,n-a,!0)):t.arc(o,s,r,i+Math.PI/2,n-Math.PI/2),t.closePath(),t.clip()}function Ct(t,e,n,i){var r,a=n.endAngle;for(i&&(n.endAngle=n.startAngle+St,Mt(t,n),n.endAngle=a,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=St,n.fullCircles--)),t.beginPath(),t.arc(n.x,n.y,n.innerRadius,n.startAngle+St,n.startAngle,!0),r=0;rs;)r-=St;for(;r=o&&r<=s,d=a>=n.innerRadius&&a<=n.outerRadius;return l&&d}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,n=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,n=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},draw:function(){var t,e=this._chart.ctx,n=this._view,i="inner"===n.borderAlign?.33:0,r={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-i,0),pixelMargin:i,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/St)};if(e.save(),e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,r.fullCircles){for(r.endAngle=r.startAngle+St,e.beginPath(),e.arc(r.x,r.y,r.outerRadius,r.startAngle,r.endAngle),e.arc(r.x,r.y,r.innerRadius,r.endAngle,r.startAngle,!0),e.closePath(),t=0;tt.x&&(e=Vt(e,"left","right")):t.basen?n:i,r:l.right||r<0?0:r>e?e:r,b:l.bottom||a<0?0:a>n?n:a,l:l.left||o<0?0:o>e?e:o}}function Ht(t){var e=Yt(t),n=e.right-e.left,i=e.bottom-e.top,r=Bt(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i},inner:{x:e.left+r.l,y:e.top+r.t,w:n-r.l-r.r,h:i-r.t-r.b}}}function Ut(t,e,n){var i=null===e,r=null===n,a=!(!t||i&&r)&&Yt(t);return a&&(i||e>=a.left&&e<=a.right)&&(r||n>=a.top&&n<=a.bottom)}K._set("global",{elements:{rectangle:{backgroundColor:Et,borderColor:Et,borderSkipped:"bottom",borderWidth:0}}});var jt=pt.extend({_type:"rectangle",draw:function(){var t=this._chart.ctx,e=this._view,n=Ht(e),i=n.outer,r=n.inner;t.fillStyle=e.backgroundColor,t.fillRect(i.x,i.y,i.w,i.h),i.w===r.w&&i.h===r.h||(t.save(),t.beginPath(),t.rect(i.x,i.y,i.w,i.h),t.clip(),t.fillStyle=e.borderColor,t.rect(r.x,r.y,r.w,r.h),t.fill("evenodd"),t.restore())},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){return Ut(this._view,t,e)},inLabelRange:function(t,e){var n=this._view;return Wt(n)?Ut(n,t,null):Ut(n,null,e)},inXRange:function(t){return Ut(this._view,t,null)},inYRange:function(t){return Ut(this._view,null,t)},getCenterPoint:function(){var t,e,n=this._view;return Wt(n)?(t=n.x,e=(n.y+n.base)/2):(t=(n.x+n.base)/2,e=n.y),{x:t,y:e}},getArea:function(){var t=this._view;return Wt(t)?t.width*Math.abs(t.y-t.base):t.height*Math.abs(t.x-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}}),qt={},Gt=Pt,$t=Ot,Zt=It,Xt=jt;qt.Arc=Gt,qt.Line=$t,qt.Point=Zt,qt.Rectangle=Xt;var Jt=ot._deprecated,Kt=ot.valueOrDefault;function Qt(t,e){var n,i,r,a,o=t._length;for(r=1,a=e.length;r0?Math.min(o,Math.abs(i-n)):o,n=i;return o}function te(t,e,n){var i,r,a=n.barThickness,o=e.stackCount,s=e.pixels[t],l=ot.isNullOrUndef(a)?Qt(e.scale,e.pixels):-1;return ot.isNullOrUndef(a)?(i=l*n.categoryPercentage,r=n.barPercentage):(i=a*o,r=1),{chunk:i/o,ratio:r,start:s-i/2}}function ee(t,e,n){var i,r=e.pixels,a=r[t],o=t>0?r[t-1]:null,s=t=0&&m.min>=0?m.min:m.max,x=void 0===m.start?m.end:m.max>=0&&m.min>=0?m.max-m.min:m.min-m.max,w=g.length;if(b||void 0===b&&void 0!==y)for(i=0;i=0&&d.max>=0?d.max:d.min,(m.min<0&&a<0||m.max>=0&&a>0)&&(_+=a));return o=h.getPixelForValue(_),l=(s=h.getPixelForValue(_+x))-o,void 0!==v&&Math.abs(l)=0&&!f||x<0&&f?o-v:o+v),{size:l,base:o,head:s,center:s+l/2}},calculateBarIndexPixels:function(t,e,n,i){var r=this,a="flex"===i.barThickness?ee(e,n,i):te(e,n,i),o=r.getStackIndex(t,r.getMeta().stack),s=a.start+a.chunk*o+a.chunk/2,l=Math.min(Kt(i.maxBarThickness,1/0),a.chunk*a.ratio);return{base:s-l/2,head:s+l/2,center:s,size:l}},draw:function(){var t=this,e=t.chart,n=t._getValueScale(),i=t.getMeta().data,r=t.getDataset(),a=i.length,o=0;for(ot.canvas.clipArea(e.ctx,e.chartArea);o=se?-le:b<-se?le:0)+m,_=Math.cos(b),x=Math.sin(b),w=Math.cos(y),k=Math.sin(y),S=b<=0&&y>=0||y>=le,M=b<=de&&y>=de||y>=le+de,C=b<=-de&&y>=-de||y>=se+de,D=b===-se||y>=se?-1:Math.min(_,_*g,w,w*g),P=C?-1:Math.min(x,x*g,k,k*g),T=S?1:Math.max(_,_*g,w,w*g),A=M?1:Math.max(x,x*g,k,k*g);d=(T-D)/2,c=(A-P)/2,u=-(T+D)/2,h=-(A+P)/2}for(i=0,r=p.length;i0&&!isNaN(t)?le*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){var e,n,i,r,a,o,s,l,d=this,c=0,u=d.chart;if(!t)for(e=0,n=u.data.datasets.length;e(c=s>c?s:c)?l:c);return c},setHoverStyle:function(t){var e=t._model,n=t._options,i=ot.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=oe(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=oe(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=oe(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(t){for(var e=0,n=0;n0&&pe(d[t-1]._model,l)&&(n.controlPointPreviousX=c(n.controlPointPreviousX,l.left,l.right),n.controlPointPreviousY=c(n.controlPointPreviousY,l.top,l.bottom)),t0&&(a=t.getDatasetMeta(a[0]._datasetIndex).data),a},"x-axis":function(t,e){return Ae(t,e,{intersect:!1})},point:function(t,e){return De(t,Me(e,t))},nearest:function(t,e,n){var i=Me(e,t);n.axis=n.axis||"xy";var r=Te(n.axis);return Pe(t,i,n.intersect,r)},x:function(t,e,n){var i=Me(e,t),r=[],a=!1;return Ce(t,(function(t){t.inXRange(i.x)&&r.push(t),t.inRange(i.x,i.y)&&(a=!0)})),n.intersect&&!a&&(r=[]),r},y:function(t,e,n){var i=Me(e,t),r=[],a=!1;return Ce(t,(function(t){t.inYRange(i.y)&&r.push(t),t.inRange(i.x,i.y)&&(a=!0)})),n.intersect&&!a&&(r=[]),r}}},Ne=ot.extend;function Fe(t,e){return ot.where(t,(function(t){return t.pos===e}))}function Re(t,e){return t.sort((function(t,n){var i=e?n:t,r=e?t:n;return i.weight===r.weight?i.index-r.index:i.weight-r.weight}))}function Le(t){var e,n,i,r=[];for(e=0,n=(t||[]).length;e 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",Ge=n(Object.freeze({__proto__:null,default:qe})),$e="$chartjs",Ze="chartjs-",Xe=Ze+"size-monitor",Je=Ze+"render-monitor",Ke=Ze+"render-animation",Qe=["animationstart","webkitAnimationStart"],tn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function en(t,e){var n=ot.getStyle(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?Number(i[1]):void 0}function nn(t,e){var n=t.style,i=t.getAttribute("height"),r=t.getAttribute("width");if(t[$e]={initial:{height:i,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===r||""===r){var a=en(t,"width");void 0!==a&&(t.width=a)}if(null===i||""===i)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var o=en(t,"height");void 0!==a&&(t.height=o)}return t}var rn=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}()&&{passive:!0};function an(t,e,n){t.addEventListener(e,n,rn)}function on(t,e,n){t.removeEventListener(e,n,rn)}function sn(t,e,n,i,r){return{type:t,chart:e,native:r||null,x:void 0!==n?n:null,y:void 0!==i?i:null}}function ln(t,e){var n=tn[t.type]||t.type,i=ot.getRelativePosition(t,e);return sn(n,e,i.x,i.y,t)}function dn(t,e){var n=!1,i=[];return function(){i=Array.prototype.slice.call(arguments),e=e||this,n||(n=!0,ot.requestAnimFrame.call(window,(function(){n=!1,t.apply(e,i)})))}}function cn(t){var e=document.createElement("div");return e.className=t||"",e}function un(t){var e=1e6,n=cn(Xe),i=cn(Xe+"-expand"),r=cn(Xe+"-shrink");i.appendChild(cn()),r.appendChild(cn()),n.appendChild(i),n.appendChild(r),n._reset=function(){i.scrollLeft=e,i.scrollTop=e,r.scrollLeft=e,r.scrollTop=e};var a=function(){n._reset(),t()};return an(i,"scroll",a.bind(i,"expand")),an(r,"scroll",a.bind(r,"shrink")),n}function hn(t,e){var n=t[$e]||(t[$e]={}),i=n.renderProxy=function(t){t.animationName===Ke&&e()};ot.each(Qe,(function(e){an(t,e,i)})),n.reflow=!!t.offsetParent,t.classList.add(Je)}function fn(t){var e=t[$e]||{},n=e.renderProxy;n&&(ot.each(Qe,(function(e){on(t,e,n)})),delete e.renderProxy),t.classList.remove(Je)}function pn(t,e,n){var i=t[$e]||(t[$e]={}),r=i.resizer=un(dn((function(){if(i.resizer){var r=n.options.maintainAspectRatio&&t.parentNode,a=r?r.clientWidth:0;e(sn("resize",n)),r&&r.clientWidth0){var a=t[0];a.label?n=a.label:a.xLabel?n=a.xLabel:r>0&&a.index-1?t.split("\n"):t}function Dn(t){var e=t._xScale,n=t._yScale||t._scale,i=t._index,r=t._datasetIndex,a=t._chart.getDatasetMeta(r).controller,o=a._getIndexScale(),s=a._getValueScale();return{xLabel:e?e.getLabelForIndex(i,r):"",yLabel:n?n.getLabelForIndex(i,r):"",label:o?""+o.getLabelForIndex(i,r):"",value:s?""+s.getLabelForIndex(i,r):"",index:i,datasetIndex:r,x:t._model.x,y:t._model.y}}function Pn(t){var e=K.global;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,rtl:t.rtl,textDirection:t.textDirection,bodyFontColor:t.bodyFontColor,_bodyFontFamily:wn(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:wn(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:wn(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:wn(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:wn(t.titleFontStyle,e.defaultFontStyle),titleFontSize:wn(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:wn(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:wn(t.footerFontStyle,e.defaultFontStyle),footerFontSize:wn(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function Tn(t,e){var n=t._chart.ctx,i=2*e.yPadding,r=0,a=e.body,o=a.reduce((function(t,e){return t+e.before.length+e.lines.length+e.after.length}),0);o+=e.beforeBody.length+e.afterBody.length;var s=e.title.length,l=e.footer.length,d=e.titleFontSize,c=e.bodyFontSize,u=e.footerFontSize;i+=s*d,i+=s?(s-1)*e.titleSpacing:0,i+=s?e.titleMarginBottom:0,i+=o*c,i+=o?(o-1)*e.bodySpacing:0,i+=l?e.footerMarginTop:0,i+=l*u,i+=l?(l-1)*e.footerSpacing:0;var h=0,f=function(t){r=Math.max(r,n.measureText(t).width+h)};return n.font=ot.fontString(d,e._titleFontStyle,e._titleFontFamily),ot.each(e.title,f),n.font=ot.fontString(c,e._bodyFontStyle,e._bodyFontFamily),ot.each(e.beforeBody.concat(e.afterBody),f),h=e.displayColors?c+2:0,ot.each(a,(function(t){ot.each(t.before,f),ot.each(t.lines,f),ot.each(t.after,f)})),h=0,n.font=ot.fontString(u,e._footerFontStyle,e._footerFontFamily),ot.each(e.footer,f),{width:r+=2*e.xPadding,height:i}}function An(t,e){var n,i,r,a,o,s=t._model,l=t._chart,d=t._chart.chartArea,c="center",u="center";s.yl.height-e.height&&(u="bottom");var h=(d.left+d.right)/2,f=(d.top+d.bottom)/2;"center"===u?(n=function(t){return t<=h},i=function(t){return t>h}):(n=function(t){return t<=e.width/2},i=function(t){return t>=l.width-e.width/2}),r=function(t){return t+e.width+s.caretSize+s.caretPadding>l.width},a=function(t){return t-e.width-s.caretSize-s.caretPadding<0},o=function(t){return t<=f?"top":"bottom"},n(s.x)?(c="left",r(s.x)&&(c="center",u=o(s.y))):i(s.x)&&(c="right",a(s.x)&&(c="center",u=o(s.y)));var p=t._options;return{xAlign:p.xAlign?p.xAlign:c,yAlign:p.yAlign?p.yAlign:u}}function On(t,e,n,i){var r=t.x,a=t.y,o=t.caretSize,s=t.caretPadding,l=t.cornerRadius,d=n.xAlign,c=n.yAlign,u=o+s,h=l+s;return"right"===d?r-=e.width:"center"===d&&((r-=e.width/2)+e.width>i.width&&(r=i.width-e.width),r<0&&(r=0)),"top"===c?a+=u:a-="bottom"===c?e.height+u:e.height/2,"center"===c?"left"===d?r+=u:"right"===d&&(r-=u):"left"===d?r-=h:"right"===d&&(r+=h),{x:r,y:a}}function Nn(t,e){return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-t.xPadding:t.x+t.xPadding}function Fn(t){return Mn([],Cn(t))}var Rn=pt.extend({initialize:function(){this._model=Pn(this._options),this._lastActive=[]},getTitle:function(){var t=this,e=t._options.callbacks,n=e.beforeTitle.apply(t,arguments),i=e.title.apply(t,arguments),r=e.afterTitle.apply(t,arguments),a=[];return a=Mn(a,Cn(n)),a=Mn(a,Cn(i)),a=Mn(a,Cn(r))},getBeforeBody:function(){return Fn(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(t,e){var n=this,i=n._options.callbacks,r=[];return ot.each(t,(function(t){var a={before:[],lines:[],after:[]};Mn(a.before,Cn(i.beforeLabel.call(n,t,e))),Mn(a.lines,i.label.call(n,t,e)),Mn(a.after,Cn(i.afterLabel.call(n,t,e))),r.push(a)})),r},getAfterBody:function(){return Fn(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this,e=t._options.callbacks,n=e.beforeFooter.apply(t,arguments),i=e.footer.apply(t,arguments),r=e.afterFooter.apply(t,arguments),a=[];return a=Mn(a,Cn(n)),a=Mn(a,Cn(i)),a=Mn(a,Cn(r))},update:function(t){var e,n,i=this,r=i._options,a=i._model,o=i._model=Pn(r),s=i._active,l=i._data,d={xAlign:a.xAlign,yAlign:a.yAlign},c={x:a.x,y:a.y},u={width:a.width,height:a.height},h={x:a.caretX,y:a.caretY};if(s.length){o.opacity=1;var f=[],p=[];h=Sn[r.position].call(i,s,i._eventPosition);var g=[];for(e=0,n=s.length;e0&&n.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},i={x:e.x,y:e.y},r=Math.abs(e.opacity<.001)?0:e.opacity,a=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(i,e,t,n),i.y+=e.yPadding,ot.rtl.overrideTextDirection(t,e.textDirection),this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),ot.rtl.restoreTextDirection(t,e.textDirection),t.restore())}},handleEvent:function(t){var e=this,n=e._options,i=!1;return e._lastActive=e._lastActive||[],"mouseout"===t.type?e._active=[]:(e._active=e._chart.getElementsAtEventForMode(t,n.mode,n),n.reverse&&e._active.reverse()),(i=!ot.arrayEquals(e._active,e._lastActive))&&(e._lastActive=e._active,(n.enabled||n.custom)&&(e._eventPosition={x:t.x,y:t.y},e.update(!0),e.pivot())),i}}),Ln=Sn,In=Rn;In.positioners=Ln;var En=ot.valueOrDefault;function Wn(){return ot.merge(Object.create(null),[].slice.call(arguments),{merger:function(t,e,n,i){if("xAxes"===t||"yAxes"===t){var r,a,o,s=n[t].length;for(e[t]||(e[t]=[]),r=0;r=e[t].length&&e[t].push({}),!e[t][r].type||o.type&&o.type!==e[t][r].type?ot.merge(e[t][r],[xn.getScaleDefaults(a),o]):ot.merge(e[t][r],o)}else ot._merger(t,e,n,i)}})}function Yn(){return ot.merge(Object.create(null),[].slice.call(arguments),{merger:function(t,e,n,i){var r=e[t]||Object.create(null),a=n[t];"scales"===t?e[t]=Wn(r,a):"scale"===t?e[t]=ot.merge(r,[xn.getScaleDefaults(a.type),a]):ot._merger(t,e,n,i)}})}function Vn(t){var e=(t=t||Object.create(null)).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=Yn(K.global,K[t.type],t.options||{}),t}function zn(t){var e=t.options;ot.each(t.scales,(function(e){Ue.removeBox(t,e)})),e=Yn(K.global,K[t.config.type],e),t.options=t.config.options=e,t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.tooltip._options=e.tooltips,t.tooltip.initialize()}function Bn(t,e,n){var i,r=function(t){return t.id===i};do{i=e+n++}while(ot.findIndex(t,r)>=0);return i}function Hn(t){return"top"===t||"bottom"===t}function Un(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}K._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 jn=function(t,e){return this.construct(t,e),this};ot.extend(jn.prototype,{construct:function(t,e){var n=this;e=Vn(e);var i=yn.acquireContext(t,e),r=i&&i.canvas,a=r&&r.height,o=r&&r.width;n.id=ot.uid(),n.ctx=i,n.canvas=r,n.config=e,n.width=o,n.height=a,n.aspectRatio=a?o/a:null,n.options=e.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,jn.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(t){n.config.data=t}}),i&&r?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return _n.notify(t,"beforeInit"),ot.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.initToolTip(),_n.notify(t,"afterInit"),t},clear:function(){return ot.canvas.clear(this),this},stop:function(){return vt.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,i=e.canvas,r=n.maintainAspectRatio&&e.aspectRatio||null,a=Math.max(0,Math.floor(ot.getMaximumWidth(i))),o=Math.max(0,Math.floor(r?a/r:ot.getMaximumHeight(i)));if((e.width!==a||e.height!==o)&&(i.width=e.width=a,i.height=e.height=o,i.style.width=a+"px",i.style.height=o+"px",ot.retinaScale(e,n.devicePixelRatio),!t)){var s={width:a,height:o};_n.notify(e,"resize",[s]),n.onResize&&n.onResize(e,s),e.stop(),e.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;ot.each(e.xAxes,(function(t,n){t.id||(t.id=Bn(e.xAxes,"x-axis-",n))})),ot.each(e.yAxes,(function(t,n){t.id||(t.id=Bn(e.yAxes,"y-axis-",n))})),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var t=this,e=t.options,n=t.scales||{},i=[],r=Object.keys(n).reduce((function(t,e){return t[e]=!1,t}),{});e.scales&&(i=i.concat((e.scales.xAxes||[]).map((function(t){return{options:t,dtype:"category",dposition:"bottom"}})),(e.scales.yAxes||[]).map((function(t){return{options:t,dtype:"linear",dposition:"left"}})))),e.scale&&i.push({options:e.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),ot.each(i,(function(e){var i=e.options,a=i.id,o=En(i.type,e.dtype);Hn(i.position)!==Hn(e.dposition)&&(i.position=e.dposition),r[a]=!0;var s=null;if(a in n&&n[a].type===o)(s=n[a]).options=i,s.ctx=t.ctx,s.chart=t;else{var l=xn.getScaleConstructor(o);if(!l)return;s=new l({id:a,type:o,options:i,ctx:t.ctx,chart:t}),n[s.id]=s}s.mergeTicksOptions(),e.isDefault&&(t.scale=s)})),ot.each(r,(function(t,e){t||delete n[e]})),t.scales=n,xn.addScalesToLayout(this)},buildOrUpdateControllers:function(){var t,e,n=this,i=[],r=n.data.datasets;for(t=0,e=r.length;t=0;--n)i.drawDataset(e[n],t);_n.notify(i,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n=this,i={meta:t,index:t.index,easingValue:e};!1!==_n.notify(n,"beforeDatasetDraw",[i])&&(t.controller.draw(e),_n.notify(n,"afterDatasetDraw",[i]))},_drawTooltip:function(t){var e=this,n=e.tooltip,i={tooltip:n,easingValue:t};!1!==_n.notify(e,"beforeTooltipDraw",[i])&&(n.draw(),_n.notify(e,"afterTooltipDraw",[i]))},getElementAtEvent:function(t){return Oe.modes.single(this,t)},getElementsAtEvent:function(t){return Oe.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return Oe.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var i=Oe.modes[e];return"function"==typeof i?i(this,t,n):[]},getDatasetAtEvent:function(t){return Oe.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this,n=e.data.datasets[t];n._meta||(n._meta={});var i=n._meta[e.id];return i||(i=n._meta[e.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n.order||0,index:t}),i},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e=0;i--){var r=t[i];if(e(r))return r}},ot.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},ot.almostEquals=function(t,e,n){return Math.abs(t-e)=t},ot.max=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.max(t,e)}),Number.NEGATIVE_INFINITY)},ot.min=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.min(t,e)}),Number.POSITIVE_INFINITY)},ot.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0==(t=+t)||isNaN(t)?t:t>0?1:-1},ot.toRadians=function(t){return t*(Math.PI/180)},ot.toDegrees=function(t){return t*(180/Math.PI)},ot._decimalPlaces=function(t){if(ot.isFinite(t)){for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n}},ot.getAngleFromPoint=function(t,e){var n=e.x-t.x,i=e.y-t.y,r=Math.sqrt(n*n+i*i),a=Math.atan2(i,n);return a<-.5*Math.PI&&(a+=2*Math.PI),{angle:a,distance:r}},ot.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},ot.aliasPixel=function(t){return t%2==0?0:.5},ot._alignPixel=function(t,e,n){var i=t.currentDevicePixelRatio,r=n/2;return Math.round((e-r)*i)/i+r},ot.splineCurve=function(t,e,n,i){var r=t.skip?e:t,a=e,o=n.skip?e:n,s=Math.sqrt(Math.pow(a.x-r.x,2)+Math.pow(a.y-r.y,2)),l=Math.sqrt(Math.pow(o.x-a.x,2)+Math.pow(o.y-a.y,2)),d=s/(s+l),c=l/(s+l),u=i*(d=isNaN(d)?0:d),h=i*(c=isNaN(c)?0:c);return{previous:{x:a.x-u*(o.x-r.x),y:a.y-u*(o.y-r.y)},next:{x:a.x+h*(o.x-r.x),y:a.y+h*(o.y-r.y)}}},ot.EPSILON=Number.EPSILON||1e-14,ot.splineCurveMonotone=function(t){var e,n,i,r,a,o,s,l,d,c=(t||[]).map((function(t){return{model:t._model,deltaK:0,mK:0}})),u=c.length;for(e=0;e0?c[e-1]:null,(r=e0?c[e-1]:null,r=e=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},ot.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},ot.niceNum=function(t,e){var n=Math.floor(ot.log10(t)),i=t/Math.pow(10,n);return(e?i<1.5?1:i<3?2:i<7?5:10:i<=1?1:i<=2?2:i<=5?5:10)*Math.pow(10,n)},ot.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},ot.getRelativePosition=function(t,e){var n,i,r=t.originalEvent||t,a=t.target||t.srcElement,o=a.getBoundingClientRect(),s=r.touches;s&&s.length>0?(n=s[0].clientX,i=s[0].clientY):(n=r.clientX,i=r.clientY);var l=parseFloat(ot.getStyle(a,"padding-left")),d=parseFloat(ot.getStyle(a,"padding-top")),c=parseFloat(ot.getStyle(a,"padding-right")),u=parseFloat(ot.getStyle(a,"padding-bottom")),h=o.right-o.left-l-c,f=o.bottom-o.top-d-u;return{x:n=Math.round((n-o.left-l)/h*a.width/e.currentDevicePixelRatio),y:i=Math.round((i-o.top-d)/f*a.height/e.currentDevicePixelRatio)}},ot.getConstraintWidth=function(t){return n(t,"max-width","clientWidth")},ot.getConstraintHeight=function(t){return n(t,"max-height","clientHeight")},ot._calculatePadding=function(t,e,n){return(e=ot.getStyle(t,e)).indexOf("%")>-1?n*parseInt(e,10)/100:parseInt(e,10)},ot._getParentNode=function(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e},ot.getMaximumWidth=function(t){var e=ot._getParentNode(t);if(!e)return t.clientWidth;var n=e.clientWidth,i=n-ot._calculatePadding(e,"padding-left",n)-ot._calculatePadding(e,"padding-right",n),r=ot.getConstraintWidth(t);return isNaN(r)?i:Math.min(i,r)},ot.getMaximumHeight=function(t){var e=ot._getParentNode(t);if(!e)return t.clientHeight;var n=e.clientHeight,i=n-ot._calculatePadding(e,"padding-top",n)-ot._calculatePadding(e,"padding-bottom",n),r=ot.getConstraintHeight(t);return isNaN(r)?i:Math.min(i,r)},ot.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},ot.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var i=t.canvas,r=t.height,a=t.width;i.height=r*n,i.width=a*n,t.ctx.scale(n,n),i.style.height||i.style.width||(i.style.height=r+"px",i.style.width=a+"px")}},ot.fontString=function(t,e,n){return e+" "+t+"px "+n},ot.longestText=function(t,e,n,i){var r=(i=i||{}).data=i.data||{},a=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(r=i.data={},a=i.garbageCollect=[],i.font=e),t.font=e;var o,s,l,d,c,u=0,h=n.length;for(o=0;on.length){for(o=0;oi&&(i=a),i},ot.numberOfLabelLines=function(t){var e=1;return ot.each(t,(function(t){ot.isArray(t)&&t.length>e&&(e=t.length)})),e},ot.color=I?function(t){return t instanceof CanvasGradient&&(t=K.global.defaultColor),I(t)}:function(t){return console.error("Color.js not found!"),t},ot.getHoverColor=function(t){return t instanceof CanvasPattern||t instanceof CanvasGradient?t:ot.color(t).saturate(.5).darken(.1).rgbString()}};function $n(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function Zn(t){this.options=t||{}}ot.extend(Zn.prototype,{formats:$n,parse:$n,format:$n,add:$n,diff:$n,startOf:$n,endOf:$n,_create:function(t){return t}}),Zn.override=function(t){ot.extend(Zn.prototype,t)};var Xn={_date:Zn},Jn={formatters:{values:function(t){return ot.isArray(t)?t:""+t},linear:function(t,e,n){var i=n.length>3?n[2]-n[1]:n[1]-n[0];Math.abs(i)>1&&t!==Math.floor(t)&&(i=t-Math.floor(t));var r=ot.log10(Math.abs(i)),a="";if(0!==t)if(Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]))<1e-4){var o=ot.log10(Math.abs(t)),s=Math.floor(o)-Math.floor(r);s=Math.max(Math.min(s,20),0),a=t.toExponential(s)}else{var l=-1*Math.floor(r);l=Math.max(Math.min(l,20),0),a=t.toFixed(l)}else a="0";return a},logarithmic:function(t,e,n){var i=t/Math.pow(10,Math.floor(ot.log10(t)));return 0===t?"0":1===i||2===i||5===i||0===e||e===n.length-1?t.toExponential():""}}},Kn=ot.isArray,Qn=ot.isNullOrUndef,ti=ot.valueOrDefault,ei=ot.valueAtIndexOrDefault;function ni(t,e){for(var n=[],i=t.length/e,r=0,a=t.length;rl+d)))return o}function ri(t,e){ot.each(t,(function(t){var n,i=t.gc,r=i.length/2;if(r>e){for(n=0;nd)return a;return Math.max(d,1)}function fi(t){var e,n,i=[];for(e=0,n=t.length;e=h||c<=1||!s.isHorizontal()?s.labelRotation=u:(e=(t=s._getLabelSizes()).widest.width,n=t.highest.height-t.highest.offset,i=Math.min(s.maxWidth,s.chart.width-e),e+6>(r=l.offset?s.maxWidth/c:i/(c-1))&&(r=i/(c-(l.offset?.5:1)),a=s.maxHeight-oi(l.gridLines)-d.padding-si(l.scaleLabel),o=Math.sqrt(e*e+n*n),f=ot.toDegrees(Math.min(Math.asin(Math.min((t.highest.height+6)/r,1)),Math.asin(Math.min(a/o,1))-Math.asin(n/o))),f=Math.max(u,Math.min(h,f))),s.labelRotation=f)},afterCalculateTickRotation:function(){ot.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){ot.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},n=t.chart,i=t.options,r=i.ticks,a=i.scaleLabel,o=i.gridLines,s=t._isVisible(),l="bottom"===i.position,d=t.isHorizontal();if(d?e.width=t.maxWidth:s&&(e.width=oi(o)+si(a)),d?s&&(e.height=oi(o)+si(a)):e.height=t.maxHeight,r.display&&s){var c=di(r),u=t._getLabelSizes(),h=u.first,f=u.last,p=u.widest,g=u.highest,m=.4*c.minor.lineHeight,v=r.padding;if(d){var b=0!==t.labelRotation,y=ot.toRadians(t.labelRotation),_=Math.cos(y),x=Math.sin(y),w=x*p.width+_*(g.height-(b?g.offset:0))+(b?0:m);e.height=Math.min(t.maxHeight,e.height+w+v);var k,S,M=t.getPixelForTick(0)-t.left,C=t.right-t.getPixelForTick(t.getTicks().length-1);b?(k=l?_*h.width+x*h.offset:x*(h.height-h.offset),S=l?x*(f.height-f.offset):_*f.width+x*f.offset):(k=h.width/2,S=f.width/2),t.paddingLeft=Math.max((k-M)*t.width/(t.width-M),0)+3,t.paddingRight=Math.max((S-C)*t.width/(t.width-C),0)+3}else{var D=r.mirror?0:p.width+v+m;e.width=Math.min(t.maxWidth,e.width+D),t.paddingTop=h.height/2,t.paddingBottom=f.height/2}}t.handleMargins(),d?(t.width=t._length=n.width-t.margins.left-t.margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=n.height-t.margins.top-t.margins.bottom)},handleMargins:function(){var t=this;t.margins&&(t.margins.left=Math.max(t.paddingLeft,t.margins.left),t.margins.top=Math.max(t.paddingTop,t.margins.top),t.margins.right=Math.max(t.paddingRight,t.margins.right),t.margins.bottom=Math.max(t.paddingBottom,t.margins.bottom))},afterFit:function(){ot.callback(this.options.afterFit,[this])},isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(Qn(t))return NaN;if(("number"==typeof t||t instanceof Number)&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},_convertTicksToLabels:function(t){var e,n,i,r=this;for(r.ticks=t.map((function(t){return t.value})),r.beforeTickToLabelConversion(),e=r.convertTicksToLabels(t)||r.ticks,r.afterTickToLabelConversion(),n=0,i=t.length;ni-1?null:e.getPixelForDecimal(t*r+(n?r/2:0))},getPixelForDecimal:function(t){var e=this;return e._reversePixels&&(t=1-t),e._startPixel+t*e._length},getDecimalForPixel:function(t){var e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this,e=t.min,n=t.max;return t.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0},_autoSkip:function(t){var e,n,i,r,a=this,o=a.options.ticks,s=a._length,l=o.maxTicksLimit||s/a._tickSize()+1,d=o.major.enabled?fi(t):[],c=d.length,u=d[0],h=d[c-1];if(c>l)return pi(t,d,c/l),ci(t);if(i=hi(d,t,s,l),c>0){for(e=0,n=c-1;e1?(h-u)/(c-1):null,gi(t,i,ot.isNullOrUndef(r)?0:u-r,u),gi(t,i,h,ot.isNullOrUndef(r)?t.length:h+r),ci(t)}return gi(t,i),ci(t)},_tickSize:function(){var t=this,e=t.options.ticks,n=ot.toRadians(t.labelRotation),i=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),a=t._getLabelSizes(),o=e.autoSkipPadding||0,s=a?a.widest.width+o:0,l=a?a.highest.height+o:0;return t.isHorizontal()?l*i>s*r?s/i:l/r:l*r=0&&(o=t),void 0!==a&&(t=n.indexOf(a))>=0&&(s=t),e.minIndex=o,e.maxIndex=s,e.min=n[o],e.max=n[s]},buildTicks:function(){var t=this,e=t._getLabels(),n=t.minIndex,i=t.maxIndex;t.ticks=0===n&&i===e.length-1?e:e.slice(n,i+1)},getLabelForIndex:function(t,e){var n=this,i=n.chart;return i.getDatasetMeta(e).controller._getValueScaleId()===n.id?n.getRightValue(i.data.datasets[e].data[t]):n._getLabels()[t]},_configure:function(){var t=this,e=t.options.offset,n=t.ticks;vi.prototype._configure.call(t),t.isHorizontal()||(t._reversePixels=!t._reversePixels),n&&(t._startValue=t.minIndex-(e?.5:0),t._valueRange=Math.max(n.length-(e?0:1),1))},getPixelForValue:function(t,e,n){var i,r,a,o=this;return bi(e)||bi(n)||(t=o.chart.data.datasets[n].data[e]),bi(t)||(i=o.isHorizontal()?t.x:t.y),(void 0!==i||void 0!==t&&isNaN(e))&&(r=o._getLabels(),t=ot.valueOrDefault(i,t),e=-1!==(a=r.indexOf(t))?a:e,isNaN(e)&&(e=t)),o.getPixelForDecimal((e-o._startValue)/o._valueRange)},getPixelForTick:function(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t],t+this.minIndex)},getValueForPixel:function(t){var e=this,n=Math.round(e._startValue+e.getDecimalForPixel(t)*e._valueRange);return Math.min(Math.max(n,0),e.ticks.length-1)},getBasePixel:function(){return this.bottom}}),xi=yi;_i._defaults=xi;var wi=ot.noop,ki=ot.isNullOrUndef;function Si(t,e){var n,i,r,a,o=[],s=1e-14,l=t.stepSize,d=l||1,c=t.maxTicks-1,u=t.min,h=t.max,f=t.precision,p=e.min,g=e.max,m=ot.niceNum((g-p)/c/d)*d;if(mc&&(m=ot.niceNum(a*m/c/d)*d),l||ki(f)?n=Math.pow(10,ot._decimalPlaces(m)):(n=Math.pow(10,f),m=Math.ceil(m*n)/n),i=Math.floor(p/m)*m,r=Math.ceil(g/m)*m,l&&(!ki(u)&&ot.almostWhole(u/m,m/1e3)&&(i=u),!ki(h)&&ot.almostWhole(h/m,m/1e3)&&(r=h)),a=(r-i)/m,a=ot.almostEquals(a,Math.round(a),m/1e3)?Math.round(a):Math.ceil(a),i=Math.round(i*n)/n,r=Math.round(r*n)/n,o.push(ki(u)?i:u);for(var v=1;v0&&i>0&&(t.min=0)}var r=void 0!==e.min||void 0!==e.suggestedMin,a=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(null===t.min?t.min=e.suggestedMin:t.min=Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(null===t.max?t.max=e.suggestedMax:t.max=Math.max(t.max,e.suggestedMax)),r!==a&&t.min>=t.max&&(r?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:function(){var t,e=this,n=e.options.ticks,i=n.stepSize,r=n.maxTicksLimit;return i?t=Math.ceil(e.max/i)-Math.floor(e.min/i)+1:(t=e._computeTickLimit(),r=r||11),r&&(t=Math.min(r,t)),t},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:wi,buildTicks:function(){var t=this,e=t.options.ticks,n=t.getTickLimit(),i={maxTicks:n=Math.max(2,n),min:e.min,max:e.max,precision:e.precision,stepSize:ot.valueOrDefault(e.fixedStepSize,e.stepSize)},r=t.ticks=Si(i,t);t.handleDirectionalChanges(),t.max=ot.max(r),t.min=ot.min(r),e.reverse?(r.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){var t=this;t.ticksAsNumbers=t.ticks.slice(),t.zeroLineIndex=t.ticks.indexOf(0),vi.prototype.convertTicksToLabels.call(t)},_configure:function(){var t,e=this,n=e.getTicks(),i=e.min,r=e.max;vi.prototype._configure.call(e),e.options.offset&&n.length&&(i-=t=(r-i)/Math.max(n.length-1,1)/2,r+=t),e._startValue=i,e._endValue=r,e._valueRange=r-i}}),Ci={position:"left",ticks:{callback:Jn.formatters.linear}},Di=0,Pi=1;function Ti(t,e,n){var i=[n.type,void 0===e&&void 0===n.stack?n.index:"",n.stack].join(".");return void 0===t[i]&&(t[i]={pos:[],neg:[]}),t[i]}function Ai(t,e,n,i){var r,a,o=t.options,s=Ti(e,o.stacked,n),l=s.pos,d=s.neg,c=i.length;for(r=0;re.length-1?null:this.getPixelForValue(e[t])}}),Fi=Ci;Ni._defaults=Fi;var Ri=ot.valueOrDefault,Li=ot.math.log10;function Ii(t,e){var n,i,r=[],a=Ri(t.min,Math.pow(10,Math.floor(Li(e.min)))),o=Math.floor(Li(e.max)),s=Math.ceil(e.max/Math.pow(10,o));0===a?(n=Math.floor(Li(e.minNotZero)),i=Math.floor(e.minNotZero/Math.pow(10,n)),r.push(a),a=i*Math.pow(10,n)):(n=Math.floor(Li(a)),i=Math.floor(a/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do{r.push(a),10==++i&&(i=1,l=++n>=0?1:l),a=Math.round(i*Math.pow(10,n)*l)/l}while(n=0?t:e}var Yi=vi.extend({determineDataLimits:function(){var t,e,n,i,r,a,o=this,s=o.options,l=o.chart,d=l.data.datasets,c=o.isHorizontal();function u(t){return c?t.xAxisID===o.id:t.yAxisID===o.id}o.min=Number.POSITIVE_INFINITY,o.max=Number.NEGATIVE_INFINITY,o.minNotZero=Number.POSITIVE_INFINITY;var h=s.stacked;if(void 0===h)for(t=0;t0){var e=ot.min(t),n=ot.max(t);o.min=Math.min(o.min,e),o.max=Math.max(o.max,n)}}))}else for(t=0;t0?t.minNotZero=t.min:t.max<1?t.minNotZero=Math.pow(10,Math.floor(Li(t.max))):t.minNotZero=n)},buildTicks:function(){var t=this,e=t.options.ticks,n=!t.isHorizontal(),i={min:Wi(e.min),max:Wi(e.max)},r=t.ticks=Ii(i,t);t.max=ot.max(r),t.min=ot.min(r),e.reverse?(n=!n,t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),n&&r.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),vi.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(t,e){return this._getScaleLabel(this.chart.data.datasets[e].data[t])},getPixelForTick:function(t){var e=this.tickValues;return t<0||t>e.length-1?null:this.getPixelForValue(e[t])},_getFirstTickValue:function(t){var e=Math.floor(Li(t));return Math.floor(t/Math.pow(10,e))*Math.pow(10,e)},_configure:function(){var t=this,e=t.min,n=0;vi.prototype._configure.call(t),0===e&&(e=t._getFirstTickValue(t.minNotZero),n=Ri(t.options.ticks.fontSize,K.global.defaultFontSize)/t._length),t._startValue=Li(e),t._valueOffset=n,t._valueRange=(Li(t.max)-Li(e))/(1-n)},getPixelForValue:function(t){var e=this,n=0;return(t=+e.getRightValue(t))>e.min&&t>0&&(n=(Li(t)-e._startValue)/e._valueRange+e._valueOffset),e.getPixelForDecimal(n)},getValueForPixel:function(t){var e=this,n=e.getDecimalForPixel(t);return 0===n&&0===e.min?0:Math.pow(10,e._startValue+(n-e._valueOffset)*e._valueRange)}}),Vi=Ei;Yi._defaults=Vi;var zi=ot.valueOrDefault,Bi=ot.valueAtIndexOrDefault,Hi=ot.options.resolve,Ui={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:Jn.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}};function ji(t){var e=t.ticks;return e.display&&t.display?zi(e.fontSize,K.global.defaultFontSize)+2*e.backdropPaddingY:0}function qi(t,e,n){return ot.isArray(n)?{w:ot.longestText(t,t.font,n),h:n.length*e}:{w:t.measureText(n).width,h:e}}function Gi(t,e,n,i,r){return t===i||t===r?{start:e-n/2,end:e+n/2}:tr?{start:e-n,end:e}:{start:e,end:e+n}}function $i(t){var e,n,i,r=ot.options._parseFont(t.options.pointLabels),a={l:0,r:t.width,t:0,b:t.height-t.paddingTop},o={};t.ctx.font=r.string,t._pointLabelSizes=[];var s=t.chart.data.labels.length;for(e=0;ea.r&&(a.r=c.end,o.r=l),u.starta.b&&(a.b=u.end,o.b=l)}t.setReductions(t.drawingArea,a,o)}function Zi(t){return 0===t||180===t?"center":t<180?"left":"right"}function Xi(t,e,n,i){var r,a,o=n.y+i/2;if(ot.isArray(e))for(r=0,a=e.length;r270||t<90)&&(n.y-=e.h)}function Ki(t){var e=t.ctx,n=t.options,i=n.pointLabels,r=ji(n),a=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),o=ot.options._parseFont(i);e.save(),e.font=o.string,e.textBaseline="middle";for(var s=t.chart.data.labels.length-1;s>=0;s--){var l=0===s?r/2:0,d=t.getPointPosition(s,a+l+5),c=Bi(i.fontColor,s,K.global.defaultFontColor);e.fillStyle=c;var u=t.getIndexAngle(s),h=ot.toDegrees(u);e.textAlign=Zi(h),Ji(h,t._pointLabelSizes[s],d),Xi(e,t.pointLabels[s],d,o.lineHeight)}e.restore()}function Qi(t,e,n,i){var r,a=t.ctx,o=e.circular,s=t.chart.data.labels.length,l=Bi(e.color,i-1),d=Bi(e.lineWidth,i-1);if((o||s)&&l&&d){if(a.save(),a.strokeStyle=l,a.lineWidth=d,a.setLineDash&&(a.setLineDash(e.borderDash||[]),a.lineDashOffset=e.borderDashOffset||0),a.beginPath(),o)a.arc(t.xCenter,t.yCenter,n,0,2*Math.PI);else{r=t.getPointPosition(0,n),a.moveTo(r.x,r.y);for(var c=1;c0&&i>0?n:0)},_drawGrid:function(){var t,e,n,i=this,r=i.ctx,a=i.options,o=a.gridLines,s=a.angleLines,l=zi(s.lineWidth,o.lineWidth),d=zi(s.color,o.color);if(a.pointLabels.display&&Ki(i),o.display&&ot.each(i.ticks,(function(t,n){0!==n&&(e=i.getDistanceFromCenterForValue(i.ticksAsNumbers[n]),Qi(i,o,e,n))})),s.display&&l&&d){for(r.save(),r.lineWidth=l,r.strokeStyle=d,r.setLineDash&&(r.setLineDash(Hi([s.borderDash,o.borderDash,[]])),r.lineDashOffset=Hi([s.borderDashOffset,o.borderDashOffset,0])),t=i.chart.data.labels.length-1;t>=0;t--)e=i.getDistanceFromCenterForValue(a.ticks.reverse?i.min:i.max),n=i.getPointPosition(t,e),r.beginPath(),r.moveTo(i.xCenter,i.yCenter),r.lineTo(n.x,n.y),r.stroke();r.restore()}},_drawLabels:function(){var t=this,e=t.ctx,n=t.options.ticks;if(n.display){var i,r,a=t.getIndexAngle(0),o=ot.options._parseFont(n),s=zi(n.fontColor,K.global.defaultFontColor);e.save(),e.font=o.string,e.translate(t.xCenter,t.yCenter),e.rotate(a),e.textAlign="center",e.textBaseline="middle",ot.each(t.ticks,(function(a,l){(0!==l||n.reverse)&&(i=t.getDistanceFromCenterForValue(t.ticksAsNumbers[l]),n.showLabelBackdrop&&(r=e.measureText(a).width,e.fillStyle=n.backdropColor,e.fillRect(-r/2-n.backdropPaddingX,-i-o.size/2-n.backdropPaddingY,r+2*n.backdropPaddingX,o.size+2*n.backdropPaddingY)),e.fillStyle=s,e.fillText(a,0,-i))})),e.restore()}},_drawTitle:ot.noop}),nr=Ui;er._defaults=nr;var ir=ot._deprecated,rr=ot.options.resolve,ar=ot.valueOrDefault,or=Number.MIN_SAFE_INTEGER||-9007199254740991,sr=Number.MAX_SAFE_INTEGER||9007199254740991,lr={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}},dr=Object.keys(lr);function cr(t,e){return t-e}function ur(t){var e,n,i,r={},a=[];for(e=0,n=t.length;ee&&s=0&&o<=s;){if(r=t[(i=o+s>>1)-1]||null,a=t[i],!r)return{lo:null,hi:a};if(a[e]n))return{lo:r,hi:a};s=i-1}}return{lo:a,hi:null}}function mr(t,e,n,i){var r=gr(t,e,n),a=r.lo?r.hi?r.lo:t[t.length-2]:t[0],o=r.lo?r.hi?r.hi:t[t.length-1]:t[1],s=o[e]-a[e],l=s?(n-a[e])/s:0,d=(o[i]-a[i])*l;return a[i]+d}function vr(t,e){var n=t._adapter,i=t.options.time,r=i.parser,a=r||i.format,o=e;return"function"==typeof r&&(o=r(o)),ot.isFinite(o)||(o="string"==typeof a?n.parse(o,a):n.parse(o)),null!==o?+o:(r||"function"!=typeof a||(o=a(e),ot.isFinite(o)||(o=n.parse(o))),o)}function br(t,e){if(ot.isNullOrUndef(e))return null;var n=t.options.time,i=vr(t,t.getRightValue(e));return null===i||n.round&&(i=+t._adapter.startOf(i,n.round)),i}function yr(t,e,n,i){var r,a,o,s=dr.length;for(r=dr.indexOf(t);r=dr.indexOf(n);a--)if(o=dr[a],lr[o].common&&t._adapter.diff(r,i,o)>=e-1)return o;return dr[n?dr.indexOf(n):0]}function xr(t){for(var e=dr.indexOf(t)+1,n=dr.length;e1e5*d)throw e+" and "+n+" are too far apart with stepSize of "+d+" "+l;for(r=u;r=0&&(e[a].major=!0);return e}function Mr(t,e,n){var i,r,a=[],o={},s=e.length;for(i=0;i1?ur(p).sort(cr):p.sort(cr),h=Math.min(h,p[0]),f=Math.max(f,p[p.length-1])),h=br(s,hr(c))||h,f=br(s,fr(c))||f,h=h===sr?+d.startOf(Date.now(),u):h,f=f===or?+d.endOf(Date.now(),u)+1:f,s.min=Math.min(h,f),s.max=Math.max(h+1,f),s._table=[],s._timestamps={data:p,datasets:g,labels:m}},buildTicks:function(){var t,e,n,i=this,r=i.min,a=i.max,o=i.options,s=o.ticks,l=o.time,d=i._timestamps,c=[],u=i.getLabelCapacity(r),h=s.source,f=o.distribution;for(d="data"===h||"auto"===h&&"series"===f?d.data:"labels"===h?d.labels:wr(i,r,a,u),"ticks"===o.bounds&&d.length&&(r=d[0],a=d[d.length-1]),r=br(i,hr(o))||r,a=br(i,fr(o))||a,t=0,e=d.length;t=r&&n<=a&&c.push(n);return i.min=r,i.max=a,i._unit=l.unit||(s.autoSkip?yr(l.minUnit,i.min,i.max,u):_r(i,c.length,l.minUnit,i.min,i.max)),i._majorUnit=s.major.enabled&&"year"!==i._unit?xr(i._unit):void 0,i._table=pr(i._timestamps.data,r,a,f),i._offsets=kr(i._table,c,r,a,o),s.reverse&&c.reverse(),Mr(i,c,i._majorUnit)},getLabelForIndex:function(t,e){var n=this,i=n._adapter,r=n.chart.data,a=n.options.time,o=r.labels&&t=0&&t0?s:1}}),Pr=Cr;Dr._defaults=Pr;var Tr={category:_i,linear:Ni,logarithmic:Yi,radialLinear:er,time:Dr},Ar={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"};Xn._date.override("function"==typeof t?{_id:"moment",formats:function(){return Ar},parse:function(e,n){return"string"==typeof e&&"string"==typeof n?e=t(e,n):e instanceof t||(e=t(e)),e.isValid()?e.valueOf():null},format:function(e,n){return t(e).format(n)},add:function(e,n,i){return t(e).add(n,i).valueOf()},diff:function(e,n,i){return t(e).diff(t(n),i)},startOf:function(e,n,i){return e=t(e),"isoWeek"===n?e.isoWeekday(i).valueOf():e.startOf(n).valueOf()},endOf:function(e,n){return t(e).endOf(n).valueOf()},_create:function(e){return t(e)}}:{}),K._set("global",{plugins:{filler:{propagate:!0}}});var Or={dataset:function(t){var e=t.fill,n=t.chart,i=n.getDatasetMeta(e),r=i&&n.isDatasetVisible(e)&&i.dataset._children||[],a=r.length||0;return a?function(t,e){return e=n)&&i;switch(a){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return a;default:return!1}}function Fr(t){var e,n=t.el._model||{},i=t.el._scale||{},r=t.fill,a=null;if(isFinite(r))return null;if("start"===r?a=void 0===n.scaleBottom?i.bottom:n.scaleBottom:"end"===r?a=void 0===n.scaleTop?i.top:n.scaleTop:void 0!==n.scaleZero?a=n.scaleZero:i.getBasePixel&&(a=i.getBasePixel()),null!=a){if(void 0!==a.x&&void 0!==a.y)return a;if(ot.isFinite(a))return{x:(e=i.isHorizontal())?a:null,y:e?null:a}}return null}function Rr(t){var e,n,i,r,a,o=t.el._scale,s=o.options,l=o.chart.data.labels.length,d=t.fill,c=[];if(!l)return null;for(e=s.ticks.reverse?o.max:o.min,n=s.ticks.reverse?o.min:o.max,i=o.getPointPositionForValue(0,e),r=0;r0;--a)ot.canvas.lineTo(t,n[a],n[a-1],!0);else for(o=n[0].cx,s=n[0].cy,l=Math.sqrt(Math.pow(n[0].x-o,2)+Math.pow(n[0].y-s,2)),a=r-1;a>0;--a)t.arc(o,s,l,n[a].angle,n[a-1].angle,!0)}}function Vr(t,e,n,i,r,a){var o,s,l,d,c,u,h,f,p=e.length,g=i.spanGaps,m=[],v=[],b=0,y=0;for(t.beginPath(),o=0,s=p;o=0;--n)(e=l[n].$filler)&&e.visible&&(r=(i=e.el)._view,a=i._children||[],o=e.mapper,s=r.backgroundColor||K.global.defaultColor,o&&s&&a.length&&(ot.canvas.clipArea(d,t.chartArea),Vr(d,a,o,r,s,i._loop),ot.canvas.unclipArea(d)))}},Br=ot.rtl.getRtlAdapter,Hr=ot.noop,Ur=ot.valueOrDefault;function jr(t,e){return t.usePointStyle&&t.boxWidth>e?e:t.boxWidth}K._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var n=e.datasetIndex,i=this.chart,r=i.getDatasetMeta(n);r.hidden=null===r.hidden?!i.data.datasets[n].hidden:null,i.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data.datasets,n=t.options.legend||{},i=n.labels&&n.labels.usePointStyle;return t._getSortedDatasetMetas().map((function(n){var r=n.controller.getStyle(i?0:void 0);return{text:e[n.index].label,fillStyle:r.backgroundColor,hidden:!t.isDatasetVisible(n.index),lineCap:r.borderCapStyle,lineDash:r.borderDash,lineDashOffset:r.borderDashOffset,lineJoin:r.borderJoinStyle,lineWidth:r.borderWidth,strokeStyle:r.borderColor,pointStyle:r.pointStyle,rotation:r.rotation,datasetIndex:n.index}}),this)}}},legendCallback:function(t){var e,n,i,r=document.createElement("ul"),a=t.data.datasets;for(r.setAttribute("class",t.id+"-legend"),e=0,n=a.length;el.width)&&(u+=o+n.padding,c[c.length-(e>0?0:1)]=0),s[e]={left:0,top:0,width:i,height:o},c[c.length-1]+=i+n.padding})),l.height+=u}else{var h=n.padding,f=t.columnWidths=[],p=t.columnHeights=[],g=n.padding,m=0,v=0;ot.each(t.legendItems,(function(t,e){var i=jr(n,o)+o/2+r.measureText(t.text).width;e>0&&v+o+2*h>l.height&&(g+=m+n.padding,f.push(m),p.push(v),m=0,v=0),m=Math.max(m,i),v+=o+h,s[e]={left:0,top:0,width:i,height:o}})),g+=m,f.push(m),p.push(v),l.width+=g}t.width=l.width,t.height=l.height}else t.width=l.width=t.height=l.height=0},afterFit:Hr,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,n=e.labels,i=K.global,r=i.defaultColor,a=i.elements.line,o=t.height,s=t.columnHeights,l=t.width,d=t.lineWidths;if(e.display){var c,u=Br(e.rtl,t.left,t.minSize.width),h=t.ctx,f=Ur(n.fontColor,i.defaultFontColor),p=ot.options._parseFont(n),g=p.size;h.textAlign=u.textAlign("left"),h.textBaseline="middle",h.lineWidth=.5,h.strokeStyle=f,h.fillStyle=f,h.font=p.string;var m=jr(n,g),v=t.legendHitBoxes,b=function(t,e,i){if(!(isNaN(m)||m<=0)){h.save();var o=Ur(i.lineWidth,a.borderWidth);if(h.fillStyle=Ur(i.fillStyle,r),h.lineCap=Ur(i.lineCap,a.borderCapStyle),h.lineDashOffset=Ur(i.lineDashOffset,a.borderDashOffset),h.lineJoin=Ur(i.lineJoin,a.borderJoinStyle),h.lineWidth=o,h.strokeStyle=Ur(i.strokeStyle,r),h.setLineDash&&h.setLineDash(Ur(i.lineDash,a.borderDash)),n&&n.usePointStyle){var s=m*Math.SQRT2/2,l=u.xPlus(t,m/2),d=e+g/2;ot.canvas.drawPoint(h,i.pointStyle,s,l,d,i.rotation)}else h.fillRect(u.leftForLtr(t,m),e,m,g),0!==o&&h.strokeRect(u.leftForLtr(t,m),e,m,g);h.restore()}},y=function(t,e,n,i){var r=g/2,a=u.xPlus(t,m+r),o=e+r;h.fillText(n.text,a,o),n.hidden&&(h.beginPath(),h.lineWidth=2,h.moveTo(a,o),h.lineTo(u.xPlus(a,i),o),h.stroke())},_=function(t,i){switch(e.align){case"start":return n.padding;case"end":return t-i;default:return(t-i+n.padding)/2}},x=t.isHorizontal();c=x?{x:t.left+_(l,d[0]),y:t.top+n.padding,line:0}:{x:t.left+n.padding,y:t.top+_(o,s[0]),line:0},ot.rtl.overrideTextDirection(t.ctx,e.textDirection);var w=g+n.padding;ot.each(t.legendItems,(function(e,i){var r=h.measureText(e.text).width,a=m+g/2+r,f=c.x,p=c.y;u.setWidth(t.minSize.width),x?i>0&&f+a+n.padding>t.left+t.minSize.width&&(p=c.y+=w,c.line++,f=c.x=t.left+_(l,d[c.line])):i>0&&p+w>t.top+t.minSize.height&&(f=c.x=f+t.columnWidths[c.line]+n.padding,c.line++,p=c.y=t.top+_(o,s[c.line]));var k=u.x(f);b(k,p,e),v[i].left=u.leftForLtr(k,v[i].width),v[i].top=p,y(k,p,e,r),x?c.x+=a+n.padding:c.y+=w})),ot.rtl.restoreTextDirection(t.ctx,e.textDirection)}},_getLegendItemAt:function(t,e){var n,i,r,a=this;if(t>=a.left&&t<=a.right&&e>=a.top&&e<=a.bottom)for(r=a.legendHitBoxes,n=0;n=(i=r[n]).left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height)return a.legendItems[n];return null},handleEvent:function(t){var e,n=this,i=n.options,r="mouseup"===t.type?"click":t.type;if("mousemove"===r){if(!i.onHover&&!i.onLeave)return}else{if("click"!==r)return;if(!i.onClick)return}e=n._getLegendItemAt(t.x,t.y),"click"===r?e&&i.onClick&&i.onClick.call(n,t.native,e):(i.onLeave&&e!==n._hoveredItem&&(n._hoveredItem&&i.onLeave.call(n,t.native,n._hoveredItem),n._hoveredItem=e),i.onHover&&e&&i.onHover.call(n,t.native,e))}});function Gr(t,e){var n=new qr({ctx:t.ctx,options:e,chart:t});Ue.configure(t,n,e),Ue.addBox(t,n),t.legend=n}var $r={id:"legend",_element:qr,beforeInit:function(t){var e=t.options.legend;e&&Gr(t,e)},beforeUpdate:function(t){var e=t.options.legend,n=t.legend;e?(ot.mergeIf(e,K.global.legend),n?(Ue.configure(t,n,e),n.options=e):Gr(t,e)):n&&(Ue.removeBox(t,n),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}},Zr=ot.noop;K._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var Xr=pt.extend({initialize:function(t){var e=this;ot.extend(e,t),e.legendHitBoxes=[]},beforeUpdate:Zr,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:Zr,beforeSetDimensions:Zr,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:Zr,beforeBuildLabels:Zr,buildLabels:Zr,afterBuildLabels:Zr,beforeFit:Zr,fit:function(){var t,e=this,n=e.options,i=e.minSize={},r=e.isHorizontal();n.display?(t=(ot.isArray(n.text)?n.text.length:1)*ot.options._parseFont(n).lineHeight+2*n.padding,e.width=i.width=r?e.maxWidth:t,e.height=i.height=r?t:e.maxHeight):e.width=i.width=e.height=i.height=0},afterFit:Zr,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,n=t.options;if(n.display){var i,r,a,o=ot.options._parseFont(n),s=o.lineHeight,l=s/2+n.padding,d=0,c=t.top,u=t.left,h=t.bottom,f=t.right;e.fillStyle=ot.valueOrDefault(n.fontColor,K.global.defaultFontColor),e.font=o.string,t.isHorizontal()?(r=u+(f-u)/2,a=c+l,i=f-u):(r="left"===n.position?u+l:f-l,a=c+(h-c)/2,i=h-c,d=Math.PI*("left"===n.position?-.5:.5)),e.save(),e.translate(r,a),e.rotate(d),e.textAlign="center",e.textBaseline="middle";var p=n.text;if(ot.isArray(p))for(var g=0,m=0;m{this.chart&&this.chart.resize()}))}static get styles(){return tt`:host{position:relative;height:100%;width:100%;display:block;min-height:25rem}canvas{width:100px;height:100px}`}firstUpdated(){fetch(this.url).then((t=>t.json())).catch((t=>console.error(t))).then((t=>{var e;let n=(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("canvas")).getContext("2d");this.chart=new ot(n,{type:"bar",data:{datasets:[{label:"Failed Logins",backgroundColor:"rgba(201, 25, 11, .5)",spanGaps:!0,data:t.logins_failed_per_1h},{label:"Successful Logins",backgroundColor:"rgba(189, 229, 184, .5)",spanGaps:!0,data:t.logins_per_1h}]},options:{maintainAspectRatio:!1,spanGaps:!0,scales:{xAxes:[{stacked:!0,gridLines:{color:"rgba(0, 0, 0, 0)"},type:"time",offset:!0,ticks:{callback:function(t,e,n){const i=n[e],r=Date.now()-i.value;return Math.round(r/1e3/3600)+" Hours ago"},autoSkip:!0,maxTicksLimit:8}}],yAxes:[{stacked:!0,gridLines:{color:"rgba(0, 0, 0, 0)"}}]}}})}))}render(){return E``}};t([X()],st.prototype,"url",void 0),st=t([$("pb-admin-logins-chart")],st);let lt=class extends nt{constructor(){super(),this.paths=[],this.activePath=window.location.hash.slice(1,1/0),window.addEventListener("hashchange",(t=>{this.activePath=window.location.hash.slice(1,1/0)})),this.querySelectorAll(".pf-c-nav__link").forEach((t=>{var e;let n=null===(e=t.attributes.getNamedItem("pb-url-prefix"))||void 0===e?void 0:e.value;if(!n){const e=new URL(t.href);if(""===e.hash)return void console.log("Ignoring "+t);n=`^${e.hash.slice(1,1/0)}$`}const i=RegExp(n);this.paths.push({anchor:t,match:i})}))}render(){return console.log(this.activePath),this.paths.forEach((t=>{t.match.exec(this.activePath)?t.anchor.classList.add("pf-m-current"):t.anchor.classList.remove("pf-m-current")})),E``}};t([X()],lt.prototype,"activePath",void 0),lt=t([$("pb-admin-sidebar")],lt);const dt={error:"fas fa-exclamation-circle",warning:"fas fa-exclamation-triangle",success:"fas fa-check-circle",info:"fas fa-info"};function ct(){(null===document||void 0===document?void 0:document.querySelector("pb-messages")).fetchMessages()}let ut=class extends nt{constructor(){super(...arguments),this.url="",this.messages=[]}createRenderRoot(){return this}firstUpdated(){this.fetchMessages()}fetchMessages(){return fetch(this.url).then((t=>t.json())).then((t=>this.messages=t)).then((t=>{const e=this.querySelector(".pf-c-alert-group");t.forEach((t=>{const n=this.renderMessage(t);e.appendChild(n)}))}))}renderMessage(t){const e="pb-message"+Math.random().toString(36).substr(2,9);const n=document.createElement("template");return n.innerHTML=`
    • \n
      \n
      \n \n
      \n

      \n ${t.message}\n

      \n
      \n
    • `,setTimeout((()=>{var t;null===(t=this.querySelector("#"+e))||void 0===t||t.remove()}),1500),n.content.firstChild}render(){return E`
        `}};t([X()],ut.prototype,"url",void 0),t([X()],ut.prototype,"messages",void 0),ut=t([$("pb-messages")],ut);const ht=["pf-m-progress","pf-m-in-progress"];let ft=class extends nt{constructor(){var t;super(),this.url="",this.isRunning=!1,null===(t=this.querySelector("button"))||void 0===t||t.addEventListener("click",(t=>this.callAction()))}setLoading(){this.isRunning=!0,this.classList.add(...ht)}setDone(t){this.isRunning=!1,this.classList.remove(...ht),this.classList.replace("pf-m-primary",t),ct(),setTimeout((()=>{this.classList.replace(t,"pf-m-primary")}),1e3)}callAction(){if(!0===this.isRunning)return;this.setLoading();const t=function(t){let e=null;if(document.cookie&&""!==document.cookie){const n=document.cookie.split(";");for(let i=0;it.json())).then((t=>{this.setDone("pf-m-success")})).catch((()=>{this.setDone("pf-m-danger")}))}render(){return E``}};t([X()],ft.prototype,"url",void 0),ft=t([$("pb-action-button")],ft);let pt=class extends nt{constructor(){super();const t=this.querySelector(".pf-c-dropdown__menu");this.querySelectorAll("button").forEach((e=>{e.addEventListener("click",(e=>{t.hidden=!t.hidden}))}))}render(){return E``}};pt=t([$("pb-dropdown")],pt);let gt=class extends nt{constructor(){super(...arguments),this.url="",this.key="",this.value=""}comparison(t){let e={"<":function(t,e){return t":function(t,e){return t>e},">=":function(t,e){return t>=e},"<=":function(t,e){return t<=e},"==":function(t,e){return t==e},"!=":function(t,e){return t!=e},"===":function(t,e){return t===e},"!==":function(t,e){return t!==e}};const n=t.split(" ");if(n.length<3)throw new Error("nah");let i=n[0];i="value"===i?this.value:parseInt(i,10);let r=n[2];r="value"===r?this.value:parseInt(r,10);const a=n[1];if(!(a in e))throw new Error("Invalid comparison");return e[a](i,r)}firstUpdated(){fetch(this.url).then((t=>t.json())).then((t=>t[this.key])).then((t=>this.value=t))}render(){if(void 0===this.value)return E``;let t="";return this.querySelectorAll("[slot]").forEach((e=>{const n=e.getAttribute("slot");this.comparison(n)&&(t=n)})),this.querySelectorAll("[data-value]").forEach((t=>{t.textContent=this.value})),E``}};var mt;t([X()],gt.prototype,"url",void 0),t([X()],gt.prototype,"key",void 0),t([X()],gt.prototype,"value",void 0),gt=t([$("fetch-fill-slot")],gt),function(t){t[t.redirect=0]="redirect",t[t.template=1]="template"}(mt||(mt={}));let vt=class extends nt{constructor(){super(...arguments),this.flowBodyUrl=""}createRenderRoot(){return this}firstUpdated(){fetch(this.flowBodyUrl).then((t=>{if(!t.ok)throw Error(t.statusText);return t})).then((t=>t.json())).then((t=>{this.updateCard(t)})).catch((t=>{this.errorMessage(t)}))}async updateCard(t){switch(t.type){case mt.redirect:window.location.assign(t.to);break;case mt.template:this.flowBody=t.body,await this.requestUpdate(),this.checkAutofocus(),ct(),this.loadFormCode(),this.setFormSubmitHandlers()}}loadFormCode(){this.querySelectorAll("script").forEach((t=>{let e=document.createElement("script");e.src=t.src,document.head.appendChild(e)}))}checkAutofocus(){const t=this.querySelector("[autofocus]");null!==t&&t.focus()}updateFormAction(t){for(let e=0;e{console.log("passbook/flows: Checking for autosubmit attribute "+t),this.checkAutosubmit(t),console.log("passbook/flows: Setting action for form "+t),this.updateFormAction(t),console.log("passbook/flows: Adding handler for form "+t),t.addEventListener("submit",(e=>{e.preventDefault();let n=new FormData(t);this.flowBody=void 0,fetch(this.flowBodyUrl,{method:"post",body:n}).then((t=>t.json())).then((t=>{this.updateCard(t)})).catch((t=>{this.errorMessage(t)}))})),t.classList.add("pb-flow-wrapped")}))}errorMessage(t){this.flowBody=`\n \n \n `}loading(){return E``}render(){return void 0!==this.flowBody?E`${this.flowBody}`:this.loading()}};t([X()],vt.prototype,"flowBodyUrl",void 0),t([X()],vt.prototype,"flowBody",void 0),vt=t([$("flow-shell-card")],vt);let bt=class extends nt{constructor(){super(...arguments),this._currentPage="",this._firstPage=""}get currentPage(){return this._currentPage}set currentPage(t){var e,n;try{null===(e=this.querySelector(`.pf-c-tab-content[tab-name='${t}']`))||void 0===e||e.removeAttribute("hidden"),null===(n=this.querySelector(`.pf-c-tabs__item[tab-name='${t}']`))||void 0===n||n.classList.add("pf-m-current"),this.querySelectorAll(`.pf-c-tab-content:not([tab-name='${t}'])`).forEach((t=>{t.setAttribute("hidden","")})),this.querySelectorAll(`.pf-c-tabs__item:not([tab-name='${t}'])`).forEach((t=>{t.classList.remove("pf-m-current")})),window.location.hash="#"+t,this._currentPage=t}catch(t){this.currentPage=this._firstPage}}createRenderRoot(){return this}firstUpdated(){var t;this._firstPage=null===(t=this.querySelector(".pf-c-tab-content"))||void 0===t?void 0:t.getAttribute("tab-name"),window.location.hash?this.currentPage=window.location.hash:this.currentPage=this._firstPage,this.querySelectorAll(".pf-c-tabs__item > button").forEach((t=>{t.addEventListener("click",(e=>{var n;let i=null===(n=t.parentElement)||void 0===n?void 0:n.getAttribute("tab-name");this.currentPage=i}))}))}};bt=t([$("pb-tabs")],bt);const yt=new CSSStyleSheet;yt.replaceSync(".pf-c-modal-box {\n --pf-c-modal-box--BackgroundColor: var(--pf-global--BackgroundColor--100);\n --pf-c-modal-box--BoxShadow: var(--pf-global--BoxShadow--xl);\n --pf-c-modal-box--ZIndex: var(--pf-global--ZIndex--xl);\n --pf-c-modal-box--Width: 100%;\n --pf-c-modal-box--MaxWidth: calc(100% - var(--pf-global--spacer--xl));\n --pf-c-modal-box--m-sm--sm--MaxWidth: 35rem;\n --pf-c-modal-box--m-md--Width: 52.5rem;\n --pf-c-modal-box--m-lg--lg--MaxWidth: 70rem;\n --pf-c-modal-box--MaxHeight: calc(100% - var(--pf-global--spacer--2xl));\n --pf-c-modal-box--m-align-top--spacer: var(--pf-global--spacer--sm);\n --pf-c-modal-box--m-align-top--xl--spacer: var(--pf-global--spacer--xl);\n --pf-c-modal-box--m-align-top--MarginTop: var(--pf-c-modal-box--m-align-top--spacer);\n --pf-c-modal-box--m-align-top--MaxHeight: calc(100% - min(var(--pf-c-modal-box--m-align-top--spacer), var(--pf-global--spacer--2xl)) - var(--pf-c-modal-box--m-align-top--spacer));\n --pf-c-modal-box--m-align-top--MaxWidth: calc(100% - min(var(--pf-c-modal-box--m-align-top--spacer) * 2, var(--pf-global--spacer--xl)));\n --pf-c-modal-box--m-danger__title-icon--Color: var(--pf-global--danger-color--100);\n --pf-c-modal-box--m-warning__title-icon--Color: var(--pf-global--warning-color--100);\n --pf-c-modal-box--m-success__title-icon--Color: var(--pf-global--success-color--100);\n --pf-c-modal-box--m-info__title-icon--Color: var(--pf-global--info-color--100);\n --pf-c-modal-box--m-default__title-icon--Color: var(--pf-global--default-color--200);\n --pf-c-modal-box__header--PaddingTop: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--PaddingRight: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--PaddingLeft: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--last-child--PaddingBottom: var(--pf-global--spacer--lg);\n --pf-c-modal-box__title--LineHeight: var(--pf-global--LineHeight--sm);\n --pf-c-modal-box__title--FontFamily: var(--pf-global--FontFamily--heading--sans-serif);\n --pf-c-modal-box__title--FontSize: var(--pf-global--FontSize--2xl);\n --pf-c-modal-box__title-icon--MarginRight: var(--pf-global--spacer--sm);\n --pf-c-modal-box__title-icon--Color: var(--pf-global--Color--100);\n --pf-c-modal-box__description--PaddingTop: var(--pf-global--spacer--xs);\n --pf-c-modal-box__body--MinHeight: calc(var(--pf-global--FontSize--md) * var(--pf-global--LineHeight--md));\n --pf-c-modal-box__body--PaddingTop: var(--pf-global--spacer--lg);\n --pf-c-modal-box__body--PaddingRight: var(--pf-global--spacer--lg);\n --pf-c-modal-box__body--PaddingLeft: var(--pf-global--spacer--lg);\n --pf-c-modal-box__body--last-child--PaddingBottom: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--body--PaddingTop: var(--pf-global--spacer--md);\n --pf-c-modal-box--c-button--Top: calc(var(--pf-global--spacer--lg));\n --pf-c-modal-box--c-button--Right: var(--pf-global--spacer--md);\n --pf-c-modal-box--c-button--sibling--MarginRight: calc(var(--pf-global--spacer--xl) + var(--pf-global--spacer--sm));\n --pf-c-modal-box__footer--PaddingTop: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--PaddingRight: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--PaddingBottom: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--PaddingLeft: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--c-button--MarginRight: var(--pf-global--spacer--md);\n --pf-c-modal-box__footer--c-button--sm--MarginRight: calc(var(--pf-c-modal-box__footer--c-button--MarginRight) / 2);\n position: relative;\n z-index: var(--pf-c-modal-box--ZIndex);\n display: flex;\n flex-direction: column;\n width: var(--pf-c-modal-box--Width);\n max-width: var(--pf-c-modal-box--MaxWidth);\n max-height: var(--pf-c-modal-box--MaxHeight);\n background-color: var(--pf-c-modal-box--BackgroundColor);\n box-shadow: var(--pf-c-modal-box--BoxShadow); }\n @media (min-width: 1200px) {\n .pf-c-modal-box {\n --pf-c-modal-box--m-align-top--spacer: var(--pf-c-modal-box--m-align-top--xl--spacer); } }\n .pf-c-modal-box.pf-m-sm {\n --pf-c-modal-box--Width: var(--pf-c-modal-box--m-sm--sm--MaxWidth); }\n .pf-c-modal-box.pf-m-md {\n --pf-c-modal-box--Width: var(--pf-c-modal-box--m-md--Width); }\n .pf-c-modal-box.pf-m-lg {\n --pf-c-modal-box--Width: var(--pf-c-modal-box--m-lg--lg--MaxWidth); }\n .pf-c-modal-box.pf-m-align-top {\n top: var(--pf-c-modal-box--m-align-top--MarginTop);\n align-self: flex-start;\n max-width: var(--pf-c-modal-box--m-align-top--MaxWidth);\n max-height: var(--pf-c-modal-box--m-align-top--MaxHeight); }\n .pf-c-modal-box.pf-m-danger {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-danger__title-icon--Color); }\n .pf-c-modal-box.pf-m-warning {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-warning__title-icon--Color); }\n .pf-c-modal-box.pf-m-success {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-success__title-icon--Color); }\n .pf-c-modal-box.pf-m-default {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-default__title-icon--Color); }\n .pf-c-modal-box.pf-m-info {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-info__title-icon--Color); }\n .pf-c-modal-box > .pf-c-button {\n position: absolute;\n top: var(--pf-c-modal-box--c-button--Top);\n right: var(--pf-c-modal-box--c-button--Right); }\n .pf-c-modal-box > .pf-c-button + * {\n margin-right: var(--pf-c-modal-box--c-button--sibling--MarginRight); }\n\n.pf-c-modal-box__header {\n display: flex;\n flex-direction: column;\n padding-top: var(--pf-c-modal-box__header--PaddingTop);\n padding-right: var(--pf-c-modal-box__header--PaddingRight);\n padding-left: var(--pf-c-modal-box__header--PaddingLeft); }\n .pf-c-modal-box__header.pf-m-help {\n display: flex;\n flex-direction: row; }\n .pf-c-modal-box__header:last-child {\n padding-bottom: var(--pf-c-modal-box__header--last-child--PaddingBottom); }\n .pf-c-modal-box__header + .pf-c-modal-box__body {\n --pf-c-modal-box__body--PaddingTop: var(--pf-c-modal-box__header--body--PaddingTop); }\n\n.pf-c-modal-box__header-main {\n flex-grow: 1;\n min-width: 0; }\n\n.pf-c-modal-box__title,\n.pf-c-modal-box__title-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap; }\n\n.pf-c-modal-box__title {\n flex: 0 0 auto;\n font-family: var(--pf-c-modal-box__title--FontFamily);\n font-size: var(--pf-c-modal-box__title--FontSize);\n line-height: var(--pf-c-modal-box__title--LineHeight); }\n .pf-c-modal-box__title.pf-m-icon {\n display: flex; }\n\n.pf-c-modal-box__title-icon {\n margin-right: var(--pf-c-modal-box__title-icon--MarginRight);\n color: var(--pf-c-modal-box__title-icon--Color); }\n\n.pf-c-modal-box__description {\n padding-top: var(--pf-c-modal-box__description--PaddingTop); }\n\n.pf-c-modal-box__body {\n flex: 1 1 auto;\n min-height: var(--pf-c-modal-box__body--MinHeight);\n padding-top: var(--pf-c-modal-box__body--PaddingTop);\n padding-right: var(--pf-c-modal-box__body--PaddingRight);\n padding-left: var(--pf-c-modal-box__body--PaddingLeft);\n overflow-x: hidden;\n overflow-y: auto;\n overscroll-behavior: contain;\n word-break: break-word;\n -webkit-overflow-scrolling: touch; }\n .pf-c-modal-box__body:last-child {\n padding-bottom: var(--pf-c-modal-box__body--last-child--PaddingBottom); }\n\n.pf-c-modal-box__footer {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n padding-top: var(--pf-c-modal-box__footer--PaddingTop);\n padding-right: var(--pf-c-modal-box__footer--PaddingRight);\n padding-bottom: var(--pf-c-modal-box__footer--PaddingBottom);\n padding-left: var(--pf-c-modal-box__footer--PaddingLeft); }\n .pf-c-modal-box__footer > .pf-c-button:not(:last-child) {\n margin-right: var(--pf-c-modal-box__footer--c-button--MarginRight); }\n @media screen and (min-width: 576px) {\n .pf-c-modal-box__footer > .pf-c-button:not(:last-child) {\n --pf-c-modal-box__footer--c-button--MarginRight: var(--pf-c-modal-box__footer--c-button--sm--MarginRight); } }\n");const _t=new CSSStyleSheet;_t.replaceSync(".pf-l-bullseye {\n --pf-l-bullseye--Padding: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n padding: var(--pf-l-bullseye--Padding);\n margin: 0; }\n");const xt=new CSSStyleSheet;xt.replaceSync(".pf-c-backdrop {\n --pf-c-backdrop--ZIndex: var(--pf-global--ZIndex--lg);\n --pf-c-backdrop--BackgroundColor: var(--pf-global--BackgroundColor--dark-transparent-100);\n position: fixed;\n top: 0;\n left: 0;\n z-index: var(--pf-c-backdrop--ZIndex);\n width: 100%;\n height: 100%;\n background-color: var(--pf-c-backdrop--BackgroundColor); }\n\n.pf-c-backdrop__open {\n overflow: hidden; }\n");let wt=class extends nt{constructor(){super(...arguments),this.href="",this.open=!1}static get styles(){return[yt,_t,xt]}setContent(t){this.querySelector("[slot=modal]").innerHTML=t,this.querySelectorAll("[slot=modal] a").forEach((t=>{t.addEventListener("click",(t=>{t.preventDefault(),this.open=!1}))})),this.querySelectorAll("[slot=modal] form").forEach((t=>{t.addEventListener("submit",(e=>{e.preventDefault();let n=new FormData(t);fetch(t.action===window.location.toString()?this.href:t.action,{method:t.method,body:n}).then((t=>t.text())).then((t=>{-1!==t.indexOf("csrfmiddlewaretoken")?this.setContent(t):(this.open=!1,this.dispatchEvent(new CustomEvent("hashchange",{bubbles:!0})),ct())})).catch((t=>{console.error(t)}))}))}))}onClick(t){const e=new Request(this.href);fetch(e,{mode:"same-origin"}).then((t=>t.text())).then((t=>{this.setContent(t),this.open=!0})).catch((t=>{console.error(t)}))}renderModal(){return E`
        `}render(){return E`${this.open?this.renderModal():""}`}};t([X()],wt.prototype,"href",void 0),t([X()],wt.prototype,"open",void 0),wt=t([$("pb-modal-button")],wt);const kt=new CSSStyleSheet;kt.replaceSync('.pf-c-spinner {\n --pf-c-spinner--AnimationDuration: 1.5s;\n --pf-c-spinner--AnimationTimingFunction: cubic-bezier(.77, .005, .315, 1);\n --pf-c-spinner--diameter: var(--pf-global--icon--FontSize--xl);\n --pf-c-spinner--stroke-width-multiplier: .1;\n --pf-c-spinner--stroke-width: calc(var(--pf-c-spinner--diameter) * var(--pf-c-spinner--stroke-width-multiplier));\n --pf-c-spinner--Width: var(--pf-c-spinner--diameter);\n --pf-c-spinner--Height: var(--pf-c-spinner--diameter);\n --pf-c-spinner--Color: var(--pf-global--primary-color--100);\n --pf-c-spinner--m-sm--diameter: var(--pf-global--icon--FontSize--sm);\n --pf-c-spinner--m-md--diameter: var(--pf-global--icon--FontSize--md);\n --pf-c-spinner--m-lg--diameter: var(--pf-global--icon--FontSize--lg);\n --pf-c-spinner--m-xl--diameter: var(--pf-global--icon--FontSize--xl);\n --pf-c-spinner__clipper--Width: var(--pf-c-spinner--diameter);\n --pf-c-spinner__clipper--Height: var(--pf-c-spinner--diameter);\n --pf-c-spinner__clipper--after--BoxShadowColor: var(--pf-c-spinner--Color);\n --pf-c-spinner__clipper--after--Width: var(--pf-c-spinner--diameter);\n --pf-c-spinner__clipper--after--Height: var(--pf-c-spinner--diameter);\n --pf-c-spinner__clipper--after--BoxShadowSpreadRadius: var(--pf-c-spinner--stroke-width);\n --pf-c-spinner__lead-ball--after--BackgroundColor: var(--pf-c-spinner--Color);\n --pf-c-spinner__ball--after--Width: var(--pf-c-spinner--stroke-width);\n --pf-c-spinner__ball--after--Height: var(--pf-c-spinner--stroke-width);\n --pf-c-spinner__tail-ball--after--BackgroundColor: var(--pf-c-spinner--Color);\n position: relative;\n display: inline-block;\n width: var(--pf-c-spinner--Width);\n height: var(--pf-c-spinner--Height);\n text-align: left;\n animation: pf-animation-spinner-parent calc(var(--pf-c-spinner--AnimationDuration) * 2) var(--pf-c-spinner--AnimationTimingFunction) infinite; }\n .pf-c-spinner.pf-m-sm {\n --pf-c-spinner--diameter: var(--pf-c-spinner--m-sm--diameter); }\n .pf-c-spinner.pf-m-md {\n --pf-c-spinner--diameter: var(--pf-c-spinner--m-md--diameter); }\n .pf-c-spinner.pf-m-lg {\n --pf-c-spinner--diameter: var(--pf-c-spinner--m-lg--diameter); }\n .pf-c-spinner.pf-m-xl {\n --pf-c-spinner--diameter: var(--pf-c-spinner--m-xl--diameter); }\n\n@keyframes pf-animation-spinner-parent {\n 0% {\n transform: rotate(0deg); }\n 50% {\n transform: rotate(-540deg); }\n 100% {\n transform: rotate(-1080deg); } }\n\n.pf-c-spinner__clipper {\n position: absolute;\n width: var(--pf-c-spinner__clipper--Width);\n height: var(--pf-c-spinner__clipper--Height);\n clip-path: inset(0 0 50% 50%);\n animation: pf-animation-spinner__clipper var(--pf-c-spinner--AnimationDuration) linear infinite; }\n\n@keyframes pf-animation-spinner__clipper {\n 0% {\n transform: rotate(0deg); }\n 100% {\n transform: rotate(-270deg); } }\n\n.pf-c-spinner__clipper::after {\n position: absolute;\n width: var(--pf-c-spinner__clipper--after--Width);\n height: var(--pf-c-spinner__clipper--after--Height);\n clip-path: inset(0 0 0 50%);\n content: "";\n border-radius: 50%;\n box-shadow: inset 0 0 0 var(--pf-c-spinner__clipper--after--BoxShadowSpreadRadius) var(--pf-c-spinner__clipper--after--BoxShadowColor);\n animation: pf-animation-spinner__clipper-after var(--pf-c-spinner--AnimationDuration) linear infinite; }\n\n@keyframes pf-animation-spinner__clipper-after {\n 0% {\n transform: rotate(90deg); }\n 100% {\n transform: rotate(-180deg); } }\n\n.pf-c-spinner__lead-ball {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n animation: pf-animation-spinner__lead-ball var(--pf-c-spinner--AnimationDuration) linear infinite; }\n .pf-c-spinner__lead-ball::after {\n position: absolute;\n top: calc(50% - (var(--pf-c-spinner__ball--after--Height) / 2));\n right: 0;\n width: var(--pf-c-spinner__ball--after--Width);\n height: var(--pf-c-spinner__ball--after--Height);\n content: "";\n background-color: var(--pf-c-spinner__lead-ball--after--BackgroundColor);\n border-radius: 50%;\n transform-origin: top right; }\n\n@keyframes pf-animation-spinner__lead-ball {\n 0% {\n transform: rotate(0deg); }\n 34% {\n transform: rotate(-180deg); }\n 100% {\n transform: rotate(-360deg); } }\n\n.pf-c-spinner__tail-ball {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n animation: pf-animation-spinner__tail-ball var(--pf-c-spinner--AnimationDuration) linear infinite; }\n .pf-c-spinner__tail-ball::after {\n position: absolute;\n top: calc(50% - (var(--pf-c-spinner__ball--after--Height) / 2));\n right: 0;\n width: var(--pf-c-spinner__ball--after--Width);\n height: var(--pf-c-spinner__ball--after--Height);\n content: "";\n background-color: var(--pf-c-spinner__tail-ball--after--BackgroundColor);\n border-radius: 50%;\n transform-origin: top right; }\n\n@keyframes pf-animation-spinner__tail-ball {\n 0% {\n transform: rotate(0deg); }\n 67.5% {\n transform: rotate(-180deg); }\n 100% {\n transform: rotate(-360deg); } }\n');let St=class extends nt{constructor(){super(),this.loading=!1,this.loadContent(),window.addEventListener("hashchange",(t=>this.loadContent()))}set defaultUrl(t){""===window.location.hash&&void 0!==t&&(window.location.hash="#"+t)}static get styles(){return[tt`:host{position:relative}:host .pf-l-bullseye{position:absolute;height:100%;width:100%;top:0;left:0}`,_t,kt]}loadContent(){let t=window.location.hash.slice(1,1/0);""!==t&&(this.loading=!0,fetch(t).then((t=>t.text())).then((t=>{this.querySelector("[slot=body]").innerHTML=t})).then((()=>{this.querySelectorAll("a").forEach((t=>{if(""!==t.href)try{const e=new URL(t.href),n=e.search||"";t.href=`#${e.pathname}${n}`}catch(e){t.href="#"+t.href}})),this.querySelectorAll("[role=pb-refresh]").forEach((t=>{t.addEventListener("click",(t=>{this.loadContent()}))})),this.loading=!1})))}render(){return E`${this.loading?E`
        `:""}`}};t([X()],St.prototype,"defaultUrl",null),t([X()],St.prototype,"loading",void 0),St=t([$("pb-admin-shell")],St); +e.exports=function(e){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]},i=t((function(e){var t={};for(var n in r)r.hasOwnProperty(n)&&(t[r[n]]=n);var i=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 o in i)if(i.hasOwnProperty(o)){if(!("channels"in i[o]))throw new Error("missing channels property: "+o);if(!("labels"in i[o]))throw new Error("missing channel labels property: "+o);if(i[o].labels.length!==i[o].channels)throw new Error("channel and label counts mismatch: "+o);var a=i[o].channels,s=i[o].labels;delete i[o].channels,delete i[o].labels,Object.defineProperty(i[o],"channels",{value:a}),Object.defineProperty(i[o],"labels",{value:s})}function l(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}i.rgb.hsl=function(e){var t,n,r=e[0]/255,i=e[1]/255,o=e[2]/255,a=Math.min(r,i,o),s=Math.max(r,i,o),l=s-a;return s===a?t=0:r===s?t=(i-o)/l:i===s?t=2+(o-r)/l:o===s&&(t=4+(r-i)/l),(t=Math.min(60*t,360))<0&&(t+=360),n=(a+s)/2,[t,100*(s===a?0:n<=.5?l/(s+a):l/(2-s-a)),100*n]},i.rgb.hsv=function(e){var t,n,r,i,o,a=e[0]/255,s=e[1]/255,l=e[2]/255,c=Math.max(a,s,l),u=c-Math.min(a,s,l),d=function(e){return(c-e)/6/u+.5};return 0===u?i=o=0:(o=u/c,t=d(a),n=d(s),r=d(l),a===c?i=r-n:s===c?i=1/3+t-r:l===c&&(i=2/3+n-t),i<0?i+=1:i>1&&(i-=1)),[360*i,100*o,100*c]},i.rgb.hwb=function(e){var t=e[0],n=e[1],r=e[2];return[i.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)))]},i.rgb.cmyk=function(e){var t,n=e[0]/255,r=e[1]/255,i=e[2]/255;return[100*((1-n-(t=Math.min(1-n,1-r,1-i)))/(1-t)||0),100*((1-r-t)/(1-t)||0),100*((1-i-t)/(1-t)||0),100*t]},i.rgb.keyword=function(e){var n=t[e];if(n)return n;var i,o=1/0;for(var a in r)if(r.hasOwnProperty(a)){var s=l(e,r[a]);s.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)]},i.rgb.lab=function(e){var t=i.rgb.xyz(e),n=t[0],r=t[1],o=t[2];return r/=100,o/=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-(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116))]},i.hsl.rgb=function(e){var t,n,r,i,o,a=e[0]/360,s=e[1]/100,l=e[2]/100;if(0===s)return[o=255*l,o,o];t=2*l-(n=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var c=0;c<3;c++)(r=a+1/3*-(c-1))<0&&r++,r>1&&r--,o=6*r<1?t+6*(n-t)*r:2*r<1?n:3*r<2?t+(n-t)*(2/3-r)*6:t,i[c]=255*o;return i},i.hsl.hsv=function(e){var t=e[0],n=e[1]/100,r=e[2]/100,i=n,o=Math.max(r,.01);return n*=(r*=2)<=1?r:2-r,i*=o<=1?o:2-o,[t,100*(0===r?2*i/(o+i):2*n/(r+n)),(r+n)/2*100]},i.hsv.rgb=function(e){var t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,o=t-Math.floor(t),a=255*r*(1-n),s=255*r*(1-n*o),l=255*r*(1-n*(1-o));switch(r*=255,i){case 0:return[r,l,a];case 1:return[s,r,a];case 2:return[a,r,l];case 3:return[a,s,r];case 4:return[l,a,r];case 5:return[r,a,s]}},i.hsv.hsl=function(e){var t,n,r,i=e[0],o=e[1]/100,a=e[2]/100,s=Math.max(a,.01);return r=(2-o)*a,n=o*s,[i,100*(n=(n/=(t=(2-o)*s)<=1?t:2-t)||0),100*(r/=2)]},i.hwb.rgb=function(e){var t,n,r,i,o,a,s,l=e[0]/360,c=e[1]/100,u=e[2]/100,d=c+u;switch(d>1&&(c/=d,u/=d),r=6*l-(t=Math.floor(6*l)),0!=(1&t)&&(r=1-r),i=c+r*((n=1-u)-c),t){default:case 6:case 0:o=n,a=i,s=c;break;case 1:o=i,a=n,s=c;break;case 2:o=c,a=n,s=i;break;case 3:o=c,a=i,s=n;break;case 4:o=i,a=c,s=n;break;case 5:o=n,a=c,s=i}return[255*o,255*a,255*s]},i.cmyk.rgb=function(e){var t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},i.xyz.rgb=function(e){var t,n,r,i=e[0]/100,o=e[1]/100,a=e[2]/100;return n=-.9689*i+1.8758*o+.0415*a,r=.0557*i+-.204*o+1.057*a,t=(t=3.2406*i+-1.5372*o+-.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))]},i.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))]},i.lab.xyz=function(e){var t,n,r,i=e[0];t=e[1]/500+(n=(i+16)/116),r=n-e[2]/200;var o=Math.pow(n,3),a=Math.pow(t,3),s=Math.pow(r,3);return n=o>.008856?o:(n-16/116)/7.787,t=a>.008856?a:(t-16/116)/7.787,r=s>.008856?s:(r-16/116)/7.787,[t*=95.047,n*=100,r*=108.883]},i.lab.lch=function(e){var t,n=e[0],r=e[1],i=e[2];return(t=360*Math.atan2(i,r)/2/Math.PI)<0&&(t+=360),[n,Math.sqrt(r*r+i*i),t]},i.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)]},i.rgb.ansi16=function(e){var t=e[0],n=e[1],r=e[2],o=1 in arguments?arguments[1]:i.rgb.hsv(e)[2];if(0===(o=Math.round(o/50)))return 30;var a=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return 2===o&&(a+=60),a},i.hsv.ansi16=function(e){return i.rgb.ansi16(i.hsv.rgb(e),e[2])},i.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)},i.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]},i.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]},i.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},i.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]},i.rgb.hcg=function(e){var t,n=e[0]/255,r=e[1]/255,i=e[2]/255,o=Math.max(Math.max(n,r),i),a=Math.min(Math.min(n,r),i),s=o-a;return t=s<=0?0:o===n?(r-i)/s%6:o===r?2+(i-n)/s:4+(n-r)/s+4,t/=6,[360*(t%=1),100*s,100*(s<1?a/(1-s):0)]},i.hsl.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=1,i=0;return(r=n<.5?2*t*n:2*t*(1-n))<1&&(i=(n-.5*r)/(1-r)),[e[0],100*r,100*i]},i.hsv.hcg=function(e){var t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},i.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 i=[0,0,0],o=t%1*6,a=o%1,s=1-a,l=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=a,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=a;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=a,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return l=(1-n)*r,[255*(n*i[0]+l),255*(n*i[1]+l),255*(n*i[2]+l)]},i.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]},i.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]},i.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)]},i.hwb.hcg=function(e){var t=e[1]/100,n=1-e[2]/100,r=n-t,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},i.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},i.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},i.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},i.gray.hsl=i.gray.hsv=function(e){return[0,0,e[0]]},i.gray.hwb=function(e){return[0,100,e[0]]},i.gray.cmyk=function(e){return[0,0,0,e[0]]},i.gray.lab=function(e){return[e[0],0,0]},i.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},i.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}}));function o(){for(var e={},t=Object.keys(i),n=t.length,r=0;r1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}function h(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,i=0;i=0&&t<1?O(Math.round(255*t)):"")}function k(e,t){return t<1||e[3]&&e[3]<1?S(e,t):"rgb("+e[0]+", "+e[1]+", "+e[2]+")"}function S(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+t+")"}function M(e,t){return t<1||e[3]&&e[3]<1?C(e,t):"rgb("+Math.round(e[0]/255*100)+"%, "+Math.round(e[1]/255*100)+"%, "+Math.round(e[2]/255*100)+"%)"}function C(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 T(e,t){return t<1||e[3]&&e[3]<1?D(e,t):"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)"}function D(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+t+")"}function L(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 N[e.slice(0,3)]}function A(e,t,n){return Math.min(Math.max(t,e),n)}function O(e){var t=e.toString(16).toUpperCase();return t.length<2?"0"+t:t}var N={};for(var F in p)N[p[F]]=F;var I=function(e){return e instanceof I?e:this instanceof I?(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=g.getRgba(e))?this.setValues("rgb",t):(t=g.getHsla(e))?this.setValues("hsl",t):(t=g.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 I(e);var t};I.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 g.hexString(this.values.rgb)},rgbString:function(){return g.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return g.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return g.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return g.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return g.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return g.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return g.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,i=void 0===t?.5:t,o=2*i-1,a=n.alpha()-r.alpha(),s=((o*a==-1?o:(o+a)/(1+o*a))+1)/2,l=1-s;return this.rgb(s*n.red()+l*r.red(),s*n.green()+l*r.green(),s*n.blue()+l*r.blue()).alpha(n.alpha()*i+r.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var e,t,n=new I,r=this.values,i=n.values;for(var o in r)r.hasOwnProperty(o)&&(e=r[o],"[object Array]"===(t={}.toString.call(e))?i[o]=e.slice(0):"[object Number]"===t?i[o]=e:console.error("unexpected color value:",e));return n}},I.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},I.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},I.prototype.getValues=function(e){for(var t=this.values,n={},r=0;r=0;i--)t.call(n,e[i],i);else for(i=0;i=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),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),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),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-B.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*B.easeInBounce(2*e):.5*B.easeOutBounce(2*e-1)+.5}},V={effects:B};H.easingEffects=B;var Y=Math.PI,U=Y/180,j=2*Y,G=Y/2,q=Y/4,$=2*Y/3,K={clear:function(e){e.ctx.clearRect(0,0,e.width,e.height)},roundedRect:function(e,t,n,r,i,o){if(o){var a=Math.min(o,i/2,r/2),s=t+a,l=n+a,c=t+r-a,u=n+i-a;e.moveTo(t,l),st.left-n&&e.xt.top-n&&e.y0&&e.requestAnimationFrame()},advance:function(){for(var e,t,n,r,i=this.animations,o=0;o=n?(ae.callback(e.onAnimationComplete,[e],t),t.animating=!1,i.splice(o,1)):++o}},ye=ae.options.resolve,be=["push","pop","shift","splice","unshift"];function xe(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),i=r.apply(this,t);return ae.each(e._chartjs.listeners,(function(e){"function"==typeof e[n]&&e[n].apply(e,t)})),i}})})))}function we(e,t){var n=e._chartjs;if(n){var r=n.listeners,i=r.indexOf(t);-1!==i&&r.splice(i,1),r.length>0||(be.forEach((function(t){delete e[t]})),delete e._chartjs)}}var _e=function(e,t){this.initialize(e,t)};ae.extend(_e.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,i=e.getDataset(),o=n.options.scales;null!==t.xAxisID&&t.xAxisID in r&&!i.xAxisID||(t.xAxisID=i.xAxisID||o.xAxes[0].id),null!==t.yAxisID&&t.yAxisID in r&&!i.yAxisID||(t.yAxisID=i.yAxisID||o.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(),i=n.getDataset().data||[],o=r.data;for(e=0,t=i.length;er&&e.insertElements(r,i-r)},insertElements:function(e,t){for(var n=0;ni?(o=i/t.innerRadius,e.arc(a,s,t.innerRadius-i,r+o,n-o,!0)):e.arc(a,s,i,r+Math.PI/2,n-Math.PI/2),e.closePath(),e.clip()}function Ce(e,t,n,r){var i,o=n.endAngle;for(r&&(n.endAngle=n.startAngle+Se,Me(e,n),n.endAngle=o,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=Se,n.fullCircles--)),e.beginPath(),e.arc(n.x,n.y,n.innerRadius,n.startAngle+Se,n.startAngle,!0),i=0;is;)i-=Se;for(;i=a&&i<=s,c=o>=n.innerRadius&&o<=n.outerRadius;return l&&c}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,i={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/Se)};if(t.save(),t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,i.fullCircles){for(i.endAngle=i.startAngle+Se,t.beginPath(),t.arc(i.x,i.y,i.outerRadius,i.startAngle,i.endAngle),t.arc(i.x,i.y,i.innerRadius,i.endAngle,i.startAngle,!0),t.closePath(),e=0;ee.x&&(t=He(t,"left","right")):e.basen?n:r,r:l.right||i<0?0:i>t?t:i,b:l.bottom||o<0?0:o>n?n:o,l:l.left||a<0?0:a>t?t:a}}function Ye(e){var t=ze(e),n=t.right-t.left,r=t.bottom-t.top,i=Ve(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b}}}function Ue(e,t,n){var r=null===t,i=null===n,o=!(!e||r&&i)&&ze(e);return o&&(r||t>=o.left&&t<=o.right)&&(i||n>=o.top&&n<=o.bottom)}J._set("global",{elements:{rectangle:{backgroundColor:We,borderColor:We,borderSkipped:"bottom",borderWidth:0}}});var je=pe.extend({_type:"rectangle",draw:function(){var e=this._chart.ctx,t=this._view,n=Ye(t),r=n.outer,i=n.inner;e.fillStyle=t.backgroundColor,e.fillRect(r.x,r.y,r.w,r.h),r.w===i.w&&r.h===i.h||(e.save(),e.beginPath(),e.rect(r.x,r.y,r.w,r.h),e.clip(),e.fillStyle=t.borderColor,e.rect(i.x,i.y,i.w,i.h),e.fill("evenodd"),e.restore())},height:function(){var e=this._view;return e.base-e.y},inRange:function(e,t){return Ue(this._view,e,t)},inLabelRange:function(e,t){var n=this._view;return Ee(n)?Ue(n,e,null):Ue(n,null,t)},inXRange:function(e){return Ue(this._view,e,null)},inYRange:function(e){return Ue(this._view,null,e)},getCenterPoint:function(){var e,t,n=this._view;return Ee(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 Ee(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}}}),Ge={},qe=De,$e=Ae,Ke=Re,Ze=je;Ge.Arc=qe,Ge.Line=$e,Ge.Point=Ke,Ge.Rectangle=Ze;var Xe=ae._deprecated,Je=ae.valueOrDefault;function Qe(e,t){var n,r,i,o,a=e._length;for(i=1,o=t.length;i0?Math.min(a,Math.abs(r-n)):a,n=r;return a}function et(e,t,n){var r,i,o=n.barThickness,a=t.stackCount,s=t.pixels[e],l=ae.isNullOrUndef(o)?Qe(t.scale,t.pixels):-1;return ae.isNullOrUndef(o)?(r=l*n.categoryPercentage,i=n.barPercentage):(r=o*a,i=1),{chunk:r/a,ratio:i,start:s-r/2}}function tt(e,t,n){var r,i=t.pixels,o=i[e],a=e>0?i[e-1]:null,s=e=0&&m.min>=0?m.min:m.max,w=void 0===m.start?m.end:m.max>=0&&m.min>=0?m.max-m.min:m.min-m.max,_=g.length;if(y||void 0===y&&void 0!==b)for(r=0;r<_&&(i=g[r]).index!==e;++r)i.stack===b&&(o=void 0===(c=h._parseValue(p[i.index].data[t])).start?c.end:c.min>=0&&c.max>=0?c.max:c.min,(m.min<0&&o<0||m.max>=0&&o>0)&&(x+=o));return a=h.getPixelForValue(x),l=(s=h.getPixelForValue(x+w))-a,void 0!==v&&Math.abs(l)=0&&!f||w<0&&f?a-v:a+v),{size:l,base:a,head:s,center:s+l/2}},calculateBarIndexPixels:function(e,t,n,r){var i=this,o="flex"===r.barThickness?tt(t,n,r):et(t,n,r),a=i.getStackIndex(e,i.getMeta().stack),s=o.start+o.chunk*a+o.chunk/2,l=Math.min(Je(r.maxBarThickness,1/0),o.chunk*o.ratio);return{base:s-l/2,head:s+l/2,center:s,size:l}},draw:function(){var e=this,t=e.chart,n=e._getValueScale(),r=e.getMeta().data,i=e.getDataset(),o=r.length,a=0;for(ae.canvas.clipArea(t.ctx,t.chartArea);a=st?-lt:y<-st?lt:0)+m,x=Math.cos(y),w=Math.sin(y),_=Math.cos(b),k=Math.sin(b),S=y<=0&&b>=0||b>=lt,M=y<=ct&&b>=ct||b>=lt+ct,C=y<=-ct&&b>=-ct||b>=st+ct,T=y===-st||b>=st?-1:Math.min(x,x*g,_,_*g),D=C?-1:Math.min(w,w*g,k,k*g),L=S?1:Math.max(x,x*g,_,_*g),P=M?1:Math.max(w,w*g,k,k*g);c=(L-T)/2,u=(P-D)/2,d=-(L+T)/2,h=-(P+D)/2}for(r=0,i=p.length;r0&&!isNaN(e)?lt*(Math.abs(e)/t):0},getMaxBorderWidth:function(e){var t,n,r,i,o,a,s,l,c=this,u=0,d=c.chart;if(!e)for(t=0,n=d.data.datasets.length;t(u=s>u?s:u)?l:u);return u},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&&pt(c[e-1]._model,l)&&(n.controlPointPreviousX=u(n.controlPointPreviousX,l.left,l.right),n.controlPointPreviousY=u(n.controlPointPreviousY,l.top,l.bottom)),e0&&(o=e.getDatasetMeta(o[0]._datasetIndex).data),o},"x-axis":function(e,t){return Pt(e,t,{intersect:!1})},point:function(e,t){return Tt(e,Mt(t,e))},nearest:function(e,t,n){var r=Mt(t,e);n.axis=n.axis||"xy";var i=Lt(n.axis);return Dt(e,r,n.intersect,i)},x:function(e,t,n){var r=Mt(t,e),i=[],o=!1;return Ct(e,(function(e){e.inXRange(r.x)&&i.push(e),e.inRange(r.x,r.y)&&(o=!0)})),n.intersect&&!o&&(i=[]),i},y:function(e,t,n){var r=Mt(t,e),i=[],o=!1;return Ct(e,(function(e){e.inYRange(r.y)&&i.push(e),e.inRange(r.x,r.y)&&(o=!0)})),n.intersect&&!o&&(i=[]),i}}},Ot=ae.extend;function Nt(e,t){return ae.where(e,(function(e){return e.pos===t}))}function Ft(e,t){return e.sort((function(e,n){var r=t?n:e,i=t?e:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight}))}function It(e){var t,n,r,i=[];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",qt=n(Object.freeze({__proto__:null,default:Gt})),$t="$chartjs",Kt="chartjs-",Zt=Kt+"size-monitor",Xt=Kt+"render-monitor",Jt=Kt+"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"),i=e.getAttribute("width");if(e[$t]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===i||""===i){var o=tn(e,"width");void 0!==o&&(e.width=o)}if(null===r||""===r)if(""===e.style.height)e.height=e.width/(t.options.aspectRatio||2);else{var a=tn(e,"height");void 0!==o&&(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 sn(e,t,n,r,i){return{type:e,chart:t,native:i||null,x:void 0!==n?n:null,y:void 0!==r?r:null}}function ln(e,t){var n=en[e.type]||e.type,r=ae.getRelativePosition(e,t);return sn(n,t,r.x,r.y,e)}function cn(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 un(e){var t=document.createElement("div");return t.className=e||"",t}function dn(e){var t=1e6,n=un(Zt),r=un(Zt+"-expand"),i=un(Zt+"-shrink");r.appendChild(un()),i.appendChild(un()),n.appendChild(r),n.appendChild(i),n._reset=function(){r.scrollLeft=t,r.scrollTop=t,i.scrollLeft=t,i.scrollTop=t};var o=function(){n._reset(),e()};return on(r,"scroll",o.bind(r,"expand")),on(i,"scroll",o.bind(i,"shrink")),n}function hn(e,t){var n=e[$t]||(e[$t]={}),r=n.renderProxy=function(e){e.animationName===Jt&&t()};ae.each(Qt,(function(t){on(e,t,r)})),n.reflow=!!e.offsetParent,e.classList.add(Xt)}function fn(e){var t=e[$t]||{},n=t.renderProxy;n&&(ae.each(Qt,(function(t){an(e,t,n)})),delete t.renderProxy),e.classList.remove(Xt)}function pn(e,t,n){var r=e[$t]||(e[$t]={}),i=r.resizer=dn(cn((function(){if(r.resizer){var i=n.options.maintainAspectRatio&&e.parentNode,o=i?i.clientWidth:0;t(sn("resize",n)),i&&i.clientWidth0){var o=e[0];o.label?n=o.label:o.xLabel?n=o.xLabel:i>0&&o.index-1?e.split("\n"):e}function Tn(e){var t=e._xScale,n=e._yScale||e._scale,r=e._index,i=e._datasetIndex,o=e._chart.getDatasetMeta(i).controller,a=o._getIndexScale(),s=o._getValueScale();return{xLabel:t?t.getLabelForIndex(r,i):"",yLabel:n?n.getLabelForIndex(r,i):"",label:a?""+a.getLabelForIndex(r,i):"",value:s?""+s.getLabelForIndex(r,i):"",index:r,datasetIndex:i,x:e._model.x,y:e._model.y}}function Dn(e){var t=J.global;return{xPadding:e.xPadding,yPadding:e.yPadding,xAlign:e.xAlign,yAlign:e.yAlign,rtl:e.rtl,textDirection:e.textDirection,bodyFontColor:e.bodyFontColor,_bodyFontFamily:_n(e.bodyFontFamily,t.defaultFontFamily),_bodyFontStyle:_n(e.bodyFontStyle,t.defaultFontStyle),_bodyAlign:e.bodyAlign,bodyFontSize:_n(e.bodyFontSize,t.defaultFontSize),bodySpacing:e.bodySpacing,titleFontColor:e.titleFontColor,_titleFontFamily:_n(e.titleFontFamily,t.defaultFontFamily),_titleFontStyle:_n(e.titleFontStyle,t.defaultFontStyle),titleFontSize:_n(e.titleFontSize,t.defaultFontSize),_titleAlign:e.titleAlign,titleSpacing:e.titleSpacing,titleMarginBottom:e.titleMarginBottom,footerFontColor:e.footerFontColor,_footerFontFamily:_n(e.footerFontFamily,t.defaultFontFamily),_footerFontStyle:_n(e.footerFontStyle,t.defaultFontStyle),footerFontSize:_n(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 Ln(e,t){var n=e._chart.ctx,r=2*t.yPadding,i=0,o=t.body,a=o.reduce((function(e,t){return e+t.before.length+t.lines.length+t.after.length}),0);a+=t.beforeBody.length+t.afterBody.length;var s=t.title.length,l=t.footer.length,c=t.titleFontSize,u=t.bodyFontSize,d=t.footerFontSize;r+=s*c,r+=s?(s-1)*t.titleSpacing:0,r+=s?t.titleMarginBottom:0,r+=a*u,r+=a?(a-1)*t.bodySpacing:0,r+=l?t.footerMarginTop:0,r+=l*d,r+=l?(l-1)*t.footerSpacing:0;var h=0,f=function(e){i=Math.max(i,n.measureText(e).width+h)};return n.font=ae.fontString(c,t._titleFontStyle,t._titleFontFamily),ae.each(t.title,f),n.font=ae.fontString(u,t._bodyFontStyle,t._bodyFontFamily),ae.each(t.beforeBody.concat(t.afterBody),f),h=t.displayColors?u+2:0,ae.each(o,(function(e){ae.each(e.before,f),ae.each(e.lines,f),ae.each(e.after,f)})),h=0,n.font=ae.fontString(d,t._footerFontStyle,t._footerFontFamily),ae.each(t.footer,f),{width:i+=2*t.xPadding,height:r}}function Pn(e,t){var n,r,i,o,a,s=e._model,l=e._chart,c=e._chart.chartArea,u="center",d="center";s.yl.height-t.height&&(d="bottom");var h=(c.left+c.right)/2,f=(c.top+c.bottom)/2;"center"===d?(n=function(e){return e<=h},r=function(e){return e>h}):(n=function(e){return e<=t.width/2},r=function(e){return e>=l.width-t.width/2}),i=function(e){return e+t.width+s.caretSize+s.caretPadding>l.width},o=function(e){return e-t.width-s.caretSize-s.caretPadding<0},a=function(e){return e<=f?"top":"bottom"},n(s.x)?(u="left",i(s.x)&&(u="center",d=a(s.y))):r(s.x)&&(u="right",o(s.x)&&(u="center",d=a(s.y)));var p=e._options;return{xAlign:p.xAlign?p.xAlign:u,yAlign:p.yAlign?p.yAlign:d}}function An(e,t,n,r){var i=e.x,o=e.y,a=e.caretSize,s=e.caretPadding,l=e.cornerRadius,c=n.xAlign,u=n.yAlign,d=a+s,h=l+s;return"right"===c?i-=t.width:"center"===c&&((i-=t.width/2)+t.width>r.width&&(i=r.width-t.width),i<0&&(i=0)),"top"===u?o+=d:o-="bottom"===u?t.height+d:t.height/2,"center"===u?"left"===c?i+=d:"right"===c&&(i-=d):"left"===c?i-=h:"right"===c&&(i+=h),{x:i,y:o}}function On(e,t){return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-e.xPadding:e.x+e.xPadding}function Nn(e){return Mn([],Cn(e))}var Fn=pe.extend({initialize:function(){this._model=Dn(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),i=t.afterTitle.apply(e,arguments),o=[];return o=Mn(o,Cn(n)),o=Mn(o,Cn(r)),o=Mn(o,Cn(i))},getBeforeBody:function(){return Nn(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(e,t){var n=this,r=n._options.callbacks,i=[];return ae.each(e,(function(e){var o={before:[],lines:[],after:[]};Mn(o.before,Cn(r.beforeLabel.call(n,e,t))),Mn(o.lines,r.label.call(n,e,t)),Mn(o.after,Cn(r.afterLabel.call(n,e,t))),i.push(o)})),i},getAfterBody:function(){return Nn(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),i=t.afterFooter.apply(e,arguments),o=[];return o=Mn(o,Cn(n)),o=Mn(o,Cn(r)),o=Mn(o,Cn(i))},update:function(e){var t,n,r=this,i=r._options,o=r._model,a=r._model=Dn(i),s=r._active,l=r._data,c={xAlign:o.xAlign,yAlign:o.yAlign},u={x:o.x,y:o.y},d={width:o.width,height:o.height},h={x:o.caretX,y:o.caretY};if(s.length){a.opacity=1;var f=[],p=[];h=Sn[i.position].call(r,s,r._eventPosition);var g=[];for(t=0,n=s.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},i=Math.abs(t.opacity<.001)?0:t.opacity,o=t.title.length||t.beforeBody.length||t.body.length||t.afterBody.length||t.footer.length;this._options.enabled&&o&&(e.save(),e.globalAlpha=i,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}}),In=Sn,Rn=Fn;Rn.positioners=In;var Wn=ae.valueOrDefault;function En(){return ae.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,n,r){if("xAxes"===e||"yAxes"===e){var i,o,a,s=n[e].length;for(t[e]||(t[e]=[]),i=0;i=t[e].length&&t[e].push({}),!t[e][i].type||a.type&&a.type!==t[e][i].type?ae.merge(t[e][i],[wn.getScaleDefaults(o),a]):ae.merge(t[e][i],a)}else ae._merger(e,t,n,r)}})}function zn(){return ae.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,n,r){var i=t[e]||Object.create(null),o=n[e];"scales"===e?t[e]=En(i,o):"scale"===e?t[e]=ae.merge(i,[wn.getScaleDefaults(o.type),o]):ae._merger(e,t,n,r)}})}function Hn(e){var t=(e=e||Object.create(null)).data=e.data||{};return t.datasets=t.datasets||[],t.labels=t.labels||[],e.options=zn(J.global,J[e.type],e.options||{}),e}function Bn(e){var t=e.options;ae.each(e.scales,(function(t){Ut.removeBox(e,t)})),t=zn(J.global,J[e.config.type],t),e.options=e.config.options=t,e.ensureScalesHaveIDs(),e.buildOrUpdateScales(),e.tooltip._options=t.tooltips,e.tooltip.initialize()}function Vn(e,t,n){var r,i=function(e){return e.id===r};do{r=t+n++}while(ae.findIndex(e,i)>=0);return r}function Yn(e){return"top"===e||"bottom"===e}function Un(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}J._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 jn=function(e,t){return this.construct(e,t),this};ae.extend(jn.prototype,{construct:function(e,t){var n=this;t=Hn(t);var r=bn.acquireContext(e,t),i=r&&r.canvas,o=i&&i.height,a=i&&i.width;n.id=ae.uid(),n.ctx=r,n.canvas=i,n.config=t,n.width=a,n.height=o,n.aspectRatio=o?a/o:null,n.options=t.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,jn.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(e){n.config.data=e}}),r&&i?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var e=this;return xn.notify(e,"beforeInit"),ae.retinaScale(e,e.options.devicePixelRatio),e.bindEvents(),e.options.responsive&&e.resize(!0),e.initToolTip(),xn.notify(e,"afterInit"),e},clear:function(){return ae.canvas.clear(this),this},stop:function(){return ve.cancelAnimation(this),this},resize:function(e){var t=this,n=t.options,r=t.canvas,i=n.maintainAspectRatio&&t.aspectRatio||null,o=Math.max(0,Math.floor(ae.getMaximumWidth(r))),a=Math.max(0,Math.floor(i?o/i:ae.getMaximumHeight(r)));if((t.width!==o||t.height!==a)&&(r.width=t.width=o,r.height=t.height=a,r.style.width=o+"px",r.style.height=a+"px",ae.retinaScale(t,n.devicePixelRatio),!e)){var s={width:o,height:a};xn.notify(t,"resize",[s]),n.onResize&&n.onResize(t,s),t.stop(),t.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var e=this.options,t=e.scales||{},n=e.scale;ae.each(t.xAxes,(function(e,n){e.id||(e.id=Vn(t.xAxes,"x-axis-",n))})),ae.each(t.yAxes,(function(e,n){e.id||(e.id=Vn(t.yAxes,"y-axis-",n))})),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var e=this,t=e.options,n=e.scales||{},r=[],i=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,o=r.id,a=Wn(r.type,t.dtype);Yn(r.position)!==Yn(t.dposition)&&(r.position=t.dposition),i[o]=!0;var s=null;if(o in n&&n[o].type===a)(s=n[o]).options=r,s.ctx=e.ctx,s.chart=e;else{var l=wn.getScaleConstructor(a);if(!l)return;s=new l({id:o,type:a,options:r,ctx:e.ctx,chart:e}),n[s.id]=s}s.mergeTicksOptions(),t.isDefault&&(e.scale=s)})),ae.each(i,(function(e,t){e||delete n[t]})),e.scales=n,wn.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e,t,n=this,r=[],i=n.data.datasets;for(e=0,t=i.length;e=0;--n)r.drawDataset(t[n],e);xn.notify(r,"afterDatasetsDraw",[e])}},drawDataset:function(e,t){var n=this,r={meta:e,index:e.index,easingValue:t};!1!==xn.notify(n,"beforeDatasetDraw",[r])&&(e.controller.draw(t),xn.notify(n,"afterDatasetDraw",[r]))},_drawTooltip:function(e){var t=this,n=t.tooltip,r={tooltip:n,easingValue:e};!1!==xn.notify(t,"beforeTooltipDraw",[r])&&(n.draw(),xn.notify(t,"afterTooltipDraw",[r]))},getElementAtEvent:function(e){return At.modes.single(this,e)},getElementsAtEvent:function(e){return At.modes.label(this,e,{intersect:!0})},getElementsAtXAxis:function(e){return At.modes["x-axis"](this,e,{intersect:!0})},getElementsAtEventForMode:function(e,t,n){var r=At.modes[t];return"function"==typeof r?r(this,e,n):[]},getDatasetAtEvent:function(e){return At.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 i=e[r];if(t(i))return i}},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,i=Math.sqrt(n*n+r*r),o=Math.atan2(r,n);return o<-.5*Math.PI&&(o+=2*Math.PI),{angle:o,distance:i}},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,i=n/2;return Math.round((t-i)*r)/r+i},ae.splineCurve=function(e,t,n,r){var i=e.skip?t:e,o=t,a=n.skip?t:n,s=Math.sqrt(Math.pow(o.x-i.x,2)+Math.pow(o.y-i.y,2)),l=Math.sqrt(Math.pow(a.x-o.x,2)+Math.pow(a.y-o.y,2)),c=s/(s+l),u=l/(s+l),d=r*(c=isNaN(c)?0:c),h=r*(u=isNaN(u)?0:u);return{previous:{x:o.x-d*(a.x-i.x),y:o.y-d*(a.y-i.y)},next:{x:o.x+h*(a.x-i.x),y:o.y+h*(a.y-i.y)}}},ae.EPSILON=Number.EPSILON||1e-14,ae.splineCurveMonotone=function(e){var t,n,r,i,o,a,s,l,c,u=(e||[]).map((function(e){return{model:e._model,deltaK:0,mK:0}})),d=u.length;for(t=0;t0?u[t-1]:null,(i=t0?u[t-1]:null,i=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,i=e.originalEvent||e,o=e.target||e.srcElement,a=o.getBoundingClientRect(),s=i.touches;s&&s.length>0?(n=s[0].clientX,r=s[0].clientY):(n=i.clientX,r=i.clientY);var l=parseFloat(ae.getStyle(o,"padding-left")),c=parseFloat(ae.getStyle(o,"padding-top")),u=parseFloat(ae.getStyle(o,"padding-right")),d=parseFloat(ae.getStyle(o,"padding-bottom")),h=a.right-a.left-l-u,f=a.bottom-a.top-c-d;return{x:n=Math.round((n-a.left-l)/h*o.width/t.currentDevicePixelRatio),y:r=Math.round((r-a.top-c)/f*o.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),i=ae.getConstraintWidth(e);return isNaN(i)?r:Math.min(r,i)},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),i=ae.getConstraintHeight(e);return isNaN(i)?r:Math.min(r,i)},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,i=e.height,o=e.width;r.height=i*n,r.width=o*n,e.ctx.scale(n,n),r.style.height||r.style.width||(r.style.height=i+"px",r.style.width=o+"px")}},ae.fontString=function(e,t,n){return t+" "+e+"px "+n},ae.longestText=function(e,t,n,r){var i=(r=r||{}).data=r.data||{},o=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},o=r.garbageCollect=[],r.font=t),e.font=t;var a,s,l,c,u,d=0,h=n.length;for(a=0;an.length){for(a=0;ar&&(r=o),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=R?function(e){return e instanceof CanvasGradient&&(e=J.global.defaultColor),R(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 $n(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function Kn(e){this.options=e||{}}ae.extend(Kn.prototype,{formats:$n,parse:$n,format:$n,add:$n,diff:$n,startOf:$n,endOf:$n,_create:function(e){return e}}),Kn.override=function(e){ae.extend(Kn.prototype,e)};var Zn={_date:Kn},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 i=ae.log10(Math.abs(r)),o="";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)),s=Math.floor(a)-Math.floor(i);s=Math.max(Math.min(s,20),0),o=e.toExponential(s)}else{var l=-1*Math.floor(i);l=Math.max(Math.min(l,20),0),o=e.toFixed(l)}else o="0";return o},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():""}}},Jn=ae.isArray,Qn=ae.isNullOrUndef,er=ae.valueOrDefault,tr=ae.valueAtIndexOrDefault;function nr(e,t){for(var n=[],r=e.length/t,i=0,o=e.length;il+c)))return a}function ir(e,t){ae.each(e,(function(e){var n,r=e.gc,i=r.length/2;if(i>t){for(n=0;nc)return o;return Math.max(c,1)}function fr(e){var t,n,r=[];for(t=0,n=e.length;t=h||u<=1||!s.isHorizontal()?s.labelRotation=d:(t=(e=s._getLabelSizes()).widest.width,n=e.highest.height-e.highest.offset,r=Math.min(s.maxWidth,s.chart.width-t),t+6>(i=l.offset?s.maxWidth/u:r/(u-1))&&(i=r/(u-(l.offset?.5:1)),o=s.maxHeight-ar(l.gridLines)-c.padding-sr(l.scaleLabel),a=Math.sqrt(t*t+n*n),f=ae.toDegrees(Math.min(Math.asin(Math.min((e.highest.height+6)/i,1)),Math.asin(Math.min(o/a,1))-Math.asin(n/a))),f=Math.max(d,Math.min(h,f))),s.labelRotation=f)},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,i=r.ticks,o=r.scaleLabel,a=r.gridLines,s=e._isVisible(),l="bottom"===r.position,c=e.isHorizontal();if(c?t.width=e.maxWidth:s&&(t.width=ar(a)+sr(o)),c?s&&(t.height=ar(a)+sr(o)):t.height=e.maxHeight,i.display&&s){var u=cr(i),d=e._getLabelSizes(),h=d.first,f=d.last,p=d.widest,g=d.highest,m=.4*u.minor.lineHeight,v=i.padding;if(c){var y=0!==e.labelRotation,b=ae.toRadians(e.labelRotation),x=Math.cos(b),w=Math.sin(b),_=w*p.width+x*(g.height-(y?g.offset:0))+(y?0:m);t.height=Math.min(e.maxHeight,t.height+_+v);var k,S,M=e.getPixelForTick(0)-e.left,C=e.right-e.getPixelForTick(e.getTicks().length-1);y?(k=l?x*h.width+w*h.offset:w*(h.height-h.offset),S=l?w*(f.height-f.offset):x*f.width+w*f.offset):(k=h.width/2,S=f.width/2),e.paddingLeft=Math.max((k-M)*e.width/(e.width-M),0)+3,e.paddingRight=Math.max((S-C)*e.width/(e.width-C),0)+3}else{var T=i.mirror?0:p.width+v+m;t.width=Math.min(e.maxWidth,t.width+T),e.paddingTop=h.height/2,e.paddingBottom=f.height/2}}e.handleMargins(),c?(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,i=this;for(i.ticks=e.map((function(e){return e.value})),i.beforeTickToLabelConversion(),t=i.convertTicksToLabels(e)||i.ticks,i.afterTickToLabelConversion(),n=0,r=e.length;nr-1?null:t.getPixelForDecimal(e*i+(n?i/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,i,o=this,a=o.options.ticks,s=o._length,l=a.maxTicksLimit||s/o._tickSize()+1,c=a.major.enabled?fr(e):[],u=c.length,d=c[0],h=c[u-1];if(u>l)return pr(e,c,u/l),ur(e);if(r=hr(c,e,s,l),u>0){for(t=0,n=u-1;t1?(h-d)/(u-1):null,gr(e,r,ae.isNullOrUndef(i)?0:d-i,d),gr(e,r,h,ae.isNullOrUndef(i)?e.length:h+i),ur(e)}return gr(e,r),ur(e)},_tickSize:function(){var e=this,t=e.options.ticks,n=ae.toRadians(e.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),o=e._getLabelSizes(),a=t.autoSkipPadding||0,s=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return e.isHorizontal()?l*r>s*i?s/r:l/i:l*i=0&&(a=e),void 0!==o&&(e=n.indexOf(o))>=0&&(s=e),t.minIndex=a,t.maxIndex=s,t.min=n[a],t.max=n[s]},buildTicks:function(){var e=this,t=e._getLabels(),n=e.minIndex,r=e.maxIndex;e.ticks=0===n&&r===t.length-1?t:t.slice(n,r+1)},getLabelForIndex:function(e,t){var n=this,r=n.chart;return r.getDatasetMeta(t).controller._getValueScaleId()===n.id?n.getRightValue(r.data.datasets[t].data[e]):n._getLabels()[e]},_configure:function(){var e=this,t=e.options.offset,n=e.ticks;vr.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,i,o,a=this;return yr(t)||yr(n)||(e=a.chart.data.datasets[n].data[t]),yr(e)||(r=a.isHorizontal()?e.x:e.y),(void 0!==r||void 0!==e&&isNaN(t))&&(i=a._getLabels(),e=ae.valueOrDefault(r,e),t=-1!==(o=i.indexOf(e))?o: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;xr._defaults=wr;var _r=ae.noop,kr=ae.isNullOrUndef;function Sr(e,t){var n,r,i,o,a=[],s=1e-14,l=e.stepSize,c=l||1,u=e.maxTicks-1,d=e.min,h=e.max,f=e.precision,p=t.min,g=t.max,m=ae.niceNum((g-p)/u/c)*c;if(mu&&(m=ae.niceNum(o*m/u/c)*c),l||kr(f)?n=Math.pow(10,ae._decimalPlaces(m)):(n=Math.pow(10,f),m=Math.ceil(m*n)/n),r=Math.floor(p/m)*m,i=Math.ceil(g/m)*m,l&&(!kr(d)&&ae.almostWhole(d/m,m/1e3)&&(r=d),!kr(h)&&ae.almostWhole(h/m,m/1e3)&&(i=h)),o=(i-r)/m,o=ae.almostEquals(o,Math.round(o),m/1e3)?Math.round(o):Math.ceil(o),r=Math.round(r*n)/n,i=Math.round(i*n)/n,a.push(kr(d)?r:d);for(var v=1;v0&&r>0&&(e.min=0)}var i=void 0!==t.min||void 0!==t.suggestedMin,o=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)),i!==o&&e.min>=e.max&&(i?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,i=n.maxTicksLimit;return r?e=Math.ceil(t.max/r)-Math.floor(t.min/r)+1:(e=t._computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:_r,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)},i=e.ticks=Sr(r,e);e.handleDirectionalChanges(),e.max=ae.max(i),e.min=ae.min(i),t.reverse?(i.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),vr.prototype.convertTicksToLabels.call(e)},_configure:function(){var e,t=this,n=t.getTicks(),r=t.min,i=t.max;vr.prototype._configure.call(t),t.options.offset&&n.length&&(r-=e=(i-r)/Math.max(n.length-1,1)/2,i+=e),t._startValue=r,t._endValue=i,t._valueRange=i-r}}),Cr={position:"left",ticks:{callback:Xn.formatters.linear}},Tr=0,Dr=1;function Lr(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 i,o,a=e.options,s=Lr(t,a.stacked,n),l=s.pos,c=s.neg,u=r.length;for(i=0;it.length-1?null:this.getPixelForValue(t[e])}}),Nr=Cr;Or._defaults=Nr;var Fr=ae.valueOrDefault,Ir=ae.math.log10;function Rr(e,t){var n,r,i=[],o=Fr(e.min,Math.pow(10,Math.floor(Ir(t.min)))),a=Math.floor(Ir(t.max)),s=Math.ceil(t.max/Math.pow(10,a));0===o?(n=Math.floor(Ir(t.minNotZero)),r=Math.floor(t.minNotZero/Math.pow(10,n)),i.push(o),o=r*Math.pow(10,n)):(n=Math.floor(Ir(o)),r=Math.floor(o/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do{i.push(o),10==++r&&(r=1,l=++n>=0?1:l),o=Math.round(r*Math.pow(10,n)*l)/l}while(n=0?e:t}var zr=vr.extend({determineDataLimits:function(){var e,t,n,r,i,o,a=this,s=a.options,l=a.chart,c=l.data.datasets,u=a.isHorizontal();function d(e){return u?e.xAxisID===a.id:e.yAxisID===a.id}a.min=Number.POSITIVE_INFINITY,a.max=Number.NEGATIVE_INFINITY,a.minNotZero=Number.POSITIVE_INFINITY;var h=s.stacked;if(void 0===h)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(Ir(e.max))):e.minNotZero=n)},buildTicks:function(){var e=this,t=e.options.ticks,n=!e.isHorizontal(),r={min:Er(t.min),max:Er(t.max)},i=e.ticks=Rr(r,e);e.max=ae.max(i),e.min=ae.min(i),t.reverse?(n=!n,e.start=e.max,e.end=e.min):(e.start=e.min,e.end=e.max),n&&i.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),vr.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(Ir(e));return Math.floor(e/Math.pow(10,t))*Math.pow(10,t)},_configure:function(){var e=this,t=e.min,n=0;vr.prototype._configure.call(e),0===t&&(t=e._getFirstTickValue(e.minNotZero),n=Fr(e.options.ticks.fontSize,J.global.defaultFontSize)/e._length),e._startValue=Ir(t),e._valueOffset=n,e._valueRange=(Ir(e.max)-Ir(t))/(1-n)},getPixelForValue:function(e){var t=this,n=0;return(e=+t.getRightValue(e))>t.min&&e>0&&(n=(Ir(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)}}),Hr=Wr;zr._defaults=Hr;var Br=ae.valueOrDefault,Vr=ae.valueAtIndexOrDefault,Yr=ae.options.resolve,Ur={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 jr(e){var t=e.ticks;return t.display&&e.display?Br(t.fontSize,J.global.defaultFontSize)+2*t.backdropPaddingY:0}function Gr(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 qr(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:ei?{start:t-n,end:t}:{start:t,end:t+n}}function $r(e){var t,n,r,i=ae.options._parseFont(e.options.pointLabels),o={l:0,r:e.width,t:0,b:e.height-e.paddingTop},a={};e.ctx.font=i.string,e._pointLabelSizes=[];var s=e.chart.data.labels.length;for(t=0;to.r&&(o.r=u.end,a.r=l),d.starto.b&&(o.b=d.end,a.b=l)}e.setReductions(e.drawingArea,o,a)}function Kr(e){return 0===e||180===e?"center":e<180?"left":"right"}function Zr(e,t,n,r){var i,o,a=n.y+r/2;if(ae.isArray(t))for(i=0,o=t.length;i270||e<90)&&(n.y-=t.h)}function Jr(e){var t=e.ctx,n=e.options,r=n.pointLabels,i=jr(n),o=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 s=e.chart.data.labels.length-1;s>=0;s--){var l=0===s?i/2:0,c=e.getPointPosition(s,o+l+5),u=Vr(r.fontColor,s,J.global.defaultFontColor);t.fillStyle=u;var d=e.getIndexAngle(s),h=ae.toDegrees(d);t.textAlign=Kr(h),Xr(h,e._pointLabelSizes[s],c),Zr(t,e.pointLabels[s],c,a.lineHeight)}t.restore()}function Qr(e,t,n,r){var i,o=e.ctx,a=t.circular,s=e.chart.data.labels.length,l=Vr(t.color,r-1),c=Vr(t.lineWidth,r-1);if((a||s)&&l&&c){if(o.save(),o.strokeStyle=l,o.lineWidth=c,o.setLineDash&&(o.setLineDash(t.borderDash||[]),o.lineDashOffset=t.borderDashOffset||0),o.beginPath(),a)o.arc(e.xCenter,e.yCenter,n,0,2*Math.PI);else{i=e.getPointPosition(0,n),o.moveTo(i.x,i.y);for(var u=1;u0&&r>0?n:0)},_drawGrid:function(){var e,t,n,r=this,i=r.ctx,o=r.options,a=o.gridLines,s=o.angleLines,l=Br(s.lineWidth,a.lineWidth),c=Br(s.color,a.color);if(o.pointLabels.display&&Jr(r),a.display&&ae.each(r.ticks,(function(e,n){0!==n&&(t=r.getDistanceFromCenterForValue(r.ticksAsNumbers[n]),Qr(r,a,t,n))})),s.display&&l&&c){for(i.save(),i.lineWidth=l,i.strokeStyle=c,i.setLineDash&&(i.setLineDash(Yr([s.borderDash,a.borderDash,[]])),i.lineDashOffset=Yr([s.borderDashOffset,a.borderDashOffset,0])),e=r.chart.data.labels.length-1;e>=0;e--)t=r.getDistanceFromCenterForValue(o.ticks.reverse?r.min:r.max),n=r.getPointPosition(e,t),i.beginPath(),i.moveTo(r.xCenter,r.yCenter),i.lineTo(n.x,n.y),i.stroke();i.restore()}},_drawLabels:function(){var e=this,t=e.ctx,n=e.options.ticks;if(n.display){var r,i,o=e.getIndexAngle(0),a=ae.options._parseFont(n),s=Br(n.fontColor,J.global.defaultFontColor);t.save(),t.font=a.string,t.translate(e.xCenter,e.yCenter),t.rotate(o),t.textAlign="center",t.textBaseline="middle",ae.each(e.ticks,(function(o,l){(0!==l||n.reverse)&&(r=e.getDistanceFromCenterForValue(e.ticksAsNumbers[l]),n.showLabelBackdrop&&(i=t.measureText(o).width,t.fillStyle=n.backdropColor,t.fillRect(-i/2-n.backdropPaddingX,-r-a.size/2-n.backdropPaddingY,i+2*n.backdropPaddingX,a.size+2*n.backdropPaddingY)),t.fillStyle=s,t.fillText(o,0,-r))})),t.restore()}},_drawTitle:ae.noop}),ni=Ur;ti._defaults=ni;var ri=ae._deprecated,ii=ae.options.resolve,oi=ae.valueOrDefault,ai=Number.MIN_SAFE_INTEGER||-9007199254740991,si=Number.MAX_SAFE_INTEGER||9007199254740991,li={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}},ci=Object.keys(li);function ui(e,t){return e-t}function di(e){var t,n,r,i={},o=[];for(t=0,n=e.length;tt&&s=0&&a<=s;){if(i=e[(r=a+s>>1)-1]||null,o=e[r],!i)return{lo:null,hi:o};if(o[t]n))return{lo:i,hi:o};s=r-1}}return{lo:o,hi:null}}function mi(e,t,n,r){var i=gi(e,t,n),o=i.lo?i.hi?i.lo:e[e.length-2]:e[0],a=i.lo?i.hi?i.hi:e[e.length-1]:e[1],s=a[t]-o[t],l=s?(n-o[t])/s:0,c=(a[r]-o[r])*l;return o[r]+c}function vi(e,t){var n=e._adapter,r=e.options.time,i=r.parser,o=i||r.format,a=t;return"function"==typeof i&&(a=i(a)),ae.isFinite(a)||(a="string"==typeof o?n.parse(a,o):n.parse(a)),null!==a?+a:(i||"function"!=typeof o||(a=o(t),ae.isFinite(a)||(a=n.parse(a))),a)}function yi(e,t){if(ae.isNullOrUndef(t))return null;var n=e.options.time,r=vi(e,e.getRightValue(t));return null===r||n.round&&(r=+e._adapter.startOf(r,n.round)),r}function bi(e,t,n,r){var i,o,a,s=ci.length;for(i=ci.indexOf(e);i=ci.indexOf(n);o--)if(a=ci[o],li[a].common&&e._adapter.diff(i,r,a)>=t-1)return a;return ci[n?ci.indexOf(n):0]}function wi(e){for(var t=ci.indexOf(e)+1,n=ci.length;t1e5*c)throw t+" and "+n+" are too far apart with stepSize of "+c+" "+l;for(i=d;i=0&&(t[o].major=!0);return t}function Mi(e,t,n){var r,i,o=[],a={},s=t.length;for(r=0;r1?di(p).sort(ui):p.sort(ui),h=Math.min(h,p[0]),f=Math.max(f,p[p.length-1])),h=yi(s,hi(u))||h,f=yi(s,fi(u))||f,h=h===si?+c.startOf(Date.now(),d):h,f=f===ai?+c.endOf(Date.now(),d)+1:f,s.min=Math.min(h,f),s.max=Math.max(h+1,f),s._table=[],s._timestamps={data:p,datasets:g,labels:m}},buildTicks:function(){var e,t,n,r=this,i=r.min,o=r.max,a=r.options,s=a.ticks,l=a.time,c=r._timestamps,u=[],d=r.getLabelCapacity(i),h=s.source,f=a.distribution;for(c="data"===h||"auto"===h&&"series"===f?c.data:"labels"===h?c.labels:_i(r,i,o,d),"ticks"===a.bounds&&c.length&&(i=c[0],o=c[c.length-1]),i=yi(r,hi(a))||i,o=yi(r,fi(a))||o,e=0,t=c.length;e=i&&n<=o&&u.push(n);return r.min=i,r.max=o,r._unit=l.unit||(s.autoSkip?bi(l.minUnit,r.min,r.max,d):xi(r,u.length,l.minUnit,r.min,r.max)),r._majorUnit=s.major.enabled&&"year"!==r._unit?wi(r._unit):void 0,r._table=pi(r._timestamps.data,i,o,f),r._offsets=ki(r._table,u,i,o,a),s.reverse&&u.reverse(),Mi(r,u,r._majorUnit)},getLabelForIndex:function(e,t){var n=this,r=n._adapter,i=n.chart.data,o=n.options.time,a=i.labels&&e=0&&e0?s:1}}),Di=Ci;Ti._defaults=Di;var Li={category:xr,linear:Or,logarithmic:zr,radialLinear:ti,time:Ti},Pi={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"};Zn._date.override("function"==typeof e?{_id:"moment",formats:function(){return Pi},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)}}:{}),J._set("global",{plugins:{filler:{propagate:!0}}});var Ai={dataset:function(e){var t=e.fill,n=e.chart,r=n.getDatasetMeta(t),i=r&&n.isDatasetVisible(t)&&r.dataset._children||[],o=i.length||0;return o?function(e,t){return t=n)&&r;switch(o){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return o;default:return!1}}function Ni(e){var t,n=e.el._model||{},r=e.el._scale||{},i=e.fill,o=null;if(isFinite(i))return null;if("start"===i?o=void 0===n.scaleBottom?r.bottom:n.scaleBottom:"end"===i?o=void 0===n.scaleTop?r.top:n.scaleTop:void 0!==n.scaleZero?o=n.scaleZero:r.getBasePixel&&(o=r.getBasePixel()),null!=o){if(void 0!==o.x&&void 0!==o.y)return o;if(ae.isFinite(o))return{x:(t=r.isHorizontal())?o:null,y:t?null:o}}return null}function Fi(e){var t,n,r,i,o,a=e.el._scale,s=a.options,l=a.chart.data.labels.length,c=e.fill,u=[];if(!l)return null;for(t=s.ticks.reverse?a.max:a.min,n=s.ticks.reverse?a.min:a.max,r=a.getPointPositionForValue(0,t),i=0;i0;--o)ae.canvas.lineTo(e,n[o],n[o-1],!0);else for(a=n[0].cx,s=n[0].cy,l=Math.sqrt(Math.pow(n[0].x-a,2)+Math.pow(n[0].y-s,2)),o=i-1;o>0;--o)e.arc(a,s,l,n[o].angle,n[o-1].angle,!0)}}function Hi(e,t,n,r,i,o){var a,s,l,c,u,d,h,f,p=t.length,g=r.spanGaps,m=[],v=[],y=0,b=0;for(e.beginPath(),a=0,s=p;a=0;--n)(t=l[n].$filler)&&t.visible&&(i=(r=t.el)._view,o=r._children||[],a=t.mapper,s=i.backgroundColor||J.global.defaultColor,a&&s&&o.length&&(ae.canvas.clipArea(c,e.chartArea),Hi(c,o,a,i,s,r._loop),ae.canvas.unclipArea(c)))}},Vi=ae.rtl.getRtlAdapter,Yi=ae.noop,Ui=ae.valueOrDefault;function ji(e,t){return e.usePointStyle&&e.boxWidth>t?t:e.boxWidth}J._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,i=r.getDatasetMeta(n);i.hidden=null===i.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 i=n.controller.getStyle(r?0:void 0);return{text:t[n.index].label,fillStyle:i.backgroundColor,hidden:!e.isDatasetVisible(n.index),lineCap:i.borderCapStyle,lineDash:i.borderDash,lineDashOffset:i.borderDashOffset,lineJoin:i.borderJoinStyle,lineWidth:i.borderWidth,strokeStyle:i.borderColor,pointStyle:i.pointStyle,rotation:i.rotation,datasetIndex:n.index}}),this)}}},legendCallback:function(e){var t,n,r,i=document.createElement("ul"),o=e.data.datasets;for(i.setAttribute("class",e.id+"-legend"),t=0,n=o.length;tl.width)&&(d+=a+n.padding,u[u.length-(t>0?0:1)]=0),s[t]={left:0,top:0,width:r,height:a},u[u.length-1]+=r+n.padding})),l.height+=d}else{var h=n.padding,f=e.columnWidths=[],p=e.columnHeights=[],g=n.padding,m=0,v=0;ae.each(e.legendItems,(function(e,t){var r=ji(n,a)+a/2+i.measureText(e.text).width;t>0&&v+a+2*h>l.height&&(g+=m+n.padding,f.push(m),p.push(v),m=0,v=0),m=Math.max(m,r),v+=a+h,s[t]={left:0,top:0,width:r,height:a}})),g+=m,f.push(m),p.push(v),l.width+=g}e.width=l.width,e.height=l.height}else e.width=l.width=e.height=l.height=0},afterFit:Yi,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var e=this,t=e.options,n=t.labels,r=J.global,i=r.defaultColor,o=r.elements.line,a=e.height,s=e.columnHeights,l=e.width,c=e.lineWidths;if(t.display){var u,d=Vi(t.rtl,e.left,e.minSize.width),h=e.ctx,f=Ui(n.fontColor,r.defaultFontColor),p=ae.options._parseFont(n),g=p.size;h.textAlign=d.textAlign("left"),h.textBaseline="middle",h.lineWidth=.5,h.strokeStyle=f,h.fillStyle=f,h.font=p.string;var m=ji(n,g),v=e.legendHitBoxes,y=function(e,t,r){if(!(isNaN(m)||m<=0)){h.save();var a=Ui(r.lineWidth,o.borderWidth);if(h.fillStyle=Ui(r.fillStyle,i),h.lineCap=Ui(r.lineCap,o.borderCapStyle),h.lineDashOffset=Ui(r.lineDashOffset,o.borderDashOffset),h.lineJoin=Ui(r.lineJoin,o.borderJoinStyle),h.lineWidth=a,h.strokeStyle=Ui(r.strokeStyle,i),h.setLineDash&&h.setLineDash(Ui(r.lineDash,o.borderDash)),n&&n.usePointStyle){var s=m*Math.SQRT2/2,l=d.xPlus(e,m/2),c=t+g/2;ae.canvas.drawPoint(h,r.pointStyle,s,l,c,r.rotation)}else h.fillRect(d.leftForLtr(e,m),t,m,g),0!==a&&h.strokeRect(d.leftForLtr(e,m),t,m,g);h.restore()}},b=function(e,t,n,r){var i=g/2,o=d.xPlus(e,m+i),a=t+i;h.fillText(n.text,o,a),n.hidden&&(h.beginPath(),h.lineWidth=2,h.moveTo(o,a),h.lineTo(d.xPlus(o,r),a),h.stroke())},x=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();u=w?{x:e.left+x(l,c[0]),y:e.top+n.padding,line:0}:{x:e.left+n.padding,y:e.top+x(a,s[0]),line:0},ae.rtl.overrideTextDirection(e.ctx,t.textDirection);var _=g+n.padding;ae.each(e.legendItems,(function(t,r){var i=h.measureText(t.text).width,o=m+g/2+i,f=u.x,p=u.y;d.setWidth(e.minSize.width),w?r>0&&f+o+n.padding>e.left+e.minSize.width&&(p=u.y+=_,u.line++,f=u.x=e.left+x(l,c[u.line])):r>0&&p+_>e.top+e.minSize.height&&(f=u.x=f+e.columnWidths[u.line]+n.padding,u.line++,p=u.y=e.top+x(a,s[u.line]));var k=d.x(f);y(k,p,t),v[r].left=d.leftForLtr(k,v[r].width),v[r].top=p,b(k,p,t,i),w?u.x+=o+n.padding:u.y+=_})),ae.rtl.restoreTextDirection(e.ctx,t.textDirection)}},_getLegendItemAt:function(e,t){var n,r,i,o=this;if(e>=o.left&&e<=o.right&&t>=o.top&&t<=o.bottom)for(i=o.legendHitBoxes,n=0;n=(r=i[n]).left&&e<=r.left+r.width&&t>=r.top&&t<=r.top+r.height)return o.legendItems[n];return null},handleEvent:function(e){var t,n=this,r=n.options,i="mouseup"===e.type?"click":e.type;if("mousemove"===i){if(!r.onHover&&!r.onLeave)return}else{if("click"!==i)return;if(!r.onClick)return}t=n._getLegendItemAt(e.x,e.y),"click"===i?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 qi(e,t){var n=new Gi({ctx:e.ctx,options:t,chart:e});Ut.configure(e,n,t),Ut.addBox(e,n),e.legend=n}var $i={id:"legend",_element:Gi,beforeInit:function(e){var t=e.options.legend;t&&qi(e,t)},beforeUpdate:function(e){var t=e.options.legend,n=e.legend;t?(ae.mergeIf(t,J.global.legend),n?(Ut.configure(e,n,t),n.options=t):qi(e,t)):n&&(Ut.removeBox(e,n),delete e.legend)},afterEvent:function(e,t){var n=e.legend;n&&n.handleEvent(t)}},Ki=ae.noop;J._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var Zi=pe.extend({initialize:function(e){var t=this;ae.extend(t,e),t.legendHitBoxes=[]},beforeUpdate:Ki,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:Ki,beforeSetDimensions:Ki,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:Ki,beforeBuildLabels:Ki,buildLabels:Ki,afterBuildLabels:Ki,beforeFit:Ki,fit:function(){var e,t=this,n=t.options,r=t.minSize={},i=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=i?t.maxWidth:e,t.height=r.height=i?e:t.maxHeight):t.width=r.width=t.height=r.height=0},afterFit:Ki,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,i,o,a=ae.options._parseFont(n),s=a.lineHeight,l=s/2+n.padding,c=0,u=e.top,d=e.left,h=e.bottom,f=e.right;t.fillStyle=ae.valueOrDefault(n.fontColor,J.global.defaultFontColor),t.font=a.string,e.isHorizontal()?(i=d+(f-d)/2,o=u+l,r=f-d):(i="left"===n.position?d+l:f-l,o=u+(h-u)/2,r=h-u,c=Math.PI*("left"===n.position?-.5:.5)),t.save(),t.translate(i,o),t.rotate(c),t.textAlign="center",t.textBaseline="middle";var p=n.text;if(ae.isArray(p))for(var g=0,m=0;m{this.chart&&this.chart.resize()}))}static get styles(){return ee`:host{position:relative;height:100%;width:100%;display:block;min-height:25rem}canvas{width:100px;height:100px}`}firstUpdated(){fetch(this.url).then((e=>e.json())).catch((e=>console.error(e))).then((e=>{var t;let n=(null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("canvas")).getContext("2d");this.chart=new ge(n,{type:"bar",data:{datasets:[{label:"Failed Logins",backgroundColor:"rgba(201, 25, 11, .5)",spanGaps:!0,data:e.logins_failed_per_1h},{label:"Successful Logins",backgroundColor:"rgba(189, 229, 184, .5)",spanGaps:!0,data:e.logins_per_1h}]},options:{maintainAspectRatio:!1,spanGaps:!0,scales:{xAxes:[{stacked:!0,gridLines:{color:"rgba(0, 0, 0, 0)"},type:"time",offset:!0,ticks:{callback:function(e,t,n){const r=n[t],i=Date.now()-r.value;return Math.round(i/1e3/3600)+" Hours ago"},autoSkip:!0,maxTicksLimit:8}}],yAxes:[{stacked:!0,gridLines:{color:"rgba(0, 0, 0, 0)"}}]}}})}))}render(){return W``}};e([Z()],me.prototype,"url",void 0),me=e([$("pb-admin-logins-chart")],me);var ve=fe((function(e,t){e.exports=function(){var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=r||i||o,s=a&&(r?document.documentMode||6:+(o||i)[1]),l=!o&&/WebKit\//.test(e),c=l&&/Qt\/\d+\.\d+/.test(e),u=!o&&/Chrome\//.test(e),d=/Opera\//.test(e),h=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),g=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),m=/Android/.test(e),v=g||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=g||/Mac/.test(t),b=/\bCrOS\b/.test(e),x=/win/i.test(t),w=d&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(d=!1,l=!0);var _=y&&(c||d&&(null==w||w<12.11)),k=n||a&&s>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var M,C=function(e,t){var n=e.className,r=S(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function D(e,t){return T(e).appendChild(t)}function L(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}g?I=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(I=function(e){try{e.select()}catch(e){}});var z=function(){this.id=null,this.f=null,this.time=0,this.handler=R(this.onTimeout,this)};function H(e,t){for(var n=0;n=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var q=[""];function $(e){for(;q.length<=e;)q.push(K(q)+" ");return q[e]}function K(e){return e[e.length-1]}function Z(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||ee.test(e))}function ne(e,t){return t?!!(t.source.indexOf("\\w")>-1&&te(e))||t.test(e):te(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ie=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function oe(e){return e.charCodeAt(0)>=768&&ie.test(e)}function ae(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function le(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;ot||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var ce=null;function ue(e,t,n){var r;ce=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:ce=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:ce=i)}return null!=r?r:ce}var de=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?t.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;function l(e,t,n){this.level=e,this.from=t,this.to=n}return function(e,t){var c="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!r.test(e))return!1;for(var u=e.length,d=[],h=0;h-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ve(e,t){var n=ge(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function we(e){e.prototype.on=function(e,t){pe(this,e,t)},e.prototype.off=function(e,t){me(this,e,t)}}function _e(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ke(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Se(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Me(e){_e(e),ke(e)}function Ce(e){return e.target||e.srcElement}function Te(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var De,Le,Pe=function(){if(a&&s<9)return!1;var e=L("div");return"draggable"in e||"dragDrop"in e}();function Ae(e){if(null==De){var t=L("span","​");D(e,L("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(De=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=De?L("span","​"):L("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Oe(e){if(null!=Le)return Le;var t=D(e,document.createTextNode("AخA")),n=M(t,0,1).getBoundingClientRect(),r=M(t,1,2).getBoundingClientRect();return T(e),!(!n||n.left==n.right)&&(Le=r.right-n.right<3)}var Ne,Fe=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Ie=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Re="oncopy"in(Ne=L("div"))||(Ne.setAttribute("oncopy","return;"),"function"==typeof Ne.oncopy),We=null;function Ee(e){if(null!=We)return We;var t=D(e,L("span","x")),n=t.getBoundingClientRect(),r=M(t,0,1).getBoundingClientRect();return We=Math.abs(n.left-r.left)>1}var ze={},He={};function Be(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ze[e]=t}function Ve(e,t){He[e]=t}function Ye(e){if("string"==typeof e&&He.hasOwnProperty(e))e=He[e];else if(e&&"string"==typeof e.name&&He.hasOwnProperty(e.name)){var t=He[e.name];"string"==typeof t&&(t={name:t}),(e=Q(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ye("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ye("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ue(e,t){t=Ye(t);var n=ze[t.name];if(!n)return Ue(e,"text/plain");var r=n(e,t);if(je.hasOwnProperty(t.name)){var i=je[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var je={};function Ge(e,t){W(t,je.hasOwnProperty(e)?je[e]:je[e]={})}function qe(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function $e(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Ke(e,t,n){return!e.startState||e.startState(t,n)}var Ze=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Xe(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?ot(n,Xe(e,n).text.length):ft(t,Xe(e,t.line).text.length)}function ft(e,t){var n=e.ch;return null==n||n>t?ot(e.line,t):n<0?ot(e.line,0):e}function pt(e,t){for(var n=[],r=0;r=this.string.length},Ze.prototype.sol=function(){return this.pos==this.lineStart},Ze.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ze.prototype.next=function(){if(this.post},Ze.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ze.prototype.skipToEnd=function(){this.pos=this.string.length},Ze.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ze.prototype.backUp=function(e){this.pos-=e},Ze.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Ze.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ze.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ze.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ze.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var gt=function(e,t){this.state=e,this.lookAhead=t},mt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function vt(e,t,n,r){var i=[e.state.modeGen],o={};Ct(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],l=1,c=0;n.state=!0,Ct(e,t.text,s.mode,n,(function(e,t){for(var n=l;ce&&i.splice(l,1,e,i[l+1],r),l+=2,c=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength&&qe(e.doc.mode,r.state),o=vt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function bt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new mt(r,!0,t);var o=Tt(e,t,n),a=o>r.first&&Xe(r,o-1).stateAfter,s=a?mt.fromSaved(r,a,o):new mt(r,Ke(r.mode),o);return r.iter(o,t,(function(n){xt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&rt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}mt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},mt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},mt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},mt.fromSaved=function(e,t,n){return t instanceof gt?new mt(e,qe(e.mode,t.state),n,t.lookAhead):new mt(e,qe(e.mode,t),n)},mt.prototype.save=function(e){var t=!1!==e?qe(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new gt(t,this.maxLookAhead):t};var kt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function St(e,t,n,r){var i,o,a=e.doc,s=a.mode,l=Xe(a,(t=ht(a,t)).line),c=bt(e,t.line,n),u=new Ze(l.text,e.options.tabSize,c);for(r&&(o=[]);(r||u.pose.options.maxHighlightLength?(s=!1,a&&xt(e,t,r,d.pos),d.pos=t.length,l=null):l=Mt(_t(n,d,r.state,h),o),h){var f=h[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!s||u!=l){for(;ca;--s){if(s<=o.first)return o.first;var l=Xe(o,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof gt?c.lookAhead:0)<=o.modeFrontier))return s;var u=E(l.text,null,e.options.tabSize);(null==i||r>u)&&(i=s-1,r=u)}return i}function Dt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=Xe(e,r).stateAfter;if(i&&(!(i instanceof gt)||r+i.lookAhead=t:o.to>t);(r||(r=[])).push(new Nt(a,o.from,s?null:o.to))}}return r}function Et(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&s)for(var b=0;b0)){var u=[l,1],d=at(c.from,s.from),h=at(c.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:s.from}),(h>0||!a.inclusiveRight&&!h)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-3}}return i}function Vt(e){var t=e.markedSpans;if(t){for(var n=0;nt)&&(!n||Gt(n,o.marker)<0)&&(n=o.marker)}return n}function Xt(e,t,n,r,i){var o=Xe(e,t),a=Pt&&o.markedSpans;if(a)for(var s=0;s=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?at(c.to,n)>=0:at(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?at(c.from,r)<=0:at(c.from,r)<0)))return!0}}}function Jt(e){for(var t;t=$t(e);)e=t.find(-1,!0).line;return e}function Qt(e){for(var t;t=Kt(e);)e=t.find(1,!0).line;return e}function en(e){for(var t,n;t=Kt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function tn(e,t){var n=Xe(e,t),r=Jt(n);return n==r?t:tt(r)}function nn(e,t){if(t>e.lastLine())return t;var n,r=Xe(e,t);if(!rn(e,r))return t;for(;n=Kt(r);)r=n.find(1,!0).line;return tt(r)+1}function rn(e,t){var n=Pt&&t.markedSpans;if(n)for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var cn=function(e,t,n){this.text=e,Yt(this,t),this.height=n?n(this):1};function un(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Vt(e),Yt(e,n);var i=r?r(e):1;i!=e.height&&et(e,i)}function dn(e){e.parent=null,Vt(e)}cn.prototype.lineNo=function(){return tt(this)},we(cn);var hn={},fn={};function pn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?fn:hn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function gn(e,t){var n=P("span",null,null,l?"padding-right: .1px":null),r={pre:P("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=vn,Oe(e.display.measure)&&(a=he(o,e.doc.direction))&&(r.addToken=bn(r.addToken,a)),r.map=[],wn(o,r,yt(e,o,t!=e.display.externalMeasured&&tt(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=F(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=F(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Ae(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return ve(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=F(r.pre.className,r.textClass||"")),r}function mn(e){var t=L("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function vn(e,t,n,r,i,o,l){if(t){var c,u=e.splitSpaces?yn(t,e.trailingSpace):t,d=e.cm.state.specialChars,h=!1;if(d.test(t)){c=document.createDocumentFragment();for(var f=0;;){d.lastIndex=f;var p=d.exec(t),g=p?p.index-f:t.length-f;if(g){var m=document.createTextNode(u.slice(f,f+g));a&&s<9?c.appendChild(L("span",[m])):c.appendChild(m),e.map.push(e.pos,e.pos+g,m),e.col+=g,e.pos+=g}if(!p)break;f+=g+1;var v=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(v=c.appendChild(L("span",$(b),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?((v=c.appendChild(L("span","\r"==p[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),a&&s<9?c.appendChild(L("span",[v])):c.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),a&&s<9&&(h=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||r||i||h||o||l){var x=n||"";r&&(x+=r),i&&(x+=i);var w=L("span",[c],x,o);if(l)for(var _ in l)l.hasOwnProperty(_)&&"style"!=_&&"class"!=_&&w.setAttribute(_,l[_]);return e.content.appendChild(w)}e.content.appendChild(c)}}function yn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;ic&&d.from<=c);h++);if(d.to>=u)return e(n,r,i,o,a,s,l);e(n,r.slice(0,d.to-c),i,o,null,s,l),o=null,r=r.slice(d.to-c),c=d.to}}}function xn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function wn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,l,c,u,d,h,f=i.length,p=0,g=1,m="",v=0;;){if(v==p){l=c=u=s="",h=null,d=null,v=1/0;for(var y=[],b=void 0,x=0;xp||_.collapsed&&w.to==p&&w.from==p)){if(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,c=""),_.className&&(l+=" "+_.className),_.css&&(s=(s?s+";":"")+_.css),_.startStyle&&w.from==p&&(u+=" "+_.startStyle),_.endStyle&&w.to==v&&(b||(b=[])).push(_.endStyle,w.to),_.title&&((h||(h={})).title=_.title),_.attributes)for(var k in _.attributes)(h||(h={}))[k]=_.attributes[k];_.collapsed&&(!d||Gt(d.marker,_)<0)&&(d=w)}else w.from>p&&v>w.from&&(v=w.from)}if(b)for(var S=0;S=f)break;for(var C=Math.min(f,v);;){if(m){var T=p+m.length;if(!d){var D=T>C?m.slice(0,C-p):m;t.addToken(t,D,a?a+l:l,u,p+D.length==v?c:"",s,h)}if(T>=C){m=m.slice(C-p),p=C;break}p=T,u=""}m=i.slice(o,o=n[g++]),a=pn(n[g++],t.cm.options)}}else for(var L=1;L2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Jn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;rn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Qn(e,t){var n=tt(t=Jt(t)),r=e.display.externalMeasured=new _n(e.doc,t,n);r.lineN=n;var i=r.built=gn(e,r);return r.text=i.pre,D(e.display.lineMeasure,i.pre),r}function er(e,t,n,r){return rr(e,nr(e,t),n,r)}function tr(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(i=(o=l-s)-1,t>=l&&(a="right")),null!=i){if(r=e[c+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],a="left";if("right"==n&&i==l-s)for(;c=0&&(n=e[i]).left==n.right;i--);return n}function lr(e,t,n,r){var i,o=ar(t.map,n,r),l=o.node,c=o.start,u=o.end,d=o.collapse;if(3==l.nodeType){for(var h=0;h<4;h++){for(;c&&oe(t.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u0&&(d=r="right"),i=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==r?f.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!i||!i.left&&!i.right)){var p=l.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+Pr(e.display),top:p.top,bottom:p.bottom}:or}for(var g=i.top-t.rect.top,m=i.bottom-t.rect.top,v=(g+m)/2,y=t.view.measure.heights,b=0;b=r.text.length?(l=r.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(e,t,n){return a(n?e-1:e,1==s[t].level!=n)}var d=ue(s,l,c),h=ce,f=u(l,d,"before"==c);return null!=h&&(f.other=u(l,h,"before"!=c)),f}function xr(e,t){var n=0;t=ht(e.doc,t),e.options.lineWrapping||(n=Pr(e.display)*t.ch);var r=Xe(e.doc,t.line),i=an(r)+jn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function wr(e,t,n,r,i){var o=ot(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function _r(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return wr(r.first,0,null,-1,-1);var i=nt(r,n),o=r.first+r.size-1;if(i>o)return wr(r.first+r.size-1,Xe(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=Xe(r,i);;){var s=Cr(e,a,i,t,n),l=Zt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==i)return c;a=Xe(r,i=c.line)}}function kr(e,t,n,r){r-=gr(t);var i=t.text.length,o=se((function(t){return rr(e,n,t-1).bottom<=r}),i,0);return{begin:o,end:i=se((function(t){return rr(e,n,t).top>r}),o,i)}}function Sr(e,t,n,r){return n||(n=nr(e,t)),kr(e,t,n,mr(e,t,rr(e,n,r),"line").top)}function Mr(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Cr(e,t,n,r,i){i-=an(t);var o=nr(e,t),a=gr(t),s=0,l=t.text.length,c=!0,u=he(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?Dr:Tr)(e,t,n,o,u,r,i);s=(c=1!=d.level)?d.from:d.to-1,l=c?d.to:d.from-1}var h,f,p=null,g=null,m=se((function(t){var n=rr(e,o,t);return n.top+=a,n.bottom+=a,!!Mr(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=t,g=n),!0)}),s,l),v=!1;if(g){var y=r-g.left=x.bottom?1:0}return wr(n,m=ae(t.text,m,1),f,v,r-h)}function Tr(e,t,n,r,i,o,a){var s=se((function(s){var l=i[s],c=1!=l.level;return Mr(br(e,ot(n,c?l.to:l.from,c?"before":"after"),"line",t,r),o,a,!0)}),0,i.length-1),l=i[s];if(s>0){var c=1!=l.level,u=br(e,ot(n,c?l.from:l.to,c?"after":"before"),"line",t,r);Mr(u,o,a,!0)&&u.top>a&&(l=i[s-1])}return l}function Dr(e,t,n,r,i,o,a){var s=kr(e,t,r,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,h=0;h=c||f.to<=l)){var p=rr(e,r,1!=f.level?Math.min(c,f.to)-1:Math.max(l,f.from)).right,g=pg)&&(u=f,d=g)}}return u||(u=i[i.length-1]),u.fromc&&(u={from:u.from,to:c,level:u.level}),u}function Lr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==ir){ir=L("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ir.appendChild(document.createTextNode("x")),ir.appendChild(L("br"));ir.appendChild(document.createTextNode("x"))}D(e.measure,ir);var n=ir.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),T(e.measure),n||1}function Pr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=L("span","xxxxxxxxxx"),n=L("pre",[t],"CodeMirror-line-like");D(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Ar(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:Or(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Or(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Nr(e){var t=Lr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Pr(e.display)-3);return function(i){if(rn(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(l=Xe(e.doc,c.line).text).length==c.ch){var u=E(l,l.length,e.options.tabSize)-l.length;c=ot(c.line,Math.max(0,Math.round((o-qn(e.display).left)/Pr(e.display))-u))}return c}function Rr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Pt&&tn(e.doc,t)i.viewFrom?zr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)zr(e);else if(t<=i.viewFrom){var o=Hr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):zr(e)}else if(n>=i.viewTo){var a=Hr(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):zr(e)}else{var s=Hr(e,t,t,-1),l=Hr(e,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(kn(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):zr(e)}var c=i.externalMeasured;c&&(n=i.lineN&&t=r.viewTo)){var o=r.view[Rr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==H(a,n)&&a.push(n)}}}function zr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Hr(e,t,n,r){var i,o=Rr(e,t),a=e.display.view;if(!Pt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,l=0;l0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;tn(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function Br(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=kn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=kn(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Rr(e,n)))),r.viewTo=n}function Vr(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||s.to().line0?t.blinker=setInterval((function(){e.hasFocus()||Jr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Kr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Xr(e))}function Zr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Jr(e))}),100)}function Xr(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ve(e,"focus",e,t),e.state.focused=!0,N(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),$r(e))}function Jr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ve(e,"blur",e,t),e.state.focused=!1,C(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Qr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r.005||h<-.005)&&(et(i.line,l),ei(i.line),i.rest))for(var f=0;fe.display.sizerWidth){var p=Math.ceil(c/Pr(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function ei(e){if(e.widgets)for(var t=0;t=a&&(o=nt(t,an(Xe(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function ni(e,t){if(!ye(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=L("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-jn(e.display))+"px;\n height: "+(t.bottom-t.top+$n(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function ri(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?ot(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?ot(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=br(e,t),l=n&&n!=t?br(e,n):s,c=oi(e,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(hi(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(pi(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}function ii(e,t){var n=oi(e,t);null!=n.scrollTop&&hi(e,n.scrollTop),null!=n.scrollLeft&&pi(e,n.scrollLeft)}function oi(e,t){var n=e.display,r=Lr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Zn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Gn(n),l=t.tops-r;if(t.topi+o){var u=Math.min(t.top,(c?s:t.bottom)-o);u!=i&&(a.scrollTop=u)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-d,f=Kn(e)-n.gutters.offsetWidth,p=t.right-t.left>f;return p&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.leftf+h-3&&(a.scrollLeft=t.right+(p?0:10)-f),a}function ai(e,t){null!=t&&(ui(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function si(e){ui(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function li(e,t,n){null==t&&null==n||ui(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function ci(e,t){ui(e),e.curOp.scrollToPos=t}function ui(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,di(e,xr(e,t.from),xr(e,t.to),t.margin))}function di(e,t,n,r){var i=oi(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});li(e,i.scrollLeft,i.scrollTop)}function hi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||Yi(e,{top:t}),fi(e,t,!0),n&&Yi(e),Ii(e,100))}function fi(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function pi(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,qi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function gi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Gn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+$n(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var mi=function(e,t,n){this.cm=n;var r=this.vert=L("div",[L("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=L("div",[L("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),pe(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),pe(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};mi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},mi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},mi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},mi.prototype.zeroWidthHack=function(){var e=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new z,this.disableVert=new z},mi.prototype.enableZeroWidthBar=function(e,t,n){function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},mi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var vi=function(){};function yi(e,t){t||(t=gi(e));var n=e.display.barWidth,r=e.display.barHeight;bi(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Qr(e),bi(e,gi(e)),n=e.display.barWidth,r=e.display.barHeight}function bi(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}vi.prototype.update=function(){return{bottom:0,right:0}},vi.prototype.setScrollLeft=function(){},vi.prototype.setScrollTop=function(){},vi.prototype.clear=function(){};var xi={native:mi,null:vi};function wi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&C(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new xi[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),pe(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?pi(e,t):hi(e,t)}),e),e.display.scrollbars.addClass&&N(e.display.wrapper,e.display.scrollbars.addClass)}var _i=0;function ki(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++_i},Mn(e.curOp)}function Si(e){var t=e.curOp;t&&Tn(t,(function(e){for(var t=0;t=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Wi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ti(e){e.updatedDisplay=e.mustUpdate&&Bi(e.cm,e.update)}function Di(e){var t=e.cm,n=t.display;e.updatedDisplay&&Qr(t),e.barMeasure=gi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=er(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+$n(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Kn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Li(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var n=+new Date+e.options.workTime,r=bt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?qe(t.mode,r.state):null,l=vt(e,o,r,!0);s&&(r.state=s),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!d&&hn)return Ii(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Ai(e,(function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Vr(e))return!1;$i(e)&&(zr(e),t.dims=Ar(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Pt&&(o=tn(e.doc,o),a=nn(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Br(e,o,a),n.viewOffset=an(Xe(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=Vr(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=zi(e);return l>4&&(n.lineDiv.style.display="none"),Ui(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Hi(c),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Ii(e,400)),n.updateLineNumbers=null,!0}function Vi(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Kn(e))r&&(t.visible=ti(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Gn(e.display)-Zn(e),n.top)}),t.visible=ti(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!Bi(e,t))break;Qr(e);var i=gi(e);Yr(e),yi(e,i),Gi(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Yi(e,t){var n=new Wi(e,t);if(Bi(e,n)){Qr(e),Vi(e,n);var r=gi(e);Yr(e),yi(e,r),Gi(e,r),n.finish()}}function Ui(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return l&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=r.view,u=r.viewFrom,d=0;d-1&&(f=!1),An(e,h,u,n)),f&&(T(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(it(e.options,u)))),a=h.node.nextSibling}else{var p=zn(e,h,u,n);o.insertBefore(p,a)}u+=h.size}for(;a;)a=s(a)}function ji(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Gi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+$n(e)+"px"}function qi(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=Or(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;as.clientWidth,u=s.scrollHeight>s.clientHeight;if(i&&c||o&&u){if(o&&y&&l)e:for(var h=t.target,f=a.view;h!=s;h=h.parentNode)for(var p=0;p=0&&at(e,r.to())<=0)return n}return-1};var oo=function(e,t){this.anchor=e,this.head=t};function ao(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return at(e.from(),t.from())})),n=H(t,i);for(var o=1;o0:l>=0){var c=ut(s.from(),a.from()),u=ct(s.to(),a.to()),d=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new oo(d?u:c,d?c:u))}}return new io(t,n)}function so(e,t){return new io([new oo(e,t||e)],0)}function lo(e){return e.text?ot(e.from.line+e.text.length-1,K(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function co(e,t){if(at(e,t.from)<0)return e;if(at(e,t.to)<=0)return lo(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=lo(t).ch-t.to.ch),ot(n,r)}function uo(e,t){for(var n=[],r=0;r1&&e.remove(s.line+1,p-1),e.insert(s.line+1,v)}Ln(e,"change",e,t)}function yo(e,t,n){function r(e,i,o){if(e.linked)for(var a=0;a1&&!e.done[e.done.length-2].ranges?(e.done.pop(),K(e.done)):void 0}function Co(e,t,n,r){var i=e.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=Mo(i,i.lastOp==r)))a=K(o.changes),0==at(t.from,t.to)&&0==at(t.from,a.to)?a.to=lo(t):o.changes.push(ko(e,t));else{var l=K(i.done);for(l&&l.ranges||Lo(e.sel,i.done),o={changes:[ko(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||ve(e,"historyAdded")}function To(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Do(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||To(e,o,K(i.done),t))?i.done[i.done.length-1]=t:Lo(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&So(i.undone)}function Lo(e,t){var n=K(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Po(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Ao(e){if(!e)return null;for(var t,n=0;n-1&&(K(s)[d]=c[d],delete c[d])}}}return r}function Io(e,t,n,r){if(r){var i=e.anchor;if(n){var o=at(t,i)<0;o!=at(n,i)<0?(i=t,t=n):o!=at(t,n)<0&&(t=n)}return new oo(i,t)}return new oo(n||t,t)}function Ro(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Vo(e,new io([Io(e.sel.primary(),t,n,i)],0),r)}function Wo(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:s.to>t.ch))){if(i&&(ve(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var d=l.find(r<0?1:-1),h=void 0;if((r<0?u:c)&&(d=Ko(e,d,-r,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(h=at(d,n))&&(r<0?h<0:h>0))return qo(e,d,t,r,i)}var f=l.find(r<0?-1:1);return(r<0?c:u)&&(f=Ko(e,f,r,f.line==t.line?o:null)),f?qo(e,f,t,r,i):null}}return t}function $o(e,t,n,r,i){var o=r||1,a=qo(e,t,n,o,i)||!i&&qo(e,t,n,o,!0)||qo(e,t,n,-o,i)||!i&&qo(e,t,n,-o,!0);return a||(e.cantEdit=!0,ot(e.first,0))}function Ko(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?ht(e,ot(t.line-1)):null:n>0&&t.ch==(r||Xe(e,t.line)).text.length?t.line=0;--i)Qo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Qo(e,t)}}function Qo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=at(t.from,t.to)){var n=uo(e,t);Co(e,t,n,e.cm?e.cm.curOp.id:NaN),na(e,t,n,zt(e,t));var r=[];yo(e,(function(e,n){n||-1!=H(r,e.history)||(sa(e.history,t),r.push(e.history)),na(e,t,null,zt(e,t))}))}}function ea(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,c=0;c=0;--f){var p=h(f);if(p)return p.v}}}}function ta(e,t){if(0!=t&&(e.first+=t,e.sel=new io(Z(e.sel.ranges,(function(e){return new oo(ot(e.anchor.line+t,e.anchor.ch),ot(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){Wr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:ot(o,Xe(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Je(e,t.from,t.to),n||(n=uo(e,t)),e.cm?ra(e.cm,t,r):vo(e,t,r),Yo(e,n,Y),e.cantEdit&&$o(e,ot(e.firstLine(),0))&&(e.cantEdit=!1)}}function ra(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=tt(Jt(Xe(r,o.line))),r.iter(l,a.line+1,(function(e){if(e==i.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&be(e),vo(r,t,n,Nr(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,(function(e){var t=sn(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),Dt(r,o.line),Ii(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?Wr(e):o.line!=a.line||1!=t.text.length||mo(e.doc,t)?Wr(e,o.line,a.line+1,c):Er(e,o.line,"text");var u=xe(e,"changes"),d=xe(e,"change");if(d||u){var h={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&Ln(e,"change",e,h),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function ia(e,t,n,r,i){var o;r||(r=n),at(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),Jo(e,{from:n,to:r,text:t,origin:i})}function oa(e,t,n,r){n1||!(this.children[0]instanceof ca))){var s=[];this.collapse(s),this.children=[new ca(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=P("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Xt(e,t.line,t,n,o)||t.line!=n.line&&Xt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ot()}o.addToHistory&&Co(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,n.line+1,(function(e){c&&o.collapsed&&!c.options.lineWrapping&&Jt(e)==c.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&et(e,0),Rt(e,new Nt(o,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){rn(e,t)&&et(t,0)})),o.clearOnEnter&&pe(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(At(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++pa,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)Wr(c,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=t.line;u<=n.line;u++)Er(c,u,"text");o.atomic&&jo(c.doc),Ln(c,"markerAdded",c,o)}return o}ga.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&ki(e),xe(this,"clear")){var n=this.find();n&&Ln(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Wr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&jo(e.doc)),e&&Ln(e,"markerCleared",e,this,r,i),t&&Si(e),this.parent&&this.parent.clear()}},ga.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i=0;l--)Jo(this,r[l]);s?Bo(this,s):this.cm&&si(this.cm)})),undo:Fi((function(){ea(this,"undo")})),redo:Fi((function(){ea(this,"redo")})),undoSelection:Fi((function(){ea(this,"undo",!0)})),redoSelection:Fi((function(){ea(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ht(this,e),t=ht(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n})),ht(this,ot(n,t))},indexFromPos:function(e){var t=(e=ht(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var d=e.dataTransfer.getData("Text");if(d){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),Yo(t.doc,so(n,n)),h)for(var f=0;f=0;t--)ia(e.doc,"",r[t].from,r[t].to,"+delete");si(e)}))}function qa(e,t,n){var r=ae(e.text,t+n,n);return r<0||r>e.text.length?null:r}function $a(e,t,n){var r=qa(e,t.ch,n);return null==r?null:new ot(t.line,r,n<0?"after":"before")}function Ka(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=he(n,t.doc.direction);if(o){var a,s=i<0?K(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=nr(t,n);a=i<0?n.text.length-1:0;var u=rr(t,c,a).top;a=se((function(e){return rr(t,c,e).top==u}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=qa(n,a,1))}else a=i<0?s.to:s.from;return new ot(r,a,l)}}return new ot(r,i<0?n.text.length:0,i<0?"before":"after")}function Za(e,t,n,r){var i=he(t,e.doc.direction);if(!i)return $a(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ue(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&h>=u.begin)){var f=d?"before":"after";return new ot(n.line,h,f)}}var p=function(e,t,r){for(var o=function(e,t){return t?new ot(n.line,l(e,1),"before"):new ot(n.line,e,"after")};e>=0&&e0==(1!=a.level),c=s?r.begin:l(r.end,-1);if(a.from<=c&&c0?u.end:l(u.begin,-1);return null==m||r>0&&m==t.text.length||!(g=p(r>0?0:i.length-1,r,c(m)))?null:g}Ea.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ea.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ea.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ea.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ea.default=y?Ea.macDefault:Ea.pcDefault;var Xa={selectAll:Zo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Y)},killLine:function(e){return Ga(e,(function(t){if(t.empty()){var n=Xe(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new ot(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ot(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Xe(e.doc,i.line-1).text;a&&(i=new ot(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),ot(i.line-1,a.length-1),i,"+transpose"))}n.push(new oo(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return Ai(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r-1&&(at((i=s.ranges[i]).from(),t)<0||t.xRel>0)&&(at(i.to(),t)>0||t.xRel<0)?_s(e,r,t,o):Ss(e,r,t,o)}function _s(e,t,n,r){var i=e.display,o=!1,c=Oi(e,(function(t){l&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Zr(e)),me(i.wrapper.ownerDocument,"mouseup",c),me(i.wrapper.ownerDocument,"mousemove",u),me(i.scroller,"dragstart",d),me(i.scroller,"drop",c),o||(_e(t),r.addNew||Ro(e.doc,n,null,null,r.extend),l&&!h||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),u=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return o=!0};l&&(i.scroller.draggable=!0),e.state.draggingText=c,c.copy=!r.moveOnDrag,pe(i.wrapper.ownerDocument,"mouseup",c),pe(i.wrapper.ownerDocument,"mousemove",u),pe(i.scroller,"dragstart",d),pe(i.scroller,"drop",c),e.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}function ks(e,t,n){if("char"==n)return new oo(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new oo(ot(t.line,0),ht(e.doc,ot(t.line+1,0)));var r=n(e,t);return new oo(r.from,r.to)}function Ss(e,t,n,r){a&&Zr(e);var i=e.display,o=e.doc;_e(t);var s,l,c=o.sel,u=c.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),s=l>-1?u[l]:new oo(n,n)):(s=o.sel.primary(),l=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new oo(n,n)),n=Ir(e,t,!0,!0),l=-1;else{var d=ks(e,n,r.unit);s=r.extend?Io(s,d.anchor,d.head,r.extend):d}r.addNew?-1==l?(l=u.length,Vo(o,ao(e,u.concat([s]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"char"==r.unit&&!r.extend?(Vo(o,ao(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),c=o.sel):Eo(o,l,s,U):(l=0,Vo(o,new io([s],0),U),c=o.sel);var h=n;function f(t){if(0!=at(h,t))if(h=t,"rectangle"==r.unit){for(var i=[],a=e.options.tabSize,u=E(Xe(o,n.line).text,n.ch,a),d=E(Xe(o,t.line).text,t.ch,a),f=Math.min(u,d),p=Math.max(u,d),g=Math.min(n.line,t.line),m=Math.min(e.lastLine(),Math.max(n.line,t.line));g<=m;g++){var v=Xe(o,g).text,y=G(v,f,a);f==p?i.push(new oo(ot(g,y),ot(g,y))):v.length>y&&i.push(new oo(ot(g,y),ot(g,G(v,p,a))))}i.length||i.push(new oo(n,n)),Vo(o,ao(e,c.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,x=s,w=ks(e,t,r.unit),_=x.anchor;at(w.anchor,_)>0?(b=w.head,_=ut(x.from(),w.anchor)):(b=w.anchor,_=ct(x.to(),w.head));var k=c.ranges.slice(0);k[l]=Ms(e,new oo(ht(o,_),b)),Vo(o,ao(e,k,l),U)}}var p=i.wrapper.getBoundingClientRect(),g=0;function m(t){var n=++g,a=Ir(e,t,!0,"rectangle"==r.unit);if(a)if(0!=at(a,h)){e.curOp.focus=O(),f(a);var s=ti(i,o);(a.line>=s.to||a.linep.bottom?20:0;l&&setTimeout(Oi(e,(function(){g==n&&(i.scroller.scrollTop+=l,m(t))})),50)}}function v(t){e.state.selectingText=!1,g=1/0,t&&(_e(t),i.input.focus()),me(i.wrapper.ownerDocument,"mousemove",y),me(i.wrapper.ownerDocument,"mouseup",b),o.history.lastSelOrigin=null}var y=Oi(e,(function(e){0!==e.buttons&&Te(e)?m(e):v(e)})),b=Oi(e,v);e.state.selectingText=b,pe(i.wrapper.ownerDocument,"mousemove",y),pe(i.wrapper.ownerDocument,"mouseup",b)}function Ms(e,t){var n=t.anchor,r=t.head,i=Xe(e.doc,n.line);if(0==at(n,r)&&n.sticky==r.sticky)return t;var o=he(i);if(!o)return t;var a=ue(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=ue(o,r.ch,r.sticky),d=u-a||(r.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?d<0:d>0}var h=o[c+(l?-1:0)],f=l==(1==h.level),p=f?h.from:h.to,g=f?"after":"before";return n.ch==p&&n.sticky==g?t:new oo(new ot(n.line,p,g),r)}function Cs(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&_e(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!xe(e,n))return Se(t);o-=s.top-a.viewOffset;for(var l=0;l=i)return ve(e,n,e,nt(e.doc,o),e.display.gutterSpecs[l].className,t),Se(t)}}function Ts(e,t){return Cs(e,t,"gutterClick",!0)}function Ds(e,t){Un(e.display,t)||Ls(e,t)||ye(e,t,"contextmenu")||k||e.display.input.onContextMenu(t)}function Ls(e,t){return!!xe(e,"gutterContextMenu")&&Cs(e,t,"gutterContextMenu",!1)}function Ps(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),hr(e)}ms.prototype.compare=function(e,t,n){return this.time+gs>e&&0==at(t,this.pos)&&n==this.button};var As={toString:function(){return"CodeMirror.Init"}},Os={},Ns={};function Fs(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=As&&i(e,t,n)}:i)}e.defineOption=n,e.Init=As,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,po(e)}),!0),n("indentUnit",2,po,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){go(e),hr(e),Wr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(ot(r,o))}r++}));for(var i=n.length-1;i>=0;i--)ia(e.doc,t,n[i],ot(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=As&&e.refresh()})),n("specialCharPlaceholder",mn,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Ps(e),Xi(e)}),!0),n("keyMap","default",(function(e,t,n){var r=ja(t),i=n!=As&&ja(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Rs,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=Ki(t,e.options.lineNumbers),Xi(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Or(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return yi(e)}),!0),n("scrollbarStyle","native",(function(e){wi(e),yi(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=Ki(e.options.gutters,t),Xi(e)}),!0),n("firstLineNumber",1,Xi,!0),n("lineNumberFormatter",(function(e){return e}),Xi,!0),n("showCursorWhenSelecting",!1,Yr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Jr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Is),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Yr,!0),n("singleCursorHeightPerLine",!0,Yr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,go,!0),n("addModeClass",!1,go,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,go,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}function Is(e,t,n){if(!t!=!(n&&n!=As)){var r=e.display.dragFunctions,i=t?pe:me;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Rs(e){e.options.lineWrapping?(N(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(C(e.display.wrapper,"CodeMirror-wrap"),ln(e)),Fr(e),Wr(e),hr(e),setTimeout((function(){return yi(e)}),100)}function Ws(e,t){var n=this;if(!(this instanceof Ws))return new Ws(e,t);this.options=t=t?W(t):{},W(Os,t,!1);var r=t.value;"string"==typeof r?r=new ka(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Ws.inputStyles[t.inputStyle](this),o=this.display=new Ji(e,r,i,t);for(var c in o.wrapper.CodeMirror=this,Ps(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),wi(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new z,keySeq:null,specialChars:null},t.autofocus&&!v&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Es(this),Aa(),ki(this),this.curOp.forceUpdate=!0,bo(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Xr(n)}),20):Jr(this),Ns)Ns.hasOwnProperty(c)&&Ns[c](this,t[c],As);$i(this),t.finishInit&&t.finishInit(this);for(var u=0;u400}pe(t.scroller,"touchstart",(function(i){if(!ye(e,i)&&!o(i)&&!Ts(e,i)){t.input.ensurePolled(),clearTimeout(n);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),pe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),pe(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!Un(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,a=e.coordsChar(t.activeTouch,"page");o=!r.prev||l(r,r.prev)?new oo(a,a):!r.prev.prev||l(r,r.prev.prev)?e.findWordAt(a):new oo(ot(a.line,0),ht(e.doc,ot(a.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),_e(n)}i()})),pe(t.scroller,"touchcancel",i),pe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(hi(e,t.scroller.scrollTop),pi(e,t.scroller.scrollLeft,!0),ve(e,"scroll",e))})),pe(t.scroller,"mousewheel",(function(t){return ro(e,t)})),pe(t.scroller,"DOMMouseScroll",(function(t){return ro(e,t)})),pe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ye(e,t)||Me(t)},over:function(t){ye(e,t)||(Ta(e,t),Me(t))},start:function(t){return Ca(e,t)},drop:Oi(e,Ma),leave:function(t){ye(e,t)||Da(e)}};var c=t.input.getField();pe(c,"keyup",(function(t){return ds.call(e,t)})),pe(c,"keydown",Oi(e,cs)),pe(c,"keypress",Oi(e,hs)),pe(c,"focus",(function(t){return Xr(e,t)})),pe(c,"blur",(function(t){return Jr(e,t)}))}Ws.defaults=Os,Ws.optionHandlers=Ns;var zs=[];function Hs(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=bt(e,t).state:n="prev");var a=e.options.tabSize,s=Xe(o,t),l=E(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((c=o.mode.indent(i,s.text.slice(u.length),s.text))==V||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?E(Xe(o,t-1).text,null,a):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var d="",h=0;if(e.options.indentWithTabs)for(var f=Math.floor(c/a);f;--f)h+=a,d+="\t";if(ha,l=Fe(t),c=null;if(s&&r.ranges.length>1)if(Bs&&Bs.text.join("\n")==t){if(r.ranges.length%Bs.text.length==0){c=[];for(var u=0;u=0;h--){var f=r.ranges[h],p=f.from(),g=f.to();f.empty()&&(n&&n>0?p=ot(p.line,p.ch-n):e.state.overwrite&&!s?g=ot(g.line,Math.min(Xe(o,g.line).text.length,g.ch+K(l).length)):s&&Bs&&Bs.lineWise&&Bs.text.join("\n")==l.join("\n")&&(p=g=ot(p.line,0)));var m={from:p,to:g,text:c?c[h%c.length]:l,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};Jo(e.doc,m),Ln(e,"inputRead",e,m)}t&&!s&&js(e,t),si(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Us(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Ai(t,(function(){return Ys(t,n,0,null,"paste")})),!0}function js(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=Hs(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Xe(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Hs(e,i.head.line,"smart"));a&&Ln(e,"electricInput",e,i.head.line)}}}function Gs(e){for(var t=[],n=[],r=0;rn&&(Hs(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&si(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&Eo(this.doc,r,new oo(o,c[r].to()),Y)}}})),getTokenAt:function(e,t){return St(this,e,t)},getLineTokens:function(e,t){return St(this,ot(e),t,!0)},getTokenTypeAt:function(e){e=ht(this.doc,e);var t,n=yt(this,Xe(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]o&&(e=o,i=!0),r=Xe(this.doc,e)}else r=e;return mr(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-an(r):0)},defaultTextHeight:function(){return Lr(this.display)},defaultCharWidth:function(){return Pr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display,a=(e=br(this,ht(this.doc,e))).bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(a=e.bottom),s+t.offsetWidth>c&&(s=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&ii(this,{left:s,top:a,right:s+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:Ni(cs),triggerOnKeyPress:Ni(hs),triggerOnKeyUp:ds,triggerOnMouseDown:Ni(ys),execCommand:function(e){if(Xa.hasOwnProperty(e))return Xa[e].call(null,this)},triggerElectric:Ni((function(e){js(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=ht(this.doc,e),a=0;a0&&a(t.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&Fr(this),ve(this,"refresh",this)})),swapDoc:Ni((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),bo(this,e),hr(this),this.display.input.reset(),li(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Ln(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},we(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}function Zs(e,t,n,r,i){var o=t,a=n,s=Xe(e,t.line),l=i&&"rtl"==e.direction?-n:n;function c(){var n=t.line+l;return!(n=e.first+e.size)&&(t=new ot(n,t.ch,t.sticky),s=Xe(e,n))}function u(o){var a;if("codepoint"==r){var u=s.text.charCodeAt(t.ch+(r>0?0:-1));a=isNaN(u)?null:new ot(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(u>=55296&&u<56320?2:1))),-n)}else a=i?Za(e.cm,s,t,n):$a(s,t,n);if(null==a){if(o||!c())return!1;t=Ka(i,e.cm,s,t.line,l)}else t=a;return!0}if("char"==r||"codepoint"==r)u();else if("column"==r)u(!0);else if("word"==r||"group"==r)for(var d=null,h="group"==r,f=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(n<0)||u(!p);p=!1){var g=s.text.charAt(t.ch)||"\n",m=ne(g,f)?"w":h&&"\n"==g?"n":!h||/\s/.test(g)?null:"p";if(!h||p||m||(m="s"),d&&d!=m){n<0&&(n=1,u(),t.sticky="after");break}if(m&&(d=m),n>0&&!u(!p))break}var v=$o(e,t,o,a,!0);return st(o,v)&&(v.hitSide=!0),v}function Xs(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*Lr(e.display),3);i=(n>0?t.bottom:t.top)+n*c}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=_r(e,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Js=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Qs(e,t){var n=tr(e,t.line);if(!n||n.hidden)return null;var r=Xe(e.doc,t.line),i=Jn(n,r,t.line),o=he(r,e.doc.direction),a="left";o&&(a=ue(o,t.ch)%2?"right":"left");var s=ar(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function el(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function tl(e,t){return t&&(e.bad=!0),e}function nl(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function c(e){return function(t){return t.id==e}}function u(){a&&(o+=s,l&&(o+=s),a=l=!1)}function d(e){e&&(u(),o+=e)}function h(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void d(n);var o,f=t.getAttribute("cm-marker");if(f){var p=e.findMarks(ot(r,0),ot(i+1,0),c(+f));return void(p.length&&(o=p[0].find(0))&&d(Je(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var g=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;g&&u();for(var m=0;m=t.display.viewTo||o.line=t.display.viewFrom&&Qs(t,i)||{node:l[0].measure.map[2],offset:0},u=o.liner.firstLine()&&(a=ot(a.line-1,Xe(r.doc,a.line-1).length)),s.ch==Xe(r.doc,s.line).text.length&&s.linei.viewTo-1)return!1;a.line==i.viewFrom||0==(e=Rr(r,a.line))?(t=tt(i.view[0].line),n=i.view[0].node):(t=tt(i.view[e].line),n=i.view[e-1].node.nextSibling);var l,c,u=Rr(r,s.line);if(u==i.view.length-1?(l=i.viewTo-1,c=i.lineDiv.lastChild):(l=tt(i.view[u+1].line)-1,c=i.view[u+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(nl(r,n,c,t,l)),h=Je(r.doc,ot(t,0),ot(l,Xe(r.doc,l).text.length));d.length>1&&h.length>1;)if(K(d)==K(h))d.pop(),h.pop(),l--;else{if(d[0]!=h[0])break;d.shift(),h.shift(),t++}for(var f=0,p=0,g=d[0],m=h[0],v=Math.min(g.length,m.length);fa.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)f--,p++;d[d.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(f).replace(/\u200b+$/,"");var w=ot(t,f),_=ot(l,h.length?K(h).length-p:0);return d.length>1||d[0]||at(w,_)?(ia(r.doc,d,w,_,"+input"),!0):void 0},Js.prototype.ensurePolled=function(){this.forceCompositionEnd()},Js.prototype.reset=function(){this.forceCompositionEnd()},Js.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Js.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Js.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Ai(this.cm,(function(){return Wr(e.cm)}))},Js.prototype.setUneditable=function(e){e.contentEditable="false"},Js.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Oi(this.cm,Ys)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Js.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Js.prototype.onContextMenu=function(){},Js.prototype.resetPosition=function(){},Js.prototype.needsContentAttribute=!0;var ol=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null};function al(e,t){if((t=t?W(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=O();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(pe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(me(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var s=Ws((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s}function sl(e){e.off=me,e.on=pe,e.wheelEventPixels=no,e.Doc=ka,e.splitLines=Fe,e.countColumn=E,e.findColumn=G,e.isWordChar=te,e.Pass=V,e.signal=ve,e.Line=cn,e.changeEnd=lo,e.scrollbarModel=xi,e.Pos=ot,e.cmpPos=at,e.modes=ze,e.mimeModes=He,e.resolveMode=Ye,e.getMode=Ue,e.modeExtensions=je,e.extendMode=Ge,e.copyState=qe,e.startState=Ke,e.innerMode=$e,e.commands=Xa,e.keyMap=Ea,e.keyName=Ua,e.isModifierKey=Va,e.lookupKey=Ba,e.normalizeKeyMap=Ha,e.StringStream=Ze,e.SharedTextMarker=va,e.TextMarker=ga,e.LineWidget=da,e.e_preventDefault=_e,e.e_stopPropagation=ke,e.e_stop=Me,e.addClass=N,e.contains=A,e.rmClass=C,e.keyNames=Fa}ol.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!ye(r,e)){if(r.somethingSelected())Vs({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Gs(r);Vs({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,Y):(n.prevInput="",i.value=t.text.join("\n"),I(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(i.style.width="0px"),pe(i,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),pe(i,"paste",(function(e){ye(r,e)||Us(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),pe(i,"cut",o),pe(i,"copy",o),pe(e.scroller,"paste",(function(t){if(!Un(e,t)&&!ye(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),pe(e.lineSpace,"selectstart",(function(t){Un(e,t)||_e(t)})),pe(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),pe(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},ol.prototype.createField=function(e){this.wrapper=$s(),this.textarea=this.wrapper.firstChild},ol.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ol.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Ur(e);if(e.options.moveInputWithCursor){var i=br(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},ol.prototype.showSelection=function(e){var t=this.cm.display;D(t.cursorDiv,e.cursors),D(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ol.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&I(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},ol.prototype.getField=function(){return this.textarea},ol.prototype.supportsTouch=function(){return!1},ol.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||O()!=this.textarea))try{this.textarea.focus()}catch(e){}},ol.prototype.blur=function(){this.textarea.blur()},ol.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ol.prototype.receivedFocus=function(){this.slowPoll()},ol.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},ol.prototype.fastPoll=function(){var e=!1,t=this;function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}t.pollingFast=!0,t.polling.set(20,n)},ol.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ie(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(r.length,i.length);l1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},ol.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ol.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},ol.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Ir(n,e),c=r.scroller.scrollTop;if(o&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&Oi(n,Vo)(n.doc,so(o),Y);var u,h=i.style.cssText,f=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(u=window.scrollY),r.input.focus(),l&&window.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&m(),k){Me(e);var g=function(){me(window,"mouseup",g),setTimeout(v,20)};pe(window,"mouseup",g)}else setTimeout(v,50)}function m(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=f,i.style.cssText=h,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=i.selectionStart)){(!a||a&&s<9)&&m();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?Oi(n,Zo)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},ol.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},ol.prototype.setUneditable=function(){},ol.prototype.needsContentAttribute=!1,Fs(Ws),Ks(Ws);var ll="iter insert remove copy getEditor constructor".split(" ");for(var cl in ka.prototype)ka.prototype.hasOwnProperty(cl)&&H(ll,cl)<0&&(Ws.prototype[cl]=function(e){return function(){return e.apply(this.doc,arguments)}}(ka.prototype[cl]));return we(ka),Ws.inputStyles={textarea:ol,contenteditable:Js},Ws.defineMode=function(e){Ws.defaults.mode||"null"==e||(Ws.defaults.mode=e),Be.apply(this,arguments)},Ws.defineMIME=Ve,Ws.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Ws.defineMIME("text/plain","null"),Ws.defineExtension=function(e,t){Ws.prototype[e]=t},Ws.defineDocExtension=function(e,t){ka.prototype[e]=t},Ws.fromTextArea=al,sl(Ws),Ws.version="5.58.3",Ws}()}));fe((function(e,t){!function(e){function t(t,r){function i(){t.display.wrapper.offsetHeight?(n(t,r),t.display.lastWrapHeight!=t.display.wrapper.clientHeight&&t.refresh()):r.timeout=setTimeout(i,r.delay)}r.timeout=setTimeout(i,r.delay),r.hurry=function(){clearTimeout(r.timeout),r.timeout=setTimeout(i,50)},e.on(window,"mouseup",r.hurry),e.on(window,"keyup",r.hurry)}function n(t,n){clearTimeout(n.timeout),e.off(window,"mouseup",n.hurry),e.off(window,"keyup",n.hurry)}e.defineOption("autoRefresh",!1,(function(e,r){e.state.autoRefresh&&(n(e,e.state.autoRefresh),e.state.autoRefresh=null),r&&0==e.display.wrapper.offsetHeight&&t(e,e.state.autoRefresh={delay:r.delay||250})}))}(ve)})),fe((function(e,t){var n,r,i;r={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},i={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1},(n=ve).defineMode("xml",(function(e,t){var o,a,s=e.indentUnit,l={},c=t.htmlMode?r:i;for(var u in c)l[u]=c[u];for(var u in t)l[u]=t[u];function d(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();return"<"==r?e.eat("!")?e.eat("[")?e.match("CDATA[")?n(p("atom","]]>")):null:e.match("--")?n(p("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(g(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=p("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=h,"tag bracket"):"&"==r?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function h(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=d,o=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return o="equals",null;if("<"==n){t.tokenize=d,t.state=b,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=f(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=h;break}return"string"};return t.isInAttribute=!0,t}function p(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=d;break}n.next()}return e}}function g(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=g(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=d;break}return n.tokenize=g(e-1),n.tokenize(t,n)}}return"meta"}}function m(e,t,n){this.prev=e.context,this.tagName=t||"",this.indent=e.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function v(e){e.context&&(e.context=e.context.prev)}function y(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(t))return;v(e)}}function b(e,t,n){return"openTag"==e?(n.tagStart=t.column(),x):"closeTag"==e?w:b}function x(e,t,n){return"word"==e?(n.tagName=t.current(),a="tag",S):l.allowMissingTagName&&"endTag"==e?(a="tag bracket",S(e,t,n)):(a="error",x)}function w(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&v(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(a="tag",_):(a="tag error",k)}return l.allowMissingTagName&&"endTag"==e?(a="tag bracket",_(e,t,n)):(a="error",k)}function _(e,t,n){return"endTag"!=e?(a="error",_):(v(n),b)}function k(e,t,n){return a="error",_(e,t,n)}function S(e,t,n){if("word"==e)return a="attribute",M;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(r)?y(n,r):(y(n,r),n.context=new m(n,r,i==n.indented)),b}return a="error",S}function M(e,t,n){return"equals"==e?C:(l.allowMissing||(a="error"),S(e,t,n))}function C(e,t,n){return"string"==e?T:"word"==e&&l.allowUnquoted?(a="string",S):(a="error",S(e,t,n))}function T(e,t,n){return"string"==e?T:S(e,t,n)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,state:b,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(a=null,t.state=t.state(o||n,e,t),a&&(n="error"==a?n+" error":a)),n},indent:function(e,t,r){var i=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+s;if(i&&i.noIndent)return n.Pass;if(e.tokenize!=h&&e.tokenize!=d)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==l.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==C&&(e.state=S)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)t.push(n.tagName);return t.reverse()}}})),n.defineMIME("text/xml","xml"),n.defineMIME("application/xml","xml"),n.mimeModes.hasOwnProperty("text/html")||n.defineMIME("text/html",{name:"xml",htmlMode:!0})})),fe((function(e,t){var n;(n=ve).defineMode("yaml",(function(){var e=new RegExp("\\b(("+["true","false","on","off","yes","no"].join(")|(")+"))$","i");return{token:function(t,n){var r=t.peek(),i=n.escaped;if(n.escaped=!1,"#"==r&&(0==t.pos||/\s/.test(t.string.charAt(t.pos-1))))return t.skipToEnd(),"comment";if(t.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(n.literal&&t.indentation()>n.keyCol)return t.skipToEnd(),"string";if(n.literal&&(n.literal=!1),t.sol()){if(n.keyCol=0,n.pair=!1,n.pairStart=!1,t.match(/---/))return"def";if(t.match(/\.\.\./))return"def";if(t.match(/\s*-\s+/))return"meta"}if(t.match(/^(\{|\}|\[|\])/))return"{"==r?n.inlinePairs++:"}"==r?n.inlinePairs--:"["==r?n.inlineList++:n.inlineList--,"meta";if(n.inlineList>0&&!i&&","==r)return t.next(),"meta";if(n.inlinePairs>0&&!i&&","==r)return n.keyCol=0,n.pair=!1,n.pairStart=!1,t.next(),"meta";if(n.pairStart){if(t.match(/^\s*(\||\>)\s*/))return n.literal=!0,"meta";if(t.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==n.inlinePairs&&t.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(n.inlinePairs>0&&t.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(t.match(e))return"keyword"}return!n.pair&&t.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(n.pair=!0,n.keyCol=t.indentation(),"atom"):n.pair&&t.match(/^:\s*/)?(n.pairStart=!0,"meta"):(n.pairStart=!1,n.escaped="\\"==r,t.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}},lineComment:"#",fold:"indent"}})),n.defineMIME("text/x-yaml","yaml"),n.defineMIME("text/yaml","yaml")})),fe((function(e,t){!function(e){function t(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}var n=t(["and","or","not","is"]),r=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in"],i=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];function o(e){return e.scopes[e.scopes.length-1]}e.registerHelper("hintWords","python",r.concat(i)),e.defineMode("python",(function(a,s){for(var l="error",c=s.delimiters||s.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,u=[s.singleOperators,s.doubleOperators,s.doubleDelimiters,s.tripleDelimiters,s.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@]|\.\.\.)/],d=0;dr?S(t):i0&&C(e,t)&&(a+=" "+l),a}return w(e,t)}function w(e,t,r){if(e.eatSpace())return null;if(!r&&e.match(/^#.*/))return"comment";if(e.match(/^[0-9\.]/,!1)){var i=!1;if(e.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(i=!0),e.match(/^[\d_]+\.\d*/)&&(i=!0),e.match(/^\.\d+/)&&(i=!0),i)return e.eat(/J/i),"number";var o=!1;if(e.match(/^0x[0-9a-f_]+/i)&&(o=!0),e.match(/^0b[01_]+/i)&&(o=!0),e.match(/^0o[0-7_]+/i)&&(o=!0),e.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(e.eat(/J/i),o=!0),e.match(/^0(?![\dx])/i)&&(o=!0),o)return e.eat(/L/i),"number"}if(e.match(v))return-1!==e.current().toLowerCase().indexOf("f")?(t.tokenize=_(e.current(),t.tokenize),t.tokenize(e,t)):(t.tokenize=k(e.current(),t.tokenize),t.tokenize(e,t));for(var a=0;a=0;)e=e.substr(1);var n=1==e.length,r="string";function i(e){return function(t,n){var r=w(t,n,!0);return"punctuation"==r&&("{"==t.current()?n.tokenize=i(e+1):"}"==t.current()&&(n.tokenize=e>1?i(e-1):o)),r}}function o(o,a){for(;!o.eol();)if(o.eatWhile(/[^'"\{\}\\]/),o.eat("\\")){if(o.next(),n&&o.eol())return r}else{if(o.match(e))return a.tokenize=t,r;if(o.match("{{"))return r;if(o.match("{",!1))return a.tokenize=i(0),o.current()?r:a.tokenize(o,a);if(o.match("}}"))return r;if(o.match("}"))return l;o.eat(/['"]/)}if(n){if(s.singleLineStringErrors)return l;a.tokenize=t}return r}return o.isString=!0,o}function k(e,t){for(;"rubf".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length,r="string";function i(i,o){for(;!i.eol();)if(i.eatWhile(/[^'"\\]/),i.eat("\\")){if(i.next(),n&&i.eol())return r}else{if(i.match(e))return o.tokenize=t,r;i.eat(/['"]/)}if(n){if(s.singleLineStringErrors)return l;o.tokenize=t}return r}return i.isString=!0,i}function S(e){for(;"py"!=o(e).type;)e.scopes.pop();e.scopes.push({offset:o(e).offset+a.indentUnit,type:"py",align:null})}function M(e,t,n){var r=e.match(/^([\s\[\{\(]|#.*)*$/,!1)?null:e.column()+1;t.scopes.push({offset:t.indent+h,type:n,align:r})}function C(e,t){for(var n=e.indentation();t.scopes.length>1&&o(t).offset>n;){if("py"!=o(t).type)return!0;t.scopes.pop()}return o(t).offset!=n}function T(e,t){e.sol()&&(t.beginningOfLine=!0);var n=t.tokenize(e,t),r=e.current();if(t.beginningOfLine&&"@"==r)return e.match(m,!1)?"meta":g?"operator":l;if(/\S/.test(r)&&(t.beginningOfLine=!1),"variable"!=n&&"builtin"!=n||"meta"!=t.lastToken||(n="meta"),"pass"!=r&&"return"!=r||(t.dedent+=1),"lambda"==r&&(t.lambda=!0),":"!=r||t.lambda||"py"!=o(t).type||S(t),1==r.length&&!/string|comment/.test(n)){var i="[({".indexOf(r);if(-1!=i&&M(e,t,"])}".slice(i,i+1)),-1!=(i="])}".indexOf(r))){if(o(t).type!=r)return l;t.indent=t.scopes.pop().offset-h}}return t.dedent>0&&e.eol()&&"py"==o(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),n}return{startState:function(e){return{tokenize:x,scopes:[{offset:e||0,type:"py",align:null}],indent:e||0,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var r=T(e,t);return r&&"comment"!=r&&(t.lastToken="keyword"==r||"punctuation"==r?e.current():r),"punctuation"==r&&(r=null),e.eol()&&t.lambda&&(t.lambda=!1),n?r+" "+l:r},indent:function(t,n){if(t.tokenize!=x)return t.tokenize.isString?e.Pass:0;var r=o(t),i=r.type==n.charAt(0);return null!=r.align?r.align-(i?1:0):r.offset-(i?h:0)},electricInput:/^\s*[\}\]\)]$/,closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"}})),e.defineMIME("text/x-python","python");var a=function(e){return e.split(" ")};e.defineMIME("text/x-cython",{name:"python",extra_keywords:a("by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE")})}(ve)}));const ye=new CSSStyleSheet;ye.replaceSync("/* BASICS */\n\n.CodeMirror {\n /* Set height, width, borders, and global font properties here */\n font-family: monospace;\n height: 300px;\n color: black;\n direction: ltr;\n}\n\n/* PADDING */\n\n.CodeMirror-lines {\n padding: 4px 0; /* Vertical padding around content */\n}\n.CodeMirror pre.CodeMirror-line,\n.CodeMirror pre.CodeMirror-line-like {\n padding: 0 4px; /* Horizontal padding of content */\n}\n\n.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n background-color: white; /* The little square between H and V scrollbars */\n}\n\n/* GUTTER */\n\n.CodeMirror-gutters {\n border-right: 1px solid #ddd;\n background-color: #f7f7f7;\n white-space: nowrap;\n}\n.CodeMirror-linenumbers {}\n.CodeMirror-linenumber {\n padding: 0 3px 0 5px;\n min-width: 20px;\n text-align: right;\n color: #999;\n white-space: nowrap;\n}\n\n.CodeMirror-guttermarker { color: black; }\n.CodeMirror-guttermarker-subtle { color: #999; }\n\n/* CURSOR */\n\n.CodeMirror-cursor {\n border-left: 1px solid black;\n border-right: none;\n width: 0;\n}\n/* Shown when moving in bi-directional text */\n.CodeMirror div.CodeMirror-secondarycursor {\n border-left: 1px solid silver;\n}\n.cm-fat-cursor .CodeMirror-cursor {\n width: auto;\n border: 0 !important;\n background: #7e7;\n}\n.cm-fat-cursor div.CodeMirror-cursors {\n z-index: 1;\n}\n.cm-fat-cursor-mark {\n background-color: rgba(20, 255, 20, 0.5);\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n}\n.cm-animate-fat-cursor {\n width: auto;\n border: 0;\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n background-color: #7e7;\n}\n@-moz-keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n@-webkit-keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n@keyframes blink {\n 0% {}\n 50% { background-color: transparent; }\n 100% {}\n}\n\n/* Can style cursor different in overwrite (non-insert) mode */\n.CodeMirror-overwrite .CodeMirror-cursor {}\n\n.cm-tab { display: inline-block; text-decoration: inherit; }\n\n.CodeMirror-rulers {\n position: absolute;\n left: 0; right: 0; top: -50px; bottom: 0;\n overflow: hidden;\n}\n.CodeMirror-ruler {\n border-left: 1px solid #ccc;\n top: 0; bottom: 0;\n position: absolute;\n}\n\n/* DEFAULT THEME */\n\n.cm-s-default .cm-header {color: blue;}\n.cm-s-default .cm-quote {color: #090;}\n.cm-negative {color: #d44;}\n.cm-positive {color: #292;}\n.cm-header, .cm-strong {font-weight: bold;}\n.cm-em {font-style: italic;}\n.cm-link {text-decoration: underline;}\n.cm-strikethrough {text-decoration: line-through;}\n\n.cm-s-default .cm-keyword {color: #708;}\n.cm-s-default .cm-atom {color: #219;}\n.cm-s-default .cm-number {color: #164;}\n.cm-s-default .cm-def {color: #00f;}\n.cm-s-default .cm-variable,\n.cm-s-default .cm-punctuation,\n.cm-s-default .cm-property,\n.cm-s-default .cm-operator {}\n.cm-s-default .cm-variable-2 {color: #05a;}\n.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}\n.cm-s-default .cm-comment {color: #a50;}\n.cm-s-default .cm-string {color: #a11;}\n.cm-s-default .cm-string-2 {color: #f50;}\n.cm-s-default .cm-meta {color: #555;}\n.cm-s-default .cm-qualifier {color: #555;}\n.cm-s-default .cm-builtin {color: #30a;}\n.cm-s-default .cm-bracket {color: #997;}\n.cm-s-default .cm-tag {color: #170;}\n.cm-s-default .cm-attribute {color: #00c;}\n.cm-s-default .cm-hr {color: #999;}\n.cm-s-default .cm-link {color: #00c;}\n\n.cm-s-default .cm-error {color: #f00;}\n.cm-invalidchar {color: #f00;}\n\n.CodeMirror-composing { border-bottom: 2px solid; }\n\n/* Default styles for common addons */\n\ndiv.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}\ndiv.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}\n.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }\n.CodeMirror-activeline-background {background: #e8f2ff;}\n\n/* STOP */\n\n/* The rest of this file contains styles related to the mechanics of\n the editor. You probably shouldn't touch them. */\n\n.CodeMirror {\n position: relative;\n overflow: hidden;\n background: white;\n}\n\n.CodeMirror-scroll {\n overflow: scroll !important; /* Things will break if this is overridden */\n /* 50px is the magic margin used to hide the element's real scrollbars */\n /* See overflow: hidden in .CodeMirror */\n margin-bottom: -50px; margin-right: -50px;\n padding-bottom: 50px;\n height: 100%;\n outline: none; /* Prevent dragging from highlighting the element */\n position: relative;\n}\n.CodeMirror-sizer {\n position: relative;\n border-right: 50px solid transparent;\n}\n\n/* The fake, visible scrollbars. Used to force redraw during scrolling\n before actual scrolling happens, thus preventing shaking and\n flickering artifacts. */\n.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n position: absolute;\n z-index: 6;\n display: none;\n outline: none;\n}\n.CodeMirror-vscrollbar {\n right: 0; top: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n}\n.CodeMirror-hscrollbar {\n bottom: 0; left: 0;\n overflow-y: hidden;\n overflow-x: scroll;\n}\n.CodeMirror-scrollbar-filler {\n right: 0; bottom: 0;\n}\n.CodeMirror-gutter-filler {\n left: 0; bottom: 0;\n}\n\n.CodeMirror-gutters {\n position: absolute; left: 0; top: 0;\n min-height: 100%;\n z-index: 3;\n}\n.CodeMirror-gutter {\n white-space: normal;\n height: 100%;\n display: inline-block;\n vertical-align: top;\n margin-bottom: -50px;\n}\n.CodeMirror-gutter-wrapper {\n position: absolute;\n z-index: 4;\n background: none !important;\n border: none !important;\n}\n.CodeMirror-gutter-background {\n position: absolute;\n top: 0; bottom: 0;\n z-index: 4;\n}\n.CodeMirror-gutter-elt {\n position: absolute;\n cursor: default;\n z-index: 4;\n}\n.CodeMirror-gutter-wrapper ::selection { background-color: transparent }\n.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }\n\n.CodeMirror-lines {\n cursor: text;\n min-height: 1px; /* prevents collapsing before first draw */\n}\n.CodeMirror pre.CodeMirror-line,\n.CodeMirror pre.CodeMirror-line-like {\n /* Reset some styles that the rest of the page might have set */\n -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;\n border-width: 0;\n background: transparent;\n font-family: inherit;\n font-size: inherit;\n margin: 0;\n white-space: pre;\n word-wrap: normal;\n line-height: inherit;\n color: inherit;\n z-index: 2;\n position: relative;\n overflow: visible;\n -webkit-tap-highlight-color: transparent;\n -webkit-font-variant-ligatures: contextual;\n font-variant-ligatures: contextual;\n}\n.CodeMirror-wrap pre.CodeMirror-line,\n.CodeMirror-wrap pre.CodeMirror-line-like {\n word-wrap: break-word;\n white-space: pre-wrap;\n word-break: normal;\n}\n\n.CodeMirror-linebackground {\n position: absolute;\n left: 0; right: 0; top: 0; bottom: 0;\n z-index: 0;\n}\n\n.CodeMirror-linewidget {\n position: relative;\n z-index: 2;\n padding: 0.1px; /* Force widget margins to stay inside of the container */\n}\n\n.CodeMirror-widget {}\n\n.CodeMirror-rtl pre { direction: rtl; }\n\n.CodeMirror-code {\n outline: none;\n}\n\n/* Force content-box sizing for the elements where we expect it */\n.CodeMirror-scroll,\n.CodeMirror-sizer,\n.CodeMirror-gutter,\n.CodeMirror-gutters,\n.CodeMirror-linenumber {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n}\n\n.CodeMirror-measure {\n position: absolute;\n width: 100%;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n}\n\n.CodeMirror-cursor {\n position: absolute;\n pointer-events: none;\n}\n.CodeMirror-measure pre { position: static; }\n\ndiv.CodeMirror-cursors {\n visibility: hidden;\n position: relative;\n z-index: 3;\n}\ndiv.CodeMirror-dragcursors {\n visibility: visible;\n}\n\n.CodeMirror-focused div.CodeMirror-cursors {\n visibility: visible;\n}\n\n.CodeMirror-selected { background: #d9d9d9; }\n.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }\n.CodeMirror-crosshair { cursor: crosshair; }\n.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }\n.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }\n\n.cm-searching {\n background-color: #ffa;\n background-color: rgba(255, 255, 0, .4);\n}\n\n/* Used to force a border model for a node */\n.cm-force-border { padding-right: .1px; }\n\n@media print {\n /* Hide the cursor when printing */\n .CodeMirror div.CodeMirror-cursors {\n visibility: hidden;\n }\n}\n\n/* See issue #2901 */\n.cm-tab-wrap-hack:after { content: ''; }\n\n/* Help users use markselection to safely style text background */\nspan.CodeMirror-selectedtext { background: none; }\n");const be=new CSSStyleSheet;be.replaceSync("/* Based on Sublime Text's Monokai theme */\n\n.cm-s-monokai.CodeMirror { background: #272822; color: #f8f8f2; }\n.cm-s-monokai div.CodeMirror-selected { background: #49483E; }\n.cm-s-monokai .CodeMirror-line::selection, .cm-s-monokai .CodeMirror-line > span::selection, .cm-s-monokai .CodeMirror-line > span > span::selection { background: rgba(73, 72, 62, .99); }\n.cm-s-monokai .CodeMirror-line::-moz-selection, .cm-s-monokai .CodeMirror-line > span::-moz-selection, .cm-s-monokai .CodeMirror-line > span > span::-moz-selection { background: rgba(73, 72, 62, .99); }\n.cm-s-monokai .CodeMirror-gutters { background: #272822; border-right: 0px; }\n.cm-s-monokai .CodeMirror-guttermarker { color: white; }\n.cm-s-monokai .CodeMirror-guttermarker-subtle { color: #d0d0d0; }\n.cm-s-monokai .CodeMirror-linenumber { color: #d0d0d0; }\n.cm-s-monokai .CodeMirror-cursor { border-left: 1px solid #f8f8f0; }\n\n.cm-s-monokai span.cm-comment { color: #75715e; }\n.cm-s-monokai span.cm-atom { color: #ae81ff; }\n.cm-s-monokai span.cm-number { color: #ae81ff; }\n\n.cm-s-monokai span.cm-comment.cm-attribute { color: #97b757; }\n.cm-s-monokai span.cm-comment.cm-def { color: #bc9262; }\n.cm-s-monokai span.cm-comment.cm-tag { color: #bc6283; }\n.cm-s-monokai span.cm-comment.cm-type { color: #5998a6; }\n\n.cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute { color: #a6e22e; }\n.cm-s-monokai span.cm-keyword { color: #f92672; }\n.cm-s-monokai span.cm-builtin { color: #66d9ef; }\n.cm-s-monokai span.cm-string { color: #e6db74; }\n\n.cm-s-monokai span.cm-variable { color: #f8f8f2; }\n.cm-s-monokai span.cm-variable-2 { color: #9effff; }\n.cm-s-monokai span.cm-variable-3, .cm-s-monokai span.cm-type { color: #66d9ef; }\n.cm-s-monokai span.cm-def { color: #fd971f; }\n.cm-s-monokai span.cm-bracket { color: #f8f8f2; }\n.cm-s-monokai span.cm-tag { color: #f92672; }\n.cm-s-monokai span.cm-header { color: #ae81ff; }\n.cm-s-monokai span.cm-link { color: #ae81ff; }\n.cm-s-monokai span.cm-error { background: #f92672; color: #f8f8f0; }\n\n.cm-s-monokai .CodeMirror-activeline-background { background: #373831; }\n.cm-s-monokai .CodeMirror-matchingbracket {\n text-decoration: underline;\n color: white !important;\n}\n");let xe=class extends ne{constructor(){super(...arguments),this.readOnly=!1,this.mode="yaml"}static get styles(){return[ye,be]}updated(){if(!this.editor){const e=this.querySelector("textarea");if(!e)return;this.editor=ve.fromTextArea(e,{mode:this.mode,theme:"monokai",lineNumbers:!1,readOnly:this.readOnly,autoRefresh:!0})}}render(){return W``}};e([Z()],xe.prototype,"readOnly",void 0),e([Z()],xe.prototype,"mode",void 0),e([Z()],xe.prototype,"name",void 0),xe=e([$("pb-codemirror")],xe);let we=class extends ne{constructor(){super();const e=this.querySelector(".pf-c-dropdown__menu");this.querySelectorAll("button").forEach((t=>{t.addEventListener("click",(t=>{e.hidden=!e.hidden}))}))}render(){return W``}};we=e([$("pb-dropdown")],we);let _e=class extends ne{constructor(){super(...arguments),this.url="",this.key="",this.value=""}comparison(e){let t={"<":function(e,t){return e":function(e,t){return e>t},">=":function(e,t){return e>=t},"<=":function(e,t){return e<=t},"==":function(e,t){return e==t},"!=":function(e,t){return e!=t},"===":function(e,t){return e===t},"!==":function(e,t){return e!==t}};const n=e.split(" ");if(n.length<3)throw new Error("nah");let r=n[0];r="value"===r?this.value:parseInt(r,10);let i=n[2];i="value"===i?this.value:parseInt(i,10);const o=n[1];if(!(o in t))throw new Error("Invalid comparison");return t[o](r,i)}firstUpdated(){fetch(this.url).then((e=>e.json())).then((e=>e[this.key])).then((e=>this.value=e))}render(){if(void 0===this.value)return W``;let e="";return this.querySelectorAll("[slot]").forEach((t=>{const n=t.getAttribute("slot");this.comparison(n)&&(e=n)})),this.querySelectorAll("[data-value]").forEach((e=>{e.textContent=this.value})),W``}};var ke;e([Z()],_e.prototype,"url",void 0),e([Z()],_e.prototype,"key",void 0),e([Z()],_e.prototype,"value",void 0),_e=e([$("fetch-fill-slot")],_e),function(e){e[e.redirect=0]="redirect",e[e.template=1]="template"}(ke||(ke={}));let Se=class extends ne{constructor(){super(...arguments),this.flowBodyUrl=""}createRenderRoot(){return this}firstUpdated(){fetch(this.flowBodyUrl).then((e=>{if(!e.ok)throw Error(e.statusText);return e})).then((e=>e.json())).then((e=>{this.updateCard(e)})).catch((e=>{this.errorMessage(e)}))}async updateCard(e){switch(e.type){case ke.redirect:window.location.assign(e.to);break;case ke.template:this.flowBody=e.body,await this.requestUpdate(),this.checkAutofocus(),ie(),this.loadFormCode(),this.setFormSubmitHandlers()}}loadFormCode(){this.querySelectorAll("script").forEach((e=>{let t=document.createElement("script");t.src=e.src,document.head.appendChild(t)}))}checkAutofocus(){const e=this.querySelector("[autofocus]");null!==e&&e.focus()}updateFormAction(e){for(let t=0;t{console.log("passbook/flows: Checking for autosubmit attribute "+e),this.checkAutosubmit(e),console.log("passbook/flows: Setting action for form "+e),this.updateFormAction(e),console.log("passbook/flows: Adding handler for form "+e),e.addEventListener("submit",(t=>{t.preventDefault();let n=new FormData(e);this.flowBody=void 0,fetch(this.flowBodyUrl,{method:"post",body:n}).then((e=>e.json())).then((e=>{this.updateCard(e)})).catch((e=>{this.errorMessage(e)}))})),e.classList.add("pb-flow-wrapped")}))}errorMessage(e){this.flowBody=`\n \n \n `}loading(){return W``}render(){return void 0!==this.flowBody?W`${this.flowBody}`:this.loading()}};e([Z()],Se.prototype,"flowBodyUrl",void 0),e([Z()],Se.prototype,"flowBody",void 0),Se=e([$("flow-shell-card")],Se);const Me=new CSSStyleSheet;Me.replaceSync(".pf-c-modal-box {\n --pf-c-modal-box--BackgroundColor: var(--pf-global--BackgroundColor--100);\n --pf-c-modal-box--BoxShadow: var(--pf-global--BoxShadow--xl);\n --pf-c-modal-box--ZIndex: var(--pf-global--ZIndex--xl);\n --pf-c-modal-box--Width: 100%;\n --pf-c-modal-box--MaxWidth: calc(100% - var(--pf-global--spacer--xl));\n --pf-c-modal-box--m-sm--sm--MaxWidth: 35rem;\n --pf-c-modal-box--m-md--Width: 52.5rem;\n --pf-c-modal-box--m-lg--lg--MaxWidth: 70rem;\n --pf-c-modal-box--MaxHeight: calc(100% - var(--pf-global--spacer--2xl));\n --pf-c-modal-box--m-align-top--spacer: var(--pf-global--spacer--sm);\n --pf-c-modal-box--m-align-top--xl--spacer: var(--pf-global--spacer--xl);\n --pf-c-modal-box--m-align-top--MarginTop: var(--pf-c-modal-box--m-align-top--spacer);\n --pf-c-modal-box--m-align-top--MaxHeight: calc(100% - min(var(--pf-c-modal-box--m-align-top--spacer), var(--pf-global--spacer--2xl)) - var(--pf-c-modal-box--m-align-top--spacer));\n --pf-c-modal-box--m-align-top--MaxWidth: calc(100% - min(var(--pf-c-modal-box--m-align-top--spacer) * 2, var(--pf-global--spacer--xl)));\n --pf-c-modal-box--m-danger__title-icon--Color: var(--pf-global--danger-color--100);\n --pf-c-modal-box--m-warning__title-icon--Color: var(--pf-global--warning-color--100);\n --pf-c-modal-box--m-success__title-icon--Color: var(--pf-global--success-color--100);\n --pf-c-modal-box--m-info__title-icon--Color: var(--pf-global--info-color--100);\n --pf-c-modal-box--m-default__title-icon--Color: var(--pf-global--default-color--200);\n --pf-c-modal-box__header--PaddingTop: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--PaddingRight: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--PaddingLeft: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--last-child--PaddingBottom: var(--pf-global--spacer--lg);\n --pf-c-modal-box__title--LineHeight: var(--pf-global--LineHeight--sm);\n --pf-c-modal-box__title--FontFamily: var(--pf-global--FontFamily--heading--sans-serif);\n --pf-c-modal-box__title--FontSize: var(--pf-global--FontSize--2xl);\n --pf-c-modal-box__title-icon--MarginRight: var(--pf-global--spacer--sm);\n --pf-c-modal-box__title-icon--Color: var(--pf-global--Color--100);\n --pf-c-modal-box__description--PaddingTop: var(--pf-global--spacer--xs);\n --pf-c-modal-box__body--MinHeight: calc(var(--pf-global--FontSize--md) * var(--pf-global--LineHeight--md));\n --pf-c-modal-box__body--PaddingTop: var(--pf-global--spacer--lg);\n --pf-c-modal-box__body--PaddingRight: var(--pf-global--spacer--lg);\n --pf-c-modal-box__body--PaddingLeft: var(--pf-global--spacer--lg);\n --pf-c-modal-box__body--last-child--PaddingBottom: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--body--PaddingTop: var(--pf-global--spacer--md);\n --pf-c-modal-box--c-button--Top: calc(var(--pf-global--spacer--lg));\n --pf-c-modal-box--c-button--Right: var(--pf-global--spacer--md);\n --pf-c-modal-box--c-button--sibling--MarginRight: calc(var(--pf-global--spacer--xl) + var(--pf-global--spacer--sm));\n --pf-c-modal-box__footer--PaddingTop: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--PaddingRight: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--PaddingBottom: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--PaddingLeft: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--c-button--MarginRight: var(--pf-global--spacer--md);\n --pf-c-modal-box__footer--c-button--sm--MarginRight: calc(var(--pf-c-modal-box__footer--c-button--MarginRight) / 2);\n position: relative;\n z-index: var(--pf-c-modal-box--ZIndex);\n display: flex;\n flex-direction: column;\n width: var(--pf-c-modal-box--Width);\n max-width: var(--pf-c-modal-box--MaxWidth);\n max-height: var(--pf-c-modal-box--MaxHeight);\n background-color: var(--pf-c-modal-box--BackgroundColor);\n box-shadow: var(--pf-c-modal-box--BoxShadow); }\n @media (min-width: 1200px) {\n .pf-c-modal-box {\n --pf-c-modal-box--m-align-top--spacer: var(--pf-c-modal-box--m-align-top--xl--spacer); } }\n .pf-c-modal-box.pf-m-sm {\n --pf-c-modal-box--Width: var(--pf-c-modal-box--m-sm--sm--MaxWidth); }\n .pf-c-modal-box.pf-m-md {\n --pf-c-modal-box--Width: var(--pf-c-modal-box--m-md--Width); }\n .pf-c-modal-box.pf-m-lg {\n --pf-c-modal-box--Width: var(--pf-c-modal-box--m-lg--lg--MaxWidth); }\n .pf-c-modal-box.pf-m-align-top {\n top: var(--pf-c-modal-box--m-align-top--MarginTop);\n align-self: flex-start;\n max-width: var(--pf-c-modal-box--m-align-top--MaxWidth);\n max-height: var(--pf-c-modal-box--m-align-top--MaxHeight); }\n .pf-c-modal-box.pf-m-danger {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-danger__title-icon--Color); }\n .pf-c-modal-box.pf-m-warning {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-warning__title-icon--Color); }\n .pf-c-modal-box.pf-m-success {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-success__title-icon--Color); }\n .pf-c-modal-box.pf-m-default {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-default__title-icon--Color); }\n .pf-c-modal-box.pf-m-info {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-info__title-icon--Color); }\n .pf-c-modal-box > .pf-c-button {\n position: absolute;\n top: var(--pf-c-modal-box--c-button--Top);\n right: var(--pf-c-modal-box--c-button--Right); }\n .pf-c-modal-box > .pf-c-button + * {\n margin-right: var(--pf-c-modal-box--c-button--sibling--MarginRight); }\n\n.pf-c-modal-box__header {\n display: flex;\n flex-direction: column;\n padding-top: var(--pf-c-modal-box__header--PaddingTop);\n padding-right: var(--pf-c-modal-box__header--PaddingRight);\n padding-left: var(--pf-c-modal-box__header--PaddingLeft); }\n .pf-c-modal-box__header.pf-m-help {\n display: flex;\n flex-direction: row; }\n .pf-c-modal-box__header:last-child {\n padding-bottom: var(--pf-c-modal-box__header--last-child--PaddingBottom); }\n .pf-c-modal-box__header + .pf-c-modal-box__body {\n --pf-c-modal-box__body--PaddingTop: var(--pf-c-modal-box__header--body--PaddingTop); }\n\n.pf-c-modal-box__header-main {\n flex-grow: 1;\n min-width: 0; }\n\n.pf-c-modal-box__title,\n.pf-c-modal-box__title-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap; }\n\n.pf-c-modal-box__title {\n flex: 0 0 auto;\n font-family: var(--pf-c-modal-box__title--FontFamily);\n font-size: var(--pf-c-modal-box__title--FontSize);\n line-height: var(--pf-c-modal-box__title--LineHeight); }\n .pf-c-modal-box__title.pf-m-icon {\n display: flex; }\n\n.pf-c-modal-box__title-icon {\n margin-right: var(--pf-c-modal-box__title-icon--MarginRight);\n color: var(--pf-c-modal-box__title-icon--Color); }\n\n.pf-c-modal-box__description {\n padding-top: var(--pf-c-modal-box__description--PaddingTop); }\n\n.pf-c-modal-box__body {\n flex: 1 1 auto;\n min-height: var(--pf-c-modal-box__body--MinHeight);\n padding-top: var(--pf-c-modal-box__body--PaddingTop);\n padding-right: var(--pf-c-modal-box__body--PaddingRight);\n padding-left: var(--pf-c-modal-box__body--PaddingLeft);\n overflow-x: hidden;\n overflow-y: auto;\n overscroll-behavior: contain;\n word-break: break-word;\n -webkit-overflow-scrolling: touch; }\n .pf-c-modal-box__body:last-child {\n padding-bottom: var(--pf-c-modal-box__body--last-child--PaddingBottom); }\n\n.pf-c-modal-box__footer {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n padding-top: var(--pf-c-modal-box__footer--PaddingTop);\n padding-right: var(--pf-c-modal-box__footer--PaddingRight);\n padding-bottom: var(--pf-c-modal-box__footer--PaddingBottom);\n padding-left: var(--pf-c-modal-box__footer--PaddingLeft); }\n .pf-c-modal-box__footer > .pf-c-button:not(:last-child) {\n margin-right: var(--pf-c-modal-box__footer--c-button--MarginRight); }\n @media screen and (min-width: 576px) {\n .pf-c-modal-box__footer > .pf-c-button:not(:last-child) {\n --pf-c-modal-box__footer--c-button--MarginRight: var(--pf-c-modal-box__footer--c-button--sm--MarginRight); } }\n");const Ce=new CSSStyleSheet;Ce.replaceSync(".pf-c-backdrop {\n --pf-c-backdrop--ZIndex: var(--pf-global--ZIndex--lg);\n --pf-c-backdrop--BackgroundColor: var(--pf-global--BackgroundColor--dark-transparent-100);\n position: fixed;\n top: 0;\n left: 0;\n z-index: var(--pf-c-backdrop--ZIndex);\n width: 100%;\n height: 100%;\n background-color: var(--pf-c-backdrop--BackgroundColor); }\n\n.pf-c-backdrop__open {\n overflow: hidden; }\n");let Te=class extends ne{constructor(){super(),this.href="",this.open=!1,window.addEventListener("keyup",(e=>{"Escape"===e.code&&(this.open=!1)}))}static get styles(){return[Me,ce,Ce]}setContent(e){this.querySelector("[slot=modal]").innerHTML=e,this.querySelectorAll("[slot=modal] a").forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),this.open=!1}))})),this.querySelectorAll("[slot=modal] form").forEach((e=>{e.addEventListener("submit",(t=>{t.preventDefault();let n=new FormData(e);fetch(e.action===window.location.toString()?this.href:e.action,{method:e.method,body:n}).then((e=>e.text())).then((e=>{-1!==e.indexOf("csrfmiddlewaretoken")?this.setContent(e):(this.open=!1,this.dispatchEvent(new CustomEvent("hashchange",{bubbles:!0})),ie())})).catch((e=>{console.error(e)}))}))}))}onClick(e){const t=new Request(this.href);fetch(t,{mode:"same-origin"}).then((e=>e.text())).then((e=>{this.setContent(e),this.open=!0})).catch((e=>{console.error(e)}))}renderModal(){return W`
        `}render(){return W`${this.open?this.renderModal():""}`}};e([Z()],Te.prototype,"href",void 0),e([Z()],Te.prototype,"open",void 0),Te=e([$("pb-modal-button")],Te);let De=class extends ne{constructor(){super(...arguments),this._currentPage="",this._firstPage=""}get currentPage(){return this._currentPage}set currentPage(e){var t,n;try{null===(t=this.querySelector(`.pf-c-tab-content[tab-name='${e}']`))||void 0===t||t.removeAttribute("hidden"),null===(n=this.querySelector(`.pf-c-tabs__item[tab-name='${e}']`))||void 0===n||n.classList.add("pf-m-current"),this.querySelectorAll(`.pf-c-tab-content:not([tab-name='${e}'])`).forEach((e=>{e.setAttribute("hidden","")})),this.querySelectorAll(`.pf-c-tabs__item:not([tab-name='${e}'])`).forEach((e=>{e.classList.remove("pf-m-current")})),window.location.hash="#"+e,this._currentPage=e}catch(e){this.currentPage=this._firstPage}}createRenderRoot(){return this}firstUpdated(){var e;this._firstPage=null===(e=this.querySelector(".pf-c-tab-content"))||void 0===e?void 0:e.getAttribute("tab-name"),window.location.hash?this.currentPage=window.location.hash:this.currentPage=this._firstPage,this.querySelectorAll(".pf-c-tabs__item > button").forEach((e=>{e.addEventListener("click",(t=>{var n;let r=null===(n=e.parentElement)||void 0===n?void 0:n.getAttribute("tab-name");this.currentPage=r}))}))}};De=e([$("pb-tabs")],De); //# sourceMappingURL=main.js.map diff --git a/passbook/static/static/passbook/main.js.map b/passbook/static/static/passbook/main.js.map index 8baeeacc1..8ce32a2b3 100644 --- a/passbook/static/static/passbook/main.js.map +++ b/passbook/static/static/passbook/main.js.map @@ -1 +1 @@ -{"version":3,"file":"main.js","sources":["../src/legacy.js","../node_modules/tslib/tslib.es6.js","../node_modules/lit-html/src/lib/dom.ts","../node_modules/lit-html/src/lib/template.ts","../node_modules/lit-html/src/lib/modify-template.ts","../node_modules/lit-html/src/lib/directive.ts","../node_modules/lit-html/src/lib/part.ts","../node_modules/lit-html/src/lib/template-instance.ts","../node_modules/lit-html/src/lib/template-result.ts","../node_modules/lit-html/src/lib/parts.ts","../node_modules/lit-html/src/lib/template-factory.ts","../node_modules/lit-html/src/lib/render.ts","../node_modules/lit-html/src/lib/default-template-processor.ts","../node_modules/lit-html/src/lit-html.ts","../node_modules/lit-html/src/lib/shady-render.ts","../node_modules/lit-element/src/lib/updating-element.ts","../node_modules/lit-element/src/lib/decorators.ts","../node_modules/lit-element/src/lib/css-tag.ts","../node_modules/lit-element/src/lit-element.ts","../node_modules/moment/moment.js","../node_modules/chart.js/dist/Chart.js","../src/AdminLoginsChart.ts","../src/AdminSidebar.ts","../src/Messages.ts","../src/ActionButton.ts","../src/utils.ts","../src/Dropdown.ts","../src/FetchFillSlot.ts","../src/FlowShellCard.ts","../src/Tabs.ts","../src/ModalButton.ts","../src/AdminSiteShell.ts"],"sourcesContent":["// Search clearing\ndocument.querySelectorAll(\"input[type=search]\").forEach((si) => {\n si.addEventListener(\"search\", (e) => {\n if (si.value === \"\") {\n si.parentElement.submit();\n }\n });\n});\n\n// Fetch from data-attributes\ndocument.querySelectorAll(\"[data-pb-fetch-fill]\").forEach((el) => {\n const url = el.dataset.pbFetchFill;\n const key = el.dataset.pbFetchKey;\n fetch(url).then(r => r.json()).then(r => {\n el.textContent = r[key];\n el.value = r[key];\n });\n});\n\n// Modal\ndocument.querySelectorAll(\"[data-target='modal']\").forEach((m) => {\n m.addEventListener(\"click\", (e) => {\n const parentContainer = e.target.closest('[data-target=\"modal\"]');\n const modalId = parentContainer.attributes['data-modal'].value;\n document.querySelector(`#${modalId}`).removeAttribute(\"hidden\");\n });\n});\ndocument.querySelectorAll(\".pf-c-modal-box [data-modal-close]\").forEach((b) => {\n b.addEventListener(\"click\", (e) => {\n const parentContainer = e.target.closest('.pf-c-backdrop');\n parentContainer.setAttribute(\"hidden\", true);\n });\n});\n\n// Make Checkbox label click trigger checkbox toggle\ndocument.querySelectorAll(\".pf-c-check__label\").forEach((checkLabel) => {\n checkLabel.addEventListener(\"click\", (e) => {\n const checkbox = e.target.parentElement.querySelector(\"input[type=checkbox]\");\n checkbox.checked = !checkbox.checked;\n });\n});\n\n// CodeMirror\ndocument.querySelectorAll(\".codemirror\").forEach((cm) => {\n let cmMode = 'xml';\n if ('data-cm-mode' in cm.attributes) {\n cmMode = cm.attributes['data-cm-mode'].value;\n }\n // https://github.com/codemirror/CodeMirror/issues/5092\n cm.removeAttribute(\"required\");\n CodeMirror.fromTextArea(cm, {\n mode: cmMode,\n theme: 'monokai',\n lineNumbers: false,\n readOnly: cm.readOnly,\n autoRefresh: true,\n });\n});\n\n// Automatic slug fields\nconst convertToSlug = (text) => {\n return text\n .toLowerCase()\n .replace(/ /g, '-')\n .replace(/[^\\w-]+/g, '');\n};\n\ndocument.querySelectorAll(\"input[name=name]\").forEach((input) => {\n input.addEventListener(\"input\", (e) => {\n const form = e.target.closest(\"form\");\n if (form === null) {\n return;\n }\n const slugField = form.querySelector(\"input[name=slug]\");\n slugField.value = convertToSlug(e.target.value);\n });\n});\n\n// Hamburger Menu\ndocument.querySelectorAll(\".pf-c-page__header-brand-toggle>button\").forEach((toggle) => {\n toggle.addEventListener(\"click\", (e) => {\n const sidebar = document.querySelector(\".pf-c-page__sidebar\");\n if (sidebar.classList.contains(\"pf-m-expanded\")) {\n // Sidebar already expanded\n sidebar.classList.remove(\"pf-m-expanded\");\n sidebar.style.zIndex = 0;\n } else {\n // Sidebar not expanded yet\n sidebar.classList.add(\"pf-m-expanded\");\n sidebar.style.zIndex = 200;\n }\n });\n});\n\n// Collapsable Menus in Sidebar\ndocument.querySelectorAll(\".pf-m-expandable>.pf-c-nav__link\").forEach((menu) => {\n menu.addEventListener(\"click\", (e) => {\n e.preventDefault();\n menu.parentElement.classList.toggle(\"pf-m-expanded\");\n });\n});\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\ninterface MaybePolyfilledCe extends CustomElementRegistry {\n readonly polyfillWrapFlushCallback?: object;\n}\n\n/**\n * True if the custom elements polyfill is in use.\n */\nexport const isCEPolyfill = typeof window !== 'undefined' &&\n window.customElements != null &&\n (window.customElements as MaybePolyfilledCe).polyfillWrapFlushCallback !==\n undefined;\n\n/**\n * Reparents nodes, starting from `start` (inclusive) to `end` (exclusive),\n * into another container (could be the same container), before `before`. If\n * `before` is null, it appends the nodes to the container.\n */\nexport const reparentNodes =\n (container: Node,\n start: Node|null,\n end: Node|null = null,\n before: Node|null = null): void => {\n while (start !== end) {\n const n = start!.nextSibling;\n container.insertBefore(start!, before);\n start = n;\n }\n };\n\n/**\n * Removes nodes, starting from `start` (inclusive) to `end` (exclusive), from\n * `container`.\n */\nexport const removeNodes =\n (container: Node, start: Node|null, end: Node|null = null): void => {\n while (start !== end) {\n const n = start!.nextSibling;\n container.removeChild(start!);\n start = n;\n }\n };\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {TemplateResult} from './template-result.js';\n\n/**\n * An expression marker with embedded unique key to avoid collision with\n * possible text in templates.\n */\nexport const marker = `{{lit-${String(Math.random()).slice(2)}}}`;\n\n/**\n * An expression marker used text-positions, multi-binding attributes, and\n * attributes with markup-like text values.\n */\nexport const nodeMarker = ``;\n\nexport const markerRegex = new RegExp(`${marker}|${nodeMarker}`);\n\n/**\n * Suffix appended to all bound attribute names.\n */\nexport const boundAttributeSuffix = '$lit$';\n\n/**\n * An updatable Template that tracks the location of dynamic parts.\n */\nexport class Template {\n readonly parts: TemplatePart[] = [];\n readonly element: HTMLTemplateElement;\n\n constructor(result: TemplateResult, element: HTMLTemplateElement) {\n this.element = element;\n\n const nodesToRemove: Node[] = [];\n const stack: Node[] = [];\n // Edge needs all 4 parameters present; IE11 needs 3rd parameter to be null\n const walker = document.createTreeWalker(\n element.content,\n 133 /* NodeFilter.SHOW_{ELEMENT|COMMENT|TEXT} */,\n null,\n false);\n // Keeps track of the last index associated with a part. We try to delete\n // unnecessary nodes, but we never want to associate two different parts\n // to the same index. They must have a constant node between.\n let lastPartIndex = 0;\n let index = -1;\n let partIndex = 0;\n const {strings, values: {length}} = result;\n while (partIndex < length) {\n const node = walker.nextNode() as Element | Comment | Text | null;\n if (node === null) {\n // We've exhausted the content inside a nested template element.\n // Because we still have parts (the outer for-loop), we know:\n // - There is a template in the stack\n // - The walker will find a nextNode outside the template\n walker.currentNode = stack.pop()!;\n continue;\n }\n index++;\n\n if (node.nodeType === 1 /* Node.ELEMENT_NODE */) {\n if ((node as Element).hasAttributes()) {\n const attributes = (node as Element).attributes;\n const {length} = attributes;\n // Per\n // https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap,\n // attributes are not guaranteed to be returned in document order.\n // In particular, Edge/IE can return them out of order, so we cannot\n // assume a correspondence between part index and attribute index.\n let count = 0;\n for (let i = 0; i < length; i++) {\n if (endsWith(attributes[i].name, boundAttributeSuffix)) {\n count++;\n }\n }\n while (count-- > 0) {\n // Get the template literal section leading up to the first\n // expression in this attribute\n const stringForPart = strings[partIndex];\n // Find the attribute name\n const name = lastAttributeNameRegex.exec(stringForPart)![2];\n // Find the corresponding attribute\n // All bound attributes have had a suffix added in\n // TemplateResult#getHTML to opt out of special attribute\n // handling. To look up the attribute value we also need to add\n // the suffix.\n const attributeLookupName =\n name.toLowerCase() + boundAttributeSuffix;\n const attributeValue =\n (node as Element).getAttribute(attributeLookupName)!;\n (node as Element).removeAttribute(attributeLookupName);\n const statics = attributeValue.split(markerRegex);\n this.parts.push({type: 'attribute', index, name, strings: statics});\n partIndex += statics.length - 1;\n }\n }\n if ((node as Element).tagName === 'TEMPLATE') {\n stack.push(node);\n walker.currentNode = (node as HTMLTemplateElement).content;\n }\n } else if (node.nodeType === 3 /* Node.TEXT_NODE */) {\n const data = (node as Text).data;\n if (data.indexOf(marker) >= 0) {\n const parent = node.parentNode!;\n const strings = data.split(markerRegex);\n const lastIndex = strings.length - 1;\n // Generate a new text node for each literal section\n // These nodes are also used as the markers for node parts\n for (let i = 0; i < lastIndex; i++) {\n let insert: Node;\n let s = strings[i];\n if (s === '') {\n insert = createMarker();\n } else {\n const match = lastAttributeNameRegex.exec(s);\n if (match !== null && endsWith(match[2], boundAttributeSuffix)) {\n s = s.slice(0, match.index) + match[1] +\n match[2].slice(0, -boundAttributeSuffix.length) + match[3];\n }\n insert = document.createTextNode(s);\n }\n parent.insertBefore(insert, node);\n this.parts.push({type: 'node', index: ++index});\n }\n // If there's no text, we must insert a comment to mark our place.\n // Else, we can trust it will stick around after cloning.\n if (strings[lastIndex] === '') {\n parent.insertBefore(createMarker(), node);\n nodesToRemove.push(node);\n } else {\n (node as Text).data = strings[lastIndex];\n }\n // We have a part for each match found\n partIndex += lastIndex;\n }\n } else if (node.nodeType === 8 /* Node.COMMENT_NODE */) {\n if ((node as Comment).data === marker) {\n const parent = node.parentNode!;\n // Add a new marker node to be the startNode of the Part if any of\n // the following are true:\n // * We don't have a previousSibling\n // * The previousSibling is already the start of a previous part\n if (node.previousSibling === null || index === lastPartIndex) {\n index++;\n parent.insertBefore(createMarker(), node);\n }\n lastPartIndex = index;\n this.parts.push({type: 'node', index});\n // If we don't have a nextSibling, keep this node so we have an end.\n // Else, we can remove it to save future costs.\n if (node.nextSibling === null) {\n (node as Comment).data = '';\n } else {\n nodesToRemove.push(node);\n index--;\n }\n partIndex++;\n } else {\n let i = -1;\n while ((i = (node as Comment).data.indexOf(marker, i + 1)) !== -1) {\n // Comment node has a binding marker inside, make an inactive part\n // The binding won't work, but subsequent bindings will\n // TODO (justinfagnani): consider whether it's even worth it to\n // make bindings in comments work\n this.parts.push({type: 'node', index: -1});\n partIndex++;\n }\n }\n }\n }\n\n // Remove text binding nodes after the walk to not disturb the TreeWalker\n for (const n of nodesToRemove) {\n n.parentNode!.removeChild(n);\n }\n }\n}\n\nconst endsWith = (str: string, suffix: string): boolean => {\n const index = str.length - suffix.length;\n return index >= 0 && str.slice(index) === suffix;\n};\n\n/**\n * A placeholder for a dynamic expression in an HTML template.\n *\n * There are two built-in part types: AttributePart and NodePart. NodeParts\n * always represent a single dynamic expression, while AttributeParts may\n * represent as many expressions are contained in the attribute.\n *\n * A Template's parts are mutable, so parts can be replaced or modified\n * (possibly to implement different template semantics). The contract is that\n * parts can only be replaced, not removed, added or reordered, and parts must\n * always consume the correct number of values in their `update()` method.\n *\n * TODO(justinfagnani): That requirement is a little fragile. A\n * TemplateInstance could instead be more careful about which values it gives\n * to Part.update().\n */\nexport type TemplatePart = {\n readonly type: 'node'; index: number;\n}|{\n readonly type: 'attribute';\n index: number;\n readonly name: string;\n readonly strings: ReadonlyArray;\n};\n\nexport const isTemplatePartActive = (part: TemplatePart) => part.index !== -1;\n\n// Allows `document.createComment('')` to be renamed for a\n// small manual size-savings.\nexport const createMarker = () => document.createComment('');\n\n/**\n * This regex extracts the attribute name preceding an attribute-position\n * expression. It does this by matching the syntax allowed for attributes\n * against the string literal directly preceding the expression, assuming that\n * the expression is in an attribute-value position.\n *\n * See attributes in the HTML spec:\n * https://www.w3.org/TR/html5/syntax.html#elements-attributes\n *\n * \" \\x09\\x0a\\x0c\\x0d\" are HTML space characters:\n * https://www.w3.org/TR/html5/infrastructure.html#space-characters\n *\n * \"\\0-\\x1F\\x7F-\\x9F\" are Unicode control characters, which includes every\n * space character except \" \".\n *\n * So an attribute is:\n * * The name: any character except a control character, space character, ('),\n * (\"), \">\", \"=\", or \"/\"\n * * Followed by zero or more space characters\n * * Followed by \"=\"\n * * Followed by zero or more space characters\n * * Followed by:\n * * Any character except space, ('), (\"), \"<\", \">\", \"=\", (`), or\n * * (\") then any non-(\"), or\n * * (') then any non-(')\n */\nexport const lastAttributeNameRegex =\n // eslint-disable-next-line no-control-regex\n /([ \\x09\\x0a\\x0c\\x0d])([^\\0-\\x1F\\x7F-\\x9F \"'>=/]+)([ \\x09\\x0a\\x0c\\x0d]*=[ \\x09\\x0a\\x0c\\x0d]*(?:[^ \\x09\\x0a\\x0c\\x0d\"'`<>=]*|\"[^\"]*|'[^']*))$/;\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {isTemplatePartActive, Template, TemplatePart} from './template.js';\n\nconst walkerNodeFilter = 133 /* NodeFilter.SHOW_{ELEMENT|COMMENT|TEXT} */;\n\n/**\n * Removes the list of nodes from a Template safely. In addition to removing\n * nodes from the Template, the Template part indices are updated to match\n * the mutated Template DOM.\n *\n * As the template is walked the removal state is tracked and\n * part indices are adjusted as needed.\n *\n * div\n * div#1 (remove) <-- start removing (removing node is div#1)\n * div\n * div#2 (remove) <-- continue removing (removing node is still div#1)\n * div\n * div <-- stop removing since previous sibling is the removing node (div#1,\n * removed 4 nodes)\n */\nexport function removeNodesFromTemplate(\n template: Template, nodesToRemove: Set) {\n const {element: {content}, parts} = template;\n const walker =\n document.createTreeWalker(content, walkerNodeFilter, null, false);\n let partIndex = nextActiveIndexInTemplateParts(parts);\n let part = parts[partIndex];\n let nodeIndex = -1;\n let removeCount = 0;\n const nodesToRemoveInTemplate = [];\n let currentRemovingNode: Node|null = null;\n while (walker.nextNode()) {\n nodeIndex++;\n const node = walker.currentNode as Element;\n // End removal if stepped past the removing node\n if (node.previousSibling === currentRemovingNode) {\n currentRemovingNode = null;\n }\n // A node to remove was found in the template\n if (nodesToRemove.has(node)) {\n nodesToRemoveInTemplate.push(node);\n // Track node we're removing\n if (currentRemovingNode === null) {\n currentRemovingNode = node;\n }\n }\n // When removing, increment count by which to adjust subsequent part indices\n if (currentRemovingNode !== null) {\n removeCount++;\n }\n while (part !== undefined && part.index === nodeIndex) {\n // If part is in a removed node deactivate it by setting index to -1 or\n // adjust the index as needed.\n part.index = currentRemovingNode !== null ? -1 : part.index - removeCount;\n // go to the next active part.\n partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n part = parts[partIndex];\n }\n }\n nodesToRemoveInTemplate.forEach((n) => n.parentNode!.removeChild(n));\n}\n\nconst countNodes = (node: Node) => {\n let count = (node.nodeType === 11 /* Node.DOCUMENT_FRAGMENT_NODE */) ? 0 : 1;\n const walker = document.createTreeWalker(node, walkerNodeFilter, null, false);\n while (walker.nextNode()) {\n count++;\n }\n return count;\n};\n\nconst nextActiveIndexInTemplateParts =\n (parts: TemplatePart[], startIndex = -1) => {\n for (let i = startIndex + 1; i < parts.length; i++) {\n const part = parts[i];\n if (isTemplatePartActive(part)) {\n return i;\n }\n }\n return -1;\n };\n\n/**\n * Inserts the given node into the Template, optionally before the given\n * refNode. In addition to inserting the node into the Template, the Template\n * part indices are updated to match the mutated Template DOM.\n */\nexport function insertNodeIntoTemplate(\n template: Template, node: Node, refNode: Node|null = null) {\n const {element: {content}, parts} = template;\n // If there's no refNode, then put node at end of template.\n // No part indices need to be shifted in this case.\n if (refNode === null || refNode === undefined) {\n content.appendChild(node);\n return;\n }\n const walker =\n document.createTreeWalker(content, walkerNodeFilter, null, false);\n let partIndex = nextActiveIndexInTemplateParts(parts);\n let insertCount = 0;\n let walkerIndex = -1;\n while (walker.nextNode()) {\n walkerIndex++;\n const walkerNode = walker.currentNode as Element;\n if (walkerNode === refNode) {\n insertCount = countNodes(node);\n refNode.parentNode!.insertBefore(node, refNode);\n }\n while (partIndex !== -1 && parts[partIndex].index === walkerIndex) {\n // If we've inserted the node, simply adjust all subsequent parts\n if (insertCount > 0) {\n while (partIndex !== -1) {\n parts[partIndex].index += insertCount;\n partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n }\n return;\n }\n partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n }\n }\n}\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {Part} from './part.js';\n\nconst directives = new WeakMap();\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type DirectiveFactory = (...args: any[]) => object;\n\nexport type DirectiveFn = (part: Part) => void;\n\n/**\n * Brands a function as a directive factory function so that lit-html will call\n * the function during template rendering, rather than passing as a value.\n *\n * A _directive_ is a function that takes a Part as an argument. It has the\n * signature: `(part: Part) => void`.\n *\n * A directive _factory_ is a function that takes arguments for data and\n * configuration and returns a directive. Users of directive usually refer to\n * the directive factory as the directive. For example, \"The repeat directive\".\n *\n * Usually a template author will invoke a directive factory in their template\n * with relevant arguments, which will then return a directive function.\n *\n * Here's an example of using the `repeat()` directive factory that takes an\n * array and a function to render an item:\n *\n * ```js\n * html`
          <${repeat(items, (item) => html`
        • ${item}
        • `)}
        `\n * ```\n *\n * When `repeat` is invoked, it returns a directive function that closes over\n * `items` and the template function. When the outer template is rendered, the\n * return directive function is called with the Part for the expression.\n * `repeat` then performs it's custom logic to render multiple items.\n *\n * @param f The directive factory function. Must be a function that returns a\n * function of the signature `(part: Part) => void`. The returned function will\n * be called with the part object.\n *\n * @example\n *\n * import {directive, html} from 'lit-html';\n *\n * const immutable = directive((v) => (part) => {\n * if (part.value !== v) {\n * part.setValue(v)\n * }\n * });\n */\nexport const directive = (f: F): F =>\n ((...args: unknown[]) => {\n const d = f(...args);\n directives.set(d, true);\n return d;\n }) as F;\n\nexport const isDirective = (o: unknown): o is DirectiveFn => {\n return typeof o === 'function' && directives.has(o);\n};\n","/**\n * @license\n * Copyright (c) 2018 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * The Part interface represents a dynamic part of a template instance rendered\n * by lit-html.\n */\nexport interface Part {\n readonly value: unknown;\n\n /**\n * Sets the current part value, but does not write it to the DOM.\n * @param value The value that will be committed.\n */\n setValue(value: unknown): void;\n\n /**\n * Commits the current part value, causing it to actually be written to the\n * DOM.\n *\n * Directives are run at the start of `commit`, so that if they call\n * `part.setValue(...)` synchronously that value will be used in the current\n * commit, and there's no need to call `part.commit()` within the directive.\n * If directives set a part value asynchronously, then they must call\n * `part.commit()` manually.\n */\n commit(): void;\n}\n\n/**\n * A sentinel value that signals that a value was handled by a directive and\n * should not be written to the DOM.\n */\nexport const noChange = {};\n\n/**\n * A sentinel value that signals a NodePart to fully clear its content.\n */\nexport const nothing = {};\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {isCEPolyfill} from './dom.js';\nimport {Part} from './part.js';\nimport {RenderOptions} from './render-options.js';\nimport {TemplateProcessor} from './template-processor.js';\nimport {isTemplatePartActive, Template, TemplatePart} from './template.js';\n\n/**\n * An instance of a `Template` that can be attached to the DOM and updated\n * with new values.\n */\nexport class TemplateInstance {\n private readonly __parts: Array = [];\n readonly processor: TemplateProcessor;\n readonly options: RenderOptions;\n readonly template: Template;\n\n constructor(\n template: Template, processor: TemplateProcessor,\n options: RenderOptions) {\n this.template = template;\n this.processor = processor;\n this.options = options;\n }\n\n update(values: readonly unknown[]) {\n let i = 0;\n for (const part of this.__parts) {\n if (part !== undefined) {\n part.setValue(values[i]);\n }\n i++;\n }\n for (const part of this.__parts) {\n if (part !== undefined) {\n part.commit();\n }\n }\n }\n\n _clone(): DocumentFragment {\n // There are a number of steps in the lifecycle of a template instance's\n // DOM fragment:\n // 1. Clone - create the instance fragment\n // 2. Adopt - adopt into the main document\n // 3. Process - find part markers and create parts\n // 4. Upgrade - upgrade custom elements\n // 5. Update - set node, attribute, property, etc., values\n // 6. Connect - connect to the document. Optional and outside of this\n // method.\n //\n // We have a few constraints on the ordering of these steps:\n // * We need to upgrade before updating, so that property values will pass\n // through any property setters.\n // * We would like to process before upgrading so that we're sure that the\n // cloned fragment is inert and not disturbed by self-modifying DOM.\n // * We want custom elements to upgrade even in disconnected fragments.\n //\n // Given these constraints, with full custom elements support we would\n // prefer the order: Clone, Process, Adopt, Upgrade, Update, Connect\n //\n // But Safari does not implement CustomElementRegistry#upgrade, so we\n // can not implement that order and still have upgrade-before-update and\n // upgrade disconnected fragments. So we instead sacrifice the\n // process-before-upgrade constraint, since in Custom Elements v1 elements\n // must not modify their light DOM in the constructor. We still have issues\n // when co-existing with CEv0 elements like Polymer 1, and with polyfills\n // that don't strictly adhere to the no-modification rule because shadow\n // DOM, which may be created in the constructor, is emulated by being placed\n // in the light DOM.\n //\n // The resulting order is on native is: Clone, Adopt, Upgrade, Process,\n // Update, Connect. document.importNode() performs Clone, Adopt, and Upgrade\n // in one step.\n //\n // The Custom Elements v1 polyfill supports upgrade(), so the order when\n // polyfilled is the more ideal: Clone, Process, Adopt, Upgrade, Update,\n // Connect.\n\n const fragment = isCEPolyfill ?\n this.template.element.content.cloneNode(true) as DocumentFragment :\n document.importNode(this.template.element.content, true);\n\n const stack: Node[] = [];\n const parts = this.template.parts;\n // Edge needs all 4 parameters present; IE11 needs 3rd parameter to be null\n const walker = document.createTreeWalker(\n fragment,\n 133 /* NodeFilter.SHOW_{ELEMENT|COMMENT|TEXT} */,\n null,\n false);\n let partIndex = 0;\n let nodeIndex = 0;\n let part: TemplatePart;\n let node = walker.nextNode();\n // Loop through all the nodes and parts of a template\n while (partIndex < parts.length) {\n part = parts[partIndex];\n if (!isTemplatePartActive(part)) {\n this.__parts.push(undefined);\n partIndex++;\n continue;\n }\n\n // Progress the tree walker until we find our next part's node.\n // Note that multiple parts may share the same node (attribute parts\n // on a single element), so this loop may not run at all.\n while (nodeIndex < part.index) {\n nodeIndex++;\n if (node!.nodeName === 'TEMPLATE') {\n stack.push(node!);\n walker.currentNode = (node as HTMLTemplateElement).content;\n }\n if ((node = walker.nextNode()) === null) {\n // We've exhausted the content inside a nested template element.\n // Because we still have parts (the outer for-loop), we know:\n // - There is a template in the stack\n // - The walker will find a nextNode outside the template\n walker.currentNode = stack.pop()!;\n node = walker.nextNode();\n }\n }\n\n // We've arrived at our part's node.\n if (part.type === 'node') {\n const part = this.processor.handleTextExpression(this.options);\n part.insertAfterNode(node!.previousSibling!);\n this.__parts.push(part);\n } else {\n this.__parts.push(...this.processor.handleAttributeExpressions(\n node as Element, part.name, part.strings, this.options));\n }\n partIndex++;\n }\n\n if (isCEPolyfill) {\n document.adoptNode(fragment);\n customElements.upgrade(fragment);\n }\n return fragment;\n }\n}\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * @module lit-html\n */\n\nimport {reparentNodes} from './dom.js';\nimport {TemplateProcessor} from './template-processor.js';\nimport {boundAttributeSuffix, lastAttributeNameRegex, marker, nodeMarker} from './template.js';\n\ndeclare const trustedTypes: typeof window.trustedTypes;\n/**\n * Our TrustedTypePolicy for HTML which is declared using the html template\n * tag function.\n *\n * That HTML is a developer-authored constant, and is parsed with innerHTML\n * before any untrusted expressions have been mixed in. Therefor it is\n * considered safe by construction.\n */\nconst policy = window.trustedTypes &&\n trustedTypes!.createPolicy('lit-html', {createHTML: (s) => s});\n\nconst commentMarker = ` ${marker} `;\n\n/**\n * The return type of `html`, which holds a Template and the values from\n * interpolated expressions.\n */\nexport class TemplateResult {\n readonly strings: TemplateStringsArray;\n readonly values: readonly unknown[];\n readonly type: string;\n readonly processor: TemplateProcessor;\n\n constructor(\n strings: TemplateStringsArray, values: readonly unknown[], type: string,\n processor: TemplateProcessor) {\n this.strings = strings;\n this.values = values;\n this.type = type;\n this.processor = processor;\n }\n\n /**\n * Returns a string of HTML used to create a `