@hydecorp/push-state
Version:
Turn static web sites into dynamic web apps
174 lines (172 loc) • 71.4 kB
JavaScript
/*! *****************************************************************************
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,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};function e(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}function r(t,e,r,n){var o,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function n(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{a(n.next(t))}catch(t){i(t)}}function c(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,c)}a((n=n.apply(t,e||[])).next())}))}function o(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}function i(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function c(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}function a(t){return this instanceof a?(this.v=t,this):new a(t)}function u(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(t,e||[]),i=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(t){o[t]&&(n[t]=function(e){return new Promise((function(r,n){i.push([t,e,r,n])>1||c(t,e)}))})}function c(t,e){try{(r=o[t](e)).value instanceof a?Promise.resolve(r.value.v).then(u,l):h(i[0][2],r)}catch(t){h(i[0][3],t)}var r}function u(t){c("next",t)}function l(t){c("throw",t)}function h(t,e){t(e),i.shift(),i.length&&c(i[0][0],i[0][1])}}function l(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t=i(t),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=t[r]&&function(e){return new Promise((function(n,o){(function(t,e,r,n){Promise.resolve(n).then((function(e){t({value:e,done:r})}),e)})(n,o,(e=t[r](e)).done,e.value)}))}}}function h(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)}function p(t,e,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(t,r):o?o.value=r:e.set(t,r),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 d="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,f=(t,e,r=null)=>{for(;e!==r;){const r=e.nextSibling;t.removeChild(e),e=r}},y=`{{lit-${String(Math.random()).slice(2)}}}`,v=`\x3c!--${y}--\x3e`,m=new RegExp(`${y}|${v}`);class b{constructor(t,e){this.parts=[],this.element=e;const r=[],n=[],o=document.createTreeWalker(e.content,133,null,!1);let i=0,s=-1,c=0;const{strings:a,values:{length:u}}=t;for(;c<u;){const t=o.nextNode();if(null!==t){if(s++,1===t.nodeType){if(t.hasAttributes()){const e=t.attributes,{length:r}=e;let n=0;for(let t=0;t<r;t++)w(e[t].name,"$lit$")&&n++;for(;n-- >0;){const e=a[c],r=_.exec(e)[2],n=r.toLowerCase()+"$lit$",o=t.getAttribute(n);t.removeAttribute(n);const i=o.split(m);this.parts.push({type:"attribute",index:s,name:r,strings:i}),c+=i.length-1}}"TEMPLATE"===t.tagName&&(n.push(t),o.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(y)>=0){const n=t.parentNode,o=e.split(m),i=o.length-1;for(let e=0;e<i;e++){let r,i=o[e];if(""===i)r=S();else{const t=_.exec(i);null!==t&&w(t[2],"$lit$")&&(i=i.slice(0,t.index)+t[1]+t[2].slice(0,-"$lit$".length)+t[3]),r=document.createTextNode(i)}n.insertBefore(r,t),this.parts.push({type:"node",index:++s})}""===o[i]?(n.insertBefore(S(),t),r.push(t)):t.data=o[i],c+=i}}else if(8===t.nodeType)if(t.data===y){const e=t.parentNode;null!==t.previousSibling&&s!==i||(s++,e.insertBefore(S(),t)),i=s,this.parts.push({type:"node",index:s}),null===t.nextSibling?t.data="":(r.push(t),s--),c++}else{let e=-1;for(;-1!==(e=t.data.indexOf(y,e+1));)this.parts.push({type:"node",index:-1}),c++}}else o.currentNode=n.pop()}for(const t of r)t.parentNode.removeChild(t)}}const w=(t,e)=>{const r=t.length-e.length;return r>=0&&t.slice(r)===e},g=t=>-1!==t.index,S=()=>document.createComment(""),_=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function x(t,e){const{element:{content:r},parts:n}=t,o=document.createTreeWalker(r,133,null,!1);let i=P(n),s=n[i],c=-1,a=0;const u=[];let l=null;for(;o.nextNode();){c++;const t=o.currentNode;for(t.previousSibling===l&&(l=null),e.has(t)&&(u.push(t),null===l&&(l=t)),null!==l&&a++;void 0!==s&&s.index===c;)s.index=null!==l?-1:s.index-a,i=P(n,i),s=n[i]}u.forEach((t=>t.parentNode.removeChild(t)))}const E=t=>{let e=11===t.nodeType?0:1;const r=document.createTreeWalker(t,133,null,!1);for(;r.nextNode();)e++;return e},P=(t,e=-1)=>{for(let r=e+1;r<t.length;r++){const e=t[r];if(g(e))return r}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 A=new WeakMap,C={},N={};
/**
* @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 T{constructor(t,e,r){this.__parts=[],this.template=t,this.processor=e,this.options=r}update(t){let e=0;for(const r of this.__parts)void 0!==r&&r.setValue(t[e]),e++;for(const t of this.__parts)void 0!==t&&t.commit()}_clone(){const t=d?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),e=[],r=this.template.parts,n=document.createTreeWalker(t,133,null,!1);let o,i=0,s=0,c=n.nextNode();for(;i<r.length;)if(o=r[i],g(o)){for(;s<o.index;)s++,"TEMPLATE"===c.nodeName&&(e.push(c),n.currentNode=c.content),null===(c=n.nextNode())&&(n.currentNode=e.pop(),c=n.nextNode());if("node"===o.type){const t=this.processor.handleTextExpression(this.options);t.insertAfterNode(c.previousSibling),this.__parts.push(t)}else this.__parts.push(...this.processor.handleAttributeExpressions(c,o.name,o.strings,this.options));i++}else this.__parts.push(void 0),i++;return d&&(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 k=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),I=` ${y} `;class O{constructor(t){this.value=void 0,this.__pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(S()),this.endNode=t.appendChild(S())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t.__insert(this.startNode=S()),t.__insert(this.endNode=S())}insertAfterPart(t){t.__insert(this.startNode=S()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this.__pendingValue=t}commit(){if(null===this.startNode.parentNode)return;for(;"function"==typeof(t=this.__pendingValue)&&A.has(t);){const t=this.__pendingValue;this.__pendingValue=C,t(this)}var t;const e=this.__pendingValue;e!==C&&((t=>null===t||!("object"==typeof t||"function"==typeof t))(e)?e!==this.value&&this.__commitText(e):e instanceof class{constructor(t,e,r,n){this.strings=t,this.values=e,this.type=r,this.processor=n}getHTML(){const t=this.strings.length-1;let e="",r=!1;for(let n=0;n<t;n++){const t=this.strings[n],o=t.lastIndexOf("\x3c!--");r=(o>-1||r)&&-1===t.indexOf("--\x3e",o+1);const i=_.exec(t);e+=null===i?t+(r?I:v):t.substr(0,i.index)+i[1]+i[2]+"$lit$"+i[3]+y}return e+=this.strings[t],e}getTemplateElement(){const t=document.createElement("template");let e=this.getHTML();return void 0!==k&&(e=k.createHTML(e)),t.innerHTML=e,t}}
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/?this.__commitTemplateResult(e):e instanceof Node?this.__commitNode(e):(t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]))(e)?this.__commitIterable(e):e===N?(this.value=N,this.clear()):this.__commitText(e))}__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,r="string"==typeof(t=null==t?"":t)?t:String(t);e===this.endNode.previousSibling&&3===e.nodeType?e.data=r:this.__commitNode(document.createTextNode(r)),this.value=t}__commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof T&&this.value.template===e)this.value.update(t.values);else{const r=new T(e,t.processor,this.options),n=r._clone();r.update(t.values),this.__commitNode(n),this.value=r}}__commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let r,n=0;for(const o of t)r=e[n],void 0===r&&(r=new O(this.options),e.push(r),0===n?r.appendIntoPart(this):r.insertAfterPart(e[n-1])),r.setValue(o),r.commit(),n++;n<e.length&&(e.length=n,this.clear(r&&r.endNode))}clear(t=this.startNode){f(this.startNode.parentNode,t.nextSibling,this.endNode)}}let R=!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
*/
function U(t){let e=L.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},L.set(t.type,e));let r=e.stringsArray.get(t.strings);if(void 0!==r)return r;const n=t.strings.join(y);return r=e.keyString.get(n),void 0===r&&(r=new b(t,t.getTemplateElement()),e.keyString.set(n,r)),e.stringsArray.set(t.strings,r),r}(()=>{try{const t={get capture(){return R=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();const L=new Map,M=new WeakMap;
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
/**
* @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");
/**
* @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 q=(t,e)=>`${t}--${e}`;let j=!0;void 0===window.ShadyCSS?j=!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."),j=!1);const H=t=>e=>{const r=q(e.type,t);let n=L.get(r);void 0===n&&(n={stringsArray:new WeakMap,keyString:new Map},L.set(r,n));let o=n.stringsArray.get(e.strings);if(void 0!==o)return o;const i=e.strings.join(y);if(o=n.keyString.get(i),void 0===o){const r=e.getTemplateElement();j&&window.ShadyCSS.prepareTemplateDom(r,t),o=new b(e,r),n.keyString.set(i,o)}return n.stringsArray.set(e.strings,o),o},$=["html","svg"],F=new Set,W=(t,e,r)=>{F.add(t);const n=r?r.element:document.createElement("template"),o=e.querySelectorAll("style"),{length:i}=o;if(0===i)return void window.ShadyCSS.prepareTemplateStyles(n,t);const s=document.createElement("style");for(let t=0;t<i;t++){const e=o[t];e.parentNode.removeChild(e),s.textContent+=e.textContent}(t=>{$.forEach((e=>{const r=L.get(q(e,t));void 0!==r&&r.keyString.forEach((t=>{const{element:{content:e}}=t,r=new Set;Array.from(e.querySelectorAll("style")).forEach((t=>{r.add(t)})),x(t,r)}))}))})(t);const c=n.content;r?function(t,e,r=null){const{element:{content:n},parts:o}=t;if(null==r)return void n.appendChild(e);const i=document.createTreeWalker(n,133,null,!1);let s=P(o),c=0,a=-1;for(;i.nextNode();)for(a++,i.currentNode===r&&(c=E(e),r.parentNode.insertBefore(e,r));-1!==s&&o[s].index===a;){if(c>0){for(;-1!==s;)o[s].index+=c,s=P(o,s);return}s=P(o,s)}}(r,s,c.firstChild):c.insertBefore(s,c.firstChild),window.ShadyCSS.prepareTemplateStyles(n,t);const a=c.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==a)e.insertBefore(a.cloneNode(!0),e.firstChild);else if(r){c.insertBefore(s,c.firstChild);const t=new Set;t.add(s),x(r,t)}};window.JSCompiler_renameProperty=(t,e)=>t;const V={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}},z=(t,e)=>e!==t&&(e==e||t==t),D={attribute:!0,type:String,converter:V,reflect:!1,hasChanged:z};class B extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach(((e,r)=>{const n=this._attributeNameForProperty(r,e);void 0!==n&&(this._attributeToPropertyMap.set(n,r),t.push(n))})),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=D){if(this._ensureClassProperties(),this._classProperties.set(t,e),e.noAccessor||this.prototype.hasOwnProperty(t))return;const r="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,r,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}static getPropertyDescriptor(t,e,r){return{get(){return this[e]},set(n){const o=this[t];this[e]=n,this.requestUpdateInternal(t,o,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this._classProperties&&this._classProperties.get(t)||D}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 r of e)this.createProperty(r,t[r])}}static _attributeNameForProperty(t,e){const r=e.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.toLowerCase():void 0}static _valueHasChanged(t,e,r=z){return r(t,e)}static _propertyValueFromAttribute(t,e){const r=e.type,n=e.converter||V,o="function"==typeof n?n:n.fromAttribute;return o?o(t,r):t}static _propertyValueToAttribute(t,e){if(void 0===e.reflect)return;const r=e.type,n=e.converter;return(n&&n.toAttribute||V.toAttribute)(t,r)}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,r){e!==r&&this._attributeToProperty(t,r)}_propertyToAttribute(t,e,r=D){const n=this.constructor,o=n._attributeNameForProperty(t,r);if(void 0!==o){const t=n._propertyValueToAttribute(e,r);if(void 0===t)return;this._updateState=8|this._updateState,null==t?this.removeAttribute(o):this.setAttribute(o,t),this._updateState=-9&this._updateState}}_attributeToProperty(t,e){if(8&this._updateState)return;const r=this.constructor,n=r._attributeToPropertyMap.get(t);if(void 0!==n){const t=r.getPropertyOptions(n);this._updateState=16|this._updateState,this[n]=r._propertyValueFromAttribute(e,t),this._updateState=-17&this._updateState}}requestUpdateInternal(t,e,r){let n=!0;if(void 0!==t){const o=this.constructor;r=r||o.getPropertyOptions(t),o._valueHasChanged(this[t],e,r.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==r.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,r))):n=!1}!this._hasRequestedUpdate&&n&&(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.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){}}B.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 J=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?Object.assign(Object.assign({},e),{finisher(r){r.createProperty(e.key,t)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}};function G(t){return(e,r)=>void 0!==r?((t,e,r)=>{e.constructor.createProperty(r,t)})(t,e,r):J(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 Y=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,K=Symbol();class X{constructor(t,e){if(e!==K)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){return void 0===this._styleSheet&&(Y?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}
/**
* @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.5.1");const Z={};class Q extends B{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,r)=>t.reduceRight(((t,r)=>Array.isArray(r)?e(r,t):(t.add(r),t)),r),r=e(t,new Set),n=[];r.forEach((t=>n.unshift(t))),this._styles=n}else this._styles=void 0===t?[]:[t];this._styles=this._styles.map((t=>{if(t instanceof CSSStyleSheet&&!Y){const e=Array.prototype.slice.call(t.cssRules).reduce(((t,e)=>t+e.cssText),"");return new X(String(e),K)}return t}))}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow(this.constructor.shadowRootOptions)}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?Y?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!==Z&&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 Z}}function tt(t){return"function"==typeof t}function et(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}Q.finalized=!0,Q.render=(t,e,r)=>{if(!r||"object"!=typeof r||!r.scopeName)throw new Error("The `scopeName` option is required.");const n=r.scopeName,o=M.has(e),i=j&&11===e.nodeType&&!!e.host,s=i&&!F.has(n),c=s?document.createDocumentFragment():e;if(((t,e,r)=>{let n=M.get(e);void 0===n&&(f(e,e.firstChild),M.set(e,n=new O(Object.assign({templateFactory:U},r))),n.appendInto(e)),n.setValue(t),n.commit()})(t,c,Object.assign({templateFactory:H(n)},r)),s){const t=M.get(c);M.delete(c);const r=t.value instanceof T?t.value.template:void 0;W(n,c,r),f(e,e.firstChild),e.appendChild(c),M.set(e,t)}!o&&i&&window.ShadyCSS.styleElement(e.host)},Q.shadowRootOptions={mode:"open"};var rt=et((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function nt(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}var ot=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._teardowns=null}var e;return t.prototype.unsubscribe=function(){var t,e,r,n,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var u=i(a),l=u.next();!l.done;l=u.next()){l.value.remove(this)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(e=u.return)&&e.call(u)}finally{if(t)throw t.error}}else a.remove(this);var h=this.initialTeardown;if(tt(h))try{h()}catch(t){o=t instanceof rt?t.errors:[t]}var p=this._teardowns;if(p){this._teardowns=null;try{for(var d=i(p),f=d.next();!f.done;f=d.next()){var y=f.value;try{ct(y)}catch(t){o=null!=o?o:[],t instanceof rt?o=c(c([],s(o)),s(t.errors)):o.push(t)}}}catch(t){r={error:t}}finally{try{f&&!f.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}}if(o)throw new rt(o)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)ct(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._teardowns=null!==(r=this._teardowns)&&void 0!==r?r:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&nt(e,t)},t.prototype.remove=function(e){var r=this._teardowns;r&&nt(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),it=ot.EMPTY;function st(t){return t instanceof ot||t&&"closed"in t&&tt(t.remove)&&tt(t.add)&&tt(t.unsubscribe)}function ct(t){tt(t)?t():t.unsubscribe()}var at={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},ut={setTimeout:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=ut.delegate;return((null==r?void 0:r.setTimeout)||setTimeout).apply(void 0,c([],s(t)))},clearTimeout:function(t){return clearTimeout(t)},delegate:void 0};function lt(t){ut.setTimeout((function(){throw t}))}function ht(){}function pt(t){t()}var dt=function(t){function r(e){var r=t.call(this)||this;return r.isStopped=!1,e?(r.destination=e,st(e)&&e.add(r)):r.destination=mt,r}return e(r,t),r.create=function(t,e,r){return new ft(t,e,r)},r.prototype.next=function(t){this.isStopped||this._next(t)},r.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},r.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},r.prototype._next=function(t){this.destination.next(t)},r.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},r.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},r}(ot),ft=function(t){function r(e,r,n){var o,i=t.call(this)||this;if(tt(e))o=e;else if(e){var s;o=e.next,r=e.error,n=e.complete,i&&at.useDeprecatedNextContext?(s=Object.create(e)).unsubscribe=function(){return i.unsubscribe()}:s=e,o=null==o?void 0:o.bind(s),r=null==r?void 0:r.bind(s),n=null==n?void 0:n.bind(s)}return i.destination={next:o?yt(o):ht,error:yt(null!=r?r:vt),complete:n?yt(n):ht},i}return e(r,t),r}(dt);function yt(t,e){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];try{t.apply(void 0,c([],s(e)))}catch(t){lt(t)}}}function vt(t){throw t}var mt={closed:!0,next:ht,error:vt,complete:ht},bt="function"==typeof Symbol&&Symbol.observable||"@@observable";function wt(t){return t}function gt(t){return 0===t.length?wt:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var St=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var n,o=this,i=(n=t)&&n instanceof dt||function(t){return t&&tt(t.next)&&tt(t.error)&&tt(t.complete)}(n)&&st(n)?t:new ft(t,e,r);return pt((function(){var t=o,e=t.operator,r=t.source;i.add(e?e.call(i,r):r?o._subscribe(i):o._trySubscribe(i))})),i},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var r=this;return new(e=_t(e))((function(e,n){var o=new ft({next:function(e){try{t(e)}catch(t){n(t),o.unsubscribe()}},error:n,complete:e});r.subscribe(o)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[bt]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return gt(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=_t(t))((function(t,r){var n;e.subscribe((function(t){return n=t}),(function(t){return r(t)}),(function(){return t(n)}))}))},t.create=function(e){return new t(e)},t}();function _t(t){var e;return null!==(e=null!=t?t:at.Promise)&&void 0!==e?e:Promise}function xt(t){return function(e){if(function(t){return tt(null==t?void 0:t.lift)}(e))return e.lift((function(e){try{return t(e,this)}catch(t){this.error(t)}}));throw new TypeError("Unable to lift unknown Observable type")}}var Et=function(t){function r(e,r,n,o,i){var s=t.call(this,e)||this;return s.onFinalize=i,s._next=r?function(t){try{r(t)}catch(t){e.error(t)}}:t.prototype._next,s._error=o?function(t){try{o(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._error,s._complete=n?function(){try{n()}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._complete,s}return e(r,t),r.prototype.unsubscribe=function(){var e,r=this.closed;t.prototype.unsubscribe.call(this),!r&&(null===(e=this.onFinalize)||void 0===e||e.call(this))},r}(dt),Pt={schedule:function(t){var e=requestAnimationFrame,r=cancelAnimationFrame,n=e((function(e){r=void 0,t(e)}));return new ot((function(){return null==r?void 0:r(n)}))},requestAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Pt.delegate;return((null==r?void 0:r.requestAnimationFrame)||requestAnimationFrame).apply(void 0,c([],s(t)))},cancelAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Pt.delegate;return((null==r?void 0:r.cancelAnimationFrame)||cancelAnimationFrame).apply(void 0,c([],s(t)))},delegate:void 0},At=et((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Ct=function(t){function r(){var e=t.call(this)||this;return e.closed=!1,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return e(r,t),r.prototype.lift=function(t){var e=new Nt(this,this);return e.operator=t,e},r.prototype._throwIfClosed=function(){if(this.closed)throw new At},r.prototype.next=function(t){var e=this;pt((function(){var r,n;if(e._throwIfClosed(),!e.isStopped){var o=e.observers.slice();try{for(var s=i(o),c=s.next();!c.done;c=s.next()){c.value.next(t)}}catch(t){r={error:t}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}}))},r.prototype.error=function(t){var e=this;pt((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var r=e.observers;r.length;)r.shift().error(t)}}))},r.prototype.complete=function(){var t=this;pt((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},r.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Object.defineProperty(r.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),r.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},r.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},r.prototype._innerSubscribe=function(t){var e=this,r=e.hasError,n=e.isStopped,o=e.observers;return r||n?it:(o.push(t),new ot((function(){return nt(o,t)})))},r.prototype._checkFinalizedStatuses=function(t){var e=this,r=e.hasError,n=e.thrownError,o=e.isStopped;r?t.error(n):o&&t.complete()},r.prototype.asObservable=function(){var t=new St;return t.source=this,t},r.create=function(t,e){return new Nt(t,e)},r}(St),Nt=function(t){function r(e,r){var n=t.call(this)||this;return n.destination=e,n.source=r,n}return e(r,t),r.prototype.next=function(t){var e,r;null===(r=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===r||r.call(e,t)},r.prototype.error=function(t){var e,r;null===(r=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===r||r.call(e,t)},r.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},r.prototype._subscribe=function(t){var e,r;return null!==(r=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==r?r:it},r}(Ct),Tt=function(t){function r(e){var r=t.call(this)||this;return r._value=e,r}return e(r,t),Object.defineProperty(r.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),r.prototype._subscribe=function(e){var r=t.prototype._subscribe.call(this,e);return!r.closed&&e.next(this._value),r},r.prototype.getValue=function(){var t=this,e=t.hasError,r=t.thrownError,n=t._value;if(e)throw r;return this._throwIfClosed(),n},r.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},r}(Ct),kt=function(){return Date.now()},It=function(t){function r(e,r){return t.call(this)||this}return e(r,t),r.prototype.schedule=function(t,e){return this},r}(ot),Ot={setInterval:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Ot.delegate;return((null==r?void 0:r.setInterval)||setInterval).apply(void 0,c([],s(t)))},clearInterval:function(t){return clearInterval(t)},delegate:void 0},Rt=function(t){function r(e,r){var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n.pending=!1,n}return e(r,t),r.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var r=this.id,n=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(n,r,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(n,this.id,e),this},r.prototype.requestAsyncId=function(t,e,r){return void 0===r&&(r=0),Ot.setInterval(t.flush.bind(t,this),r)},r.prototype.recycleAsyncId=function(t,e,r){if(void 0===r&&(r=0),null!=r&&this.delay===r&&!1===this.pending)return e;Ot.clearInterval(e)},r.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(t,e);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},r.prototype._execute=function(t,e){var r,n=!1;try{this.work(t)}catch(t){n=!0,r=t||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},r.prototype.unsubscribe=function(){if(!this.closed){var e=this.id,r=this.scheduler,n=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,nt(n,this),null!=e&&(this.id=this.recycleAsyncId(r,e,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},r}(It),Ut=function(){function t(e,r){void 0===r&&(r=t.now),this.schedulerActionCtor=e,this.now=r}return t.prototype.schedule=function(t,e,r){return void 0===e&&(e=0),new this.schedulerActionCtor(this,t).schedule(r,e)},t.now=kt,t}(),Lt=function(t){function r(e,r){void 0===r&&(r=Ut.now);var n=t.call(this,e,r)||this;return n.actions=[],n._active=!1,n._scheduled=void 0,n}return e(r,t),r.prototype.flush=function(t){var e=this.actions;if(this._active)e.push(t);else{var r;this._active=!0;do{if(r=t.execute(t.state,t.delay))break}while(t=e.shift());if(this._active=!1,r){for(;t=e.shift();)t.unsubscribe();throw r}}},r}(Ut),Mt=new Lt(Rt),qt=function(t){function r(e,r){var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n}return e(r,t),r.prototype.requestAsyncId=function(e,r,n){return void 0===n&&(n=0),null!==n&&n>0?t.prototype.requestAsyncId.call(this,e,r,n):(e.actions.push(this),e._scheduled||(e._scheduled=Pt.requestAnimationFrame((function(){return e.flush(void 0)}))))},r.prototype.recycleAsyncId=function(e,r,n){if(void 0===n&&(n=0),null!=n&&n>0||null==n&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,r,n);e.actions.some((function(t){return t.id===r}))||(Pt.cancelAnimationFrame(r),e._scheduled=void 0)},r}(Rt),jt=new(function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return e(r,t),r.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var r,n=this.actions;t=t||n.shift();do{if(r=t.execute(t.state,t.delay))break}while((t=n[0])&&t.id===e&&n.shift());if(this._active=!1,r){for(;(t=n[0])&&t.id===e&&n.shift();)t.unsubscribe();throw r}},r}(Lt))(qt),Ht=new St((function(t){return t.complete()}));function $t(t){return t[t.length-1]}function Ft(t){return tt($t(t))?t.pop():void 0}function Wt(t){return(e=$t(t))&&tt(e.schedule)?t.pop():void 0;var e}function Vt(t,e){return"number"==typeof $t(t)?t.pop():e}var zt=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function Dt(t){return tt(null==t?void 0:t.then)}function Bt(t){return tt(t[bt])}function Jt(t){return Symbol.asyncIterator&&tt(null==t?void 0:t[Symbol.asyncIterator])}function Gt(t){return new TypeError("You provided "+(null!==t&&"object"==typeof t?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var Yt="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Kt(t){return tt(null==t?void 0:t[Yt])}function Xt(t){return u(this,arguments,(function(){var e,r,n;return o(this,(function(o){switch(o.label){case 0:e=t.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,a(e.read())];case 3:return r=o.sent(),n=r.value,r.done?[4,a(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,a(n)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}}))}))}function Zt(t){return tt(null==t?void 0:t.getReader)}function Qt(t){if(t instanceof St)return t;if(null!=t){if(Bt(t))return o=t,new St((function(t){var e=o[bt]();if(tt(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(zt(t))return n=t,new St((function(t){for(var e=0;e<n.length&&!t.closed;e++)t.next(n[e]);t.complete()}));if(Dt(t))return r=t,new St((function(t){r.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,lt)}));if(Jt(t))return te(t);if(Kt(t))return e=t,new St((function(t){var r,n;try{for(var o=i(e),s=o.next();!s.done;s=o.next()){var c=s.value;if(t.next(c),t.closed)return}}catch(t){r={error:t}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.complete()}));if(Zt(t))return te(Xt(t))}var e,r,n,o;throw Gt(t)}function te(t){return new St((function(e){(function(t,e){var r,i,s,c;return n(this,void 0,void 0,(function(){var n,a;return o(this,(function(o){switch(o.label){case 0:o.trys.push([0,5,6,11]),r=l(t),o.label=1;case 1:return[4,r.next()];case 2:if((i=o.sent()).done)return[3,4];if(n=i.value,e.next(n),e.closed)return[2];o.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=o.sent(),s={error:a},[3,11];case 6:return o.trys.push([6,,9,10]),i&&!i.done&&(c=r.return)?[4,c.call(r)]:[3,8];case 7:o.sent(),o.label=8;case 8:return[3,10];case 9:if(s)throw s.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}}))}))})(t,e).catch((function(t){return e.error(t)}))}))}function ee(t,e,r,n,o){void 0===n&&(n=0),void 0===o&&(o=!1);var i=e.schedule((function(){r(),o?t.add(this.schedule(null,n)):this.unsubscribe()}),n);if(t.add(i),!o)return i}function re(t,e){return void 0===e&&(e=0),xt((function(r,n){r.subscribe(new Et(n,(function(r){return ee(n,t,(function(){return n.next(r)}),e)}),(function(){return ee(n,t,(function(){return n.complete()}),e)}),(function(r){return ee(n,t,(function(){return n.error(r)}),e)})))}))}function ne(t,e){return void 0===e&&(e=0),xt((function(r,n){n.add(t.schedule((function(){return r.subscribe(n)}),e))}))}function oe(t,e){if(!t)throw new Error("Iterable cannot be null");return new St((function(r){ee(r,e,(function(){var n=t[Symbol.asyncIterator]();ee(r,e,(function(){n.next().then((function(t){t.done?r.complete():r.next(t.value)}))}),0,!0)}))}))}function ie(t,e){if(null!=t){if(Bt(t))return function(t,e){return Qt(t).pipe(ne(e),re(e))}(t,e);if(zt(t))return function(t,e){return new St((function(r){var n=0;return e.schedule((function(){n===t.length?r.complete():(r.next(t[n++]),r.closed||this.schedule())}))}))}(t,e);if(Dt(t))return function(t,e){return Qt(t).pipe(ne(e),re(e))}(t,e);if(Jt(t))return oe(t,e);if(Kt(t))return function(t,e){return new St((function(r){var n;return ee(r,e,(function(){n=t[Yt](),ee(r,e,(function(){var t,e,o;try{e=(t=n.next()).value,o=t.done}catch(t){return void r.error(t)}o?r.complete():r.next(e)}),0,!0)})),function(){return tt(null==n?void 0:n.return)&&n.return()}}))}(t,e);if(Zt(t))return function(t,e){return oe(Xt(t),e)}(t,e)}throw Gt(t)}function se(t,e){return e?ie(t,e):Qt(t)}function ce(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Wt(t);return se(t,r)}function ae(t,e){return xt((function(r,n){var o=0;r.subscribe(new Et(n,(function(r){n.next(t.call(e,r,o++))})))}))}var ue=Array.isArray;function le(t){return ae((function(e){return function(t,e){return ue(e)?t.apply(void 0,c([],s(e))):t(e)}(t,e)}))}function he(t,e,r){return void 0===r&&(r=1/0),tt(e)?he((function(r,n){return ae((function(t,o){return e(r,t,n,o)}))(Qt(t(r,n)))}),r):("number"==typeof e&&(r=e),xt((function(e,n){return function(t,e,r,n,o,i,s,c){var a=[],u=0,l=0,h=!1,p=function(){!h||a.length||u||e.complete()},d=function(t){return u<n?f(t):a.push(t)},f=function(t){i&&e.next(t),u++;var c=!1;Qt(r(t,l++)).subscribe(new Et(e,(function(t){null==o||o(t),i?d(t):e.next(t)}),(function(){c=!0}),void 0,(function(){if(c)try{u--;for(var t=function(){var t=a.shift();s?ee(e,s,(function(){return f(t)})):f(t)};a.length&&u<n;)t();p()}catch(t){e.error(t)}})))};return t.subscribe(new Et(e,d,(function(){h=!0,p()}))),function(){null==c||c()}}(e,n,t,r)})))}function pe(t){return void 0===t&&(t=1/0),he(wt,t)}function de(){return pe(1)}function fe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return de()(se(t,Wt(t)))}function ye(t){return new St((function(e){Qt(t()).subscribe(e)}))}var ve=["addListener","removeListener"],me=["addEventListener","removeEventListener"],be=["on","off"];function we(t,e,r,n){if(tt(r)&&(n=r,r=void 0),n)return we(t,e,r).pipe(le(n));var o=s(function(t){return tt(t.addEventListener)&&tt(t.removeEventListener)}(t)?me.map((function(n){return function(o){return t[n](e,o,r)}})):function(t){return tt(t.addListener)&&tt(t.removeListener)}(t)?ve.map(ge(t,e)):function(t){return tt(t.on)&&tt(t.off)}(t)?be.map(ge(t,e)):[],2),i=o[0],c=o[1];if(!i&&zt(t))return he((function(t){return we(t,e,r)}))(Qt(t));if(!i)throw new TypeError("Invalid event target");return new St((function(t){var e=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t.next(1<e.length?e:e[0])};return i(e),function(){return c(e)}}))}function ge(t,e){return function(r){return function(n){return t[r](e,n)}}}function Se(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Wt(t),n=Vt(t,1/0),o=t;return o.length?1===o.length?Qt(o[0]):pe(n)(se(o,r)):Ht}var _e,xe=new St(ht),Ee=Array.isArray;function Pe(t){return 1===t.length&&Ee(t[0])?t[0]:t}function Ae(t,e){return xt((function(r,n){var o=0;r.subscribe(new Et(n,(function(r){return t.call(e,r,o++)&&n.next(r)})))}))}function Ce(t){return xt((function(e,r){var n,o=null,i=!1;o=e.subscribe(new Et(r,void 0,void 0,(function(s){n=Qt(t(s,Ce(t)(e))),o?(o.unsubscribe(),o=null,n.subscribe(r)):i=!0}))),i&&(o.unsubscribe(),o=null,n.subscribe(r))}))}function