/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
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.
***************************************************************************** */
var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};function e(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}var i=function(){return(i=Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};function r(t,e,i,r){var n,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(o<3?n(s):o>3?n(e,i,s):n(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s}function n(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function o(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var r,n,o=i.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){n={error:t}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return s}function s(t,e,i){return Object.entries(l(e||{})).reduce(((t,[e,i])=>t.replace(new RegExp(`{{[  ]*${e}[  ]*}}`,"gm"),String(l(i)))),t)}function a(t,e){const i=t.split(".");let r=e.strings;for(;null!=r&&i.length>0;)r=r[i.shift()];return null!=r?r.toString():null}function l(t){return"function"==typeof t?t():t}let d={loader:()=>Promise.resolve({}),empty:t=>`[${t}]`,lookup:a,interpolate:s,translationCache:{}};function c(t){return d=Object.assign(Object.assign({},d),t)}function h(t,e,i=d){var r;r={previousStrings:i.strings,previousLang:i.lang,lang:i.lang=t,strings:i.strings=e},window.dispatchEvent(new CustomEvent("langChanged",{detail:r}))}async function u(t,e=d){const i=await e.loader(t,e);e.translationCache={},h(t,i,e)}function p(t,e,i=d){let r=i.translationCache[t]||(i.translationCache[t]=i.lookup(t,i)||i.empty(t,i));return null!=(e=null!=e?l(e):null)?i.interpolate(r,e,i):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
 */const f=new WeakMap,m=t=>(...e)=>{const i=t(...e);return f.set(i,!0),i},g=t=>"function"==typeof t&&f.has(t),b="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,v=(t,e,i=null)=>{for(;e!==i;){const i=e.nextSibling;t.removeChild(e),e=i}},y={},_={},w=`{{lit-${String(Math.random()).slice(2)}}}`,x=`\x3c!--${w}--\x3e`,M=new RegExp(`${w}|${x}`);class k{constructor(t,e){this.parts=[],this.element=e;const i=[],r=[],n=document.createTreeWalker(e.content,133,null,!1);let o=0,s=-1,a=0;const{strings:l,values:{length:d}}=t;for(;a<d;){const t=n.nextNode();if(null!==t){if(s++,1===t.nodeType){if(t.hasAttributes()){const e=t.attributes,{length:i}=e;let r=0;for(let t=0;t<i;t++)S(e[t].name,"$lit$")&&r++;for(;r-- >0;){const e=l[a],i=T.exec(e)[2],r=i.toLowerCase()+"$lit$",n=t.getAttribute(r);t.removeAttribute(r);const o=n.split(M);this.parts.push({type:"attribute",index:s,name:i,strings:o}),a+=o.length-1}}"TEMPLATE"===t.tagName&&(r.push(t),n.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(w)>=0){const r=t.parentNode,n=e.split(M),o=n.length-1;for(let e=0;e<o;e++){let i,o=n[e];if(""===o)i=A();else{const t=T.exec(o);null!==t&&S(t[2],"$lit$")&&(o=o.slice(0,t.index)+t[1]+t[2].slice(0,-"$lit$".length)+t[3]),i=document.createTextNode(o)}r.insertBefore(i,t),this.parts.push({type:"node",index:++s})}""===n[o]?(r.insertBefore(A(),t),i.push(t)):t.data=n[o],a+=o}}else if(8===t.nodeType)if(t.data===w){const e=t.parentNode;null!==t.previousSibling&&s!==o||(s++,e.insertBefore(A(),t)),o=s,this.parts.push({type:"node",index:s}),null===t.nextSibling?t.data="":(i.push(t),s--),a++}else{let e=-1;for(;-1!==(e=t.data.indexOf(w,e+1));)this.parts.push({type:"node",index:-1}),a++}}else n.currentNode=r.pop()}for(const t of i)t.parentNode.removeChild(t)}}const S=(t,e)=>{const i=t.length-e.length;return i>=0&&t.slice(i)===e},E=t=>-1!==t.index,A=()=>document.createComment(""),T=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;
/**
 * @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
 */
class I{constructor(t,e,i){this.__parts=[],this.template=t,this.processor=e,this.options=i}update(t){let e=0;for(const i of this.__parts)void 0!==i&&i.setValue(t[e]),e++;for(const t of this.__parts)void 0!==t&&t.commit()}_clone(){const t=b?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),e=[],i=this.template.parts,r=document.createTreeWalker(t,133,null,!1);let n,o=0,s=0,a=r.nextNode();for(;o<i.length;)if(n=i[o],E(n)){for(;s<n.index;)s++,"TEMPLATE"===a.nodeName&&(e.push(a),r.currentNode=a.content),null===(a=r.nextNode())&&(r.currentNode=e.pop(),a=r.nextNode());if("node"===n.type){const t=this.processor.handleTextExpression(this.options);t.insertAfterNode(a.previousSibling),this.__parts.push(t)}else this.__parts.push(...this.processor.handleAttributeExpressions(a,n.name,n.strings,this.options));o++}else this.__parts.push(void 0),o++;return b&&(document.adoptNode(t),customElements.upgrade(t)),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 C=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),R=` ${w} `;class O{constructor(t,e,i,r){this.strings=t,this.values=e,this.type=i,this.processor=r}getHTML(){const t=this.strings.length-1;let e="",i=!1;for(let r=0;r<t;r++){const t=this.strings[r],n=t.lastIndexOf("\x3c!--");i=(n>-1||i)&&-1===t.indexOf("--\x3e",n+1);const o=T.exec(t);e+=null===o?t+(i?R:x):t.substr(0,o.index)+o[1]+o[2]+"$lit$"+o[3]+w}return e+=this.strings[t],e}getTemplateElement(){const t=document.createElement("template");let e=this.getHTML();return void 0!==C&&(e=C.createHTML(e)),t.innerHTML=e,t}}class L extends O{getHTML(){return`<svg>${super.getHTML()}</svg>`}getTemplateElement(){const t=super.getTemplateElement(),e=t.content,i=e.firstChild;return e.removeChild(i),((t,e,i=null,r=null)=>{for(;e!==i;){const i=e.nextSibling;t.insertBefore(e,r),e=i}})(e,i.firstChild),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 P=t=>null===t||!("object"==typeof t||"function"==typeof t),B=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class N{constructor(t,e,i){this.dirty=!0,this.element=t,this.name=e,this.strings=i,this.parts=[];for(let t=0;t<i.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new $(this)}_getValue(){const t=this.strings,e=t.length-1,i=this.parts;if(1===e&&""===t[0]&&""===t[1]){const t=i[0].value;if("symbol"==typeof t)return String(t);if("string"==typeof t||!B(t))return t}let r="";for(let n=0;n<e;n++){r+=t[n];const e=i[n];if(void 0!==e){const t=e.value;if(P(t)||!B(t))r+="string"==typeof t?t:String(t);else for(const e of t)r+="string"==typeof e?e:String(e)}}return r+=t[e],r}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class ${constructor(t){this.value=void 0,this.committer=t}setValue(t){t===y||P(t)&&t===this.value||(this.value=t,g(t)||(this.committer.dirty=!0))}commit(){for(;g(this.value);){const t=this.value;this.value=y,t(this)}this.value!==y&&this.committer.commit()}}class z{constructor(t){this.value=void 0,this.__pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(A()),this.endNode=t.appendChild(A())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t.__insert(this.startNode=A()),t.__insert(this.endNode=A())}insertAfterPart(t){t.__insert(this.startNode=A()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this.__pendingValue=t}commit(){if(null===this.startNode.parentNode)return;for(;g(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=y,t(this)}const t=this.__pendingValue;t!==y&&(P(t)?t!==this.value&&this.__commitText(t):t instanceof O?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):B(t)?this.__commitIterable(t):t===_?(this.value=_,this.clear()):this.__commitText(t))}__insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}__commitNode(t){this.value!==t&&(this.clear(),this.__insert(t),this.value=t)}__commitText(t){const e=this.startNode.nextSibling,i="string"==typeof(t=null==t?"":t)?t:String(t);e===this.endNode.previousSibling&&3===e.nodeType?e.data=i:this.__commitNode(document.createTextNode(i)),this.value=t}__commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof I&&this.value.template===e)this.value.update(t.values);else{const i=new I(e,t.processor,this.options),r=i._clone();i.update(t.values),this.__commitNode(r),this.value=i}}__commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let i,r=0;for(const n of t)i=e[r],void 0===i&&(i=new z(this.options),e.push(i),0===r?i.appendIntoPart(this):i.insertAfterPart(e[r-1])),i.setValue(n),i.commit(),r++;r<e.length&&(e.length=r,this.clear(i&&i.endNode))}clear(t=this.startNode){v(this.startNode.parentNode,t.nextSibling,this.endNode)}}class j{constructor(t,e,i){if(this.value=void 0,this.__pendingValue=void 0,2!==i.length||""!==i[0]||""!==i[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=i}setValue(t){this.__pendingValue=t}commit(){for(;g(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=y,t(this)}if(this.__pendingValue===y)return;const t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=y}}class F extends N{constructor(t,e,i){super(t,e,i),this.single=2===i.length&&""===i[0]&&""===i[1]}_createPart(){return new D(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class D extends ${}let q=!1;(()=>{try{const t={get capture(){return q=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();class U{constructor(t,e,i){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=i,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;g(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=y,t(this)}if(this.__pendingValue===y)return;const t=this.__pendingValue,e=this.value,i=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),r=null!=t&&(null==e||i);i&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),r&&(this.__options=H(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=y}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const H=t=>t&&(q?{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
 */;const V=new class{handleAttributeExpressions(t,e,i,r){const n=e[0];if("."===n){return new F(t,e.slice(1),i).parts}if("@"===n)return[new U(t,e.slice(1),r.eventContext)];if("?"===n)return[new j(t,e.slice(1),i)];return new N(t,e,i).parts}handleTextExpression(t){return new z(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
 */function W(t){let e=G.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},G.set(t.type,e));let i=e.stringsArray.get(t.strings);if(void 0!==i)return i;const r=t.strings.join(w);return i=e.keyString.get(r),void 0===i&&(i=new k(t,t.getTemplateElement()),e.keyString.set(r,i)),e.stringsArray.set(t.strings,i),i}const G=new Map,K=new WeakMap,X=(t,e,i)=>{let r=K.get(e);void 0===r&&(v(e,e.firstChild),K.set(e,r=new z(Object.assign({templateFactory:W},i))),r.appendInto(e)),r.setValue(t),r.commit()};
/**
 * @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
 */
/**
 * @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 Z=(t,...e)=>new O(t,e,"html",V),Y=(t,...e)=>new L(t,e,"svg",V);function J(t){return t instanceof z?t.startNode.isConnected:t instanceof $?t.committer.element.isConnected:t.element.isConnected}const Q=new Map;var tt;function et(t,e,i){const r=e(i);t.value!==r&&(t.setValue(r),t.commit())}!function(t,e){const i=e=>t(e.detail);window.addEventListener("langChanged",i,e)}((t=>{for(const[e,i]of Q)J(e)&&et(e,i,t)})),tt=Q,setInterval((()=>{return t=()=>function(t){for(const[e]of t)J(e)||t.delete(e)}(tt),void("requestIdleCallback"in window?window.requestIdleCallback(t):setTimeout(t));var t}),6e4);const it=m((t=>e=>{Q.set(e,t),et(e,t)})),rt=(t,e,i)=>it((()=>p(t,e,i)))
/**
 * @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 nt(t,e){const{element:{content:i},parts:r}=t,n=document.createTreeWalker(i,133,null,!1);let o=st(r),s=r[o],a=-1,l=0;const d=[];let c=null;for(;n.nextNode();){a++;const t=n.currentNode;for(t.previousSibling===c&&(c=null),e.has(t)&&(d.push(t),null===c&&(c=t)),null!==c&&l++;void 0!==s&&s.index===a;)s.index=null!==c?-1:s.index-l,o=st(r,o),s=r[o]}d.forEach((t=>t.parentNode.removeChild(t)))}const ot=t=>{let e=11===t.nodeType?0:1;const i=document.createTreeWalker(t,133,null,!1);for(;i.nextNode();)e++;return e},st=(t,e=-1)=>{for(let i=e+1;i<t.length;i++){const e=t[i];if(E(e))return i}return-1};
/**
 * @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 at=(t,e)=>`${t}--${e}`;let lt=!0;void 0===window.ShadyCSS?lt=!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."),lt=!1);const dt=t=>e=>{const i=at(e.type,t);let r=G.get(i);void 0===r&&(r={stringsArray:new WeakMap,keyString:new Map},G.set(i,r));let n=r.stringsArray.get(e.strings);if(void 0!==n)return n;const o=e.strings.join(w);if(n=r.keyString.get(o),void 0===n){const i=e.getTemplateElement();lt&&window.ShadyCSS.prepareTemplateDom(i,t),n=new k(e,i),r.keyString.set(o,n)}return r.stringsArray.set(e.strings,n),n},ct=["html","svg"],ht=new Set,ut=(t,e,i)=>{ht.add(t);const r=i?i.element:document.createElement("template"),n=e.querySelectorAll("style"),{length:o}=n;if(0===o)return void window.ShadyCSS.prepareTemplateStyles(r,t);const s=document.createElement("style");for(let t=0;t<o;t++){const e=n[t];e.parentNode.removeChild(e),s.textContent+=e.textContent}(t=>{ct.forEach((e=>{const i=G.get(at(e,t));void 0!==i&&i.keyString.forEach((t=>{const{element:{content:e}}=t,i=new Set;Array.from(e.querySelectorAll("style")).forEach((t=>{i.add(t)})),nt(t,i)}))}))})(t);const a=r.content;i?function(t,e,i=null){const{element:{content:r},parts:n}=t;if(null==i)return void r.appendChild(e);const o=document.createTreeWalker(r,133,null,!1);let s=st(n),a=0,l=-1;for(;o.nextNode();)for(l++,o.currentNode===i&&(a=ot(e),i.parentNode.insertBefore(e,i));-1!==s&&n[s].index===l;){if(a>0){for(;-1!==s;)n[s].index+=a,s=st(n,s);return}s=st(n,s)}}(i,s,a.firstChild):a.insertBefore(s,a.firstChild),window.ShadyCSS.prepareTemplateStyles(r,t);const l=a.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)e.insertBefore(l.cloneNode(!0),e.firstChild);else if(i){a.insertBefore(s,a.firstChild);const t=new Set;t.add(s),nt(i,t)}};window.JSCompiler_renameProperty=(t,e)=>t;const pt={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}},ft=(t,e)=>e!==t&&(e==e||t==t),mt={attribute:!0,type:String,converter:pt,reflect:!1,hasChanged:ft};class gt extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach(((e,i)=>{const r=this._attributeNameForProperty(i,e);void 0!==r&&(this._attributeToPropertyMap.set(r,i),t.push(r))})),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=mt){if(this._ensureClassProperties(),this._classProperties.set(t,e),e.noAccessor||this.prototype.hasOwnProperty(t))return;const i="symbol"==typeof t?Symbol():"__"+t,r=this.getPropertyDescriptor(t,i,e);void 0!==r&&Object.defineProperty(this.prototype,t,r)}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(r){const n=this[t];this[e]=r,this.requestUpdateInternal(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this._classProperties&&this._classProperties.get(t)||mt}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 i of e)this.createProperty(i,t[i])}}static _attributeNameForProperty(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}static _valueHasChanged(t,e,i=ft){return i(t,e)}static _propertyValueFromAttribute(t,e){const i=e.type,r=e.converter||pt,n="function"==typeof r?r:r.fromAttribute;return n?n(t,i):t}static _propertyValueToAttribute(t,e){if(void 0===e.reflect)return;const i=e.type,r=e.converter;return(r&&r.toAttribute||pt.toAttribute)(t,i)}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,i){e!==i&&this._attributeToProperty(t,i)}_propertyToAttribute(t,e,i=mt){const r=this.constructor,n=r._attributeNameForProperty(t,i);if(void 0!==n){const t=r._propertyValueToAttribute(e,i);if(void 0===t)return;this._updateState=8|this._updateState,null==t?this.removeAttribute(n):this.setAttribute(n,t),this._updateState=-9&this._updateState}}_attributeToProperty(t,e){if(8&this._updateState)return;const i=this.constructor,r=i._attributeToPropertyMap.get(t);if(void 0!==r){const t=i.getPropertyOptions(r);this._updateState=16|this._updateState,this[r]=i._propertyValueFromAttribute(e,t),this._updateState=-17&this._updateState}}requestUpdateInternal(t,e,i){let r=!0;if(void 0!==t){const n=this.constructor;i=i||n.getPropertyOptions(t),n._valueHasChanged(this[t],e,i.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==i.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,i))):r=!1}!this._hasRequestedUpdate&&r&&(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){}}gt.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 bt=t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:i,elements:r}=e;return{kind:i,elements:r,finisher(e){window.customElements.define(t,e)}}})(t,e),vt=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?Object.assign(Object.assign({},e),{finisher(i){i.createProperty(e.key,t)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function yt(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):vt(t,e)}function _t(t){return yt({attribute:!1,hasChanged:null==t?void 0:t.hasChanged})}function wt(t,e){return(i,r)=>{const n={get(){return this.renderRoot.querySelector(t)},enumerable:!0,configurable:!0};if(e){const e="symbol"==typeof r?Symbol():"__"+r;n.get=function(){return void 0===this[e]&&(this[e]=this.renderRoot.querySelector(t)),this[e]}}return void 0!==r?Mt(n,i,r):kt(n,i)}}function xt(t){return(e,i)=>{const r={async get(){return await this.updateComplete,this.renderRoot.querySelector(t)},enumerable:!0,configurable:!0};return void 0!==i?Mt(r,e,i):kt(r,e)}}const Mt=(t,e,i)=>{Object.defineProperty(e,i,t)},kt=(t,e)=>({kind:"method",placement:"prototype",key:e.key,descriptor:t});function St(t){return(e,i)=>void 0!==i?((t,e,i)=>{Object.assign(e[i],t)})(t,e,i):((t,e)=>Object.assign(Object.assign({},e),{finisher(i){Object.assign(i.prototype[e.key],t)}}))(t,e)}
/**
@license
Copyright (c) 2019 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 Et=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,At=Symbol();class Tt{constructor(t,e){if(e!==At)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){return void 0===this._styleSheet&&(Et?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const It=t=>new Tt(String(t),At),Ct=(t,...e)=>{const i=e.reduce(((e,i,r)=>e+(t=>{if(t instanceof Tt)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.`)})(i)+t[r+1]),t[0]);return new Tt(i,At)};
/**
 * @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
 */
(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");const Rt={};class Ot extends gt{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,i)=>t.reduceRight(((t,i)=>Array.isArray(i)?e(i,t):(t.add(i),t)),i),i=e(t,new Set),r=[];i.forEach((t=>r.unshift(t))),this._styles=r}else this._styles=void 0===t?[]:[t];this._styles=this._styles.map((t=>{if(t instanceof CSSStyleSheet&&!Et){const e=Array.prototype.slice.call(t.cssRules).reduce(((t,e)=>t+e.cssText),"");return It(e)}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?Et?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!==Rt&&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 Rt}}Ot.finalized=!0,Ot.render=(t,e,i)=>{if(!i||"object"!=typeof i||!i.scopeName)throw new Error("The `scopeName` option is required.");const r=i.scopeName,n=K.has(e),o=lt&&11===e.nodeType&&!!e.host,s=o&&!ht.has(r),a=s?document.createDocumentFragment():e;if(X(t,a,Object.assign({templateFactory:dt(r)},i)),s){const t=K.get(a);K.delete(a);const i=t.value instanceof I?t.value.template:void 0;ut(r,a,i),v(e,e.firstChild),e.appendChild(a),K.set(e,t)}!n&&o&&window.ShadyCSS.styleElement(e.host)};
/**
@license
Copyright (c) 2018 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 Lt=t=>e=>class extends e{connectedCallback(){super.connectedCallback&&super.connectedCallback(),this._storeUnsubscribe=t.subscribe((()=>this.stateChanged(t.getState()))),this.stateChanged(t.getState())}disconnectedCallback(){this._storeUnsubscribe(),super.disconnectedCallback&&super.disconnectedCallback()}stateChanged(t){}}
/**
@license
Copyright (c) 2018 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
*/;var Pt=function(t){var e,i=t.Symbol;return"function"==typeof i?i.observable?e=i.observable:(e=i("observable"),i.observable=e):e="@@observable",e}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")()),Bt=function(){return Math.random().toString(36).substring(7).split("").join(".")},Nt={INIT:"@@redux/INIT"+Bt(),REPLACE:"@@redux/REPLACE"+Bt(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Bt()}};function $t(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function zt(t,e){var i=e&&e.type;return"Given "+(i&&'action "'+String(i)+'"'||"an action")+', reducer "'+t+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function jt(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Ft(t,e){var i=Object.keys(t);return Object.getOwnPropertySymbols&&i.push.apply(i,Object.getOwnPropertySymbols(t)),e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i}function Dt(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Ft(i,!0).forEach((function(e){jt(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ft(i).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function qt(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function Ut(t){return function(e){var i=e.dispatch,r=e.getState;return function(e){return function(n){return"function"==typeof n?n(i,r,t):e(n)}}}}var Ht=Ut();Ht.withExtraArgument=Ut;
/**
@license
Copyright (c) 2018 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 Vt=(t,e={})=>i=>{if(!0!==["/summary","/job","/experiment","/data","/statistics","/usersettings","/agent","/resource","/user","/credential","/environment","/settings","/maintenance","/information","/github","/import"].includes(t)){let i=t.split(/[\/]+/);i.length>1&&""===i[0]&&(t=i[1],e.requestURL=i.slice(2).join("/"))}let r;e.queryString=window.location.search,"index.html"!==t&&""!==t||(t="/"),r=["/","build","/build","app","/app"].includes(t)?"summary":"/"===t[0]?t.slice(1):t,i(Wt(r,e)),i(Zt(!1))},Wt=(t,e={})=>i=>{switch(t){case"summary":import("./backend-ai-summary-view-ec8f4397.js").then((t=>{}));break;case"job":import("./backend-ai-session-view-580ad7d4.js");break;case"experiment":import("./backend-ai-experiment-view-e0a7a009.js");break;case"data":import("./backend-ai-data-view-cf553ea7.js");break;case"usersettings":import("./backend-ai-usersettings-view-3befdba9.js");break;case"agent":case"resource":import("./backend-ai-agent-view-93a54008.js");break;case"credential":case"user":import("./backend-ai-credential-view-a14f795b.js");break;case"environment":import("./backend-ai-environment-view-71dba0de.js");break;case"settings":import("./backend-ai-settings-view-136d63fe.js");break;case"maintenance":import("./backend-ai-maintenance-view-5f8c2432.js");break;case"information":import("./backend-ai-information-view-bc6fbff6.js");break;case"statistics":import("./backend-ai-statistics-view-343d45cc.js");break;case"logs":import("./backend-ai-error-log-view-98ca78ae.js");break;case"verify-email":import("./backend-ai-email-verification-view-110ee59c.js");break;case"change-password":import("./backend-ai-change-forgot-password-view-1f61c26a.js");break;case"github":case"gitlab":case"import":import("./backend-ai-import-view-2c61ac67.js");break;default:if(void 0!==globalThis.backendaiPage)for(let t of globalThis.backendaiPage)if("url"in t){import("./plugins/"+t.url);break}import("./backend-ai-error-view-820f916d.js").then((t=>{}))}i(Gt(t,e))},Gt=(t,e)=>({type:"UPDATE_PAGE",page:t,params:e});
/**
 @license
 Copyright (c) 2015-2020 Lablup Inc. All rights reserved.
 */let Kt;const Xt=t=>(e,i)=>{t!==i().app.offline&&e((t=>{t({type:"OPEN_SNACKBAR"}),window.clearTimeout(Kt),Kt=window.setTimeout((()=>t({type:"CLOSE_SNACKBAR"})),3e3)})),e({type:"UPDATE_OFFLINE",offline:t})},Zt=t=>({type:"UPDATE_DRAWER_STATE",opened:t}),Yt={page:"",params:{},offline:!1,drawerOpened:!1,offlineIndicatorOpened:!1},Jt=function t(e,i,r){var n;if("function"==typeof i&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"==typeof i&&void 0===r&&(r=i,i=void 0),void 0!==r){if("function"!=typeof r)throw new Error("Expected the enhancer to be a function.");return r(t)(e,i)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var o=e,s=i,a=[],l=a,d=!1;function c(){l===a&&(l=a.slice())}function h(){if(d)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return s}function u(t){if("function"!=typeof t)throw new Error("Expected the listener to be a function.");if(d)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribelistener for more details.");var e=!0;return c(),l.push(t),function(){if(e){if(d)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribelistener for more details.");e=!1,c();var i=l.indexOf(t);l.splice(i,1),a=null}}}function p(t){if(!$t(t))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===t.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(d)throw new Error("Reducers may not dispatch actions.");try{d=!0,s=o(s,t)}finally{d=!1}for(var e=a=l,i=0;i<e.length;i++){(0,e[i])()}return t}function f(t){if("function"!=typeof t)throw new Error("Expected the nextReducer to be a function.");o=t,p({type:Nt.REPLACE})}function m(){var t,e=u;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new TypeError("Expected the observer to be an object.");function i(){t.next&&t.next(h())}return i(),{unsubscribe:e(i)}}})[Pt]=function(){return this},t}return p({type:Nt.INIT}),(n={dispatch:p,subscribe:u,getState:h,replaceReducer:f})[Pt]=m,n}((t=>t),(window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||qt)((t=>e=>(i,r)=>{let n={};const o=e(i,r);return Object.assign({},o,{addReducers(e){const i=Object.assign({},n,e);this.replaceReducer(t(n=i))}})})((function(t){for(var e=Object.keys(t),i={},r=0;r<e.length;r++){var n=e[r];"function"==typeof t[n]&&(i[n]=t[n])}var o,s=Object.keys(i);try{!function(t){Object.keys(t).forEach((function(e){var i=t[e];if(void 0===i(void 0,{type:Nt.INIT}))throw new Error('Reducer "'+e+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===i(void 0,{type:Nt.PROBE_UNKNOWN_ACTION()}))throw new Error('Reducer "'+e+"\" returned undefined when probed with a random type. Don't try to handle "+Nt.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')}))}(i)}catch(t){o=t}return function(t,e){if(void 0===t&&(t={}),o)throw o;for(var r=!1,n={},a=0;a<s.length;a++){var l=s[a],d=i[l],c=t[l],h=d(c,e);if(void 0===h){var u=zt(l,e);throw new Error(u)}n[l]=h,r=r||h!==c}return(r=r||s.length!==Object.keys(t).length)?n:t}})),function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return function(){var i=t.apply(void 0,arguments),r=function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},n={getState:i.getState,dispatch:function(){return r.apply(void 0,arguments)}},o=e.map((function(t){return t(n)}));return Dt({},i,{dispatch:r=qt.apply(void 0,o)(i.dispatch)})}}}(Ht)));Jt.addReducers({app:(t=Yt,e)=>{switch(e.type){case"UPDATE_PAGE":return Object.assign(Object.assign({},t),{page:e.page,params:e.params});case"UPDATE_OFFLINE":return Object.assign(Object.assign({},t),{offline:e.offline});case"UPDATE_DRAWER_STATE":return Object.assign(Object.assign({},t),{drawerOpened:e.opened});case"OPEN_SNACKBAR":return Object.assign(Object.assign({},t),{offlineIndicatorOpened:!0});case"CLOSE_SNACKBAR":return Object.assign(Object.assign({},t),{offlineIndicatorOpened:!1});default:return t}}}),
/**
 * @license
 * Copyright 2016 Google Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
(()=>{var t,e,i;const r=Symbol(),n=Symbol(),o=Symbol(),s=Symbol(),a=Symbol(),l=Symbol(),d=Symbol(),c=Symbol(),h=Symbol(),u=Symbol(),p=Symbol(),f=Symbol(),m=Symbol();class g{constructor(){this[t]=[],this[e]=[],this[i]=new Set}destructor(){this[h](this[o]);const t=this;t[r]=null,t[o]=null,t[n]=null}get top(){const t=this[r];return t[t.length-1]||null}push(t){t&&t!==this.top&&(this.remove(t),this[l](t),this[r].push(t))}remove(t){const e=this[r].indexOf(t);return-1!==e&&(this[r].splice(e,1),e===this[r].length&&this[l](this.top),!0)}pop(){const t=this.top;return t&&this.remove(t),t}has(t){return-1!==this[r].indexOf(t)}[(t=r,e=o,i=n,l)](t){const e=this[n],i=this[o];if(!t)return this[h](i),e.clear(),void(this[o]=[]);const r=this[u](t);if(r[r.length-1].parentNode!==document.body)throw Error("Non-connected element cannot be a blocking element");this[o]=r;const s=this[p](t);if(!i.length)return void this[c](r,s,e);let a=i.length-1,l=r.length-1;for(;a>0&&l>0&&i[a]===r[l];)a--,l--;i[a]!==r[l]&&this[d](i[a],r[l]),a>0&&this[h](i.slice(0,a)),l>0&&this[c](r.slice(0,l),s,null)}[d](t,e){const i=t[s];this[f](t)&&!t.inert&&(t.inert=!0,i.add(t)),i.has(e)&&(e.inert=!1,i.delete(e)),e[a]=t[a],e[s]=i,t[a]=void 0,t[s]=void 0}[h](t){for(const e of t){e[a].disconnect(),e[a]=void 0;const t=e[s];for(const e of t)e.inert=!1;e[s]=void 0}}[c](t,e,i){for(const r of t){const t=r.parentNode,n=t.children,o=new Set;for(let t=0;t<n.length;t++){const s=n[t];s===r||!this[f](s)||e&&e.has(s)||(i&&s.inert?i.add(s):(s.inert=!0,o.add(s)))}r[s]=o;const l=new MutationObserver(this[m].bind(this));r[a]=l;let d=t;const c=d;c.__shady&&c.host&&(d=c.host),l.observe(d,{childList:!0})}}[m](t){const e=this[o],i=this[n];for(const r of t){const t=r.target.host||r.target,n=t===document.body?e.length:e.indexOf(t),o=e[n-1],a=o[s];for(let t=0;t<r.removedNodes.length;t++){const e=r.removedNodes[t];if(e===o)return console.info("Detected removal of the top Blocking Element."),void this.pop();a.has(e)&&(e.inert=!1,a.delete(e))}for(let t=0;t<r.addedNodes.length;t++){const e=r.addedNodes[t];this[f](e)&&(i&&e.inert?i.add(e):(e.inert=!0,a.add(e)))}}}[f](t){return!1===/^(style|template|script)$/.test(t.localName)}[u](t){const e=[];let i=t;for(;i&&i!==document.body;)if(i.nodeType===Node.ELEMENT_NODE&&e.push(i),i.assignedSlot){for(;i=i.assignedSlot;)e.push(i);i=e.pop()}else i=i.parentNode||i.host;return e}[p](t){const e=t.shadowRoot;if(!e)return null;const i=new Set;let r,n,o;const s=e.querySelectorAll("slot");if(s.length&&s[0].assignedNodes)for(r=0;r<s.length;r++)for(o=s[r].assignedNodes({flatten:!0}),n=0;n<o.length;n++)o[n].nodeType===Node.ELEMENT_NODE&&i.add(o[n]);return i}}document.$blockingElements=new g})(),function(){if("undefined"==typeof window)return;const t=Array.prototype.slice,e=Element.prototype.matches||Element.prototype.msMatchesSelector,i=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","details","summary","iframe","object","embed","[contenteditable]"].join(",");class r{constructor(t,e){this._inertManager=e,this._rootElement=t,this._managedNodes=new Set,this._rootElement.hasAttribute("aria-hidden")?this._savedAriaHidden=this._rootElement.getAttribute("aria-hidden"):this._savedAriaHidden=null,this._rootElement.setAttribute("aria-hidden","true"),this._makeSubtreeUnfocusable(this._rootElement),this._observer=new MutationObserver(this._onMutation.bind(this)),this._observer.observe(this._rootElement,{attributes:!0,childList:!0,subtree:!0})}destructor(){this._observer.disconnect(),this._rootElement&&(null!==this._savedAriaHidden?this._rootElement.setAttribute("aria-hidden",this._savedAriaHidden):this._rootElement.removeAttribute("aria-hidden")),this._managedNodes.forEach((function(t){this._unmanageNode(t.node)}),this),this._observer=null,this._rootElement=null,this._managedNodes=null,this._inertManager=null}get managedNodes(){return new Set(this._managedNodes)}get hasSavedAriaHidden(){return null!==this._savedAriaHidden}set savedAriaHidden(t){this._savedAriaHidden=t}get savedAriaHidden(){return this._savedAriaHidden}_makeSubtreeUnfocusable(t){o(t,(t=>this._visitNode(t)));let e=document.activeElement;if(!document.body.contains(t)){let i=t,r=void 0;for(;i;){if(i.nodeType===Node.DOCUMENT_FRAGMENT_NODE){r=i;break}i=i.parentNode}r&&(e=r.activeElement)}t.contains(e)&&(e.blur(),e===document.activeElement&&document.body.focus())}_visitNode(t){if(t.nodeType!==Node.ELEMENT_NODE)return;const r=t;r!==this._rootElement&&r.hasAttribute("inert")&&this._adoptInertRoot(r),(e.call(r,i)||r.hasAttribute("tabindex"))&&this._manageNode(r)}_manageNode(t){const e=this._inertManager.register(t,this);this._managedNodes.add(e)}_unmanageNode(t){const e=this._inertManager.deregister(t,this);e&&this._managedNodes.delete(e)}_unmanageSubtree(t){o(t,(t=>this._unmanageNode(t)))}_adoptInertRoot(t){let e=this._inertManager.getInertRoot(t);e||(this._inertManager.setInert(t,!0),e=this._inertManager.getInertRoot(t)),e.managedNodes.forEach((function(t){this._manageNode(t.node)}),this)}_onMutation(e,i){e.forEach((function(e){const i=e.target;if("childList"===e.type)t.call(e.addedNodes).forEach((function(t){this._makeSubtreeUnfocusable(t)}),this),t.call(e.removedNodes).forEach((function(t){this._unmanageSubtree(t)}),this);else if("attributes"===e.type)if("tabindex"===e.attributeName)this._manageNode(i);else if(i!==this._rootElement&&"inert"===e.attributeName&&i.hasAttribute("inert")){this._adoptInertRoot(i);const t=this._inertManager.getInertRoot(i);this._managedNodes.forEach((function(e){i.contains(e.node)&&t._manageNode(e.node)}))}}),this)}}class n{constructor(t,e){this._node=t,this._overrodeFocusMethod=!1,this._inertRoots=new Set([e]),this._savedTabIndex=null,this._destroyed=!1,this.ensureUntabbable()}destructor(){if(this._throwIfDestroyed(),this._node&&this._node.nodeType===Node.ELEMENT_NODE){const t=this._node;null!==this._savedTabIndex?t.setAttribute("tabindex",this._savedTabIndex):t.removeAttribute("tabindex"),this._overrodeFocusMethod&&delete t.focus}this._node=null,this._inertRoots=null,this._destroyed=!0}get destroyed(){return this._destroyed}_throwIfDestroyed(){if(this.destroyed)throw new Error("Trying to access destroyed InertNode")}get hasSavedTabIndex(){return null!==this._savedTabIndex}get node(){return this._throwIfDestroyed(),this._node}set savedTabIndex(t){this._throwIfDestroyed(),this._savedTabIndex=t}get savedTabIndex(){return this._throwIfDestroyed(),this._savedTabIndex}ensureUntabbable(){if(this.node.nodeType!==Node.ELEMENT_NODE)return;const t=this.node;if(e.call(t,i)){if(-1===t.tabIndex&&this.hasSavedTabIndex)return;t.hasAttribute("tabindex")&&(this._savedTabIndex=t.tabIndex),t.setAttribute("tabindex","-1"),t.nodeType===Node.ELEMENT_NODE&&(t.focus=function(){},this._overrodeFocusMethod=!0)}else t.hasAttribute("tabindex")&&(this._savedTabIndex=t.tabIndex,t.removeAttribute("tabindex"))}addInertRoot(t){this._throwIfDestroyed(),this._inertRoots.add(t)}removeInertRoot(t){this._throwIfDestroyed(),this._inertRoots.delete(t),0===this._inertRoots.size&&this.destructor()}}function o(t,e,i){if(t.nodeType==Node.ELEMENT_NODE){const i=t;e&&e(i);const r=i.shadowRoot;if(r)return void o(r,e);if("content"==i.localName){const t=i,r=t.getDistributedNodes?t.getDistributedNodes():[];for(let t=0;t<r.length;t++)o(r[t],e);return}if("slot"==i.localName){const t=i,r=t.assignedNodes?t.assignedNodes({flatten:!0}):[];for(let t=0;t<r.length;t++)o(r[t],e);return}}let r=t.firstChild;for(;null!=r;)o(r,e),r=r.nextSibling}function s(t){if(t.querySelector("style#inert-style, link#inert-style"))return;const e=document.createElement("style");e.setAttribute("id","inert-style"),e.textContent="\n[inert] {\n  pointer-events: none;\n  cursor: default;\n}\n\n[inert], [inert] * {\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n}\n",t.appendChild(e)}const a=new class{constructor(t){if(!t)throw new Error("Missing required argument; InertManager needs to wrap a document.");this._document=t,this._managedNodes=new Map,this._inertRoots=new Map,this._observer=new MutationObserver(this._watchForInert.bind(this)),s(t.head||t.body||t.documentElement),"loading"===t.readyState?t.addEventListener("DOMContentLoaded",this._onDocumentLoaded.bind(this)):this._onDocumentLoaded()}setInert(t,e){if(e){if(this._inertRoots.has(t))return;const e=new r(t,this);if(t.setAttribute("inert",""),this._inertRoots.set(t,e),!this._document.body.contains(t)){let e=t.parentNode;for(;e;)11===e.nodeType&&s(e),e=e.parentNode}}else{if(!this._inertRoots.has(t))return;this._inertRoots.get(t).destructor(),this._inertRoots.delete(t),t.removeAttribute("inert")}}getInertRoot(t){return this._inertRoots.get(t)}register(t,e){let i=this._managedNodes.get(t);return void 0!==i?i.addInertRoot(e):i=new n(t,e),this._managedNodes.set(t,i),i}deregister(t,e){const i=this._managedNodes.get(t);return i?(i.removeInertRoot(e),i.destroyed&&this._managedNodes.delete(t),i):null}_onDocumentLoaded(){t.call(this._document.querySelectorAll("[inert]")).forEach((function(t){this.setInert(t,!0)}),this),this._observer.observe(this._document.body||this._document.documentElement,{attributes:!0,subtree:!0,childList:!0})}_watchForInert(i,r){const n=this;i.forEach((function(i){switch(i.type){case"childList":t.call(i.addedNodes).forEach((function(i){if(i.nodeType!==Node.ELEMENT_NODE)return;const r=t.call(i.querySelectorAll("[inert]"));e.call(i,"[inert]")&&r.unshift(i),r.forEach((function(t){this.setInert(t,!0)}),n)}),n);break;case"attributes":if("inert"!==i.attributeName)return;const r=i.target,o=r.hasAttribute("inert");n.setInert(r,o)}}),this)}}(document);Element.prototype.hasOwnProperty("inert")||Object.defineProperty(Element.prototype,"inert",{enumerable:!0,get:function(){return this.hasAttribute("inert")},set:function(t){a.setInert(this,t)}})}();
/**
 * @license
 * Copyright 2016 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var Qt={ANIMATE:"mdc-drawer--animate",CLOSING:"mdc-drawer--closing",DISMISSIBLE:"mdc-drawer--dismissible",MODAL:"mdc-drawer--modal",OPEN:"mdc-drawer--open",OPENING:"mdc-drawer--opening",ROOT:"mdc-drawer"},te={APP_CONTENT_SELECTOR:".mdc-drawer-app-content",CLOSE_EVENT:"MDCDrawer:closed",OPEN_EVENT:"MDCDrawer:opened",SCRIM_SELECTOR:".mdc-drawer-scrim"},ee=function(){function t(t){void 0===t&&(t={}),this.adapter=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}(),ie=function(t){function r(e){var n=t.call(this,i(i({},r.defaultAdapter),e))||this;return n.animationFrame_=0,n.animationTimer_=0,n}return e(r,t),Object.defineProperty(r,"strings",{get:function(){return te},enumerable:!0,configurable:!0}),Object.defineProperty(r,"cssClasses",{get:function(){return Qt},enumerable:!0,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},elementHasClass:function(){return!1},notifyClose:function(){},notifyOpen:function(){},saveFocus:function(){},restoreFocus:function(){},focusActiveNavigationItem:function(){},trapFocus:function(){},releaseFocus:function(){}}},enumerable:!0,configurable:!0}),r.prototype.destroy=function(){this.animationFrame_&&cancelAnimationFrame(this.animationFrame_),this.animationTimer_&&clearTimeout(this.animationTimer_)},r.prototype.open=function(){var t=this;this.isOpen()||this.isOpening()||this.isClosing()||(this.adapter.addClass(Qt.OPEN),this.adapter.addClass(Qt.ANIMATE),this.runNextAnimationFrame_((function(){t.adapter.addClass(Qt.OPENING)})),this.adapter.saveFocus())},r.prototype.close=function(){!this.isOpen()||this.isOpening()||this.isClosing()||this.adapter.addClass(Qt.CLOSING)},r.prototype.isOpen=function(){return this.adapter.hasClass(Qt.OPEN)},r.prototype.isOpening=function(){return this.adapter.hasClass(Qt.OPENING)||this.adapter.hasClass(Qt.ANIMATE)},r.prototype.isClosing=function(){return this.adapter.hasClass(Qt.CLOSING)},r.prototype.handleKeydown=function(t){var e=t.keyCode;("Escape"===t.key||27===e)&&this.close()},r.prototype.handleTransitionEnd=function(t){var e=Qt.OPENING,i=Qt.CLOSING,r=Qt.OPEN,n=Qt.ANIMATE,o=Qt.ROOT;this.isElement_(t.target)&&this.adapter.elementHasClass(t.target,o)&&(this.isClosing()?(this.adapter.removeClass(r),this.closed_(),this.adapter.restoreFocus(),this.adapter.notifyClose()):(this.adapter.focusActiveNavigationItem(),this.opened_(),this.adapter.notifyOpen()),this.adapter.removeClass(n),this.adapter.removeClass(e),this.adapter.removeClass(i))},r.prototype.opened_=function(){},r.prototype.closed_=function(){},r.prototype.runNextAnimationFrame_=function(t){var e=this;cancelAnimationFrame(this.animationFrame_),this.animationFrame_=requestAnimationFrame((function(){e.animationFrame_=0,clearTimeout(e.animationTimer_),e.animationTimer_=setTimeout(t,0)}))},r.prototype.isElement_=function(t){return Boolean(t.classList)},r}(ee),re=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return e(i,t),i.prototype.handleScrimClick=function(){this.close()},i.prototype.opened_=function(){this.adapter.trapFocus()},i.prototype.closed_=function(){this.adapter.releaseFocus()},i}(ie);function ne(t,e){return(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,e)}
/**
@license
Copyright 2018 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/const oe=t=>t.nodeType===Node.ELEMENT_NODE;function se(t){return{addClass:e=>{t.classList.add(e)},removeClass:e=>{t.classList.remove(e)},hasClass:e=>t.classList.contains(e)}}let ae=!1;const le=()=>{},de={get passive(){return ae=!0,!1}};document.addEventListener("x",le,de),document.removeEventListener("x",le);const ce=ae,he=(t=window.document)=>{let e=t.activeElement;const i=[];if(!e)return i;for(;e&&(i.push(e),e.shadowRoot);)e=e.shadowRoot.activeElement;return i},ue=t=>{const e=he();if(!e.length)return!1;const i=e[e.length-1],r=new Event("check-if-focused",{bubbles:!0,composed:!0});let n=[];const o=t=>{n=t.composedPath()};return document.body.addEventListener("check-if-focused",o),i.dispatchEvent(r),document.body.removeEventListener("check-if-focused",o),-1!==n.indexOf(t)};
/**
@license
Copyright 2018 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
class pe extends Ot{click(){if(this.mdcRoot)return this.mdcRoot.focus(),void this.mdcRoot.click();super.click()}createFoundation(){void 0!==this.mdcFoundation&&this.mdcFoundation.destroy(),this.mdcFoundationClass&&(this.mdcFoundation=new this.mdcFoundationClass(this.createAdapter()),this.mdcFoundation.init())}firstUpdated(){this.createFoundation()}}
/**
@license
Copyright 2018 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/const fe=t=>(e,i)=>{if(e.constructor._observers){if(!e.constructor.hasOwnProperty("_observers")){const t=e.constructor._observers;e.constructor._observers=new Map,t.forEach(((t,i)=>e.constructor._observers.set(i,t)))}}else{e.constructor._observers=new Map;const t=e.updated;e.updated=function(e){t.call(this,e),e.forEach(((t,e)=>{const i=this.constructor._observers.get(e);void 0!==i&&i.call(this,this[e],t)}))}}e.constructor._observers.set(i,t)}
/**
 * @license
 * Copyright (c) 2018 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
 */;class me{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;const e=(t.getAttribute("class")||"").split(/\s+/);for(const t of e)this.classes.add(t)}add(t){this.classes.add(t),this.changed=!0}remove(t){this.classes.delete(t),this.changed=!0}commit(){if(this.changed){let t="";this.classes.forEach((e=>t+=e+" ")),this.element.setAttribute("class",t)}}}const ge=new WeakMap,be=m((t=>e=>{if(!(e instanceof $)||e instanceof D||"class"!==e.committer.name||e.committer.parts.length>1)throw new Error("The `classMap` directive must be used in the `class` attribute and must be the only part in the attribute.");const{committer:i}=e,{element:r}=i;let n=ge.get(e);void 0===n&&(r.setAttribute("class",i.strings.join(" ")),ge.set(e,n=new Set));const o=r.classList||new me(r);n.forEach((e=>{e in t||(o.remove(e),n.delete(e))}));for(const e in t){const i=t[e];i!=n.has(e)&&(i?(o.add(e),n.add(e)):(o.remove(e),n.delete(e)))}"function"==typeof o.commit&&o.commit()})),ve=document.$blockingElements;class ye extends pe{constructor(){super(...arguments),this._previousFocus=null,this.open=!1,this.hasHeader=!1,this.type=""}get mdcFoundationClass(){return"modal"===this.type?re:ie}createAdapter(){return Object.assign(Object.assign({},se(this.mdcRoot)),{elementHasClass:(t,e)=>t.classList.contains(e),saveFocus:()=>{this._previousFocus=this.getRootNode().activeElement},restoreFocus:()=>{this._previousFocus&&this._previousFocus.focus&&this._previousFocus.focus()},notifyClose:()=>{this.open=!1,this.dispatchEvent(new Event(te.CLOSE_EVENT,{bubbles:!0,cancelable:!0}))},notifyOpen:()=>{this.open=!0,this.dispatchEvent(new Event(te.OPEN_EVENT,{bubbles:!0,cancelable:!0}))},focusActiveNavigationItem:()=>{},trapFocus:()=>{ve.push(this),this.appContent.inert=!0},releaseFocus:()=>{ve.remove(this),this.appContent.inert=!1}})}_handleScrimClick(){this.mdcFoundation instanceof re&&this.mdcFoundation.handleScrimClick()}render(){const t="dismissible"===this.type||"modal"===this.type,e="modal"===this.type,i=this.hasHeader?Z`
      <div class="mdc-drawer__header">
        <h3 class="mdc-drawer__title"><slot name="title"></slot></h3>
        <h6 class="mdc-drawer__subtitle"><slot name="subtitle"></slot></h6>
        <slot name="header"></slot>
      </div>
      `:"";return Z`
      <aside class="mdc-drawer ${be({"mdc-drawer--dismissible":t,"mdc-drawer--modal":e})}">
        ${i}
        <div class="mdc-drawer__content"><slot></slot></div>
      </aside>
      ${e?Z`<div class="mdc-drawer-scrim"
                          @click="${this._handleScrimClick}"></div>`:""}
      <div class="mdc-drawer-app-content">
        <slot name="appContent"></slot>
      </div>
      `}firstUpdated(){this.mdcRoot.addEventListener("keydown",(t=>this.mdcFoundation.handleKeydown(t))),this.mdcRoot.addEventListener("transitionend",(t=>this.mdcFoundation.handleTransitionEnd(t)))}updated(t){t.has("type")&&this.createFoundation()}}r([wt(".mdc-drawer")],ye.prototype,"mdcRoot",void 0),r([wt(".mdc-drawer-app-content")],ye.prototype,"appContent",void 0),r([fe((function(t){""!==this.type&&(t?this.mdcFoundation.open():this.mdcFoundation.close())})),yt({type:Boolean,reflect:!0})],ye.prototype,"open",void 0),r([yt({type:Boolean})],ye.prototype,"hasHeader",void 0),r([yt({reflect:!0})],ye.prototype,"type",void 0);
/**
@license
Copyright 2018 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
const _e=Ct`.mdc-drawer{border-color:rgba(0, 0, 0, 0.12);background-color:#fff;background-color:var(--mdc-theme-surface, #fff);border-top-left-radius:0;border-top-right-radius:0;border-top-right-radius:var(--mdc-shape-large, 0);border-bottom-right-radius:0;border-bottom-right-radius:var(--mdc-shape-large, 0);border-bottom-left-radius:0;z-index:6;width:256px;display:flex;flex-direction:column;flex-shrink:0;box-sizing:border-box;height:100%;border-right-width:1px;border-right-style:solid;overflow:hidden;transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.mdc-drawer .mdc-drawer__title{color:rgba(0, 0, 0, 0.87)}.mdc-drawer .mdc-list-group__subheader{color:rgba(0, 0, 0, 0.6)}.mdc-drawer .mdc-drawer__subtitle{color:rgba(0, 0, 0, 0.6)}.mdc-drawer .mdc-list-item__graphic{color:rgba(0, 0, 0, 0.6)}.mdc-drawer .mdc-list-item{color:rgba(0, 0, 0, 0.87)}.mdc-drawer .mdc-list-item--activated .mdc-list-item__graphic{color:#6200ee}.mdc-drawer .mdc-list-item--activated{color:rgba(98, 0, 238, 0.87)}[dir=rtl] .mdc-drawer,.mdc-drawer[dir=rtl]{border-top-left-radius:0;border-top-left-radius:var(--mdc-shape-large, 0);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0;border-bottom-left-radius:var(--mdc-shape-large, 0)}.mdc-drawer .mdc-list-item{border-radius:4px;border-radius:var(--mdc-shape-small, 4px)}.mdc-drawer.mdc-drawer--open:not(.mdc-drawer--closing)+.mdc-drawer-app-content{margin-left:256px;margin-right:0}[dir=rtl] .mdc-drawer.mdc-drawer--open:not(.mdc-drawer--closing)+.mdc-drawer-app-content,.mdc-drawer.mdc-drawer--open:not(.mdc-drawer--closing)+.mdc-drawer-app-content[dir=rtl]{margin-left:0;margin-right:256px}[dir=rtl] .mdc-drawer,.mdc-drawer[dir=rtl]{border-right-width:0;border-left-width:1px;border-right-style:none;border-left-style:solid}.mdc-drawer .mdc-list-item{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-subtitle2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.875rem;font-size:var(--mdc-typography-subtitle2-font-size, 0.875rem);line-height:1.375rem;line-height:var(--mdc-typography-subtitle2-line-height, 1.375rem);font-weight:500;font-weight:var(--mdc-typography-subtitle2-font-weight, 500);letter-spacing:0.0071428571em;letter-spacing:var(--mdc-typography-subtitle2-letter-spacing, 0.0071428571em);text-decoration:inherit;text-decoration:var(--mdc-typography-subtitle2-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle2-text-transform, inherit);height:calc(48px - 2 * 4px);margin:8px 8px;padding:0 8px}.mdc-drawer .mdc-list-item:nth-child(1){margin-top:2px}.mdc-drawer .mdc-list-item:nth-last-child(1){margin-bottom:0}.mdc-drawer .mdc-list-group__subheader{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.875rem;font-size:var(--mdc-typography-body2-font-size, 0.875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight, 400);letter-spacing:0.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, 0.0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform, inherit);display:block;margin-top:0;line-height:normal;margin:0;padding:0 16px}.mdc-drawer .mdc-list-group__subheader::before{display:inline-block;width:0;height:24px;content:"";vertical-align:0}.mdc-drawer .mdc-list-divider{margin:3px 0 4px}.mdc-drawer .mdc-list-item__text,.mdc-drawer .mdc-list-item__graphic{pointer-events:none}.mdc-drawer--animate{transform:translateX(-100%)}[dir=rtl] .mdc-drawer--animate,.mdc-drawer--animate[dir=rtl]{transform:translateX(100%)}.mdc-drawer--opening{transform:translateX(0);transition-duration:250ms}[dir=rtl] .mdc-drawer--opening,.mdc-drawer--opening[dir=rtl]{transform:translateX(0)}.mdc-drawer--closing{transform:translateX(-100%);transition-duration:200ms}[dir=rtl] .mdc-drawer--closing,.mdc-drawer--closing[dir=rtl]{transform:translateX(100%)}.mdc-drawer__header{flex-shrink:0;box-sizing:border-box;min-height:64px;padding:0 16px 4px}.mdc-drawer__title{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-headline6-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1.25rem;font-size:var(--mdc-typography-headline6-font-size, 1.25rem);line-height:2rem;line-height:var(--mdc-typography-headline6-line-height, 2rem);font-weight:500;font-weight:var(--mdc-typography-headline6-font-weight, 500);letter-spacing:0.0125em;letter-spacing:var(--mdc-typography-headline6-letter-spacing, 0.0125em);text-decoration:inherit;text-decoration:var(--mdc-typography-headline6-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-headline6-text-transform, inherit);display:block;margin-top:0;line-height:normal;margin-bottom:-20px}.mdc-drawer__title::before{display:inline-block;width:0;height:36px;content:"";vertical-align:0}.mdc-drawer__title::after{display:inline-block;width:0;height:20px;content:"";vertical-align:-20px}.mdc-drawer__subtitle{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.875rem;font-size:var(--mdc-typography-body2-font-size, 0.875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight, 400);letter-spacing:0.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, 0.0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform, inherit);display:block;margin-top:0;line-height:normal;margin-bottom:0}.mdc-drawer__subtitle::before{display:inline-block;width:0;height:20px;content:"";vertical-align:0}.mdc-drawer__content{height:100%;overflow-y:auto;-webkit-overflow-scrolling:touch}.mdc-drawer--dismissible{left:0;right:initial;display:none;position:absolute}[dir=rtl] .mdc-drawer--dismissible,.mdc-drawer--dismissible[dir=rtl]{left:initial;right:0}.mdc-drawer--dismissible.mdc-drawer--open{display:flex}.mdc-drawer-app-content{margin-left:0;margin-right:0;position:relative}[dir=rtl] .mdc-drawer-app-content,.mdc-drawer-app-content[dir=rtl]{margin-left:0;margin-right:0}.mdc-drawer--modal{box-shadow:0px 8px 10px -5px rgba(0, 0, 0, 0.2),0px 16px 24px 2px rgba(0, 0, 0, 0.14),0px 6px 30px 5px rgba(0,0,0,.12);left:0;right:initial;display:none;position:fixed}.mdc-drawer--modal+.mdc-drawer-scrim{background-color:rgba(0, 0, 0, 0.32)}[dir=rtl] .mdc-drawer--modal,.mdc-drawer--modal[dir=rtl]{left:initial;right:0}.mdc-drawer--modal.mdc-drawer--open{display:flex}.mdc-drawer-scrim{display:none;position:fixed;top:0;left:0;width:100%;height:100%;z-index:5;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.mdc-drawer--open+.mdc-drawer-scrim{display:block}.mdc-drawer--animate+.mdc-drawer-scrim{opacity:0}.mdc-drawer--opening+.mdc-drawer-scrim{transition-duration:250ms;opacity:1}.mdc-drawer--closing+.mdc-drawer-scrim{transition-duration:200ms;opacity:0}.mdc-drawer-app-content{overflow:auto;flex:1}:host{display:flex;height:100%}.mdc-drawer{width:256px;width:var(--mdc-drawer-width, 256px)}.mdc-drawer.mdc-drawer--open:not(.mdc-drawer--closing)+.mdc-drawer-app-content{margin-left:256px;margin-left:var(--mdc-drawer-width, 256px);margin-right:0}[dir=rtl] .mdc-drawer.mdc-drawer--open:not(.mdc-drawer--closing)+.mdc-drawer-app-content,.mdc-drawer.mdc-drawer--open:not(.mdc-drawer--closing)+.mdc-drawer-app-content[dir=rtl]{margin-left:0;margin-right:256px;margin-right:var(--mdc-drawer-width, 256px)}`;let we=class extends ye{static get styles(){return[_e,Ct`
    .mdc-drawer {
      background-color: var(--mdc-drawer-background-color, '#ffffff');
      width: var(--mdc-drawer-width, 256px);
      border-left: var(--mdc-drawer-border-left, 1px solid rgba(0,0,0,0.12));
      border-right:var(--mdc-drawer-border-right, 1px solid rgba(0,0,0,0.12));
    }
    .mdc-drawer.mdc-drawer--open:not(.mdc-drawer--closing) + .mdc-drawer-app-content {
      margin-left: var(--mdc-drawer-width, 256px)!important;
      width: calc(100% - var(--mdc-drawer-width, 256px));
    }`]}};we=r([bt("mwc-drawer")],we);
/**
@license
Copyright 2018 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
const xe=Ct`.mdc-top-app-bar{background-color:#6200ee;background-color:var(--mdc-theme-primary, #6200ee);color:white;display:flex;position:fixed;flex-direction:column;justify-content:space-between;box-sizing:border-box;width:100%;z-index:4}.mdc-top-app-bar .mdc-top-app-bar__action-item,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon{color:#fff;color:var(--mdc-theme-on-primary, #fff)}.mdc-top-app-bar .mdc-top-app-bar__action-item::before,.mdc-top-app-bar .mdc-top-app-bar__action-item::after,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon::before,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon::after{background-color:#fff;background-color:var(--mdc-theme-on-primary, #fff)}.mdc-top-app-bar .mdc-top-app-bar__action-item:hover::before,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon:hover::before{opacity:.08}.mdc-top-app-bar .mdc-top-app-bar__action-item.mdc-ripple-upgraded--background-focused::before,.mdc-top-app-bar .mdc-top-app-bar__action-item:not(.mdc-ripple-upgraded):focus::before,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon.mdc-ripple-upgraded--background-focused::before,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:.24}.mdc-top-app-bar .mdc-top-app-bar__action-item:not(.mdc-ripple-upgraded)::after,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-top-app-bar .mdc-top-app-bar__action-item:not(.mdc-ripple-upgraded):active::after,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:.24}.mdc-top-app-bar .mdc-top-app-bar__action-item.mdc-ripple-upgraded,.mdc-top-app-bar .mdc-top-app-bar__navigation-icon.mdc-ripple-upgraded{--mdc-ripple-fg-opacity: 0.24}.mdc-top-app-bar__row{display:flex;position:relative;box-sizing:border-box;width:100%;height:64px}.mdc-top-app-bar__section{display:inline-flex;flex:1 1 auto;align-items:center;min-width:0;padding:8px 12px;z-index:1}.mdc-top-app-bar__section--align-start{justify-content:flex-start;order:-1}.mdc-top-app-bar__section--align-end{justify-content:flex-end;order:1}.mdc-top-app-bar__title{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-headline6-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1.25rem;font-size:var(--mdc-typography-headline6-font-size, 1.25rem);line-height:2rem;line-height:var(--mdc-typography-headline6-line-height, 2rem);font-weight:500;font-weight:var(--mdc-typography-headline6-font-weight, 500);letter-spacing:0.0125em;letter-spacing:var(--mdc-typography-headline6-letter-spacing, 0.0125em);text-decoration:inherit;text-decoration:var(--mdc-typography-headline6-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-headline6-text-transform, inherit);padding-left:20px;padding-right:0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;z-index:1}[dir=rtl] .mdc-top-app-bar__title,.mdc-top-app-bar__title[dir=rtl]{padding-left:0;padding-right:20px}.mdc-top-app-bar--short-collapsed{border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:24px;border-bottom-left-radius:0}[dir=rtl] .mdc-top-app-bar--short-collapsed,.mdc-top-app-bar--short-collapsed[dir=rtl]{border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:24px}.mdc-top-app-bar--short{top:0;right:auto;left:0;width:100%;transition:width 250ms cubic-bezier(0.4, 0, 0.2, 1)}[dir=rtl] .mdc-top-app-bar--short,.mdc-top-app-bar--short[dir=rtl]{right:0;left:auto}.mdc-top-app-bar--short .mdc-top-app-bar__row{height:56px}.mdc-top-app-bar--short .mdc-top-app-bar__section{padding:4px}.mdc-top-app-bar--short .mdc-top-app-bar__title{transition:opacity 200ms cubic-bezier(0.4, 0, 0.2, 1);opacity:1}.mdc-top-app-bar--short-collapsed{box-shadow:0px 2px 4px -1px rgba(0, 0, 0, 0.2),0px 4px 5px 0px rgba(0, 0, 0, 0.14),0px 1px 10px 0px rgba(0,0,0,.12);width:56px;transition:width 300ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-top-app-bar--short-collapsed .mdc-top-app-bar__title{display:none}.mdc-top-app-bar--short-collapsed .mdc-top-app-bar__action-item{transition:padding 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-top-app-bar--short-collapsed.mdc-top-app-bar--short-has-action-item{width:112px}.mdc-top-app-bar--short-collapsed.mdc-top-app-bar--short-has-action-item .mdc-top-app-bar__section--align-end{padding-left:0;padding-right:12px}[dir=rtl] .mdc-top-app-bar--short-collapsed.mdc-top-app-bar--short-has-action-item .mdc-top-app-bar__section--align-end,.mdc-top-app-bar--short-collapsed.mdc-top-app-bar--short-has-action-item .mdc-top-app-bar__section--align-end[dir=rtl]{padding-left:12px;padding-right:0}.mdc-top-app-bar--dense .mdc-top-app-bar__row{height:48px}.mdc-top-app-bar--dense .mdc-top-app-bar__section{padding:0 4px}.mdc-top-app-bar--dense .mdc-top-app-bar__title{padding-left:12px;padding-right:0}[dir=rtl] .mdc-top-app-bar--dense .mdc-top-app-bar__title,.mdc-top-app-bar--dense .mdc-top-app-bar__title[dir=rtl]{padding-left:0;padding-right:12px}.mdc-top-app-bar--prominent .mdc-top-app-bar__row{height:128px}.mdc-top-app-bar--prominent .mdc-top-app-bar__title{align-self:flex-end;padding-bottom:2px}.mdc-top-app-bar--prominent .mdc-top-app-bar__action-item,.mdc-top-app-bar--prominent .mdc-top-app-bar__navigation-icon{align-self:flex-start}.mdc-top-app-bar--fixed{transition:box-shadow 200ms linear}.mdc-top-app-bar--fixed-scrolled{box-shadow:0px 2px 4px -1px rgba(0, 0, 0, 0.2),0px 4px 5px 0px rgba(0, 0, 0, 0.14),0px 1px 10px 0px rgba(0,0,0,.12);transition:box-shadow 200ms linear}.mdc-top-app-bar--dense.mdc-top-app-bar--prominent .mdc-top-app-bar__row{height:96px}.mdc-top-app-bar--dense.mdc-top-app-bar--prominent .mdc-top-app-bar__section{padding:0 12px}.mdc-top-app-bar--dense.mdc-top-app-bar--prominent .mdc-top-app-bar__title{padding-left:20px;padding-right:0;padding-bottom:9px}[dir=rtl] .mdc-top-app-bar--dense.mdc-top-app-bar--prominent .mdc-top-app-bar__title,.mdc-top-app-bar--dense.mdc-top-app-bar--prominent .mdc-top-app-bar__title[dir=rtl]{padding-left:0;padding-right:20px}.mdc-top-app-bar--fixed-adjust{padding-top:64px}.mdc-top-app-bar--dense-fixed-adjust{padding-top:48px}.mdc-top-app-bar--short-fixed-adjust{padding-top:56px}.mdc-top-app-bar--prominent-fixed-adjust{padding-top:128px}.mdc-top-app-bar--dense-prominent-fixed-adjust{padding-top:96px}@media(max-width: 599px){.mdc-top-app-bar__row{height:56px}.mdc-top-app-bar__section{padding:4px}.mdc-top-app-bar--short{transition:width 200ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-top-app-bar--short-collapsed{transition:width 250ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-top-app-bar--short-collapsed .mdc-top-app-bar__section--align-end{padding-left:0;padding-right:12px}[dir=rtl] .mdc-top-app-bar--short-collapsed .mdc-top-app-bar__section--align-end,.mdc-top-app-bar--short-collapsed .mdc-top-app-bar__section--align-end[dir=rtl]{padding-left:12px;padding-right:0}.mdc-top-app-bar--prominent .mdc-top-app-bar__title{padding-bottom:6px}.mdc-top-app-bar--fixed-adjust{padding-top:56px}}:host{display:block}.mdc-top-app-bar{color:#fff;color:var(--mdc-theme-on-primary, #fff);width:100%;width:var(--mdc-top-app-bar-width, 100%)}.mdc-top-app-bar--prominent #navigation ::slotted(*),.mdc-top-app-bar--prominent #actions ::slotted(*){align-self:flex-start}#navigation ::slotted(*),#actions ::slotted(*){--mdc-icon-button-ripple-opacity: 0.24}.mdc-top-app-bar--short-collapsed #actions ::slotted(*){transition:padding 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-top-app-bar__section--align-center{justify-content:center}.mdc-top-app-bar__section--align-center .mdc-top-app-bar__title{padding-left:0;padding-right:0}.center-title .mdc-top-app-bar__section--align-start,.center-title .mdc-top-app-bar__section--align-end{flex-basis:0}.mdc-top-app-bar--dense.mdc-top-app-bar--prominent .mdc-top-app-bar__section--align-center .mdc-top-app-bar__title{padding-left:0;padding-right:0}.mdc-top-app-bar--fixed-scrolled{box-shadow:var(--mdc-top-app-bar-fixed-box-shadow, 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12))}`
/**
 @license
 Copyright (c) 2015 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

 Modified for Backend.AI Console Project / Lit-element with TypeScript
 */,Me=[Ct`
    :host > *, html {
      /* Material Design color palette for Google products */
      --google-red-100: #f4c7c3;
      --google-red-300: #e67c73;
      --google-red-500: #db4437;
      --google-red-700: #c53929;

      --google-blue-100: #c6dafc;
      --google-blue-300: #7baaf7;
      --google-blue-500: #4285f4;
      --google-blue-700: #3367d6;

      --google-green-100: #b7e1cd;
      --google-green-300: #57bb8a;
      --google-green-500: #0f9d58;
      --google-green-700: #0b8043;

      --google-yellow-100: #fce8b2;
      --google-yellow-300: #f7cb4d;
      --google-yellow-500: #f4b400;
      --google-yellow-700: #f09300;

      --google-grey-100: #f5f5f5;
      --google-grey-300: #e0e0e0;
      --google-grey-500: #9e9e9e;
      --google-grey-700: #616161;

      /* Material Design color palette from online spec document */

      --paper-red-50: #ffebee;
      --paper-red-100: #ffcdd2;
      --paper-red-200: #ef9a9a;
      --paper-red-300: #e57373;
      --paper-red-400: #ef5350;
      --paper-red-500: #f44336;
      --paper-red-600: #e53935;
      --paper-red-700: #d32f2f;
      --paper-red-800: #c62828;
      --paper-red-900: #b71c1c;
      --paper-red-a100: #ff8a80;
      --paper-red-a200: #ff5252;
      --paper-red-a400: #ff1744;
      --paper-red-a700: #d50000;

      --paper-pink-50: #fce4ec;
      --paper-pink-100: #f8bbd0;
      --paper-pink-200: #f48fb1;
      --paper-pink-300: #f06292;
      --paper-pink-400: #ec407a;
      --paper-pink-500: #e91e63;
      --paper-pink-600: #d81b60;
      --paper-pink-700: #c2185b;
      --paper-pink-800: #ad1457;
      --paper-pink-900: #880e4f;
      --paper-pink-a100: #ff80ab;
      --paper-pink-a200: #ff4081;
      --paper-pink-a400: #f50057;
      --paper-pink-a700: #c51162;

      --paper-purple-50: #f3e5f5;
      --paper-purple-100: #e1bee7;
      --paper-purple-200: #ce93d8;
      --paper-purple-300: #ba68c8;
      --paper-purple-400: #ab47bc;
      --paper-purple-500: #9c27b0;
      --paper-purple-600: #8e24aa;
      --paper-purple-700: #7b1fa2;
      --paper-purple-800: #6a1b9a;
      --paper-purple-900: #4a148c;
      --paper-purple-a100: #ea80fc;
      --paper-purple-a200: #e040fb;
      --paper-purple-a400: #d500f9;
      --paper-purple-a700: #aa00ff;

      --paper-deep-purple-50: #ede7f6;
      --paper-deep-purple-100: #d1c4e9;
      --paper-deep-purple-200: #b39ddb;
      --paper-deep-purple-300: #9575cd;
      --paper-deep-purple-400: #7e57c2;
      --paper-deep-purple-500: #673ab7;
      --paper-deep-purple-600: #5e35b1;
      --paper-deep-purple-700: #512da8;
      --paper-deep-purple-800: #4527a0;
      --paper-deep-purple-900: #311b92;
      --paper-deep-purple-a100: #b388ff;
      --paper-deep-purple-a200: #7c4dff;
      --paper-deep-purple-a400: #651fff;
      --paper-deep-purple-a700: #6200ea;

      --paper-indigo-50: #e8eaf6;
      --paper-indigo-100: #c5cae9;
      --paper-indigo-200: #9fa8da;
      --paper-indigo-300: #7986cb;
      --paper-indigo-400: #5c6bc0;
      --paper-indigo-500: #3f51b5;
      --paper-indigo-600: #3949ab;
      --paper-indigo-700: #303f9f;
      --paper-indigo-800: #283593;
      --paper-indigo-900: #1a237e;
      --paper-indigo-a100: #8c9eff;
      --paper-indigo-a200: #536dfe;
      --paper-indigo-a400: #3d5afe;
      --paper-indigo-a700: #304ffe;

      --paper-blue-50: #e3f2fd;
      --paper-blue-100: #bbdefb;
      --paper-blue-200: #90caf9;
      --paper-blue-300: #64b5f6;
      --paper-blue-400: #42a5f5;
      --paper-blue-500: #2196f3;
      --paper-blue-600: #1e88e5;
      --paper-blue-700: #1976d2;
      --paper-blue-800: #1565c0;
      --paper-blue-900: #0d47a1;
      --paper-blue-a100: #82b1ff;
      --paper-blue-a200: #448aff;
      --paper-blue-a400: #2979ff;
      --paper-blue-a700: #2962ff;

      --paper-light-blue-50: #e1f5fe;
      --paper-light-blue-100: #b3e5fc;
      --paper-light-blue-200: #81d4fa;
      --paper-light-blue-300: #4fc3f7;
      --paper-light-blue-400: #29b6f6;
      --paper-light-blue-500: #03a9f4;
      --paper-light-blue-600: #039be5;
      --paper-light-blue-700: #0288d1;
      --paper-light-blue-800: #0277bd;
      --paper-light-blue-900: #01579b;
      --paper-light-blue-a100: #80d8ff;
      --paper-light-blue-a200: #40c4ff;
      --paper-light-blue-a400: #00b0ff;
      --paper-light-blue-a700: #0091ea;

      --paper-cyan-50: #e0f7fa;
      --paper-cyan-100: #b2ebf2;
      --paper-cyan-200: #80deea;
      --paper-cyan-300: #4dd0e1;
      --paper-cyan-400: #26c6da;
      --paper-cyan-500: #00bcd4;
      --paper-cyan-600: #00acc1;
      --paper-cyan-700: #0097a7;
      --paper-cyan-800: #00838f;
      --paper-cyan-900: #006064;
      --paper-cyan-a100: #84ffff;
      --paper-cyan-a200: #18ffff;
      --paper-cyan-a400: #00e5ff;
      --paper-cyan-a700: #00b8d4;

      --paper-teal-50: #e0f2f1;
      --paper-teal-100: #b2dfdb;
      --paper-teal-200: #80cbc4;
      --paper-teal-300: #4db6ac;
      --paper-teal-400: #26a69a;
      --paper-teal-500: #009688;
      --paper-teal-600: #00897b;
      --paper-teal-700: #00796b;
      --paper-teal-800: #00695c;
      --paper-teal-900: #004d40;
      --paper-teal-a100: #a7ffeb;
      --paper-teal-a200: #64ffda;
      --paper-teal-a400: #1de9b6;
      --paper-teal-a700: #00bfa5;

      --paper-green-50: #e8f5e9;
      --paper-green-100: #c8e6c9;
      --paper-green-200: #a5d6a7;
      --paper-green-300: #81c784;
      --paper-green-400: #66bb6a;
      --paper-green-500: #4caf50;
      --paper-green-600: #43a047;
      --paper-green-700: #388e3c;
      --paper-green-800: #2e7d32;
      --paper-green-900: #1b5e20;
      --paper-green-a100: #b9f6ca;
      --paper-green-a200: #69f0ae;
      --paper-green-a400: #00e676;
      --paper-green-a700: #00c853;

      --paper-light-green-50: #f1f8e9;
      --paper-light-green-100: #dcedc8;
      --paper-light-green-200: #c5e1a5;
      --paper-light-green-300: #aed581;
      --paper-light-green-400: #9ccc65;
      --paper-light-green-500: #8bc34a;
      --paper-light-green-600: #7cb342;
      --paper-light-green-700: #689f38;
      --paper-light-green-800: #558b2f;
      --paper-light-green-900: #33691e;
      --paper-light-green-a100: #ccff90;
      --paper-light-green-a200: #b2ff59;
      --paper-light-green-a400: #76ff03;
      --paper-light-green-a700: #64dd17;

      --paper-lime-50: #f9fbe7;
      --paper-lime-100: #f0f4c3;
      --paper-lime-200: #e6ee9c;
      --paper-lime-300: #dce775;
      --paper-lime-400: #d4e157;
      --paper-lime-500: #cddc39;
      --paper-lime-600: #c0ca33;
      --paper-lime-700: #afb42b;
      --paper-lime-800: #9e9d24;
      --paper-lime-900: #827717;
      --paper-lime-a100: #f4ff81;
      --paper-lime-a200: #eeff41;
      --paper-lime-a400: #c6ff00;
      --paper-lime-a700: #aeea00;

      --paper-yellow-50: #fffde7;
      --paper-yellow-100: #fff9c4;
      --paper-yellow-200: #fff59d;
      --paper-yellow-300: #fff176;
      --paper-yellow-400: #ffee58;
      --paper-yellow-500: #ffeb3b;
      --paper-yellow-600: #fdd835;
      --paper-yellow-700: #fbc02d;
      --paper-yellow-800: #f9a825;
      --paper-yellow-900: #f57f17;
      --paper-yellow-a100: #ffff8d;
      --paper-yellow-a200: #ffff00;
      --paper-yellow-a400: #ffea00;
      --paper-yellow-a700: #ffd600;

      --paper-amber-50: #fff8e1;
      --paper-amber-100: #ffecb3;
      --paper-amber-200: #ffe082;
      --paper-amber-300: #ffd54f;
      --paper-amber-400: #ffca28;
      --paper-amber-500: #ffc107;
      --paper-amber-600: #ffb300;
      --paper-amber-700: #ffa000;
      --paper-amber-800: #ff8f00;
      --paper-amber-900: #ff6f00;
      --paper-amber-a100: #ffe57f;
      --paper-amber-a200: #ffd740;
      --paper-amber-a400: #ffc400;
      --paper-amber-a700: #ffab00;

      --paper-orange-50: #fff3e0;
      --paper-orange-100: #ffe0b2;
      --paper-orange-200: #ffcc80;
      --paper-orange-300: #ffb74d;
      --paper-orange-400: #ffa726;
      --paper-orange-500: #ff9800;
      --paper-orange-600: #fb8c00;
      --paper-orange-700: #f57c00;
      --paper-orange-800: #ef6c00;
      --paper-orange-900: #e65100;
      --paper-orange-a100: #ffd180;
      --paper-orange-a200: #ffab40;
      --paper-orange-a400: #ff9100;
      --paper-orange-a700: #ff6500;

      --paper-deep-orange-50: #fbe9e7;
      --paper-deep-orange-100: #ffccbc;
      --paper-deep-orange-200: #ffab91;
      --paper-deep-orange-300: #ff8a65;
      --paper-deep-orange-400: #ff7043;
      --paper-deep-orange-500: #ff5722;
      --paper-deep-orange-600: #f4511e;
      --paper-deep-orange-700: #e64a19;
      --paper-deep-orange-800: #d84315;
      --paper-deep-orange-900: #bf360c;
      --paper-deep-orange-a100: #ff9e80;
      --paper-deep-orange-a200: #ff6e40;
      --paper-deep-orange-a400: #ff3d00;
      --paper-deep-orange-a700: #dd2c00;

      --paper-brown-50: #efebe9;
      --paper-brown-100: #d7ccc8;
      --paper-brown-200: #bcaaa4;
      --paper-brown-300: #a1887f;
      --paper-brown-400: #8d6e63;
      --paper-brown-500: #795548;
      --paper-brown-600: #6d4c41;
      --paper-brown-700: #5d4037;
      --paper-brown-800: #4e342e;
      --paper-brown-900: #3e2723;

      --paper-grey-50: #fafafa;
      --paper-grey-100: #f5f5f5;
      --paper-grey-200: #eeeeee;
      --paper-grey-300: #e0e0e0;
      --paper-grey-400: #bdbdbd;
      --paper-grey-500: #9e9e9e;
      --paper-grey-600: #757575;
      --paper-grey-700: #616161;
      --paper-grey-800: #424242;
      --paper-grey-900: #212121;

      --paper-blue-grey-50: #eceff1;
      --paper-blue-grey-100: #cfd8dc;
      --paper-blue-grey-200: #b0bec5;
      --paper-blue-grey-300: #90a4ae;
      --paper-blue-grey-400: #78909c;
      --paper-blue-grey-500: #607d8b;
      --paper-blue-grey-600: #546e7a;
      --paper-blue-grey-700: #455a64;
      --paper-blue-grey-800: #37474f;
      --paper-blue-grey-900: #263238;

      /* opacity for dark text on a light background */
      --dark-divider-opacity: 0.12;
      --dark-disabled-opacity: 0.38; /* or hint text or icon */
      --dark-secondary-opacity: 0.54;
      --dark-primary-opacity: 0.87;

      /* opacity for light text on a dark background */
      --light-divider-opacity: 0.12;
      --light-disabled-opacity: 0.3; /* or hint text or icon */
      --light-secondary-opacity: 0.7;
      --light-primary-opacity: 1.0;
    }
  `,Ct`
    :host > *, html {
      -webkit-box-sizing: border-box;
      -moz-box-sizing: border-box;
      box-sizing: border-box;
      --general-menu-background-color: transparent;
      --general-menu-background-color-less: rgba(255, 255, 255, 0.6);
      --general-menu-background-border: rgba(23, 23, 23, 1);
      --general-menu-background-opacity: 1;
      --general-menu-color-2: #242424;
      --general-menu-color: #efefef;
      --general-navbar-footer-background-color-r: 255;
      --general-navbar-footer-background-color-g: 255;
      --general-navbar-footer-background-color-b: 255;
      --general-navbar-footer-background-color: rgba(255, 255, 255, 0.95);
      --general-navbar-footer-background-color-less: rgba(255, 255, 255, 0.6);
      --general-navbar-footer-background-border: rgba(23, 23, 23, 1);
      --general-navbar-footer-background-opacity: 1;
      --general-navbar-footer-color: #424242;
      --general-panel-width: 280px;
      --general-big-panel-width: 560px;
      --general-content-container-width: 980px;
      --general-background-color: rgba(247, 246, 246, 1);
      --general-sidebar-color: #949494;
      --general-sidebar-background-color: #2a2c30;
      --general-sidebar-h3-color: #cccccc;
      --general-sidebar-h3-border-color: 1px solid #444444;
      --general-sidebar-topbar-background-color-3: #383e48;
      --general-sidebar-topbar-background-color-2: rgba(103, 172, 91, 1.00);
      --general-sidebar-topbar-background-color-4: var(--paper-grey-200);
      --general-sidebar-topbar-color-4: #222222;
      --general-sidebar-topbar-background-color: rgba(24, 24, 24, 1);
      --general-sidebar-topbar-color: #efefef;
      --general-sidebar-selected-color: #72EB51; /*var(--paper-green-400);*/
      --general-sidebar-selected-background-color: transparent;
      --general-sidebar-selected-background-gradient-color: transparent;
      --general-sidebar-selected-border-left: 3px solid var(--general-sidebar-selected-color);
      --general-sidebar-footer-color: #777777;
      --general-sidebar-navbar-footer-color: #222222;
      --general-sidebar-item-even-background-color: transparent;
      --general-sidebar-item-odd-background-color: rgba(239, 240, 242, 0.95);
      --general-sidepanel-color: #dddddd;
      --general-sidepanel-background-color: #ffffff; /*rgba(244, 245, 247, 1); rgba(48, 48, 48, 1.0);*/
      --general-tabbar-background-color: var(--general-sidebar-background-color);
      --general-tabbar-tab-disabled-color: var(--general-sidebar-color);
      --general-tabbar-button-color: var(--general-sidebar-selected-color);
      --general-textfield-selected-color: #27824F;
      --general-dropdown-color: var(--general-sidebar-color);
      --general-checkbox-color: var(--general-textfield-selected-color);
      --general-button-background-color: #27824F;
      --general-button-color: #ffffff;
      --general-switch-off-color: #AAA;
      --general-switch-on-color: #27824F;
      --general-slider-color: var(--general-textfield-selected-color);
      --general-dialog-background-color: #ffffff;
      --general-font-family: 'Ubuntu', 'Quicksand', Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", AppleSDGothic, "Apple SD Gothic Neo", NanumGothic, "NanumGothicOTF", "Nanum Gothic", "Malgun Gothic", sans-serif;
      --general-monospace-font-family: Menlo, Courier, "Courier New", RobotoMono, sans-serif;
      --general-progress-bar-bg: #e8e8e8;
      --general-progress-bar-reserved: linear-gradient(to left, #722cd7, #5c7cfa);
      --general-progress-bar-using: linear-gradient(to left, #18aa7c, #60bb43),
                                       linear-gradient(to left, #722cd7, #5c7cfa);
    }

    body {
      background-color: var(--general-background-color, #fafafa);
      font-family: var(--general-font-family);
      font-weight: 400;
      font-size: 14px;
      color: #222222;
      margin: 0;
      overflow-x: hidden;
      word-break: keep-all;
    }

    [unresolved] {
      background-repeat: no-repeat;
      background-position: 50% 50vh;
      background-color: var(--general-background-color, #fafafa);
    }

    span,
    wl-icon {
      pointer-events: none;
    }

    body,
    .fonts-loaded body {
      font-family: 'Ubuntu', 'Quicksand', Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Sans KR", "Noto Sans", AppleSDGothic, NanumGothic, "NanumGothicOTF", "Nanum Gothic", "Malgun Gothic", sans-serif;
    }

    section {
      padding: 5px 0;
    }

    a {
      text-decoration: none;
      cursor: pointer;
    }

    fieldset {
      padding: 0;
      border: 0;
    }

    footer {
      bottom: 0;
      text-align: center;
      color: #aaaaaa;
    }

    footer a {
      color: #cccccc !important;
    }

    #content {
      padding: 0 auto;
      margin: 0 auto 5px auto;
    }

    .monospace {
      font-family: var(--general-monospace-font-family);
    }

    .clearfix:after {
      content: ".";
      visibility: hidden;
      display: block;
      height: 0;
      clear: both;
    }

    div.ui-draggable {
      width: 100%;
    }

    .lazyload {
      opacity: 0;
      transform: scale(0.8);
    }

    .lazyloaded {
      opacity: 1;
      transform: scale(1);
      transition: all 400ms;
    }

    .wl-card-title {
      font-weight: 200;
    }

    wl-select {
      --input-font-family: var(--general-font-family);
    }

    ::-webkit-scrollbar {
      max-width: 2px;
      background-color: transparent;
    }

    ::-webkit-scrollbar-thumb {
      border-radius: 6px;
      background-color: #464646;
    }

    .paper-header {
      height: 60px;
      font-size: 16px;
      line-height: 60px;
      padding: 0 10px;
      color: white;
      transition: height 0.2s;
    }

    .paper-header a {
      color: white;
    }

    .paper-header.tall {
      height: 120px;
    }

    .paper-header.medium-tall {
      height: 100px;
      line-height: 50px;
    }

    .cover {
      margin: 60px;
    }

    wl-icon.tiny {
      --icon-size: 12px;
    }

    wl-card {
      display: block;
      background: white;
      box-sizing: border-box;
      padding: 0;
      border-radius: 2px;
    }

    div.item {
      color: #000000;
    }

    #content > wl-card {
      max-width: var(--general-content-container-width, 980px);
    }

    @media screen and (max-width: 399px) {
      wl-card {
        margin-left: 0;
        margin-right: 0;
      }
    }

    @media screen and (max-width: 449px) {
      #content > wl-card {
        width: 100%;
      }
    }

    @media screen and (min-width: 450px) {
      #content > wl-card,
      #content > div {
        width: 100%;
        --card-elevation: 0;
        --card-padding: 0;
      }

      #content > wl-card {
        margin: 0 !important;
      }
    }

    @media screen and (max-width: 899px) {
      .item div.layout {
        -ms-flex-pack: center;
        -webkit-justify-content: center;
        justify-content: center;
      }
    }

    mwc-multi-select {
      --mdc-select-min-width: 100px; /* Fallback to apply width */
    }

    mwc-button,
    mwc-button[outlined],
    mwc-button[raised],
    mwc-button[unelevated] {
      border-radius: 5px;
      background-image: linear-gradient(to bottom, #69cee0 0%, #38bd73 100%);
      --mdc-theme-primary: transparent; /* gradient-color doesn't work in mwc-button styling */
      --mdc-theme-on-primary: var(--general-button-color);
    }


    mwc-button.operation {
      margin: 0px 5px;
    }

    mwc-icon-button.pagination {
      --mdc-icon-button-size: 30px;
      --mdc-theme-text-disabled-on-light: var(--paper-grey-400);
      color: var(--general-button-background-color);
      box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.2);
      border-radius: 5px;
    }

    mwc-icon-button[disabled].pagination {
      background-color: var(--paper-grey-100);
    }

    mwc-switch {
      --mdc-theme-surface: var(--general-switch-off-color);
      --mdc-theme-on-surface: var(--general-switch-off-color);
      --mdc-theme-secondary: var(--general-switch-on-color);
    }

    wl-card p {
      padding: 10px;
    }

    wl-card > .entry > p {
      padding: 5px;
    }

    wl-card .commands {
      margin: 0;
      border-top: 1px solid #dddddd;
      text-align: left;
    }

    wl-card.item div.items {
      padding-bottom: 10px;
    }

    wl-card .commands.float {
      border-top: none;
      position: fixed;
      right: 0;
      bottom: 0;
      left: 0;
    }

    .panels wl-card,
    .panels div {
      width: var(--general-panel-width);
    }

    .wide-panels {
      margin: 0 0 10px 0;
    }

    .wide-panels wl-card {
      width: 100%;
      margin: 0 0 16px 0;
    }

    .line {
      margin-bottom: 10px;
      display: -ms-flexbox;
      display: -webkit-flex;
      display: flex;
      -ms-flex-direction: row;
      -webkit-flex-direction: row;
      flex-direction: row;
    }

    .line span {
      margin-left: 24px;
    }

    .line {
      display: inline-block;
      width: auto;
      height: 1px;
      border: 0;
      border-top: 1px solid #ccc;
      margin: 20px;
      padding: 0;
    }

    .resource-line {
      border-bottom: 1px solid #ccc;
      height: 1px;
      width: 60%;
      margin-left: 80px;
      margin-bottom: 10px;
    }

    wl-card > h3 {
      font-size: 20px;
      font-weight: 400;
      padding: 10px 20px;
      margin: 0;
      display: block;
      border-bottom: 1px solid #dddddd;
    }

    wl-card > h3 > .date {
      font-size: 12px;
      text-align: right;
      color: #888888;
      margin-left: 20px;
    }

    wl-card > h3.blue,
    wl-card > h4.blue {
      border-left: 3px solid var(--paper-light-blue-400);
    }

    wl-card > h3.red,
    wl-card > h4.red {
      border-left: 3px solid var(--paper-red-400);
    }

    wl-card > h3.green,
    wl-card > h4.green {
      border-left: 3px solid var(--paper-green-400);
    }

    wl-card > h3.orange,
    wl-card > h4.orange {

      border-left: 3px solid var(--paper-orange-400);
    }

    wl-card > h3.cyan,
    wl-card > h4.cyan {

      border-left: 3px solid var(--paper-cyan-400);
    }

    wl-card > h3.lime,
    wl-card > h4.lime {
      border-left: 3px solid var(--paper-lime-400);
    }

    wl-card > h3.pink,
    wl-card > h4.pink {
      border-left: 3px solid var(--paper-pink-400);
    }

    wl-card > h4 {
      font-size: 14px;
      padding: 5px 15px 5px 20px;
      margin: 0 0 10px 0;
      display: block;
      border-bottom: 1px solid #dddddd;
      -ms-flex-pack: justify;
      -webkit-justify-content: space-between;
      justify-content: space-between;
    }

    wl-card .flex {
      display: flex;
    }

    wl-card.entries > div {
      margin: 20px;
    }

    wl-backdrop {
      --backdrop-bg: rgba(255, 0, 0, 0.3);
      background: rgba(255, 0, 0, 0.3) !important;
    }

    paper-toolbar {
      --paper-toolbar-sm-height: 45px;
    }
    mwc-button, mwc-button[unelevated] {
      background-image: none;
      --mdc-theme-primary: var(--general-button-background-color);
      --mdc-on-theme-primary: var(--general-button-background-color);
      --mdc-typography-font-family: var(--general-font-family);
    }

    mwc-textfield, mwc-textarea {
      --mdc-text-field-hover-line-color: transparent;
      --mdc-text-field-idle-line-color: transparent;
      --mdc-text-field-fill-color: var(--general-background-color, #fafafa);
      --mdc-typography-subtitle1-font-size: 14px;
      --mdc-typography-font-family: var(--general-font-family);
    }

    .bg-blue {
      background-color: var(--paper-light-blue-400);
    }

    .bg-red {
      background-color: var(--paper-red-400);
    }

    .bg-yellow {
      background-color: var(--paper-yellow-400);
    }

    .bg-orange {
      background-color: var(--paper-amber-400);
    }

    .bg-green {
      background-color: var(--paper-green-400);
    }

    .bg-cyan {
      background-color: var(--paper-cyan-400);
    }

    .bg-lime {
      background-color: var(--paper-lime-400);
    }

    .bg-pink {
      background-color: var(--paper-pink-a200);
    }

    .bg-purple {
      background-color: var(--paper-purple-400);
    }

    .white {
      color: #ffffff !important;
    }

    .black {
      color: #222222 !important;
    }

    .fg.black {
      color: #222222;
    }

    .fg.blue {
      color: var(--paper-light-blue-400) !important;
    }

    .fg.red {
      color: var(--paper-red-400) !important;
    }

    .fg.yellow {
      color: var(--paper-yellow-400) !important;
    }

    .fg.orange {
      color: var(--paper-amber-400) !important;
    }

    .fg.green {
      color: var(--paper-green-400) !important;
    }

    .fg.teal {
      color: var(--paper-teal-400) !important;
    }

    .fg.cyan {
      color: var(--paper-cyan-400) !important;
    }

    .fg.lime {
      color: var(--paper-lime-400) !important;
    }

    .fg.pink {
      color: var(--paper-pink-a200) !important;
    }

    .fg.purple {
      color: var(--paper-purple-400) !important;
    }

    /* Layout */
    .flex-1-container {
      -ms-flex: 1 1 0.000000001px;
      -webkit-flex: 1;
      flex: 1;
      -webkit-flex-basis: 0.000000001px;
      flex-basis: 0.000000001px;
    }

    .centered {
      max-width: 400px;
      margin-left: auto;
      margin-right: auto;
    }

    .distancing {
      margin:15px;
    }

    wl-card > h4 {
      font-weight: 200;
    }

    /* Loading spinner */
    #lablup-loading-spinner {
      position: fixed;
      width: 30px;
      height: 30px;
      bottom: 6px;
      left: 6px;
      z-index: 1000;
    }

    /* Tab on head */
    wl-card h3.tab {
      padding-top: 0;
      padding-bottom: 0;
      padding-left: 0;
    }

    /* Button */
    wl-button {
      --button-padding: 8px;
      --button-font-size: 14px;
    }

    wl-button.full-size,
    wl-button.full {
      width: 100%;
    }

    wl-button,
    wl-expansion,
    wl-textfield {
      --font-family-serif: var(--general-font-family);
      --font-family-sans-serif: var(--general-font-family);
    }

    lablup-progress-bar {
      --progress-bar-width: 186px;
      --progress-bar-height: 17px;
      --progres-bar-font-family: var(--general-font-family);
      --progress-bar-border-radius: 3px;
      --progress-bar-font-color-inverse: white;
      --progress-bar-font-color: black;
      margin-bottom: 5px;
    }

    lablup-progress-bar.start {
      --progress-bar-background: var(--general-progress-bar-reserved);
    }

    lablup-progress-bar.end {
      --progress-bar-background: var(--general-progress-bar-using);
    }

    div.progress-bar {
      position: relative;
    }

    div.progress-bar > span.gauge-label {
      position: absolute;
      left: 0.5em;
      top: 25%;
      z-index: 1;
      color: #2f2f2f;
    }

    .gauge-label {
      width: inherit;
      font-weight: bold;
      font-size: 10px;
      color: #2f2f2f;
    }

    .gauge-name {
      float: right;
      font-size: 14px;
      font-weight: bold;
      color: #2f2f2f;
    }

    span.percentage {
      font-size: 10px;
      color: #2f2f2f;
    }

    span.start-bar {
      margin-bottom: 5px;
      margin-left: 5px;
      padding-bottom: 5px;
    }

    span.end-bar {
      margin-top: 5px;
      margin-left: 5px;
      padding-bottom: 5px;
    }

    .resource-name {
      width: 60px;
      text-align: right;
      display: inline-block !important;
      margin: auto 20px auto 0px;
    }

    .resource-legend-stack {
      margin-bottom: 5px;
    }

    span.resource-legend {
      color: var(--general-sidebar-color);
      margin-right: 5px;
    }

    .resource-legend-icon {
      width:10px;
      height: 10px;
      margin-top: 2px;
      margin-left: 10px;
      margin-right: 3px;
      border-radius: 4px;
    }

    .resource-legend-icon.start {
      background-color: rgba(103, 82, 232, 1);
    }

    .resource-legend-icon.end {
      background-color: rgba(58, 178, 97, 1);
    }

    .resource-legend-icon.total {
      background-color: #E0E0E0;
    }

    .vertical-card {
      margin: 20px;
    }

    vaadin-grid {
      font-family: var(--general-font-family);
    }

    backend-ai-session-launcher#session-launcher {
      --component-color: #ffffff;
      --component-bg: rgb(104, 185, 155);
      --component-bg: linear-gradient(rgba(56,189,115, 0.5), rgba(56,189,115, 0.5)), linear-gradient(to bottom, #69cee0 0%, #38bd73 100%);
      --component-bg-hover: linear-gradient(180deg, rgba(98, 180, 131, 1) 0%, rgba(104, 185, 155, 1) 50%, rgba(93, 178, 113, 1) 100%);
      --component-bg-active: rgb(104, 185, 155);
      --component-shadow-color: #37c995;
    }

  `];
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var ke={FIXED_CLASS:"mdc-top-app-bar--fixed",FIXED_SCROLLED_CLASS:"mdc-top-app-bar--fixed-scrolled",SHORT_CLASS:"mdc-top-app-bar--short",SHORT_COLLAPSED_CLASS:"mdc-top-app-bar--short-collapsed",SHORT_HAS_ACTION_ITEM_CLASS:"mdc-top-app-bar--short-has-action-item"},Se={DEBOUNCE_THROTTLE_RESIZE_TIME_MS:100,MAX_TOP_APP_BAR_HEIGHT:128},Ee={ACTION_ITEM_SELECTOR:".mdc-top-app-bar__action-item",NAVIGATION_EVENT:"MDCTopAppBar:nav",NAVIGATION_ICON_SELECTOR:".mdc-top-app-bar__navigation-icon",ROOT_SELECTOR:".mdc-top-app-bar",TITLE_SELECTOR:".mdc-top-app-bar__title"},Ae=function(t){function r(e){return t.call(this,i(i({},r.defaultAdapter),e))||this}return e(r,t),Object.defineProperty(r,"strings",{get:function(){return Ee},enumerable:!0,configurable:!0}),Object.defineProperty(r,"cssClasses",{get:function(){return ke},enumerable:!0,configurable:!0}),Object.defineProperty(r,"numbers",{get:function(){return Se},enumerable:!0,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setStyle:function(){},getTopAppBarHeight:function(){return 0},notifyNavigationIconClicked:function(){},getViewportScrollY:function(){return 0},getTotalActionItems:function(){return 0}}},enumerable:!0,configurable:!0}),r.prototype.handleTargetScroll=function(){},r.prototype.handleWindowResize=function(){},r.prototype.handleNavigationClick=function(){this.adapter.notifyNavigationIconClicked()},r}(ee),Te=function(t){function i(e){var i=t.call(this,e)||this;return i.wasDocked_=!0,i.isDockedShowing_=!0,i.currentAppBarOffsetTop_=0,i.isCurrentlyBeingResized_=!1,i.resizeThrottleId_=0,i.resizeDebounceId_=0,i.lastScrollPosition_=i.adapter.getViewportScrollY(),i.topAppBarHeight_=i.adapter.getTopAppBarHeight(),i}return e(i,t),i.prototype.destroy=function(){t.prototype.destroy.call(this),this.adapter.setStyle("top","")},i.prototype.handleTargetScroll=function(){var t=Math.max(this.adapter.getViewportScrollY(),0),e=t-this.lastScrollPosition_;this.lastScrollPosition_=t,this.isCurrentlyBeingResized_||(this.currentAppBarOffsetTop_-=e,this.currentAppBarOffsetTop_>0?this.currentAppBarOffsetTop_=0:Math.abs(this.currentAppBarOffsetTop_)>this.topAppBarHeight_&&(this.currentAppBarOffsetTop_=-this.topAppBarHeight_),this.moveTopAppBar_())},i.prototype.handleWindowResize=function(){var t=this;this.resizeThrottleId_||(this.resizeThrottleId_=setTimeout((function(){t.resizeThrottleId_=0,t.throttledResizeHandler_()}),Se.DEBOUNCE_THROTTLE_RESIZE_TIME_MS)),this.isCurrentlyBeingResized_=!0,this.resizeDebounceId_&&clearTimeout(this.resizeDebounceId_),this.resizeDebounceId_=setTimeout((function(){t.handleTargetScroll(),t.isCurrentlyBeingResized_=!1,t.resizeDebounceId_=0}),Se.DEBOUNCE_THROTTLE_RESIZE_TIME_MS)},i.prototype.checkForUpdate_=function(){var t=-this.topAppBarHeight_,e=this.currentAppBarOffsetTop_<0,i=this.currentAppBarOffsetTop_>t,r=e&&i;if(r)this.wasDocked_=!1;else{if(!this.wasDocked_)return this.wasDocked_=!0,!0;if(this.isDockedShowing_!==i)return this.isDockedShowing_=i,!0}return r},i.prototype.moveTopAppBar_=function(){if(this.checkForUpdate_()){var t=this.currentAppBarOffsetTop_;Math.abs(t)>=this.topAppBarHeight_&&(t=-Se.MAX_TOP_APP_BAR_HEIGHT),this.adapter.setStyle("top",t+"px")}},i.prototype.throttledResizeHandler_=function(){var t=this.adapter.getTopAppBarHeight();this.topAppBarHeight_!==t&&(this.wasDocked_=!1,this.currentAppBarOffsetTop_-=this.topAppBarHeight_-t,this.topAppBarHeight_=t),this.handleTargetScroll()},i}(Ae);const Ie=ce?{passive:!0}:void 0;class Ce extends pe{constructor(){super(...arguments),this.mdcFoundationClass=Ae,this.centerTitle=!1,this.handleTargetScroll=()=>{this.mdcFoundation.handleTargetScroll()},this.handleNavigationClick=()=>{this.mdcFoundation.handleNavigationClick()}}get scrollTarget(){return this._scrollTarget||window}set scrollTarget(t){this.unregisterScrollListener();const e=this.scrollTarget;this._scrollTarget=t,this.updateRootPosition(),this.requestUpdate("scrollTarget",e),this.registerScrollListener()}updateRootPosition(){if(this.mdcRoot){const t=this.scrollTarget===window;this.mdcRoot.style.position=t?"":"absolute"}}render(){let t=Z`<span class="mdc-top-app-bar__title"><slot name="title"></slot></span>`;return this.centerTitle&&(t=Z`<section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-center">${t}</section>`),Z`
      <header class="mdc-top-app-bar ${be(this.barClasses())}">
      <div class="mdc-top-app-bar__row">
        <section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-start" id="navigation">
          <slot name="navigationIcon"
            @click=${this.handleNavigationClick}></slot>
          ${this.centerTitle?null:t}
        </section>
        ${this.centerTitle?t:null}
        <section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-end" id="actions" role="toolbar">
          <slot name="actionItems"></slot>
        </section>
      </div>
    </header>
    <div class="${be(this.contentClasses())}">
      <slot></slot>
    </div>
    `}createAdapter(){return Object.assign(Object.assign({},se(this.mdcRoot)),{setStyle:(t,e)=>this.mdcRoot.style.setProperty(t,e),getTopAppBarHeight:()=>this.mdcRoot.clientHeight,notifyNavigationIconClicked:()=>{this.dispatchEvent(new Event(Ee.NAVIGATION_EVENT,{bubbles:!0,cancelable:!0}))},getViewportScrollY:()=>this.scrollTarget instanceof Window?this.scrollTarget.pageYOffset:this.scrollTarget.scrollTop,getTotalActionItems:()=>this._actionItemsSlot.assignedNodes({flatten:!0}).length})}registerListeners(){this.registerScrollListener()}unregisterListeners(){this.unregisterScrollListener()}registerScrollListener(){this.scrollTarget.addEventListener("scroll",this.handleTargetScroll,Ie)}unregisterScrollListener(){this.scrollTarget.removeEventListener("scroll",this.handleTargetScroll)}firstUpdated(){super.firstUpdated(),this.updateRootPosition(),this.registerListeners()}disconnectedCallback(){super.disconnectedCallback(),this.unregisterListeners()}}r([wt(".mdc-top-app-bar")],Ce.prototype,"mdcRoot",void 0),r([wt('slot[name="actionItems"]')],Ce.prototype,"_actionItemsSlot",void 0),r([yt({type:Boolean})],Ce.prototype,"centerTitle",void 0),r([yt()],Ce.prototype,"scrollTarget",null);class Re extends Ce{constructor(){super(...arguments),this.mdcFoundationClass=Te,this.prominent=!1,this.dense=!1,this.handleResize=()=>{this.mdcFoundation.handleWindowResize()}}barClasses(){return{"mdc-top-app-bar--dense":this.dense,"mdc-top-app-bar--prominent":this.prominent,"center-title":this.centerTitle}}contentClasses(){return{"mdc-top-app-bar--fixed-adjust":!this.dense&&!this.prominent,"mdc-top-app-bar--dense-fixed-adjust":this.dense&&!this.prominent,"mdc-top-app-bar--prominent-fixed-adjust":!this.dense&&this.prominent,"mdc-top-app-bar--dense-prominent-fixed-adjust":this.dense&&this.prominent}}registerListeners(){super.registerListeners(),window.addEventListener("resize",this.handleResize,Ie)}unregisterListeners(){super.unregisterListeners(),window.removeEventListener("resize",this.handleResize)}}r([yt({type:Boolean,reflect:!0})],Re.prototype,"prominent",void 0),r([yt({type:Boolean,reflect:!0})],Re.prototype,"dense",void 0);
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var Oe=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e.wasScrolled_=!1,e}return e(i,t),i.prototype.handleTargetScroll=function(){this.adapter.getViewportScrollY()<=0?this.wasScrolled_&&(this.adapter.removeClass(ke.FIXED_SCROLLED_CLASS),this.wasScrolled_=!1):this.wasScrolled_||(this.adapter.addClass(ke.FIXED_SCROLLED_CLASS),this.wasScrolled_=!0)},i}(Te);
/**
@license
Copyright 2019 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/class Le extends Re{constructor(){super(...arguments),this.mdcFoundationClass=Oe}barClasses(){return Object.assign(Object.assign({},super.barClasses()),{"mdc-top-app-bar--fixed":!0})}registerListeners(){this.scrollTarget.addEventListener("scroll",this.handleTargetScroll,Ie)}unregisterListeners(){this.scrollTarget.removeEventListener("scroll",this.handleTargetScroll)}}let Pe=class extends Le{static get styles(){return[xe,Me,Ct`
        .mdc-top-app-bar {
          width: calc(100% - var(--mdc-drawer-width, 256px));
        }
        .mdc-top-app-bar__title {
          padding-left:0;
        }
        .mdc-top-app-bar--prominent .mdc-top-app-bar__row {
          height: 96px;
        }
        .mdc-top-app-bar--prominent-fixed-adjust {
          padding-top: 96px;
        }
      `]}};Pe=r([bt("mwc-top-app-bar-fixed")],Pe);
/**
@license
Copyright 2018 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
const Be=Ct`:host{font-family:var(--mdc-icon-font, "Material Icons");font-weight:normal;font-style:normal;font-size:var(--mdc-icon-size, 24px);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga"}`;let Ne=class extends Ot{render(){return Z`<slot></slot>`}};Ne.styles=Be,Ne=r([bt("mwc-icon")],Ne);
/**
 * @license
 * Copyright 2016 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var $e,ze={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},je={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},Fe={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300};function De(t,e){void 0===e&&(e=!1);var i,r=t.CSS;if("boolean"==typeof $e&&!e)return $e;if(!(r&&"function"==typeof r.supports))return!1;var n=r.supports("--css-vars","yes"),o=r.supports("(--css-vars: yes)")&&r.supports("color","#00000000");return i=n||o,e||($e=i),i}
/**
 * @license
 * Copyright 2016 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var qe=["touchstart","pointerdown","mousedown","keydown"],Ue=["touchend","pointerup","mouseup","contextmenu"],He=[],Ve=function(t){function r(e){var n=t.call(this,i(i({},r.defaultAdapter),e))||this;return n.activationAnimationHasEnded_=!1,n.activationTimer_=0,n.fgDeactivationRemovalTimer_=0,n.fgScale_="0",n.frame_={width:0,height:0},n.initialSize_=0,n.layoutFrame_=0,n.maxRadius_=0,n.unboundedCoords_={left:0,top:0},n.activationState_=n.defaultActivationState_(),n.activationTimerCallback_=function(){n.activationAnimationHasEnded_=!0,n.runDeactivationUXLogicIfReady_()},n.activateHandler_=function(t){return n.activate_(t)},n.deactivateHandler_=function(){return n.deactivate_()},n.focusHandler_=function(){return n.handleFocus()},n.blurHandler_=function(){return n.handleBlur()},n.resizeHandler_=function(){return n.layout()},n}return e(r,t),Object.defineProperty(r,"cssClasses",{get:function(){return ze},enumerable:!0,configurable:!0}),Object.defineProperty(r,"strings",{get:function(){return je},enumerable:!0,configurable:!0}),Object.defineProperty(r,"numbers",{get:function(){return Fe},enumerable:!0,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!0,configurable:!0}),r.prototype.init=function(){var t=this,e=this.supportsPressRipple_();if(this.registerRootHandlers_(e),e){var i=r.cssClasses,n=i.ROOT,o=i.UNBOUNDED;requestAnimationFrame((function(){t.adapter.addClass(n),t.adapter.isUnbounded()&&(t.adapter.addClass(o),t.layoutInternal_())}))}},r.prototype.destroy=function(){var t=this;if(this.supportsPressRipple_()){this.activationTimer_&&(clearTimeout(this.activationTimer_),this.activationTimer_=0,this.adapter.removeClass(r.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer_&&(clearTimeout(this.fgDeactivationRemovalTimer_),this.fgDeactivationRemovalTimer_=0,this.adapter.removeClass(r.cssClasses.FG_DEACTIVATION));var e=r.cssClasses,i=e.ROOT,n=e.UNBOUNDED;requestAnimationFrame((function(){t.adapter.removeClass(i),t.adapter.removeClass(n),t.removeCssVars_()}))}this.deregisterRootHandlers_(),this.deregisterDeactivationHandlers_()},r.prototype.activate=function(t){this.activate_(t)},r.prototype.deactivate=function(){this.deactivate_()},r.prototype.layout=function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame((function(){t.layoutInternal_(),t.layoutFrame_=0}))},r.prototype.setUnbounded=function(t){var e=r.cssClasses.UNBOUNDED;t?this.adapter.addClass(e):this.adapter.removeClass(e)},r.prototype.handleFocus=function(){var t=this;requestAnimationFrame((function(){return t.adapter.addClass(r.cssClasses.BG_FOCUSED)}))},r.prototype.handleBlur=function(){var t=this;requestAnimationFrame((function(){return t.adapter.removeClass(r.cssClasses.BG_FOCUSED)}))},r.prototype.supportsPressRipple_=function(){return this.adapter.browserSupportsCssVars()},r.prototype.defaultActivationState_=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},r.prototype.registerRootHandlers_=function(t){var e=this;t&&(qe.forEach((function(t){e.adapter.registerInteractionHandler(t,e.activateHandler_)})),this.adapter.isUnbounded()&&this.adapter.registerResizeHandler(this.resizeHandler_)),this.adapter.registerInteractionHandler("focus",this.focusHandler_),this.adapter.registerInteractionHandler("blur",this.blurHandler_)},r.prototype.registerDeactivationHandlers_=function(t){var e=this;"keydown"===t.type?this.adapter.registerInteractionHandler("keyup",this.deactivateHandler_):Ue.forEach((function(t){e.adapter.registerDocumentInteractionHandler(t,e.deactivateHandler_)}))},r.prototype.deregisterRootHandlers_=function(){var t=this;qe.forEach((function(e){t.adapter.deregisterInteractionHandler(e,t.activateHandler_)})),this.adapter.deregisterInteractionHandler("focus",this.focusHandler_),this.adapter.deregisterInteractionHandler("blur",this.blurHandler_),this.adapter.isUnbounded()&&this.adapter.deregisterResizeHandler(this.resizeHandler_)},r.prototype.deregisterDeactivationHandlers_=function(){var t=this;this.adapter.deregisterInteractionHandler("keyup",this.deactivateHandler_),Ue.forEach((function(e){t.adapter.deregisterDocumentInteractionHandler(e,t.deactivateHandler_)}))},r.prototype.removeCssVars_=function(){var t=this,e=r.strings;Object.keys(e).forEach((function(i){0===i.indexOf("VAR_")&&t.adapter.updateCssVariable(e[i],null)}))},r.prototype.activate_=function(t){var e=this;if(!this.adapter.isSurfaceDisabled()){var i=this.activationState_;if(!i.isActivated){var r=this.previousActivationEvent_;if(!(r&&void 0!==t&&r.type!==t.type))i.isActivated=!0,i.isProgrammatic=void 0===t,i.activationEvent=t,i.wasActivatedByPointer=!i.isProgrammatic&&(void 0!==t&&("mousedown"===t.type||"touchstart"===t.type||"pointerdown"===t.type)),void 0!==t&&He.length>0&&He.some((function(t){return e.adapter.containsEventTarget(t)}))?this.resetActivationState_():(void 0!==t&&(He.push(t.target),this.registerDeactivationHandlers_(t)),i.wasElementMadeActive=this.checkElementMadeActive_(t),i.wasElementMadeActive&&this.animateActivation_(),requestAnimationFrame((function(){He=[],i.wasElementMadeActive||void 0===t||" "!==t.key&&32!==t.keyCode||(i.wasElementMadeActive=e.checkElementMadeActive_(t),i.wasElementMadeActive&&e.animateActivation_()),i.wasElementMadeActive||(e.activationState_=e.defaultActivationState_())})))}}},r.prototype.checkElementMadeActive_=function(t){return void 0===t||"keydown"!==t.type||this.adapter.isSurfaceActive()},r.prototype.animateActivation_=function(){var t=this,e=r.strings,i=e.VAR_FG_TRANSLATE_START,n=e.VAR_FG_TRANSLATE_END,o=r.cssClasses,s=o.FG_DEACTIVATION,a=o.FG_ACTIVATION,l=r.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal_();var d="",c="";if(!this.adapter.isUnbounded()){var h=this.getFgTranslationCoordinates_(),u=h.startPoint,p=h.endPoint;d=u.x+"px, "+u.y+"px",c=p.x+"px, "+p.y+"px"}this.adapter.updateCssVariable(i,d),this.adapter.updateCssVariable(n,c),clearTimeout(this.activationTimer_),clearTimeout(this.fgDeactivationRemovalTimer_),this.rmBoundedActivationClasses_(),this.adapter.removeClass(s),this.adapter.computeBoundingRect(),this.adapter.addClass(a),this.activationTimer_=setTimeout((function(){return t.activationTimerCallback_()}),l)},r.prototype.getFgTranslationCoordinates_=function(){var t,e=this.activationState_,i=e.activationEvent;return{startPoint:t={x:(t=e.wasActivatedByPointer?function(t,e,i){if(!t)return{x:0,y:0};var r,n,o=e.x,s=e.y,a=o+i.left,l=s+i.top;if("touchstart"===t.type){var d=t;r=d.changedTouches[0].pageX-a,n=d.changedTouches[0].pageY-l}else{var c=t;r=c.pageX-a,n=c.pageY-l}return{x:r,y:n}}(i,this.adapter.getWindowPageOffset(),this.adapter.computeBoundingRect()):{x:this.frame_.width/2,y:this.frame_.height/2}).x-this.initialSize_/2,y:t.y-this.initialSize_/2},endPoint:{x:this.frame_.width/2-this.initialSize_/2,y:this.frame_.height/2-this.initialSize_/2}}},r.prototype.runDeactivationUXLogicIfReady_=function(){var t=this,e=r.cssClasses.FG_DEACTIVATION,i=this.activationState_,n=i.hasDeactivationUXRun,o=i.isActivated;(n||!o)&&this.activationAnimationHasEnded_&&(this.rmBoundedActivationClasses_(),this.adapter.addClass(e),this.fgDeactivationRemovalTimer_=setTimeout((function(){t.adapter.removeClass(e)}),Fe.FG_DEACTIVATION_MS))},r.prototype.rmBoundedActivationClasses_=function(){var t=r.cssClasses.FG_ACTIVATION;this.adapter.removeClass(t),this.activationAnimationHasEnded_=!1,this.adapter.computeBoundingRect()},r.prototype.resetActivationState_=function(){var t=this;this.previousActivationEvent_=this.activationState_.activationEvent,this.activationState_=this.defaultActivationState_(),setTimeout((function(){return t.previousActivationEvent_=void 0}),r.numbers.TAP_DELAY_MS)},r.prototype.deactivate_=function(){var t=this,e=this.activationState_;if(e.isActivated){var r=i({},e);e.isProgrammatic?(requestAnimationFrame((function(){return t.animateDeactivation_(r)})),this.resetActivationState_()):(this.deregisterDeactivationHandlers_(),requestAnimationFrame((function(){t.activationState_.hasDeactivationUXRun=!0,t.animateDeactivation_(r),t.resetActivationState_()})))}},r.prototype.animateDeactivation_=function(t){var e=t.wasActivatedByPointer,i=t.wasElementMadeActive;(e||i)&&this.runDeactivationUXLogicIfReady_()},r.prototype.layoutInternal_=function(){var t=this;this.frame_=this.adapter.computeBoundingRect();var e=Math.max(this.frame_.height,this.frame_.width);this.maxRadius_=this.adapter.isUnbounded()?e:Math.sqrt(Math.pow(t.frame_.width,2)+Math.pow(t.frame_.height,2))+r.numbers.PADDING;var i=Math.floor(e*r.numbers.INITIAL_ORIGIN_SCALE);this.adapter.isUnbounded()&&i%2!=0?this.initialSize_=i-1:this.initialSize_=i,this.fgScale_=""+this.maxRadius_/this.initialSize_,this.updateLayoutCssVars_()},r.prototype.updateLayoutCssVars_=function(){var t=r.strings,e=t.VAR_FG_SIZE,i=t.VAR_LEFT,n=t.VAR_TOP,o=t.VAR_FG_SCALE;this.adapter.updateCssVariable(e,this.initialSize_+"px"),this.adapter.updateCssVariable(o,this.fgScale_),this.adapter.isUnbounded()&&(this.unboundedCoords_={left:Math.round(this.frame_.width/2-this.initialSize_/2),top:Math.round(this.frame_.height/2-this.initialSize_/2)},this.adapter.updateCssVariable(i,this.unboundedCoords_.left+"px"),this.adapter.updateCssVariable(n,this.unboundedCoords_.top+"px"))},r}(ee);
/**
 * @license
 * Copyright (c) 2018 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 We=new WeakMap,Ge=m((t=>e=>{if(!(e instanceof $)||e instanceof D||"style"!==e.committer.name||e.committer.parts.length>1)throw new Error("The `styleMap` directive must be used in the style attribute and must be the only part in the attribute.");const{committer:i}=e,{style:r}=i.element;let n=We.get(e);void 0===n&&(r.cssText=i.strings.join(" "),We.set(e,n=new Set)),n.forEach((e=>{e in t||(n.delete(e),-1===e.indexOf("-")?r[e]=null:r.removeProperty(e))}));for(const e in t)n.add(e),-1===e.indexOf("-")?r[e]=t[e]:r.setProperty(e,t[e])}));class Ke extends pe{constructor(){super(...arguments),this.primary=!1,this.accent=!1,this.unbounded=!1,this.disabled=!1,this.activated=!1,this.selected=!1,this.hovering=!1,this.bgFocused=!1,this.fgActivation=!1,this.fgDeactivation=!1,this.fgScale="",this.fgSize="",this.translateStart="",this.translateEnd="",this.leftPos="",this.topPos="",this.mdcFoundationClass=Ve}get isActive(){return(this.parentElement||this).matches(":active")}createAdapter(){return{browserSupportsCssVars:()=>!0,isUnbounded:()=>this.unbounded,isSurfaceActive:()=>this.isActive,isSurfaceDisabled:()=>this.disabled,addClass:t=>{switch(t){case"mdc-ripple-upgraded--background-focused":this.bgFocused=!0;break;case"mdc-ripple-upgraded--foreground-activation":this.fgActivation=!0;break;case"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation=!0}},removeClass:t=>{switch(t){case"mdc-ripple-upgraded--background-focused":this.bgFocused=!1;break;case"mdc-ripple-upgraded--foreground-activation":this.fgActivation=!1;break;case"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation=!1}},containsEventTarget:()=>!0,registerInteractionHandler:()=>{},deregisterInteractionHandler:()=>{},registerDocumentInteractionHandler:()=>{},deregisterDocumentInteractionHandler:()=>{},registerResizeHandler:()=>{},deregisterResizeHandler:()=>{},updateCssVariable:(t,e)=>{switch(t){case"--mdc-ripple-fg-scale":this.fgScale=e;break;case"--mdc-ripple-fg-size":this.fgSize=e;break;case"--mdc-ripple-fg-translate-end":this.translateEnd=e;break;case"--mdc-ripple-fg-translate-start":this.translateStart=e;break;case"--mdc-ripple-left":this.leftPos=e;break;case"--mdc-ripple-top":this.topPos=e}},computeBoundingRect:()=>(this.parentElement||this).getBoundingClientRect(),getWindowPageOffset:()=>({x:window.pageXOffset,y:window.pageYOffset})}}startPress(t){this.waitForFoundation((()=>{this.mdcFoundation.activate(t)}))}endPress(){this.waitForFoundation((()=>{this.mdcFoundation.deactivate()}))}startFocus(){this.waitForFoundation((()=>{this.mdcFoundation.handleFocus()}))}endFocus(){this.waitForFoundation((()=>{this.mdcFoundation.handleBlur()}))}startHover(){this.hovering=!0}endHover(){this.hovering=!1}waitForFoundation(t){this.mdcFoundation?t():this.updateComplete.then(t)}render(){const t={"mdc-ripple-upgraded--unbounded":this.unbounded,"mdc-ripple-upgraded--background-focused":this.bgFocused,"mdc-ripple-upgraded--foreground-activation":this.fgActivation,"mdc-ripple-upgraded--foreground-deactivation":this.fgDeactivation,hover:this.hovering,primary:this.primary,accent:this.accent,disabled:this.disabled,activated:this.activated,selected:this.selected};return Z`
        <div class="mdc-ripple-surface mdc-ripple-upgraded ${be(t)}"
          style="${Ge({"--mdc-ripple-fg-scale":this.fgScale,"--mdc-ripple-fg-size":this.fgSize,"--mdc-ripple-fg-translate-end":this.translateEnd,"--mdc-ripple-fg-translate-start":this.translateStart,"--mdc-ripple-left":this.leftPos,"--mdc-ripple-top":this.topPos})}"></div>`}}r([wt(".mdc-ripple-surface")],Ke.prototype,"mdcRoot",void 0),r([yt({type:Boolean})],Ke.prototype,"primary",void 0),r([yt({type:Boolean})],Ke.prototype,"accent",void 0),r([yt({type:Boolean})],Ke.prototype,"unbounded",void 0),r([yt({type:Boolean})],Ke.prototype,"disabled",void 0),r([yt({type:Boolean})],Ke.prototype,"activated",void 0),r([yt({type:Boolean})],Ke.prototype,"selected",void 0),r([_t()],Ke.prototype,"hovering",void 0),r([_t()],Ke.prototype,"bgFocused",void 0),r([_t()],Ke.prototype,"fgActivation",void 0),r([_t()],Ke.prototype,"fgDeactivation",void 0),r([_t()],Ke.prototype,"fgScale",void 0),r([_t()],Ke.prototype,"fgSize",void 0),r([_t()],Ke.prototype,"translateStart",void 0),r([_t()],Ke.prototype,"translateEnd",void 0),r([_t()],Ke.prototype,"leftPos",void 0),r([_t()],Ke.prototype,"topPos",void 0);
/**
@license
Copyright 2018 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
const Xe=Ct`:host{display:block;position:absolute;top:0;bottom:0;left:0;right:0;width:100%;height:100%;pointer-events:none}@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}:host .primary{--mdc-ripple-color: var(--mdc-theme-primary, #6200ee)}:host .accent{--mdc-ripple-color: var( --mdc-theme-secondary, #018786 )}:host .mdc-ripple-surface{top:0;bottom:0;left:0;right:0;width:100%;height:100%;pointer-events:none;--mdc-ripple-fg-size: 0;--mdc-ripple-left: 0;--mdc-ripple-top: 0;--mdc-ripple-fg-scale: 1;--mdc-ripple-fg-translate-end: 0;--mdc-ripple-fg-translate-start: 0;-webkit-tap-highlight-color:rgba(0,0,0,0);will-change:transform,opacity;position:relative;outline:none;overflow:hidden;--mdc-ripple-fg-opacity: var( --mdc-ripple-press-opacity, 0.12 )}:host .mdc-ripple-surface::before,:host .mdc-ripple-surface::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}:host .mdc-ripple-surface::before{transition:opacity 15ms linear,background-color 15ms linear;z-index:1}:host .mdc-ripple-surface.mdc-ripple-upgraded::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}:host .mdc-ripple-surface.mdc-ripple-upgraded::after{top:0;left:0;transform:scale(0);transform-origin:center center}:host .mdc-ripple-surface.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}:host .mdc-ripple-surface.mdc-ripple-upgraded--foreground-activation::after{animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}:host .mdc-ripple-surface.mdc-ripple-upgraded--foreground-deactivation::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}:host .mdc-ripple-surface::before,:host .mdc-ripple-surface::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}:host .mdc-ripple-surface.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}:host .mdc-ripple-surface.mdc-ripple-upgraded--unbounded{overflow:visible}:host .mdc-ripple-surface.mdc-ripple-upgraded--unbounded::before,:host .mdc-ripple-surface.mdc-ripple-upgraded--unbounded::after{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}:host .mdc-ripple-surface.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::before,:host .mdc-ripple-surface.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{top:var(--mdc-ripple-top, calc(50% - 50%));left:var(--mdc-ripple-left, calc(50% - 50%));width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}:host .mdc-ripple-surface.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}:host .mdc-ripple-surface.hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}:host .mdc-ripple-surface.mdc-ripple-upgraded--background-focused::before{opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}:host .mdc-ripple-surface::before,:host .mdc-ripple-surface::after{background-color:#000;background-color:var(--mdc-ripple-color, #000)}:host .mdc-ripple-surface.activated{--mdc-ripple-press-opacity: calc( var(--mdc-ripple-press-opacity, 0.12) + 0.12 )}:host .mdc-ripple-surface.activated::before{opacity:0.12;opacity:var(--mdc-ripple-activated-opacity, 0.12)}:host .mdc-ripple-surface.activated.hover::before{opacity:.16;opacity:calc( var(--mdc-ripple-hover-opacity, 0.04) + var(--mdc-ripple-activated-opacity, 0.12) )}:host .mdc-ripple-surface.activated.mdc-ripple-upgraded--background-focused::before{opacity:.24;opacity:calc( var(--mdc-ripple-focus-opacity, 0.12) + var(--mdc-ripple-activated-opacity, 0.12) )}:host .mdc-ripple-surface.selected{--mdc-ripple-press-opacity: calc( var(--mdc-ripple-press-opacity, 0.12) + 0.08 )}:host .mdc-ripple-surface.selected::before{opacity:0.08;opacity:var(--mdc-ripple-selected-opacity, 0.08)}:host .mdc-ripple-surface.selected.hover::before{opacity:.12;opacity:calc( var(--mdc-ripple-hover-opacity, 0.04) + var(--mdc-ripple-selected-opacity, 0.08) )}:host .mdc-ripple-surface.selected.mdc-ripple-upgraded--background-focused::before{opacity:.2;opacity:calc( var(--mdc-ripple-focus-opacity, 0.12) + var(--mdc-ripple-selected-opacity, 0.08) )}:host .mdc-ripple-surface.disabled{--mdc-ripple-color: transparent}:host .mdc-ripple-surface::before{z-index:1;z-index:var(--m-ripple-z-index, 1)}:host .mdc-ripple-surface::after{z-index:0;z-index:var(--m-ripple-z-index, 0)}`;let Ze=class extends Ke{};Ze.styles=Xe,Ze=r([bt("mwc-ripple")],Ze);
/**
@license
Copyright 2020 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
class Ye{constructor(t){this.startPress=e=>{t().then((t=>{t&&t.startPress(e)}))},this.endPress=()=>{t().then((t=>{t&&t.endPress()}))},this.startFocus=()=>{t().then((t=>{t&&t.startFocus()}))},this.endFocus=()=>{t().then((t=>{t&&t.endFocus()}))},this.startHover=()=>{t().then((t=>{t&&t.startHover()}))},this.endHover=()=>{t().then((t=>{t&&t.endHover()}))}}}class Je extends Ot{constructor(){super(...arguments),this.raised=!1,this.unelevated=!1,this.outlined=!1,this.dense=!1,this.disabled=!1,this.trailingIcon=!1,this.fullwidth=!1,this.icon="",this.label="",this.expandContent=!1,this.shouldRenderRipple=!1,this.rippleHandlers=new Ye((()=>(this.shouldRenderRipple=!0,this.ripple)))}renderRipple(){const t=this.raised||this.unelevated;return this.shouldRenderRipple?Z`<mwc-ripple .primary="${!t}" .disabled="${this.disabled}"></mwc-ripple>`:""}createRenderRoot(){return this.attachShadow({mode:"open",delegatesFocus:!0})}focus(){const t=this.buttonElement;t&&(this.rippleHandlers.startFocus(),t.focus())}blur(){const t=this.buttonElement;t&&(this.rippleHandlers.endFocus(),t.blur())}getRenderClasses(){return be({"mdc-button--raised":this.raised,"mdc-button--unelevated":this.unelevated,"mdc-button--outlined":this.outlined,"mdc-button--dense":this.dense})}render(){return Z`
      <button
          id="button"
          class="mdc-button ${this.getRenderClasses()}"
          ?disabled="${this.disabled}"
          aria-label="${this.label||this.icon}"
          @focus="${this.handleRippleFocus}"
          @blur="${this.handleRippleBlur}"
          @mousedown="${this.handleRippleActivate}"
          @mouseenter="${this.handleRippleMouseEnter}"
          @mouseleave="${this.handleRippleMouseLeave}"
          @touchstart="${this.handleRippleActivate}"
          @touchend="${this.handleRippleDeactivate}"
          @touchcancel="${this.handleRippleDeactivate}">
        ${this.renderRipple()}
        <span class="leading-icon">
          <slot name="icon">
            ${this.icon&&!this.trailingIcon?this.renderIcon():""}
          </slot>
        </span>
        <span class="mdc-button__label">${this.label}</span>
        <span class="slot-container ${be({flex:this.expandContent})}">
          <slot></slot>
        </span>
        <span class="trailing-icon">
          <slot name="trailingIcon">
            ${this.icon&&this.trailingIcon?this.renderIcon():""}
          </slot>
        </span>
      </button>`}renderIcon(){return Z`
    <mwc-icon class="mdc-button__icon">
      ${this.icon}
    </mwc-icon>`}handleRippleActivate(t){const e=()=>{window.removeEventListener("mouseup",e),this.handleRippleDeactivate()};window.addEventListener("mouseup",e),this.rippleHandlers.startPress(t)}handleRippleDeactivate(){this.rippleHandlers.endPress()}handleRippleMouseEnter(){this.rippleHandlers.startHover()}handleRippleMouseLeave(){this.rippleHandlers.endHover()}handleRippleFocus(){this.rippleHandlers.startFocus()}handleRippleBlur(){this.rippleHandlers.endFocus()}}r([yt({type:Boolean})],Je.prototype,"raised",void 0),r([yt({type:Boolean})],Je.prototype,"unelevated",void 0),r([yt({type:Boolean})],Je.prototype,"outlined",void 0),r([yt({type:Boolean})],Je.prototype,"dense",void 0),r([yt({type:Boolean,reflect:!0})],Je.prototype,"disabled",void 0),r([yt({type:Boolean,attribute:"trailingicon"})],Je.prototype,"trailingIcon",void 0),r([yt({type:Boolean,reflect:!0})],Je.prototype,"fullwidth",void 0),r([yt({type:String})],Je.prototype,"icon",void 0),r([yt({type:String})],Je.prototype,"label",void 0),r([yt({type:Boolean})],Je.prototype,"expandContent",void 0),r([wt("#button")],Je.prototype,"buttonElement",void 0),r([xt("mwc-ripple")],Je.prototype,"ripple",void 0),r([_t()],Je.prototype,"shouldRenderRipple",void 0),r([St({passive:!0})],Je.prototype,"handleRippleActivate",null);
/**
@license
Copyright 2018 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
const Qe=Ct`.mdc-touch-target-wrapper{display:inline}.mdc-elevation-overlay{position:absolute;border-radius:inherit;pointer-events:none;opacity:0;opacity:var(--mdc-elevation-overlay-opacity, 0);transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1);background-color:#fff;background-color:var(--mdc-elevation-overlay-color, #fff)}.mdc-button{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-button-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.875rem;font-size:var(--mdc-typography-button-font-size, 0.875rem);line-height:2.25rem;line-height:var(--mdc-typography-button-line-height, 2.25rem);font-weight:500;font-weight:var(--mdc-typography-button-font-weight, 500);letter-spacing:0.0892857143em;letter-spacing:var(--mdc-typography-button-letter-spacing, 0.0892857143em);text-decoration:none;text-decoration:var(--mdc-typography-button-text-decoration, none);text-transform:uppercase;text-transform:var(--mdc-typography-button-text-transform, uppercase);padding:0 8px 0 8px;position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:64px;border:none;outline:none;line-height:inherit;user-select:none;-webkit-appearance:none;overflow:visible;vertical-align:middle;border-radius:4px;border-radius:var(--mdc-shape-small, 4px);height:36px}.mdc-button .mdc-elevation-overlay{width:100%;height:100%;top:0;left:0}.mdc-button::-moz-focus-inner{padding:0;border:0}.mdc-button:active{outline:none}.mdc-button:hover{cursor:pointer}.mdc-button:disabled{cursor:default;pointer-events:none}.mdc-button .mdc-button__ripple{border-radius:4px;border-radius:var(--mdc-shape-small, 4px)}.mdc-button:not(:disabled){background-color:transparent}.mdc-button:disabled{background-color:transparent}.mdc-button .mdc-button__icon{margin-left:0;margin-right:8px;display:inline-block;width:18px;height:18px;font-size:18px;vertical-align:top}[dir=rtl] .mdc-button .mdc-button__icon,.mdc-button .mdc-button__icon[dir=rtl]{margin-left:8px;margin-right:0}.mdc-button .mdc-button__touch{position:absolute;top:50%;right:0;height:48px;left:0;transform:translateY(-50%)}.mdc-button:not(:disabled){color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}.mdc-button:disabled{color:rgba(0, 0, 0, 0.38)}.mdc-button__label+.mdc-button__icon{margin-left:8px;margin-right:0}[dir=rtl] .mdc-button__label+.mdc-button__icon,.mdc-button__label+.mdc-button__icon[dir=rtl]{margin-left:0;margin-right:8px}svg.mdc-button__icon{fill:currentColor}.mdc-button--raised .mdc-button__icon,.mdc-button--unelevated .mdc-button__icon,.mdc-button--outlined .mdc-button__icon{margin-left:-4px;margin-right:8px}[dir=rtl] .mdc-button--raised .mdc-button__icon,.mdc-button--raised .mdc-button__icon[dir=rtl],[dir=rtl] .mdc-button--unelevated .mdc-button__icon,.mdc-button--unelevated .mdc-button__icon[dir=rtl],[dir=rtl] .mdc-button--outlined .mdc-button__icon,.mdc-button--outlined .mdc-button__icon[dir=rtl]{margin-left:8px;margin-right:-4px}.mdc-button--raised .mdc-button__label+.mdc-button__icon,.mdc-button--unelevated .mdc-button__label+.mdc-button__icon,.mdc-button--outlined .mdc-button__label+.mdc-button__icon{margin-left:8px;margin-right:-4px}[dir=rtl] .mdc-button--raised .mdc-button__label+.mdc-button__icon,.mdc-button--raised .mdc-button__label+.mdc-button__icon[dir=rtl],[dir=rtl] .mdc-button--unelevated .mdc-button__label+.mdc-button__icon,.mdc-button--unelevated .mdc-button__label+.mdc-button__icon[dir=rtl],[dir=rtl] .mdc-button--outlined .mdc-button__label+.mdc-button__icon,.mdc-button--outlined .mdc-button__label+.mdc-button__icon[dir=rtl]{margin-left:-4px;margin-right:8px}.mdc-button--raised,.mdc-button--unelevated{padding:0 16px 0 16px}.mdc-button--raised:not(:disabled),.mdc-button--unelevated:not(:disabled){background-color:#6200ee;background-color:var(--mdc-theme-primary, #6200ee)}.mdc-button--raised:not(:disabled),.mdc-button--unelevated:not(:disabled){color:#fff;color:var(--mdc-theme-on-primary, #fff)}.mdc-button--raised:disabled,.mdc-button--unelevated:disabled{background-color:rgba(0, 0, 0, 0.12)}.mdc-button--raised:disabled,.mdc-button--unelevated:disabled{color:rgba(0, 0, 0, 0.38)}.mdc-button--raised{box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2),0px 2px 2px 0px rgba(0, 0, 0, 0.14),0px 1px 5px 0px rgba(0,0,0,.12);transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-button--raised:hover,.mdc-button--raised:focus{box-shadow:0px 2px 4px -1px rgba(0, 0, 0, 0.2),0px 4px 5px 0px rgba(0, 0, 0, 0.14),0px 1px 10px 0px rgba(0,0,0,.12)}.mdc-button--raised:active{box-shadow:0px 5px 5px -3px rgba(0, 0, 0, 0.2),0px 8px 10px 1px rgba(0, 0, 0, 0.14),0px 3px 14px 2px rgba(0,0,0,.12)}.mdc-button--raised:disabled{box-shadow:0px 0px 0px 0px rgba(0, 0, 0, 0.2),0px 0px 0px 0px rgba(0, 0, 0, 0.14),0px 0px 0px 0px rgba(0,0,0,.12)}.mdc-button--outlined{padding:0 15px 0 15px;border-width:1px;border-style:solid}.mdc-button--outlined .mdc-button__ripple{top:-1px;left:-1px;border:1px solid transparent}.mdc-button--outlined .mdc-button__touch{left:-1px;width:calc(100% + 2 * 1px)}.mdc-button--outlined:not(:disabled){border-color:rgba(0, 0, 0, 0.12)}.mdc-button--outlined:disabled{border-color:rgba(0, 0, 0, 0.12)}.mdc-button--touch{margin-top:6px;margin-bottom:6px}:host{display:inline-flex;outline:none;vertical-align:top}:host([fullwidth]){width:100%}:host([raised]),:host([unelevated]){--mdc-ripple-color: #fff;--mdc-ripple-focus-opacity: 0.24;--mdc-ripple-hover-opacity: 0.08;--mdc-ripple-press-opacity: 0.24}.trailing-icon ::slotted(*),.trailing-icon .mdc-button__icon,.leading-icon ::slotted(*),.leading-icon .mdc-button__icon{margin-left:0;margin-right:8px;display:inline-block;width:18px;height:18px;font-size:18px;vertical-align:top}[dir=rtl] .trailing-icon ::slotted(*),.trailing-icon ::slotted(*)[dir=rtl],[dir=rtl] .trailing-icon .mdc-button__icon,.trailing-icon .mdc-button__icon[dir=rtl],[dir=rtl] .leading-icon ::slotted(*),.leading-icon ::slotted(*)[dir=rtl],[dir=rtl] .leading-icon .mdc-button__icon,.leading-icon .mdc-button__icon[dir=rtl]{margin-left:8px;margin-right:0}.trailing-icon ::slotted(*),.trailing-icon .mdc-button__icon{margin-left:8px;margin-right:0}[dir=rtl] .trailing-icon ::slotted(*),.trailing-icon ::slotted(*)[dir=rtl],[dir=rtl] .trailing-icon .mdc-button__icon,.trailing-icon .mdc-button__icon[dir=rtl]{margin-left:0;margin-right:8px}.slot-container{display:inline-flex;align-items:center;justify-content:center}.slot-container.flex{flex:auto}.mdc-button{flex:auto;overflow:hidden;padding-left:8px;padding-left:var(--mdc-button-horizontal-padding, 8px);padding-right:8px;padding-right:var(--mdc-button-horizontal-padding, 8px)}.mdc-button--raised{box-shadow:0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);box-shadow:var(--mdc-button-raised-box-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12))}.mdc-button--raised:hover,.mdc-button--raised:focus{box-shadow:0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12);box-shadow:var(--mdc-button-raised-box-shadow-hover, 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12))}.mdc-button--raised:active{box-shadow:0px 5px 5px -3px rgba(0, 0, 0, 0.2), 0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12);box-shadow:var(--mdc-button-raised-box-shadow-active, 0px 5px 5px -3px rgba(0, 0, 0, 0.2), 0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12))}.mdc-button--raised:disabled{box-shadow:0px 0px 0px 0px rgba(0, 0, 0, 0.2), 0px 0px 0px 0px rgba(0, 0, 0, 0.14), 0px 0px 0px 0px rgba(0, 0, 0, 0.12);box-shadow:var(--mdc-button-raised-box-shadow-disabled, 0px 0px 0px 0px rgba(0, 0, 0, 0.2), 0px 0px 0px 0px rgba(0, 0, 0, 0.14), 0px 0px 0px 0px rgba(0, 0, 0, 0.12))}.mdc-button--raised,.mdc-button--unelevated{padding-left:16px;padding-left:var(--mdc-button-horizontal-padding, 16px);padding-right:16px;padding-right:var(--mdc-button-horizontal-padding, 16px)}.mdc-button--outlined{border-width:1px;border-width:var(--mdc-button-outline-width, 1px);padding-left:calc(16px - 1px);padding-left:calc(var(--mdc-button-horizontal-padding, 16px) - var(--mdc-button-outline-width, 1px));padding-right:calc(16px - 1px);padding-right:calc(var(--mdc-button-horizontal-padding, 16px) - var(--mdc-button-outline-width, 1px))}.mdc-button--outlined:not(:disabled){border-color:rgba(0, 0, 0, 0.12);border-color:var(--mdc-button-outline-color, rgba(0, 0, 0, 0.12))}.mdc-button--outlined mwc-ripple{top:calc(-1 * 1px);top:calc(-1 * var(--mdc-button-outline-width, 1px));left:calc(-1 * 1px);left:calc(-1 * var(--mdc-button-outline-width, 1px));right:initial;border-width:1px;border-width:var(--mdc-button-outline-width, 1px);border-style:solid;border-color:transparent}[dir=rtl] .mdc-button--outlined mwc-ripple,.mdc-button--outlined mwc-ripple[dir=rtl]{left:initial;right:calc(-1 * 1px);right:calc(-1 * var(--mdc-button-outline-width, 1px))}.mdc-button--dense{height:28px;margin-top:0;margin-bottom:0}.mdc-button--dense .mdc-button__touch{display:none}:host([disabled]){pointer-events:none}:host([disabled]) .mdc-button{color:rgba(0, 0, 0, 0.38);color:var(--mdc-button-disabled-ink-color, rgba(0, 0, 0, 0.38))}:host([disabled]) .mdc-button--raised,:host([disabled]) .mdc-button--unelevated{background-color:rgba(0, 0, 0, 0.12);background-color:var(--mdc-button-disabled-fill-color, rgba(0, 0, 0, 0.12))}:host([disabled]) .mdc-button--outlined{border-color:rgba(0, 0, 0, 0.12);border-color:var(--mdc-button-disabled-outline-color, rgba(0, 0, 0, 0.12))}`;let ti=class extends Je{};ti.styles=Qe,ti=r([bt("mwc-button")],ti);class ei extends Ot{constructor(){super(...arguments),this.disabled=!1,this.icon="",this.label="",this.shouldRenderRipple=!1,this.rippleHandlers=new Ye((()=>(this.shouldRenderRipple=!0,this.ripple)))}renderRipple(){return this.shouldRenderRipple?Z`
            <mwc-ripple
                .disabled="${this.disabled}"
                unbounded>
            </mwc-ripple>`:""}focus(){const t=this.buttonElement;t&&(this.rippleHandlers.startFocus(),t.focus())}blur(){const t=this.buttonElement;t&&(this.rippleHandlers.endFocus(),t.blur())}render(){return Z`<button
        class="mdc-icon-button"
        aria-label="${this.label||this.icon}"
        ?disabled="${this.disabled}"
        @focus="${this.handleRippleFocus}"
        @blur="${this.handleRippleBlur}"
        @mousedown="${this.handleRippleMouseDown}"
        @mouseenter="${this.handleRippleMouseEnter}"
        @mouseleave="${this.handleRippleMouseLeave}"
        @touchstart="${this.handleRippleTouchStart}"
        @touchend="${this.handleRippleDeactivate}"
        @touchcancel="${this.handleRippleDeactivate}">
      ${this.renderRipple()}
    <i class="material-icons">${this.icon}</i>
    <span class="default-slot-container">
        <slot></slot>
    </span>
  </button>`}handleRippleMouseDown(t){const e=()=>{window.removeEventListener("mouseup",e),this.handleRippleDeactivate()};window.addEventListener("mouseup",e),this.rippleHandlers.startPress(t)}handleRippleTouchStart(t){this.rippleHandlers.startPress(t)}handleRippleDeactivate(){this.rippleHandlers.endPress()}handleRippleMouseEnter(){this.rippleHandlers.startHover()}handleRippleMouseLeave(){this.rippleHandlers.endHover()}handleRippleFocus(){this.rippleHandlers.startFocus()}handleRippleBlur(){this.rippleHandlers.endFocus()}}r([yt({type:Boolean,reflect:!0})],ei.prototype,"disabled",void 0),r([yt({type:String})],ei.prototype,"icon",void 0),r([yt({type:String})],ei.prototype,"label",void 0),r([wt("button")],ei.prototype,"buttonElement",void 0),r([xt("mwc-ripple")],ei.prototype,"ripple",void 0),r([_t()],ei.prototype,"shouldRenderRipple",void 0),r([St({passive:!0})],ei.prototype,"handleRippleMouseDown",null),r([St({passive:!0})],ei.prototype,"handleRippleTouchStart",null);
/**
@license
Copyright 2018 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
const ii=Ct`.material-icons{font-family:var(--mdc-icon-font, "Material Icons");font-weight:normal;font-style:normal;font-size:var(--mdc-icon-size, 24px);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga"}.mdc-icon-button{display:inline-block;position:relative;box-sizing:border-box;border:none;outline:none;background-color:transparent;fill:currentColor;color:inherit;font-size:24px;text-decoration:none;cursor:pointer;user-select:none;width:48px;height:48px;padding:12px}.mdc-icon-button svg,.mdc-icon-button img{width:24px;height:24px}.mdc-icon-button:disabled{color:rgba(0, 0, 0, 0.38);color:var(--mdc-theme-text-disabled-on-light, rgba(0, 0, 0, 0.38))}.mdc-icon-button:disabled{cursor:default;pointer-events:none}.mdc-icon-button__icon{display:inline-block}.mdc-icon-button__icon.mdc-icon-button__icon--on{display:none}.mdc-icon-button--on .mdc-icon-button__icon{display:none}.mdc-icon-button--on .mdc-icon-button__icon.mdc-icon-button__icon--on{display:inline-block}:host{display:inline-block;outline:none;--mdc-ripple-color: currentcolor}:host([disabled]){pointer-events:none}:host,.mdc-icon-button{vertical-align:top}.mdc-icon-button{width:var(--mdc-icon-button-size, 48px);height:var(--mdc-icon-button-size, 48px);padding:calc((var(--mdc-icon-button-size, 48px) - var(--mdc-icon-size, 24px)) / 2)}.mdc-icon-button>i{position:absolute;top:0;padding-top:inherit}.mdc-icon-button i,.mdc-icon-button svg,.mdc-icon-button img,.mdc-icon-button ::slotted(*){display:block;width:var(--mdc-icon-size, 24px);height:var(--mdc-icon-size, 24px)}`
/**
@license
Copyright 2018 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/;let ri=class extends ei{};ri.styles=ii,ri=r([bt("mwc-icon-button")],ri);
/**
 * @license
 * Copyright (c) 2018 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 ni=new WeakMap,oi=m((t=>e=>{const i=ni.get(e);if(void 0===t&&e instanceof $){if(void 0!==i||!ni.has(e)){const t=e.committer.name;e.committer.element.removeAttribute(t)}}else t!==i&&e.setValue(t);ni.set(e,t)}));
/**
 * @license
 * Copyright 2020 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var si="Unknown",li="Backspace",di="Enter",ci="Spacebar",hi="PageUp",ui="PageDown",pi="End",fi="Home",mi="ArrowLeft",gi="ArrowUp",bi="ArrowRight",vi="ArrowDown",yi="Delete",_i="Escape",wi=new Set;wi.add(li),wi.add(di),wi.add(ci),wi.add(hi),wi.add(ui),wi.add(pi),wi.add(fi),wi.add(mi),wi.add(gi),wi.add(bi),wi.add(vi),wi.add(yi),wi.add(_i);var xi=8,Mi=13,ki=32,Si=33,Ei=34,Ai=35,Ti=36,Ii=37,Ci=38,Ri=39,Oi=40,Li=46,Pi=27,Bi=new Map;Bi.set(xi,li),Bi.set(Mi,di),Bi.set(ki,ci),Bi.set(Si,hi),Bi.set(Ei,ui),Bi.set(Ai,pi),Bi.set(Ti,fi),Bi.set(Ii,mi),Bi.set(Ci,gi),Bi.set(Ri,bi),Bi.set(Oi,vi),Bi.set(Li,yi),Bi.set(Pi,_i);var Ni=new Set;function $i(t){var e=t.key;if(wi.has(e))return e;var i=Bi.get(t.keyCode);return i||si}
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */Ni.add(hi),Ni.add(ui),Ni.add(pi),Ni.add(fi),Ni.add(mi),Ni.add(gi),Ni.add(bi),Ni.add(vi);var zi="mdc-list-item",ji="mdc-list-item--disabled",Fi={ACTION_EVENT:"MDCList:action",ARIA_CHECKED:"aria-checked",ARIA_CHECKED_CHECKBOX_SELECTOR:'[role="checkbox"][aria-checked="true"]',ARIA_CHECKED_RADIO_SELECTOR:'[role="radio"][aria-checked="true"]',ARIA_CURRENT:"aria-current",ARIA_DISABLED:"aria-disabled",ARIA_ORIENTATION:"aria-orientation",ARIA_ORIENTATION_HORIZONTAL:"horizontal",ARIA_ROLE_CHECKBOX_SELECTOR:'[role="checkbox"]',ARIA_SELECTED:"aria-selected",CHECKBOX_RADIO_SELECTOR:'input[type="checkbox"], input[type="radio"]',CHECKBOX_SELECTOR:'input[type="checkbox"]',CHILD_ELEMENTS_TO_TOGGLE_TABINDEX:"\n    ."+zi+" button:not(:disabled),\n    ."+zi+" a\n  ",FOCUSABLE_CHILD_ELEMENTS:"\n    ."+zi+" button:not(:disabled),\n    ."+zi+" a,\n    ."+zi+' input[type="radio"]:not(:disabled),\n    .'+zi+' input[type="checkbox"]:not(:disabled)\n  ',RADIO_SELECTOR:'input[type="radio"]'},Di={UNSET_INDEX:-1,TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS:300};
/**
 @license
 Copyright 2020 Google Inc. All Rights Reserved.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 */
const qi=["input","button","textarea","select"];function Ui(t){return t instanceof Set}const Hi=t=>{const e=t===Di.UNSET_INDEX?new Set:t;return Ui(e)?new Set(e):new Set([e])};class Vi extends ee{constructor(t){super(Object.assign(Object.assign({},Vi.defaultAdapter),t)),this.isMulti_=!1,this.wrapFocus_=!1,this.isVertical_=!0,this.selectedIndex_=Di.UNSET_INDEX,this.focusedItemIndex_=Di.UNSET_INDEX,this.useActivatedClass_=!1,this.ariaCurrentAttrValue_=null}static get strings(){return Fi}static get numbers(){return Di}static get defaultAdapter(){return{focusItemAtIndex:()=>{},getFocusedElementIndex:()=>0,getListItemCount:()=>0,isFocusInsideList:()=>!1,isRootFocused:()=>!1,notifyAction:()=>{},notifySelected:()=>{},getSelectedStateForElementIndex:()=>!1,setDisabledStateForElementIndex:()=>{},getDisabledStateForElementIndex:()=>!1,setSelectedStateForElementIndex:()=>{},setActivatedStateForElementIndex:()=>{},setTabIndexForElementIndex:()=>{},setAttributeForElementIndex:()=>{},getAttributeForElementIndex:()=>null}}setWrapFocus(t){this.wrapFocus_=t}setMulti(t){this.isMulti_=t;const e=this.selectedIndex_;if(t){if(!Ui(e)){const t=e===Di.UNSET_INDEX;this.selectedIndex_=t?new Set:new Set([e])}}else if(Ui(e))if(e.size){const t=Array.from(e).sort();this.selectedIndex_=t[0]}else this.selectedIndex_=Di.UNSET_INDEX}setVerticalOrientation(t){this.isVertical_=t}setUseActivatedClass(t){this.useActivatedClass_=t}getSelectedIndex(){return this.selectedIndex_}setSelectedIndex(t){this.isIndexValid_(t)&&(this.isMulti_?this.setMultiSelectionAtIndex_(Hi(t)):this.setSingleSelectionAtIndex_(t))}handleFocusIn(t,e){e>=0&&this.adapter.setTabIndexForElementIndex(e,0)}handleFocusOut(t,e){e>=0&&this.adapter.setTabIndexForElementIndex(e,-1),setTimeout((()=>{this.adapter.isFocusInsideList()||this.setTabindexToFirstSelectedItem_()}),0)}handleKeydown(t,e,i){const r="ArrowLeft"===$i(t),n="ArrowUp"===$i(t),o="ArrowRight"===$i(t),s="ArrowDown"===$i(t),a="Home"===$i(t),l="End"===$i(t),d="Enter"===$i(t),c="Spacebar"===$i(t);if(this.adapter.isRootFocused())return void(n||l?(t.preventDefault(),this.focusLastElement()):(s||a)&&(t.preventDefault(),this.focusFirstElement()));let h,u=this.adapter.getFocusedElementIndex();if(!(-1===u&&(u=i,u<0))){if(this.isVertical_&&s||!this.isVertical_&&o)this.preventDefaultEvent(t),h=this.focusNextElement(u);else if(this.isVertical_&&n||!this.isVertical_&&r)this.preventDefaultEvent(t),h=this.focusPrevElement(u);else if(a)this.preventDefaultEvent(t),h=this.focusFirstElement();else if(l)this.preventDefaultEvent(t),h=this.focusLastElement();else if((d||c)&&e){const e=t.target;if(e&&"A"===e.tagName&&d)return;this.preventDefaultEvent(t),this.setSelectedIndexOnAction_(u,!0)}this.focusedItemIndex_=u,void 0!==h&&(this.setTabindexAtIndex_(h),this.focusedItemIndex_=h)}}handleSingleSelection(t,e,i){t!==Di.UNSET_INDEX&&(this.setSelectedIndexOnAction_(t,e,i),this.setTabindexAtIndex_(t),this.focusedItemIndex_=t)}focusNextElement(t){let e=t+1;if(e>=this.adapter.getListItemCount()){if(!this.wrapFocus_)return t;e=0}return this.adapter.focusItemAtIndex(e),e}focusPrevElement(t){let e=t-1;if(e<0){if(!this.wrapFocus_)return t;e=this.adapter.getListItemCount()-1}return this.adapter.focusItemAtIndex(e),e}focusFirstElement(){return this.adapter.focusItemAtIndex(0),0}focusLastElement(){const t=this.adapter.getListItemCount()-1;return this.adapter.focusItemAtIndex(t),t}setEnabled(t,e){this.isIndexValid_(t)&&this.adapter.setDisabledStateForElementIndex(t,!e)}preventDefaultEvent(t){const e=(""+t.target.tagName).toLowerCase();-1===qi.indexOf(e)&&t.preventDefault()}setSingleSelectionAtIndex_(t,e=!0){this.selectedIndex_!==t&&(this.selectedIndex_!==Di.UNSET_INDEX&&(this.adapter.setSelectedStateForElementIndex(this.selectedIndex_,!1),this.useActivatedClass_&&this.adapter.setActivatedStateForElementIndex(this.selectedIndex_,!1)),e&&this.adapter.setSelectedStateForElementIndex(t,!0),this.useActivatedClass_&&this.adapter.setActivatedStateForElementIndex(t,!0),this.setAriaForSingleSelectionAtIndex_(t),this.selectedIndex_=t,this.adapter.notifySelected(t))}setMultiSelectionAtIndex_(t,e=!0){const i=((t,e)=>{const i=Array.from(t),r=Array.from(e),n={added:[],removed:[]},o=i.sort(),s=r.sort();let a=0,l=0;for(;a<o.length||l<s.length;){const t=o[a],e=s[l];t!==e?void 0!==t&&(void 0===e||t<e)?(n.removed.push(t),a++):void 0!==e&&(void 0===t||e<t)&&(n.added.push(e),l++):(a++,l++)}return n})(Hi(this.selectedIndex_),t);if(i.removed.length||i.added.length){for(const t of i.removed)e&&this.adapter.setSelectedStateForElementIndex(t,!1),this.useActivatedClass_&&this.adapter.setActivatedStateForElementIndex(t,!1);for(const t of i.added)e&&this.adapter.setSelectedStateForElementIndex(t,!0),this.useActivatedClass_&&this.adapter.setActivatedStateForElementIndex(t,!0);this.selectedIndex_=t,this.adapter.notifySelected(t,i)}}setAriaForSingleSelectionAtIndex_(t){this.selectedIndex_===Di.UNSET_INDEX&&(this.ariaCurrentAttrValue_=this.adapter.getAttributeForElementIndex(t,Fi.ARIA_CURRENT));const e=null!==this.ariaCurrentAttrValue_,i=e?Fi.ARIA_CURRENT:Fi.ARIA_SELECTED;this.selectedIndex_!==Di.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex_,i,"false");const r=e?this.ariaCurrentAttrValue_:"true";this.adapter.setAttributeForElementIndex(t,i,r)}setTabindexAtIndex_(t){this.focusedItemIndex_===Di.UNSET_INDEX&&0!==t?this.adapter.setTabIndexForElementIndex(0,-1):this.focusedItemIndex_>=0&&this.focusedItemIndex_!==t&&this.adapter.setTabIndexForElementIndex(this.focusedItemIndex_,-1),this.adapter.setTabIndexForElementIndex(t,0)}setTabindexToFirstSelectedItem_(){let t=0;"number"==typeof this.selectedIndex_&&this.selectedIndex_!==Di.UNSET_INDEX?t=this.selectedIndex_:Ui(this.selectedIndex_)&&this.selectedIndex_.size>0&&(t=Math.min(...this.selectedIndex_)),this.setTabindexAtIndex_(t)}isIndexValid_(t){if(t instanceof Set){if(!this.isMulti_)throw new Error("MDCListFoundation: Array of index is only supported for checkbox based list");if(0===t.size)return!0;{let e=!1;for(const i of t)if(e=this.isIndexInRange_(i),e)break;return e}}if("number"==typeof t){if(this.isMulti_)throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+t);return t===Di.UNSET_INDEX||this.isIndexInRange_(t)}return!1}isIndexInRange_(t){const e=this.adapter.getListItemCount();return t>=0&&t<e}setSelectedIndexOnAction_(t,e,i){if(this.adapter.getDisabledStateForElementIndex(t))return;let r=t;if(this.isMulti_&&(r=new Set([t])),this.isIndexValid_(r)){if(this.isMulti_)this.toggleMultiAtIndex(t,i,e);else if(e||i)this.setSingleSelectionAtIndex_(t,e);else{this.selectedIndex_===t&&this.setSingleSelectionAtIndex_(Di.UNSET_INDEX)}e&&this.adapter.notifyAction(t)}}toggleMultiAtIndex(t,e,i=!0){let r=!1;r=void 0===e?!this.adapter.getSelectedStateForElementIndex(t):e;const n=Hi(this.selectedIndex_);r?n.add(t):n.delete(t),this.setMultiSelectionAtIndex_(n,i)}}
/**
@license
Copyright 2020 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/const Wi=t=>t.hasAttribute("mwc-list-item");class Gi extends pe{constructor(){super(...arguments),this.mdcAdapter=null,this.mdcFoundationClass=Vi,this.activatable=!1,this.multi=!1,this.wrapFocus=!1,this.itemRoles=null,this.innerRole=null,this.innerAriaLabel=null,this.rootTabbable=!1,this.previousTabindex=null,this.noninteractive=!1,this.items_=[]}get assignedElements(){const t=this.slotElement;return t?t.assignedNodes({flatten:!0}).filter(oe):[]}get items(){return this.items_}updateItems(){const t=this.assignedElements,e=[];for(const i of t)Wi(i)&&(e.push(i),i._managingList=this),i.hasAttribute("divider")&&!i.hasAttribute("role")&&i.setAttribute("role","separator");this.items_=e;const i=new Set;if(this.items_.forEach(((t,e)=>{this.itemRoles?t.setAttribute("role",this.itemRoles):t.removeAttribute("role"),t.selected&&i.add(e)})),this.multi)this.select(i);else{const t=i.size?i.entries().next().value[1]:-1;this.select(t)}const r=new Event("items-updated",{bubbles:!0,composed:!0});this.dispatchEvent(r)}get selected(){const t=this.index;if(!Ui(t))return-1===t?null:this.items[t];const e=[];for(const i of t)e.push(this.items[i]);return e}get index(){return this.mdcFoundation?this.mdcFoundation.getSelectedIndex():-1}render(){const t=null===this.innerRole?void 0:this.innerRole,e=null===this.innerAriaLabel?void 0:this.innerAriaLabel,i=this.rootTabbable?"0":"-1";return Z`
      <!-- @ts-ignore -->
      <ul
          tabindex=${i}
          role="${oi(t)}"
          aria-label="${oi(e)}"
          class="mdc-list"
          @keydown=${this.onKeydown}
          @focusin=${this.onFocusIn}
          @focusout=${this.onFocusOut}
          @request-selected=${this.onRequestSelected}
          @list-item-rendered=${this.onListItemConnected}>
        <slot></slot>
      </ul>
    `}firstUpdated(){super.firstUpdated(),this.items.length||(this.mdcFoundation.setMulti(this.multi),this.layout())}onFocusIn(t){if(this.mdcFoundation&&this.mdcRoot){const e=this.getIndexOfTarget(t);this.mdcFoundation.handleFocusIn(t,e)}}onFocusOut(t){if(this.mdcFoundation&&this.mdcRoot){const e=this.getIndexOfTarget(t);this.mdcFoundation.handleFocusOut(t,e)}}onKeydown(t){if(this.mdcFoundation&&this.mdcRoot){const e=this.getIndexOfTarget(t),i=t.target,r=Wi(i);this.mdcFoundation.handleKeydown(t,r,e)}}onRequestSelected(t){if(this.mdcFoundation){let e=this.getIndexOfTarget(t);if(-1===e&&(this.layout(),e=this.getIndexOfTarget(t),-1===e))return;if(this.items[e].disabled)return;const i=t.detail.selected,r=t.detail.source;this.mdcFoundation.handleSingleSelection(e,"interaction"===r,i),t.stopPropagation()}}getIndexOfTarget(t){const e=this.items,i=t.composedPath();for(const t of i){let i=-1;if(oe(t)&&Wi(t)&&(i=e.indexOf(t)),-1!==i)return i}return-1}createAdapter(){return this.mdcAdapter={getListItemCount:()=>this.mdcRoot?this.items.length:0,getFocusedElementIndex:this.getFocusedItemIndex,getAttributeForElementIndex:(t,e)=>{if(!this.mdcRoot)return"";const i=this.items[t];return i?i.getAttribute(e):""},setAttributeForElementIndex:(t,e,i)=>{if(!this.mdcRoot)return;const r=this.items[t];r&&r.setAttribute(e,i)},focusItemAtIndex:t=>{const e=this.items[t];e&&e.focus()},setTabIndexForElementIndex:(t,e)=>{const i=this.items[t];i&&(i.tabindex=e)},notifyAction:t=>{const e={bubbles:!0,composed:!0};e.detail={index:t};const i=new CustomEvent("action",e);this.dispatchEvent(i)},notifySelected:(t,e)=>{const i={bubbles:!0,composed:!0};i.detail={index:t,diff:e};const r=new CustomEvent("selected",i);this.dispatchEvent(r)},isFocusInsideList:()=>ue(this),isRootFocused:()=>{const t=this.mdcRoot;return t.getRootNode().activeElement===t},setDisabledStateForElementIndex:(t,e)=>{const i=this.items[t];i&&(i.disabled=e)},getDisabledStateForElementIndex:t=>{const e=this.items[t];return!!e&&e.disabled},setSelectedStateForElementIndex:(t,e)=>{const i=this.items[t];i&&(i.selected=e)},getSelectedStateForElementIndex:t=>{const e=this.items[t];return!!e&&e.selected},setActivatedStateForElementIndex:(t,e)=>{const i=this.items[t];i&&(i.activated=e)}},this.mdcAdapter}selectUi(t,e=!1){const i=this.items[t];i&&(i.selected=!0,i.activated=e)}deselectUi(t){const e=this.items[t];e&&(e.selected=!1,e.activated=!1)}select(t){this.mdcFoundation&&this.mdcFoundation.setSelectedIndex(t)}toggle(t,e){this.multi&&this.mdcFoundation.toggleMultiAtIndex(t,e)}onListItemConnected(t){const e=t.target;this.layout(-1===this.items.indexOf(e))}layout(t=!0){t&&this.updateItems();const e=this.items[0];for(const t of this.items)t.tabindex=-1;e&&(this.noninteractive?this.previousTabindex||(this.previousTabindex=e):e.tabindex=0)}getFocusedItemIndex(){if(!this.mdcRoot)return-1;if(!this.items.length)return-1;const t=he();if(!t.length)return-1;for(let e=t.length-1;e>=0;e--){const i=t[e];if(Wi(i))return this.items.indexOf(i)}return-1}focusItemAtIndex(t){for(const t of this.items)if(0===t.tabindex){t.tabindex=-1;break}this.items[t].tabindex=0,this.items[t].focus()}focus(){const t=this.mdcRoot;t&&t.focus()}blur(){const t=this.mdcRoot;t&&t.blur()}}r([wt(".mdc-list")],Gi.prototype,"mdcRoot",void 0),r([wt("slot")],Gi.prototype,"slotElement",void 0),r([yt({type:Boolean}),fe((function(t){this.mdcFoundation&&this.mdcFoundation.setUseActivatedClass(t)}))],Gi.prototype,"activatable",void 0),r([yt({type:Boolean}),fe((function(t,e){this.mdcFoundation&&this.mdcFoundation.setMulti(t),void 0!==e&&this.layout()}))],Gi.prototype,"multi",void 0),r([yt({type:Boolean}),fe((function(t){this.mdcFoundation&&this.mdcFoundation.setWrapFocus(t)}))],Gi.prototype,"wrapFocus",void 0),r([yt({type:String}),fe((function(t,e){void 0!==e&&this.updateItems()}))],Gi.prototype,"itemRoles",void 0),r([yt({type:String})],Gi.prototype,"innerRole",void 0),r([yt({type:String})],Gi.prototype,"innerAriaLabel",void 0),r([yt({type:Boolean})],Gi.prototype,"rootTabbable",void 0),r([yt({type:Boolean,reflect:!0}),fe((function(t){const e=this.slotElement;if(t&&e){const t=function(t,e){for(const i of t.assignedNodes({flatten:!0}))if(oe(i)){const t=i;if(ne(t,e))return t}return null}(e,'[tabindex="0"]');this.previousTabindex=t,t&&t.setAttribute("tabindex","-1")}else!t&&this.previousTabindex&&(this.previousTabindex.setAttribute("tabindex","0"),this.previousTabindex=null)}))],Gi.prototype,"noninteractive",void 0);
/**
@license
Copyright 2018 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
const Ki=Ct`@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}:host{display:block}.mdc-list{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);line-height:1.75rem;line-height:var(--mdc-typography-subtitle1-line-height, 1.75rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight, 400);letter-spacing:0.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, 0.009375em);text-decoration:inherit;text-decoration:var(--mdc-typography-subtitle1-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform, inherit);line-height:1.5rem;margin:0;padding:8px 0;list-style-type:none;color:rgba(0, 0, 0, 0.87);color:var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87));padding:var(--mdc-list-vertical-padding, 8px) 0}.mdc-list:focus{outline:none}.mdc-list-item{height:48px}.mdc-list--dense{padding-top:4px;padding-bottom:4px;font-size:.812rem}.mdc-list ::slotted([divider]){height:0;margin:0;border:none;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgba(0, 0, 0, 0.12)}.mdc-list ::slotted([divider][padded]){margin:0 var(--mdc-list-side-padding, 16px)}.mdc-list ::slotted([divider][inset]){margin-left:var(--mdc-list-inset-margin, 72px);margin-right:0;width:calc(100% - var(--mdc-list-inset-margin, 72px))}.mdc-list-group[dir=rtl] .mdc-list ::slotted([divider][inset]),[dir=rtl] .mdc-list-group .mdc-list ::slotted([divider][inset]){margin-left:0;margin-right:var(--mdc-list-inset-margin, 72px)}.mdc-list ::slotted([divider][inset][padded]){width:calc(100% - var(--mdc-list-inset-margin, 72px) - var(--mdc-list-side-padding, 16px))}.mdc-list--dense ::slotted([mwc-list-item]){height:40px}.mdc-list--dense ::slotted([mwc-list]){--mdc-list-item-graphic-size: 20px}.mdc-list--two-line.mdc-list--dense ::slotted([mwc-list-item]),.mdc-list--avatar-list.mdc-list--dense ::slotted([mwc-list-item]){height:60px}.mdc-list--avatar-list.mdc-list--dense ::slotted([mwc-list]){--mdc-list-item-graphic-size: 36px}:host([noninteractive]){pointer-events:none;cursor:default}.mdc-list--dense ::slotted(.mdc-list-item__primary-text){display:block;margin-top:0;line-height:normal;margin-bottom:-20px}.mdc-list--dense ::slotted(.mdc-list-item__primary-text)::before{display:inline-block;width:0;height:24px;content:"";vertical-align:0}.mdc-list--dense ::slotted(.mdc-list-item__primary-text)::after{display:inline-block;width:0;height:20px;content:"";vertical-align:-20px}`
/**
@license
Copyright 2020 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/;let Xi=class extends Gi{};Xi.styles=Ki,Xi=r([bt("mwc-list")],Xi);
/**
 @license
 Copyright 2020 Google Inc. All Rights Reserved.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 */
class Zi extends Ot{constructor(){super(...arguments),this.value="",this.group=null,this.tabindex=-1,this.disabled=!1,this.twoline=!1,this.activated=!1,this.graphic=null,this.multipleGraphics=!1,this.hasMeta=!1,this.noninteractive=!1,this.selected=!1,this.shouldRenderRipple=!1,this._managingList=null,this.boundOnClick=this.onClick.bind(this),this._firstChanged=!0,this._skipPropRequest=!1,this.rippleHandlers=new Ye((()=>(this.shouldRenderRipple=!0,this.ripple))),this.listeners=[{target:this,eventNames:["click"],cb:()=>{this.onClick()}},{target:this,eventNames:["mouseenter"],cb:this.rippleHandlers.startHover},{target:this,eventNames:["mouseleave"],cb:this.rippleHandlers.endHover},{target:this,eventNames:["focus"],cb:this.rippleHandlers.startFocus},{target:this,eventNames:["blur"],cb:this.rippleHandlers.endFocus},{target:this,eventNames:["mousedown","touchstart"],cb:t=>{const e=t.type;this.onDown("mousedown"===e?"mouseup":"touchend",t)}}]}get text(){const t=this.textContent;return t?t.trim():""}render(){const t=this.renderText(),e=this.graphic?this.renderGraphic():Z``,i=this.hasMeta?this.renderMeta():Z``;return Z`
      ${this.renderRipple()}
      ${e}
      ${t}
      ${i}`}renderRipple(){return this.shouldRenderRipple?Z`
      <mwc-ripple
        .activated=${this.activated}>
      </mwc-ripple>`:this.activated?Z`<div class="fake-activated-ripple"></div>`:""}renderGraphic(){const t={multi:this.multipleGraphics};return Z`
      <span class="mdc-list-item__graphic material-icons ${be(t)}">
        <slot name="graphic"></slot>
      </span>`}renderMeta(){return Z`
      <span class="mdc-list-item__meta material-icons">
        <slot name="meta"></slot>
      </span>`}renderText(){const t=this.twoline?this.renderTwoline():this.renderSingleLine();return Z`
      <span class="mdc-list-item__text">
        ${t}
      </span>`}renderSingleLine(){return Z`<slot></slot>`}renderTwoline(){return Z`
      <span class="mdc-list-item__primary-text">
        <slot></slot>
      </span>
      <span class="mdc-list-item__secondary-text">
        <slot name="secondary"></slot>
      </span>
    `}onClick(){this.fireRequestSelected(!this.selected,"interaction")}onDown(t,e){const i=()=>{window.removeEventListener(t,i),this.rippleHandlers.endPress()};window.addEventListener(t,i),this.rippleHandlers.startPress(e)}fireRequestSelected(t,e){if(this.noninteractive)return;const i=new CustomEvent("request-selected",{bubbles:!0,composed:!0,detail:{source:e,selected:t}});this.dispatchEvent(i)}connectedCallback(){super.connectedCallback(),this.noninteractive||this.setAttribute("mwc-list-item","");for(const t of this.listeners)for(const e of t.eventNames)t.target.addEventListener(e,t.cb,{passive:!0})}disconnectedCallback(){super.disconnectedCallback();for(const t of this.listeners)for(const e of t.eventNames)t.target.removeEventListener(e,t.cb);this._managingList&&this._managingList.layout(!0)}firstUpdated(){const t=new Event("list-item-rendered",{bubbles:!0,composed:!0});this.dispatchEvent(t)}}r([wt("slot")],Zi.prototype,"slotElement",void 0),r([xt("mwc-ripple")],Zi.prototype,"ripple",void 0),r([yt({type:String})],Zi.prototype,"value",void 0),r([yt({type:String,reflect:!0})],Zi.prototype,"group",void 0),r([yt({type:Number,reflect:!0})],Zi.prototype,"tabindex",void 0),r([yt({type:Boolean,reflect:!0}),fe((function(t){t?this.setAttribute("aria-disabled","true"):this.setAttribute("aria-disabled","false")}))],Zi.prototype,"disabled",void 0),r([yt({type:Boolean,reflect:!0})],Zi.prototype,"twoline",void 0),r([yt({type:Boolean,reflect:!0})],Zi.prototype,"activated",void 0),r([yt({type:String,reflect:!0})],Zi.prototype,"graphic",void 0),r([yt({type:Boolean})],Zi.prototype,"multipleGraphics",void 0),r([yt({type:Boolean})],Zi.prototype,"hasMeta",void 0),r([yt({type:Boolean,reflect:!0}),fe((function(t){t?(this.removeAttribute("aria-checked"),this.removeAttribute("mwc-list-item"),this.selected=!1,this.activated=!1,this.tabIndex=-1):this.setAttribute("mwc-list-item","")}))],Zi.prototype,"noninteractive",void 0),r([yt({type:Boolean,reflect:!0}),fe((function(t){const e=this.getAttribute("role"),i="gridcell"===e||"option"===e||"row"===e||"tab"===e;i&&t?this.setAttribute("aria-selected","true"):i&&this.setAttribute("aria-selected","false"),this._firstChanged?this._firstChanged=!1:this._skipPropRequest||this.fireRequestSelected(t,"property")}))],Zi.prototype,"selected",void 0),r([_t()],Zi.prototype,"shouldRenderRipple",void 0),r([_t()],Zi.prototype,"_managingList",void 0);
/**
@license
Copyright 2018 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
const Yi=Ct`:host{cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;height:48px;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;padding-left:var(--mdc-list-side-padding, 16px);padding-right:var(--mdc-list-side-padding, 16px);outline:none;height:48px;color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87))}:host:focus{outline:none}:host([activated]){color:#6200ee;color:var(--mdc-theme-primary, #6200ee);--mdc-ripple-color: var(--mdc-theme-primary, #6200ee)}:host([activated]) .mdc-list-item__graphic{color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}:host([activated]) .fake-activated-ripple::before{position:absolute;display:block;top:0;bottom:0;left:0;right:0;width:100%;height:100%;pointer-events:none;z-index:1;content:"";opacity:0.12;opacity:var(--mdc-ripple-activated-opacity, 0.12);background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-list-item__graphic{flex-shrink:0;align-items:center;justify-content:center;fill:currentColor;display:inline-flex}.mdc-list-item__graphic ::slotted(*){flex-shrink:0;align-items:center;justify-content:center;fill:currentColor;width:100%;height:100%;text-align:center}.mdc-list-item__meta{width:var(--mdc-list-item-meta-size, 24px);height:var(--mdc-list-item-meta-size, 24px);margin-left:auto;margin-right:0;color:rgba(0, 0, 0, 0.38);color:var(--mdc-theme-text-hint-on-background, rgba(0, 0, 0, 0.38))}.mdc-list-item__meta.multi{width:auto}.mdc-list-item__meta ::slotted(*){width:var(--mdc-list-item-meta-size, 24px);line-height:var(--mdc-list-item-meta-size, 24px)}.mdc-list-item__meta ::slotted(.material-icons),.mdc-list-item__meta ::slotted(mwc-icon){line-height:var(--mdc-list-item-meta-size, 24px) !important}.mdc-list-item__meta ::slotted(:not(.material-icons):not(mwc-icon)){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.75rem;font-size:var(--mdc-typography-caption-font-size, 0.75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight, 400);letter-spacing:0.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, 0.0333333333em);text-decoration:inherit;text-decoration:var(--mdc-typography-caption-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform, inherit)}:host[dir=rtl] .mdc-list-item__meta,[dir=rtl] :host .mdc-list-item__meta{margin-left:0;margin-right:auto}.mdc-list-item__meta ::slotted(*){width:100%;height:100%}.mdc-list-item__text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.mdc-list-item__text ::slotted([for]),.mdc-list-item__text[for]{pointer-events:none}.mdc-list-item__primary-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block;margin-top:0;line-height:normal;margin-bottom:-20px;display:block}.mdc-list-item__primary-text::before{display:inline-block;width:0;height:32px;content:"";vertical-align:0}.mdc-list-item__primary-text::after{display:inline-block;width:0;height:20px;content:"";vertical-align:-20px}.mdc-list-item__secondary-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.875rem;font-size:var(--mdc-typography-body2-font-size, 0.875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight, 400);letter-spacing:0.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, 0.0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform, inherit);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block;margin-top:0;line-height:normal;display:block}.mdc-list-item__secondary-text::before{display:inline-block;width:0;height:20px;content:"";vertical-align:0}.mdc-list--dense .mdc-list-item__secondary-text{font-size:inherit}* ::slotted(a),a{color:inherit;text-decoration:none}:host([twoline]){height:72px}:host([twoline]) .mdc-list-item__text{align-self:flex-start}:host([disabled]),:host([noninteractive]){cursor:default;pointer-events:none}:host([disabled]) .mdc-list-item__text ::slotted(*){opacity:.38}:host([disabled]) .mdc-list-item__text ::slotted(*),:host([disabled]) .mdc-list-item__primary-text ::slotted(*),:host([disabled]) .mdc-list-item__secondary-text ::slotted(*){color:#000;color:var(--mdc-theme-on-surface, #000)}.mdc-list-item__secondary-text ::slotted(*){color:rgba(0, 0, 0, 0.54);color:var(--mdc-theme-text-secondary-on-background, rgba(0, 0, 0, 0.54))}.mdc-list-item__graphic ::slotted(*){background-color:transparent;color:rgba(0, 0, 0, 0.38);color:var(--mdc-theme-text-icon-on-background, rgba(0, 0, 0, 0.38))}.mdc-list-group__subheader ::slotted(*){color:rgba(0, 0, 0, 0.87);color:var(--mdc-theme-text-primary-on-background, rgba(0, 0, 0, 0.87))}:host([graphic=avatar]) .mdc-list-item__graphic{width:var(--mdc-list-item-graphic-size, 40px);height:var(--mdc-list-item-graphic-size, 40px)}:host([graphic=avatar]) .mdc-list-item__graphic.multi{width:auto}:host([graphic=avatar]) .mdc-list-item__graphic ::slotted(*){width:var(--mdc-list-item-graphic-size, 40px);line-height:var(--mdc-list-item-graphic-size, 40px)}:host([graphic=avatar]) .mdc-list-item__graphic ::slotted(.material-icons),:host([graphic=avatar]) .mdc-list-item__graphic ::slotted(mwc-icon){line-height:var(--mdc-list-item-graphic-size, 40px) !important}:host([graphic=avatar]) .mdc-list-item__graphic ::slotted(*){border-radius:50%}:host([graphic=avatar],[graphic=medium],[graphic=large],[graphic=control]) .mdc-list-item__graphic{margin-left:0;margin-right:var(--mdc-list-item-graphic-margin, 16px)}:host[dir=rtl] :host([graphic=avatar],[graphic=medium],[graphic=large],[graphic=control]) .mdc-list-item__graphic,[dir=rtl] :host :host([graphic=avatar],[graphic=medium],[graphic=large],[graphic=control]) .mdc-list-item__graphic{margin-left:var(--mdc-list-item-graphic-margin, 16px);margin-right:0}:host([graphic=icon]) .mdc-list-item__graphic{width:var(--mdc-list-item-graphic-size, 24px);height:var(--mdc-list-item-graphic-size, 24px);margin-left:0;margin-right:var(--mdc-list-item-graphic-margin, 32px)}:host([graphic=icon]) .mdc-list-item__graphic.multi{width:auto}:host([graphic=icon]) .mdc-list-item__graphic ::slotted(*){width:var(--mdc-list-item-graphic-size, 24px);line-height:var(--mdc-list-item-graphic-size, 24px)}:host([graphic=icon]) .mdc-list-item__graphic ::slotted(.material-icons),:host([graphic=icon]) .mdc-list-item__graphic ::slotted(mwc-icon){line-height:var(--mdc-list-item-graphic-size, 24px) !important}:host[dir=rtl] :host([graphic=icon]) .mdc-list-item__graphic,[dir=rtl] :host :host([graphic=icon]) .mdc-list-item__graphic{margin-left:var(--mdc-list-item-graphic-margin, 32px);margin-right:0}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:56px}:host([graphic=medium]:not([twoLine])),:host([graphic=large]:not([twoLine])){height:72px}:host([graphic=medium]) .mdc-list-item__graphic,:host([graphic=large]) .mdc-list-item__graphic{width:var(--mdc-list-item-graphic-size, 56px);height:var(--mdc-list-item-graphic-size, 56px)}:host([graphic=medium]) .mdc-list-item__graphic.multi,:host([graphic=large]) .mdc-list-item__graphic.multi{width:auto}:host([graphic=medium]) .mdc-list-item__graphic ::slotted(*),:host([graphic=large]) .mdc-list-item__graphic ::slotted(*){width:var(--mdc-list-item-graphic-size, 56px);line-height:var(--mdc-list-item-graphic-size, 56px)}:host([graphic=medium]) .mdc-list-item__graphic ::slotted(.material-icons),:host([graphic=medium]) .mdc-list-item__graphic ::slotted(mwc-icon),:host([graphic=large]) .mdc-list-item__graphic ::slotted(.material-icons),:host([graphic=large]) .mdc-list-item__graphic ::slotted(mwc-icon){line-height:var(--mdc-list-item-graphic-size, 56px) !important}:host([graphic=large]){padding-left:0px}`
/**
@license
Copyright 2020 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/;let Ji=class extends Zi{};Ji.styles=Yi,Ji=r([bt("mwc-list-item")],Ji);
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var Qi,tr,er={ANCHOR:"mdc-menu-surface--anchor",ANIMATING_CLOSED:"mdc-menu-surface--animating-closed",ANIMATING_OPEN:"mdc-menu-surface--animating-open",FIXED:"mdc-menu-surface--fixed",IS_OPEN_BELOW:"mdc-menu-surface--is-open-below",OPEN:"mdc-menu-surface--open",ROOT:"mdc-menu-surface"},ir={CLOSED_EVENT:"MDCMenuSurface:closed",OPENED_EVENT:"MDCMenuSurface:opened",FOCUSABLE_ELEMENTS:["button:not(:disabled)",'[href]:not([aria-disabled="true"])',"input:not(:disabled)","select:not(:disabled)","textarea:not(:disabled)",'[tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])'].join(", ")},rr={TRANSITION_OPEN_DURATION:120,TRANSITION_CLOSE_DURATION:75,MARGIN_TO_EDGE:32,ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO:.67};!function(t){t[t.BOTTOM=1]="BOTTOM",t[t.CENTER=2]="CENTER",t[t.RIGHT=4]="RIGHT",t[t.FLIP_RTL=8]="FLIP_RTL"}(Qi||(Qi={})),function(t){t[t.TOP_LEFT=0]="TOP_LEFT",t[t.TOP_RIGHT=4]="TOP_RIGHT",t[t.BOTTOM_LEFT=1]="BOTTOM_LEFT",t[t.BOTTOM_RIGHT=5]="BOTTOM_RIGHT",t[t.TOP_START=8]="TOP_START",t[t.TOP_END=12]="TOP_END",t[t.BOTTOM_START=9]="BOTTOM_START",t[t.BOTTOM_END=13]="BOTTOM_END"}(tr||(tr={}));
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var nr=function(t){function r(e){var n=t.call(this,i(i({},r.defaultAdapter),e))||this;return n.isSurfaceOpen=!1,n.isQuickOpen=!1,n.isHoistedElement=!1,n.isFixedPosition=!1,n.openAnimationEndTimerId=0,n.closeAnimationEndTimerId=0,n.animationRequestId=0,n.anchorCorner=tr.TOP_START,n.originCorner=tr.TOP_START,n.anchorMargin={top:0,right:0,bottom:0,left:0},n.position={x:0,y:0},n}return e(r,t),Object.defineProperty(r,"cssClasses",{get:function(){return er},enumerable:!0,configurable:!0}),Object.defineProperty(r,"strings",{get:function(){return ir},enumerable:!0,configurable:!0}),Object.defineProperty(r,"numbers",{get:function(){return rr},enumerable:!0,configurable:!0}),Object.defineProperty(r,"Corner",{get:function(){return tr},enumerable:!0,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},hasAnchor:function(){return!1},isElementInContainer:function(){return!1},isFocused:function(){return!1},isRtl:function(){return!1},getInnerDimensions:function(){return{height:0,width:0}},getAnchorDimensions:function(){return null},getWindowDimensions:function(){return{height:0,width:0}},getBodyDimensions:function(){return{height:0,width:0}},getWindowScroll:function(){return{x:0,y:0}},setPosition:function(){},setMaxHeight:function(){},setTransformOrigin:function(){},saveFocus:function(){},restoreFocus:function(){},notifyClose:function(){},notifyOpen:function(){}}},enumerable:!0,configurable:!0}),r.prototype.init=function(){var t=r.cssClasses,e=t.ROOT,i=t.OPEN;if(!this.adapter.hasClass(e))throw new Error(e+" class required in root element.");this.adapter.hasClass(i)&&(this.isSurfaceOpen=!0)},r.prototype.destroy=function(){clearTimeout(this.openAnimationEndTimerId),clearTimeout(this.closeAnimationEndTimerId),cancelAnimationFrame(this.animationRequestId)},r.prototype.setAnchorCorner=function(t){this.anchorCorner=t},r.prototype.flipCornerHorizontally=function(){this.originCorner=this.originCorner^Qi.RIGHT},r.prototype.setAnchorMargin=function(t){this.anchorMargin.top=t.top||0,this.anchorMargin.right=t.right||0,this.anchorMargin.bottom=t.bottom||0,this.anchorMargin.left=t.left||0},r.prototype.setIsHoisted=function(t){this.isHoistedElement=t},r.prototype.setFixedPosition=function(t){this.isFixedPosition=t},r.prototype.setAbsolutePosition=function(t,e){this.position.x=this.isFinite(t)?t:0,this.position.y=this.isFinite(e)?e:0},r.prototype.setQuickOpen=function(t){this.isQuickOpen=t},r.prototype.isOpen=function(){return this.isSurfaceOpen},r.prototype.open=function(){var t=this;this.isSurfaceOpen||(this.adapter.saveFocus(),this.isQuickOpen?(this.isSurfaceOpen=!0,this.adapter.addClass(r.cssClasses.OPEN),this.dimensions=this.adapter.getInnerDimensions(),this.autoposition(),this.adapter.notifyOpen()):(this.adapter.addClass(r.cssClasses.ANIMATING_OPEN),this.animationRequestId=requestAnimationFrame((function(){t.adapter.addClass(r.cssClasses.OPEN),t.dimensions=t.adapter.getInnerDimensions(),t.autoposition(),t.openAnimationEndTimerId=setTimeout((function(){t.openAnimationEndTimerId=0,t.adapter.removeClass(r.cssClasses.ANIMATING_OPEN),t.adapter.notifyOpen()}),rr.TRANSITION_OPEN_DURATION)})),this.isSurfaceOpen=!0))},r.prototype.close=function(t){var e=this;void 0===t&&(t=!1),this.isSurfaceOpen&&(this.isQuickOpen?(this.isSurfaceOpen=!1,t||this.maybeRestoreFocus(),this.adapter.removeClass(r.cssClasses.OPEN),this.adapter.removeClass(r.cssClasses.IS_OPEN_BELOW),this.adapter.notifyClose()):(this.adapter.addClass(r.cssClasses.ANIMATING_CLOSED),requestAnimationFrame((function(){e.adapter.removeClass(r.cssClasses.OPEN),e.adapter.removeClass(r.cssClasses.IS_OPEN_BELOW),e.closeAnimationEndTimerId=setTimeout((function(){e.closeAnimationEndTimerId=0,e.adapter.removeClass(r.cssClasses.ANIMATING_CLOSED),e.adapter.notifyClose()}),rr.TRANSITION_CLOSE_DURATION)})),this.isSurfaceOpen=!1,t||this.maybeRestoreFocus()))},r.prototype.handleBodyClick=function(t){var e=t.target;this.adapter.isElementInContainer(e)||this.close()},r.prototype.handleKeydown=function(t){var e=t.keyCode;("Escape"===t.key||27===e)&&this.close()},r.prototype.autoposition=function(){var t;this.measurements=this.getAutoLayoutmeasurements();var e=this.getoriginCorner(),i=this.getMenuSurfaceMaxHeight(e),n=this.hasBit(e,Qi.BOTTOM)?"bottom":"top",o=this.hasBit(e,Qi.RIGHT)?"right":"left",s=this.getHorizontalOriginOffset(e),a=this.getVerticalOriginOffset(e),l=this.measurements,d=l.anchorSize,c=l.surfaceSize,h=((t={})[o]=s,t[n]=a,t);d.width/c.width>rr.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO&&(o="center"),(this.isHoistedElement||this.isFixedPosition)&&this.adjustPositionForHoistedElement(h),this.adapter.setTransformOrigin(o+" "+n),this.adapter.setPosition(h),this.adapter.setMaxHeight(i?i+"px":""),this.hasBit(e,Qi.BOTTOM)||this.adapter.addClass(r.cssClasses.IS_OPEN_BELOW)},r.prototype.getAutoLayoutmeasurements=function(){var t=this.adapter.getAnchorDimensions(),e=this.adapter.getBodyDimensions(),i=this.adapter.getWindowDimensions(),r=this.adapter.getWindowScroll();return t||(t={top:this.position.y,right:this.position.x,bottom:this.position.y,left:this.position.x,width:0,height:0}),{anchorSize:t,bodySize:e,surfaceSize:this.dimensions,viewportDistance:{top:t.top,right:i.width-t.right,bottom:i.height-t.bottom,left:t.left},viewportSize:i,windowScroll:r}},r.prototype.getoriginCorner=function(){var t,e,i=this.originCorner,n=this.measurements,o=n.viewportDistance,s=n.anchorSize,a=n.surfaceSize,l=r.numbers.MARGIN_TO_EDGE;this.hasBit(this.anchorCorner,Qi.BOTTOM)?(t=o.top-l+s.height+this.anchorMargin.bottom,e=o.bottom-l-this.anchorMargin.bottom):(t=o.top-l+this.anchorMargin.top,e=o.bottom-l+s.height-this.anchorMargin.top),!(e-a.height>0)&&t>=e&&(i=this.setBit(i,Qi.BOTTOM));var d,c,h=this.adapter.isRtl(),u=this.hasBit(this.anchorCorner,Qi.FLIP_RTL),p=this.hasBit(this.anchorCorner,Qi.RIGHT),f=!1;(f=h&&u?!p:p)?(d=o.left+s.width+this.anchorMargin.right,c=o.right-this.anchorMargin.right):(d=o.left+this.anchorMargin.left,c=o.right+s.width-this.anchorMargin.left);var m=d-a.width>0,g=c-a.width>0,b=this.hasBit(i,Qi.FLIP_RTL)&&this.hasBit(i,Qi.RIGHT);return g&&b&&h||!m&&b?i=this.unsetBit(i,Qi.RIGHT):(m&&f&&h||m&&!f&&p||!g&&d>=c)&&(i=this.setBit(i,Qi.RIGHT)),i},r.prototype.getMenuSurfaceMaxHeight=function(t){var e=this.measurements.viewportDistance,i=0,n=this.hasBit(t,Qi.BOTTOM),o=this.hasBit(this.anchorCorner,Qi.BOTTOM),s=r.numbers.MARGIN_TO_EDGE;return n?(i=e.top+this.anchorMargin.top-s,o||(i+=this.measurements.anchorSize.height)):(i=e.bottom-this.anchorMargin.bottom+this.measurements.anchorSize.height-s,o&&(i-=this.measurements.anchorSize.height)),i},r.prototype.getHorizontalOriginOffset=function(t){var e=this.measurements.anchorSize,i=this.hasBit(t,Qi.RIGHT),r=this.hasBit(this.anchorCorner,Qi.RIGHT);if(i){var n=r?e.width-this.anchorMargin.left:this.anchorMargin.right;return this.isHoistedElement||this.isFixedPosition?n-(this.measurements.viewportSize.width-this.measurements.bodySize.width):n}return r?e.width-this.anchorMargin.right:this.anchorMargin.left},r.prototype.getVerticalOriginOffset=function(t){var e=this.measurements.anchorSize,i=this.hasBit(t,Qi.BOTTOM),r=this.hasBit(this.anchorCorner,Qi.BOTTOM);return i?r?e.height-this.anchorMargin.top:-this.anchorMargin.bottom:r?e.height+this.anchorMargin.bottom:this.anchorMargin.top},r.prototype.adjustPositionForHoistedElement=function(t){var e,i,r=this.measurements,n=r.windowScroll,o=r.viewportDistance,s=Object.keys(t);try{for(var a=function(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],r=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(s),l=a.next();!l.done;l=a.next()){var d=l.value,c=t[d]||0;c+=o[d],this.isFixedPosition||("top"===d?c+=n.y:"bottom"===d?c-=n.y:"left"===d?c+=n.x:c-=n.x),t[d]=c}}catch(t){e={error:t}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(e)throw e.error}}},r.prototype.maybeRestoreFocus=function(){var t=this.adapter.isFocused(),e=document.activeElement&&this.adapter.isElementInContainer(document.activeElement);(t||e)&&this.adapter.restoreFocus()},r.prototype.hasBit=function(t,e){return Boolean(t&e)},r.prototype.setBit=function(t,e){return t|e},r.prototype.unsetBit=function(t,e){return t^e},r.prototype.isFinite=function(t){return"number"==typeof t&&isFinite(t)},r}(ee);const or={TOP_LEFT:tr.TOP_LEFT,TOP_RIGHT:tr.TOP_RIGHT,BOTTOM_LEFT:tr.BOTTOM_LEFT,BOTTOM_RIGHT:tr.BOTTOM_RIGHT,TOP_START:tr.TOP_START,TOP_END:tr.TOP_END,BOTTOM_START:tr.BOTTOM_START,BOTTOM_END:tr.BOTTOM_END};class sr extends pe{constructor(){super(...arguments),this.mdcFoundationClass=nr,this.absolute=!1,this.fullwidth=!1,this.fixed=!1,this.x=null,this.y=null,this.quick=!1,this.open=!1,this.bitwiseCorner=tr.TOP_START,this.previousMenuCorner=null,this.menuCorner="START",this.corner="TOP_START",this.styleTop="",this.styleLeft="",this.styleRight="",this.styleBottom="",this.styleMaxHeight="",this.styleTransformOrigin="",this.anchor=null,this.previouslyFocused=null,this.previousAnchor=null,this.onBodyClickBound=()=>{}}render(){const t={"mdc-menu-surface--fixed":this.fixed,"mdc-menu-surface--fullwidth":this.fullwidth},e={top:this.styleTop,left:this.styleLeft,right:this.styleRight,bottom:this.styleBottom,"max-height":this.styleMaxHeight,"transform-origin":this.styleTransformOrigin};return Z`
      <div
          class="mdc-menu-surface ${be(t)}"
          style="${Ge(e)}"
          @keydown=${this.onKeydown}
          @opened=${this.registerBodyClick}
          @closed=${this.deregisterBodyClick}>
        <slot></slot>
      </div>`}createAdapter(){return Object.assign(Object.assign({},se(this.mdcRoot)),{hasAnchor:()=>!!this.anchor,notifyClose:()=>{const t=new CustomEvent("closed",{bubbles:!0,composed:!0});this.open=!1,this.mdcRoot.dispatchEvent(t)},notifyOpen:()=>{const t=new CustomEvent("opened",{bubbles:!0,composed:!0});this.open=!0,this.mdcRoot.dispatchEvent(t)},isElementInContainer:()=>!1,isRtl:()=>!!this.mdcRoot&&"rtl"===getComputedStyle(this.mdcRoot).direction,setTransformOrigin:t=>{this.mdcRoot&&(this.styleTransformOrigin=t)},isFocused:()=>ue(this),saveFocus:()=>{const t=he(),e=t.length;e||(this.previouslyFocused=null),this.previouslyFocused=t[e-1]},restoreFocus:()=>{this.previouslyFocused&&"focus"in this.previouslyFocused&&this.previouslyFocused.focus()},getInnerDimensions:()=>{const t=this.mdcRoot;return t?{width:t.offsetWidth,height:t.offsetHeight}:{width:0,height:0}},getAnchorDimensions:()=>{const t=this.anchor;return t?t.getBoundingClientRect():null},getBodyDimensions:()=>({width:document.body.clientWidth,height:document.body.clientHeight}),getWindowDimensions:()=>({width:window.innerWidth,height:window.innerHeight}),getWindowScroll:()=>({x:window.pageXOffset,y:window.pageYOffset}),setPosition:t=>{this.mdcRoot&&(this.styleLeft="left"in t?t.left+"px":"",this.styleRight="right"in t?t.right+"px":"",this.styleTop="top"in t?t.top+"px":"",this.styleBottom="bottom"in t?t.bottom+"px":"")},setMaxHeight:async t=>{this.mdcRoot&&(this.styleMaxHeight=t,await this.updateComplete,this.styleMaxHeight=`var(--mdc-menu-max-height, ${t})`)}})}onKeydown(t){this.mdcFoundation&&this.mdcFoundation.handleKeydown(t)}onBodyClick(t){-1===t.composedPath().indexOf(this)&&this.close()}registerBodyClick(){this.onBodyClickBound=this.onBodyClick.bind(this),document.body.addEventListener("click",this.onBodyClickBound,{passive:!0,capture:!0})}deregisterBodyClick(){document.body.removeEventListener("click",this.onBodyClickBound)}close(){this.open=!1}show(){this.open=!0}}r([wt(".mdc-menu-surface")],sr.prototype,"mdcRoot",void 0),r([wt("slot")],sr.prototype,"slotElement",void 0),r([yt({type:Boolean}),fe((function(t){this.mdcFoundation&&!this.fixed&&this.mdcFoundation.setIsHoisted(t)}))],sr.prototype,"absolute",void 0),r([yt({type:Boolean})],sr.prototype,"fullwidth",void 0),r([yt({type:Boolean}),fe((function(t){this.mdcFoundation&&!this.absolute&&this.mdcFoundation.setIsHoisted(t)}))],sr.prototype,"fixed",void 0),r([yt({type:Number}),fe((function(t){this.mdcFoundation&&null!==this.y&&null!==t&&(this.mdcFoundation.setAbsolutePosition(t,this.y),this.mdcFoundation.setAnchorMargin({left:t,top:this.y,right:-t,bottom:this.y}))}))],sr.prototype,"x",void 0),r([yt({type:Number}),fe((function(t){this.mdcFoundation&&null!==this.x&&null!==t&&(this.mdcFoundation.setAbsolutePosition(this.x,t),this.mdcFoundation.setAnchorMargin({left:this.x,top:t,right:-this.x,bottom:t}))}))],sr.prototype,"y",void 0),r([yt({type:Boolean}),fe((function(t){this.mdcFoundation&&this.mdcFoundation.setQuickOpen(t)}))],sr.prototype,"quick",void 0),r([yt({type:Boolean,reflect:!0}),fe((function(t,e){this.mdcFoundation&&(t?this.mdcFoundation.open():void 0!==e&&this.mdcFoundation.close())}))],sr.prototype,"open",void 0),r([_t(),fe((function(t){this.mdcFoundation&&this.mdcFoundation.setAnchorCorner(t)}))],sr.prototype,"bitwiseCorner",void 0),r([yt({type:String}),fe((function(t){if(this.mdcFoundation){const e="START"===t||"END"===t,i=null===this.previousMenuCorner,r=!i&&t!==this.previousMenuCorner,n=i&&"END"===t;e&&(r||n)&&(this.bitwiseCorner=this.bitwiseCorner^Qi.RIGHT,this.mdcFoundation.flipCornerHorizontally(),this.previousMenuCorner=t)}}))],sr.prototype,"menuCorner",void 0),r([yt({type:String}),fe((function(t){if(this.mdcFoundation&&t){let e=or[t];"END"===this.menuCorner&&(e^=Qi.RIGHT),this.bitwiseCorner=e}}))],sr.prototype,"corner",void 0),r([_t()],sr.prototype,"styleTop",void 0),r([_t()],sr.prototype,"styleLeft",void 0),r([_t()],sr.prototype,"styleRight",void 0),r([_t()],sr.prototype,"styleBottom",void 0),r([_t()],sr.prototype,"styleMaxHeight",void 0),r([_t()],sr.prototype,"styleTransformOrigin",void 0);
/**
@license
Copyright 2018 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
const ar=Ct`.mdc-menu-surface{display:none;position:absolute;box-sizing:border-box;max-width:calc(100vw - 32px);max-height:calc(100vh - 32px);margin:0;padding:0;transform:scale(1);transform-origin:top left;opacity:0;overflow:auto;will-change:transform,opacity;z-index:8;transition:opacity .03s linear,transform .12s cubic-bezier(0, 0, 0.2, 1),height 250ms cubic-bezier(0, 0, 0.2, 1);box-shadow:0px 5px 5px -3px rgba(0, 0, 0, 0.2),0px 8px 10px 1px rgba(0, 0, 0, 0.14),0px 3px 14px 2px rgba(0,0,0,.12);background-color:#fff;background-color:var(--mdc-theme-surface, #fff);color:#000;color:var(--mdc-theme-on-surface, #000);border-radius:4px;border-radius:var(--mdc-shape-medium, 4px);transform-origin-left:top left;transform-origin-right:top right}.mdc-menu-surface:focus{outline:none}.mdc-menu-surface--open{display:inline-block;transform:scale(1);opacity:1}.mdc-menu-surface--animating-open{display:inline-block;transform:scale(0.8);opacity:0}.mdc-menu-surface--animating-closed{display:inline-block;opacity:0;transition:opacity .075s linear}[dir=rtl] .mdc-menu-surface,.mdc-menu-surface[dir=rtl]{transform-origin-left:top right;transform-origin-right:top left}.mdc-menu-surface--anchor{position:relative;overflow:visible}.mdc-menu-surface--fixed{position:fixed}.mdc-menu-surface--fullwidth{width:100%}:host(:not([open])){display:none}.mdc-menu-surface{z-index:8;z-index:var(--mdc-menu-z-index, 8);max-height:calc(100vh - 32px);max-height:var(--mdc-menu-max-height, calc(100vh - 32px))}`
/**
@license
Copyright 2020 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/;let lr=class extends sr{};lr.styles=ar,lr=r([bt("mwc-menu-surface")],lr);
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var dr,cr={MENU_SELECTED_LIST_ITEM:"mdc-menu-item--selected",MENU_SELECTION_GROUP:"mdc-menu__selection-group",ROOT:"mdc-menu"},hr={ARIA_CHECKED_ATTR:"aria-checked",ARIA_DISABLED_ATTR:"aria-disabled",CHECKBOX_SELECTOR:'input[type="checkbox"]',LIST_SELECTOR:".mdc-list",SELECTED_EVENT:"MDCMenu:selected"},ur={FOCUS_ROOT_INDEX:-1};!function(t){t[t.NONE=0]="NONE",t[t.LIST_ROOT=1]="LIST_ROOT",t[t.FIRST_ITEM=2]="FIRST_ITEM",t[t.LAST_ITEM=3]="LAST_ITEM"}(dr||(dr={}));
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var pr=function(t){function r(e){var n=t.call(this,i(i({},r.defaultAdapter),e))||this;return n.closeAnimationEndTimerId_=0,n.defaultFocusState_=dr.LIST_ROOT,n}return e(r,t),Object.defineProperty(r,"cssClasses",{get:function(){return cr},enumerable:!0,configurable:!0}),Object.defineProperty(r,"strings",{get:function(){return hr},enumerable:!0,configurable:!0}),Object.defineProperty(r,"numbers",{get:function(){return ur},enumerable:!0,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addClassToElementAtIndex:function(){},removeClassFromElementAtIndex:function(){},addAttributeToElementAtIndex:function(){},removeAttributeFromElementAtIndex:function(){},elementContainsClass:function(){return!1},closeSurface:function(){},getElementIndex:function(){return-1},notifySelected:function(){},getMenuItemCount:function(){return 0},focusItemAtIndex:function(){},focusListRoot:function(){},getSelectedSiblingOfItemAtIndex:function(){return-1},isSelectableItemAtIndex:function(){return!1}}},enumerable:!0,configurable:!0}),r.prototype.destroy=function(){this.closeAnimationEndTimerId_&&clearTimeout(this.closeAnimationEndTimerId_),this.adapter.closeSurface()},r.prototype.handleKeydown=function(t){var e=t.key,i=t.keyCode;("Tab"===e||9===i)&&this.adapter.closeSurface(!0)},r.prototype.handleItemAction=function(t){var e=this,i=this.adapter.getElementIndex(t);i<0||(this.adapter.notifySelected({index:i}),this.adapter.closeSurface(),this.closeAnimationEndTimerId_=setTimeout((function(){var i=e.adapter.getElementIndex(t);i>=0&&e.adapter.isSelectableItemAtIndex(i)&&e.setSelectedIndex(i)}),nr.numbers.TRANSITION_CLOSE_DURATION))},r.prototype.handleMenuSurfaceOpened=function(){switch(this.defaultFocusState_){case dr.FIRST_ITEM:this.adapter.focusItemAtIndex(0);break;case dr.LAST_ITEM:this.adapter.focusItemAtIndex(this.adapter.getMenuItemCount()-1);break;case dr.NONE:break;default:this.adapter.focusListRoot()}},r.prototype.setDefaultFocusState=function(t){this.defaultFocusState_=t},r.prototype.setSelectedIndex=function(t){if(this.validatedIndex_(t),!this.adapter.isSelectableItemAtIndex(t))throw new Error("MDCMenuFoundation: No selection group at specified index.");var e=this.adapter.getSelectedSiblingOfItemAtIndex(t);e>=0&&(this.adapter.removeAttributeFromElementAtIndex(e,hr.ARIA_CHECKED_ATTR),this.adapter.removeClassFromElementAtIndex(e,cr.MENU_SELECTED_LIST_ITEM)),this.adapter.addClassToElementAtIndex(t,cr.MENU_SELECTED_LIST_ITEM),this.adapter.addAttributeToElementAtIndex(t,hr.ARIA_CHECKED_ATTR,"true")},r.prototype.setEnabled=function(t,e){this.validatedIndex_(t),e?(this.adapter.removeClassFromElementAtIndex(t,ji),this.adapter.addAttributeToElementAtIndex(t,hr.ARIA_DISABLED_ATTR,"false")):(this.adapter.addClassToElementAtIndex(t,ji),this.adapter.addAttributeToElementAtIndex(t,hr.ARIA_DISABLED_ATTR,"true"))},r.prototype.validatedIndex_=function(t){var e=this.adapter.getMenuItemCount();if(!(t>=0&&t<e))throw new Error("MDCMenuFoundation: No list item at specified index.")},r}(ee);class fr extends pe{constructor(){super(...arguments),this.mdcFoundationClass=pr,this.listElement_=null,this.anchor=null,this.open=!1,this.quick=!1,this.wrapFocus=!1,this.innerRole="menu",this.corner="TOP_START",this.x=null,this.y=null,this.absolute=!1,this.multi=!1,this.activatable=!1,this.fixed=!1,this.forceGroupSelection=!1,this.fullwidth=!1,this.menuCorner="START",this.defaultFocus="LIST_ROOT",this._listUpdateComplete=null}get listElement(){return this.listElement_||(this.listElement_=this.renderRoot.querySelector("mwc-list")),this.listElement_}get items(){const t=this.listElement;return t?t.items:[]}get index(){const t=this.listElement;return t?t.index:-1}get selected(){const t=this.listElement;return t?t.selected:null}render(){const t="menu"===this.innerRole?"menuitem":"option";return Z`
      <mwc-menu-surface
          ?hidden=${!this.open}
          .anchor=${this.anchor}
          .open=${this.open}
          .quick=${this.quick}
          .corner=${this.corner}
          .x=${this.x}
          .y=${this.y}
          .absolute=${this.absolute}
          .fixed=${this.fixed}
          .fullwidth=${this.fullwidth}
          .menuCorner=${this.menuCorner}
          class="mdc-menu mdc-menu-surface"
          @closed=${this.onClosed}
          @opened=${this.onOpened}
          @keydown=${this.onKeydown}>
        <mwc-list
          rootTabbable
          .innerRole=${this.innerRole}
          .multi=${this.multi}
          class="mdc-list"
          .itemRoles=${t}
          .wrapFocus=${this.wrapFocus}
          .activatable=${this.activatable}
          @action=${this.onAction}>
        <slot></slot>
      </mwc-list>
    </mwc-menu-surface>`}createAdapter(){return{addClassToElementAtIndex:(t,e)=>{const i=this.listElement;if(!i)return;const r=i.items[t];r&&("mdc-menu-item--selected"===e?this.forceGroupSelection&&!r.selected&&i.toggle(t,!0):r.classList.add(e))},removeClassFromElementAtIndex:(t,e)=>{const i=this.listElement;if(!i)return;const r=i.items[t];r&&("mdc-menu-item--selected"===e?r.selected&&i.toggle(t,!1):r.classList.remove(e))},addAttributeToElementAtIndex:(t,e,i)=>{const r=this.listElement;if(!r)return;const n=r.items[t];n&&n.setAttribute(e,i)},removeAttributeFromElementAtIndex:(t,e)=>{const i=this.listElement;if(!i)return;const r=i.items[t];r&&r.removeAttribute(e)},elementContainsClass:(t,e)=>t.classList.contains(e),closeSurface:()=>{this.open=!1},getElementIndex:t=>{const e=this.listElement;return e?e.items.indexOf(t):-1},notifySelected:()=>{},getMenuItemCount:()=>{const t=this.listElement;return t?t.items.length:0},focusItemAtIndex:t=>{const e=this.listElement;if(!e)return;const i=e.items[t];i&&i.focus()},focusListRoot:()=>{this.listElement&&this.listElement.focus()},getSelectedSiblingOfItemAtIndex:t=>{const e=this.listElement;if(!e)return-1;const i=e.items[t];if(!i||!i.group)return-1;for(let r=0;r<e.items.length;r++){if(r===t)continue;const n=e.items[r];if(n.selected&&n.group===i.group)return r}return-1},isSelectableItemAtIndex:t=>{const e=this.listElement;if(!e)return!1;const i=e.items[t];return!!i&&i.hasAttribute("group")}}}onKeydown(t){this.mdcFoundation&&this.mdcFoundation.handleKeydown(t)}onAction(t){const e=this.listElement;if(this.mdcFoundation&&e){const i=t.detail.index,r=e.items[i];r&&this.mdcFoundation.handleItemAction(r)}}onOpened(){this.open=!0,this.mdcFoundation&&this.mdcFoundation.handleMenuSurfaceOpened()}onClosed(){this.open=!1}async _getUpdateComplete(){await this._listUpdateComplete,await super._getUpdateComplete()}async firstUpdated(){super.firstUpdated();const t=this.listElement;t&&(this._listUpdateComplete=t.updateComplete,await this._listUpdateComplete)}select(t){const e=this.listElement;e&&e.select(t)}close(){this.open=!1}show(){this.open=!0}getFocusedItemIndex(){const t=this.listElement;return t?t.getFocusedItemIndex():-1}focusItemAtIndex(t){const e=this.listElement;e&&e.focusItemAtIndex(t)}layout(t=!0){const e=this.listElement;e&&e.layout(t)}}r([wt(".mdc-menu")],fr.prototype,"mdcRoot",void 0),r([wt("slot")],fr.prototype,"slotElement",void 0),r([yt({type:Object})],fr.prototype,"anchor",void 0),r([yt({type:Boolean,reflect:!0})],fr.prototype,"open",void 0),r([yt({type:Boolean})],fr.prototype,"quick",void 0),r([yt({type:Boolean})],fr.prototype,"wrapFocus",void 0),r([yt({type:String})],fr.prototype,"innerRole",void 0),r([yt({type:String})],fr.prototype,"corner",void 0),r([yt({type:Number})],fr.prototype,"x",void 0),r([yt({type:Number})],fr.prototype,"y",void 0),r([yt({type:Boolean})],fr.prototype,"absolute",void 0),r([yt({type:Boolean})],fr.prototype,"multi",void 0),r([yt({type:Boolean})],fr.prototype,"activatable",void 0),r([yt({type:Boolean})],fr.prototype,"fixed",void 0),r([yt({type:Boolean})],fr.prototype,"forceGroupSelection",void 0),r([yt({type:Boolean})],fr.prototype,"fullwidth",void 0),r([yt({type:String})],fr.prototype,"menuCorner",void 0),r([yt({type:String}),fe((function(t){this.mdcFoundation&&this.mdcFoundation.setDefaultFocusState(dr[t])}))],fr.prototype,"defaultFocus",void 0);
/**
@license
Copyright 2018 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
const mr=Ct`mwc-list ::slotted([mwc-list-item]:not([twoline])){height:var(--mdc-menu-item-height, 48px)}mwc-list{max-width:var(--mdc-menu-max-width, auto);min-width:var(--mdc-menu-min-width, auto)}`
/**
@license
Copyright 2020 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/;let gr=class extends fr{};gr.styles=mr,gr=r([bt("mwc-menu")],gr);
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var br={NOTCH_ELEMENT_SELECTOR:".mdc-notched-outline__notch"},vr={NOTCH_ELEMENT_PADDING:8},yr={NO_LABEL:"mdc-notched-outline--no-label",OUTLINE_NOTCHED:"mdc-notched-outline--notched",OUTLINE_UPGRADED:"mdc-notched-outline--upgraded"},_r=function(t){function r(e){return t.call(this,i(i({},r.defaultAdapter),e))||this}return e(r,t),Object.defineProperty(r,"strings",{get:function(){return br},enumerable:!0,configurable:!0}),Object.defineProperty(r,"cssClasses",{get:function(){return yr},enumerable:!0,configurable:!0}),Object.defineProperty(r,"numbers",{get:function(){return vr},enumerable:!0,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNotchWidthProperty:function(){},removeNotchWidthProperty:function(){}}},enumerable:!0,configurable:!0}),r.prototype.notch=function(t){var e=r.cssClasses.OUTLINE_NOTCHED;t>0&&(t+=vr.NOTCH_ELEMENT_PADDING),this.adapter.setNotchWidthProperty(t),this.adapter.addClass(e)},r.prototype.closeNotch=function(){var t=r.cssClasses.OUTLINE_NOTCHED;this.adapter.removeClass(t),this.adapter.removeNotchWidthProperty()},r}(ee);class wr extends pe{constructor(){super(...arguments),this.mdcFoundationClass=_r,this.width=0,this.open=!1,this.lastOpen=this.open}createAdapter(){return{addClass:t=>this.mdcRoot.classList.add(t),removeClass:t=>this.mdcRoot.classList.remove(t),setNotchWidthProperty:t=>this.notchElement.style.setProperty("width",t+"px"),removeNotchWidthProperty:()=>this.notchElement.style.removeProperty("width")}}openOrClose(t,e){this.mdcFoundation&&(t&&void 0!==e?this.mdcFoundation.notch(e):this.mdcFoundation.closeNotch())}render(){this.openOrClose(this.open,this.width);const t=be({"mdc-notched-outline--notched":this.open});return Z`
      <span class="mdc-notched-outline ${t}">
        <span class="mdc-notched-outline__leading"></span>
        <span class="mdc-notched-outline__notch">
          <slot></slot>
        </span>
        <span class="mdc-notched-outline__trailing"></span>
      </span>`}}r([wt(".mdc-notched-outline")],wr.prototype,"mdcRoot",void 0),r([yt({type:Number})],wr.prototype,"width",void 0),r([yt({type:Boolean,reflect:!0})],wr.prototype,"open",void 0),r([wt(".mdc-notched-outline__notch")],wr.prototype,"notchElement",void 0);
/**
@license
Copyright 2018 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
const xr=Ct`.mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline,.mdc-notched-outline[dir=rtl]{text-align:right}.mdc-notched-outline__leading,.mdc-notched-outline__notch,.mdc-notched-outline__trailing{box-sizing:border-box;height:100%;border-top:1px solid;border-bottom:1px solid;pointer-events:none}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;width:12px}[dir=rtl] .mdc-notched-outline__leading,.mdc-notched-outline__leading[dir=rtl]{border-left:none;border-right:1px solid}.mdc-notched-outline__trailing{border-left:none;border-right:1px solid;flex-grow:1}[dir=rtl] .mdc-notched-outline__trailing,.mdc-notched-outline__trailing[dir=rtl]{border-left:1px solid;border-right:none}.mdc-notched-outline__notch{flex:0 0 auto;width:auto;max-width:calc(100% - 12px * 2)}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(100% / 0.75)}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch,.mdc-notched-outline--notched .mdc-notched-outline__notch[dir=rtl]{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{padding:0}:host{display:block;position:absolute;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] :host,:host[dir=rtl]{text-align:right}::slotted(.mdc-floating-label){display:inline-block;position:relative;top:17px;bottom:auto;max-width:100%}::slotted(.mdc-floating-label--float-above){text-overflow:clip}.mdc-notched-outline--upgraded ::slotted(.mdc-floating-label--float-above){max-width:calc(100% / .75)}.mdc-notched-outline .mdc-notched-outline__leading{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:4px;border-bottom-left-radius:var(--mdc-shape-small, 4px)}[dir=rtl] .mdc-notched-outline .mdc-notched-outline__leading,.mdc-notched-outline .mdc-notched-outline__leading[dir=rtl]{border-top-left-radius:0;border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:4px;border-bottom-right-radius:var(--mdc-shape-small, 4px);border-bottom-left-radius:0}@supports(top: max(0%)){.mdc-notched-outline .mdc-notched-outline__leading{width:max(12px, var(--mdc-shape-small, 4px))}}@supports(top: max(0%)){.mdc-notched-outline .mdc-notched-outline__notch{max-width:calc(100% - max(12px, var(--mdc-shape-small, 4px)) * 2)}}.mdc-notched-outline .mdc-notched-outline__trailing{border-top-left-radius:0;border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:4px;border-bottom-right-radius:var(--mdc-shape-small, 4px);border-bottom-left-radius:0}[dir=rtl] .mdc-notched-outline .mdc-notched-outline__trailing,.mdc-notched-outline .mdc-notched-outline__trailing[dir=rtl]{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:4px;border-bottom-left-radius:var(--mdc-shape-small, 4px)}.mdc-notched-outline__leading,.mdc-notched-outline__notch,.mdc-notched-outline__trailing{border-color:var(--mdc-notched-outline-border-color, var(--mdc-theme-primary, #6200ee));border-width:1px;border-width:var(--mdc-notched-outline-stroke-width, 1px)}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:0;padding-top:var(--mdc-notched-outline-notch-offset, 0)}`;let Mr=class extends wr{};Mr.styles=xr,Mr=r([bt("mwc-notched-outline")],Mr);
/**
 * @license
 * Copyright 2020 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var kr=["input","button","textarea","select"],Sr=function(t){var e=t.target;if(e){var i=(""+e.tagName).toLowerCase();-1===kr.indexOf(i)&&t.preventDefault()}};function Er(t,e){for(var i=new Map,r=0;r<t;r++){var n=e(r).trim();if(n){var o=n[0].toLowerCase();i.has(o)||i.set(o,[]),i.get(o).push({text:n.toLowerCase(),index:r})}}return i.forEach((function(t){t.sort((function(t,e){return t.index-e.index}))})),i}function Ar(t,e){var i,r=t.nextChar,n=t.focusItemAtIndex,o=t.sortedIndexByFirstChar,s=t.focusedItemIndex,a=t.skipFocus,l=t.isItemAtIndexDisabled;return clearTimeout(e.bufferClearTimeout),e.bufferClearTimeout=setTimeout((function(){!function(t){t.typeaheadBuffer=""}(e)}),Di.TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS),e.typeaheadBuffer=e.typeaheadBuffer+r,-1===(i=1===e.typeaheadBuffer.length?function(t,e,i,r){var n=r.typeaheadBuffer[0],o=t.get(n);if(!o)return-1;if(n===r.currentFirstChar&&o[r.sortedIndexCursor].index===e){r.sortedIndexCursor=(r.sortedIndexCursor+1)%o.length;var s=o[r.sortedIndexCursor].index;if(!i(s))return s}r.currentFirstChar=n;var a,l=-1;for(a=0;a<o.length;a++)if(!i(o[a].index)){l=a;break}for(;a<o.length;a++)if(o[a].index>e&&!i(o[a].index)){l=a;break}if(-1!==l)return r.sortedIndexCursor=l,o[r.sortedIndexCursor].index;return-1}(o,s,l,e):function(t,e,i){var r=i.typeaheadBuffer[0],n=t.get(r);if(!n)return-1;var o=n[i.sortedIndexCursor];if(0===o.text.lastIndexOf(i.typeaheadBuffer,0)&&!e(o.index))return o.index;var s=(i.sortedIndexCursor+1)%n.length,a=-1;for(;s!==i.sortedIndexCursor;){var l=n[s],d=0===l.text.lastIndexOf(i.typeaheadBuffer,0),c=!e(l.index);if(d&&c){a=s;break}s=(s+1)%n.length}if(-1!==a)return i.sortedIndexCursor=a,n[i.sortedIndexCursor].index;return-1}(o,l,e))||a||n(i),i}function Tr(t){return t.typeaheadBuffer.length>0}
/**
@license
Copyright 2018 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
class Ir extends pe{createRenderRoot(){return this.attachShadow({mode:"open",delegatesFocus:!0})}click(){this.formElement&&(this.formElement.focus(),this.formElement.click())}setAriaLabel(t){this.formElement&&this.formElement.setAttribute("aria-label",t)}firstUpdated(){super.firstUpdated(),this.mdcRoot.addEventListener("change",(t=>{this.dispatchEvent(new Event("change",t))}))}}
/**
 * @license
 * Copyright 2016 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */var Cr={LABEL_FLOAT_ABOVE:"mdc-floating-label--float-above",LABEL_REQUIRED:"mdc-floating-label--required",LABEL_SHAKE:"mdc-floating-label--shake",ROOT:"mdc-floating-label"},Rr=function(t){function r(e){var n=t.call(this,i(i({},r.defaultAdapter),e))||this;return n.shakeAnimationEndHandler_=function(){return n.handleShakeAnimationEnd_()},n}return e(r,t),Object.defineProperty(r,"cssClasses",{get:function(){return Cr},enumerable:!0,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},getWidth:function(){return 0},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){}}},enumerable:!0,configurable:!0}),r.prototype.init=function(){this.adapter.registerInteractionHandler("animationend",this.shakeAnimationEndHandler_)},r.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("animationend",this.shakeAnimationEndHandler_)},r.prototype.getWidth=function(){return this.adapter.getWidth()},r.prototype.shake=function(t){var e=r.cssClasses.LABEL_SHAKE;t?this.adapter.addClass(e):this.adapter.removeClass(e)},r.prototype.float=function(t){var e=r.cssClasses,i=e.LABEL_FLOAT_ABOVE,n=e.LABEL_SHAKE;t?this.adapter.addClass(i):(this.adapter.removeClass(i),this.adapter.removeClass(n))},r.prototype.setRequired=function(t){var e=r.cssClasses.LABEL_REQUIRED;t?this.adapter.addClass(e):this.adapter.removeClass(e)},r.prototype.handleShakeAnimationEnd_=function(){var t=r.cssClasses.LABEL_SHAKE;this.adapter.removeClass(t)},r}(ee);
/**
 * @license
 * Copyright 2016 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */const Or=new WeakMap,Lr=m((t=>e=>{if(!Or.get(e)){const i=e.committer.element;i.classList.add("mdc-floating-label");const r=(t=>({addClass:e=>t.classList.add(e),removeClass:e=>t.classList.remove(e),getWidth:()=>t.scrollWidth,registerInteractionHandler:(e,i)=>{t.addEventListener(e,i)},deregisterInteractionHandler:(e,i)=>{t.removeEventListener(e,i)}}))(i),n=new Rr(r);n.init(),e.setValue(n),Or.set(e,{label:t,foundation:n})}}));
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var Pr={LINE_RIPPLE_ACTIVE:"mdc-line-ripple--active",LINE_RIPPLE_DEACTIVATING:"mdc-line-ripple--deactivating"},Br=function(t){function r(e){var n=t.call(this,i(i({},r.defaultAdapter),e))||this;return n.transitionEndHandler_=function(t){return n.handleTransitionEnd(t)},n}return e(r,t),Object.defineProperty(r,"cssClasses",{get:function(){return Pr},enumerable:!0,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setStyle:function(){},registerEventHandler:function(){},deregisterEventHandler:function(){}}},enumerable:!0,configurable:!0}),r.prototype.init=function(){this.adapter.registerEventHandler("transitionend",this.transitionEndHandler_)},r.prototype.destroy=function(){this.adapter.deregisterEventHandler("transitionend",this.transitionEndHandler_)},r.prototype.activate=function(){this.adapter.removeClass(Pr.LINE_RIPPLE_DEACTIVATING),this.adapter.addClass(Pr.LINE_RIPPLE_ACTIVE)},r.prototype.setRippleCenter=function(t){this.adapter.setStyle("transform-origin",t+"px center")},r.prototype.deactivate=function(){this.adapter.addClass(Pr.LINE_RIPPLE_DEACTIVATING)},r.prototype.handleTransitionEnd=function(t){var e=this.adapter.hasClass(Pr.LINE_RIPPLE_DEACTIVATING);"opacity"===t.propertyName&&e&&(this.adapter.removeClass(Pr.LINE_RIPPLE_ACTIVE),this.adapter.removeClass(Pr.LINE_RIPPLE_DEACTIVATING))},r}(ee);
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */const Nr=new WeakMap,$r=m((()=>t=>{if(!Nr.get(t)){const e=t.committer.element;e.classList.add("mdc-line-ripple");const i=(t=>({addClass:e=>t.classList.add(e),removeClass:e=>t.classList.remove(e),hasClass:e=>t.classList.contains(e),setStyle:(e,i)=>t.style.setProperty(e,i),registerEventHandler:(e,i)=>{t.addEventListener(e,i)},deregisterEventHandler:(e,i)=>{t.removeEventListener(e,i)}}))(e),r=new Br(i);r.init(),t.setValue(r),Nr.set(t,r)}}));
/**
 * @license
 * Copyright 2016 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var zr={ACTIVATED:"mdc-select--activated",DISABLED:"mdc-select--disabled",FOCUSED:"mdc-select--focused",INVALID:"mdc-select--invalid",MENU_INVALID:"mdc-select__menu--invalid",OUTLINED:"mdc-select--outlined",REQUIRED:"mdc-select--required",ROOT:"mdc-select",WITH_LEADING_ICON:"mdc-select--with-leading-icon"},jr={ARIA_CONTROLS:"aria-controls",ARIA_DESCRIBEDBY:"aria-describedby",ARIA_SELECTED_ATTR:"aria-selected",CHANGE_EVENT:"MDCSelect:change",HIDDEN_INPUT_SELECTOR:'input[type="hidden"]',LABEL_SELECTOR:".mdc-floating-label",LEADING_ICON_SELECTOR:".mdc-select__icon",LINE_RIPPLE_SELECTOR:".mdc-line-ripple",MENU_SELECTOR:".mdc-select__menu",OUTLINE_SELECTOR:".mdc-notched-outline",SELECTED_TEXT_SELECTOR:".mdc-select__selected-text",SELECT_ANCHOR_SELECTOR:".mdc-select__anchor",VALUE_ATTR:"data-value"},Fr={LABEL_SCALE:.75,UNSET_INDEX:-1},Dr=function(t){function r(e,n){void 0===n&&(n={});var o=t.call(this,i(i({},r.defaultAdapter),e))||this;return o.disabled=!1,o.isMenuOpen=!1,o.useDefaultValidation=!0,o.customValidity=!0,o.lastSelectedIndex=Fr.UNSET_INDEX,o.leadingIcon=n.leadingIcon,o.helperText=n.helperText,o}return e(r,t),Object.defineProperty(r,"cssClasses",{get:function(){return zr},enumerable:!0,configurable:!0}),Object.defineProperty(r,"numbers",{get:function(){return Fr},enumerable:!0,configurable:!0}),Object.defineProperty(r,"strings",{get:function(){return jr},enumerable:!0,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},activateBottomLine:function(){},deactivateBottomLine:function(){},getSelectedIndex:function(){return-1},setSelectedIndex:function(){},hasLabel:function(){return!1},floatLabel:function(){},getLabelWidth:function(){return 0},setLabelRequired:function(){},hasOutline:function(){return!1},notchOutline:function(){},closeOutline:function(){},setRippleCenter:function(){},notifyChange:function(){},setSelectedText:function(){},isSelectAnchorFocused:function(){return!1},getSelectAnchorAttr:function(){return""},setSelectAnchorAttr:function(){},removeSelectAnchorAttr:function(){},addMenuClass:function(){},removeMenuClass:function(){},openMenu:function(){},closeMenu:function(){},getAnchorElement:function(){return null},setMenuAnchorElement:function(){},setMenuAnchorCorner:function(){},setMenuWrapFocus:function(){},focusMenuItemAtIndex:function(){},getMenuItemCount:function(){return 0},getMenuItemValues:function(){return[]},getMenuItemTextAtIndex:function(){return""},isTypeaheadInProgress:function(){return!1},typeaheadMatchItem:function(){return-1}}},enumerable:!0,configurable:!0}),r.prototype.getSelectedIndex=function(){return this.adapter.getSelectedIndex()},r.prototype.setSelectedIndex=function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1),t>=this.adapter.getMenuItemCount()||(t===Fr.UNSET_INDEX?this.adapter.setSelectedText(""):this.adapter.setSelectedText(this.adapter.getMenuItemTextAtIndex(t).trim()),this.adapter.setSelectedIndex(t),e&&this.adapter.closeMenu(),i||this.lastSelectedIndex===t||this.handleChange(),this.lastSelectedIndex=t)},r.prototype.setValue=function(t,e){void 0===e&&(e=!1);var i=this.adapter.getMenuItemValues().indexOf(t);this.setSelectedIndex(i,!1,e)},r.prototype.getValue=function(){var t=this.adapter.getSelectedIndex(),e=this.adapter.getMenuItemValues();return t!==Fr.UNSET_INDEX?e[t]:""},r.prototype.getDisabled=function(){return this.disabled},r.prototype.setDisabled=function(t){this.disabled=t,this.disabled?(this.adapter.addClass(zr.DISABLED),this.adapter.closeMenu()):this.adapter.removeClass(zr.DISABLED),this.leadingIcon&&this.leadingIcon.setDisabled(this.disabled),this.disabled?this.adapter.removeSelectAnchorAttr("tabindex"):this.adapter.setSelectAnchorAttr("tabindex","0"),this.adapter.setSelectAnchorAttr("aria-disabled",this.disabled.toString())},r.prototype.openMenu=function(){this.adapter.addClass(zr.ACTIVATED),this.adapter.openMenu(),this.isMenuOpen=!0,this.adapter.setSelectAnchorAttr("aria-expanded","true")},r.prototype.setHelperTextContent=function(t){this.helperText&&this.helperText.setContent(t)},r.prototype.layout=function(){if(this.adapter.hasLabel()){var t=this.getValue().length>0,e=this.adapter.hasClass(zr.FOCUSED),i=t||e,r=this.adapter.hasClass(zr.REQUIRED);this.notchOutline(i),this.adapter.floatLabel(i),this.adapter.setLabelRequired(r)}},r.prototype.layoutOptions=function(){var t=this.adapter.getMenuItemValues().indexOf(this.getValue());this.setSelectedIndex(t,!1,!0)},r.prototype.handleMenuOpened=function(){if(0!==this.adapter.getMenuItemValues().length){var t=this.getSelectedIndex(),e=t>=0?t:0;this.adapter.focusMenuItemAtIndex(e)}},r.prototype.handleMenuClosed=function(){this.adapter.removeClass(zr.ACTIVATED),this.isMenuOpen=!1,this.adapter.setSelectAnchorAttr("aria-expanded","false"),this.adapter.isSelectAnchorFocused()||this.blur()},r.prototype.handleChange=function(){this.layout(),this.adapter.notifyChange(this.getValue()),this.adapter.hasClass(zr.REQUIRED)&&this.useDefaultValidation&&this.setValid(this.isValid())},r.prototype.handleMenuItemAction=function(t){this.setSelectedIndex(t,!0)},r.prototype.handleFocus=function(){this.adapter.addClass(zr.FOCUSED),this.layout(),this.adapter.activateBottomLine()},r.prototype.handleBlur=function(){this.isMenuOpen||this.blur()},r.prototype.handleClick=function(t){this.disabled||(this.isMenuOpen?this.adapter.closeMenu():(this.adapter.setRippleCenter(t),this.openMenu()))},r.prototype.handleKeydown=function(t){if(!this.isMenuOpen&&this.adapter.hasClass(zr.FOCUSED)){var e=$i(t)===di,i=$i(t)===ci,r=$i(t)===gi,n=$i(t)===vi;if(!i&&t.key&&1===t.key.length||i&&this.adapter.isTypeaheadInProgress()){var o=i?" ":t.key,s=this.adapter.typeaheadMatchItem(o,this.getSelectedIndex());return s>=0&&this.setSelectedIndex(s),void t.preventDefault()}(e||i||r||n)&&(r&&this.getSelectedIndex()>0?this.setSelectedIndex(this.getSelectedIndex()-1):n&&this.getSelectedIndex()<this.adapter.getMenuItemCount()-1&&this.setSelectedIndex(this.getSelectedIndex()+1),this.openMenu(),t.preventDefault())}},r.prototype.notchOutline=function(t){if(this.adapter.hasOutline()){var e=this.adapter.hasClass(zr.FOCUSED);if(t){var i=Fr.LABEL_SCALE,r=this.adapter.getLabelWidth()*i;this.adapter.notchOutline(r)}else e||this.adapter.closeOutline()}},r.prototype.setLeadingIconAriaLabel=function(t){this.leadingIcon&&this.leadingIcon.setAriaLabel(t)},r.prototype.setLeadingIconContent=function(t){this.leadingIcon&&this.leadingIcon.setContent(t)},r.prototype.setUseDefaultValidation=function(t){this.useDefaultValidation=t},r.prototype.setValid=function(t){this.useDefaultValidation||(this.customValidity=t),this.adapter.setSelectAnchorAttr("aria-invalid",(!t).toString()),t?(this.adapter.removeClass(zr.INVALID),this.adapter.removeMenuClass(zr.MENU_INVALID)):(this.adapter.addClass(zr.INVALID),this.adapter.addMenuClass(zr.MENU_INVALID)),this.syncHelperTextValidity(t)},r.prototype.isValid=function(){return this.useDefaultValidation&&this.adapter.hasClass(zr.REQUIRED)&&!this.adapter.hasClass(zr.DISABLED)?this.getSelectedIndex()!==Fr.UNSET_INDEX&&(0!==this.getSelectedIndex()||Boolean(this.getValue())):this.customValidity},r.prototype.setRequired=function(t){t?this.adapter.addClass(zr.REQUIRED):this.adapter.removeClass(zr.REQUIRED),this.adapter.setSelectAnchorAttr("aria-required",t.toString()),this.adapter.setLabelRequired(t)},r.prototype.getRequired=function(){return"true"===this.adapter.getSelectAnchorAttr("aria-required")},r.prototype.init=function(){var t=this.adapter.getAnchorElement();t&&(this.adapter.setMenuAnchorElement(t),this.adapter.setMenuAnchorCorner(tr.BOTTOM_START)),this.adapter.setMenuWrapFocus(!1),this.setDisabled(this.adapter.hasClass(zr.DISABLED)),this.syncHelperTextValidity(!this.adapter.hasClass(zr.INVALID)),this.layout(),this.layoutOptions()},r.prototype.blur=function(){this.adapter.removeClass(zr.FOCUSED),this.layout(),this.adapter.deactivateBottomLine(),this.adapter.hasClass(zr.REQUIRED)&&this.useDefaultValidation&&this.setValid(this.isValid())},r.prototype.syncHelperTextValidity=function(t){if(this.helperText){this.helperText.setValidity(t);var e=this.helperText.isVisible(),i=this.helperText.getId();e&&i?this.adapter.setSelectAnchorAttr(jr.ARIA_DESCRIBEDBY,i):this.adapter.removeSelectAnchorAttr(jr.ARIA_DESCRIBEDBY)}},r}(ee);const qr=(t={})=>{const e={};for(const i in t)e[i]=t[i];return Object.assign({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1},e)};class Ur extends Ir{constructor(){super(...arguments),this.mdcFoundationClass=Dr,this.disabled=!1,this.outlined=!1,this.label="",this.outlineOpen=!1,this.outlineWidth=0,this.value="",this.selectedText="",this.icon="",this.menuOpen=!1,this.helper="",this.validateOnInitialRender=!1,this.validationMessage="",this.required=!1,this.naturalMenuWidth=!1,this.isUiValid=!0,this.typeaheadState={bufferClearTimeout:0,currentFirstChar:"",sortedIndexCursor:0,typeaheadBuffer:""},this.sortedIndexByFirstChar=new Map,this.menuElement_=null,this.listeners=[],this.onBodyClickBound=()=>{},this._menuUpdateComplete=null,this.renderReady=!1,this.valueSetDirectly=!1,this.validityTransform=null,this._validity=qr()}get items(){return this.menuElement_||(this.menuElement_=this.menuElement),this.menuElement_?this.menuElement_.items:[]}get selected(){const t=this.menuElement;return t?t.selected:null}get index(){const t=this.menuElement;return t?t.index:-1}get shouldRenderHelperText(){return!!this.helper||!!this.validationMessage}get validity(){return this._checkValidity(this.value),this._validity}render(){const t={"mdc-select--disabled":this.disabled,"mdc-select--no-label":!this.label,"mdc-select--filled":!this.outlined,"mdc-select--outlined":this.outlined,"mdc-select--with-leading-icon":!!this.icon,"mdc-select--required":this.required,"mdc-select--invalid":!this.isUiValid},e={"mdc-select__menu--invalid":!this.isUiValid},i=this.shouldRenderHelperText?"helper-text":void 0;return Z`
      <div
          class="mdc-select ${be(t)}">
        <input
            class="formElement"
            .value=${this.value}
            hidden
            ?required=${this.required}>
        <!-- @ts-ignore -->
        <div class="mdc-select__anchor"
            aria-autocomplete="none"
            role="combobox"
            aria-expanded=${this.menuOpen}
            aria-invalid=${!this.isUiValid}
            aria-haspopup="listbox"
            aria-labelledby="label"
            aria-required=${this.required}
            aria-describedby=${oi(i)}
            @click=${this.onClick}
            @focus=${this.onFocus}
            @blur=${this.onBlur}
            @keydown=${this.onKeydown}>
          ${this.renderRipple()}
          ${this.outlined?this.renderOutline():this.renderLabel()}
          ${this.renderLeadingIcon()}
          <span class="mdc-select__selected-text-container">
            <span class="mdc-select__selected-text">${this.selectedText}</span>
          </span>
          <span class="mdc-select__dropdown-icon">
            <svg
                class="mdc-select__dropdown-icon-graphic"
                viewBox="7 10 10 5"
                focusable="false">
              <polygon
                  class="mdc-select__dropdown-icon-inactive"
                  stroke="none"
                  fill-rule="evenodd"
                  points="7 10 12 15 17 10">
              </polygon>
              <polygon
                  class="mdc-select__dropdown-icon-active"
                  stroke="none"
                  fill-rule="evenodd"
                  points="7 15 12 10 17 15">
              </polygon>
            </svg>
          </span>
          ${this.renderLineRipple()}
        </div>
        <mwc-menu
            innerRole="listbox"
            wrapFocus
            class="mdc-select__menu mdc-menu mdc-menu-surface ${be(e)}"
            activatable
            .fullwidth=${!this.naturalMenuWidth}
            .open=${this.menuOpen}
            .anchor=${this.anchorElement}
            @selected=${this.onSelected}
            @opened=${this.onOpened}
            @closed=${this.onClosed}
            @items-updated=${this.onItemsUpdated}
            @keydown=${this.handleTypeahead}>
          <slot></slot>
        </mwc-menu>
      </div>
      ${this.renderHelperText()}`}renderRipple(){return this.outlined?_:Z`
      <span class="mdc-select__ripple"></span>
    `}renderOutline(){return this.outlined?Z`
      <mwc-notched-outline
          .width=${this.outlineWidth}
          .open=${this.outlineOpen}
          class="mdc-notched-outline">
        ${this.renderLabel()}
      </mwc-notched-outline>`:_}renderLabel(){return this.label?Z`
      <span
          .floatingLabelFoundation=${Lr(this.label)}
          id="label">${this.label}</span>
    `:_}renderLeadingIcon(){return this.icon?Z`<mwc-icon class="mdc-select__icon"><div>${this.icon}</div></mwc-icon>`:_}renderLineRipple(){return this.outlined?_:Z`
      <span .lineRippleFoundation=${$r()}></span>
    `}renderHelperText(){if(!this.shouldRenderHelperText)return _;const t=this.validationMessage&&!this.isUiValid;return Z`
        <p
          class="mdc-select-helper-text ${be({"mdc-select-helper-text--validation-msg":t})}"
          id="helper-text">${t?this.validationMessage:this.helper}</p>`}createAdapter(){return Object.assign(Object.assign({},se(this.mdcRoot)),{activateBottomLine:()=>{this.lineRippleElement&&this.lineRippleElement.lineRippleFoundation.activate()},deactivateBottomLine:()=>{this.lineRippleElement&&this.lineRippleElement.lineRippleFoundation.deactivate()},hasLabel:()=>!!this.label,floatLabel:t=>{this.labelElement&&this.labelElement.floatingLabelFoundation.float(t)},getLabelWidth:()=>this.labelElement?this.labelElement.floatingLabelFoundation.getWidth():0,setLabelRequired:t=>{this.labelElement&&this.labelElement.floatingLabelFoundation.setRequired(t)},hasOutline:()=>this.outlined,notchOutline:t=>{this.outlineElement&&!this.outlineOpen&&(this.outlineWidth=t,this.outlineOpen=!0)},closeOutline:()=>{this.outlineElement&&(this.outlineOpen=!1)},setRippleCenter:t=>{if(this.lineRippleElement){this.lineRippleElement.lineRippleFoundation.setRippleCenter(t)}},notifyChange:async t=>{if(!this.valueSetDirectly&&t===this.value)return;this.valueSetDirectly=!1,this.value=t,await this.updateComplete;const e=new Event("change",{bubbles:!0});this.dispatchEvent(e)},setSelectedText:t=>this.selectedText=t,isSelectAnchorFocused:()=>{const t=this.anchorElement;if(!t)return!1;return t.getRootNode().activeElement===t},getSelectAnchorAttr:t=>{const e=this.anchorElement;return e?e.getAttribute(t):null},setSelectAnchorAttr:(t,e)=>{const i=this.anchorElement;i&&i.setAttribute(t,e)},removeSelectAnchorAttr:t=>{const e=this.anchorElement;e&&e.removeAttribute(t)},openMenu:()=>{this.menuOpen=!0},closeMenu:()=>{this.menuOpen=!1},addMenuClass:()=>{},removeMenuClass:()=>{},getAnchorElement:()=>this.anchorElement,setMenuAnchorElement:()=>{},setMenuAnchorCorner:()=>{const t=this.menuElement;t&&(t.corner="BOTTOM_START")},setMenuWrapFocus:t=>{const e=this.menuElement;e&&(e.wrapFocus=t)},focusMenuItemAtIndex:t=>{const e=this.menuElement;if(!e)return;const i=e.items[t];i&&i.focus()},getMenuItemCount:()=>{const t=this.menuElement;return t?t.items.length:0},getMenuItemValues:()=>{const t=this.menuElement;if(!t)return[];return t.items.map((t=>t.value))},getMenuItemTextAtIndex:t=>{const e=this.menuElement;if(!e)return"";const i=e.items[t];return i?i.text:""},getSelectedIndex:()=>this.index,setSelectedIndex:()=>{},isTypeaheadInProgress:()=>Tr(this.typeaheadState),typeaheadMatchItem:(t,e)=>{if(!this.menuElement)return-1;const i=Ar({focusItemAtIndex:t=>{this.menuElement.focusItemAtIndex(t)},focusedItemIndex:e||this.menuElement.getFocusedItemIndex(),nextChar:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,skipFocus:!1,isItemAtIndexDisabled:t=>this.items[t].disabled},this.typeaheadState);return-1!==i&&this.select(i),i}})}checkValidity(){const t=this._checkValidity(this.value);if(!t){const t=new Event("invalid",{bubbles:!1,cancelable:!0});this.dispatchEvent(t)}return t}reportValidity(){const t=this.checkValidity();return this.isUiValid=t,t}_checkValidity(t){const e=this.formElement.validity;let i=qr(e);if(this.validityTransform){const e=this.validityTransform(t,i);i=Object.assign(Object.assign({},i),e)}return this._validity=i,this._validity.valid}setCustomValidity(t){this.validationMessage=t,this.formElement.setCustomValidity(t)}async _getUpdateComplete(){await this._menuUpdateComplete,await super._getUpdateComplete()}async firstUpdated(){const t=this.menuElement;if(t&&(this._menuUpdateComplete=t.updateComplete,await this._menuUpdateComplete),super.firstUpdated(),this.mdcFoundation.isValid=()=>!0,this.mdcFoundation.setValid=()=>{},this.mdcFoundation.setDisabled(this.disabled),this.validateOnInitialRender&&this.reportValidity(),!this.selected){!this.items.length&&this.slotElement&&this.slotElement.assignedNodes({flatten:!0}).length&&(await new Promise((t=>requestAnimationFrame(t))),await this.layout());const t=this.items.length&&""===this.items[0].value;if(!this.value&&t)return void this.select(0);this.selectByValue(this.value)}this.sortedIndexByFirstChar=Er(this.items.length,(t=>this.items[t].text)),this.renderReady=!0}onItemsUpdated(){this.sortedIndexByFirstChar=Er(this.items.length,(t=>this.items[t].text))}select(t){const e=this.menuElement;e&&e.select(t)}selectByValue(t){let e=-1;for(let i=0;i<this.items.length;i++){if(this.items[i].value===t){e=i;break}}this.valueSetDirectly=!0,this.select(e),this.mdcFoundation.handleChange()}disconnectedCallback(){super.disconnectedCallback();for(const t of this.listeners)t.target.removeEventListener(t.name,t.cb)}focus(){const t=new CustomEvent("focus"),e=this.anchorElement;e&&(e.dispatchEvent(t),e.focus())}blur(){const t=new CustomEvent("blur"),e=this.anchorElement;e&&(e.dispatchEvent(t),e.blur())}onFocus(){this.mdcFoundation&&this.mdcFoundation.handleFocus()}onBlur(){this.mdcFoundation&&this.mdcFoundation.handleBlur();const t=this.menuElement;t&&!t.open&&this.reportValidity()}onClick(t){if(this.mdcFoundation){this.focus();const e=t.target.getBoundingClientRect();let i=0;i="touches"in t?t.touches[0].clientX:t.clientX;const r=i-e.left;this.mdcFoundation.handleClick(r)}}onKeydown(t){const e=$i(t)===gi,i=$i(t)===vi;if(i||e){const r=e&&this.index>0,n=i&&this.index<this.items.length-1;return r?this.select(this.index-1):n&&this.select(this.index+1),t.preventDefault(),void this.mdcFoundation.openMenu()}this.mdcFoundation.handleKeydown(t)}handleTypeahead(t){if(!this.menuElement)return;const e=this.menuElement.getFocusedItemIndex(),i=oe(t.target)?t.target:null;!function(t,e){var i=t.event,r=t.isTargetListItem,n=t.focusedItemIndex,o=t.focusItemAtIndex,s=t.sortedIndexByFirstChar,a=t.isItemAtIndexDisabled,l="ArrowLeft"===$i(i),d="ArrowUp"===$i(i),c="ArrowRight"===$i(i),h="ArrowDown"===$i(i),u="Home"===$i(i),p="End"===$i(i),f="Enter"===$i(i),m="Spacebar"===$i(i);l||d||c||h||u||p||f||(m||1!==i.key.length?m&&(r&&Sr(i),r&&Tr(e)&&Ar({focusItemAtIndex:o,focusedItemIndex:n,nextChar:" ",sortedIndexByFirstChar:s,skipFocus:!1,isItemAtIndexDisabled:a},e)):(Sr(i),Ar({focusItemAtIndex:o,focusedItemIndex:n,nextChar:i.key.toLowerCase(),sortedIndexByFirstChar:s,skipFocus:!1,isItemAtIndexDisabled:a},e)))}({event:t,focusItemAtIndex:t=>{this.menuElement.focusItemAtIndex(t)},focusedItemIndex:e,isTargetListItem:!!i&&i.hasAttribute("mwc-list-item"),sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:t=>this.items[t].disabled},this.typeaheadState)}async onSelected(t){this.mdcFoundation||await this.updateComplete,this.mdcFoundation.handleMenuItemAction(t.detail.index);const e=this.items[t.detail.index];e&&(this.value=e.value)}onOpened(){this.mdcFoundation&&(this.menuOpen=!0,this.mdcFoundation.handleMenuOpened())}onClosed(){this.mdcFoundation&&(this.menuOpen=!1,this.mdcFoundation.handleMenuClosed())}async layout(t=!0){this.mdcFoundation&&this.mdcFoundation.layout(),await this.updateComplete;const e=this.menuElement;e&&e.layout(t);const i=this.labelElement;if(!i)return void(this.outlineOpen=!1);const r=!!this.label&&!!this.value;if(i.floatingLabelFoundation.float(r),!this.outlined)return;this.outlineOpen=r,await this.updateComplete;const n=i.floatingLabelFoundation.getWidth();this.outlineOpen&&(this.outlineWidth=n)}}r([wt(".mdc-select")],Ur.prototype,"mdcRoot",void 0),r([wt(".formElement")],Ur.prototype,"formElement",void 0),r([wt("slot")],Ur.prototype,"slotElement",void 0),r([wt("select")],Ur.prototype,"nativeSelectElement",void 0),r([wt("input")],Ur.prototype,"nativeInputElement",void 0),r([wt(".mdc-line-ripple")],Ur.prototype,"lineRippleElement",void 0),r([wt(".mdc-floating-label")],Ur.prototype,"labelElement",void 0),r([wt("mwc-notched-outline")],Ur.prototype,"outlineElement",void 0),r([wt(".mdc-menu")],Ur.prototype,"menuElement",void 0),r([wt(".mdc-select__anchor")],Ur.prototype,"anchorElement",void 0),r([yt({type:Boolean,attribute:"disabled",reflect:!0}),fe((function(t){this.renderReady&&this.mdcFoundation.setDisabled(t)}))],Ur.prototype,"disabled",void 0),r([yt({type:Boolean}),fe((function(t,e){void 0!==e&&this.outlined!==e&&this.layout(!1)}))],Ur.prototype,"outlined",void 0),r([yt({type:String}),fe((function(t,e){void 0!==e&&this.label!==e&&this.layout(!1)}))],Ur.prototype,"label",void 0),r([yt({type:Boolean})],Ur.prototype,"outlineOpen",void 0),r([yt({type:Number})],Ur.prototype,"outlineWidth",void 0),r([yt({type:String}),fe((function(t){if(this.mdcFoundation){const e=null===this.selected&&!!t,i=this.selected&&this.selected.value!==t;(e||i)&&this.selectByValue(t),this.reportValidity()}}))],Ur.prototype,"value",void 0),r([yt({type:String})],Ur.prototype,"selectedText",void 0),r([yt({type:String})],Ur.prototype,"icon",void 0),r([yt({type:Boolean})],Ur.prototype,"menuOpen",void 0),r([yt({type:String})],Ur.prototype,"helper",void 0),r([yt({type:Boolean})],Ur.prototype,"validateOnInitialRender",void 0),r([yt({type:String})],Ur.prototype,"validationMessage",void 0),r([yt({type:Boolean})],Ur.prototype,"required",void 0),r([yt({type:Boolean})],Ur.prototype,"naturalMenuWidth",void 0),r([yt({type:Boolean})],Ur.prototype,"isUiValid",void 0),r([St({capture:!0})],Ur.prototype,"handleTypeahead",null);
/**
@license
Copyright 2018 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
const Hr=Ct`.mdc-floating-label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight, 400);letter-spacing:0.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, 0.009375em);text-decoration:inherit;text-decoration:var(--mdc-typography-subtitle1-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform, inherit);position:absolute;left:0;transform-origin:left top;line-height:1.15rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform;transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1)}[dir=rtl] .mdc-floating-label,.mdc-floating-label[dir=rtl]{right:0;left:auto;transform-origin:right top;text-align:right}.mdc-floating-label--float-above{cursor:auto}.mdc-floating-label--required::after{margin-left:1px;margin-right:0px;content:"*"}[dir=rtl] .mdc-floating-label--required::after,.mdc-floating-label--required[dir=rtl]::after{margin-left:0;margin-right:1px}.mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-standard 250ms 1}@keyframes mdc-floating-label-shake-float-above-standard{0%{transform:translateX(calc(0 - 0%)) translateY(-106%) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 0%)) translateY(-106%) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 0%)) translateY(-106%) scale(0.75)}100%{transform:translateX(calc(0 - 0%)) translateY(-106%) scale(0.75)}}@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-line-ripple::before,.mdc-line-ripple::after{position:absolute;bottom:0;left:0;width:100%;border-bottom-style:solid;content:""}.mdc-line-ripple::before{border-bottom-width:1px;z-index:1}.mdc-line-ripple::after{transform:scaleX(0);border-bottom-width:2px;opacity:0;z-index:2}.mdc-line-ripple::after{transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-line-ripple--active::after{transform:scaleX(1);opacity:1}.mdc-line-ripple--deactivating::after{opacity:0}.mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline,.mdc-notched-outline[dir=rtl]{text-align:right}.mdc-notched-outline__leading,.mdc-notched-outline__notch,.mdc-notched-outline__trailing{box-sizing:border-box;height:100%;border-top:1px solid;border-bottom:1px solid;pointer-events:none}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;width:12px}[dir=rtl] .mdc-notched-outline__leading,.mdc-notched-outline__leading[dir=rtl]{border-left:none;border-right:1px solid}.mdc-notched-outline__trailing{border-left:none;border-right:1px solid;flex-grow:1}[dir=rtl] .mdc-notched-outline__trailing,.mdc-notched-outline__trailing[dir=rtl]{border-left:1px solid;border-right:none}.mdc-notched-outline__notch{flex:0 0 auto;width:auto;max-width:calc(100% - 12px * 2)}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(100% / 0.75)}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch,.mdc-notched-outline--notched .mdc-notched-outline__notch[dir=rtl]{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{padding:0}.mdc-select{display:inline-flex;position:relative}.mdc-select:not(.mdc-select--disabled) .mdc-select__selected-text{color:rgba(0, 0, 0, 0.87)}.mdc-select.mdc-select--disabled .mdc-select__selected-text{color:rgba(0, 0, 0, 0.38)}.mdc-select:not(.mdc-select--disabled) .mdc-floating-label{color:rgba(0, 0, 0, 0.6)}.mdc-select:not(.mdc-select--disabled).mdc-select--focused .mdc-floating-label{color:rgba(98, 0, 238, 0.87)}.mdc-select.mdc-select--disabled .mdc-floating-label{color:rgba(0, 0, 0, 0.38)}.mdc-select:not(.mdc-select--disabled) .mdc-select__dropdown-icon{fill:rgba(0, 0, 0, 0.54)}.mdc-select:not(.mdc-select--disabled).mdc-select--focused .mdc-select__dropdown-icon{fill:#6200ee;fill:var(--mdc-theme-primary, #6200ee)}.mdc-select.mdc-select--disabled .mdc-select__dropdown-icon{fill:rgba(0, 0, 0, 0.38)}.mdc-select:not(.mdc-select--disabled)+.mdc-select-helper-text{color:rgba(0, 0, 0, 0.6)}.mdc-select.mdc-select--disabled+.mdc-select-helper-text{color:rgba(0, 0, 0, 0.38)}.mdc-select:not(.mdc-select--disabled) .mdc-select__icon{color:rgba(0, 0, 0, 0.54)}.mdc-select.mdc-select--disabled .mdc-select__icon{color:rgba(0, 0, 0, 0.38)}@media screen and (-ms-high-contrast: active){.mdc-select.mdc-select--disabled .mdc-select__selected-text{color:GrayText}.mdc-select.mdc-select--disabled .mdc-select__dropdown-icon{fill:red}.mdc-select.mdc-select--disabled .mdc-floating-label{color:GrayText}.mdc-select.mdc-select--disabled .mdc-line-ripple::before{border-bottom-color:GrayText}.mdc-select.mdc-select--disabled .mdc-notched-outline__leading,.mdc-select.mdc-select--disabled .mdc-notched-outline__notch,.mdc-select.mdc-select--disabled .mdc-notched-outline__trailing{border-color:GrayText}.mdc-select.mdc-select--disabled .mdc-select__icon{color:GrayText}.mdc-select.mdc-select--disabled+.mdc-select-helper-text{color:GrayText}}.mdc-select .mdc-floating-label{top:50%;transform:translateY(-50%);pointer-events:none}.mdc-select .mdc-select__anchor{padding-left:16px;padding-right:0}[dir=rtl] .mdc-select .mdc-select__anchor,.mdc-select .mdc-select__anchor[dir=rtl]{padding-left:0;padding-right:16px}.mdc-select.mdc-select--with-leading-icon .mdc-select__anchor{padding-left:0;padding-right:0}[dir=rtl] .mdc-select.mdc-select--with-leading-icon .mdc-select__anchor,.mdc-select.mdc-select--with-leading-icon .mdc-select__anchor[dir=rtl]{padding-left:0;padding-right:0}.mdc-select .mdc-select__icon{width:24px;height:24px;font-size:24px}.mdc-select .mdc-select__dropdown-icon{width:24px;height:24px}.mdc-select .mdc-select__menu .mdc-list-item{padding-left:16px;padding-right:16px}[dir=rtl] .mdc-select .mdc-select__menu .mdc-list-item,.mdc-select .mdc-select__menu .mdc-list-item[dir=rtl]{padding-left:16px;padding-right:16px}.mdc-select .mdc-select__menu .mdc-list-item__graphic{margin-left:0;margin-right:12px}[dir=rtl] .mdc-select .mdc-select__menu .mdc-list-item__graphic,.mdc-select .mdc-select__menu .mdc-list-item__graphic[dir=rtl]{margin-left:12px;margin-right:0}.mdc-select__dropdown-icon{margin-left:12px;margin-right:12px;display:inline-flex;position:relative;align-self:center;align-items:center;justify-content:center;flex-shrink:0;pointer-events:none}.mdc-select__dropdown-icon .mdc-select__dropdown-icon-active,.mdc-select__dropdown-icon .mdc-select__dropdown-icon-inactive{position:absolute;top:0;left:0}.mdc-select__dropdown-icon .mdc-select__dropdown-icon-graphic{width:41.6666666667%;height:20.8333333333%}.mdc-select__dropdown-icon .mdc-select__dropdown-icon-inactive{opacity:1;transition:opacity 75ms linear 75ms}.mdc-select__dropdown-icon .mdc-select__dropdown-icon-active{opacity:0;transition:opacity 75ms linear}[dir=rtl] .mdc-select__dropdown-icon,.mdc-select__dropdown-icon[dir=rtl]{margin-left:12px;margin-right:12px}.mdc-select--activated .mdc-select__dropdown-icon .mdc-select__dropdown-icon-inactive{opacity:0;transition:opacity 49.5ms linear}.mdc-select--activated .mdc-select__dropdown-icon .mdc-select__dropdown-icon-active{opacity:1;transition:opacity 100.5ms linear 49.5ms}.mdc-select__anchor{width:200px;min-width:0;flex:1 1 auto;position:relative;box-sizing:border-box;overflow:hidden;outline:none;cursor:pointer}.mdc-select__anchor .mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-select__selected-text-container{display:flex;appearance:none;pointer-events:none;box-sizing:border-box;width:auto;min-width:0;flex-grow:1;height:28px;border:none;outline:none;padding:0;background-color:transparent;color:inherit}.mdc-select__selected-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);line-height:1.75rem;line-height:var(--mdc-typography-subtitle1-line-height, 1.75rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight, 400);letter-spacing:0.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, 0.009375em);text-decoration:inherit;text-decoration:var(--mdc-typography-subtitle1-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform, inherit);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block;width:100%;text-align:left}[dir=rtl] .mdc-select__selected-text,.mdc-select__selected-text[dir=rtl]{text-align:right}.mdc-select--invalid:not(.mdc-select--disabled) .mdc-floating-label{color:#b00020;color:var(--mdc-theme-error, #b00020)}.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--focused .mdc-floating-label{color:#b00020;color:var(--mdc-theme-error, #b00020)}.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--invalid+.mdc-select-helper-text--validation-msg{color:#b00020;color:var(--mdc-theme-error, #b00020)}.mdc-select--invalid:not(.mdc-select--disabled) .mdc-select__dropdown-icon{fill:#b00020;fill:var(--mdc-theme-error, #b00020)}.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--focused .mdc-select__dropdown-icon{fill:#b00020;fill:var(--mdc-theme-error, #b00020)}.mdc-select--disabled{cursor:default;pointer-events:none}.mdc-select--with-leading-icon .mdc-select__menu .mdc-list-item{padding-left:12px;padding-right:12px}[dir=rtl] .mdc-select--with-leading-icon .mdc-select__menu .mdc-list-item,.mdc-select--with-leading-icon .mdc-select__menu .mdc-list-item[dir=rtl]{padding-left:12px;padding-right:12px}.mdc-select__menu .mdc-list .mdc-select__icon{margin-left:0;margin-right:0}[dir=rtl] .mdc-select__menu .mdc-list .mdc-select__icon,.mdc-select__menu .mdc-list .mdc-select__icon[dir=rtl]{margin-left:0;margin-right:0}.mdc-select__menu .mdc-list .mdc-list-item--selected,.mdc-select__menu .mdc-list .mdc-list-item--activated{color:#000;color:var(--mdc-theme-on-surface, #000)}.mdc-select__menu .mdc-list .mdc-list-item--selected .mdc-list-item__graphic,.mdc-select__menu .mdc-list .mdc-list-item--activated .mdc-list-item__graphic{color:#000;color:var(--mdc-theme-on-surface, #000)}.mdc-select--filled .mdc-select__anchor{height:56px;display:flex;align-items:baseline}.mdc-select--filled .mdc-select__anchor::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}.mdc-select--filled.mdc-select--no-label .mdc-select__anchor .mdc-select__selected-text::before{content:"​"}.mdc-select--filled.mdc-select--no-label .mdc-select__anchor .mdc-select__selected-text-container{height:100%;display:inline-flex;align-items:center}.mdc-select--filled.mdc-select--no-label .mdc-select__anchor::before{display:none}.mdc-select--filled .mdc-select__anchor{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:0;border-bottom-left-radius:0}.mdc-select--filled:not(.mdc-select--disabled) .mdc-select__anchor{background-color:whitesmoke}.mdc-select--filled.mdc-select--disabled .mdc-select__anchor{background-color:#fafafa}.mdc-select--filled:not(.mdc-select--disabled) .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.42)}.mdc-select--filled:not(.mdc-select--disabled):hover .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.87)}.mdc-select--filled:not(.mdc-select--disabled) .mdc-line-ripple::after{border-bottom-color:#6200ee;border-bottom-color:var(--mdc-theme-primary, #6200ee)}.mdc-select--filled.mdc-select--disabled .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.06)}.mdc-select--filled .mdc-floating-label{max-width:calc(100% - 64px)}.mdc-select--filled .mdc-floating-label--float-above{max-width:calc(100% / 0.75 - 64px / 0.75)}.mdc-select--filled .mdc-menu-surface--is-open-below{border-top-left-radius:0px;border-top-right-radius:0px}.mdc-select--filled.mdc-select--focused.mdc-line-ripple::after{transform:scale(1, 2);opacity:1}.mdc-select--filled .mdc-floating-label{left:16px;right:initial}[dir=rtl] .mdc-select--filled .mdc-floating-label,.mdc-select--filled .mdc-floating-label[dir=rtl]{left:initial;right:16px}.mdc-select--filled.mdc-select--with-leading-icon .mdc-floating-label{left:48px;right:initial}[dir=rtl] .mdc-select--filled.mdc-select--with-leading-icon .mdc-floating-label,.mdc-select--filled.mdc-select--with-leading-icon .mdc-floating-label[dir=rtl]{left:initial;right:48px}.mdc-select--filled.mdc-select--with-leading-icon .mdc-floating-label{max-width:calc(100% - 96px)}.mdc-select--filled.mdc-select--with-leading-icon .mdc-floating-label--float-above{max-width:calc(100% / 0.75 - 96px / 0.75)}.mdc-select--invalid:not(.mdc-select--disabled) .mdc-line-ripple::before{border-bottom-color:#b00020;border-bottom-color:var(--mdc-theme-error, #b00020)}.mdc-select--invalid:not(.mdc-select--disabled):hover .mdc-line-ripple::before{border-bottom-color:#b00020;border-bottom-color:var(--mdc-theme-error, #b00020)}.mdc-select--invalid:not(.mdc-select--disabled) .mdc-line-ripple::after{border-bottom-color:#b00020;border-bottom-color:var(--mdc-theme-error, #b00020)}.mdc-select--outlined{border:none}.mdc-select--outlined .mdc-select__anchor{height:56px}.mdc-select--outlined .mdc-select__anchor .mdc-floating-label--float-above{transform:translateY(-37.25px) scale(1)}.mdc-select--outlined .mdc-select__anchor .mdc-floating-label--float-above{font-size:.75rem}.mdc-select--outlined .mdc-select__anchor.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-select--outlined .mdc-select__anchor .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) scale(0.75)}.mdc-select--outlined .mdc-select__anchor.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-select--outlined .mdc-select__anchor .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-select--outlined .mdc-select__anchor .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-select-outlined-56px 250ms 1}@keyframes mdc-floating-label-shake-float-above-select-outlined-56px{0%{transform:translateX(calc(0 - 0%)) translateY(-34.75px) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 0%)) translateY(-34.75px) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 0%)) translateY(-34.75px) scale(0.75)}100%{transform:translateX(calc(0 - 0%)) translateY(-34.75px) scale(0.75)}}.mdc-select--outlined .mdc-notched-outline .mdc-notched-outline__leading{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:4px;border-bottom-left-radius:var(--mdc-shape-small, 4px)}[dir=rtl] .mdc-select--outlined .mdc-notched-outline .mdc-notched-outline__leading,.mdc-select--outlined .mdc-notched-outline .mdc-notched-outline__leading[dir=rtl]{border-top-left-radius:0;border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:4px;border-bottom-right-radius:var(--mdc-shape-small, 4px);border-bottom-left-radius:0}@supports(top: max(0%)){.mdc-select--outlined .mdc-notched-outline .mdc-notched-outline__leading{width:max(12px, var(--mdc-shape-small, 4px))}}@supports(top: max(0%)){.mdc-select--outlined .mdc-notched-outline .mdc-notched-outline__notch{max-width:calc(100% - max(12px, var(--mdc-shape-small, 4px)) * 2)}}.mdc-select--outlined .mdc-notched-outline .mdc-notched-outline__trailing{border-top-left-radius:0;border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:4px;border-bottom-right-radius:var(--mdc-shape-small, 4px);border-bottom-left-radius:0}[dir=rtl] .mdc-select--outlined .mdc-notched-outline .mdc-notched-outline__trailing,.mdc-select--outlined .mdc-notched-outline .mdc-notched-outline__trailing[dir=rtl]{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:4px;border-bottom-left-radius:var(--mdc-shape-small, 4px)}@supports(top: max(0%)){.mdc-select--outlined .mdc-select__anchor{padding-left:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}[dir=rtl] .mdc-select--outlined .mdc-select__anchor,.mdc-select--outlined .mdc-select__anchor[dir=rtl]{padding-left:0}@supports(top: max(0%)){[dir=rtl] .mdc-select--outlined .mdc-select__anchor,.mdc-select--outlined .mdc-select__anchor[dir=rtl]{padding-right:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}@supports(top: max(0%)){.mdc-select--outlined+.mdc-select-helper-text{margin-left:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}[dir=rtl] .mdc-select--outlined+.mdc-select-helper-text,.mdc-select--outlined+.mdc-select-helper-text[dir=rtl]{margin-left:0}@supports(top: max(0%)){[dir=rtl] .mdc-select--outlined+.mdc-select-helper-text,.mdc-select--outlined+.mdc-select-helper-text[dir=rtl]{margin-right:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}.mdc-select--outlined:not(.mdc-select--disabled) .mdc-select__anchor{background-color:transparent}.mdc-select--outlined.mdc-select--disabled .mdc-select__anchor{background-color:transparent}.mdc-select--outlined:not(.mdc-select--disabled) .mdc-notched-outline__leading,.mdc-select--outlined:not(.mdc-select--disabled) .mdc-notched-outline__notch,.mdc-select--outlined:not(.mdc-select--disabled) .mdc-notched-outline__trailing{border-color:rgba(0, 0, 0, 0.38)}.mdc-select--outlined:not(.mdc-select--disabled):not(.mdc-select--focused) .mdc-select__anchor:hover .mdc-notched-outline .mdc-notched-outline__leading,.mdc-select--outlined:not(.mdc-select--disabled):not(.mdc-select--focused) .mdc-select__anchor:hover .mdc-notched-outline .mdc-notched-outline__notch,.mdc-select--outlined:not(.mdc-select--disabled):not(.mdc-select--focused) .mdc-select__anchor:hover .mdc-notched-outline .mdc-notched-outline__trailing{border-color:rgba(0, 0, 0, 0.87)}.mdc-select--outlined:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__leading,.mdc-select--outlined:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__notch,.mdc-select--outlined:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__trailing{border-width:2px}.mdc-select--outlined:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__leading,.mdc-select--outlined:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__notch,.mdc-select--outlined:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__trailing{border-color:#6200ee;border-color:var(--mdc-theme-primary, #6200ee)}.mdc-select--outlined.mdc-select--disabled .mdc-notched-outline__leading,.mdc-select--outlined.mdc-select--disabled .mdc-notched-outline__notch,.mdc-select--outlined.mdc-select--disabled .mdc-notched-outline__trailing{border-color:rgba(0, 0, 0, 0.06)}.mdc-select--outlined .mdc-select__anchor :not(.mdc-notched-outline--notched) .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mdc-select--outlined .mdc-select__anchor{display:flex;align-items:baseline;overflow:visible}.mdc-select--outlined .mdc-select__anchor .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-select-outlined 250ms 1}.mdc-select--outlined .mdc-select__anchor .mdc-floating-label--float-above{transform:translateY(-37.25px) scale(1)}.mdc-select--outlined .mdc-select__anchor .mdc-floating-label--float-above{font-size:.75rem}.mdc-select--outlined .mdc-select__anchor.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-select--outlined .mdc-select__anchor .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) scale(0.75)}.mdc-select--outlined .mdc-select__anchor.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-select--outlined .mdc-select__anchor .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-select--outlined .mdc-select__anchor .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:1px}.mdc-select--outlined .mdc-select__anchor .mdc-select__selected-text::before{content:"​"}.mdc-select--outlined .mdc-select__anchor .mdc-select__selected-text-container{height:100%;display:inline-flex;align-items:center}.mdc-select--outlined .mdc-select__anchor::before{display:none}.mdc-select--outlined .mdc-select__selected-text-container{display:flex;border:none;z-index:1;background-color:transparent}.mdc-select--outlined .mdc-select__icon{z-index:2}.mdc-select--outlined .mdc-floating-label{line-height:1.15rem;left:4px;right:initial}[dir=rtl] .mdc-select--outlined .mdc-floating-label,.mdc-select--outlined .mdc-floating-label[dir=rtl]{left:initial;right:4px}.mdc-select--outlined.mdc-select--focused .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:2px}.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled) .mdc-notched-outline__leading,.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled) .mdc-notched-outline__notch,.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled) .mdc-notched-outline__trailing{border-color:#b00020;border-color:var(--mdc-theme-error, #b00020)}.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled):not(.mdc-select--focused) .mdc-select__anchor:hover .mdc-notched-outline .mdc-notched-outline__leading,.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled):not(.mdc-select--focused) .mdc-select__anchor:hover .mdc-notched-outline .mdc-notched-outline__notch,.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled):not(.mdc-select--focused) .mdc-select__anchor:hover .mdc-notched-outline .mdc-notched-outline__trailing{border-color:#b00020;border-color:var(--mdc-theme-error, #b00020)}.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__leading,.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__notch,.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__trailing{border-width:2px}.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__leading,.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__notch,.mdc-select--outlined.mdc-select--invalid:not(.mdc-select--disabled).mdc-select--focused .mdc-notched-outline .mdc-notched-outline__trailing{border-color:#b00020;border-color:var(--mdc-theme-error, #b00020)}.mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label{left:36px;right:initial}[dir=rtl] .mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label,.mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label[dir=rtl]{left:initial;right:36px}.mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label--float-above{transform:translateY(-37.25px) translateX(-32px) scale(1)}[dir=rtl] .mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label--float-above,.mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label--float-above[dir=rtl]{transform:translateY(-37.25px) translateX(32px) scale(1)}.mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label--float-above{font-size:.75rem}.mdc-select--outlined.mdc-select--with-leading-icon.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-select--outlined.mdc-select--with-leading-icon .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) translateX(-32px) scale(0.75)}[dir=rtl] .mdc-select--outlined.mdc-select--with-leading-icon.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-select--outlined.mdc-select--with-leading-icon.mdc-notched-outline--upgraded .mdc-floating-label--float-above[dir=rtl],[dir=rtl] .mdc-select--outlined.mdc-select--with-leading-icon .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-select--outlined.mdc-select--with-leading-icon .mdc-notched-outline--upgraded .mdc-floating-label--float-above[dir=rtl]{transform:translateY(-34.75px) translateX(32px) scale(0.75)}.mdc-select--outlined.mdc-select--with-leading-icon.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-select--outlined.mdc-select--with-leading-icon .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-select-outlined-leading-icon-56px 250ms 1}@keyframes mdc-floating-label-shake-float-above-select-outlined-leading-icon-56px{0%{transform:translateX(calc(0 - 32px)) translateY(-34.75px) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 32px)) translateY(-34.75px) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 32px)) translateY(-34.75px) scale(0.75)}100%{transform:translateX(calc(0 - 32px)) translateY(-34.75px) scale(0.75)}}[dir=rtl] .mdc-select--outlined.mdc-select--with-leading-icon .mdc-floating-label--shake,.mdc-select--outlined.mdc-select--with-leading-icon[dir=rtl] .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-select-outlined-leading-icon-56px 250ms 1}@keyframes mdc-floating-label-shake-float-above-select-outlined-leading-icon-56px-rtl{0%{transform:translateX(calc(0 - -32px)) translateY(-34.75px) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - -32px)) translateY(-34.75px) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - -32px)) translateY(-34.75px) scale(0.75)}100%{transform:translateX(calc(0 - -32px)) translateY(-34.75px) scale(0.75)}}.mdc-select--outlined.mdc-select--with-leading-icon .mdc-select__anchor :not(.mdc-notched-outline--notched) .mdc-notched-outline__notch{max-width:calc(100% - 96px)}.mdc-select--outlined .mdc-menu-surface{margin-bottom:8px}.mdc-select--outlined.mdc-select--no-label .mdc-menu-surface,.mdc-select--outlined .mdc-menu-surface--is-open-below{margin-bottom:0}.mdc-select__anchor{--mdc-ripple-fg-size: 0;--mdc-ripple-left: 0;--mdc-ripple-top: 0;--mdc-ripple-fg-scale: 1;--mdc-ripple-fg-translate-end: 0;--mdc-ripple-fg-translate-start: 0;-webkit-tap-highlight-color:rgba(0,0,0,0);will-change:transform,opacity}.mdc-select__anchor .mdc-select__ripple::before,.mdc-select__anchor .mdc-select__ripple::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-select__anchor .mdc-select__ripple::before{transition:opacity 15ms linear,background-color 15ms linear;z-index:1}.mdc-select__anchor.mdc-ripple-upgraded .mdc-select__ripple::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-select__anchor.mdc-ripple-upgraded .mdc-select__ripple::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-select__anchor.mdc-ripple-upgraded--unbounded .mdc-select__ripple::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-select__anchor.mdc-ripple-upgraded--foreground-activation .mdc-select__ripple::after{animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.mdc-select__anchor.mdc-ripple-upgraded--foreground-deactivation .mdc-select__ripple::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-select__anchor .mdc-select__ripple::before,.mdc-select__anchor .mdc-select__ripple::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-select__anchor.mdc-ripple-upgraded .mdc-select__ripple::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-select__anchor .mdc-select__ripple::before,.mdc-select__anchor .mdc-select__ripple::after{background-color:rgba(0, 0, 0, 0.87)}.mdc-select__anchor:hover .mdc-select__ripple::before{opacity:.04}.mdc-select__anchor.mdc-ripple-upgraded--background-focused .mdc-select__ripple::before,.mdc-select__anchor:not(.mdc-ripple-upgraded):focus .mdc-select__ripple::before{transition-duration:75ms;opacity:.12}.mdc-select__anchor .mdc-select__ripple{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.mdc-select__menu .mdc-list .mdc-list-item--selected .mdc-list-item__ripple::before,.mdc-select__menu .mdc-list .mdc-list-item--selected .mdc-list-item__ripple::after{background-color:#000;background-color:var(--mdc-theme-on-surface, #000)}.mdc-select__menu .mdc-list .mdc-list-item--selected:hover .mdc-list-item__ripple::before{opacity:.04}.mdc-select__menu .mdc-list .mdc-list-item--selected.mdc-ripple-upgraded--background-focused .mdc-list-item__ripple::before,.mdc-select__menu .mdc-list .mdc-list-item--selected:not(.mdc-ripple-upgraded):focus .mdc-list-item__ripple::before{transition-duration:75ms;opacity:.12}.mdc-select__menu .mdc-list .mdc-list-item--selected:not(.mdc-ripple-upgraded) .mdc-list-item__ripple::after{transition:opacity 150ms linear}.mdc-select__menu .mdc-list .mdc-list-item--selected:not(.mdc-ripple-upgraded):active .mdc-list-item__ripple::after{transition-duration:75ms;opacity:.12}.mdc-select__menu .mdc-list .mdc-list-item--selected.mdc-ripple-upgraded{--mdc-ripple-fg-opacity: 0.12}.mdc-select-helper-text{margin:0;margin-left:16px;margin-right:16px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.75rem;font-size:var(--mdc-typography-caption-font-size, 0.75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight, 400);letter-spacing:0.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, 0.0333333333em);text-decoration:inherit;text-decoration:var(--mdc-typography-caption-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform, inherit);display:block;margin-top:0;line-height:normal}[dir=rtl] .mdc-select-helper-text,.mdc-select-helper-text[dir=rtl]{margin-left:16px;margin-right:16px}.mdc-select-helper-text::before{display:inline-block;width:0;height:16px;content:"";vertical-align:0}.mdc-select-helper-text--validation-msg{opacity:0;transition:opacity 180ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-select--invalid+.mdc-select-helper-text--validation-msg,.mdc-select-helper-text--validation-msg-persistent{opacity:1}.mdc-select--with-leading-icon .mdc-select__icon{display:inline-block;box-sizing:border-box;border:none;text-decoration:none;cursor:pointer;user-select:none;flex-shrink:0;align-self:center;background-color:transparent;fill:currentColor}.mdc-select--with-leading-icon .mdc-select__icon{margin-left:12px;margin-right:12px}[dir=rtl] .mdc-select--with-leading-icon .mdc-select__icon,.mdc-select--with-leading-icon .mdc-select__icon[dir=rtl]{margin-left:12px;margin-right:12px}.mdc-select__icon:not([tabindex]),.mdc-select__icon[tabindex="-1"]{cursor:default;pointer-events:none}.material-icons{font-family:var(--mdc-icon-font, "Material Icons");font-weight:normal;font-style:normal;font-size:var(--mdc-icon-size, 24px);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga"}:host{display:inline-block;vertical-align:top;outline:none}.mdc-select{width:100%}[hidden]{display:none}.mdc-select__icon{z-index:2}.mdc-select--with-leading-icon{--mdc-list-item-graphic-margin: calc(48px - var(--mdc-list-item-graphic-size, 24px) - var(--mdc-list-side-padding, 16px))}.mdc-select .mdc-select__anchor .mdc-select__selected-text{overflow:hidden}.mdc-select .mdc-select__anchor *{display:inline-flex}.mdc-select .mdc-select__anchor .mdc-floating-label{display:inline-block}mwc-notched-outline{--mdc-notched-outline-border-color: var(--mdc-select-outlined-idle-border-color, rgba(0, 0, 0, 0.38));--mdc-notched-outline-notch-offset: 1px}:host(:not([disabled]):hover) .mdc-select:not(.mdc-select--invalid):not(.mdc-select--focused) mwc-notched-outline{--mdc-notched-outline-border-color: var(--mdc-select-outlined-hover-border-color, rgba(0, 0, 0, 0.87))}:host(:not([disabled])) .mdc-select:not(.mdc-select--disabled) .mdc-select__selected-text{color:rgba(0, 0, 0, 0.87);color:var(--mdc-select-ink-color, rgba(0, 0, 0, 0.87))}:host(:not([disabled])) .mdc-select:not(.mdc-select--disabled) .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.42);border-bottom-color:var(--mdc-select-idle-line-color, rgba(0, 0, 0, 0.42))}:host(:not([disabled])) .mdc-select:not(.mdc-select--disabled):hover .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.87);border-bottom-color:var(--mdc-select-hover-line-color, rgba(0, 0, 0, 0.87))}:host(:not([disabled])) .mdc-select:not(.mdc-select--outlined):not(.mdc-select--disabled) .mdc-select__anchor{background-color:whitesmoke;background-color:var(--mdc-select-fill-color, whitesmoke)}:host(:not([disabled])) .mdc-select.mdc-select--invalid .mdc-select__dropdown-icon{fill:var(--mdc-select-error-dropdown-icon-color, var(--mdc-select-error-color, var(--mdc-theme-error, #b00020)))}:host(:not([disabled])) .mdc-select.mdc-select--invalid .mdc-floating-label,:host(:not([disabled])) .mdc-select.mdc-select--invalid .mdc-floating-label::after{color:var(--mdc-select-error-color, var(--mdc-theme-error, #b00020))}:host(:not([disabled])) .mdc-select.mdc-select--invalid mwc-notched-outline{--mdc-notched-outline-border-color: var(--mdc-select-error-color, var(--mdc-theme-error, #b00020))}.mdc-select__menu--invalid{--mdc-theme-primary: var(--mdc-select-error-color, var(--mdc-theme-error, #b00020))}:host(:not([disabled])) .mdc-select:not(.mdc-select--invalid):not(.mdc-select--focused) .mdc-floating-label,:host(:not([disabled])) .mdc-select:not(.mdc-select--invalid):not(.mdc-select--focused) .mdc-floating-label::after{color:rgba(0, 0, 0, 0.6);color:var(--mdc-select-label-ink-color, rgba(0, 0, 0, 0.6))}:host(:not([disabled])) .mdc-select:not(.mdc-select--invalid):not(.mdc-select--focused) .mdc-select__dropdown-icon{fill:rgba(0, 0, 0, 0.54);fill:var(--mdc-select-dropdown-icon-color, rgba(0, 0, 0, 0.54))}:host(:not([disabled])) .mdc-select.mdc-select--focused mwc-notched-outline{--mdc-notched-outline-stroke-width: 2px;--mdc-notched-outline-notch-offset: 2px}:host(:not([disabled])) .mdc-select.mdc-select--focused:not(.mdc-select--invalid) mwc-notched-outline{--mdc-notched-outline-border-color: var(--mdc-select-focused-label-color, var(--mdc-theme-primary, rgba(98, 0, 238, 0.87)))}:host(:not([disabled])) .mdc-select.mdc-select--focused:not(.mdc-select--invalid) .mdc-select__dropdown-icon{fill:rgba(98,0,238,.87);fill:var(--mdc-select-focused-dropdown-icon-color, var(--mdc-theme-primary, rgba(98, 0, 238, 0.87)))}:host(:not([disabled])) .mdc-select.mdc-select--focused:not(.mdc-select--invalid) .mdc-floating-label{color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}:host(:not([disabled])) .mdc-select.mdc-select--focused:not(.mdc-select--invalid) .mdc-floating-label::after{color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}:host(:not([disabled])) .mdc-select-helper-text:not(.mdc-select-helper-text--validation-msg){color:var(--mdc-select-label-ink-color, rgba(0, 0, 0, 0.6))}:host([disabled]){pointer-events:none}:host([disabled]) .mdc-select:not(.mdc-select--outlined).mdc-select--disabled .mdc-select__anchor{background-color:#fafafa;background-color:var(--mdc-select-disabled-fill-color, #fafafa)}:host([disabled]) .mdc-select.mdc-select--outlined mwc-notched-outline{--mdc-notched-outline-border-color: var(--mdc-select-outlined-disabled-border-color, rgba(0, 0, 0, 0.06))}:host([disabled]) .mdc-select .mdc-select__dropdown-icon{fill:rgba(0, 0, 0, 0.38);fill:var(--mdc-select-disabled-dropdown-icon-color, rgba(0, 0, 0, 0.38))}:host([disabled]) .mdc-select:not(.mdc-select--invalid):not(.mdc-select--focused) .mdc-floating-label,:host([disabled]) .mdc-select:not(.mdc-select--invalid):not(.mdc-select--focused) .mdc-floating-label::after{color:rgba(0, 0, 0, 0.38);color:var(--mdc-select-disabled-ink-color, rgba(0, 0, 0, 0.38))}:host([disabled]) .mdc-select-helper-text{color:rgba(0, 0, 0, 0.38);color:var(--mdc-select-disabled-ink-color, rgba(0, 0, 0, 0.38))}:host([disabled]) .mdc-select__selected-text{color:rgba(0, 0, 0, 0.38);color:var(--mdc-select-disabled-ink-color, rgba(0, 0, 0, 0.38))}`
/**
@license
Copyright 2020 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/;let Vr=class extends Ur{};Vr.styles=Hr,Vr=r([bt("mwc-select")],Vr);class Wr extends Ot{constructor(){super(...arguments),this.indeterminate=!1,this.progress=0,this.density=0,this.closed=!1,this.ariaLabel=""}open(){this.closed=!1}close(){this.closed=!0}render(){const t={"mdc-circular-progress--closed":this.closed,"mdc-circular-progress--indeterminate":this.indeterminate},e=48+4*this.density,i={width:e+"px",height:e+"px"};return Z`
      <div
        class="mdc-circular-progress ${be(t)}"
        style="${Ge(i)}"
        role="progressbar"
        aria-label="${this.ariaLabel}"
        aria-valuemin="0"
        aria-valuemax="1"
        aria-valuenow="${oi(this.indeterminate?void 0:this.progress)}">
        ${this.renderDeterminateContainer()}
        ${this.renderIndeterminateContainer()}
      </div>`}renderDeterminateContainer(){const t=48+4*this.density,e=t/2,i=this.density>=-3?18+11*this.density/6:12.5+5*(this.density+3)/4,r=6.2831852*i,n=(1-this.progress)*r,o=this.density>=-3?4+this.density*(1/3):3+(this.density+3)*(1/6);return Z`
      <div class="mdc-circular-progress__determinate-container">
        <svg class="mdc-circular-progress__determinate-circle-graphic"
             viewBox="0 0 ${t} ${t}">
          <circle class="mdc-circular-progress__determinate-track"
                  cx="${e}" cy="${e}" r="${i}"
                  stroke-width="${o}"></circle>
          <circle class="mdc-circular-progress__determinate-circle"
                  cx="${e}" cy="${e}" r="${i}"
                  stroke-dasharray="${6.2831852*i}"
                  stroke-dashoffset="${n}"
                  stroke-width="${o}"></circle>
        </svg>
      </div>`}renderIndeterminateContainer(){return Z`
      <div class="mdc-circular-progress__indeterminate-container">
        <div class="mdc-circular-progress__spinner-layer">
          ${this.renderIndeterminateSpinnerLayer()}
        </div>
      </div>`}renderIndeterminateSpinnerLayer(){const t=48+4*this.density,e=t/2,i=this.density>=-3?18+11*this.density/6:12.5+5*(this.density+3)/4,r=6.2831852*i,n=.5*r,o=this.density>=-3?4+this.density*(1/3):3+(this.density+3)*(1/6);return Z`
        <div class="mdc-circular-progress__circle-clipper mdc-circular-progress__circle-left">
          <svg class="mdc-circular-progress__indeterminate-circle-graphic"
               viewBox="0 0 ${t} ${t}">
            <circle cx="${e}" cy="${e}" r="${i}"
                    stroke-dasharray="${r}"
                    stroke-dashoffset="${n}"
                    stroke-width="${o}"></circle>
          </svg>
        </div><div class="mdc-circular-progress__gap-patch">
          <svg class="mdc-circular-progress__indeterminate-circle-graphic"
               viewBox="0 0 ${t} ${t}">
            <circle cx="${e}" cy="${e}" r="${i}"
                    stroke-dasharray="${r}"
                    stroke-dashoffset="${n}"
                    stroke-width="${.8*o}"></circle>
          </svg>
        </div><div class="mdc-circular-progress__circle-clipper mdc-circular-progress__circle-right">
          <svg class="mdc-circular-progress__indeterminate-circle-graphic"
               viewBox="0 0 ${t} ${t}">
            <circle cx="${e}" cy="${e}" r="${i}"
                    stroke-dasharray="${r}"
                    stroke-dashoffset="${n}"
                    stroke-width="${o}"></circle>
          </svg>
        </div>`}update(t){super.update(t),t.has("progress")&&(this.progress>1&&(this.progress=1),this.progress<0&&(this.progress=0))}}r([yt({type:Boolean,reflect:!0})],Wr.prototype,"indeterminate",void 0),r([yt({type:Number,reflect:!0})],Wr.prototype,"progress",void 0),r([yt({type:Number,reflect:!0})],Wr.prototype,"density",void 0),r([yt({type:Boolean,reflect:!0})],Wr.prototype,"closed",void 0),r([yt({type:String})],Wr.prototype,"ariaLabel",void 0);
/**
@license
Copyright 2018 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
const Gr=Ct`.mdc-circular-progress__determinate-circle,.mdc-circular-progress__indeterminate-circle-graphic{stroke:#6200ee;stroke:var(--mdc-theme-primary, #6200ee)}.mdc-circular-progress__determinate-track{stroke:transparent}@keyframes mdc-circular-progress-container-rotate{to{transform:rotate(360deg)}}@keyframes mdc-circular-progress-spinner-layer-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes mdc-circular-progress-color-1-fade-in-out{from{opacity:.99}25%{opacity:.99}26%{opacity:0}89%{opacity:0}90%{opacity:.99}to{opacity:.99}}@keyframes mdc-circular-progress-color-2-fade-in-out{from{opacity:0}15%{opacity:0}25%{opacity:.99}50%{opacity:.99}51%{opacity:0}to{opacity:0}}@keyframes mdc-circular-progress-color-3-fade-in-out{from{opacity:0}40%{opacity:0}50%{opacity:.99}75%{opacity:.99}76%{opacity:0}to{opacity:0}}@keyframes mdc-circular-progress-color-4-fade-in-out{from{opacity:0}65%{opacity:0}75%{opacity:.99}90%{opacity:.99}to{opacity:0}}@keyframes mdc-circular-progress-left-spin{from{transform:rotate(265deg)}50%{transform:rotate(130deg)}to{transform:rotate(265deg)}}@keyframes mdc-circular-progress-right-spin{from{transform:rotate(-265deg)}50%{transform:rotate(-130deg)}to{transform:rotate(-265deg)}}.mdc-circular-progress{display:inline-flex;position:relative;direction:ltr;transition:opacity 250ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-circular-progress__determinate-container,.mdc-circular-progress__indeterminate-circle-graphic,.mdc-circular-progress__indeterminate-container,.mdc-circular-progress__spinner-layer{position:absolute;width:100%;height:100%}.mdc-circular-progress__determinate-container{transform:rotate(-90deg)}.mdc-circular-progress__indeterminate-container{opacity:0}.mdc-circular-progress__determinate-circle-graphic,.mdc-circular-progress__indeterminate-circle-graphic{fill:transparent}.mdc-circular-progress__determinate-circle{transition:stroke-dashoffset 500ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-circular-progress__gap-patch{position:absolute;top:0;left:47.5%;box-sizing:border-box;width:5%;height:100%;overflow:hidden}.mdc-circular-progress__gap-patch .mdc-circular-progress__indeterminate-circle-graphic{left:-900%;width:2000%;transform:rotate(180deg)}.mdc-circular-progress__circle-clipper{display:inline-flex;position:relative;width:50%;height:100%;overflow:hidden}.mdc-circular-progress__circle-clipper .mdc-circular-progress__indeterminate-circle-graphic{width:200%}.mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{left:-100%}.mdc-circular-progress--indeterminate .mdc-circular-progress__determinate-container{opacity:0}.mdc-circular-progress--indeterminate .mdc-circular-progress__indeterminate-container{opacity:1}.mdc-circular-progress--indeterminate .mdc-circular-progress__indeterminate-container{animation:mdc-circular-progress-container-rotate 1568.2352941176ms linear infinite}.mdc-circular-progress--indeterminate .mdc-circular-progress__spinner-layer{animation:mdc-circular-progress-spinner-layer-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__color-1{animation:mdc-circular-progress-spinner-layer-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both,mdc-circular-progress-color-1-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__color-2{animation:mdc-circular-progress-spinner-layer-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both,mdc-circular-progress-color-2-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__color-3{animation:mdc-circular-progress-spinner-layer-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both,mdc-circular-progress-color-3-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__color-4{animation:mdc-circular-progress-spinner-layer-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both,mdc-circular-progress-color-4-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-left .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-left-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-right-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--closed{opacity:0}:host{display:inline-flex}.mdc-circular-progress__determinate-track{stroke:transparent;stroke:var(--mdc-circular-progress-track-color, transparent)}`;let Kr=class extends Wr{};function Xr(t,e,i,r){void 0===r&&(r=!1);for(var n,o,s=0,a="",l=e;o=l.exec(t);)n=t.substring(s,o.index),s=l.lastIndex,a+=n,a+=i&&"function"==typeof i?i(t,o):i;return a+=t.substring(s),l.test(a)&&!0===r?Xr(a,new RegExp(l),i,!0):a}function Zr(t){var e=new RegExp("^[ \t]*(.+?) *[=:] *(?:\"((?!\")[\\w\\W]+?)\"|'{3,}((?!'{3,})[\\w\\W]+?)'{3,}|(\\[[\\w\\W]+?(?:(?: *])+ *$\\n*)+)|(\\{[\\w\\W]+?(?:(?: *})+ *$\\n*)+)|(.+) *)|^(.+)$","gm"),i={};return Xr(t,e,(function(t,e){var r,n;if(e[1]){if("#"===e[1].charAt(0))return;return r='"'===e[1].charAt(0)&&'"'===e[1].charAt(e[1].length-1)?e[1].slice(1,-1):e[1],(e[2]||e[3])&&(n=e[2]||e[3].replace(/^(\s*)(__>>\[<<__)/gm,"$1[")),(e[4]||e[5])&&(n=JSON.parse(""+(e[4]||e[5]))),e[6]&&(e[6]=e[6].trim(),n=+e[6]==+e[6]?Number(e[6]):"true"===e[6]||"false"===e[6]?"true"===e[6]:"inf"===e[6]||"+inf"===e[6]?1/0:"-inf"===e[6]?-1/0:parseInt(e[6],16).toString(16)===e[6].toLowerCase()?parseInt(e[6],16):parseInt(e[6],8).toString(8)===e[6].toLowerCase()?parseInt(e[6],8):parseInt(e[6],2).toString(2)===e[6].toLowerCase()?parseInt(e[6],2):e[6]),i[r]=n,""}if(e[7])return""})),i}function Yr(t,e,i,r){r=!!r,e.split&&(e=e.split("."));for(var n,o=0,s=e.length,a=t;o<s;++o)e[o]=e[o].trim(),e[o]='"'===e[o].substr(0,1)&&'"'===e[o].substr(-1)?e[o].slice(1,-1):e[o],a instanceof Array?(n=a[a.length-1],o--):n=a[e[o]],o===s-1?n instanceof Array?a[e[o]].push(i):a[e[o]]=r?[i]:i:a=n instanceof Array?n:a[e[o]]=null==n?{}:n}Kr.styles=Gr,Kr=r([bt("mwc-circular-progress")],Kr);var Jr=function(t,e){return e!=e?"__>>NaN<<__":e===1/0?"__>>Inf<<__":e===-1/0?"__>>-Inf<<__":e},Qr=function(t,e){return"__>>NaN<<__"===e?NaN:"__>>Inf<<__"===e?1/0:"__>>-Inf<<__"===e?-1/0:e};function tn(t,e){t.tabIndex=e?-1:t.tabIndex<0?0:t.tabIndex}function en(t){return It(t)}function rn(t,e){for(const i in e){const r=!0===e[i]?"":e[i];r||""===r||0===r?t.getAttribute(i)!==r&&t.setAttribute(i,r.toString()):t.hasAttribute(i)&&t.removeAttribute(i)}}function nn(t,e){if(null==t.shadowRoot)return[];const i=t.shadowRoot.host.getRootNode(),r=i.querySelectorAll(e);return r.length>0?Array.from(r):nn(i,e)}function on(t=document.activeElement){return null!=t&&null!=t.shadowRoot&&null!=t.shadowRoot.activeElement?on(t.shadowRoot.activeElement):t}function sn(t){for(;t.firstChild;)t.firstChild.remove()}function an(t,e){return null!=e?"none"===e.display:null===t.offsetParent}function ln(t,e,i=document.documentElement){i.style.setProperty(t,e)}const dn=new Map;function cn(t,e,i){const r=dn.get(i);null!=r&&window.clearTimeout(r),dn.set(i,window.setTimeout((()=>{t(),dn.delete(i)}),e))}function hn(t,e,i,r,n){const o=Array.isArray(e)?e:[e],s=Math.random().toString(),a=t=>null==n?i(t):cn((()=>i(t)),n,s);return o.forEach((e=>t.addEventListener(e,a,r))),()=>o.forEach((e=>t.removeEventListener(e,a,r)))}function un(t){t.forEach((t=>t())),t.length=0}function pn(t){t.preventDefault(),t.stopPropagation()}var fn,mn;function gn({anchorOriginX:t,anchorOriginY:e},{left:i,top:r,width:n=0,height:o=0}){switch(t){case fn.CENTER:i+=n/2;break;case fn.RIGHT:i+=n}switch(e){case mn.CENTER:r+=o/2;break;case mn.BOTTOM:r+=o}return{left:i,top:r}}function bn(t,e){const i=function(t){return new WebKitCSSMatrix(t.webkitTransform)}(t);return{x:0===(null==e?t.getPropertyValue("width"):e.width)?0:i.a,y:0===(null==e?t.getPropertyValue("height"):e.height)?0:i.d}}function vn(t){if("0px"===t.getPropertyValue("width")||"0px"===t.getPropertyValue("height"))return 0;const e=t.getPropertyValue("opacity");return isNaN(+e)?0:Number(e)}function yn(t,e,i,r=20,n=0){let o=[];if(n>=r)return o;const s=t=>{const o=t.assignedNodes().filter((t=>1===t.nodeType));return o.length>0?yn(o[0].parentElement,e,i,r,n+1):[]},a=Array.from(t.children||[]);for(const t of a)e(t)||(i(t)&&o.push(t),null!=t.shadowRoot?o.push(...yn(t.shadowRoot,e,i,r,n+1)):"SLOT"===t.tagName?o.push(...s(t)):o.push(...yn(t,e,i,r,n+1)));return o}function _n(t){return t.hasAttribute("hidden")||t.hasAttribute("aria-hidden")&&"false"!==t.getAttribute("aria-hidden")||"none"===t.style.display||"0"===t.style.opacity||"hidden"===t.style.visibility||"collapse"===t.style.visibility}function wn(t){return"-1"!==t.getAttribute("tabindex")&&!_n(t)&&!function(t){return t.hasAttribute("disabled")||t.hasAttribute("aria-disabled")&&"false"!==t.getAttribute("aria-disabled")}(t)&&(t.hasAttribute("tabindex")||(t instanceof HTMLAnchorElement||t instanceof HTMLAreaElement)&&t.hasAttribute("href")||t instanceof HTMLButtonElement||t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement||t instanceof HTMLIFrameElement)}!function(t){t.LEFT="left",t.CENTER="center",t.RIGHT="right"}(fn||(fn={})),function(t){t.TOP="top",t.CENTER="center",t.BOTTOM="bottom"}(mn||(mn={}));const xn=document.createElement("template");xn.innerHTML='\n\t<div id="start"></div>\n\t<div id="backup"></div>\n\t<slot></slot>\n\t<div id="end"></div>\n';class Mn extends HTMLElement{constructor(){super(),this.debounceId=Math.random().toString(),this._focused=!1;const t=this.attachShadow({mode:"open"});t.appendChild(xn.content.cloneNode(!0)),this.$backup=t.querySelector("#backup"),this.$start=t.querySelector("#start"),this.$end=t.querySelector("#end"),this.focusLastElement=this.focusLastElement.bind(this),this.focusFirstElement=this.focusFirstElement.bind(this),this.onFocusIn=this.onFocusIn.bind(this),this.onFocusOut=this.onFocusOut.bind(this)}static get observedAttributes(){return["inactive"]}get inactive(){return this.hasAttribute("inactive")}set inactive(t){t?this.setAttribute("inactive",""):this.removeAttribute("inactive")}get focused(){return this._focused}connectedCallback(){this.$start.addEventListener("focus",this.focusLastElement),this.$end.addEventListener("focus",this.focusFirstElement),this.addEventListener("focusin",this.onFocusIn),this.addEventListener("focusout",this.onFocusOut),this.render()}disconnectedCallback(){this.$start.removeEventListener("focus",this.focusLastElement),this.$end.removeEventListener("focus",this.focusFirstElement),this.removeEventListener("focusin",this.onFocusIn),this.removeEventListener("focusout",this.onFocusOut)}attributeChangedCallback(){this.render()}focusFirstElement(){this.trapFocus()}focusLastElement(){this.trapFocus(!0)}getFocusableElements(){return yn(this,_n,wn)}trapFocus(t){if(this.inactive)return;let e=this.getFocusableElements();e.length>0?(t?e[e.length-1].focus():e[0].focus(),this.$backup.setAttribute("tabindex","-1")):(this.$backup.setAttribute("tabindex","0"),this.$backup.focus())}onFocusIn(){this.updateFocused(!0)}onFocusOut(){this.updateFocused(!1)}updateFocused(t){cn((()=>{this.focused!==t&&(this._focused=t,this.render())}),0,this.debounceId)}render(){this.$start.setAttribute("tabindex",!this.focused||this.inactive?"-1":"0"),this.$end.setAttribute("tabindex",!this.focused||this.inactive?"-1":"0"),this.focused?this.setAttribute("focused",""):this.removeAttribute("focused")}}window.customElements.define("focus-trap",Mn);let kn=class extends Ot{constructor(){super(...arguments),this.role="presentation"}render(){return Z``}};function Sn(t){t.onfinish=null,t.pause()}function En(t){for(const e of t)Sn(e);t.length=0}kn.styles=[en(":host{background:var(--backdrop-bg,rgba(0,0,0,.6));position:absolute;top:0;left:0;width:100%;height:100%;outline:none}")],r([yt({type:String,reflect:!0}),n("design:type",String)],kn.prototype,"role",void 0),kn=r([bt("wl-backdrop")],kn);const An="ResizeObserver"in window;function Tn(t,e,{debounceMs:i}={}){const r=new ResizeObserver((t=>{t.forEach((({contentRect:t})=>null==i?e(t):cn((()=>e(t)),i,Math.random().toString())))}));return r.observe(t),()=>r.disconnect()}function In(t=10){return"_"+Math.random().toString(36).substr(2,t)}const Cn="cubic-bezier(0.4, 0, 0.2, 1)",Rn="ArrowRight",On="ArrowLeft",Ln="ArrowUp",Pn="ArrowDown";const Bn=en("*{-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box}");var Nn;!function(t){t.DID_SHOW="didShow",t.DID_HIDE="didHide"}(Nn||(Nn={}));const $n=document.documentElement,zn=t=>"overlay-"+t;class jn extends Ot{constructor(){super(...arguments),this.open=!1,this.disableFocusTrap=!1,this.backdrop=!1,this.fixed=!1,this.persistent=!1,this.blockScrolling=!1,this.duration=200,this.scrollContainer=$n,this.activeInAnimations=[],this.activeOutAnimations=[],this.resolvers=[],this.overlayId=In(),this.listeners=[]}get $blockableScrollContainer(){return this.scrollContainer instanceof HTMLElement?this.scrollContainer:$n}get animationConfig(){return{duration:this.duration,easing:"cubic-bezier(0.4, 0, 0.2, 1)",fill:"both"}}trapFocus(){null!=this.$focusTrap&&(this.storeCurrentActiveElement(),this.$focusTrap.focusFirstElement())}storeCurrentActiveElement(){this.activeElementBeforeOpen=on()}show(t){return this.activeInAnimations.length>0||(this.prepareShowAnimation(t),this.animateIn(),this.open=!0),this.createResolver()}hide(t){this.activeOutAnimations.length>0||(this.prepareHideAnimation(),this.animateOut(t))}updated(t){super.updated(t),t.has("open")&&(this.open?this.removeAttribute("tabindex"):this.setAttribute("tabindex","-1")),this.updateAria()}updateAria(){rn(this,{"aria-hidden":!this.open})}createResolver(){return new Promise((t=>{this.resolvers.push(t)}))}resolve(t){for(const e of this.resolvers)e(t);this.resolvers.length=0}clickAway(){!this.persistent&&this.open&&this.hide()}dispatchOverlayEvent(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,composed:!0,bubbles:!0}))}setConfig(t){Object.assign(this,t)}pauseAnimations(){this.pauseInAnimations(),this.pauseOutAnimations()}pauseInAnimations(){En(this.activeInAnimations)}pauseOutAnimations(){En(this.activeOutAnimations)}prepareShowAnimation(t){if(this.listeners.push(hn(this.scrollContainer,"scroll",this.updatePosition.bind(this),{passive:!0}),An?Tn(this,this.updatePosition.bind(this),{debounceMs:100}):hn(window,"resize",this.updatePosition.bind(this),{passive:!0})),this.pauseAnimations(),null!=t&&this.setConfig(t),this.blockScrolling){const t=this.$blockableScrollContainer;t.style.overflow="hidden",t.classList.add(zn(this.overlayId))}}prepareHideAnimation(){un(this.listeners),this.pauseAnimations()}didShow(){this.activeInAnimations.length=0,this.listeners.push(hn(this,"keydown",this.onKeyDown.bind(this))),this.disableFocusTrap||this.trapFocus(),this.dispatchOverlayEvent(Nn.DID_SHOW)}didHide(t){if(this.blockScrolling){const t=this.$blockableScrollContainer,e=t.className.match(new RegExp("overlay","gm"));(null===e||null!=e&&1===e.length)&&(t.style.overflow=""),t.classList.remove(zn(this.overlayId))}null!=this.activeElementBeforeOpen&&(this.activeElementBeforeOpen.focus(),this.activeElementBeforeOpen=void 0),this.activeOutAnimations.length=0,this.open=!1,this.dispatchOverlayEvent(Nn.DID_HIDE,t)}updatePosition(){}onKeyDown(t){switch(t.code){case"Escape":this.open&&!this.persistent&&(this.hide(),pn(t))}}}jn.styles=[Bn,en(":host([backdrop]) #backdrop{display:block}#backdrop{display:none;pointer-events:all}")],r([yt({type:Boolean,reflect:!0}),n("design:type",Boolean)],jn.prototype,"open",void 0),r([yt({type:Boolean,reflect:!0}),n("design:type",Boolean)],jn.prototype,"disableFocusTrap",void 0),r([yt({type:Boolean,reflect:!0}),n("design:type",Boolean)],jn.prototype,"backdrop",void 0),r([yt({type:Boolean,reflect:!0}),n("design:type",Boolean)],jn.prototype,"fixed",void 0),r([yt({type:Boolean}),n("design:type",Boolean)],jn.prototype,"persistent",void 0),r([yt({type:Boolean}),n("design:type",Boolean)],jn.prototype,"blockScrolling",void 0),r([yt({type:Number}),n("design:type",Number)],jn.prototype,"duration",void 0),r([yt({type:Object}),n("design:type",EventTarget)],jn.prototype,"scrollContainer",void 0);fn.LEFT,mn.TOP,fn.LEFT,mn.TOP;let Fn=class extends jn{constructor(){super(...arguments),this.closeOnClick=!1,this.noFallback=!1,this.transformOriginX=fn.LEFT,this.transformOriginY=mn.TOP,this.anchorOriginX=fn.LEFT,this.anchorOriginY=mn.TOP,this.role="menu",this.clickAwayListeners=[],this.anchorOpenEventListeners=[],this.anchorCloseEventListeners=[]}get $focusTrap(){return this.$content}disconnectedCallback(){super.disconnectedCallback(),this.detachClickAwayListeners(),un(this.anchorOpenEventListeners),un(this.anchorCloseEventListeners)}updated(t){super.updated(t),t.has("anchorOpenEvents")&&null!=this.anchorOpenEvents&&this.attachEventListenersToAnchor(this.anchorOpenEventListeners,this.anchorOpenEvents,(()=>!this.open&&this.show())),t.has("anchorCloseEvents")&&null!=this.anchorCloseEvents&&this.attachEventListenersToAnchor(this.anchorCloseEventListeners,this.anchorCloseEvents,(()=>this.open&&this.hide()))}showAtPosition(t,e){return this.anchorPosition=t,this.show(e)}getPositionStrategy(){return{transformOriginX:this.transformOriginX,transformOriginY:this.transformOriginY,anchorOriginX:this.anchorOriginX,anchorOriginY:this.anchorOriginY}}didShow(){super.didShow(),this.$focusTrap.focusFirstElement(),this.attachClickAwayListeners()}didHide(t){super.didHide(t),this.anchorPosition=void 0}attachEventListenersToAnchor(t,e,i){un(t);const r=this.getAnchor();if(null==r)return this.throwNoAnchorError();t.push(hn(r,e,i))}throwNoAnchorError(){throw new Error(`No anchor could be found for the popover. "${this.anchor}" provided as anchor.`)}attachClickAwayListeners(){var t,e;this.clickAwayListeners.push((t=[this.$container],e=this.clickAway.bind(this),hn(window,["mousedown","pointerdown"],(i=>{if(!("composedPath"in i))return;const r=i.composedPath();null==t.find((t=>r.includes(t)))&&e()}),{passive:!0})),hn(this.$container,"click",this.onContainerClick.bind(this)))}detachClickAwayListeners(){un(this.clickAwayListeners)}animateIn(){let t=!1;const e=()=>{t||(t=!0,this.didShow())},i=this.$backdrop.animate({opacity:[vn(window.getComputedStyle(this.$backdrop)).toString(),"1"]},this.animationConfig),r=window.getComputedStyle(this.$content),n=bn(r,this.$content.getBoundingClientRect()),o=vn(r),s=this.$content.animate({transform:[`scale(${n.x}, ${n.y})`,"scale(1)"],opacity:[""+(o>.5?o:0),1]},this.animationConfig);s.onfinish=e,i.onfinish=e,this.activeInAnimations.push(s,i),this.updatePosition()}animateOut(t){let e=!1;const i=()=>{e||(e=!0,this.resolve(t),this.didHide(t))},r=this.$backdrop.animate({opacity:[vn(window.getComputedStyle(this.$backdrop)).toString(),"0"]},this.animationConfig),n=window.getComputedStyle(this.$content),o=bn(n,this.$content.getBoundingClientRect()),s=vn(n),a=this.$content.animate({opacity:[s.toString(),0],transform:[`scale(${o.x}, ${o.y})`,"scale(0)"]},this.animationConfig);r.onfinish=i,a.onfinish=i,this.detachClickAwayListeners(),this.activeOutAnimations.push(r,a)}updatePosition(){super.updatePosition(),requestAnimationFrame((()=>{const t=this.getAnchor();let e,i=this.getPositionStrategy(),r=!1,n=null;if(null!=this.anchorPosition)e=this.anchorPosition;else{if(null==t)return this.throwNoAnchorError();n=t.getBoundingClientRect(),e=gn(i,n)}if(!this.noFallback){const t=function({transformOriginX:t,transformOriginY:e,anchorOriginX:i,anchorOriginY:r},{top:n,left:o},s){const{innerHeight:a,innerWidth:l}=window;switch(e){case mn.TOP:n+s.height>a&&(e=mn.BOTTOM,r=mn.TOP);break;case mn.BOTTOM:}switch(t){case fn.LEFT:o+s.width>l&&(t=fn.RIGHT,i=fn.LEFT)}return{transformOriginY:e,transformOriginX:t,anchorOriginX:i,anchorOriginY:r}}(i,e,this.$container.getBoundingClientRect());s=t,r=(o=i).transformOriginX!==s.transformOriginX||o.transformOriginY!==s.transformOriginY||o.anchorOriginX!==s.anchorOriginX||o.anchorOriginY!==s.anchorOriginY,r&&(i=t,e=gn(t,n||e))}var o,s;const a=function({transformOriginX:t,transformOriginY:e}){let i=0,r=0;switch(t){case fn.CENTER:i="-50%";break;case fn.RIGHT:i="-100%"}switch(e){case mn.CENTER:r="-50%";break;case mn.BOTTOM:r="-100%"}return{x:i,y:r}}(i);this.$content.style.transformOrigin=`${i.transformOriginX} ${i.transformOriginY}`,Object.assign(this.$container.style,{top:e.top+"px",left:e.left+"px",transform:`translate(${a.x}, ${a.y})`}),rn(this.$container,{"data-fallback-strategy":r,"data-anchor-origin-x":i.anchorOriginX,"data-anchor-origin-y":i.anchorOriginY,"data-transform-origin-x":i.transformOriginX,"data-transform-origin-y":i.transformOriginY});const{maxWidth:l,maxHeight:d}=function({transformOriginX:t,transformOriginY:e},{left:i,top:r}){const{innerHeight:n,innerWidth:o}=window;return{maxWidth:t===fn.RIGHT?i:o-i,maxHeight:e===mn.BOTTOM?r:n-r}}(i,e);ln("--popover-container-max-width",l+"px",this.$container),ln("--popover-container-max-height",d+"px",this.$container)}))}getAnchor(){let t=this.anchor;if("string"==typeof t||t instanceof String){const e=nn(this,t);t=e.length>0?e[0]:void 0}return t}onContainerClick(){this.open&&this.closeOnClick&&this.hide()}renderContent(){return Z` <slot></slot> `}render(){return Z` <wl-backdrop id="backdrop" @click="${this.clickAway}"></wl-backdrop> <div id="container" aria-expanded="${this.open.toString()}"> <focus-trap id="content" ?inactive="${!this.open||this.disableFocusTrap}"> ${this.renderContent()} </focus-trap> </div> `}};Fn.styles=[...jn.styles,en(":host{display:none;outline:none;pointer-events:none}:host([fixed]){z-index:var(--popover-z-index,12345678);position:fixed;top:0;left:0;width:100%;height:100%}:host([fixed]) #container{position:absolute}#content,:host([open]){display:block}#content{z-index:1;pointer-events:all}")],r([yt({type:Boolean}),n("design:type",Boolean)],Fn.prototype,"closeOnClick",void 0),r([yt({type:Boolean}),n("design:type",Boolean)],Fn.prototype,"noFallback",void 0),r([yt({type:String,reflect:!0}),n("design:type",String)],Fn.prototype,"transformOriginX",void 0),r([yt({type:String,reflect:!0}),n("design:type",String)],Fn.prototype,"transformOriginY",void 0),r([yt({type:String,reflect:!0}),n("design:type",String)],Fn.prototype,"anchorOriginX",void 0),r([yt({type:String,reflect:!0}),n("design:type",String)],Fn.prototype,"anchorOriginY",void 0),r([yt({type:String,reflect:!0}),n("design:type",String)],Fn.prototype,"role",void 0),r([yt({type:String}),n("design:type",Object)],Fn.prototype,"anchor",void 0),r([yt({type:Array}),n("design:type",Array)],Fn.prototype,"anchorOpenEvents",void 0),r([yt({type:Array}),n("design:type",Array)],Fn.prototype,"anchorCloseEvents",void 0),r([wt("#content"),n("design:type",Mn)],Fn.prototype,"$content",void 0),r([wt("#container"),n("design:type",HTMLElement)],Fn.prototype,"$container",void 0),r([wt("#backdrop"),n("design:type",kn)],Fn.prototype,"$backdrop",void 0),Fn=r([bt("wl-popover")],Fn);let Dn=class extends Ot{constructor(){super(...arguments),this.hoverable=!1}render(){return Z` <slot></slot> `}};Dn.styles=[Bn,en(":host{color:var(--card-color,hsl(var(--foreground,var(--foreground-hue,230),var(--foreground-saturation,70%),var(--foreground-lightness,5%))));background:var(--card-bg,hsl(var(--background,var(--background-hue,0),var(--background-saturation,0%),var(--background-lightness,100%))));transition:var(--card-transition,box-shadow var(--transition-duration-fast,.12s) var(--transition-timing-function-ease,ease));box-shadow:var(--card-elevation,var(--elevation-1,0 .3125rem .625rem -.125rem hsla(var(--shadow,var(--shadow-hue,230),var(--shadow-saturation,70%),var(--shadow-lightness,5%)),.15)));border-radius:var(--card-border-radius,.5rem);padding:var(--card-padding,0);display:flex;flex-direction:column;text-align:left}:host([hoverable]:hover){box-shadow:var(--card-elevation-hover,var(--elevation-4,0 .5rem 1rem -.125rem hsla(var(--shadow,var(--shadow-hue,230),var(--shadow-saturation,70%),var(--shadow-lightness,5%)),.15)))}")],r([yt({reflect:!0,type:Boolean}),n("design:type",Boolean)],Dn.prototype,"hoverable",void 0),Dn=r([bt("wl-card")],Dn);let qn=class extends Ot{render(){return Z` <svg id="arrow" viewBox="0 0 100 100" preserveAspectRatio="none"> <polygon points="50 0, 100 100, 0 100"/> </svg> <wl-card id="content"> <slot></slot> </wl-card> `}};qn.styles=[Bn,en(":host{--card-elevation:var(--popover-card-elevation,var(--elevation-4,0px 0.5rem 1rem -0.125rem hsla(var(--shadow,var(--shadow-hue,230),var(--shadow-saturation,70%),var(--shadow-lightness,5%)),0.15)));display:flex;flex-direction:var(--_flex-direction,column)}#content{transform:translate(calc(var(--popover-card-arrow-width, .625rem) * var(--_content-translate-x-multiplier, 0)),calc(var(--popover-card-arrow-width, .625rem) * var(--_content-translate-y-multiplier, 0)));overflow:hidden}#arrow{transform:rotate(var(--_arrow-rotation,0deg)) translate(calc(50% * var(--_arrow-translate-x-multiplier, 0)),calc(50% * var(--_arrow-translate-y-multiplier, 0)));left:var(--_arrow-offset-x,unset);top:var(--_arrow-offset-y,unset);justify-self:var(--_justify-content,flex-start);align-self:var(--_align-items,flex-start);pointer-events:none;position:relative;width:var(--popover-card-arrow-width,.625rem);height:var(--popover-card-arrow-height,.375rem);fill:var(--popover-card-arrow-fill,var(--card-bg,hsl(var(--background,var(--background-hue,0),var(--background-saturation,0%),var(--background-lightness,100%)))));z-index:1;display:none}:host-context([data-transform-origin-x][data-transform-origin-y]) #arrow{display:block}:host-context([data-transform-origin-x=left]){--_align-items:flex-start}:host-context([data-transform-origin-x=center]){--_align-items:center}:host-context([data-transform-origin-x=right]){--_align-items:flex-end}:host-context([data-transform-origin-y=top]){--_justify-content:flex-start}:host-context([data-transform-origin-y=center]){--_justify-content:center}:host-context([data-transform-origin-y=bottom]){--_flex-direction:column-reverse}:host-context([data-transform-origin-x=center][data-transform-origin-y=center]) #arrow{display:none}:host-context([data-transform-origin-x=left][data-transform-origin-y=top]){--_content-translate-x-multiplier:-2;--_arrow-translate-x-multiplier:-1}:host-context([data-transform-origin-x=right][data-transform-origin-y=top]){--_content-translate-x-multiplier:2;--_arrow-translate-x-multiplier:1}:host-context([data-transform-origin-y=bottom]){--_arrow-rotation:180deg}:host-context([data-transform-origin-x=left][data-transform-origin-y=bottom]){--_content-translate-x-multiplier:-2;--_arrow-translate-x-multiplier:1}:host-context([data-transform-origin-x=right][data-transform-origin-y=bottom]){--_content-translate-x-multiplier:2;--_arrow-translate-x-multiplier:-1}:host-context([data-transform-origin-y=center]){--_arrow-translate-x-multiplier:0;--_align-items:center}:host-context([data-transform-origin-x=left][data-transform-origin-y=center]){--_flex-direction:row;--_arrow-rotation:-90deg}:host-context([data-transform-origin-x=left][data-transform-origin-y=center]) #content{transform:translateX(calc(((var(--popover-card-arrow-width, .625rem) - var(--popover-card-arrow-height, .375rem)) / 2) * -1))}:host-context([data-transform-origin-x=right][data-transform-origin-y=center]){--_flex-direction:row-reverse;--_arrow-rotation:90deg}:host-context([data-transform-origin-x=right][data-transform-origin-y=center]) #content{transform:translateX(calc((var(--popover-card-arrow-width, .625rem) - var(--popover-card-arrow-height, .375rem)) / 2))}")],qn=r([bt("wl-popover-card")],qn),c({loader:t=>fetch(`/resources/i18n/${t}.json`).then((t=>t.json()))});class Un extends Ot{constructor(){super(),this.active=!1,this.hasLoadedStrings=!1,this.run_after_connection=t=>{},this.active=!1,this.tasker=globalThis.tasker}get activeConnected(){return this.active&&void 0!==globalThis.backendaiclient&&null!==globalThis.backendaiclient&&!0===globalThis.backendaiclient.ready}get connected(){return void 0!==globalThis.backendaiclient&&null!==globalThis.backendaiclient&&!0===globalThis.backendaiclient.ready}_viewStateChanged(t){}shouldUpdate(){return this.active}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}attributeChangedCallback(t,e,i){"active"==t&&null!==i?(this.active=!0,this._viewStateChanged(!0)):(this.active=!1,this._viewStateChanged(!1)),super.attributeChangedCallback(t,e,i)}_hideDialog(t){t.target.closest("backend-ai-dialog").hide()}_addInputValidator(t){if(!t.hasAttribute("auto-validate"))return;let e;null===t.validityTransform&&(e=t.getAttribute("error-message")?t.getAttribute("error-message"):t.getAttribute("validationMessage")?t.getAttribute("validationMessage"):"Validation failed.",t.validityTransform=(i,r)=>r.valid?{valid:r.valid}:r.patternMismatch?(t.validationMessage=e,{valid:r.valid,patternMismatch:!r.valid}):r.valueMissing?(t.validationMessage="Value required.",{valid:r.valid,valueMissing:!r.valid}):r.tooShort?(t.validationMessage="Input too short.",{valid:r.valid,valueMissing:!r.valid}):(t.validationMessage=e,{valid:r.valid,patternMismatch:!r.valid}))}}r([yt({type:Boolean})],Un.prototype,"active",void 0),r([yt({type:Boolean})],Un.prototype,"hasLoadedStrings",void 0);let Hn=class extends Un{constructor(){super(),this.options=Object(),this.options={"user.desktop_notification":!0,"user.compact_sidebar":!1,"user.preserve_login":!1,"user.language":"default","user.automatic_update_check":!0,"user.custom_ssh_port":"","user.beta_feature":!1},this.readSettings()}firstUpdated(){}readSettings(){this._readSettings()}_readSettings(){for(let t=0,e=localStorage.length;t<e;++t)if(localStorage.key(t).startsWith("backendaiconsole.settings")){let e=localStorage.key(t).replace("backendaiconsole.settings.","");this._readSetting(e)}}exists(t,e="user"){return e+"."+t in this.options}get(t,e=null,i="user"){return i+"."+t in this.options?this.options[i+"."+t]:e}set(t,e,i="user"){return this._writeUserSetting(t,e,i)}delete(t,e="user"){return this._deleteUserSetting(t,e)}_readSetting(t,e=!0,i="user"){let r=localStorage.getItem("backendaiconsole.settings."+t);null!==r&&""!=r&&'""'!=r?"false"===r?this.options[t]=!1:"true"===r?this.options[t]=!0:this.isJson(r)?this.options[t]=JSON.parse(r):this.options[t]=r:this.options[t]=e}_writeUserSetting(t,e,i){!1===e?localStorage.setItem("backendaiconsole.settings."+i+"."+t,"false"):!0===e?localStorage.setItem("backendaiconsole.settings."+i+"."+t,"true"):"object"==typeof e?localStorage.setItem("backendaiconsole.settings."+i+"."+t,JSON.stringify(e)):localStorage.setItem("backendaiconsole.settings."+i+"."+t,e),this.options[i+"."+t]=e}_deleteUserSetting(t,e){return localStorage.removeItem("backendaiconsole.settings."+e+"."+t),delete this.options[e+"."+t],!0}isJson(t){try{JSON.parse(t)}catch(t){return!1}return!0}render(){return Z`
    `}};r([yt({type:Object})],Hn.prototype,"options",void 0),Hn=r([bt("backend-ai-settings-store")],Hn);var Vn=Hn;function Wn(t,e,i){return t<e?e:t>i?i:t}function Gn(t,e){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2))/2}const Kn={easing:"ease-out",fill:"both"};let Xn=class extends Ot{constructor(){super(...arguments),this.unbounded=!1,this.centered=!1,this.overlay=!1,this.disabled=!1,this.focusable=!1,this.autoRelease=!1,this.initialDuration=350,this.releaseDuration=500,this.role="presentation",this.target=this,this.listeners=[],this.rippleAnimationListeners=[]}connectedCallback(){super.connectedCallback(),this.addListeners()}disconnectedCallback(){super.disconnectedCallback(),this.removeListeners()}updated(t){super.updated(t),t.has("target")&&null!=this.target&&(this.removeListeners(),this.addListeners())}addListeners(){null!=this.target&&this.listeners.push(hn(this.target,"mousedown",(t=>this.spawnRipple(t)),{passive:!0}),hn(this.target,"focusin",this.onFocusIn.bind(this),{passive:!0}),hn(this.target,"focusout",this.onFocusOut.bind(this),{passive:!0}))}removeListeners(){un(this.listeners)}spawnRipple(t,e){if(this.disabled)return()=>{};this.releaseRipple();const i=this.getBoundingClientRect();let r=0,n=0;if(this.centered||null==t)r=i.width/2,n=i.height/2;else{let{clientX:e,clientY:o}=function(t){let e,i=!1;null!=t.changedTouches?(e=t.changedTouches[0],i=!0):e=t;let{clientX:r,clientY:n,pageX:o,pageY:s}=e;return{clientX:r,clientY:n,pageX:o,pageY:s,isTouch:i}}(t);r=e-i.left,n=o-i.top}const o=this.showRippleAtCoords({x:r,y:n},e);return this.rippleAnimationListeners.push(o),null==this.target||this.focusable||this.rippleAnimationListeners.push(hn(window,"mouseup",this.releaseRipple.bind(this),{passive:!0})),o}releaseRipple(){un(this.rippleAnimationListeners)}showRippleAtCoords({x:t,y:e},i){const{offsetWidth:r,offsetHeight:n}=this,o=bn(window.getComputedStyle(this)),{releaseDuration:s=this.releaseDuration,initialDuration:a=this.initialDuration,autoRelease:l=this.autoRelease}=i||{};t*=0===o.x?1:1/o.x,e*=0===o.y?1:1/o.y;const d=document.createElement("div");d.classList.add("ripple");const c=Gn(r,n),h=Gn(Math.abs(r/2-t),Math.abs(n/2-e)),u=Math.round(c+2*h),p=2*u;Object.assign(d.style,{left:t-u+"px",top:e-u+"px",height:p+"px",width:p+"px",position:"absolute"});let f=!1;const m=()=>{if(f)return;f=!0;const t=vn(window.getComputedStyle(d));d.animate({opacity:[t.toString(),"0"]},{...Kn,duration:s}).onfinish=()=>{requestAnimationFrame((()=>{this.shadowRoot.contains(d)&&this.shadowRoot.removeChild(d)}))}};return this.shadowRoot.appendChild(d),l&&m(),d.animate({transform:["scale(0)","scale(1)"]},{...Kn,duration:a}),m}onFocusIn(){this.focusable&&this.spawnRipple(void 0,{autoRelease:!1})}onFocusOut(){this.focusable&&this.releaseRipple()}render(){return Z``}};Xn.styles=[Bn,en(":host{position:relative;display:block;outline:none;-webkit-user-select:none;user-select:none}:host(:not([unbounded])){overflow:hidden}:host([overlay]){position:absolute;top:50%;left:50%;width:100%;height:100%;transform:translate(-50%,-50%)}.ripple{background:var(--ripple-color,currentcolor);opacity:var(--ripple-opacity,.15);border-radius:100%;pointer-events:none;will-change:opacity,transform}")],r([yt({type:Boolean,reflect:!0}),n("design:type",Boolean)],Xn.prototype,"unbounded",void 0),r([yt({type:Boolean,reflect:!0}),n("design:type",Boolean)],Xn.prototype,"centered",void 0),r([yt({type:Boolean,reflect:!0}),n("design:type",Boolean)],Xn.prototype,"overlay",void 0),r([yt({type:Boolean,reflect:!0}),n("design:type",Boolean)],Xn.prototype,"disabled",void 0),r([yt({type:Boolean,reflect:!0}),n("design:type",Boolean)],Xn.prototype,"focusable",void 0),r([yt({type:Boolean,reflect:!0}),n("design:type",Boolean)],Xn.prototype,"autoRelease",void 0),r([yt({type:Number}),n("design:type",Number)],Xn.prototype,"initialDuration",void 0),r([yt({type:Number}),n("design:type",Number)],Xn.prototype,"releaseDuration",void 0),r([yt({type:String,reflect:!0}),n("design:type",String)],Xn.prototype,"role",void 0),r([yt({type:Object}),n("design:type",EventTarget)],Xn.prototype,"target",void 0),Xn=r([bt("wl-ripple")],Xn);class Zn extends Ot{constructor(){super(...arguments),this.disabled=!1,this.readonly=!1,this.required=!1,this.value="",this.formElementId=In(),this.listeners=[]}get validationMessage(){return this.$formElement.validationMessage}get valid(){return null==this.validity||this.validity.valid}get validity(){return this.$formElement.validity}get willValidate(){return this.$formElement.willValidate}get form(){return this.$formElement.form}checkValidity(){return this.$formElement.checkValidity()}setCustomValidity(t){return this.$formElement.setCustomValidity(t)}firstUpdated(t){super.firstUpdated(t),this.$formElement=this.queryFormElement(),this.appendChild(this.$formElement)}disconnectedCallback(){super.disconnectedCallback(),un(this.listeners)}updated(t){super.updated(t),t.has("disabled")&&rn(this,{"aria-disabled":this.disabled.toString()}),this.updateTabindex(t)}updateTabindex(t){t.has("disabled")&&tn(this,this.disabled)}getFormItemValue(){return null!=this.$formElement?this.$formElement.value:this.initialValue||""}queryFormElement(){return this.shadowRoot.querySelector("#"+this.formElementId)}}Zn.styles=[Bn,en("")],r([yt({type:Boolean,reflect:!0}),n("design:type",Boolean)],Zn.prototype,"disabled",void 0),r([yt({type:Boolean,reflect:!0}),n("design:type",Boolean)],Zn.prototype,"readonly",void 0),r([yt({type:Boolean,reflect:!0}),n("design:type",Boolean)],Zn.prototype,"required",void 0),r([yt({type:String}),n("design:type",String)],Zn.prototype,"name",void 0),r([yt({type:String}),n("design:type",String)],Zn.prototype,"value",void 0);class Yn extends Zn{constructor(){super(...arguments),this.type="submit"}connectedCallback(){super.connectedCallback(),this.listeners.push(hn(this,"click",this.onClick.bind(this)),hn(this,"keydown",this.onKeyDown.bind(this)))}onKeyDown(t){t instanceof KeyboardEvent&&("Enter"===t.code||"Space"===t.code)&&(this.click(),pn(t),null!=this.$ripple&&this.$ripple.spawnRipple(void 0,{autoRelease:!0}))}onClick(t){this.disabled?pn(t):t.target!=this||t.defaultPrevented||this.$formElement.dispatchEvent(new MouseEvent("click",{relatedTarget:this,composed:!0}))}renderFormElement(){return Z` <button style="display: none;" id="${this.formElementId}" aria-hidden="true" tabindex="-1" type="${this.type}" ?disabled="${this.disabled}" name="${oi(this.name)}" value="${oi(this.value)}"></button> `}}Yn.styles=[...Zn.styles,en("")],r([yt({type:String}),n("design:type",String)],Yn.prototype,"type",void 0);let Jn=class extends Yn{constructor(){super(...arguments),this.inverted=!1,this.fab=!1,this.outlined=!1,this.noRipple=!1,this.flat=!1,this.role="button"}render(){return Z` <wl-ripple id="ripple" overlay .target="${this}" ?disabled="${this.disabled||this.noRipple}"></wl-ripple> <slot></slot> ${this.renderFormElement()} `}};Jn.styles=[...Yn.styles,en(':host{--_button-color:var(--button-color,hsl(var(--primary-500-contrast,var(--primary-hue-contrast,0),var(--primary-saturation-contrast,100%),var(--primary-lightness-contrast,100%))));--_button-bg:var(--button-bg,hsl(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%))));--_button-shadow-color:var(--button-shadow-color,hsla(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%)),0.2));color:var(--_button-color);background:var(--_button-bg);box-shadow:var(--elevation-1,0 .3125rem .625rem -.125rem var(--_button-shadow-color));padding:var(--button-padding,.75rem 1.5rem);font-size:var(--button-font-size,1rem);border-radius:var(--button-border-radius,.5rem);font-family:var(--button-font-family,var(--font-family-sans-serif,"Roboto Condensed",helvetica,sans-serif));transition:var(--button-transition,box-shadow var(--transition-duration-slow,.25s) var(--transition-timing-function-ease,ease),background var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease),color var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease));letter-spacing:var(--button-letter-spacing,.125rem);line-height:1;text-transform:uppercase;cursor:pointer;text-align:center;-webkit-user-select:none;user-select:none;outline:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:relative;z-index:0}:host,:host([fab]){display:inline-flex;align-items:center;justify-content:center}:host([fab]){width:var(--button-fab-size,2.5rem);height:var(--button-fab-size,2.5rem);padding:0;letter-spacing:0;border-radius:100%}:host([inverted]){color:var(--_button-bg);background:var(--_button-color)}:host([outlined]){border:var(--button-border-outlined,.125rem solid currentColor)}:host(:focus),:host(:hover){--_button-color:var(--button-color-hover,hsl(var(--primary-400-contrast,var(--primary-hue-contrast,0),var(--primary-saturation-contrast,100%),var(--primary-lightness-contrast,100%))));--_button-bg:var(--button-bg-hover,hsl(var(--primary-400,var(--primary-hue,224),var(--primary-saturation,42%),var(--primary-lightness,52%))));--_button-shadow-color:var(--button-shadow-color-hover,hsla(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%)),0.5));will-change:background,color,box-shadow}:host(:active){--_button-color:var(--button-color-active,hsl(var(--primary-500-contrast,var(--primary-hue-contrast,0),var(--primary-saturation-contrast,100%),var(--primary-lightness-contrast,100%))));--_button-bg:var(--button-bg-active,hsl(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%))));box-shadow:var(--elevation-4,0 .5rem 1rem -.125rem var(--_button-shadow-color))}:host([flat]:focus){background:var(--button-bg-active-flat,hsla(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%)),.08))}:host([disabled]){--_button-color:var(--button-color-disabled,hsl(var(--shade-400-contrast,var(--shade-hue-contrast,0),var(--shade-saturation-contrast,100%),var(--shade-lightness-contrast,100%))));--_button-bg:var(--button-bg-disabled,hsl(var(--shade-400,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,65%))));box-shadow:none;cursor:default;pointer-events:none}:host([flat]){box-shadow:none;background:none}#ripple{z-index:-1}')],r([yt({type:Boolean,reflect:!0}),n("design:type",Boolean)],Jn.prototype,"inverted",void 0),r([yt({type:Boolean,reflect:!0}),n("design:type",Boolean)],Jn.prototype,"fab",void 0),r([yt({type:Boolean,reflect:!0}),n("design:type",Boolean)],Jn.prototype,"outlined",void 0),r([yt({type:Boolean,reflect:!0}),n("design:type",Boolean)],Jn.prototype,"noRipple",void 0),r([yt({type:Boolean,reflect:!0}),n("design:type",Boolean)],Jn.prototype,"flat",void 0),r([yt({type:String,reflect:!0}),n("design:type",String)],Jn.prototype,"role",void 0),r([wt("#ripple"),n("design:type",Xn)],Jn.prototype,"$ripple",void 0),Jn=r([bt("wl-button")],Jn);var Qn;!function(t){t.SMALL="small",t.MEDIUM="medium",t.LARGE="large",t.AUTO="auto",t.FULLSCREEN="fullscreen"}(Qn||(Qn={}));Qn.MEDIUM;let to=class extends jn{constructor(){super(...arguments),this.scrollable=!1,this.role="dialog"}get $focusTrap(){return this.$dialog}animateIn(){let t=!1;const e=()=>{t||(t=!0,this.didShow())},i=this.$dialog.animate([{transform:"scale(0.9) translate(0, 30px)",opacity:"0"},{transform:"scale(1) translate(0, 0)",opacity:"1"}],this.animationConfig),r=this.$backdrop.animate([{opacity:"0"},{opacity:"1"}],this.animationConfig);i.onfinish=e,r.onfinish=e,this.activeInAnimations.push(i,r)}animateOut(t){let e=!1;const i=()=>{e||(e=!0,this.resolve(t),this.didHide(t))},r=this.$dialog.animate([{transform:"translateY(0)",opacity:"1"},{transform:"translateY(30px)",opacity:"0"}],this.animationConfig),n=this.$backdrop.animate([{opacity:"1"},{opacity:"0"}],this.animationConfig);r.onfinish=i,n.onfinish=i,this.activeOutAnimations.push(r,n)}render(){return Z` <wl-backdrop id="backdrop" @click="${this.clickAway}"></wl-backdrop> <focus-trap id="dialog" ?inactive="${!this.open||this.disableFocusTrap}"> <slot name="header"></slot> <slot name="content"></slot> <slot></slot> <slot name="footer"></slot> </focus-trap> `}};to.styles=[...jn.styles,en(":host{--_dialog-width:var(--dialog-width,auto);--_dialog-height:var(--dialog-height,auto);text-align:left;display:none;position:relative;outline:none}:host([scrollable]) #dialog{overflow:hidden}:host([scrollable]) ::slotted([slot=header]){padding:var(--dialog-header-padding-scrollable,1.5rem);border-bottom:var(--dialog-scrollable-border,.0625rem solid hsl(var(--shade-400,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,65%))))}:host([scrollable]) ::slotted([slot=footer]){border-top:var(--dialog-scrollable-border,.0625rem solid hsl(var(--shade-400,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,65%))))}:host([scrollable]) ::slotted([slot=content]){overflow-y:scroll;-webkit-overflow-scrolling:touch}:host([open]){display:flex;align-items:center;justify-content:center}::slotted([slot=header]){--h-margin:0;padding:var(--dialog-header-padding,1.5rem 1.5rem 0);margin:0;flex-shrink:0}::slotted([slot=footer]){padding:var(--dialog-footer-padding,.75rem);display:flex;align-items:center;justify-content:flex-end;flex-shrink:0}::slotted([slot=content]){padding:var(--dialog-content-padding,1.5rem);flex-grow:1}:host([fixed]){z-index:var(--dialog-z-index,1234567);will-change:transform,opacity;position:fixed;top:0;left:0;width:100%;height:100%}:host([fixed]) #dialog{min-width:var(--dialog-min-width,260px);min-height:var(--dialog-min-height,auto);max-width:var(--dialog-max-width,100vw);max-height:var(--dialog-max-height,100vh)}:host([size=small][fixed]){--_dialog-width:var(--dialog-width-s,40%);--_dialog-height:var(--dialog-height-s,40%)}:host([size=medium][fixed]){--_dialog-width:var(--dialog-width-m,50%);--_dialog-height:var(--dialog-height-m,50%)}:host([size=large][fixed]){--_dialog-width:var(--dialog-width-l,60%);--_dialog-height:var(--dialog-height-l,60%)}:host([size=auto][fixed]){--_dialog-width:var(--dialog-width-auto,auto);--_dialog-height:var(--dialog-height-auto,auto)}:host([size=fullscreen][fixed]){--_dialog-width:var(--dialog-width-fullscreen,100%);--_dialog-height:var(--dialog-height-fullscreen,100%)}:host([size=fullscreen][fixed]) #dialog{border-radius:0}#dialog{width:var(--_dialog-width);height:var(--_dialog-height);box-shadow:var(--dialog-elevation,var(--elevation-4,0 .5rem 1rem -.125rem hsla(var(--shadow,var(--shadow-hue,230),var(--shadow-saturation,70%),var(--shadow-lightness,5%)),.15)));border-radius:var(--dialog-border-radius,.5rem);background:var(--dialog-bg,hsl(var(--background,var(--background-hue,0),var(--background-saturation,0%),var(--background-lightness,100%))));color:var(--dialog-color,hsl(var(--foreground,var(--foreground-hue,230),var(--foreground-saturation,70%),var(--foreground-lightness,5%))));padding:0;margin:0;outline:none;display:flex;flex-direction:column;align-items:stretch;border:none;overflow-y:auto;overscroll-behavior:contain;position:relative;z-index:1}")],r([yt({type:String,reflect:!0}),n("design:type",String)],to.prototype,"size",void 0),r([yt({type:Boolean,reflect:!0}),n("design:type",Boolean)],to.prototype,"scrollable",void 0),r([yt({type:String,reflect:!0}),n("design:type",String)],to.prototype,"role",void 0),r([wt("#dialog"),n("design:type",Mn)],to.prototype,"$dialog",void 0),r([wt("#backdrop"),n("design:type",kn)],to.prototype,"$backdrop",void 0),to=r([bt("wl-dialog")],to);let eo=class extends Ot{constructor(){super(...arguments),this.role="presentation"}render(){return Z` <slot></slot> `}};eo.styles=[en(':host{font-size:var(--icon-size,1.5em);font-family:var(--icon-font,"Material Icons");font-weight:400;font-style:normal;color:inherit;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-feature-settings:"liga";-webkit-font-smoothing:antialiased}'),Bn],r([yt({type:String,reflect:!0}),n("design:type",String)],eo.prototype,"role",void 0),eo=r([bt("wl-icon")],eo);let io=class extends Ot{constructor(){super(),this.dialog=Object(),this.edition="Open Source",this.license="Subscription",this.validUntil="",this.version="",this.managerVersion=""}static get styles(){return[Ct`
        :host > *, html {
          font-family: var(--general-font-family);
        }

        a,
        a:visited {
          color: #222222;
        }

        a:hover {
          color: #3e872d;
        }

        #splash-panel {
          --dialog-width: 345px;
          --dialog-height: 345px;
          --dialog-border-radius: 10px;
        }

        .splash-header {
          height: 120px;
          background-size: contain;
          background-repeat: no-repeat;
          background-position: left top;
          background-color: RGB(246, 253, 247);
          font-size: 28px;
          font-weight: 400;
          line-height: 60px;
        }

        ul {
          list-style-type: none;
        }

        .splash-information .detail {
          font-weight: 400;
          font-size: 13px;
        }

        .copyright {
          font-size: 12px;
        }

        .release-note {
          font-size: 12px;
        }

      `]}firstUpdated(){this.dialog=this.shadowRoot.querySelector("wl-dialog")}connectedCallback(){super.connectedCallback()}show(){this.edition=globalThis.packageEdition,this.validUntil=globalThis.packageValidUntil,this.version=globalThis.packageVersion,this.managerVersion=globalThis.backendaiclient.managerVersion,"Open Source"!==this.edition?"2099-12-31"===globalThis.packageValidUntil||'""'===this.validUntil||""==this.validUntil?this.license=p("license.Perpetual"):this.license=p("license.Subscription"):this.license=p("license.OpenSource"),this.dialog.show()}hide(){this.dialog.hide()}render(){return Z`
      <wl-dialog id="splash-panel" fixed backdrop blockscrolling persistent>
        <div class="splash-header">
          <img src="manifest/backend.ai-text.svg" style="height:50px;padding:35px 20px;" />
          <wl-button style="position:absolute;top:0;right:0;" fab flat inverted @click="${()=>this.hide()}">
            <wl-icon>close</wl-icon>
          </wl-button>
        </div>
        <div class="splash-information">
          <ul>
            <li>Backend.AI Console <span id="version-detail" class="detail">${globalThis.packageVersion}</span></li>
            <li><span id="license-detail">${this.edition} Edition</span></li>
            <li><span id="valid-until" class="detail">
              ${"Subscription"===this.license?Z`Subscription is active until ${this.validUntil}`:Z``}
              ${"Perpetual"===this.license?Z`Perpetual License`:Z``}
              </span></li>
            <li style="margin-top:15px;"><span id="mode-detail" class="detail">Backend.AI Cluster</span> <span id="manager-build-detail" class="detail">${this.managerVersion}</span></li>
            <li><span id="mode-detail" class="detail">${globalThis.isElectron?"App":"WebServer"}</span> <span id="build-detail" class="detail">Build ${globalThis.buildVersion}</span></li>
          </ul>
          <ul>
            <li>Powered by <a target="_blank" href="https://github.com/lablup/backend.ai/blob/master/LICENSE">open-source software</a></li>
            <li class="copyright">Copyright &copy; 2015-2020 Lablup Inc.</li>
            <li class="release-note">
              <a target="_blank" href="https://github.com/lablup/backend.ai-console/releases/tag/v${this.version}">Release Note</a>
              <a target="_blank" href="https://github.com/lablup/backend.ai-console/blob/main/LICENSE">License</a>
            </li>
            </ul>
          </ul>
        </div>
      </wl-dialog>
    `}};r([yt({type:Object})],io.prototype,"dialog",void 0),r([yt({type:String})],io.prototype,"edition",void 0),r([yt({type:String})],io.prototype,"license",void 0),r([yt({type:String})],io.prototype,"validUntil",void 0),r([yt({type:String})],io.prototype,"version",void 0),r([yt({type:String})],io.prototype,"managerVersion",void 0),io=r([bt("backend-ai-splash")],io);let ro=class extends Un{constructor(){super(),this.lang="default",this.manualURL="",this.disabled=!1,this.URLmatchingTable={"":"summary/summary.html",summary:"summary/summary.html",data:"vfolder/vfolder.html",job:"session_use/session_use.html",credential:"admin_user_keypair_management/admin_user_keypair_management.html",environment:"admin_user_keypair_management/admin_user_keypair_management.html#manage-images",agent:"admin_user_keypair_management/admin_user_keypair_management.html#query-agent-nodes",settings:"admin_user_keypair_management/admin_user_keypair_management.html#system-settings"}}static get styles(){return[Ct`
    mwc-icon-button {
      color: white;
    }
    `]}firstUpdated(){this.currentPage}connectedCallback(){super.connectedCallback()}get currentPage(){let t=globalThis.location.toString().split(/[\/]+/).pop();return void 0===this.page?this.page="error":this.page=t,this.page}showHelpPage(){let t="";if(""!=this.manualURL)t=this.manualURL;else if(this.currentPage in this.URLmatchingTable){t=this.URLmatchingTable[this.currentPage];let e=globalThis.backendaioptions.get("current_language");["ko","en"].includes(e)?this.lang=e:this.lang="en"}this.showOnlineHelpPage(t)}showOnlineHelpPage(t){window.open(`https://console.docs.backend.ai/${this.lang}/latest/`+t,"_blank")}render(){return Z`
      <mwc-icon-button id="help-page-button" icon="help_outline" @click="${()=>this.showHelpPage()}"></mwc-icon-button>
    `}};r([yt({type:String})],ro.prototype,"lang",void 0),r([yt({type:String})],ro.prototype,"manualURL",void 0),r([yt({type:String})],ro.prototype,"page",void 0),r([yt({type:Boolean})],ro.prototype,"disabled",void 0),r([yt({type:Object})],ro.prototype,"URLmatchingTable",void 0),ro=r([bt("backend-ai-help-button")],ro);let no=class extends jn{constructor(){super(...arguments),this.role="banner",this.hideDelay=5e3,this.autoHideTimeout=null}get $focusTrap(){return this.$snackbar}animateIn(){let t=!1;const e=()=>{t||(t=!0,this.didShow())},i=this.$snackbar.animate([{transform:"translateY(100%)",opacity:"0"},{transform:"translateY(0)",opacity:"1"}],this.animationConfig),r=this.$backdrop.animate([{opacity:"0"},{opacity:"1"}],this.animationConfig);r.onfinish=e,i.onfinish=e,this.activeInAnimations.push(i,r)}animateOut(t){null!=this.autoHideTimeout&&window.clearTimeout(this.autoHideTimeout);let e=!1;const i=()=>{e||(e=!0,this.resolve(t),this.didHide(t))},r=this.$snackbar.animate([{transform:"translateY(0)",opacity:"1"},{transform:"translateY(100%)",opacity:"0"}],this.animationConfig),n=this.$backdrop.animate([{opacity:"1"},{opacity:"0"}],this.animationConfig);n.onfinish=i,r.onfinish=i,this.activeOutAnimations.push(r,n)}didShow(){super.didShow(),this.autoHideTimeout=window.setTimeout((()=>{this.persistent||this.hide()}),this.hideDelay)}render(){return Z` <wl-backdrop id="backdrop" @click="${this.clickAway}"></wl-backdrop> <focus-trap id="snackbar" ?inactive="${!this.open||this.disableFocusTrap}"> <div id="content"> <slot name="icon"></slot> <slot></slot> </div> <div id="actions"> <slot name="action"></slot> </div> </focus-trap> `}};no.styles=[...jn.styles,en(":host{display:none;pointer-events:none;outline:none}:host([open]){display:block}:host([fixed]){padding:var(--snackbar-fixed-padding,.75rem);z-index:var(--snackbar-z-index,12345678);position:fixed;left:0;bottom:0;top:0;right:0}:host([fixed][open]){display:flex;align-items:flex-end}#snackbar{padding:var(--snackbar-padding,.375rem);color:var(--snackbar-color,hsl(var(--background,var(--background-hue,0),var(--background-saturation,0%),var(--background-lightness,100%))));background:var(--snackbar-bg,hsl(var(--foreground,var(--foreground-hue,230),var(--foreground-saturation,70%),var(--foreground-lightness,5%))));border-radius:var(--snackbar-border-radius,.5rem);box-shadow:var(--snackbar-elevation,var(--elevation-1,0 .3125rem .625rem -.125rem hsla(var(--shadow,var(--shadow-hue,230),var(--shadow-saturation,70%),var(--shadow-lightness,5%)),.15)));flex-wrap:wrap;justify-content:flex-end;text-align:left;position:relative;pointer-events:all}#actions,#content,#snackbar{display:flex;align-items:center;flex-wrap:wrap}::slotted([slot=icon]){margin:var(--snackbar-icon-margin,0 .75rem 0 0);color:var(--snackbar-icon-color,hsl(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%))))}#content{padding:var(--snackbar-content-padding,.375rem .75rem);flex-grow:1}")],r([yt({type:String,reflect:!0}),n("design:type",String)],no.prototype,"role",void 0),r([yt({type:Number}),n("design:type",Object)],no.prototype,"hideDelay",void 0),r([wt("#backdrop"),n("design:type",kn)],no.prototype,"$backdrop",void 0),r([wt("#snackbar"),n("design:type",Mn)],no.prototype,"$snackbar",void 0),no=r([bt("wl-snackbar")],no);
/**
 @license
 Copyright (c) 2015-2020 Lablup Inc. All rights reserved.
 */
let oo=class extends Ot{constructor(){super(),this.text="",this.detail="",this.url="",this.message="",this.requestUrl="",this.status="",this.timestamp="",this.notifications=Array(),this.notificationstore=Array(),this.active=!0,this.supportDesktopNotification=!1,this.step=0,this.newDesktopNotification=Object(),this.options=Object(),this.options={desktop_notification:!0}}static get is(){return"lablup-notification"}static get styles(){return[Ct`
        wl-snackbar {
          position: fixed;
          right: 20px;
          font-size: 16px;
          font-weight: 400;
          font-family: 'Ubuntu', 'Quicksand', Roboto, sans-serif;
          z-index: 12345678;
        }

        wl-button {
          --button-font-size: 11px;
          --button-fab-size: 12px;
        }

        wl-icon {
          --icon-size: 10px;
        }
      `]}render(){return Z``}shouldUpdate(){return this.active}firstUpdated(){"Notification"in window&&("granted"===Notification.permission?this.supportDesktopNotification=!0:(Notification.permission,Notification.requestPermission().then((()=>{this.supportDesktopNotification=!0})))),this._readUserSetting("desktop_notification",!0),!1===this.options.desktop_notification&&(this.supportDesktopNotification=!1)}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}async getMoreState(){}async ladder(){}_readUserSetting(t,e=!0){let i=localStorage.getItem("backendaiconsole.usersetting."+t);this.options[t]=null!==i&&""!=i&&'""'!=i?"false"!==i&&("true"===i||i):e}_hideNotification(t){t.target.closest("wl-snackbar").hide()}_moreNotification(t){this._hideNotification(t);let e=globalThis.location.toString().split(/[\/]+/).pop();if(globalThis.history.pushState({},"","/usersettings"),Jt.dispatch(Vt(decodeURIComponent("/usersettings"),{tab:"logs"})),e&&"usersettings"===e){let t=new CustomEvent("backend-ai-usersettings-logs",{});document.dispatchEvent(t)}}_createCloseButton(t){let e=document.createElement("wl-button");e.setAttribute("slot","action"),e.setAttribute("flat",""),e.setAttribute("fab",""),e.addEventListener("click",this._hideNotification.bind(this)),e.innerHTML="<wl-icon>close</wl-icon>",t.appendChild(e)}async show(t=!1,e=Object()){let i=document.querySelector("wl-snackbar[persistent='true']");i&&(this.notifications=[],document.body.removeChild(i)),this.gc();let r=document.createElement("wl-snackbar");if(r.innerHTML='<span style="overflow-x:hidden">'+this.text+"</span>",""!=this.detail&&(r.innerHTML=r.innerHTML+'<div style="display:none;"> : '+this.detail+"</div>"),0!==Object.keys(e).length&&this._saveToLocalStorage("backendaiconsole.logs",e),""!==this.detail){let t=document.createElement("wl-button");t.style.fontSize="12px",t.setAttribute("slot","action"),t.setAttribute("flat",""),t.setAttribute("fab",""),t.style.width="80px",""!=this.url?(t.innerHTML=p("notification.Visit"),t.addEventListener("click",this._openURL.bind(this,this.url))):(t.innerHTML=p("notification.SeeDetail"),t.addEventListener("click",this._moreNotification.bind(this))),r.appendChild(t)}this.detail="",this.url="",!1===t?r.setAttribute("hideDelay","3000"):(r.setAttribute("persistent","true"),this._createCloseButton(r)),r.setAttribute("backdrop",""),r.style.bottom=20+55*this.step+"px",r.style.position="fixed",r.querySelector("span").style.overflowX="hidden",r.querySelector("span").style.maxWidth="70vw",r.style.right="20px",r.style.fontSize="16px",r.style.fontWeight="400",r.style.fontFamily="'Ubuntu', 'Quicksand', Roboto, sans-serif",r.style.zIndex="12345678";let n=new Date;r.setAttribute("created",n.toLocaleString()),document.body.appendChild(r),this.notifications.push(r),await this.updateComplete,r.show();let o=new CustomEvent("backend-ai-notification-changed",{});document.dispatchEvent(o),this._spawnDesktopNotification("Backend.AI",this.text,"")}_spawnDesktopNotification(t,e,i){if(!1===this.supportDesktopNotification)return;let r={body:e,icon:i};this.newDesktopNotification=new Notification(t,r)}_openURL(t){window.open(t,"_blank")}_saveToLocalStorage(t,e){const i=JSON.parse(localStorage.getItem(t)||"{}");let r=Array();r.push(e),r=r.concat(i),localStorage.setItem(t,JSON.stringify(r))}gc(){if(this.notifications.length>0){let t=this.notifications.filter((t=>!0===t.open));this.notifications=t;let e=new CustomEvent("backend-ai-notification-changed",{});document.dispatchEvent(e)}let t=JSON.parse(localStorage.getItem("backendaiconsole.logs")||"{}");t.length>3e3&&(t=t.slice(0,2999)),this.step=this.notifications.length,localStorage.setItem("backendaiconsole.logs",JSON.stringify(t))}};r([yt({type:String})],oo.prototype,"text",void 0),r([yt({type:String})],oo.prototype,"detail",void 0),r([yt({type:String})],oo.prototype,"url",void 0),r([yt({type:String})],oo.prototype,"message",void 0),r([yt({type:String})],oo.prototype,"requestUrl",void 0),r([yt({type:String})],oo.prototype,"status",void 0),r([yt({type:String})],oo.prototype,"timestamp",void 0),r([yt({type:Object})],oo.prototype,"indicator",void 0),r([yt({type:Array})],oo.prototype,"notifications",void 0),r([yt({type:Array})],oo.prototype,"notificationstore",void 0),r([yt({type:Boolean})],oo.prototype,"active",void 0),r([yt({type:Boolean})],oo.prototype,"supportDesktopNotification",void 0),r([yt({type:Number})],oo.prototype,"step",void 0),r([yt({type:Object})],oo.prototype,"newDesktopNotification",void 0),r([yt({type:Object})],oo.prototype,"options",void 0),oo=r([bt("lablup-notification")],oo);let so=class extends Ot{constructor(){super(...arguments),this.role="separator",this.vertical=!1}render(){return Z` <slot></slot> `}};so.styles=[en(":host{background:var(--divider-color,rgba(0,0,0,.15));height:var(--divider-size,.0625rem);display:block;width:100%}:host([vertical]){width:var(--divider-size,.0625rem);height:100%}"),Bn],r([yt({type:String,reflect:!0}),n("design:type",String)],so.prototype,"role",void 0),r([yt({type:Boolean,reflect:!0}),n("design:type",Boolean)],so.prototype,"vertical",void 0),so=r([bt("wl-divider")],so);let ao=class extends Ot{constructor(){super(...arguments),this.role="banner"}render(){return Z` <div id="content"> <slot name="icon"></slot> <slot></slot> </div> <div id="actions"> <slot name="action"></slot> </div> <wl-divider id="divider"></wl-divider> `}};ao.styles=[Bn,en(":host{padding:var(--banner-padding,.375rem);color:var(--banner-color,hsl(var(--foreground,var(--foreground-hue,230),var(--foreground-saturation,70%),var(--foreground-lightness,5%))));background:var(--banner-bg,hsl(var(--background,var(--background-hue,0),var(--background-saturation,0%),var(--background-lightness,100%))));flex-wrap:wrap;justify-content:flex-end;text-align:left;position:relative}#actions,#content,:host{display:flex;align-items:center;flex-wrap:wrap}::slotted([slot=icon]){margin:var(--banner-icon-margin,0 .75rem 0 0);color:var(--banner-icon-color,hsl(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%))))}#content{padding:var(--banner-content-padding,.375rem .75rem);flex-grow:1}#divider{position:absolute;left:0;bottom:0;width:100%}")],r([yt({type:String,reflect:!0}),n("design:type",String)],ao.prototype,"role",void 0),ao=r([bt("wl-banner")],ao);var lo;!function(t){t.INDETERMINATE="indeterminate",t.DETERMINATE="determinate"}(lo||(lo={}));class co extends Ot{constructor(){super(...arguments),this.mode=lo.INDETERMINATE,this.value=0,this.max=1,this.min=0,this.buffer=0,this.bufferMax=1,this.bufferMin=0,this.role="progressbar"}get progressPerc(){return Wn(this.value/(this.max-this.min),0,1)}get bufferPerc(){return Wn(this.buffer/(this.bufferMax-this.bufferMin),0,1)}connectedCallback(){super.connectedCallback(),this.setAttribute("role",this.role)}updateAria(){rn(this,{"aria-valuemin":this.min,"aria-valuemax":this.max,"aria-valuenow":this.value,"aria-valuetext":100*this.progressPerc+"%","aria-busy":"true","aria-live":"polite"})}updated(t){super.updated(t),this.updateAria()}}co.styles=[Bn,en("")],r([yt({type:String,reflect:!0}),n("design:type",String)],co.prototype,"mode",void 0),r([yt({type:Number}),n("design:type",Number)],co.prototype,"value",void 0),r([yt({type:Number}),n("design:type",Number)],co.prototype,"max",void 0),r([yt({type:Number}),n("design:type",Number)],co.prototype,"min",void 0),r([yt({type:Number}),n("design:type",Number)],co.prototype,"buffer",void 0),r([yt({type:Number}),n("design:type",Number)],co.prototype,"bufferMax",void 0),r([yt({type:Number}),n("design:type",Number)],co.prototype,"bufferMin",void 0),r([yt({type:String,reflect:!0}),n("design:type",String)],co.prototype,"role",void 0);let ho=class extends co{render(){return Z`
			${this.bufferPerc>0?Z`
						<div id="buffer" style="transform: scaleX(${this.bufferPerc})"></div>
				  `:""}
			<div id="progress" style="${this.mode===lo.DETERMINATE?`transform: scaleX(${this.progressPerc})`:""}">
				<div id="before"></div>
				<div id="after"></div>
			</div>
		`}};ho.styles=[...co.styles,en(":host{height:var(--progress-bar-height,.25rem);background:var(--progress-bar-bg,hsl(var(--shade-300,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,75%))));contain:strict;position:relative;display:block;overflow:hidden}#progress{background:var(--progress-bar-color,hsl(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%))))}#buffer{background:var(--progress-bar-buffer-color,hsla(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%)),.5))}:host([mode=indeterminate]) #progress #after,:host([mode=indeterminate]) #progress #before{background-color:inherit;position:absolute;height:100%;left:0;top:0;bottom:0;animation-duration:var(--progress-bar-indeterminate-duration,2.1s);animation-timing-function:var(--progress-bar-indeterminate-timing-function,var(--transition-timing-function-standard-curve,cubic-bezier(.4,0,.2,1)));animation-iteration-count:infinite}:host([mode=indeterminate]) #progress #before{animation-name:indeterminate}:host([mode=indeterminate]) #progress #after{animation-name:indeterminate-short;animation-delay:var(--progress-bar-indeterminate-short-delay,1.15s)}#buffer,:host([mode=determinate]) #progress{transition:var(--progress-bar-determinate-transition,transform var(--transition-timing-function-linear,linear));transform-origin:top left;position:absolute;top:0;left:0;height:100%;width:100%}@keyframes indeterminate{0%{left:-35%;right:100%}60%{left:100%;right:-90%}to{left:100%;right:-90%}}@keyframes indeterminate-short{0%{left:-200%;right:100%}60%{left:107%;right:-8%}to{left:107%;right:-8%}}")],ho=r([bt("wl-progress-bar")],ho);let uo=class extends Ot{constructor(){super(...arguments),this.level=1,this.nowrap=!1,this.role="heading"}updated(t){super.updated(t),t.has("level")&&rn(this,{"aria-level":this.level})}render(){return Z` <slot></slot> `}};uo.styles=[Bn,en(':host{margin:var(--title-margin,0 0 .2em);font-family:var(--title-font-family,var(--font-family-sans-serif,"Roboto Condensed",helvetica,sans-serif));font-weight:var(--title-font-weight,var(--font-weight-bold,800));line-height:var(--title-line-height,var(--line-height-m,1.5em));display:block}:host([nowrap]){white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;line-height:1.1}:host([level="1"]){font-size:var(--title-font-size-level-1,1.875rem)}:host([level="2"]){font-size:var(--title-font-size-level-2,1.5625rem)}:host([level="3"]){font-size:var(--title-font-size-level-3,1.25rem)}:host([level="4"]){font-size:var(--title-font-size-level-4,1rem)}:host([level="5"]){font-size:var(--title-font-size-level-5,.75rem)}:host([level="6"]){font-size:var(--title-font-size-level-6,.5rem)}')],r([yt({type:Number,reflect:!0}),n("design:type",Number)],uo.prototype,"level",void 0),r([yt({type:Boolean}),n("design:type",Boolean)],uo.prototype,"nowrap",void 0),r([yt({type:String,reflect:!0}),n("design:type",String)],uo.prototype,"role",void 0),uo=r([bt("wl-title")],uo);let po=class extends Ot{constructor(){super(),this.value=0,this.delay=1e3,this.text="",this.mode="determinate"}static get styles(){return[Ct`
        wl-dialog {
          position: fixed;
          right: 20px;
          bottom: 20px;
          z-index: 9000;
          --dialog-height: 80px;
          --dialog-width: 250px;
          --dialog-content-padding: 15px;
        }
      `]}firstUpdated(){this.dialog=this.shadowRoot.querySelector("#app-progress-dialog")}connectedCallback(){super.connectedCallback()}async start(t="determinate"){this.value=0,this.mode=t,await this.updateComplete,this.dialog.show()}set(t,e=""){this.value=t/100,this.text=e,this.value>=1&&this.end(this.delay)}end(t=1e3){0!==t&&(this.delay=t),setTimeout((()=>{this.dialog.hide()}),t)}render(){return Z`
      <wl-dialog id="app-progress-dialog" blockscrolling>
        <wl-title level="5" id="app-progress-text" slot="header">${this.text}</wl-title>
        <div slot="content">
        <wl-progress-bar .mode="${this.mode}" id="app-progress" .value="${this.value}"></wl-progress-bar>
        </div>
      </wl-dialog>
    `}};r([yt({type:Number})],po.prototype,"value",void 0),r([yt({type:Number})],po.prototype,"delay",void 0),r([yt({type:String})],po.prototype,"text",void 0),r([yt({type:String})],po.prototype,"mode",void 0),r([yt({type:Object})],po.prototype,"dialog",void 0),po=r([bt("backend-ai-indicator")],po);let fo=class extends Ot{constructor(){super(),this.value=0,this.step=0,this.text="",this.mode="determinate",this.pool=Array()}static get styles(){return[]}firstUpdated(){this.dialog=this.shadowRoot.querySelector("#app-progress-dialog")}connectedCallback(){super.connectedCallback()}async start(t="determinate"){this.gc();let e=document.createElement("backend-ai-indicator");return e.value=0,e.text="Initializing...",e.mode=t,e.style.bottom=20+90*this.step+"px",document.body.appendChild(e),this.pool.push(e),this.step=this.pool.length,await this.updateComplete,await e.start(),e}removeIndicator(t){let e=this.pool.filter((e=>e===t));if(e.length>0){let t=this.pool.indexOf(e[0]);t>-1&&this.pool.splice(t,1),document.body.removeChild(e[0]),e[0].remove(),console.log("deleted")}}gc(){let t=[];this.pool.forEach((e=>{console.log(e.value),e.value>=1&&t.push(e)})),t.forEach((t=>{setTimeout((()=>{this.removeIndicator(t)}),t.delay+500)}))}render(){return Z`
    `}};r([yt({type:Number})],fo.prototype,"value",void 0),r([yt({type:Number})],fo.prototype,"step",void 0),r([yt({type:String})],fo.prototype,"text",void 0),r([yt({type:String})],fo.prototype,"mode",void 0),r([yt({type:Object})],fo.prototype,"dialog",void 0),r([yt({type:Array})],fo.prototype,"pool",void 0),fo=r([bt("backend-ai-indicator-pool")],fo);var mo;!function(t){t.CHANGE="change"}(mo||(mo={}));class go extends Zn{constructor(){super(...arguments),this.checked=!1,this.ariaChecked=this.checked.toString(),this.role="checkbox",this.formElementType="checkbox"}firstUpdated(t){super.firstUpdated(t),this.onClick=this.onClick.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.attachListeners()}updated(t){super.updated(t),this.updateAria(t)}updateAria(t){t.has("checked")&&(this.ariaChecked=this.checked.toString())}attachListeners(){this.listeners.push(hn(this,"click",this.onClick.bind(this)),hn(this,"keydown",this.onKeyDown.bind(this)))}onClick(t){this.disabled?pn(t):this.toggle()}toggle(){this.checked=!this.checked,this.dispatchChangeEvent()}dispatchChangeEvent(){requestAnimationFrame((()=>{this.dispatchEvent(new CustomEvent(mo.CHANGE,{composed:!0,bubbles:!0,detail:this.checked}))}))}onKeyDown(t){"Space"!==t.code&&"Enter"!==t.code||(this.click(),pn(t))}renderFormElement(){return Z` <input style="display: none;" id="${this.formElementId}" type="${this.formElementType}" ?checked="${this.checked}" ?required="${this.required}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" .value="${this.value}" name="${oi(this.name)}" aria-hidden="true" tabindex="-1"> `}}go.styles=[...Zn.styles,en("")],r([yt({type:Boolean,reflect:!0}),n("design:type",Boolean)],go.prototype,"checked",void 0),r([yt({type:String,reflect:!0,attribute:"aria-checked"}),n("design:type",String)],go.prototype,"ariaChecked",void 0),r([yt({type:String,reflect:!0}),n("design:type",String)],go.prototype,"role",void 0);class bo extends go{constructor(){super(...arguments),this.indeterminate=!1}toggle(){this.indeterminate&&(this.indeterminate=!1),this.checked=!this.checked,this.dispatchChangeEvent()}updateAria(t){(t.has("checked")||t.has("indeterminate"))&&(this.ariaChecked=this.indeterminate?"mixed":this.checked.toString())}}bo.styles=[...go.styles,en("")],r([yt({type:Boolean,reflect:!0}),n("design:type",Boolean)],bo.prototype,"indeterminate",void 0);let vo=class extends bo{render(){return Z` <svg id="checkmark" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" preserveAspectRatio="none" viewBox="0 0 24 24"> <path id="checkmark-path" fill="none" d="M1.73,12.91 8.1,19.28 22.79,4.59"></path> <line id="indeterminate-path" fill="none" x1="0" y1="12.5" x2="24" y2="12.5"/> </svg> <wl-ripple id="ripple" .target="${this}" focusable overlay unbounded centered initialDuration="200"></wl-ripple> <slot></slot> ${this.renderFormElement()} `}};vo.styles=[...go.styles,en(":host{--_checkbox-bg:var(--checkbox-bg,transparent);--_checkbox-color:var(--checkbox-color,hsl(var(--shade-500,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,55%))));background:var(--_checkbox-bg);color:var(--_checkbox-color);width:var(--checkbox-size,1.25rem);height:var(--checkbox-size,1.25rem);border:var(--checkbox-border-config,.125rem solid) currentColor;border-radius:var(--checkbox-border-radius,.375rem);transition:var(--checkbox-transition,background var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)),border-color var(--transition-duration-fast,.12s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)));position:relative;display:inline-flex;align-items:center;justify-content:center;outline:none;-webkit-user-select:none;user-select:none}:host(:not([disabled])){cursor:pointer}:host([checked]),:host([indeterminate]){--_checkbox-bg:var(--checkbox-bg-checked,hsl(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%))));--_checkbox-color:var(--checkbox-color-checked,hsl(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%))))}:host([checked]:not([indeterminate])) #checkmark-path,:host([indeterminate]) #indeterminate-path{stroke-dashoffset:0}:host(:focus),:host(:hover){will-change:border,background}:host(:focus) #checkmark-path,:host(:hover) #checkmark-path{will-change:stroke-dashoffset}:host([disabled]){--_checkbox-bg:var(--checkbox-bg-disabled,transparent);--_checkbox-color:var(--checkbox-color-disabled,hsl(var(--shade-400,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,65%))));pointer-events:none}:host([disabled][checked]),:host([disabled][indeterminate]){--_checkbox-bg:var(--checkbox-bg-disabled-checked,hsl(var(--shade-500,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,55%))));--_checkbox-color:var(--checkbox-color-disabled-checked,hsl(var(--shade-500,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,55%))))}#checkmark{width:var(--checkbox-checkmark-size,.75rem);height:var(--checkbox-checkmark-size,.75rem)}#checkmark-path,#indeterminate-path{stroke-width:var(--checkbox-checkmark-path-width,.1875rem);stroke:var(--checkbox-checkmark-stroke-color,hsl(var(--primary-500-contrast,var(--primary-hue-contrast,0),var(--primary-saturation-contrast,100%),var(--primary-lightness-contrast,100%))));stroke-dasharray:var(--checkbox-checkmark-path-dasharray,30);stroke-dashoffset:var(--checkbox-checkmark-path-dasharray,30);transition:var(--checkbox-checkmark-transition,stroke-dashoffset var(--transition-duration-medium,.18s) var(--transition-timing-function-deceleration-curve,cubic-bezier(0,0,.2,1)))}#checkmark-path{transition-delay:var(--checkbox-checkmark-path-delay,50ms)}#ripple{transform:var(--checkbox-ripple-transform,translate(-50%,-50%) scale(1.8))}")],vo=r([bt("wl-checkbox")],vo);
/**
 @license
 Copyright (c) 2015 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 yo=Ct`
    /* Most common used flex styles*/
    .layout.horizontal,
    .layout.vertical {
      display: -ms-flexbox;
      display: -webkit-flex;
      display: flex;
    }

    .layout.inline {
      display: -ms-inline-flexbox;
      display: -webkit-inline-flex;
      display: inline-flex;
    }

    .layout.horizontal {
      -ms-flex-direction: row;
      -webkit-flex-direction: row;
      flex-direction: row;
    }

    .layout.vertical {
      -ms-flex-direction: column;
      -webkit-flex-direction: column;
      flex-direction: column;
    }

    .layout.wrap {
      -ms-flex-wrap: wrap;
      -webkit-flex-wrap: wrap;
      flex-wrap: wrap;
    }

    .layout.no-wrap {
      -ms-flex-wrap: nowrap;
      -webkit-flex-wrap: nowrap;
      flex-wrap: nowrap;
    }

    .layout.center,
    .layout.center-center {
      -ms-flex-align: center;
      -webkit-align-items: center;
      align-items: center;
    }

    .layout.center-justified,
    .layout.center-center {
      -ms-flex-pack: center;
      -webkit-justify-content: center;
      justify-content: center;
    }

    .flex {
      -ms-flex: 1 1 0.000000001px;
      -webkit-flex: 1;
      flex: 1;
      -webkit-flex-basis: 0.000000001px;
      flex-basis: 0.000000001px;
    }

    .flex-auto {
      -ms-flex: 1 1 auto;
      -webkit-flex: 1 1 auto;
      flex: 1 1 auto;
    }

    .flex-none {
      -ms-flex: none;
      -webkit-flex: none;
      flex: none;
    }
  `,_o=(Ct`
    .layout.horizontal-reverse,
    .layout.vertical-reverse {
      display: -ms-flexbox;
      display: -webkit-flex;
      display: flex;
    }

    .layout.horizontal-reverse {
      -ms-flex-direction: row-reverse;
      -webkit-flex-direction: row-reverse;
      flex-direction: row-reverse;
    }

    .layout.vertical-reverse {
      -ms-flex-direction: column-reverse;
      -webkit-flex-direction: column-reverse;
      flex-direction: column-reverse;
    }

    .layout.wrap-reverse {
      -ms-flex-wrap: wrap-reverse;
      -webkit-flex-wrap: wrap-reverse;
      flex-wrap: wrap-reverse;
    }
  `,Ct`

    /**
     * Alignment in cross axis.
     */
    .layout.start {
      -ms-flex-align: start;
      -webkit-align-items: flex-start;
      align-items: flex-start;
    }

    .layout.center,
    .layout.center-center {
      -ms-flex-align: center;
      -webkit-align-items: center;
      align-items: center;
    }

    .layout.end {
      -ms-flex-align: end;
      -webkit-align-items: flex-end;
      align-items: flex-end;
    }

    .layout.baseline {
      -ms-flex-align: baseline;
      -webkit-align-items: baseline;
      align-items: baseline;
    }

    /**
     * Alignment in main axis.
     */
    .layout.start-justified {
      -ms-flex-pack: start;
      -webkit-justify-content: flex-start;
      justify-content: flex-start;
    }

    .layout.center-justified,
    .layout.center-center {
      -ms-flex-pack: center;
      -webkit-justify-content: center;
      justify-content: center;
    }

    .layout.end-justified {
      -ms-flex-pack: end;
      -webkit-justify-content: flex-end;
      justify-content: flex-end;
    }

    .layout.around-justified {
      -ms-flex-pack: distribute;
      -webkit-justify-content: space-around;
      justify-content: space-around;
    }

    .layout.justified {
      -ms-flex-pack: justify;
      -webkit-justify-content: space-between;
      justify-content: space-between;
    }

    /**
     * Self alignment.
     */
    .self-start {
      -ms-align-self: flex-start;
      -webkit-align-self: flex-start;
      align-self: flex-start;
    }

    .self-center {
      -ms-align-self: center;
      -webkit-align-self: center;
      align-self: center;
    }

    .self-end {
      -ms-align-self: flex-end;
      -webkit-align-self: flex-end;
      align-self: flex-end;
    }

    .self-stretch {
      -ms-align-self: stretch;
      -webkit-align-self: stretch;
      align-self: stretch;
    }

    .self-baseline {
      -ms-align-self: baseline;
      -webkit-align-self: baseline;
      align-self: baseline;
    }

    /**
     * multi-line alignment in main axis.
     */
    .layout.start-aligned {
      -ms-flex-line-pack: start; /* IE10 */
      -ms-align-content: flex-start;
      -webkit-align-content: flex-start;
      align-content: flex-start;
    }

    .layout.end-aligned {
      -ms-flex-line-pack: end; /* IE10 */
      -ms-align-content: flex-end;
      -webkit-align-content: flex-end;
      align-content: flex-end;
    }

    .layout.center-aligned {
      -ms-flex-line-pack: center; /* IE10 */
      -ms-align-content: center;
      -webkit-align-content: center;
      align-content: center;
    }

    .layout.between-aligned {
      -ms-flex-line-pack: justify; /* IE10 */
      -ms-align-content: space-between;
      -webkit-align-content: space-between;
      align-content: space-between;
    }

    .layout.around-aligned {
      -ms-flex-line-pack: distribute; /* IE10 */
      -ms-align-content: space-around;
      -webkit-align-content: space-around;
      align-content: space-around;
    }
  `),wo=Ct`
    .flex,
    .flex-1 {
      -ms-flex: 1 1 0.000000001px;
      -webkit-flex: 1;
      flex: 1;
      -webkit-flex-basis: 0.000000001px;
      flex-basis: 0.000000001px;
    }

    .flex-2 {
      -ms-flex: 2;
      -webkit-flex: 2;
      flex: 2;
    }

    .flex-3 {
      -ms-flex: 3;
      -webkit-flex: 3;
      flex: 3;
    }

    .flex-4 {
      -ms-flex: 4;
      -webkit-flex: 4;
      flex: 4;
    }

    .flex-5 {
      -ms-flex: 5;
      -webkit-flex: 5;
      flex: 5;
    }

    .flex-6 {
      -ms-flex: 6;
      -webkit-flex: 6;
      flex: 6;
    }

    .flex-7 {
      -ms-flex: 7;
      -webkit-flex: 7;
      flex: 7;
    }

    .flex-8 {
      -ms-flex: 8;
      -webkit-flex: 8;
      flex: 8;
    }

    .flex-9 {
      -ms-flex: 9;
      -webkit-flex: 9;
      flex: 9;
    }

    .flex-10 {
      -ms-flex: 10;
      -webkit-flex: 10;
      flex: 10;
    }

    .flex-11 {
      -ms-flex: 11;
      -webkit-flex: 11;
      flex: 11;
    }

    .flex-12 {
      -ms-flex: 12;
      -webkit-flex: 12;
      flex: 12;
    }`,xo=Ct`
    .block {
      display: block;
    }

    [hidden] {
      display: none !important;
    }

    .invisible {
      visibility: hidden !important;
    }

    .relative {
      position: relative;
    }

    .fit {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
    }

    body.fullbleed {
      margin: 0;
      height: 100vh;
    }

    .scroll {
      -webkit-overflow-scrolling: touch;
      overflow: auto;
    }

    /* fixed position */
    .fixed-bottom,
    .fixed-left,
    .fixed-right,
    .fixed-top {
      position: fixed;
    }

    .fixed-top {
      top: 0;
      left: 0;
      right: 0;
    }

    .fixed-right {
      top: 0;
      right: 0;
      bottom: 0;
    }

    .fixed-bottom {
      right: 0;
      bottom: 0;
      left: 0;
    }

    .fixed-left {
      top: 0;
      bottom: 0;
      left: 0;
    }
  `;let Mo=class extends Ot{constructor(){super(),this.dialog=Object(),this.fixed=!1,this.narrowLayout=!1,this.scrollable=!1,this.backdrop=!1,this.noclosebutton=!1,this.persistent=!1,this.blockscrolling=!1,this.open=!1,this.type="normal"}static get styles(){return[Me,yo,_o,Ct`
        wl-dialog {
          --dialog-min-width: var(--component-min-width);
          --dialog-max-width: var(--component-max-width);
          --dialog-max-height: var(--component-max-height);
          --dialog-width: var(--component-width);
          --dialog-height: var(--component-height, auto);
        }

        wl-dialog > wl-card {
          --card-elevation: 0;
        }

        wl-dialog > wl-card > h3 {
          background-color: var(--general-dialog-background-color, #ffffff);
        }

        wl-dialog.warning h3 {
          color: red;
        }

        wl-dialog div.content {
          padding: var(--component-padding, 15px);
          font-size: var(--component-font-size, 14px);
          word-break: keep-all;
          overflow-x: hidden;
        }

        wl-dialog div.footer {
          padding: 5px 15px 15px 15px;
        }

        wl-dialog wl-button.cancel {
          margin-right: 5px;
        }

        wl-dialog wl-button.ok {
          margin-right: 5px;
        }

        wl-dialog[narrow] div.content,
        wl-dialog[narrow] div.footer {
          padding: 0;
          margin: 0;
        }

        wl-dialog[scrollable]::slotted([slot="content"]),
        wl-dialog[scrollable] div.content-area {
          overflow-y: scroll; /* Has to be scroll (not auto) to get smooth scrolling on iOS */
          -webkit-overflow-scrolling: touch;
          max-height: calc(100vh - 190px);
        }

        wl-dialog div.content h4 {
          font-size: 14px;
          padding: 5px 15px 5px 12px;
          margin: 0 0 10px 0;
          display: block;
          height: 20px;
          border-bottom: 1px solid #DDD;
        }
      `]}firstUpdated(){this.dialog=this.shadowRoot.querySelector("#dialog"),""===this.dialog.style.getPropertyValue("--dialog-height")&&this.dialog.style.setProperty("--dialog-height","auto"),this.open=this.dialog.open,this.dialog.addEventListener("didShow",(()=>{this._syncOpenState()})),this.dialog.addEventListener("didHide",(()=>{this._syncOpenState()}))}connectedCallback(){super.connectedCallback()}_syncOpenState(){if(this.open=this.dialog.open,!0===this.open){let t=new CustomEvent("didShow",{detail:""});this.dispatchEvent(t)}else{let t=new CustomEvent("didHide",{detail:""});this.dispatchEvent(t)}}_hideDialog(){this.dialog.hide(),this.open=this.dialog.open}show(){this.dialog.show(),this.open=this.dialog.open}hide(){this.dialog.hide(),this.open=this.dialog.open}render(){return Z`
      <wl-dialog id="dialog"
                    ?fixed="${this.fixed}"
                    ?narrow="${this.narrowLayout}"
                    ?backdrop="${this.backdrop}"
                    ?persistent="${this.persistent}"
                    ?scrollable="${this.scrollable}"
                    blockscrolling="${this.blockscrolling}"
                    style="padding:0;" class="${this.type}">
        <wl-card elevation="1" class="intro" style="margin: 0;">
          <h3 class="horizontal center layout" style="font-weight:bold">
            <span><slot name="title"></slot></span>
            <div class="flex"></div>
            <slot name="action"></slot>
            ${this.noclosebutton?Z``:Z`
            <wl-button fab flat inverted @click="${()=>this._hideDialog()}">
              <wl-icon>close</wl-icon>
            </wl-button>
            `}
          </h3>
          <div class="content content-area">
            <slot name="content"></slot>
          </div>
          <div class="footer horizontal flex layout">
            <slot name="footer"></slot>
          </div>
        </wl-card>
      </wl-dialog>
      `}};r([yt({type:Object})],Mo.prototype,"dialog",void 0),r([yt({type:Boolean})],Mo.prototype,"fixed",void 0),r([yt({type:Boolean})],Mo.prototype,"narrowLayout",void 0),r([yt({type:Boolean})],Mo.prototype,"scrollable",void 0),r([yt({type:Boolean})],Mo.prototype,"backdrop",void 0),r([yt({type:Boolean})],Mo.prototype,"noclosebutton",void 0),r([yt({type:Boolean})],Mo.prototype,"persistent",void 0),r([yt({type:Boolean})],Mo.prototype,"blockscrolling",void 0),r([yt({type:Boolean})],Mo.prototype,"open",void 0),r([yt({type:String})],Mo.prototype,"type",void 0),Mo=r([bt("backend-ai-dialog")],Mo);class ko{static relieve(t){if(void 0===t)return"Problem occurred.";if(console.log(t),!0===globalThis.backendaiconsole.debug)return t;if(this.errorMessageTable.hasOwnProperty(t))return this.errorMessageTable[t];for(const e of Object.keys(this.regexTable))if(RegExp(e).test(t))return this.regexTable[e];return t}}ko.errorMessageTable={"Cannot read property 'map' of null":"User has no group. Please contact administrator to fix it.","Cannot read property 'split' of undefined":"Wrong API server address.","Login failed. Check login information.":"Login failed. Check login information.","server responded failure: 400 Bad Request - The virtual folder already exists with the same name.":"A virtual folder with the same name already exists. Delete your own folder or decline the invitation.","server responded failure: 400 Bad Request - Missing or invalid API parameters. (You cannot create more vfolders.)":"You cannot create more vfolders due to resource policy","server responded failure: 401 Unauthorized - Credential/signature mismatch. (Access key not found)":"Login information mismatch. Check your information","server responded failure: 401 Unauthorized - Credential/signature mismatch.":"Login information mismatch. Check your information","server responded failure: 412 Precondition Failed - You have reached your resource limit.":"Reached your resource limit. Check resources and sessions.","Authentication failed. Check information and manager status.":"Authentication failed. Check information and manager status."},ko.regexTable={'integrity error: duplicate key value violates unique constraint "pk_resource_presets"[\\n]DETAIL:  Key \\(name\\)=\\([\\w]+\\) already exists.[\\n]':"A resource policy with the same name already exists.",'integrity error: duplicate key value violates unique constraint "pk_scaling_groups"[\\n]DETAIL:  Key \\(name\\)=\\([\\w]+\\) already exists.[\\n]':"A scaling group with the same name already exists.","server responded failure: 400 Bad Request - Missing or invalid API parameters. (Your resource quota is exceeded. (cpu=24 mem=512g cuda.shares=80))":"Resource limit exceed. Check your free resources."};let So=class extends Ot{constructor(){super(),this.tosEntryURL="/resources/documents/terms-of-service.en.html",this.tosEntry="terms-of-service",this.tosContent="",this.tosLanguage="en",this.tosLanguages=[{code:"ko",text:p("language.Korean")},{code:"en",text:p("language.English")}],this.title="",this.show=!1,this.approved=!1,this.block=!1,this.approveCheckbox=Object(),this.dialog=Object()}static get styles(){return[Me,yo,_o,wo,xo,Ct`
        @media screen and (max-width: 669px) {
          backend-ai-dialog.terms-of-service-dialog {
            --component-width: 85% !important;
            --component-height: 80vh;
          }
        }

        @media screen and (min-width: 670px) {
          backend-ai-dialog.terms-of-service-dialog {
            --component-width: 650px !important;
            --component-height: 80vh;
          }
        }

        wl-button.language {
          --button-bg: transparent;
          --button-bg-hover: var(--paper-lightblue-300);
          --button-bg-active: var(--paper-lightblue-300);
        }

        wl-button.language[active] {
          --button-bg: var(--paper-lightblue-300);
        }

        wl-button.dismiss {
          --button-bg: transparent;
          --button-bg-hover: var(--paper-green-300);
          --button-bg-active: var(--paper-green-300);
        }
      `]}tos_contents(){return Z`
    `}render(){return Z`
      <backend-ai-dialog id="terms-of-service-dialog" class="terms-of-service-dialog" fixed blockscrolling persistent scrollable>
        <span slot="title">${this.title}</span>
        <div slot="action" class="horizontal end-justified center flex layout">
          ${this.tosLanguages?Z`
            <span style="font-size:14px;">${rt("language.Language")}</span>
            ${this.tosLanguages.map((t=>Z`
            <mwc-button
                unelevated
                ?active="${this.tosLanguage===t.code}"
                label="${t.text}"
                @click="${()=>{this.changeLanguage(t.code)}}"></mwc-button>`))}
          `:Z``}
        </div>
        <div slot="content">
          <div id="terms-of-service-dialog-content"></div>
          <div class="horizontal end-justified flex layout">
            <div class="flex"></div>
            <mwc-button
                unelevated
                id="dismis-button"
                label=${rt("button.Dismiss")}
                @click="${()=>{this.close()}}"></mwc-button>
          </div>
        </div>
      </backend-ai-dialog>
    `}firstUpdated(){this.notification=globalThis.lablupNotification,this.dialog=this.shadowRoot.querySelector("#terms-of-service-dialog"),this.dialog.addEventListener("didShow",(()=>{this._syncOpenState()})),this.dialog.addEventListener("didHide",(()=>{this._syncOpenState()})),this.block&&(this.dialog.backdrop=!0),this.show&&this._showTOSdialog()}attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i)}_syncOpenState(){this.show=this.dialog.open}async open(){await this.updateComplete,this._showTOSdialog()}close(){this.show=!1,this._hideTOSdialog()}changeLanguage(t){this.tosContent="",this.tosLanguage=t,this._showTOSdialog(!0)}async sendRequest(t){let e,i;try{"GET"==t.method&&(t.body=void 0),e=await fetch(t.uri,t);let r=e.headers.get("Content-Type");if(i=r.startsWith("application/json")||r.startsWith("application/problem+json")?await e.json():r.startsWith("text/")?await e.text():await e.blob(),!e.ok)throw i}catch(t){console.log(t)}return i}_showTOSdialog(t=!1){if("default"===this.tosLanguage&&globalThis.backendaioptions.exists("current_language")&&(this.tosLanguage=globalThis.backendaioptions.get("current_language")),["ko","en"].includes(this.tosLanguage)||(this.tosLanguage="en"),this.tosEntryURL="/resources/documents/"+this.tosEntry+"."+this.tosLanguage+".html",""==this.tosContent){let e={method:"GET",uri:this.tosEntryURL,body:JSON.stringify({mode:"dialog"})};this.sendRequest(e).then((e=>{this.tosContent=void 0!==e?e:"",this.shadowRoot.querySelector("#terms-of-service-dialog-content").innerHTML=this.tosContent,this.show=!0,!1===t&&this.dialog.show()})).catch((t=>{console.log(t),t&&t.message&&(this.notification.text=ko.relieve(t.title),this.notification.detail=t.message,this.notification.show(!0,t)),this.shadowRoot.querySelector("#terms-of-service-dialog-content").innerHTML="Problem found while loading contents. Please try again later."}))}else this.show=!0,!1===t&&this.dialog.show()}_hideTOSdialog(){this.show=!1,this.dialog.hide()}_changeApproved(){return!0===this.approveCheckbox.checked?(this.show=!1,this.dialog.hide(),void(this.approved=!0)):void(this.approved=!1)}};r([yt({type:String})],So.prototype,"tosEntryURL",void 0),r([yt({type:String})],So.prototype,"tosEntry",void 0),r([yt({type:String})],So.prototype,"tosContent",void 0),r([yt({type:String})],So.prototype,"tosLanguage",void 0),r([yt({type:Array})],So.prototype,"tosLanguages",void 0),r([yt({type:String})],So.prototype,"title",void 0),r([yt({type:Boolean})],So.prototype,"show",void 0),r([yt({type:Boolean})],So.prototype,"approved",void 0),r([yt({type:Boolean})],So.prototype,"block",void 0),r([yt({type:Object})],So.prototype,"notification",void 0),r([yt({type:Object})],So.prototype,"approveCheckbox",void 0),r([yt({type:Object})],So.prototype,"dialog",void 0),So=r([bt("lablup-terms-of-service")],So);
/**
 * @license
 * Copyright 2016 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var Eo={CLOSING:"mdc-dialog--closing",OPEN:"mdc-dialog--open",OPENING:"mdc-dialog--opening",SCROLLABLE:"mdc-dialog--scrollable",SCROLL_LOCK:"mdc-dialog-scroll-lock",STACKED:"mdc-dialog--stacked"},Ao={ACTION_ATTRIBUTE:"data-mdc-dialog-action",BUTTON_DEFAULT_ATTRIBUTE:"data-mdc-dialog-button-default",BUTTON_SELECTOR:".mdc-dialog__button",CLOSED_EVENT:"MDCDialog:closed",CLOSE_ACTION:"close",CLOSING_EVENT:"MDCDialog:closing",CONTAINER_SELECTOR:".mdc-dialog__container",CONTENT_SELECTOR:".mdc-dialog__content",DESTROY_ACTION:"destroy",INITIAL_FOCUS_ATTRIBUTE:"data-mdc-dialog-initial-focus",OPENED_EVENT:"MDCDialog:opened",OPENING_EVENT:"MDCDialog:opening",SCRIM_SELECTOR:".mdc-dialog__scrim",SUPPRESS_DEFAULT_PRESS_SELECTOR:["textarea",".mdc-menu .mdc-list-item"].join(", "),SURFACE_SELECTOR:".mdc-dialog__surface"},To={DIALOG_ANIMATION_CLOSE_TIME_MS:75,DIALOG_ANIMATION_OPEN_TIME_MS:150},Io=function(t){function r(e){var n=t.call(this,i(i({},r.defaultAdapter),e))||this;return n.isOpen_=!1,n.animationFrame_=0,n.animationTimer_=0,n.layoutFrame_=0,n.escapeKeyAction_=Ao.CLOSE_ACTION,n.scrimClickAction_=Ao.CLOSE_ACTION,n.autoStackButtons_=!0,n.areButtonsStacked_=!1,n.suppressDefaultPressSelector=Ao.SUPPRESS_DEFAULT_PRESS_SELECTOR,n}return e(r,t),Object.defineProperty(r,"cssClasses",{get:function(){return Eo},enumerable:!0,configurable:!0}),Object.defineProperty(r,"strings",{get:function(){return Ao},enumerable:!0,configurable:!0}),Object.defineProperty(r,"numbers",{get:function(){return To},enumerable:!0,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addBodyClass:function(){},addClass:function(){},areButtonsStacked:function(){return!1},clickDefaultButton:function(){},eventTargetMatches:function(){return!1},getActionFromEvent:function(){return""},getInitialFocusEl:function(){return null},hasClass:function(){return!1},isContentScrollable:function(){return!1},notifyClosed:function(){},notifyClosing:function(){},notifyOpened:function(){},notifyOpening:function(){},releaseFocus:function(){},removeBodyClass:function(){},removeClass:function(){},reverseButtons:function(){},trapFocus:function(){}}},enumerable:!0,configurable:!0}),r.prototype.init=function(){this.adapter.hasClass(Eo.STACKED)&&this.setAutoStackButtons(!1)},r.prototype.destroy=function(){this.isOpen_&&this.close(Ao.DESTROY_ACTION),this.animationTimer_&&(clearTimeout(this.animationTimer_),this.handleAnimationTimerEnd_()),this.layoutFrame_&&(cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=0)},r.prototype.open=function(){var t=this;this.isOpen_=!0,this.adapter.notifyOpening(),this.adapter.addClass(Eo.OPENING),this.runNextAnimationFrame_((function(){t.adapter.addClass(Eo.OPEN),t.adapter.addBodyClass(Eo.SCROLL_LOCK),t.layout(),t.animationTimer_=setTimeout((function(){t.handleAnimationTimerEnd_(),t.adapter.trapFocus(t.adapter.getInitialFocusEl()),t.adapter.notifyOpened()}),To.DIALOG_ANIMATION_OPEN_TIME_MS)}))},r.prototype.close=function(t){var e=this;void 0===t&&(t=""),this.isOpen_&&(this.isOpen_=!1,this.adapter.notifyClosing(t),this.adapter.addClass(Eo.CLOSING),this.adapter.removeClass(Eo.OPEN),this.adapter.removeBodyClass(Eo.SCROLL_LOCK),cancelAnimationFrame(this.animationFrame_),this.animationFrame_=0,clearTimeout(this.animationTimer_),this.animationTimer_=setTimeout((function(){e.adapter.releaseFocus(),e.handleAnimationTimerEnd_(),e.adapter.notifyClosed(t)}),To.DIALOG_ANIMATION_CLOSE_TIME_MS))},r.prototype.isOpen=function(){return this.isOpen_},r.prototype.getEscapeKeyAction=function(){return this.escapeKeyAction_},r.prototype.setEscapeKeyAction=function(t){this.escapeKeyAction_=t},r.prototype.getScrimClickAction=function(){return this.scrimClickAction_},r.prototype.setScrimClickAction=function(t){this.scrimClickAction_=t},r.prototype.getAutoStackButtons=function(){return this.autoStackButtons_},r.prototype.setAutoStackButtons=function(t){this.autoStackButtons_=t},r.prototype.getSuppressDefaultPressSelector=function(){return this.suppressDefaultPressSelector},r.prototype.setSuppressDefaultPressSelector=function(t){this.suppressDefaultPressSelector=t},r.prototype.layout=function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame((function(){t.layoutInternal_(),t.layoutFrame_=0}))},r.prototype.handleClick=function(t){if(this.adapter.eventTargetMatches(t.target,Ao.SCRIM_SELECTOR)&&""!==this.scrimClickAction_)this.close(this.scrimClickAction_);else{var e=this.adapter.getActionFromEvent(t);e&&this.close(e)}},r.prototype.handleKeydown=function(t){var e="Enter"===t.key||13===t.keyCode;if(e&&!this.adapter.getActionFromEvent(t)){var i=t.composedPath?t.composedPath()[0]:t.target,r=!this.adapter.eventTargetMatches(i,this.suppressDefaultPressSelector);e&&r&&this.adapter.clickDefaultButton()}},r.prototype.handleDocumentKeydown=function(t){("Escape"===t.key||27===t.keyCode)&&""!==this.escapeKeyAction_&&this.close(this.escapeKeyAction_)},r.prototype.layoutInternal_=function(){this.autoStackButtons_&&this.detectStackedButtons_(),this.detectScrollableContent_()},r.prototype.handleAnimationTimerEnd_=function(){this.animationTimer_=0,this.adapter.removeClass(Eo.OPENING),this.adapter.removeClass(Eo.CLOSING)},r.prototype.runNextAnimationFrame_=function(t){var e=this;cancelAnimationFrame(this.animationFrame_),this.animationFrame_=requestAnimationFrame((function(){e.animationFrame_=0,clearTimeout(e.animationTimer_),e.animationTimer_=setTimeout(t,0)}))},r.prototype.detectStackedButtons_=function(){this.adapter.removeClass(Eo.STACKED);var t=this.adapter.areButtonsStacked();t&&this.adapter.addClass(Eo.STACKED),t!==this.areButtonsStacked_&&(this.adapter.reverseButtons(),this.areButtonsStacked_=t)},r.prototype.detectScrollableContent_=function(){this.adapter.removeClass(Eo.SCROLLABLE),this.adapter.isContentScrollable()&&this.adapter.addClass(Eo.SCROLLABLE)},r}(ee);
/**
 * @license
 * Copyright 2019 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
function Co(t){return void 0===t&&(t=window),!!function(t){void 0===t&&(t=window);var e=!1;try{var i={get passive(){return e=!0,!1}},r=function(){};t.document.addEventListener("test",r,i),t.document.removeEventListener("test",r,i)}catch(t){e=!1}return e}(t)&&{passive:!0}}const Ro=document.$blockingElements;class Oo extends pe{constructor(){super(...arguments),this.hideActions=!1,this.stacked=!1,this.heading="",this.scrimClickAction="close",this.escapeKeyAction="close",this.open=!1,this.defaultAction="close",this.actionAttribute="dialogAction",this.initialFocusAttribute="dialogInitialFocus",this.mdcFoundationClass=Io,this.boundLayout=null,this.boundHandleClick=null,this.boundHandleKeydown=null,this.boundHandleDocumentKeydown=null}get primaryButton(){let t=this.primarySlot.assignedNodes();t=t.filter((t=>t instanceof HTMLElement));const e=t[0];return e||null}emitNotification(t,e){const i=new CustomEvent(t,{detail:e?{action:e}:{}});this.dispatchEvent(i)}getInitialFocusEl(){const t=`[${this.initialFocusAttribute}]`,e=this.querySelector(t);if(e)return e;const i=this.primarySlot.assignedNodes({flatten:!0}),r=this.searchNodeTreesForAttribute(i,this.initialFocusAttribute);if(r)return r;const n=this.secondarySlot.assignedNodes({flatten:!0}),o=this.searchNodeTreesForAttribute(n,this.initialFocusAttribute);if(o)return o;const s=this.contentSlot.assignedNodes({flatten:!0});return this.searchNodeTreesForAttribute(s,this.initialFocusAttribute)}searchNodeTreesForAttribute(t,e){for(const i of t)if(i instanceof HTMLElement){if(i.hasAttribute(e))return i;{const t=i.querySelector(`[${e}]`);if(t)return t}}return null}createAdapter(){return Object.assign(Object.assign({},se(this.mdcRoot)),{addBodyClass:()=>document.body.style.overflow="hidden",removeBodyClass:()=>document.body.style.overflow="",areButtonsStacked:()=>this.stacked,clickDefaultButton:()=>{const t=this.primaryButton;t&&t.click()},eventTargetMatches:(t,e)=>!!t&&ne(t,e),getActionFromEvent:t=>{if(!t.target)return"";const e=
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
function(t,e){if(t.closest)return t.closest(e);for(var i=t;i;){if(ne(i,e))return i;i=i.parentElement}return null}(t.target,`[${this.actionAttribute}]`);return e&&e.getAttribute(this.actionAttribute)},getInitialFocusEl:()=>this.getInitialFocusEl(),isContentScrollable:()=>{const t=this.contentElement;return!!t&&t.scrollHeight>t.offsetHeight},notifyClosed:t=>this.emitNotification("closed",t),notifyClosing:t=>{this.closingDueToDisconnect||(this.open=!1),this.emitNotification("closing",t)},notifyOpened:()=>this.emitNotification("opened"),notifyOpening:()=>{this.open=!0,this.emitNotification("opening")},reverseButtons:()=>{},releaseFocus:()=>{Ro.remove(this)},trapFocus:t=>{Ro.push(this),t&&t.focus()}})}render(){const t={[Eo.STACKED]:this.stacked};let e=Z``;this.heading&&(e=this.renderHeading());const i={"mdc-dialog__actions":!this.hideActions};return Z`
    <div class="mdc-dialog ${be(t)}"
        role="alertdialog"
        aria-modal="true"
        aria-labelledby="title"
        aria-describedby="content">
      <div class="mdc-dialog__container">
        <div class="mdc-dialog__surface">
          ${e}
          <div id="content" class="mdc-dialog__content">
            <slot id="contentSlot"></slot>
          </div>
          <footer
              id="actions"
              class="${be(i)}">
            <span>
              <slot name="secondaryAction"></slot>
            </span>
            <span>
             <slot name="primaryAction"></slot>
            </span>
          </footer>
        </div>
      </div>
      <div class="mdc-dialog__scrim"></div>
    </div>`}renderHeading(){return Z`
      <h2 id="title" class="mdc-dialog__title">${this.heading}</h2>`}firstUpdated(){super.firstUpdated(),this.mdcFoundation.setAutoStackButtons(!0)}connectedCallback(){super.connectedCallback(),this.open&&this.mdcFoundation&&!this.mdcFoundation.isOpen()&&(this.setEventListeners(),this.mdcFoundation.open())}disconnectedCallback(){super.disconnectedCallback(),this.open&&this.mdcFoundation&&(this.removeEventListeners(),this.closingDueToDisconnect=!0,this.mdcFoundation.close(this.currentAction||this.defaultAction),this.closingDueToDisconnect=!1,this.currentAction=void 0,Ro.remove(this))}forceLayout(){this.mdcFoundation.layout()}focus(){const t=this.getInitialFocusEl();t&&t.focus()}blur(){if(!this.shadowRoot)return;const t=this.shadowRoot.activeElement;if(t)t instanceof HTMLElement&&t.blur();else{const t=this.getRootNode(),e=t instanceof Document?t.activeElement:null;e instanceof HTMLElement&&e.blur()}}setEventListeners(){this.boundHandleClick=this.mdcFoundation.handleClick.bind(this.mdcFoundation),this.boundLayout=()=>{this.open&&this.mdcFoundation.layout.bind(this.mdcFoundation)},this.boundHandleKeydown=this.mdcFoundation.handleKeydown.bind(this.mdcFoundation),this.boundHandleDocumentKeydown=this.mdcFoundation.handleDocumentKeydown.bind(this.mdcFoundation),this.mdcRoot.addEventListener("click",this.boundHandleClick),window.addEventListener("resize",this.boundLayout,Co()),window.addEventListener("orientationchange",this.boundLayout,Co()),this.mdcRoot.addEventListener("keydown",this.boundHandleKeydown,Co()),document.addEventListener("keydown",this.boundHandleDocumentKeydown,Co())}removeEventListeners(){this.boundHandleClick&&this.mdcRoot.removeEventListener("click",this.boundHandleClick),this.boundLayout&&(window.removeEventListener("resize",this.boundLayout),window.removeEventListener("orientationchange",this.boundLayout)),this.boundHandleKeydown&&this.mdcRoot.removeEventListener("keydown",this.boundHandleKeydown),this.boundHandleDocumentKeydown&&this.mdcRoot.removeEventListener("keydown",this.boundHandleDocumentKeydown)}close(){this.open=!1}show(){this.open=!0}}r([wt(".mdc-dialog")],Oo.prototype,"mdcRoot",void 0),r([wt('slot[name="primaryAction"]')],Oo.prototype,"primarySlot",void 0),r([wt('slot[name="secondaryAction"]')],Oo.prototype,"secondarySlot",void 0),r([wt("#contentSlot")],Oo.prototype,"contentSlot",void 0),r([wt(".mdc-dialog__content")],Oo.prototype,"contentElement",void 0),r([wt(".mdc-container")],Oo.prototype,"conatinerElement",void 0),r([yt({type:Boolean})],Oo.prototype,"hideActions",void 0),r([yt({type:Boolean}),fe((function(){this.forceLayout()}))],Oo.prototype,"stacked",void 0),r([yt({type:String})],Oo.prototype,"heading",void 0),r([yt({type:String}),fe((function(t){this.mdcFoundation.setScrimClickAction(t)}))],Oo.prototype,"scrimClickAction",void 0),r([yt({type:String}),fe((function(t){this.mdcFoundation.setEscapeKeyAction(t)}))],Oo.prototype,"escapeKeyAction",void 0),r([yt({type:Boolean,reflect:!0}),fe((function(t){this.mdcFoundation&&this.isConnected&&(t?(this.setEventListeners(),this.mdcFoundation.open()):(this.removeEventListeners(),this.mdcFoundation.close(this.currentAction||this.defaultAction),this.currentAction=void 0))}))],Oo.prototype,"open",void 0),r([yt()],Oo.prototype,"defaultAction",void 0),r([yt()],Oo.prototype,"actionAttribute",void 0),r([yt()],Oo.prototype,"initialFocusAttribute",void 0);
/**
@license
Copyright 2018 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
const Lo=Ct`.mdc-elevation-overlay{position:absolute;border-radius:inherit;pointer-events:none;opacity:0;opacity:var(--mdc-elevation-overlay-opacity, 0);transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1);background-color:#fff;background-color:var(--mdc-elevation-overlay-color, #fff)}.mdc-dialog,.mdc-dialog__scrim{position:fixed;top:0;left:0;align-items:center;justify-content:center;box-sizing:border-box;width:100%;height:100%}.mdc-dialog{display:none;z-index:7}.mdc-dialog .mdc-dialog__surface{background-color:#fff;background-color:var(--mdc-theme-surface, #fff)}.mdc-dialog .mdc-dialog__scrim{background-color:rgba(0,0,0,.32)}.mdc-dialog .mdc-dialog__title{color:rgba(0,0,0,.87)}.mdc-dialog .mdc-dialog__content{color:rgba(0,0,0,.6)}.mdc-dialog.mdc-dialog--scrollable .mdc-dialog__title,.mdc-dialog.mdc-dialog--scrollable .mdc-dialog__actions{border-color:rgba(0,0,0,.12)}.mdc-dialog .mdc-dialog__content{padding:20px 24px 20px 24px}.mdc-dialog .mdc-dialog__surface{min-width:280px}@media(max-width: 592px){.mdc-dialog .mdc-dialog__surface{max-width:calc(100vw - 32px)}}@media(min-width: 592px){.mdc-dialog .mdc-dialog__surface{max-width:560px}}.mdc-dialog .mdc-dialog__surface{max-height:calc(100% - 32px)}.mdc-dialog .mdc-dialog__surface{border-radius:4px;border-radius:var(--mdc-shape-medium, 4px)}.mdc-dialog__scrim{opacity:0;z-index:-1}.mdc-dialog__container{display:flex;flex-direction:row;align-items:center;justify-content:space-around;box-sizing:border-box;height:100%;transform:scale(0.8);opacity:0;pointer-events:none}.mdc-dialog__surface{position:relative;box-shadow:0px 11px 15px -7px rgba(0, 0, 0, 0.2),0px 24px 38px 3px rgba(0, 0, 0, 0.14),0px 9px 46px 8px rgba(0,0,0,.12);display:flex;flex-direction:column;flex-grow:0;flex-shrink:0;box-sizing:border-box;max-width:100%;max-height:100%;pointer-events:auto;overflow-y:auto}.mdc-dialog__surface .mdc-elevation-overlay{width:100%;height:100%;top:0;left:0}.mdc-dialog[dir=rtl] .mdc-dialog__surface,[dir=rtl] .mdc-dialog .mdc-dialog__surface{text-align:right}.mdc-dialog__title{display:block;margin-top:0;line-height:normal;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-headline6-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1.25rem;font-size:var(--mdc-typography-headline6-font-size, 1.25rem);line-height:2rem;line-height:var(--mdc-typography-headline6-line-height, 2rem);font-weight:500;font-weight:var(--mdc-typography-headline6-font-weight, 500);letter-spacing:0.0125em;letter-spacing:var(--mdc-typography-headline6-letter-spacing, 0.0125em);text-decoration:inherit;text-decoration:var(--mdc-typography-headline6-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-headline6-text-transform, inherit);position:relative;flex-shrink:0;box-sizing:border-box;margin:0;padding:0 24px 9px;border-bottom:1px solid transparent}.mdc-dialog__title::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}.mdc-dialog[dir=rtl] .mdc-dialog__title,[dir=rtl] .mdc-dialog .mdc-dialog__title{text-align:right}.mdc-dialog--scrollable .mdc-dialog__title{padding-bottom:15px}.mdc-dialog__content{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-body1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-body1-font-size, 1rem);line-height:1.5rem;line-height:var(--mdc-typography-body1-line-height, 1.5rem);font-weight:400;font-weight:var(--mdc-typography-body1-font-weight, 400);letter-spacing:0.03125em;letter-spacing:var(--mdc-typography-body1-letter-spacing, 0.03125em);text-decoration:inherit;text-decoration:var(--mdc-typography-body1-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-body1-text-transform, inherit);flex-grow:1;box-sizing:border-box;margin:0;overflow:auto;-webkit-overflow-scrolling:touch}.mdc-dialog__content>:first-child{margin-top:0}.mdc-dialog__content>:last-child{margin-bottom:0}.mdc-dialog__title+.mdc-dialog__content{padding-top:0}.mdc-dialog--scrollable .mdc-dialog__title+.mdc-dialog__content{padding-top:8px;padding-bottom:8px}.mdc-dialog__content .mdc-list:first-child:last-child{padding:6px 0 0}.mdc-dialog--scrollable .mdc-dialog__content .mdc-list:first-child:last-child{padding:0}.mdc-dialog__actions{display:flex;position:relative;flex-shrink:0;flex-wrap:wrap;align-items:center;justify-content:flex-end;box-sizing:border-box;min-height:52px;margin:0;padding:8px;border-top:1px solid transparent}.mdc-dialog--stacked .mdc-dialog__actions{flex-direction:column;align-items:flex-end}.mdc-dialog__button{margin-left:8px;margin-right:0;max-width:100%;text-align:right}[dir=rtl] .mdc-dialog__button,.mdc-dialog__button[dir=rtl]{margin-left:0;margin-right:8px}.mdc-dialog__button:first-child{margin-left:0;margin-right:0}[dir=rtl] .mdc-dialog__button:first-child,.mdc-dialog__button:first-child[dir=rtl]{margin-left:0;margin-right:0}.mdc-dialog[dir=rtl] .mdc-dialog__button,[dir=rtl] .mdc-dialog .mdc-dialog__button{text-align:left}.mdc-dialog--stacked .mdc-dialog__button:not(:first-child){margin-top:12px}.mdc-dialog--open,.mdc-dialog--opening,.mdc-dialog--closing{display:flex}.mdc-dialog--opening .mdc-dialog__scrim{transition:opacity 150ms linear}.mdc-dialog--opening .mdc-dialog__container{transition:opacity 75ms linear,transform 150ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-dialog--closing .mdc-dialog__scrim,.mdc-dialog--closing .mdc-dialog__container{transition:opacity 75ms linear}.mdc-dialog--closing .mdc-dialog__container{transform:none}.mdc-dialog--open .mdc-dialog__scrim{opacity:1}.mdc-dialog--open .mdc-dialog__container{transform:none;opacity:1}.mdc-dialog-scroll-lock{overflow:hidden}#actions:not(.mdc-dialog__actions){display:none}.mdc-dialog__surface{box-shadow:var(--mdc-dialog-box-shadow, 0px 11px 15px -7px rgba(0, 0, 0, 0.2), 0px 24px 38px 3px rgba(0, 0, 0, 0.14), 0px 9px 46px 8px rgba(0, 0, 0, 0.12))}@media(min-width: 560px){.mdc-dialog .mdc-dialog__surface{max-width:560px;max-width:var(--mdc-dialog-max-width, 560px)}}.mdc-dialog .mdc-dialog__scrim{background-color:rgba(0, 0, 0, 0.32);background-color:var(--mdc-dialog-scrim-color, rgba(0, 0, 0, 0.32))}.mdc-dialog .mdc-dialog__title{color:rgba(0, 0, 0, 0.87);color:var(--mdc-dialog-heading-ink-color, rgba(0, 0, 0, 0.87))}.mdc-dialog .mdc-dialog__content{color:rgba(0, 0, 0, 0.6);color:var(--mdc-dialog-content-ink-color, rgba(0, 0, 0, 0.6))}.mdc-dialog.mdc-dialog--scrollable .mdc-dialog__title,.mdc-dialog.mdc-dialog--scrollable .mdc-dialog__actions{border-color:rgba(0, 0, 0, 0.12);border-color:var(--mdc-dialog-scroll-divider-color, rgba(0, 0, 0, 0.12))}.mdc-dialog .mdc-dialog__surface{min-width:280px;min-width:var(--mdc-dialog-min-width, 280px)}.mdc-dialog .mdc-dialog__surface{max-height:var(--mdc-dialog-max-height, calc(100% - 32px))}#actions ::slotted(*){margin-left:8px;margin-right:0;max-width:100%;text-align:right}[dir=rtl] #actions ::slotted(*),#actions ::slotted(*)[dir=rtl]{margin-left:0;margin-right:8px}.mdc-dialog[dir=rtl] #actions ::slotted(*),[dir=rtl] .mdc-dialog #actions ::slotted(*){text-align:left}.mdc-dialog--stacked #actions{flex-direction:column-reverse}.mdc-dialog--stacked #actions *:not(:last-child) ::slotted(*){flex-basis:1e-9px;margin-top:12px}`;let Po=class extends Oo{};Po.styles=Lo,Po=r([bt("mwc-dialog")],Po);const Bo=[Me,Ct`
    .loading-background {
      transition: all 0.3s linear;
      position: fixed;
      z-index: 10000;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-image: url("/resources/images/loading-background-large.jpg");
      background-repeat: no-repeat;
      background-attachment: fixed;
      background-position: top left;
    }

    .loading-background[inactive] {
      display: none;
    }

    .hidden {
      display: none;
    }

    .visuallyhidden {
      opacity: 0;
    }

    mwc-top-app-bar-fixed {
      --mdc-typography-headline6-font-family: var(--general-font-family);
      --mdc-typography-font-family: var(--general-font-family);
    }

    .site-name {
      text-align: center;
      margin-left: 0;
      margin-right: auto;
      line-height: 16px;
      font-size: 16px;
      font-weight: 100;
      color: var(--general-sidebar-topbar-color, #efefef);
      font-family: var(--general-font-family);
    }

    .site-name > .bold {
      font-weight: 400;
    }

    .mini-ui .site-name {
      display: none;
    }

    .vertical-line {
      width: 1px; /* Line width */
      background-color: #dbdbdb; /* Line color */
      height: 100%;
      float: left;
      margin-top: 10px;
    }

    .drawer-menu {
      overflow-y: auto;
      overflow-x: hidden;
      -webkit-overflow-scrolling: touch;
      overflow: -moz-scrollbars-none;
      -ms-overflow-style: none;
      will-change: transform;
      background-color: var(--general-sidebar-background-color, #fafafa);
    }

    .drawer-menu .portrait-bar {
      padding-left: 0 !important;
      background-color: transparent;
      color: var(--general-sidebar-topbar-color);
      height: 80px;
    }

    .drawer-menu h3 {
      height: 12px;
      font-size: 12px;
      font-weight: 400;
      line-height: 20px;
      padding: 5px 15px 10px 0;
      margin: 20px 25px 20px 25px;
      display: block;
      color: var(--general-sidebar-h3-color);
      border-bottom: var(--general-sidebar-h3-border-color);
    }

    mwc-list.sidebar {
      cursor: pointer;
      color: var(--general-sidebar-color, #949494);
      --mdc-list-side-padding: 32px;
    }

    mwc-list.sidebar mwc-list-item {
      --mdc-theme-primary: var(--general-sidebar-selected-color, #949494);
      --mdc-theme-text-primary-on-background: var(--general-sidebar-color, #949494);
      --mdc-list-item-graphic-margin: 15px;
      height: 36px;
      margin-top: 10px;
      margin-bottom: 10px;
      font-size: 14px;
    }

    mwc-list.sidebar > mwc-list-item > i {
      color: #949494;
      font-size: 17px;
      padding-top: 5px;
    }

    mwc-list.sidebar mwc-list-item[selected] {
      color: var(--general-sidebar-selected-color, #949494);
      background: var(--general-sidebar-selected-background-color, #23252b);
      border-left: var(--general-sidebar-selected-border-left);
      padding-left: 29px; /* 32px - 3px */
      border-right: 0;
      padding-right: 11px;
      font-weight: 900;
    }

    mwc-list.sidebar mwc-list-item[selected] > i {
      color: inherit;
    }

    mwc-list.sidebar mwc-list-item[disabled],
    mwc-list.sidebar mwc-list-item[disabled] mwc-icon {
      --mdc-theme-on-surface: #888888;
      color: #888888 !important;
    }

    .mini-ui mwc-list.sidebar mwc-list-item {
      --mdc-list-item-graphic-margin: 0;
    }

    #app-body {
      --mdc-drawer-background-color: var(--sidebar-background-color, var(--general-sidebar-background-color, #fafafa));
      --mdc-drawer-border-left: 0;
      --mdc-drawer-border-right: 0;
    }

    app-drawer-layout:not([narrow]) [drawer-toggle] {
      display: none;
    }

    .drawer-menu footer {
      bottom: 0;
      color: var(--general-sidebar-footer-color, #aaaaaa);
      background-color: var(--general-sidebar-background-color);
      margin: 0;
      padding-bottom: 5px;
      font-size: 10px;
    }

    .drawer-menu footer a {
      color: var(--general-sidebar-footer-color, #aaaaaa) !important;
    }

    mwc-menu#dropdown-menu {
      position: relative;
      left: -30px;
      top: 20px;
    }

    mwc-button {
      margin: auto 10px;
      background-image: none;
      --mdc-theme-primary: var(--general-button-background-color);
      --mdc-on-theme-primary: var(--general-button-background-color);
    }

    mwc-button[unelevate--mdc-theme-primaryd] {
      : var(--general-button-background-color);
      --mdc-on-theme-primary: var(--general-button-background-color);
    }

    .page {
      display: none;
    }

    .page[active] {
      display: block;
    }

    .sidepanel {
      display: none;
    }

    .sidepanel[active] {
      display: block;
    }

    #content-body {
      background-color: var(--general-background-color, #ffffff);
      color: var(--general-sidepanel-color, #fafafa);
      --mdc-drawer-background-color: var(--sidepanel-background-color, var(--general-sidepanel-background-color, #fafafa));
    }

    .sidepanel-drawer {
      border-right: 1px solid #cccccc;
      height: 100vh;
      overflow-y: auto;
      overflow-x: hidden;
      -webkit-overflow-scrolling: touch;
      overflow: -moz-scrollbars-none;
      -ms-overflow-style: none;
      will-change: transform;
    }

    wl-progress-spinner {
      --progress-spinner-size: 48px;
      --progress-spinner-stroke-width: 12px;
      width: 48px;
      height: 48px;
      position: fixed;
      top: calc(50vh - 24px);
    }

    mwc-circular-progress {
      width: 48px;
      height: 48px;
      position: fixed;
      --mdc-theme-primary: #e91e63;
      top: calc(50vh - 24px);
    }

    @media screen and (max-width: 899px) {
      wl-progress-spinner {
        left: calc(50% - 24px);
      }

      mwc-circular-progress {
        left: calc(50% - 24px);
      }
    }

    @media screen and (min-width: 900px) {
      wl-progress-spinner {
        left: calc(50% + 71px);
      }

      .mini-ui wl-progress-spinner {
        left: calc(50% + 29px);
      }

      mwc-circular-progress {
        left: calc(50% + 71px);
      }

      .mini-ui mwc-circular-progress {
        left: calc(50% + 29px);
      }
    }

    .draggable {
      -webkit-user-select: none !important;
      -webkit-app-region: drag !important;
    }

    .drawer-menu footer {
      width: 250px;
    }

    mwc-tab {
      color: #ffffff;
    }

    mwc-menu {
      font-family: var(--general-font-family);
      --mdc-typography-subtitle1-font-family: var(--general-font-family);
    }

    span.full_name, mwc-select {
      font-weight: bold;
    }

    mwc-select#group-select {
      font-family: var(--general-font-family);
      --mdc-typography-subtitle1-font-family: var(--general-font-family);
      --mdc-typography-subtitle1-font-size: 14px;
      --mdc-typography-subtitle1-font-color: black;
      --mdc-typography-subtitle1-font-weight: 400;
      --mdc-typography-subtitle1-line-height: 16px;
      --mdc-theme-primary: transparent;
      --mdc-select-idle-line-color: transparent;
      --mdc-select-hover-line-color: transparent;
      --mdc-select-outlined-idle-border-color: rgba(255, 255, 255, 0.42);
      --mdc-select-outlined-hover-border-color: rgba(255, 255, 255, 0.87);
      --mdc-select-outlined-disabled-border-color: rgba(255, 255, 255, 0.87);
      --mdc-select-fill-color: transparent;
      --mdc-select-disabled-fill-color: transparent;
      --mdc-select-ink-color: black;
      --mdc-select-label-ink-color: black;
      --mdc-select-focused-label-color: rgba(24, 24, 24, 1.0);
      --mdc-select-disabled-ink-color: rgba(255, 255, 255, 1.0);
      --mdc-select-dropdown-icon-color: #747474;
      --mdc-select-focused-dropdown-icon-color: rgba(255, 255, 255, 0.42);
      --mdc-select-disabled-dropdown-icon-color: #747474;
    }

    mwc-multi-select {
      width: 135px;
      min-width: 135px;
      font-family: var(--general-font-family);
      --mdc-typography-subtitle1-font-family: var(--general-font-family);
      --mdc-typography-subtitle1-font-size: 14px;
      --mdc-typography-subtitle1-font-color: white;
      --mdc-typography-subtitle1-font-weight: 400;
      --mdc-typography-subtitle1-line-height: 16px;
      --mdc-theme-primary: rgba(255, 255, 255, 1.0);
      --mdc-select-idle-line-color: transparent;
      --mdc-select-hover-line-color: transparent;
      --mdc-select-outlined-idle-border-color: rgba(255, 255, 255, 0.42);
      --mdc-select-outlined-hover-border-color: rgba(255, 255, 255, 0.87);
      --mdc-select-outlined-disabled-border-color: rgba(255, 255, 255, 0.87);
      --mdc-select-fill-color: transparent;
      --mdc-select-disabled-fill-color: transparent;
      --mdc-select-ink-color: rgba(255, 255, 255, 1.0);
      --mdc-select-label-ink-color: rgba(255, 255, 255, 1.0);
      --mdc-select-focused-label-color: rgba(24, 24, 24, 1.0);
      --mdc-select-disabled-ink-color: rgba(255, 255, 255, 1.0);
      --mdc-select-dropdown-icon-color: rgba(255, 255, 255, 1.0);
      --mdc-select-focused-dropdown-icon-color: rgba(255, 255, 255, 0.42);
      --mdc-select-disabled-dropdown-icon-color: rgba(255, 255, 255, 0.87);
      --mdc-theme-surface: white;
      --mdc-list-vertical-padding: 5px;
      --mdc-list-side-padding: 10px;
      --mdc-menu-item-height: 28px;
      --mdc-list-item__primary-text: {
        height: 20px;
        color: #222222;
      };
      --mdc-select-min-width: 100px;
    }

    mwc-list-item[activated] {
      color: black;
      background-color: #e1e1e1;
    }

    mwc-list-item > mwc-icon {
      font-size: 20px;
      margin: 5px;
    }

    mwc-icon.dropdown-menu {
      color: #242424;
      padding-right: 10px;
    }

    mwc-textfield {
      width: 100%;
      --mdc-text-field-fill-color: transparent;
      --mdc-theme-primary: var(--general-textfield-selected-color);
      font-family: var(--general-font-family);
    }

    mwc-textarea {
      width: 100%;
      --mdc-text-field-fill-color: transparent;
      --mdc-theme-primary: var(--general-textfield-selected-color);
      font-family: var(--general-font-family);
    }

    wl-popover-card {
      padding: 5px;
    }

    backend-ai-dialog wl-textfield,
    wl-dialog wl-textfield {
      --input-font-family: var(--general-font-family);
      --input-color-disabled: #222222;
      --input-label-color-disabled: #222222;
      --input-label-font-size: 12px;
      --input-border-style-disabled: 1px solid #cccccc;
    }

    mwc-list-item {
      font-family: var(--general-font-family);
      font-weight: 400;
    }

    a.email:hover {
      color: #29b6f6;
    }

    mwc-menu.user-menu {
      --mdc-theme-surface: #f1f1f1;
      --mdc-menu-item-height: 28px;
      box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    }

    mwc-menu.user-menu mwc-list-item {
      font-size: 14px;
    }


    mwc-icon-button.side-menu {
      --mdc-icon-button-size: 44px;
      --mdc-theme-text-disabled-on-light: var(--paper-grey-800);
    }

    #sidebar-navbar-footer mwc-icon-button {
      --mdc-theme-text-disabled-on-light: var(--paper-grey-800);
    }

    .mini-ui .full-menu {
      display: none;
      margin: 0 !important;
    }

    .mini-menu {
      display: none;
    }

    .mini-ui .mini-menu {
      display: block;
    }

    .sidebar-footer {
      text-align: center;
      margin-left: auto;
      margin-right: auto;
      line-height: 16px;
      font-size: 12px;
      font-weight: 100;
      font-family: var(--general-font-family);
    }

    .portrait-canvas {
      margin-left: 18px;
      border-radius: 8px;
      width: 48px;
      height: 48px;
      background-color: #ffffff;
      background-image: url("/manifest/backend.ai-brand-simple.svg");
      background-repeat: no-repeat;
      background-size: 36px 36px;
      background-position: center center;
    }

    .mini-ui .portrait-canvas {
      margin-left: 18px;
      padding-right: 0;
    }

    .drawer-menu::-webkit-scrollbar {
      display: none !important;
    }

    #portrait-bar {
      height: 64px;
      padding-top: 15px;
    }

    #content-body {
      height: 100vh;
    }

    #main-toolbar {
      background-color: var(--general-menu-background-color);
      color: var(--general-menu-color);
      z-index: 1;
      overflow: visible;
      --mdc-theme-on-primary: black;
      --mdc-theme-primary: rgba(247, 246, 246, 1);
      border-bottom: 1px solid #dbdbdb;
    }

    #main-toolbar > p {
      padding: 10px;
      margin: auto;
      font-size: 14px;
      font-weight: bold;
      font-stretch: normal;
      font-style: normal;
      line-height: normal;
      letter-spacing: normal;
      color: #090909;
    }

    #content {
      padding-top: 0;
    }

    #sidebar-navbar-footer {
      right: 0;
      left: 0;
      bottom: 0 !important; /* Workaround to prevent miscalculated height */
      text-align: center;
      height: 100px;
      border-top: 1px solid #eeeeee;
      background-color: var(--general-navbar-footer-background-color);
      color: var(--general-sidebar-navbar-footer-color);
    }

    @supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
      #main-toolbar {
        /*-webkit-backdrop-filter: saturate(180%) blur(20px);
        backdrop-filter: saturate(180%) blur(20px);*/
      }

      #sidebar-navbar-footer {
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        backdrop-filter: saturate(180%) blur(20px);
        border: 0;
      }
    }

    @media screen and (max-width: 449px) {
      #sidebar-navbar-footer {
        border-top: 1px solid #eeeeee;
        background-color: var(--general-navbar-footer-background-color);
        color: var(--general-sidebar-navbar-footer-color);
      }
    }

    @media screen and (min-width: 450px) {
      #sidebar-navbar-footer {
        border-top: 1px solid var(--general-sidebar-background-color);
        background-color: var(--general-sidebar-background-color);
        color: var(--general-sidebar-color);
      }
    }
  `];let No=class extends Un{constructor(){super(),this.active=!0,this.tasks=Array()}static get styles(){return[Bo,yo,_o,wo,xo,Ct`
        h3 {
          font-size: 16px;
          color: #242424;
          display: block;
          width: 100%;
          height: 25px;
          padding: 5px 15px;
          border-bottom: 1px solid #cccccc;
        }

        mwc-list {
          padding: 0;
          margin: 0;
        }
      `]}async _viewStateChanged(t){await this.updateComplete}_taskIcon(t){switch(t){case"session":return"subject";case"database":return"dns";case"image":return"extension";case"general":default:return"widget"}}render(){return Z`
      <div id="container">
        <h3>${rt("sidepanel.BackgroundTasks")}</h3>
        <mwc-list>
        ${this.tasks.map((t=>Z`
          <mwc-list-item graphic="icon" twoline>
            <mwc-icon id="summary-menu-icon" slot="graphic" id="activities-icon" class="fg black">${this._taskIcon(t.tasktype)}</mwc-icon>
            <span>${t.tasktitle}</span>
            <span slot="secondary">${rt("sidepanel.Running")}</span>
          </mwc-list-item>
          <li divider role="separator"></li>`))}
          ${0===this.tasks.length?Z`
            <div style="padding:15px 0;width:100%;text-align:center;">
              ${rt("sidepanel.NoBackgroundTask")}
            </div>
        `:Z``}
        </mwc-list>
      </div>
    `}shouldUpdate(){return this.active}firstUpdated(){this.tasks=[],document.addEventListener("backend-ai-task-changed",(()=>this.refresh()))}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}async refresh(){this.tasks=globalThis.tasker.taskstore,await this.requestUpdate()}};r([yt({type:Boolean})],No.prototype,"active",void 0),r([yt({type:Array})],No.prototype,"tasks",void 0),No=r([bt("backend-ai-sidepanel-task")],No);let $o=class extends Un{constructor(){super(),this.active=!0,this.notifications=Array()}static get styles(){return[Bo,yo,_o,wo,xo,Ct`
        h3 {
          font-size: 16px;
          color: #242424;
          display: block;
          width: 100%;
          height: 25px;
          padding: 5px 15px;
          border-bottom: 1px solid #cccccc;
        }

        mwc-list {
          padding: 0;
          margin: 0;
        }
      `]}async _viewStateChanged(t){await this.updateComplete}render(){return Z`
      <div id="container">
        <h3>${rt("sidepanel.Notification")}</h3>
        <mwc-list>
        ${this.notifications.map((t=>Z`
          <mwc-list-item twoline>
            <span>${t.outerText}</span>
            <span slot="secondary">${t.getAttribute("created")}</span>
          </mwc-list-item>
          <li divider role="separator"></li>`))}
          ${0===this.notifications.length?Z`
            <div style="padding:15px 0;width:100%;text-align:center;">
              ${rt("sidepanel.NoNotification")}
            </div>
        `:Z``}
        </mwc-list>
      </div>
    `}shouldUpdate(){return this.active}firstUpdated(){this.notifications=globalThis.lablupNotification.notifications,document.addEventListener("backend-ai-notification-changed",(()=>this.refresh()))}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}async refresh(){this.notifications=globalThis.lablupNotification.notifications,await this.requestUpdate()}};r([yt({type:Boolean})],$o.prototype,"active",void 0),r([yt({type:Array})],$o.prototype,"notifications",void 0),$o=r([bt("backend-ai-sidepanel-notification")],$o);let zo=class extends Ot{constructor(){super(...arguments),this.required=!1,this.nowrap=!1,this.listeners=[]}firstUpdated(t){super.firstUpdated(t),this.listeners.push(hn(this,"click",this.refireClick.bind(this))),this.updateAria()}disconnectedCallback(){super.disconnectedCallback(),un(this.listeners)}getTargetElement(){if(null==this.for){const t=function(t){return Array.from(t.querySelector("slot").assignedNodes()).filter((t=>"#text"!==t.nodeName))}(this.shadowRoot);return t.length>0?t[0]:null}const t=nn(this,"#"===this.for[0]?this.for:"#"+this.for);return t.length>0?t[0]:null}updateAria(){const t=this.getTargetElement();null!=t&&(""==this.id&&(this.id=In()),t.setAttribute("aria-labelledby",this.id))}refireClick(t){const e=this.getTargetElement();null!=e&&t.target!==e&&(e.dispatchEvent(new MouseEvent("click",{relatedTarget:this})),e instanceof HTMLElement&&e.focus())}render(){return Z` <slot></slot> `}};zo.styles=[Bn,en(':host{font-size:var(--label-font-size,1rem);font-family:var(--label-font-family,var(--font-family-serif,"Roboto Slab",times,serif));line-height:var(--label-line-height,var(--line-height-m,1.5em));color:var(--label-color,hsl(var(--shade-500,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,55%))));cursor:default;display:inline-block}:host([nowrap]){white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;line-height:1.1}:host([required]):after{content:"*";color:var(--label-required-color,hsl(var(--error-500,var(--error-hue,3),var(--error-saturation,80%),var(--error-lightness,54%))))}')],r([yt({type:Boolean}),n("design:type",Boolean)],zo.prototype,"required",void 0),r([yt({type:Boolean}),n("design:type",Boolean)],zo.prototype,"nowrap",void 0),r([yt({type:String}),n("design:type",String)],zo.prototype,"for",void 0),zo=r([bt("wl-label")],zo);var jo;!function(t){t.SUBMIT="submit",t.INVALID="invalid"}(jo||(jo={}));class Fo extends Zn{constructor(){super(...arguments),this.outlined=!1,this.filled=!1,this.role="textbox",this._pristine=!0}set value(t){this.setValue(t)}get value(){return this.getFormItemValue()}set valueAsNumber(t){this.setValue(t.toString())}get valueAsNumber(){return parseFloat(this.getFormItemValue())}get $slot(){return this.shadowRoot.querySelector("#slot")}get $interactiveElement(){return this.$formElement}get pristine(){return this._pristine}get dirty(){return null!=this.value&&""!==this.value}firstUpdated(t){super.firstUpdated(t),this.listeners.push(hn(this.$formElement,"keydown",this.onKeyDown.bind(this),{passive:!0}),hn(this.$formElement,"input",this.onInput.bind(this),{passive:!0}),hn(this.$formElement,"focusout",this.onBlur.bind(this),{passive:!0}),hn(this.$formElement,"invalid",this.onInvalid.bind(this),{passive:!0})),(null!=this.initialValue||this.hasAttribute("value"))&&(this.value=this.initialValue||this.getAttribute("value")||"")}updated(t){super.updated(t),this.refreshAttributes()}createRenderRoot(){return this.attachShadow({mode:"open",delegatesFocus:!0})}focus(){this.$interactiveElement.focus()}setValue(t){null!=this.$formElement?(this.$formElement.value=t,this.refreshAttributes()):this.initialValue=t}onInput(t){this.refreshAttributes()}onInvalid(t){this.dispatchInputEvent(jo.INVALID)}onBlur(){this._pristine=!1,this.refreshAttributes()}refreshAttributes(){rn(this,{dirty:this.dirty,invalid:!this.valid&&!this.pristine,pristine:this.pristine})}onKeyDown(t){switch(t.code){case"Enter":(t.ctrlKey||t.metaKey)&&this.dispatchInputEvent(jo.SUBMIT)}}dispatchInputEvent(t){this.dispatchEvent(new CustomEvent(t,{composed:!0}))}render(){return Z` <div id="container"> <slot id="before" name="before"></slot> <div id="wrapper"> <div id="label">${this.label}</div> <slot id="slot"></slot> ${this.renderFormElement()} </div> <slot id="after" name="after"></slot> </div> `}}Fo.styles=[...Zn.styles,en(':host{--_input-state-color:var(--input-state-color-inactive,hsl(var(--shade-400,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,65%))));--_input-padding-left-right:var(--input-padding-left-right,0);--_input-bg:var(--input-bg,transparent);--_input-border-radius:0;--_input-color:var(--input-color,hsl(var(--foreground,var(--foreground-hue,230),var(--foreground-saturation,70%),var(--foreground-lightness,5%))));--_input-label-color:var(--input-label-color,hsl(var(--shade-600,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,35%))));--_input-border-style:var(--input-border-style,solid);transform:translateZ(0);display:block;outline:none}:host([disabled]){pointer-events:none;--_input-state-color:var(--input-state-color-disabled,hsl(var(--shade-300,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,75%))));--_input-label-color:var(--input-label-color-disabled,hsl(var(--shade-400,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,65%))));--_input-color:var(--input-color-disabled,hsl(var(--shade-400,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,65%))));--_input-border-style:var(--input-border-style-disabled,dashed)}#container{background:var(--_input-bg);color:var(--_input-color);border-radius:var(--_input-border-radius);font-size:var(--input-font-size,1rem);font-family:var(--input-font-family,var(--font-family-serif,"Roboto Slab",times,serif));border-bottom:var(--input-border-width,.0625rem) var(--_input-border-style) var(--_input-state-color);transition:var(--input-transition,border-color var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease),background var(--transition-duration-medium,.18s) var(--transition-timing-function-ease,ease));position:relative;display:flex;align-items:center;overflow:hidden}#wrapper{position:relative;flex-grow:1}#label{left:var(--_input-padding-left-right);color:var(--_input-label-color);transition:var(--input-label-transition,top var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear),font-size var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear),transform var(--transition-duration-fast,.12s) var(--transition-timing-function-linear,linear));font-family:var(--input-font-family,var(--font-family-serif,"Roboto Slab",times,serif));top:50%;transform:translateY(-50%);z-index:1;position:absolute;pointer-events:none;font-size:inherit;line-height:1;white-space:nowrap;-webkit-user-select:none;user-select:none}:host(:hover){--_input-state-color:var(--input-state-color-hover,hsl(var(--shade-600,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,35%))))}:host([filled]),:host([outlined]){--_input-padding-left-right:var(--input-padding-left-right-outlined,0.75rem)}:host([filled]){--_input-border-radius:var(--input-border-radius-outlined,0.5rem 0.5rem 0 0);--_input-bg:var(--input-bg,hsl(var(--shade-200,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,85%))))}:host([filled]:hover){--_input-bg:var(--input-bg-filled-hover,hsla(var(--shade-200,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,85%)),0.5))}:host([outlined]){--_input-border-radius:var(--input-border-radius-outlined,0.5rem)}:host([outlined]) #container{border:var(--input-border-width,.0625rem) var(--_input-border-style) var(--_input-state-color)}:host(:focus-within){--_input-state-color:var(--input-state-color-active,hsl(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%))))}:host(:focus-within) #label,:host([dirty]) #label,:host([type=color]) #label,:host([type=date]) #label,:host([type=file]) #label,:host([type=range]) #label{font-size:var(--input-label-font-size,.75rem);top:var(--input-padding-top-bottom,.5rem);transform:translateY(0)}#slot-wrapper,::slotted(input),::slotted(select),::slotted(textarea){caret-color:var(--_input-color-state);padding:var(--input-padding-top-bottom,.5rem) var(--_input-padding-left-right);font-family:var(--input-font-family,var(--font-family-serif,"Roboto Slab",times,serif));font-size:var(--input-font-size,1rem);-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-tap-highlight-color:transparent;box-sizing:border-box;display:block;color:inherit;-webkit-overflow-scrolling:touch;position:relative;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;outline:none;margin:0;background:transparent;width:100%}:host([label]) #slot-wrapper,:host([label]) ::slotted(input),:host([label]) ::slotted(select),:host([label]) ::slotted(textarea){padding-top:calc(var(--input-label-space, .875rem) + var(--input-padding-top-bottom, .5rem))}:host([invalid]){--_input-state-color:var(--input-state-color-invalid,hsl(var(--error-500,var(--error-hue,3),var(--error-saturation,80%),var(--error-lightness,54%))))}::slotted(input[type=color]){height:3.75rem;cursor:pointer}::slotted([slot=after]),::slotted([slot=before]){color:var(--input-before-after-color,hsl(var(--shade-500,var(--shade-hue,200),var(--shade-saturation,4%),var(--shade-lightness,55%))))}:host(:not([outlined]):not([filled])) ::slotted([slot=before]){margin-right:var(--input-padding-left-right-outlined,.75rem)}:host(:not([outlined]):not([filled])) ::slotted([slot=after]),:host([filled]) ::slotted([slot=before]),:host([outlined]) ::slotted([slot=before]){margin-left:var(--input-padding-left-right-outlined,.75rem)}:host([filled]) ::slotted([slot=after]),:host([outlined]) ::slotted([slot=after]){margin-right:var(--input-padding-left-right-outlined,.75rem)}')],r([yt({type:String,reflect:!0}),n("design:type",String)],Fo.prototype,"autocomplete",void 0),r([yt({type:Boolean,reflect:!0}),n("design:type",Boolean)],Fo.prototype,"outlined",void 0),r([yt({type:Boolean,reflect:!0}),n("design:type",Boolean)],Fo.prototype,"filled",void 0),r([yt({type:String,reflect:!0}),n("design:type",String)],Fo.prototype,"role",void 0),r([yt({type:String,reflect:!0}),n("design:type",String)],Fo.prototype,"label",void 0),r([yt({type:String}),n("design:type",String),n("design:paramtypes",[String])],Fo.prototype,"value",null),r([yt({type:Number}),n("design:type",Number),n("design:paramtypes",[Number])],Fo.prototype,"valueAsNumber",null);class Do extends Fo{}Do.styles=[...Fo.styles,en("")],r([yt({type:String}),n("design:type",String)],Do.prototype,"pattern",void 0),r([yt({type:Number}),n("design:type",Number)],Do.prototype,"minLength",void 0),r([yt({type:Number}),n("design:type",Number)],Do.prototype,"maxLength",void 0);let qo=class extends Do{constructor(){super(...arguments),this.type="text"}renderFormElement(){return Z` <input id="${this.formElementId}" .value="${this.value}" value="${oi(this.initialValue)}" ?required="${this.required}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" aria-label="${oi(this.label)}" type="${oi(this.type)}" name="${oi(this.name)}" list="${oi(this.list)}" pattern="${oi(this.pattern)}" autocomplete="${oi(this.autocomplete)}" minlength="${oi(this.minLength)}" maxlength="${oi(this.maxLength)}" min="${oi(this.min)}" max="${oi(this.max)}" tabindex="${this.disabled?-1:0}"> `}};qo.styles=[...Do.styles,en("")],r([yt({type:String}),n("design:type",String)],qo.prototype,"list",void 0),r([yt({type:String,reflect:!0}),n("design:type",String)],qo.prototype,"type",void 0),r([yt({type:Number}),n("design:type",Number)],qo.prototype,"min",void 0),r([yt({type:Number}),n("design:type",Number)],qo.prototype,"max",void 0),qo=r([bt("wl-textfield")],qo),function(){let t;function e(e){return!!function(){if(void 0===t){t=!1;try{const e=Object.defineProperty({},"passive",{get:()=>{t=!0}});window.addEventListener("test",null,e)}catch(t){}}return t}()&&{passive:e}}function i(t,e=t,i=t){let r=t;if(e>i)throw new RangeError(`'min' ${e} should be lower than 'max' ${i}`);return t<e&&(r=e),t>i&&(r=i),r}function r(t,e,i){i?t.setAttribute(e,""):t.removeAttribute(e)}function n(t,e){return t.hasAttribute(e)}function o(t,e,i){t.setAttribute(e,i)}function s(t,e,i=0){const r=t.getAttribute(e);return null===r?i:parseInt(r,10)}function a(t){if("touchstart"===t.type||"touchmove"===t.type||"touchend"===t.type){const e=t.targetTouches[0]||t.changedTouches[0];return{x:e.clientX,y:e.clientY,id:e.identifier,event:t}}return{x:t.clientX,y:t.clientY,id:null,event:t}}const l=document.createElement("template");l.innerHTML='<style>:host{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;contain:content;-webkit-tap-highlight-color:rgba(0,0,0,0);--macro-carousel-gap:16px;--macro-carousel-background-color:transparent;--macro-carousel-slide-min-height:0px;--macro-carousel-slide-max-height:none;--macro-carousel-transition-duration:0.6s;--macro-carousel-transition-timing-function:cubic-bezier(0.25,0.46,0.45,0.94);--macro-carousel-pagination-gap:2px;--macro-carousel-pagination-height:44px;--macro-carousel-fallback-message-color-background:#fff;--macro-carousel__internal__slides-per-view:1}:host([hidden]){display:none}:host-context(.js-focus-visible) ::slotted(:focus:not(.focus-visible)),:host-context(.js-focus-visible) :focus:not(.focus-visible){outline:0}#externalWrapper{height:100%;overflow:hidden;contain:paint;background-color:var(--macro-carousel-background-color);-ms-touch-action:pan-y pinch-zoom;touch-action:pan-y pinch-zoom;cursor:-webkit-grab;cursor:grab}#externalWrapper:active{cursor:-webkit-grabbing;cursor:grabbing}:host([disable-drag]) #externalWrapper{cursor:default}#slidesWrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;height:100%;min-height:var(--macro-carousel-slide-min-height);max-height:var(--macro-carousel-slide-max-height);will-change:transform}:host([transitioning]) #slidesWrapper{-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform,-webkit-transform;-webkit-transition-duration:var(--macro-carousel-transition-duration);transition-duration:var(--macro-carousel-transition-duration);-webkit-transition-timing-function:var(--macro-carousel-transition-timing-function);transition-timing-function:var(--macro-carousel-transition-timing-function)}#slidesWrapper ::slotted(*){-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0;-ms-flex-preferred-size:calc((100% - (var(--macro-carousel__internal__slides-per-view) - 1) * var(--macro-carousel-gap)) / var(--macro-carousel__internal__slides-per-view));flex-basis:calc((100% - (var(--macro-carousel__internal__slides-per-view) - 1) * var(--macro-carousel-gap)) / var(--macro-carousel__internal__slides-per-view));min-height:var(--macro-carousel-slide-min-height);max-height:var(--macro-carousel-slide-max-height);margin-right:var(--macro-carousel-gap);overflow:hidden;outline:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.slidesFallback{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin:0;padding:.5em 1em;width:100%;background-color:var(--macro-carousel-fallback-message-color-background)}:host([disable-drag]) #slidesWrapper ::slotted(*){-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto}#pagination{display:none}:host([pagination]) #pagination{-ms-flex-item-align:center;align-self:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:100%;height:var(--macro-carousel-pagination-height);contain:strict;font-size:0}div ::slotted(macro-carousel-pagination-indicator){margin:0 calc(var(--macro-carousel-pagination-gap) / 2);padding:0;font-size:inherit;opacity:.8}div ::slotted(macro-carousel-pagination-indicator.selected),div ::slotted(macro-carousel-pagination-indicator:hover){opacity:1}#navigation{display:none}:host([navigation]) #navigation{display:block}div ::slotted(macro-carousel-nav-button){position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}:host([pagination]) div ::slotted(macro-carousel-nav-button){top:calc(50% - var(--macro-carousel-pagination-height) / 2)}div ::slotted(.macro-carousel-previous){left:0}div ::slotted(.macro-carousel-next){right:0}#aria-live ::slotted(*){position:absolute;height:1px;width:1px;margin:-1px;padding:0;clip:rect(0 0 0 0);overflow:hidden;border:0}@media print{#slidesWrapper ::slotted(*){margin-right:0;margin-bottom:.2em;outline:1px solid #000;color:#000;page-break-inside:avoid}:host([navigation]) #navigation,:host([pagination]) #pagination{display:none}#slidesWrapper{display:block;-webkit-transform:none!important;transform:none!important;-webkit-transition:0s;transition:0s}}</style> <div id="externalWrapper"> <div id="slidesWrapper"> <slot id="slidesSlot"> <p class="slidesFallback">No content available</p> </slot> </div> </div> <div id="navigation"> <slot id="navigationSlot" name="navigationSlot"></slot> </div> <div id="pagination"> <slot id="paginationSlot" name="paginationSlot"></slot> </div> <div id="aria-live"> <slot id="ariaSlot" name="ariaSlot"></slot> </div> ',window.ShadyCSS&&window.ShadyCSS.prepareTemplate(l,"macro-carousel");const d=Math.abs((35,Math.round(100*Math.tan(35*Math.PI/180))/100));window.customElements.define("macro-carousel",class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(l.content.cloneNode(!0)),this.t=this.shadowRoot.querySelector("#externalWrapper"),this.i=this.shadowRoot.querySelector("#slidesWrapper"),this.s=this.shadowRoot.querySelector("#slidesSlot"),this.e=this.shadowRoot.querySelector("#ariaSlot"),this.o=this.shadowRoot.querySelector("#paginationSlot"),this.a=[],this.n=this.shadowRoot.querySelector("#navigationSlot"),this.r=void 0,this.h=void 0,this.c=[],this.l=-1,this.d=!1,this.u=0,this.m=0,this.g=0,this.p=0,this.b=0,this.v=0,this.w=void 0,this.f=!1,this.k=!1,this._=void 0,this.S=void 0,this.z=void 0,this.M=void 0,this.C=void 0,this.W=void 0,this.P=void 0,this.L=void 0,this.G=[],this.F=!1,this.I=50,this.$=20,this.A=.7,this.D=.04,this.T=0,this.N=!1}connectedCallback(){window.ShadyCSS&&window.ShadyCSS.styleElement(this),this.hasAttribute("role")||this.setAttribute("role","list"),this.j("selected"),this.j("loop"),this.j("navigation"),this.j("pagination"),this.j("disableDrag"),this.j("slidesPerView"),this.j("reducedMotion"),this.j("autoFocus"),this.m=this.selected,this.O(),this.s.addEventListener("slotchange",this),window.addEventListener("resize",this,e(!0)),this.addEventListener("keydown",this),window.addEventListener("touchmove",(function(){})),this.q()}disconnectedCallback(){this.s.removeEventListener("slotchange",this),window.removeEventListener("resize",this),this.disableDrag||(this.t.removeEventListener("touchstart",this),this.t.removeEventListener("mousedown",this)),this.navigation&&(this.r.removeEventListener("macro-carousel-nav-button-clicked",this),this.h.removeEventListener("macro-carousel-nav-button-clicked",this)),this.pagination&&this.a.forEach((t=>{t.removeEventListener("macro-carousel-pagination-indicator-clicked",this)}))}handleEvent(t){"resize"===t.type&&t.target===window?(this.B(),this.update()):"slotchange"===t.type&&t.target===this.s?this.q():"macro-carousel-pagination-indicator-clicked"===t.type&&this.pagination?this.V(t):"macro-carousel-nav-button-clicked"===t.type&&this.navigation?t.target===this.r?this.previous():t.target===this.h&&this.next():"keydown"===t.type?37===t.keyCode||38===t.keyCode?this.previous():39!==t.keyCode&&40!==t.keyCode||this.next():"transitionend"===t.type&&t.target===this.i?(this.H(),this.R(),this.X()):"touchstart"===t.type||"mousedown"===t.type?this.Y(a(t)):"touchmove"===t.type||"mousemove"===t.type?this.U(a(t)):"touchend"===t.type||"mouseup"===t.type?this.J(a(t)):"touchcancel"===t.type&&this.K()}j(t){if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this[t]=e}}update(){clearTimeout(this.w),this.B(),this.w=setTimeout((()=>{this.Q()}),50)}Q(){this.Z(),this.tt(),this.it(),this.st(this.c.map((t=>t.layoutIndex)),!0),this.et(this.selected),this.ot(),this.at(),this.nt(),this.H(),this.X(),this.O()}previous(){this.selected=this.rt(this.selected)}rt(t){let e=t;return t>0?e=t-1:this.loop&&(this.d&&(this.u-=1),e=this.l),i(e,0,this.l)}next(){this.selected=this.ht(this.selected)}ht(t){let e=t;return t<this.l?e=t+1:this.loop&&(this.d&&(this.u+=1),e=0),i(e,0,this.l)}static get observedAttributes(){return["selected","loop","navigation","pagination","disable-drag","slides-per-view","reduced-motion","auto-focus"]}attributeChangedCallback(t,e,i){switch(0===this.c.length&&this.q(),t){case"selected":const t=parseInt(i,10);if(!Number.isFinite(t)||t>this.l||t<0)return void(this.selected=e||0);if(this.d){const t=this.selected+this.u*(this.l+1),e=this.m-t,i=[],r=e<0?this.slidesPerView+e:0;for(let n=-1;n<Math.abs(e);n++)i.push(n+t+r);this.st(i),this.m=t}this.et(this.selected),this.ot(),this.at(),this.dispatchEvent(new CustomEvent("macro-carousel-selected-changed",{detail:this.selected,bubbles:!0})),this.f||this.N||(this.H(),this.R(),this.X());break;case"loop":this.tt(),this.it(),this.st(this.c.map(((t,e)=>e))),this.at(),this.ot(),this.H(),this.R(),this.X(),window.ShadyCSS&&window.ShadyCSS.styleSubtree(this);break;case"navigation":this.update(),window.ShadyCSS&&window.ShadyCSS.styleSubtree(this);break;case"pagination":this.ot(),window.ShadyCSS&&window.ShadyCSS.styleSubtree(this);break;case"disable-drag":this.nt();break;case"slides-per-view":const r=parseInt(i,10);if(!Number.isFinite(r)||r<1||r>this.c.length)return void(this.slidesPerView=e||1);this.update(),window.ShadyCSS&&window.ShadyCSS.styleSubtree(this);break;case"reduced-motion":null!==i?this.B():this.O()}}set selected(t){o(this,"selected",t)}get selected(){return s(this,"selected")}set loop(t){r(this,"loop",t)}get loop(){return n(this,"loop")}set navigation(t){r(this,"navigation",t)}get navigation(){return n(this,"navigation")}set pagination(t){r(this,"pagination",t)}get pagination(){return n(this,"pagination")}set disableDrag(t){r(this,"disable-drag",t)}get disableDrag(){return n(this,"disable-drag")}set slidesPerView(t){o(this,"slides-per-view",t)}get slidesPerView(){return s(this,"slides-per-view",1)}set reducedMotion(t){r(this,"reduced-motion",t)}get reducedMotion(){return n(this,"reduced-motion")}set autoFocus(t){r(this,"auto-focus",t)}get autoFocus(){return n(this,"auto-focus")}B(){this.f=!1,this.removeAttribute("transitioning"),this.i.removeEventListener("transitionend",this,!1)}O(){this.reducedMotion||requestAnimationFrame((()=>{requestAnimationFrame((()=>{this.f=!0,this.setAttribute("transitioning",""),this.i.addEventListener("transitionend",this,!1)}))}))}Z(){this.g=this.i.getBoundingClientRect().width,this.p=this.ct(),this.b=this.lt()}lt(){return(this.g-(this.slidesPerView-1)*this.p)/this.slidesPerView}ct(){/\d$/.test(function(t,e){const i=getComputedStyle(t);return String(i.getPropertyValue("--macro-carousel-gap")).trim()}(this))&&console.warn("Warning: it looks like --macro-carousel-gap has a unitless value.\nAdd CSS units to its value to avoid breaking the slides layout.");const t=parseInt(getComputedStyle(this.c[0].element)["margin-right"],10);return Number.isFinite(t)?t:0}it(){var t,e;t="--macro-carousel__internal__slides-per-view",e=""+this.slidesPerView,this.style.setProperty(t,e),window.ShadyCSS&&window.ShadyCSS.styleSubtree(this,{[t]:e}),this.l=this.d?this.c.length-1:this.dt(),!this.d&&this.selected>this.l&&(this.selected=this.l)}dt(){return Math.max(0,this.c.length-this.slidesPerView)}ut(t){let e=t;for(;e<0;)e+=this.c.length;return e%this.c.length}st(t,e=!1){let i;t.forEach((t=>{!e&&this.c.find((e=>e.layoutIndex===t))||(i=this.ut(t),this.c[i].layoutIndex=t,this.c[i].position=this.mt(t),this.c[i].element.style.transform=`translateX(${this.mt(i-t)}px)`)}))}mt(t){return-t*(this.b+this.p)}gt(t){this.i.style.transform=`translate3d(${t}px, 0, 0)`,this.v=t}et(t){this.i&&!this.N&&this.gt(this.c[t].position)}R(){this.autoFocus&&this.c[this.selected].element.focus()}H(){const t=[];for(let e=0;e<this.slidesPerView;e++)t.push((this.selected+e)%this.c.length);let e;this.c.map((t=>t.element)).forEach(((i,r)=>{e=void 0!==t.find((t=>t===r)),i.setAttribute("aria-hidden",e?"false":"true"),e?(i.removeAttribute("inert"),i.setAttribute("tabindex",-1)):i.setAttribute("inert","")}))}ot(){if((!this.pagination||this.pagination&&this.o.assignedNodes().length!==this.l+1)&&(this.a.forEach((t=>{t.removeEventListener("macro-carousel-pagination-indicator-clicked",this),this.removeChild(t)})),this.a.length=0),this.pagination){if(this.o.assignedNodes().length!==this.l+1){const t=document.createDocumentFragment();for(let e=0;e<=this.l;e++){const i=document.createElement("macro-carousel-pagination-indicator");i.textContent=e,i.setAttribute("slot","paginationSlot"),i.setAttribute("aria-label","Go to item "+(e+1)),i.addEventListener("macro-carousel-pagination-indicator-clicked",this),t.appendChild(i),this.a.push(i)}this.appendChild(t)}this.a.forEach(((t,e)=>{e===this.selected?t.classList.add("selected"):t.classList.remove("selected")}))}}V(t){this.selected=parseInt(t.target.textContent,10)}pt(t){const e=document.createElement("macro-carousel-nav-button");return e.classList.add(t),e.setAttribute("slot","navigationSlot"),e.addEventListener("macro-carousel-nav-button-clicked",this),/next/.test(t)&&e.setAttribute("flipped",""),e}at(){(!this.navigation||this.navigation&&2!==this.n.assignedNodes().length)&&(this.n.assignedNodes().forEach((t=>{t.removeEventListener("macro-carousel-nav-button-clicked",this),this.removeChild(t)})),this.r=void 0,this.h=void 0),this.navigation&&(2!==this.n.assignedNodes().length&&(this.r=this.pt("macro-carousel-previous"),this.appendChild(this.r),this.h=this.pt("macro-carousel-next"),this.appendChild(this.h)),this.r.disabled=!this.loop&&0===this.selected,this.h.disabled=!this.loop&&this.selected===this.l,this.r.setAttribute("aria-label",`Go to ${this.loop&&0===this.selected?"last":"previous"} item`),this.h.setAttribute("aria-label",`Go to ${this.loop&&this.selected===this.l?"first":"next"} item`))}tt(){this.d=this.loop&&this.dt()>1}bt(){return this.s.assignedNodes({flatten:!0}).forEach((t=>{t.nodeType===Node.TEXT_NODE&&t.parentNode&&t.parentNode.removeChild(t)})),this.s.assignedNodes({flatten:!0}).filter((t=>t.nodeType===Node.ELEMENT_NODE)).map(((t,e)=>({element:t,layoutIndex:e,position:this.mt(e)})))||[]}q(){this.c=this.bt(),this.c.forEach((t=>{t.element.hasAttribute("tabindex")||t.element.setAttribute("tabindex",-1),"list"===this.getAttribute("role")&&t.element.setAttribute("role","listitem")}));const t=this.c.length>0&&-1===this.l;this.Q(),t&&(this.selected=this.selected)}X(){1!==this.e.assignedNodes().length&&(this.vt=document.createElement("div"),this.vt.setAttribute("slot","ariaSlot"),this.vt.setAttribute("aria-live","polite"),this.vt.setAttribute("aria-atomic","true"),this.appendChild(this.vt));const t=this.c[this.selected].layoutIndex;let e="";for(let i=0;i<this.slidesPerView;i++)e+=(t+i)%this.c.length+1,i<this.slidesPerView-2?e+=", ":i<this.slidesPerView-1&&(e+=" and ");this.vt.textContent=`Item${this.slidesPerView>1?"s":""} ${e} of ${this.c.length} visible`}nt(){this.disableDrag?(this.t.removeEventListener("touchstart",this),this.t.removeEventListener("mousedown",this)):(this.t.addEventListener("touchstart",this,e(!0)),this.t.addEventListener("mousedown",this,e(!0)))}Y(t){this.k||(this.N=!1,this.k=!0,this._=t.id,this.S=this.M=this.W=t.x,this.z=this.C=this.P=t.y,this.L=this.c[this.selected].layoutIndex,this.G=[],this.wt(this.M),window.addEventListener("touchmove",this,e(!1)),window.addEventListener("mousemove",this,e(!1)),window.addEventListener("mouseup",this),window.addEventListener("touchend",this),window.addEventListener("touchcancel",this))}U(t){if(this.k&&t.id===this._){this.W=t.x,this.P=t.y;const e=Math.abs(this.W-this.S),i=Math.abs(this.P-this.z);e/i>d||0===i||i>e&&i-e<5?(t.event.preventDefault(),this.wt(this.M),this.B(),this.ft()):this.K()}}J(t){this.k&&t.id===this._&&this.K()}K(){this.k=!1,this._=void 0,this.wt(this.M),window.removeEventListener("touchmove",this),window.removeEventListener("mousemove",this),window.removeEventListener("touchend",this),window.removeEventListener("mouseup",this),window.removeEventListener("touchcancel",this),this.kt()}wt(t){const e=Date.now();for(;this.G.length>0&&!(e-this.G[0].time<=100);)this.G.shift();this.G.push({x:t,time:e})}ft(){this.F||requestAnimationFrame(this.xt.bind(this)),this.F=!0}xt(){const t=this.v+this.W-this.M;let e,i;if(this.c.forEach(((r,n)=>{r.position>=t&&(void 0===i||r.position<i)&&(i=r.position,e=n)})),this.d){let t;if(void 0===e){const i=this.c.slice(0).sort(((t,e)=>t.layoutIndex>e.layoutIndex))[0];for(e=i.layoutIndex-1;e<0;)e+=this.c.length;e%=this.c.length,t=i.layoutIndex-2}else t=this.c[e].layoutIndex-1;const i=[],r=t+this.slidesPerView+2;for(let e=t;e<r;e++)i.push(e);this.st(i)}else e=e||0;this.L=this.c[e].layoutIndex,this.gt(t),this.M=this.W,this.C=this.P,this.F=!1}kt(){this.N=!0;const t=this.G[this.G.length-1],e=this.G[0],r=t.x-e.x||0;this.u=Math.floor(this.L/this.c.length);const n=this.ut(this.L);let o;if(0===r)this.T=0,o=this.c[n].position-this.v>this.b/2?this.ht(n):n;else{this.T=function(t,e,r){if(0===t)throw new RangeError("x must be different from `0`");return t/Math.abs(t)*i(Math.abs(t),e,r)}(r,this.$,this.I);let t=1;const e=.5*this.g;for(;Math.abs(r)>e*t&&t<this.slidesPerView+2;)t+=1;r>0&&(t-=1);let s=n;for(let e=0;e<t;e++)s=r<0?this.ht(s):this.rt(s);o=s}this.selected=i(o,0,this.l),requestAnimationFrame(this.yt.bind(this))}yt(){if(!this.N)return;const t=this.c[this.selected].position;this.T+=this.D*(t-this.v),this.T*=this.A;const e=this.v+this.T;(Math.abs(t-e)>=1||Math.abs(this.T)>=1)&&!this.reducedMotion?(this.gt(e),requestAnimationFrame(this.yt.bind(this))):(this.gt(t),this.N=!1,this.O(),requestAnimationFrame((()=>{this.H(),this.R(),this.X()})))}});class c extends HTMLElement{constructor(){super();const t=Object.getPrototypeOf(this).constructor.template;this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(t.content.cloneNode(!0))}connectedCallback(){window.ShadyCSS&&window.ShadyCSS.styleElement(this),this._t=0,this.hasAttribute("role")||this.setAttribute("role","button"),this.hasAttribute("tabindex")?this._t=this.getAttribute("tabindex"):this.setAttribute("tabindex",this._t),this.j("disabled"),this.addEventListener("keydown",this),this.addEventListener("click",this)}j(t){if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this[t]=e}}static get observedAttributes(){return["disabled"]}set disabled(t){r(this,"disabled",t)}get disabled(){return n(this,"disabled")}attributeChangedCallback(t,e,i){switch(t){case"disabled":if(e===i)return;this.disabled?(this._t=this.getAttribute("tabindex"),this.removeAttribute("tabindex"),this.setAttribute("aria-disabled","true")):(this.setAttribute("tabindex",this._t),this.setAttribute("aria-disabled","false"))}}handleEvent(t){this.disabled?t.preventDefault():"click"===t.type?this.St&&this.St():"keydown"!==t.type||32!==t.keyCode&&13!==t.keyCode||(t.preventDefault(),this.St&&this.St())}}const h=document.createElement("template");h.innerHTML='<style>:host{--macro-carousel-navigation-color:#000;--macro-carousel-navigation-color-focus:var(--macro-carousel-navigation-color);--macro-carousel-navigation-color-background:transparent;--macro-carousel-navigation-color-background-focus:#f0f0f0;--macro-carousel-navigation-button-size:48px;--macro-carousel-navigation-icon-size:24px;--macro-carousel-navigation-icon-mask:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 24 24\'%3E%3Cpath d=\'M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\'/%3E%3C/svg%3E");position:relative;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;min-width:var(--macro-carousel-navigation-button-size);min-height:var(--macro-carousel-navigation-button-size);border-radius:50%;overflow:hidden;cursor:pointer;contain:paint}:host([disabled]){opacity:.2}.bg,.content{position:absolute;top:0;right:0;bottom:0;left:0}.content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;background-color:var(--macro-carousel-navigation-color-background)}.bg{z-index:0;background-color:var(--macro-carousel-navigation-color-background-focus);opacity:0;will-change:opacity}.icon{position:relative;z-index:1;width:var(--macro-carousel-navigation-icon-size);height:var(--macro-carousel-navigation-icon-size);color:var(--macro-carousel-navigation-color);background:var(--macro-carousel-navigation-icon-mask)}@supports ((-webkit-mask-image:var(--macro-carousel-navigation-icon-mask)) or (mask-image:var(--macro-carousel-navigation-icon-mask))){.icon{background:var(--macro-carousel-navigation-color);-webkit-mask-image:var(--macro-carousel-navigation-icon-mask);mask-image:var(--macro-carousel-navigation-icon-mask)}}:host([flipped]) .icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}:host(.focus-visible) .bg,:host(:active:not([disabled])) .bg,:host(:focus:not([disabled])) .bg,:host(:hover:not([disabled])) .bg{opacity:1}:host-context(.js-focus-visible):host(:focus:not(:active):not(:hover):not(.focus-visible)) .bg{opacity:0}@supports ((-webkit-mask-image:var(--macro-carousel-navigation-icon-mask)) or (mask-image:var(--macro-carousel-navigation-icon-mask))){:host(.focus-visible) .icon,:host(:active:not([disabled])) .icon,:host(:focus:not([disabled])) .icon,:host(:hover:not([disabled])) .icon{background:var(--macro-carousel-navigation-color-focus)}:host-context(.js-focus-visible):host(:focus:not(:active):not(:hover):not(.focus-visible)) .icon{background:var(--macro-carousel-navigation-color)}}</style> <div class="content"> <div class="bg"></div> <div class="icon"></div> </div> ',window.ShadyCSS&&window.ShadyCSS.prepareTemplate(h,"macro-carousel-nav-button"),window.customElements.define("macro-carousel-nav-button",class extends c{static get template(){return h}St(){this.dispatchEvent(new CustomEvent("macro-carousel-nav-button-clicked"))}});const u=document.createElement("template");u.innerHTML='<style>:host{--macro-carousel-pagination-color:#999;--macro-carousel-pagination-color-selected:#000;--macro-carousel-pagination-size-clickable:24px;--macro-carousel-pagination-size-dot:8px;--macro-carousel-pagination-border:1px solid var(--macro-carousel-pagination-color);--macro-carousel-pagination-border-selected:1px solid var(--macro-carousel-pagination-color-selected);position:relative;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:var(--macro-carousel-pagination-size-clickable);height:var(--macro-carousel-pagination-size-clickable);overflow:hidden;cursor:pointer;contain:paint}.bg,.fg,:host{border-radius:50%}.bg,.fg{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);display:block;width:var(--macro-carousel-pagination-size-dot);height:var(--macro-carousel-pagination-size-dot);-webkit-box-sizing:border-box;box-sizing:border-box;background-color:var(--macro-carousel-pagination-color);content:""}.bg{-webkit-transform:translate(-50%,-50%) scale(2);transform:translate(-50%,-50%) scale(2);opacity:0;will-change:opacity}.fg{border:var(--macro-carousel-pagination-border)}:host(.focus-visible) .bg,:host(:hover) .bg{opacity:.2}:host(.selected) .fg{background-color:var(--macro-carousel-pagination-color-selected);border:var(--macro-carousel-pagination-border-selected)}</style> <div class="bg"></div> <div class="fg"></div> ',window.ShadyCSS&&window.ShadyCSS.prepareTemplate(u,"macro-carousel-pagination-indicator"),window.customElements.define("macro-carousel-pagination-indicator",class extends c{static get template(){return u}St(){this.dispatchEvent(new CustomEvent("macro-carousel-pagination-indicator-clicked"))}})}();let Uo=class extends co{render(){return Z`
			<svg focusable="false" preserveAspectRatio="xMidYMid meet" viewBox="0 0 100 100">
				${this.bufferPerc>0?Y`<circle id="buffer" cx="50%" cy="50%" r="45" fill="transparent" style="stroke-dashoffset: ${285-285*this.bufferPerc}px"></circle>`:""}
				<circle
					id="progress"
					cx="50%"
					cy="50%"
					r="45"
					fill="transparent"
					style="${this.mode===lo.DETERMINATE?`stroke-dashoffset: ${285-285*this.progressPerc}px;`:""}"
				></circle>
			</svg>
		`}};Uo.styles=[...co.styles,en(":host{width:var(--progress-spinner-size,3rem);height:var(--progress-spinner-size,3rem);contain:strict;position:relative;display:inline-block}svg{width:100%;height:100%;position:absolute;transform:rotate(-90deg);top:0;left:0;transform-origin:center center;overflow:visible}#buffer,#progress{stroke-width:var(--progress-spinner-stroke-width,10%);stroke-dasharray:285px;transition-property:stroke;transform-origin:center}#buffer{stroke:var(--progress-spinner-buffer-color,hsla(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%)),.2))}#progress{stroke:var(--progress-spinner-color,hsl(var(--primary-500,var(--primary-hue,224),var(--primary-saturation,47%),var(--primary-lightness,38%))))}:host([mode=indeterminate]) svg{animation:rotate var(--progress-spinner-indeterminate-container-duration,2s) linear infinite}:host([mode=indeterminate]) #progress{animation-duration:var(--progress-spinner-indeterminate-progress-duration,4s);animation-timing-function:var(--progress-spinner-indeterminate-timing-function,var(--transition-timing-function-standard-curve,cubic-bezier(.4,0,.2,1)));animation-iteration-count:infinite;animation-name:indeterminate}#buffer,:host([mode=determinate]) #progress{transition:var(--progress-spinner-determinate-progress-transition,stroke-dashoffset var(--transition-timing-function-linear,linear))}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(1turn)}}@keyframes indeterminate{0%{stroke-dashoffset:268px;transform:rotate(0)}12.5%{stroke-dashoffset:56px;transform:rotate(0)}12.5001%{stroke-dashoffset:56px;transform:rotateX(180deg) rotate(72.5deg)}25%{stroke-dashoffset:268px;transform:rotateX(180deg) rotate(72.5deg)}25.0001%{stroke-dashoffset:268px;transform:rotate(270deg)}37.5%{stroke-dashoffset:56px;transform:rotate(270deg)}37.5001%{stroke-dashoffset:56px;transform:rotateX(180deg) rotate(161.5deg)}50%{stroke-dashoffset:268px;transform:rotateX(180deg) rotate(161.5deg)}50.0001%{stroke-dashoffset:268px;transform:rotate(180deg)}62.5%{stroke-dashoffset:56px;transform:rotate(180deg)}62.5001%{stroke-dashoffset:56px;transform:rotateX(180deg) rotate(251.5deg)}75%{stroke-dashoffset:268px;transform:rotateX(180deg) rotate(251.5deg)}75.0001%{stroke-dashoffset:268px;transform:rotate(90deg)}87.5%{stroke-dashoffset:56px;transform:rotate(90deg)}87.5001%{stroke-dashoffset:56px;transform:rotateX(180deg) rotate(341.5deg)}to{stroke-dashoffset:268px;transform:rotateX(180deg) rotate(341.5deg)}}")],Uo=r([bt("wl-progress-spinner")],Uo);
/**
 @license
 Copyright (c) 2015-2020 Lablup Inc. All rights reserved.
 */
let Ho=class extends Ot{constructor(){super(),this.active=!1}static get styles(){return[Ct`
        wl-progress-spinner {
          --progress-spinner-size: 48px;
          --progress-spinner-stroke-width: 12px;
          width: 48px;
          height: 48px;
          position: fixed;
          bottom: 60px;
          right: 60px;
        }
      `]}render(){return Z`
      <wl-progress-spinner id="spinner"></wl-progress-spinner>
    `}shouldUpdate(){return this.active}firstUpdated(){this.spinner=this.shadowRoot.querySelector("#spinner"),this.active=!0}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}async getMoreState(){}async show(){this.active=!0,await this.updateComplete,this.spinner.style.display="block"}async hide(){this.active=!0,await this.updateComplete,this.spinner.style.display="none",this.active=!1}async toggle(){await this.updateComplete,!0===this.spinner.active?(this.active=!0,this.spinner.style.display="none",this.active=!1):(this.active=!0,this.spinner.style.display="block")}};r([yt({type:Object})],Ho.prototype,"spinner",void 0),r([yt({type:Boolean})],Ho.prototype,"active",void 0),Ho=r([bt("lablup-loading-spinner")],Ho);let Vo=class extends Un{constructor(){super(),this.active=!0,this.condition="running",this.jobs=Object(),this.appSupportList=Array(),this.appTemplate=Object(),this.imageInfo=Object(),this._selected_items=Array(),this.refreshing=!1,this.notification=Object(),this.spinner=Object(),this.refreshTimer=Object(),this.kernel_labels=Object(),this.indicator=Object(),this.sshPort=0,this.vncPort=0,this.appLaunchBeforeTunneling=["nniboard"],this.appController=Object(),this.openPortToPublic=!1}static get styles(){return[Me,yo,_o,Ct`
        mwc-icon-button.apps {
          --mdc-icon-button-size: 48px;
          --mdc-icon-size: 36px;
          padding: 3px;
        }

        #app-dialog {
          --component-width: 330px;
          --component-width: auto;
          --component-max-width: 70%;
        }

        #ssh-dialog {
          --component-width: 330px;
        }

        .app-icon {
          margin-left: 5px;
          margin-right: 5px;
        }

        .app-icon .label {
          display: block;
          width: 80px;
          text-align: center;
          height: 25px;
          font-size: 13px;
        }

        #app-launch-confirmation-dialog {
          --component-width: 400px;
          --component-font-size: 14px;
        }

        wl-button.app-launch-confirmation-button {
          width: 335px;
          --button-bg: var(--paper-red-50);
          --button-bg-active: var(--paper-red-300);
          --button-bg-hover: var(--paper-red-300);
          --button-bg-active-flat: var(--paper-orange-50);
          --button-color: var(--paper-red-600);
          --button-color-active: red;
          --button-color-hover: red;
        }

        macro-carousel {
          max-width: 700px;
          height: 450px;
          padding: 0 30px;
          margin: 0 10px;
        }

        .slide {
          display: flex;
          align-items: center;
          justify-content: center;
        }

        .slide > span {
          width: 100%;
          height: 100%;
          display: flex;
          justify-content: center;
          align-items: center;
          background-repeat: no-repeat;
          background-size: contain;
          background-position: top center;
        }

        .slide > p {
          font-size: 14px;
        }

        macro-carousel-pagination-indicator {
          /* Change the dots color */
          --macro-carousel-pagination-color: var(--paper-grey-400);
          /* Change the aspect of the selected dot */
          --macro-carousel-pagination-color-selected: var(--paper-green-400);
          /* Change the dots size */
          --macro-carousel-pagination-size-clickable: 32px;
          --macro-carousel-pagination-size-dot: 10px;
        }

        wl-label {
          font-family: 'Ubuntu', 'Quicksand', Roboto, sans-serif;
        }

        wl-label.keyboard {
          font-family: Menlo, Courier, "Courier New";
          padding: 20px;
          background-color: var(--paper-grey-200);
          border-radius: 10px;
          margin: 0px 10px;
        }

        wl-label.invert {
          font-size: 26px;
          color: var(--paper-grey-200);
          background-color: transparent;
          margin: 0px 10px;
        }

        wl-label.one-key {
          text-align: center;
          width: 24px;
        }

        wl-checkbox#hide-guide {
          margin-right: 10px;
        }

        p code {
          font: 12px Monaco, "Courier New", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", monospace;
          color: #52595d;
          -webkit-border-radius: 3px;
          -moz-border-radius: 3px;
          border-radius: 3px;
          -moz-background-clip: padding;
          -webkit-background-clip: padding-box;
          background-clip: padding-box;
          border: 1px solid #ccc;
          background-color: #f9f9f9;
          padding: 0px 3px;
          display: inline-block;
        }
      `]}firstUpdated(){this._initializeAppTemplate(),this.refreshTimer=null,fetch("resources/image_metadata.json").then((t=>t.json())).then((t=>{this.imageInfo=t.imageInfo;for(let t in this.imageInfo)this.kernel_labels[t]=[],"label"in this.imageInfo[t]?this.kernel_labels[t]=this.imageInfo[t].label:this.kernel_labels[t]=[]})),this._createTerminalGuide(),this._createDonotShowOption(),this.notification=globalThis.lablupNotification;this.shadowRoot.querySelector("#hide-guide").addEventListener("change",(t=>{t.target.checked?localStorage.setItem("backendaiconsole.terminalguide","false"):localStorage.setItem("backendaiconsole.terminalguide","true")}))}async _viewStateChanged(t){await this.updateComplete}_initializeAppTemplate(){fetch("resources/app_template.json").then((t=>t.json())).then((t=>{this.appTemplate=t.appTemplate}))}async sendRequest(t){let e,i;try{"GET"==t.method&&(t.body=void 0),e=await fetch(t.uri,t);let r=e.headers.get("Content-Type");if(i=r.startsWith("application/json")||r.startsWith("application/problem+json")?await e.json():r.startsWith("text/")?await e.text():await e.blob(),!e.ok)throw i}catch(t){}return i}_getProxyURL(){let t="http://127.0.0.1:5050/";return void 0!==globalThis.__local_proxy?t=globalThis.__local_proxy:void 0!==globalThis.backendaiclient._config.proxyURL&&(t=globalThis.backendaiclient._config.proxyURL),t}showLauncher(t){return this._showAppLauncher(t)}_showAppLauncher(t){const e=t["session-uuid"],i=t["access-key"],r=t["app-services"];if("runtime"in t){let i={};return i["session-uuid"]=e,i["app-name"]=t.runtime,i["url-postfix"]="",i["file-name"]=t.filename,"jupyter"===i["app-name"]&&(i["url-postfix"]="&redirect=/notebooks/"+i["file-name"]),this._runAppWithParameters(i)}this.appSupportList=[],this.appSupportList.push({name:"ttyd",title:"Console",redirect:"",src:"./resources/icons/terminal.svg"}),r.forEach((t=>{t in this.appTemplate?("sshd"!==t||"sshd"===t&&globalThis.isElectron)&&this.appTemplate[t].forEach((t=>{this.appSupportList.push(t)})):["ttyd","ipython"].includes(t)||this.appSupportList.push({name:t,title:t,redirect:"",src:"./resources/icons/default_app.svg"})})),this.openPortToPublic=globalThis.backendaiclient._config.openPortToPublic;const n=this.shadowRoot.querySelector("#app-dialog");n.setAttribute("session-uuid",e),n.setAttribute("access-key",i),this.shadowRoot.querySelector("#app-dialog").show()}_hideAppLauncher(){this.shadowRoot.querySelector("#app-dialog").hide()}async _open_wsproxy(t,e="jupyter",i=null){if(void 0===globalThis.backendaiclient||null===globalThis.backendaiclient||!1===globalThis.backendaiclient.ready)return!1;let r=this.shadowRoot.querySelector("#chk-open-to-public"),n=!1;null==r||(n=r.checked,r.checked=!1);let o={endpoint:globalThis.backendaiclient._config.endpoint};if("SESSION"===globalThis.backendaiclient._config.connectionMode?(o.mode="SESSION",o.session=globalThis.backendaiclient._config._session_id):(o.mode="DEFAULT",o.access_key=globalThis.backendaiclient._config.accessKey,o.secret_key=globalThis.backendaiclient._config.secretKey),o.api_version=globalThis.backendaiclient.APIMajorVersion,globalThis.isElectron&&void 0===globalThis.__local_proxy)return this.indicator.end(),this.notification.text="Proxy is not ready yet. Check proxy settings for detail.",this.notification.show(),Promise.resolve(!1);let s={method:"PUT",body:JSON.stringify(o),headers:{Accept:"application/json","Content-Type":"application/json"},uri:this._getProxyURL()+"conf"};this.indicator.set(20,"Setting up proxy for the app...");try{const r=await this.sendRequest(s);if(void 0===r)return this.indicator.end(),this.notification.text="Proxy configurator is not responding.",this.notification.show(),Promise.resolve(!1);let o=r.token,a=this._getProxyURL()+`proxy/${o}/${t}/add?app=${e}`;null!==i&&i>1024&&i<65535&&(a+="&port="+i),n&&(a+="&open_to_public=true"),this.indicator.set(50,"Adding kernel to socket queue...");const l={method:"GET",app:e,uri:a};return await this.sendRequest(l)}catch(t){throw t}}async _runAppWithParameters(t){let e=t["session-uuid"],i=t["url-postfix"],r=t["app-name"];if(null!=r&&(null==i&&(i=""),void 0===globalThis.backendaiwsproxy||null===globalThis.backendaiwsproxy)){this._hideAppLauncher(),this.indicator=await globalThis.lablupIndicator.start();let t=null;globalThis.isElectron&&"sshd"===r&&(t=globalThis.backendaioptions.get("custom_ssh_port",0),"0"!==t&&0!==t||(t=null)),this._open_wsproxy(e,r,t).then((t=>{t.url&&(this.indicator.set(100,"Prepared."),setTimeout((()=>{globalThis.open(t.url+i,"_blank"),console.log(r+" proxy loaded: "),console.log(e)}),1e3))}))}}async _runThisAppWithConfirmationIfNeeded(t){const e=t.target["app-name"];if(!this.appLaunchBeforeTunneling.includes(e))return this._runThisApp(t);{const e=t.target;this.appController["app-name"]=e["app-name"];let i=e.closest("#app-dialog");this.appController["session-uuid"]=i.getAttribute("session-uuid"),this.appController["url-postfix"]=e["url-postfix"],this._openAppLaunchConfirmationDialog(t)}}async _runThisApp(t){const e=t.target;this.appController["app-name"]=e["app-name"];let i=e.closest("#app-dialog");return this.appController["session-uuid"]=i.getAttribute("session-uuid"),this.appController["url-postfix"]=e["url-postfix"],this._runApp(this.appController)}async _runApp(t){let e=t["app-name"],i=t["session-uuid"],r=t["url-postfix"];if(null!=e){if(null==r&&(r=""),"ttyd"===e){let t=localStorage.getItem("backendaiconsole.terminalguide");t&&"true"!==t||this._openTerminalGuideDialog()}if(void 0===globalThis.backendaiwsproxy||null===globalThis.backendaiwsproxy){let t;this._hideAppLauncher(),this.indicator=await globalThis.lablupIndicator.start(),globalThis.isElectron&&"sshd"===e&&(t=globalThis.backendaioptions.get("custom_ssh_port",0),"0"!==t&&0!==t||(t=null));const n=this.shadowRoot.querySelector("#chk-preferred-port").checked,o=parseInt(this.shadowRoot.querySelector("#app-port").value);n&&o&&(t=o),this._open_wsproxy(i,e,t).then((t=>{"sshd"===e?(this.indicator.set(100,"Prepared."),this.sshPort=t.port,this._readSSHKey(i),this._openSSHDialog(),setTimeout((()=>{this.indicator.end()}),1e3)):"vnc"===e?(this.indicator.set(100,"Prepared."),this.vncPort=t.port,this._openVNCDialog()):t.url&&(this.indicator.set(100,"Prepared."),setTimeout((()=>{globalThis.open(t.url+r,"_blank"),console.log(e+" proxy loaded: "),console.log(i)}),1e3))}))}}}async _readSSHKey(t){const e=this.shadowRoot.querySelector("#sshkey-download-link"),i=await globalThis.backendaiclient.download_single(t,"/home/work/id_container"),r=(await i.text()).indexOf("-----"),n=await i.slice(r,i.size,i.type);e.href=globalThis.URL.createObjectURL(n),e.download="id_container"}async runTerminal(t){let e=localStorage.getItem("backendaiconsole.terminalguide");e&&"true"!==e||this._openTerminalGuideDialog(),null!=globalThis.backendaiwsproxy&&null!=globalThis.backendaiwsproxy||(this.indicator=await globalThis.lablupIndicator.start(),this._open_wsproxy(t,"ttyd").then((e=>{e.url&&(this.indicator.set(100,"Prepared."),setTimeout((()=>{globalThis.open(e.url,"_blank"),this.indicator.end(),console.log("Terminal proxy loaded: "),console.log(t)}),1e3))})))}_openAppLaunchConfirmationDialog(t){this.shadowRoot.querySelector("#app-launch-confirmation-dialog").show()}_openSSHDialog(){this.shadowRoot.querySelector("#ssh-dialog").show()}_openVNCDialog(){this.shadowRoot.querySelector("#vnc-dialog").show()}_openTerminalGuideDialog(){this.shadowRoot.querySelector("#terminal-guide").show()}_createDonotShowOption(){let t=this.shadowRoot.querySelector("#terminal-guide");const e=t.children[t.children.length-1],i=document.createElement("div");i.setAttribute("class","horizontal layout flex");const r=document.createElement("wl-checkbox");r.setAttribute("id","hide-guide");const n=document.createElement("wl-label");n.innerHTML=""+p("dialog.hide.DonotShowThisAgain"),i.appendChild(r),i.appendChild(n),e.appendChild(i)}_createTerminalGuide(){const t=this.shadowRoot.querySelector("#terminal-guide").children[1],e=document.createElement("div");e.setAttribute("class","vertical layout flex");let i=globalThis.backendaioptions.get("current_language");["ko","en"].includes(i)||(i="en"),e.innerHTML=`\n      <macro-carousel pagination navigation selected="0" auto-focus reduced-motion disable-drag>\n        <article class="slide vertical layout center">\n          <span class="flex" style="background-image:url(/resources/images/web-terminal-guide-1.png); border:auto;">\n            <wl-label class="keyboard">Ctrl</wl-label>\n            <wl-label class="keyboard invert">+</wl-label>\n            <wl-label class="keyboard one-key">B</wl-label>\n          </span>\n          <p>${p("webTerminalUsageGuide.CopyGuideOne")}</p>\n        </article>\n        <article class="slide vertical layout center">\n          <span style="background-image:url(/resources/images/web-terminal-guide-2.png);"></span>\n          <p>${p("webTerminalUsageGuide.CopyGuideTwo")}</p>\n        </article>\n        <article class="slide vertical layout center">\n          <span style="background-image:url(/resources/images/web-terminal-guide-3.png);"></span>\n          <p>${p("webTerminalUsageGuide.CopyGuideThree")}</p>\n        </article>\n        <article class="slide vertical layout center">\n          <span style="background-image:url(/resources/images/web-terminal-guide-4.png);">\n            <wl-label class="keyboard">Ctrl</wl-label>\n            <wl-label class="keyboard invert">+</wl-label>\n            <wl-label class="keyboard one-key">B</wl-label>\n          </span>\n          <div class="flex layout center-justified vertical center">\n            <p>${p("webTerminalUsageGuide.CopyGuideFour")}</p>\n            <a href="https://console.docs.backend.ai/${i}/latest/session_use/session_use.html#advanced-web-terminal-usage"\n               target="_blank" style="width:100%;text-align:right;">\n              <p>${p("webTerminalUsageGuide.LearnMore")}</p>\n            </a>\n          </div>\n        </article>\n      </macro-carousel>`,t.appendChild(e)}render(){return Z`
      <backend-ai-dialog id="app-dialog" fixed backdrop>
        <span slot="title">App</span>
        <div slot="content">
          <div style="padding:15px;" class="horizontal layout wrap center start-justified">
            ${this.appSupportList.map((t=>Z`
              <div class="vertical layout center center-justified app-icon">
                <mwc-icon-button class="fg apps green" .app="${t.name}" .app-name="${t.name}"
                                 .url-postfix="${t.redirect}"
                                 @click="${t=>this._runThisAppWithConfirmationIfNeeded(t)}">
                  <img src="${t.src}" />
                </mwc-icon-button>
                <span class="label">${t.title}</span>
              </div>
            `))}
          </div>
          <div style="padding:10px 20px 0 20px">
            ${globalThis.isElectron||!this.openPortToPublic?"":Z`
              <div class="horizontal layout center">
                <wl-checkbox id="chk-open-to-public" style="margin-right:0.5em"></wl-checkbox>
                ${rt("session.OpenToPublic")}
              </div>
            `}
            <div class="horizontal layout center">
              <wl-checkbox id="chk-preferred-port" style="margin-right:0.5em"></wl-checkbox>
              ${rt("session.TryPreferredPort")}
              <wl-textfield id="app-port" type="number" no-label-float value="10250"
                  min="1025" max="65534" style="margin-left:1em; width:70px"></wl-textfield>
            </div>
          </div>
        </div>
      </backend-ai-dialog>
      <backend-ai-dialog id="ssh-dialog" fixed backdrop>
        <span slot="title">SSH / SFTP connection</span>
        <div slot="content" style="padding:15px;">
          <div style="padding:15px 0;" >${rt("session.SFTPDescription")}</div>
          <section class="vertical layout wrap start start-justified">
            <h4>${rt("session.ConnectionInformation")}</h4>
            <div><span>SSH URL:</span> <a href="ssh://127.0.0.1:${this.sshPort}">ssh://127.0.0.1:${this.sshPort}</a></div>
            <div><span>SFTP URL:</span> <a href="sftp://127.0.0.1:${this.sshPort}">sftp://127.0.0.1:${this.sshPort}</a></div>
            <div><span>Port:</span> ${this.sshPort}</div>
            <a id="sshkey-download-link" style="margin-top:15px;" href="">
              <mwc-button class="fg apps green">${rt("DownloadSSHKey")}</mwc-button>
            </a>
          </section>
        </div>
      </backend-ai-dialog>
      <backend-ai-dialog id="vnc-dialog" fixed backdrop>
        <span slot="title">${rt("session.VNCconnection")}</span>
        <div slot="content" style="padding:15px;">
          <div style="padding:15px 0;">${rt("session.UseYourFavoriteSSHApp")}</div>
          <section class="vertical layout wrap start start-justified">
            <h4>${rt("session.ConnectionInformation")}</h4>
            <div><span>VNC URL:</span> <a href="ssh://127.0.0.1:${this.vncPort}">vnc://127.0.0.1:${this.vncPort}</a></div>
          </section>
        </div>
      </backend-ai-dialog>
      <backend-ai-dialog id="app-launch-confirmation-dialog" warning fixed backdrop>
        <span slot="title">${rt("session.applauncher.AppMustBeRun")}</span>
        <div slot="content" class="vertical layout">
          <p>${rt("session.applauncher.AppMustBeRunDialog")}</p>
          <p>${rt("dialog.ask.DoYouWantToProceed")}</p>
        </div>
        <div slot="footer" style="padding-top:0;margin:0 5px;">
          <mwc-button
          raised
          id="app-launch-confirmation-button"
          icon="rowing"
          label="${rt("session.applauncher.ConfirmAndRun")}"
          style="width:100%;"
          @click="${()=>this._runApp(this.appController)}">
          </mwc-button>
        </div>
      </backend-ai-dialog>
      <backend-ai-dialog id="terminal-guide" fixed backdrop>
        <span slot="title">${rt("webTerminalUsageGuide.CopyGuide")}</span>
        <div slot="content"></div>
        <div slot="footer"></div>
      </backend-ai-dialog>
      `}};r([yt({type:Boolean})],Vo.prototype,"active",void 0),r([yt({type:String})],Vo.prototype,"condition",void 0),r([yt({type:Object})],Vo.prototype,"jobs",void 0),r([yt({type:Array})],Vo.prototype,"appSupportList",void 0),r([yt({type:Object})],Vo.prototype,"appTemplate",void 0),r([yt({type:Object})],Vo.prototype,"imageInfo",void 0),r([yt({type:Array})],Vo.prototype,"_selected_items",void 0),r([yt({type:Boolean})],Vo.prototype,"refreshing",void 0),r([yt({type:Object})],Vo.prototype,"notification",void 0),r([yt({type:Object})],Vo.prototype,"spinner",void 0),r([yt({type:Object})],Vo.prototype,"refreshTimer",void 0),r([yt({type:Object})],Vo.prototype,"kernel_labels",void 0),r([yt({type:Object})],Vo.prototype,"indicator",void 0),r([yt({type:Number})],Vo.prototype,"sshPort",void 0),r([yt({type:Number})],Vo.prototype,"vncPort",void 0),r([yt({type:Array})],Vo.prototype,"appLaunchBeforeTunneling",void 0),r([yt({type:Object})],Vo.prototype,"appController",void 0),r([yt({type:Object})],Vo.prototype,"openPortToPublic",void 0),Vo=r([bt("backend-ai-app-launcher")],Vo);let Wo=class extends Un{constructor(){super(),this.supports=Object(),this.supportImages=Object(),this.imageRequirements=Object(),this.aliases=Object(),this.tags=Object(),this.imageInfo=Object(),this.imageNames=Object(),this.resourceLimits=Object(),this.userResourceLimit=Object(),this.icons=Object(),this.kernel="",this.gpu_modes=[],this.gpu_step=.05,this.cpu_metric={min:"1",max:"1"},this.mem_metric={min:"1",max:"1"},this.shmem_metric={min:.0625,max:1,preferred:.0625},this.cuda_device_metric={min:0,max:0},this.rocm_device_metric={min:"0",max:"0"},this.tpu_device_metric={min:"1",max:"1"},this.lastQueryTime=0,this.lastResourcePolicyQueryTime=0,this.lastVFolderQueryTime=0,this.aggregate_updating=!1,this._default_language_updated=!1,this._default_version_updated=!1,this._GPUmodeUpdated=!1,this.allow_project_resource_monitor=!1,this.max_cpu_core_per_session=64,this.active=!1,this.init_resource()}static get is(){return"backend-ai-resource-broker"}static get styles(){return[]}init_resource(){this.languages=[],this.total_slot={},this.total_resource_group_slot={},this.total_project_slot={},this.used_slot={},this.used_resource_group_slot={},this.used_project_slot={},this.available_slot={},this.used_slot_percent={},this.used_resource_group_slot_percent={},this.used_project_slot_percent={},this.resource_templates=[],this.resource_templates_filtered=[],this.vfolders=[],this.default_language="",this.concurrency_used=0,this.concurrency_max=0,this.concurrency_limit=0,this.scaling_groups=[{name:""}],this.scaling_group="",this.current_user_group="",this.sessions_list=[],this.metric_updating=!1,this.metadata_updating=!1,this.image_updating=!0,this.disableLaunch=[]}firstUpdated(){fetch("resources/image_metadata.json").then((t=>t.json())).then((t=>{this.imageInfo=t.imageInfo;for(let t in this.imageInfo)this.tags[t]=[],"name"in this.imageInfo[t]&&(this.aliases[t]=this.imageInfo[t].name,this.imageNames[t]=this.imageInfo[t].name),"icon"in this.imageInfo[t]?this.icons[t]=this.imageInfo[t].icon:this.icons[t]="default.png","label"in this.imageInfo[t]&&this.imageInfo[t].label.forEach((e=>{"category"in e||this.tags[t].push(e)}));void 0===globalThis.backendaiclient||null===globalThis.backendaiclient||!1===globalThis.backendaiclient.ready?document.addEventListener("backend-ai-connected",(()=>{this._refreshImageList()}),{once:!0}):this._refreshImageList()})),document.addEventListener("backend-ai-resource-refreshed",(()=>{this.active&&!1===this.metadata_updating&&(this.metadata_updating=!0,this.aggregateResource("resource-refreshed"),this.metadata_updating=!1)})),document.addEventListener("backend-ai-group-changed",(t=>{this._updatePageVariables(!0)}))}_initAliases(){for(let t in this.aliases)this.aliases[this.aliases[t]]=t}async updateScalingGroup(t=!1,e){""!=this.scaling_group&&""!==e&&e!==this.scaling_group&&(this.scaling_group=e,this.active&&(this.lastQueryTime=0,!0===t&&await this._refreshResourcePolicy()))}async _viewStateChanged(t){await this.updateComplete,this.active&&(void 0===globalThis.backendaiclient||null===globalThis.backendaiclient||!1===globalThis.backendaiclient.ready?document.addEventListener("backend-ai-connected",(()=>{this.allow_project_resource_monitor=globalThis.backendaiclient._config.allow_project_resource_monitor,this._updatePageVariables(!0)}),{once:!0}):(this.allow_project_resource_monitor=globalThis.backendaiclient._config.allow_project_resource_monitor,await this._updatePageVariables(!0)))}async _updatePageVariables(t){if(!1===this.metadata_updating){if(this.metadata_updating=!0,t&&(this.lastQueryTime=0),""===this.scaling_group||t){""===this.current_user_group&&(this.current_user_group=globalThis.backendaiclient.current_group);const t=await globalThis.backendaiclient.scalingGroup.list(this.current_user_group);this.scaling_groups=t.scaling_groups.length>0?t.scaling_groups:[{name:""}],this.scaling_group=this.scaling_groups[0].name}let e=["created_at"];await globalThis.backendaiclient.computeSession.list(e=e,status="RUNNING",null,1e3).then((t=>{!t.compute_session_list&&t.legacy_compute_session_list&&(t.compute_session_list=t.legacy_compute_session_list),this.sessions_list=t.compute_session_list.items.map((t=>t.created_at))})),this._initAliases(),await this._refreshResourcePolicy(),this.aggregateResource("update-page-variable"),this.metadata_updating=!1;let i=new CustomEvent("backend-ai-resource-broker-updated",{detail:""});return document.dispatchEvent(i),Promise.resolve(!0)}return Promise.resolve(!1)}_refreshConcurrency(){return globalThis.backendaiclient.keypair.info(globalThis.backendaiclient._config.accessKey,["concurrency_used"]).then((t=>{this.concurrency_used=t.keypair.concurrency_used}))}async _refreshResourcePolicy(){return Date.now()-this.lastResourcePolicyQueryTime<2e3?Promise.resolve(!1):(this.lastResourcePolicyQueryTime=Date.now(),globalThis.backendaiclient.keypair.info(globalThis.backendaiclient._config.accessKey,["resource_policy","concurrency_used"]).then((t=>{let e=t.keypair.resource_policy;return this.concurrency_used=t.keypair.concurrency_used,globalThis.backendaiclient.resourcePolicy.get(e,["default_for_unspecified","total_resource_slots","max_concurrent_sessions","max_containers_per_session"])})).then((t=>{let e=t.keypair_resource_policy;return this.userResourceLimit=JSON.parse(t.keypair_resource_policy.total_resource_slots),this.concurrency_max=e.max_concurrent_sessions,this._updateGPUMode()})).catch((t=>{throw this.metadata_updating=!1,t})))}_updateGPUMode(){return this._GPUmodeUpdated?Promise.resolve(!0):(this._GPUmodeUpdated=!0,globalThis.backendaiclient.get_resource_slots().then((t=>{let e=t;["cuda.device","cuda.shares","rocm.device","tpu.device"].forEach((t=>{t in e&&!this.gpu_modes.includes(t)&&(this.gpu_mode=t,this.gpu_modes.push(t),this.gpu_step="cuda.shares"===t?.05:1)})),void 0===this.gpu_mode&&(this.gpu_mode="none")})))}generateSessionId(){for(var t="",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=0;i<8;i++)t+=e.charAt(Math.floor(Math.random()*e.length));return t+"-console"}async updateVirtualFolderList(){if(Date.now()-this.lastVFolderQueryTime<2e3)return Promise.resolve(!1);return globalThis.backendaiclient.vfolder.list(globalThis.backendaiclient.current_group_id()).then((t=>{this.lastVFolderQueryTime=Date.now();let e=[],i=[];t.forEach((t=>{t.name.startsWith(".")?(t.disabled=!0,t.name=t.name+" (Automount folder)",i.push(t)):e.push(t)})),this.vfolders=e.concat(i)}))}async _aggregateCurrentResource(t=""){if(this.aggregate_updating)return Promise.resolve(!1);if(Date.now()-this.lastQueryTime<1e3)return Promise.resolve(!1);this.aggregate_updating=!0;let e={},i={},r={};return globalThis.backendaiclient.keypair.info(globalThis.backendaiclient._config.accessKey,["concurrency_used"]).then((async t=>{this.concurrency_used=t.keypair.concurrency_used,""===this.current_user_group&&(this.current_user_group=globalThis.backendaiclient.current_group);const e={group:globalThis.backendaiclient.current_group};if(this.current_user_group!==globalThis.backendaiclient.current_group||0==this.scaling_groups.length||1===this.scaling_groups.length&&""===this.scaling_groups[0].name){this.current_user_group=globalThis.backendaiclient.current_group;const t=await globalThis.backendaiclient.scalingGroup.list(this.current_user_group);this.scaling_groups=t.scaling_groups.length>0?t.scaling_groups:[{name:""}]}if(this.scaling_groups.length>0){let t=[];this.scaling_groups.map((e=>{t.push(e.name)})),""!==this.scaling_group&&t.includes(this.scaling_group)||(this.scaling_group=this.scaling_groups[0].name),e.scaling_group=this.scaling_group}return globalThis.backendaiclient.resourcePreset.check(e)})).then((t=>{if(t.presets){let e=t.presets,i=[];e.forEach((t=>{!0===t.allocatable&&("cuda.shares"in t.resource_slots?t.cuda_shares=t.resource_slots["cuda.shares"]:"cuda.device"in t.resource_slots&&(t.cuda_device=t.resource_slots["cuda.device"]),"rocm.device"in t.resource_slots&&(t.rocm_device=t.resource_slots["rocm.device"]),"tpu.device"in t.resource_slots&&(t.tpu_device=t.resource_slots["tpu.device"]),t.cpu=t.resource_slots.cpu,t.mem=globalThis.backendaiclient.utils.changeBinaryUnit(t.resource_slots.mem,"g"),t.shared_memory?t.shmem=globalThis.backendaiclient.utils.changeBinaryUnit(t.shared_memory,"g"):t.shmem=null,i.push(t))})),i.sort(((t,e)=>t.name>e.name?1:-1)),this.resource_templates=i,0===this.resource_templates_filtered.length&&(this.resource_templates_filtered=this.resource_templates)}let n=t.keypair_remaining,o=t.keypair_using,s=t.group_limits,a=t.group_using,l={"cuda.device":"cuda_device","cuda.shares":"cuda_shares","rocm.device":"rocm_device","tpu.device":"tpu_device"};if(""===this.scaling_group&&this.scaling_groups.length>0)t.scaling_groups[""]={using:{cpu:0,mem:0},remaining:{cpu:0,mem:0}};else if(0===this.scaling_groups.length)return this.aggregate_updating=!1,Promise.resolve(!1);let d=t.scaling_groups[this.scaling_group].using,c=t.scaling_groups[this.scaling_group].remaining,h=t.keypair_limits;"cpu"in h&&(i.cpu=Number(c.cpu)+Number(d.cpu),r.cpu=Number(s.cpu),"Infinity"===h.cpu?e.cpu=i.cpu:e.cpu=h.cpu),"mem"in h&&(i.mem=parseFloat(globalThis.backendaiclient.utils.changeBinaryUnit(c.mem,"g"))+parseFloat(globalThis.backendaiclient.utils.changeBinaryUnit(d.mem,"g")),r.mem=parseFloat(globalThis.backendaiclient.utils.changeBinaryUnit(s.mem,"g")),"Infinity"===h.mem?e.mem=i.mem:e.mem=parseFloat(globalThis.backendaiclient.utils.changeBinaryUnit(h.mem,"g"))),e.mem=e.mem.toFixed(2),i.mem=i.mem.toFixed(2);for(let[t,n]of Object.entries(l))t in h&&(i[n]=Number(c[t])+Number(d[t]),r[n]=Number(s[t]),"Infinity"===h[t]?e[n]=i[n]:e[n]=h[t]);let u=Object(),p=Object(),f=Object(),m=Object(),g=Object();"cpu"in n&&(p.cpu="cpu"in o?o.cpu:0,"Infinity"===n.cpu?u.cpu=e.cpu-p.cpu:u.cpu=n.cpu),"cpu"in c&&(m.cpu="cpu"in d?d.cpu:0,f.cpu=c.cpu),g.cpu="cpu"in a?a.cpu:0,"mem"in n&&(p.mem="mem"in o?parseFloat(globalThis.backendaiclient.utils.changeBinaryUnit(o.mem,"g")):0,"Infinity"===n.mem?u.mem=e.mem-p.mem:u.mem=parseFloat(globalThis.backendaiclient.utils.changeBinaryUnit(n.mem,"g"))),p.mem=p.mem.toFixed(2),"mem"in c&&(m.mem="mem"in d?parseFloat(globalThis.backendaiclient.utils.changeBinaryUnit(d.mem,"g")):0,f.mem=parseFloat(globalThis.backendaiclient.utils.changeBinaryUnit(c.mem,"g"))),m.mem=m.mem.toFixed(2),g.mem="mem"in a?parseFloat(globalThis.backendaiclient.utils.changeBinaryUnit(a.mem,"g")):0,g.mem=g.mem.toFixed(2);for(let[t,e]of Object.entries(l))t in n&&(u[e]=n[t],p[e]=t in o?o[t]:0),t in c&&(f[e]=c[t],m[e]=t in d?d[t]:0),g[e]=t in a?a[t]:0;"cuda_shares"in p&&(e.cuda_shares=parseFloat(e.cuda_shares).toFixed(2)),"cuda_shares"in m&&(i.cuda_shares=parseFloat(i.cuda_shares).toFixed(2)),"cuda_shares"in g&&(r.cuda_shares=parseFloat(r.cuda_shares).toFixed(2)),this.total_slot=e,this.total_resource_group_slot=i,this.total_project_slot=r,this.used_slot=p,this.used_resource_group_slot=m,this.used_project_slot=g;let b={},v={},y={};return["cpu","mem","cuda_device","cuda_shares","rocm_device","tpu_device"].forEach((t=>{t in p&&(Number(e[t])<Number(p[t])&&(e[t]=p[t]),0!=e[t]?b[t]=p[t]/e[t]*100:b[t]=0,0!=i[t]?v[t]=m[t]/i[t]*100:v[t]=0,0!=r[t]?y[t]=g[t]/r[t]*100:y[t]=0),t in u&&"Infinity"===u[t]&&(u[t]=f[t])})),this.used_project_slot_percent=y,0===this.concurrency_max?(b.concurrency=0,u.concurrency=this.concurrency_max):(b.concurrency=this.concurrency_used/this.concurrency_max*100,u.concurrency=this.concurrency_max-this.concurrency_used),this.concurrency_limit=Math.min(u.concurrency,5),this.available_slot=f,this.used_slot_percent=b,this.used_resource_group_slot_percent=v,this.lastQueryTime=Date.now(),this.aggregate_updating=!1,Promise.resolve(!0)})).catch((t=>{throw this.lastQueryTime=Date.now(),this.aggregate_updating=!1,t}))}aggregateResource(t=""){void 0===globalThis.backendaiclient||null===globalThis.backendaiclient||!1===globalThis.backendaiclient.ready?document.addEventListener("backend-ai-connected",(()=>{this._aggregateCurrentResource(t)}),!0):this._aggregateCurrentResource(t)}async _refreshImageList(){return globalThis.backendaiclient.image.list(["name","humanized_name","tag","registry","digest","installed","resource_limits { key min max }","labels { key value }"],!0,!1).then((t=>{0!==t.images.length&&(this.images=t.images,this.supports={},this.supportImages={},this.imageRequirements={},Object.keys(this.images).map(((t,e)=>{const i=this.images[t],r=`${i.registry}/${i.name}`;let n;r in this.supports||(this.supports[r]=[]),this.supports[r].push(i.tag);let o=i.name.split("/");n=1===o.length?o[0]:o[1],this.supportImages[r]=this.imageInfo[n]||{name:"Custom Environments",description:"Custom-built images.",group:"Custom Environments",tags:[],label:[{category:"Custom",tag:"Custom",color:"black"}]},"group"in this.supportImages[r]||(this.supportImages[r].group="Custom Environments"),this.resourceLimits[`${r}:${i.tag}`]=i.resource_limits,this.imageRequirements[`${r}:${i.tag}`]={},i.labels.forEach((t=>{"com.nvidia.tensorflow.version"===t.key&&(this.imageRequirements[`${r}:${i.tag}`].framework="TensorFlow "+t.value),"com.nvidia.pytorch.version"===t.key&&(this.imageRequirements[`${r}:${i.tag}`].framework="PyTorch "+t.value)}))})),this._updateEnvironment())})).catch((t=>{throw this.metadata_updating=!1,t}))}_guessHumanizedNames(t){const e=this.imageNames;let i="",r=null,n="abcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*()";return Object.keys(e).forEach(((o,s)=>{let a=t.split("/");i=2==a.length?a[1]:a[2],(i===o||""===i&&t.endsWith(o)&&o.length<n.length)&&(r=e[o],n=o)})),r}_updateEnvironment(){const t=Object.keys(this.supports);if(void 0===t)return;t.sort(((t,e)=>this.supportImages[t].group>this.supportImages[e].group?1:-1));let e="";this.languages=[],t.forEach(((t,i)=>{if(!Object.keys(this.aliases).includes(t)){const e=this._guessHumanizedNames(t);this.aliases[t]=null!==e?e:t}let r,n,o=t.split("/"),s=o[0];2==o.length?(r="",n=o[1]):(r=o[1],n=o[2]);let a,l=this.aliases[t];a=void 0!==l?l.split(" (")[0]:n,l=l.split("/").slice(-1)[0],a=a.split("/").slice(-1)[0];let d=[];n in this.tags&&(d=d.concat(this.tags[n])),""!=r&&"lablup"!=r&&d.push({tag:r,color:"purple"});let c="default.png";n in this.icons&&(c=this.icons[n]),e!==this.supportImages[t].group&&(this.languages.push({name:"",registry:"",prefix:"",kernelname:"",alias:"",icon:"",basename:this.supportImages[t].group,tags:[],clickable:!1}),e=this.supportImages[t].group),this.languages.push({name:t,registry:s,prefix:r,kernelname:n,alias:l,basename:a,tags:d,icon:c})})),this.image_updating=!1}async initDefaultLanguage(){if(!this._default_language_updated)return void 0!==globalThis.backendaiclient._config.default_session_environment&&"default_session_environment"in globalThis.backendaiclient._config&&""!==globalThis.backendaiclient._config.default_session_environment?this.default_language=globalThis.backendaiclient._config.default_session_environment:this.languages.length>1?this.default_language=this.languages[1].name:0!==this.languages.length?this.default_language=this.languages[0].name:this.default_language="index.docker.io/lablup/ngc-tensorflow",this._default_language_updated=!0,this.default_language}render(){return Z``}};r([yt({type:Object})],Wo.prototype,"supports",void 0),r([yt({type:Object})],Wo.prototype,"images",void 0),r([yt({type:Object})],Wo.prototype,"supportImages",void 0),r([yt({type:Object})],Wo.prototype,"imageRequirements",void 0),r([yt({type:Object})],Wo.prototype,"aliases",void 0),r([yt({type:Object})],Wo.prototype,"tags",void 0),r([yt({type:Object})],Wo.prototype,"imageInfo",void 0),r([yt({type:Object})],Wo.prototype,"imageNames",void 0),r([yt({type:Object})],Wo.prototype,"resourceLimits",void 0),r([yt({type:Object})],Wo.prototype,"userResourceLimit",void 0),r([yt({type:Object})],Wo.prototype,"icons",void 0),r([yt({type:String})],Wo.prototype,"kernel",void 0),r([yt({type:Array})],Wo.prototype,"versions",void 0),r([yt({type:Array})],Wo.prototype,"languages",void 0),r([yt({type:String})],Wo.prototype,"gpu_mode",void 0),r([yt({type:Array})],Wo.prototype,"gpu_modes",void 0),r([yt({type:Number})],Wo.prototype,"gpu_step",void 0),r([yt({type:Object})],Wo.prototype,"total_slot",void 0),r([yt({type:Object})],Wo.prototype,"total_resource_group_slot",void 0),r([yt({type:Object})],Wo.prototype,"total_project_slot",void 0),r([yt({type:Object})],Wo.prototype,"used_slot",void 0),r([yt({type:Object})],Wo.prototype,"used_resource_group_slot",void 0),r([yt({type:Object})],Wo.prototype,"used_project_slot",void 0),r([yt({type:Object})],Wo.prototype,"available_slot",void 0),r([yt({type:Number})],Wo.prototype,"concurrency_used",void 0),r([yt({type:Number})],Wo.prototype,"concurrency_max",void 0),r([yt({type:Number})],Wo.prototype,"concurrency_limit",void 0),r([yt({type:Array})],Wo.prototype,"vfolders",void 0),r([yt({type:Object})],Wo.prototype,"used_slot_percent",void 0),r([yt({type:Object})],Wo.prototype,"used_resource_group_slot_percent",void 0),r([yt({type:Object})],Wo.prototype,"used_project_slot_percent",void 0),r([yt({type:Array})],Wo.prototype,"resource_templates",void 0),r([yt({type:Array})],Wo.prototype,"resource_templates_filtered",void 0),r([yt({type:String})],Wo.prototype,"default_language",void 0),r([yt({type:Object})],Wo.prototype,"cpu_metric",void 0),r([yt({type:Object})],Wo.prototype,"mem_metric",void 0),r([yt({type:Object})],Wo.prototype,"shmem_metric",void 0),r([yt({type:Object})],Wo.prototype,"cuda_device_metric",void 0),r([yt({type:Object})],Wo.prototype,"cuda_shares_metric",void 0),r([yt({type:Object})],Wo.prototype,"rocm_device_metric",void 0),r([yt({type:Object})],Wo.prototype,"tpu_device_metric",void 0),r([yt({type:Number})],Wo.prototype,"lastQueryTime",void 0),r([yt({type:Number})],Wo.prototype,"lastResourcePolicyQueryTime",void 0),r([yt({type:Number})],Wo.prototype,"lastVFolderQueryTime",void 0),r([yt({type:String})],Wo.prototype,"scaling_group",void 0),r([yt({type:String})],Wo.prototype,"current_user_group",void 0),r([yt({type:Array})],Wo.prototype,"scaling_groups",void 0),r([yt({type:Array})],Wo.prototype,"sessions_list",void 0),r([yt({type:Boolean})],Wo.prototype,"metric_updating",void 0),r([yt({type:Boolean})],Wo.prototype,"metadata_updating",void 0),r([yt({type:Boolean})],Wo.prototype,"aggregate_updating",void 0),r([yt({type:Boolean})],Wo.prototype,"image_updating",void 0),r([yt({type:Boolean})],Wo.prototype,"_default_language_updated",void 0),r([yt({type:Boolean})],Wo.prototype,"_default_version_updated",void 0),r([yt({type:Boolean})],Wo.prototype,"_GPUmodeUpdated",void 0),r([yt({type:Boolean})],Wo.prototype,"allow_project_resource_monitor",void 0),r([yt({type:Array})],Wo.prototype,"disableLaunch",void 0),r([yt({type:Number})],Wo.prototype,"max_cpu_core_per_session",void 0),Wo=r([bt("backend-ai-resource-broker")],Wo),function(t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).ai=t()}((function(){for(var t=function(t){var e;return function(i){return e||t(e={exports:{},parent:i},e.exports),e.exports}},e=t((function(t,e){(function(e,n){(function(){var a;t.exports=A,A.ReadableState=E,q.EventEmitter;var c,h=function(t,e){return t.listeners(e).length},u=d({}).Buffer,p=n.Uint8Array||function(){},f=l({});c=f&&f.debuglog?f.debuglog("stream"):function(){};var m,g,b,v=ft.getHighWaterMark,y=dt.codes,_=y.ERR_INVALID_ARG_TYPE,w=y.ERR_STREAM_PUSH_AFTER_EOF,x=y.ERR_METHOD_NOT_IMPLEMENTED,M=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;F(A,et);var k=lt.errorOrDestroy,S=["error","close","destroy","pause","resume"];function E(t,e,i){a=a||s({}),t=t||{},"boolean"!=typeof i&&(i=e instanceof a),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=v(this,t,"readableHighWaterMark",i),this.buffer=new at,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(m||(m=o({}).StringDecoder),this.decoder=new m(t.encoding),this.encoding=t.encoding)}function A(t){if(a=a||s({}),!(this instanceof A))return new A(t);var e=this instanceof a;this._readableState=new E(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),et.call(this)}function T(t,e,i,r,n){c("readableAddChunk",e);var o,s=t._readableState;if(null===e)s.reading=!1,function(t,e){if(c("onEofChunk"),!e.ended){if(e.decoder){var i=e.decoder.end();i&&i.length&&(e.buffer.push(i),e.length+=e.objectMode?1:i.length)}e.ended=!0,e.sync?R(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,O(t)))}}(t,s);else if(n||(o=function(t,e){var i,r;return r=e,u.isBuffer(r)||r instanceof p||"string"==typeof e||void 0===e||t.objectMode||(i=new _("chunk",["string","Buffer","Uint8Array"],e)),i}(s,e)),o)k(t,o);else if(s.objectMode||e&&e.length>0)if("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),r)s.endEmitted?k(t,new M):I(t,s,e,!0);else if(s.ended)k(t,new w);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!i?(e=s.decoder.write(e),s.objectMode||0!==e.length?I(t,s,e,!1):L(t,s)):I(t,s,e,!1)}else r||(s.reading=!1,L(t,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function I(t,e,i,r){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",i)):(e.length+=e.objectMode?1:i.length,r?e.buffer.unshift(i):e.buffer.push(i),e.needReadable&&R(t)),L(t,e)}function C(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function R(t){var i=t._readableState;c("emitReadable",i.needReadable,i.emittedReadable),i.needReadable=!1,i.emittedReadable||(c("emitReadable",i.flowing),i.emittedReadable=!0,e.nextTick(O,t))}function O(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,z(t)}function L(t,i){i.readingMore||(i.readingMore=!0,e.nextTick(P,t,i))}function P(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var i=e.length;if(c("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}function B(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function N(t){c("readable nexttick read 0"),t.read(0)}function $(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),z(t),e.flowing&&!e.reading&&t.read(0)}function z(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function j(t,e){return 0===e.length?null:(e.objectMode?i=e.buffer.shift():!t||t>=e.length?(i=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):i=e.buffer.consume(t,e.decoder),i);var i}function D(t){var i=t._readableState;c("endReadable",i.endEmitted),i.endEmitted||(i.ended=!0,e.nextTick(U,i,t))}function U(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var i=e._writableState;(!i||i.autoDestroy&&i.finished)&&e.destroy()}}function H(t,e){for(var i=0,r=t.length;i<r;i++)if(t[i]===e)return i;return-1}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),A.prototype.destroy=lt.destroy,A.prototype._undestroy=lt.undestroy,A.prototype._destroy=function(t,e){e(t)},A.prototype.push=function(t,e){var i,r=this._readableState;return r.objectMode?i=!0:"string"==typeof t&&((e=e||r.defaultEncoding)!==r.encoding&&(t=u.from(t,e),e=""),i=!0),T(this,t,e,!1,i)},A.prototype.unshift=function(t){return T(this,t,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(t){m||(m=o({}).StringDecoder);var e=new m(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var i=this._readableState.buffer.head,r="";null!==i;)r+=e.write(i.data),i=i.next;return this._readableState.buffer.clear(),""!==r&&this._readableState.buffer.push(r),this._readableState.length=r.length,this},A.prototype.read=function(t){c("read",t),t=parseInt(t,10);var e=this._readableState,i=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?D(this):R(this),null;if(0===(t=C(t,e))&&e.ended)return 0===e.length&&D(this),null;var r,n=e.needReadable;return c("need readable",n),(0===e.length||e.length-t<e.highWaterMark)&&c("length less than watermark",n=!0),e.ended||e.reading?c("reading or ended",n=!1):n&&(c("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=C(i,e))),null===(r=t>0?j(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),i!==t&&e.ended&&D(this)),null!==r&&this.emit("data",r),r},A.prototype._read=function(t){k(this,new x("_read()"))},A.prototype.pipe=function(t,i){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,c("pipe count=%d opts=%j",n.pipesCount,i);var o=i&&!1===i.end||t===e.stdout||t===e.stderr?m:s;function s(){c("onend"),t.end()}n.endEmitted?e.nextTick(o):r.once("end",o),t.on("unpipe",(function e(i,o){c("onunpipe"),i===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,c("cleanup"),t.removeListener("close",p),t.removeListener("finish",f),t.removeListener("drain",a),t.removeListener("error",u),t.removeListener("unpipe",e),r.removeListener("end",s),r.removeListener("end",m),r.removeListener("data",d),l=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||a())}));var a=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&h(t,"data")&&(e.flowing=!0,z(t))}}(r);t.on("drain",a);var l=!1;function d(e){c("ondata");var i=t.write(e);c("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==H(n.pipes,t))&&!l&&(c("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function u(e){c("onerror",e),m(),t.removeListener("error",u),0===h(t,"error")&&k(t,e)}function p(){t.removeListener("finish",f),m()}function f(){c("onfinish"),t.removeListener("close",p),m()}function m(){c("unpipe"),r.unpipe(t)}return r.on("data",d),function(t,e,i){if("function"==typeof t.prependListener)return t.prependListener("error",i);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(i):t._events.error=[i,t._events.error]:t.on("error",i)}(t,0,u),t.once("close",p),t.once("finish",f),t.emit("pipe",r),n.flowing||(c("pipe resume"),r.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,i={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,i)),this;if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=H(e.pipes,t);return-1===s||(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,i)),this},A.prototype.on=function(t,i){var r=et.prototype.on.call(this,t,i),n=this._readableState;return"data"===t?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,c("on readable",n.length,n.reading),n.length?R(this):n.reading||e.nextTick(N,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,i){var r=et.prototype.removeListener.call(this,t,i);return"readable"===t&&e.nextTick(B,this),r},A.prototype.removeAllListeners=function(t){var i=et.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||e.nextTick(B,this),i},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,i){i.resumeScheduled||(i.resumeScheduled=!0,e.nextTick($,t,i))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,i=this._readableState,r=!1;for(var n in t.on("end",(function(){if(c("wrapped end"),i.decoder&&!i.ended){var t=i.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(n){c("wrapped data"),i.decoder&&(n=i.decoder.write(n)),i.objectMode&&null==n||(i.objectMode||n&&n.length)&&(e.push(n)||(r=!0,t.pause()))})),t)void 0===this[n]&&"function"==typeof t[n]&&(this[n]=function(e){return function(){return t[e].apply(t,arguments)}}(n));for(var o=0;o<S.length;o++)t.on(S[o],this.emit.bind(this,S[o]));return this._read=function(e){c("wrapped _read",e),r&&(r=!1,t.resume())},this},"function"==typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===g&&(g=r({})),g(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),A._fromList=j,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(A.from=function(t,e){return void 0===b&&(b=i({})),b(A,t,e)})}).call(this)}).call(this,E,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})})),i=t((function(t,e){t.exports=function(){throw new Error("Readable.from is not available in the browser")}})),r=t((function(t,e){(function(e){(function(){var i;function r(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var o=n({}),s=Symbol("lastResolve"),a=Symbol("lastReject"),l=Symbol("error"),d=Symbol("ended"),c=Symbol("lastPromise"),h=Symbol("handlePromise"),u=Symbol("stream");function p(t,e){return{value:t,done:e}}function f(t){var e=t[s];if(null!==e){var i=t[u].read();null!==i&&(t[c]=null,t[s]=null,t[a]=null,e(p(i,!1)))}}var m=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((r(i={get stream(){return this[u]},next:function(){var t=this,i=this[l];if(null!==i)return Promise.reject(i);if(this[d])return Promise.resolve(p(void 0,!0));if(this[u].destroyed)return new Promise((function(i,r){e.nextTick((function(){t[l]?r(t[l]):i(p(void 0,!0))}))}));var r,n=this[c];if(n)r=new Promise(function(t,e){return function(i,r){t.then((function(){e[d]?i(p(void 0,!0)):e[h](i,r)}),r)}}(n,this));else{var o=this[u].read();if(null!==o)return Promise.resolve(p(o,!1));r=new Promise(this[h])}return this[c]=r,r}},Symbol.asyncIterator,(function(){return this})),r(i,"return",(function(){var t=this;return new Promise((function(e,i){t[u].destroy(null,(function(t){t?i(t):e(p(void 0,!0))}))}))})),i),m);t.exports=function(t){var i,n=Object.create(g,(r(i={},u,{value:t,writable:!0}),r(i,s,{value:null,writable:!0}),r(i,a,{value:null,writable:!0}),r(i,l,{value:null,writable:!0}),r(i,d,{value:t._readableState.endEmitted,writable:!0}),r(i,h,{value:function(t,e){var i=n[u].read();i?(n[c]=null,n[s]=null,n[a]=null,t(p(i,!1))):(n[s]=t,n[a]=e)},writable:!0}),i));return n[c]=null,o(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=n[a];return null!==e&&(n[c]=null,n[s]=null,n[a]=null,e(t)),void(n[l]=t)}var i=n[s];null!==i&&(n[c]=null,n[s]=null,n[a]=null,i(p(void 0,!0))),n[d]=!0})),t.on("readable",function(t){e.nextTick(f,t)}.bind(null,n)),n}}).call(this)}).call(this,E)})),n=t((function(t,e){var i=dt.codes.ERR_STREAM_PREMATURE_CLOSE;function r(){}t.exports=function t(e,n,o){if("function"==typeof n)return t(e,null,n);n||(n={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var i=arguments.length,r=new Array(i),n=0;n<i;n++)r[n]=arguments[n];t.apply(this,r)}}}(o||r);var s=n.readable||!1!==n.readable&&e.readable,a=n.writable||!1!==n.writable&&e.writable,l=function(){e.writable||c()},d=e._writableState&&e._writableState.finished,c=function(){a=!1,d=!0,s||o.call(e)},h=e._readableState&&e._readableState.endEmitted,u=function(){s=!1,h=!0,a||o.call(e)},p=function(t){o.call(e,t)},f=function(){var t;return s&&!h?(e._readableState&&e._readableState.ended||(t=new i),o.call(e,t)):a&&!d?(e._writableState&&e._writableState.ended||(t=new i),o.call(e,t)):void 0},m=function(){e.req.on("finish",c)};return function(t){return t.setHeader&&"function"==typeof t.abort}(e)?(e.on("complete",c),e.on("abort",f),e.req?m():e.on("request",m)):a&&!e._writableState&&(e.on("end",l),e.on("close",l)),e.on("end",u),e.on("finish",c),!1!==n.error&&e.on("error",p),e.on("close",f),function(){e.removeListener("complete",c),e.removeListener("abort",f),e.removeListener("request",m),e.req&&e.req.removeListener("finish",c),e.removeListener("end",l),e.removeListener("close",l),e.removeListener("finish",c),e.removeListener("end",u),e.removeListener("error",p),e.removeListener("close",f)}}})),o=t((function(t,e){var i=y.Buffer,r=i.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(i.isEncoding===r||!r(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=a,this.end=l,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=d,this.end=c,e=3;break;default:return this.write=h,void(this.end=u)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,i=function(t,e,i){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==i?i:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function a(t,e){if((t.length-e)%2==0){var i=t.toString("utf16le",e);if(i){var r=i.charCodeAt(i.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function l(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,i)}return e}function d(t,e){var i=(t.length-e)%3;return 0===i?t.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,1===i?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-i))}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function u(t){return t&&t.length?this.write(t):""}e.StringDecoder=n,n.prototype.write=function(t){if(0===t.length)return"";var e,i;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<t.length?e?e+this.text(t,i):this.text(t,i):e||""},n.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},n.prototype.text=function(t,e){var i=function(t,e,i){var r=e.length-1;if(r<i)return 0;var n=o(e[r]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--r<i||-2===n?0:(n=o(e[r]))>=0?(n>0&&(t.lastNeed=n-2),n):--r<i||-2===n?0:(n=o(e[r]))>=0?(n>0&&(2===n?n=0:t.lastNeed=n-3),n):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=i;var r=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},n.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}})),s=t((function(t,i){(function(i){(function(){var r=Object.keys||function(t){var e=[];for(var i in t)e.push(i);return e};t.exports=c;var n=e({}),o=a({});F(c,n);for(var s=r(o.prototype),l=0;l<s.length;l++){var d=s[l];c.prototype[d]||(c.prototype[d]=o.prototype[d])}function c(t){if(!(this instanceof c))return new c(t);n.call(this,t),o.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",h)))}function h(){this._writableState.ended||i.nextTick(u,this)}function u(t){t.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})}).call(this)}).call(this,E)})),a=t((function(t,e){(function(e,i){(function(){function r(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,i){var r=t.entry;for(t.entry=null;r;){var n=r.callback;e.pendingcb--,n(void 0),r=r.next}e.corkedRequestsFree.next=t}(e,t)}}var n;t.exports=k,k.WritableState=M;var o,a={deprecate:mt},l=d({}).Buffer,c=i.Uint8Array||function(){},h=ft.getHighWaterMark,u=dt.codes,p=u.ERR_INVALID_ARG_TYPE,f=u.ERR_METHOD_NOT_IMPLEMENTED,m=u.ERR_MULTIPLE_CALLBACK,g=u.ERR_STREAM_CANNOT_PIPE,b=u.ERR_STREAM_DESTROYED,v=u.ERR_STREAM_NULL_VALUES,y=u.ERR_STREAM_WRITE_AFTER_END,_=u.ERR_UNKNOWN_ENCODING,w=lt.errorOrDestroy;function x(){}function M(t,i,o){n=n||s({}),t=t||{},"boolean"!=typeof o&&(o=i instanceof n),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,i){var r=t._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new m;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),i)!function(t,i,r,n,o){--i.pendingcb,r?(e.nextTick(o,n),e.nextTick(C,t,i),t._writableState.errorEmitted=!0,w(t,n)):(o(n),t._writableState.errorEmitted=!0,w(t,n),C(t,i))}(t,r,n,i,o);else{var s=T(r)||t.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||A(t,r),n?e.nextTick(E,t,r,s,o):E(t,r,s,o)}}(i,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function k(t){var e=this instanceof(n=n||s({}));if(!e&&!o.call(k,this))return new k(t);this._writableState=new M(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),et.call(this)}function S(t,e,i,r,n,o,s){e.writelen=r,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new b("write")):i?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function E(t,e,i,r){i||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),C(t,e)}function A(t,e){e.bufferProcessing=!0;var i=e.bufferedRequest;if(t._writev&&i&&i.next){var n=e.bufferedRequestCount,o=new Array(n),s=e.corkedRequestsFree;s.entry=i;for(var a=0,l=!0;i;)o[a]=i,i.isBuf||(l=!1),i=i.next,a+=1;o.allBuffers=l,S(t,e,!0,e.length,o,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new r(e),e.bufferedRequestCount=0}else{for(;i;){var d=i.chunk,c=i.encoding,h=i.callback;if(S(t,e,!1,e.objectMode?1:d.length,d,c,h),i=i.next,e.bufferedRequestCount--,e.writing)break}null===i&&(e.lastBufferedRequest=null)}e.bufferedRequest=i,e.bufferProcessing=!1}function T(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function I(t,e){t._final((function(i){e.pendingcb--,i&&w(t,i),e.prefinished=!0,t.emit("prefinish"),C(t,e)}))}function C(t,i){var r=T(i);if(r&&(function(t,i){i.prefinished||i.finalCalled||("function"!=typeof t._final||i.destroyed?(i.prefinished=!0,t.emit("prefinish")):(i.pendingcb++,i.finalCalled=!0,e.nextTick(I,t,i)))}(t,i),0===i.pendingcb&&(i.finished=!0,t.emit("finish"),i.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}F(k,et),M.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(M.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(t){return!!o.call(this,t)||this===k&&t&&t._writableState instanceof M}})):o=function(t){return t instanceof this},k.prototype.pipe=function(){w(this,new g)},k.prototype.write=function(t,i,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=t,l.isBuffer(n)||n instanceof c);return a&&!l.isBuffer(t)&&(t=function(t){return l.from(t)}(t)),"function"==typeof i&&(r=i,i=null),a?i="buffer":i||(i=o.defaultEncoding),"function"!=typeof r&&(r=x),o.ending?function(t,i){var r=new y;w(t,r),e.nextTick(i,r)}(this,r):(a||function(t,i,r,n){var o;return null===r?o=new v:"string"==typeof r||i.objectMode||(o=new p("chunk",["string","Buffer"],r)),!o||(w(t,o),e.nextTick(n,o),!1)}(this,o,t,r))&&(o.pendingcb++,s=function(t,e,i,r,n,o){if(!i){var s=function(t,e,i){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=l.from(e,i)),e}(e,r,n);r!==s&&(i=!0,n="buffer",r=s)}var a=e.objectMode?1:r.length;e.length+=a;var d=e.length<e.highWaterMark;if(d||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:n,isBuf:i,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else S(t,e,!1,a,r,n,o);return d}(this,o,a,t,i,r)),s},k.prototype.cork=function(){this._writableState.corked++},k.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||A(this,t))},k.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(t,e,i){i(new f("_write()"))},k.prototype._writev=null,k.prototype.end=function(t,i,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,i=null):"function"==typeof i&&(r=i,i=null),null!=t&&this.write(t,i),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,i,r){i.ending=!0,C(t,i),r&&(i.finished?e.nextTick(r):t.once("finish",r)),i.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),k.prototype.destroy=lt.destroy,k.prototype._undestroy=lt.undestroy,k.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,E,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})})),l=t((function(t,e){})),d=t((function(t,e){(function(t){(function(){function t(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,i){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return o(t)}return r(t,e,i)}function r(e,r,n){if("string"==typeof e)return function(e,r){if("string"==typeof r&&""!==r||(r="utf8"),!i.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var n=0|l(e,r),o=t(n),s=o.write(e,r);return s!==n&&(o=o.slice(0,s)),o}(e,r);if(ArrayBuffer.isView(e))return s(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(N(e,ArrayBuffer)||e&&N(e.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return(n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r)).__proto__=i.prototype,n}(e,r,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var o=e.valueOf&&e.valueOf();if(null!=o&&o!==e)return i.from(o,r,n);var d=function(e){if(i.isBuffer(e)){var r=0|a(e.length),n=t(r);return 0===n.length||e.copy(n,0,0,r),n}return void 0!==e.length?"number"!=typeof e.length||$(e.length)?t(0):s(e):"Buffer"===e.type&&Array.isArray(e.data)?s(e.data):void 0}(e);if(d)return d;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return i.from(e[Symbol.toPrimitive]("string"),r,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function n(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function o(e){return n(e),t(e<0?0:0|a(e))}function s(e){for(var i=e.length<0?0:0|a(e.length),r=t(i),n=0;n<i;n+=1)r[n]=255&e[n];return r}function a(t){if(t>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function l(t,e){if(i.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||N(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return P(t).length;default:if(o)return n?-1:L(t).length;e=(""+e).toLowerCase(),o=!0}}function d(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function h(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),$(r=+r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:u(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):u(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function u(t,e,i,r,n){var o,s=1,a=t.length,l=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,l/=2,i/=2}function d(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(n){var c=-1;for(o=i;o<a;o++)if(d(t,o)===d(e,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===l)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(i+l>a&&(i=a-l),o=i;o>=0;o--){for(var h=!0,u=0;u<l;u++)if(d(t,o+u)!==d(e,u)){h=!1;break}if(h)return o}return-1}function p(t,e,i,r){i=Number(i)||0;var n=t.length-i;r?(r=Number(r))>n&&(r=n):r=n;var o=e.length;r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(e.substr(2*s,2),16);if($(a))return s;t[i+s]=a}return s}function f(t,e,i,r){return B(L(e,t.length-i),t,i,r)}function m(t,e,i,r){return B(function(t){for(var e=[],i=0;i<t.length;++i)e.push(255&t.charCodeAt(i));return e}(e),t,i,r)}function g(t,e,i,r){return m(t,e,i,r)}function b(t,e,i,r){return B(P(e),t,i,r)}function y(t,e,i,r){return B(function(t,e){for(var i,r,n,o=[],s=0;s<t.length&&!((e-=2)<0);++s)r=(i=t.charCodeAt(s))>>8,n=i%256,o.push(n),o.push(r);return o}(e,t.length-i),t,i,r)}function _(t,e,i){return 0===e&&i===t.length?c.fromByteArray(t):c.fromByteArray(t.slice(e,i))}function w(t,e,i){i=Math.min(t.length,i);for(var r=[],n=e;n<i;){var o,s,a,l,d=t[n],c=null,h=d>239?4:d>223?3:d>191?2:1;if(n+h<=i)switch(h){case 1:d<128&&(c=d);break;case 2:128==(192&(o=t[n+1]))&&(l=(31&d)<<6|63&o)>127&&(c=l);break;case 3:o=t[n+1],s=t[n+2],128==(192&o)&&128==(192&s)&&(l=(15&d)<<12|(63&o)<<6|63&s)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=t[n+1],s=t[n+2],a=t[n+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(l=(15&d)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(c=l)}null===c?(c=65533,h=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),n+=h}return function(t){var e=t.length;if(e<=x)return String.fromCharCode.apply(String,t);for(var i="",r=0;r<e;)i+=String.fromCharCode.apply(String,t.slice(r,r+=x));return i}(r)}e.Buffer=i,e.SlowBuffer=function(t){return+t!=t&&(t=0),i.alloc(+t)},e.INSPECT_MAX_BYTES=50,e.kMaxLength=2147483647,i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(t,e,i){return r(t,e,i)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(e,i,r){return function(e,i,r){return n(e),e<=0?t(e):void 0!==i?"string"==typeof r?t(e).fill(i,r):t(e).fill(i):t(e)}(e,i,r)},i.allocUnsafe=function(t){return o(t)},i.allocUnsafeSlow=function(t){return o(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==i.prototype},i.compare=function(t,e){if(N(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),N(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,o=0,s=Math.min(r,n);o<s;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},i.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return i.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=i.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var s=t[r];if(N(s,Uint8Array)&&(s=i.from(s)),!i.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,o),o+=s.length}return n},i.byteLength=l,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)d(this,e,e+1);return this},i.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)d(this,e,e+3),d(this,e+1,e+2);return this},i.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)d(this,e,e+7),d(this,e+1,e+6),d(this,e+2,e+5),d(this,e+3,e+4);return this},i.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?w(this,0,t):function(t,e,i){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return S(this,e,i);case"utf8":case"utf-8":return w(this,e,i);case"ascii":return M(this,e,i);case"latin1":case"binary":return k(this,e,i);case"base64":return _(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,i);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(t){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===i.compare(this,t)},i.prototype.inspect=function(){var t="",i=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(t+=" ... "),"<Buffer "+t+">"},i.prototype.compare=function(t,e,r,n,o){if(N(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var s=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),l=Math.min(s,a),d=this.slice(n,o),c=t.slice(e,r),h=0;h<l;++h)if(d[h]!==c[h]){s=d[h],a=c[h];break}return s<a?-1:a<s?1:0},i.prototype.includes=function(t,e,i){return-1!==this.indexOf(t,e,i)},i.prototype.indexOf=function(t,e,i){return h(this,t,e,i,!0)},i.prototype.lastIndexOf=function(t,e,i){return h(this,t,e,i,!1)},i.prototype.write=function(t,e,i,r){if(void 0===e)r="utf8",i=this.length,e=0;else if(void 0===i&&"string"==typeof e)r=e,i=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(i)?(i>>>=0,void 0===r&&(r="utf8")):(r=i,i=void 0)}var n=this.length-e;if((void 0===i||i>n)&&(i=n),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return p(this,t,e,i);case"utf8":case"utf-8":return f(this,t,e,i);case"ascii":return m(this,t,e,i);case"latin1":case"binary":return g(this,t,e,i);case"base64":return b(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return y(this,t,e,i);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function M(t,e,i){var r="";i=Math.min(t.length,i);for(var n=e;n<i;++n)r+=String.fromCharCode(127&t[n]);return r}function k(t,e,i){var r="";i=Math.min(t.length,i);for(var n=e;n<i;++n)r+=String.fromCharCode(t[n]);return r}function S(t,e,i){var r,n=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>n)&&(i=n);for(var o="",s=e;s<i;++s)o+=(r=t[s])<16?"0"+r.toString(16):r.toString(16);return o}function E(t,e,i){for(var r=t.slice(e,i),n="",o=0;o<r.length;o+=2)n+=String.fromCharCode(r[o]+256*r[o+1]);return n}function A(t,e,i){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}function T(t,e,r,n,o,s){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<s)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function I(t,e,i,r,n,o){if(i+r>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function C(t,e,i,r,n){return e=+e,i>>>=0,n||I(t,0,i,4),v.write(t,e,i,r,23,4),i+4}function R(t,e,i,r,n){return e=+e,i>>>=0,n||I(t,0,i,8),v.write(t,e,i,r,52,8),i+8}i.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return n.__proto__=i.prototype,n},i.prototype.readUIntLE=function(t,e,i){t>>>=0,e>>>=0,i||A(t,e,this.length);for(var r=this[t],n=1,o=0;++o<e&&(n*=256);)r+=this[t+o]*n;return r},i.prototype.readUIntBE=function(t,e,i){t>>>=0,e>>>=0,i||A(t,e,this.length);for(var r=this[t+--e],n=1;e>0&&(n*=256);)r+=this[t+--e]*n;return r},i.prototype.readUInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,i){t>>>=0,e>>>=0,i||A(t,e,this.length);for(var r=this[t],n=1,o=0;++o<e&&(n*=256);)r+=this[t+o]*n;return r>=(n*=128)&&(r-=Math.pow(2,8*e)),r},i.prototype.readIntBE=function(t,e,i){t>>>=0,e>>>=0,i||A(t,e,this.length);for(var r=e,n=1,o=this[t+--r];r>0&&(n*=256);)o+=this[t+--r]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*e)),o},i.prototype.readInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||A(t,2,this.length);var i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i},i.prototype.readInt16BE=function(t,e){t>>>=0,e||A(t,2,this.length);var i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||A(t,4,this.length),v.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||A(t,4,this.length),v.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||A(t,8,this.length),v.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||A(t,8,this.length),v.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,i,r){t=+t,e>>>=0,i>>>=0,r||T(this,t,e,i,Math.pow(2,8*i)-1,0);var n=1,o=0;for(this[e]=255&t;++o<i&&(n*=256);)this[e+o]=t/n&255;return e+i},i.prototype.writeUIntBE=function(t,e,i,r){t=+t,e>>>=0,i>>>=0,r||T(this,t,e,i,Math.pow(2,8*i)-1,0);var n=i-1,o=1;for(this[e+n]=255&t;--n>=0&&(o*=256);)this[e+n]=t/o&255;return e+i},i.prototype.writeUInt8=function(t,e,i){return t=+t,e>>>=0,i||T(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,i){return t=+t,e>>>=0,i||T(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,i){return t=+t,e>>>=0,i||T(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,i){return t=+t,e>>>=0,i||T(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUInt32BE=function(t,e,i){return t=+t,e>>>=0,i||T(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,i,r){if(t=+t,e>>>=0,!r){var n=Math.pow(2,8*i-1);T(this,t,e,i,n-1,-n)}var o=0,s=1,a=0;for(this[e]=255&t;++o<i&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+i},i.prototype.writeIntBE=function(t,e,i,r){if(t=+t,e>>>=0,!r){var n=Math.pow(2,8*i-1);T(this,t,e,i,n-1,-n)}var o=i-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+i},i.prototype.writeInt8=function(t,e,i){return t=+t,e>>>=0,i||T(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,i){return t=+t,e>>>=0,i||T(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,i){return t=+t,e>>>=0,i||T(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,i){return t=+t,e>>>=0,i||T(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,i){return t=+t,e>>>=0,i||T(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,i){return C(this,t,e,!0,i)},i.prototype.writeFloatBE=function(t,e,i){return C(this,t,e,!1,i)},i.prototype.writeDoubleLE=function(t,e,i){return R(this,t,e,!0,i)},i.prototype.writeDoubleBE=function(t,e,i){return R(this,t,e,!1,i)},i.prototype.copy=function(t,e,r,n){if(!i.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o=n-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var s=o-1;s>=0;--s)t[s+e]=this[s+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return o},i.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var o=t.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(t=o)}}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var s;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=e;s<r;++s)this[s]=t;else{var a=i.isBuffer(t)?t:i.from(t,n),l=a.length;if(0===l)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<r-e;++s)this[s+e]=a[s%l]}return this};var O=/[^+/0-9A-Za-z-_]/g;function L(t,e){var i;e=e||1/0;for(var r=t.length,n=null,o=[],s=0;s<r;++s){if((i=t.charCodeAt(s))>55295&&i<57344){if(!n){if(i>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}n=i;continue}if(i<56320){(e-=3)>-1&&o.push(239,191,189),n=i;continue}i=65536+(n-55296<<10|i-56320)}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,i<128){if((e-=1)<0)break;o.push(i)}else if(i<2048){if((e-=2)<0)break;o.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;o.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return o}function P(t){return c.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function B(t,e,i,r){for(var n=0;n<r&&!(n+i>=e.length||n>=t.length);++n)e[n+i]=t[n];return n}function N(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function $(t){return t!=t}}).call(this)}).call(this,d({}).Buffer)})),c={toByteArray:function(t){var e,i,r=function(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");return-1===i&&(i=e),[i,i===e?0:4-i%4]}(t),n=r[0],o=r[1],s=new p(function(t,e,i){return 3*(e+i)/4-i}(0,n,o)),a=0,l=o>0?n-4:n;for(i=0;i<l;i+=4)e=u[t.charCodeAt(i)]<<18|u[t.charCodeAt(i+1)]<<12|u[t.charCodeAt(i+2)]<<6|u[t.charCodeAt(i+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=255&e;return 2===o&&(e=u[t.charCodeAt(i)]<<2|u[t.charCodeAt(i+1)]>>4,s[a++]=255&e),1===o&&(e=u[t.charCodeAt(i)]<<10|u[t.charCodeAt(i+1)]<<4|u[t.charCodeAt(i+2)]>>2,s[a++]=e>>8&255,s[a++]=255&e),s},fromByteArray:function(t){for(var e,i=t.length,r=i%3,n=[],o=0,s=i-r;o<s;o+=16383)n.push(b(t,o,o+16383>s?s:o+16383));return 1===r?(e=t[i-1],n.push(h[e>>2]+h[e<<4&63]+"==")):2===r&&(e=(t[i-2]<<8)+t[i-1],n.push(h[e>>10]+h[e>>4&63]+h[e<<2&63]+"=")),n.join("")}},h=[],u=[],p="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",m=0,g=f.length;m<g;++m)h[m]=f[m],u[f.charCodeAt(m)]=m;function b(t,e,i){for(var r,n,o=[],s=e;s<i;s+=3)r=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(h[(n=r)>>18&63]+h[n>>12&63]+h[n>>6&63]+h[63&n]);return o.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63;var v={read:function(t,e,i,r,n){var o,s,a=8*n-r-1,l=(1<<a)-1,d=l>>1,c=-7,h=i?n-1:0,u=i?-1:1,p=t[e+h];for(h+=u,o=p&(1<<-c)-1,p>>=-c,c+=a;c>0;o=256*o+t[e+h],h+=u,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=r;c>0;s=256*s+t[e+h],h+=u,c-=8);if(0===o)o=1-d;else{if(o===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=d}return(p?-1:1)*s*Math.pow(2,o-r)},write:function(t,e,i,r,n,o){var s,a,l,d=8*o-n-1,c=(1<<d)-1,h=c>>1,u=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,f=r?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+h>=1?u/l:u*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(e*l-1)*Math.pow(2,n),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,n),s=0));n>=8;t[i+p]=255&a,p+=f,a/=256,n-=8);for(s=s<<n|a,d+=n;d>0;t[i+p]=255&s,p+=f,s/=256,d-=8);t[i+p-f]|=128*m}},y={},_=d({}),w=_.Buffer;function x(t,e){for(var i in t)e[i]=t[i]}function M(t,e,i){return w(t,e,i)}w.from&&w.alloc&&w.allocUnsafe&&w.allocUnsafeSlow?y=_:(x(_,y),y.Buffer=M),M.prototype=Object.create(w.prototype),x(w,M),M.from=function(t,e,i){if("number"==typeof t)throw new TypeError("Argument must not be a number");return w(t,e,i)},M.alloc=function(t,e,i){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=w(t);return void 0!==e?"string"==typeof i?r.fill(e,i):r.fill(e):r.fill(0),r},M.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return w(t)},M.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return _.SlowBuffer(t)};var k,S,E={},A=E={};function T(){throw new Error("setTimeout has not been defined")}function I(){throw new Error("clearTimeout has not been defined")}function C(t){if(k===setTimeout)return setTimeout(t,0);if((k===T||!k)&&setTimeout)return k=setTimeout,setTimeout(t,0);try{return k(t,0)}catch(e){try{return k.call(null,t,0)}catch(e){return k.call(this,t,0)}}}!function(){try{k="function"==typeof setTimeout?setTimeout:T}catch(t){k=T}try{S="function"==typeof clearTimeout?clearTimeout:I}catch(t){S=I}}();var R,O=[],L=!1,P=-1;function B(){L&&R&&(L=!1,R.length?O=R.concat(O):P=-1,O.length&&N())}function N(){if(!L){var t=C(B);L=!0;for(var e=O.length;e;){for(R=O,O=[];++P<e;)R&&R[P].run();P=-1,e=O.length}R=null,L=!1,function(t){if(S===clearTimeout)return clearTimeout(t);if((S===I||!S)&&clearTimeout)return S=clearTimeout,clearTimeout(t);try{S(t)}catch(e){try{return S.call(null,t)}catch(e){return S.call(this,t)}}}(t)}}function $(t,e){this.fun=t,this.array=e}function z(){}A.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];O.push(new $(t,e)),1!==O.length||L||C(N)},$.prototype.run=function(){this.fun.apply(null,this.array)},A.title="browser",A.browser=!0,A.env={},A.argv=[],A.version="",A.versions={},A.on=z,A.addListener=z,A.once=z,A.off=z,A.removeListener=z,A.removeAllListeners=z,A.emit=z,A.prependListener=z,A.prependOnceListener=z,A.listeners=function(t){return[]},A.binding=function(t){throw new Error("process.binding is not supported")},A.cwd=function(){return"/"},A.chdir=function(t){throw new Error("process.chdir is not supported")},A.umask=function(){return 0};var j={};(function(t,e){(function(){var i=y.Buffer,r=e.crypto||e.msCrypto;j=r&&r.getRandomValues?function(e,n){if(e>4294967295)throw new RangeError("requested too many random bytes");var o=i.allocUnsafe(e);if(e>0)if(e>65536)for(var s=0;s<e;s+=65536)r.getRandomValues(o.slice(s,s+65536));else r.getRandomValues(o);return"function"==typeof n?t.nextTick((function(){n(null,o)})):o}:function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this)}).call(this,E,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var F={};F="function"==typeof Object.create?function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:function(t,e){if(e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}};var D,q={},U="object"==typeof Reflect?Reflect:null,H=U&&"function"==typeof U.apply?U.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)};D=U&&"function"==typeof U.ownKeys?U.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var V=Number.isNaN||function(t){return t!=t};function W(){W.init.call(this)}(q=W).once=function(t,e){return new Promise((function(i,r){function n(){void 0!==o&&t.removeListener("error",o),i([].slice.call(arguments))}var o;"error"!==e&&(o=function(i){t.removeListener(e,n),r(i)},t.once("error",o)),t.once(e,n)}))},W.EventEmitter=W,W.prototype._events=void 0,W.prototype._eventsCount=0,W.prototype._maxListeners=void 0;var G=10;function K(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function X(t){return void 0===t._maxListeners?W.defaultMaxListeners:t._maxListeners}function Z(t,e,i,r){var n,o,s,a;if(K(i),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,i.listener?i.listener:i),o=t._events),s=o[e]),void 0===s)s=o[e]=i,++t._eventsCount;else if("function"==typeof s?s=o[e]=r?[i,s]:[s,i]:r?s.unshift(i):s.push(i),(n=X(t))>0&&s.length>n&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,a=l,console&&console.warn&&console.warn(a)}return t}function Y(t,e,i){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},n=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(r);return n.listener=i,r.wrapFn=n,n}function J(t,e,i){var r=t._events;if(void 0===r)return[];var n=r[e];return void 0===n?[]:"function"==typeof n?i?[n.listener||n]:[n]:i?function(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}(n):tt(n,n.length)}function Q(t){var e=this._events;if(void 0!==e){var i=e[t];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function tt(t,e){for(var i=new Array(e),r=0;r<e;++r)i[r]=t[r];return i}Object.defineProperty(W,"defaultMaxListeners",{enumerable:!0,get:function(){return G},set:function(t){if("number"!=typeof t||t<0||V(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");G=t}}),W.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},W.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||V(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},W.prototype.getMaxListeners=function(){return X(this)},W.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e.push(arguments[i]);var r="error"===t,n=this._events;if(void 0!==n)r=r&&void 0===n.error;else if(!r)return!1;if(r){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=n[t];if(void 0===a)return!1;if("function"==typeof a)H(a,this,e);else{var l=a.length,d=tt(a,l);for(i=0;i<l;++i)H(d[i],this,e)}return!0},W.prototype.addListener=function(t,e){return Z(this,t,e,!1)},W.prototype.on=W.prototype.addListener,W.prototype.prependListener=function(t,e){return Z(this,t,e,!0)},W.prototype.once=function(t,e){return K(e),this.on(t,Y(this,t,e)),this},W.prototype.prependOnceListener=function(t,e){return K(e),this.prependListener(t,Y(this,t,e)),this},W.prototype.removeListener=function(t,e){var i,r,n,o,s;if(K(e),void 0===(r=this._events))return this;if(void 0===(i=r[t]))return this;if(i===e||i.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,i.listener||e));else if("function"!=typeof i){for(n=-1,o=i.length-1;o>=0;o--)if(i[o]===e||i[o].listener===e){s=i[o].listener,n=o;break}if(n<0)return this;0===n?i.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(i,n),1===i.length&&(r[t]=i[0]),void 0!==r.removeListener&&this.emit("removeListener",t,s||e)}return this},W.prototype.off=W.prototype.removeListener,W.prototype.removeAllListeners=function(t){var e,i,r;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[t]),this;if(0===arguments.length){var n,o=Object.keys(i);for(r=0;r<o.length;++r)"removeListener"!==(n=o[r])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=i[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},W.prototype.listeners=function(t){return J(this,t,!0)},W.prototype.rawListeners=function(t){return J(this,t,!1)},W.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):Q.call(t,e)},W.prototype.listenerCount=Q,W.prototype.eventNames=function(){return this._eventsCount>0?D(this._events):[]};var et=q.EventEmitter;function it(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}function rt(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var nt=d({}).Buffer,ot=l({}).inspect,st=ot&&ot.custom||"inspect",at=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e;return(e=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,i=""+e.data;e=e.next;)i+=t+e.data;return i}},{key:"concat",value:function(t){if(0===this.length)return nt.alloc(0);for(var e,i,r,n=nt.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=o.data,i=n,r=s,nt.prototype.copy.call(e,i,r),s+=o.data.length,o=o.next;return n}},{key:"consume",value:function(t,e){var i;return t<this.head.data.length?(i=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):i=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,i=1,r=e.data;for(t-=r.length;e=e.next;){var n=e.data,o=t>n.length?n.length:t;if(o===n.length?r+=n:r+=n.slice(0,t),0==(t-=o)){o===n.length?(++i,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=n.slice(o));break}++i}return this.length-=i,r}},{key:"_getBuffer",value:function(t){var e=nt.allocUnsafe(t),i=this.head,r=1;for(i.data.copy(e),t-=i.data.length;i=i.next;){var n=i.data,o=t>n.length?n.length:t;if(n.copy(e,e.length-t,0,o),0==(t-=o)){o===n.length?(++r,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=n.slice(o));break}++r}return this.length-=r,e}},{key:st,value:function(t,e){return ot(this,function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?it(Object(i),!0).forEach((function(e){rt(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):it(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}])&&function(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(t.prototype,e),t}(),lt={};(function(t){(function(){function e(t,e){r(t,e),i(t)}function i(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function r(t,e){t.emit("error",e)}lt={destroy:function(n,o){var s=this,a=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return a||l?(o?o(n):n&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(r,this,n)):t.nextTick(r,this,n)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(n||null,(function(r){!o&&r?s._writableState?s._writableState.errorEmitted?t.nextTick(i,s):(s._writableState.errorEmitted=!0,t.nextTick(e,s,r)):t.nextTick(e,s,r):o?(t.nextTick(i,s),o(r)):t.nextTick(i,s)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var i=t._readableState,r=t._writableState;i&&i.autoDestroy||r&&r.autoDestroy?t.destroy(e):t.emit("error",e)}}}).call(this)}).call(this,E);var dt={},ct={};function ht(t,e,i){i||(i=Error);var r=function(t){var i,r;function n(i,r,n){return t.call(this,function(t,i,r){return"string"==typeof e?e:e(t,i,r)}(i,r,n))||this}return r=t,(i=n).prototype=Object.create(r.prototype),i.prototype.constructor=i,i.__proto__=r,n}(i);r.prototype.name=i.name,r.prototype.code=t,ct[t]=r}function ut(t,e){if(Array.isArray(t)){var i=t.length;return t=t.map((function(t){return String(t)})),i>2?"one of ".concat(e," ").concat(t.slice(0,i-1).join(", "),", or ")+t[i-1]:2===i?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}ht("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),ht("ERR_INVALID_ARG_TYPE",(function(t,e,i){var r,n,o,s;if("string"==typeof e&&"not "===e.substr(0,"not ".length)?(r="must not be",e=e.replace(/^not /,"")):r="must be",o=t,(void 0===s||s>o.length)&&(s=o.length)," argument"===o.substring(s-" argument".length,s))n="The ".concat(t," ").concat(r," ").concat(ut(e,"type"));else{var a=function(t,e,i){return"number"!=typeof i&&(i=0),!(i+".".length>t.length)&&-1!==t.indexOf(".",i)}(t)?"property":"argument";n='The "'.concat(t,'" ').concat(a," ").concat(r," ").concat(ut(e,"type"))}return n+". Received type ".concat(typeof i)}),TypeError),ht("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),ht("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),ht("ERR_STREAM_PREMATURE_CLOSE","Premature close"),ht("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),ht("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),ht("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),ht("ERR_STREAM_WRITE_AFTER_END","write after end"),ht("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),ht("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),ht("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),dt.codes=ct;var pt=dt.codes.ERR_INVALID_OPT_VALUE,ft={getHighWaterMark:function(t,e,i,r){var n=function(t,e,i){return null!=t.highWaterMark?t.highWaterMark:e?t[i]:null}(e,r,i);if(null!=n){if(!isFinite(n)||Math.floor(n)!==n||n<0)throw new pt(r?i:"highWaterMark",n);return Math.floor(n)}return t.objectMode?16:16384}},mt={};(function(t){(function(){function e(e){try{if(!t.localStorage)return!1}catch(t){return!1}var i=t.localStorage[e];return null!=i&&"true"===String(i).toLowerCase()}mt=function(t,i){if(e("noDeprecation"))return t;var r=!1;return function(){if(!r){if(e("throwDeprecation"))throw new Error(i);e("traceDeprecation")?console.trace(i):console.warn(i),r=!0}return t.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var gt=kt,bt=dt.codes,vt=bt.ERR_METHOD_NOT_IMPLEMENTED,yt=bt.ERR_MULTIPLE_CALLBACK,_t=bt.ERR_TRANSFORM_ALREADY_TRANSFORMING,wt=bt.ERR_TRANSFORM_WITH_LENGTH_0,xt=s({});function Mt(t,e){var i=this._transformState;i.transforming=!1;var r=i.writecb;if(null===r)return this.emit("error",new yt);i.writechunk=null,i.writecb=null,null!=e&&this.push(e),r(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function kt(t){if(!(this instanceof kt))return new kt(t);xt.call(this,t),this._transformState={afterTransform:Mt.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",St)}function St(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?Et(this,null,null):this._flush((function(e,i){Et(t,e,i)}))}function Et(t,e,i){if(e)return t.emit("error",e);if(null!=i&&t.push(i),t._writableState.length)throw new wt;if(t._transformState.transforming)throw new _t;return t.push(null)}F(kt,xt),kt.prototype.push=function(t,e){return this._transformState.needTransform=!1,xt.prototype.push.call(this,t,e)},kt.prototype._transform=function(t,e,i){i(new vt("_transform()"))},kt.prototype._write=function(t,e,i){var r=this._transformState;if(r.writecb=i,r.writechunk=t,r.writeencoding=e,!r.transforming){var n=this._readableState;(r.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},kt.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},kt.prototype._destroy=function(t,e){xt.prototype._destroy.call(this,t,(function(t){e(t)}))};var At,Tt=It;function It(t){if(!(this instanceof It))return new It(t);gt.call(this,t)}F(It,gt),It.prototype._transform=function(t,e,i){i(null,t)};var Ct=dt.codes,Rt=Ct.ERR_MISSING_ARGS,Ot=Ct.ERR_STREAM_DESTROYED;function Lt(t){if(t)throw t}function Pt(t){t()}function Bt(t,e){return t.pipe(e)}var Nt=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];var r,o=function(t){return t.length?"function"!=typeof t[t.length-1]?Lt:t.pop():Lt}(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Rt("streams");var s=e.map((function(t,i){var a=i<e.length-1;return function(t,e,i,r){r=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(r);var o=!1;t.on("close",(function(){o=!0})),void 0===At&&(At=n({})),At(t,{readable:e,writable:i},(function(t){if(t)return r(t);o=!0,r()}));var s=!1;return function(e){if(!o&&!s)return s=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void r(e||new Ot("pipe"))}}(t,a,i>0,(function(t){r||(r=t),t&&s.forEach(Pt),a||(s.forEach(Pt),o(r))}))}));return e.reduce(Bt)},$t={};($t=$t=e({})).Stream=$t,$t.Readable=$t,$t.Writable=a({}),$t.Duplex=s({}),$t.Transform=gt,$t.PassThrough=Tt,$t.finished=n({}),$t.pipeline=Nt;var zt={},jt=y.Buffer,Ft=$t.Transform;function Dt(t){Ft.call(this),this._block=jt.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}F(Dt,Ft),Dt.prototype._transform=function(t,e,i){var r=null;try{this.update(t,e)}catch(t){r=t}i(r)},Dt.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},Dt.prototype.update=function(t,e){if(function(t,e){if(!jt.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer")}(t),this._finalized)throw new Error("Digest already called");jt.isBuffer(t)||(t=jt.from(t,e));for(var i=this._block,r=0;this._blockOffset+t.length-r>=this._blockSize;){for(var n=this._blockOffset;n<this._blockSize;)i[n++]=t[r++];this._update(),this._blockOffset=0}for(;r<t.length;)i[this._blockOffset++]=t[r++];for(var o=0,s=8*t.length;s>0;++o)this._length[o]+=s,(s=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*s);return this},Dt.prototype._update=function(){throw new Error("_update is not implemented")},Dt.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var i=0;i<4;++i)this._length[i]=0;return e},Dt.prototype._digest=function(){throw new Error("_digest is not implemented")},zt=Dt;var qt={},Ut=y.Buffer,Ht=new Array(16);function Vt(){zt.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function Wt(t,e){return t<<e|t>>>32-e}function Gt(t,e,i,r,n,o,s){return Wt(t+(e&i|~e&r)+n+o|0,s)+e|0}function Kt(t,e,i,r,n,o,s){return Wt(t+(e&r|i&~r)+n+o|0,s)+e|0}function Xt(t,e,i,r,n,o,s){return Wt(t+(e^i^r)+n+o|0,s)+e|0}function Zt(t,e,i,r,n,o,s){return Wt(t+(i^(e|~r))+n+o|0,s)+e|0}F(Vt,zt),Vt.prototype._update=function(){for(var t=Ht,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var i=this._a,r=this._b,n=this._c,o=this._d;i=Gt(i,r,n,o,t[0],3614090360,7),o=Gt(o,i,r,n,t[1],3905402710,12),n=Gt(n,o,i,r,t[2],606105819,17),r=Gt(r,n,o,i,t[3],3250441966,22),i=Gt(i,r,n,o,t[4],4118548399,7),o=Gt(o,i,r,n,t[5],1200080426,12),n=Gt(n,o,i,r,t[6],2821735955,17),r=Gt(r,n,o,i,t[7],4249261313,22),i=Gt(i,r,n,o,t[8],1770035416,7),o=Gt(o,i,r,n,t[9],2336552879,12),n=Gt(n,o,i,r,t[10],4294925233,17),r=Gt(r,n,o,i,t[11],2304563134,22),i=Gt(i,r,n,o,t[12],1804603682,7),o=Gt(o,i,r,n,t[13],4254626195,12),n=Gt(n,o,i,r,t[14],2792965006,17),i=Kt(i,r=Gt(r,n,o,i,t[15],1236535329,22),n,o,t[1],4129170786,5),o=Kt(o,i,r,n,t[6],3225465664,9),n=Kt(n,o,i,r,t[11],643717713,14),r=Kt(r,n,o,i,t[0],3921069994,20),i=Kt(i,r,n,o,t[5],3593408605,5),o=Kt(o,i,r,n,t[10],38016083,9),n=Kt(n,o,i,r,t[15],3634488961,14),r=Kt(r,n,o,i,t[4],3889429448,20),i=Kt(i,r,n,o,t[9],568446438,5),o=Kt(o,i,r,n,t[14],3275163606,9),n=Kt(n,o,i,r,t[3],4107603335,14),r=Kt(r,n,o,i,t[8],1163531501,20),i=Kt(i,r,n,o,t[13],2850285829,5),o=Kt(o,i,r,n,t[2],4243563512,9),n=Kt(n,o,i,r,t[7],1735328473,14),i=Xt(i,r=Kt(r,n,o,i,t[12],2368359562,20),n,o,t[5],4294588738,4),o=Xt(o,i,r,n,t[8],2272392833,11),n=Xt(n,o,i,r,t[11],1839030562,16),r=Xt(r,n,o,i,t[14],4259657740,23),i=Xt(i,r,n,o,t[1],2763975236,4),o=Xt(o,i,r,n,t[4],1272893353,11),n=Xt(n,o,i,r,t[7],4139469664,16),r=Xt(r,n,o,i,t[10],3200236656,23),i=Xt(i,r,n,o,t[13],681279174,4),o=Xt(o,i,r,n,t[0],3936430074,11),n=Xt(n,o,i,r,t[3],3572445317,16),r=Xt(r,n,o,i,t[6],76029189,23),i=Xt(i,r,n,o,t[9],3654602809,4),o=Xt(o,i,r,n,t[12],3873151461,11),n=Xt(n,o,i,r,t[15],530742520,16),i=Zt(i,r=Xt(r,n,o,i,t[2],3299628645,23),n,o,t[0],4096336452,6),o=Zt(o,i,r,n,t[7],1126891415,10),n=Zt(n,o,i,r,t[14],2878612391,15),r=Zt(r,n,o,i,t[5],4237533241,21),i=Zt(i,r,n,o,t[12],1700485571,6),o=Zt(o,i,r,n,t[3],2399980690,10),n=Zt(n,o,i,r,t[10],4293915773,15),r=Zt(r,n,o,i,t[1],2240044497,21),i=Zt(i,r,n,o,t[8],1873313359,6),o=Zt(o,i,r,n,t[15],4264355552,10),n=Zt(n,o,i,r,t[6],2734768916,15),r=Zt(r,n,o,i,t[13],1309151649,21),i=Zt(i,r,n,o,t[4],4149444226,6),o=Zt(o,i,r,n,t[11],3174756917,10),n=Zt(n,o,i,r,t[2],718787259,15),r=Zt(r,n,o,i,t[9],3951481745,21),this._a=this._a+i|0,this._b=this._b+r|0,this._c=this._c+n|0,this._d=this._d+o|0},Vt.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=Ut.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},qt=Vt;var Yt={},Jt=d({}).Buffer,Qt=new Array(16),te=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],ee=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],ie=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],re=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],ne=[0,1518500249,1859775393,2400959708,2840853838],oe=[1352829926,1548603684,1836072691,2053994217,0];function se(){zt.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function ae(t,e){return t<<e|t>>>32-e}function le(t,e,i,r,n,o,s,a){return ae(t+(e^i^r)+o+s|0,a)+n|0}function de(t,e,i,r,n,o,s,a){return ae(t+(e&i|~e&r)+o+s|0,a)+n|0}function ce(t,e,i,r,n,o,s,a){return ae(t+((e|~i)^r)+o+s|0,a)+n|0}function he(t,e,i,r,n,o,s,a){return ae(t+(e&r|i&~r)+o+s|0,a)+n|0}function ue(t,e,i,r,n,o,s,a){return ae(t+(e^(i|~r))+o+s|0,a)+n|0}F(se,zt),se.prototype._update=function(){for(var t=Qt,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var i=0|this._a,r=0|this._b,n=0|this._c,o=0|this._d,s=0|this._e,a=0|this._a,l=0|this._b,d=0|this._c,c=0|this._d,h=0|this._e,u=0;u<80;u+=1){var p,f;u<16?(p=le(i,r,n,o,s,t[te[u]],ne[0],ie[u]),f=ue(a,l,d,c,h,t[ee[u]],oe[0],re[u])):u<32?(p=de(i,r,n,o,s,t[te[u]],ne[1],ie[u]),f=he(a,l,d,c,h,t[ee[u]],oe[1],re[u])):u<48?(p=ce(i,r,n,o,s,t[te[u]],ne[2],ie[u]),f=ce(a,l,d,c,h,t[ee[u]],oe[2],re[u])):u<64?(p=he(i,r,n,o,s,t[te[u]],ne[3],ie[u]),f=de(a,l,d,c,h,t[ee[u]],oe[3],re[u])):(p=ue(i,r,n,o,s,t[te[u]],ne[4],ie[u]),f=le(a,l,d,c,h,t[ee[u]],oe[4],re[u])),i=s,s=o,o=ae(n,10),n=r,r=p,a=h,h=c,c=ae(d,10),d=l,l=f}var m=this._b+n+c|0;this._b=this._c+o+h|0,this._c=this._d+s+a|0,this._d=this._e+i+l|0,this._e=this._a+r+d|0,this._a=m},se.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=Jt.alloc?Jt.alloc(20):new Jt(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},Yt=se;var pe={},fe=y.Buffer;function me(t,e){this._block=fe.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}me.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=fe.from(t,e));for(var i=this._block,r=this._blockSize,n=t.length,o=this._len,s=0;s<n;){for(var a=o%r,l=Math.min(n-s,r-a),d=0;d<l;d++)i[a+d]=t[s+d];s+=l,(o+=l)%r==0&&this._update(i)}return this._len+=n,this},me.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var i=8*this._len;if(i<=4294967295)this._block.writeUInt32BE(i,this._blockSize-4);else{var r=(4294967295&i)>>>0,n=(i-r)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},me.prototype._update=function(){throw new Error("_update must be implemented by subclass")},pe=me;var ge,be=y.Buffer,ve=[1518500249,1859775393,-1894007588,-899497514],ye=new Array(80);function _e(){this.init(),this._w=ye,pe.call(this,64,56)}function we(t){return t<<30|t>>>2}function xe(t,e,i,r){return 0===t?e&i|~e&r:2===t?e&i|e&r|i&r:e^i^r}F(_e,pe),_e.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},_e.prototype._update=function(t){for(var e,i=this._w,r=0|this._a,n=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,l=0;l<16;++l)i[l]=t.readInt32BE(4*l);for(;l<80;++l)i[l]=i[l-3]^i[l-8]^i[l-14]^i[l-16];for(var d=0;d<80;++d){var c=~~(d/20),h=0|((e=r)<<5|e>>>27)+xe(c,n,o,s)+a+i[d]+ve[c];a=s,s=o,o=we(n),n=r,r=h}this._a=r+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},_e.prototype._hash=function(){var t=be.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},ge=_e;var Me,ke=y.Buffer,Se=[1518500249,1859775393,-1894007588,-899497514],Ee=new Array(80);function Ae(){this.init(),this._w=Ee,pe.call(this,64,56)}function Te(t){return t<<5|t>>>27}function Ie(t){return t<<30|t>>>2}function Ce(t,e,i,r){return 0===t?e&i|~e&r:2===t?e&i|e&r|i&r:e^i^r}F(Ae,pe),Ae.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Ae.prototype._update=function(t){for(var e,i=this._w,r=0|this._a,n=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,l=0;l<16;++l)i[l]=t.readInt32BE(4*l);for(;l<80;++l)i[l]=(e=i[l-3]^i[l-8]^i[l-14]^i[l-16])<<1|e>>>31;for(var d=0;d<80;++d){var c=~~(d/20),h=Te(r)+Ce(c,n,o,s)+a+i[d]+Se[c]|0;a=s,s=o,o=Ie(n),n=r,r=h}this._a=r+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},Ae.prototype._hash=function(){var t=ke.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},Me=Ae;var Re,Oe=y.Buffer,Le=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Pe=new Array(64);function Be(){this.init(),this._w=Pe,pe.call(this,64,56)}function Ne(t,e,i){return i^t&(e^i)}function $e(t,e,i){return t&e|i&(t|e)}function ze(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function je(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function Fe(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}F(Be,pe),Be.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},Be.prototype._update=function(t){for(var e,i=this._w,r=0|this._a,n=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,l=0|this._f,d=0|this._g,c=0|this._h,h=0;h<16;++h)i[h]=t.readInt32BE(4*h);for(;h<64;++h)i[h]=0|(((e=i[h-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+i[h-7]+Fe(i[h-15])+i[h-16];for(var u=0;u<64;++u){var p=c+je(a)+Ne(a,l,d)+Le[u]+i[u]|0,f=ze(r)+$e(r,n,o)|0;c=d,d=l,l=a,a=s+p|0,s=o,o=n,n=r,r=p+f|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0,this._f=l+this._f|0,this._g=d+this._g|0,this._h=c+this._h|0},Be.prototype._hash=function(){var t=Oe.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},Re=Be;var De,qe=y.Buffer,Ue=new Array(64);function He(){this.init(),this._w=Ue,pe.call(this,64,56)}F(He,Re),He.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},He.prototype._hash=function(){var t=qe.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},De=He;var Ve,We=y.Buffer,Ge=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],Ke=new Array(160);function Xe(){this.init(),this._w=Ke,pe.call(this,128,112)}function Ze(t,e,i){return i^t&(e^i)}function Ye(t,e,i){return t&e|i&(t|e)}function Je(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function Qe(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function ti(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function ei(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function ii(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function ri(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function ni(t,e){return t>>>0<e>>>0?1:0}F(Xe,pe),Xe.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},Xe.prototype._update=function(t){for(var e=this._w,i=0|this._ah,r=0|this._bh,n=0|this._ch,o=0|this._dh,s=0|this._eh,a=0|this._fh,l=0|this._gh,d=0|this._hh,c=0|this._al,h=0|this._bl,u=0|this._cl,p=0|this._dl,f=0|this._el,m=0|this._fl,g=0|this._gl,b=0|this._hl,v=0;v<32;v+=2)e[v]=t.readInt32BE(4*v),e[v+1]=t.readInt32BE(4*v+4);for(;v<160;v+=2){var y=e[v-30],_=e[v-30+1],w=ti(y,_),x=ei(_,y),M=ii(y=e[v-4],_=e[v-4+1]),k=ri(_,y),S=e[v-14],E=e[v-14+1],A=e[v-32],T=e[v-32+1],I=x+E|0,C=w+S+ni(I,x)|0;C=(C=C+M+ni(I=I+k|0,k)|0)+A+ni(I=I+T|0,T)|0,e[v]=C,e[v+1]=I}for(var R=0;R<160;R+=2){C=e[R],I=e[R+1];var O=Ye(i,r,n),L=Ye(c,h,u),P=Je(i,c),B=Je(c,i),N=Qe(s,f),$=Qe(f,s),z=Ge[R],j=Ge[R+1],F=Ze(s,a,l),D=Ze(f,m,g),q=b+$|0,U=d+N+ni(q,b)|0;U=(U=(U=U+F+ni(q=q+D|0,D)|0)+z+ni(q=q+j|0,j)|0)+C+ni(q=q+I|0,I)|0;var H=B+L|0,V=P+O+ni(H,B)|0;d=l,b=g,l=a,g=m,a=s,m=f,s=o+U+ni(f=p+q|0,p)|0,o=n,p=u,n=r,u=h,r=i,h=c,i=U+V+ni(c=q+H|0,q)|0}this._al=this._al+c|0,this._bl=this._bl+h|0,this._cl=this._cl+u|0,this._dl=this._dl+p|0,this._el=this._el+f|0,this._fl=this._fl+m|0,this._gl=this._gl+g|0,this._hl=this._hl+b|0,this._ah=this._ah+i+ni(this._al,c)|0,this._bh=this._bh+r+ni(this._bl,h)|0,this._ch=this._ch+n+ni(this._cl,u)|0,this._dh=this._dh+o+ni(this._dl,p)|0,this._eh=this._eh+s+ni(this._el,f)|0,this._fh=this._fh+a+ni(this._fl,m)|0,this._gh=this._gh+l+ni(this._gl,g)|0,this._hh=this._hh+d+ni(this._hl,b)|0},Xe.prototype._hash=function(){var t=We.allocUnsafe(64);function e(e,i,r){t.writeInt32BE(e,r),t.writeInt32BE(i,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},Ve=Xe;var oi,si,ai,li=y.Buffer,di=new Array(160);function ci(){this.init(),this._w=di,pe.call(this,128,112)}F(ci,Ve),ci.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},ci.prototype._hash=function(){var t=li.allocUnsafe(48);function e(e,i,r){t.writeInt32BE(e,r),t.writeInt32BE(i,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},oi=ci,(ai=si=function(t){t=t.toLowerCase();var e=ai[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e}).sha=ge,ai.sha1=Me,ai.sha224=De,ai.sha256=Re,ai.sha384=oi,ai.sha512=Ve;var hi=pi,ui=q.EventEmitter;function pi(){ui.call(this)}F(pi,ui),pi.Readable=e({}),pi.Writable=a({}),pi.Duplex=s({}),pi.Transform=gt,pi.PassThrough=Tt,pi.finished=n({}),pi.pipeline=Nt,pi.Stream=pi,pi.prototype.pipe=function(t,e){var i=this;function r(e){t.writable&&!1===t.write(e)&&i.pause&&i.pause()}function n(){i.readable&&i.resume&&i.resume()}i.on("data",r),t.on("drain",n),t._isStdio||e&&!1===e.end||(i.on("end",s),i.on("close",a));var o=!1;function s(){o||(o=!0,t.end())}function a(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function l(t){if(d(),0===ui.listenerCount(this,"error"))throw t}function d(){i.removeListener("data",r),t.removeListener("drain",n),i.removeListener("end",s),i.removeListener("close",a),i.removeListener("error",l),t.removeListener("error",l),i.removeListener("end",d),i.removeListener("close",d),t.removeListener("close",d)}return i.on("error",l),t.on("error",l),i.on("end",d),i.on("close",d),t.on("close",d),t.emit("pipe",i),t};var fi,mi={},gi=y.Buffer,bi=hi.Transform,vi=o({}).StringDecoder;function yi(t){bi.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}function _i(t){mi.call(this,"digest"),this._hash=t}F(yi,bi),yi.prototype.update=function(t,e,i){"string"==typeof t&&(t=gi.from(t,e));var r=this._update(t);return this.hashMode?this:(i&&(r=this._toString(r,i)),r)},yi.prototype.setAutoPadding=function(){},yi.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},yi.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},yi.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},yi.prototype._transform=function(t,e,i){var r;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){r=t}finally{i(r)}},yi.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},yi.prototype._finalOrDigest=function(t){var e=this.__final()||gi.alloc(0);return t&&(e=this._toString(e,t,!0)),e},yi.prototype._toString=function(t,e,i){if(this._decoder||(this._decoder=new vi(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var r=this._decoder.write(t);return i&&(r+=this._decoder.end()),r},F(_i,mi=yi),_i.prototype._update=function(t){this._hash.update(t)},_i.prototype._final=function(){return this._hash.digest()},fi=function(t){return"md5"===(t=t.toLowerCase())?new qt:"rmd160"===t||"ripemd160"===t?new Yt:new _i(si(t))};var wi={},xi=y.Buffer,Mi=xi.alloc(128);function ki(t,e){mi.call(this,"digest"),"string"==typeof e&&(e=xi.from(e)),this._alg=t,this._key=e,e.length>64?e=t(e):e.length<64&&(e=xi.concat([e,Mi],64));for(var i=this._ipad=xi.allocUnsafe(64),r=this._opad=xi.allocUnsafe(64),n=0;n<64;n++)i[n]=54^e[n],r[n]=92^e[n];this._hash=[i]}F(ki,mi),ki.prototype._update=function(t){this._hash.push(t)},ki.prototype._final=function(){var t=this._alg(xi.concat(this._hash));return this._alg(xi.concat([this._opad,t]))},wi=ki;var Si,Ei=function(t){return(new qt).update(t).digest()},Ai=y.Buffer,Ti=Ai.alloc(128);function Ii(t,e){mi.call(this,"digest"),"string"==typeof e&&(e=Ai.from(e));var i="sha512"===t||"sha384"===t?128:64;this._alg=t,this._key=e,e.length>i?e=("rmd160"===t?new Yt:si(t)).update(e).digest():e.length<i&&(e=Ai.concat([e,Ti],i));for(var r=this._ipad=Ai.allocUnsafe(i),n=this._opad=Ai.allocUnsafe(i),o=0;o<i;o++)r[o]=54^e[o],n[o]=92^e[o];this._hash="rmd160"===t?new Yt:si(t),this._hash.update(r)}F(Ii,mi),Ii.prototype._update=function(t){this._hash.update(t)},Ii.prototype._final=function(){var t=this._hash.digest();return("rmd160"===this._alg?new Yt:si(this._alg)).update(this._opad).update(t).digest()},Si=function(t,e){return"rmd160"===(t=t.toLowerCase())||"ripemd160"===t?new Ii("rmd160",e):"md5"===t?new wi(Ei,e):new Ii(t,e)};var Ci={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}},Ri=Math.pow(2,30)-1,Oi={};(function(t){(function(){var e;e=t.browser?"utf-8":t.version?parseInt(t.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary":"utf-8",Oi=e}).call(this)}).call(this,E);var Li,Pi=y.Buffer,Bi=function(t,e,i){if(Pi.isBuffer(t))return t;if("string"==typeof t)return Pi.from(t,e);if(ArrayBuffer.isView(t))return Pi.from(t.buffer);throw new TypeError(i+" must be a string, a Buffer, a typed array or a DataView")},Ni=y.Buffer,$i=Ni.alloc(128),zi={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function ji(t,e,i){var r=function(t){return"rmd160"===t||"ripemd160"===t?function(t){return(new Yt).update(t).digest()}:"md5"===t?Ei:function(e){return si(t).update(e).digest()}}(t),n="sha512"===t||"sha384"===t?128:64;e.length>n?e=r(e):e.length<n&&(e=Ni.concat([e,$i],n));for(var o=Ni.allocUnsafe(n+zi[t]),s=Ni.allocUnsafe(n+zi[t]),a=0;a<n;a++)o[a]=54^e[a],s[a]=92^e[a];var l=Ni.allocUnsafe(n+i+4);o.copy(l,0,0,n),this.ipad1=l,this.ipad2=o,this.opad=s,this.alg=t,this.blocksize=n,this.hash=r,this.size=zi[t]}ji.prototype.run=function(t,e){return t.copy(e,this.blocksize),this.hash(e).copy(this.opad,this.blocksize),this.hash(this.opad)},Li=function(t,e,i,r,n){!function(t,e){if("number"!=typeof t)throw new TypeError("Iterations not a number");if(t<0)throw new TypeError("Bad iterations");if("number"!=typeof e)throw new TypeError("Key length not a number");if(e<0||e>Ri||e!=e)throw new TypeError("Bad key length")}(i,r);var o=new ji(n=n||"sha1",t=Bi(t,Oi,"Password"),(e=Bi(e,Oi,"Salt")).length),s=Ni.allocUnsafe(r),a=Ni.allocUnsafe(e.length+4);e.copy(a,0,0,e.length);for(var l=0,d=zi[n],c=Math.ceil(r/d),h=1;h<=c;h++){a.writeUInt32BE(h,e.length);for(var u=o.run(a,o.ipad1),p=u,f=1;f<i;f++){p=o.run(p,o.ipad2);for(var m=0;m<d;m++)u[m]^=p[m]}u.copy(s,l),l+=d}return s},function(t,e){(function(){y.Buffer,e.crypto&&e.crypto.subtle}).call(this)}.call(this,E,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var Fi={};Fi.pbkdf2Sync=Li;var Di={readUInt32BE:function(t,e){return(t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e])>>>0},writeUInt32BE:function(t,e,i){t[0+i]=e>>>24,t[1+i]=e>>>16&255,t[2+i]=e>>>8&255,t[3+i]=255&e},ip:function(t,e,i,r){for(var n=0,o=0,s=6;s>=0;s-=2){for(var a=0;a<=24;a+=8)n<<=1,n|=e>>>a+s&1;for(a=0;a<=24;a+=8)n<<=1,n|=t>>>a+s&1}for(s=6;s>=0;s-=2){for(a=1;a<=25;a+=8)o<<=1,o|=e>>>a+s&1;for(a=1;a<=25;a+=8)o<<=1,o|=t>>>a+s&1}i[r+0]=n>>>0,i[r+1]=o>>>0},rip:function(t,e,i,r){for(var n=0,o=0,s=0;s<4;s++)for(var a=24;a>=0;a-=8)n<<=1,n|=e>>>a+s&1,n<<=1,n|=t>>>a+s&1;for(s=4;s<8;s++)for(a=24;a>=0;a-=8)o<<=1,o|=e>>>a+s&1,o<<=1,o|=t>>>a+s&1;i[r+0]=n>>>0,i[r+1]=o>>>0},pc1:function(t,e,i,r){for(var n=0,o=0,s=7;s>=5;s--){for(var a=0;a<=24;a+=8)n<<=1,n|=e>>a+s&1;for(a=0;a<=24;a+=8)n<<=1,n|=t>>a+s&1}for(a=0;a<=24;a+=8)n<<=1,n|=e>>a+s&1;for(s=1;s<=3;s++){for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1;for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1}for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1;i[r+0]=n>>>0,i[r+1]=o>>>0},r28shl:function(t,e){return t<<e&268435455|t>>>28-e}},qi=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];Di.pc2=function(t,e,i,r){for(var n=0,o=0,s=qi.length>>>1,a=0;a<s;a++)n<<=1,n|=t>>>qi[a]&1;for(a=s;a<qi.length;a++)o<<=1,o|=e>>>qi[a]&1;i[r+0]=n>>>0,i[r+1]=o>>>0},Di.expand=function(t,e,i){var r=0,n=0;r=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)r<<=6,r|=t>>>o&63;for(o=11;o>=3;o-=4)n|=t>>>o&63,n<<=6;n|=(31&t)<<1|t>>>31,e[i+0]=r>>>0,e[i+1]=n>>>0};var Ui=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];Di.substitute=function(t,e){for(var i=0,r=0;r<4;r++)i<<=4,i|=Ui[64*r+(t>>>18-6*r&63)];for(r=0;r<4;r++)i<<=4,i|=Ui[256+64*r+(e>>>18-6*r&63)];return i>>>0};var Hi,Vi=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];function Wi(t,e){if(!t)throw new Error(e||"Assertion failed")}Di.permute=function(t){for(var e=0,i=0;i<Vi.length;i++)e<<=1,e|=t>>>Vi[i]&1;return e>>>0},Di.padSplit=function(t,e,i){for(var r=t.toString(2);r.length<e;)r="0"+r;for(var n=[],o=0;o<e;o+=i)n.push(r.slice(o,o+i));return n.join(" ")},Hi=Wi,Wi.equal=function(t,e,i){if(t!=e)throw new Error(i||"Assertion failed: "+t+" != "+e)};var Gi={};function Ki(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}Gi=Ki,Ki.prototype._init=function(){},Ki.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},Ki.prototype._buffer=function(t,e){for(var i=Math.min(this.buffer.length-this.bufferOff,t.length-e),r=0;r<i;r++)this.buffer[this.bufferOff+r]=t[e+r];return this.bufferOff+=i,i},Ki.prototype._flushBuffer=function(t,e){return this._update(this.buffer,0,t,e),this.bufferOff=0,this.blockSize},Ki.prototype._updateEncrypt=function(t){var e=0,i=0,r=(this.bufferOff+t.length)/this.blockSize|0,n=new Array(r*this.blockSize);0!==this.bufferOff&&(e+=this._buffer(t,e),this.bufferOff===this.buffer.length&&(i+=this._flushBuffer(n,i)));for(var o=t.length-(t.length-e)%this.blockSize;e<o;e+=this.blockSize)this._update(t,e,n,i),i+=this.blockSize;for(;e<t.length;e++,this.bufferOff++)this.buffer[this.bufferOff]=t[e];return n},Ki.prototype._updateDecrypt=function(t){for(var e=0,i=0,r=Math.ceil((this.bufferOff+t.length)/this.blockSize)-1,n=new Array(r*this.blockSize);r>0;r--)e+=this._buffer(t,e),i+=this._flushBuffer(n,i);return e+=this._buffer(t,e),n},Ki.prototype.final=function(t){var e,i;return t&&(e=this.update(t)),i="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(i):i},Ki.prototype._pad=function(t,e){if(0===e)return!1;for(;e<t.length;)t[e++]=0;return!0},Ki.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var t=new Array(this.blockSize);return this._update(this.buffer,0,t,0),t},Ki.prototype._unpad=function(t){return t},Ki.prototype._finalDecrypt=function(){var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)};var Xi={};function Zi(){this.tmp=new Array(2),this.keys=null}function Yi(t){Gi.call(this,t);var e=new Zi;this._desState=e,this.deriveKeys(e,t.key)}F(Yi,Gi),Xi=Yi,Yi.create=function(t){return new Yi(t)};var Ji=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];Yi.prototype.deriveKeys=function(t,e){t.keys=new Array(32);var i=Di.readUInt32BE(e,0),r=Di.readUInt32BE(e,4);Di.pc1(i,r,t.tmp,0),i=t.tmp[0],r=t.tmp[1];for(var n=0;n<t.keys.length;n+=2){var o=Ji[n>>>1];i=Di.r28shl(i,o),r=Di.r28shl(r,o),Di.pc2(i,r,t.keys,n)}},Yi.prototype._update=function(t,e,i,r){var n=this._desState,o=Di.readUInt32BE(t,e),s=Di.readUInt32BE(t,e+4);Di.ip(o,s,n.tmp,0),o=n.tmp[0],s=n.tmp[1],"encrypt"===this.type?this._encrypt(n,o,s,n.tmp,0):this._decrypt(n,o,s,n.tmp,0),o=n.tmp[0],s=n.tmp[1],Di.writeUInt32BE(i,o,r),Di.writeUInt32BE(i,s,r+4)},Yi.prototype._pad=function(t,e){for(var i=t.length-e,r=e;r<t.length;r++)t[r]=i;return!0},Yi.prototype._unpad=function(t){for(var e=t[t.length-1],i=t.length-e;i<t.length;i++);return t.slice(0,t.length-e)},Yi.prototype._encrypt=function(t,e,i,r,n){for(var o=e,s=i,a=0;a<t.keys.length;a+=2){var l=t.keys[a],d=t.keys[a+1];Di.expand(s,t.tmp,0),l^=t.tmp[0],d^=t.tmp[1];var c=Di.substitute(l,d),h=s;s=(o^Di.permute(c))>>>0,o=h}Di.rip(s,o,r,n)},Yi.prototype._decrypt=function(t,e,i,r,n){for(var o=i,s=e,a=t.keys.length-2;a>=0;a-=2){var l=t.keys[a],d=t.keys[a+1];Di.expand(o,t.tmp,0),l^=t.tmp[0],d^=t.tmp[1];var c=Di.substitute(l,d),h=o;o=(s^Di.permute(c))>>>0,s=h}Di.rip(o,s,r,n)};var Qi,tr={},er={};function ir(t){this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=t[e]}function rr(t,e){var i=e.slice(0,8),r=e.slice(8,16),n=e.slice(16,24);this.ciphers="encrypt"===t?[Xi.create({type:"encrypt",key:i}),Xi.create({type:"decrypt",key:r}),Xi.create({type:"encrypt",key:n})]:[Xi.create({type:"decrypt",key:n}),Xi.create({type:"encrypt",key:r}),Xi.create({type:"decrypt",key:i})]}function nr(t){Gi.call(this,t);var e=new rr(this.type,this.options.key);this._edeState=e}tr.instantiate=function(t){function e(e){t.call(this,e),this._cbcInit()}F(e,t);for(var i=Object.keys(er),r=0;r<i.length;r++){var n=i[r];e.prototype[n]=er[n]}return e.create=function(t){return new e(t)},e},er._cbcInit=function(){var t=new ir(this.options.iv);this._cbcState=t},er._update=function(t,e,i,r){var n=this._cbcState,o=this.constructor.super_.prototype,s=n.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)s[a]^=t[e+a];for(o._update.call(this,s,0,i,r),a=0;a<this.blockSize;a++)s[a]=i[r+a]}else{for(o._update.call(this,t,e,i,r),a=0;a<this.blockSize;a++)i[r+a]^=s[a];for(a=0;a<this.blockSize;a++)s[a]=t[e+a]}},F(nr,Gi),Qi=nr,nr.create=function(t){return new nr(t)},nr.prototype._update=function(t,e,i,r){var n=this._edeState;n.ciphers[0]._update(t,e,i,r),n.ciphers[1]._update(i,r,i,r),n.ciphers[2]._update(i,r,i,r)},nr.prototype._pad=Xi.prototype._pad,nr.prototype._unpad=Xi.prototype._unpad;var or={};or.DES=Xi,or.CBC=tr,or.EDE=Qi;var sr=y.Buffer,ar={"des-ede3-cbc":or.CBC.instantiate(or.EDE),"des-ede3":or.EDE,"des-ede-cbc":or.CBC.instantiate(or.EDE),"des-ede":or.EDE,"des-cbc":or.CBC.instantiate(or.DES),"des-ecb":or.DES};function lr(t){mi.call(this);var e,i=t.mode.toLowerCase(),r=ar[i];e=t.decrypt?"decrypt":"encrypt";var n=t.key;sr.isBuffer(n)||(n=sr.from(n)),"des-ede"!==i&&"des-ede-cbc"!==i||(n=sr.concat([n,n.slice(0,8)]));var o=t.iv;sr.isBuffer(o)||(o=sr.from(o)),this._des=r.create({key:n,iv:o,type:e})}ar.des=ar["des-cbc"],ar.des3=ar["des-ede3-cbc"],F(lr,mi),lr.prototype._update=function(t){return sr.from(this._des.update(t))},lr.prototype._final=function(){return sr.from(this._des.final())};var dr={};(function(t){(function(){dr=function(e,i){for(var r=Math.min(e.length,i.length),n=new t(r),o=0;o<r;++o)n[o]=e[o]^i[o];return n}}).call(this)}).call(this,d({}).Buffer);var cr={encrypt:function(t,e){var i=dr(e,t._prev);return t._prev=t._cipher.encryptBlock(i),t._prev},decrypt:function(t,e){var i=t._prev;t._prev=e;var r=t._cipher.decryptBlock(e);return dr(r,i)}},hr={},ur=y.Buffer;function pr(t,e,i){var r=e.length,n=dr(e,t._cache);return t._cache=t._cache.slice(r),t._prev=ur.concat([t._prev,i?e:n]),n}hr.encrypt=function(t,e,i){for(var r,n=ur.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=ur.allocUnsafe(0)),!(t._cache.length<=e.length)){n=ur.concat([n,pr(t,e,i)]);break}r=t._cache.length,n=ur.concat([n,pr(t,e.slice(0,r),i)]),e=e.slice(r)}return n};var fr={},mr=y.Buffer;function gr(t,e,i){var r=t._cipher.encryptBlock(t._prev)[0]^e;return t._prev=mr.concat([t._prev.slice(1),mr.from([i?e:r])]),r}fr.encrypt=function(t,e,i){for(var r=e.length,n=mr.allocUnsafe(r),o=-1;++o<r;)n[o]=gr(t,e[o],i);return n};var br={},vr=y.Buffer;function yr(t,e,i){for(var r,n,o=-1,s=0;++o<8;)r=e&1<<7-o?128:0,s+=(128&(n=t._cipher.encryptBlock(t._prev)[0]^r))>>o%8,t._prev=_r(t._prev,i?r:n);return s}function _r(t,e){var i=t.length,r=-1,n=vr.allocUnsafe(t.length);for(t=vr.concat([t,vr.from([e])]);++r<i;)n[r]=t[r]<<1|t[r+1]>>7;return n}br.encrypt=function(t,e,i){for(var r=e.length,n=vr.allocUnsafe(r),o=-1;++o<r;)n[o]=yr(t,e[o],i);return n};var wr={};(function(t){(function(){function e(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}wr.encrypt=function(i,r){for(;i._cache.length<r.length;)i._cache=t.concat([i._cache,e(i)]);var n=i._cache.slice(0,r.length);return i._cache=i._cache.slice(r.length),dr(r,n)}}).call(this)}).call(this,d({}).Buffer);var xr=function(t){for(var e,i=t.length;i--;){if(255!==(e=t.readUInt8(i))){e++,t.writeUInt8(e,i);break}t.writeUInt8(0,i)}},Mr={},kr=y.Buffer;function Sr(t){var e=t._cipher.encryptBlockRaw(t._prev);return xr(t._prev),e}Mr.encrypt=function(t,e){var i=Math.ceil(e.length/16),r=t._cache.length;t._cache=kr.concat([t._cache,kr.allocUnsafe(16*i)]);for(var n=0;n<i;n++){var o=Sr(t),s=r+16*n;t._cache.writeUInt32BE(o[0],s+0),t._cache.writeUInt32BE(o[1],s+4),t._cache.writeUInt32BE(o[2],s+8),t._cache.writeUInt32BE(o[3],s+12)}var a=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),dr(e,a)};var Er={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}},Ar={ECB:{encrypt:function(t,e){return t._cipher.encryptBlock(e)},decrypt:function(t,e){return t._cipher.decryptBlock(e)}},CBC:cr,CFB:hr,CFB8:fr,CFB1:br,OFB:wr,CTR:Mr,GCM:Mr};for(var Tr in Er)Er[Tr].module=Ar[Er[Tr].mode];var Ir={},Cr=y.Buffer;function Rr(t){Cr.isBuffer(t)||(t=Cr.from(t));for(var e=t.length/4|0,i=new Array(e),r=0;r<e;r++)i[r]=t.readUInt32BE(4*r);return i}function Or(t){for(;0<t.length;t++)t[0]=0}function Lr(t,e,i,r,n){for(var o,s,a,l,d=i[0],c=i[1],h=i[2],u=i[3],p=t[0]^e[0],f=t[1]^e[1],m=t[2]^e[2],g=t[3]^e[3],b=4,v=1;v<n;v++)o=d[p>>>24]^c[f>>>16&255]^h[m>>>8&255]^u[255&g]^e[b++],s=d[f>>>24]^c[m>>>16&255]^h[g>>>8&255]^u[255&p]^e[b++],a=d[m>>>24]^c[g>>>16&255]^h[p>>>8&255]^u[255&f]^e[b++],l=d[g>>>24]^c[p>>>16&255]^h[f>>>8&255]^u[255&m]^e[b++],p=o,f=s,m=a,g=l;return o=(r[p>>>24]<<24|r[f>>>16&255]<<16|r[m>>>8&255]<<8|r[255&g])^e[b++],s=(r[f>>>24]<<24|r[m>>>16&255]<<16|r[g>>>8&255]<<8|r[255&p])^e[b++],a=(r[m>>>24]<<24|r[g>>>16&255]<<16|r[p>>>8&255]<<8|r[255&f])^e[b++],l=(r[g>>>24]<<24|r[p>>>16&255]<<16|r[f>>>8&255]<<8|r[255&m])^e[b++],[o>>>=0,s>>>=0,a>>>=0,l>>>=0]}var Pr=[0,1,2,4,8,16,32,64,128,27,54],Br=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var i=[],r=[],n=[[],[],[],[]],o=[[],[],[],[]],s=0,a=0,l=0;l<256;++l){var d=a^a<<1^a<<2^a<<3^a<<4;d=d>>>8^255&d^99,i[s]=d,r[d]=s;var c=t[s],h=t[c],u=t[h],p=257*t[d]^16843008*d;n[0][s]=p<<24|p>>>8,n[1][s]=p<<16|p>>>16,n[2][s]=p<<8|p>>>24,n[3][s]=p,p=16843009*u^65537*h^257*c^16843008*s,o[0][d]=p<<24|p>>>8,o[1][d]=p<<16|p>>>16,o[2][d]=p<<8|p>>>24,o[3][d]=p,0===s?s=a=1:(s=c^t[t[t[u^c]]],a^=t[t[a]])}return{SBOX:i,INV_SBOX:r,SUB_MIX:n,INV_SUB_MIX:o}}();function Nr(t){this._key=Rr(t),this._reset()}Nr.blockSize=16,Nr.keySize=32,Nr.prototype.blockSize=Nr.blockSize,Nr.prototype.keySize=Nr.keySize,Nr.prototype._reset=function(){for(var t=this._key,e=t.length,i=e+6,r=4*(i+1),n=[],o=0;o<e;o++)n[o]=t[o];for(o=e;o<r;o++){var s=n[o-1];o%e==0?(s=s<<8|s>>>24,s=Br.SBOX[s>>>24]<<24|Br.SBOX[s>>>16&255]<<16|Br.SBOX[s>>>8&255]<<8|Br.SBOX[255&s],s^=Pr[o/e|0]<<24):e>6&&o%e==4&&(s=Br.SBOX[s>>>24]<<24|Br.SBOX[s>>>16&255]<<16|Br.SBOX[s>>>8&255]<<8|Br.SBOX[255&s]),n[o]=n[o-e]^s}for(var a=[],l=0;l<r;l++){var d=r-l,c=n[d-(l%4?0:4)];a[l]=l<4||d<=4?c:Br.INV_SUB_MIX[0][Br.SBOX[c>>>24]]^Br.INV_SUB_MIX[1][Br.SBOX[c>>>16&255]]^Br.INV_SUB_MIX[2][Br.SBOX[c>>>8&255]]^Br.INV_SUB_MIX[3][Br.SBOX[255&c]]}this._nRounds=i,this._keySchedule=n,this._invKeySchedule=a},Nr.prototype.encryptBlockRaw=function(t){return Lr(t=Rr(t),this._keySchedule,Br.SUB_MIX,Br.SBOX,this._nRounds)},Nr.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),i=Cr.allocUnsafe(16);return i.writeUInt32BE(e[0],0),i.writeUInt32BE(e[1],4),i.writeUInt32BE(e[2],8),i.writeUInt32BE(e[3],12),i},Nr.prototype.decryptBlock=function(t){var e=(t=Rr(t))[1];t[1]=t[3],t[3]=e;var i=Lr(t,this._invKeySchedule,Br.INV_SUB_MIX,Br.INV_SBOX,this._nRounds),r=Cr.allocUnsafe(16);return r.writeUInt32BE(i[0],0),r.writeUInt32BE(i[3],4),r.writeUInt32BE(i[2],8),r.writeUInt32BE(i[1],12),r},Nr.prototype.scrub=function(){Or(this._keySchedule),Or(this._invKeySchedule),Or(this._key)},Ir.AES=Nr;var $r={},zr=y.Buffer,jr=zr.alloc(16,0);function Fr(t){var e=zr.allocUnsafe(16);return e.writeUInt32BE(t[0]>>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function Dr(t){this.h=t,this.state=zr.alloc(16,0),this.cache=zr.allocUnsafe(0)}Dr.prototype.ghash=function(t){for(var e=-1;++e<t.length;)this.state[e]^=t[e];this._multiply()},Dr.prototype._multiply=function(){for(var t,e,i,r=[(t=this.h).readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)],n=[0,0,0,0],o=-1;++o<128;){for(0!=(this.state[~~(o/8)]&1<<7-o%8)&&(n[0]^=r[0],n[1]^=r[1],n[2]^=r[2],n[3]^=r[3]),i=0!=(1&r[3]),e=3;e>0;e--)r[e]=r[e]>>>1|(1&r[e-1])<<31;r[0]=r[0]>>>1,i&&(r[0]=r[0]^225<<24)}this.state=Fr(n)},Dr.prototype.update=function(t){var e;for(this.cache=zr.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},Dr.prototype.final=function(t,e){return this.cache.length&&this.ghash(zr.concat([this.cache,jr],16)),this.ghash(Fr([0,t,0,e])),this.state},$r=Dr;var qr=y.Buffer;function Ur(t,e,i,r){mi.call(this);var n=qr.alloc(4,0);this._cipher=new Ir.AES(e);var o=this._cipher.encryptBlock(n);this._ghash=new $r(o),i=function(t,e,i){if(12===e.length)return t._finID=qr.concat([e,qr.from([0,0,0,1])]),qr.concat([e,qr.from([0,0,0,2])]);var r=new $r(i),n=e.length,o=n%16;r.update(e),o&&(o=16-o,r.update(qr.alloc(o,0))),r.update(qr.alloc(8,0));var s=8*n,a=qr.alloc(8);a.writeUIntBE(s,0,8),r.update(a),t._finID=r.state;var l=qr.from(t._finID);return xr(l),l}(this,i,o),this._prev=qr.from(i),this._cache=qr.allocUnsafe(0),this._secCache=qr.allocUnsafe(0),this._decrypt=r,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}F(Ur,mi),Ur.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=qr.alloc(e,0),this._ghash.update(e))}this._called=!0;var i=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(i),this._len+=t.length,i},Ur.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=dr(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(t,e){var i=0;t.length!==e.length&&i++;for(var r=Math.min(t.length,e.length),n=0;n<r;++n)i+=t[n]^e[n];return i}(t,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=t,this._cipher.scrub()},Ur.prototype.getAuthTag=function(){if(this._decrypt||!qr.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},Ur.prototype.setAuthTag=function(t){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=t},Ur.prototype.setAAD=function(t){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(t),this._alen+=t.length};var Hr=y.Buffer;function Vr(t,e,i,r){mi.call(this),this._cipher=new Ir.AES(e),this._prev=Hr.from(i),this._cache=Hr.allocUnsafe(0),this._secCache=Hr.allocUnsafe(0),this._decrypt=r,this._mode=t}F(Vr,mi),Vr.prototype._update=function(t){return this._mode.encrypt(this,t,this._decrypt)},Vr.prototype._final=function(){this._cipher.scrub()};var Wr=y.Buffer,Gr=y.Buffer;function Kr(t,e,i){mi.call(this),this._cache=new Zr,this._cipher=new Ir.AES(e),this._prev=Gr.from(i),this._mode=t,this._autopadding=!0}F(Kr,mi),Kr.prototype._update=function(t){var e,i;this._cache.add(t);for(var r=[];e=this._cache.get();)i=this._mode.encrypt(this,e),r.push(i);return Gr.concat(r)};var Xr=Gr.alloc(16,16);function Zr(){this.cache=Gr.allocUnsafe(0)}Kr.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(Xr))throw this._cipher.scrub(),new Error("data not multiple of block length")},Kr.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},Zr.prototype.add=function(t){this.cache=Gr.concat([this.cache,t])},Zr.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},Zr.prototype.flush=function(){for(var t=16-this.cache.length,e=Gr.allocUnsafe(t),i=-1;++i<t;)e.writeUInt8(t,i);return Gr.concat([this.cache,e])};var Yr=y.Buffer;function Jr(t,e,i){mi.call(this),this._cache=new Qr,this._last=void 0,this._cipher=new Ir.AES(e),this._prev=Yr.from(i),this._mode=t,this._autopadding=!0}function Qr(){this.cache=Yr.allocUnsafe(0)}F(Jr,mi),Jr.prototype._update=function(t){var e,i;this._cache.add(t);for(var r=[];e=this._cache.get(this._autopadding);)i=this._mode.decrypt(this,e),r.push(i);return Yr.concat(r)},Jr.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");for(var i=-1;++i<e;)if(t[i+(16-e)]!==e)throw new Error("unable to decrypt data");if(16!==e)return t.slice(0,16-e)}(this._mode.decrypt(this,t));if(t)throw new Error("data not multiple of block length")},Jr.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},Qr.prototype.add=function(t){this.cache=Yr.concat([this.cache,t])},Qr.prototype.get=function(t){var e;if(t){if(this.cache.length>16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},Qr.prototype.flush=function(){if(this.cache.length)return this.cache};var tn={};tn.createCipheriv={}.createCipheriv,tn.createDecipheriv={}.createDecipheriv;var en={exports:{}};!function(t,e){function i(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function r(t,e,i){if(r.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var n;"object"==typeof t?t.exports=r:e.BN=r,r.BN=r,r.wordSize=26;try{n=l({}).Buffer}catch(t){}function o(t,e,i){for(var r=0,n=Math.min(t.length,i),o=e;o<n;o++){var s=t.charCodeAt(o)-48;r<<=4,r|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return r}function s(t,e,i,r){for(var n=0,o=Math.min(t.length,i),s=e;s<o;s++){var a=t.charCodeAt(s)-48;n*=r,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}r.isBN=function(t){return t instanceof r||null!==t&&"object"==typeof t&&t.constructor.wordSize===r.wordSize&&Array.isArray(t.words)},r.max=function(t,e){return t.cmp(e)>0?t:e},r.min=function(t,e){return t.cmp(e)<0?t:e},r.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16);var r=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&r++,16===e?this._parseHex(t,r):this._parseBase(t,e,r),"-"===t[0]&&(this.negative=1),this.strip(),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initArray=function(t,e,i){if(t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,o,s=0;if("be"===i)for(r=t.length-1,n=0;r>=0;r-=3)o=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[n]|=o<<s&67108863,this.words[n+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);else if("le"===i)for(r=0,n=0;r<t.length;r+=3)o=t[r]|t[r+1]<<8|t[r+2]<<16,this.words[n]|=o<<s&67108863,this.words[n+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);return this.strip()},r.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var r,n,s=0;for(i=t.length-6,r=0;i>=e;i-=6)n=o(t,i,i+6),this.words[r]|=n<<s&67108863,this.words[r+1]|=n>>>26-s&4194303,(s+=24)>=26&&(s-=26,r++);i+6!==e&&(n=o(t,e,i+6),this.words[r]|=n<<s&67108863,this.words[r+1]|=n>>>26-s&4194303),this.strip()},r.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var o=t.length-i,a=o%r,l=Math.min(o,o-a)+i,d=0,c=i;c<l;c+=r)d=s(t,c,c+r,e),this.imuln(n),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(0!==a){var h=1;for(d=s(t,c,t.length,e),c=0;c<a;c++)h*=e;this.imuln(h),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}},r.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},r.prototype.clone=function(){var t=new r(null);return this.copy(t),t},r.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},r.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},r.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},r.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var a=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,l=s/67108864|0;i.words[0]=a;for(var d=1;d<r;d++){for(var c=l>>>26,h=67108863&l,u=Math.min(d,e.length-1),p=Math.max(0,d-t.length+1);p<=u;p++){var f=d-p|0;c+=(s=(n=0|t.words[f])*(o=0|e.words[p])+h)/67108864|0,h=67108863&s}i.words[d]=0|h,l=0|c}return 0!==l?i.words[d]=0|l:i.length--,i.strip()}r.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var r=0,n=0,o=0;o<this.length;o++){var s=this.words[o],l=(16777215&(s<<r|n)).toString(16);i=0!=(n=s>>>24-r&16777215)||o!==this.length-1?a[6-l.length]+l+i:l+i,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(i=n.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var h=d[t],u=c[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var f=p.modn(u).toString(t);i=(p=p.idivn(u)).isZero()?f+i:a[h-f.length]+f+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}},r.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length,0!==this.negative?-t:t},r.prototype.toJSON=function(){return this.toString(16)},r.prototype.toBuffer=function(t,e){return this.toArrayLike(n,t,e)},r.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},r.prototype.toArrayLike=function(t,e,i){var r=this.byteLength(),n=i||Math.max(1,r);this.strip();var o,s,a="le"===e,l=new t(n),d=this.clone();if(a){for(s=0;!d.isZero();s++)o=d.andln(255),d.iushrn(8),l[s]=o;for(;s<n;s++)l[s]=0}else{for(s=0;s<n-r;s++)l[s]=0;for(s=0;!d.isZero();s++)o=d.andln(255),d.iushrn(8),l[n-s-1]=o}return l},Math.clz32?r.prototype._countBits=function(t){return 32-Math.clz32(t)}:r.prototype._countBits=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},r.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},r.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var i=this._zeroBits(this.words[e]);if(t+=i,26!==i)break}return t},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},r.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return 0!==this.negative},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},r.prototype.ior=function(t){return this.iuor(t)},r.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},r.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},r.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;i<e.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=e.length,this.strip()},r.prototype.iand=function(t){return this.iuand(t)},r.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},r.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},r.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;r<i.length;r++)this.words[r]=e.words[r]^i.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},r.prototype.ixor=function(t){return this.iuxor(t)},r.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},r.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},r.prototype.inotn=function(t){var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var r=0;r<e;r++)this.words[r]=67108863&~this.words[r];return i>0&&(this.words[r]=~this.words[r]&67108863>>26-i),this.strip()},r.prototype.notn=function(t){return this.clone().inotn(t)},r.prototype.setn=function(t,e){var i=t/26|0,r=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<r:this.words[i]&~(1<<r),this.strip()},r.prototype.iadd=function(t){var e,i,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0,o=0;o<r.length;o++)e=(0|i.words[o])+(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<i.length;o++)e=(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this},r.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},r.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var o=0,s=0;s<r.length;s++)o=(e=(0|i.words[s])-(0|r.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<i.length;s++)o=(e=(0|i.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<i.length&&i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this.length=Math.max(this.length,s),i!==this&&(this.negative=1),this.strip()},r.prototype.sub=function(t){return this.clone().isub(t)};var u=function(t,e,i){var r,n,o,s=t.words,a=e.words,l=i.words,d=0,c=0|s[0],h=8191&c,u=c>>>13,p=0|s[1],f=8191&p,m=p>>>13,g=0|s[2],b=8191&g,v=g>>>13,y=0|s[3],_=8191&y,w=y>>>13,x=0|s[4],M=8191&x,k=x>>>13,S=0|s[5],E=8191&S,A=S>>>13,T=0|s[6],I=8191&T,C=T>>>13,R=0|s[7],O=8191&R,L=R>>>13,P=0|s[8],B=8191&P,N=P>>>13,$=0|s[9],z=8191&$,j=$>>>13,F=0|a[0],D=8191&F,q=F>>>13,U=0|a[1],H=8191&U,V=U>>>13,W=0|a[2],G=8191&W,K=W>>>13,X=0|a[3],Z=8191&X,Y=X>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],it=8191&et,rt=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],lt=8191&at,dt=at>>>13,ct=0|a[8],ht=8191&ct,ut=ct>>>13,pt=0|a[9],ft=8191&pt,mt=pt>>>13;i.negative=t.negative^e.negative,i.length=19;var gt=(d+(r=Math.imul(h,D))|0)+((8191&(n=(n=Math.imul(h,q))+Math.imul(u,D)|0))<<13)|0;d=((o=Math.imul(u,q))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(f,D),n=(n=Math.imul(f,q))+Math.imul(m,D)|0,o=Math.imul(m,q);var bt=(d+(r=r+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,V)|0)+Math.imul(u,H)|0))<<13)|0;d=((o=o+Math.imul(u,V)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,D),n=(n=Math.imul(b,q))+Math.imul(v,D)|0,o=Math.imul(v,q),r=r+Math.imul(f,H)|0,n=(n=n+Math.imul(f,V)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,V)|0;var vt=(d+(r=r+Math.imul(h,G)|0)|0)+((8191&(n=(n=n+Math.imul(h,K)|0)+Math.imul(u,G)|0))<<13)|0;d=((o=o+Math.imul(u,K)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(_,D),n=(n=Math.imul(_,q))+Math.imul(w,D)|0,o=Math.imul(w,q),r=r+Math.imul(b,H)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,n=(n=n+Math.imul(f,K)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,K)|0;var yt=(d+(r=r+Math.imul(h,Z)|0)|0)+((8191&(n=(n=n+Math.imul(h,Y)|0)+Math.imul(u,Z)|0))<<13)|0;d=((o=o+Math.imul(u,Y)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(M,D),n=(n=Math.imul(M,q))+Math.imul(k,D)|0,o=Math.imul(k,q),r=r+Math.imul(_,H)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,H)|0,o=o+Math.imul(w,V)|0,r=r+Math.imul(b,G)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,K)|0,r=r+Math.imul(f,Z)|0,n=(n=n+Math.imul(f,Y)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,Y)|0;var _t=(d+(r=r+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(u,Q)|0))<<13)|0;d=((o=o+Math.imul(u,tt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(E,D),n=(n=Math.imul(E,q))+Math.imul(A,D)|0,o=Math.imul(A,q),r=r+Math.imul(M,H)|0,n=(n=n+Math.imul(M,V)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(_,G)|0,n=(n=n+Math.imul(_,K)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,K)|0,r=r+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,Y)|0,r=r+Math.imul(f,Q)|0,n=(n=n+Math.imul(f,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var wt=(d+(r=r+Math.imul(h,it)|0)|0)+((8191&(n=(n=n+Math.imul(h,rt)|0)+Math.imul(u,it)|0))<<13)|0;d=((o=o+Math.imul(u,rt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(I,D),n=(n=Math.imul(I,q))+Math.imul(C,D)|0,o=Math.imul(C,q),r=r+Math.imul(E,H)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,V)|0,r=r+Math.imul(M,G)|0,n=(n=n+Math.imul(M,K)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,K)|0,r=r+Math.imul(_,Z)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,Y)|0,r=r+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(f,it)|0,n=(n=n+Math.imul(f,rt)|0)+Math.imul(m,it)|0,o=o+Math.imul(m,rt)|0;var xt=(d+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,st)|0)+Math.imul(u,ot)|0))<<13)|0;d=((o=o+Math.imul(u,st)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(O,D),n=(n=Math.imul(O,q))+Math.imul(L,D)|0,o=Math.imul(L,q),r=r+Math.imul(I,H)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(C,H)|0,o=o+Math.imul(C,V)|0,r=r+Math.imul(E,G)|0,n=(n=n+Math.imul(E,K)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,K)|0,r=r+Math.imul(M,Z)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,Y)|0,r=r+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(b,it)|0,n=(n=n+Math.imul(b,rt)|0)+Math.imul(v,it)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(f,ot)|0,n=(n=n+Math.imul(f,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Mt=(d+(r=r+Math.imul(h,lt)|0)|0)+((8191&(n=(n=n+Math.imul(h,dt)|0)+Math.imul(u,lt)|0))<<13)|0;d=((o=o+Math.imul(u,dt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(B,D),n=(n=Math.imul(B,q))+Math.imul(N,D)|0,o=Math.imul(N,q),r=r+Math.imul(O,H)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,V)|0,r=r+Math.imul(I,G)|0,n=(n=n+Math.imul(I,K)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,K)|0,r=r+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,Y)|0,r=r+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(_,it)|0,n=(n=n+Math.imul(_,rt)|0)+Math.imul(w,it)|0,o=o+Math.imul(w,rt)|0,r=r+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,r=r+Math.imul(f,lt)|0,n=(n=n+Math.imul(f,dt)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,dt)|0;var kt=(d+(r=r+Math.imul(h,ht)|0)|0)+((8191&(n=(n=n+Math.imul(h,ut)|0)+Math.imul(u,ht)|0))<<13)|0;d=((o=o+Math.imul(u,ut)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(z,D),n=(n=Math.imul(z,q))+Math.imul(j,D)|0,o=Math.imul(j,q),r=r+Math.imul(B,H)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(O,G)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,K)|0,r=r+Math.imul(I,Z)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,Y)|0,r=r+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(M,it)|0,n=(n=n+Math.imul(M,rt)|0)+Math.imul(k,it)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(_,ot)|0,n=(n=n+Math.imul(_,st)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,st)|0,r=r+Math.imul(b,lt)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,dt)|0,r=r+Math.imul(f,ht)|0,n=(n=n+Math.imul(f,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var St=(d+(r=r+Math.imul(h,ft)|0)|0)+((8191&(n=(n=n+Math.imul(h,mt)|0)+Math.imul(u,ft)|0))<<13)|0;d=((o=o+Math.imul(u,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(z,H),n=(n=Math.imul(z,V))+Math.imul(j,H)|0,o=Math.imul(j,V),r=r+Math.imul(B,G)|0,n=(n=n+Math.imul(B,K)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,K)|0,r=r+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,Y)|0,r=r+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,r=r+Math.imul(E,it)|0,n=(n=n+Math.imul(E,rt)|0)+Math.imul(A,it)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,r=r+Math.imul(_,lt)|0,n=(n=n+Math.imul(_,dt)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,dt)|0,r=r+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,ut)|0;var Et=(d+(r=r+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,mt)|0)+Math.imul(m,ft)|0))<<13)|0;d=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(z,G),n=(n=Math.imul(z,K))+Math.imul(j,G)|0,o=Math.imul(j,K),r=r+Math.imul(B,Z)|0,n=(n=n+Math.imul(B,Y)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,Y)|0,r=r+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,r=r+Math.imul(I,it)|0,n=(n=n+Math.imul(I,rt)|0)+Math.imul(C,it)|0,o=o+Math.imul(C,rt)|0,r=r+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,r=r+Math.imul(M,lt)|0,n=(n=n+Math.imul(M,dt)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,dt)|0,r=r+Math.imul(_,ht)|0,n=(n=n+Math.imul(_,ut)|0)+Math.imul(w,ht)|0,o=o+Math.imul(w,ut)|0;var At=(d+(r=r+Math.imul(b,ft)|0)|0)+((8191&(n=(n=n+Math.imul(b,mt)|0)+Math.imul(v,ft)|0))<<13)|0;d=((o=o+Math.imul(v,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(z,Z),n=(n=Math.imul(z,Y))+Math.imul(j,Z)|0,o=Math.imul(j,Y),r=r+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(O,it)|0,n=(n=n+Math.imul(O,rt)|0)+Math.imul(L,it)|0,o=o+Math.imul(L,rt)|0,r=r+Math.imul(I,ot)|0,n=(n=n+Math.imul(I,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,r=r+Math.imul(E,lt)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,dt)|0,r=r+Math.imul(M,ht)|0,n=(n=n+Math.imul(M,ut)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,ut)|0;var Tt=(d+(r=r+Math.imul(_,ft)|0)|0)+((8191&(n=(n=n+Math.imul(_,mt)|0)+Math.imul(w,ft)|0))<<13)|0;d=((o=o+Math.imul(w,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(z,Q),n=(n=Math.imul(z,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),r=r+Math.imul(B,it)|0,n=(n=n+Math.imul(B,rt)|0)+Math.imul(N,it)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,r=r+Math.imul(I,lt)|0,n=(n=n+Math.imul(I,dt)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,dt)|0,r=r+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,ut)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ut)|0;var It=(d+(r=r+Math.imul(M,ft)|0)|0)+((8191&(n=(n=n+Math.imul(M,mt)|0)+Math.imul(k,ft)|0))<<13)|0;d=((o=o+Math.imul(k,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(z,it),n=(n=Math.imul(z,rt))+Math.imul(j,it)|0,o=Math.imul(j,rt),r=r+Math.imul(B,ot)|0,n=(n=n+Math.imul(B,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,r=r+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(L,lt)|0,o=o+Math.imul(L,dt)|0,r=r+Math.imul(I,ht)|0,n=(n=n+Math.imul(I,ut)|0)+Math.imul(C,ht)|0,o=o+Math.imul(C,ut)|0;var Ct=(d+(r=r+Math.imul(E,ft)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(A,ft)|0))<<13)|0;d=((o=o+Math.imul(A,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(z,ot),n=(n=Math.imul(z,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),r=r+Math.imul(B,lt)|0,n=(n=n+Math.imul(B,dt)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,dt)|0,r=r+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(L,ht)|0,o=o+Math.imul(L,ut)|0;var Rt=(d+(r=r+Math.imul(I,ft)|0)|0)+((8191&(n=(n=n+Math.imul(I,mt)|0)+Math.imul(C,ft)|0))<<13)|0;d=((o=o+Math.imul(C,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(z,lt),n=(n=Math.imul(z,dt))+Math.imul(j,lt)|0,o=Math.imul(j,dt),r=r+Math.imul(B,ht)|0,n=(n=n+Math.imul(B,ut)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,ut)|0;var Ot=(d+(r=r+Math.imul(O,ft)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(L,ft)|0))<<13)|0;d=((o=o+Math.imul(L,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(z,ht),n=(n=Math.imul(z,ut))+Math.imul(j,ht)|0,o=Math.imul(j,ut);var Lt=(d+(r=r+Math.imul(B,ft)|0)|0)+((8191&(n=(n=n+Math.imul(B,mt)|0)+Math.imul(N,ft)|0))<<13)|0;d=((o=o+Math.imul(N,mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Pt=(d+(r=Math.imul(z,ft))|0)+((8191&(n=(n=Math.imul(z,mt))+Math.imul(j,ft)|0))<<13)|0;return d=((o=Math.imul(j,mt))+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,l[0]=gt,l[1]=bt,l[2]=vt,l[3]=yt,l[4]=_t,l[5]=wt,l[6]=xt,l[7]=Mt,l[8]=kt,l[9]=St,l[10]=Et,l[11]=At,l[12]=Tt,l[13]=It,l[14]=Ct,l[15]=Rt,l[16]=Ot,l[17]=Lt,l[18]=Pt,0!==d&&(l[19]=d,i.length++),i};function p(t,e,i){return(new f).mulp(t,e,i)}function f(t,e){this.x=t,this.y=e}Math.imul||(u=h),r.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?u(this,t,e):i<63?h(this,t,e):i<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,o=0;o<i.length-1;o++){var s=n;n=0;for(var a=67108863&r,l=Math.min(o,e.length-1),d=Math.max(0,o-t.length+1);d<=l;d++){var c=o-d,h=(0|t.words[c])*(0|e.words[d]),u=67108863&h;a=67108863&(u=u+a|0),n+=(s=(s=s+(h/67108864|0)|0)+(u>>>26)|0)>>>26,s&=67108863}i.words[o]=a,r=s,s=n}return 0!==r?i.words[o]=r:i.length--,i.strip()}(this,t,e):p(this,t,e)},f.prototype.makeRBT=function(t){for(var e=new Array(t),i=r.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,i,t);return e},f.prototype.revBin=function(t,e,i){if(0===t||t===i-1)return t;for(var r=0,n=0;n<e;n++)r|=(1&t)<<e-n-1,t>>=1;return r},f.prototype.permute=function(t,e,i,r,n,o){for(var s=0;s<o;s++)r[s]=e[t[s]],n[s]=i[t[s]]},f.prototype.transform=function(t,e,i,r,n,o){this.permute(o,t,e,i,r,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,l=Math.cos(2*Math.PI/a),d=Math.sin(2*Math.PI/a),c=0;c<n;c+=a)for(var h=l,u=d,p=0;p<s;p++){var f=i[c+p],m=r[c+p],g=i[c+p+s],b=r[c+p+s],v=h*g-u*b;b=h*b+u*g,g=v,i[c+p]=f+g,r[c+p]=m+b,i[c+p+s]=f-g,r[c+p+s]=m-b,p!==a&&(v=l*h-d*u,u=l*u+d*h,h=v)}},f.prototype.guessLen13b=function(t,e){var i=1|Math.max(e,t),r=1&i,n=0;for(i=i/2|0;i;i>>>=1)n++;return 1<<n+1+r},f.prototype.conjugate=function(t,e,i){if(!(i<=1))for(var r=0;r<i/2;r++){var n=t[r];t[r]=t[i-r-1],t[i-r-1]=n,n=e[r],e[r]=-e[i-r-1],e[i-r-1]=-n}},f.prototype.normalize13b=function(t,e){for(var i=0,r=0;r<e/2;r++){var n=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+i;t[r]=67108863&n,i=n<67108864?0:n/67108864|0}return t},f.prototype.convert13b=function(t,e,i,r){for(var n=0,o=0;o<e;o++)n+=0|t[o],i[2*o]=8191&n,n>>>=13,i[2*o+1]=8191&n,n>>>=13;for(o=2*e;o<r;++o)i[o]=0},f.prototype.stub=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=0;return e},f.prototype.mulp=function(t,e,i){var r=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(r),o=this.stub(r),s=new Array(r),a=new Array(r),l=new Array(r),d=new Array(r),c=new Array(r),h=new Array(r),u=i.words;u.length=r,this.convert13b(t.words,t.length,s,r),this.convert13b(e.words,e.length,d,r),this.transform(s,o,a,l,r,n),this.transform(d,o,c,h,r,n);for(var p=0;p<r;p++){var f=a[p]*c[p]-l[p]*h[p];l[p]=a[p]*h[p]+l[p]*c[p],a[p]=f}return this.conjugate(a,l,r),this.transform(a,l,u,o,r,n),this.conjugate(u,o,r),this.normalize13b(u,r),i.negative=t.negative^e.negative,i.length=t.length+e.length,i.strip()},r.prototype.mul=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},r.prototype.mulf=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),p(this,t,e)},r.prototype.imul=function(t){return this.clone().mulTo(t,this)},r.prototype.imuln=function(t){for(var e=0,i=0;i<this.length;i++){var r=(0|this.words[i])*t,n=(67108863&r)+(67108863&e);e>>=26,e+=r/67108864|0,e+=n>>>26,this.words[i]=67108863&n}return 0!==e&&(this.words[i]=e,this.length++),this},r.prototype.muln=function(t){return this.clone().imuln(t)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i<e.length;i++){var r=i/26|0,n=i%26;e[i]=(t.words[r]&1<<n)>>>n}return e}(t);if(0===e.length)return new r(1);for(var i=this,n=0;n<e.length&&0===e[n];n++,i=i.sqr());if(++n<e.length)for(var o=i.sqr();n<e.length;n++,o=o.sqr())0!==e[n]&&(i=i.mul(o));return i},r.prototype.iushln=function(t){var e,i=t%26,r=(t-i)/26,n=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e<this.length;e++){var s=this.words[e]&n,a=(0|this.words[e])-s<<i;this.words[e]=a|o,o=s>>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e<r;e++)this.words[e]=0;this.length+=r}return this.strip()},r.prototype.ishln=function(t){return this.iushln(t)},r.prototype.iushrn=function(t,e,i){var r;r=e?(e-e%26)/26:0;var n=t%26,o=Math.min((t-n)/26,this.length),s=67108863^67108863>>>n<<n,a=i;if(r-=o,r=Math.max(0,r),a){for(var l=0;l<o;l++)a.words[l]=this.words[l];a.length=o}if(0===o);else if(this.length>o)for(this.length-=o,l=0;l<this.length;l++)this.words[l]=this.words[l+o];else this.words[0]=0,this.length=1;var d=0;for(l=this.length-1;l>=0&&(0!==d||l>=r);l--){var c=0|this.words[l];this.words[l]=d<<26-n|c>>>n,d=c&s}return a&&0!==d&&(a.words[a.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},r.prototype.ishrn=function(t,e,i){return this.iushrn(t,e,i)},r.prototype.shln=function(t){return this.clone().ishln(t)},r.prototype.ushln=function(t){return this.clone().iushln(t)},r.prototype.shrn=function(t){return this.clone().ishrn(t)},r.prototype.ushrn=function(t){return this.clone().iushrn(t)},r.prototype.testn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;return!(this.length<=i||!(this.words[i]&r))},r.prototype.imaskn=function(t){var e=t%26,i=(t-e)/26;if(this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var r=67108863^67108863>>>e<<e;this.words[this.length-1]&=r}return this.strip()},r.prototype.maskn=function(t){return this.clone().imaskn(t)},r.prototype.iaddn=function(t){return t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},r.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},r.prototype.isubn=function(t){if(t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},r.prototype.addn=function(t){return this.clone().iaddn(t)},r.prototype.subn=function(t){return this.clone().isubn(t)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(t,e,i){var r,n,o=t.length+i;this._expand(o);var s=0;for(r=0;r<t.length;r++){n=(0|this.words[r+i])+s;var a=(0|t.words[r])*e;s=((n-=67108863&a)>>26)-(a/67108864|0),this.words[r+i]=67108863&n}for(;r<this.length-i;r++)s=(n=(0|this.words[r+i])+s)>>26,this.words[r+i]=67108863&n;if(0===s)return this.strip();for(s=0,r=0;r<this.length;r++)s=(n=-(0|this.words[r])+s)>>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},r.prototype._wordDiv=function(t,e){var i=(this.length,t.length),n=this.clone(),o=t,s=0|o.words[o.length-1];0!=(i=26-this._countBits(s))&&(o=o.ushln(i),n.iushln(i),s=0|o.words[o.length-1]);var a,l=n.length-o.length;if("mod"!==e){(a=new r(null)).length=l+1,a.words=new Array(a.length);for(var d=0;d<a.length;d++)a.words[d]=0}var c=n.clone()._ishlnsubmul(o,1,l);0===c.negative&&(n=c,a&&(a.words[l]=1));for(var h=l-1;h>=0;h--){var u=67108864*(0|n.words[o.length+h])+(0|n.words[o.length+h-1]);for(u=Math.min(u/s|0,67108863),n._ishlnsubmul(o,u,h);0!==n.negative;)u--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=u)}return a&&a.strip(),n.strip(),"div"!==e&&0!==i&&n.iushrn(i),{div:a||null,mod:n}},r.prototype.divmod=function(t,e,i){return this.isZero()?{div:new r(0),mod:new r(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(o=s.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new r(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new r(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new r(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,s},r.prototype.div=function(t){return this.divmod(t,"div",!1).div},r.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},r.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},r.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),o=i.cmp(r);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},r.prototype.modn=function(t){for(var e=(1<<26)%t,i=0,r=this.length-1;r>=0;r--)i=(e*i+(0|this.words[r]))%t;return i},r.prototype.idivn=function(t){for(var e=0,i=this.length-1;i>=0;i--){var r=(0|this.words[i])+67108864*e;this.words[i]=r/t|0,e=r%t}return this.strip()},r.prototype.divn=function(t){return this.clone().idivn(t)},r.prototype.egcd=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new r(1),o=new r(0),s=new r(0),a=new r(1),l=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++l;for(var d=i.clone(),c=e.clone();!e.isZero();){for(var h=0,u=1;0==(e.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(d),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,f=1;0==(i.words[0]&f)&&p<26;++p,f<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(s.isOdd()||a.isOdd())&&(s.iadd(d),a.isub(c)),s.iushrn(1),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(s),o.isub(a)):(i.isub(e),s.isub(n),a.isub(o))}return{a:s,b:a,gcd:i.iushln(l)}},r.prototype._invmp=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new r(1),s=new r(0),a=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(a),o.iushrn(1);for(var c=0,h=1;0==(i.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(i.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(a),s.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(s)):(i.isub(e),s.isub(o))}return(n=0===e.cmpn(1)?o:s).cmpn(0)<0&&n.iadd(t),n},r.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var o=e;e=i,i=o}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},r.prototype.invm=function(t){return this.egcd(t).a.umod(t)},r.prototype.isEven=function(){return 0==(1&this.words[0])},r.prototype.isOdd=function(){return 1==(1&this.words[0])},r.prototype.andln=function(t){return this.words[0]&t},r.prototype.bincn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=r,this;for(var n=r,o=i;0!==n&&o<this.length;o++){var s=0|this.words[o];n=(s+=n)>>>26,s&=67108863,this.words[o]=s}return 0!==n&&(this.words[o]=n,this.length++),this},r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},r.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t);var r=0|this.words[0];e=r===t?0:r<t?-1:1}return 0!==this.negative?0|-e:e},r.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},r.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){r<n?e=-1:r>n&&(e=1);break}}return e},r.prototype.gtn=function(t){return 1===this.cmpn(t)},r.prototype.gt=function(t){return 1===this.cmp(t)},r.prototype.gten=function(t){return this.cmpn(t)>=0},r.prototype.gte=function(t){return this.cmp(t)>=0},r.prototype.ltn=function(t){return-1===this.cmpn(t)},r.prototype.lt=function(t){return-1===this.cmp(t)},r.prototype.lten=function(t){return this.cmpn(t)<=0},r.prototype.lte=function(t){return this.cmp(t)<=0},r.prototype.eqn=function(t){return 0===this.cmpn(t)},r.prototype.eq=function(t){return 0===this.cmp(t)},r.red=function(t){return new w(t)},r.prototype.toRed=function(t){return t.convertTo(this)._forceRed(t)},r.prototype.fromRed=function(){return this.red.convertFrom(this)},r.prototype._forceRed=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return this._forceRed(t)},r.prototype.redAdd=function(t){return this.red.add(this,t)},r.prototype.redIAdd=function(t){return this.red.iadd(this,t)},r.prototype.redSub=function(t){return this.red.sub(this,t)},r.prototype.redISub=function(t){return this.red.isub(this,t)},r.prototype.redShl=function(t){return this.red.shl(this,t)},r.prototype.redMul=function(t){return this.red._verify2(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return this.red._verify2(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(t){return this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new r(e,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function y(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=r._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function x(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new r(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},i(b,g),b.prototype.split=function(t,e){for(var i=Math.min(t.length,9),r=0;r<i;r++)e.words[r]=t.words[r];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(e.words[e.length++]=4194303&n,r=10;r<t.length;r++){var o=0|t.words[r];t.words[r-10]=(4194303&o)<<4|n>>>22,n=o}n>>>=22,t.words[r-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i<t.length;i++){var r=0|t.words[i];e+=977*r,t.words[i]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(v,g),i(y,g),i(_,g),_.prototype.imulK=function(t){for(var e=0,i=0;i<t.length;i++){var r=19*(0|t.words[i])+e,n=67108863&r;r>>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},r._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new v;else if("p192"===t)e=new y;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return m[t]=e,e},w.prototype._verify1=function(t){},w.prototype._verify2=function(t,e){},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},w.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();if(3===this.m.andln(3)){var e=this.m.add(new r(1)).iushrn(2);return this.pow(t,e)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);var o=new r(1).toRed(this),s=o.redNeg(),a=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new r(2*l*l).toRed(this);0!==this.pow(l,a).cmp(s);)l.redIAdd(s);for(var d=this.pow(l,i),c=this.pow(t,i.addn(1).iushrn(1)),h=this.pow(t,i),u=n;0!==h.cmp(o);){for(var p=h,f=0;0!==p.cmp(o);f++)p=p.redSqr();var m=this.pow(d,new r(1).iushln(u-f-1));c=c.redMul(m),d=m.redSqr(),h=h.redMul(d),u=f}return c},w.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},w.prototype.pow=function(t,e){if(e.isZero())return new r(1).toRed(this);if(0===e.cmpn(1))return t.clone();var i=new Array(16);i[0]=new r(1).toRed(this),i[1]=t;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],t);var o=i[0],s=0,a=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var d=e.words[n],c=l-1;c>=0;c--){var h=d>>c&1;o!==i[0]&&(o=this.sqr(o)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===n&&0===c)&&(o=this.mul(o,i[s]),a=0,s=0)):a=0}l=26}return o},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},r.mont=function(t){return new x(t)},i(x,w),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0)._forceRed(this);var i=t.mul(e),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(en,this),en=en.exports;var rn,nn,on={exports:{}};function sn(t){this.rand=t}if(function(t,e){function i(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function r(t,e,i){if(r.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var n;"object"==typeof t?t.exports=r:e.BN=r,r.BN=r,r.wordSize=26;try{n=l({}).Buffer}catch(t){}function o(t,e,i){for(var r=0,n=Math.min(t.length,i),o=e;o<n;o++){var s=t.charCodeAt(o)-48;r<<=4,r|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return r}function s(t,e,i,r){for(var n=0,o=Math.min(t.length,i),s=e;s<o;s++){var a=t.charCodeAt(s)-48;n*=r,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}r.isBN=function(t){return t instanceof r||null!==t&&"object"==typeof t&&t.constructor.wordSize===r.wordSize&&Array.isArray(t.words)},r.max=function(t,e){return t.cmp(e)>0?t:e},r.min=function(t,e){return t.cmp(e)<0?t:e},r.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16);var r=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&r++,16===e?this._parseHex(t,r):this._parseBase(t,e,r),"-"===t[0]&&(this.negative=1),this.strip(),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initArray=function(t,e,i){if(t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,o,s=0;if("be"===i)for(r=t.length-1,n=0;r>=0;r-=3)o=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[n]|=o<<s&67108863,this.words[n+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);else if("le"===i)for(r=0,n=0;r<t.length;r+=3)o=t[r]|t[r+1]<<8|t[r+2]<<16,this.words[n]|=o<<s&67108863,this.words[n+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);return this.strip()},r.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var r,n,s=0;for(i=t.length-6,r=0;i>=e;i-=6)n=o(t,i,i+6),this.words[r]|=n<<s&67108863,this.words[r+1]|=n>>>26-s&4194303,(s+=24)>=26&&(s-=26,r++);i+6!==e&&(n=o(t,e,i+6),this.words[r]|=n<<s&67108863,this.words[r+1]|=n>>>26-s&4194303),this.strip()},r.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var o=t.length-i,a=o%r,l=Math.min(o,o-a)+i,d=0,c=i;c<l;c+=r)d=s(t,c,c+r,e),this.imuln(n),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(0!==a){var h=1;for(d=s(t,c,t.length,e),c=0;c<a;c++)h*=e;this.imuln(h),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}},r.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},r.prototype.clone=function(){var t=new r(null);return this.copy(t),t},r.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},r.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},r.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},r.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var a=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,l=s/67108864|0;i.words[0]=a;for(var d=1;d<r;d++){for(var c=l>>>26,h=67108863&l,u=Math.min(d,e.length-1),p=Math.max(0,d-t.length+1);p<=u;p++){var f=d-p|0;c+=(s=(n=0|t.words[f])*(o=0|e.words[p])+h)/67108864|0,h=67108863&s}i.words[d]=0|h,l=0|c}return 0!==l?i.words[d]=0|l:i.length--,i.strip()}r.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var r=0,n=0,o=0;o<this.length;o++){var s=this.words[o],l=(16777215&(s<<r|n)).toString(16);i=0!=(n=s>>>24-r&16777215)||o!==this.length-1?a[6-l.length]+l+i:l+i,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(i=n.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var h=d[t],u=c[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var f=p.modn(u).toString(t);i=(p=p.idivn(u)).isZero()?f+i:a[h-f.length]+f+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}},r.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length,0!==this.negative?-t:t},r.prototype.toJSON=function(){return this.toString(16)},r.prototype.toBuffer=function(t,e){return this.toArrayLike(n,t,e)},r.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},r.prototype.toArrayLike=function(t,e,i){var r=this.byteLength(),n=i||Math.max(1,r);this.strip();var o,s,a="le"===e,l=new t(n),d=this.clone();if(a){for(s=0;!d.isZero();s++)o=d.andln(255),d.iushrn(8),l[s]=o;for(;s<n;s++)l[s]=0}else{for(s=0;s<n-r;s++)l[s]=0;for(s=0;!d.isZero();s++)o=d.andln(255),d.iushrn(8),l[n-s-1]=o}return l},Math.clz32?r.prototype._countBits=function(t){return 32-Math.clz32(t)}:r.prototype._countBits=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},r.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},r.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var i=this._zeroBits(this.words[e]);if(t+=i,26!==i)break}return t},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},r.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return 0!==this.negative},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},r.prototype.ior=function(t){return this.iuor(t)},r.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},r.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},r.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;i<e.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=e.length,this.strip()},r.prototype.iand=function(t){return this.iuand(t)},r.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},r.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},r.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;r<i.length;r++)this.words[r]=e.words[r]^i.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},r.prototype.ixor=function(t){return this.iuxor(t)},r.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},r.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},r.prototype.inotn=function(t){var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var r=0;r<e;r++)this.words[r]=67108863&~this.words[r];return i>0&&(this.words[r]=~this.words[r]&67108863>>26-i),this.strip()},r.prototype.notn=function(t){return this.clone().inotn(t)},r.prototype.setn=function(t,e){var i=t/26|0,r=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<r:this.words[i]&~(1<<r),this.strip()},r.prototype.iadd=function(t){var e,i,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0,o=0;o<r.length;o++)e=(0|i.words[o])+(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<i.length;o++)e=(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this},r.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},r.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var o=0,s=0;s<r.length;s++)o=(e=(0|i.words[s])-(0|r.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<i.length;s++)o=(e=(0|i.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<i.length&&i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this.length=Math.max(this.length,s),i!==this&&(this.negative=1),this.strip()},r.prototype.sub=function(t){return this.clone().isub(t)};var u=function(t,e,i){var r,n,o,s=t.words,a=e.words,l=i.words,d=0,c=0|s[0],h=8191&c,u=c>>>13,p=0|s[1],f=8191&p,m=p>>>13,g=0|s[2],b=8191&g,v=g>>>13,y=0|s[3],_=8191&y,w=y>>>13,x=0|s[4],M=8191&x,k=x>>>13,S=0|s[5],E=8191&S,A=S>>>13,T=0|s[6],I=8191&T,C=T>>>13,R=0|s[7],O=8191&R,L=R>>>13,P=0|s[8],B=8191&P,N=P>>>13,$=0|s[9],z=8191&$,j=$>>>13,F=0|a[0],D=8191&F,q=F>>>13,U=0|a[1],H=8191&U,V=U>>>13,W=0|a[2],G=8191&W,K=W>>>13,X=0|a[3],Z=8191&X,Y=X>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],it=8191&et,rt=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],lt=8191&at,dt=at>>>13,ct=0|a[8],ht=8191&ct,ut=ct>>>13,pt=0|a[9],ft=8191&pt,mt=pt>>>13;i.negative=t.negative^e.negative,i.length=19;var gt=(d+(r=Math.imul(h,D))|0)+((8191&(n=(n=Math.imul(h,q))+Math.imul(u,D)|0))<<13)|0;d=((o=Math.imul(u,q))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(f,D),n=(n=Math.imul(f,q))+Math.imul(m,D)|0,o=Math.imul(m,q);var bt=(d+(r=r+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,V)|0)+Math.imul(u,H)|0))<<13)|0;d=((o=o+Math.imul(u,V)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,D),n=(n=Math.imul(b,q))+Math.imul(v,D)|0,o=Math.imul(v,q),r=r+Math.imul(f,H)|0,n=(n=n+Math.imul(f,V)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,V)|0;var vt=(d+(r=r+Math.imul(h,G)|0)|0)+((8191&(n=(n=n+Math.imul(h,K)|0)+Math.imul(u,G)|0))<<13)|0;d=((o=o+Math.imul(u,K)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(_,D),n=(n=Math.imul(_,q))+Math.imul(w,D)|0,o=Math.imul(w,q),r=r+Math.imul(b,H)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,n=(n=n+Math.imul(f,K)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,K)|0;var yt=(d+(r=r+Math.imul(h,Z)|0)|0)+((8191&(n=(n=n+Math.imul(h,Y)|0)+Math.imul(u,Z)|0))<<13)|0;d=((o=o+Math.imul(u,Y)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(M,D),n=(n=Math.imul(M,q))+Math.imul(k,D)|0,o=Math.imul(k,q),r=r+Math.imul(_,H)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,H)|0,o=o+Math.imul(w,V)|0,r=r+Math.imul(b,G)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,K)|0,r=r+Math.imul(f,Z)|0,n=(n=n+Math.imul(f,Y)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,Y)|0;var _t=(d+(r=r+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(u,Q)|0))<<13)|0;d=((o=o+Math.imul(u,tt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(E,D),n=(n=Math.imul(E,q))+Math.imul(A,D)|0,o=Math.imul(A,q),r=r+Math.imul(M,H)|0,n=(n=n+Math.imul(M,V)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(_,G)|0,n=(n=n+Math.imul(_,K)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,K)|0,r=r+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,Y)|0,r=r+Math.imul(f,Q)|0,n=(n=n+Math.imul(f,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var wt=(d+(r=r+Math.imul(h,it)|0)|0)+((8191&(n=(n=n+Math.imul(h,rt)|0)+Math.imul(u,it)|0))<<13)|0;d=((o=o+Math.imul(u,rt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(I,D),n=(n=Math.imul(I,q))+Math.imul(C,D)|0,o=Math.imul(C,q),r=r+Math.imul(E,H)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,V)|0,r=r+Math.imul(M,G)|0,n=(n=n+Math.imul(M,K)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,K)|0,r=r+Math.imul(_,Z)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,Y)|0,r=r+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(f,it)|0,n=(n=n+Math.imul(f,rt)|0)+Math.imul(m,it)|0,o=o+Math.imul(m,rt)|0;var xt=(d+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,st)|0)+Math.imul(u,ot)|0))<<13)|0;d=((o=o+Math.imul(u,st)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(O,D),n=(n=Math.imul(O,q))+Math.imul(L,D)|0,o=Math.imul(L,q),r=r+Math.imul(I,H)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(C,H)|0,o=o+Math.imul(C,V)|0,r=r+Math.imul(E,G)|0,n=(n=n+Math.imul(E,K)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,K)|0,r=r+Math.imul(M,Z)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,Y)|0,r=r+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(b,it)|0,n=(n=n+Math.imul(b,rt)|0)+Math.imul(v,it)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(f,ot)|0,n=(n=n+Math.imul(f,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Mt=(d+(r=r+Math.imul(h,lt)|0)|0)+((8191&(n=(n=n+Math.imul(h,dt)|0)+Math.imul(u,lt)|0))<<13)|0;d=((o=o+Math.imul(u,dt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(B,D),n=(n=Math.imul(B,q))+Math.imul(N,D)|0,o=Math.imul(N,q),r=r+Math.imul(O,H)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,V)|0,r=r+Math.imul(I,G)|0,n=(n=n+Math.imul(I,K)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,K)|0,r=r+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,Y)|0,r=r+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(_,it)|0,n=(n=n+Math.imul(_,rt)|0)+Math.imul(w,it)|0,o=o+Math.imul(w,rt)|0,r=r+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,r=r+Math.imul(f,lt)|0,n=(n=n+Math.imul(f,dt)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,dt)|0;var kt=(d+(r=r+Math.imul(h,ht)|0)|0)+((8191&(n=(n=n+Math.imul(h,ut)|0)+Math.imul(u,ht)|0))<<13)|0;d=((o=o+Math.imul(u,ut)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(z,D),n=(n=Math.imul(z,q))+Math.imul(j,D)|0,o=Math.imul(j,q),r=r+Math.imul(B,H)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(O,G)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,K)|0,r=r+Math.imul(I,Z)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,Y)|0,r=r+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(M,it)|0,n=(n=n+Math.imul(M,rt)|0)+Math.imul(k,it)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(_,ot)|0,n=(n=n+Math.imul(_,st)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,st)|0,r=r+Math.imul(b,lt)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,dt)|0,r=r+Math.imul(f,ht)|0,n=(n=n+Math.imul(f,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var St=(d+(r=r+Math.imul(h,ft)|0)|0)+((8191&(n=(n=n+Math.imul(h,mt)|0)+Math.imul(u,ft)|0))<<13)|0;d=((o=o+Math.imul(u,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(z,H),n=(n=Math.imul(z,V))+Math.imul(j,H)|0,o=Math.imul(j,V),r=r+Math.imul(B,G)|0,n=(n=n+Math.imul(B,K)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,K)|0,r=r+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,Y)|0,r=r+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,r=r+Math.imul(E,it)|0,n=(n=n+Math.imul(E,rt)|0)+Math.imul(A,it)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,r=r+Math.imul(_,lt)|0,n=(n=n+Math.imul(_,dt)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,dt)|0,r=r+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,ut)|0;var Et=(d+(r=r+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,mt)|0)+Math.imul(m,ft)|0))<<13)|0;d=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(z,G),n=(n=Math.imul(z,K))+Math.imul(j,G)|0,o=Math.imul(j,K),r=r+Math.imul(B,Z)|0,n=(n=n+Math.imul(B,Y)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,Y)|0,r=r+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,r=r+Math.imul(I,it)|0,n=(n=n+Math.imul(I,rt)|0)+Math.imul(C,it)|0,o=o+Math.imul(C,rt)|0,r=r+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,r=r+Math.imul(M,lt)|0,n=(n=n+Math.imul(M,dt)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,dt)|0,r=r+Math.imul(_,ht)|0,n=(n=n+Math.imul(_,ut)|0)+Math.imul(w,ht)|0,o=o+Math.imul(w,ut)|0;var At=(d+(r=r+Math.imul(b,ft)|0)|0)+((8191&(n=(n=n+Math.imul(b,mt)|0)+Math.imul(v,ft)|0))<<13)|0;d=((o=o+Math.imul(v,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(z,Z),n=(n=Math.imul(z,Y))+Math.imul(j,Z)|0,o=Math.imul(j,Y),r=r+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(O,it)|0,n=(n=n+Math.imul(O,rt)|0)+Math.imul(L,it)|0,o=o+Math.imul(L,rt)|0,r=r+Math.imul(I,ot)|0,n=(n=n+Math.imul(I,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,r=r+Math.imul(E,lt)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,dt)|0,r=r+Math.imul(M,ht)|0,n=(n=n+Math.imul(M,ut)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,ut)|0;var Tt=(d+(r=r+Math.imul(_,ft)|0)|0)+((8191&(n=(n=n+Math.imul(_,mt)|0)+Math.imul(w,ft)|0))<<13)|0;d=((o=o+Math.imul(w,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(z,Q),n=(n=Math.imul(z,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),r=r+Math.imul(B,it)|0,n=(n=n+Math.imul(B,rt)|0)+Math.imul(N,it)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,r=r+Math.imul(I,lt)|0,n=(n=n+Math.imul(I,dt)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,dt)|0,r=r+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,ut)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ut)|0;var It=(d+(r=r+Math.imul(M,ft)|0)|0)+((8191&(n=(n=n+Math.imul(M,mt)|0)+Math.imul(k,ft)|0))<<13)|0;d=((o=o+Math.imul(k,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(z,it),n=(n=Math.imul(z,rt))+Math.imul(j,it)|0,o=Math.imul(j,rt),r=r+Math.imul(B,ot)|0,n=(n=n+Math.imul(B,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,r=r+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(L,lt)|0,o=o+Math.imul(L,dt)|0,r=r+Math.imul(I,ht)|0,n=(n=n+Math.imul(I,ut)|0)+Math.imul(C,ht)|0,o=o+Math.imul(C,ut)|0;var Ct=(d+(r=r+Math.imul(E,ft)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(A,ft)|0))<<13)|0;d=((o=o+Math.imul(A,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(z,ot),n=(n=Math.imul(z,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),r=r+Math.imul(B,lt)|0,n=(n=n+Math.imul(B,dt)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,dt)|0,r=r+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(L,ht)|0,o=o+Math.imul(L,ut)|0;var Rt=(d+(r=r+Math.imul(I,ft)|0)|0)+((8191&(n=(n=n+Math.imul(I,mt)|0)+Math.imul(C,ft)|0))<<13)|0;d=((o=o+Math.imul(C,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(z,lt),n=(n=Math.imul(z,dt))+Math.imul(j,lt)|0,o=Math.imul(j,dt),r=r+Math.imul(B,ht)|0,n=(n=n+Math.imul(B,ut)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,ut)|0;var Ot=(d+(r=r+Math.imul(O,ft)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(L,ft)|0))<<13)|0;d=((o=o+Math.imul(L,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(z,ht),n=(n=Math.imul(z,ut))+Math.imul(j,ht)|0,o=Math.imul(j,ut);var Lt=(d+(r=r+Math.imul(B,ft)|0)|0)+((8191&(n=(n=n+Math.imul(B,mt)|0)+Math.imul(N,ft)|0))<<13)|0;d=((o=o+Math.imul(N,mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Pt=(d+(r=Math.imul(z,ft))|0)+((8191&(n=(n=Math.imul(z,mt))+Math.imul(j,ft)|0))<<13)|0;return d=((o=Math.imul(j,mt))+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,l[0]=gt,l[1]=bt,l[2]=vt,l[3]=yt,l[4]=_t,l[5]=wt,l[6]=xt,l[7]=Mt,l[8]=kt,l[9]=St,l[10]=Et,l[11]=At,l[12]=Tt,l[13]=It,l[14]=Ct,l[15]=Rt,l[16]=Ot,l[17]=Lt,l[18]=Pt,0!==d&&(l[19]=d,i.length++),i};function p(t,e,i){return(new f).mulp(t,e,i)}function f(t,e){this.x=t,this.y=e}Math.imul||(u=h),r.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?u(this,t,e):i<63?h(this,t,e):i<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,o=0;o<i.length-1;o++){var s=n;n=0;for(var a=67108863&r,l=Math.min(o,e.length-1),d=Math.max(0,o-t.length+1);d<=l;d++){var c=o-d,h=(0|t.words[c])*(0|e.words[d]),u=67108863&h;a=67108863&(u=u+a|0),n+=(s=(s=s+(h/67108864|0)|0)+(u>>>26)|0)>>>26,s&=67108863}i.words[o]=a,r=s,s=n}return 0!==r?i.words[o]=r:i.length--,i.strip()}(this,t,e):p(this,t,e)},f.prototype.makeRBT=function(t){for(var e=new Array(t),i=r.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,i,t);return e},f.prototype.revBin=function(t,e,i){if(0===t||t===i-1)return t;for(var r=0,n=0;n<e;n++)r|=(1&t)<<e-n-1,t>>=1;return r},f.prototype.permute=function(t,e,i,r,n,o){for(var s=0;s<o;s++)r[s]=e[t[s]],n[s]=i[t[s]]},f.prototype.transform=function(t,e,i,r,n,o){this.permute(o,t,e,i,r,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,l=Math.cos(2*Math.PI/a),d=Math.sin(2*Math.PI/a),c=0;c<n;c+=a)for(var h=l,u=d,p=0;p<s;p++){var f=i[c+p],m=r[c+p],g=i[c+p+s],b=r[c+p+s],v=h*g-u*b;b=h*b+u*g,g=v,i[c+p]=f+g,r[c+p]=m+b,i[c+p+s]=f-g,r[c+p+s]=m-b,p!==a&&(v=l*h-d*u,u=l*u+d*h,h=v)}},f.prototype.guessLen13b=function(t,e){var i=1|Math.max(e,t),r=1&i,n=0;for(i=i/2|0;i;i>>>=1)n++;return 1<<n+1+r},f.prototype.conjugate=function(t,e,i){if(!(i<=1))for(var r=0;r<i/2;r++){var n=t[r];t[r]=t[i-r-1],t[i-r-1]=n,n=e[r],e[r]=-e[i-r-1],e[i-r-1]=-n}},f.prototype.normalize13b=function(t,e){for(var i=0,r=0;r<e/2;r++){var n=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+i;t[r]=67108863&n,i=n<67108864?0:n/67108864|0}return t},f.prototype.convert13b=function(t,e,i,r){for(var n=0,o=0;o<e;o++)n+=0|t[o],i[2*o]=8191&n,n>>>=13,i[2*o+1]=8191&n,n>>>=13;for(o=2*e;o<r;++o)i[o]=0},f.prototype.stub=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=0;return e},f.prototype.mulp=function(t,e,i){var r=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(r),o=this.stub(r),s=new Array(r),a=new Array(r),l=new Array(r),d=new Array(r),c=new Array(r),h=new Array(r),u=i.words;u.length=r,this.convert13b(t.words,t.length,s,r),this.convert13b(e.words,e.length,d,r),this.transform(s,o,a,l,r,n),this.transform(d,o,c,h,r,n);for(var p=0;p<r;p++){var f=a[p]*c[p]-l[p]*h[p];l[p]=a[p]*h[p]+l[p]*c[p],a[p]=f}return this.conjugate(a,l,r),this.transform(a,l,u,o,r,n),this.conjugate(u,o,r),this.normalize13b(u,r),i.negative=t.negative^e.negative,i.length=t.length+e.length,i.strip()},r.prototype.mul=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},r.prototype.mulf=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),p(this,t,e)},r.prototype.imul=function(t){return this.clone().mulTo(t,this)},r.prototype.imuln=function(t){for(var e=0,i=0;i<this.length;i++){var r=(0|this.words[i])*t,n=(67108863&r)+(67108863&e);e>>=26,e+=r/67108864|0,e+=n>>>26,this.words[i]=67108863&n}return 0!==e&&(this.words[i]=e,this.length++),this},r.prototype.muln=function(t){return this.clone().imuln(t)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i<e.length;i++){var r=i/26|0,n=i%26;e[i]=(t.words[r]&1<<n)>>>n}return e}(t);if(0===e.length)return new r(1);for(var i=this,n=0;n<e.length&&0===e[n];n++,i=i.sqr());if(++n<e.length)for(var o=i.sqr();n<e.length;n++,o=o.sqr())0!==e[n]&&(i=i.mul(o));return i},r.prototype.iushln=function(t){var e,i=t%26,r=(t-i)/26,n=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e<this.length;e++){var s=this.words[e]&n,a=(0|this.words[e])-s<<i;this.words[e]=a|o,o=s>>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e<r;e++)this.words[e]=0;this.length+=r}return this.strip()},r.prototype.ishln=function(t){return this.iushln(t)},r.prototype.iushrn=function(t,e,i){var r;r=e?(e-e%26)/26:0;var n=t%26,o=Math.min((t-n)/26,this.length),s=67108863^67108863>>>n<<n,a=i;if(r-=o,r=Math.max(0,r),a){for(var l=0;l<o;l++)a.words[l]=this.words[l];a.length=o}if(0===o);else if(this.length>o)for(this.length-=o,l=0;l<this.length;l++)this.words[l]=this.words[l+o];else this.words[0]=0,this.length=1;var d=0;for(l=this.length-1;l>=0&&(0!==d||l>=r);l--){var c=0|this.words[l];this.words[l]=d<<26-n|c>>>n,d=c&s}return a&&0!==d&&(a.words[a.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},r.prototype.ishrn=function(t,e,i){return this.iushrn(t,e,i)},r.prototype.shln=function(t){return this.clone().ishln(t)},r.prototype.ushln=function(t){return this.clone().iushln(t)},r.prototype.shrn=function(t){return this.clone().ishrn(t)},r.prototype.ushrn=function(t){return this.clone().iushrn(t)},r.prototype.testn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;return!(this.length<=i||!(this.words[i]&r))},r.prototype.imaskn=function(t){var e=t%26,i=(t-e)/26;if(this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var r=67108863^67108863>>>e<<e;this.words[this.length-1]&=r}return this.strip()},r.prototype.maskn=function(t){return this.clone().imaskn(t)},r.prototype.iaddn=function(t){return t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},r.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},r.prototype.isubn=function(t){if(t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},r.prototype.addn=function(t){return this.clone().iaddn(t)},r.prototype.subn=function(t){return this.clone().isubn(t)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(t,e,i){var r,n,o=t.length+i;this._expand(o);var s=0;for(r=0;r<t.length;r++){n=(0|this.words[r+i])+s;var a=(0|t.words[r])*e;s=((n-=67108863&a)>>26)-(a/67108864|0),this.words[r+i]=67108863&n}for(;r<this.length-i;r++)s=(n=(0|this.words[r+i])+s)>>26,this.words[r+i]=67108863&n;if(0===s)return this.strip();for(s=0,r=0;r<this.length;r++)s=(n=-(0|this.words[r])+s)>>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},r.prototype._wordDiv=function(t,e){var i=(this.length,t.length),n=this.clone(),o=t,s=0|o.words[o.length-1];0!=(i=26-this._countBits(s))&&(o=o.ushln(i),n.iushln(i),s=0|o.words[o.length-1]);var a,l=n.length-o.length;if("mod"!==e){(a=new r(null)).length=l+1,a.words=new Array(a.length);for(var d=0;d<a.length;d++)a.words[d]=0}var c=n.clone()._ishlnsubmul(o,1,l);0===c.negative&&(n=c,a&&(a.words[l]=1));for(var h=l-1;h>=0;h--){var u=67108864*(0|n.words[o.length+h])+(0|n.words[o.length+h-1]);for(u=Math.min(u/s|0,67108863),n._ishlnsubmul(o,u,h);0!==n.negative;)u--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=u)}return a&&a.strip(),n.strip(),"div"!==e&&0!==i&&n.iushrn(i),{div:a||null,mod:n}},r.prototype.divmod=function(t,e,i){return this.isZero()?{div:new r(0),mod:new r(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(o=s.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new r(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new r(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new r(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,s},r.prototype.div=function(t){return this.divmod(t,"div",!1).div},r.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},r.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},r.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),o=i.cmp(r);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},r.prototype.modn=function(t){for(var e=(1<<26)%t,i=0,r=this.length-1;r>=0;r--)i=(e*i+(0|this.words[r]))%t;return i},r.prototype.idivn=function(t){for(var e=0,i=this.length-1;i>=0;i--){var r=(0|this.words[i])+67108864*e;this.words[i]=r/t|0,e=r%t}return this.strip()},r.prototype.divn=function(t){return this.clone().idivn(t)},r.prototype.egcd=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new r(1),o=new r(0),s=new r(0),a=new r(1),l=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++l;for(var d=i.clone(),c=e.clone();!e.isZero();){for(var h=0,u=1;0==(e.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(d),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,f=1;0==(i.words[0]&f)&&p<26;++p,f<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(s.isOdd()||a.isOdd())&&(s.iadd(d),a.isub(c)),s.iushrn(1),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(s),o.isub(a)):(i.isub(e),s.isub(n),a.isub(o))}return{a:s,b:a,gcd:i.iushln(l)}},r.prototype._invmp=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new r(1),s=new r(0),a=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(a),o.iushrn(1);for(var c=0,h=1;0==(i.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(i.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(a),s.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(s)):(i.isub(e),s.isub(o))}return(n=0===e.cmpn(1)?o:s).cmpn(0)<0&&n.iadd(t),n},r.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var o=e;e=i,i=o}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},r.prototype.invm=function(t){return this.egcd(t).a.umod(t)},r.prototype.isEven=function(){return 0==(1&this.words[0])},r.prototype.isOdd=function(){return 1==(1&this.words[0])},r.prototype.andln=function(t){return this.words[0]&t},r.prototype.bincn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=r,this;for(var n=r,o=i;0!==n&&o<this.length;o++){var s=0|this.words[o];n=(s+=n)>>>26,s&=67108863,this.words[o]=s}return 0!==n&&(this.words[o]=n,this.length++),this},r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},r.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t);var r=0|this.words[0];e=r===t?0:r<t?-1:1}return 0!==this.negative?0|-e:e},r.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},r.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){r<n?e=-1:r>n&&(e=1);break}}return e},r.prototype.gtn=function(t){return 1===this.cmpn(t)},r.prototype.gt=function(t){return 1===this.cmp(t)},r.prototype.gten=function(t){return this.cmpn(t)>=0},r.prototype.gte=function(t){return this.cmp(t)>=0},r.prototype.ltn=function(t){return-1===this.cmpn(t)},r.prototype.lt=function(t){return-1===this.cmp(t)},r.prototype.lten=function(t){return this.cmpn(t)<=0},r.prototype.lte=function(t){return this.cmp(t)<=0},r.prototype.eqn=function(t){return 0===this.cmpn(t)},r.prototype.eq=function(t){return 0===this.cmp(t)},r.red=function(t){return new w(t)},r.prototype.toRed=function(t){return t.convertTo(this)._forceRed(t)},r.prototype.fromRed=function(){return this.red.convertFrom(this)},r.prototype._forceRed=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return this._forceRed(t)},r.prototype.redAdd=function(t){return this.red.add(this,t)},r.prototype.redIAdd=function(t){return this.red.iadd(this,t)},r.prototype.redSub=function(t){return this.red.sub(this,t)},r.prototype.redISub=function(t){return this.red.isub(this,t)},r.prototype.redShl=function(t){return this.red.shl(this,t)},r.prototype.redMul=function(t){return this.red._verify2(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return this.red._verify2(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(t){return this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new r(e,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function y(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=r._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function x(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new r(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},i(b,g),b.prototype.split=function(t,e){for(var i=Math.min(t.length,9),r=0;r<i;r++)e.words[r]=t.words[r];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(e.words[e.length++]=4194303&n,r=10;r<t.length;r++){var o=0|t.words[r];t.words[r-10]=(4194303&o)<<4|n>>>22,n=o}n>>>=22,t.words[r-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i<t.length;i++){var r=0|t.words[i];e+=977*r,t.words[i]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(v,g),i(y,g),i(_,g),_.prototype.imulK=function(t){for(var e=0,i=0;i<t.length;i++){var r=19*(0|t.words[i])+e,n=67108863&r;r>>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},r._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new v;else if("p192"===t)e=new y;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return m[t]=e,e},w.prototype._verify1=function(t){},w.prototype._verify2=function(t,e){},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},w.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();if(3===this.m.andln(3)){var e=this.m.add(new r(1)).iushrn(2);return this.pow(t,e)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);var o=new r(1).toRed(this),s=o.redNeg(),a=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new r(2*l*l).toRed(this);0!==this.pow(l,a).cmp(s);)l.redIAdd(s);for(var d=this.pow(l,i),c=this.pow(t,i.addn(1).iushrn(1)),h=this.pow(t,i),u=n;0!==h.cmp(o);){for(var p=h,f=0;0!==p.cmp(o);f++)p=p.redSqr();var m=this.pow(d,new r(1).iushln(u-f-1));c=c.redMul(m),d=m.redSqr(),h=h.redMul(d),u=f}return c},w.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},w.prototype.pow=function(t,e){if(e.isZero())return new r(1).toRed(this);if(0===e.cmpn(1))return t.clone();var i=new Array(16);i[0]=new r(1).toRed(this),i[1]=t;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],t);var o=i[0],s=0,a=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var d=e.words[n],c=l-1;c>=0;c--){var h=d>>c&1;o!==i[0]&&(o=this.sqr(o)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===n&&0===c)&&(o=this.mul(o,i[s]),a=0,s=0)):a=0}l=26}return o},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},r.mont=function(t){return new x(t)},i(x,w),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0)._forceRed(this);var i=t.mul(e),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(on,this),on=on.exports,(rn=function(t){return nn||(nn=new sn(null)),nn.generate(t)}).Rand=sn,sn.prototype.generate=function(t){return this._rand(t)},sn.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),i=0;i<e.length;i++)e[i]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?sn.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?sn.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(sn.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var an=l({});if("function"!=typeof an.randomBytes)throw new Error("Not supported");sn.prototype._rand=function(t){return an.randomBytes(t)}}catch(t){}var ln={};function dn(t){this.rand=t||new rn.Rand}ln=dn,dn.create=function(t){return new dn(t)},dn.prototype._randbelow=function(t){var e=t.bitLength(),i=Math.ceil(e/8);do{var r=new on(this.rand.generate(i))}while(r.cmp(t)>=0);return r},dn.prototype._randrange=function(t,e){var i=e.sub(t);return t.add(this._randbelow(i))},dn.prototype.test=function(t,e,i){var r=t.bitLength(),n=on.mont(t),o=new on(1).toRed(n);e||(e=Math.max(1,r/48|0));for(var s=t.subn(1),a=0;!s.testn(a);a++);for(var l=t.shrn(a),d=s.toRed(n);e>0;e--){var c=this._randrange(new on(2),s);i&&i(c);var h=c.toRed(n).redPow(l);if(0!==h.cmp(o)&&0!==h.cmp(d)){for(var u=1;u<a;u++){if(0===(h=h.redSqr()).cmp(o))return!1;if(0===h.cmp(d))break}if(u===a)return!1}}return!0},dn.prototype.getDivisor=function(t,e){var i=t.bitLength(),r=on.mont(t),n=new on(1).toRed(r);e||(e=Math.max(1,i/48|0));for(var o=t.subn(1),s=0;!o.testn(s);s++);for(var a=t.shrn(s),l=o.toRed(r);e>0;e--){var d=this._randrange(new on(2),o),c=t.gcd(d);if(0!==c.cmpn(1))return c;var h=d.toRed(r).redPow(a);if(0!==h.cmp(n)&&0!==h.cmp(l)){for(var u=1;u<s;u++){if(0===(h=h.redSqr()).cmp(n))return h.fromRed().subn(1).gcd(t);if(0===h.cmp(l))break}if(u===s)return(h=h.redSqr()).fromRed().subn(1).gcd(t)}}return!1};var cn={};cn=Mn,Mn.simpleSieve=wn,Mn.fermatTest=xn;var hn=new en(24),un=new ln,pn=new en(1),fn=new en(2),mn=new en(5),gn=(new en(16),new en(8),new en(10)),bn=new en(3),vn=(new en(7),new en(11)),yn=new en(4),_n=(new en(12),null);function wn(t){for(var e=function(){if(null!==_n)return _n;var t=[];t[0]=2;for(var e=1,i=3;i<1048576;i+=2){for(var r=Math.ceil(Math.sqrt(i)),n=0;n<e&&t[n]<=r&&i%t[n]!=0;n++);e!==n&&t[n]<=r||(t[e++]=i)}return _n=t,t}(),i=0;i<e.length;i++)if(0===t.modn(e[i]))return 0===t.cmpn(e[i]);return!0}function xn(t){var e=en.mont(t);return 0===fn.toRed(e).redPow(t.subn(1)).fromRed().cmpn(1)}function Mn(t,e){if(t<16)return new en(2===e||5===e?[140,123]:[140,39]);var i,r;for(e=new en(e);;){for(i=new en(j(Math.ceil(t/8)));i.bitLength()>t;)i.ishrn(1);if(i.isEven()&&i.iadd(pn),i.testn(1)||i.iadd(fn),e.cmp(fn)){if(!e.cmp(mn))for(;i.mod(gn).cmp(bn);)i.iadd(yn)}else for(;i.mod(hn).cmp(vn);)i.iadd(yn);if(wn(r=i.shrn(1))&&wn(i)&&xn(r)&&xn(i)&&un.test(r)&&un.test(i))return i}}(function(t){(function(){var e=new ln,i=new en(24),r=new en(11),n=new en(10),o=new en(3),s=new en(7);function a(e,i){return i=i||"utf8",t.isBuffer(e)||(e=new t(e,i)),this._pub=new en(e),this}function l(e,i){return i=i||"utf8",t.isBuffer(e)||(e=new t(e,i)),this._priv=new en(e),this}var d={};function c(t,e,i){this.setGenerator(e),this.__prime=new en(t),this._prime=en.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,i?(this.setPublicKey=a,this.setPrivateKey=l):this._primeCode=8}function h(e,i){var r=new t(e.toArray());return i?r.toString(i):r}Object.defineProperty(c.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(t,a){var l=a.toString("hex"),c=[l,t.toString(16)].join("_");if(c in d)return d[c];var h,u=0;if(t.isEven()||!cn.simpleSieve||!cn.fermatTest(t)||!e.test(t))return u+=1,u+="02"===l||"05"===l?8:4,d[c]=u,u;switch(e.test(t.shrn(1))||(u+=2),l){case"02":t.mod(i).cmp(r)&&(u+=8);break;case"05":(h=t.mod(n)).cmp(o)&&h.cmp(s)&&(u+=8);break;default:u+=4}return d[c]=u,u}(this.__prime,this.__gen)),this._primeCode}}),c.prototype.generateKeys=function(){return this._priv||(this._priv=new en(j(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},c.prototype.computeSecret=function(e){var i=(e=(e=new en(e)).toRed(this._prime)).redPow(this._priv).fromRed(),r=new t(i.toArray()),n=this.getPrime();if(r.length<n.length){var o=new t(n.length-r.length);o.fill(0),r=t.concat([o,r])}return r},c.prototype.getPublicKey=function(t){return h(this._pub,t)},c.prototype.getPrivateKey=function(t){return h(this._priv,t)},c.prototype.getPrime=function(t){return h(this.__prime,t)},c.prototype.getGenerator=function(t){return h(this._gen,t)},c.prototype.setGenerator=function(e,i){return i=i||"utf8",t.isBuffer(e)||(e=new t(e,i)),this.__gen=e,this._gen=new en(e),this}}).call(this)}).call(this,d({}).Buffer),function(t){(function(){}).call(this)}.call(this,d({}).Buffer);var kn={exports:{}};!function(t,e){function i(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function r(t,e,i){if(r.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var n;"object"==typeof t?t.exports=r:e.BN=r,r.BN=r,r.wordSize=26;try{n=l({}).Buffer}catch(t){}function o(t,e,i){for(var r=0,n=Math.min(t.length,i),o=e;o<n;o++){var s=t.charCodeAt(o)-48;r<<=4,r|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return r}function s(t,e,i,r){for(var n=0,o=Math.min(t.length,i),s=e;s<o;s++){var a=t.charCodeAt(s)-48;n*=r,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}r.isBN=function(t){return t instanceof r||null!==t&&"object"==typeof t&&t.constructor.wordSize===r.wordSize&&Array.isArray(t.words)},r.max=function(t,e){return t.cmp(e)>0?t:e},r.min=function(t,e){return t.cmp(e)<0?t:e},r.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16);var r=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&r++,16===e?this._parseHex(t,r):this._parseBase(t,e,r),"-"===t[0]&&(this.negative=1),this.strip(),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initArray=function(t,e,i){if(t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,o,s=0;if("be"===i)for(r=t.length-1,n=0;r>=0;r-=3)o=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[n]|=o<<s&67108863,this.words[n+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);else if("le"===i)for(r=0,n=0;r<t.length;r+=3)o=t[r]|t[r+1]<<8|t[r+2]<<16,this.words[n]|=o<<s&67108863,this.words[n+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);return this.strip()},r.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var r,n,s=0;for(i=t.length-6,r=0;i>=e;i-=6)n=o(t,i,i+6),this.words[r]|=n<<s&67108863,this.words[r+1]|=n>>>26-s&4194303,(s+=24)>=26&&(s-=26,r++);i+6!==e&&(n=o(t,e,i+6),this.words[r]|=n<<s&67108863,this.words[r+1]|=n>>>26-s&4194303),this.strip()},r.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var o=t.length-i,a=o%r,l=Math.min(o,o-a)+i,d=0,c=i;c<l;c+=r)d=s(t,c,c+r,e),this.imuln(n),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(0!==a){var h=1;for(d=s(t,c,t.length,e),c=0;c<a;c++)h*=e;this.imuln(h),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}},r.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},r.prototype.clone=function(){var t=new r(null);return this.copy(t),t},r.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},r.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},r.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},r.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var a=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,l=s/67108864|0;i.words[0]=a;for(var d=1;d<r;d++){for(var c=l>>>26,h=67108863&l,u=Math.min(d,e.length-1),p=Math.max(0,d-t.length+1);p<=u;p++){var f=d-p|0;c+=(s=(n=0|t.words[f])*(o=0|e.words[p])+h)/67108864|0,h=67108863&s}i.words[d]=0|h,l=0|c}return 0!==l?i.words[d]=0|l:i.length--,i.strip()}r.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var r=0,n=0,o=0;o<this.length;o++){var s=this.words[o],l=(16777215&(s<<r|n)).toString(16);i=0!=(n=s>>>24-r&16777215)||o!==this.length-1?a[6-l.length]+l+i:l+i,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(i=n.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var h=d[t],u=c[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var f=p.modn(u).toString(t);i=(p=p.idivn(u)).isZero()?f+i:a[h-f.length]+f+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}},r.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length,0!==this.negative?-t:t},r.prototype.toJSON=function(){return this.toString(16)},r.prototype.toBuffer=function(t,e){return this.toArrayLike(n,t,e)},r.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},r.prototype.toArrayLike=function(t,e,i){var r=this.byteLength(),n=i||Math.max(1,r);this.strip();var o,s,a="le"===e,l=new t(n),d=this.clone();if(a){for(s=0;!d.isZero();s++)o=d.andln(255),d.iushrn(8),l[s]=o;for(;s<n;s++)l[s]=0}else{for(s=0;s<n-r;s++)l[s]=0;for(s=0;!d.isZero();s++)o=d.andln(255),d.iushrn(8),l[n-s-1]=o}return l},Math.clz32?r.prototype._countBits=function(t){return 32-Math.clz32(t)}:r.prototype._countBits=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},r.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},r.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var i=this._zeroBits(this.words[e]);if(t+=i,26!==i)break}return t},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},r.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return 0!==this.negative},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},r.prototype.ior=function(t){return this.iuor(t)},r.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},r.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},r.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;i<e.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=e.length,this.strip()},r.prototype.iand=function(t){return this.iuand(t)},r.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},r.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},r.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;r<i.length;r++)this.words[r]=e.words[r]^i.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},r.prototype.ixor=function(t){return this.iuxor(t)},r.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},r.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},r.prototype.inotn=function(t){var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var r=0;r<e;r++)this.words[r]=67108863&~this.words[r];return i>0&&(this.words[r]=~this.words[r]&67108863>>26-i),this.strip()},r.prototype.notn=function(t){return this.clone().inotn(t)},r.prototype.setn=function(t,e){var i=t/26|0,r=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<r:this.words[i]&~(1<<r),this.strip()},r.prototype.iadd=function(t){var e,i,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0,o=0;o<r.length;o++)e=(0|i.words[o])+(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<i.length;o++)e=(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this},r.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},r.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var o=0,s=0;s<r.length;s++)o=(e=(0|i.words[s])-(0|r.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<i.length;s++)o=(e=(0|i.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<i.length&&i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this.length=Math.max(this.length,s),i!==this&&(this.negative=1),this.strip()},r.prototype.sub=function(t){return this.clone().isub(t)};var u=function(t,e,i){var r,n,o,s=t.words,a=e.words,l=i.words,d=0,c=0|s[0],h=8191&c,u=c>>>13,p=0|s[1],f=8191&p,m=p>>>13,g=0|s[2],b=8191&g,v=g>>>13,y=0|s[3],_=8191&y,w=y>>>13,x=0|s[4],M=8191&x,k=x>>>13,S=0|s[5],E=8191&S,A=S>>>13,T=0|s[6],I=8191&T,C=T>>>13,R=0|s[7],O=8191&R,L=R>>>13,P=0|s[8],B=8191&P,N=P>>>13,$=0|s[9],z=8191&$,j=$>>>13,F=0|a[0],D=8191&F,q=F>>>13,U=0|a[1],H=8191&U,V=U>>>13,W=0|a[2],G=8191&W,K=W>>>13,X=0|a[3],Z=8191&X,Y=X>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],it=8191&et,rt=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],lt=8191&at,dt=at>>>13,ct=0|a[8],ht=8191&ct,ut=ct>>>13,pt=0|a[9],ft=8191&pt,mt=pt>>>13;i.negative=t.negative^e.negative,i.length=19;var gt=(d+(r=Math.imul(h,D))|0)+((8191&(n=(n=Math.imul(h,q))+Math.imul(u,D)|0))<<13)|0;d=((o=Math.imul(u,q))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(f,D),n=(n=Math.imul(f,q))+Math.imul(m,D)|0,o=Math.imul(m,q);var bt=(d+(r=r+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,V)|0)+Math.imul(u,H)|0))<<13)|0;d=((o=o+Math.imul(u,V)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,D),n=(n=Math.imul(b,q))+Math.imul(v,D)|0,o=Math.imul(v,q),r=r+Math.imul(f,H)|0,n=(n=n+Math.imul(f,V)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,V)|0;var vt=(d+(r=r+Math.imul(h,G)|0)|0)+((8191&(n=(n=n+Math.imul(h,K)|0)+Math.imul(u,G)|0))<<13)|0;d=((o=o+Math.imul(u,K)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(_,D),n=(n=Math.imul(_,q))+Math.imul(w,D)|0,o=Math.imul(w,q),r=r+Math.imul(b,H)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,n=(n=n+Math.imul(f,K)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,K)|0;var yt=(d+(r=r+Math.imul(h,Z)|0)|0)+((8191&(n=(n=n+Math.imul(h,Y)|0)+Math.imul(u,Z)|0))<<13)|0;d=((o=o+Math.imul(u,Y)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(M,D),n=(n=Math.imul(M,q))+Math.imul(k,D)|0,o=Math.imul(k,q),r=r+Math.imul(_,H)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,H)|0,o=o+Math.imul(w,V)|0,r=r+Math.imul(b,G)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,K)|0,r=r+Math.imul(f,Z)|0,n=(n=n+Math.imul(f,Y)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,Y)|0;var _t=(d+(r=r+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(u,Q)|0))<<13)|0;d=((o=o+Math.imul(u,tt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(E,D),n=(n=Math.imul(E,q))+Math.imul(A,D)|0,o=Math.imul(A,q),r=r+Math.imul(M,H)|0,n=(n=n+Math.imul(M,V)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(_,G)|0,n=(n=n+Math.imul(_,K)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,K)|0,r=r+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,Y)|0,r=r+Math.imul(f,Q)|0,n=(n=n+Math.imul(f,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var wt=(d+(r=r+Math.imul(h,it)|0)|0)+((8191&(n=(n=n+Math.imul(h,rt)|0)+Math.imul(u,it)|0))<<13)|0;d=((o=o+Math.imul(u,rt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(I,D),n=(n=Math.imul(I,q))+Math.imul(C,D)|0,o=Math.imul(C,q),r=r+Math.imul(E,H)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,V)|0,r=r+Math.imul(M,G)|0,n=(n=n+Math.imul(M,K)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,K)|0,r=r+Math.imul(_,Z)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,Y)|0,r=r+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(f,it)|0,n=(n=n+Math.imul(f,rt)|0)+Math.imul(m,it)|0,o=o+Math.imul(m,rt)|0;var xt=(d+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,st)|0)+Math.imul(u,ot)|0))<<13)|0;d=((o=o+Math.imul(u,st)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(O,D),n=(n=Math.imul(O,q))+Math.imul(L,D)|0,o=Math.imul(L,q),r=r+Math.imul(I,H)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(C,H)|0,o=o+Math.imul(C,V)|0,r=r+Math.imul(E,G)|0,n=(n=n+Math.imul(E,K)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,K)|0,r=r+Math.imul(M,Z)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,Y)|0,r=r+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(b,it)|0,n=(n=n+Math.imul(b,rt)|0)+Math.imul(v,it)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(f,ot)|0,n=(n=n+Math.imul(f,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Mt=(d+(r=r+Math.imul(h,lt)|0)|0)+((8191&(n=(n=n+Math.imul(h,dt)|0)+Math.imul(u,lt)|0))<<13)|0;d=((o=o+Math.imul(u,dt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(B,D),n=(n=Math.imul(B,q))+Math.imul(N,D)|0,o=Math.imul(N,q),r=r+Math.imul(O,H)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,V)|0,r=r+Math.imul(I,G)|0,n=(n=n+Math.imul(I,K)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,K)|0,r=r+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,Y)|0,r=r+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(_,it)|0,n=(n=n+Math.imul(_,rt)|0)+Math.imul(w,it)|0,o=o+Math.imul(w,rt)|0,r=r+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,r=r+Math.imul(f,lt)|0,n=(n=n+Math.imul(f,dt)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,dt)|0;var kt=(d+(r=r+Math.imul(h,ht)|0)|0)+((8191&(n=(n=n+Math.imul(h,ut)|0)+Math.imul(u,ht)|0))<<13)|0;d=((o=o+Math.imul(u,ut)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(z,D),n=(n=Math.imul(z,q))+Math.imul(j,D)|0,o=Math.imul(j,q),r=r+Math.imul(B,H)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(O,G)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,K)|0,r=r+Math.imul(I,Z)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,Y)|0,r=r+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(M,it)|0,n=(n=n+Math.imul(M,rt)|0)+Math.imul(k,it)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(_,ot)|0,n=(n=n+Math.imul(_,st)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,st)|0,r=r+Math.imul(b,lt)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,dt)|0,r=r+Math.imul(f,ht)|0,n=(n=n+Math.imul(f,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var St=(d+(r=r+Math.imul(h,ft)|0)|0)+((8191&(n=(n=n+Math.imul(h,mt)|0)+Math.imul(u,ft)|0))<<13)|0;d=((o=o+Math.imul(u,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(z,H),n=(n=Math.imul(z,V))+Math.imul(j,H)|0,o=Math.imul(j,V),r=r+Math.imul(B,G)|0,n=(n=n+Math.imul(B,K)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,K)|0,r=r+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,Y)|0,r=r+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,r=r+Math.imul(E,it)|0,n=(n=n+Math.imul(E,rt)|0)+Math.imul(A,it)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,r=r+Math.imul(_,lt)|0,n=(n=n+Math.imul(_,dt)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,dt)|0,r=r+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,ut)|0;var Et=(d+(r=r+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,mt)|0)+Math.imul(m,ft)|0))<<13)|0;d=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(z,G),n=(n=Math.imul(z,K))+Math.imul(j,G)|0,o=Math.imul(j,K),r=r+Math.imul(B,Z)|0,n=(n=n+Math.imul(B,Y)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,Y)|0,r=r+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,r=r+Math.imul(I,it)|0,n=(n=n+Math.imul(I,rt)|0)+Math.imul(C,it)|0,o=o+Math.imul(C,rt)|0,r=r+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,r=r+Math.imul(M,lt)|0,n=(n=n+Math.imul(M,dt)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,dt)|0,r=r+Math.imul(_,ht)|0,n=(n=n+Math.imul(_,ut)|0)+Math.imul(w,ht)|0,o=o+Math.imul(w,ut)|0;var At=(d+(r=r+Math.imul(b,ft)|0)|0)+((8191&(n=(n=n+Math.imul(b,mt)|0)+Math.imul(v,ft)|0))<<13)|0;d=((o=o+Math.imul(v,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(z,Z),n=(n=Math.imul(z,Y))+Math.imul(j,Z)|0,o=Math.imul(j,Y),r=r+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(O,it)|0,n=(n=n+Math.imul(O,rt)|0)+Math.imul(L,it)|0,o=o+Math.imul(L,rt)|0,r=r+Math.imul(I,ot)|0,n=(n=n+Math.imul(I,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,r=r+Math.imul(E,lt)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,dt)|0,r=r+Math.imul(M,ht)|0,n=(n=n+Math.imul(M,ut)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,ut)|0;var Tt=(d+(r=r+Math.imul(_,ft)|0)|0)+((8191&(n=(n=n+Math.imul(_,mt)|0)+Math.imul(w,ft)|0))<<13)|0;d=((o=o+Math.imul(w,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(z,Q),n=(n=Math.imul(z,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),r=r+Math.imul(B,it)|0,n=(n=n+Math.imul(B,rt)|0)+Math.imul(N,it)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,r=r+Math.imul(I,lt)|0,n=(n=n+Math.imul(I,dt)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,dt)|0,r=r+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,ut)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ut)|0;var It=(d+(r=r+Math.imul(M,ft)|0)|0)+((8191&(n=(n=n+Math.imul(M,mt)|0)+Math.imul(k,ft)|0))<<13)|0;d=((o=o+Math.imul(k,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(z,it),n=(n=Math.imul(z,rt))+Math.imul(j,it)|0,o=Math.imul(j,rt),r=r+Math.imul(B,ot)|0,n=(n=n+Math.imul(B,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,r=r+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(L,lt)|0,o=o+Math.imul(L,dt)|0,r=r+Math.imul(I,ht)|0,n=(n=n+Math.imul(I,ut)|0)+Math.imul(C,ht)|0,o=o+Math.imul(C,ut)|0;var Ct=(d+(r=r+Math.imul(E,ft)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(A,ft)|0))<<13)|0;d=((o=o+Math.imul(A,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(z,ot),n=(n=Math.imul(z,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),r=r+Math.imul(B,lt)|0,n=(n=n+Math.imul(B,dt)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,dt)|0,r=r+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(L,ht)|0,o=o+Math.imul(L,ut)|0;var Rt=(d+(r=r+Math.imul(I,ft)|0)|0)+((8191&(n=(n=n+Math.imul(I,mt)|0)+Math.imul(C,ft)|0))<<13)|0;d=((o=o+Math.imul(C,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(z,lt),n=(n=Math.imul(z,dt))+Math.imul(j,lt)|0,o=Math.imul(j,dt),r=r+Math.imul(B,ht)|0,n=(n=n+Math.imul(B,ut)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,ut)|0;var Ot=(d+(r=r+Math.imul(O,ft)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(L,ft)|0))<<13)|0;d=((o=o+Math.imul(L,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(z,ht),n=(n=Math.imul(z,ut))+Math.imul(j,ht)|0,o=Math.imul(j,ut);var Lt=(d+(r=r+Math.imul(B,ft)|0)|0)+((8191&(n=(n=n+Math.imul(B,mt)|0)+Math.imul(N,ft)|0))<<13)|0;d=((o=o+Math.imul(N,mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Pt=(d+(r=Math.imul(z,ft))|0)+((8191&(n=(n=Math.imul(z,mt))+Math.imul(j,ft)|0))<<13)|0;return d=((o=Math.imul(j,mt))+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,l[0]=gt,l[1]=bt,l[2]=vt,l[3]=yt,l[4]=_t,l[5]=wt,l[6]=xt,l[7]=Mt,l[8]=kt,l[9]=St,l[10]=Et,l[11]=At,l[12]=Tt,l[13]=It,l[14]=Ct,l[15]=Rt,l[16]=Ot,l[17]=Lt,l[18]=Pt,0!==d&&(l[19]=d,i.length++),i};function p(t,e,i){return(new f).mulp(t,e,i)}function f(t,e){this.x=t,this.y=e}Math.imul||(u=h),r.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?u(this,t,e):i<63?h(this,t,e):i<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,o=0;o<i.length-1;o++){var s=n;n=0;for(var a=67108863&r,l=Math.min(o,e.length-1),d=Math.max(0,o-t.length+1);d<=l;d++){var c=o-d,h=(0|t.words[c])*(0|e.words[d]),u=67108863&h;a=67108863&(u=u+a|0),n+=(s=(s=s+(h/67108864|0)|0)+(u>>>26)|0)>>>26,s&=67108863}i.words[o]=a,r=s,s=n}return 0!==r?i.words[o]=r:i.length--,i.strip()}(this,t,e):p(this,t,e)},f.prototype.makeRBT=function(t){for(var e=new Array(t),i=r.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,i,t);return e},f.prototype.revBin=function(t,e,i){if(0===t||t===i-1)return t;for(var r=0,n=0;n<e;n++)r|=(1&t)<<e-n-1,t>>=1;return r},f.prototype.permute=function(t,e,i,r,n,o){for(var s=0;s<o;s++)r[s]=e[t[s]],n[s]=i[t[s]]},f.prototype.transform=function(t,e,i,r,n,o){this.permute(o,t,e,i,r,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,l=Math.cos(2*Math.PI/a),d=Math.sin(2*Math.PI/a),c=0;c<n;c+=a)for(var h=l,u=d,p=0;p<s;p++){var f=i[c+p],m=r[c+p],g=i[c+p+s],b=r[c+p+s],v=h*g-u*b;b=h*b+u*g,g=v,i[c+p]=f+g,r[c+p]=m+b,i[c+p+s]=f-g,r[c+p+s]=m-b,p!==a&&(v=l*h-d*u,u=l*u+d*h,h=v)}},f.prototype.guessLen13b=function(t,e){var i=1|Math.max(e,t),r=1&i,n=0;for(i=i/2|0;i;i>>>=1)n++;return 1<<n+1+r},f.prototype.conjugate=function(t,e,i){if(!(i<=1))for(var r=0;r<i/2;r++){var n=t[r];t[r]=t[i-r-1],t[i-r-1]=n,n=e[r],e[r]=-e[i-r-1],e[i-r-1]=-n}},f.prototype.normalize13b=function(t,e){for(var i=0,r=0;r<e/2;r++){var n=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+i;t[r]=67108863&n,i=n<67108864?0:n/67108864|0}return t},f.prototype.convert13b=function(t,e,i,r){for(var n=0,o=0;o<e;o++)n+=0|t[o],i[2*o]=8191&n,n>>>=13,i[2*o+1]=8191&n,n>>>=13;for(o=2*e;o<r;++o)i[o]=0},f.prototype.stub=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=0;return e},f.prototype.mulp=function(t,e,i){var r=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(r),o=this.stub(r),s=new Array(r),a=new Array(r),l=new Array(r),d=new Array(r),c=new Array(r),h=new Array(r),u=i.words;u.length=r,this.convert13b(t.words,t.length,s,r),this.convert13b(e.words,e.length,d,r),this.transform(s,o,a,l,r,n),this.transform(d,o,c,h,r,n);for(var p=0;p<r;p++){var f=a[p]*c[p]-l[p]*h[p];l[p]=a[p]*h[p]+l[p]*c[p],a[p]=f}return this.conjugate(a,l,r),this.transform(a,l,u,o,r,n),this.conjugate(u,o,r),this.normalize13b(u,r),i.negative=t.negative^e.negative,i.length=t.length+e.length,i.strip()},r.prototype.mul=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},r.prototype.mulf=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),p(this,t,e)},r.prototype.imul=function(t){return this.clone().mulTo(t,this)},r.prototype.imuln=function(t){for(var e=0,i=0;i<this.length;i++){var r=(0|this.words[i])*t,n=(67108863&r)+(67108863&e);e>>=26,e+=r/67108864|0,e+=n>>>26,this.words[i]=67108863&n}return 0!==e&&(this.words[i]=e,this.length++),this},r.prototype.muln=function(t){return this.clone().imuln(t)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i<e.length;i++){var r=i/26|0,n=i%26;e[i]=(t.words[r]&1<<n)>>>n}return e}(t);if(0===e.length)return new r(1);for(var i=this,n=0;n<e.length&&0===e[n];n++,i=i.sqr());if(++n<e.length)for(var o=i.sqr();n<e.length;n++,o=o.sqr())0!==e[n]&&(i=i.mul(o));return i},r.prototype.iushln=function(t){var e,i=t%26,r=(t-i)/26,n=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e<this.length;e++){var s=this.words[e]&n,a=(0|this.words[e])-s<<i;this.words[e]=a|o,o=s>>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e<r;e++)this.words[e]=0;this.length+=r}return this.strip()},r.prototype.ishln=function(t){return this.iushln(t)},r.prototype.iushrn=function(t,e,i){var r;r=e?(e-e%26)/26:0;var n=t%26,o=Math.min((t-n)/26,this.length),s=67108863^67108863>>>n<<n,a=i;if(r-=o,r=Math.max(0,r),a){for(var l=0;l<o;l++)a.words[l]=this.words[l];a.length=o}if(0===o);else if(this.length>o)for(this.length-=o,l=0;l<this.length;l++)this.words[l]=this.words[l+o];else this.words[0]=0,this.length=1;var d=0;for(l=this.length-1;l>=0&&(0!==d||l>=r);l--){var c=0|this.words[l];this.words[l]=d<<26-n|c>>>n,d=c&s}return a&&0!==d&&(a.words[a.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},r.prototype.ishrn=function(t,e,i){return this.iushrn(t,e,i)},r.prototype.shln=function(t){return this.clone().ishln(t)},r.prototype.ushln=function(t){return this.clone().iushln(t)},r.prototype.shrn=function(t){return this.clone().ishrn(t)},r.prototype.ushrn=function(t){return this.clone().iushrn(t)},r.prototype.testn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;return!(this.length<=i||!(this.words[i]&r))},r.prototype.imaskn=function(t){var e=t%26,i=(t-e)/26;if(this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var r=67108863^67108863>>>e<<e;this.words[this.length-1]&=r}return this.strip()},r.prototype.maskn=function(t){return this.clone().imaskn(t)},r.prototype.iaddn=function(t){return t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},r.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},r.prototype.isubn=function(t){if(t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},r.prototype.addn=function(t){return this.clone().iaddn(t)},r.prototype.subn=function(t){return this.clone().isubn(t)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(t,e,i){var r,n,o=t.length+i;this._expand(o);var s=0;for(r=0;r<t.length;r++){n=(0|this.words[r+i])+s;var a=(0|t.words[r])*e;s=((n-=67108863&a)>>26)-(a/67108864|0),this.words[r+i]=67108863&n}for(;r<this.length-i;r++)s=(n=(0|this.words[r+i])+s)>>26,this.words[r+i]=67108863&n;if(0===s)return this.strip();for(s=0,r=0;r<this.length;r++)s=(n=-(0|this.words[r])+s)>>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},r.prototype._wordDiv=function(t,e){var i=(this.length,t.length),n=this.clone(),o=t,s=0|o.words[o.length-1];0!=(i=26-this._countBits(s))&&(o=o.ushln(i),n.iushln(i),s=0|o.words[o.length-1]);var a,l=n.length-o.length;if("mod"!==e){(a=new r(null)).length=l+1,a.words=new Array(a.length);for(var d=0;d<a.length;d++)a.words[d]=0}var c=n.clone()._ishlnsubmul(o,1,l);0===c.negative&&(n=c,a&&(a.words[l]=1));for(var h=l-1;h>=0;h--){var u=67108864*(0|n.words[o.length+h])+(0|n.words[o.length+h-1]);for(u=Math.min(u/s|0,67108863),n._ishlnsubmul(o,u,h);0!==n.negative;)u--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=u)}return a&&a.strip(),n.strip(),"div"!==e&&0!==i&&n.iushrn(i),{div:a||null,mod:n}},r.prototype.divmod=function(t,e,i){return this.isZero()?{div:new r(0),mod:new r(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(o=s.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new r(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new r(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new r(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,s},r.prototype.div=function(t){return this.divmod(t,"div",!1).div},r.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},r.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},r.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),o=i.cmp(r);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},r.prototype.modn=function(t){for(var e=(1<<26)%t,i=0,r=this.length-1;r>=0;r--)i=(e*i+(0|this.words[r]))%t;return i},r.prototype.idivn=function(t){for(var e=0,i=this.length-1;i>=0;i--){var r=(0|this.words[i])+67108864*e;this.words[i]=r/t|0,e=r%t}return this.strip()},r.prototype.divn=function(t){return this.clone().idivn(t)},r.prototype.egcd=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new r(1),o=new r(0),s=new r(0),a=new r(1),l=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++l;for(var d=i.clone(),c=e.clone();!e.isZero();){for(var h=0,u=1;0==(e.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(d),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,f=1;0==(i.words[0]&f)&&p<26;++p,f<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(s.isOdd()||a.isOdd())&&(s.iadd(d),a.isub(c)),s.iushrn(1),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(s),o.isub(a)):(i.isub(e),s.isub(n),a.isub(o))}return{a:s,b:a,gcd:i.iushln(l)}},r.prototype._invmp=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new r(1),s=new r(0),a=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(a),o.iushrn(1);for(var c=0,h=1;0==(i.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(i.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(a),s.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(s)):(i.isub(e),s.isub(o))}return(n=0===e.cmpn(1)?o:s).cmpn(0)<0&&n.iadd(t),n},r.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var o=e;e=i,i=o}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},r.prototype.invm=function(t){return this.egcd(t).a.umod(t)},r.prototype.isEven=function(){return 0==(1&this.words[0])},r.prototype.isOdd=function(){return 1==(1&this.words[0])},r.prototype.andln=function(t){return this.words[0]&t},r.prototype.bincn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=r,this;for(var n=r,o=i;0!==n&&o<this.length;o++){var s=0|this.words[o];n=(s+=n)>>>26,s&=67108863,this.words[o]=s}return 0!==n&&(this.words[o]=n,this.length++),this},r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},r.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t);var r=0|this.words[0];e=r===t?0:r<t?-1:1}return 0!==this.negative?0|-e:e},r.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},r.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){r<n?e=-1:r>n&&(e=1);break}}return e},r.prototype.gtn=function(t){return 1===this.cmpn(t)},r.prototype.gt=function(t){return 1===this.cmp(t)},r.prototype.gten=function(t){return this.cmpn(t)>=0},r.prototype.gte=function(t){return this.cmp(t)>=0},r.prototype.ltn=function(t){return-1===this.cmpn(t)},r.prototype.lt=function(t){return-1===this.cmp(t)},r.prototype.lten=function(t){return this.cmpn(t)<=0},r.prototype.lte=function(t){return this.cmp(t)<=0},r.prototype.eqn=function(t){return 0===this.cmpn(t)},r.prototype.eq=function(t){return 0===this.cmp(t)},r.red=function(t){return new w(t)},r.prototype.toRed=function(t){return t.convertTo(this)._forceRed(t)},r.prototype.fromRed=function(){return this.red.convertFrom(this)},r.prototype._forceRed=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return this._forceRed(t)},r.prototype.redAdd=function(t){return this.red.add(this,t)},r.prototype.redIAdd=function(t){return this.red.iadd(this,t)},r.prototype.redSub=function(t){return this.red.sub(this,t)},r.prototype.redISub=function(t){return this.red.isub(this,t)},r.prototype.redShl=function(t){return this.red.shl(this,t)},r.prototype.redMul=function(t){return this.red._verify2(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return this.red._verify2(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(t){return this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new r(e,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function y(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=r._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function x(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new r(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},i(b,g),b.prototype.split=function(t,e){for(var i=Math.min(t.length,9),r=0;r<i;r++)e.words[r]=t.words[r];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(e.words[e.length++]=4194303&n,r=10;r<t.length;r++){var o=0|t.words[r];t.words[r-10]=(4194303&o)<<4|n>>>22,n=o}n>>>=22,t.words[r-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i<t.length;i++){var r=0|t.words[i];e+=977*r,t.words[i]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(v,g),i(y,g),i(_,g),_.prototype.imulK=function(t){for(var e=0,i=0;i<t.length;i++){var r=19*(0|t.words[i])+e,n=67108863&r;r>>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},r._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new v;else if("p192"===t)e=new y;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return m[t]=e,e},w.prototype._verify1=function(t){},w.prototype._verify2=function(t,e){},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},w.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();if(3===this.m.andln(3)){var e=this.m.add(new r(1)).iushrn(2);return this.pow(t,e)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);var o=new r(1).toRed(this),s=o.redNeg(),a=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new r(2*l*l).toRed(this);0!==this.pow(l,a).cmp(s);)l.redIAdd(s);for(var d=this.pow(l,i),c=this.pow(t,i.addn(1).iushrn(1)),h=this.pow(t,i),u=n;0!==h.cmp(o);){for(var p=h,f=0;0!==p.cmp(o);f++)p=p.redSqr();var m=this.pow(d,new r(1).iushln(u-f-1));c=c.redMul(m),d=m.redSqr(),h=h.redMul(d),u=f}return c},w.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},w.prototype.pow=function(t,e){if(e.isZero())return new r(1).toRed(this);if(0===e.cmpn(1))return t.clone();var i=new Array(16);i[0]=new r(1).toRed(this),i[1]=t;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],t);var o=i[0],s=0,a=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var d=e.words[n],c=l-1;c>=0;c--){var h=d>>c&1;o!==i[0]&&(o=this.sqr(o)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===n&&0===c)&&(o=this.mul(o,i[s]),a=0,s=0)):a=0}l=26}return o},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},r.mont=function(t){return new x(t)},i(x,w),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0)._forceRed(this);var i=t.mul(e),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(kn,this),kn=kn.exports;var Sn={};(function(t){(function(){function e(e,r){var n=function(t){var e=i(t);return{blinder:e.toRed(kn.mont(t.modulus)).redPow(new kn(t.publicExponent)).fromRed(),unblinder:e.invm(t.modulus)}}(r),o=r.modulus.byteLength(),s=(kn.mont(r.modulus),new kn(e).mul(n.blinder).umod(r.modulus)),a=s.toRed(kn.mont(r.prime1)),l=s.toRed(kn.mont(r.prime2)),d=r.coefficient,c=r.prime1,h=r.prime2,u=a.redPow(r.exponent1),p=l.redPow(r.exponent2);u=u.fromRed(),p=p.fromRed();var f=u.isub(p).imul(d).umod(c);return f.imul(h),p.iadd(f),new t(p.imul(n.unblinder).umod(r.modulus).toArray(!1,o))}function i(t){for(var e=t.modulus.byteLength(),i=new kn(j(e));i.cmp(t.modulus)>=0||!i.umod(t.prime1)||!i.umod(t.prime2);)i=new kn(j(e));return i}Sn=e,e.getr=i}).call(this)}).call(this,d({}).Buffer);var En={exports:{}};!function(t,e){function i(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function r(t,e,i){if(r.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var n;"object"==typeof t?t.exports=r:e.BN=r,r.BN=r,r.wordSize=26;try{n=l({}).Buffer}catch(t){}function o(t,e,i){for(var r=0,n=Math.min(t.length,i),o=e;o<n;o++){var s=t.charCodeAt(o)-48;r<<=4,r|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return r}function s(t,e,i,r){for(var n=0,o=Math.min(t.length,i),s=e;s<o;s++){var a=t.charCodeAt(s)-48;n*=r,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}r.isBN=function(t){return t instanceof r||null!==t&&"object"==typeof t&&t.constructor.wordSize===r.wordSize&&Array.isArray(t.words)},r.max=function(t,e){return t.cmp(e)>0?t:e},r.min=function(t,e){return t.cmp(e)<0?t:e},r.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16);var r=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&r++,16===e?this._parseHex(t,r):this._parseBase(t,e,r),"-"===t[0]&&(this.negative=1),this.strip(),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initArray=function(t,e,i){if(t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,o,s=0;if("be"===i)for(r=t.length-1,n=0;r>=0;r-=3)o=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[n]|=o<<s&67108863,this.words[n+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);else if("le"===i)for(r=0,n=0;r<t.length;r+=3)o=t[r]|t[r+1]<<8|t[r+2]<<16,this.words[n]|=o<<s&67108863,this.words[n+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);return this.strip()},r.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var r,n,s=0;for(i=t.length-6,r=0;i>=e;i-=6)n=o(t,i,i+6),this.words[r]|=n<<s&67108863,this.words[r+1]|=n>>>26-s&4194303,(s+=24)>=26&&(s-=26,r++);i+6!==e&&(n=o(t,e,i+6),this.words[r]|=n<<s&67108863,this.words[r+1]|=n>>>26-s&4194303),this.strip()},r.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var o=t.length-i,a=o%r,l=Math.min(o,o-a)+i,d=0,c=i;c<l;c+=r)d=s(t,c,c+r,e),this.imuln(n),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(0!==a){var h=1;for(d=s(t,c,t.length,e),c=0;c<a;c++)h*=e;this.imuln(h),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}},r.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},r.prototype.clone=function(){var t=new r(null);return this.copy(t),t},r.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},r.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},r.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},r.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var a=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,l=s/67108864|0;i.words[0]=a;for(var d=1;d<r;d++){for(var c=l>>>26,h=67108863&l,u=Math.min(d,e.length-1),p=Math.max(0,d-t.length+1);p<=u;p++){var f=d-p|0;c+=(s=(n=0|t.words[f])*(o=0|e.words[p])+h)/67108864|0,h=67108863&s}i.words[d]=0|h,l=0|c}return 0!==l?i.words[d]=0|l:i.length--,i.strip()}r.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var r=0,n=0,o=0;o<this.length;o++){var s=this.words[o],l=(16777215&(s<<r|n)).toString(16);i=0!=(n=s>>>24-r&16777215)||o!==this.length-1?a[6-l.length]+l+i:l+i,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(i=n.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var h=d[t],u=c[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var f=p.modn(u).toString(t);i=(p=p.idivn(u)).isZero()?f+i:a[h-f.length]+f+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}},r.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length,0!==this.negative?-t:t},r.prototype.toJSON=function(){return this.toString(16)},r.prototype.toBuffer=function(t,e){return this.toArrayLike(n,t,e)},r.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},r.prototype.toArrayLike=function(t,e,i){var r=this.byteLength(),n=i||Math.max(1,r);this.strip();var o,s,a="le"===e,l=new t(n),d=this.clone();if(a){for(s=0;!d.isZero();s++)o=d.andln(255),d.iushrn(8),l[s]=o;for(;s<n;s++)l[s]=0}else{for(s=0;s<n-r;s++)l[s]=0;for(s=0;!d.isZero();s++)o=d.andln(255),d.iushrn(8),l[n-s-1]=o}return l},Math.clz32?r.prototype._countBits=function(t){return 32-Math.clz32(t)}:r.prototype._countBits=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},r.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},r.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var i=this._zeroBits(this.words[e]);if(t+=i,26!==i)break}return t},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},r.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return 0!==this.negative},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},r.prototype.ior=function(t){return this.iuor(t)},r.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},r.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},r.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;i<e.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=e.length,this.strip()},r.prototype.iand=function(t){return this.iuand(t)},r.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},r.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},r.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;r<i.length;r++)this.words[r]=e.words[r]^i.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},r.prototype.ixor=function(t){return this.iuxor(t)},r.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},r.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},r.prototype.inotn=function(t){var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var r=0;r<e;r++)this.words[r]=67108863&~this.words[r];return i>0&&(this.words[r]=~this.words[r]&67108863>>26-i),this.strip()},r.prototype.notn=function(t){return this.clone().inotn(t)},r.prototype.setn=function(t,e){var i=t/26|0,r=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<r:this.words[i]&~(1<<r),this.strip()},r.prototype.iadd=function(t){var e,i,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0,o=0;o<r.length;o++)e=(0|i.words[o])+(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<i.length;o++)e=(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this},r.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},r.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var o=0,s=0;s<r.length;s++)o=(e=(0|i.words[s])-(0|r.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<i.length;s++)o=(e=(0|i.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<i.length&&i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this.length=Math.max(this.length,s),i!==this&&(this.negative=1),this.strip()},r.prototype.sub=function(t){return this.clone().isub(t)};var u=function(t,e,i){var r,n,o,s=t.words,a=e.words,l=i.words,d=0,c=0|s[0],h=8191&c,u=c>>>13,p=0|s[1],f=8191&p,m=p>>>13,g=0|s[2],b=8191&g,v=g>>>13,y=0|s[3],_=8191&y,w=y>>>13,x=0|s[4],M=8191&x,k=x>>>13,S=0|s[5],E=8191&S,A=S>>>13,T=0|s[6],I=8191&T,C=T>>>13,R=0|s[7],O=8191&R,L=R>>>13,P=0|s[8],B=8191&P,N=P>>>13,$=0|s[9],z=8191&$,j=$>>>13,F=0|a[0],D=8191&F,q=F>>>13,U=0|a[1],H=8191&U,V=U>>>13,W=0|a[2],G=8191&W,K=W>>>13,X=0|a[3],Z=8191&X,Y=X>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],it=8191&et,rt=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],lt=8191&at,dt=at>>>13,ct=0|a[8],ht=8191&ct,ut=ct>>>13,pt=0|a[9],ft=8191&pt,mt=pt>>>13;i.negative=t.negative^e.negative,i.length=19;var gt=(d+(r=Math.imul(h,D))|0)+((8191&(n=(n=Math.imul(h,q))+Math.imul(u,D)|0))<<13)|0;d=((o=Math.imul(u,q))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(f,D),n=(n=Math.imul(f,q))+Math.imul(m,D)|0,o=Math.imul(m,q);var bt=(d+(r=r+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,V)|0)+Math.imul(u,H)|0))<<13)|0;d=((o=o+Math.imul(u,V)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,D),n=(n=Math.imul(b,q))+Math.imul(v,D)|0,o=Math.imul(v,q),r=r+Math.imul(f,H)|0,n=(n=n+Math.imul(f,V)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,V)|0;var vt=(d+(r=r+Math.imul(h,G)|0)|0)+((8191&(n=(n=n+Math.imul(h,K)|0)+Math.imul(u,G)|0))<<13)|0;d=((o=o+Math.imul(u,K)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(_,D),n=(n=Math.imul(_,q))+Math.imul(w,D)|0,o=Math.imul(w,q),r=r+Math.imul(b,H)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,n=(n=n+Math.imul(f,K)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,K)|0;var yt=(d+(r=r+Math.imul(h,Z)|0)|0)+((8191&(n=(n=n+Math.imul(h,Y)|0)+Math.imul(u,Z)|0))<<13)|0;d=((o=o+Math.imul(u,Y)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(M,D),n=(n=Math.imul(M,q))+Math.imul(k,D)|0,o=Math.imul(k,q),r=r+Math.imul(_,H)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,H)|0,o=o+Math.imul(w,V)|0,r=r+Math.imul(b,G)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,K)|0,r=r+Math.imul(f,Z)|0,n=(n=n+Math.imul(f,Y)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,Y)|0;var _t=(d+(r=r+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(u,Q)|0))<<13)|0;d=((o=o+Math.imul(u,tt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(E,D),n=(n=Math.imul(E,q))+Math.imul(A,D)|0,o=Math.imul(A,q),r=r+Math.imul(M,H)|0,n=(n=n+Math.imul(M,V)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(_,G)|0,n=(n=n+Math.imul(_,K)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,K)|0,r=r+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,Y)|0,r=r+Math.imul(f,Q)|0,n=(n=n+Math.imul(f,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var wt=(d+(r=r+Math.imul(h,it)|0)|0)+((8191&(n=(n=n+Math.imul(h,rt)|0)+Math.imul(u,it)|0))<<13)|0;d=((o=o+Math.imul(u,rt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(I,D),n=(n=Math.imul(I,q))+Math.imul(C,D)|0,o=Math.imul(C,q),r=r+Math.imul(E,H)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,V)|0,r=r+Math.imul(M,G)|0,n=(n=n+Math.imul(M,K)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,K)|0,r=r+Math.imul(_,Z)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,Y)|0,r=r+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(f,it)|0,n=(n=n+Math.imul(f,rt)|0)+Math.imul(m,it)|0,o=o+Math.imul(m,rt)|0;var xt=(d+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,st)|0)+Math.imul(u,ot)|0))<<13)|0;d=((o=o+Math.imul(u,st)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(O,D),n=(n=Math.imul(O,q))+Math.imul(L,D)|0,o=Math.imul(L,q),r=r+Math.imul(I,H)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(C,H)|0,o=o+Math.imul(C,V)|0,r=r+Math.imul(E,G)|0,n=(n=n+Math.imul(E,K)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,K)|0,r=r+Math.imul(M,Z)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,Y)|0,r=r+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(b,it)|0,n=(n=n+Math.imul(b,rt)|0)+Math.imul(v,it)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(f,ot)|0,n=(n=n+Math.imul(f,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Mt=(d+(r=r+Math.imul(h,lt)|0)|0)+((8191&(n=(n=n+Math.imul(h,dt)|0)+Math.imul(u,lt)|0))<<13)|0;d=((o=o+Math.imul(u,dt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(B,D),n=(n=Math.imul(B,q))+Math.imul(N,D)|0,o=Math.imul(N,q),r=r+Math.imul(O,H)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,V)|0,r=r+Math.imul(I,G)|0,n=(n=n+Math.imul(I,K)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,K)|0,r=r+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,Y)|0,r=r+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(_,it)|0,n=(n=n+Math.imul(_,rt)|0)+Math.imul(w,it)|0,o=o+Math.imul(w,rt)|0,r=r+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,r=r+Math.imul(f,lt)|0,n=(n=n+Math.imul(f,dt)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,dt)|0;var kt=(d+(r=r+Math.imul(h,ht)|0)|0)+((8191&(n=(n=n+Math.imul(h,ut)|0)+Math.imul(u,ht)|0))<<13)|0;d=((o=o+Math.imul(u,ut)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(z,D),n=(n=Math.imul(z,q))+Math.imul(j,D)|0,o=Math.imul(j,q),r=r+Math.imul(B,H)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(O,G)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,K)|0,r=r+Math.imul(I,Z)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,Y)|0,r=r+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(M,it)|0,n=(n=n+Math.imul(M,rt)|0)+Math.imul(k,it)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(_,ot)|0,n=(n=n+Math.imul(_,st)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,st)|0,r=r+Math.imul(b,lt)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,dt)|0,r=r+Math.imul(f,ht)|0,n=(n=n+Math.imul(f,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var St=(d+(r=r+Math.imul(h,ft)|0)|0)+((8191&(n=(n=n+Math.imul(h,mt)|0)+Math.imul(u,ft)|0))<<13)|0;d=((o=o+Math.imul(u,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(z,H),n=(n=Math.imul(z,V))+Math.imul(j,H)|0,o=Math.imul(j,V),r=r+Math.imul(B,G)|0,n=(n=n+Math.imul(B,K)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,K)|0,r=r+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,Y)|0,r=r+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,r=r+Math.imul(E,it)|0,n=(n=n+Math.imul(E,rt)|0)+Math.imul(A,it)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,r=r+Math.imul(_,lt)|0,n=(n=n+Math.imul(_,dt)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,dt)|0,r=r+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,ut)|0;var Et=(d+(r=r+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,mt)|0)+Math.imul(m,ft)|0))<<13)|0;d=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(z,G),n=(n=Math.imul(z,K))+Math.imul(j,G)|0,o=Math.imul(j,K),r=r+Math.imul(B,Z)|0,n=(n=n+Math.imul(B,Y)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,Y)|0,r=r+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,r=r+Math.imul(I,it)|0,n=(n=n+Math.imul(I,rt)|0)+Math.imul(C,it)|0,o=o+Math.imul(C,rt)|0,r=r+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,r=r+Math.imul(M,lt)|0,n=(n=n+Math.imul(M,dt)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,dt)|0,r=r+Math.imul(_,ht)|0,n=(n=n+Math.imul(_,ut)|0)+Math.imul(w,ht)|0,o=o+Math.imul(w,ut)|0;var At=(d+(r=r+Math.imul(b,ft)|0)|0)+((8191&(n=(n=n+Math.imul(b,mt)|0)+Math.imul(v,ft)|0))<<13)|0;d=((o=o+Math.imul(v,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(z,Z),n=(n=Math.imul(z,Y))+Math.imul(j,Z)|0,o=Math.imul(j,Y),r=r+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(O,it)|0,n=(n=n+Math.imul(O,rt)|0)+Math.imul(L,it)|0,o=o+Math.imul(L,rt)|0,r=r+Math.imul(I,ot)|0,n=(n=n+Math.imul(I,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,r=r+Math.imul(E,lt)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,dt)|0,r=r+Math.imul(M,ht)|0,n=(n=n+Math.imul(M,ut)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,ut)|0;var Tt=(d+(r=r+Math.imul(_,ft)|0)|0)+((8191&(n=(n=n+Math.imul(_,mt)|0)+Math.imul(w,ft)|0))<<13)|0;d=((o=o+Math.imul(w,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(z,Q),n=(n=Math.imul(z,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),r=r+Math.imul(B,it)|0,n=(n=n+Math.imul(B,rt)|0)+Math.imul(N,it)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,r=r+Math.imul(I,lt)|0,n=(n=n+Math.imul(I,dt)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,dt)|0,r=r+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,ut)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ut)|0;var It=(d+(r=r+Math.imul(M,ft)|0)|0)+((8191&(n=(n=n+Math.imul(M,mt)|0)+Math.imul(k,ft)|0))<<13)|0;d=((o=o+Math.imul(k,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(z,it),n=(n=Math.imul(z,rt))+Math.imul(j,it)|0,o=Math.imul(j,rt),r=r+Math.imul(B,ot)|0,n=(n=n+Math.imul(B,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,r=r+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(L,lt)|0,o=o+Math.imul(L,dt)|0,r=r+Math.imul(I,ht)|0,n=(n=n+Math.imul(I,ut)|0)+Math.imul(C,ht)|0,o=o+Math.imul(C,ut)|0;var Ct=(d+(r=r+Math.imul(E,ft)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(A,ft)|0))<<13)|0;d=((o=o+Math.imul(A,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(z,ot),n=(n=Math.imul(z,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),r=r+Math.imul(B,lt)|0,n=(n=n+Math.imul(B,dt)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,dt)|0,r=r+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(L,ht)|0,o=o+Math.imul(L,ut)|0;var Rt=(d+(r=r+Math.imul(I,ft)|0)|0)+((8191&(n=(n=n+Math.imul(I,mt)|0)+Math.imul(C,ft)|0))<<13)|0;d=((o=o+Math.imul(C,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(z,lt),n=(n=Math.imul(z,dt))+Math.imul(j,lt)|0,o=Math.imul(j,dt),r=r+Math.imul(B,ht)|0,n=(n=n+Math.imul(B,ut)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,ut)|0;var Ot=(d+(r=r+Math.imul(O,ft)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(L,ft)|0))<<13)|0;d=((o=o+Math.imul(L,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(z,ht),n=(n=Math.imul(z,ut))+Math.imul(j,ht)|0,o=Math.imul(j,ut);var Lt=(d+(r=r+Math.imul(B,ft)|0)|0)+((8191&(n=(n=n+Math.imul(B,mt)|0)+Math.imul(N,ft)|0))<<13)|0;d=((o=o+Math.imul(N,mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Pt=(d+(r=Math.imul(z,ft))|0)+((8191&(n=(n=Math.imul(z,mt))+Math.imul(j,ft)|0))<<13)|0;return d=((o=Math.imul(j,mt))+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,l[0]=gt,l[1]=bt,l[2]=vt,l[3]=yt,l[4]=_t,l[5]=wt,l[6]=xt,l[7]=Mt,l[8]=kt,l[9]=St,l[10]=Et,l[11]=At,l[12]=Tt,l[13]=It,l[14]=Ct,l[15]=Rt,l[16]=Ot,l[17]=Lt,l[18]=Pt,0!==d&&(l[19]=d,i.length++),i};function p(t,e,i){return(new f).mulp(t,e,i)}function f(t,e){this.x=t,this.y=e}Math.imul||(u=h),r.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?u(this,t,e):i<63?h(this,t,e):i<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,o=0;o<i.length-1;o++){var s=n;n=0;for(var a=67108863&r,l=Math.min(o,e.length-1),d=Math.max(0,o-t.length+1);d<=l;d++){var c=o-d,h=(0|t.words[c])*(0|e.words[d]),u=67108863&h;a=67108863&(u=u+a|0),n+=(s=(s=s+(h/67108864|0)|0)+(u>>>26)|0)>>>26,s&=67108863}i.words[o]=a,r=s,s=n}return 0!==r?i.words[o]=r:i.length--,i.strip()}(this,t,e):p(this,t,e)},f.prototype.makeRBT=function(t){for(var e=new Array(t),i=r.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,i,t);return e},f.prototype.revBin=function(t,e,i){if(0===t||t===i-1)return t;for(var r=0,n=0;n<e;n++)r|=(1&t)<<e-n-1,t>>=1;return r},f.prototype.permute=function(t,e,i,r,n,o){for(var s=0;s<o;s++)r[s]=e[t[s]],n[s]=i[t[s]]},f.prototype.transform=function(t,e,i,r,n,o){this.permute(o,t,e,i,r,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,l=Math.cos(2*Math.PI/a),d=Math.sin(2*Math.PI/a),c=0;c<n;c+=a)for(var h=l,u=d,p=0;p<s;p++){var f=i[c+p],m=r[c+p],g=i[c+p+s],b=r[c+p+s],v=h*g-u*b;b=h*b+u*g,g=v,i[c+p]=f+g,r[c+p]=m+b,i[c+p+s]=f-g,r[c+p+s]=m-b,p!==a&&(v=l*h-d*u,u=l*u+d*h,h=v)}},f.prototype.guessLen13b=function(t,e){var i=1|Math.max(e,t),r=1&i,n=0;for(i=i/2|0;i;i>>>=1)n++;return 1<<n+1+r},f.prototype.conjugate=function(t,e,i){if(!(i<=1))for(var r=0;r<i/2;r++){var n=t[r];t[r]=t[i-r-1],t[i-r-1]=n,n=e[r],e[r]=-e[i-r-1],e[i-r-1]=-n}},f.prototype.normalize13b=function(t,e){for(var i=0,r=0;r<e/2;r++){var n=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+i;t[r]=67108863&n,i=n<67108864?0:n/67108864|0}return t},f.prototype.convert13b=function(t,e,i,r){for(var n=0,o=0;o<e;o++)n+=0|t[o],i[2*o]=8191&n,n>>>=13,i[2*o+1]=8191&n,n>>>=13;for(o=2*e;o<r;++o)i[o]=0},f.prototype.stub=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=0;return e},f.prototype.mulp=function(t,e,i){var r=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(r),o=this.stub(r),s=new Array(r),a=new Array(r),l=new Array(r),d=new Array(r),c=new Array(r),h=new Array(r),u=i.words;u.length=r,this.convert13b(t.words,t.length,s,r),this.convert13b(e.words,e.length,d,r),this.transform(s,o,a,l,r,n),this.transform(d,o,c,h,r,n);for(var p=0;p<r;p++){var f=a[p]*c[p]-l[p]*h[p];l[p]=a[p]*h[p]+l[p]*c[p],a[p]=f}return this.conjugate(a,l,r),this.transform(a,l,u,o,r,n),this.conjugate(u,o,r),this.normalize13b(u,r),i.negative=t.negative^e.negative,i.length=t.length+e.length,i.strip()},r.prototype.mul=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},r.prototype.mulf=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),p(this,t,e)},r.prototype.imul=function(t){return this.clone().mulTo(t,this)},r.prototype.imuln=function(t){for(var e=0,i=0;i<this.length;i++){var r=(0|this.words[i])*t,n=(67108863&r)+(67108863&e);e>>=26,e+=r/67108864|0,e+=n>>>26,this.words[i]=67108863&n}return 0!==e&&(this.words[i]=e,this.length++),this},r.prototype.muln=function(t){return this.clone().imuln(t)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i<e.length;i++){var r=i/26|0,n=i%26;e[i]=(t.words[r]&1<<n)>>>n}return e}(t);if(0===e.length)return new r(1);for(var i=this,n=0;n<e.length&&0===e[n];n++,i=i.sqr());if(++n<e.length)for(var o=i.sqr();n<e.length;n++,o=o.sqr())0!==e[n]&&(i=i.mul(o));return i},r.prototype.iushln=function(t){var e,i=t%26,r=(t-i)/26,n=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e<this.length;e++){var s=this.words[e]&n,a=(0|this.words[e])-s<<i;this.words[e]=a|o,o=s>>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e<r;e++)this.words[e]=0;this.length+=r}return this.strip()},r.prototype.ishln=function(t){return this.iushln(t)},r.prototype.iushrn=function(t,e,i){var r;r=e?(e-e%26)/26:0;var n=t%26,o=Math.min((t-n)/26,this.length),s=67108863^67108863>>>n<<n,a=i;if(r-=o,r=Math.max(0,r),a){for(var l=0;l<o;l++)a.words[l]=this.words[l];a.length=o}if(0===o);else if(this.length>o)for(this.length-=o,l=0;l<this.length;l++)this.words[l]=this.words[l+o];else this.words[0]=0,this.length=1;var d=0;for(l=this.length-1;l>=0&&(0!==d||l>=r);l--){var c=0|this.words[l];this.words[l]=d<<26-n|c>>>n,d=c&s}return a&&0!==d&&(a.words[a.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},r.prototype.ishrn=function(t,e,i){return this.iushrn(t,e,i)},r.prototype.shln=function(t){return this.clone().ishln(t)},r.prototype.ushln=function(t){return this.clone().iushln(t)},r.prototype.shrn=function(t){return this.clone().ishrn(t)},r.prototype.ushrn=function(t){return this.clone().iushrn(t)},r.prototype.testn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;return!(this.length<=i||!(this.words[i]&r))},r.prototype.imaskn=function(t){var e=t%26,i=(t-e)/26;if(this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var r=67108863^67108863>>>e<<e;this.words[this.length-1]&=r}return this.strip()},r.prototype.maskn=function(t){return this.clone().imaskn(t)},r.prototype.iaddn=function(t){return t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},r.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},r.prototype.isubn=function(t){if(t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},r.prototype.addn=function(t){return this.clone().iaddn(t)},r.prototype.subn=function(t){return this.clone().isubn(t)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(t,e,i){var r,n,o=t.length+i;this._expand(o);var s=0;for(r=0;r<t.length;r++){n=(0|this.words[r+i])+s;var a=(0|t.words[r])*e;s=((n-=67108863&a)>>26)-(a/67108864|0),this.words[r+i]=67108863&n}for(;r<this.length-i;r++)s=(n=(0|this.words[r+i])+s)>>26,this.words[r+i]=67108863&n;if(0===s)return this.strip();for(s=0,r=0;r<this.length;r++)s=(n=-(0|this.words[r])+s)>>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},r.prototype._wordDiv=function(t,e){var i=(this.length,t.length),n=this.clone(),o=t,s=0|o.words[o.length-1];0!=(i=26-this._countBits(s))&&(o=o.ushln(i),n.iushln(i),s=0|o.words[o.length-1]);var a,l=n.length-o.length;if("mod"!==e){(a=new r(null)).length=l+1,a.words=new Array(a.length);for(var d=0;d<a.length;d++)a.words[d]=0}var c=n.clone()._ishlnsubmul(o,1,l);0===c.negative&&(n=c,a&&(a.words[l]=1));for(var h=l-1;h>=0;h--){var u=67108864*(0|n.words[o.length+h])+(0|n.words[o.length+h-1]);for(u=Math.min(u/s|0,67108863),n._ishlnsubmul(o,u,h);0!==n.negative;)u--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=u)}return a&&a.strip(),n.strip(),"div"!==e&&0!==i&&n.iushrn(i),{div:a||null,mod:n}},r.prototype.divmod=function(t,e,i){return this.isZero()?{div:new r(0),mod:new r(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(o=s.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new r(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new r(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new r(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,s},r.prototype.div=function(t){return this.divmod(t,"div",!1).div},r.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},r.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},r.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),o=i.cmp(r);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},r.prototype.modn=function(t){for(var e=(1<<26)%t,i=0,r=this.length-1;r>=0;r--)i=(e*i+(0|this.words[r]))%t;return i},r.prototype.idivn=function(t){for(var e=0,i=this.length-1;i>=0;i--){var r=(0|this.words[i])+67108864*e;this.words[i]=r/t|0,e=r%t}return this.strip()},r.prototype.divn=function(t){return this.clone().idivn(t)},r.prototype.egcd=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new r(1),o=new r(0),s=new r(0),a=new r(1),l=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++l;for(var d=i.clone(),c=e.clone();!e.isZero();){for(var h=0,u=1;0==(e.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(d),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,f=1;0==(i.words[0]&f)&&p<26;++p,f<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(s.isOdd()||a.isOdd())&&(s.iadd(d),a.isub(c)),s.iushrn(1),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(s),o.isub(a)):(i.isub(e),s.isub(n),a.isub(o))}return{a:s,b:a,gcd:i.iushln(l)}},r.prototype._invmp=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new r(1),s=new r(0),a=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(a),o.iushrn(1);for(var c=0,h=1;0==(i.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(i.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(a),s.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(s)):(i.isub(e),s.isub(o))}return(n=0===e.cmpn(1)?o:s).cmpn(0)<0&&n.iadd(t),n},r.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var o=e;e=i,i=o}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},r.prototype.invm=function(t){return this.egcd(t).a.umod(t)},r.prototype.isEven=function(){return 0==(1&this.words[0])},r.prototype.isOdd=function(){return 1==(1&this.words[0])},r.prototype.andln=function(t){return this.words[0]&t},r.prototype.bincn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=r,this;for(var n=r,o=i;0!==n&&o<this.length;o++){var s=0|this.words[o];n=(s+=n)>>>26,s&=67108863,this.words[o]=s}return 0!==n&&(this.words[o]=n,this.length++),this},r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},r.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t);var r=0|this.words[0];e=r===t?0:r<t?-1:1}return 0!==this.negative?0|-e:e},r.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},r.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){r<n?e=-1:r>n&&(e=1);break}}return e},r.prototype.gtn=function(t){return 1===this.cmpn(t)},r.prototype.gt=function(t){return 1===this.cmp(t)},r.prototype.gten=function(t){return this.cmpn(t)>=0},r.prototype.gte=function(t){return this.cmp(t)>=0},r.prototype.ltn=function(t){return-1===this.cmpn(t)},r.prototype.lt=function(t){return-1===this.cmp(t)},r.prototype.lten=function(t){return this.cmpn(t)<=0},r.prototype.lte=function(t){return this.cmp(t)<=0},r.prototype.eqn=function(t){return 0===this.cmpn(t)},r.prototype.eq=function(t){return 0===this.cmp(t)},r.red=function(t){return new w(t)},r.prototype.toRed=function(t){return t.convertTo(this)._forceRed(t)},r.prototype.fromRed=function(){return this.red.convertFrom(this)},r.prototype._forceRed=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return this._forceRed(t)},r.prototype.redAdd=function(t){return this.red.add(this,t)},r.prototype.redIAdd=function(t){return this.red.iadd(this,t)},r.prototype.redSub=function(t){return this.red.sub(this,t)},r.prototype.redISub=function(t){return this.red.isub(this,t)},r.prototype.redShl=function(t){return this.red.shl(this,t)},r.prototype.redMul=function(t){return this.red._verify2(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return this.red._verify2(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(t){return this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new r(e,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function y(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=r._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function x(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new r(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},i(b,g),b.prototype.split=function(t,e){for(var i=Math.min(t.length,9),r=0;r<i;r++)e.words[r]=t.words[r];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(e.words[e.length++]=4194303&n,r=10;r<t.length;r++){var o=0|t.words[r];t.words[r-10]=(4194303&o)<<4|n>>>22,n=o}n>>>=22,t.words[r-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i<t.length;i++){var r=0|t.words[i];e+=977*r,t.words[i]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(v,g),i(y,g),i(_,g),_.prototype.imulK=function(t){for(var e=0,i=0;i<t.length;i++){var r=19*(0|t.words[i])+e,n=67108863&r;r>>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},r._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new v;else if("p192"===t)e=new y;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return m[t]=e,e},w.prototype._verify1=function(t){},w.prototype._verify2=function(t,e){},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},w.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();if(3===this.m.andln(3)){var e=this.m.add(new r(1)).iushrn(2);return this.pow(t,e)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);var o=new r(1).toRed(this),s=o.redNeg(),a=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new r(2*l*l).toRed(this);0!==this.pow(l,a).cmp(s);)l.redIAdd(s);for(var d=this.pow(l,i),c=this.pow(t,i.addn(1).iushrn(1)),h=this.pow(t,i),u=n;0!==h.cmp(o);){for(var p=h,f=0;0!==p.cmp(o);f++)p=p.redSqr();var m=this.pow(d,new r(1).iushln(u-f-1));c=c.redMul(m),d=m.redSqr(),h=h.redMul(d),u=f}return c},w.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},w.prototype.pow=function(t,e){if(e.isZero())return new r(1).toRed(this);if(0===e.cmpn(1))return t.clone();var i=new Array(16);i[0]=new r(1).toRed(this),i[1]=t;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],t);var o=i[0],s=0,a=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var d=e.words[n],c=l-1;c>=0;c--){var h=d>>c&1;o!==i[0]&&(o=this.sqr(o)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===n&&0===c)&&(o=this.mul(o,i[s]),a=0,s=0)):a=0}l=26}return o},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},r.mont=function(t){return new x(t)},i(x,w),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0)._forceRed(this);var i=t.mul(e),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(En,this),En=En.exports;var An={},Tn=An;function In(t){return 1===t.length?"0"+t:t}function Cn(t){for(var e="",i=0;i<t.length;i++)e+=In(t[i].toString(16));return e}Tn.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var i=[];if("string"!=typeof t){for(var r=0;r<t.length;r++)i[r]=0|t[r];return i}if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),r=0;r<t.length;r+=2)i.push(parseInt(t[r]+t[r+1],16));else for(r=0;r<t.length;r++){var n=t.charCodeAt(r),o=n>>8,s=255&n;o?i.push(o,s):i.push(s)}return i},Tn.zero2=In,Tn.toHex=Cn,Tn.encode=function(t,e){return"hex"===e?Cn(t):t};var Rn={},On=Rn;On.assert=Hi,On.toArray=An.toArray,On.zero2=An.zero2,On.toHex=An.toHex,On.encode=An.encode,On.getNAF=function(t,e,i){var r=new Array(Math.max(t.bitLength(),i)+1);r.fill(0);for(var n=1<<e+1,o=t.clone(),s=0;s<r.length;s++){var a,l=o.andln(n-1);o.isOdd()?(a=l>(n>>1)-1?(n>>1)-l:l,o.isubn(a)):a=0,r[s]=a,o.iushrn(1)}return r},On.getJSF=function(t,e){var i=[[],[]];t=t.clone(),e=e.clone();for(var r=0,n=0;t.cmpn(-r)>0||e.cmpn(-n)>0;){var o,s,a,l=t.andln(3)+r&3,d=e.andln(3)+n&3;3===l&&(l=-1),3===d&&(d=-1),o=0==(1&l)?0:3!=(a=t.andln(7)+r&7)&&5!==a||2!==d?l:-l,i[0].push(o),s=0==(1&d)?0:3!=(a=e.andln(7)+n&7)&&5!==a||2!==l?d:-d,i[1].push(s),2*r===o+1&&(r=1-r),2*n===s+1&&(n=1-n),t.iushrn(1),e.iushrn(1)}return i},On.cachedProperty=function(t,e,i){var r="_"+e;t.prototype[e]=function(){return void 0!==this[r]?this[r]:this[r]=i.call(this)}},On.parseBytes=function(t){return"string"==typeof t?On.toArray(t,"hex"):t},On.intFromLE=function(t){return new En(t,"hex","le")};var Ln,Pn,Bn,Nn={},$n=Rn.getNAF,zn=Rn.getJSF;function jn(t,e){this.type=t,this.p=new En(e.p,16),this.red=e.prime?En.red(e.prime):En.mont(this.p),this.zero=new En(0).toRed(this.red),this.one=new En(1).toRed(this.red),this.two=new En(2).toRed(this.red),this.n=e.n&&new En(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function Fn(t,e){this.curve=t,this.type=e,this.precomputed=null}function Dn(t){Nn.call(this,"short",t),this.a=new En(t.a,16).toRed(this.red),this.b=new En(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function qn(t,e,i,r){Nn.BasePoint.call(this,t,"affine"),null===e&&null===i?(this.x=null,this.y=null,this.inf=!0):(this.x=new En(e,16),this.y=new En(i,16),r&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function Un(t,e,i,r){Nn.BasePoint.call(this,t,"jacobian"),null===e&&null===i&&null===r?(this.x=this.curve.one,this.y=this.curve.one,this.z=new En(0)):(this.x=new En(e,16),this.y=new En(i,16),this.z=new En(r,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}function Hn(t){Nn.call(this,"mont",t),this.a=new En(t.a,16).toRed(this.red),this.b=new En(t.b,16).toRed(this.red),this.i4=new En(4).toRed(this.red).redInvm(),this.two=new En(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function Vn(t,e,i){Nn.BasePoint.call(this,t,"projective"),null===e&&null===i?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new En(e,16),this.z=new En(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}function Wn(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,Nn.call(this,"edwards",t),this.a=new En(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new En(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new En(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),this.oneC=1==(0|t.c)}function Gn(t,e,i,r,n){Nn.BasePoint.call(this,t,"projective"),null===e&&null===i&&null===r?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new En(e,16),this.y=new En(i,16),this.z=r?new En(r,16):this.curve.one,this.t=n&&new En(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}Nn=jn,jn.prototype.point=function(){throw new Error("Not implemented")},jn.prototype.validate=function(){throw new Error("Not implemented")},jn.prototype._fixedNafMul=function(t,e){var i=t._getDoubles(),r=$n(e,1,this._bitLength),n=(1<<i.step+1)-(i.step%2==0?2:1);n/=3;for(var o=[],s=0;s<r.length;s+=i.step){var a=0;for(e=s+i.step-1;e>=s;e--)a=(a<<1)+r[e];o.push(a)}for(var l=this.jpoint(null,null,null),d=this.jpoint(null,null,null),c=n;c>0;c--){for(s=0;s<o.length;s++)(a=o[s])===c?d=d.mixedAdd(i.points[s]):a===-c&&(d=d.mixedAdd(i.points[s].neg()));l=l.add(d)}return l.toP()},jn.prototype._wnafMul=function(t,e){var i=4,r=t._getNAFPoints(i);i=r.wnd;for(var n=r.points,o=$n(e,i,this._bitLength),s=this.jpoint(null,null,null),a=o.length-1;a>=0;a--){for(e=0;a>=0&&0===o[a];a--)e++;if(a>=0&&e++,s=s.dblp(e),a<0)break;var l=o[a];s="affine"===t.type?l>0?s.mixedAdd(n[l-1>>1]):s.mixedAdd(n[-l-1>>1].neg()):l>0?s.add(n[l-1>>1]):s.add(n[-l-1>>1].neg())}return"affine"===t.type?s.toP():s},jn.prototype._wnafMulAdd=function(t,e,i,r,n){for(var o=this._wnafT1,s=this._wnafT2,a=this._wnafT3,l=0,d=0;d<r;d++){var c=(M=e[d])._getNAFPoints(t);o[d]=c.wnd,s[d]=c.points}for(d=r-1;d>=1;d-=2){var h=d-1,u=d;if(1===o[h]&&1===o[u]){var p=[e[h],null,null,e[u]];0===e[h].y.cmp(e[u].y)?(p[1]=e[h].add(e[u]),p[2]=e[h].toJ().mixedAdd(e[u].neg())):0===e[h].y.cmp(e[u].y.redNeg())?(p[1]=e[h].toJ().mixedAdd(e[u]),p[2]=e[h].add(e[u].neg())):(p[1]=e[h].toJ().mixedAdd(e[u]),p[2]=e[h].toJ().mixedAdd(e[u].neg()));var f=[-3,-1,-5,-7,0,7,5,1,3],m=zn(i[h],i[u]);l=Math.max(m[0].length,l),a[h]=new Array(l),a[u]=new Array(l);for(var g=0;g<l;g++){var b=0|m[0][g],v=0|m[1][g];a[h][g]=f[3*(b+1)+(v+1)],a[u][g]=0,s[h]=p}}else a[h]=$n(i[h],o[h],this._bitLength),a[u]=$n(i[u],o[u],this._bitLength),l=Math.max(a[h].length,l),l=Math.max(a[u].length,l)}var y=this.jpoint(null,null,null),_=this._wnafT4;for(d=l;d>=0;d--){for(var w=0;d>=0;){var x=!0;for(g=0;g<r;g++)_[g]=0|a[g][d],0!==_[g]&&(x=!1);if(!x)break;w++,d--}if(d>=0&&w++,y=y.dblp(w),d<0)break;for(g=0;g<r;g++){var M,k=_[g];0!==k&&(k>0?M=s[g][k-1>>1]:k<0&&(M=s[g][-k-1>>1].neg()),y="affine"===M.type?y.mixedAdd(M):y.add(M))}}for(d=0;d<r;d++)s[d]=null;return n?y:y.toP()},jn.BasePoint=Fn,Fn.prototype.eq=function(){throw new Error("Not implemented")},Fn.prototype.validate=function(){return this.curve.validate(this)},jn.prototype.decodePoint=function(t,e){t=Rn.toArray(t,e);var i=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*i)return 6===t[0]||t[0],this.point(t.slice(1,1+i),t.slice(1+i,1+2*i));if((2===t[0]||3===t[0])&&t.length-1===i)return this.pointFromX(t.slice(1,1+i),3===t[0]);throw new Error("Unknown point format")},Fn.prototype.encodeCompressed=function(t){return this.encode(t,!0)},Fn.prototype._encode=function(t){var e=this.curve.p.byteLength(),i=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(i):[4].concat(i,this.getY().toArray("be",e))},Fn.prototype.encode=function(t,e){return Rn.encode(this._encode(e),t)},Fn.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},Fn.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},Fn.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],r=this,n=0;n<e;n+=t){for(var o=0;o<t;o++)r=r.dbl();i.push(r)}return{step:t,points:i}},Fn.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],i=(1<<t)-1,r=1===i?null:this.dbl(),n=1;n<i;n++)e[n]=e[n-1].add(r);return{wnd:t,points:e}},Fn.prototype._getBeta=function(){return null},Fn.prototype.dblp=function(t){for(var e=this,i=0;i<t;i++)e=e.dbl();return e},F(Dn,Nn),Ln=Dn,Dn.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,i;if(t.beta)e=new En(t.beta,16).toRed(this.red);else{var r=this._getEndoRoots(this.p);e=(e=r[0].cmp(r[1])<0?r[0]:r[1]).toRed(this.red)}if(t.lambda)i=new En(t.lambda,16);else{var n=this._getEndoRoots(this.n);i=0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(e))?n[0]:n[1]}return{beta:e,lambda:i,basis:t.basis?t.basis.map((function(t){return{a:new En(t.a,16),b:new En(t.b,16)}})):this._getEndoBasis(i)}}},Dn.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:En.mont(t),i=new En(2).toRed(e).redInvm(),r=i.redNeg(),n=new En(3).toRed(e).redNeg().redSqrt().redMul(i);return[r.redAdd(n).fromRed(),r.redSub(n).fromRed()]},Dn.prototype._getEndoBasis=function(t){for(var e,i,r,n,o,s,a,l,d,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=t,u=this.n.clone(),p=new En(1),f=new En(0),m=new En(0),g=new En(1),b=0;0!==h.cmpn(0);){var v=u.div(h);l=u.sub(v.mul(h)),d=m.sub(v.mul(p));var y=g.sub(v.mul(f));if(!r&&l.cmp(c)<0)e=a.neg(),i=p,r=l.neg(),n=d;else if(r&&2==++b)break;a=l,u=h,h=l,m=p,p=d,g=f,f=y}o=l.neg(),s=d;var _=r.sqr().add(n.sqr());return o.sqr().add(s.sqr()).cmp(_)>=0&&(o=e,s=i),r.negative&&(r=r.neg(),n=n.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:r,b:n},{a:o,b:s}]},Dn.prototype._endoSplit=function(t){var e=this.endo.basis,i=e[0],r=e[1],n=r.b.mul(t).divRound(this.n),o=i.b.neg().mul(t).divRound(this.n),s=n.mul(i.a),a=o.mul(r.a),l=n.mul(i.b),d=o.mul(r.b);return{k1:t.sub(s).sub(a),k2:l.add(d).neg()}},Dn.prototype.pointFromX=function(t,e){(t=new En(t,16)).red||(t=t.toRed(this.red));var i=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),r=i.redSqrt();if(0!==r.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");var n=r.fromRed().isOdd();return(e&&!n||!e&&n)&&(r=r.redNeg()),this.point(t,r)},Dn.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,i=t.y,r=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(r).redIAdd(this.b);return 0===i.redSqr().redISub(n).cmpn(0)},Dn.prototype._endoWnafMulAdd=function(t,e,i){for(var r=this._endoWnafT1,n=this._endoWnafT2,o=0;o<t.length;o++){var s=this._endoSplit(e[o]),a=t[o],l=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),l=l.neg(!0)),r[2*o]=a,r[2*o+1]=l,n[2*o]=s.k1,n[2*o+1]=s.k2}for(var d=this._wnafMulAdd(1,r,n,2*o,i),c=0;c<2*o;c++)r[c]=null,n[c]=null;return d},F(qn,Nn.BasePoint),Dn.prototype.point=function(t,e,i){return new qn(this,t,e,i)},Dn.prototype.pointFromJSON=function(t,e){return qn.fromJSON(this,t,e)},qn.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var i=this.curve,r=function(t){return i.point(t.x.redMul(i.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(r)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(r)}}}return e}},qn.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},qn.fromJSON=function(t,e,i){"string"==typeof e&&(e=JSON.parse(e));var r=t.point(e[0],e[1],i);if(!e[2])return r;function n(e){return t.point(e[0],e[1],i)}var o=e[2];return r.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[r].concat(o.doubles.points.map(n))},naf:o.naf&&{wnd:o.naf.wnd,points:[r].concat(o.naf.points.map(n))}},r},qn.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},qn.prototype.isInfinity=function(){return this.inf},qn.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var i=e.redSqr().redISub(this.x).redISub(t.x),r=e.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,r)},qn.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,i=this.x.redSqr(),r=t.redInvm(),n=i.redAdd(i).redIAdd(i).redIAdd(e).redMul(r),o=n.redSqr().redISub(this.x.redAdd(this.x)),s=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},qn.prototype.getX=function(){return this.x.fromRed()},qn.prototype.getY=function(){return this.y.fromRed()},qn.prototype.mul=function(t){return t=new En(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},qn.prototype.mulAdd=function(t,e,i){var r=[this,e],n=[t,i];return this.curve.endo?this.curve._endoWnafMulAdd(r,n):this.curve._wnafMulAdd(1,r,n,2)},qn.prototype.jmulAdd=function(t,e,i){var r=[this,e],n=[t,i];return this.curve.endo?this.curve._endoWnafMulAdd(r,n,!0):this.curve._wnafMulAdd(1,r,n,2,!0)},qn.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},qn.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var i=this.precomputed,r=function(t){return t.neg()};e.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(r)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(r)}}}return e},qn.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},F(Un,Nn.BasePoint),Dn.prototype.jpoint=function(t,e,i){return new Un(this,t,e,i)},Un.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),i=this.x.redMul(e),r=this.y.redMul(e).redMul(t);return this.curve.point(i,r)},Un.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Un.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),i=this.z.redSqr(),r=this.x.redMul(e),n=t.x.redMul(i),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(i.redMul(this.z)),a=r.redSub(n),l=o.redSub(s);if(0===a.cmpn(0))return 0!==l.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var d=a.redSqr(),c=d.redMul(a),h=r.redMul(d),u=l.redSqr().redIAdd(c).redISub(h).redISub(h),p=l.redMul(h.redISub(u)).redISub(o.redMul(c)),f=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(u,p,f)},Un.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),i=this.x,r=t.x.redMul(e),n=this.y,o=t.y.redMul(e).redMul(this.z),s=i.redSub(r),a=n.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=s.redSqr(),d=l.redMul(s),c=i.redMul(l),h=a.redSqr().redIAdd(d).redISub(c).redISub(c),u=a.redMul(c.redISub(h)).redISub(n.redMul(d)),p=this.z.redMul(s);return this.curve.jpoint(h,u,p)},Un.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,i=0;i<t;i++)e=e.dbl();return e}var r=this.curve.a,n=this.curve.tinv,o=this.x,s=this.y,a=this.z,l=a.redSqr().redSqr(),d=s.redAdd(s);for(i=0;i<t;i++){var c=o.redSqr(),h=d.redSqr(),u=h.redSqr(),p=c.redAdd(c).redIAdd(c).redIAdd(r.redMul(l)),f=o.redMul(h),m=p.redSqr().redISub(f.redAdd(f)),g=f.redISub(m),b=p.redMul(g);b=b.redIAdd(b).redISub(u);var v=d.redMul(a);i+1<t&&(l=l.redMul(u)),o=m,a=v,d=b}return this.curve.jpoint(o,d.redMul(n),a)},Un.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Un.prototype._zeroDbl=function(){var t,e,i;if(this.zOne){var r=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(r).redISub(o);s=s.redIAdd(s);var a=r.redAdd(r).redIAdd(r),l=a.redSqr().redISub(s).redISub(s),d=o.redIAdd(o);d=(d=d.redIAdd(d)).redIAdd(d),t=l,e=a.redMul(s.redISub(l)).redISub(d),i=this.y.redAdd(this.y)}else{var c=this.x.redSqr(),h=this.y.redSqr(),u=h.redSqr(),p=this.x.redAdd(h).redSqr().redISub(c).redISub(u);p=p.redIAdd(p);var f=c.redAdd(c).redIAdd(c),m=f.redSqr(),g=u.redIAdd(u);g=(g=g.redIAdd(g)).redIAdd(g),t=m.redISub(p).redISub(p),e=f.redMul(p.redISub(t)).redISub(g),i=(i=this.y.redMul(this.z)).redIAdd(i)}return this.curve.jpoint(t,e,i)},Un.prototype._threeDbl=function(){var t,e,i;if(this.zOne){var r=this.x.redSqr(),n=this.y.redSqr(),o=n.redSqr(),s=this.x.redAdd(n).redSqr().redISub(r).redISub(o);s=s.redIAdd(s);var a=r.redAdd(r).redIAdd(r).redIAdd(this.curve.a),l=a.redSqr().redISub(s).redISub(s);t=l;var d=o.redIAdd(o);d=(d=d.redIAdd(d)).redIAdd(d),e=a.redMul(s.redISub(l)).redISub(d),i=this.y.redAdd(this.y)}else{var c=this.z.redSqr(),h=this.y.redSqr(),u=this.x.redMul(h),p=this.x.redSub(c).redMul(this.x.redAdd(c));p=p.redAdd(p).redIAdd(p);var f=u.redIAdd(u),m=(f=f.redIAdd(f)).redAdd(f);t=p.redSqr().redISub(m),i=this.y.redAdd(this.z).redSqr().redISub(h).redISub(c);var g=h.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),e=p.redMul(f.redISub(t)).redISub(g)}return this.curve.jpoint(t,e,i)},Un.prototype._dbl=function(){var t=this.curve.a,e=this.x,i=this.y,r=this.z,n=r.redSqr().redSqr(),o=e.redSqr(),s=i.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(n)),l=e.redAdd(e),d=(l=l.redIAdd(l)).redMul(s),c=a.redSqr().redISub(d.redAdd(d)),h=d.redISub(c),u=s.redSqr();u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var p=a.redMul(h).redISub(u),f=i.redAdd(i).redMul(r);return this.curve.jpoint(c,p,f)},Un.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),i=this.z.redSqr(),r=e.redSqr(),n=t.redAdd(t).redIAdd(t),o=n.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(r),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),l=r.redIAdd(r);l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=n.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(l),c=e.redMul(d);c=(c=c.redIAdd(c)).redIAdd(c);var h=this.x.redMul(a).redISub(c);h=(h=h.redIAdd(h)).redIAdd(h);var u=this.y.redMul(d.redMul(l.redISub(d)).redISub(s.redMul(a)));u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var p=this.z.redAdd(s).redSqr().redISub(i).redISub(a);return this.curve.jpoint(h,u,p)},Un.prototype.mul=function(t,e){return t=new En(t,e),this.curve._wnafMul(this,t)},Un.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),i=t.z.redSqr();if(0!==this.x.redMul(i).redISub(t.x.redMul(e)).cmpn(0))return!1;var r=e.redMul(this.z),n=i.redMul(t.z);return 0===this.y.redMul(n).redISub(t.y.redMul(r)).cmpn(0)},Un.prototype.eqXToP=function(t){var e=this.z.redSqr(),i=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(i))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(e);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(i.redIAdd(n),0===this.x.cmp(i))return!0}},Un.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},Un.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},F(Hn,Nn),Pn=Hn,Hn.prototype.validate=function(t){var e=t.normalize().x,i=e.redSqr(),r=i.redMul(e).redAdd(i.redMul(this.a)).redAdd(e);return 0===r.redSqrt().redSqr().cmp(r)},F(Vn,Nn.BasePoint),Hn.prototype.decodePoint=function(t,e){return this.point(Rn.toArray(t,e),1)},Hn.prototype.point=function(t,e){return new Vn(this,t,e)},Hn.prototype.pointFromJSON=function(t){return Vn.fromJSON(this,t)},Vn.prototype.precompute=function(){},Vn.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Vn.fromJSON=function(t,e){return new Vn(t,e[0],e[1]||t.one)},Vn.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Vn.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Vn.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),i=t.redSub(e),r=t.redMul(e),n=i.redMul(e.redAdd(this.curve.a24.redMul(i)));return this.curve.point(r,n)},Vn.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Vn.prototype.diffAdd=function(t,e){var i=this.x.redAdd(this.z),r=this.x.redSub(this.z),n=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(i),s=n.redMul(r),a=e.z.redMul(o.redAdd(s).redSqr()),l=e.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,l)},Vn.prototype.mul=function(t){for(var e=t.clone(),i=this,r=this.curve.point(null,null),n=[];0!==e.cmpn(0);e.iushrn(1))n.push(e.andln(1));for(var o=n.length-1;o>=0;o--)0===n[o]?(i=i.diffAdd(r,this),r=r.dbl()):(r=i.diffAdd(r,this),i=i.dbl());return r},Vn.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Vn.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Vn.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},Vn.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Vn.prototype.getX=function(){return this.normalize(),this.x.fromRed()},F(Wn,Nn),Bn=Wn,Wn.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},Wn.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},Wn.prototype.jpoint=function(t,e,i,r){return this.point(t,e,i,r)},Wn.prototype.pointFromX=function(t,e){(t=new En(t,16)).red||(t=t.toRed(this.red));var i=t.redSqr(),r=this.c2.redSub(this.a.redMul(i)),n=this.one.redSub(this.c2.redMul(this.d).redMul(i)),o=r.redMul(n.redInvm()),s=o.redSqrt();if(0!==s.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var a=s.fromRed().isOdd();return(e&&!a||!e&&a)&&(s=s.redNeg()),this.point(t,s)},Wn.prototype.pointFromY=function(t,e){(t=new En(t,16)).red||(t=t.toRed(this.red));var i=t.redSqr(),r=i.redSub(this.c2),n=i.redMul(this.d).redMul(this.c2).redSub(this.a),o=r.redMul(n.redInvm());if(0===o.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var s=o.redSqrt();if(0!==s.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==e&&(s=s.redNeg()),this.point(s,t)},Wn.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),i=t.y.redSqr(),r=e.redMul(this.a).redAdd(i),n=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(i)));return 0===r.cmp(n)},F(Gn,Nn.BasePoint),Wn.prototype.pointFromJSON=function(t){return Gn.fromJSON(this,t)},Wn.prototype.point=function(t,e,i,r){return new Gn(this,t,e,i,r)},Gn.fromJSON=function(t,e){return new Gn(t,e[0],e[1],e[2])},Gn.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Gn.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},Gn.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var r=this.curve._mulA(t),n=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=r.redAdd(e),s=o.redSub(i),a=r.redSub(e),l=n.redMul(s),d=o.redMul(a),c=n.redMul(a),h=s.redMul(o);return this.curve.point(l,d,h,c)},Gn.prototype._projDbl=function(){var t,e,i,r=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var s=(d=this.curve._mulA(n)).redAdd(o);if(this.zOne)t=r.redSub(n).redSub(o).redMul(s.redSub(this.curve.two)),e=s.redMul(d.redSub(o)),i=s.redSqr().redSub(s).redSub(s);else{var a=this.z.redSqr(),l=s.redSub(a).redISub(a);t=r.redSub(n).redISub(o).redMul(l),e=s.redMul(d.redSub(o)),i=s.redMul(l)}}else{var d=n.redAdd(o);a=this.curve._mulC(this.z).redSqr(),l=d.redSub(a).redSub(a),t=this.curve._mulC(r.redISub(d)).redMul(l),e=this.curve._mulC(d).redMul(n.redISub(o)),i=d.redMul(l)}return this.curve.point(t,e,i)},Gn.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Gn.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),i=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),r=this.t.redMul(this.curve.dd).redMul(t.t),n=this.z.redMul(t.z.redAdd(t.z)),o=i.redSub(e),s=n.redSub(r),a=n.redAdd(r),l=i.redAdd(e),d=o.redMul(s),c=a.redMul(l),h=o.redMul(l),u=s.redMul(a);return this.curve.point(d,c,u,h)},Gn.prototype._projAdd=function(t){var e,i,r=this.z.redMul(t.z),n=r.redSqr(),o=this.x.redMul(t.x),s=this.y.redMul(t.y),a=this.curve.d.redMul(o).redMul(s),l=n.redSub(a),d=n.redAdd(a),c=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(s),h=r.redMul(l).redMul(c);return this.curve.twisted?(e=r.redMul(d).redMul(s.redSub(this.curve._mulA(o))),i=l.redMul(d)):(e=r.redMul(d).redMul(s.redSub(o)),i=this.curve._mulC(l).redMul(d)),this.curve.point(h,e,i)},Gn.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},Gn.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},Gn.prototype.mulAdd=function(t,e,i){return this.curve._wnafMulAdd(1,[this,e],[t,i],2,!1)},Gn.prototype.jmulAdd=function(t,e,i){return this.curve._wnafMulAdd(1,[this,e],[t,i],2,!0)},Gn.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},Gn.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Gn.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Gn.prototype.getY=function(){return this.normalize(),this.y.fromRed()},Gn.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},Gn.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var i=t.clone(),r=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(r),0===this.x.cmp(e))return!0}},Gn.prototype.toP=Gn.prototype.normalize,Gn.prototype.mixedAdd=Gn.prototype.add;var Kn={},Xn=Kn;Xn.base=Nn,Xn.short=Ln,Xn.mont=Pn,Xn.edwards=Bn;var Zn={};function Yn(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function Jn(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function Qn(t){return 1===t.length?"0"+t:t}function to(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}Zn.inherits=F,Zn.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var i=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)i.push(parseInt(t[n]+t[n+1],16))}else for(var r=0,n=0;n<t.length;n++){var o=t.charCodeAt(n);o<128?i[r++]=o:o<2048?(i[r++]=o>>6|192,i[r++]=63&o|128):Yn(t,n)?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++n)),i[r++]=o>>18|240,i[r++]=o>>12&63|128,i[r++]=o>>6&63|128,i[r++]=63&o|128):(i[r++]=o>>12|224,i[r++]=o>>6&63|128,i[r++]=63&o|128)}else for(n=0;n<t.length;n++)i[n]=0|t[n];return i},Zn.toHex=function(t){for(var e="",i=0;i<t.length;i++)e+=Qn(t[i].toString(16));return e},Zn.htonl=Jn,Zn.toHex32=function(t,e){for(var i="",r=0;r<t.length;r++){var n=t[r];"little"===e&&(n=Jn(n)),i+=to(n.toString(16))}return i},Zn.zero2=Qn,Zn.zero8=to,Zn.join32=function(t,e,i,r){for(var n=new Array((i-e)/4),o=0,s=e;o<n.length;o++,s+=4){var a;a="big"===r?t[s]<<24|t[s+1]<<16|t[s+2]<<8|t[s+3]:t[s+3]<<24|t[s+2]<<16|t[s+1]<<8|t[s],n[o]=a>>>0}return n},Zn.split32=function(t,e){for(var i=new Array(4*t.length),r=0,n=0;r<t.length;r++,n+=4){var o=t[r];"big"===e?(i[n]=o>>>24,i[n+1]=o>>>16&255,i[n+2]=o>>>8&255,i[n+3]=255&o):(i[n+3]=o>>>24,i[n+2]=o>>>16&255,i[n+1]=o>>>8&255,i[n]=255&o)}return i},Zn.rotr32=function(t,e){return t>>>e|t<<32-e},Zn.rotl32=function(t,e){return t<<e|t>>>32-e},Zn.sum32=function(t,e){return t+e>>>0},Zn.sum32_3=function(t,e,i){return t+e+i>>>0},Zn.sum32_4=function(t,e,i,r){return t+e+i+r>>>0},Zn.sum32_5=function(t,e,i,r,n){return t+e+i+r+n>>>0},Zn.sum64=function(t,e,i,r){var n=t[e],o=r+t[e+1]>>>0,s=(o<r?1:0)+i+n;t[e]=s>>>0,t[e+1]=o},Zn.sum64_hi=function(t,e,i,r){return(e+r>>>0<e?1:0)+t+i>>>0},Zn.sum64_lo=function(t,e,i,r){return e+r>>>0},Zn.sum64_4_hi=function(t,e,i,r,n,o,s,a){var l=0,d=e;return l+=(d=d+r>>>0)<e?1:0,l+=(d=d+o>>>0)<o?1:0,t+i+n+s+(l+=(d=d+a>>>0)<a?1:0)>>>0},Zn.sum64_4_lo=function(t,e,i,r,n,o,s,a){return e+r+o+a>>>0},Zn.sum64_5_hi=function(t,e,i,r,n,o,s,a,l,d){var c=0,h=e;return c+=(h=h+r>>>0)<e?1:0,c+=(h=h+o>>>0)<o?1:0,c+=(h=h+a>>>0)<a?1:0,t+i+n+s+l+(c+=(h=h+d>>>0)<d?1:0)>>>0},Zn.sum64_5_lo=function(t,e,i,r,n,o,s,a,l,d){return e+r+o+a+d>>>0},Zn.rotr64_hi=function(t,e,i){return(e<<32-i|t>>>i)>>>0},Zn.rotr64_lo=function(t,e,i){return(t<<32-i|e>>>i)>>>0},Zn.shr64_hi=function(t,e,i){return t>>>i},Zn.shr64_lo=function(t,e,i){return(t<<32-i|e>>>i)>>>0};var eo={};function io(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}eo.BlockHash=io,io.prototype.update=function(t,e){if(t=Zn.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var i=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-i,t.length),0===this.pending.length&&(this.pending=null),t=Zn.join32(t,0,t.length-i,this.endian);for(var r=0;r<t.length;r+=this._delta32)this._update(t,r,r+this._delta32)}return this},io.prototype.digest=function(t){return this.update(this._pad()),this._digest(t)},io.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,i=e-(t+this.padLength)%e,r=new Array(i+this.padLength);r[0]=128;for(var n=1;n<i;n++)r[n]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)r[n++]=0;r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=t>>>24&255,r[n++]=t>>>16&255,r[n++]=t>>>8&255,r[n++]=255&t}else for(r[n++]=255&t,r[n++]=t>>>8&255,r[n++]=t>>>16&255,r[n++]=t>>>24&255,r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=0,o=8;o<this.padLength;o++)r[n++]=0;return r};var ro={},no=Zn.rotr32;function oo(t,e,i){return t&e^~t&i}function so(t,e,i){return t&e^t&i^e&i}ro.ft_1=function(t,e,i,r){return 0===t?oo(e,i,r):1===t||3===t?function(t,e,i){return t^e^i}(e,i,r):2===t?so(e,i,r):void 0},ro.ch32=oo,ro.maj32=so,ro.s0_256=function(t){return no(t,2)^no(t,13)^no(t,22)},ro.s1_256=function(t){return no(t,6)^no(t,11)^no(t,25)},ro.g0_256=function(t){return no(t,7)^no(t,18)^t>>>3},ro.g1_256=function(t){return no(t,17)^no(t,19)^t>>>10};var ao,lo=Zn.rotl32,co=Zn.sum32,ho=Zn.sum32_5,uo=ro.ft_1,po=eo.BlockHash,fo=[1518500249,1859775393,2400959708,3395469782];function mo(){if(!(this instanceof mo))return new mo;po.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Zn.inherits(mo,po),ao=mo,mo.blockSize=512,mo.outSize=160,mo.hmacStrength=80,mo.padLength=64,mo.prototype._update=function(t,e){for(var i=this.W,r=0;r<16;r++)i[r]=t[e+r];for(;r<i.length;r++)i[r]=lo(i[r-3]^i[r-8]^i[r-14]^i[r-16],1);var n=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],l=this.h[4];for(r=0;r<i.length;r++){var d=~~(r/20),c=ho(lo(n,5),uo(d,o,s,a),l,i[r],fo[d]);l=a,a=s,s=lo(o,30),o=n,n=c}this.h[0]=co(this.h[0],n),this.h[1]=co(this.h[1],o),this.h[2]=co(this.h[2],s),this.h[3]=co(this.h[3],a),this.h[4]=co(this.h[4],l)},mo.prototype._digest=function(t){return"hex"===t?Zn.toHex32(this.h,"big"):Zn.split32(this.h,"big")};var go,bo={},vo=Zn.sum32,yo=Zn.sum32_4,_o=Zn.sum32_5,wo=ro.ch32,xo=ro.maj32,Mo=ro.s0_256,ko=ro.s1_256,So=ro.g0_256,Eo=ro.g1_256,Ao=eo.BlockHash,To=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Io(){if(!(this instanceof Io))return new Io;Ao.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=To,this.W=new Array(64)}function Co(){if(!(this instanceof Co))return new Co;bo.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Zn.inherits(Io,Ao),bo=Io,Io.blockSize=512,Io.outSize=256,Io.hmacStrength=192,Io.padLength=64,Io.prototype._update=function(t,e){for(var i=this.W,r=0;r<16;r++)i[r]=t[e+r];for(;r<i.length;r++)i[r]=yo(Eo(i[r-2]),i[r-7],So(i[r-15]),i[r-16]);var n=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],l=this.h[4],d=this.h[5],c=this.h[6],h=this.h[7];for(r=0;r<i.length;r++){var u=_o(h,ko(l),wo(l,d,c),this.k[r],i[r]),p=vo(Mo(n),xo(n,o,s));h=c,c=d,d=l,l=vo(a,u),a=s,s=o,o=n,n=vo(u,p)}this.h[0]=vo(this.h[0],n),this.h[1]=vo(this.h[1],o),this.h[2]=vo(this.h[2],s),this.h[3]=vo(this.h[3],a),this.h[4]=vo(this.h[4],l),this.h[5]=vo(this.h[5],d),this.h[6]=vo(this.h[6],c),this.h[7]=vo(this.h[7],h)},Io.prototype._digest=function(t){return"hex"===t?Zn.toHex32(this.h,"big"):Zn.split32(this.h,"big")},Zn.inherits(Co,bo),go=Co,Co.blockSize=512,Co.outSize=224,Co.hmacStrength=192,Co.padLength=64,Co.prototype._digest=function(t){return"hex"===t?Zn.toHex32(this.h.slice(0,7),"big"):Zn.split32(this.h.slice(0,7),"big")};var Ro,Oo={},Lo=Zn.rotr64_hi,Po=Zn.rotr64_lo,Bo=Zn.shr64_hi,No=Zn.shr64_lo,$o=Zn.sum64,zo=Zn.sum64_hi,jo=Zn.sum64_lo,Fo=Zn.sum64_4_hi,Do=Zn.sum64_4_lo,qo=Zn.sum64_5_hi,Uo=Zn.sum64_5_lo,Ho=eo.BlockHash,Vo=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Wo(){if(!(this instanceof Wo))return new Wo;Ho.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Vo,this.W=new Array(160)}function Go(t,e,i,r,n){var o=t&i^~t&n;return o<0&&(o+=4294967296),o}function Ko(t,e,i,r,n,o){var s=e&r^~e&o;return s<0&&(s+=4294967296),s}function Xo(t,e,i,r,n){var o=t&i^t&n^i&n;return o<0&&(o+=4294967296),o}function Zo(t,e,i,r,n,o){var s=e&r^e&o^r&o;return s<0&&(s+=4294967296),s}function Yo(t,e){var i=Lo(t,e,28)^Lo(e,t,2)^Lo(e,t,7);return i<0&&(i+=4294967296),i}function Jo(t,e){var i=Po(t,e,28)^Po(e,t,2)^Po(e,t,7);return i<0&&(i+=4294967296),i}function Qo(t,e){var i=Lo(t,e,14)^Lo(t,e,18)^Lo(e,t,9);return i<0&&(i+=4294967296),i}function ts(t,e){var i=Po(t,e,14)^Po(t,e,18)^Po(e,t,9);return i<0&&(i+=4294967296),i}function es(t,e){var i=Lo(t,e,1)^Lo(t,e,8)^Bo(t,e,7);return i<0&&(i+=4294967296),i}function is(t,e){var i=Po(t,e,1)^Po(t,e,8)^No(t,e,7);return i<0&&(i+=4294967296),i}function rs(t,e){var i=Lo(t,e,19)^Lo(e,t,29)^Bo(t,e,6);return i<0&&(i+=4294967296),i}function ns(t,e){var i=Po(t,e,19)^Po(e,t,29)^No(t,e,6);return i<0&&(i+=4294967296),i}function os(){if(!(this instanceof os))return new os;Oo.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Zn.inherits(Wo,Ho),Oo=Wo,Wo.blockSize=1024,Wo.outSize=512,Wo.hmacStrength=192,Wo.padLength=128,Wo.prototype._prepareBlock=function(t,e){for(var i=this.W,r=0;r<32;r++)i[r]=t[e+r];for(;r<i.length;r+=2){var n=rs(i[r-4],i[r-3]),o=ns(i[r-4],i[r-3]),s=i[r-14],a=i[r-13],l=es(i[r-30],i[r-29]),d=is(i[r-30],i[r-29]),c=i[r-32],h=i[r-31];i[r]=Fo(n,o,s,a,l,d,c,h),i[r+1]=Do(n,o,s,a,l,d,c,h)}},Wo.prototype._update=function(t,e){this._prepareBlock(t,e);for(var i=this.W,r=this.h[0],n=this.h[1],o=this.h[2],s=this.h[3],a=this.h[4],l=this.h[5],d=this.h[6],c=this.h[7],h=this.h[8],u=this.h[9],p=this.h[10],f=this.h[11],m=this.h[12],g=this.h[13],b=this.h[14],v=this.h[15],y=0;y<i.length;y+=2){var _=b,w=v,x=Qo(h,u),M=ts(h,u),k=Go(h,0,p,0,m),S=Ko(0,u,0,f,0,g),E=this.k[y],A=this.k[y+1],T=i[y],I=i[y+1],C=qo(_,w,x,M,k,S,E,A,T,I),R=Uo(_,w,x,M,k,S,E,A,T,I);_=Yo(r,n),w=Jo(r,n),x=Xo(r,0,o,0,a),M=Zo(0,n,0,s,0,l);var O=zo(_,w,x,M),L=jo(_,w,x,M);b=m,v=g,m=p,g=f,p=h,f=u,h=zo(d,c,C,R),u=jo(c,c,C,R),d=a,c=l,a=o,l=s,o=r,s=n,r=zo(C,R,O,L),n=jo(C,R,O,L)}$o(this.h,0,r,n),$o(this.h,2,o,s),$o(this.h,4,a,l),$o(this.h,6,d,c),$o(this.h,8,h,u),$o(this.h,10,p,f),$o(this.h,12,m,g),$o(this.h,14,b,v)},Wo.prototype._digest=function(t){return"hex"===t?Zn.toHex32(this.h,"big"):Zn.split32(this.h,"big")},Zn.inherits(os,Oo),Ro=os,os.blockSize=1024,os.outSize=384,os.hmacStrength=192,os.padLength=128,os.prototype._digest=function(t){return"hex"===t?Zn.toHex32(this.h.slice(0,12),"big"):Zn.split32(this.h.slice(0,12),"big")};var ss={};ss.sha1=ao,ss.sha224=go,ss.sha256=bo,ss.sha384=Ro,ss.sha512=Oo;var as={},ls=Zn.rotl32,ds=Zn.sum32,cs=Zn.sum32_3,hs=Zn.sum32_4,us=eo.BlockHash;function ps(){if(!(this instanceof ps))return new ps;us.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function fs(t,e,i,r){return t<=15?e^i^r:t<=31?e&i|~e&r:t<=47?(e|~i)^r:t<=63?e&r|i&~r:e^(i|~r)}function ms(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function gs(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}Zn.inherits(ps,us),as.ripemd160=ps,ps.blockSize=512,ps.outSize=160,ps.hmacStrength=192,ps.padLength=64,ps.prototype._update=function(t,e){for(var i=this.h[0],r=this.h[1],n=this.h[2],o=this.h[3],s=this.h[4],a=i,l=r,d=n,c=o,h=s,u=0;u<80;u++){var p=ds(ls(hs(i,fs(u,r,n,o),t[vs[u]+e],ms(u)),_s[u]),s);i=s,s=o,o=ls(n,10),n=r,r=p,p=ds(ls(hs(a,fs(79-u,l,d,c),t[ys[u]+e],gs(u)),ws[u]),h),a=h,h=c,c=ls(d,10),d=l,l=p}p=cs(this.h[1],n,c),this.h[1]=cs(this.h[2],o,h),this.h[2]=cs(this.h[3],s,a),this.h[3]=cs(this.h[4],i,l),this.h[4]=cs(this.h[0],r,d),this.h[0]=p},ps.prototype._digest=function(t){return"hex"===t?Zn.toHex32(this.h,"little"):Zn.split32(this.h,"little")};var bs,vs=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],ys=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],_s=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],ws=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];function xs(t,e,i){if(!(this instanceof xs))return new xs(t,e,i);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(Zn.toArray(e,i))}bs=xs,xs.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest());for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},xs.prototype.update=function(t,e){return this.inner.update(t,e),this},xs.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)};var Ms={},ks=Ms;ks.utils=Zn,ks.common=eo,ks.sha=ss,ks.ripemd=as,ks.hmac=bs,ks.sha1=ks.sha.sha1,ks.sha256=ks.sha.sha256,ks.sha224=ks.sha.sha224,ks.sha384=ks.sha.sha384,ks.sha512=ks.sha.sha512,ks.ripemd160=ks.ripemd.ripemd160;var Ss,Es={},As=Es;function Ts(t){"short"===t.type?this.curve=new Kn.short(t):"edwards"===t.type?this.curve=new Kn.edwards(t):this.curve=new Kn.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash}function Is(t,e){Object.defineProperty(As,t,{configurable:!0,enumerable:!0,get:function(){var i=new Ts(e);return Object.defineProperty(As,t,{configurable:!0,enumerable:!0,value:i}),i}})}As.PresetCurve=Ts,Is("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Ms.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),Is("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Ms.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),Is("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Ms.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),Is("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Ms.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),Is("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Ms.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),Is("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ms.sha256,gRed:!1,g:["9"]}),Is("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ms.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{Ss={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}}catch(t){Ss=void 0}Is("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Ms.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",Ss]});var Cs,Rs={};function Os(t){if(!(this instanceof Os))return new Os(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=An.toArray(t.entropy,t.entropyEnc||"hex"),i=An.toArray(t.nonce,t.nonceEnc||"hex"),r=An.toArray(t.pers,t.persEnc||"hex");this._init(e,i,r)}function Ls(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}Rs=Os,Os.prototype._init=function(t,e,i){var r=t.concat(e).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(r),this._reseed=1,this.reseedInterval=281474976710656},Os.prototype._hmac=function(){return new Ms.hmac(this.hash,this.K)},Os.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},Os.prototype.reseed=function(t,e,i,r){"string"!=typeof e&&(r=i,i=e,e=null),t=An.toArray(t,e),i=An.toArray(i,r),this._update(t.concat(i||[])),this._reseed=1},Os.prototype.generate=function(t,e,i,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(r=i,i=e,e=null),i&&(i=An.toArray(i,r||"hex"),this._update(i));for(var n=[];n.length<t;)this.V=this._hmac().update(this.V).digest(),n=n.concat(this.V);var o=n.slice(0,t);return this._update(i),this._reseed++,An.encode(o,e)},Cs=Ls,Ls.fromPublic=function(t,e,i){return e instanceof Ls?e:new Ls(t,{pub:e,pubEnc:i})},Ls.fromPrivate=function(t,e,i){return e instanceof Ls?e:new Ls(t,{priv:e,privEnc:i})},Ls.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},Ls.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},Ls.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},Ls.prototype._importPrivate=function(t,e){this.priv=new En(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},Ls.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type||"short"===this.ec.curve.type||this.ec.curve.type,void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},Ls.prototype.derive=function(t){return t.mul(this.priv).getX()},Ls.prototype.sign=function(t,e,i){return this.ec.sign(t,this,e,i)},Ls.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},Ls.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Ps={};function Bs(t,e){if(t instanceof Bs)return t;this._importDER(t,e)||(this.r=new En(t.r,16),this.s=new En(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function Ns(){this.place=0}function $s(t,e){var i=t[e.place++];if(!(128&i))return i;var r=15&i;if(0===r||r>4)return!1;for(var n=0,o=0,s=e.place;o<r;o++,s++)n<<=8,n|=t[s],n>>>=0;return!(n<=127)&&(e.place=s,n)}function zs(t){for(var e=0,i=t.length-1;!t[e]&&!(128&t[e+1])&&e<i;)e++;return 0===e?t:t.slice(e)}function js(t,e){if(e<128)t.push(e);else{var i=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|i);--i;)t.push(e>>>(i<<3)&255);t.push(e)}}Ps=Bs,Bs.prototype._importDER=function(t,e){t=Rn.toArray(t,e);var i=new Ns;if(48!==t[i.place++])return!1;var r=$s(t,i);if(!1===r)return!1;if(r+i.place!==t.length)return!1;if(2!==t[i.place++])return!1;var n=$s(t,i);if(!1===n)return!1;var o=t.slice(i.place,n+i.place);if(i.place+=n,2!==t[i.place++])return!1;var s=$s(t,i);if(!1===s)return!1;if(t.length!==s+i.place)return!1;var a=t.slice(i.place,s+i.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new En(o),this.s=new En(a),this.recoveryParam=null,!0},Bs.prototype.toDER=function(t){var e=this.r.toArray(),i=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&i[0]&&(i=[0].concat(i)),e=zs(e),i=zs(i);!(i[0]||128&i[1]);)i=i.slice(1);var r=[2];js(r,e.length),(r=r.concat(e)).push(2),js(r,i.length);var n=r.concat(i),o=[48];return js(o,n.length),o=o.concat(n),Rn.encode(o,t)};var Fs,Ds=Cs;function qs(t){if(!(this instanceof qs))return new qs(t);"string"==typeof t&&(t=Es[t]),t instanceof Es.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}Fs=qs,qs.prototype.keyPair=function(t){return new Ds(this,t)},qs.prototype.keyFromPrivate=function(t,e){return Ds.fromPrivate(this,t,e)},qs.prototype.keyFromPublic=function(t,e){return Ds.fromPublic(this,t,e)},qs.prototype.genKeyPair=function(t){t||(t={});for(var e=new Rs({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||rn(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),r=this.n.sub(new En(2));;){var n=new En(e.generate(i));if(!(n.cmp(r)>0))return n.iaddn(1),this.keyFromPrivate(n)}},qs.prototype._truncateToN=function(t,e){var i=8*t.byteLength()-this.n.bitLength();return i>0&&(t=t.ushrn(i)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},qs.prototype.sign=function(t,e,i,r){"object"==typeof i&&(r=i,i=null),r||(r={}),e=this.keyFromPrivate(e,i),t=this._truncateToN(new En(t,16));for(var n=this.n.byteLength(),o=e.getPrivate().toArray("be",n),s=t.toArray("be",n),a=new Rs({hash:this.hash,entropy:o,nonce:s,pers:r.pers,persEnc:r.persEnc||"utf8"}),l=this.n.sub(new En(1)),d=0;;d++){var c=r.k?r.k(d):new En(a.generate(this.n.byteLength()));if(!((c=this._truncateToN(c,!0)).cmpn(1)<=0||c.cmp(l)>=0)){var h=this.g.mul(c);if(!h.isInfinity()){var u=h.getX(),p=u.umod(this.n);if(0!==p.cmpn(0)){var f=c.invm(this.n).mul(p.mul(e.getPrivate()).iadd(t));if(0!==(f=f.umod(this.n)).cmpn(0)){var m=(h.getY().isOdd()?1:0)|(0!==u.cmp(p)?2:0);return r.canonical&&f.cmp(this.nh)>0&&(f=this.n.sub(f),m^=1),new Ps({r:p,s:f,recoveryParam:m})}}}}}},qs.prototype.verify=function(t,e,i,r){t=this._truncateToN(new En(t,16)),i=this.keyFromPublic(i,r);var n=(e=new Ps(e,"hex")).r,o=e.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s,a=o.invm(this.n),l=a.mul(t).umod(this.n),d=a.mul(n).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(l,i.getPublic(),d)).isInfinity()&&s.eqXToP(n):!(s=this.g.mulAdd(l,i.getPublic(),d)).isInfinity()&&0===s.getX().umod(this.n).cmp(n)},qs.prototype.recoverPubKey=function(t,e,i,r){e=new Ps(e,r);var n=this.n,o=new En(t),s=e.r,a=e.s,l=1&i,d=i>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");s=d?this.curve.pointFromX(s.add(this.curve.n),l):this.curve.pointFromX(s,l);var c=e.r.invm(n),h=n.sub(o).mul(c).umod(n),u=a.mul(c).umod(n);return this.g.mulAdd(h,s,u)},qs.prototype.getKeyRecoveryParam=function(t,e,i,r){if(null!==(e=new Ps(e,r)).recoveryParam)return e.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(t,e,n)}catch(t){continue}if(o.eq(i))return n}throw new Error("Unable to find valid recovery factor")};var Us={},Hs=Rn.parseBytes,Vs=Rn.cachedProperty;function Ws(t,e){this.eddsa=t,this._secret=Hs(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=Hs(e.pub)}Ws.fromPublic=function(t,e){return e instanceof Ws?e:new Ws(t,{pub:e})},Ws.fromSecret=function(t,e){return e instanceof Ws?e:new Ws(t,{secret:e})},Ws.prototype.secret=function(){return this._secret},Vs(Ws,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),Vs(Ws,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),Vs(Ws,"privBytes",(function(){var t=this.eddsa,e=this.hash(),i=t.encodingLength-1,r=e.slice(0,t.encodingLength);return r[0]&=248,r[i]&=127,r[i]|=64,r})),Vs(Ws,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),Vs(Ws,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),Vs(Ws,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),Ws.prototype.sign=function(t){return this.eddsa.sign(t,this)},Ws.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},Ws.prototype.getSecret=function(t){return Rn.encode(this.secret(),t)},Ws.prototype.getPublic=function(t){return Rn.encode(this.pubBytes(),t)},Us=Ws;var Gs={},Ks=Rn.cachedProperty,Xs=Rn.parseBytes;function Zs(t,e){this.eddsa=t,"object"!=typeof e&&(e=Xs(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof En&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}Ks(Zs,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),Ks(Zs,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),Ks(Zs,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),Ks(Zs,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),Zs.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Zs.prototype.toHex=function(){return Rn.encode(this.toBytes(),"hex").toUpperCase()},Gs=Zs;var Ys,Js=Rn.parseBytes;function Qs(t){if(!(this instanceof Qs))return new Qs(t);t=Es[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=Ms.sha512}Ys=Qs,Qs.prototype.sign=function(t,e){t=Js(t);var i=this.keyFromSecret(e),r=this.hashInt(i.messagePrefix(),t),n=this.g.mul(r),o=this.encodePoint(n),s=this.hashInt(o,i.pubBytes(),t).mul(i.priv()),a=r.add(s).umod(this.curve.n);return this.makeSignature({R:n,S:a,Rencoded:o})},Qs.prototype.verify=function(t,e,i){t=Js(t),e=this.makeSignature(e);var r=this.keyFromPublic(i),n=this.hashInt(e.Rencoded(),r.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(r.pub().mul(n)).eq(o)},Qs.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return Rn.intFromLE(t.digest()).umod(this.curve.n)},Qs.prototype.keyFromPublic=function(t){return Us.fromPublic(this,t)},Qs.prototype.keyFromSecret=function(t){return Us.fromSecret(this,t)},Qs.prototype.makeSignature=function(t){return t instanceof Gs?t:new Gs(this,t)},Qs.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},Qs.prototype.decodePoint=function(t){var e=(t=Rn.parseBytes(t)).length-1,i=t.slice(0,e).concat(-129&t[e]),r=0!=(128&t[e]),n=Rn.intFromLE(i);return this.curve.pointFromY(n,r)},Qs.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},Qs.prototype.decodeInt=function(t){return Rn.intFromLE(t)},Qs.prototype.isPoint=function(t){return t instanceof this.pointClass};var ta={},ea=ta;ea.version="6.5.3",ea.utils=Rn,ea.rand=rn,ea.curve=Kn,ea.curves=Es,ea.ec=Fs,ea.eddsa=Ys;var ia={exports:{}};!function(t,e){function i(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function r(t,e,i){if(r.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var n;"object"==typeof t?t.exports=r:e.BN=r,r.BN=r,r.wordSize=26;try{n=l({}).Buffer}catch(t){}function o(t,e,i){for(var r=0,n=Math.min(t.length,i),o=e;o<n;o++){var s=t.charCodeAt(o)-48;r<<=4,r|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:s}return r}function s(t,e,i,r){for(var n=0,o=Math.min(t.length,i),s=e;s<o;s++){var a=t.charCodeAt(s)-48;n*=r,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}function a(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(r.isBN=function(t){return t instanceof r||null!==t&&"object"==typeof t&&t.constructor.wordSize===r.wordSize&&Array.isArray(t.words)},r.max=function(t,e){return t.cmp(e)>0?t:e},r.min=function(t,e){return t.cmp(e)<0?t:e},r.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16);var r=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&r++,16===e?this._parseHex(t,r):this._parseBase(t,e,r),"-"===t[0]&&(this.negative=1),this._strip(),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initArray=function(t,e,i){if(t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,o,s=0;if("be"===i)for(r=t.length-1,n=0;r>=0;r-=3)o=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[n]|=o<<s&67108863,this.words[n+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);else if("le"===i)for(r=0,n=0;r<t.length;r+=3)o=t[r]|t[r+1]<<8|t[r+2]<<16,this.words[n]|=o<<s&67108863,this.words[n+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);return this._strip()},r.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var r,n,s=0;for(i=t.length-6,r=0;i>=e;i-=6)n=o(t,i,i+6),this.words[r]|=n<<s&67108863,this.words[r+1]|=n>>>26-s&4194303,(s+=24)>=26&&(s-=26,r++);i+6!==e&&(n=o(t,e,i+6),this.words[r]|=n<<s&67108863,this.words[r+1]|=n>>>26-s&4194303),this._strip()},r.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var o=t.length-i,a=o%r,l=Math.min(o,o-a)+i,d=0,c=i;c<l;c+=r)d=s(t,c,c+r,e),this.imuln(n),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(0!==a){var h=1;for(d=s(t,c,t.length,e),c=0;c<a;c++)h*=e;this.imuln(h),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}},r.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},r.prototype._move=function(t){a(t,this)},r.prototype.clone=function(){var t=new r(null);return this.copy(t),t},r.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},r.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},r.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{r.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(t){r.prototype.inspect=d}else r.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],u=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,l=s/67108864|0;i.words[0]=a;for(var d=1;d<r;d++){for(var c=l>>>26,h=67108863&l,u=Math.min(d,e.length-1),p=Math.max(0,d-t.length+1);p<=u;p++){var f=d-p|0;c+=(s=(n=0|t.words[f])*(o=0|e.words[p])+h)/67108864|0,h=67108863&s}i.words[d]=0|h,l=0|c}return 0!==l?i.words[d]=0|l:i.length--,i._strip()}r.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var r=0,n=0,o=0;o<this.length;o++){var s=this.words[o],a=(16777215&(s<<r|n)).toString(16);i=0!=(n=s>>>24-r&16777215)||o!==this.length-1?c[6-a.length]+a+i:a+i,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(i=n.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var l=h[t],d=u[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var f=p.modrn(d).toString(t);i=(p=p.idivn(d)).isZero()?f+i:c[l-f.length]+f+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}},r.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length,0!==this.negative?-t:t},r.prototype.toJSON=function(){return this.toString(16,2)},n&&(r.prototype.toBuffer=function(t,e){return this.toArrayLike(n,t,e)}),r.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},r.prototype.toArrayLike=function(t,e,i){this._strip();var r=this.byteLength(),n=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,i||Math.max(1,r));return this["_toArrayLike"+("le"===e?"LE":"BE")](n,r),n},r.prototype._toArrayLikeLE=function(t,e){for(var i=0,r=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|r;t[i++]=255&s,i<t.length&&(t[i++]=s>>8&255),i<t.length&&(t[i++]=s>>16&255),6===o?(i<t.length&&(t[i++]=s>>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(i<t.length)for(t[i++]=r;i<t.length;)t[i++]=0},r.prototype._toArrayLikeBE=function(t,e){for(var i=t.length-1,r=0,n=0,o=0;n<this.length;n++){var s=this.words[n]<<o|r;t[i--]=255&s,i>=0&&(t[i--]=s>>8&255),i>=0&&(t[i--]=s>>16&255),6===o?(i>=0&&(t[i--]=s>>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(i>=0)for(t[i--]=r;i>=0;)t[i--]=0},Math.clz32?r.prototype._countBits=function(t){return 32-Math.clz32(t)}:r.prototype._countBits=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},r.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},r.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var i=this._zeroBits(this.words[e]);if(t+=i,26!==i)break}return t},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},r.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return 0!==this.negative},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},r.prototype.ior=function(t){return this.iuor(t)},r.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},r.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},r.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;i<e.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=e.length,this._strip()},r.prototype.iand=function(t){return this.iuand(t)},r.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},r.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},r.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;r<i.length;r++)this.words[r]=e.words[r]^i.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this._strip()},r.prototype.ixor=function(t){return this.iuxor(t)},r.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},r.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},r.prototype.inotn=function(t){var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var r=0;r<e;r++)this.words[r]=67108863&~this.words[r];return i>0&&(this.words[r]=~this.words[r]&67108863>>26-i),this._strip()},r.prototype.notn=function(t){return this.clone().inotn(t)},r.prototype.setn=function(t,e){var i=t/26|0,r=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<r:this.words[i]&~(1<<r),this._strip()},r.prototype.iadd=function(t){var e,i,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0,o=0;o<r.length;o++)e=(0|i.words[o])+(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<i.length;o++)e=(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this},r.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},r.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var o=0,s=0;s<r.length;s++)o=(e=(0|i.words[s])-(0|r.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<i.length;s++)o=(e=(0|i.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<i.length&&i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this.length=Math.max(this.length,s),i!==this&&(this.negative=1),this._strip()},r.prototype.sub=function(t){return this.clone().isub(t)};var f=function(t,e,i){var r,n,o,s=t.words,a=e.words,l=i.words,d=0,c=0|s[0],h=8191&c,u=c>>>13,p=0|s[1],f=8191&p,m=p>>>13,g=0|s[2],b=8191&g,v=g>>>13,y=0|s[3],_=8191&y,w=y>>>13,x=0|s[4],M=8191&x,k=x>>>13,S=0|s[5],E=8191&S,A=S>>>13,T=0|s[6],I=8191&T,C=T>>>13,R=0|s[7],O=8191&R,L=R>>>13,P=0|s[8],B=8191&P,N=P>>>13,$=0|s[9],z=8191&$,j=$>>>13,F=0|a[0],D=8191&F,q=F>>>13,U=0|a[1],H=8191&U,V=U>>>13,W=0|a[2],G=8191&W,K=W>>>13,X=0|a[3],Z=8191&X,Y=X>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],it=8191&et,rt=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],lt=8191&at,dt=at>>>13,ct=0|a[8],ht=8191&ct,ut=ct>>>13,pt=0|a[9],ft=8191&pt,mt=pt>>>13;i.negative=t.negative^e.negative,i.length=19;var gt=(d+(r=Math.imul(h,D))|0)+((8191&(n=(n=Math.imul(h,q))+Math.imul(u,D)|0))<<13)|0;d=((o=Math.imul(u,q))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(f,D),n=(n=Math.imul(f,q))+Math.imul(m,D)|0,o=Math.imul(m,q);var bt=(d+(r=r+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,V)|0)+Math.imul(u,H)|0))<<13)|0;d=((o=o+Math.imul(u,V)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,D),n=(n=Math.imul(b,q))+Math.imul(v,D)|0,o=Math.imul(v,q),r=r+Math.imul(f,H)|0,n=(n=n+Math.imul(f,V)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,V)|0;var vt=(d+(r=r+Math.imul(h,G)|0)|0)+((8191&(n=(n=n+Math.imul(h,K)|0)+Math.imul(u,G)|0))<<13)|0;d=((o=o+Math.imul(u,K)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(_,D),n=(n=Math.imul(_,q))+Math.imul(w,D)|0,o=Math.imul(w,q),r=r+Math.imul(b,H)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,n=(n=n+Math.imul(f,K)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,K)|0;var yt=(d+(r=r+Math.imul(h,Z)|0)|0)+((8191&(n=(n=n+Math.imul(h,Y)|0)+Math.imul(u,Z)|0))<<13)|0;d=((o=o+Math.imul(u,Y)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(M,D),n=(n=Math.imul(M,q))+Math.imul(k,D)|0,o=Math.imul(k,q),r=r+Math.imul(_,H)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,H)|0,o=o+Math.imul(w,V)|0,r=r+Math.imul(b,G)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,K)|0,r=r+Math.imul(f,Z)|0,n=(n=n+Math.imul(f,Y)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,Y)|0;var _t=(d+(r=r+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(u,Q)|0))<<13)|0;d=((o=o+Math.imul(u,tt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(E,D),n=(n=Math.imul(E,q))+Math.imul(A,D)|0,o=Math.imul(A,q),r=r+Math.imul(M,H)|0,n=(n=n+Math.imul(M,V)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(_,G)|0,n=(n=n+Math.imul(_,K)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,K)|0,r=r+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,Y)|0,r=r+Math.imul(f,Q)|0,n=(n=n+Math.imul(f,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var wt=(d+(r=r+Math.imul(h,it)|0)|0)+((8191&(n=(n=n+Math.imul(h,rt)|0)+Math.imul(u,it)|0))<<13)|0;d=((o=o+Math.imul(u,rt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(I,D),n=(n=Math.imul(I,q))+Math.imul(C,D)|0,o=Math.imul(C,q),r=r+Math.imul(E,H)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,V)|0,r=r+Math.imul(M,G)|0,n=(n=n+Math.imul(M,K)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,K)|0,r=r+Math.imul(_,Z)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,Y)|0,r=r+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(f,it)|0,n=(n=n+Math.imul(f,rt)|0)+Math.imul(m,it)|0,o=o+Math.imul(m,rt)|0;var xt=(d+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,st)|0)+Math.imul(u,ot)|0))<<13)|0;d=((o=o+Math.imul(u,st)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(O,D),n=(n=Math.imul(O,q))+Math.imul(L,D)|0,o=Math.imul(L,q),r=r+Math.imul(I,H)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(C,H)|0,o=o+Math.imul(C,V)|0,r=r+Math.imul(E,G)|0,n=(n=n+Math.imul(E,K)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,K)|0,r=r+Math.imul(M,Z)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,Y)|0,r=r+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(b,it)|0,n=(n=n+Math.imul(b,rt)|0)+Math.imul(v,it)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(f,ot)|0,n=(n=n+Math.imul(f,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Mt=(d+(r=r+Math.imul(h,lt)|0)|0)+((8191&(n=(n=n+Math.imul(h,dt)|0)+Math.imul(u,lt)|0))<<13)|0;d=((o=o+Math.imul(u,dt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(B,D),n=(n=Math.imul(B,q))+Math.imul(N,D)|0,o=Math.imul(N,q),r=r+Math.imul(O,H)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,V)|0,r=r+Math.imul(I,G)|0,n=(n=n+Math.imul(I,K)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,K)|0,r=r+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,Y)|0,r=r+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(_,it)|0,n=(n=n+Math.imul(_,rt)|0)+Math.imul(w,it)|0,o=o+Math.imul(w,rt)|0,r=r+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,r=r+Math.imul(f,lt)|0,n=(n=n+Math.imul(f,dt)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,dt)|0;var kt=(d+(r=r+Math.imul(h,ht)|0)|0)+((8191&(n=(n=n+Math.imul(h,ut)|0)+Math.imul(u,ht)|0))<<13)|0;d=((o=o+Math.imul(u,ut)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(z,D),n=(n=Math.imul(z,q))+Math.imul(j,D)|0,o=Math.imul(j,q),r=r+Math.imul(B,H)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(O,G)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,K)|0,r=r+Math.imul(I,Z)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,Y)|0,r=r+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(M,it)|0,n=(n=n+Math.imul(M,rt)|0)+Math.imul(k,it)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(_,ot)|0,n=(n=n+Math.imul(_,st)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,st)|0,r=r+Math.imul(b,lt)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,dt)|0,r=r+Math.imul(f,ht)|0,n=(n=n+Math.imul(f,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var St=(d+(r=r+Math.imul(h,ft)|0)|0)+((8191&(n=(n=n+Math.imul(h,mt)|0)+Math.imul(u,ft)|0))<<13)|0;d=((o=o+Math.imul(u,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(z,H),n=(n=Math.imul(z,V))+Math.imul(j,H)|0,o=Math.imul(j,V),r=r+Math.imul(B,G)|0,n=(n=n+Math.imul(B,K)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,K)|0,r=r+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,Y)|0,r=r+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,r=r+Math.imul(E,it)|0,n=(n=n+Math.imul(E,rt)|0)+Math.imul(A,it)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,r=r+Math.imul(_,lt)|0,n=(n=n+Math.imul(_,dt)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,dt)|0,r=r+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,ut)|0;var Et=(d+(r=r+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,mt)|0)+Math.imul(m,ft)|0))<<13)|0;d=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(z,G),n=(n=Math.imul(z,K))+Math.imul(j,G)|0,o=Math.imul(j,K),r=r+Math.imul(B,Z)|0,n=(n=n+Math.imul(B,Y)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,Y)|0,r=r+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,r=r+Math.imul(I,it)|0,n=(n=n+Math.imul(I,rt)|0)+Math.imul(C,it)|0,o=o+Math.imul(C,rt)|0,r=r+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,r=r+Math.imul(M,lt)|0,n=(n=n+Math.imul(M,dt)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,dt)|0,r=r+Math.imul(_,ht)|0,n=(n=n+Math.imul(_,ut)|0)+Math.imul(w,ht)|0,o=o+Math.imul(w,ut)|0;var At=(d+(r=r+Math.imul(b,ft)|0)|0)+((8191&(n=(n=n+Math.imul(b,mt)|0)+Math.imul(v,ft)|0))<<13)|0;d=((o=o+Math.imul(v,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(z,Z),n=(n=Math.imul(z,Y))+Math.imul(j,Z)|0,o=Math.imul(j,Y),r=r+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(O,it)|0,n=(n=n+Math.imul(O,rt)|0)+Math.imul(L,it)|0,o=o+Math.imul(L,rt)|0,r=r+Math.imul(I,ot)|0,n=(n=n+Math.imul(I,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,r=r+Math.imul(E,lt)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,dt)|0,r=r+Math.imul(M,ht)|0,n=(n=n+Math.imul(M,ut)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,ut)|0;var Tt=(d+(r=r+Math.imul(_,ft)|0)|0)+((8191&(n=(n=n+Math.imul(_,mt)|0)+Math.imul(w,ft)|0))<<13)|0;d=((o=o+Math.imul(w,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(z,Q),n=(n=Math.imul(z,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),r=r+Math.imul(B,it)|0,n=(n=n+Math.imul(B,rt)|0)+Math.imul(N,it)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,r=r+Math.imul(I,lt)|0,n=(n=n+Math.imul(I,dt)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,dt)|0,r=r+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,ut)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ut)|0;var It=(d+(r=r+Math.imul(M,ft)|0)|0)+((8191&(n=(n=n+Math.imul(M,mt)|0)+Math.imul(k,ft)|0))<<13)|0;d=((o=o+Math.imul(k,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(z,it),n=(n=Math.imul(z,rt))+Math.imul(j,it)|0,o=Math.imul(j,rt),r=r+Math.imul(B,ot)|0,n=(n=n+Math.imul(B,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,r=r+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(L,lt)|0,o=o+Math.imul(L,dt)|0,r=r+Math.imul(I,ht)|0,n=(n=n+Math.imul(I,ut)|0)+Math.imul(C,ht)|0,o=o+Math.imul(C,ut)|0;var Ct=(d+(r=r+Math.imul(E,ft)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(A,ft)|0))<<13)|0;d=((o=o+Math.imul(A,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(z,ot),n=(n=Math.imul(z,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),r=r+Math.imul(B,lt)|0,n=(n=n+Math.imul(B,dt)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,dt)|0,r=r+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(L,ht)|0,o=o+Math.imul(L,ut)|0;var Rt=(d+(r=r+Math.imul(I,ft)|0)|0)+((8191&(n=(n=n+Math.imul(I,mt)|0)+Math.imul(C,ft)|0))<<13)|0;d=((o=o+Math.imul(C,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(z,lt),n=(n=Math.imul(z,dt))+Math.imul(j,lt)|0,o=Math.imul(j,dt),r=r+Math.imul(B,ht)|0,n=(n=n+Math.imul(B,ut)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,ut)|0;var Ot=(d+(r=r+Math.imul(O,ft)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(L,ft)|0))<<13)|0;d=((o=o+Math.imul(L,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(z,ht),n=(n=Math.imul(z,ut))+Math.imul(j,ht)|0,o=Math.imul(j,ut);var Lt=(d+(r=r+Math.imul(B,ft)|0)|0)+((8191&(n=(n=n+Math.imul(B,mt)|0)+Math.imul(N,ft)|0))<<13)|0;d=((o=o+Math.imul(N,mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Pt=(d+(r=Math.imul(z,ft))|0)+((8191&(n=(n=Math.imul(z,mt))+Math.imul(j,ft)|0))<<13)|0;return d=((o=Math.imul(j,mt))+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,l[0]=gt,l[1]=bt,l[2]=vt,l[3]=yt,l[4]=_t,l[5]=wt,l[6]=xt,l[7]=Mt,l[8]=kt,l[9]=St,l[10]=Et,l[11]=At,l[12]=Tt,l[13]=It,l[14]=Ct,l[15]=Rt,l[16]=Ot,l[17]=Lt,l[18]=Pt,0!==d&&(l[19]=d,i.length++),i};function m(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,o=0;o<i.length-1;o++){var s=n;n=0;for(var a=67108863&r,l=Math.min(o,e.length-1),d=Math.max(0,o-t.length+1);d<=l;d++){var c=o-d,h=(0|t.words[c])*(0|e.words[d]),u=67108863&h;a=67108863&(u=u+a|0),n+=(s=(s=s+(h/67108864|0)|0)+(u>>>26)|0)>>>26,s&=67108863}i.words[o]=a,r=s,s=n}return 0!==r?i.words[o]=r:i.length--,i._strip()}function g(t,e,i){return m(t,e,i)}Math.imul||(f=p),r.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?f(this,t,e):i<63?p(this,t,e):i<1024?m(this,t,e):g(this,t,e)},r.prototype.mul=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},r.prototype.mulf=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),g(this,t,e)},r.prototype.imul=function(t){return this.clone().mulTo(t,this)},r.prototype.imuln=function(t){var e=t<0;e&&(t=-t);for(var i=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,o=(67108863&n)+(67108863&i);i>>=26,i+=n/67108864|0,i+=o>>>26,this.words[r]=67108863&o}return 0!==i&&(this.words[r]=i,this.length++),e?this.ineg():this},r.prototype.muln=function(t){return this.clone().imuln(t)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i<e.length;i++){var r=i/26|0,n=i%26;e[i]=t.words[r]>>>n&1}return e}(t);if(0===e.length)return new r(1);for(var i=this,n=0;n<e.length&&0===e[n];n++,i=i.sqr());if(++n<e.length)for(var o=i.sqr();n<e.length;n++,o=o.sqr())0!==e[n]&&(i=i.mul(o));return i},r.prototype.iushln=function(t){var e,i=t%26,r=(t-i)/26,n=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e<this.length;e++){var s=this.words[e]&n,a=(0|this.words[e])-s<<i;this.words[e]=a|o,o=s>>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e<r;e++)this.words[e]=0;this.length+=r}return this._strip()},r.prototype.ishln=function(t){return this.iushln(t)},r.prototype.iushrn=function(t,e,i){var r;r=e?(e-e%26)/26:0;var n=t%26,o=Math.min((t-n)/26,this.length),s=67108863^67108863>>>n<<n,a=i;if(r-=o,r=Math.max(0,r),a){for(var l=0;l<o;l++)a.words[l]=this.words[l];a.length=o}if(0===o);else if(this.length>o)for(this.length-=o,l=0;l<this.length;l++)this.words[l]=this.words[l+o];else this.words[0]=0,this.length=1;var d=0;for(l=this.length-1;l>=0&&(0!==d||l>=r);l--){var c=0|this.words[l];this.words[l]=d<<26-n|c>>>n,d=c&s}return a&&0!==d&&(a.words[a.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},r.prototype.ishrn=function(t,e,i){return this.iushrn(t,e,i)},r.prototype.shln=function(t){return this.clone().ishln(t)},r.prototype.ushln=function(t){return this.clone().iushln(t)},r.prototype.shrn=function(t){return this.clone().ishrn(t)},r.prototype.ushrn=function(t){return this.clone().iushrn(t)},r.prototype.testn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;return!(this.length<=i||!(this.words[i]&r))},r.prototype.imaskn=function(t){var e=t%26,i=(t-e)/26;if(this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var r=67108863^67108863>>>e<<e;this.words[this.length-1]&=r}return this._strip()},r.prototype.maskn=function(t){return this.clone().imaskn(t)},r.prototype.iaddn=function(t){return t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},r.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},r.prototype.isubn=function(t){if(t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},r.prototype.addn=function(t){return this.clone().iaddn(t)},r.prototype.subn=function(t){return this.clone().isubn(t)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(t,e,i){var r,n,o=t.length+i;this._expand(o);var s=0;for(r=0;r<t.length;r++){n=(0|this.words[r+i])+s;var a=(0|t.words[r])*e;s=((n-=67108863&a)>>26)-(a/67108864|0),this.words[r+i]=67108863&n}for(;r<this.length-i;r++)s=(n=(0|this.words[r+i])+s)>>26,this.words[r+i]=67108863&n;if(0===s)return this._strip();for(s=0,r=0;r<this.length;r++)s=(n=-(0|this.words[r])+s)>>26,this.words[r]=67108863&n;return this.negative=1,this._strip()},r.prototype._wordDiv=function(t,e){var i=(this.length,t.length),n=this.clone(),o=t,s=0|o.words[o.length-1];0!=(i=26-this._countBits(s))&&(o=o.ushln(i),n.iushln(i),s=0|o.words[o.length-1]);var a,l=n.length-o.length;if("mod"!==e){(a=new r(null)).length=l+1,a.words=new Array(a.length);for(var d=0;d<a.length;d++)a.words[d]=0}var c=n.clone()._ishlnsubmul(o,1,l);0===c.negative&&(n=c,a&&(a.words[l]=1));for(var h=l-1;h>=0;h--){var u=67108864*(0|n.words[o.length+h])+(0|n.words[o.length+h-1]);for(u=Math.min(u/s|0,67108863),n._ishlnsubmul(o,u,h);0!==n.negative;)u--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=u)}return a&&a._strip(),n._strip(),"div"!==e&&0!==i&&n.iushrn(i),{div:a||null,mod:n}},r.prototype.divmod=function(t,e,i){return this.isZero()?{div:new r(0),mod:new r(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(o=s.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new r(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new r(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new r(this.modrn(t.words[0]))}:this._wordDiv(t,e);var n,o,s},r.prototype.div=function(t){return this.divmod(t,"div",!1).div},r.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},r.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},r.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),o=i.cmp(r);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},r.prototype.modrn=function(t){var e=t<0;e&&(t=-t);for(var i=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(i*r+(0|this.words[n]))%t;return e?-r:r},r.prototype.modn=function(t){return this.modrn(t)},r.prototype.idivn=function(t){var e=t<0;e&&(t=-t);for(var i=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*i;this.words[r]=n/t|0,i=n%t}return this._strip(),e?this.ineg():this},r.prototype.divn=function(t){return this.clone().idivn(t)},r.prototype.egcd=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new r(1),o=new r(0),s=new r(0),a=new r(1),l=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++l;for(var d=i.clone(),c=e.clone();!e.isZero();){for(var h=0,u=1;0==(e.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(d),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,f=1;0==(i.words[0]&f)&&p<26;++p,f<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(s.isOdd()||a.isOdd())&&(s.iadd(d),a.isub(c)),s.iushrn(1),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(s),o.isub(a)):(i.isub(e),s.isub(n),a.isub(o))}return{a:s,b:a,gcd:i.iushln(l)}},r.prototype._invmp=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new r(1),s=new r(0),a=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(a),o.iushrn(1);for(var c=0,h=1;0==(i.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(i.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(a),s.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(s)):(i.isub(e),s.isub(o))}return(n=0===e.cmpn(1)?o:s).cmpn(0)<0&&n.iadd(t),n},r.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var o=e;e=i,i=o}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},r.prototype.invm=function(t){return this.egcd(t).a.umod(t)},r.prototype.isEven=function(){return 0==(1&this.words[0])},r.prototype.isOdd=function(){return 1==(1&this.words[0])},r.prototype.andln=function(t){return this.words[0]&t},r.prototype.bincn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=r,this;for(var n=r,o=i;0!==n&&o<this.length;o++){var s=0|this.words[o];n=(s+=n)>>>26,s&=67108863,this.words[o]=s}return 0!==n&&(this.words[o]=n,this.length++),this},r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},r.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)e=1;else{i&&(t=-t);var r=0|this.words[0];e=r===t?0:r<t?-1:1}return 0!==this.negative?0|-e:e},r.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},r.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){r<n?e=-1:r>n&&(e=1);break}}return e},r.prototype.gtn=function(t){return 1===this.cmpn(t)},r.prototype.gt=function(t){return 1===this.cmp(t)},r.prototype.gten=function(t){return this.cmpn(t)>=0},r.prototype.gte=function(t){return this.cmp(t)>=0},r.prototype.ltn=function(t){return-1===this.cmpn(t)},r.prototype.lt=function(t){return-1===this.cmp(t)},r.prototype.lten=function(t){return this.cmpn(t)<=0},r.prototype.lte=function(t){return this.cmp(t)<=0},r.prototype.eqn=function(t){return 0===this.cmpn(t)},r.prototype.eq=function(t){return 0===this.cmp(t)},r.red=function(t){return new M(t)},r.prototype.toRed=function(t){return t.convertTo(this)._forceRed(t)},r.prototype.fromRed=function(){return this.red.convertFrom(this)},r.prototype._forceRed=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return this._forceRed(t)},r.prototype.redAdd=function(t){return this.red.add(this,t)},r.prototype.redIAdd=function(t){return this.red.iadd(this,t)},r.prototype.redSub=function(t){return this.red.sub(this,t)},r.prototype.redISub=function(t){return this.red.isub(this,t)},r.prototype.redShl=function(t){return this.red.shl(this,t)},r.prototype.redMul=function(t){return this.red._verify2(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return this.red._verify2(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(t){return this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new r(e,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=r._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function k(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new r(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(y,v),y.prototype.split=function(t,e){for(var i=Math.min(t.length,9),r=0;r<i;r++)e.words[r]=t.words[r];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(e.words[e.length++]=4194303&n,r=10;r<t.length;r++){var o=0|t.words[r];t.words[r-10]=(4194303&o)<<4|n>>>22,n=o}n>>>=22,t.words[r-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i<t.length;i++){var r=0|t.words[i];e+=977*r,t.words[i]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(_,v),i(w,v),i(x,v),x.prototype.imulK=function(t){for(var e=0,i=0;i<t.length;i++){var r=19*(0|t.words[i])+e,n=67108863&r;r>>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},r._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new _;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new x}return b[t]=e,e},M.prototype._verify1=function(t){},M.prototype._verify2=function(t,e){},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(a(t,t.umod(this.m)._forceRed(this)),t)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},M.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();if(3===this.m.andln(3)){var e=this.m.add(new r(1)).iushrn(2);return this.pow(t,e)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);var o=new r(1).toRed(this),s=o.redNeg(),a=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new r(2*l*l).toRed(this);0!==this.pow(l,a).cmp(s);)l.redIAdd(s);for(var d=this.pow(l,i),c=this.pow(t,i.addn(1).iushrn(1)),h=this.pow(t,i),u=n;0!==h.cmp(o);){for(var p=h,f=0;0!==p.cmp(o);f++)p=p.redSqr();var m=this.pow(d,new r(1).iushln(u-f-1));c=c.redMul(m),d=m.redSqr(),h=h.redMul(d),u=f}return c},M.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},M.prototype.pow=function(t,e){if(e.isZero())return new r(1).toRed(this);if(0===e.cmpn(1))return t.clone();var i=new Array(16);i[0]=new r(1).toRed(this),i[1]=t;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],t);var o=i[0],s=0,a=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var d=e.words[n],c=l-1;c>=0;c--){var h=d>>c&1;o!==i[0]&&(o=this.sqr(o)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===n&&0===c)&&(o=this.mul(o,i[s]),a=0,s=0)):a=0}l=26}return o},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},r.mont=function(t){return new k(t)},i(k,M),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0)._forceRed(this);var i=t.mul(e),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(ia,this),ia=ia.exports;var ra={exports:{}};!function(t,e){function i(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function r(t,e,i){if(r.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var n;"object"==typeof t?t.exports=r:e.BN=r,r.BN=r,r.wordSize=26;try{n=l({}).Buffer}catch(t){}function o(t,e,i){for(var r=0,n=Math.min(t.length,i),o=e;o<n;o++){var s=t.charCodeAt(o)-48;r<<=4,r|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return r}function s(t,e,i,r){for(var n=0,o=Math.min(t.length,i),s=e;s<o;s++){var a=t.charCodeAt(s)-48;n*=r,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}r.isBN=function(t){return t instanceof r||null!==t&&"object"==typeof t&&t.constructor.wordSize===r.wordSize&&Array.isArray(t.words)},r.max=function(t,e){return t.cmp(e)>0?t:e},r.min=function(t,e){return t.cmp(e)<0?t:e},r.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16);var r=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&r++,16===e?this._parseHex(t,r):this._parseBase(t,e,r),"-"===t[0]&&(this.negative=1),this.strip(),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initArray=function(t,e,i){if(t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,o,s=0;if("be"===i)for(r=t.length-1,n=0;r>=0;r-=3)o=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[n]|=o<<s&67108863,this.words[n+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);else if("le"===i)for(r=0,n=0;r<t.length;r+=3)o=t[r]|t[r+1]<<8|t[r+2]<<16,this.words[n]|=o<<s&67108863,this.words[n+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);return this.strip()},r.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var r,n,s=0;for(i=t.length-6,r=0;i>=e;i-=6)n=o(t,i,i+6),this.words[r]|=n<<s&67108863,this.words[r+1]|=n>>>26-s&4194303,(s+=24)>=26&&(s-=26,r++);i+6!==e&&(n=o(t,e,i+6),this.words[r]|=n<<s&67108863,this.words[r+1]|=n>>>26-s&4194303),this.strip()},r.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var o=t.length-i,a=o%r,l=Math.min(o,o-a)+i,d=0,c=i;c<l;c+=r)d=s(t,c,c+r,e),this.imuln(n),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(0!==a){var h=1;for(d=s(t,c,t.length,e),c=0;c<a;c++)h*=e;this.imuln(h),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}},r.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},r.prototype.clone=function(){var t=new r(null);return this.copy(t),t},r.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},r.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},r.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},r.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var a=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,l=s/67108864|0;i.words[0]=a;for(var d=1;d<r;d++){for(var c=l>>>26,h=67108863&l,u=Math.min(d,e.length-1),p=Math.max(0,d-t.length+1);p<=u;p++){var f=d-p|0;c+=(s=(n=0|t.words[f])*(o=0|e.words[p])+h)/67108864|0,h=67108863&s}i.words[d]=0|h,l=0|c}return 0!==l?i.words[d]=0|l:i.length--,i.strip()}r.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var r=0,n=0,o=0;o<this.length;o++){var s=this.words[o],l=(16777215&(s<<r|n)).toString(16);i=0!=(n=s>>>24-r&16777215)||o!==this.length-1?a[6-l.length]+l+i:l+i,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(i=n.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var h=d[t],u=c[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var f=p.modn(u).toString(t);i=(p=p.idivn(u)).isZero()?f+i:a[h-f.length]+f+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}},r.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length,0!==this.negative?-t:t},r.prototype.toJSON=function(){return this.toString(16)},r.prototype.toBuffer=function(t,e){return this.toArrayLike(n,t,e)},r.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},r.prototype.toArrayLike=function(t,e,i){var r=this.byteLength(),n=i||Math.max(1,r);this.strip();var o,s,a="le"===e,l=new t(n),d=this.clone();if(a){for(s=0;!d.isZero();s++)o=d.andln(255),d.iushrn(8),l[s]=o;for(;s<n;s++)l[s]=0}else{for(s=0;s<n-r;s++)l[s]=0;for(s=0;!d.isZero();s++)o=d.andln(255),d.iushrn(8),l[n-s-1]=o}return l},Math.clz32?r.prototype._countBits=function(t){return 32-Math.clz32(t)}:r.prototype._countBits=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},r.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},r.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var i=this._zeroBits(this.words[e]);if(t+=i,26!==i)break}return t},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},r.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return 0!==this.negative},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},r.prototype.ior=function(t){return this.iuor(t)},r.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},r.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},r.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;i<e.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=e.length,this.strip()},r.prototype.iand=function(t){return this.iuand(t)},r.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},r.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},r.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;r<i.length;r++)this.words[r]=e.words[r]^i.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},r.prototype.ixor=function(t){return this.iuxor(t)},r.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},r.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},r.prototype.inotn=function(t){var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var r=0;r<e;r++)this.words[r]=67108863&~this.words[r];return i>0&&(this.words[r]=~this.words[r]&67108863>>26-i),this.strip()},r.prototype.notn=function(t){return this.clone().inotn(t)},r.prototype.setn=function(t,e){var i=t/26|0,r=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<r:this.words[i]&~(1<<r),this.strip()},r.prototype.iadd=function(t){var e,i,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0,o=0;o<r.length;o++)e=(0|i.words[o])+(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<i.length;o++)e=(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this},r.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},r.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var o=0,s=0;s<r.length;s++)o=(e=(0|i.words[s])-(0|r.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<i.length;s++)o=(e=(0|i.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<i.length&&i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this.length=Math.max(this.length,s),i!==this&&(this.negative=1),this.strip()},r.prototype.sub=function(t){return this.clone().isub(t)};var u=function(t,e,i){var r,n,o,s=t.words,a=e.words,l=i.words,d=0,c=0|s[0],h=8191&c,u=c>>>13,p=0|s[1],f=8191&p,m=p>>>13,g=0|s[2],b=8191&g,v=g>>>13,y=0|s[3],_=8191&y,w=y>>>13,x=0|s[4],M=8191&x,k=x>>>13,S=0|s[5],E=8191&S,A=S>>>13,T=0|s[6],I=8191&T,C=T>>>13,R=0|s[7],O=8191&R,L=R>>>13,P=0|s[8],B=8191&P,N=P>>>13,$=0|s[9],z=8191&$,j=$>>>13,F=0|a[0],D=8191&F,q=F>>>13,U=0|a[1],H=8191&U,V=U>>>13,W=0|a[2],G=8191&W,K=W>>>13,X=0|a[3],Z=8191&X,Y=X>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],it=8191&et,rt=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],lt=8191&at,dt=at>>>13,ct=0|a[8],ht=8191&ct,ut=ct>>>13,pt=0|a[9],ft=8191&pt,mt=pt>>>13;i.negative=t.negative^e.negative,i.length=19;var gt=(d+(r=Math.imul(h,D))|0)+((8191&(n=(n=Math.imul(h,q))+Math.imul(u,D)|0))<<13)|0;d=((o=Math.imul(u,q))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(f,D),n=(n=Math.imul(f,q))+Math.imul(m,D)|0,o=Math.imul(m,q);var bt=(d+(r=r+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,V)|0)+Math.imul(u,H)|0))<<13)|0;d=((o=o+Math.imul(u,V)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,D),n=(n=Math.imul(b,q))+Math.imul(v,D)|0,o=Math.imul(v,q),r=r+Math.imul(f,H)|0,n=(n=n+Math.imul(f,V)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,V)|0;var vt=(d+(r=r+Math.imul(h,G)|0)|0)+((8191&(n=(n=n+Math.imul(h,K)|0)+Math.imul(u,G)|0))<<13)|0;d=((o=o+Math.imul(u,K)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(_,D),n=(n=Math.imul(_,q))+Math.imul(w,D)|0,o=Math.imul(w,q),r=r+Math.imul(b,H)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,n=(n=n+Math.imul(f,K)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,K)|0;var yt=(d+(r=r+Math.imul(h,Z)|0)|0)+((8191&(n=(n=n+Math.imul(h,Y)|0)+Math.imul(u,Z)|0))<<13)|0;d=((o=o+Math.imul(u,Y)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(M,D),n=(n=Math.imul(M,q))+Math.imul(k,D)|0,o=Math.imul(k,q),r=r+Math.imul(_,H)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,H)|0,o=o+Math.imul(w,V)|0,r=r+Math.imul(b,G)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,K)|0,r=r+Math.imul(f,Z)|0,n=(n=n+Math.imul(f,Y)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,Y)|0;var _t=(d+(r=r+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(u,Q)|0))<<13)|0;d=((o=o+Math.imul(u,tt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(E,D),n=(n=Math.imul(E,q))+Math.imul(A,D)|0,o=Math.imul(A,q),r=r+Math.imul(M,H)|0,n=(n=n+Math.imul(M,V)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(_,G)|0,n=(n=n+Math.imul(_,K)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,K)|0,r=r+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,Y)|0,r=r+Math.imul(f,Q)|0,n=(n=n+Math.imul(f,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var wt=(d+(r=r+Math.imul(h,it)|0)|0)+((8191&(n=(n=n+Math.imul(h,rt)|0)+Math.imul(u,it)|0))<<13)|0;d=((o=o+Math.imul(u,rt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(I,D),n=(n=Math.imul(I,q))+Math.imul(C,D)|0,o=Math.imul(C,q),r=r+Math.imul(E,H)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,V)|0,r=r+Math.imul(M,G)|0,n=(n=n+Math.imul(M,K)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,K)|0,r=r+Math.imul(_,Z)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,Y)|0,r=r+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(f,it)|0,n=(n=n+Math.imul(f,rt)|0)+Math.imul(m,it)|0,o=o+Math.imul(m,rt)|0;var xt=(d+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,st)|0)+Math.imul(u,ot)|0))<<13)|0;d=((o=o+Math.imul(u,st)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(O,D),n=(n=Math.imul(O,q))+Math.imul(L,D)|0,o=Math.imul(L,q),r=r+Math.imul(I,H)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(C,H)|0,o=o+Math.imul(C,V)|0,r=r+Math.imul(E,G)|0,n=(n=n+Math.imul(E,K)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,K)|0,r=r+Math.imul(M,Z)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,Y)|0,r=r+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(b,it)|0,n=(n=n+Math.imul(b,rt)|0)+Math.imul(v,it)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(f,ot)|0,n=(n=n+Math.imul(f,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Mt=(d+(r=r+Math.imul(h,lt)|0)|0)+((8191&(n=(n=n+Math.imul(h,dt)|0)+Math.imul(u,lt)|0))<<13)|0;d=((o=o+Math.imul(u,dt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(B,D),n=(n=Math.imul(B,q))+Math.imul(N,D)|0,o=Math.imul(N,q),r=r+Math.imul(O,H)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,V)|0,r=r+Math.imul(I,G)|0,n=(n=n+Math.imul(I,K)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,K)|0,r=r+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,Y)|0,r=r+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(_,it)|0,n=(n=n+Math.imul(_,rt)|0)+Math.imul(w,it)|0,o=o+Math.imul(w,rt)|0,r=r+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,r=r+Math.imul(f,lt)|0,n=(n=n+Math.imul(f,dt)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,dt)|0;var kt=(d+(r=r+Math.imul(h,ht)|0)|0)+((8191&(n=(n=n+Math.imul(h,ut)|0)+Math.imul(u,ht)|0))<<13)|0;d=((o=o+Math.imul(u,ut)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(z,D),n=(n=Math.imul(z,q))+Math.imul(j,D)|0,o=Math.imul(j,q),r=r+Math.imul(B,H)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(O,G)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,K)|0,r=r+Math.imul(I,Z)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,Y)|0,r=r+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(M,it)|0,n=(n=n+Math.imul(M,rt)|0)+Math.imul(k,it)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(_,ot)|0,n=(n=n+Math.imul(_,st)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,st)|0,r=r+Math.imul(b,lt)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,dt)|0,r=r+Math.imul(f,ht)|0,n=(n=n+Math.imul(f,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var St=(d+(r=r+Math.imul(h,ft)|0)|0)+((8191&(n=(n=n+Math.imul(h,mt)|0)+Math.imul(u,ft)|0))<<13)|0;d=((o=o+Math.imul(u,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(z,H),n=(n=Math.imul(z,V))+Math.imul(j,H)|0,o=Math.imul(j,V),r=r+Math.imul(B,G)|0,n=(n=n+Math.imul(B,K)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,K)|0,r=r+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,Y)|0,r=r+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,r=r+Math.imul(E,it)|0,n=(n=n+Math.imul(E,rt)|0)+Math.imul(A,it)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,r=r+Math.imul(_,lt)|0,n=(n=n+Math.imul(_,dt)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,dt)|0,r=r+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,ut)|0;var Et=(d+(r=r+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,mt)|0)+Math.imul(m,ft)|0))<<13)|0;d=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(z,G),n=(n=Math.imul(z,K))+Math.imul(j,G)|0,o=Math.imul(j,K),r=r+Math.imul(B,Z)|0,n=(n=n+Math.imul(B,Y)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,Y)|0,r=r+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,r=r+Math.imul(I,it)|0,n=(n=n+Math.imul(I,rt)|0)+Math.imul(C,it)|0,o=o+Math.imul(C,rt)|0,r=r+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,r=r+Math.imul(M,lt)|0,n=(n=n+Math.imul(M,dt)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,dt)|0,r=r+Math.imul(_,ht)|0,n=(n=n+Math.imul(_,ut)|0)+Math.imul(w,ht)|0,o=o+Math.imul(w,ut)|0;var At=(d+(r=r+Math.imul(b,ft)|0)|0)+((8191&(n=(n=n+Math.imul(b,mt)|0)+Math.imul(v,ft)|0))<<13)|0;d=((o=o+Math.imul(v,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(z,Z),n=(n=Math.imul(z,Y))+Math.imul(j,Z)|0,o=Math.imul(j,Y),r=r+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(O,it)|0,n=(n=n+Math.imul(O,rt)|0)+Math.imul(L,it)|0,o=o+Math.imul(L,rt)|0,r=r+Math.imul(I,ot)|0,n=(n=n+Math.imul(I,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,r=r+Math.imul(E,lt)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,dt)|0,r=r+Math.imul(M,ht)|0,n=(n=n+Math.imul(M,ut)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,ut)|0;var Tt=(d+(r=r+Math.imul(_,ft)|0)|0)+((8191&(n=(n=n+Math.imul(_,mt)|0)+Math.imul(w,ft)|0))<<13)|0;d=((o=o+Math.imul(w,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(z,Q),n=(n=Math.imul(z,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),r=r+Math.imul(B,it)|0,n=(n=n+Math.imul(B,rt)|0)+Math.imul(N,it)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,r=r+Math.imul(I,lt)|0,n=(n=n+Math.imul(I,dt)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,dt)|0,r=r+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,ut)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ut)|0;var It=(d+(r=r+Math.imul(M,ft)|0)|0)+((8191&(n=(n=n+Math.imul(M,mt)|0)+Math.imul(k,ft)|0))<<13)|0;d=((o=o+Math.imul(k,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(z,it),n=(n=Math.imul(z,rt))+Math.imul(j,it)|0,o=Math.imul(j,rt),r=r+Math.imul(B,ot)|0,n=(n=n+Math.imul(B,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,r=r+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(L,lt)|0,o=o+Math.imul(L,dt)|0,r=r+Math.imul(I,ht)|0,n=(n=n+Math.imul(I,ut)|0)+Math.imul(C,ht)|0,o=o+Math.imul(C,ut)|0;var Ct=(d+(r=r+Math.imul(E,ft)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(A,ft)|0))<<13)|0;d=((o=o+Math.imul(A,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(z,ot),n=(n=Math.imul(z,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),r=r+Math.imul(B,lt)|0,n=(n=n+Math.imul(B,dt)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,dt)|0,r=r+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(L,ht)|0,o=o+Math.imul(L,ut)|0;var Rt=(d+(r=r+Math.imul(I,ft)|0)|0)+((8191&(n=(n=n+Math.imul(I,mt)|0)+Math.imul(C,ft)|0))<<13)|0;d=((o=o+Math.imul(C,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(z,lt),n=(n=Math.imul(z,dt))+Math.imul(j,lt)|0,o=Math.imul(j,dt),r=r+Math.imul(B,ht)|0,n=(n=n+Math.imul(B,ut)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,ut)|0;var Ot=(d+(r=r+Math.imul(O,ft)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(L,ft)|0))<<13)|0;d=((o=o+Math.imul(L,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(z,ht),n=(n=Math.imul(z,ut))+Math.imul(j,ht)|0,o=Math.imul(j,ut);var Lt=(d+(r=r+Math.imul(B,ft)|0)|0)+((8191&(n=(n=n+Math.imul(B,mt)|0)+Math.imul(N,ft)|0))<<13)|0;d=((o=o+Math.imul(N,mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Pt=(d+(r=Math.imul(z,ft))|0)+((8191&(n=(n=Math.imul(z,mt))+Math.imul(j,ft)|0))<<13)|0;return d=((o=Math.imul(j,mt))+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,l[0]=gt,l[1]=bt,l[2]=vt,l[3]=yt,l[4]=_t,l[5]=wt,l[6]=xt,l[7]=Mt,l[8]=kt,l[9]=St,l[10]=Et,l[11]=At,l[12]=Tt,l[13]=It,l[14]=Ct,l[15]=Rt,l[16]=Ot,l[17]=Lt,l[18]=Pt,0!==d&&(l[19]=d,i.length++),i};function p(t,e,i){return(new f).mulp(t,e,i)}function f(t,e){this.x=t,this.y=e}Math.imul||(u=h),r.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?u(this,t,e):i<63?h(this,t,e):i<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,o=0;o<i.length-1;o++){var s=n;n=0;for(var a=67108863&r,l=Math.min(o,e.length-1),d=Math.max(0,o-t.length+1);d<=l;d++){var c=o-d,h=(0|t.words[c])*(0|e.words[d]),u=67108863&h;a=67108863&(u=u+a|0),n+=(s=(s=s+(h/67108864|0)|0)+(u>>>26)|0)>>>26,s&=67108863}i.words[o]=a,r=s,s=n}return 0!==r?i.words[o]=r:i.length--,i.strip()}(this,t,e):p(this,t,e)},f.prototype.makeRBT=function(t){for(var e=new Array(t),i=r.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,i,t);return e},f.prototype.revBin=function(t,e,i){if(0===t||t===i-1)return t;for(var r=0,n=0;n<e;n++)r|=(1&t)<<e-n-1,t>>=1;return r},f.prototype.permute=function(t,e,i,r,n,o){for(var s=0;s<o;s++)r[s]=e[t[s]],n[s]=i[t[s]]},f.prototype.transform=function(t,e,i,r,n,o){this.permute(o,t,e,i,r,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,l=Math.cos(2*Math.PI/a),d=Math.sin(2*Math.PI/a),c=0;c<n;c+=a)for(var h=l,u=d,p=0;p<s;p++){var f=i[c+p],m=r[c+p],g=i[c+p+s],b=r[c+p+s],v=h*g-u*b;b=h*b+u*g,g=v,i[c+p]=f+g,r[c+p]=m+b,i[c+p+s]=f-g,r[c+p+s]=m-b,p!==a&&(v=l*h-d*u,u=l*u+d*h,h=v)}},f.prototype.guessLen13b=function(t,e){var i=1|Math.max(e,t),r=1&i,n=0;for(i=i/2|0;i;i>>>=1)n++;return 1<<n+1+r},f.prototype.conjugate=function(t,e,i){if(!(i<=1))for(var r=0;r<i/2;r++){var n=t[r];t[r]=t[i-r-1],t[i-r-1]=n,n=e[r],e[r]=-e[i-r-1],e[i-r-1]=-n}},f.prototype.normalize13b=function(t,e){for(var i=0,r=0;r<e/2;r++){var n=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+i;t[r]=67108863&n,i=n<67108864?0:n/67108864|0}return t},f.prototype.convert13b=function(t,e,i,r){for(var n=0,o=0;o<e;o++)n+=0|t[o],i[2*o]=8191&n,n>>>=13,i[2*o+1]=8191&n,n>>>=13;for(o=2*e;o<r;++o)i[o]=0},f.prototype.stub=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=0;return e},f.prototype.mulp=function(t,e,i){var r=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(r),o=this.stub(r),s=new Array(r),a=new Array(r),l=new Array(r),d=new Array(r),c=new Array(r),h=new Array(r),u=i.words;u.length=r,this.convert13b(t.words,t.length,s,r),this.convert13b(e.words,e.length,d,r),this.transform(s,o,a,l,r,n),this.transform(d,o,c,h,r,n);for(var p=0;p<r;p++){var f=a[p]*c[p]-l[p]*h[p];l[p]=a[p]*h[p]+l[p]*c[p],a[p]=f}return this.conjugate(a,l,r),this.transform(a,l,u,o,r,n),this.conjugate(u,o,r),this.normalize13b(u,r),i.negative=t.negative^e.negative,i.length=t.length+e.length,i.strip()},r.prototype.mul=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},r.prototype.mulf=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),p(this,t,e)},r.prototype.imul=function(t){return this.clone().mulTo(t,this)},r.prototype.imuln=function(t){for(var e=0,i=0;i<this.length;i++){var r=(0|this.words[i])*t,n=(67108863&r)+(67108863&e);e>>=26,e+=r/67108864|0,e+=n>>>26,this.words[i]=67108863&n}return 0!==e&&(this.words[i]=e,this.length++),this},r.prototype.muln=function(t){return this.clone().imuln(t)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i<e.length;i++){var r=i/26|0,n=i%26;e[i]=(t.words[r]&1<<n)>>>n}return e}(t);if(0===e.length)return new r(1);for(var i=this,n=0;n<e.length&&0===e[n];n++,i=i.sqr());if(++n<e.length)for(var o=i.sqr();n<e.length;n++,o=o.sqr())0!==e[n]&&(i=i.mul(o));return i},r.prototype.iushln=function(t){var e,i=t%26,r=(t-i)/26,n=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e<this.length;e++){var s=this.words[e]&n,a=(0|this.words[e])-s<<i;this.words[e]=a|o,o=s>>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e<r;e++)this.words[e]=0;this.length+=r}return this.strip()},r.prototype.ishln=function(t){return this.iushln(t)},r.prototype.iushrn=function(t,e,i){var r;r=e?(e-e%26)/26:0;var n=t%26,o=Math.min((t-n)/26,this.length),s=67108863^67108863>>>n<<n,a=i;if(r-=o,r=Math.max(0,r),a){for(var l=0;l<o;l++)a.words[l]=this.words[l];a.length=o}if(0===o);else if(this.length>o)for(this.length-=o,l=0;l<this.length;l++)this.words[l]=this.words[l+o];else this.words[0]=0,this.length=1;var d=0;for(l=this.length-1;l>=0&&(0!==d||l>=r);l--){var c=0|this.words[l];this.words[l]=d<<26-n|c>>>n,d=c&s}return a&&0!==d&&(a.words[a.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},r.prototype.ishrn=function(t,e,i){return this.iushrn(t,e,i)},r.prototype.shln=function(t){return this.clone().ishln(t)},r.prototype.ushln=function(t){return this.clone().iushln(t)},r.prototype.shrn=function(t){return this.clone().ishrn(t)},r.prototype.ushrn=function(t){return this.clone().iushrn(t)},r.prototype.testn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;return!(this.length<=i||!(this.words[i]&r))},r.prototype.imaskn=function(t){var e=t%26,i=(t-e)/26;if(this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var r=67108863^67108863>>>e<<e;this.words[this.length-1]&=r}return this.strip()},r.prototype.maskn=function(t){return this.clone().imaskn(t)},r.prototype.iaddn=function(t){return t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},r.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},r.prototype.isubn=function(t){if(t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},r.prototype.addn=function(t){return this.clone().iaddn(t)},r.prototype.subn=function(t){return this.clone().isubn(t)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(t,e,i){var r,n,o=t.length+i;this._expand(o);var s=0;for(r=0;r<t.length;r++){n=(0|this.words[r+i])+s;var a=(0|t.words[r])*e;s=((n-=67108863&a)>>26)-(a/67108864|0),this.words[r+i]=67108863&n}for(;r<this.length-i;r++)s=(n=(0|this.words[r+i])+s)>>26,this.words[r+i]=67108863&n;if(0===s)return this.strip();for(s=0,r=0;r<this.length;r++)s=(n=-(0|this.words[r])+s)>>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},r.prototype._wordDiv=function(t,e){var i=(this.length,t.length),n=this.clone(),o=t,s=0|o.words[o.length-1];0!=(i=26-this._countBits(s))&&(o=o.ushln(i),n.iushln(i),s=0|o.words[o.length-1]);var a,l=n.length-o.length;if("mod"!==e){(a=new r(null)).length=l+1,a.words=new Array(a.length);for(var d=0;d<a.length;d++)a.words[d]=0}var c=n.clone()._ishlnsubmul(o,1,l);0===c.negative&&(n=c,a&&(a.words[l]=1));for(var h=l-1;h>=0;h--){var u=67108864*(0|n.words[o.length+h])+(0|n.words[o.length+h-1]);for(u=Math.min(u/s|0,67108863),n._ishlnsubmul(o,u,h);0!==n.negative;)u--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=u)}return a&&a.strip(),n.strip(),"div"!==e&&0!==i&&n.iushrn(i),{div:a||null,mod:n}},r.prototype.divmod=function(t,e,i){return this.isZero()?{div:new r(0),mod:new r(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(o=s.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new r(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new r(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new r(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,s},r.prototype.div=function(t){return this.divmod(t,"div",!1).div},r.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},r.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},r.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),o=i.cmp(r);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},r.prototype.modn=function(t){for(var e=(1<<26)%t,i=0,r=this.length-1;r>=0;r--)i=(e*i+(0|this.words[r]))%t;return i},r.prototype.idivn=function(t){for(var e=0,i=this.length-1;i>=0;i--){var r=(0|this.words[i])+67108864*e;this.words[i]=r/t|0,e=r%t}return this.strip()},r.prototype.divn=function(t){return this.clone().idivn(t)},r.prototype.egcd=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new r(1),o=new r(0),s=new r(0),a=new r(1),l=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++l;for(var d=i.clone(),c=e.clone();!e.isZero();){for(var h=0,u=1;0==(e.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(d),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,f=1;0==(i.words[0]&f)&&p<26;++p,f<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(s.isOdd()||a.isOdd())&&(s.iadd(d),a.isub(c)),s.iushrn(1),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(s),o.isub(a)):(i.isub(e),s.isub(n),a.isub(o))}return{a:s,b:a,gcd:i.iushln(l)}},r.prototype._invmp=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new r(1),s=new r(0),a=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(a),o.iushrn(1);for(var c=0,h=1;0==(i.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(i.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(a),s.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(s)):(i.isub(e),s.isub(o))}return(n=0===e.cmpn(1)?o:s).cmpn(0)<0&&n.iadd(t),n},r.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var o=e;e=i,i=o}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},r.prototype.invm=function(t){return this.egcd(t).a.umod(t)},r.prototype.isEven=function(){return 0==(1&this.words[0])},r.prototype.isOdd=function(){return 1==(1&this.words[0])},r.prototype.andln=function(t){return this.words[0]&t},r.prototype.bincn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=r,this;for(var n=r,o=i;0!==n&&o<this.length;o++){var s=0|this.words[o];n=(s+=n)>>>26,s&=67108863,this.words[o]=s}return 0!==n&&(this.words[o]=n,this.length++),this},r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},r.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t);var r=0|this.words[0];e=r===t?0:r<t?-1:1}return 0!==this.negative?0|-e:e},r.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},r.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){r<n?e=-1:r>n&&(e=1);break}}return e},r.prototype.gtn=function(t){return 1===this.cmpn(t)},r.prototype.gt=function(t){return 1===this.cmp(t)},r.prototype.gten=function(t){return this.cmpn(t)>=0},r.prototype.gte=function(t){return this.cmp(t)>=0},r.prototype.ltn=function(t){return-1===this.cmpn(t)},r.prototype.lt=function(t){return-1===this.cmp(t)},r.prototype.lten=function(t){return this.cmpn(t)<=0},r.prototype.lte=function(t){return this.cmp(t)<=0},r.prototype.eqn=function(t){return 0===this.cmpn(t)},r.prototype.eq=function(t){return 0===this.cmp(t)},r.red=function(t){return new w(t)},r.prototype.toRed=function(t){return t.convertTo(this)._forceRed(t)},r.prototype.fromRed=function(){return this.red.convertFrom(this)},r.prototype._forceRed=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return this._forceRed(t)},r.prototype.redAdd=function(t){return this.red.add(this,t)},r.prototype.redIAdd=function(t){return this.red.iadd(this,t)},r.prototype.redSub=function(t){return this.red.sub(this,t)},r.prototype.redISub=function(t){return this.red.isub(this,t)},r.prototype.redShl=function(t){return this.red.shl(this,t)},r.prototype.redMul=function(t){return this.red._verify2(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return this.red._verify2(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(t){return this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new r(e,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function y(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=r._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function x(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new r(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},i(b,g),b.prototype.split=function(t,e){for(var i=Math.min(t.length,9),r=0;r<i;r++)e.words[r]=t.words[r];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(e.words[e.length++]=4194303&n,r=10;r<t.length;r++){var o=0|t.words[r];t.words[r-10]=(4194303&o)<<4|n>>>22,n=o}n>>>=22,t.words[r-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i<t.length;i++){var r=0|t.words[i];e+=977*r,t.words[i]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(v,g),i(y,g),i(_,g),_.prototype.imulK=function(t){for(var e=0,i=0;i<t.length;i++){var r=19*(0|t.words[i])+e,n=67108863&r;r>>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},r._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new v;else if("p192"===t)e=new y;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return m[t]=e,e},w.prototype._verify1=function(t){},w.prototype._verify2=function(t,e){},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},w.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();if(3===this.m.andln(3)){var e=this.m.add(new r(1)).iushrn(2);return this.pow(t,e)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);var o=new r(1).toRed(this),s=o.redNeg(),a=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new r(2*l*l).toRed(this);0!==this.pow(l,a).cmp(s);)l.redIAdd(s);for(var d=this.pow(l,i),c=this.pow(t,i.addn(1).iushrn(1)),h=this.pow(t,i),u=n;0!==h.cmp(o);){for(var p=h,f=0;0!==p.cmp(o);f++)p=p.redSqr();var m=this.pow(d,new r(1).iushln(u-f-1));c=c.redMul(m),d=m.redSqr(),h=h.redMul(d),u=f}return c},w.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},w.prototype.pow=function(t,e){if(e.isZero())return new r(1).toRed(this);if(0===e.cmpn(1))return t.clone();var i=new Array(16);i[0]=new r(1).toRed(this),i[1]=t;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],t);var o=i[0],s=0,a=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var d=e.words[n],c=l-1;c>=0;c--){var h=d>>c&1;o!==i[0]&&(o=this.sqr(o)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===n&&0===c)&&(o=this.mul(o,i[s]),a=0,s=0)):a=0}l=26}return o},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},r.mont=function(t){return new x(t)},i(x,w),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0)._forceRed(this);var i=t.mul(e),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(ra,this),ra=ra.exports;var na={};(function(t){(function(){var e,i=d({}),r=i.Buffer,n={};for(e in i)i.hasOwnProperty(e)&&"SlowBuffer"!==e&&"Buffer"!==e&&(n[e]=i[e]);var o=n.Buffer={};for(e in r)r.hasOwnProperty(e)&&"allocUnsafe"!==e&&"allocUnsafeSlow"!==e&&(o[e]=r[e]);if(n.Buffer.prototype=r.prototype,o.from&&o.from!==Uint8Array.from||(o.from=function(t,e,i){if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof t);if(t&&void 0===t.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);return r(t,e,i)}),o.alloc||(o.alloc=function(t,e,i){if("number"!=typeof t)throw new TypeError('The "size" argument must be of type number. Received type '+typeof t);if(t<0||t>=2*(1<<30))throw new RangeError('The value "'+t+'" is invalid for option "size"');var n=r(t);return e&&0!==e.length?"string"==typeof i?n.fill(e,i):n.fill(e):n.fill(0),n}),!n.kStringMaxLength)try{n.kStringMaxLength=t.binding("buffer").kStringMaxLength}catch(t){}n.constants||(n.constants={MAX_LENGTH:n.kMaxLength},n.kStringMaxLength&&(n.constants.MAX_STRING_LENGTH=n.kStringMaxLength)),na=n}).call(this)}).call(this,E);var oa={};function sa(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function aa(t,e){this.path=t,this.rethrow(e)}oa.Reporter=sa,sa.prototype.isError=function(t){return t instanceof aa},sa.prototype.save=function(){const t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},sa.prototype.restore=function(t){const e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},sa.prototype.enterKey=function(t){return this._reporterState.path.push(t)},sa.prototype.exitKey=function(t){const e=this._reporterState;e.path=e.path.slice(0,t-1)},sa.prototype.leaveKey=function(t,e,i){const r=this._reporterState;this.exitKey(t),null!==r.obj&&(r.obj[e]=i)},sa.prototype.path=function(){return this._reporterState.path.join("/")},sa.prototype.enterObject=function(){const t=this._reporterState,e=t.obj;return t.obj={},e},sa.prototype.leaveObject=function(t){const e=this._reporterState,i=e.obj;return e.obj=t,i},sa.prototype.error=function(t){let e;const i=this._reporterState,r=t instanceof aa;if(e=r?t:new aa(i.path.map((function(t){return"["+JSON.stringify(t)+"]"})).join(""),t.message||t,t.stack),!i.options.partial)throw e;return r||i.errors.push(e),e},sa.prototype.wrapResult=function(t){const e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},F(aa,Error),aa.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,aa),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this};var la={};const da=oa.Reporter,ca=na.Buffer;function ha(t,e){da.call(this,e),ca.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error("Input not Buffer")}function ua(t,e){if(Array.isArray(t))this.length=0,this.value=t.map((function(t){return ua.isEncoderBuffer(t)||(t=new ua(t,e)),this.length+=t.length,t}),this);else if("number"==typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"==typeof t)this.value=t,this.length=ca.byteLength(t);else{if(!ca.isBuffer(t))return e.error("Unsupported type: "+typeof t);this.value=t,this.length=t.length}}F(ha,da),la.DecoderBuffer=ha,ha.isDecoderBuffer=function(t){return t instanceof ha||"object"==typeof t&&ca.isBuffer(t.base)&&"DecoderBuffer"===t.constructor.name&&"number"==typeof t.offset&&"number"==typeof t.length&&"function"==typeof t.save&&"function"==typeof t.restore&&"function"==typeof t.isEmpty&&"function"==typeof t.readUInt8&&"function"==typeof t.skip&&"function"==typeof t.raw},ha.prototype.save=function(){return{offset:this.offset,reporter:da.prototype.save.call(this)}},ha.prototype.restore=function(t){const e=new ha(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,da.prototype.restore.call(this,t.reporter),e},ha.prototype.isEmpty=function(){return this.offset===this.length},ha.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},ha.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");const i=new ha(this.base);return i._reporterState=this._reporterState,i.offset=this.offset,i.length=this.offset+t,this.offset+=t,i},ha.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},la.EncoderBuffer=ua,ua.isEncoderBuffer=function(t){return t instanceof ua||"object"==typeof t&&"EncoderBuffer"===t.constructor.name&&"number"==typeof t.length&&"function"==typeof t.join},ua.prototype.join=function(t,e){return t||(t=ca.alloc(this.length)),e||(e=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(i){i.join(t,e),e+=i.length})):("number"==typeof this.value?t[e]=this.value:"string"==typeof this.value?t.write(this.value,e):ca.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length)),t};const pa=oa.Reporter,fa=la.EncoderBuffer,ma=la.DecoderBuffer,ga=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],ba=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(ga);function va(t,e,i){const r={};this._baseState=r,r.name=i,r.enc=t,r.parent=e||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}var ya=va;const _a=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];va.prototype.clone=function(){const t=this._baseState,e={};_a.forEach((function(i){e[i]=t[i]}));const i=new this.constructor(e.parent);return i._baseState=e,i},va.prototype._wrap=function(){const t=this._baseState;ba.forEach((function(e){this[e]=function(){const i=new this.constructor(this);return t.children.push(i),i[e].apply(i,arguments)}}),this)},va.prototype._init=function(t){const e=this._baseState;t.call(this),e.children=e.children.filter((function(t){return t._baseState.parent===this}),this)},va.prototype._useArgs=function(t){const e=this._baseState,i=t.filter((function(t){return t instanceof this.constructor}),this);t=t.filter((function(t){return!(t instanceof this.constructor)}),this),0!==i.length&&(e.children=i,i.forEach((function(t){t._baseState.parent=this}),this)),0!==t.length&&(e.args=t,e.reverseArgs=t.map((function(t){if("object"!=typeof t||t.constructor!==Object)return t;const e={};return Object.keys(t).forEach((function(i){i==(0|i)&&(i|=0);const r=t[i];e[r]=i})),e})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(t){va.prototype[t]=function(){const e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}})),ga.forEach((function(t){va.prototype[t]=function(){const e=this._baseState,i=Array.prototype.slice.call(arguments);return e.tag=t,this._useArgs(i),this}})),va.prototype.use=function(t){return this._baseState.use=t,this},va.prototype.optional=function(){return this._baseState.optional=!0,this},va.prototype.def=function(t){const e=this._baseState;return e.default=t,e.optional=!0,this},va.prototype.explicit=function(t){return this._baseState.explicit=t,this},va.prototype.implicit=function(t){return this._baseState.implicit=t,this},va.prototype.obj=function(){const t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},va.prototype.key=function(t){return this._baseState.key=t,this},va.prototype.any=function(){return this._baseState.any=!0,this},va.prototype.choice=function(t){return this._baseState.choice=t,this._useArgs(Object.keys(t).map((function(e){return t[e]}))),this},va.prototype.contains=function(t){return this._baseState.contains=t,this},va.prototype._decode=function(t,e){const i=this._baseState;if(null===i.parent)return t.wrapResult(i.children[0]._decode(t,e));let r,n=i.default,o=!0,s=null;if(null!==i.key&&(s=t.enterKey(i.key)),i.optional){let r=null;if(null!==i.explicit?r=i.explicit:null!==i.implicit?r=i.implicit:null!==i.tag&&(r=i.tag),null!==r||i.any){if(o=this._peekTag(t,r,i.any),t.isError(o))return o}else{const r=t.save();try{null===i.choice?this._decodeGeneric(i.tag,t,e):this._decodeChoice(t,e),o=!0}catch(t){o=!1}t.restore(r)}}if(i.obj&&o&&(r=t.enterObject()),o){if(null!==i.explicit){const e=this._decodeTag(t,i.explicit);if(t.isError(e))return e;t=e}const r=t.offset;if(null===i.use&&null===i.choice){let e;i.any&&(e=t.save());const r=this._decodeTag(t,null!==i.implicit?i.implicit:i.tag,i.any);if(t.isError(r))return r;i.any?n=t.raw(e):t=r}if(e&&e.track&&null!==i.tag&&e.track(t.path(),r,t.length,"tagged"),e&&e.track&&null!==i.tag&&e.track(t.path(),t.offset,t.length,"content"),i.any||(n=null===i.choice?this._decodeGeneric(i.tag,t,e):this._decodeChoice(t,e)),t.isError(n))return n;if(i.any||null!==i.choice||null===i.children||i.children.forEach((function(i){i._decode(t,e)})),i.contains&&("octstr"===i.tag||"bitstr"===i.tag)){const r=new ma(n);n=this._getUse(i.contains,t._reporterState.obj)._decode(r,e)}}return i.obj&&o&&(n=t.leaveObject(r)),null===i.key||null===n&&!0!==o?null!==s&&t.exitKey(s):t.leaveKey(s,i.key,n),n},va.prototype._decodeGeneric=function(t,e,i){const r=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,r.args[0],i):/str$/.test(t)?this._decodeStr(e,t,i):"objid"===t&&r.args?this._decodeObjid(e,r.args[0],r.args[1],i):"objid"===t?this._decodeObjid(e,null,null,i):"gentime"===t||"utctime"===t?this._decodeTime(e,t,i):"null_"===t?this._decodeNull(e,i):"bool"===t?this._decodeBool(e,i):"objDesc"===t?this._decodeStr(e,t,i):"int"===t||"enum"===t?this._decodeInt(e,r.args&&r.args[0],i):null!==r.use?this._getUse(r.use,e._reporterState.obj)._decode(e,i):e.error("unknown tag: "+t)},va.prototype._getUse=function(t,e){const i=this._baseState;return i.useDecoder=this._use(t,e),i.useDecoder=i.useDecoder._baseState.children[0],i.implicit!==i.useDecoder._baseState.implicit&&(i.useDecoder=i.useDecoder.clone(),i.useDecoder._baseState.implicit=i.implicit),i.useDecoder},va.prototype._decodeChoice=function(t,e){const i=this._baseState;let r=null,n=!1;return Object.keys(i.choice).some((function(o){const s=t.save(),a=i.choice[o];try{const i=a._decode(t,e);if(t.isError(i))return!1;r={type:o,value:i},n=!0}catch(e){return t.restore(s),!1}return!0}),this),n?r:t.error("Choice not matched")},va.prototype._createEncoderBuffer=function(t){return new fa(t,this.reporter)},va.prototype._encode=function(t,e,i){const r=this._baseState;if(null!==r.default&&r.default===t)return;const n=this._encodeValue(t,e,i);return void 0===n||this._skipDefault(n,e,i)?void 0:n},va.prototype._encodeValue=function(t,e,i){const r=this._baseState;if(null===r.parent)return r.children[0]._encode(t,e||new pa);let n=null;if(this.reporter=e,r.optional&&void 0===t){if(null===r.default)return;t=r.default}let o=null,s=!1;if(r.any)n=this._createEncoderBuffer(t);else if(r.choice)n=this._encodeChoice(t,e);else if(r.contains)o=this._getUse(r.contains,i)._encode(t,e),s=!0;else if(r.children)o=r.children.map((function(i){if("null_"===i._baseState.tag)return i._encode(null,e,t);if(null===i._baseState.key)return e.error("Child should have a key");const r=e.enterKey(i._baseState.key);if("object"!=typeof t)return e.error("Child expected, but input is not object");const n=i._encode(t[i._baseState.key],e,t);return e.leaveKey(r),n}),this).filter((function(t){return t})),o=this._createEncoderBuffer(o);else if("seqof"===r.tag||"setof"===r.tag){if(!r.args||1!==r.args.length)return e.error("Too many args for : "+r.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");const i=this.clone();i._baseState.implicit=null,o=this._createEncoderBuffer(t.map((function(i){const r=this._baseState;return this._getUse(r.args[0],t)._encode(i,e)}),i))}else null!==r.use?n=this._getUse(r.use,i)._encode(t,e):(o=this._encodePrimitive(r.tag,t),s=!0);if(!r.any&&null===r.choice){const t=null!==r.implicit?r.implicit:r.tag,i=null===r.implicit?"universal":"context";null===t?null===r.use&&e.error("Tag could be omitted only for .use()"):null===r.use&&(n=this._encodeComposite(t,s,i,o))}return null!==r.explicit&&(n=this._encodeComposite(r.explicit,!1,"context",n)),n},va.prototype._encodeChoice=function(t,e){return this._baseState.choice[t.type]._encode(t.value,e)},va.prototype._encodePrimitive=function(t,e){const i=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&i.args)return this._encodeObjid(e,i.reverseArgs[0],i.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,i.args&&i.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},va.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},va.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(t)};var wa={};function xa(t){const e={};return Object.keys(t).forEach((function(i){(0|i)==i&&(i|=0);const r=t[i];e[r]=i})),e}wa.tagClass={0:"universal",1:"application",2:"context",3:"private"},wa.tagClassByName=xa(wa.tagClass),wa.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},wa.tagByName=xa(wa.tag);var Ma={};const ka=na.Buffer;function Sa(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new Ea,this.tree._init(t.body)}function Ea(t){ya.call(this,"der",t)}function Aa(t){return t<10?"0"+t:t}var Ta;function Ia(t){Ma.call(this,t),this.enc="pem"}Ma=Sa,Sa.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},F(Ea,ya),Ea.prototype._encodeComposite=function(t,e,i,r){const n=function(t,e,i,r){let n;if("seqof"===t?t="seq":"setof"===t&&(t="set"),wa.tagByName.hasOwnProperty(t))n=wa.tagByName[t];else{if("number"!=typeof t||(0|t)!==t)return r.error("Unknown tag: "+t);n=t}return n>=31?r.error("Multi-octet tag encoding unsupported"):(e||(n|=32),n|wa.tagClassByName[i||"universal"]<<6)}(t,e,i,this.reporter);if(r.length<128){const t=ka.alloc(2);return t[0]=n,t[1]=r.length,this._createEncoderBuffer([t,r])}let o=1;for(let t=r.length;t>=256;t>>=8)o++;const s=ka.alloc(2+o);s[0]=n,s[1]=128|o;for(let t=1+o,e=r.length;e>0;t--,e>>=8)s[t]=255&e;return this._createEncoderBuffer([s,r])},Ea.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){const e=ka.alloc(2*t.length);for(let i=0;i<t.length;i++)e.writeUInt16BE(t.charCodeAt(i),2*i);return this._createEncoderBuffer(e)}return"numstr"===e?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===e?this._isPrintstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(e)||"objDesc"===e?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: "+e+" unsupported")},Ea.prototype._encodeObjid=function(t,e,i){if("string"==typeof t){if(!e)return this.reporter.error("string objid given, but no values map found");if(!e.hasOwnProperty(t))return this.reporter.error("objid not found in values map");t=e[t].split(/[\s.]+/g);for(let e=0;e<t.length;e++)t[e]|=0}else if(Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]|=0}if(!Array.isArray(t))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(t));if(!i){if(t[1]>=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}let r=0;for(let e=0;e<t.length;e++){let i=t[e];for(r++;i>=128;i>>=7)r++}const n=ka.alloc(r);let o=n.length-1;for(let e=t.length-1;e>=0;e--){let i=t[e];for(n[o--]=127&i;(i>>=7)>0;)n[o--]=128|127&i}return this._createEncoderBuffer(n)},Ea.prototype._encodeTime=function(t,e){let i;const r=new Date(t);return"gentime"===e?i=[Aa(r.getUTCFullYear()),Aa(r.getUTCMonth()+1),Aa(r.getUTCDate()),Aa(r.getUTCHours()),Aa(r.getUTCMinutes()),Aa(r.getUTCSeconds()),"Z"].join(""):"utctime"===e?i=[Aa(r.getUTCFullYear()%100),Aa(r.getUTCMonth()+1),Aa(r.getUTCDate()),Aa(r.getUTCHours()),Aa(r.getUTCMinutes()),Aa(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(i,"octstr")},Ea.prototype._encodeNull=function(){return this._createEncoderBuffer("")},Ea.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!ka.isBuffer(t)){const e=t.toArray();!t.sign&&128&e[0]&&e.unshift(0),t=ka.from(e)}if(ka.isBuffer(t)){let e=t.length;0===t.length&&e++;const i=ka.alloc(e);return t.copy(i),0===t.length&&(i[0]=0),this._createEncoderBuffer(i)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);let i=1;for(let e=t;e>=256;e>>=8)i++;const r=new Array(i);for(let e=r.length-1;e>=0;e--)r[e]=255&t,t>>=8;return 128&r[0]&&r.unshift(0),this._createEncoderBuffer(ka.from(r))},Ea.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},Ea.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},Ea.prototype._skipDefault=function(t,e,i){const r=this._baseState;let n;if(null===r.default)return!1;const o=t.join();if(void 0===r.defaultBuffer&&(r.defaultBuffer=this._encodeValue(r.default,e,i).join()),o.length!==r.defaultBuffer.length)return!1;for(n=0;n<o.length;n++)if(o[n]!==r.defaultBuffer[n])return!1;return!0},F(Ia,Ma),Ta=Ia,Ia.prototype.encode=function(t,e){const i=Ma.prototype.encode.call(this,t).toString("base64"),r=["-----BEGIN "+e.label+"-----"];for(let t=0;t<i.length;t+=64)r.push(i.slice(t,t+64));return r.push("-----END "+e.label+"-----"),r.join("\n")};var Ca={};const Ra=Ca;Ra.der=Ma,Ra.pem=Ta;var Oa={};const La=la.DecoderBuffer;function Pa(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new Ba,this.tree._init(t.body)}function Ba(t){ya.call(this,"der",t)}function Na(t,e){let i=t.readUInt8(e);if(t.isError(i))return i;const r=wa.tagClass[i>>6],n=0==(32&i);if(31==(31&i)){let r=i;for(i=0;128==(128&r);){if(r=t.readUInt8(e),t.isError(r))return r;i<<=7,i|=127&r}}else i&=31;return{cls:r,primitive:n,tag:i,tagStr:wa.tag[i]}}function $a(t,e,i){let r=t.readUInt8(i);if(t.isError(r))return r;if(!e&&128===r)return null;if(0==(128&r))return r;const n=127&r;if(n>4)return t.error("length octect is too long");r=0;for(let e=0;e<n;e++){r<<=8;const e=t.readUInt8(i);if(t.isError(e))return e;r|=e}return r}var za;Oa=Pa,Pa.prototype.decode=function(t,e){return La.isDecoderBuffer(t)||(t=new La(t,e)),this.tree._decode(t,e)},F(Ba,ya),Ba.prototype._peekTag=function(t,e,i){if(t.isEmpty())return!1;const r=t.save(),n=Na(t,'Failed to peek tag: "'+e+'"');return t.isError(n)?n:(t.restore(r),n.tag===e||n.tagStr===e||n.tagStr+"of"===e||i)},Ba.prototype._decodeTag=function(t,e,i){const r=Na(t,'Failed to decode tag of "'+e+'"');if(t.isError(r))return r;let n=$a(t,r.primitive,'Failed to get length of "'+e+'"');if(t.isError(n))return n;if(!i&&r.tag!==e&&r.tagStr!==e&&r.tagStr+"of"!==e)return t.error('Failed to match tag: "'+e+'"');if(r.primitive||null!==n)return t.skip(n,'Failed to match body of: "'+e+'"');const o=t.save(),s=this._skipUntilEnd(t,'Failed to skip indefinite length body: "'+this.tag+'"');return t.isError(s)?s:(n=t.offset-o.offset,t.restore(o),t.skip(n,'Failed to match body of: "'+e+'"'))},Ba.prototype._skipUntilEnd=function(t,e){for(;;){const i=Na(t,e);if(t.isError(i))return i;const r=$a(t,i.primitive,e);if(t.isError(r))return r;let n;if(n=i.primitive||null!==r?t.skip(r):this._skipUntilEnd(t,e),t.isError(n))return n;if("end"===i.tagStr)break}},Ba.prototype._decodeList=function(t,e,i,r){const n=[];for(;!t.isEmpty();){const e=this._peekTag(t,"end");if(t.isError(e))return e;const o=i.decode(t,"der",r);if(t.isError(o)&&e)break;n.push(o)}return n},Ba.prototype._decodeStr=function(t,e){if("bitstr"===e){const e=t.readUInt8();return t.isError(e)?e:{unused:e,data:t.raw()}}if("bmpstr"===e){const e=t.raw();if(e.length%2==1)return t.error("Decoding of string type: bmpstr length mismatch");let i="";for(let t=0;t<e.length/2;t++)i+=String.fromCharCode(e.readUInt16BE(2*t));return i}if("numstr"===e){const e=t.raw().toString("ascii");return this._isNumstr(e)?e:t.error("Decoding of string type: numstr unsupported characters")}if("octstr"===e)return t.raw();if("objDesc"===e)return t.raw();if("printstr"===e){const e=t.raw().toString("ascii");return this._isPrintstr(e)?e:t.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(e)?t.raw().toString():t.error("Decoding of string type: "+e+" unsupported")},Ba.prototype._decodeObjid=function(t,e,i){let r;const n=[];let o=0,s=0;for(;!t.isEmpty();)o<<=7,o|=127&(s=t.readUInt8()),0==(128&s)&&(n.push(o),o=0);128&s&&n.push(o);const a=n[0]/40|0,l=n[0]%40;if(r=i?n:[a,l].concat(n.slice(1)),e){let t=e[r.join(" ")];void 0===t&&(t=e[r.join(".")]),void 0!==t&&(r=t)}return r},Ba.prototype._decodeTime=function(t,e){const i=t.raw().toString();let r,n,o,s,a,l;if("gentime"===e)r=0|i.slice(0,4),n=0|i.slice(4,6),o=0|i.slice(6,8),s=0|i.slice(8,10),a=0|i.slice(10,12),l=0|i.slice(12,14);else{if("utctime"!==e)return t.error("Decoding "+e+" time is not supported yet");r=0|i.slice(0,2),n=0|i.slice(2,4),o=0|i.slice(4,6),s=0|i.slice(6,8),a=0|i.slice(8,10),l=0|i.slice(10,12),r=r<70?2e3+r:1900+r}return Date.UTC(r,n-1,o,s,a,l,0)},Ba.prototype._decodeNull=function(){return null},Ba.prototype._decodeBool=function(t){const e=t.readUInt8();return t.isError(e)?e:0!==e},Ba.prototype._decodeInt=function(t,e){const i=t.raw();let r=new ra(i);return e&&(r=e[r.toString(10)]||r),r},Ba.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getDecoder("der").tree};const ja=na.Buffer;function Fa(t){Oa.call(this,t),this.enc="pem"}F(Fa,Oa),za=Fa,Fa.prototype.decode=function(t,e){const i=t.toString().split(/[\r\n]+/g),r=e.label.toUpperCase(),n=/^-----(BEGIN|END) ([^-]+)-----$/;let o=-1,s=-1;for(let t=0;t<i.length;t++){const e=i[t].match(n);if(null!==e&&e[2]===r){if(-1!==o){if("END"!==e[1])break;s=t;break}if("BEGIN"!==e[1])break;o=t}}if(-1===o||-1===s)throw new Error("PEM section not found for: "+r);const a=i.slice(o+1,s).join("");a.replace(/[^a-z0-9+/=]+/gi,"");const l=ja.from(a,"base64");return Oa.prototype.decode.call(this,l,e)};var Da={};const qa=Da;qa.der=Oa,qa.pem=za;var Ua={};function Ha(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}Ua.define=function(t,e){return new Ha(t,e)},Ha.prototype._createNamed=function(t){const e=this.name;function i(t){this._initNamed(t,e)}return F(i,t),i.prototype._initNamed=function(e,i){t.call(this,e,i)},new i(this)},Ha.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(Da[t])),this.decoders[t]},Ha.prototype.decode=function(t,e,i){return this._getDecoder(e).decode(t,i)},Ha.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(Ca[t])),this.encoders[t]},Ha.prototype.encode=function(t,e,i){return this._getEncoder(e).encode(t,i)};var Va={};const Wa=Va;Wa.Reporter=oa.Reporter,Wa.DecoderBuffer=la.DecoderBuffer,Wa.EncoderBuffer=la.EncoderBuffer,Wa.Node=ya;var Ga={};const Ka=Ga;Ka._reverse=function(t){const e={};return Object.keys(t).forEach((function(i){(0|i)==i&&(i|=0);const r=t[i];e[r]=i})),e},Ka.der=wa;var Xa={};const Za=Xa;Za.bignum=ra,Za.define=Ua.define,Za.base=Va,Za.constants=Ga,Za.decoders=Da,Za.encoders=Ca;var Ya=Xa.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),Ja=Xa.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),Qa=Xa.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),tl=Xa.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(Qa),this.key("subjectPublicKey").bitstr())})),el=Xa.define("RelativeDistinguishedName",(function(){this.setof(Ja)})),il=Xa.define("RDNSequence",(function(){this.seqof(el)})),rl=Xa.define("Name",(function(){this.choice({rdnSequence:this.use(il)})})),nl=Xa.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(Ya),this.key("notAfter").use(Ya))})),ol=Xa.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),sl=Xa.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(Qa),this.key("issuer").use(rl),this.key("validity").use(nl),this.key("subject").use(rl),this.key("subjectPublicKeyInfo").use(tl),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(ol).optional())})),al=Xa.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(sl),this.key("signatureAlgorithm").use(Qa),this.key("signatureValue").bitstr())})),ll={};ll.certificate=al;var dl=Xa.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));ll.RSAPrivateKey=dl;var cl=Xa.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));ll.RSAPublicKey=cl;var hl=Xa.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(ul),this.key("subjectPublicKey").bitstr())}));ll.PublicKey=hl;var ul=Xa.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),pl=Xa.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(ul),this.key("subjectPrivateKey").octstr())}));ll.PrivateKey=pl;var fl=Xa.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));ll.EncryptedPrivateKey=fl;var ml=Xa.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));ll.DSAPrivateKey=ml,ll.DSAparam=Xa.define("DSAparam",(function(){this.int()}));var gl=Xa.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(bl),this.key("publicKey").optional().explicit(1).bitstr())}));ll.ECPrivateKey=gl;var bl=Xa.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));ll.signature=Xa.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}));var vl={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"},yl=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,_l=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,wl=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,xl=y.Buffer,Ml={},kl=y.Buffer;function Sl(t){var e;"object"!=typeof t||kl.isBuffer(t)||(e=t.passphrase,t=t.key),"string"==typeof t&&(t=kl.from(t));var i,r,n=function(t,e){var i,r=t.toString(),n=r.match(yl);if(n){var o="aes"+n[1],s=xl.from(n[2],"hex"),a=xl.from(n[3].replace(/[\r\n]/g,""),"base64"),l=function(t,e,i,r){if(Wr.isBuffer(t)||(t=Wr.from(t,"binary")),e&&(Wr.isBuffer(e)||(e=Wr.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var n=i/8,o=Wr.alloc(n),s=Wr.alloc(r||0),a=Wr.alloc(0);n>0||r>0;){var l=new qt;l.update(a),l.update(t),e&&l.update(e),a=l.digest();var d=0;if(n>0){var c=o.length-n;d=Math.min(n,a.length),a.copy(o,c,0,d),n-=d}if(d<a.length&&r>0){var h=s.length-r,u=Math.min(r,a.length-d);a.copy(s,h,d,d+u),r-=u}}return a.fill(0),{key:o,iv:s}}(e,s.slice(0,8),parseInt(n[1],10)).key,d=[],c=tn.createDecipheriv(o,l,s);d.push(c.update(a)),d.push(c.final()),i=xl.concat(d)}else{var h=r.match(wl);i=xl.from(h[2].replace(/[\r\n]/g,""),"base64")}return{tag:r.match(_l)[1],data:i}}(t,e),o=n.tag,s=n.data;switch(o){case"CERTIFICATE":r=ll.certificate.decode(s,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(r||(r=ll.PublicKey.decode(s,"der")),i=r.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return ll.RSAPublicKey.decode(r.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return r.subjectPrivateKey=r.subjectPublicKey,{type:"ec",data:r};case"1.2.840.10040.4.1":return r.algorithm.params.pub_key=ll.DSAparam.decode(r.subjectPublicKey.data,"der"),{type:"dsa",data:r.algorithm.params};default:throw new Error("unknown key id "+i)}case"ENCRYPTED PRIVATE KEY":s=function(t,e){var i=t.algorithm.decrypt.kde.kdeparams.salt,r=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),n=vl[t.algorithm.decrypt.cipher.algo.join(".")],o=t.algorithm.decrypt.cipher.iv,s=t.subjectPrivateKey,a=parseInt(n.split("-")[1],10)/8,l=Fi.pbkdf2Sync(e,i,r,a,"sha1"),d=tn.createDecipheriv(n,l,o),c=[];return c.push(d.update(s)),c.push(d.final()),kl.concat(c)}(s=ll.EncryptedPrivateKey.decode(s,"der"),e);case"PRIVATE KEY":switch(i=(r=ll.PrivateKey.decode(s,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return ll.RSAPrivateKey.decode(r.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:r.algorithm.curve,privateKey:ll.ECPrivateKey.decode(r.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return r.algorithm.params.priv_key=ll.DSAparam.decode(r.subjectPrivateKey,"der"),{type:"dsa",params:r.algorithm.params};default:throw new Error("unknown key id "+i)}case"RSA PUBLIC KEY":return ll.RSAPublicKey.decode(s,"der");case"RSA PRIVATE KEY":return ll.RSAPrivateKey.decode(s,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:ll.DSAPrivateKey.decode(s,"der")};case"EC PRIVATE KEY":return{curve:(s=ll.ECPrivateKey.decode(s,"der")).parameters.value,privateKey:s.privateKey};default:throw new Error("unknown key type "+o)}}Ml=Sl,Sl.signature=ll.signature;var El,Al={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"},Tl=y.Buffer,Il=ta.ec;function Cl(t,e,i,r){if((t=Tl.from(t.toArray())).length<e.byteLength()){var n=Tl.alloc(e.byteLength()-t.length);t=Tl.concat([n,t])}var o=i.length,s=function(t,e){t=(t=Rl(t,e)).mod(e);var i=Tl.from(t.toArray());if(i.length<e.byteLength()){var r=Tl.alloc(e.byteLength()-i.length);i=Tl.concat([r,i])}return i}(i,e),a=Tl.alloc(o);a.fill(1);var l=Tl.alloc(o);return l=Si(r,l).update(a).update(Tl.from([0])).update(t).update(s).digest(),a=Si(r,l).update(a).digest(),{k:l=Si(r,l).update(a).update(Tl.from([1])).update(t).update(s).digest(),v:a=Si(r,l).update(a).digest()}}function Rl(t,e){var i=new ia(t),r=(t.length<<3)-e.bitLength();return r>0&&i.ishrn(r),i}function Ol(t,e,i){var r,n;do{for(r=Tl.alloc(0);8*r.length<t.bitLength();)e.v=Si(i,e.k).update(e.v).digest(),r=Tl.concat([r,e.v]);n=Rl(r,t),e.k=Si(i,e.k).update(e.v).update(Tl.from([0])).digest(),e.v=Si(i,e.k).update(e.v).digest()}while(-1!==n.cmp(t));return n}function Ll(t,e,i,r){return t.toRed(ia.mont(i)).redPow(e).fromRed().mod(r)}(El=function(t,e,i,r,n){var o=Ml(e);if(o.curve){if("ecdsa"!==r&&"ecdsa/rsa"!==r)throw new Error("wrong private key type");return function(t,e){var i=Al[e.curve.join(".")];if(!i)throw new Error("unknown curve "+e.curve.join("."));var r=new Il(i).keyFromPrivate(e.privateKey).sign(t);return Tl.from(r.toDER())}(t,o)}if("dsa"===o.type){if("dsa"!==r)throw new Error("wrong private key type");return function(t,e,i){for(var r,n=e.params.priv_key,o=e.params.p,s=e.params.q,a=e.params.g,l=new ia(0),d=Rl(t,s).mod(s),c=!1,h=Cl(n,s,t,i);!1===c;)l=Ll(a,r=Ol(s,h,i),o,s),0===(c=r.invm(s).imul(d.add(n.mul(l))).mod(s)).cmpn(0)&&(c=!1,l=new ia(0));return function(t,e){t=t.toArray(),e=e.toArray(),128&t[0]&&(t=[0].concat(t)),128&e[0]&&(e=[0].concat(e));var i=[48,t.length+e.length+4,2,t.length];return i=i.concat(t,[2,e.length],e),Tl.from(i)}(l,c)}(t,o,i)}if("rsa"!==r&&"ecdsa/rsa"!==r)throw new Error("wrong private key type");t=Tl.concat([n,t]);for(var s=o.modulus.byteLength(),a=[0,1];t.length+a.length+1<s;)a.push(255);a.push(0);for(var l=-1;++l<t.length;)a.push(t[l]);return Sn(a,o)}).getKey=Cl,El.makeKey=Ol;var Pl=y.Buffer,Bl=ta.ec;function Nl(t,e){if(t.cmpn(0)<=0)throw new Error("invalid sig");if(t.cmp(e)>=e)throw new Error("invalid sig")}var $l=y.Buffer;function zl(t){$t.Writable.call(this);var e=Ci[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=fi(e.hash),this._tag=e.id,this._signType=e.sign}function jl(t){$t.Writable.call(this);var e=Ci[t];if(!e)throw new Error("Unknown message digest");this._hash=fi(e.hash),this._tag=e.id,this._signType=e.sign}Object.keys(Ci).forEach((function(t){Ci[t].id=$l.from(Ci[t].id,"hex"),Ci[t.toLowerCase()]=Ci[t]})),F(zl,$t.Writable),zl.prototype._write=function(t,e,i){this._hash.update(t),i()},zl.prototype.update=function(t,e){return"string"==typeof t&&(t=$l.from(t,e)),this._hash.update(t),this},zl.prototype.sign=function(t,e){this.end();var i=this._hash.digest(),r=El(i,t,this._hashType,this._signType,this._tag);return e?r.toString(e):r},F(jl,$t.Writable),jl.prototype._write=function(t,e,i){this._hash.update(t),i()},jl.prototype.update=function(t,e){return"string"==typeof t&&(t=$l.from(t,e)),this._hash.update(t),this},jl.prototype.verify=function(t,e,i){return"string"==typeof e&&(e=$l.from(e,i)),this.end(),function(t,e,i,r,n){var o=Ml(i);if("ec"===o.type){if("ecdsa"!==r&&"ecdsa/rsa"!==r)throw new Error("wrong public key type");return function(t,e,i){var r=Al[i.data.algorithm.curve.join(".")];if(!r)throw new Error("unknown curve "+i.data.algorithm.curve.join("."));var n=new Bl(r),o=i.data.subjectPrivateKey.data;return n.verify(e,t,o)}(t,e,o)}if("dsa"===o.type){if("dsa"!==r)throw new Error("wrong public key type");return function(t,e,i){var r=i.data.p,n=i.data.q,o=i.data.g,s=i.data.pub_key,a=Ml.signature.decode(t,"der"),l=a.s,d=a.r;Nl(l,n),Nl(d,n);var c=ia.mont(r),h=l.invm(n);return 0===o.toRed(c).redPow(new ia(e).mul(h).mod(n)).fromRed().mul(s.toRed(c).redPow(d.mul(h).mod(n)).fromRed()).mod(r).mod(n).cmp(d)}(t,e,o)}if("rsa"!==r&&"ecdsa/rsa"!==r)throw new Error("wrong public key type");e=Pl.concat([n,e]);for(var s=o.modulus.byteLength(),a=[1],l=0;e.length+a.length+2<s;)a.push(255),l++;a.push(0);for(var d=-1;++d<e.length;)a.push(e[d]);a=Pl.from(a);var c=ia.mont(o.modulus);t=(t=new ia(t).toRed(c)).redPow(new ia(o.publicExponent)),t=Pl.from(t.fromRed().toArray());var h=l<8?1:0;for(s=Math.min(t.length,a.length),t.length!==a.length&&(h=1),d=-1;++d<s;)h|=t[d]^a[d];return 0===h}(e,this._hash.digest(),t,this._signType,this._tag)};var Fl={exports:{}};!function(t,e){function i(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function r(t,e,i){if(r.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var n;"object"==typeof t?t.exports=r:e.BN=r,r.BN=r,r.wordSize=26;try{n=l({}).Buffer}catch(t){}function o(t,e,i){for(var r=0,n=Math.min(t.length,i),o=e;o<n;o++){var s=t.charCodeAt(o)-48;r<<=4,r|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return r}function s(t,e,i,r){for(var n=0,o=Math.min(t.length,i),s=e;s<o;s++){var a=t.charCodeAt(s)-48;n*=r,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}r.isBN=function(t){return t instanceof r||null!==t&&"object"==typeof t&&t.constructor.wordSize===r.wordSize&&Array.isArray(t.words)},r.max=function(t,e){return t.cmp(e)>0?t:e},r.min=function(t,e){return t.cmp(e)<0?t:e},r.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16);var r=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&r++,16===e?this._parseHex(t,r):this._parseBase(t,e,r),"-"===t[0]&&(this.negative=1),this.strip(),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initArray=function(t,e,i){if(t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,o,s=0;if("be"===i)for(r=t.length-1,n=0;r>=0;r-=3)o=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[n]|=o<<s&67108863,this.words[n+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);else if("le"===i)for(r=0,n=0;r<t.length;r+=3)o=t[r]|t[r+1]<<8|t[r+2]<<16,this.words[n]|=o<<s&67108863,this.words[n+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);return this.strip()},r.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var r,n,s=0;for(i=t.length-6,r=0;i>=e;i-=6)n=o(t,i,i+6),this.words[r]|=n<<s&67108863,this.words[r+1]|=n>>>26-s&4194303,(s+=24)>=26&&(s-=26,r++);i+6!==e&&(n=o(t,e,i+6),this.words[r]|=n<<s&67108863,this.words[r+1]|=n>>>26-s&4194303),this.strip()},r.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var o=t.length-i,a=o%r,l=Math.min(o,o-a)+i,d=0,c=i;c<l;c+=r)d=s(t,c,c+r,e),this.imuln(n),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(0!==a){var h=1;for(d=s(t,c,t.length,e),c=0;c<a;c++)h*=e;this.imuln(h),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}},r.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},r.prototype.clone=function(){var t=new r(null);return this.copy(t),t},r.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},r.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},r.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},r.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var a=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,l=s/67108864|0;i.words[0]=a;for(var d=1;d<r;d++){for(var c=l>>>26,h=67108863&l,u=Math.min(d,e.length-1),p=Math.max(0,d-t.length+1);p<=u;p++){var f=d-p|0;c+=(s=(n=0|t.words[f])*(o=0|e.words[p])+h)/67108864|0,h=67108863&s}i.words[d]=0|h,l=0|c}return 0!==l?i.words[d]=0|l:i.length--,i.strip()}r.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var r=0,n=0,o=0;o<this.length;o++){var s=this.words[o],l=(16777215&(s<<r|n)).toString(16);i=0!=(n=s>>>24-r&16777215)||o!==this.length-1?a[6-l.length]+l+i:l+i,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(i=n.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var h=d[t],u=c[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var f=p.modn(u).toString(t);i=(p=p.idivn(u)).isZero()?f+i:a[h-f.length]+f+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}},r.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length,0!==this.negative?-t:t},r.prototype.toJSON=function(){return this.toString(16)},r.prototype.toBuffer=function(t,e){return this.toArrayLike(n,t,e)},r.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},r.prototype.toArrayLike=function(t,e,i){var r=this.byteLength(),n=i||Math.max(1,r);this.strip();var o,s,a="le"===e,l=new t(n),d=this.clone();if(a){for(s=0;!d.isZero();s++)o=d.andln(255),d.iushrn(8),l[s]=o;for(;s<n;s++)l[s]=0}else{for(s=0;s<n-r;s++)l[s]=0;for(s=0;!d.isZero();s++)o=d.andln(255),d.iushrn(8),l[n-s-1]=o}return l},Math.clz32?r.prototype._countBits=function(t){return 32-Math.clz32(t)}:r.prototype._countBits=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},r.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},r.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var i=this._zeroBits(this.words[e]);if(t+=i,26!==i)break}return t},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},r.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return 0!==this.negative},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},r.prototype.ior=function(t){return this.iuor(t)},r.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},r.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},r.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;i<e.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=e.length,this.strip()},r.prototype.iand=function(t){return this.iuand(t)},r.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},r.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},r.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;r<i.length;r++)this.words[r]=e.words[r]^i.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},r.prototype.ixor=function(t){return this.iuxor(t)},r.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},r.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},r.prototype.inotn=function(t){var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var r=0;r<e;r++)this.words[r]=67108863&~this.words[r];return i>0&&(this.words[r]=~this.words[r]&67108863>>26-i),this.strip()},r.prototype.notn=function(t){return this.clone().inotn(t)},r.prototype.setn=function(t,e){var i=t/26|0,r=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<r:this.words[i]&~(1<<r),this.strip()},r.prototype.iadd=function(t){var e,i,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0,o=0;o<r.length;o++)e=(0|i.words[o])+(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<i.length;o++)e=(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this},r.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},r.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var o=0,s=0;s<r.length;s++)o=(e=(0|i.words[s])-(0|r.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<i.length;s++)o=(e=(0|i.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<i.length&&i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this.length=Math.max(this.length,s),i!==this&&(this.negative=1),this.strip()},r.prototype.sub=function(t){return this.clone().isub(t)};var u=function(t,e,i){var r,n,o,s=t.words,a=e.words,l=i.words,d=0,c=0|s[0],h=8191&c,u=c>>>13,p=0|s[1],f=8191&p,m=p>>>13,g=0|s[2],b=8191&g,v=g>>>13,y=0|s[3],_=8191&y,w=y>>>13,x=0|s[4],M=8191&x,k=x>>>13,S=0|s[5],E=8191&S,A=S>>>13,T=0|s[6],I=8191&T,C=T>>>13,R=0|s[7],O=8191&R,L=R>>>13,P=0|s[8],B=8191&P,N=P>>>13,$=0|s[9],z=8191&$,j=$>>>13,F=0|a[0],D=8191&F,q=F>>>13,U=0|a[1],H=8191&U,V=U>>>13,W=0|a[2],G=8191&W,K=W>>>13,X=0|a[3],Z=8191&X,Y=X>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],it=8191&et,rt=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],lt=8191&at,dt=at>>>13,ct=0|a[8],ht=8191&ct,ut=ct>>>13,pt=0|a[9],ft=8191&pt,mt=pt>>>13;i.negative=t.negative^e.negative,i.length=19;var gt=(d+(r=Math.imul(h,D))|0)+((8191&(n=(n=Math.imul(h,q))+Math.imul(u,D)|0))<<13)|0;d=((o=Math.imul(u,q))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(f,D),n=(n=Math.imul(f,q))+Math.imul(m,D)|0,o=Math.imul(m,q);var bt=(d+(r=r+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,V)|0)+Math.imul(u,H)|0))<<13)|0;d=((o=o+Math.imul(u,V)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,D),n=(n=Math.imul(b,q))+Math.imul(v,D)|0,o=Math.imul(v,q),r=r+Math.imul(f,H)|0,n=(n=n+Math.imul(f,V)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,V)|0;var vt=(d+(r=r+Math.imul(h,G)|0)|0)+((8191&(n=(n=n+Math.imul(h,K)|0)+Math.imul(u,G)|0))<<13)|0;d=((o=o+Math.imul(u,K)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(_,D),n=(n=Math.imul(_,q))+Math.imul(w,D)|0,o=Math.imul(w,q),r=r+Math.imul(b,H)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,n=(n=n+Math.imul(f,K)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,K)|0;var yt=(d+(r=r+Math.imul(h,Z)|0)|0)+((8191&(n=(n=n+Math.imul(h,Y)|0)+Math.imul(u,Z)|0))<<13)|0;d=((o=o+Math.imul(u,Y)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(M,D),n=(n=Math.imul(M,q))+Math.imul(k,D)|0,o=Math.imul(k,q),r=r+Math.imul(_,H)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,H)|0,o=o+Math.imul(w,V)|0,r=r+Math.imul(b,G)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,K)|0,r=r+Math.imul(f,Z)|0,n=(n=n+Math.imul(f,Y)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,Y)|0;var _t=(d+(r=r+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(u,Q)|0))<<13)|0;d=((o=o+Math.imul(u,tt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(E,D),n=(n=Math.imul(E,q))+Math.imul(A,D)|0,o=Math.imul(A,q),r=r+Math.imul(M,H)|0,n=(n=n+Math.imul(M,V)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(_,G)|0,n=(n=n+Math.imul(_,K)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,K)|0,r=r+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,Y)|0,r=r+Math.imul(f,Q)|0,n=(n=n+Math.imul(f,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var wt=(d+(r=r+Math.imul(h,it)|0)|0)+((8191&(n=(n=n+Math.imul(h,rt)|0)+Math.imul(u,it)|0))<<13)|0;d=((o=o+Math.imul(u,rt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(I,D),n=(n=Math.imul(I,q))+Math.imul(C,D)|0,o=Math.imul(C,q),r=r+Math.imul(E,H)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,V)|0,r=r+Math.imul(M,G)|0,n=(n=n+Math.imul(M,K)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,K)|0,r=r+Math.imul(_,Z)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,Y)|0,r=r+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(f,it)|0,n=(n=n+Math.imul(f,rt)|0)+Math.imul(m,it)|0,o=o+Math.imul(m,rt)|0;var xt=(d+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,st)|0)+Math.imul(u,ot)|0))<<13)|0;d=((o=o+Math.imul(u,st)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(O,D),n=(n=Math.imul(O,q))+Math.imul(L,D)|0,o=Math.imul(L,q),r=r+Math.imul(I,H)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(C,H)|0,o=o+Math.imul(C,V)|0,r=r+Math.imul(E,G)|0,n=(n=n+Math.imul(E,K)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,K)|0,r=r+Math.imul(M,Z)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,Y)|0,r=r+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(b,it)|0,n=(n=n+Math.imul(b,rt)|0)+Math.imul(v,it)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(f,ot)|0,n=(n=n+Math.imul(f,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Mt=(d+(r=r+Math.imul(h,lt)|0)|0)+((8191&(n=(n=n+Math.imul(h,dt)|0)+Math.imul(u,lt)|0))<<13)|0;d=((o=o+Math.imul(u,dt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(B,D),n=(n=Math.imul(B,q))+Math.imul(N,D)|0,o=Math.imul(N,q),r=r+Math.imul(O,H)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,V)|0,r=r+Math.imul(I,G)|0,n=(n=n+Math.imul(I,K)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,K)|0,r=r+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,Y)|0,r=r+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(_,it)|0,n=(n=n+Math.imul(_,rt)|0)+Math.imul(w,it)|0,o=o+Math.imul(w,rt)|0,r=r+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,r=r+Math.imul(f,lt)|0,n=(n=n+Math.imul(f,dt)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,dt)|0;var kt=(d+(r=r+Math.imul(h,ht)|0)|0)+((8191&(n=(n=n+Math.imul(h,ut)|0)+Math.imul(u,ht)|0))<<13)|0;d=((o=o+Math.imul(u,ut)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(z,D),n=(n=Math.imul(z,q))+Math.imul(j,D)|0,o=Math.imul(j,q),r=r+Math.imul(B,H)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(O,G)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,K)|0,r=r+Math.imul(I,Z)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,Y)|0,r=r+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(M,it)|0,n=(n=n+Math.imul(M,rt)|0)+Math.imul(k,it)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(_,ot)|0,n=(n=n+Math.imul(_,st)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,st)|0,r=r+Math.imul(b,lt)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,dt)|0,r=r+Math.imul(f,ht)|0,n=(n=n+Math.imul(f,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var St=(d+(r=r+Math.imul(h,ft)|0)|0)+((8191&(n=(n=n+Math.imul(h,mt)|0)+Math.imul(u,ft)|0))<<13)|0;d=((o=o+Math.imul(u,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(z,H),n=(n=Math.imul(z,V))+Math.imul(j,H)|0,o=Math.imul(j,V),r=r+Math.imul(B,G)|0,n=(n=n+Math.imul(B,K)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,K)|0,r=r+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,Y)|0,r=r+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,r=r+Math.imul(E,it)|0,n=(n=n+Math.imul(E,rt)|0)+Math.imul(A,it)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,r=r+Math.imul(_,lt)|0,n=(n=n+Math.imul(_,dt)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,dt)|0,r=r+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,ut)|0;var Et=(d+(r=r+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,mt)|0)+Math.imul(m,ft)|0))<<13)|0;d=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(z,G),n=(n=Math.imul(z,K))+Math.imul(j,G)|0,o=Math.imul(j,K),r=r+Math.imul(B,Z)|0,n=(n=n+Math.imul(B,Y)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,Y)|0,r=r+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,r=r+Math.imul(I,it)|0,n=(n=n+Math.imul(I,rt)|0)+Math.imul(C,it)|0,o=o+Math.imul(C,rt)|0,r=r+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,r=r+Math.imul(M,lt)|0,n=(n=n+Math.imul(M,dt)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,dt)|0,r=r+Math.imul(_,ht)|0,n=(n=n+Math.imul(_,ut)|0)+Math.imul(w,ht)|0,o=o+Math.imul(w,ut)|0;var At=(d+(r=r+Math.imul(b,ft)|0)|0)+((8191&(n=(n=n+Math.imul(b,mt)|0)+Math.imul(v,ft)|0))<<13)|0;d=((o=o+Math.imul(v,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(z,Z),n=(n=Math.imul(z,Y))+Math.imul(j,Z)|0,o=Math.imul(j,Y),r=r+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(O,it)|0,n=(n=n+Math.imul(O,rt)|0)+Math.imul(L,it)|0,o=o+Math.imul(L,rt)|0,r=r+Math.imul(I,ot)|0,n=(n=n+Math.imul(I,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,r=r+Math.imul(E,lt)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,dt)|0,r=r+Math.imul(M,ht)|0,n=(n=n+Math.imul(M,ut)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,ut)|0;var Tt=(d+(r=r+Math.imul(_,ft)|0)|0)+((8191&(n=(n=n+Math.imul(_,mt)|0)+Math.imul(w,ft)|0))<<13)|0;d=((o=o+Math.imul(w,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(z,Q),n=(n=Math.imul(z,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),r=r+Math.imul(B,it)|0,n=(n=n+Math.imul(B,rt)|0)+Math.imul(N,it)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,r=r+Math.imul(I,lt)|0,n=(n=n+Math.imul(I,dt)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,dt)|0,r=r+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,ut)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ut)|0;var It=(d+(r=r+Math.imul(M,ft)|0)|0)+((8191&(n=(n=n+Math.imul(M,mt)|0)+Math.imul(k,ft)|0))<<13)|0;d=((o=o+Math.imul(k,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(z,it),n=(n=Math.imul(z,rt))+Math.imul(j,it)|0,o=Math.imul(j,rt),r=r+Math.imul(B,ot)|0,n=(n=n+Math.imul(B,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,r=r+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(L,lt)|0,o=o+Math.imul(L,dt)|0,r=r+Math.imul(I,ht)|0,n=(n=n+Math.imul(I,ut)|0)+Math.imul(C,ht)|0,o=o+Math.imul(C,ut)|0;var Ct=(d+(r=r+Math.imul(E,ft)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(A,ft)|0))<<13)|0;d=((o=o+Math.imul(A,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(z,ot),n=(n=Math.imul(z,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),r=r+Math.imul(B,lt)|0,n=(n=n+Math.imul(B,dt)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,dt)|0,r=r+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(L,ht)|0,o=o+Math.imul(L,ut)|0;var Rt=(d+(r=r+Math.imul(I,ft)|0)|0)+((8191&(n=(n=n+Math.imul(I,mt)|0)+Math.imul(C,ft)|0))<<13)|0;d=((o=o+Math.imul(C,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(z,lt),n=(n=Math.imul(z,dt))+Math.imul(j,lt)|0,o=Math.imul(j,dt),r=r+Math.imul(B,ht)|0,n=(n=n+Math.imul(B,ut)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,ut)|0;var Ot=(d+(r=r+Math.imul(O,ft)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(L,ft)|0))<<13)|0;d=((o=o+Math.imul(L,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(z,ht),n=(n=Math.imul(z,ut))+Math.imul(j,ht)|0,o=Math.imul(j,ut);var Lt=(d+(r=r+Math.imul(B,ft)|0)|0)+((8191&(n=(n=n+Math.imul(B,mt)|0)+Math.imul(N,ft)|0))<<13)|0;d=((o=o+Math.imul(N,mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Pt=(d+(r=Math.imul(z,ft))|0)+((8191&(n=(n=Math.imul(z,mt))+Math.imul(j,ft)|0))<<13)|0;return d=((o=Math.imul(j,mt))+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,l[0]=gt,l[1]=bt,l[2]=vt,l[3]=yt,l[4]=_t,l[5]=wt,l[6]=xt,l[7]=Mt,l[8]=kt,l[9]=St,l[10]=Et,l[11]=At,l[12]=Tt,l[13]=It,l[14]=Ct,l[15]=Rt,l[16]=Ot,l[17]=Lt,l[18]=Pt,0!==d&&(l[19]=d,i.length++),i};function p(t,e,i){return(new f).mulp(t,e,i)}function f(t,e){this.x=t,this.y=e}Math.imul||(u=h),r.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?u(this,t,e):i<63?h(this,t,e):i<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,o=0;o<i.length-1;o++){var s=n;n=0;for(var a=67108863&r,l=Math.min(o,e.length-1),d=Math.max(0,o-t.length+1);d<=l;d++){var c=o-d,h=(0|t.words[c])*(0|e.words[d]),u=67108863&h;a=67108863&(u=u+a|0),n+=(s=(s=s+(h/67108864|0)|0)+(u>>>26)|0)>>>26,s&=67108863}i.words[o]=a,r=s,s=n}return 0!==r?i.words[o]=r:i.length--,i.strip()}(this,t,e):p(this,t,e)},f.prototype.makeRBT=function(t){for(var e=new Array(t),i=r.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,i,t);return e},f.prototype.revBin=function(t,e,i){if(0===t||t===i-1)return t;for(var r=0,n=0;n<e;n++)r|=(1&t)<<e-n-1,t>>=1;return r},f.prototype.permute=function(t,e,i,r,n,o){for(var s=0;s<o;s++)r[s]=e[t[s]],n[s]=i[t[s]]},f.prototype.transform=function(t,e,i,r,n,o){this.permute(o,t,e,i,r,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,l=Math.cos(2*Math.PI/a),d=Math.sin(2*Math.PI/a),c=0;c<n;c+=a)for(var h=l,u=d,p=0;p<s;p++){var f=i[c+p],m=r[c+p],g=i[c+p+s],b=r[c+p+s],v=h*g-u*b;b=h*b+u*g,g=v,i[c+p]=f+g,r[c+p]=m+b,i[c+p+s]=f-g,r[c+p+s]=m-b,p!==a&&(v=l*h-d*u,u=l*u+d*h,h=v)}},f.prototype.guessLen13b=function(t,e){var i=1|Math.max(e,t),r=1&i,n=0;for(i=i/2|0;i;i>>>=1)n++;return 1<<n+1+r},f.prototype.conjugate=function(t,e,i){if(!(i<=1))for(var r=0;r<i/2;r++){var n=t[r];t[r]=t[i-r-1],t[i-r-1]=n,n=e[r],e[r]=-e[i-r-1],e[i-r-1]=-n}},f.prototype.normalize13b=function(t,e){for(var i=0,r=0;r<e/2;r++){var n=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+i;t[r]=67108863&n,i=n<67108864?0:n/67108864|0}return t},f.prototype.convert13b=function(t,e,i,r){for(var n=0,o=0;o<e;o++)n+=0|t[o],i[2*o]=8191&n,n>>>=13,i[2*o+1]=8191&n,n>>>=13;for(o=2*e;o<r;++o)i[o]=0},f.prototype.stub=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=0;return e},f.prototype.mulp=function(t,e,i){var r=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(r),o=this.stub(r),s=new Array(r),a=new Array(r),l=new Array(r),d=new Array(r),c=new Array(r),h=new Array(r),u=i.words;u.length=r,this.convert13b(t.words,t.length,s,r),this.convert13b(e.words,e.length,d,r),this.transform(s,o,a,l,r,n),this.transform(d,o,c,h,r,n);for(var p=0;p<r;p++){var f=a[p]*c[p]-l[p]*h[p];l[p]=a[p]*h[p]+l[p]*c[p],a[p]=f}return this.conjugate(a,l,r),this.transform(a,l,u,o,r,n),this.conjugate(u,o,r),this.normalize13b(u,r),i.negative=t.negative^e.negative,i.length=t.length+e.length,i.strip()},r.prototype.mul=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},r.prototype.mulf=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),p(this,t,e)},r.prototype.imul=function(t){return this.clone().mulTo(t,this)},r.prototype.imuln=function(t){for(var e=0,i=0;i<this.length;i++){var r=(0|this.words[i])*t,n=(67108863&r)+(67108863&e);e>>=26,e+=r/67108864|0,e+=n>>>26,this.words[i]=67108863&n}return 0!==e&&(this.words[i]=e,this.length++),this},r.prototype.muln=function(t){return this.clone().imuln(t)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i<e.length;i++){var r=i/26|0,n=i%26;e[i]=(t.words[r]&1<<n)>>>n}return e}(t);if(0===e.length)return new r(1);for(var i=this,n=0;n<e.length&&0===e[n];n++,i=i.sqr());if(++n<e.length)for(var o=i.sqr();n<e.length;n++,o=o.sqr())0!==e[n]&&(i=i.mul(o));return i},r.prototype.iushln=function(t){var e,i=t%26,r=(t-i)/26,n=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e<this.length;e++){var s=this.words[e]&n,a=(0|this.words[e])-s<<i;this.words[e]=a|o,o=s>>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e<r;e++)this.words[e]=0;this.length+=r}return this.strip()},r.prototype.ishln=function(t){return this.iushln(t)},r.prototype.iushrn=function(t,e,i){var r;r=e?(e-e%26)/26:0;var n=t%26,o=Math.min((t-n)/26,this.length),s=67108863^67108863>>>n<<n,a=i;if(r-=o,r=Math.max(0,r),a){for(var l=0;l<o;l++)a.words[l]=this.words[l];a.length=o}if(0===o);else if(this.length>o)for(this.length-=o,l=0;l<this.length;l++)this.words[l]=this.words[l+o];else this.words[0]=0,this.length=1;var d=0;for(l=this.length-1;l>=0&&(0!==d||l>=r);l--){var c=0|this.words[l];this.words[l]=d<<26-n|c>>>n,d=c&s}return a&&0!==d&&(a.words[a.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},r.prototype.ishrn=function(t,e,i){return this.iushrn(t,e,i)},r.prototype.shln=function(t){return this.clone().ishln(t)},r.prototype.ushln=function(t){return this.clone().iushln(t)},r.prototype.shrn=function(t){return this.clone().ishrn(t)},r.prototype.ushrn=function(t){return this.clone().iushrn(t)},r.prototype.testn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;return!(this.length<=i||!(this.words[i]&r))},r.prototype.imaskn=function(t){var e=t%26,i=(t-e)/26;if(this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var r=67108863^67108863>>>e<<e;this.words[this.length-1]&=r}return this.strip()},r.prototype.maskn=function(t){return this.clone().imaskn(t)},r.prototype.iaddn=function(t){return t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},r.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},r.prototype.isubn=function(t){if(t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},r.prototype.addn=function(t){return this.clone().iaddn(t)},r.prototype.subn=function(t){return this.clone().isubn(t)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(t,e,i){var r,n,o=t.length+i;this._expand(o);var s=0;for(r=0;r<t.length;r++){n=(0|this.words[r+i])+s;var a=(0|t.words[r])*e;s=((n-=67108863&a)>>26)-(a/67108864|0),this.words[r+i]=67108863&n}for(;r<this.length-i;r++)s=(n=(0|this.words[r+i])+s)>>26,this.words[r+i]=67108863&n;if(0===s)return this.strip();for(s=0,r=0;r<this.length;r++)s=(n=-(0|this.words[r])+s)>>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},r.prototype._wordDiv=function(t,e){var i=(this.length,t.length),n=this.clone(),o=t,s=0|o.words[o.length-1];0!=(i=26-this._countBits(s))&&(o=o.ushln(i),n.iushln(i),s=0|o.words[o.length-1]);var a,l=n.length-o.length;if("mod"!==e){(a=new r(null)).length=l+1,a.words=new Array(a.length);for(var d=0;d<a.length;d++)a.words[d]=0}var c=n.clone()._ishlnsubmul(o,1,l);0===c.negative&&(n=c,a&&(a.words[l]=1));for(var h=l-1;h>=0;h--){var u=67108864*(0|n.words[o.length+h])+(0|n.words[o.length+h-1]);for(u=Math.min(u/s|0,67108863),n._ishlnsubmul(o,u,h);0!==n.negative;)u--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=u)}return a&&a.strip(),n.strip(),"div"!==e&&0!==i&&n.iushrn(i),{div:a||null,mod:n}},r.prototype.divmod=function(t,e,i){return this.isZero()?{div:new r(0),mod:new r(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(o=s.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new r(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new r(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new r(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,s},r.prototype.div=function(t){return this.divmod(t,"div",!1).div},r.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},r.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},r.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),o=i.cmp(r);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},r.prototype.modn=function(t){for(var e=(1<<26)%t,i=0,r=this.length-1;r>=0;r--)i=(e*i+(0|this.words[r]))%t;return i},r.prototype.idivn=function(t){for(var e=0,i=this.length-1;i>=0;i--){var r=(0|this.words[i])+67108864*e;this.words[i]=r/t|0,e=r%t}return this.strip()},r.prototype.divn=function(t){return this.clone().idivn(t)},r.prototype.egcd=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new r(1),o=new r(0),s=new r(0),a=new r(1),l=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++l;for(var d=i.clone(),c=e.clone();!e.isZero();){for(var h=0,u=1;0==(e.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(d),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,f=1;0==(i.words[0]&f)&&p<26;++p,f<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(s.isOdd()||a.isOdd())&&(s.iadd(d),a.isub(c)),s.iushrn(1),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(s),o.isub(a)):(i.isub(e),s.isub(n),a.isub(o))}return{a:s,b:a,gcd:i.iushln(l)}},r.prototype._invmp=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new r(1),s=new r(0),a=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(a),o.iushrn(1);for(var c=0,h=1;0==(i.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(i.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(a),s.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(s)):(i.isub(e),s.isub(o))}return(n=0===e.cmpn(1)?o:s).cmpn(0)<0&&n.iadd(t),n},r.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var o=e;e=i,i=o}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},r.prototype.invm=function(t){return this.egcd(t).a.umod(t)},r.prototype.isEven=function(){return 0==(1&this.words[0])},r.prototype.isOdd=function(){return 1==(1&this.words[0])},r.prototype.andln=function(t){return this.words[0]&t},r.prototype.bincn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=r,this;for(var n=r,o=i;0!==n&&o<this.length;o++){var s=0|this.words[o];n=(s+=n)>>>26,s&=67108863,this.words[o]=s}return 0!==n&&(this.words[o]=n,this.length++),this},r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},r.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t);var r=0|this.words[0];e=r===t?0:r<t?-1:1}return 0!==this.negative?0|-e:e},r.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},r.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){r<n?e=-1:r>n&&(e=1);break}}return e},r.prototype.gtn=function(t){return 1===this.cmpn(t)},r.prototype.gt=function(t){return 1===this.cmp(t)},r.prototype.gten=function(t){return this.cmpn(t)>=0},r.prototype.gte=function(t){return this.cmp(t)>=0},r.prototype.ltn=function(t){return-1===this.cmpn(t)},r.prototype.lt=function(t){return-1===this.cmp(t)},r.prototype.lten=function(t){return this.cmpn(t)<=0},r.prototype.lte=function(t){return this.cmp(t)<=0},r.prototype.eqn=function(t){return 0===this.cmpn(t)},r.prototype.eq=function(t){return 0===this.cmp(t)},r.red=function(t){return new w(t)},r.prototype.toRed=function(t){return t.convertTo(this)._forceRed(t)},r.prototype.fromRed=function(){return this.red.convertFrom(this)},r.prototype._forceRed=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return this._forceRed(t)},r.prototype.redAdd=function(t){return this.red.add(this,t)},r.prototype.redIAdd=function(t){return this.red.iadd(this,t)},r.prototype.redSub=function(t){return this.red.sub(this,t)},r.prototype.redISub=function(t){return this.red.isub(this,t)},r.prototype.redShl=function(t){return this.red.shl(this,t)},r.prototype.redMul=function(t){return this.red._verify2(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return this.red._verify2(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(t){return this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new r(e,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function y(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=r._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function x(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new r(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},i(b,g),b.prototype.split=function(t,e){for(var i=Math.min(t.length,9),r=0;r<i;r++)e.words[r]=t.words[r];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(e.words[e.length++]=4194303&n,r=10;r<t.length;r++){var o=0|t.words[r];t.words[r-10]=(4194303&o)<<4|n>>>22,n=o}n>>>=22,t.words[r-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i<t.length;i++){var r=0|t.words[i];e+=977*r,t.words[i]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(v,g),i(y,g),i(_,g),_.prototype.imulK=function(t){for(var e=0,i=0;i<t.length;i++){var r=19*(0|t.words[i])+e,n=67108863&r;r>>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},r._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new v;else if("p192"===t)e=new y;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return m[t]=e,e},w.prototype._verify1=function(t){},w.prototype._verify2=function(t,e){},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},w.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();if(3===this.m.andln(3)){var e=this.m.add(new r(1)).iushrn(2);return this.pow(t,e)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);var o=new r(1).toRed(this),s=o.redNeg(),a=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new r(2*l*l).toRed(this);0!==this.pow(l,a).cmp(s);)l.redIAdd(s);for(var d=this.pow(l,i),c=this.pow(t,i.addn(1).iushrn(1)),h=this.pow(t,i),u=n;0!==h.cmp(o);){for(var p=h,f=0;0!==p.cmp(o);f++)p=p.redSqr();var m=this.pow(d,new r(1).iushln(u-f-1));c=c.redMul(m),d=m.redSqr(),h=h.redMul(d),u=f}return c},w.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},w.prototype.pow=function(t,e){if(e.isZero())return new r(1).toRed(this);if(0===e.cmpn(1))return t.clone();var i=new Array(16);i[0]=new r(1).toRed(this),i[1]=t;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],t);var o=i[0],s=0,a=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var d=e.words[n],c=l-1;c>=0;c--){var h=d>>c&1;o!==i[0]&&(o=this.sqr(o)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===n&&0===c)&&(o=this.mul(o,i[s]),a=0,s=0)):a=0}l=26}return o},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},r.mont=function(t){return new x(t)},i(x,w),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0)._forceRed(this);var i=t.mul(e),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(Fl,this),Fl=Fl.exports,function(t){(function(){}).call(this)}.call(this,d({}).Buffer),y.Buffer;var Dl={exports:{}};!function(t,e){function i(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}function r(t,e,i){if(r.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(i=e,e=10),this._init(t||0,e||10,i||"be"))}var n;"object"==typeof t?t.exports=r:e.BN=r,r.BN=r,r.wordSize=26;try{n=l({}).Buffer}catch(t){}function o(t,e,i){for(var r=0,n=Math.min(t.length,i),o=e;o<n;o++){var s=t.charCodeAt(o)-48;r<<=4,r|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return r}function s(t,e,i,r){for(var n=0,o=Math.min(t.length,i),s=e;s<o;s++){var a=t.charCodeAt(s)-48;n*=r,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}r.isBN=function(t){return t instanceof r||null!==t&&"object"==typeof t&&t.constructor.wordSize===r.wordSize&&Array.isArray(t.words)},r.max=function(t,e){return t.cmp(e)>0?t:e},r.min=function(t,e){return t.cmp(e)<0?t:e},r.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16);var r=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&r++,16===e?this._parseHex(t,r):this._parseBase(t,e,r),"-"===t[0]&&(this.negative=1),this.strip(),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initNumber=function(t,e,i){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),e,i)},r.prototype._initArray=function(t,e,i){if(t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,o,s=0;if("be"===i)for(r=t.length-1,n=0;r>=0;r-=3)o=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[n]|=o<<s&67108863,this.words[n+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);else if("le"===i)for(r=0,n=0;r<t.length;r+=3)o=t[r]|t[r+1]<<8|t[r+2]<<16,this.words[n]|=o<<s&67108863,this.words[n+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);return this.strip()},r.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var r,n,s=0;for(i=t.length-6,r=0;i>=e;i-=6)n=o(t,i,i+6),this.words[r]|=n<<s&67108863,this.words[r+1]|=n>>>26-s&4194303,(s+=24)>=26&&(s-=26,r++);i+6!==e&&(n=o(t,e,i+6),this.words[r]|=n<<s&67108863,this.words[r+1]|=n>>>26-s&4194303),this.strip()},r.prototype._parseBase=function(t,e,i){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=e)r++;r--,n=n/e|0;for(var o=t.length-i,a=o%r,l=Math.min(o,o-a)+i,d=0,c=i;c<l;c+=r)d=s(t,c,c+r,e),this.imuln(n),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(0!==a){var h=1;for(d=s(t,c,t.length,e),c=0;c<a;c++)h*=e;this.imuln(h),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}},r.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},r.prototype.clone=function(){var t=new r(null);return this.copy(t),t},r.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},r.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},r.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},r.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var a=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(t,e,i){i.negative=e.negative^t.negative;var r=t.length+e.length|0;i.length=r,r=r-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,l=s/67108864|0;i.words[0]=a;for(var d=1;d<r;d++){for(var c=l>>>26,h=67108863&l,u=Math.min(d,e.length-1),p=Math.max(0,d-t.length+1);p<=u;p++){var f=d-p|0;c+=(s=(n=0|t.words[f])*(o=0|e.words[p])+h)/67108864|0,h=67108863&s}i.words[d]=0|h,l=0|c}return 0!==l?i.words[d]=0|l:i.length--,i.strip()}r.prototype.toString=function(t,e){var i;if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var r=0,n=0,o=0;o<this.length;o++){var s=this.words[o],l=(16777215&(s<<r|n)).toString(16);i=0!=(n=s>>>24-r&16777215)||o!==this.length-1?a[6-l.length]+l+i:l+i,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(i=n.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var h=d[t],u=c[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var f=p.modn(u).toString(t);i=(p=p.idivn(u)).isZero()?f+i:a[h-f.length]+f+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}},r.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length,0!==this.negative?-t:t},r.prototype.toJSON=function(){return this.toString(16)},r.prototype.toBuffer=function(t,e){return this.toArrayLike(n,t,e)},r.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},r.prototype.toArrayLike=function(t,e,i){var r=this.byteLength(),n=i||Math.max(1,r);this.strip();var o,s,a="le"===e,l=new t(n),d=this.clone();if(a){for(s=0;!d.isZero();s++)o=d.andln(255),d.iushrn(8),l[s]=o;for(;s<n;s++)l[s]=0}else{for(s=0;s<n-r;s++)l[s]=0;for(s=0;!d.isZero();s++)o=d.andln(255),d.iushrn(8),l[n-s-1]=o}return l},Math.clz32?r.prototype._countBits=function(t){return 32-Math.clz32(t)}:r.prototype._countBits=function(t){var e=t,i=0;return e>=4096&&(i+=13,e>>>=13),e>=64&&(i+=7,e>>>=7),e>=8&&(i+=4,e>>>=4),e>=2&&(i+=2,e>>>=2),i+e},r.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},r.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var i=this._zeroBits(this.words[e]);if(t+=i,26!==i)break}return t},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},r.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return 0!==this.negative},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},r.prototype.ior=function(t){return this.iuor(t)},r.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},r.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},r.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var i=0;i<e.length;i++)this.words[i]=this.words[i]&t.words[i];return this.length=e.length,this.strip()},r.prototype.iand=function(t){return this.iuand(t)},r.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},r.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},r.prototype.iuxor=function(t){var e,i;this.length>t.length?(e=this,i=t):(e=t,i=this);for(var r=0;r<i.length;r++)this.words[r]=e.words[r]^i.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},r.prototype.ixor=function(t){return this.iuxor(t)},r.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},r.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},r.prototype.inotn=function(t){var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var r=0;r<e;r++)this.words[r]=67108863&~this.words[r];return i>0&&(this.words[r]=~this.words[r]&67108863>>26-i),this.strip()},r.prototype.notn=function(t){return this.clone().inotn(t)},r.prototype.setn=function(t,e){var i=t/26|0,r=t%26;return this._expand(i+1),this.words[i]=e?this.words[i]|1<<r:this.words[i]&~(1<<r),this.strip()},r.prototype.iadd=function(t){var e,i,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(i=this,r=t):(i=t,r=this);for(var n=0,o=0;o<r.length;o++)e=(0|i.words[o])+(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<i.length;o++)e=(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=i.length,0!==n)this.words[this.length]=n,this.length++;else if(i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this},r.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},r.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var i,r,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(i=this,r=t):(i=t,r=this);for(var o=0,s=0;s<r.length;s++)o=(e=(0|i.words[s])-(0|r.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<i.length;s++)o=(e=(0|i.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<i.length&&i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this.length=Math.max(this.length,s),i!==this&&(this.negative=1),this.strip()},r.prototype.sub=function(t){return this.clone().isub(t)};var u=function(t,e,i){var r,n,o,s=t.words,a=e.words,l=i.words,d=0,c=0|s[0],h=8191&c,u=c>>>13,p=0|s[1],f=8191&p,m=p>>>13,g=0|s[2],b=8191&g,v=g>>>13,y=0|s[3],_=8191&y,w=y>>>13,x=0|s[4],M=8191&x,k=x>>>13,S=0|s[5],E=8191&S,A=S>>>13,T=0|s[6],I=8191&T,C=T>>>13,R=0|s[7],O=8191&R,L=R>>>13,P=0|s[8],B=8191&P,N=P>>>13,$=0|s[9],z=8191&$,j=$>>>13,F=0|a[0],D=8191&F,q=F>>>13,U=0|a[1],H=8191&U,V=U>>>13,W=0|a[2],G=8191&W,K=W>>>13,X=0|a[3],Z=8191&X,Y=X>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],it=8191&et,rt=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],lt=8191&at,dt=at>>>13,ct=0|a[8],ht=8191&ct,ut=ct>>>13,pt=0|a[9],ft=8191&pt,mt=pt>>>13;i.negative=t.negative^e.negative,i.length=19;var gt=(d+(r=Math.imul(h,D))|0)+((8191&(n=(n=Math.imul(h,q))+Math.imul(u,D)|0))<<13)|0;d=((o=Math.imul(u,q))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(f,D),n=(n=Math.imul(f,q))+Math.imul(m,D)|0,o=Math.imul(m,q);var bt=(d+(r=r+Math.imul(h,H)|0)|0)+((8191&(n=(n=n+Math.imul(h,V)|0)+Math.imul(u,H)|0))<<13)|0;d=((o=o+Math.imul(u,V)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,D),n=(n=Math.imul(b,q))+Math.imul(v,D)|0,o=Math.imul(v,q),r=r+Math.imul(f,H)|0,n=(n=n+Math.imul(f,V)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,V)|0;var vt=(d+(r=r+Math.imul(h,G)|0)|0)+((8191&(n=(n=n+Math.imul(h,K)|0)+Math.imul(u,G)|0))<<13)|0;d=((o=o+Math.imul(u,K)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(_,D),n=(n=Math.imul(_,q))+Math.imul(w,D)|0,o=Math.imul(w,q),r=r+Math.imul(b,H)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,V)|0,r=r+Math.imul(f,G)|0,n=(n=n+Math.imul(f,K)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,K)|0;var yt=(d+(r=r+Math.imul(h,Z)|0)|0)+((8191&(n=(n=n+Math.imul(h,Y)|0)+Math.imul(u,Z)|0))<<13)|0;d=((o=o+Math.imul(u,Y)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(M,D),n=(n=Math.imul(M,q))+Math.imul(k,D)|0,o=Math.imul(k,q),r=r+Math.imul(_,H)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(w,H)|0,o=o+Math.imul(w,V)|0,r=r+Math.imul(b,G)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,K)|0,r=r+Math.imul(f,Z)|0,n=(n=n+Math.imul(f,Y)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,Y)|0;var _t=(d+(r=r+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,tt)|0)+Math.imul(u,Q)|0))<<13)|0;d=((o=o+Math.imul(u,tt)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(E,D),n=(n=Math.imul(E,q))+Math.imul(A,D)|0,o=Math.imul(A,q),r=r+Math.imul(M,H)|0,n=(n=n+Math.imul(M,V)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,V)|0,r=r+Math.imul(_,G)|0,n=(n=n+Math.imul(_,K)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,K)|0,r=r+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,Y)|0,r=r+Math.imul(f,Q)|0,n=(n=n+Math.imul(f,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var wt=(d+(r=r+Math.imul(h,it)|0)|0)+((8191&(n=(n=n+Math.imul(h,rt)|0)+Math.imul(u,it)|0))<<13)|0;d=((o=o+Math.imul(u,rt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(I,D),n=(n=Math.imul(I,q))+Math.imul(C,D)|0,o=Math.imul(C,q),r=r+Math.imul(E,H)|0,n=(n=n+Math.imul(E,V)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,V)|0,r=r+Math.imul(M,G)|0,n=(n=n+Math.imul(M,K)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,K)|0,r=r+Math.imul(_,Z)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,Y)|0,r=r+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(f,it)|0,n=(n=n+Math.imul(f,rt)|0)+Math.imul(m,it)|0,o=o+Math.imul(m,rt)|0;var xt=(d+(r=r+Math.imul(h,ot)|0)|0)+((8191&(n=(n=n+Math.imul(h,st)|0)+Math.imul(u,ot)|0))<<13)|0;d=((o=o+Math.imul(u,st)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(O,D),n=(n=Math.imul(O,q))+Math.imul(L,D)|0,o=Math.imul(L,q),r=r+Math.imul(I,H)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(C,H)|0,o=o+Math.imul(C,V)|0,r=r+Math.imul(E,G)|0,n=(n=n+Math.imul(E,K)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,K)|0,r=r+Math.imul(M,Z)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,Y)|0,r=r+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(b,it)|0,n=(n=n+Math.imul(b,rt)|0)+Math.imul(v,it)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(f,ot)|0,n=(n=n+Math.imul(f,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Mt=(d+(r=r+Math.imul(h,lt)|0)|0)+((8191&(n=(n=n+Math.imul(h,dt)|0)+Math.imul(u,lt)|0))<<13)|0;d=((o=o+Math.imul(u,dt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(B,D),n=(n=Math.imul(B,q))+Math.imul(N,D)|0,o=Math.imul(N,q),r=r+Math.imul(O,H)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,V)|0,r=r+Math.imul(I,G)|0,n=(n=n+Math.imul(I,K)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,K)|0,r=r+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,Y)|0,r=r+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(_,it)|0,n=(n=n+Math.imul(_,rt)|0)+Math.imul(w,it)|0,o=o+Math.imul(w,rt)|0,r=r+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,r=r+Math.imul(f,lt)|0,n=(n=n+Math.imul(f,dt)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,dt)|0;var kt=(d+(r=r+Math.imul(h,ht)|0)|0)+((8191&(n=(n=n+Math.imul(h,ut)|0)+Math.imul(u,ht)|0))<<13)|0;d=((o=o+Math.imul(u,ut)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(z,D),n=(n=Math.imul(z,q))+Math.imul(j,D)|0,o=Math.imul(j,q),r=r+Math.imul(B,H)|0,n=(n=n+Math.imul(B,V)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,V)|0,r=r+Math.imul(O,G)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,K)|0,r=r+Math.imul(I,Z)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,Y)|0,r=r+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,r=r+Math.imul(M,it)|0,n=(n=n+Math.imul(M,rt)|0)+Math.imul(k,it)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(_,ot)|0,n=(n=n+Math.imul(_,st)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,st)|0,r=r+Math.imul(b,lt)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,dt)|0,r=r+Math.imul(f,ht)|0,n=(n=n+Math.imul(f,ut)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ut)|0;var St=(d+(r=r+Math.imul(h,ft)|0)|0)+((8191&(n=(n=n+Math.imul(h,mt)|0)+Math.imul(u,ft)|0))<<13)|0;d=((o=o+Math.imul(u,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(z,H),n=(n=Math.imul(z,V))+Math.imul(j,H)|0,o=Math.imul(j,V),r=r+Math.imul(B,G)|0,n=(n=n+Math.imul(B,K)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,K)|0,r=r+Math.imul(O,Z)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,Y)|0,r=r+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,r=r+Math.imul(E,it)|0,n=(n=n+Math.imul(E,rt)|0)+Math.imul(A,it)|0,o=o+Math.imul(A,rt)|0,r=r+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,r=r+Math.imul(_,lt)|0,n=(n=n+Math.imul(_,dt)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,dt)|0,r=r+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,ut)|0)+Math.imul(v,ht)|0,o=o+Math.imul(v,ut)|0;var Et=(d+(r=r+Math.imul(f,ft)|0)|0)+((8191&(n=(n=n+Math.imul(f,mt)|0)+Math.imul(m,ft)|0))<<13)|0;d=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(z,G),n=(n=Math.imul(z,K))+Math.imul(j,G)|0,o=Math.imul(j,K),r=r+Math.imul(B,Z)|0,n=(n=n+Math.imul(B,Y)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,Y)|0,r=r+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,r=r+Math.imul(I,it)|0,n=(n=n+Math.imul(I,rt)|0)+Math.imul(C,it)|0,o=o+Math.imul(C,rt)|0,r=r+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,r=r+Math.imul(M,lt)|0,n=(n=n+Math.imul(M,dt)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,dt)|0,r=r+Math.imul(_,ht)|0,n=(n=n+Math.imul(_,ut)|0)+Math.imul(w,ht)|0,o=o+Math.imul(w,ut)|0;var At=(d+(r=r+Math.imul(b,ft)|0)|0)+((8191&(n=(n=n+Math.imul(b,mt)|0)+Math.imul(v,ft)|0))<<13)|0;d=((o=o+Math.imul(v,mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(z,Z),n=(n=Math.imul(z,Y))+Math.imul(j,Z)|0,o=Math.imul(j,Y),r=r+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(O,it)|0,n=(n=n+Math.imul(O,rt)|0)+Math.imul(L,it)|0,o=o+Math.imul(L,rt)|0,r=r+Math.imul(I,ot)|0,n=(n=n+Math.imul(I,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,r=r+Math.imul(E,lt)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,dt)|0,r=r+Math.imul(M,ht)|0,n=(n=n+Math.imul(M,ut)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,ut)|0;var Tt=(d+(r=r+Math.imul(_,ft)|0)|0)+((8191&(n=(n=n+Math.imul(_,mt)|0)+Math.imul(w,ft)|0))<<13)|0;d=((o=o+Math.imul(w,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(z,Q),n=(n=Math.imul(z,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),r=r+Math.imul(B,it)|0,n=(n=n+Math.imul(B,rt)|0)+Math.imul(N,it)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(O,ot)|0,n=(n=n+Math.imul(O,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,r=r+Math.imul(I,lt)|0,n=(n=n+Math.imul(I,dt)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,dt)|0,r=r+Math.imul(E,ht)|0,n=(n=n+Math.imul(E,ut)|0)+Math.imul(A,ht)|0,o=o+Math.imul(A,ut)|0;var It=(d+(r=r+Math.imul(M,ft)|0)|0)+((8191&(n=(n=n+Math.imul(M,mt)|0)+Math.imul(k,ft)|0))<<13)|0;d=((o=o+Math.imul(k,mt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(z,it),n=(n=Math.imul(z,rt))+Math.imul(j,it)|0,o=Math.imul(j,rt),r=r+Math.imul(B,ot)|0,n=(n=n+Math.imul(B,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,r=r+Math.imul(O,lt)|0,n=(n=n+Math.imul(O,dt)|0)+Math.imul(L,lt)|0,o=o+Math.imul(L,dt)|0,r=r+Math.imul(I,ht)|0,n=(n=n+Math.imul(I,ut)|0)+Math.imul(C,ht)|0,o=o+Math.imul(C,ut)|0;var Ct=(d+(r=r+Math.imul(E,ft)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(A,ft)|0))<<13)|0;d=((o=o+Math.imul(A,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(z,ot),n=(n=Math.imul(z,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),r=r+Math.imul(B,lt)|0,n=(n=n+Math.imul(B,dt)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,dt)|0,r=r+Math.imul(O,ht)|0,n=(n=n+Math.imul(O,ut)|0)+Math.imul(L,ht)|0,o=o+Math.imul(L,ut)|0;var Rt=(d+(r=r+Math.imul(I,ft)|0)|0)+((8191&(n=(n=n+Math.imul(I,mt)|0)+Math.imul(C,ft)|0))<<13)|0;d=((o=o+Math.imul(C,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(z,lt),n=(n=Math.imul(z,dt))+Math.imul(j,lt)|0,o=Math.imul(j,dt),r=r+Math.imul(B,ht)|0,n=(n=n+Math.imul(B,ut)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,ut)|0;var Ot=(d+(r=r+Math.imul(O,ft)|0)|0)+((8191&(n=(n=n+Math.imul(O,mt)|0)+Math.imul(L,ft)|0))<<13)|0;d=((o=o+Math.imul(L,mt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(z,ht),n=(n=Math.imul(z,ut))+Math.imul(j,ht)|0,o=Math.imul(j,ut);var Lt=(d+(r=r+Math.imul(B,ft)|0)|0)+((8191&(n=(n=n+Math.imul(B,mt)|0)+Math.imul(N,ft)|0))<<13)|0;d=((o=o+Math.imul(N,mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Pt=(d+(r=Math.imul(z,ft))|0)+((8191&(n=(n=Math.imul(z,mt))+Math.imul(j,ft)|0))<<13)|0;return d=((o=Math.imul(j,mt))+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,l[0]=gt,l[1]=bt,l[2]=vt,l[3]=yt,l[4]=_t,l[5]=wt,l[6]=xt,l[7]=Mt,l[8]=kt,l[9]=St,l[10]=Et,l[11]=At,l[12]=Tt,l[13]=It,l[14]=Ct,l[15]=Rt,l[16]=Ot,l[17]=Lt,l[18]=Pt,0!==d&&(l[19]=d,i.length++),i};function p(t,e,i){return(new f).mulp(t,e,i)}function f(t,e){this.x=t,this.y=e}Math.imul||(u=h),r.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?u(this,t,e):i<63?h(this,t,e):i<1024?function(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var r=0,n=0,o=0;o<i.length-1;o++){var s=n;n=0;for(var a=67108863&r,l=Math.min(o,e.length-1),d=Math.max(0,o-t.length+1);d<=l;d++){var c=o-d,h=(0|t.words[c])*(0|e.words[d]),u=67108863&h;a=67108863&(u=u+a|0),n+=(s=(s=s+(h/67108864|0)|0)+(u>>>26)|0)>>>26,s&=67108863}i.words[o]=a,r=s,s=n}return 0!==r?i.words[o]=r:i.length--,i.strip()}(this,t,e):p(this,t,e)},f.prototype.makeRBT=function(t){for(var e=new Array(t),i=r.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,i,t);return e},f.prototype.revBin=function(t,e,i){if(0===t||t===i-1)return t;for(var r=0,n=0;n<e;n++)r|=(1&t)<<e-n-1,t>>=1;return r},f.prototype.permute=function(t,e,i,r,n,o){for(var s=0;s<o;s++)r[s]=e[t[s]],n[s]=i[t[s]]},f.prototype.transform=function(t,e,i,r,n,o){this.permute(o,t,e,i,r,n);for(var s=1;s<n;s<<=1)for(var a=s<<1,l=Math.cos(2*Math.PI/a),d=Math.sin(2*Math.PI/a),c=0;c<n;c+=a)for(var h=l,u=d,p=0;p<s;p++){var f=i[c+p],m=r[c+p],g=i[c+p+s],b=r[c+p+s],v=h*g-u*b;b=h*b+u*g,g=v,i[c+p]=f+g,r[c+p]=m+b,i[c+p+s]=f-g,r[c+p+s]=m-b,p!==a&&(v=l*h-d*u,u=l*u+d*h,h=v)}},f.prototype.guessLen13b=function(t,e){var i=1|Math.max(e,t),r=1&i,n=0;for(i=i/2|0;i;i>>>=1)n++;return 1<<n+1+r},f.prototype.conjugate=function(t,e,i){if(!(i<=1))for(var r=0;r<i/2;r++){var n=t[r];t[r]=t[i-r-1],t[i-r-1]=n,n=e[r],e[r]=-e[i-r-1],e[i-r-1]=-n}},f.prototype.normalize13b=function(t,e){for(var i=0,r=0;r<e/2;r++){var n=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+i;t[r]=67108863&n,i=n<67108864?0:n/67108864|0}return t},f.prototype.convert13b=function(t,e,i,r){for(var n=0,o=0;o<e;o++)n+=0|t[o],i[2*o]=8191&n,n>>>=13,i[2*o+1]=8191&n,n>>>=13;for(o=2*e;o<r;++o)i[o]=0},f.prototype.stub=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=0;return e},f.prototype.mulp=function(t,e,i){var r=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(r),o=this.stub(r),s=new Array(r),a=new Array(r),l=new Array(r),d=new Array(r),c=new Array(r),h=new Array(r),u=i.words;u.length=r,this.convert13b(t.words,t.length,s,r),this.convert13b(e.words,e.length,d,r),this.transform(s,o,a,l,r,n),this.transform(d,o,c,h,r,n);for(var p=0;p<r;p++){var f=a[p]*c[p]-l[p]*h[p];l[p]=a[p]*h[p]+l[p]*c[p],a[p]=f}return this.conjugate(a,l,r),this.transform(a,l,u,o,r,n),this.conjugate(u,o,r),this.normalize13b(u,r),i.negative=t.negative^e.negative,i.length=t.length+e.length,i.strip()},r.prototype.mul=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},r.prototype.mulf=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),p(this,t,e)},r.prototype.imul=function(t){return this.clone().mulTo(t,this)},r.prototype.imuln=function(t){for(var e=0,i=0;i<this.length;i++){var r=(0|this.words[i])*t,n=(67108863&r)+(67108863&e);e>>=26,e+=r/67108864|0,e+=n>>>26,this.words[i]=67108863&n}return 0!==e&&(this.words[i]=e,this.length++),this},r.prototype.muln=function(t){return this.clone().imuln(t)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i<e.length;i++){var r=i/26|0,n=i%26;e[i]=(t.words[r]&1<<n)>>>n}return e}(t);if(0===e.length)return new r(1);for(var i=this,n=0;n<e.length&&0===e[n];n++,i=i.sqr());if(++n<e.length)for(var o=i.sqr();n<e.length;n++,o=o.sqr())0!==e[n]&&(i=i.mul(o));return i},r.prototype.iushln=function(t){var e,i=t%26,r=(t-i)/26,n=67108863>>>26-i<<26-i;if(0!==i){var o=0;for(e=0;e<this.length;e++){var s=this.words[e]&n,a=(0|this.words[e])-s<<i;this.words[e]=a|o,o=s>>>26-i}o&&(this.words[e]=o,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e<r;e++)this.words[e]=0;this.length+=r}return this.strip()},r.prototype.ishln=function(t){return this.iushln(t)},r.prototype.iushrn=function(t,e,i){var r;r=e?(e-e%26)/26:0;var n=t%26,o=Math.min((t-n)/26,this.length),s=67108863^67108863>>>n<<n,a=i;if(r-=o,r=Math.max(0,r),a){for(var l=0;l<o;l++)a.words[l]=this.words[l];a.length=o}if(0===o);else if(this.length>o)for(this.length-=o,l=0;l<this.length;l++)this.words[l]=this.words[l+o];else this.words[0]=0,this.length=1;var d=0;for(l=this.length-1;l>=0&&(0!==d||l>=r);l--){var c=0|this.words[l];this.words[l]=d<<26-n|c>>>n,d=c&s}return a&&0!==d&&(a.words[a.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},r.prototype.ishrn=function(t,e,i){return this.iushrn(t,e,i)},r.prototype.shln=function(t){return this.clone().ishln(t)},r.prototype.ushln=function(t){return this.clone().iushln(t)},r.prototype.shrn=function(t){return this.clone().ishrn(t)},r.prototype.ushrn=function(t){return this.clone().iushrn(t)},r.prototype.testn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;return!(this.length<=i||!(this.words[i]&r))},r.prototype.imaskn=function(t){var e=t%26,i=(t-e)/26;if(this.length<=i)return this;if(0!==e&&i++,this.length=Math.min(i,this.length),0!==e){var r=67108863^67108863>>>e<<e;this.words[this.length-1]&=r}return this.strip()},r.prototype.maskn=function(t){return this.clone().imaskn(t)},r.prototype.iaddn=function(t){return t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},r.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},r.prototype.isubn=function(t){if(t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},r.prototype.addn=function(t){return this.clone().iaddn(t)},r.prototype.subn=function(t){return this.clone().isubn(t)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(t,e,i){var r,n,o=t.length+i;this._expand(o);var s=0;for(r=0;r<t.length;r++){n=(0|this.words[r+i])+s;var a=(0|t.words[r])*e;s=((n-=67108863&a)>>26)-(a/67108864|0),this.words[r+i]=67108863&n}for(;r<this.length-i;r++)s=(n=(0|this.words[r+i])+s)>>26,this.words[r+i]=67108863&n;if(0===s)return this.strip();for(s=0,r=0;r<this.length;r++)s=(n=-(0|this.words[r])+s)>>26,this.words[r]=67108863&n;return this.negative=1,this.strip()},r.prototype._wordDiv=function(t,e){var i=(this.length,t.length),n=this.clone(),o=t,s=0|o.words[o.length-1];0!=(i=26-this._countBits(s))&&(o=o.ushln(i),n.iushln(i),s=0|o.words[o.length-1]);var a,l=n.length-o.length;if("mod"!==e){(a=new r(null)).length=l+1,a.words=new Array(a.length);for(var d=0;d<a.length;d++)a.words[d]=0}var c=n.clone()._ishlnsubmul(o,1,l);0===c.negative&&(n=c,a&&(a.words[l]=1));for(var h=l-1;h>=0;h--){var u=67108864*(0|n.words[o.length+h])+(0|n.words[o.length+h-1]);for(u=Math.min(u/s|0,67108863),n._ishlnsubmul(o,u,h);0!==n.negative;)u--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=u)}return a&&a.strip(),n.strip(),"div"!==e&&0!==i&&n.iushrn(i),{div:a||null,mod:n}},r.prototype.divmod=function(t,e,i){return this.isZero()?{div:new r(0),mod:new r(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(o=s.mod.neg(),i&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),i&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new r(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new r(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new r(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,o,s},r.prototype.div=function(t){return this.divmod(t,"div",!1).div},r.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},r.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},r.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var i=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),n=t.andln(1),o=i.cmp(r);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},r.prototype.modn=function(t){for(var e=(1<<26)%t,i=0,r=this.length-1;r>=0;r--)i=(e*i+(0|this.words[r]))%t;return i},r.prototype.idivn=function(t){for(var e=0,i=this.length-1;i>=0;i--){var r=(0|this.words[i])+67108864*e;this.words[i]=r/t|0,e=r%t}return this.strip()},r.prototype.divn=function(t){return this.clone().idivn(t)},r.prototype.egcd=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new r(1),o=new r(0),s=new r(0),a=new r(1),l=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++l;for(var d=i.clone(),c=e.clone();!e.isZero();){for(var h=0,u=1;0==(e.words[0]&u)&&h<26;++h,u<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(d),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var p=0,f=1;0==(i.words[0]&f)&&p<26;++p,f<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(s.isOdd()||a.isOdd())&&(s.iadd(d),a.isub(c)),s.iushrn(1),a.iushrn(1);e.cmp(i)>=0?(e.isub(i),n.isub(s),o.isub(a)):(i.isub(e),s.isub(n),a.isub(o))}return{a:s,b:a,gcd:i.iushln(l)}},r.prototype._invmp=function(t){var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new r(1),s=new r(0),a=i.clone();e.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(a),o.iushrn(1);for(var c=0,h=1;0==(i.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(i.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(a),s.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(s)):(i.isub(e),s.isub(o))}return(n=0===e.cmpn(1)?o:s).cmpn(0)<0&&n.iadd(t),n},r.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),i=t.clone();e.negative=0,i.negative=0;for(var r=0;e.isEven()&&i.isEven();r++)e.iushrn(1),i.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;i.isEven();)i.iushrn(1);var n=e.cmp(i);if(n<0){var o=e;e=i,i=o}else if(0===n||0===i.cmpn(1))break;e.isub(i)}return i.iushln(r)},r.prototype.invm=function(t){return this.egcd(t).a.umod(t)},r.prototype.isEven=function(){return 0==(1&this.words[0])},r.prototype.isOdd=function(){return 1==(1&this.words[0])},r.prototype.andln=function(t){return this.words[0]&t},r.prototype.bincn=function(t){var e=t%26,i=(t-e)/26,r=1<<e;if(this.length<=i)return this._expand(i+1),this.words[i]|=r,this;for(var n=r,o=i;0!==n&&o<this.length;o++){var s=0|this.words[o];n=(s+=n)>>>26,s&=67108863,this.words[o]=s}return 0!==n&&(this.words[o]=n,this.length++),this},r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},r.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)e=1;else{i&&(t=-t);var r=0|this.words[0];e=r===t?0:r<t?-1:1}return 0!==this.negative?0|-e:e},r.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},r.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,i=this.length-1;i>=0;i--){var r=0|this.words[i],n=0|t.words[i];if(r!==n){r<n?e=-1:r>n&&(e=1);break}}return e},r.prototype.gtn=function(t){return 1===this.cmpn(t)},r.prototype.gt=function(t){return 1===this.cmp(t)},r.prototype.gten=function(t){return this.cmpn(t)>=0},r.prototype.gte=function(t){return this.cmp(t)>=0},r.prototype.ltn=function(t){return-1===this.cmpn(t)},r.prototype.lt=function(t){return-1===this.cmp(t)},r.prototype.lten=function(t){return this.cmpn(t)<=0},r.prototype.lte=function(t){return this.cmp(t)<=0},r.prototype.eqn=function(t){return 0===this.cmpn(t)},r.prototype.eq=function(t){return 0===this.cmp(t)},r.red=function(t){return new w(t)},r.prototype.toRed=function(t){return t.convertTo(this)._forceRed(t)},r.prototype.fromRed=function(){return this.red.convertFrom(this)},r.prototype._forceRed=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return this._forceRed(t)},r.prototype.redAdd=function(t){return this.red.add(this,t)},r.prototype.redIAdd=function(t){return this.red.iadd(this,t)},r.prototype.redSub=function(t){return this.red.sub(this,t)},r.prototype.redISub=function(t){return this.red.isub(this,t)},r.prototype.redShl=function(t){return this.red.shl(this,t)},r.prototype.redMul=function(t){return this.red._verify2(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return this.red._verify2(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(t){return this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new r(e,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function y(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(t){if("string"==typeof t){var e=r._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function x(t){w.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new r(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,i=t;do{this.split(i,this.tmp),e=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:i.ucmp(this.p);return 0===r?(i.words[0]=0,i.length=1):r>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},i(b,g),b.prototype.split=function(t,e){for(var i=Math.min(t.length,9),r=0;r<i;r++)e.words[r]=t.words[r];if(e.length=i,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(e.words[e.length++]=4194303&n,r=10;r<t.length;r++){var o=0|t.words[r];t.words[r-10]=(4194303&o)<<4|n>>>22,n=o}n>>>=22,t.words[r-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i<t.length;i++){var r=0|t.words[i];e+=977*r,t.words[i]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(v,g),i(y,g),i(_,g),_.prototype.imulK=function(t){for(var e=0,i=0;i<t.length;i++){var r=19*(0|t.words[i])+e,n=67108863&r;r>>>=26,t.words[i]=n,e=r}return 0!==e&&(t.words[t.length++]=e),t},r._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new v;else if("p192"===t)e=new y;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return m[t]=e,e},w.prototype._verify1=function(t){},w.prototype._verify2=function(t,e){},w.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},w.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},w.prototype.add=function(t,e){this._verify2(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},w.prototype.iadd=function(t,e){this._verify2(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},w.prototype.sub=function(t,e){this._verify2(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},w.prototype.isub=function(t,e){this._verify2(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},w.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},w.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},w.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},w.prototype.isqr=function(t){return this.imul(t,t.clone())},w.prototype.sqr=function(t){return this.mul(t,t)},w.prototype.sqrt=function(t){if(t.isZero())return t.clone();if(3===this.m.andln(3)){var e=this.m.add(new r(1)).iushrn(2);return this.pow(t,e)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);var o=new r(1).toRed(this),s=o.redNeg(),a=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new r(2*l*l).toRed(this);0!==this.pow(l,a).cmp(s);)l.redIAdd(s);for(var d=this.pow(l,i),c=this.pow(t,i.addn(1).iushrn(1)),h=this.pow(t,i),u=n;0!==h.cmp(o);){for(var p=h,f=0;0!==p.cmp(o);f++)p=p.redSqr();var m=this.pow(d,new r(1).iushln(u-f-1));c=c.redMul(m),d=m.redSqr(),h=h.redMul(d),u=f}return c},w.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},w.prototype.pow=function(t,e){if(e.isZero())return new r(1).toRed(this);if(0===e.cmpn(1))return t.clone();var i=new Array(16);i[0]=new r(1).toRed(this),i[1]=t;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],t);var o=i[0],s=0,a=0,l=e.bitLength()%26;for(0===l&&(l=26),n=e.length-1;n>=0;n--){for(var d=e.words[n],c=l-1;c>=0;c--){var h=d>>c&1;o!==i[0]&&(o=this.sqr(o)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===n&&0===c)&&(o=this.mul(o,i[s]),a=0,s=0)):a=0}l=26}return o},w.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},w.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},r.mont=function(t){return new x(t)},i(x,w),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var i=t.imul(e),r=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(r).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0)._forceRed(this);var i=t.mul(e),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=i.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(Dl,this),Dl=Dl.exports,y.Buffer,y.Buffer,y.Buffer,function(t,e){(function(){y.Buffer,y.kMaxLength;var i=e.crypto||e.msCrypto;i&&i.getRandomValues||t.browser}).call(this)}.call(this,E,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var ql={};ql.createHash=fi,ql.createHmac=Si;var Ul=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Hl=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function Vl(t,e){if(t.map)return t.map(e);for(var i=[],r=0;r<t.length;r++)i.push(e(t[r],r));return i}var Wl=Object.keys||function(t){var e=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.push(i);return e},Gl=function(t,e,i,r){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?Vl(Wl(t),(function(r){var n=encodeURIComponent(Ul(r))+i;return Hl(t[r])?Vl(t[r],(function(t){return n+encodeURIComponent(Ul(t))})).join(e):n+encodeURIComponent(Ul(t[r]))})).join(e):r?encodeURIComponent(Ul(r))+i+encodeURIComponent(Ul(t)):""},Kl={};return function(t,e){(function(){class i{constructor(t,e,i,r="API"){if(this._apiVersionMajor="4",this._apiVersion="v4.20190615",this._hashType="sha256",null==i&&(i="https://api.backend.ai"),this._endpoint=i,this._endpointHost=i.replace(/^[^:]+:\/\//,""),"API"===r){if(null==t)throw"You must set accessKey! (either as argument or environment variable)";if(null==e)throw"You must set secretKey! (either as argument or environment variable)";this._accessKey=t,this._secretKey=e,this._userId="",this._password=""}else{if(null==t)throw"You must set user id! (either as argument or environment variable)";if(null==e)throw"You must set password! (either as argument or environment variable)";this._accessKey="",this._secretKey="",this._userId=t,this._password=e}this._proxyURL=null,this._connectionMode=r}get accessKey(){return this._accessKey}get secretKey(){return this._secretKey}get userId(){return this._userId}get password(){return this._password}get endpoint(){return this._endpoint}get proxyURL(){return this._proxyURL}get endpointHost(){return this._endpointHost}get apiVersion(){return this._apiVersion}get apiVersionMajor(){return this._apiVersionMajor}get hashType(){return this._hashType}get connectionMode(){return this._connectionMode}static createFromEnv(){return new this(t.env.BACKEND_ACCESS_KEY,t.env.BACKEND_SECRET_KEY,t.env.BACKEND_ENDPOINT)}}class r{constructor(t,e){this.ready=!1,this.code=null,this.sessionId=null,this.kernelType=null,this.clientVersion="20.8.1",this.agentSignature=e,this._config=void 0===t?i.createFromEnv():t,this._managerVersion=null,this._apiVersion=null,this._apiVersionMajor=null,this.is_admin=!1,this.is_superadmin=!1,this.kernelPrefix="/kernel",this.resourcePreset=new n(this),this.vfolder=new o(this),this.agent=new s(this),this.keypair=new a(this),this.image=new d(this),this.utils=new M(this),this.computeSession=new c(this),this.resourcePolicy=new l(this),this.user=new m(this),this.group=new u(this),this.domain=new p(this),this.resources=new h(this),this.maintenance=new f(this),this.scalingGroup=new g(this),this.registry=new b(this),this.setting=new v(this),this.userConfig=new _(this),this.service=new y(this),this.domain=new p(this),this.enterprise=new w(this),this.cloud=new x(this),this._features={},this.abortController=new AbortController,this.abortSignal=this.abortController.signal,this.requestTimeout=5e3}get managerVersion(){return this._managerVersion}get apiVersion(){return this._apiVersion}async _wrapWithPromise(t,e=!1,i=null,n=0){let o,s,a,l,d=r.ERR_REQUEST,c="";try{if("GET"==t.method&&(t.body=void 0),"SESSION"===this._config.connectionMode&&(t.credentials="include",t.mode="cors"),null!==i)t.signal=i;else{let e=new AbortController;t.signal=e.signal,l=setTimeout((()=>{d=r.ERR_TIMEOUT,e.abort()}),0===n?this.requestTimeout:n)}s=await fetch(t.uri,t),void 0!==l&&clearTimeout(l),d=r.ERR_RESPONSE;let o=s.headers.get("Content-Type");if(!1===e&&null===o?a=void 0===s.blob?await s.buffer():await s.blob():!1===e&&(o.startsWith("application/json")||o.startsWith("application/problem+json"))?(a=await s.json(),d=a.type,c=a.title):a=!1===e&&o.startsWith("text/")?await s.text():void 0===s.blob?await s.buffer():await s.blob(),d=r.ERR_SERVER,!s.ok)throw a}catch(e){let i;switch(i="object"==typeof e&&e.constructor===Object&&"title"in e?e.title:e,void 0===s&&(s={}),d){case r.ERR_REQUEST:d="https://api.backend.ai/probs/client-request-error",navigator.onLine?(c=i,o="sending request has failed: "+i):(c="Network disconnected.",o="sending request has failed: Network disconnected");break;case r.ERR_RESPONSE:d="https://api.backend.ai/probs/client-response-error",c=i,o="reading response has failed: "+i;break;case r.ERR_SERVER:d="https://api.backend.ai/probs/server-error",c=`${s.status} ${s.statusText} - ${a.title}`,o="server responded failure: ",a.msg?o+=`${s.status} ${s.statusText} - ${a.msg}`:o+=`${s.status} ${s.statusText} - ${a.title}`;break;case r.ERR_ABORT:d="https://api.backend.ai/probs/request-abort-error",c="Request aborted",o="Request aborted by user",s.status=408,s.statusText="Request aborted by user";break;case r.ERR_TIMEOUT:d="https://api.backend.ai/probs/request-timeout-error",c="Request timeout",o="No response returned during the timeout period",s.status=408,s.statusText="Timeout exceeded";break;default:void 0===s.status&&(s.status=500,s.statusText="Server error"),""===d&&(d=r.ERR_UNKNOWN),""===c&&(c=a.title),o=`server responded failure: ${s.status} ${s.statusText} - ${a.title}`}throw{isError:!0,timestamp:(new Date).toUTCString(),type:d,requestUrl:t.uri,requestMethod:t.method,requestParameters:t.body,statusCode:s.status,statusText:s.statusText,title:c,message:o}}let h=JSON.parse(localStorage.getItem("backendaiconsole.logs"));h&&h.length>5e3&&(h=h.slice(1,5e3));let u=Array();void 0===s&&(s={status:"No status",statusText:"No response given."});let p={isError:!1,timestamp:(new Date).toUTCString(),type:"",requestUrl:t.uri,requestMethod:t.method,requestParameters:t.body,statusCode:s.status,statusText:s.statusText,title:a.title,message:""};return u.push(p),h&&(u=u.concat(h)),localStorage.setItem("backendaiconsole.logs",JSON.stringify(u)),a}getServerVersion(t=null){let e=this.newPublicRequest("GET","/",null,"");return this._wrapWithPromise(e,!1,t)}get APIMajorVersion(){return this._apiVersionMajor}set APIMajorVersion(t){this._apiVersionMajor=t,this._config._apiVersionMajor=this._apiVersionMajor}async get_manager_version(t=null){if(null===this._managerVersion){let e=await this.getServerVersion(t);this._managerVersion=e.manager,this._apiVersion=e.version,this._config._apiVersion=this._apiVersion,this._apiVersionMajor=e.version.substr(1,2),this._config._apiVersionMajor=this._apiVersionMajor,this._apiVersionMajor>4&&(this.kernelPrefix="/session")}return this._managerVersion}supports(t){return 0===Object.keys(this._features).length&&this._updateSupportList(),t in this._features&&this._features[t]}_updateFieldCompatibilityByAPIVersion(t){const e={session_name:"sess_id"};return this._apiVersionMajor<5&&Object.keys(e).forEach((i=>{let r=t.indexOf(i);-1!==r&&(t[r]=e[i])})),t}_updateSupportList(){this.isAPIVersionCompatibleWith("v4.20190601")&&(this._features["scaling-group"]=!0,this._features.group=!0,this._features["group-folder"]=!0,this._features["system-images"]=!0,this._features["detailed-session-states"]=!0)}isManagerVersionCompatibleWith(t){let e=this._managerVersion;return e=e.split(".").map((t=>t.padStart(10))).join("."),(t=t.split(".").map((t=>t.padStart(10))).join("."))<=e}isAPIVersionCompatibleWith(t){let e=this._apiVersion;return null!==e&&null!==t&&(e=e.split(".").map((t=>t.padStart(10))).join("."),t=t.split(".").map((t=>t.padStart(10))).join(".")),t<=e}async check_login(){let t,e=this.newSignedRequest("POST","/server/login-check",null);try{!0===(t=await this._wrapWithPromise(e)).authenticated&&(this._config._accessKey=t.data.access_key,this._config._session_id=t.session_id)}catch(t){return console.log(t),Promise.resolve(!1)}return t.authenticated}async login(){let t,e={username:this._config.userId,password:this._config.password},i=this.newSignedRequest("POST","/server/login",e);try{if(!0===(t=await this._wrapWithPromise(i)).authenticated)return await this.get_manager_version(),this.check_login();if(!1===t.authenticated)return t.data&&t.data.details?Promise.resolve({fail_reason:t.data.details}):Promise.resolve(!1)}catch(t){throw{title:"No manager found at API Endpoint.",message:"Authentication failed. Check information and manager status."}}}logout(){let t=this.newSignedRequest("POST","/server/logout",{});return this._wrapWithPromise(t)}async signout(t,e){let i={username:t,password:e},r=this.newSignedRequest("POST","/auth/signout",i);return this._wrapWithPromise(r)}async update_password(t,e,i){let r={old_password:t,new_password:e,new_password2:i},n=this.newSignedRequest("POST","/auth/update-password",r);return this._wrapWithPromise(n)}async get_resource_slots(){let t;return t=this.isAPIVersionCompatibleWith("v4.20190601")?this.newPublicRequest("GET","/config/resource-slots",null,""):this.newPublicRequest("GET","/etcd/resource-slots",null,""),this._wrapWithPromise(t)}async createIfNotExists(t,e,i={},r=0){null==e&&(e=this.generateSessionId());let n,o={lang:t,clientSessionToken:e};if(i!={}){let t={};i.cpu&&(t.cpu=i.cpu),i.mem&&(t.mem=i.mem),i.gpu&&(t["cuda.device"]=parseInt(i.gpu)),i["cuda.device"]&&(t["cuda.device"]=parseInt(i["cuda.device"])),i.vgpu?t["cuda.shares"]=parseFloat(i.vgpu).toFixed(2):i.fgpu&&(t["cuda.shares"]=parseFloat(i.fgpu).toFixed(2)),i["cuda.shares"]&&(t["cuda.shares"]=parseFloat(i["cuda.shares"]).toFixed(2)),i.tpu&&(t["tpu.device"]=i.tpu),i.env&&(t.environ=i.env),i.clustersize&&(t.clusterSize=i.clustersize),i.group_name&&(o.group_name=i.group_name),i.domain&&(o.domain=i.domain),i.enqueueOnly&&(o.enqueueOnly=i.enqueueOnly),i.maxWaitSeconds&&(o.maxWaitSeconds=i.maxWaitSeconds),i.reuseIfExists&&(o.reuseIfExists=i.reuseIfExists),i.startupCommand&&(o.startupCommand=i.startupCommand),i.bootstrapScript&&(o.bootstrapScript=i.bootstrapScript),i.bootstrap_script&&(o.bootstrap_script=i.bootstrap_script),i.owner_access_key&&(o.owner_access_key=i.owner_access_key),o.config={resources:t},i.mounts&&(o.config.mounts=i.mounts),i.scaling_group&&(o.config.scaling_group=i.scaling_group),i.shmem&&(o.config.resource_opts={},o.config.resource_opts.shmem=i.shmem)}return n=this._apiVersionMajor<5?this.newSignedRequest("POST",this.kernelPrefix+"/create",o):this.newSignedRequest("POST",""+this.kernelPrefix,o),this._wrapWithPromise(n,!1,null,r)}async get_info(t,e=null){let i=`${this.kernelPrefix}/${t}`;null!=e&&(i=`${i}?owner_access_key=${e}`);let r=this.newSignedRequest("GET",i,null);return this._wrapWithPromise(r)}async get_logs(t,e=null){let i=`${this.kernelPrefix}/${t}/logs`;null!=e&&(i=`${i}?owner_access_key=${e}`);let r=this.newSignedRequest("GET",i,null);return this._wrapWithPromise(r)}async destroy(t,e=null){let i=`${this.kernelPrefix}/${t}`;null!=e&&(i=`${i}?owner_access_key=${e}`);let r=this.newSignedRequest("DELETE",i,null);return this._wrapWithPromise(r)}async restart(t,e=null){let i=`${this.kernelPrefix}/${t}`;null!=e&&(i=`${i}?owner_access_key=${e}`);let r=this.newSignedRequest("PATCH",i,null);return this._wrapWithPromise(r)}async execute(t,e,i,r,n){let o={mode:i,code:r,runId:e,options:n},s=this.newSignedRequest("POST",`${this.kernelPrefix}/${t}`,o);return this._wrapWithPromise(s)}createKernel(t,e,i={},r=0){return this.createIfNotExists(t,e,i,r)}destroyKernel(t,e=null){return this.destroy(t,e)}refreshKernel(t,e=null){return this.restart(t,e)}runCode(t,e,i,r){return this.execute(e,i,r,t,{})}async upload(t,e,i){const r=new FormData;r.append("src",i,e);let n=this.newSignedRequest("POST",`${this.kernelPrefix}/${t}/upload`,r);return this._wrapWithPromise(n)}async download(t,e){const i=Gl({files:e});let r=this.newSignedRequest("GET",`${this.kernelPrefix}/${t}/download?${i}`,null);return this._wrapWithPromise(r,!0)}async download_single(t,e){const i=Gl({file:e});let r=this.newSignedRequest("GET",`${this.kernelPrefix}/${t}/download_single?${i}`,null);return this._wrapWithPromise(r,!0)}async mangleUserAgentSignature(){return this.clientVersion+(this.agentSignature?"; "+this.agentSignature:"")}async query(t,e,i=null,r=0){let n={query:t,variables:e},o=this.newSignedRequest("POST","/admin/graphql",n);return this._wrapWithPromise(o,!1,i,r)}newSignedRequest(t,i,r){let n,o,s,a,l,d="application/json",c=new Date;if(null==r?o=n="":"function"==typeof r.getBoundary||r instanceof FormData?(n=r,o="",d="multipart/form-data"):o=n=JSON.stringify(r),l="","SESSION"===this._config.connectionMode)a=new Headers({"User-Agent":"Backend.AI Client for Javascript "+this.mangleUserAgentSignature(),"X-BackendAI-Version":this._config.apiVersion,"X-BackendAI-Date":c.toISOString()}),l=!0===i.startsWith("/server")?this._config.endpoint+i:this._config.endpoint+"/func"+i;else{s=this._config._apiVersion[1]<4?this.getAuthenticationString(t,i,c.toISOString(),o,d):this.getAuthenticationString(t,i,c.toISOString(),"",d);let e=this.getSignKey(this._config.secretKey,c),r=this.sign(e,"binary",s,"hex");a=new Headers({"User-Agent":"Backend.AI Client for Javascript "+this.mangleUserAgentSignature(),"X-BackendAI-Version":this._config.apiVersion,"X-BackendAI-Date":c.toISOString(),Authorization:`BackendAI signMethod=HMAC-SHA256, credential=${this._config.accessKey}:${r}`}),l=this._config.endpoint+i}return null!=r?("function"==typeof r.getBoundary&&a.set("Content-Type",r.getHeaders()["content-type"]),r instanceof FormData||(a.set("Content-Type",d),a.set("Content-Length",e.byteLength(o)))):a.set("Content-Type",d),{method:t,headers:a,cache:"default",body:n,uri:l}}newUnsignedRequest(t,e,i){return this.newPublicRequest(t,e,i,this._config.apiVersionMajor)}newPublicRequest(t,e,i,r){let n=new Date,o={method:t,headers:new Headers({"Content-Type":"application/json","User-Agent":"Backend.AI Client for Javascript "+this.mangleUserAgentSignature(),"X-BackendAI-Version":this._config.apiVersion,"X-BackendAI-Date":n.toISOString(),credentials:"include",mode:"cors"}),mode:"cors",cache:"default",uri:""};return"SESSION"===this._config.connectionMode&&!0===e.startsWith("/server")?o.uri=this._config.endpoint+e:"SESSION"===this._config.connectionMode&&!1===e.startsWith("/server")?o.uri=this._config.endpoint+"/func"+e:o.uri=this._config.endpoint+e,o}getAuthenticationString(t,e,i,r,n="application/json"){let o=ql.createHash(this._config.hashType).update(r).digest("hex");return t+"\n"+e+"\n"+i+"\nhost:"+this._config.endpointHost+"\ncontent-type:"+n+"\nx-backendai-version:"+this._config.apiVersion+"\n"+o}getCurrentDate(t){return("0000"+t.getUTCFullYear()).slice(-4)+("0"+(t.getUTCMonth()+1)).slice(-2)+("0"+t.getUTCDate()).slice(-2)}sign(t,i,r,n){let o=new e(t,i),s=ql.createHmac(this._config.hashType,o);return s.update(r,"utf8"),s.digest(n)}getSignKey(t,e){let i=this.sign(t,"utf8",this.getCurrentDate(e),"binary");return this.sign(i,"binary",this._config.endpointHost,"binary")}generateSessionId(){for(var t="",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=0;i<8;i++)t+=e.charAt(Math.floor(Math.random()*e.length));return t+"-jsSDK"}async fetchSSHKeypair(){let t=this.newSignedRequest("GET","/auth/ssh-keypair",null);return this._wrapWithPromise(t,!1)}async refreshSSHKeypair(){let t=this.newSignedRequest("PATCH","/auth/ssh-keypair",null);return this._wrapWithPromise(t,!1)}}class n{constructor(t){this.client=t,this.urlPrefix="/resource"}async list(t=null){let e=this.client.newSignedRequest("GET",this.urlPrefix+"/presets",t);return this.client._wrapWithPromise(e)}async check(t=null){let e=this.client.newSignedRequest("POST",this.urlPrefix+"/check-presets",t);return this.client._wrapWithPromise(e)}async add(t=null,e){if(!0===this.client.is_admin&&null!==t){let i="mutation($name: String!, $input: CreateResourcePresetInput!) {  create_resource_preset(name: $name, props: $input) {    ok msg   }}",r={name:t,input:e};return this.client.query(i,r)}return Promise.resolve(!1)}async mutate(t=null,e){if(!0===this.client.is_admin&&null!==t){let i="mutation($name: String!, $input: ModifyResourcePresetInput!) {  modify_resource_preset(name: $name, props: $input) {    ok msg   }}",r={name:t,input:e};return this.client.query(i,r)}return Promise.resolve(!1)}async delete(t=null){if(!0===this.client.is_admin&&null!==t){let e="mutation($name: String!) {  delete_resource_preset(name: $name) {    ok msg   }}",i={name:t};return this.client.query(e,i)}return Promise.resolve(!1)}}class o{constructor(t,e=null){this.client=t,this.name=e,this.urlPrefix="/folders"}async list_allowed_types(){let t=this.client.newSignedRequest("GET",this.urlPrefix+"/_/allowed_types",null);return this.client._wrapWithPromise(t)}async create(t,e="",i="",r="general",n="rw"){let o;""!==e&&(o={name:t,host:e}),this.client.supports("group-folder")&&""!==i&&(o={name:t,host:e,group:i}),this.client.isAPIVersionCompatibleWith("v4.20191215")&&(r&&(o.usage_mode=r),n&&(o.permission=n));let s=this.client.newSignedRequest("POST",""+this.urlPrefix,o);return this.client._wrapWithPromise(s)}async list(t=null){let e=this.urlPrefix;if(t){e+="?"+Gl({group_id:t})}let i=this.client.newSignedRequest("GET",e,null);return this.client._wrapWithPromise(i)}async list_hosts(){let t=this.client.newSignedRequest("GET",this.urlPrefix+"/_/hosts",null);return this.client._wrapWithPromise(t)}async info(t=null){null==t&&(t=this.name);let e=this.client.newSignedRequest("GET",`${this.urlPrefix}/${t}`,null);return this.client._wrapWithPromise(e)}async rename(t=null){const e={new_name:t};let i=this.client.newSignedRequest("POST",`${this.urlPrefix}/${this.name}/rename`,e);return this.client._wrapWithPromise(i)}async delete(t=null){null==t&&(t=this.name);let e=this.client.newSignedRequest("DELETE",`${this.urlPrefix}/${t}`,null);return this.client._wrapWithPromise(e)}async upload(t,e,i=null){null==i&&(i=this.name);let r=new FormData;r.append("src",e,t);let n=this.client.newSignedRequest("POST",`${this.urlPrefix}/${i}/upload`,r);return this.client._wrapWithPromise(n)}async uploadFormData(t,e=null){let i=this.client.newSignedRequest("POST",`${this.urlPrefix}/${e}/upload`,t);return this.client._wrapWithPromise(i)}async create_upload_session(t,e,i=null){null==i&&(i=this.name);let r,n={path:t,size:e.size};r=this.client._apiVersionMajor<6?`${this.urlPrefix}/${i}/create_upload_session`:`${this.urlPrefix}/${i}/request-upload`;const o=this.client.newSignedRequest("POST",r,n),s=await this.client._wrapWithPromise(o),a=s.token;let l;return this.client._apiVersionMajor<6?(l=this.client._config.endpoint,"SESSION"===this.client._config.connectionMode&&(l+="/func"),l+=`${this.urlPrefix}/_/tus/upload/${a}`):l=`${s.url}?token=${a}`,Promise.resolve(l)}async mkdir(t,e=null){null==e&&(e=this.name);let i={path:t},r=this.client.newSignedRequest("POST",`${this.urlPrefix}/${e}/mkdir`,i);return this.client._wrapWithPromise(r)}async rename_file(t,e,i=null){null==i&&(i=this.name);const r={target_path:t,new_name:e};let n=this.client.newSignedRequest("POST",`${this.urlPrefix}/${i}/rename_file`,r);return this.client._wrapWithPromise(n)}async delete_files(t,e=!1,i=null){null==i&&(i=this.name),null==e&&(e=!1);let r={files:t,recursive:e},n=this.client.newSignedRequest("DELETE",`${this.urlPrefix}/${i}/delete_files`,r);return this.client._wrapWithPromise(n)}async download(t,e=!1,i=!1){let r=Gl({file:t,archive:i}),n=this.client.newSignedRequest("GET",`${this.urlPrefix}/${e}/download_single?${r}`,null);return this.client._wrapWithPromise(n,!0)}async request_download_token(t,e=!1,i=!1){let r,n={file:t,archive:i};r=this.client._apiVersionMajor<6?`${this.urlPrefix}/${e}/request_download`:`${this.urlPrefix}/${e}/request-download`;const o=this.client.newSignedRequest("POST",r,n);return this.client._wrapWithPromise(o)}async download_with_token(t=""){let e=Gl({token:t}),i=this.client.newSignedRequest("GET",`${this.urlPrefix}/_/download_with_token?${e}`,null);return this.client._wrapWithPromise(i,!0)}get_download_url_with_token(t=""){let e=Gl({token:t});return"SESSION"===this.client._config.connectionMode?`${this.client._config.endpoint}/func${this.urlPrefix}/_/download_with_token?${e}`:`${this.client._config.endpoint}${this.urlPrefix}/_/download_with_token?${e}`}async list_files(t,e=null){null==e&&(e=this.name);let i=Gl({path:t}),r=this.client.newSignedRequest("GET",`${this.urlPrefix}/${e}/files?${i}`,null);return this.client._wrapWithPromise(r)}async invite(t,e,i=null){null==i&&(i=this.name);let r={perm:t,user_ids:e},n=this.client.newSignedRequest("POST",`${this.urlPrefix}/${i}/invite`,r);return this.client._wrapWithPromise(n)}async invitations(){let t=this.client.newSignedRequest("GET",this.urlPrefix+"/invitations/list",null);return this.client._wrapWithPromise(t)}async accept_invitation(t){let e={inv_id:t},i=this.client.newSignedRequest("POST",this.urlPrefix+"/invitations/accept",e);return this.client._wrapWithPromise(i)}async delete_invitation(t){let e={inv_id:t},i=this.client.newSignedRequest("DELETE",this.urlPrefix+"/invitations/delete",e);return this.client._wrapWithPromise(i)}async list_invitees(t=null){let e="/folders/_/shared";null!==t&&(e=`${e}?vfolder_id=${t}`);let i=this.client.newSignedRequest("GET",e,null);return this.client._wrapWithPromise(i)}async modify_invitee_permission(t){let e=this.client.newSignedRequest("POST","/folders/_/shared",t);return this.client._wrapWithPromise(e)}}class s{constructor(t){this.client=t}async list(t="ALIVE",e=["id","status","region","first_contact","cpu_cur_pct","mem_cur_bytes","available_slots","occupied_slots"]){if(!1===["ALIVE","TERMINATED"].includes(t))return Promise.resolve(!1);let i="query($status: String) {  agents(status: $status) {     "+e.join(" ")+"  }}",r={status:t};return this.client.query(i,r)}}class a{constructor(t,e=null){this.client=t,this.name=e}async info(t,e=["access_key","secret_key","is_active","is_admin","user_id","created_at","last_used","concurrency_limit","concurrency_used","rate_limit","num_queries","resource_policy"]){let i,r;return this.client.is_admin?(i="query($access_key: String!) {  keypair(access_key: $access_key) {    "+e.join(" ")+"  }}",r={access_key:t}):(i="query {  keypair {    "+e.join(" ")+"  }}",r={}),this.client.query(i,r)}async list(t=null,e=["access_key","is_active","is_admin","user_id","created_at","last_used","concurrency_used","rate_limit","num_queries","resource_policy"],i=!0){let r,n;if(this.client._apiVersionMajor<5)return r=this.client.is_admin&&null==t?`\n        query($is_active: Boolean) {\n          keypairs(is_active: $is_active) {\n            ${e.join(" ")}\n          }\n        }\n      `:`\n        query($email: String!, $is_active: Boolean) {\n          keypairs(email: $email, is_active: $is_active) {\n            ${e.join(" ")}\n          }\n        }\n      `,n={email:t||this.client.email,is_active:i},this.client.query(r,n);{const o=100,s=[];r=this.client.is_admin&&null==t?`\n        query($offset:Int!, $limit:Int!, $is_active: Boolean) {\n          keypair_list(offset:$offset, limit:$limit, is_active: $is_active) {\n            items { ${e.join(" ")} }\n            total_count\n          }\n        }\n      `:`\n        query($offset:Int!, $limit:Int!, $email: String!, $is_active: Boolean) {\n          keypair_list(offset:$offset, limit:$limit, email: $email, is_active: $is_active) {\n            items { ${e.join(" ")} }\n            total_count\n          }\n        }\n      `;for(let e=0;e<10*o;e+=o){n={offset:e,limit:o,email:t||this.client.email,is_active:i};const a=await this.client.query(r,n);if(s.push(...a.keypair_list.items),e>=a.keypair_list.total_count)break}const a={keypairs:s};return Promise.resolve(a)}}async add(t=null,e=!0,i=!1,r="default",n=1e3){let o=`mutation($user_id: String!, $input: KeyPairInput!) {  create_keypair(user_id: $user_id, props: $input) {    ok msg keypair { ${["is_active","is_admin","resource_policy","concurrency_limit","rate_limit"].join(" ")} }  }}`,s={user_id:t,input:{is_active:e,is_admin:i,resource_policy:r,rate_limit:n}};return this.client.query(o,s)}async mutate(t,e){let i={access_key:t,input:e};return this.client.query("mutation($access_key: String!, $input: ModifyKeyPairInput!) {  modify_keypair(access_key: $access_key, props: $input) {    ok msg  }}",i)}async delete(t){let e={access_key:t};return this.client.query("mutation($access_key: String!) {  delete_keypair(access_key: $access_key) {    ok msg  }}",e)}}class l{constructor(t){this.client=t}async get(t=null,e=["name","created_at","default_for_unspecified","total_resource_slots","max_concurrent_sessions","max_containers_per_session","max_vfolder_count","max_vfolder_size","allowed_vfolder_hosts","idle_timeout"]){let i,r;return null===t?(i=`query {  keypair_resource_policies { ${e.join(" ")} }}`,r={n:t}):(i=`query($n:String!) {  keypair_resource_policy(name: $n) { ${e.join(" ")} }}`,r={n:t}),this.client.query(i,r)}async add(t=null,e){let i=["name","created_at","default_for_unspecified","total_resource_slots","max_concurrent_sessions","max_containers_per_session","max_vfolder_count","max_vfolder_size","allowed_vfolder_hosts","idle_timeout"];if(!0===this.client.is_admin&&null!==t){let r=`mutation($name: String!, $input: CreateKeyPairResourcePolicyInput!) {  create_keypair_resource_policy(name: $name, props: $input) {    ok msg resource_policy { ${i.join(" ")} }  }}`,n={name:t,input:e};return this.client.query(r,n)}return Promise.resolve(!1)}async mutate(t=null,e){if(!0===this.client.is_admin&&null!==t){let i="mutation($name: String!, $input: ModifyKeyPairResourcePolicyInput!) {  modify_keypair_resource_policy(name: $name, props: $input) {    ok msg   }}",r={name:t,input:e};return this.client.query(i,r)}return Promise.resolve(!1)}}class d{constructor(t){this.client=t}async list(t=["name","tag","registry","digest","installed","labels { key value }","resource_limits { key min max }"],e=!1,i=!1){let r,n;return this.client.supports("system-images")?!0===e?(r=`query($installed:Boolean) {  images(is_installed:$installed) { ${t.join(" ")} }}`,n={installed:e,is_operation:i}):(r=`query {  images { ${t.join(" ")} }}`,n={is_operation:i}):(r=`query {  images { ${t.join(" ")} }}`,n={}),this.client.query(r,n)}async modifyResource(t,e,i,r){let n=[];return t=t.replace(":","%3A"),e=e.replace("/","%2F"),Object.keys(r).forEach((o=>{Object.keys(r[o]).forEach((s=>{const a=this.client.newSignedRequest("POST","/config/set",{key:`images/${t}/${e}/${i}/resource/${o}/${s}`,value:r[o][s]});n.push(this.client._wrapWithPromise(a))}))})),Promise.all(n)}async modifyLabel(t,e,i,r,n){t=t.replace(":","%3A"),e=e.replace("/","%2F"),i=i.replace("/","%2F");const o=this.client.newSignedRequest("POST","/config/set",{key:`images/${t}/${e}/${i}/labels/${r}`,value:n});return this.client._wrapWithPromise(o)}async install(t,e={},i="index.docker.io"){"index.docker.io"!=i?i+="/":i="",i=i.replace(":","%3A");let r=this.client.generateSessionId();return 0===Object.keys(e).length&&(e={cpu:"1",mem:"512m"}),this.client.createIfNotExists(i+t,r,e,6e5).then((t=>this.client.destroyKernel(r))).catch((t=>{throw t}))}async uninstall(t,e="index.docker.io"){return Promise.resolve(!1)}async get(t,e,i){t=t.replace(":","%3A");const r=this.client.newSignedRequest("POST","/config/get",{key:`images/${t}/${e}/${i}/resource/`,prefix:!0});return this.client._wrapWithPromise(r)}}class c{constructor(t){this.client=t}async list(t=["id","name","image","created_at","terminated_at","status","status_info","occupied_slots","containers {live_stat last_stat}"],e="RUNNING",i="",r=30,n=0,o=""){let s,a;return s=`query($limit:Int!, $offset:Int!, $ak:String, $group_id:String, $status:String) {\n      compute_session_list(limit:$limit, offset:$offset, access_key:$ak, group_id:$group_id, status:$status) {\n        items { ${(t=this.client._updateFieldCompatibilityByAPIVersion(t)).join(" ")}}\n        total_count\n      }\n    }`,a={limit:r,offset:n,status:e},""!=i&&(a.ak=i),""!=o&&(a.group_id=o),this.client.query(s,a)}async listAll(t=["id","name","image","created_at","terminated_at","status","status_info","occupied_slots","containers {live_stat last_stat}"],e="RUNNING,RESTARTING,TERMINATING,PENDING,PREPARING,PULLING,TERMINATED,CANCELLED,ERROR",i="",r=100,n=0,o=""){let s,a;const l=[];s=`query($limit:Int!, $offset:Int!, $ak:String, $group_id:String, $status:String) {\n      compute_session_list(limit:$limit, offset:$offset, access_key:$ak, group_id:$group_id, status:$status) {\n        items { ${(t=this.client._updateFieldCompatibilityByAPIVersion(t)).join(" ")}}\n        total_count\n      }\n    }`;for(let t=0;t<10*r;t+=r){a={limit:r,offset:t,status:e},""!=i&&(a.access_key=i),""!=o&&(a.group_id=o);const n=await this.client.query(s,a);if(console.log(n.compute_session_list.total_count),l.push(...n.compute_session_list.items),t>=n.compute_session_list.total_count)break}return Promise.resolve(l)}async get(t=["id","session_name","lang","created_at","terminated_at","status","status_info","occupied_slots","cpu_used","io_read_bytes","io_write_bytes"],e="",i="",r=""){let n,o;return n=`query($ak:String, $domain_name:String, $session_name:String!) {\n      compute_session(access_key:$ak, domain_name:$domain_name, sess_id:$session_name) {\n        ${(t=this.client._updateFieldCompatibilityByAPIVersion(t)).join(" ")}\n      }\n    }`,o={ak:r,domain_name:i,session_name:e},this.client.query(n,o)}}class h{constructor(t){this.client=t,this.resources={},this._init_resource_values()}_init_resource_values(){this.resources.cpu={},this.resources.cpu.total=0,this.resources.cpu.used=0,this.resources.cpu.percent=0,this.resources.mem={},this.resources.mem.total=0,this.resources.mem.allocated=0,this.resources.mem.used=0,this.resources.gpu={},this.resources.gpu.total=0,this.resources.gpu.used=0,this.resources["cuda.device"]={},this.resources["cuda.device"].total=0,this.resources["cuda.device"].used=0,this.resources.fgpu={},this.resources.fgpu.total=0,this.resources.fgpu.used=0,this.resources["cuda.shares"]={},this.resources["cuda.shares"].total=0,this.resources["cuda.shares"].used=0,this.resources["rocm.device"]={},this.resources["rocm.device"].total=0,this.resources["rocm.device"].used=0,this.resources["tpu.device"]={},this.resources["tpu.device"].total=0,this.resources["tpu.device"].used=0,this.resources.agents={},this.resources.agents.total=0,this.resources.agents.using=0,this.agents=[]}async totalResourceInformation(t="ALIVE"){if(this.client.is_admin){let e=["id","addr","status","first_contact","cpu_cur_pct","mem_cur_bytes","occupied_slots","available_slots"];return this.client.agent.list(t,e).then((t=>(this._init_resource_values(),this.agents=t.agents,Object.keys(this.agents).map(((t,e)=>{let i=this.agents[t],r=JSON.parse(i.occupied_slots),n=JSON.parse(i.available_slots);"cpu"in n&&(this.resources.cpu.total=this.resources.cpu.total+Math.floor(Number(n.cpu))),"cpu"in r&&(this.resources.cpu.used=this.resources.cpu.used+Math.floor(Number(r.cpu))),this.resources.cpu.percent=this.resources.cpu.percent+parseFloat(i.cpu_cur_pct),void 0===r.mem&&(r.mem=0),this.resources.mem.total=parseFloat(this.resources.mem.total)+parseInt(this.client.utils.changeBinaryUnit(n.mem,"b")),this.resources.mem.allocated=parseInt(this.resources.mem.allocated)+parseInt(this.client.utils.changeBinaryUnit(r.mem,"b")),this.resources.mem.used=parseInt(this.resources.mem.used)+parseInt(this.client.utils.changeBinaryUnit(i.mem_cur_bytes,"b")),"cuda.device"in n&&(this.resources["cuda.device"].total=parseInt(this.resources["cuda.device"].total)+Math.floor(Number(n["cuda.device"]))),"cuda.device"in r&&(this.resources["cuda.device"].used=parseInt(this.resources["cuda.device"].used)+Math.floor(Number(r["cuda.device"]))),"cuda.shares"in n&&(this.resources["cuda.shares"].total=parseFloat(this.resources["cuda.shares"].total)+parseFloat(n["cuda.shares"])),"cuda.shares"in r&&(this.resources["cuda.shares"].used=parseFloat(this.resources["cuda.shares"].used)+parseFloat(r["cuda.shares"])),"rocm.device"in n&&(this.resources["rocm.device"].total=parseInt(this.resources["rocm.device"].total)+Math.floor(Number(n["rocm.device"]))),"rocm.device"in r&&(this.resources["rocm.device"].used=parseInt(this.resources["rocm.device"].used)+Math.floor(Number(r["rocm.device"]))),"tpu.device"in n&&(this.resources["tpu.device"].total=parseInt(this.resources["tpu.device"].total)+Math.floor(Number(n["tpu.device"]))),"tpu.device"in r&&(this.resources["tpu.device"].used=parseInt(this.resources["tpu.device"].used)+Math.floor(Number(r["tpu.device"]))),isNaN(this.resources.cpu.used)&&(this.resources.cpu.used=0),isNaN(this.resources.mem.used)&&(this.resources.mem.used=0),isNaN(this.resources.gpu.used)&&(this.resources.gpu.used=0),isNaN(this.resources.fgpu.used)&&(this.resources.fgpu.used=0)})),this.resources.gpu.total=this.resources["cuda.device"].total,this.resources.gpu.used=this.resources["cuda.device"].used,this.resources.fgpu.used=this.resources["cuda.shares"].used.toFixed(2),this.resources.fgpu.total=this.resources["cuda.shares"].total.toFixed(2),this.resources.agents.total=Object.keys(this.agents).length,this.resources.agents.using=Object.keys(this.agents).length,Promise.resolve(this.resources)))).catch((t=>{throw t}))}return Promise.resolve(!1)}async user_stats(){const t=this.client.newSignedRequest("GET","/resource/stats/user/month",null);return this.client._wrapWithPromise(t)}}class u{constructor(t){this.client=t}async list(t=!0,e=!1,i=["id","name","description","is_active","created_at","modified_at","domain_name"]){let r,n;return!0===this.client.is_admin?(r=`query($is_active:Boolean) {  groups(is_active:$is_active) { ${i.join(" ")} }}`,n={is_active:t},!1!==e&&(r=`query($domain_name: String, $is_active:Boolean) {  groups(domain_name: $domain_name, is_active:$is_active) { ${i.join(" ")} }}`,n={is_active:t,domain_name:e})):(r=`query($is_active:Boolean) {  groups(is_active:$is_active) { ${i.join(" ")} }}`,n={is_active:t}),this.client.query(r,n)}}class p{constructor(t){this.client=t}async get(t=!1,e=["name","description","is_active","created_at","modified_at","total_resource_slots","allowed_vfolder_hosts","allowed_docker_registries","integration_id","scaling_groups"]){let i,r;if(!1!==t)return i=`query($name: String) {  domain(name: $name) { ${e.join(" ")} }}`,r={name:t},this.client.query(i,r)}async list(t=["name","description","is_active","created_at","total_resource_slots","allowed_vfolder_hosts","allowed_docker_registries","integration_id"]){let e=`query { domains { ${t.join(" ")} }}`;return this.client.query(e,{})}async update(t=!1,e){if(!0===this.client.is_superadmin){let i="mutation($name: String!, $input: ModifyDomainInput!) {  modify_domain(name: $name, props: $input) {    ok msg  }}",r={name:t,input:e};return this.client.query(i,r)}return Promise.resolve(!1)}}class f{constructor(t){this.client=t,this.urlPrefix="/resource"}async rescan_images(t=""){if(!0===this.client.is_admin){let e,i;return""!==t?(t=decodeURIComponent(t),e="mutation($registry: String) {  rescan_images(registry: $registry) {    ok msg   }}",i={registry:t}):(e="mutation {  rescan_images {    ok msg   }}",i={}),this.client.query(e,i,null,6e5)}return Promise.resolve(!1)}async recalculate_usage(){if(!0===this.client.is_superadmin){let t=this.client.newSignedRequest("POST",this.urlPrefix+"/recalculate-usage",null);return this.client._wrapWithPromise(t,null,null,6e4)}}}class m{constructor(t){this.client=t}async list(t=!0,e=["username","password","need_password_change","full_name","description","is_active","domain_name","role","groups {id name}"]){let i,r;if(this.client._apiVersionMajor<5)return i=this.client.is_admin?`\n        query($is_active:Boolean) {\n          users(is_active:$is_active) { ${e.join(" ")} }\n        }\n      `:`\n        query {\n          users { ${e.join(" ")} }\n        }\n      `,r=this.client.is_admin?{is_active:t}:{},this.client.query(i,r);{const n=100,o=[];i=this.client.is_admin?`\n        query($offset:Int!, $limit:Int!, $is_active:Boolean) {\n          user_list(offset:$offset, limit:$limit, is_active:$is_active) {\n            items { ${e.join(" ")} }\n            total_count\n          }\n        }\n      `:`\n        query($offset:Int!, $limit:Int!) {\n          user_list(offset:$offset, limit:$limit) {\n            items { ${e.join(" ")} }\n            total_count\n          }\n        }\n      `;for(let e=0;e<10*n;e+=n){r=this.client.is_admin?{offset:e,limit:n,is_active:t}:{offset:e,limit:n};const s=await this.client.query(i,r);if(o.push(...s.user_list.items),e>=s.user_list.total_count)break}const s={users:o};return Promise.resolve(s)}}async get(t,e=["email","username","password","need_password_change","full_name","description","is_active","domain_name","role","groups {id name}"]){let i,r;return!0===this.client.is_admin?(i=`query($email:String) {  user (email:$email) { ${e.join(" ")} }}`,r={email:t}):(i=`query {  user { ${e.join(" ")} }}`,r={}),this.client.query(i,r)}async create(t=null,e){let i=["username","password","need_password_change","full_name","description","is_active","domain_name","role","groups{id, name}"];if(!0===this.client.is_admin){let r=`mutation($email: String!, $input: UserInput!) {  create_user(email: $email, props: $input) {    ok msg user { ${i.join(" ")} }  }}`,n={email:t,input:e};return this.client.query(r,n)}return Promise.resolve(!1)}async update(t=null,e){if(!0===this.client.is_superadmin){let i="mutation($email: String!, $input: ModifyUserInput!) {  modify_user(email: $email, props: $input) {    ok msg  }}",r={email:t,input:e};return this.client.query(i,r)}return Promise.resolve(!1)}async delete(t){if(!0===this.client.is_superadmin){let e="mutation($email: String!) {  delete_user(email: $email) {    ok msg  }}",i={email:t};return this.client.query(e,i)}return Promise.resolve(!1)}}class g{constructor(t){this.client=t}async list_available(){if(!0===this.client.is_superadmin){const t=`query {  scaling_groups { ${["name","description","is_active","created_at","driver","driver_opts","scheduler","scheduler_opts"].join(" ")} }}`,e={};return this.client.query(t,e)}return Promise.resolve(!1)}async list(t="default"){const e="/scaling-groups?group="+t,i=this.client.newSignedRequest("GET",e,null);return this.client._wrapWithPromise(i)}async create(t,e=""){let i={name:t,input:{description:e,is_active:!0,driver:"static",scheduler:"fifo",driver_opts:"{}",scheduler_opts:"{}"}};return this.client.query("mutation($name: String!, $input: ScalingGroupInput!) {  create_scaling_group(name: $name, props: $input) {    ok msg  }}",i)}async associate_domain(t,e){let i={domain:t,scaling_group:e};return this.client.query("mutation($domain: String!, $scaling_group: String!) {  associate_scaling_group_with_domain(domain: $domain, scaling_group: $scaling_group) {    ok msg  }}",i)}async update(t,e){let i={name:t,input:e};return this.client.query("mutation($name: String!, $input: ModifyScalingGroupInput!) {  modify_scaling_group(name: $name, props: $input) {    ok msg  }}",i)}async delete(t){let e={name:t};return this.client.query("mutation($name: String!) {  delete_scaling_group(name: $name) {    ok msg  }}",e)}}class b{constructor(t){this.client=t}async list(){const t=this.client.newSignedRequest("POST","/config/get",{key:"config/docker/registry",prefix:!0});return this.client._wrapWithPromise(t)}async add(t,e){let i="config/docker/registry/"+(t=encodeURIComponent(t));const r=this.client.newSignedRequest("POST","/config/set",{key:i,value:e});return this.client._wrapWithPromise(r)}async delete(t){t=encodeURIComponent(t);const e=this.client.newSignedRequest("POST","/config/delete",{key:"config/docker/registry/"+t,prefix:!0});return this.client._wrapWithPromise(e)}}class v{constructor(t){this.client=t,this.config=null}async list(t=""){t="config/"+t;const e=this.client.newSignedRequest("POST","/config/get",{key:t,prefix:!0});return this.client._wrapWithPromise(e)}async get(t){t="config/"+t;const e=this.client.newSignedRequest("POST","/config/get",{key:t,prefix:!1});return this.client._wrapWithPromise(e)}async set(t,e){t="config/"+t;const i=this.client.newSignedRequest("POST","/config/set",{key:t,value:e});return this.client._wrapWithPromise(i)}async delete(t,e=!1){t="config/"+t;const i=this.client.newSignedRequest("POST","/config/delete",{key:""+t,prefix:e});return this.client._wrapWithPromise(i)}}class y{constructor(t){this.client=t,this.config=null}async get_announcement(){const t=this.client.newSignedRequest("GET","/manager/announcement",null);return this.client._wrapWithPromise(t)}async update_announcement(t=!0,e){const i=this.client.newSignedRequest("POST","/manager/announcement",{enabled:t,message:e});return this.client._wrapWithPromise(i)}}class _{constructor(t){this.client=t,this.config=null}async get_bootstrap_script(){if(!this.client._config.accessKey)throw"Your access key is not set";const t=this.client.newSignedRequest("GET","/user-config/bootstrap-script");return this.client._wrapWithPromise(t)}async update_bootstrap_script(t){const e=this.client.newSignedRequest("POST","/user-config/bootstrap-script",{script:t});return this.client._wrapWithPromise(e)}async create(t="",e){if(!this.client._config.accessKey)throw"Your access key is not set";let i={path:e,data:t,permission:"644"};const r=this.client.newSignedRequest("POST","/user-config/dotfiles",i);return this.client._wrapWithPromise(r)}async get(){if(!this.client._config.accessKey)throw"Your access key is not set";const t=this.client.newSignedRequest("GET","/user-config/dotfiles");return this.client._wrapWithPromise(t)}async update(t,e){let i={data:t,path:e,permission:"644"};const r=this.client.newSignedRequest("PATCH","/user-config/dotfiles",i);return this.client._wrapWithPromise(r)}async delete(t){let e={path:t};const i=this.client.newSignedRequest("DELETE","/user-config/dotfiles",e);return this.client._wrapWithPromise(i)}}class w{constructor(t){this.client=t,this.config=null}async getLicense(){if(!0!==this.client.is_superadmin)return Promise.resolve(!1);if(void 0===this.certificate){const t=this.client.newSignedRequest("GET","/license");let e=await this.client._wrapWithPromise(t);return this.certificate=e.certificate,"valid"===e.status?this.certificate.valid=!0:this.certificate.valid=!1,Promise.resolve(this.certificate)}}}class x{constructor(t){this.client=t,this.config=null}async ping(){const t=this.client.newSignedRequest("GET","/cloud/ping");return this.client._wrapWithPromise(t)}async verify_email(t){const e={verification_code:t},i=this.client.newSignedRequest("POST","/cloud/verify-email",e);return this.client._wrapWithPromise(i)}async send_verification_email(t){const e={email:t},i=this.client.newSignedRequest("POST","/cloud/send-verification-email",e);return this.client._wrapWithPromise(i)}async send_password_change_email(t){const e={email:t},i=this.client.newSignedRequest("POST","/cloud/send-password-change-email",e);return this.client._wrapWithPromise(i)}async change_password(t,e,i){const r={email:t,password:e,token:i},n=this.client.newSignedRequest("POST","/cloud/change-password",r);return this.client._wrapWithPromise(n)}}class M{constructor(t){this.client=t}changeBinaryUnit(t,e="g",i="b"){if(void 0===t)return t;let r;const n=["b","k","m","g","t","p","auto"],o=["B","KiB","MiB","GiB","TiB","PiB"];if(!n.includes(e))return!1;if((t=t.toString()).indexOf(" ")>=0){let e=t.split(/(\s+)/);t=o.includes(e[2])?e[0]+n[o.indexOf(e[2])]:e[0]}return n.includes(t.substr(-1))?(r=t.substr(-1),t=t.slice(0,-1)):r=i,t*Math.pow(1024,Math.floor(n.indexOf(r)-n.indexOf(e)))}elapsedTime(t,e){var i=new Date(t);if(null===e)var r=new Date;else r=new Date(e);var n=Math.floor((r.getTime()-i.getTime())/1e3),o=Math.floor(n/86400);n-=86400*o;var s=Math.floor(n/3600);n-=3600*s;var a=Math.floor(n/60),l=n-=60*a,d="";return void 0!==o&&o>0&&(d=d+String(o)+" Day "),void 0!==s&&(d=d+this._padding_zeros(s,2)+":"),void 0!==a&&(d=d+this._padding_zeros(a,2)+":"),d+this._padding_zeros(l,2)+""}_padding_zeros(t,e){return(t+="").length>=e?t:new Array(e-t.length+1).join("0")+t}gqlToObject(t,e){let i={};return t.forEach((function(t){i[t[e]]=t})),i}gqlToList(t,e){let i=[];return t.forEach((function(t){i.push(t[e])})),i}}Object.defineProperty(r,"ERR_SERVER",{value:0,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(r,"ERR_RESPONSE",{value:1,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(r,"ERR_REQUEST",{value:2,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(r,"ERR_ABORT",{value:3,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(r,"ERR_TIMEOUT",{value:4,writable:!1,enumerable:!0,configurable:!1}),Object.defineProperty(r,"ERR_UNKNOWN",{value:99,writable:!1,enumerable:!0,configurable:!1});const k={Client:r,ClientConfig:i};Kl.backend=k,Kl.Client=r,Kl.ClientConfig=i,Kl.BackendAIClient=r,Kl.BackendAIClientConfig=i}).call(this)}.call(this,E,d({}).Buffer),Kl}));
/**
 @license
 Copyright 2020 Google Inc. All Rights Reserved.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 */
let Go=class extends Ur{static get styles(){return[Hr,Ct`
        .mdc-select__anchor {
          min-width: var(--mdc-select-min-width, 200px);
        }
        .mdc-select--filled {
          min-width: var(--mdc-select-min-width, 200px);
        }
      `]}};Go=r([bt("mwc-multi-select")],Go);let Ko=class extends Ot{static get styles(){return[Ct`
        :host {
          display: block;
          position: fixed;
          top: 100%;
          left: 0;
          right: 0;
          padding: 12px;
          background-color: #246;
          color: white;
          box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
          text-align: center;
          will-change: transform;
          transform: translate3d(0, 0, 0);
          transition-property: visibility, transform;
          transition-duration: 0.2s;
          visibility: hidden;
        }

        :host([active]) {
          visibility: visible;
          transform: translate3d(0, -100%, 0);
        }

        @media (min-width: 460px) {
          :host {
            width: 320px;
            margin: auto;
          }
        }
      `]}render(){return Z`
      <slot></slot>
    `}};Ko=r([bt("backend-ai-offline-indicator")],Ko);
/**
 * @license
 * Copyright 2016 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var Xo={ARIA_CONTROLS:"aria-controls",INPUT_SELECTOR:".mdc-text-field__input",LABEL_SELECTOR:".mdc-floating-label",LEADING_ICON_SELECTOR:".mdc-text-field__icon--leading",LINE_RIPPLE_SELECTOR:".mdc-line-ripple",OUTLINE_SELECTOR:".mdc-notched-outline",PREFIX_SELECTOR:".mdc-text-field__affix--prefix",SUFFIX_SELECTOR:".mdc-text-field__affix--suffix",TRAILING_ICON_SELECTOR:".mdc-text-field__icon--trailing"},Zo={DISABLED:"mdc-text-field--disabled",FOCUSED:"mdc-text-field--focused",HELPER_LINE:"mdc-text-field-helper-line",INVALID:"mdc-text-field--invalid",LABEL_FLOATING:"mdc-text-field--label-floating",NO_LABEL:"mdc-text-field--no-label",OUTLINED:"mdc-text-field--outlined",ROOT:"mdc-text-field",TEXTAREA:"mdc-text-field--textarea",WITH_LEADING_ICON:"mdc-text-field--with-leading-icon",WITH_TRAILING_ICON:"mdc-text-field--with-trailing-icon"},Yo={LABEL_SCALE:.75},Jo=["pattern","min","max","required","step","minlength","maxlength"],Qo=["color","date","datetime-local","month","range","time","week"],ts=["mousedown","touchstart"],es=["click","keydown"],is=function(t){function r(e,n){void 0===n&&(n={});var o=t.call(this,i(i({},r.defaultAdapter),e))||this;return o.isFocused_=!1,o.receivedUserInput_=!1,o.isValid_=!0,o.useNativeValidation_=!0,o.helperText_=n.helperText,o.characterCounter_=n.characterCounter,o.leadingIcon_=n.leadingIcon,o.trailingIcon_=n.trailingIcon,o.inputFocusHandler_=function(){return o.activateFocus()},o.inputBlurHandler_=function(){return o.deactivateFocus()},o.inputInputHandler_=function(){return o.handleInput()},o.setPointerXOffset_=function(t){return o.setTransformOrigin(t)},o.textFieldInteractionHandler_=function(){return o.handleTextFieldInteraction()},o.validationAttributeChangeHandler_=function(t){return o.handleValidationAttributeChange(t)},o}return e(r,t),Object.defineProperty(r,"cssClasses",{get:function(){return Zo},enumerable:!0,configurable:!0}),Object.defineProperty(r,"strings",{get:function(){return Xo},enumerable:!0,configurable:!0}),Object.defineProperty(r,"numbers",{get:function(){return Yo},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"shouldAlwaysFloat_",{get:function(){var t=this.getNativeInput_().type;return Qo.indexOf(t)>=0},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"shouldFloat",{get:function(){return this.shouldAlwaysFloat_||this.isFocused_||!!this.getValue()||this.isBadInput_()},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"shouldShake",{get:function(){return!this.isFocused_&&!this.isValid()&&!!this.getValue()},enumerable:!0,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!0},registerTextFieldInteractionHandler:function(){},deregisterTextFieldInteractionHandler:function(){},registerInputInteractionHandler:function(){},deregisterInputInteractionHandler:function(){},registerValidationAttributeChangeHandler:function(){return new MutationObserver((function(){}))},deregisterValidationAttributeChangeHandler:function(){},getNativeInput:function(){return null},isFocused:function(){return!1},activateLineRipple:function(){},deactivateLineRipple:function(){},setLineRippleTransformOrigin:function(){},shakeLabel:function(){},floatLabel:function(){},setLabelRequired:function(){},hasLabel:function(){return!1},getLabelWidth:function(){return 0},hasOutline:function(){return!1},notchOutline:function(){},closeOutline:function(){}}},enumerable:!0,configurable:!0}),r.prototype.init=function(){var t=this;this.adapter.hasLabel()&&this.getNativeInput_().required&&this.adapter.setLabelRequired(!0),this.adapter.isFocused()?this.inputFocusHandler_():this.adapter.hasLabel()&&this.shouldFloat&&(this.notchOutline(!0),this.adapter.floatLabel(!0),this.styleFloating_(!0)),this.adapter.registerInputInteractionHandler("focus",this.inputFocusHandler_),this.adapter.registerInputInteractionHandler("blur",this.inputBlurHandler_),this.adapter.registerInputInteractionHandler("input",this.inputInputHandler_),ts.forEach((function(e){t.adapter.registerInputInteractionHandler(e,t.setPointerXOffset_)})),es.forEach((function(e){t.adapter.registerTextFieldInteractionHandler(e,t.textFieldInteractionHandler_)})),this.validationObserver_=this.adapter.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler_),this.setCharacterCounter_(this.getValue().length)},r.prototype.destroy=function(){var t=this;this.adapter.deregisterInputInteractionHandler("focus",this.inputFocusHandler_),this.adapter.deregisterInputInteractionHandler("blur",this.inputBlurHandler_),this.adapter.deregisterInputInteractionHandler("input",this.inputInputHandler_),ts.forEach((function(e){t.adapter.deregisterInputInteractionHandler(e,t.setPointerXOffset_)})),es.forEach((function(e){t.adapter.deregisterTextFieldInteractionHandler(e,t.textFieldInteractionHandler_)})),this.adapter.deregisterValidationAttributeChangeHandler(this.validationObserver_)},r.prototype.handleTextFieldInteraction=function(){var t=this.adapter.getNativeInput();t&&t.disabled||(this.receivedUserInput_=!0)},r.prototype.handleValidationAttributeChange=function(t){var e=this;t.some((function(t){return Jo.indexOf(t)>-1&&(e.styleValidity_(!0),e.adapter.setLabelRequired(e.getNativeInput_().required),!0)})),t.indexOf("maxlength")>-1&&this.setCharacterCounter_(this.getValue().length)},r.prototype.notchOutline=function(t){if(this.adapter.hasOutline()&&this.adapter.hasLabel())if(t){var e=this.adapter.getLabelWidth()*Yo.LABEL_SCALE;this.adapter.notchOutline(e)}else this.adapter.closeOutline()},r.prototype.activateFocus=function(){this.isFocused_=!0,this.styleFocused_(this.isFocused_),this.adapter.activateLineRipple(),this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.adapter.shakeLabel(this.shouldShake)),this.helperText_&&this.helperText_.showToScreenReader()},r.prototype.setTransformOrigin=function(t){if(!this.isDisabled()&&!this.adapter.hasOutline()){var e=t.touches,i=e?e[0]:t,r=i.target.getBoundingClientRect(),n=i.clientX-r.left;this.adapter.setLineRippleTransformOrigin(n)}},r.prototype.handleInput=function(){this.autoCompleteFocus(),this.setCharacterCounter_(this.getValue().length)},r.prototype.autoCompleteFocus=function(){this.receivedUserInput_||this.activateFocus()},r.prototype.deactivateFocus=function(){this.isFocused_=!1,this.adapter.deactivateLineRipple();var t=this.isValid();this.styleValidity_(t),this.styleFocused_(this.isFocused_),this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.adapter.shakeLabel(this.shouldShake)),this.shouldFloat||(this.receivedUserInput_=!1)},r.prototype.getValue=function(){return this.getNativeInput_().value},r.prototype.setValue=function(t){this.getValue()!==t&&(this.getNativeInput_().value=t),this.setCharacterCounter_(t.length);var e=this.isValid();this.styleValidity_(e),this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.adapter.shakeLabel(this.shouldShake))},r.prototype.isValid=function(){return this.useNativeValidation_?this.isNativeInputValid_():this.isValid_},r.prototype.setValid=function(t){this.isValid_=t,this.styleValidity_(t);var e=!t&&!this.isFocused_&&!!this.getValue();this.adapter.hasLabel()&&this.adapter.shakeLabel(e)},r.prototype.setUseNativeValidation=function(t){this.useNativeValidation_=t},r.prototype.isDisabled=function(){return this.getNativeInput_().disabled},r.prototype.setDisabled=function(t){this.getNativeInput_().disabled=t,this.styleDisabled_(t)},r.prototype.setHelperTextContent=function(t){this.helperText_&&this.helperText_.setContent(t)},r.prototype.setLeadingIconAriaLabel=function(t){this.leadingIcon_&&this.leadingIcon_.setAriaLabel(t)},r.prototype.setLeadingIconContent=function(t){this.leadingIcon_&&this.leadingIcon_.setContent(t)},r.prototype.setTrailingIconAriaLabel=function(t){this.trailingIcon_&&this.trailingIcon_.setAriaLabel(t)},r.prototype.setTrailingIconContent=function(t){this.trailingIcon_&&this.trailingIcon_.setContent(t)},r.prototype.setCharacterCounter_=function(t){if(this.characterCounter_){var e=this.getNativeInput_().maxLength;if(-1===e)throw new Error("MDCTextFieldFoundation: Expected maxlength html property on text input or textarea.");this.characterCounter_.setCounterValue(t,e)}},r.prototype.isBadInput_=function(){return this.getNativeInput_().validity.badInput||!1},r.prototype.isNativeInputValid_=function(){return this.getNativeInput_().validity.valid},r.prototype.styleValidity_=function(t){var e=r.cssClasses.INVALID;t?this.adapter.removeClass(e):this.adapter.addClass(e),this.helperText_&&this.helperText_.setValidity(t)},r.prototype.styleFocused_=function(t){var e=r.cssClasses.FOCUSED;t?this.adapter.addClass(e):this.adapter.removeClass(e)},r.prototype.styleDisabled_=function(t){var e=r.cssClasses,i=e.DISABLED,n=e.INVALID;t?(this.adapter.addClass(i),this.adapter.removeClass(n)):this.adapter.removeClass(i),this.leadingIcon_&&this.leadingIcon_.setDisabled(t),this.trailingIcon_&&this.trailingIcon_.setDisabled(t)},r.prototype.styleFloating_=function(t){var e=r.cssClasses.LABEL_FLOATING;t?this.adapter.addClass(e):this.adapter.removeClass(e)},r.prototype.getNativeInput_=function(){return(this.adapter?this.adapter.getNativeInput():null)||{disabled:!1,maxLength:-1,required:!1,type:"input",validity:{badInput:!1,valid:!0},value:""}},r}(ee);
/**
 * @license
 * Copyright (c) 2020 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 rs=m((t=>e=>{let i;if(e instanceof U||e instanceof z)throw new Error("The `live` directive is not allowed on text or event bindings");if(e instanceof j)ns(e.strings),i=e.element.hasAttribute(e.name),e.value=i;else{const{element:r,name:n,strings:o}=e.committer;if(ns(o),e instanceof D){if(i=r[n],i===t)return}else e instanceof $&&(i=r.getAttribute(n));if(i===String(t))return}e.setValue(t)})),ns=t=>{if(2!==t.length||""!==t[0]||""!==t[1])throw new Error("`live` bindings can only contain a single expression")},os=["touchstart","touchmove","scroll","mousewheel"],ss=(t={})=>{const e={};for(const i in t)e[i]=t[i];return Object.assign({badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:!0,valueMissing:!1},e)};class as extends Ir{constructor(){super(...arguments),this.mdcFoundationClass=is,this.value="",this.type="text",this.placeholder="",this.label="",this.icon="",this.iconTrailing="",this.disabled=!1,this.required=!1,this.minLength=-1,this.maxLength=-1,this.outlined=!1,this.helper="",this.validateOnInitialRender=!1,this.validationMessage="",this.autoValidate=!1,this.pattern="",this.min="",this.max="",this.step=null,this.size=null,this.helperPersistent=!1,this.charCounter=!1,this.endAligned=!1,this.prefix="",this.suffix="",this.name="",this.readOnly=!1,this.autocapitalize="",this.outlineOpen=!1,this.outlineWidth=0,this.isUiValid=!0,this._validity=ss(),this._outlineUpdateComplete=null,this.validityTransform=null}get validity(){return this._checkValidity(this.value),this._validity}get willValidate(){return this.formElement.willValidate}get selectionStart(){return this.formElement.selectionStart}get selectionEnd(){return this.formElement.selectionEnd}get shouldRenderHelperText(){return!!this.helper||!!this.validationMessage||this.charCounterVisible}get charCounterVisible(){return this.charCounter&&-1!==this.maxLength}focus(){const t=new CustomEvent("focus");this.formElement.dispatchEvent(t),this.formElement.focus()}blur(){const t=new CustomEvent("blur");this.formElement.dispatchEvent(t),this.formElement.blur()}select(){this.formElement.select()}setSelectionRange(t,e,i){this.formElement.setSelectionRange(t,e,i)}update(t){t.has("value")&&"string"!=typeof this.value&&(this.value=""+this.value),super.update(t)}render(){const t={"mdc-text-field--disabled":this.disabled,"mdc-text-field--no-label":!this.label,"mdc-text-field--filled":!this.outlined,"mdc-text-field--outlined":this.outlined,"mdc-text-field--with-leading-icon":this.icon,"mdc-text-field--with-trailing-icon":this.iconTrailing,"mdc-text-field--end-aligned":this.endAligned};return Z`
      <label class="mdc-text-field ${be(t)}">
        ${this.renderRipple()}
        ${this.outlined?this.renderOutline():this.renderLabel()}
        ${this.renderLeadingIcon()}
        ${this.renderPrefix()}
        ${this.renderInput()}
        ${this.renderSuffix()}
        ${this.renderTrailingIcon()}
        ${this.renderLineRipple()}
      </label>
      ${this.renderHelperText(this.renderCharCounter())}
    `}updated(t){t.has("value")&&void 0!==t.get("value")&&this.mdcFoundation.setValue(this.value)}renderRipple(){return this.outlined?_:Z`
      <span class="mdc-text-field__ripple"></span>
    `}renderOutline(){return this.outlined?Z`
      <mwc-notched-outline
          .width=${this.outlineWidth}
          .open=${this.outlineOpen}
          class="mdc-notched-outline">
        ${this.renderLabel()}
      </mwc-notched-outline>`:_}renderLabel(){return this.label?Z`
      <span
          .floatingLabelFoundation=${Lr(this.label)}
          id="label">${this.label}</span>
    `:_}renderLeadingIcon(){return this.icon?this.renderIcon(this.icon):_}renderTrailingIcon(){return this.iconTrailing?this.renderIcon(this.iconTrailing,!0):_}renderIcon(t,e=!1){return Z`<i class="material-icons mdc-text-field__icon ${be({"mdc-text-field__icon--leading":!e,"mdc-text-field__icon--trailing":e})}">${t}</i>`}renderPrefix(){return this.prefix?this.renderAffix(this.prefix):_}renderSuffix(){return this.suffix?this.renderAffix(this.suffix,!0):_}renderAffix(t,e=!1){return Z`<span class="mdc-text-field__affix ${be({"mdc-text-field__affix--prefix":!e,"mdc-text-field__affix--suffix":e})}">
        ${t}</span>`}renderInput(){const t=-1===this.minLength?void 0:this.minLength,e=-1===this.maxLength?void 0:this.maxLength,i=this.autocapitalize?this.autocapitalize:void 0;return Z`
      <input
          aria-labelledby="label"
          class="mdc-text-field__input"
          type="${this.type}"
          .value="${rs(this.value)}"
          ?disabled="${this.disabled}"
          placeholder="${this.placeholder}"
          ?required="${this.required}"
          ?readonly="${this.readOnly}"
          minlength="${oi(t)}"
          maxlength="${oi(e)}"
          pattern="${oi(this.pattern?this.pattern:void 0)}"
          min="${oi(""===this.min?void 0:this.min)}"
          max="${oi(""===this.max?void 0:this.max)}"
          step="${oi(null===this.step?void 0:this.step)}"
          size="${oi(null===this.size?void 0:this.size)}"
          name="${oi(""===this.name?void 0:this.name)}"
          inputmode="${oi(this.inputMode)}"
          autocapitalize="${oi(i)}"
          @input="${this.handleInputChange}"
          @blur="${this.onInputBlur}">`}renderLineRipple(){return this.outlined?_:Z`
      <span .lineRippleFoundation=${$r()}></span>
    `}renderHelperText(t=_){if(!this.shouldRenderHelperText)return _;const e=this.validationMessage&&!this.isUiValid,i={"mdc-text-field-helper-text--persistent":this.helperPersistent,"mdc-text-field-helper-text--validation-msg":e};return Z`
      <div class="mdc-text-field-helper-line">
        <div class="mdc-text-field-helper-text ${be(i)}">${e?this.validationMessage:this.helper}</div>
        ${t}
      </div>
    `}renderCharCounter(){if(!this.charCounterVisible)return _;const t=Math.min(this.value.length,this.maxLength);return Z`<span class="mdc-text-field-character-counter">${t} / ${this.maxLength}</span>`}onInputBlur(){this.reportValidity()}checkValidity(){const t=this._checkValidity(this.value);if(!t){const t=new Event("invalid",{bubbles:!1,cancelable:!0});this.dispatchEvent(t)}return t}reportValidity(){const t=this.checkValidity();return this.mdcFoundation.setValid(t),this.isUiValid=t,t}_checkValidity(t){const e=this.formElement.validity;let i=ss(e);if(this.validityTransform){const e=this.validityTransform(t,i);i=Object.assign(Object.assign({},i),e),this.mdcFoundation.setUseNativeValidation(!1)}else this.mdcFoundation.setUseNativeValidation(!0);return this._validity=i,this._validity.valid}setCustomValidity(t){this.validationMessage=t,this.formElement.setCustomValidity(t)}handleInputChange(){this.value=this.formElement.value,this.autoValidate&&this.reportValidity()}createFoundation(){void 0!==this.mdcFoundation&&this.mdcFoundation.destroy(),this.mdcFoundation=new this.mdcFoundationClass(this.createAdapter()),this.mdcFoundation.init()}createAdapter(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.getRootAdapterMethods()),this.getInputAdapterMethods()),this.getLabelAdapterMethods()),this.getLineRippleAdapterMethods()),this.getOutlineAdapterMethods())}getRootAdapterMethods(){return Object.assign({registerTextFieldInteractionHandler:(t,e)=>this.addEventListener(t,e),deregisterTextFieldInteractionHandler:(t,e)=>this.removeEventListener(t,e),registerValidationAttributeChangeHandler:t=>{const e=new MutationObserver((e=>{t((t=>t.map((t=>t.attributeName)).filter((t=>t)))(e))}));return e.observe(this.formElement,{attributes:!0}),e},deregisterValidationAttributeChangeHandler:t=>t.disconnect()},se(this.mdcRoot))}getInputAdapterMethods(){return{getNativeInput:()=>this.formElement,isFocused:()=>!!this.shadowRoot&&this.shadowRoot.activeElement===this.formElement,registerInputInteractionHandler:(t,e)=>this.formElement.addEventListener(t,e,{passive:t in os}),deregisterInputInteractionHandler:(t,e)=>this.formElement.removeEventListener(t,e)}}getLabelAdapterMethods(){return{floatLabel:t=>this.labelElement&&this.labelElement.floatingLabelFoundation.float(t),getLabelWidth:()=>this.labelElement?this.labelElement.floatingLabelFoundation.getWidth():0,hasLabel:()=>Boolean(this.labelElement),shakeLabel:t=>this.labelElement&&this.labelElement.floatingLabelFoundation.shake(t),setLabelRequired:t=>{this.labelElement&&this.labelElement.floatingLabelFoundation.setRequired(t)}}}getLineRippleAdapterMethods(){return{activateLineRipple:()=>{this.lineRippleElement&&this.lineRippleElement.lineRippleFoundation.activate()},deactivateLineRipple:()=>{this.lineRippleElement&&this.lineRippleElement.lineRippleFoundation.deactivate()},setLineRippleTransformOrigin:t=>{this.lineRippleElement&&this.lineRippleElement.lineRippleFoundation.setRippleCenter(t)}}}async _getUpdateComplete(){await super._getUpdateComplete(),await this._outlineUpdateComplete}async firstUpdated(){const t=this.outlineElement;t&&(this._outlineUpdateComplete=t.updateComplete,await this._outlineUpdateComplete),super.firstUpdated(),this.validateOnInitialRender&&this.reportValidity()}getOutlineAdapterMethods(){return{closeOutline:()=>this.outlineElement&&(this.outlineOpen=!1),hasOutline:()=>Boolean(this.outlineElement),notchOutline:t=>{this.outlineElement&&!this.outlineOpen&&(this.outlineWidth=t,this.outlineOpen=!0)}}}async layout(){await this.updateComplete;const t=this.labelElement;if(!t)return void(this.outlineOpen=!1);const e=!!this.label&&!!this.value;if(t.floatingLabelFoundation.float(e),!this.outlined)return;this.outlineOpen=e,await this.updateComplete;const i=t.floatingLabelFoundation.getWidth();this.outlineOpen&&(this.outlineWidth=i)}}r([wt(".mdc-text-field")],as.prototype,"mdcRoot",void 0),r([wt("input")],as.prototype,"formElement",void 0),r([wt(".mdc-floating-label")],as.prototype,"labelElement",void 0),r([wt(".mdc-line-ripple")],as.prototype,"lineRippleElement",void 0),r([wt("mwc-notched-outline")],as.prototype,"outlineElement",void 0),r([wt(".mdc-notched-outline__notch")],as.prototype,"notchElement",void 0),r([yt({type:String})],as.prototype,"value",void 0),r([yt({type:String})],as.prototype,"type",void 0),r([yt({type:String})],as.prototype,"placeholder",void 0),r([yt({type:String}),fe((function(t,e){void 0!==e&&this.label!==e&&this.layout()}))],as.prototype,"label",void 0),r([yt({type:String})],as.prototype,"icon",void 0),r([yt({type:String})],as.prototype,"iconTrailing",void 0),r([yt({type:Boolean,reflect:!0})],as.prototype,"disabled",void 0),r([yt({type:Boolean})],as.prototype,"required",void 0),r([yt({type:Number})],as.prototype,"minLength",void 0),r([yt({type:Number})],as.prototype,"maxLength",void 0),r([yt({type:Boolean,reflect:!0}),fe((function(t,e){void 0!==e&&this.outlined!==e&&this.layout()}))],as.prototype,"outlined",void 0),r([yt({type:String})],as.prototype,"helper",void 0),r([yt({type:Boolean})],as.prototype,"validateOnInitialRender",void 0),r([yt({type:String})],as.prototype,"validationMessage",void 0),r([yt({type:Boolean})],as.prototype,"autoValidate",void 0),r([yt({type:String})],as.prototype,"pattern",void 0),r([yt({type:String})],as.prototype,"min",void 0),r([yt({type:String})],as.prototype,"max",void 0),r([yt({type:Number})],as.prototype,"step",void 0),r([yt({type:Number})],as.prototype,"size",void 0),r([yt({type:Boolean})],as.prototype,"helperPersistent",void 0),r([yt({type:Boolean})],as.prototype,"charCounter",void 0),r([yt({type:Boolean})],as.prototype,"endAligned",void 0),r([yt({type:String})],as.prototype,"prefix",void 0),r([yt({type:String})],as.prototype,"suffix",void 0),r([yt({type:String})],as.prototype,"name",void 0),r([yt({type:String})],as.prototype,"inputMode",void 0),r([yt({type:Boolean})],as.prototype,"readOnly",void 0),r([yt({type:String})],as.prototype,"autocapitalize",void 0),r([yt({type:Boolean})],as.prototype,"outlineOpen",void 0),r([yt({type:Number})],as.prototype,"outlineWidth",void 0),r([yt({type:Boolean})],as.prototype,"isUiValid",void 0),r([St({passive:!0})],as.prototype,"handleInputChange",null);
/**
@license
Copyright 2018 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
const ls=Ct`.mdc-floating-label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight, 400);letter-spacing:0.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, 0.009375em);text-decoration:inherit;text-decoration:var(--mdc-typography-subtitle1-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform, inherit);position:absolute;left:0;transform-origin:left top;line-height:1.15rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform;transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1),color 150ms cubic-bezier(0.4, 0, 0.2, 1)}[dir=rtl] .mdc-floating-label,.mdc-floating-label[dir=rtl]{right:0;left:auto;transform-origin:right top;text-align:right}.mdc-floating-label--float-above{cursor:auto}.mdc-floating-label--required::after{margin-left:1px;margin-right:0px;content:"*"}[dir=rtl] .mdc-floating-label--required::after,.mdc-floating-label--required[dir=rtl]::after{margin-left:0;margin-right:1px}.mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-standard 250ms 1}@keyframes mdc-floating-label-shake-float-above-standard{0%{transform:translateX(calc(0 - 0%)) translateY(-106%) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 0%)) translateY(-106%) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 0%)) translateY(-106%) scale(0.75)}100%{transform:translateX(calc(0 - 0%)) translateY(-106%) scale(0.75)}}.mdc-line-ripple::before,.mdc-line-ripple::after{position:absolute;bottom:0;left:0;width:100%;border-bottom-style:solid;content:""}.mdc-line-ripple::before{border-bottom-width:1px;z-index:1}.mdc-line-ripple::after{transform:scaleX(0);border-bottom-width:2px;opacity:0;z-index:2}.mdc-line-ripple::after{transition:transform 180ms cubic-bezier(0.4, 0, 0.2, 1),opacity 180ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-line-ripple--active::after{transform:scaleX(1);opacity:1}.mdc-line-ripple--deactivating::after{opacity:0}.mdc-notched-outline{display:flex;position:absolute;top:0;right:0;left:0;box-sizing:border-box;width:100%;max-width:100%;height:100%;text-align:left;pointer-events:none}[dir=rtl] .mdc-notched-outline,.mdc-notched-outline[dir=rtl]{text-align:right}.mdc-notched-outline__leading,.mdc-notched-outline__notch,.mdc-notched-outline__trailing{box-sizing:border-box;height:100%;border-top:1px solid;border-bottom:1px solid;pointer-events:none}.mdc-notched-outline__leading{border-left:1px solid;border-right:none;width:12px}[dir=rtl] .mdc-notched-outline__leading,.mdc-notched-outline__leading[dir=rtl]{border-left:none;border-right:1px solid}.mdc-notched-outline__trailing{border-left:none;border-right:1px solid;flex-grow:1}[dir=rtl] .mdc-notched-outline__trailing,.mdc-notched-outline__trailing[dir=rtl]{border-left:1px solid;border-right:none}.mdc-notched-outline__notch{flex:0 0 auto;width:auto;max-width:calc(100% - 12px * 2)}.mdc-notched-outline .mdc-floating-label{display:inline-block;position:relative;max-width:100%}.mdc-notched-outline .mdc-floating-label--float-above{text-overflow:clip}.mdc-notched-outline--upgraded .mdc-floating-label--float-above{max-width:calc(100% / 0.75)}.mdc-notched-outline--notched .mdc-notched-outline__notch{padding-left:0;padding-right:8px;border-top:none}[dir=rtl] .mdc-notched-outline--notched .mdc-notched-outline__notch,.mdc-notched-outline--notched .mdc-notched-outline__notch[dir=rtl]{padding-left:8px;padding-right:0}.mdc-notched-outline--no-label .mdc-notched-outline__notch{padding:0}@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-text-field--filled{--mdc-ripple-fg-size: 0;--mdc-ripple-left: 0;--mdc-ripple-top: 0;--mdc-ripple-fg-scale: 1;--mdc-ripple-fg-translate-end: 0;--mdc-ripple-fg-translate-start: 0;-webkit-tap-highlight-color:rgba(0,0,0,0);will-change:transform,opacity}.mdc-text-field--filled .mdc-text-field__ripple::before,.mdc-text-field--filled .mdc-text-field__ripple::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-text-field--filled .mdc-text-field__ripple::before{transition:opacity 15ms linear,background-color 15ms linear;z-index:1}.mdc-text-field--filled.mdc-ripple-upgraded .mdc-text-field__ripple::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-text-field--filled.mdc-ripple-upgraded .mdc-text-field__ripple::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-text-field--filled.mdc-ripple-upgraded--unbounded .mdc-text-field__ripple::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-text-field--filled.mdc-ripple-upgraded--foreground-activation .mdc-text-field__ripple::after{animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.mdc-text-field--filled.mdc-ripple-upgraded--foreground-deactivation .mdc-text-field__ripple::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-text-field--filled .mdc-text-field__ripple::before,.mdc-text-field--filled .mdc-text-field__ripple::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-text-field--filled.mdc-ripple-upgraded .mdc-text-field__ripple::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-text-field__ripple{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.mdc-text-field{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:0;border-bottom-left-radius:0;display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity,transform,color}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-floating-label{color:rgba(0, 0, 0, 0.6)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__input{color:rgba(0, 0, 0, 0.87)}@media all{.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__input::placeholder{color:rgba(0, 0, 0, 0.54)}}@media all{.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__input:-ms-input-placeholder{color:rgba(0, 0, 0, 0.54)}}.mdc-text-field .mdc-text-field__input{caret-color:#6200ee;caret-color:var(--mdc-theme-primary, #6200ee)}.mdc-text-field:not(.mdc-text-field--disabled)+.mdc-text-field-helper-line .mdc-text-field-helper-text{color:rgba(0, 0, 0, 0.6)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field-character-counter,.mdc-text-field:not(.mdc-text-field--disabled)+.mdc-text-field-helper-line .mdc-text-field-character-counter{color:rgba(0, 0, 0, 0.6)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__icon--leading{color:rgba(0, 0, 0, 0.54)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__icon--trailing{color:rgba(0, 0, 0, 0.54)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--prefix{color:rgba(0, 0, 0, 0.6)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--suffix{color:rgba(0, 0, 0, 0.6)}.mdc-text-field .mdc-floating-label{top:50%;transform:translateY(-50%);pointer-events:none}.mdc-text-field__input{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight, 400);letter-spacing:0.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, 0.009375em);text-decoration:inherit;text-decoration:var(--mdc-typography-subtitle1-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform, inherit);height:28px;transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);width:100%;min-width:0;border:none;border-radius:0;background:none;appearance:none;padding:0}.mdc-text-field__input::-ms-clear{display:none}.mdc-text-field__input::-webkit-calendar-picker-indicator{display:none}.mdc-text-field__input:focus{outline:none}.mdc-text-field__input:invalid{box-shadow:none}@media all{.mdc-text-field__input::placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1);opacity:0}}@media all{.mdc-text-field__input:-ms-input-placeholder{transition:opacity 67ms cubic-bezier(0.4, 0, 0.2, 1);opacity:0}}@media all{.mdc-text-field--no-label .mdc-text-field__input::placeholder,.mdc-text-field--focused .mdc-text-field__input::placeholder{transition-delay:40ms;transition-duration:110ms;opacity:1}}@media all{.mdc-text-field--no-label .mdc-text-field__input:-ms-input-placeholder,.mdc-text-field--focused .mdc-text-field__input:-ms-input-placeholder{transition-delay:40ms;transition-duration:110ms;opacity:1}}.mdc-text-field__affix{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-subtitle1-font-size, 1rem);font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight, 400);letter-spacing:0.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, 0.009375em);text-decoration:inherit;text-decoration:var(--mdc-typography-subtitle1-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform, inherit);height:28px;transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);opacity:0;white-space:nowrap}.mdc-text-field--label-floating .mdc-text-field__affix,.mdc-text-field--no-label .mdc-text-field__affix{opacity:1}@supports(-webkit-hyphens: none){.mdc-text-field--outlined .mdc-text-field__affix{align-items:center;align-self:center;display:inline-flex;height:100%}}.mdc-text-field__affix--prefix{padding-left:0;padding-right:2px}[dir=rtl] .mdc-text-field__affix--prefix,.mdc-text-field__affix--prefix[dir=rtl]{padding-left:2px;padding-right:0}.mdc-text-field--end-aligned .mdc-text-field__affix--prefix{padding-left:0;padding-right:12px}[dir=rtl] .mdc-text-field--end-aligned .mdc-text-field__affix--prefix,.mdc-text-field--end-aligned .mdc-text-field__affix--prefix[dir=rtl]{padding-left:12px;padding-right:0}.mdc-text-field__affix--suffix{padding-left:12px;padding-right:0}[dir=rtl] .mdc-text-field__affix--suffix,.mdc-text-field__affix--suffix[dir=rtl]{padding-left:0;padding-right:12px}.mdc-text-field--end-aligned .mdc-text-field__affix--suffix{padding-left:2px;padding-right:0}[dir=rtl] .mdc-text-field--end-aligned .mdc-text-field__affix--suffix,.mdc-text-field--end-aligned .mdc-text-field__affix--suffix[dir=rtl]{padding-left:0;padding-right:2px}.mdc-text-field--filled{height:56px}.mdc-text-field--filled .mdc-text-field__ripple::before,.mdc-text-field--filled .mdc-text-field__ripple::after{background-color:rgba(0, 0, 0, 0.87)}.mdc-text-field--filled:hover .mdc-text-field__ripple::before{opacity:.04}.mdc-text-field--filled.mdc-ripple-upgraded--background-focused .mdc-text-field__ripple::before,.mdc-text-field--filled:not(.mdc-ripple-upgraded):focus .mdc-text-field__ripple::before{transition-duration:75ms;opacity:.12}.mdc-text-field--filled::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:whitesmoke}.mdc-text-field--filled:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.42)}.mdc-text-field--filled:not(.mdc-text-field--disabled):hover .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.87)}.mdc-text-field--filled .mdc-line-ripple::after{border-bottom-color:#6200ee;border-bottom-color:var(--mdc-theme-primary, #6200ee)}.mdc-text-field--filled .mdc-floating-label{left:16px;right:initial}[dir=rtl] .mdc-text-field--filled .mdc-floating-label,.mdc-text-field--filled .mdc-floating-label[dir=rtl]{left:initial;right:16px}.mdc-text-field--filled .mdc-floating-label--float-above{transform:translateY(-106%) scale(0.75)}.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__input{height:100%}.mdc-text-field--filled.mdc-text-field--no-label .mdc-floating-label{display:none}.mdc-text-field--filled.mdc-text-field--no-label::before{display:none}@supports(-webkit-hyphens: none){.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__affix{align-items:center;align-self:center;display:inline-flex;height:100%}}.mdc-text-field--outlined{height:56px;overflow:visible}.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-37.25px) scale(1)}.mdc-text-field--outlined .mdc-floating-label--float-above{font-size:.75rem}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) scale(0.75)}.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-text-field--outlined .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-text-field-outlined 250ms 1}@keyframes mdc-floating-label-shake-float-above-text-field-outlined{0%{transform:translateX(calc(0 - 0%)) translateY(-34.75px) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 0%)) translateY(-34.75px) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 0%)) translateY(-34.75px) scale(0.75)}100%{transform:translateX(calc(0 - 0%)) translateY(-34.75px) scale(0.75)}}.mdc-text-field--outlined .mdc-text-field__input{height:100%}.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__leading,.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__notch,.mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__trailing{border-color:rgba(0, 0, 0, 0.38)}.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-notched-outline .mdc-notched-outline__leading,.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-notched-outline .mdc-notched-outline__notch,.mdc-text-field--outlined:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-notched-outline .mdc-notched-outline__trailing{border-color:rgba(0, 0, 0, 0.87)}.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__leading,.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__notch,.mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__trailing{border-color:#6200ee;border-color:var(--mdc-theme-primary, #6200ee)}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:4px;border-bottom-left-radius:var(--mdc-shape-small, 4px)}[dir=rtl] .mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading,.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading[dir=rtl]{border-top-left-radius:0;border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:4px;border-bottom-right-radius:var(--mdc-shape-small, 4px);border-bottom-left-radius:0}@supports(top: max(0%)){.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__leading{width:max(12px, var(--mdc-shape-small, 4px))}}@supports(top: max(0%)){.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__notch{max-width:calc(100% - max(12px, var(--mdc-shape-small, 4px)) * 2)}}.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing{border-top-left-radius:0;border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:4px;border-bottom-right-radius:var(--mdc-shape-small, 4px);border-bottom-left-radius:0}[dir=rtl] .mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing,.mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing[dir=rtl]{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:4px;border-bottom-left-radius:var(--mdc-shape-small, 4px)}@supports(top: max(0%)){.mdc-text-field--outlined{padding-left:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}@supports(top: max(0%)){.mdc-text-field--outlined{padding-right:max(16px, var(--mdc-shape-small, 4px))}}@supports(top: max(0%)){.mdc-text-field--outlined+.mdc-text-field-helper-line{padding-left:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}@supports(top: max(0%)){.mdc-text-field--outlined+.mdc-text-field-helper-line{padding-right:max(16px, var(--mdc-shape-small, 4px))}}.mdc-text-field--outlined.mdc-text-field--with-leading-icon{padding-left:0}@supports(top: max(0%)){.mdc-text-field--outlined.mdc-text-field--with-leading-icon{padding-right:max(16px, var(--mdc-shape-small, 4px))}}[dir=rtl] .mdc-text-field--outlined.mdc-text-field--with-leading-icon,.mdc-text-field--outlined.mdc-text-field--with-leading-icon[dir=rtl]{padding-right:0}@supports(top: max(0%)){[dir=rtl] .mdc-text-field--outlined.mdc-text-field--with-leading-icon,.mdc-text-field--outlined.mdc-text-field--with-leading-icon[dir=rtl]{padding-left:max(16px, var(--mdc-shape-small, 4px))}}.mdc-text-field--outlined.mdc-text-field--with-trailing-icon{padding-right:0}@supports(top: max(0%)){.mdc-text-field--outlined.mdc-text-field--with-trailing-icon{padding-left:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}[dir=rtl] .mdc-text-field--outlined.mdc-text-field--with-trailing-icon,.mdc-text-field--outlined.mdc-text-field--with-trailing-icon[dir=rtl]{padding-left:0}@supports(top: max(0%)){[dir=rtl] .mdc-text-field--outlined.mdc-text-field--with-trailing-icon,.mdc-text-field--outlined.mdc-text-field--with-trailing-icon[dir=rtl]{padding-right:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}.mdc-text-field--outlined.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon{padding-left:0;padding-right:0}.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:1px}.mdc-text-field--outlined .mdc-text-field__ripple::before,.mdc-text-field--outlined .mdc-text-field__ripple::after{content:none}.mdc-text-field--outlined .mdc-floating-label{left:4px;right:initial}[dir=rtl] .mdc-text-field--outlined .mdc-floating-label,.mdc-text-field--outlined .mdc-floating-label[dir=rtl]{left:initial;right:4px}.mdc-text-field--outlined .mdc-text-field__input{display:flex;border:none !important;background-color:transparent}.mdc-text-field--outlined .mdc-notched-outline{z-index:1}.mdc-text-field--textarea{flex-direction:column;align-items:center;width:auto;height:auto;padding:0;transition:none}.mdc-text-field--textarea .mdc-floating-label{top:19px}.mdc-text-field--textarea .mdc-floating-label:not(.mdc-floating-label--float-above){transform:none}.mdc-text-field--textarea .mdc-text-field__input{flex-grow:1;height:auto;min-height:1.5rem;overflow-x:hidden;overflow-y:auto;box-sizing:border-box;resize:none;padding:0 16px;line-height:1.5rem}.mdc-text-field--textarea.mdc-text-field--filled::before{display:none}.mdc-text-field--textarea.mdc-text-field--filled .mdc-floating-label--float-above{transform:translateY(-10.25px) scale(0.75)}.mdc-text-field--textarea.mdc-text-field--filled .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-textarea-filled 250ms 1}@keyframes mdc-floating-label-shake-float-above-textarea-filled{0%{transform:translateX(calc(0 - 0%)) translateY(-10.25px) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 0%)) translateY(-10.25px) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 0%)) translateY(-10.25px) scale(0.75)}100%{transform:translateX(calc(0 - 0%)) translateY(-10.25px) scale(0.75)}}.mdc-text-field--textarea.mdc-text-field--filled .mdc-text-field__input{margin-top:23px;margin-bottom:9px}.mdc-text-field--textarea.mdc-text-field--filled.mdc-text-field--no-label .mdc-text-field__input{margin-top:16px;margin-bottom:16px}.mdc-text-field--textarea.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:0}.mdc-text-field--textarea.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-27.25px) scale(1)}.mdc-text-field--textarea.mdc-text-field--outlined .mdc-floating-label--float-above{font-size:.75rem}.mdc-text-field--textarea.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--textarea.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-24.75px) scale(0.75)}.mdc-text-field--textarea.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--textarea.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-text-field--textarea.mdc-text-field--outlined .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-textarea-outlined 250ms 1}@keyframes mdc-floating-label-shake-float-above-textarea-outlined{0%{transform:translateX(calc(0 - 0%)) translateY(-24.75px) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 0%)) translateY(-24.75px) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 0%)) translateY(-24.75px) scale(0.75)}100%{transform:translateX(calc(0 - 0%)) translateY(-24.75px) scale(0.75)}}.mdc-text-field--textarea.mdc-text-field--outlined .mdc-text-field__input{margin-top:16px;margin-bottom:16px}.mdc-text-field--textarea.mdc-text-field--outlined .mdc-floating-label{top:18px}.mdc-text-field--textarea.mdc-text-field--with-internal-counter .mdc-text-field__input{margin-bottom:2px}.mdc-text-field--textarea.mdc-text-field--with-internal-counter .mdc-text-field-character-counter{align-self:flex-end;padding:0 16px}.mdc-text-field--textarea.mdc-text-field--with-internal-counter .mdc-text-field-character-counter::after{display:inline-block;width:0;height:16px;content:"";vertical-align:-16px}.mdc-text-field--textarea.mdc-text-field--with-internal-counter .mdc-text-field-character-counter::before{display:none}.mdc-text-field__resizer{align-self:stretch;display:inline-flex;flex-direction:column;flex-grow:1;max-height:100%;max-width:100%;min-height:56px;min-width:fit-content;min-width:-moz-available;min-width:-webkit-fill-available;overflow:hidden;resize:both}.mdc-text-field--filled .mdc-text-field__resizer{transform:translateY(-1px)}.mdc-text-field--filled .mdc-text-field__resizer .mdc-text-field__input,.mdc-text-field--filled .mdc-text-field__resizer .mdc-text-field-character-counter{transform:translateY(1px)}.mdc-text-field--outlined .mdc-text-field__resizer{transform:translateX(-1px) translateY(-1px)}[dir=rtl] .mdc-text-field--outlined .mdc-text-field__resizer,.mdc-text-field--outlined .mdc-text-field__resizer[dir=rtl]{transform:translateX(1px) translateY(-1px)}.mdc-text-field--outlined .mdc-text-field__resizer .mdc-text-field__input,.mdc-text-field--outlined .mdc-text-field__resizer .mdc-text-field-character-counter{transform:translateX(1px) translateY(1px)}[dir=rtl] .mdc-text-field--outlined .mdc-text-field__resizer .mdc-text-field__input,.mdc-text-field--outlined .mdc-text-field__resizer .mdc-text-field__input[dir=rtl],[dir=rtl] .mdc-text-field--outlined .mdc-text-field__resizer .mdc-text-field-character-counter,.mdc-text-field--outlined .mdc-text-field__resizer .mdc-text-field-character-counter[dir=rtl]{transform:translateX(-1px) translateY(1px)}.mdc-text-field--with-leading-icon{padding-left:0;padding-right:16px}[dir=rtl] .mdc-text-field--with-leading-icon,.mdc-text-field--with-leading-icon[dir=rtl]{padding-left:16px;padding-right:0}.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 48px);left:48px;right:initial}[dir=rtl] .mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label,.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label[dir=rtl]{left:initial;right:48px}.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label--float-above{max-width:calc(100% / 0.75 - 64px / 0.75)}.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label{left:36px;right:initial}[dir=rtl] .mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label,.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label[dir=rtl]{left:initial;right:36px}.mdc-text-field--with-leading-icon.mdc-text-field--outlined :not(.mdc-notched-outline--notched) .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label--float-above{transform:translateY(-37.25px) translateX(-32px) scale(1)}[dir=rtl] .mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label--float-above,.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label--float-above[dir=rtl]{transform:translateY(-37.25px) translateX(32px) scale(1)}.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label--float-above{font-size:.75rem}.mdc-text-field--with-leading-icon.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{transform:translateY(-34.75px) translateX(-32px) scale(0.75)}[dir=rtl] .mdc-text-field--with-leading-icon.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--with-leading-icon.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above[dir=rtl],[dir=rtl] .mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above[dir=rtl]{transform:translateY(-34.75px) translateX(32px) scale(0.75)}.mdc-text-field--with-leading-icon.mdc-text-field--outlined.mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{font-size:1rem}.mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-text-field-outlined-leading-icon 250ms 1}@keyframes mdc-floating-label-shake-float-above-text-field-outlined-leading-icon{0%{transform:translateX(calc(0 - 32px)) translateY(-34.75px) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - 32px)) translateY(-34.75px) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - 32px)) translateY(-34.75px) scale(0.75)}100%{transform:translateX(calc(0 - 32px)) translateY(-34.75px) scale(0.75)}}[dir=rtl] .mdc-text-field--with-leading-icon.mdc-text-field--outlined .mdc-floating-label--shake,.mdc-text-field--with-leading-icon.mdc-text-field--outlined[dir=rtl] .mdc-floating-label--shake{animation:mdc-floating-label-shake-float-above-text-field-outlined-leading-icon 250ms 1}@keyframes mdc-floating-label-shake-float-above-text-field-outlined-leading-icon-rtl{0%{transform:translateX(calc(0 - -32px)) translateY(-34.75px) scale(0.75)}33%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(calc(4% - -32px)) translateY(-34.75px) scale(0.75)}66%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-4% - -32px)) translateY(-34.75px) scale(0.75)}100%{transform:translateX(calc(0 - -32px)) translateY(-34.75px) scale(0.75)}}.mdc-text-field--with-trailing-icon{padding-left:16px;padding-right:0}[dir=rtl] .mdc-text-field--with-trailing-icon,.mdc-text-field--with-trailing-icon[dir=rtl]{padding-left:0;padding-right:16px}.mdc-text-field--with-trailing-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 64px)}.mdc-text-field--with-trailing-icon.mdc-text-field--filled .mdc-floating-label--float-above{max-width:calc(100% / 0.75 - 64px / 0.75)}.mdc-text-field--with-trailing-icon.mdc-text-field--outlined :not(.mdc-notched-outline--notched) .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon{padding-left:0;padding-right:0}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 96px)}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon.mdc-text-field--filled .mdc-floating-label--float-above{max-width:calc(100% / 0.75 - 96px / 0.75)}.mdc-text-field-helper-line{display:flex;justify-content:space-between;box-sizing:border-box}.mdc-text-field+.mdc-text-field-helper-line{padding-right:16px;padding-left:16px}.mdc-form-field>.mdc-text-field+label{align-self:flex-start}.mdc-text-field--focused:not(.mdc-text-field--disabled) .mdc-floating-label{color:rgba(98, 0, 238, 0.87)}.mdc-text-field--focused .mdc-notched-outline__leading,.mdc-text-field--focused .mdc-notched-outline__notch,.mdc-text-field--focused .mdc-notched-outline__trailing{border-width:2px}.mdc-text-field--focused+.mdc-text-field-helper-line .mdc-text-field-helper-text:not(.mdc-text-field-helper-text--validation-msg){opacity:1}.mdc-text-field--focused.mdc-text-field--outlined .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:2px}.mdc-text-field--focused.mdc-text-field--outlined.mdc-text-field--textarea .mdc-notched-outline--notched .mdc-notched-outline__notch{padding-top:0}.mdc-text-field--invalid:not(.mdc-text-field--disabled):hover .mdc-line-ripple::before{border-bottom-color:#b00020;border-bottom-color:var(--mdc-theme-error, #b00020)}.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-line-ripple::after{border-bottom-color:#b00020;border-bottom-color:var(--mdc-theme-error, #b00020)}.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-floating-label{color:#b00020;color:var(--mdc-theme-error, #b00020)}.mdc-text-field--invalid:not(.mdc-text-field--disabled).mdc-text-field--invalid+.mdc-text-field-helper-line .mdc-text-field-helper-text--validation-msg{color:#b00020;color:var(--mdc-theme-error, #b00020)}.mdc-text-field--invalid .mdc-text-field__input{caret-color:#b00020;caret-color:var(--mdc-theme-error, #b00020)}.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-text-field__icon--trailing{color:#b00020;color:var(--mdc-theme-error, #b00020)}.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:#b00020;border-bottom-color:var(--mdc-theme-error, #b00020)}.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-notched-outline__leading,.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-notched-outline__notch,.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-notched-outline__trailing{border-color:#b00020;border-color:var(--mdc-theme-error, #b00020)}.mdc-text-field--invalid:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-notched-outline .mdc-notched-outline__leading,.mdc-text-field--invalid:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-notched-outline .mdc-notched-outline__notch,.mdc-text-field--invalid:not(.mdc-text-field--disabled):not(.mdc-text-field--focused):hover .mdc-notched-outline .mdc-notched-outline__trailing{border-color:#b00020;border-color:var(--mdc-theme-error, #b00020)}.mdc-text-field--invalid:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__leading,.mdc-text-field--invalid:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__notch,.mdc-text-field--invalid:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-notched-outline__trailing{border-color:#b00020;border-color:var(--mdc-theme-error, #b00020)}.mdc-text-field--invalid+.mdc-text-field-helper-line .mdc-text-field-helper-text--validation-msg{opacity:1}.mdc-text-field--disabled{pointer-events:none}.mdc-text-field--disabled .mdc-text-field__input{color:rgba(0, 0, 0, 0.38)}@media all{.mdc-text-field--disabled .mdc-text-field__input::placeholder{color:rgba(0, 0, 0, 0.38)}}@media all{.mdc-text-field--disabled .mdc-text-field__input:-ms-input-placeholder{color:rgba(0, 0, 0, 0.38)}}.mdc-text-field--disabled .mdc-floating-label{color:rgba(0, 0, 0, 0.38)}.mdc-text-field--disabled+.mdc-text-field-helper-line .mdc-text-field-helper-text{color:rgba(0, 0, 0, 0.38)}.mdc-text-field--disabled .mdc-text-field-character-counter,.mdc-text-field--disabled+.mdc-text-field-helper-line .mdc-text-field-character-counter{color:rgba(0, 0, 0, 0.38)}.mdc-text-field--disabled .mdc-text-field__icon--leading{color:rgba(0, 0, 0, 0.3)}.mdc-text-field--disabled .mdc-text-field__icon--trailing{color:rgba(0, 0, 0, 0.3)}.mdc-text-field--disabled .mdc-text-field__affix--prefix{color:rgba(0, 0, 0, 0.38)}.mdc-text-field--disabled .mdc-text-field__affix--suffix{color:rgba(0, 0, 0, 0.38)}.mdc-text-field--disabled .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.06)}.mdc-text-field--disabled .mdc-notched-outline__leading,.mdc-text-field--disabled .mdc-notched-outline__notch,.mdc-text-field--disabled .mdc-notched-outline__trailing{border-color:rgba(0, 0, 0, 0.06)}@media screen and (-ms-high-contrast: active){.mdc-text-field--disabled .mdc-text-field__input::placeholder{color:GrayText}}@media screen and (-ms-high-contrast: active){.mdc-text-field--disabled .mdc-text-field__input:-ms-input-placeholder{color:GrayText}}@media screen and (-ms-high-contrast: active){.mdc-text-field--disabled .mdc-floating-label{color:GrayText}}@media screen and (-ms-high-contrast: active){.mdc-text-field--disabled+.mdc-text-field-helper-line .mdc-text-field-helper-text{color:GrayText}}@media screen and (-ms-high-contrast: active){.mdc-text-field--disabled .mdc-text-field-character-counter,.mdc-text-field--disabled+.mdc-text-field-helper-line .mdc-text-field-character-counter{color:GrayText}}@media screen and (-ms-high-contrast: active){.mdc-text-field--disabled .mdc-text-field__icon--leading{color:GrayText}}@media screen and (-ms-high-contrast: active){.mdc-text-field--disabled .mdc-text-field__icon--trailing{color:GrayText}}@media screen and (-ms-high-contrast: active){.mdc-text-field--disabled .mdc-text-field__affix--prefix{color:GrayText}}@media screen and (-ms-high-contrast: active){.mdc-text-field--disabled .mdc-text-field__affix--suffix{color:GrayText}}@media screen and (-ms-high-contrast: active){.mdc-text-field--disabled .mdc-line-ripple::before{border-bottom-color:GrayText}}@media screen and (-ms-high-contrast: active){.mdc-text-field--disabled .mdc-notched-outline__leading,.mdc-text-field--disabled .mdc-notched-outline__notch,.mdc-text-field--disabled .mdc-notched-outline__trailing{border-color:GrayText}}.mdc-text-field--disabled .mdc-floating-label{cursor:default}.mdc-text-field--disabled.mdc-text-field--filled{background-color:#fafafa}.mdc-text-field--disabled.mdc-text-field--filled .mdc-text-field__ripple{display:none}.mdc-text-field--disabled .mdc-text-field__input{pointer-events:auto}.mdc-text-field--end-aligned .mdc-text-field__input{text-align:right}[dir=rtl] .mdc-text-field--end-aligned .mdc-text-field__input,.mdc-text-field--end-aligned .mdc-text-field__input[dir=rtl]{text-align:left}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__input,[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__affix,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__input,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__affix{direction:ltr}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__affix--prefix,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__affix--prefix{padding-left:0;padding-right:2px}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__affix--suffix,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__affix--suffix{padding-left:12px;padding-right:0}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__icon--leading,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__icon--leading{order:1}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__affix--suffix,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__affix--suffix{order:2}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__input,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__input{order:3}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__affix--prefix,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__affix--prefix{order:4}[dir=rtl] .mdc-text-field--ltr-text .mdc-text-field__icon--trailing,.mdc-text-field--ltr-text[dir=rtl] .mdc-text-field__icon--trailing{order:5}[dir=rtl] .mdc-text-field--ltr-text.mdc-text-field--end-aligned .mdc-text-field__input,.mdc-text-field--ltr-text.mdc-text-field--end-aligned[dir=rtl] .mdc-text-field__input{text-align:right}[dir=rtl] .mdc-text-field--ltr-text.mdc-text-field--end-aligned .mdc-text-field__affix--prefix,.mdc-text-field--ltr-text.mdc-text-field--end-aligned[dir=rtl] .mdc-text-field__affix--prefix{padding-right:12px}[dir=rtl] .mdc-text-field--ltr-text.mdc-text-field--end-aligned .mdc-text-field__affix--suffix,.mdc-text-field--ltr-text.mdc-text-field--end-aligned[dir=rtl] .mdc-text-field__affix--suffix{padding-left:2px}.mdc-text-field-helper-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.75rem;font-size:var(--mdc-typography-caption-font-size, 0.75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight, 400);letter-spacing:0.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, 0.0333333333em);text-decoration:inherit;text-decoration:var(--mdc-typography-caption-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform, inherit);display:block;margin-top:0;line-height:normal;margin:0;opacity:0;will-change:opacity;transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}.mdc-text-field-helper-text::before{display:inline-block;width:0;height:16px;content:"";vertical-align:0}.mdc-text-field-helper-text--persistent{transition:none;opacity:1;will-change:initial}.mdc-text-field-character-counter{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.75rem;font-size:var(--mdc-typography-caption-font-size, 0.75rem);line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight, 400);letter-spacing:0.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, 0.0333333333em);text-decoration:inherit;text-decoration:var(--mdc-typography-caption-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform, inherit);display:block;margin-top:0;line-height:normal;margin-left:auto;margin-right:0;padding-left:16px;padding-right:0;white-space:nowrap}.mdc-text-field-character-counter::before{display:inline-block;width:0;height:16px;content:"";vertical-align:0}[dir=rtl] .mdc-text-field-character-counter,.mdc-text-field-character-counter[dir=rtl]{margin-left:0;margin-right:auto}[dir=rtl] .mdc-text-field-character-counter,.mdc-text-field-character-counter[dir=rtl]{padding-left:0;padding-right:16px}.mdc-text-field__icon{align-self:center;cursor:pointer}.mdc-text-field__icon:not([tabindex]),.mdc-text-field__icon[tabindex="-1"]{cursor:default;pointer-events:none}.mdc-text-field__icon svg{display:block}.mdc-text-field__icon--leading{margin-left:16px;margin-right:8px}[dir=rtl] .mdc-text-field__icon--leading,.mdc-text-field__icon--leading[dir=rtl]{margin-left:8px;margin-right:16px}.mdc-text-field__icon--trailing{margin-left:12px;margin-right:12px}[dir=rtl] .mdc-text-field__icon--trailing,.mdc-text-field__icon--trailing[dir=rtl]{margin-left:12px;margin-right:12px}.material-icons{font-family:var(--mdc-icon-font, "Material Icons");font-weight:normal;font-style:normal;font-size:var(--mdc-icon-size, 24px);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga"}:host{display:inline-flex;flex-direction:column;outline:none}.mdc-text-field{width:100%}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.42);border-bottom-color:var(--mdc-text-field-idle-line-color, rgba(0, 0, 0, 0.42))}.mdc-text-field:not(.mdc-text-field--disabled):hover .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.87);border-bottom-color:var(--mdc-text-field-hover-line-color, rgba(0, 0, 0, 0.87))}.mdc-text-field.mdc-text-field--disabled .mdc-line-ripple::before{border-bottom-color:rgba(0, 0, 0, 0.06);border-bottom-color:var(--mdc-text-field-disabled-line-color, rgba(0, 0, 0, 0.06))}.mdc-text-field.mdc-text-field--invalid:not(.mdc-text-field--disabled) .mdc-line-ripple::before{border-bottom-color:#b00020;border-bottom-color:var(--mdc-theme-error, #b00020)}mwc-notched-outline{--mdc-notched-outline-border-color: var(--mdc-text-field-outlined-idle-border-color, rgba(0, 0, 0, 0.38))}:host(:not([disabled]):hover) :not(.mdc-text-field--invalid):not(.mdc-text-field--focused) mwc-notched-outline{--mdc-notched-outline-border-color: var(--mdc-text-field-outlined-hover-border-color, rgba(0, 0, 0, 0.87))}:host(:not([disabled])) .mdc-text-field:not(.mdc-text-field--outlined){background-color:var(--mdc-text-field-fill-color, whitesmoke)}:host(:not([disabled])) .mdc-text-field.mdc-text-field--invalid mwc-notched-outline{--mdc-notched-outline-border-color: var(--mdc-text-field-error-color, var(--mdc-theme-error, #b00020))}:host(:not([disabled])) .mdc-text-field.mdc-text-field--invalid+.mdc-text-field-helper-line .mdc-text-field-character-counter,:host(:not([disabled])) .mdc-text-field.mdc-text-field--invalid .mdc-text-field__icon{color:var(--mdc-text-field-error-color, var(--mdc-theme-error, #b00020))}:host(:not([disabled])) .mdc-text-field:not(.mdc-text-field--invalid):not(.mdc-text-field--focused) .mdc-floating-label,:host(:not([disabled])) .mdc-text-field:not(.mdc-text-field--invalid):not(.mdc-text-field--focused) .mdc-floating-label::after{color:var(--mdc-text-field-label-ink-color, rgba(0, 0, 0, 0.6))}:host(:not([disabled])) .mdc-text-field.mdc-text-field--focused mwc-notched-outline{--mdc-notched-outline-stroke-width: 2px}:host(:not([disabled])) .mdc-text-field.mdc-text-field--focused:not(.mdc-text-field--invalid) mwc-notched-outline{--mdc-notched-outline-border-color: var(--mdc-text-field-focused-label-color, var(--mdc-theme-primary, rgba(98, 0, 238, 0.87)))}:host(:not([disabled])) .mdc-text-field.mdc-text-field--focused:not(.mdc-text-field--invalid) .mdc-floating-label{color:#6200ee;color:var(--mdc-theme-primary, #6200ee)}:host(:not([disabled])) .mdc-text-field .mdc-text-field__input{color:var(--mdc-text-field-ink-color, rgba(0, 0, 0, 0.87))}:host(:not([disabled])) .mdc-text-field .mdc-text-field__input::placeholder{color:var(--mdc-text-field-label-ink-color, rgba(0, 0, 0, 0.6))}:host(:not([disabled])) .mdc-text-field-helper-line .mdc-text-field-helper-text:not(.mdc-text-field-helper-text--validation-msg),:host(:not([disabled])) .mdc-text-field-helper-line:not(.mdc-text-field--invalid) .mdc-text-field-character-counter{color:var(--mdc-text-field-label-ink-color, rgba(0, 0, 0, 0.6))}:host([disabled]) .mdc-text-field:not(.mdc-text-field--outlined){background-color:var(--mdc-text-field-disabled-fill-color, #fafafa)}:host([disabled]) .mdc-text-field.mdc-text-field--outlined mwc-notched-outline{--mdc-notched-outline-border-color: var(--mdc-text-field-outlined-disabled-border-color, rgba(0, 0, 0, 0.06))}:host([disabled]) .mdc-text-field:not(.mdc-text-field--invalid):not(.mdc-text-field--focused) .mdc-floating-label,:host([disabled]) .mdc-text-field:not(.mdc-text-field--invalid):not(.mdc-text-field--focused) .mdc-floating-label::after{color:var(--mdc-text-field-disabled-ink-color, rgba(0, 0, 0, 0.38))}:host([disabled]) .mdc-text-field .mdc-text-field__input,:host([disabled]) .mdc-text-field .mdc-text-field__input::placeholder{color:var(--mdc-text-field-disabled-ink-color, rgba(0, 0, 0, 0.38))}:host([disabled]) .mdc-text-field-helper-line .mdc-text-field-helper-text,:host([disabled]) .mdc-text-field-helper-line .mdc-text-field-character-counter{color:var(--mdc-text-field-disabled-ink-color, rgba(0, 0, 0, 0.38))}`
/**
@license
Copyright 2019 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/;let ds=class extends as{};ds.styles=ls,ds=r([bt("mwc-textfield")],ds);let cs=class extends Ot{constructor(){super(),this.app="",this.description="",this.color="green",this.appColor="grey",this.ui="flat"}static get styles(){return[yo,_o,wo,xo,Ct`
        .text {
          font-family: 'DejaVu Sans', Verdana, Geneva, sans-serif;
          font-size: 11px;
          line-height: 11px;
          padding: 4px;
          display: block;
          color: #ffffff;
        }

        .round {
          border-radius: 4px;
        }
        .round-left {
          border-top-left-radius: 4px;
          border-bottom-left-radius: 4px;
        }
        .round-right {
          border-top-right-radius: 4px;
          border-bottom-right-radius: 4px;
        }
      `]}get _colorScheme(){return{brightgreen:{colorB:"#44cc11",colorT:"#222222"},lightgreen:{colorB:"#f3f5d0",colorT:"#222222"},green:{colorB:"#97ca00"},darkgreen:{colorB:"#457b3b"},yellow:{colorB:"#dfb317"},yellowgreen:{colorB:"#a4a61d"},orange:{colorB:"#fe7d37"},red:{colorB:"#e05d44"},blue:{colorB:"#007ec6"},purple:{colorB:"#ab47bc"},lightblue:{colorB:"#caedfc",colorT:"#222222"},grey:{colorB:"#555555"},gray:{colorB:"#555555"},lightgrey:{colorB:"#9f9f9f"},lightgray:{colorB:"#9f9f9f"}}}render(){return Z`
      <div class="shields layout horizontal flex">
        <div id="app" class="app horizontal layout center">
          <slot name="app-icon"></slot>
          <span id="app-text" class="text app-text">${this.app}</span></div>
        <div id="description" class="desc horizontal layout center">
          <slot name="desc-icon"></slot>
          <span id="desc-text" class="text desc-text">${this.description}</span></div>
      </div>
    `}firstUpdated(){this._colorChanged(),this._appColorChanged(),this._formatItem(),this._descriptionChanged(),""==this.app&&(this.shadowRoot.querySelector("#app-text").style.display="none")}connectedCallback(){super.connectedCallback()}attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i),"app"==t&&(this.app=i,this._appChanged()),"description"==t&&(this.description=i,this._descriptionChanged())}updated(t){t.has("color")&&this._colorChanged(),t.has("appColor")&&this._appColorChanged()}_classChanged(){this._formatItem()}_colorChanged(){this._colorScheme[this.color]&&(this.shadowRoot.querySelector(".desc").style.backgroundColor=this._colorScheme[this.color].colorB,this._colorScheme[this.color].colorT&&(this.shadowRoot.querySelector(".desc-text").style.color=this._colorScheme[this.color].colorT))}_appColorChanged(){this._colorScheme[this.appColor]?(this.shadowRoot.querySelector(".app").style.backgroundColor=this._colorScheme[this.appColor].colorB,this._colorScheme[this.appColor].colorT&&(this.shadowRoot.querySelector(".app-text").style.color=this._colorScheme[this.appColor].colorT)):this.shadowRoot.querySelector(".app").style.backgroundColor="#555"}async _appChanged(){await this.updateComplete,void 0===this.app||"undefined"==this.app||""===this.app?this.shadowRoot.querySelector("#app").style.display="none":this.shadowRoot.querySelector("#app").style.display="block"}async _descriptionChanged(){await this.updateComplete,void 0===this.description||"undefined"==this.description||""===this.description?this.shadowRoot.querySelector("#description").style.display="none":this.shadowRoot.querySelector("#description").style.display="block"}_formatItem(){["round"].indexOf(this.ui)>=0&&(this.shadowRoot.querySelector(".shields").classList.add(this.ui),void 0===this.description||"undefined"==this.description||""===this.description?void 0===this.app||"undefined"==this.app||""===this.app||this.shadowRoot.querySelector("#app").classList.add(this.ui):void 0===this.app||"undefined"==this.app||""===this.app?this.shadowRoot.querySelector("#description").classList.add(this.ui):(this.shadowRoot.querySelector("#app").classList.add(this.ui+"-left"),this.shadowRoot.querySelector("#description").classList.add(this.ui+"-right")))}};r([yt({type:String})],cs.prototype,"app",void 0),r([yt({type:String})],cs.prototype,"description",void 0),r([yt({type:String})],cs.prototype,"color",void 0),r([yt({type:String})],cs.prototype,"appColor",void 0),r([yt({type:String})],cs.prototype,"ui",void 0),cs=r([bt("lablup-shields")],cs);
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var hs={ICON_BUTTON_ON:"mdc-icon-button--on",ROOT:"mdc-icon-button"},us={ARIA_LABEL:"aria-label",ARIA_PRESSED:"aria-pressed",DATA_ARIA_LABEL_OFF:"data-aria-label-off",DATA_ARIA_LABEL_ON:"data-aria-label-on",CHANGE_EVENT:"MDCIconButtonToggle:change"},ps=function(t){function r(e){var n=t.call(this,i(i({},r.defaultAdapter),e))||this;return n.hasToggledAriaLabel=!1,n}return e(r,t),Object.defineProperty(r,"cssClasses",{get:function(){return hs},enumerable:!0,configurable:!0}),Object.defineProperty(r,"strings",{get:function(){return us},enumerable:!0,configurable:!0}),Object.defineProperty(r,"defaultAdapter",{get:function(){return{addClass:function(){},hasClass:function(){return!1},notifyChange:function(){},removeClass:function(){},getAttr:function(){return null},setAttr:function(){}}},enumerable:!0,configurable:!0}),r.prototype.init=function(){var t=this.adapter.getAttr(us.DATA_ARIA_LABEL_ON),e=this.adapter.getAttr(us.DATA_ARIA_LABEL_OFF);if(t&&e){if(null!==this.adapter.getAttr(us.ARIA_PRESSED))throw new Error("MDCIconButtonToggleFoundation: Button should not set `aria-pressed` if it has a toggled aria label.");this.hasToggledAriaLabel=!0}else this.adapter.setAttr(us.ARIA_PRESSED,String(this.isOn()))},r.prototype.handleClick=function(){this.toggle(),this.adapter.notifyChange({isOn:this.isOn()})},r.prototype.isOn=function(){return this.adapter.hasClass(hs.ICON_BUTTON_ON)},r.prototype.toggle=function(t){if(void 0===t&&(t=!this.isOn()),t?this.adapter.addClass(hs.ICON_BUTTON_ON):this.adapter.removeClass(hs.ICON_BUTTON_ON),this.hasToggledAriaLabel){var e=t?this.adapter.getAttr(us.DATA_ARIA_LABEL_ON):this.adapter.getAttr(us.DATA_ARIA_LABEL_OFF);this.adapter.setAttr(us.ARIA_LABEL,e||"")}else this.adapter.setAttr(us.ARIA_PRESSED,""+t)},r}(ee);class fs extends pe{constructor(){super(...arguments),this.mdcFoundationClass=ps,this.label="",this.disabled=!1,this.onIcon="",this.offIcon="",this.on=!1,this.shouldRenderRipple=!1,this.rippleHandlers=new Ye((()=>(this.shouldRenderRipple=!0,this.ripple)))}createAdapter(){return Object.assign(Object.assign({},se(this.mdcRoot)),{getAttr:t=>this.mdcRoot.getAttribute(t),setAttr:(t,e)=>{this.mdcRoot.setAttribute(t,e)},notifyChange:t=>{this.dispatchEvent(new CustomEvent("MDCIconButtonToggle:change",{detail:t,bubbles:!0}))}})}handleClick(){this.on=!this.on,this.mdcFoundation.handleClick()}focus(){this.rippleHandlers.startFocus(),this.mdcRoot.focus()}blur(){this.rippleHandlers.endFocus(),this.mdcRoot.blur()}renderRipple(){return this.shouldRenderRipple?Z`
            <mwc-ripple
                .disabled="${this.disabled}"
                unbounded>
            </mwc-ripple>`:""}render(){return Z`
      <button
          class="mdc-icon-button"
          @click="${this.handleClick}"
          aria-label="${this.label}"
          ?disabled="${this.disabled}"
          @focus="${this.handleRippleFocus}"
          @blur="${this.handleRippleBlur}"
          @mousedown="${this.handleRippleMouseDown}"
          @mouseenter="${this.handleRippleMouseEnter}"
          @mouseleave="${this.handleRippleMouseLeave}"
          @touchstart="${this.handleRippleTouchStart}"
          @touchend="${this.handleRippleDeactivate}"
          @touchcancel="${this.handleRippleDeactivate}">
        ${this.renderRipple()}
        <span class="mdc-icon-button__icon">
          <slot name="offIcon">
            <i class="material-icons">${this.offIcon}</i>
          </slot>
        </span>
        <span class="mdc-icon-button__icon mdc-icon-button__icon--on">
          <slot name="onIcon">
            <i class="material-icons">${this.onIcon}</i>
          </slot>
        </span>
      </button>`}handleRippleMouseDown(t){const e=()=>{window.removeEventListener("mouseup",e),this.handleRippleDeactivate()};window.addEventListener("mouseup",e),this.rippleHandlers.startPress(t)}handleRippleTouchStart(t){this.rippleHandlers.startPress(t)}handleRippleDeactivate(){this.rippleHandlers.endPress()}handleRippleMouseEnter(){this.rippleHandlers.startHover()}handleRippleMouseLeave(){this.rippleHandlers.endHover()}handleRippleFocus(){this.rippleHandlers.startFocus()}handleRippleBlur(){this.rippleHandlers.endFocus()}}r([wt(".mdc-icon-button")],fs.prototype,"mdcRoot",void 0),r([yt({type:String})],fs.prototype,"label",void 0),r([yt({type:Boolean,reflect:!0})],fs.prototype,"disabled",void 0),r([yt({type:String})],fs.prototype,"onIcon",void 0),r([yt({type:String})],fs.prototype,"offIcon",void 0),r([yt({type:Boolean,reflect:!0}),fe((function(t){this.mdcFoundation.toggle(t)}))],fs.prototype,"on",void 0),r([xt("mwc-ripple")],fs.prototype,"ripple",void 0),r([_t()],fs.prototype,"shouldRenderRipple",void 0),r([St({passive:!0})],fs.prototype,"handleRippleMouseDown",null),r([St({passive:!0})],fs.prototype,"handleRippleTouchStart",null);
/**
@license
Copyright 2019 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
let ms=class extends fs{};ms.styles=ii,ms=r([bt("mwc-icon-button-toggle")],ms);let gs=class extends Un{constructor(){super(),this.company_name="",this.company_id="",this.user_name="",this.user_email="",this.errorMsg="",this.endpoint="",this.notification=Object(),this.signupPanel=Object(),this.blockPanel=Object(),this.TOSlanguage="en",this.TOSdialog=Object()}static get styles(){return[Me,yo,_o,wo,xo,Ct`
          fieldset input {
              width: 100%;
              border: 0;
              border-bottom: 1px solid #aaa;
              margin: 15px 0;
            font: inherit;
            font-size: 16px;
            outline: none;
          }

          fieldset input:focus {
            border-bottom: 1.5px solid #0d47a1;
          }

          #signup-panel {
            --dialog-width: 400px;
            --dialog-elevation: 0px 0px 5px 5px rgba(0, 0, 0, 0.1);
          }

          mwc-textfield {
            width: 100%;
            --mdc-text-field-fill-color: transparent;
          }

          mwc-button.full {
            width: 335px;
          }

          mwc-button {
            background-image: none;
            --mdc-theme-primary: var(--general-button-background-color);
            --mdc-on-theme-primary: var(--general-button-background-color);
          }

          mwc-button[unelevated] {
            background-image: none;
            --mdc-theme-primary: var(--general-button-background-color);
          }

          mwc-button[outlined] {
            background-image: none;
            --mdc-button-outline-width: 2px;
            --mdc-button-disabled-outline-color: var(--general-button-background-color);
            --mdc-button-disabled-ink-color: var(--general-button-background-color);
            --mdc-theme-primary: var(--general-button-background-color);
            --mdc-on-theme-primary: var(--general-button-background-color);
          }
      `]}firstUpdated(){this.signupPanel=this.shadowRoot.querySelector("#signup-panel"),this.blockPanel=this.shadowRoot.querySelector("#block-panel"),this.notification=globalThis.lablupNotification,this.TOSdialog=this.shadowRoot.querySelector("#terms-of-service");let t=this.shadowRoot.querySelectorAll("mwc-textfield");for(const e of t)this._addInputValidator(e)}async _viewStateChanged(t){await this.updateComplete,!1!==t&&(void 0!==globalThis.backendaiclient&&null!==globalThis.backendaiclient&&!1!==globalThis.backendaiclient.ready||document.addEventListener("backend-ai-connected",(()=>{}),!0))}receiveTOSAgreement(){!1===this.TOSdialog.show&&(this.TOSdialog.tosContent="",this.TOSdialog.tosLanguage=globalThis.backendaioptions.get("language"),this.TOSdialog.title=rt("console.menu.TermsOfService"),this.TOSdialog.tosEntry="terms-of-service",this.TOSdialog.open())}receivePPAgreement(){!1===this.TOSdialog.show&&(this.TOSdialog.tosContent="",this.TOSdialog.tosLanguage=globalThis.backendaioptions.get("language"),this.TOSdialog.title=rt("console.menu.PrivacyPolicy"),this.TOSdialog.tosEntry="privacy-policy",this.TOSdialog.open())}open(){!0!==this.signupPanel.open&&(this._clearUserInput(),this.signupPanel.show())}close(){!0===this.signupPanel.open&&this.signupPanel.hide()}init_client(){if(void 0===this.client&&""!==this.endpoint&&this.client!=={}){let t={connectionMode:"SESSION",apiVersionMajor:"v4",apiVersion:"v4.20190615",_apiVersion:"v4.20190615",endpoint:this.endpoint};this.client=new ai.backend.Client(t,"Backend.AI Console.")}}block(t=""){this.errorMsg=t,this.blockPanel.show()}_validate_data(t){return null!=t&&null!=t&&""!=t}_clear_info(){this.company_name="",this.user_name=""}_clearUserInput(){this._toggleInputField(!0);["#id_user_email","#id_token","#id_password1","#id_password2"].map((t=>{this.shadowRoot.querySelector(t).value=""})),this.shadowRoot.querySelector("#signup-button-message").textContent="Signup"}_toggleInputField(t){t?(this.shadowRoot.querySelector("#id_user_name").removeAttribute("disabled"),this.shadowRoot.querySelector("#id_token").removeAttribute("disabled"),this.shadowRoot.querySelector("#signup-button").removeAttribute("disabled")):(this.shadowRoot.querySelector("#id_user_name").setAttribute("disabled","true"),this.shadowRoot.querySelector("#id_token").setAttribute("disabled","true"),this.shadowRoot.querySelector("#signup-button").setAttribute("disabled","true"))}_signup(){let t=["#id_user_email","#id_token","#id_password1","#id_password2"].map((t=>(this.shadowRoot.querySelector(t).reportValidity(),this.shadowRoot.querySelector(t).checkValidity())));if(!1===this.shadowRoot.querySelector("#approve-terms-of-service").checked)return this.notification.text=p("signup.RequestAgreementTermsOfService"),void this.notification.show();if(t.includes(!1))return;const e=this.shadowRoot.querySelector("#id_token").value,i=this.shadowRoot.querySelector("#id_user_email").value,r=this.shadowRoot.querySelector("#id_user_name").value,n=this.shadowRoot.querySelector("#id_password1").value;this.notification.text="Processing...",this.notification.show();const o={email:i,user_name:r,password:n,token:e};this.init_client();let s=this.client.newSignedRequest("POST","/auth/signup",o);this.client._wrapWithPromise(s).then((t=>{this._toggleInputField(!1),this.shadowRoot.querySelector("#signup-button-message").textContent="Signup succeed",this.notification.text="Signup succeed.",this.notification.show(),setTimeout((()=>{this.signupPanel.hide(),this._clearUserInput(),this.shadowRoot.querySelector("#email-sent-dialog").show()}),1e3)})).catch((t=>{t.message&&(this.notification.text=t.message,this.notification.show(!0,t)),console.log(t)}))}_politeErrorMessage(t){const e={"Cannot read property 'map' of null":"User has no group. Please contact administrator to fix it.","Cannot read property 'split' of undefined":"Wrong API server address."};return console.log(t),t in e?e[t]:t}_togglePasswordVisibility(t){const e=t.__on,i=t.closest("div").querySelector("mwc-textfield");e?i.setAttribute("type","text"):i.setAttribute("type","password")}_validateEmail(){const t=this.shadowRoot.querySelector("#id_user_email");t.validityTransform=(e,i)=>{if(i.valid){let e=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.exec(t.value);return e||(t.validationMessage=p("signup.InvalidEmail")),{valid:e,customError:!e}}return i.valueMissing?(t.validationMessage=p("signup.EmailInputRequired"),{valid:i.valid,customError:!i.valid}):(t.validationMessage=p("signup.InvalidEmail"),{valid:i.valid,customError:!i.valid})}}_validatePassword1(){const t=this.shadowRoot.querySelector("#id_password1");this.shadowRoot.querySelector("#id_password2").reportValidity(),t.validityTransform=(e,i)=>i.valid?{valid:i.valid,customError:!i.valid}:i.valueMissing?(t.validationMessage=p("signup.PasswordInputRequired"),{valid:i.valid,customError:!i.valid}):(t.validationMessage=p("signup.PasswordInvalid"),{valid:i.valid,customError:!i.valid})}_validatePassword2(){const t=this.shadowRoot.querySelector("#id_password2");t.validityTransform=(e,i)=>{if(i.valid){let e=this.shadowRoot.querySelector("#id_password1").value===t.value;return e||(t.validationMessage=p("signup.PasswordNotMatched")),{valid:e,customError:!e}}return i.valueMissing?(t.validationMessage=p("signup.PasswordInputRequired"),{valid:i.valid,customError:!i.valid}):(t.validationMessage=p("signup.PasswordInvalid"),{valid:i.valid,customError:!i.valid})}}_validatePassword(){this._validatePassword1(),this._validatePassword2()}render(){return Z`
      <backend-ai-dialog id="signup-panel" fixed blockscrolling persistent disablefocustrap>
        <span slot="title">${rt("signup.SignupBETA")}</span>
        <div slot="content">
          <mwc-textfield type="email" name="user_email" id="id_user_email" maxlength="50" autofocus
                       label="${rt("signup.E-mail")}" validateOnInitialRender
                       @change="${this._validateEmail}"
                       validationMessage="${rt("signup.EmailInputRequired")}"
                       value="${this.user_email}" required></mwc-textfield>
          <mwc-textfield type="text" name="user_name" id="id_user_name" maxlength="30"
                       label="${rt("signup.UserName")}" value="${this.user_name}"
                       validationMessage="${rt("signup.UserNameInputRequired")}"></mwc-textfield>
          <mwc-textfield type="text" name="token" id="id_token" maxlength="50"
                       label="${rt("signup.InvitationToken")}"
                       validationMessage="${rt("signup.TokenInputRequired")}" required></mwc-textfield>
          <div class="horizontal flex layout">
            <mwc-textfield type="password" name="password1" id="id_password1"
                        label="${rt("signup.Password")}" minlength="8"
                        pattern="^(?=.*[A-Za-z])(?=.*\\d)(?=.*[@$!%*#?&])[A-Za-z\\d@$!%*#?&]{8,}$"
                        validationMessage="${rt("signup.PasswordInputRequired")}"
                        @change="${this._validatePassword}"
                        value="" required></mwc-textfield>
            <mwc-icon-button-toggle off onIcon="visibility" offIcon="visibility_off"
                                    @click="${t=>this._togglePasswordVisibility(t.target)}">
            </mwc-icon-button-toggle>
          </div>
          <div class="horizontal flex layout">
            <mwc-textfield type="password" name="password2" id="id_password2"
                        label="${rt("signup.PasswordAgain")}" minlength="8"
                        pattern="^(?=.*[A-Za-z])(?=.*\\d)(?=.*[@$!%*#?&])[A-Za-z\\d@$!%*#?&]{8,}$"
                        validationMessage="${rt("signup.PasswordInputRequired")}"
                        @change="${this._validatePassword}"
                        value="" required></mwc-textfield>
            <mwc-icon-button-toggle off onIcon="visibility" offIcon="visibility_off"
                                    @click="${t=>this._togglePasswordVisibility(t.target)}">
            </mwc-icon-button-toggle>
          </div>
          <div style="margin-top:10px;">
            <wl-checkbox id="approve-terms-of-service">
            </wl-checkbox>
             I have read and agree to the <a style="color:forestgreen;" @click="${()=>this.receiveTOSAgreement()}">${rt("signup.TermsOfService")}</a> and <a style="color:forestgreen;" @click="${()=>this.receivePPAgreement()}">${rt("signup.PrivacyPolicy")}</a>.
          </div>
        </div>
        <div slot="footer" class="horizontal center-justified flex layout">
          <mwc-button
              id="signup-button"
              raised
              class="full"
              icon="check"
              @click="${()=>this._signup()}">
                <span id="signup-button-message">${rt("signup.Signup")}</span>
          </mwc-button>
        </div>
      </backend-ai-dialog>
      <backend-ai-dialog id="block-panel" fixed type="error" backdrop blockscrolling persistent>
        <span slot="title">${rt("dialog.error.Error")}</span>
        <div slot="content" style="text-align:center;">
          ${this.errorMsg}
        </div>
      </backend-ai-dialog>
      <backend-ai-dialog id="email-sent-dialog" noclosebutton fixed backdrop blockscrolling persistent>
        <span slot="title">${rt("signup.ThankYou")}</span>
        <div slot="content">
          <p style="max-width:350px">${rt("signup.VerificationMessage")}</p>
        </div>
        <div slot="footer" class="horizontal end-justified flex layout">
          <mwc-button
              unelevated
              label="${rt("button.Okay")}"
              @click="${t=>t.target.closest("backend-ai-dialog").hide()}"></mwc-button>
        </div>
      </backend-ai-dialog>
      <lablup-terms-of-service id="terms-of-service"></lablup-terms-of-service>
    `}};r([yt({type:String})],gs.prototype,"company_name",void 0),r([yt({type:String})],gs.prototype,"company_id",void 0),r([yt({type:String})],gs.prototype,"user_name",void 0),r([yt({type:String})],gs.prototype,"user_email",void 0),r([yt({type:String})],gs.prototype,"errorMsg",void 0),r([yt({type:String})],gs.prototype,"endpoint",void 0),r([yt({type:Object})],gs.prototype,"notification",void 0),r([yt({type:Object})],gs.prototype,"signupPanel",void 0),r([yt({type:Object})],gs.prototype,"blockPanel",void 0),r([yt({type:Object})],gs.prototype,"client",void 0),r([yt({type:String})],gs.prototype,"TOSlanguage",void 0),r([yt({type:Object})],gs.prototype,"TOSdialog",void 0),gs=r([bt("backend-ai-signup")],gs);
/**
 @license
 Copyright (c) 2015-2020 Lablup Inc. All rights reserved.
 */
let bs=class extends Un{constructor(){super(),this.api_key="",this.secret_key="",this.user_id="",this.password="",this.proxy_url="http://127.0.0.1:5050/",this.api_endpoint="",this.domain_name="",this.default_session_environment="",this.blockType="",this.blockMessage="",this.connection_mode="SESSION",this.config=Object(),this.is_connected=!1,this.signup_support=!1,this.allowAnonymousChangePassword=!1,this.change_signin_support=!1,this.allow_signout=!1,this.allow_project_resource_monitor=!1,this.openPortToPublic=!1,globalThis.backendaiconsole={},this.endpoints=[]}static get styles(){return[Me,yo,_o,wo,xo,Ct`
        .warning {
          color: red;
        }

        backend-ai-dialog {
          --component-width: 400px;
          --component-padding: 0;
        }

        fieldset input {
          width: 100%;
          border: 0;
          margin: 15px 0 0 0;
          font: inherit;
          font-size: 16px;
          outline: none;
        }

        mwc-textfield {
          font-family: var(--general-font-family);
          --mdc-theme-primary: black;
          --mdc-text-field-fill-color: rgb(250, 250, 250);
          width: 100%;
        }

        .endpoint-text {
          --mdc-text-field-disabled-line-color: rgba(0, 0, 0, 0.0);
        }

        mwc-icon-button {
          /*color: rgba(0, 0, 0, 0.54); Matched color with above icons*/
          color: var(--paper-blue-600);
          --mdc-icon-size: 24px;
        }

        mwc-icon-button.endpoint-control-button {
          --mdc-icon-size: 16px;
          --mdc-icon-button-size: 24px;
          color: red;
        }

        mwc-menu {
          font-family: var(--general-font-family);
          --mdc-menu-min-width: 400px;
          --mdc-menu-max-width: 400px;
        }

        mwc-list-item[disabled] {
          --mdc-menu-item-height: 30px;
          border-bottom: 1px solid #ccc;
        }

        mwc-button {
          background-image: none;
          --mdc-theme-primary: var(--general-button-background-color);
          --mdc-on-theme-primary: var(--general-button-background-color);
        }

        mwc-button[unelevated] {
          background-image: none;
          --mdc-theme-primary: var(--general-button-background-color);
        }

        mwc-button[outlined] {
          background-image: none;
          --mdc-button-outline-width: 2px;
          --mdc-button-disabled-outline-color: var(--general-button-background-color);
          --mdc-button-disabled-ink-color: var(--general-button-background-color);
          --mdc-theme-primary: var(--general-button-background-color);
          --mdc-on-theme-primary: var(--general-button-background-color);
        }

        #login-panel {
          --dialog-width: 400px;
          --backdrop-bg: transparent;
          --dialog-elevation: 0px 0px 5px 5px rgba(0, 0, 0, 0.1);
        }

        h3 small {
          --button-font-size: 12px;
        }

        wl-icon {
          --icon-size: 16px;
          padding: 0;
        }

        .login-input {
          background-color: #FAFAFA;
          border-bottom: 1px solid #ccc;
          height: 50px;
        }

        .login-input mwc-icon {
          margin: 5px 15px 5px 15px;
          color: #737373;
        }

        .login-input input {
          width: 100%;
          background-color: #FAFAFA;
          margin-bottom: 5px;
          font-size: 18px;
          margin-top: 5px;
        }
      `]}firstUpdated(){this.loginPanel=this.shadowRoot.querySelector("#login-panel"),this.signoutPanel=this.shadowRoot.querySelector("#signout-panel"),this.blockPanel=this.shadowRoot.querySelector("#block-panel"),this.notification=globalThis.lablupNotification,this.endpoints=globalThis.backendaioptions.get("endpoints",[])}_changeSigninMode(){!0===this.change_signin_support&&("SESSION"==this.connection_mode?(this.connection_mode="API",localStorage.setItem("backendaiconsole.connection_mode","API")):(this.connection_mode="SESSION",localStorage.setItem("backendaiconsole.connection_mode","SESSION")),this.requestUpdate())}refreshWithConfig(t){void 0===t.plugin||void 0===t.plugin.login||""===t.plugin.login||import("../plugins/"+t.plugin.login).then((()=>{console.log("Plugin loaded.")})).catch((t=>{!0!==this.loginPanel.open?(void 0!==t.message?(this.notification.text=ko.relieve(t.title),this.notification.detail=t.message):this.notification.text=ko.relieve("Plugin loading failed."),this.notification.show(!1,t),this.open()):(this.notification.text=ko.relieve("Login failed. Check login information."),this.notification.show(!1,t))})),void 0===t.general||void 0===t.general.debug||""===t.general.debug?globalThis.backendaiconsole.debug=!1:!0===t.general.debug&&(globalThis.backendaiconsole.debug=!0,console.log("Debug flag is set to true")),void 0===t.general||void 0===t.general.signupSupport||""===t.general.signupSupport||0==t.general.signupSupport?this.signup_support=!1:(this.signup_support=!0,this.shadowRoot.querySelector("#signup-dialog").active=!0),void 0===t.general||void 0===t.general.allowAnonymousChangePassword||""===t.general.allowAnonymousChangePassword||0==t.general.allowAnonymousChangePassword?this.allowAnonymousChangePassword=!1:this.allowAnonymousChangePassword=!0,void 0===t.general||void 0===t.general.allowChangeSigninMode||""===t.general.allowChangeSigninMode||0==t.general.allowChangeSigninMode?this.change_signin_support=!1:this.change_signin_support=!0,void 0===t.general||void 0===t.general.allowProjectResourceMonitor||""===t.general.allowProjectResourceMonitor||0==t.general.allowProjectResourceMonitor?this.allow_project_resource_monitor=!1:this.allow_project_resource_monitor=!0,void 0===t.general||void 0===t.general.openPortToPublic||""===t.general.openPortToPublic||0==t.general.openPortToPublic?this.openPortToPublic=!1:this.openPortToPublic=!0,void 0===t.general||void 0===t.general.allowSignout||""===t.general.allowSignout||0==t.general.allowSignout?this.allow_signout=!1:this.allow_signout=!0,void 0===t.wsproxy||void 0===t.wsproxy.proxyURL||""===t.wsproxy.proxyURL?this.proxy_url="http://127.0.0.1:5050/":this.proxy_url=t.wsproxy.proxyURL,void 0===t.general||void 0===t.general.apiEndpoint||""===t.general.apiEndpoint?(this.shadowRoot.querySelector("#id_api_endpoint_container").style.display="flex",this.shadowRoot.querySelector("#id_api_endpoint_humanized").style.display="none"):(this.api_endpoint=t.general.apiEndpoint,void 0===t.general||void 0===t.general.apiEndpointText||""===t.general.apiEndpointText?(this.shadowRoot.querySelector("#id_api_endpoint_container").style.display="flex",this.shadowRoot.querySelector("#id_api_endpoint_humanized").style.display="none",this.shadowRoot.querySelector("#endpoint-button").disabled="true"):(this.shadowRoot.querySelector("#id_api_endpoint_container").style.display="none",this.shadowRoot.querySelector("#id_api_endpoint_humanized").style.display="block",this.shadowRoot.querySelector("#id_api_endpoint_humanized").value=t.general.apiEndpointText),this.shadowRoot.querySelector("#id_api_endpoint").disabled=!0,this.shadowRoot.querySelector("#id_api_endpoint_humanized").disabled=!0),void 0===t.general||void 0===t.general.defaultSessionEnvironment||""===t.general.defaultSessionEnvironment?this.default_session_environment="":this.default_session_environment=t.general.defaultSessionEnvironment;let e=localStorage.getItem("backendaiconsole.connection_mode");globalThis.isElectron&&null!==e&&""!=e&&'""'!=e?this.connection_mode="SESSION"===e?"SESSION":"API":void 0===t.general||void 0===t.general.connectionMode||""===t.general.connectionMode||"SESSION"===t.general.connectionMode.toUpperCase()?this.connection_mode="SESSION":this.connection_mode="API"}open(){!0!==this.loginPanel.open&&this.loginPanel.show(),!0===this.blockPanel.open&&this.blockPanel.hide()}close(){!0===this.loginPanel.open&&this.loginPanel.hide(),!0===this.blockPanel.open&&this.blockPanel.hide()}block(t="",e=""){this.blockMessage=t,this.blockType=e,setTimeout((()=>{!1===this.blockPanel.open&&!1===this.is_connected&&!1===this.loginPanel.open&&this.blockPanel.show()}),2e3)}free(){this.blockPanel.hide()}_trimChar(t,e){return t.replace(/^\|+|\|+$/g,"")}login(t=!0){if(""===this.api_endpoint){let t=localStorage.getItem("backendaiconsole.api_endpoint");null!=t&&(this.api_endpoint=t.replace(/^\"+|\"+$/g,""))}this.api_endpoint=this.api_endpoint.trim(),"SESSION"===this.connection_mode?this._connectUsingSession(t):"API"===this.connection_mode?this._connectUsingAPI(t):this.open()}signout(){this.signoutPanel.show()}_showSignupDialog(){if(this.api_endpoint=this.api_endpoint.trim(),""===this.api_endpoint)return this.notification.text="API Endpoint is empty. Please specify Backend.AI API endpoint to signup.",void this.notification.show();this.shadowRoot.querySelector("#signup-dialog").endpoint=this.api_endpoint,this.shadowRoot.querySelector("#signup-dialog").open()}_showChangePasswordEmailDialog(){this.shadowRoot.querySelector("#change-password-confirm-dialog").show()}async _sendChangePasswordEmail(){const t=this.shadowRoot.querySelector("#password-change-email");if(t.value&&t.validity.valid)try{const e=new ai.backend.ClientConfig("","",this.api_endpoint,"SESSION"),i=new ai.backend.Client(e,"Backend.AI Console.");await i.cloud.send_password_change_email(t.value),this.shadowRoot.querySelector("#change-password-confirm-dialog").hide(),this.notification.text=p("signup.EmailSent"),this.notification.show()}catch(t){console.error(t),this.notification.text=t.message||"Send error",this.notification.show()}}_cancelLogin(t){this._hideDialog(t),this.open()}_validate_data(t){return null!=t&&null!=t&&""!=t}_submitIfEnter(t){13==t.keyCode&&this._login()}_signoutIfEnter(t){13==t.keyCode&&this._signout()}_signout(){let t=this.shadowRoot.querySelector("#id_signout_user_id").value,e=this.shadowRoot.querySelector("#id_signout_password").value;this.client.signout(t,e).then((t=>{this.notification.text=p("login.SignoutFinished"),this.notification.show();let e=new CustomEvent("backend-ai-logout",{detail:""});document.dispatchEvent(e)})).catch((t=>{this.free(),!0!==this.signoutPanel.open?(console.log(t),void 0!==t.message?(this.notification.text=ko.relieve(t.title),this.notification.detail=t.message):this.notification.text=ko.relieve("Login information mismatch. Check your information and try again."),this.notification.show()):(this.notification.text=ko.relieve("Signout failed. Check ID/password information."),this.notification.show())}))}_login(){if(this.api_endpoint=this.shadowRoot.querySelector("#id_api_endpoint").value,this.api_endpoint=this.api_endpoint.replace(/\/+$/,""),""===this.api_endpoint)return this.notification.text=p("login.APIEndpointEmpty"),void this.notification.show();"SESSION"===this.connection_mode?(this.user_id=this.shadowRoot.querySelector("#id_user_id").value,this.password=this.shadowRoot.querySelector("#id_password").value,this._connectUsingSession(!0)):(this.api_key=this.shadowRoot.querySelector("#id_api_key").value,this.secret_key=this.shadowRoot.querySelector("#id_secret_key").value,this._connectUsingAPI(!0))}async _connectUsingSession(t=!0){return""===this.api_endpoint?(this.free(),this.open(),Promise.resolve(!1)):(this.clientConfig=new ai.backend.ClientConfig(this.user_id,this.password,this.api_endpoint,"SESSION"),this.client=new ai.backend.Client(this.clientConfig,"Backend.AI Console."),this.client.get_manager_version().then((async()=>{if(!1!==await this.client.check_login())return this.is_connected=!0,this._connectGQL();this.block(p("login.PleaseWait"),p("login.ConnectingToCluster")),this.client.login().then((t=>{if(!1===t)this.open(),""!=this.user_id&&""!=this.password&&(this.notification.text=ko.relieve("Login information mismatch. Please check your login information."),this.notification.show());else{if(!t.fail_reason)return this.is_connected=!0,this._connectGQL();this.open(),""!=this.user_id&&""!=this.password&&(this.notification.text=ko.relieve(t.fail_reason),this.notification.show())}})).catch((e=>{this.free(),t&&(!0!==this.loginPanel.open?void 0!==e.message?(this.notification.text=ko.relieve(e.title),this.notification.detail=e.message):this.notification.text=ko.relieve("Login information mismatch. If the information is correct, logout and login again."):(void 0!==e.message?(this.notification.text=ko.relieve(e.title),this.notification.detail=e.message):this.notification.text=ko.relieve("Login failed. Check login information."),console.log(e)),this.notification.show()),this.open()}))})).catch((e=>(this.free(),this.open(),t&&(this.notification.text=ko.relieve("Endpoint is unreachable. Please check the connection or endpoint"),this.notification.show()),Promise.resolve(!1)))))}_connectUsingAPI(t=!0){this.clientConfig=new ai.backend.ClientConfig(this.api_key,this.secret_key,this.api_endpoint),this.client=new ai.backend.Client(this.clientConfig,"Backend.AI Console."),this.client.ready=!1,this._connectGQL(t)}_connectGQL(t=!0){!0!==this.loginPanel.open&&this.block(),this.client.get_manager_version().then((t=>{this._connectViaGQL()})).catch((e=>{this.free(),t&&(!0!==this.loginPanel.open?(void 0!==e.message?408===e.status?(this.notification.text="Login succeed but manager is not responding.",this.notification.detail=e.message):(this.notification.text=ko.relieve(e.title),this.notification.detail=e.message):this.notification.text=ko.relieve("Login information mismatch. If the information is correct, logout and login again."),this.notification.show(!1,e),this.open()):(this.notification.text=ko.relieve("Login failed. Check login information."),this.notification.show())),this.open()}))}_connectViaGQL(){let t=`query { keypair { ${["user_id","resource_policy","user"].join(" ")} } }`;return this.client.query(t,{}).then((t=>{this.is_connected=!0,globalThis.backendaiclient=this.client;let e=t.keypair.resource_policy;globalThis.backendaiclient.resource_policy=e,this.user=t.keypair.user;let i=`query { user{ ${["username","email","full_name","is_active","role","domain_name","groups {name, id}"].join(" ")} } }`,r={uuid:this.user};return globalThis.backendaiclient.query(i,r)})).then((t=>{let e=t.user.email;this.email!==e&&(this.email=e),this.user_groups=t.user.groups;let i=t.user.role;return this.domain_name=t.user.domain_name,globalThis.backendaiclient.email=this.email,globalThis.backendaiclient.full_name=t.user.full_name,globalThis.backendaiclient.is_admin=!1,globalThis.backendaiclient.is_superadmin=!1,["superadmin","admin"].includes(i)&&(globalThis.backendaiclient.is_admin=!0),["superadmin"].includes(i)&&(globalThis.backendaiclient.is_superadmin=!0),globalThis.backendaiclient.group.list(!0,!1,["id","name","description","is_active"])})).then((t=>{let e=t.groups,i=this.user_groups.map((({id:t})=>t));if(null!==e){globalThis.backendaiclient.groups=e.filter((t=>{if(i.includes(t.id))return t})).map((t=>t.name));let t=Object();e.forEach((function(e){t[e.name]=e.id})),globalThis.backendaiclient.groupIds=t}else globalThis.backendaiclient.groups=["default"];globalThis.backendaiclient.current_group=globalThis.backendaiclient.groups[0],globalThis.backendaiclient.current_group_id=()=>globalThis.backendaiclient.groupIds[globalThis.backendaiclient.current_group],globalThis.backendaiclient._config._proxyURL=this.proxy_url,globalThis.backendaiclient._config.domainName=this.domain_name,globalThis.backendaiclient._config.default_session_environment=this.default_session_environment,globalThis.backendaiclient._config.allow_project_resource_monitor=this.allow_project_resource_monitor,globalThis.backendaiclient._config.openPortToPublic=this.openPortToPublic,globalThis.backendaiclient.ready=!0,-1===this.endpoints.indexOf(globalThis.backendaiclient._config.endpoint)&&(this.endpoints.push(globalThis.backendaiclient._config.endpoint),this.endpoints.length>5&&(this.endpoints=this.endpoints.slice(1,6)),globalThis.backendaioptions.set("endpoints",this.endpoints));let r=new CustomEvent("backend-ai-connected",{detail:this.client});document.dispatchEvent(r),this.close(),this._saveLoginInfo(),localStorage.setItem("backendaiconsole.api_endpoint",this.api_endpoint)})).catch((t=>{!0!==this.loginPanel.open?(void 0!==t.message?void 0!==t.title?(this.notification.text=ko.relieve(t.title),this.notification.detail=t.message):(this.notification.text=ko.relieve(t),this.notification.detail=t):this.notification.text=ko.relieve("Login information mismatch. If the information is correct, logout and login again."),this.notification.show(!1,t),this.open()):(this.notification.text=ko.relieve("Login failed. Check login information."),this.notification.show(!0))}))}async _saveLoginInfo(){localStorage.removeItem("backendaiconsole.login.api_key"),localStorage.removeItem("backendaiconsole.login.secret_key"),localStorage.removeItem("backendaiconsole.login.user_id"),localStorage.removeItem("backendaiconsole.login.password")}_toggleEndpoint(){let t=this.shadowRoot.querySelector("#endpoint-list"),e=this.shadowRoot.querySelector("#endpoint-button");t.anchor=e,t.open=!t.open}_updateEndpoint(){let t=this.shadowRoot.querySelector("#endpoint-list");this.api_endpoint=t.selected.value}_deleteEndpoint(t){let e=this.endpoints.indexOf(t);e>-1&&this.endpoints.splice(e,1),globalThis.backendaioptions.set("endpoints",this.endpoints),this.requestUpdate()}render(){return Z`
      <backend-ai-dialog id="login-panel" noclosebutton fixed blockscrolling persistent disablefocustrap>
        <div slot="title" class="horizontal center layout">
          <img src="manifest/backend.ai-text.svg" style="height:35px;padding:15px 0 15px 5px;" />
          <div class="flex"></div>
        </div>
        <div slot="content" class="login-panel intro centered" style="margin: 0;">
          <h3 class="horizontal center layout" style="margin: 0 25px;font-weight:700;min-height:40px;">
            <div>${"SESSION"==this.connection_mode?rt("login.LoginWithE-mail"):rt("login.LoginWithIAM")}</div>
            <div class="flex"></div>
            ${this.change_signin_support?Z`
                <div class="vertical center-justified layout">
                  <div style="font-size:12px;margin:5px 10px;text-align:center;font-weight:400;">${rt("login.LoginAnotherway")}</div>
                  <mwc-button
                      class="change-login-mode-button"
                      outlined
                      label="${"SESSION"==this.connection_mode?rt("login.ClickToUseIAM"):rt("login.ClickToUseID")}"
                      @click="${()=>this._changeSigninMode()}">
                  </mwc-button>
                </div>
            `:Z``}
          </h3>
          <form id="session-login-form" style="${"SESSION"==this.connection_mode?"display:block;":"display:none;"}">
            <fieldset>
              <div class="horizontal layout start-justified center login-input">
                <mwc-icon>email</mwc-icon>
                <input type="email" id="id_user_id" maxlength="50" autocomplete="username"
                             label="${rt("login.E-mail")}" placeholder="${rt("login.E-mail")}" icon="email" value="${this.user_id}" @keyup="${this._submitIfEnter}"></input>
              </div>
              <div class="horizontal layout start-justified center login-input">
                <mwc-icon>vpn_key</mwc-icon>
                <input type="password" id="id_password" autocomplete="current-password"
                             label="${rt("login.Password")}" placeholder="${rt("login.Password")}" icon="vpn_key" value="${this.password}" @keyup="${this._submitIfEnter}"></input>
              </div>
            </fieldset>
          </form>
          <form id="api-login-form" style="${"SESSION"==this.connection_mode?"display:none;":"display:block;"}">
            <fieldset>
              <mwc-textfield type="text" id="id_api_key" maxlength="30"
                           label="${rt("login.APIKey")}" icon="lock" value="${this.api_key}" @keyup="${this._submitIfEnter}"></mwc-textfield>
              <mwc-textfield type="password" id="id_secret_key"
                           label="${rt("login.SecretKey")}" icon="vpn_key" value="${this.secret_key}" @keyup="${this._submitIfEnter}"></mwc-textfield>
            </fieldset>
          </form>
          <form>
            <fieldset>
              <div class="horizontal layout" id="id_api_endpoint_container" style="display:none;">
                <mwc-icon-button id="endpoint-button" icon="cloud_queue" style="margin-left:5px;" @click="${()=>this._toggleEndpoint()}"></mwc-icon-button>
                <mwc-menu id="endpoint-list" @selected="${()=>this._updateEndpoint()}">
                  <mwc-list-item disabled>${rt("login.EndpointHistory")}</mwc-list-item>
                  ${0===this.endpoints.length?Z`
                  <mwc-list-item value="">${rt("login.NoEndpointSaved")}</mwc-list-item>
                  `:Z``}

                  ${this.endpoints.map((t=>Z`<mwc-list-item value="${t}">
                    <div class="horizontal justified center flex layout" style="width:365px;">
                      <span>${t}</span><span class="flex"></span>
                      <mwc-icon-button icon="delete" @click="${()=>this._deleteEndpoint(t)}" class="endpoint-control-button"></mwc-icon-button>
                    </div>
                  </mwc-list-item>`))}
                </mwc-menu>
                <mwc-textfield class="endpoint-text" type="text" id="id_api_endpoint"
                             style="--mdc-text-field-idle-line-color:rgba(255,255,255,0);--mdc-text-field-hover-line-color:rgba(255,255,255,0);"
                             label="${rt("login.Endpoint")}" value="${this.api_endpoint}" @keyup="${this._submitIfEnter}"></mwc-textfield>
              </div>
              <mwc-textfield class="endpoint-text" type="text" id="id_api_endpoint_humanized"
                           style="display:none;--mdc-text-field-idle-line-color:rgba(255,255,255,0);--mdc-text-field-hover-line-color:rgba(255,255,255,0);"
                           label="${rt("login.Endpoint")}" icon="cloud" value=""></mwc-textfield>
              <mwc-button
                    unelevated
                    id="login-button"
                    icon="check"
                    style="width:100%;"
                    label="${rt("login.Login")}"
                    @click="${()=>this._login()}"></mwc-button>
              ${this.signup_support&&this.allowAnonymousChangePassword?Z`
              <div class="layout horizontal" style="margin-top:2em;">
                ${this.signup_support?Z`
                  <div class="vertical center-justified layout" style="width:100%;">
                    <div style="font-size:12px; margin:0 10px; text-align:center;">${rt("login.NotAUser")}</div>
                    <mwc-button
                        outlined
                        label="${rt("login.SignUp")}"
                        @click="${()=>this._showSignupDialog()}"></mwc-button>
                  </div>
                `:Z``}
                ${this.signup_support&&this.allowAnonymousChangePassword?Z`
                  <span class="flex" style="min-width:1em;"></span>
                `:Z``}
                ${this.allowAnonymousChangePassword?Z`
                  <div class="vertical center-justified layout" style="width:100%;">
                    <div style="font-size:12px; margin:0 10px; text-align:center;">${rt("login.ForgotPassword")}</div>
                    <mwc-button
                        outlined
                        label="${rt("login.ChangePassword")}"
                        @click="${()=>this._showChangePasswordEmailDialog()}"></mwc-button>
                  </div>
                `:Z``}
              </div>`:Z``}
            </fieldset>
          </form>
        </div>
      </backend-ai-dialog>
      <backend-ai-dialog id="signout-panel" fixed backdrop blockscrolling persistent disablefocustrap>
        <span slot="title">${rt("login.LeaveService")}</span>
        <div slot="content">
          <section>
            <div class="warning">${rt("login.DescConfirmLeave")}</div>
          </section>
          <mwc-textfield type="email" name="signout_user_id" id="id_signout_user_id" maxlength="30"
                       label="E-mail" value="" @keyup="${this._signoutIfEnter}"></mwc-textfield>
          <mwc-textfield type="password" name="signout_password" id="id_signout_password"
                       label="Password" value="" @keyup="${this._signoutIfEnter}"></mwc-textfield>
        </div>
        <div slot="footer" class="horizontal end-justified flex layout">
          <mwc-button
              outlined
              id="signout-button"
              icon="check"
              label="${rt("login.LeaveService")}"
              @click="${()=>this._signout()}"></mwc-button>
        </div>
      </backend-ai-dialog>
      <backend-ai-dialog id="change-password-confirm-dialog" fixed backdrop blockscrolling persistent disablefocustrap>
        <span slot="title">${rt("login.SendChangePasswordEmail")}</span>
        <div slot="content">
          <section>
            <div style="padding:1em">${rt("login.DescChangePasswordEmail")}</div>
          </section>
          <mwc-textfield type="email" id="password-change-email" maxlength="30"
              label="E-mail" value="" autofocus auto-validate
              validationMessage="${rt("signup.InvalidEmail")}"
              pattern="^[A-Z0-9a-z#-_]+@.+\\..+$"></mwc-textfield>
        </div>
        <div slot="footer" class="horizontal end-justified flex layout">
          <mwc-button
              outlined
              icon="check"
              label="${rt("login.EmailSendButton")}"
              @click="${()=>this._sendChangePasswordEmail()}"></mwc-button>
        </div>
      </backend-ai-dialog>
      <backend-ai-dialog id="block-panel" fixed blockscrolling persistent>
        ${""!=this.blockMessage?Z`
          ${""!==this.blockType?Z`
            <span slot="title" id="work-title">${this.blockType}</span>
          `:Z``}
          <div slot="content" style="text-align:center;padding-top:15px;">
          ${this.blockMessage}
          </div>
          <div slot="footer" class="horizontal end-justified flex layout">
          <mwc-button
              outlined
              label="${rt("login.CancelLogin")}"
              @click="${t=>this._cancelLogin(t)}"></mwc-button>
          </div>
        `:Z``}
      </backend-ai-dialog>
      <backend-ai-signup id="signup-dialog"></backend-ai-signup>
    `}};r([yt({type:String})],bs.prototype,"api_key",void 0),r([yt({type:String})],bs.prototype,"secret_key",void 0),r([yt({type:String})],bs.prototype,"user_id",void 0),r([yt({type:String})],bs.prototype,"password",void 0),r([yt({type:String})],bs.prototype,"proxy_url",void 0),r([yt({type:String})],bs.prototype,"api_endpoint",void 0),r([yt({type:String})],bs.prototype,"domain_name",void 0),r([yt({type:String})],bs.prototype,"default_session_environment",void 0),r([yt({type:String})],bs.prototype,"blockType",void 0),r([yt({type:String})],bs.prototype,"blockMessage",void 0),r([yt({type:String})],bs.prototype,"connection_mode",void 0),r([yt({type:String})],bs.prototype,"user",void 0),r([yt({type:String})],bs.prototype,"email",void 0),r([yt({type:Object})],bs.prototype,"config",void 0),r([yt({type:Object})],bs.prototype,"loginPanel",void 0),r([yt({type:Object})],bs.prototype,"signoutPanel",void 0),r([yt({type:Object})],bs.prototype,"blockPanel",void 0),r([yt({type:Boolean})],bs.prototype,"is_connected",void 0),r([yt({type:Object})],bs.prototype,"clientConfig",void 0),r([yt({type:Object})],bs.prototype,"client",void 0),r([yt({type:Object})],bs.prototype,"notification",void 0),r([yt({type:Object})],bs.prototype,"user_groups",void 0),r([yt({type:Boolean})],bs.prototype,"signup_support",void 0),r([yt({type:Boolean})],bs.prototype,"allowAnonymousChangePassword",void 0),r([yt({type:Boolean})],bs.prototype,"change_signin_support",void 0),r([yt({type:Boolean})],bs.prototype,"allow_signout",void 0),r([yt({type:Boolean})],bs.prototype,"allow_project_resource_monitor",void 0),r([yt({type:Boolean})],bs.prototype,"openPortToPublic",void 0),r([yt({type:Array})],bs.prototype,"endpoints",void 0),bs=r([bt("backend-ai-login")],bs);
/**
 @license
 Copyright (c) 2015-2020 Lablup Inc. All rights reserved.
 */
class vs{constructor(t,e,i,r){this.tasktitle=t,this.taskid=i,this.taskobj=e,this.tasktype=r,this.created_at=Date.now(),this.finished_at=0,this.status="active"}remove(){delete this.taskobj}}let ys=class extends Ot{constructor(){super(),this.active=!0,this.isGCworking=!1,this.taskstore=[],this.finished=[],this.indicator=globalThis.lablupIndicator,this.pooler=setInterval((()=>{this.gc()}),1e4)}static get styles(){return[Ct``]}render(){return Z`
    `}shouldUpdate(){return this.active}firstUpdated(){}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}add(t,e,i="",r="general"){""===i&&(i=this.generate_UUID());let n=new vs(t,e,i,r);return null!=e&&"function"==typeof e.then&&(e.then().catch((t=>{})).finally((()=>{this.finished.push(i),this.gc()})),this.taskstore.push(n),this.signal(),n)}remove(t=""){let e=this.taskstore.filter((e=>e.taskid===t));if(e.length>0){let i=this.taskstore.indexOf(e[0]);i>-1&&(e[0].remove(),this.taskstore.splice(i,1)),delete e[0],i=this.finished.indexOf(t),i>-1&&this.finished.splice(i,1),this.signal()}}list(){return this.taskstore}generate_UUID(){let t=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{let i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?i:3&i|8).toString(16)}))}async gc(){this.isGCworking||(this.isGCworking=!0,this.finished.length>0&&this.finished.forEach((t=>{this.remove(t)})),this.isGCworking=!1)}signal(){let t=new CustomEvent("backend-ai-task-changed",{detail:{tasks:this.taskstore}});document.dispatchEvent(t)}};r([yt({type:Object})],ys.prototype,"indicator",void 0),r([yt({type:Array})],ys.prototype,"taskstore",void 0),r([yt({type:Array})],ys.prototype,"finished",void 0),r([yt({type:Object})],ys.prototype,"pooler",void 0),r([yt({type:Boolean})],ys.prototype,"active",void 0),r([yt({type:Boolean})],ys.prototype,"isGCworking",void 0),ys=r([bt("backend-ai-tasker")],ys);var _s=ys;c({loader:t=>fetch(`/resources/i18n/${t}.json`).then((t=>t.json()))}),globalThis.backendaioptions=new Vn,globalThis.tasker=new _s;let ws=class extends(Lt(Jt)(Ot)){constructor(){super(),this.hasLoadedStrings=!1,this.menuTitle="LOGIN REQUIRED",this.siteDescription="",this.user_id="DISCONNECTED",this.full_name="DISCONNECTED",this.domain="CLICK TO CONNECT",this.is_connected=!1,this.is_admin=!1,this.is_superadmin=!1,this.allow_signout=!1,this.proxy_url="",this.connection_mode="API",this.connection_server="",this.edition="Open Source",this.validUntil="",this.groups=Array(),this.current_group="",this.plugins=Object(),this.splash=Object(),this.loginPanel=Object(),this._page="",this._pageParams={},this._sidepanel="",this._drawerOpened=!1,this._offlineIndicatorOpened=!1,this._offline=!1,this._dropdownMenuIcon=Object(),this.config=Object(),this.TOSdialog=Object(),this.mini_ui=!1,this.lang="default",this.supportLanguageCodes=["en","ko"],this.minibarWidth=88,this.sidebarWidth=250,this.sidepanelWidth=250,this.blockedMenuitem=[]}static get styles(){return[Bo,yo,_o,wo,xo,Ct`
    `]}firstUpdated(){var t,e;let i;globalThis.lablupNotification=this.shadowRoot.querySelector("#notification"),globalThis.lablupIndicator=this.shadowRoot.querySelector("#indicator"),globalThis.appLauncher=this.shadowRoot.querySelector("#app-launcher"),globalThis.resourceBroker=this.shadowRoot.querySelector("#resource-broker"),globalThis.currentPage=this._page,globalThis.currentPageParams=this._pageParams,this.notification=globalThis.lablupNotification,this.appBody=this.shadowRoot.querySelector("#app-body"),this.contentBody=this.shadowRoot.querySelector("#content-body"),this.contentBody.type="dismissible",this.mainToolbar=this.shadowRoot.querySelector("#main-toolbar"),this.drawerToggleButton=this.shadowRoot.querySelector("#drawer-toggle-button"),this.sidebarMenu=this.shadowRoot.getElementById("sidebar-menu"),this.splash=this.shadowRoot.querySelector("#about-backendai-panel"),this.loginPanel=this.shadowRoot.querySelector("#login-panel"),this.TOSdialog=this.shadowRoot.querySelector("#terms-of-service"),this._dropdownMenuIcon=this.shadowRoot.querySelector("#dropdown-button"),globalThis.isElectron&&navigator.platform.indexOf("Mac")>=0&&(this.shadowRoot.querySelector(".portrait-canvas").style.visibility="hidden"),t=t=>Jt.dispatch(Vt(decodeURIComponent(t.pathname))),document.body.addEventListener("click",(e=>{if(e.defaultPrevented||0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey)return;const i=e.composedPath().filter((t=>"A"===t.tagName))[0];if(!i||i.target||i.hasAttribute("download")||"external"===i.getAttribute("rel"))return;const r=i.href;if(!r||-1!==r.indexOf("mailto:"))return;const n=window.location,o=n.origin||n.protocol+"//"+n.host;0===r.indexOf(o)&&(e.preventDefault(),r!==n.href&&(window.history.pushState({},"",r),t(n,e)))})),window.addEventListener("popstate",(e=>t(window.location,e))),t(window.location,null),e=t=>Jt.dispatch(Xt(t)),window.addEventListener("online",(()=>e(!1))),window.addEventListener("offline",(()=>e(!0))),e(!1===navigator.onLine),globalThis.isElectron?(i="./config.toml",document.addEventListener("backend-ai-logout",(()=>this.logout(!0))),document.addEventListener("backend-ai-app-close",(()=>this.close_app_window(!0))),document.addEventListener("backend-ai-show-splash",(()=>this.splash.show()))):(i="../../config.toml",document.addEventListener("backend-ai-logout",(()=>this.logout(!1)))),this._parseConfig(i).then((()=>{if(this.loadConfig(this.config),void 0===globalThis.backendaiclient||null===globalThis.backendaiclient||!1===globalThis.backendaiclient.ready)if("verify-email"===this._page){const t=this.shadowRoot.querySelector("backend-ai-email-verification-view");window.setTimeout((()=>{t.verify(this.loginPanel.api_endpoint)}),1e3)}else if("change-password"===this._page){const t=this.shadowRoot.querySelector("backend-ai-change-forgot-password-view");window.setTimeout((()=>{t.open(this.loginPanel.api_endpoint)}),1e3)}else this.loginPanel.login(!1)})).catch((t=>{console.log("Initialization failed."),void 0!==globalThis.backendaiclient&&null!==globalThis.backendaiclient&&!1!==globalThis.backendaiclient.ready||this.loginPanel.block("Configuration is not loaded.","Error")})),this.mini_ui=globalThis.backendaioptions.get("compact_sidebar"),globalThis.mini_ui=this.mini_ui,this._changeDrawerLayout(document.body.clientWidth,document.body.clientHeight),globalThis.addEventListener("resize",(t=>{this._changeDrawerLayout(document.body.clientWidth,document.body.clientHeight)}))}async connectedCallback(){super.connectedCallback(),document.addEventListener("backend-ai-connected",(()=>this.refreshPage())),"default"===globalThis.backendaioptions.get("language")&&this.supportLanguageCodes.includes(globalThis.navigator.language)?this.lang=globalThis.navigator.language:this.supportLanguageCodes.includes(globalThis.backendaioptions.get("language"))?this.lang=globalThis.backendaioptions.get("language"):this.lang="en",globalThis.backendaioptions.set("current_language",this.lang),await u(this.lang),this.hasLoadedStrings=!0}disconnectedCallback(){document.removeEventListener("backend-ai-connected",(()=>this.refreshPage())),super.disconnectedCallback()}attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i)}shouldUpdate(t){return this.hasLoadedStrings&&super.shouldUpdate(t)}loadConfig(t){void 0!==t.general&&"siteDescription"in t.general&&(this.siteDescription=t.general.siteDescription),void 0!==t.general&&"connectionMode"in t.general&&(this.connection_mode=t.general.connectionMode),void 0!==t.general&&"connectionServer"in t.general&&(this.connection_server=t.general.connectionServer),void 0!==t.license&&"edition"in t.license&&(this.edition=t.license.edition),void 0!==t.menu&&"blocklist"in t.menu&&(this.blockedMenuitem=t.menu.blocklist.split(",")),globalThis.packageEdition=this.edition,void 0!==t.license&&"validUntil"in t.license&&(this.validUntil=t.license.validUntil),globalThis.packageValidUntil=this.validUntil,void 0===t.general||void 0===t.general.allowSignout||""===t.general.allowSignout||0==t.general.allowSignout?this.allow_signout=!1:this.allow_signout=!0,void 0!==t.plugin&&("login"in t.plugin&&(this.plugins.login=t.plugin.login),"page"in t.plugin&&(this.plugins.page=t.plugin.page,globalThis.backendaiPages=t.plugin.page),"sidebar"in t.plugin&&(this.plugins.sidebar=t.plugin.sidebar)),this.loginPanel.refreshWithConfig(t)}refreshPage(){this.shadowRoot.getElementById("sign-button").icon="exit_to_app",globalThis.backendaiclient.proxyURL=this.proxy_url,void 0!==globalThis.backendaiclient&&null!=globalThis.backendaiclient&&void 0!==globalThis.backendaiclient.is_admin&&!0===globalThis.backendaiclient.is_admin?this.is_admin=!0:this.is_admin=!1,void 0!==globalThis.backendaiclient&&null!=globalThis.backendaiclient&&void 0!==globalThis.backendaiclient.is_superadmin&&!0===globalThis.backendaiclient.is_superadmin?this.is_superadmin=!0:this.is_superadmin=!1,this._refreshUserInfoPanel(),this._writeRecentProjectGroup(this.current_group),document.body.style.backgroundImage="none",this.appBody.style.visibility="visible";let t=this.shadowRoot.getElementById("loading-curtain");t.classList.add("visuallyhidden"),t.addEventListener("transitionend",(()=>{t.classList.add("hidden"),this.is_connected=!0}),{capture:!1,once:!0,passive:!1}),this.addTooltips()}showUpdateNotifier(){let t=this.shadowRoot.getElementById("backend-ai-indicator");t.innerHTML='New console available. Please <a onclick="globalThis.location.reload()">reload</a> to update.',t.show()}_parseConfig(t){return fetch(t).then((t=>200==t.status?t.text():"")).then((t=>{var e,i,r;this.config=(e=t,i=new RegExp("^\\s*\\[(\\[)?(.*?)\\]\\]?(?= *$)((?:[\\w\\W](?!^\\s*\\[))*)","gm"),r={},Xr(e=(e="["===e[0]?e:"[]\n"+e).replace(/('{3,}(?:(?!'{3,})[\w\W]+?)'{3,})/gm,(function(t,e){if(e)return e.replace(/^(\s*)(\[)/gm,"$1__>>[<<__")})),i,(function(t,e){e[1]?Yr(r,e[2].trim(),Zr(e[3]),!0):""===e[2]?r=Object.assign({},r,Zr(e[3])):Yr(r,e[2].trim(),Zr(e[3]),!1)})),JSON.parse(JSON.stringify(r,Jr),Qr))})).catch((t=>{console.log("Configuration file missing.")}))}toggleSidebarUI(){this.mini_ui?this.mini_ui=!1:this.mini_ui=!0,globalThis.mini_ui=this.mini_ui;let t=new CustomEvent("backend-ai-ui-changed",{detail:{"mini-ui":this.mini_ui}});document.dispatchEvent(t),this._changeDrawerLayout(document.body.clientWidth,document.body.clientHeight)}toggleSidePanelUI(){this.contentBody.open?(this.contentBody.open=!1,this.mini_ui?this.mainToolbar.style.setProperty("--mdc-drawer-width",this.minibarWidth+"px"):this.mainToolbar.style.setProperty("--mdc-drawer-width",this.sidebarWidth+"px")):(this.contentBody.open=!0,this.contentBody.style.setProperty("--mdc-drawer-width",this.sidepanelWidth+"px"),this.mini_ui?this.mainToolbar.style.setProperty("--mdc-drawer-width",this.minibarWidth+this.sidepanelWidth+"px"):this.mainToolbar.style.setProperty("--mdc-drawer-width",this.sidebarWidth+this.sidepanelWidth+"px"))}toggleSidePanelType(){this.contentBody.type,this.contentBody.type}_openSidePanel(t){!0===this.contentBody.open?t!=this._sidepanel?this._sidepanel=t:(this._sidepanel="",this.toggleSidePanelUI()):(this._sidepanel=t,this.toggleSidePanelUI())}_changeDrawerLayout(t,e){this.mainToolbar.style.setProperty("--mdc-drawer-width","0px"),t<700?(this.appBody.style.setProperty("--mdc-drawer-width",this.sidebarWidth+"px"),this.appBody.type="modal",this.appBody.open=!1,this.mainToolbar.style.setProperty("--mdc-drawer-width","0px"),this.drawerToggleButton.style.display="block",this.mini_ui&&(this.mini_ui=!1,globalThis.mini_ui=this.mini_ui)):(this.mini_ui?(this.appBody.style.setProperty("--mdc-drawer-width",this.minibarWidth+"px"),this.mainToolbar.style.setProperty("--mdc-drawer-width",this.minibarWidth+"px"),this.contentBody.style.width=t-this.minibarWidth+"px",this.contentBody.open&&this.mainToolbar.style.setProperty("--mdc-drawer-width",this.minibarWidth+this.sidebarWidth+"px")):(this.appBody.style.setProperty("--mdc-drawer-width",this.sidebarWidth+"px"),this.mainToolbar.style.setProperty("--mdc-drawer-width",this.sidebarWidth+"px"),this.contentBody.style.width=t-this.sidebarWidth+"px",this.contentBody.open&&this.mainToolbar.style.setProperty("--mdc-drawer-width",this.sidebarWidth+this.sidepanelWidth+"px")),this.appBody.type="dismissible",this.appBody.open=!0,this.drawerToggleButton.style.display="none"),this.contentBody.open&&this.contentBody.style.setProperty("--mdc-drawer-width",this.sidepanelWidth+"px")}_refreshUserInfoPanel(){this.user_id=globalThis.backendaiclient.email,this.full_name=globalThis.backendaiclient.full_name,this.domain=globalThis.backendaiclient._config.domainName,this.current_group=this._readRecentProjectGroup(),globalThis.backendaiclient.current_group=this.current_group,this.groups=globalThis.backendaiclient.groups;let t=this.shadowRoot.getElementById("group-select-box");t.hasChildNodes()&&t.removeChild(t.firstChild);let e=document.createElement("div");e.className="horizontal center center-justified layout";let i=document.createElement("p");i.setAttribute("style","font-size:12px;color:#8c8484;"),i.innerHTML=p("console.menu.Project");let r=document.createElement("mwc-select");r.id="group-select",r.value=this.current_group,r.style.width="130px",r.addEventListener("selected",(t=>this.changeGroup(t)));let n=document.createElement("mwc-list-item");n.setAttribute("disabled","true"),n.innerHTML=p("console.menu.SelectProject"),n.style.borderBottom="1px solid #ccc",r.appendChild(n),this.groups.map((t=>{n=document.createElement("mwc-list-item"),n.value=t,this.current_group===t?n.selected=!0:n.selected=!1,n.innerHTML=t,r.appendChild(n)})),e.appendChild(i),e.appendChild(r),t.appendChild(e)}_loadPageElement(){"index.html"!==this._page&&""!==this._page||(this._page="summary")}_openUserPrefDialog(){this.shadowRoot.querySelector("#user-preference-dialog").show()}_hideUserPrefDialog(){this.shadowRoot.querySelector("#user-preference-dialog").hide()}_updateUserPassword(){const t=this.shadowRoot.querySelector("#user-preference-dialog"),e=t.querySelector("#pref-original-password").value,i=t.querySelector("#pref-new-password"),r=t.querySelector("#pref-new-password2");if(!e)return this.notification.text="Enter old password",void this.notification.show();if(!i.value||!i.validity.valid)return this.notification.text="Invalid new password",void this.notification.show();if(i.value!==r.value)return this.notification.text="Two new passwords do not match",void this.notification.show();globalThis.backendaiclient.updatePassword(e,i.value,r.value).then((t=>{this.notification.text="Password updated",this.notification.show(),this._hideUserPrefDialog(),this.shadowRoot.querySelector("#prefj-original-password").value="",this.shadowRoot.querySelector("#prefj-new-password").value="",this.shadowRoot.querySelector("#prefj-new-password2").value=""})).catch((t=>{t&&t.title&&(this.notification.text=t.title,this.notification.detail=t.message,this.notification.show(!0,t))}))}_menuSelected(t){}updated(t){if(t.has("_page")){let t=this._page;if(!0!==["summary","job","agent","credential","data","usersettings","environment","settings","maintenance","information","statistics","github","import"].includes(t)){let e=t.split(/[\/]+/).pop();t=void 0!==e?e:"summary",this._page=t}this._updateSidebar(t)}}_updateSidebar(t){switch(t){case"summary":case"verify-email":this.menuTitle=p("console.menu.Summary");break;case"change-password":this.menuTitle=p("console.menu.Summary")+this.user_id;break;case"job":this.menuTitle=p("console.menu.Sessions");break;case"experiment":this.menuTitle=p("console.menu.Experiments");break;case"data":this.menuTitle=p("console.menu.Data&Storage");break;case"statistics":this.menuTitle=p("console.menu.Statistics");break;case"usersettings":this.menuTitle=p("console.menu.Settings&Logs");break;case"credential":this.menuTitle=p("console.menu.UserCredentials&Policies");break;case"environment":this.menuTitle=p("console.menu.Environments&Presets");break;case"agent":this.menuTitle=p("console.menu.ComputationResources");break;case"settings":this.menuTitle=p("console.menu.Configurations");break;case"maintenance":this.menuTitle=p("console.menu.Maintenance");break;case"information":this.menuTitle=p("console.menu.Information");break;case"logs":this.menuTitle=p("console.menu.Logs");break;case"github":case"import":this.menuTitle=p("console.menu.Import&Run");break;default:this._page="error",this.menuTitle=p("console.NOTFOUND")}}async close_app_window(t=!1){if(!1===globalThis.backendaioptions.get("preserve_login")){this.notification.text="Clean up login session...",this.notification.show();const t=Object.keys(localStorage);for(let e=0;e<t.length;e++){const i=t[e];/^(backendaiconsole\.login\.)/.test(i)&&localStorage.removeItem(i)}sessionStorage.clear()}void 0!==globalThis.backendaiclient&&null!==globalThis.backendaiclient&&("SESSION"===globalThis.backendaiclient._config.connectionMode&&await globalThis.backendaiclient.logout(),globalThis.backendaiclient=null)}async logout(t=!1){if(console.log("also close the app:",t),this._deleteRecentProjectGroupInfo(),void 0!==globalThis.backendaiclient&&null!==globalThis.backendaiclient){this.notification.text="Clean up now...",this.notification.show(),"SESSION"===globalThis.backendaiclient._config.connectionMode&&await globalThis.backendaiclient.logout(),this.is_admin=!1,this.is_superadmin=!1,globalThis.backendaiclient=null;const e=Object.keys(localStorage);for(let t=0;t<e.length;t++){const i=e[t];/^(backendaiconsole\.login\.)/.test(i)&&localStorage.removeItem(i)}sessionStorage.clear(),!0===t||(globalThis.isElectron?(this.user_id="",this.domain="",this._page="summary",globalThis.history.pushState({},"","/summary"),Jt.dispatch(Vt(decodeURIComponent("/"))),this.loginPanel.login()):globalThis.location.reload())}}updateTitleColor(t,e){this.shadowRoot.querySelector("#main-toolbar").style.setProperty("--mdc-theme-primary",t),this.shadowRoot.querySelector("#main-toolbar").style.color=e}changeGroup(t){globalThis.backendaiclient.current_group=t.target.value,this.current_group=globalThis.backendaiclient.current_group,this._writeRecentProjectGroup(globalThis.backendaiclient.current_group);let e=new CustomEvent("backend-ai-group-changed",{detail:globalThis.backendaiclient.current_group});document.dispatchEvent(e)}toggleDrawer(){let t=this.shadowRoot.querySelector("mwc-drawer");!0===t.open?t.open=!1:t.open=!0}_toggleDropdown(){let t=this.shadowRoot.querySelector("#dropdown-menu"),e=this.shadowRoot.querySelector("#dropdown-button");t.anchor=e,t.open=!t.open}showTOSAgreement(){!1===this.TOSdialog.show&&(this.TOSdialog.tosContent="",this.TOSdialog.tosLanguage=this.lang,this.TOSdialog.title=p("console.menu.TermsOfService"),this.TOSdialog.tosEntry="terms-of-service",this.TOSdialog.open())}showPPAgreement(){!1===this.TOSdialog.show&&(this.TOSdialog.tosContent="",this.TOSdialog.tosLanguage=this.lang,this.TOSdialog.title=p("console.menu.PrivacyPolicy"),this.TOSdialog.tosEntry="privacy-policy",this.TOSdialog.open())}_moveTo(t){globalThis.history.pushState({},"",t),Jt.dispatch(Vt(decodeURIComponent(t),{}))}_moveToLogPage(){let t=globalThis.location.toString().split(/[\/]+/).pop();if(globalThis.history.pushState({},"","/usersettings"),Jt.dispatch(Vt(decodeURIComponent("/usersettings"),{tab:"logs"})),t&&"usersettings"===t){let t=new CustomEvent("backend-ai-usersettings-logs",{});document.dispatchEvent(t)}}_readRecentProjectGroup(){let t=globalThis.backendaiclient._config.endpointHost.replace(/\./g,"_"),e=globalThis.backendaioptions.get("projectGroup."+t);return e?globalThis.backendaiclient.groups.length>0&&globalThis.backendaiclient.groups.includes(e)?e:(this._deleteRecentProjectGroupInfo(),globalThis.backendaiclient.current_group):globalThis.backendaiclient.current_group}_writeRecentProjectGroup(t){let e=globalThis.backendaiclient._config.endpointHost.replace(/\./g,"_");globalThis.backendaioptions.set("projectGroup."+e,t||globalThis.backendaiclient.current_group)}_deleteRecentProjectGroupInfo(){let t=globalThis.backendaiclient._config.endpointHost.replace(/\./g,"_");globalThis.backendaioptions.delete("projectGroup."+t)}_moveToUserSettingsPage(){let t=globalThis.location.toString().split(/[\/]+/).pop();if(globalThis.history.pushState({},"","/usersettings"),Jt.dispatch(Vt(decodeURIComponent("/usersettings"),{tab:"general"})),t&&"usersettings"===t){let t=new CustomEvent("backend-ai-usersettings",{});document.dispatchEvent(t)}}async addTooltips(){this._createPopover("#summary-menu-icon",p("console.menu.Summary")),this._createPopover("#sessions-menu-icon",p("console.menu.Sessions")),this._createPopover("#data-menu-icon",p("console.menu.Data&Storage")),this._createPopover("#statistics-menu-icon",p("console.menu.Statistics")),this._createPopover("#usersettings-menu-icon",p("console.menu.Settings")),this.is_admin&&this._createPopover("#user-menu-icon",p("console.menu.Users")),this.is_superadmin&&(this._createPopover("#resources-menu-icon",p("console.menu.Resources")),this._createPopover("#environments-menu-icon",p("console.menu.Environments")),this._createPopover("#configurations-menu-icon",p("console.menu.Configurations")),this._createPopover("#maintenance-menu-icon",p("console.menu.Maintenance")),this._createPopover("#information-menu-icon",p("console.menu.Information")))}_createPopover(t,e){let i=document.createElement("wl-popover");i.anchor=t,i.setAttribute("fixed",""),i.setAttribute("disablefocustrap",""),i.setAttribute("anchororiginx","right"),i.setAttribute("anchororiginy","center"),i.setAttribute("transformoriginx","left"),i.setAttribute("transformoriginy","center"),i.anchorOpenEvents=["mouseover"],i.anchorCloseEvents=["mouseout"];let r=document.createElement("wl-popover-card"),n=document.createElement("div");n.style.padding="5px",n.innerText=e,r.appendChild(n),i.appendChild(r),this.shadowRoot.querySelector("#mini-tooltips").appendChild(i)}stateChanged(t){this._page=t.app.page,this._pageParams=t.app.params,this._offline=t.app.offline,this._offlineIndicatorOpened=t.app.offlineIndicatorOpened,this._drawerOpened=t.app.drawerOpened,globalThis.currentPage=this._page,globalThis.currentPageParams=this._pageParams}render(){return Z`
      <link rel="stylesheet" href="resources/fonts/font-awesome-all.min.css">
      <div id="loading-curtain" class="loading-background"></div>
      <mwc-drawer id="app-body" class="${this.mini_ui?"mini-ui":""}" style="visibility:hidden;">
        <div class="drawer-menu" style="height:100vh;">
          <div id="portrait-bar" class="draggable">
            <div class="horizontal center layout flex bar draggable" style="cursor:pointer;" @click="${()=>this._moveTo("/summary")}">
              <div class="portrait-canvas"></div>
              <div class="vertical start-justified layout full-menu" style="margin-left:10px;margin-right:10px;">
                <div class="site-name"><span class="bold">Backend</span>.AI</div>
                ${this.siteDescription?Z`
                  <div class="site-name" style="font-size:13px;text-align:right;">
                    ${this.siteDescription}
                  </div>`:Z``}
              </div>
              <span class="flex"></span>
            </div>
          </div>
          <div class="horizontal center-justified center layout flex" style="max-height:40px;">
            <mwc-icon-button id="mini-ui-toggle-button" style="color:#fff;" icon="menu" slot="navigationIcon" @click="${()=>this.toggleSidebarUI()}"></mwc-icon-button>
            <mwc-icon-button disabled class="full-menu side-menu fg ${this.contentBody&&!0===this.contentBody.open&&"feedback"===this._sidepanel?"yellow":"white"}" id="feedback-icon" icon="question_answer"></mwc-icon-button>
            <mwc-icon-button class="full-menu side-menu fg ${this.contentBody&&!0===this.contentBody.open&&"notification"===this._sidepanel?"yellow":"white"}" id="notification-icon" icon="notification_important" @click="${()=>this._openSidePanel("notification")}"></mwc-icon-button>
            <mwc-icon-button class="full-menu side-menu fg ${this.contentBody&&!0===this.contentBody.open&&"task"===this._sidepanel?"yellow":"white"}" id="task-icon" icon="ballot" @click="${()=>this._openSidePanel("task")}"></mwc-icon-button>
          </div>
          <mwc-list id="sidebar-menu" class="sidebar list" @selected="${t=>this._menuSelected(t)}">
            <mwc-list-item graphic="icon" ?selected="${"summary"===this._page}" @click="${()=>this._moveTo("/summary")}" ?disabled="${this.blockedMenuitem.includes("summary")}">
              <i class="fas fa-th-large" slot="graphic" id="summary-menu-icon"></i>
              <span class="full-menu">${rt("console.menu.Summary")}</span>
            </mwc-list-item>
            <mwc-list-item graphic="icon" ?selected="${"job"===this._page}" @click="${()=>this._moveTo("/job")}" ?disabled="${this.blockedMenuitem.includes("job")}">
              <i class="fas fa-list-alt" slot="graphic" id="sessions-menu-icon"></i>
              <span class="full-menu">${rt("console.menu.Sessions")}</span>
            </mwc-list-item>
            ${Z``}
            <mwc-list-item graphic="icon" ?selected="${"github"===this._page||"import"===this._page}" @click="${()=>this._moveTo("/import")}" ?disabled="${this.blockedMenuitem.includes("import")}">
              <i class="fas fa-play" slot="graphic" id="import-menu-icon"></i>
              <span class="full-menu">${rt("console.menu.Import&Run")}</span>
            </mwc-list-item>
            <mwc-list-item graphic="icon" ?selected="${"data"===this._page}" @click="${()=>this._moveTo("/data")}" ?disabled="${this.blockedMenuitem.includes("data")}">
              <i class="fas fa-cloud-upload-alt" slot="graphic" id="data-menu-icon"></i>
              <span class="full-menu">${rt("console.menu.Data&Storage")}</span>
            </mwc-list-item>
            <mwc-list-item graphic="icon" ?selected="${"statistics"===this._page}" @click="${()=>this._moveTo("/statistics")}" ?disabled="${this.blockedMenuitem.includes("statistics")}">
              <i class="fas fa-chart-bar" slot="graphic" id="statistics-menu-icon"></i>
              <span class="full-menu">${rt("console.menu.Statistics")}</span>
            </mwc-list-item>
            ${this.is_admin?Z`
                <h3 class="full-menu">${rt("console.menu.Administration")}</h3>
                <mwc-list-item graphic="icon" ?selected="${"credential"===this._page}" @click="${()=>this._moveTo("/credential")}" ?disabled="${!this.is_admin}">
                  <i class="fas fa-address-card" slot="graphic" id="user-menu-icon"></i>
                  <span class="full-menu">${rt("console.menu.Users")}</span>
                </mwc-list-item>
                <mwc-list-item graphic="icon" ?selected="${"environment"===this._page}" @click="${()=>this._moveTo("/environment")}" ?disabled="${!this.is_admin}">
                  <i class="fas fa-microchip" slot="graphic" id="environments-menu-icon"></i>
                  <span class="full-menu">${rt("console.menu.Environments")}</span>
                </mwc-list-item>`:Z``}
            ${this.is_superadmin?Z`
                <mwc-list-item graphic="icon" ?selected="${"agent"===this._page}" @click="${()=>this._moveTo("/agent")}" ?disabled="${!this.is_superadmin}">
                  <i class="fas fa-server" slot="graphic" id="resources-menu-icon"></i>
                  <span class="full-menu">${rt("console.menu.Resources")}</span>
                </mwc-list-item>
                <mwc-list-item graphic="icon" ?selected="${"settings"===this._page}" @click="${()=>this._moveTo("/settings")}" ?disabled="${!this.is_superadmin}">
                  <i class="fas fa-cog" slot="graphic" id="configurations-menu-icon"></i>
                  <span class="full-menu">${rt("console.menu.Configurations")}</span>
                </mwc-list-item>
                <mwc-list-item graphic="icon" ?selected="${"maintenance"===this._page}" @click="${()=>this._moveTo("/maintenance")}" ?disabled="${!this.is_superadmin}">
                  <i class="fas fa-wrench" slot="graphic" id="maintenance-menu-icon"></i>
                  <span class="full-menu">${rt("console.menu.Maintenance")}</span>
                </mwc-list-item>
                <mwc-list-item graphic="icon" ?selected="${"information"===this._page}" @click="${()=>this._moveTo("/information")}" ?disabled="${!this.is_superadmin}">
                  <i class="fas fa-info-circle" slot="graphic" id="information-menu-icon"></i>
                  <span class="full-menu">${rt("console.menu.Information")}</span>
                </mwc-list-item>`:Z``}
          </mwc-list>
          <footer class="full-menu">
            <div class="terms-of-use" style="margin-bottom:10px;">
              <small style="font-size:11px;">
                <a @click="${()=>this.showTOSAgreement()}">${rt("console.menu.TermsOfService")}</a>
                ·
                <a style="color:forestgreen;" @click="${()=>this.showPPAgreement()}">${rt("console.menu.PrivacyPolicy")}</a>
                ·
                <a @click="${()=>this.splash.show()}">${rt("console.menu.AboutBackendAI")}</a>
                ${!0===this.allow_signout?Z`
                ·
                <a @click="${()=>this.loginPanel.signout()}">${rt("console.menu.LeaveService")}</a>
                `:Z``}
              </small>
            </div>
            <address>
              <small class="sidebar-footer">Lablup Inc.</small>
              <small class="sidebar-footer" style="font-size:9px;">20.11.1.201102</small>
            </address>
          </footer>
          <div id="sidebar-navbar-footer" class="vertical start end-justified layout" style="margin-left:16px;">
            <backend-ai-help-button active style="margin-left:4px;"></backend-ai-help-button>
            <mwc-icon-button id="usersettings-menu-icon" icon="settings" slot="graphic" class="fg ${"usersettings"===this._page?"yellow":"white"}" style="margin-left:4px;" @click="${()=>this._moveTo("/usersettings")}"></mwc-icon-button>
          </div>
        </div>
        <div id="app-content" slot="appContent">
          <mwc-drawer id="content-body">
            <div class="sidepanel-drawer">
              <backend-ai-sidepanel-notification class="sidepanel" ?active="${"notification"===this._sidepanel}"></backend-ai-sidepanel-notification>
              <backend-ai-sidepanel-task class="sidepanel" ?active="${"task"===this._sidepanel}"></backend-ai-sidepanel-task>
            </div>
            <div slot="appContent">
              <mwc-top-app-bar-fixed id="main-toolbar" class="draggable">
                <div class="horizontal layout center" id="drawer-toggle-button" slot="navigationIcon" style="margin:auto 20px;" @click="${()=>this.toggleDrawer()}">
                  <i class="fas fa-angle-left" style="display:block;color:#747474;margin-right:0.5em;"></i>
                  <i class="fas fa-bars fa-lg" style="color:#747474;"></i>
                </div>
                <div slot="navigationIcon" class="vertical-line" style="height:35px;"></div>
                <p slot="title" style="padding-top:15px;margin:auto;">
                  ${p("console.menu.WelcomeMessage")+this.full_name+"."}
                </p>
                <div slot="actionItems" style="margin:0px;">
                  <div class="horizontal flex center layout">
                    <div id="group-select-box" style="height:48px;"></div>
                    <div class="vertical-line" style="height:35px;"></div>
                    <div class="horizontal center layout" id="dropdown-button">
                      <div class="vertical layout center" style="position:relative;padding-top:10px;">
                        <span class="email" style="color:#8c8484;font-size:12px;line-height:22px;text-align:left;-webkit-font-smoothing:antialiased;margin:auto 10px;">
                          ${rt("console.menu.UserName")}
                        </span>
                        <mwc-menu id="dropdown-menu" class="user-menu">
                          ${"default"!==this.domain&&""!==this.domain?Z`
                          <mwc-list-item class="horizontal layout start center" disabled style="border-bottom:1px solid #ccc;">
                              ${this.domain}
                          </mwc-list-item>
                          `:Z``}
                          <mwc-list-item class="horizontal layout start center" disabled style="border-bottom:1px solid #ccc;">
                              ${this.user_id}
                          </mwc-list-item>
                          <mwc-list-item class="horizontal layout start center" @click="${()=>this.splash.show()}">
                              <mwc-icon class="dropdown-menu">info</mwc-icon>
                              ${rt("console.menu.AboutBackendAI")}
                          </mwc-list-item>
                          <mwc-list-item class="horizontal layout start center" @click="${()=>this._openUserPrefDialog()}">
                              <mwc-icon class="dropdown-menu">lock</mwc-icon>
                              ${rt("console.menu.ChangePassword")}
                          </mwc-list-item>
                          <mwc-list-item class="horizontal layout start center" @click="${()=>this._moveToUserSettingsPage()}">
                              <mwc-icon class="dropdown-menu">drag_indicator</mwc-icon>
                              ${rt("console.menu.Preferences")}
                          </mwc-list-item>
                          <mwc-list-item class="horizontal layout start center" @click="${()=>this._moveToLogPage()}">
                              <mwc-icon class="dropdown-menu">assignment</mwc-icon>
                              ${rt("console.menu.LogsErrors")}
                          </mwc-list-item>
                          <mwc-list-item class="horizontal layout start center" id="sign-button" @click="${()=>this.logout()}">
                              <mwc-icon class="dropdown-menu">logout</mwc-icon>
                              ${rt("console.menu.LogOut")}
                          </mwc-list-item>
                        </mwc-menu>
                      </div>
                      <span class="full_name" style="font-size:14px;text-align:right;-webkit-font-smoothing:antialiased;margin:auto 0px auto 10px; padding-top:10px;">
                        ${this.full_name}
                      </span>
                      <mwc-icon-button @click="${()=>this._toggleDropdown()}" style="font-size: 0.5rem;">
                        <i class="fas fa-user-alt fa-xs" style="color:#8c8484;"></i>
                      </mwc-icon-button>
                      <div class="vertical-line" style="height:35px;"></div>
                      <div class="horizontal layout center" style="margin:auto 10px;padding-top:10px;">
                        <span class="log_out" style="font-size:12px;margin:auto 0px;color:#8c8484;">
                          ${p("console.menu.LogOut")}
                        </span>
                        <mwc-icon-button @click="${()=>this.logout()}" style="padding-bottom:5px;">
                          <i class="fas fa-sign-out-alt fa-xs" style="color:#8c8484;"></i>
                        </mwc-icon-button>
                      </div>
                    </div>
                  </div>
                </div>
              </mwc-top-app-bar-fixed>

              <div class="content">
                <div id="navbar-top" class="navbar-top horizontal flex layout wrap"></div>
                <section role="main" id="content" class="container layout vertical center">
                  <div id="app-page">
                    <backend-ai-summary-view class="page" name="summary" ?active="${"summary"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-summary-view>
                    <backend-ai-import-view class="page" name="import" ?active="${"github"===this._page||"import"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-import-view>
                    <backend-ai-session-view class="page" name="job" ?active="${"job"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-session-view>
                    <backend-ai-experiment-view class="page" name="experiment" ?active="${"experiment"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-experiment-view>
                    <backend-ai-usersettings-view class="page" name="usersettings" ?active="${"usersettings"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-usersettings-view>
                    <backend-ai-credential-view class="page" name="credential" ?active="${"credential"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-credential-view>
                    <backend-ai-agent-view class="page" name="agent" ?active="${"agent"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-agent-view>
                    <backend-ai-data-view class="page" name="data" ?active="${"data"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-data-view>
                    <backend-ai-environment-view class="page" name="environment" ?active="${"environment"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-environment-view>
                    <backend-ai-settings-view class="page" name="settings" ?active="${"settings"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-settings-view>
                    <backend-ai-maintenance-view class="page" name="maintenance" ?active="${"maintenance"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-maintenance-view>
                    <backend-ai-information-view class="page" name="information" ?active="${"information"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-information-view>
                    <backend-ai-statistics-view class="page" name="statistics" ?active="${"statistics"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-statistics-view>
                    <backend-ai-email-verification-view class="page" name="email-verification" ?active="${"verify-email"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-email-verification-view>
                    <backend-ai-change-forgot-password-view class="page" name="change-forgot-password" ?active="${"change-password"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-change-forgot-password-view>
                    <backend-ai-error-view class="page" name="error" ?active="${"error"===this._page}"><mwc-circular-progress indeterminate></mwc-circular-progress></backend-ai-error-view>
                  </div>
                </section>
              </div>
            </div>
          </mwc-drawer>
        </div>
      </mwc-drawer>
      <div id="mini-tooltips" style="display:${this.mini_ui?"block":"none"};">
        <wl-popover anchor="#mini-ui-toggle-button" .anchorOpenEvents="${["mouseover"]}" fixed disablefocustrap
           anchororiginx="right" anchororiginy="center" transformoriginx="left" transformOriginY="center">
          <wl-popover-card>
            <div style="padding:5px">
              <mwc-icon-button disabled class="side-menu fg ${this.contentBody&&!0===this.contentBody.open&&"feedback"===this._sidepanel?"red":"black"}" id="feedback-icon-popover" icon="question_answer"></mwc-icon-button>
              <mwc-icon-button class="side-menu fg ${this.contentBody&&!0===this.contentBody.open&&"notification"===this._sidepanel?"red":"black"}" id="notification-icon-popover" icon="notification_important" @click="${()=>this._openSidePanel("notification")}"></mwc-icon-button>
              <mwc-icon-button class="side-menu fg ${this.contentBody&&!0===this.contentBody.open&&"task"===this._sidepanel?"red":"black"}" id="task-icon-popover" icon="ballot" @click="${()=>this._openSidePanel("task")}"></mwc-icon-button>
            </div>
          </wl-popover-card>
        </wl-popover>
      </div>
      <backend-ai-offline-indicator ?active="${this._offlineIndicatorOpened}">
        ${this._offline?rt("console.YouAreOffline"):rt("console.YouAreOnline")}.
      </backend-ai-offline-indicator>
      <backend-ai-login active id="login-panel"></backend-ai-login>
      <backend-ai-splash id="about-backendai-panel"></backend-ai-splash>
      <lablup-notification id="notification"></lablup-notification>
      <backend-ai-indicator-pool id="indicator"></backend-ai-indicator-pool>
      <lablup-terms-of-service id="terms-of-service" block></lablup-terms-of-service>
      <backend-ai-dialog id="user-preference-dialog" fixed backdrop>
        <span slot="title">${rt("console.menu.ChangePassword")}</span>
        <div slot="content" class="layout vertical" style="width:300px;">
          <mwc-textfield id="pref-original-password" type="password"
              label="${rt("console.menu.OriginalPassword")}" max-length="30" autofocus
              style="margin-bottom:20px">
          </mwc-textfield>
          <mwc-textfield id="pref-new-password" label="${rt("console.menu.NewPassword")}"
              type="password" min-length="8" max-length="30"
              auto-validate validationMessage="${rt("console.menu.InvalidPasswordMessage")}"
              pattern="^(?=.*[A-Za-z])(?=.*\\d)(?=.*[@$!%*#?&])[A-Za-z\\d@$!%*#?&]{8,}$">
          </mwc-textfield>
          <mwc-textfield id="pref-new-password2" label="${rt("console.menu.NewPasswordAgain")}"
              type="password" min-length="8" max-length="30">
          </mwc-textfield>
        </div>
        <div slot="footer" class="horizontal end-justified flex layout">
          <div class="flex"></div>
          <mwc-button
              label="${rt("console.menu.Cancel")}"
              @click="${this._hideUserPrefDialog}"></mwc-button>
          <mwc-button
              unelevated
              label="${rt("console.menu.Update")}"
              @click="${this._updateUserPassword}"></mwc-button>
        </div>
      </backend-ai-dialog>
      <backend-ai-app-launcher id="app-launcher"></backend-ai-app-launcher>
      <backend-ai-resource-broker id="resource-broker" ?active="${this.is_connected}"></backend-ai-resource-broker>
    `}};r([yt({type:Boolean})],ws.prototype,"hasLoadedStrings",void 0),r([yt({type:String})],ws.prototype,"menuTitle",void 0),r([yt({type:String})],ws.prototype,"siteDescription",void 0),r([yt({type:String})],ws.prototype,"user_id",void 0),r([yt({type:String})],ws.prototype,"full_name",void 0),r([yt({type:String})],ws.prototype,"domain",void 0),r([yt({type:Boolean})],ws.prototype,"is_connected",void 0),r([yt({type:Boolean})],ws.prototype,"is_admin",void 0),r([yt({type:Boolean})],ws.prototype,"is_superadmin",void 0),r([yt({type:Boolean})],ws.prototype,"allow_signout",void 0),r([yt({type:String})],ws.prototype,"proxy_url",void 0),r([yt({type:String})],ws.prototype,"connection_mode",void 0),r([yt({type:String})],ws.prototype,"connection_server",void 0),r([yt({type:String})],ws.prototype,"edition",void 0),r([yt({type:String})],ws.prototype,"validUntil",void 0),r([yt({type:Array})],ws.prototype,"groups",void 0),r([yt({type:String})],ws.prototype,"current_group",void 0),r([yt({type:Object})],ws.prototype,"plugins",void 0),r([yt({type:Object})],ws.prototype,"splash",void 0),r([yt({type:Object})],ws.prototype,"loginPanel",void 0),r([yt({type:String})],ws.prototype,"_page",void 0),r([yt({type:Object})],ws.prototype,"_pageParams",void 0),r([yt({type:String})],ws.prototype,"_sidepanel",void 0),r([yt({type:Boolean})],ws.prototype,"_drawerOpened",void 0),r([yt({type:Boolean})],ws.prototype,"_offlineIndicatorOpened",void 0),r([yt({type:Boolean})],ws.prototype,"_offline",void 0),r([yt({type:Object})],ws.prototype,"_dropdownMenuIcon",void 0),r([yt({type:Object})],ws.prototype,"config",void 0),r([yt({type:Object})],ws.prototype,"notification",void 0),r([yt({type:Object})],ws.prototype,"appBody",void 0),r([yt({type:Object})],ws.prototype,"appPage",void 0),r([yt({type:Object})],ws.prototype,"contentBody",void 0),r([yt({type:Object})],ws.prototype,"mainToolbar",void 0),r([yt({type:Object})],ws.prototype,"drawerToggleButton",void 0),r([yt({type:Object})],ws.prototype,"sidebarMenu",void 0),r([yt({type:Object})],ws.prototype,"TOSdialog",void 0),r([yt({type:Boolean})],ws.prototype,"mini_ui",void 0),r([yt({type:String})],ws.prototype,"lang",void 0),r([yt({type:Array})],ws.prototype,"supportLanguageCodes",void 0),r([yt({type:Array})],ws.prototype,"blockedMenuitem",void 0),r([yt({type:Number})],ws.prototype,"minibarWidth",void 0),r([yt({type:Number})],ws.prototype,"sidebarWidth",void 0),r([yt({type:Number})],ws.prototype,"sidepanelWidth",void 0),ws=r([bt("backend-ai-console")],ws);var xs=ws;export{y as $,_ as A,Un as B,Cn as C,Xn as D,e as E,Ir as F,i as G,fe as H,yo as I,se as J,Co as K,Ot as L,pn as M,z as N,Ln as O,On as P,Pn as Q,Ye as R,Rn as S,go as T,nn as U,tn as V,X as W,ee as X,pe as Y,De as Z,r as _,_o as a,Ve as a0,ne as a1,W as a2,o as a3,Yn as a4,Bn as a5,un as a6,An as a7,Tn as a8,Fo as a9,sn as aa,u as ab,Jt as ac,as as ad,rs as ae,ls as af,qo as ag,Do as ah,an as ai,xs as aj,Ct as b,bt as c,Me as d,xo as e,ko as f,p as g,Z as h,m as i,P as j,_t as k,be as l,oi as m,wo as n,xt as o,yt as p,wt as q,St as r,Ge as s,rt as t,Zi as u,Yi as v,it as w,en as x,n as y,hn as z};
