@tradeshift/elements
Advanced tools
Comparing version 0.1.5 to 0.2.2
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const directives=new WeakMap,isDirective=e=>"function"==typeof e&&directives.has(e),isCEPolyfill=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,removeNodes=function(e,t,s){void 0===s&&(s=null);let r=t;for(;r!==s;){const t=r.nextSibling;e.removeChild(r),r=t}},noChange={},nothing={},marker=`{{lit-${String(Math.random()).slice(2)}}}`,nodeMarker=`\x3c!--${marker}--\x3e`,markerRegex=new RegExp(`${marker}|${nodeMarker}`),boundAttributeSuffix="$lit$";class Template{constructor(e,t){this.parts=[],this.element=t;let s=-1,r=0;const n=[],i=t=>{const o=t.content,a=document.createTreeWalker(o,133,null,!1);let l=0;for(;a.nextNode();){s++;const t=a.currentNode;if(1===t.nodeType){if(t.hasAttributes()){const n=t.attributes;let i=0;for(let e=0;e<n.length;e++)n[e].value.indexOf(marker)>=0&&i++;for(;i-- >0;){const n=e.strings[r],i=lastAttributeNameRegex.exec(n)[2],o=i.toLowerCase()+boundAttributeSuffix,a=t.getAttribute(o).split(markerRegex);this.parts.push({type:"attribute",index:s,name:i,strings:a}),t.removeAttribute(o),r+=a.length-1}}"TEMPLATE"===t.tagName&&i(t)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(marker)>=0){const i=t.parentNode,o=e.split(markerRegex),a=o.length-1;for(let e=0;e<a;e++)i.insertBefore(""===o[e]?createMarker():document.createTextNode(o[e]),t),this.parts.push({type:"node",index:++s});""===o[a]?(i.insertBefore(createMarker(),t),n.push(t)):t.data=o[a],r+=a}}else if(8===t.nodeType)if(t.data===marker){const e=t.parentNode;null!==t.previousSibling&&s!==l||(s++,e.insertBefore(createMarker(),t)),l=s,this.parts.push({type:"node",index:s}),null===t.nextSibling?t.data="":(n.push(t),s--),r++}else{let e=-1;for(;-1!==(e=t.data.indexOf(marker,e+1));)this.parts.push({type:"node",index:-1})}}};i(t);for(const e of n)e.parentNode.removeChild(e)}}const isTemplatePartActive=e=>-1!==e.index,createMarker=()=>document.createComment(""),lastAttributeNameRegex=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F \x09\x0a\x0c\x0d"'>=\/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class TemplateInstance{constructor(e,t,s){this._parts=[],this.template=e,this.processor=t,this.options=s}update(e){let t=0;for(const s of this._parts)void 0!==s&&s.setValue(e[t]),t++;for(const e of this._parts)void 0!==e&&e.commit()}_clone(){const e=isCEPolyfill?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=this.template.parts;let s=0,r=0;const n=e=>{const i=document.createTreeWalker(e,133,null,!1);let o=i.nextNode();for(;s<t.length&&null!==o;){const e=t[s];if(isTemplatePartActive(e))if(r===e.index){if("node"===e.type){const e=this.processor.handleTextExpression(this.options);e.insertAfterNode(o.previousSibling),this._parts.push(e)}else this._parts.push(...this.processor.handleAttributeExpressions(o,e.name,e.strings,this.options));s++}else r++,"TEMPLATE"===o.nodeName&&n(o.content),o=i.nextNode();else this._parts.push(void 0),s++}};return n(e),isCEPolyfill&&(document.adoptNode(e),customElements.upgrade(e)),e}}class TemplateResult{constructor(e,t,s,r){this.strings=e,this.values=t,this.type=s,this.processor=r}getHTML(){const e=this.strings.length-1;let t="";for(let s=0;s<e;s++){const e=this.strings[s],r=lastAttributeNameRegex.exec(e);t+=r?e.substr(0,r.index)+r[1]+r[2]+boundAttributeSuffix+r[3]+marker:e+nodeMarker}return t+this.strings[e]}getTemplateElement(){const e=document.createElement("template");return e.innerHTML=this.getHTML(),e}}const isPrimitive=e=>null===e||!("object"==typeof e||"function"==typeof e);class AttributeCommitter{constructor(e,t,s){this.dirty=!0,this.element=e,this.name=t,this.strings=s,this.parts=[];for(let e=0;e<s.length-1;e++)this.parts[e]=this._createPart()}_createPart(){return new AttributePart(this)}_getValue(){const e=this.strings,t=e.length-1;let s="";for(let r=0;r<t;r++){s+=e[r];const t=this.parts[r];if(void 0!==t){const e=t.value;if(null!=e&&(Array.isArray(e)||"string"!=typeof e&&e[Symbol.iterator]))for(const t of e)s+="string"==typeof t?t:String(t);else s+="string"==typeof e?e:String(e)}}return s+=e[t]}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class AttributePart{constructor(e){this.value=void 0,this.committer=e}setValue(e){e===noChange||isPrimitive(e)&&e===this.value||(this.value=e,isDirective(e)||(this.committer.dirty=!0))}commit(){for(;isDirective(this.value);){const e=this.value;this.value=noChange,e(this)}this.value!==noChange&&this.committer.commit()}}class NodePart{constructor(e){this.value=void 0,this._pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(createMarker()),this.endNode=e.appendChild(createMarker())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e._insert(this.startNode=createMarker()),e._insert(this.endNode=createMarker())}insertAfterPart(e){e._insert(this.startNode=createMarker()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this._pendingValue=e}commit(){for(;isDirective(this._pendingValue);){const e=this._pendingValue;this._pendingValue=noChange,e(this)}const e=this._pendingValue;e!==noChange&&(isPrimitive(e)?e!==this.value&&this._commitText(e):e instanceof TemplateResult?this._commitTemplateResult(e):e instanceof Node?this._commitNode(e):Array.isArray(e)||e[Symbol.iterator]?this._commitIterable(e):e===nothing?(this.value=nothing,this.clear()):this._commitText(e))}_insert(e){this.endNode.parentNode.insertBefore(e,this.endNode)}_commitNode(e){this.value!==e&&(this.clear(),this._insert(e),this.value=e)}_commitText(e){const t=this.startNode.nextSibling;e=null==e?"":e,t===this.endNode.previousSibling&&3===t.nodeType?t.data=e:this._commitNode(document.createTextNode("string"==typeof e?e:String(e))),this.value=e}_commitTemplateResult(e){const t=this.options.templateFactory(e);if(this.value instanceof TemplateInstance&&this.value.template===t)this.value.update(e.values);else{const s=new TemplateInstance(t,e.processor,this.options),r=s._clone();s.update(e.values),this._commitNode(r),this.value=s}}_commitIterable(e){Array.isArray(this.value)||(this.value=[],this.clear());const t=this.value;let s,r=0;for(const n of e)void 0===(s=t[r])&&(s=new NodePart(this.options),t.push(s),0===r?s.appendIntoPart(this):s.insertAfterPart(t[r-1])),s.setValue(n),s.commit(),r++;r<t.length&&(t.length=r,this.clear(s&&s.endNode))}clear(e){void 0===e&&(e=this.startNode),removeNodes(this.startNode.parentNode,e.nextSibling,this.endNode)}}class BooleanAttributePart{constructor(e,t,s){if(this.value=void 0,this._pendingValue=void 0,2!==s.length||""!==s[0]||""!==s[1])throw new Error("Boolean attributes can only contain a single expression");this.element=e,this.name=t,this.strings=s}setValue(e){this._pendingValue=e}commit(){for(;isDirective(this._pendingValue);){const e=this._pendingValue;this._pendingValue=noChange,e(this)}if(this._pendingValue===noChange)return;const e=!!this._pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)),this.value=e,this._pendingValue=noChange}}class PropertyCommitter extends AttributeCommitter{constructor(e,t,s){super(e,t,s),this.single=2===s.length&&""===s[0]&&""===s[1]}_createPart(){return new PropertyPart(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class PropertyPart extends AttributePart{}let eventOptionsSupported=!1;try{const e={get capture(){return eventOptionsSupported=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}class EventPart{constructor(e,t,s){this.value=void 0,this._pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=s,this._boundHandleEvent=(e=>this.handleEvent(e))}setValue(e){this._pendingValue=e}commit(){for(;isDirective(this._pendingValue);){const e=this._pendingValue;this._pendingValue=noChange,e(this)}if(this._pendingValue===noChange)return;const e=this._pendingValue,t=this.value,s=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive);s&&this.element.removeEventListener(this.eventName,this._boundHandleEvent,this._options),null==e||null!=t&&!s||(this._options=getOptions(e),this.element.addEventListener(this.eventName,this._boundHandleEvent,this._options)),this.value=e,this._pendingValue=noChange}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const getOptions=e=>e&&(eventOptionsSupported?{capture:e.capture,passive:e.passive,once:e.once}:e.capture);class DefaultTemplateProcessor{handleAttributeExpressions(e,t,s,r){const n=t[0];if("."===n){return new PropertyCommitter(e,t.slice(1),s).parts}return"@"===n?[new EventPart(e,t.slice(1),r.eventContext)]:"?"===n?[new BooleanAttributePart(e,t.slice(1),s)]:new AttributeCommitter(e,t,s).parts}handleTextExpression(e){return new NodePart(e)}}const defaultTemplateProcessor=new DefaultTemplateProcessor;function templateFactory(e){let t=templateCaches.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},templateCaches.set(e.type,t));let s=t.stringsArray.get(e.strings);if(void 0!==s)return s;const r=e.strings.join(marker);return void 0===(s=t.keyString.get(r))&&(s=new Template(e,e.getTemplateElement()),t.keyString.set(r,s)),t.stringsArray.set(e.strings,s),s}const templateCaches=new Map,parts=new WeakMap,render=(e,t,s)=>{let r=parts.get(t);void 0===r&&(removeNodes(t,t.firstChild),parts.set(t,r=new NodePart(Object.assign({templateFactory:templateFactory},s))),r.appendInto(t)),r.setValue(e),r.commit()};(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.0.0");const html=function(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),r=1;r<t;r++)s[r-1]=arguments[r];return new TemplateResult(e,s,"html",defaultTemplateProcessor)},walkerNodeFilter=133;function removeNodesFromTemplate(e,t){const s=e.element.content,r=e.parts,n=document.createTreeWalker(s,walkerNodeFilter,null,!1);let i=nextActiveIndexInTemplateParts(r),o=r[i],a=-1,l=0;const h=[];let c=null;for(;n.nextNode();){a++;const e=n.currentNode;for(e.previousSibling===c&&(c=null),t.has(e)&&(h.push(e),null===c&&(c=e)),null!==c&&l++;void 0!==o&&o.index===a;)o.index=null!==c?-1:o.index-l,o=r[i=nextActiveIndexInTemplateParts(r,i)]}h.forEach(e=>e.parentNode.removeChild(e))}const countNodes=e=>{let t=11===e.nodeType?0:1;const s=document.createTreeWalker(e,walkerNodeFilter,null,!1);for(;s.nextNode();)t++;return t},nextActiveIndexInTemplateParts=function(e,t){void 0===t&&(t=-1);for(let s=t+1;s<e.length;s++){const t=e[s];if(isTemplatePartActive(t))return s}return-1};function insertNodeIntoTemplate(e,t,s){void 0===s&&(s=null);const r=e.element.content,n=e.parts;if(null==s)return void r.appendChild(t);const i=document.createTreeWalker(r,walkerNodeFilter,null,!1);let o=nextActiveIndexInTemplateParts(n),a=0,l=-1;for(;i.nextNode();){for(l++,i.currentNode===s&&(a=countNodes(t),s.parentNode.insertBefore(t,s));-1!==o&&n[o].index===l;){if(a>0){for(;-1!==o;)n[o].index+=a,o=nextActiveIndexInTemplateParts(n,o);return}o=nextActiveIndexInTemplateParts(n,o)}}}const getTemplateCacheKey=(e,t)=>`${e}--${t}`;let compatibleShadyCSSVersion=!0;void 0===window.ShadyCSS?compatibleShadyCSSVersion=!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."),compatibleShadyCSSVersion=!1);const shadyTemplateFactory=e=>t=>{const s=getTemplateCacheKey(t.type,e);let r=templateCaches.get(s);void 0===r&&(r={stringsArray:new WeakMap,keyString:new Map},templateCaches.set(s,r));let n=r.stringsArray.get(t.strings);if(void 0!==n)return n;const i=t.strings.join(marker);if(void 0===(n=r.keyString.get(i))){const s=t.getTemplateElement();compatibleShadyCSSVersion&&window.ShadyCSS.prepareTemplateDom(s,e),n=new Template(t,s),r.keyString.set(i,n)}return r.stringsArray.set(t.strings,n),n},TEMPLATE_TYPES=["html","svg"],removeStylesFromLitTemplates=e=>{TEMPLATE_TYPES.forEach(t=>{const s=templateCaches.get(getTemplateCacheKey(t,e));void 0!==s&&s.keyString.forEach(e=>{const t=e.element.content,s=new Set;Array.from(t.querySelectorAll("style")).forEach(e=>{s.add(e)}),removeNodesFromTemplate(e,s)})})},shadyRenderSet=new Set,prepareTemplateStyles=(e,t,s)=>{shadyRenderSet.add(s);const r=e.querySelectorAll("style");if(0===r.length)return void window.ShadyCSS.prepareTemplateStyles(t.element,s);const n=document.createElement("style");for(let e=0;e<r.length;e++){const t=r[e];t.parentNode.removeChild(t),n.textContent+=t.textContent}if(removeStylesFromLitTemplates(s),insertNodeIntoTemplate(t,n,t.element.content.firstChild),window.ShadyCSS.prepareTemplateStyles(t.element,s),window.ShadyCSS.nativeShadow){const s=t.element.content.querySelector("style");e.insertBefore(s.cloneNode(!0),e.firstChild)}else{t.element.content.insertBefore(n,t.element.content.firstChild);const e=new Set;e.add(n),removeNodesFromTemplate(t,e)}},render$1=(e,t,s)=>{const r=s.scopeName,n=parts.has(t),i=t instanceof ShadowRoot&&compatibleShadyCSSVersion&&e instanceof TemplateResult,o=i&&!shadyRenderSet.has(r),a=o?document.createDocumentFragment():t;if(render(e,a,Object.assign({templateFactory:shadyTemplateFactory(r)},s)),o){const e=parts.get(a);parts.delete(a),e.value instanceof TemplateInstance&&prepareTemplateStyles(a,e.value.template,r),removeNodes(t,t.firstChild),t.appendChild(a),parts.set(t,e)}!n&&i&&window.ShadyCSS.styleElement(t.host)};window.JSCompiler_renameProperty=(e=>e);const defaultConverter={toAttribute(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){switch(t){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},notEqual=(e,t)=>t!==e&&(t==t||e==e),defaultPropertyDeclaration={attribute:!0,type:String,converter:defaultConverter,reflect:!1,hasChanged:notEqual},microtaskPromise=Promise.resolve(!0),STATE_HAS_UPDATED=1,STATE_UPDATE_REQUESTED=4,STATE_IS_REFLECTING_TO_ATTRIBUTE=8,STATE_IS_REFLECTING_TO_PROPERTY=16,STATE_HAS_CONNECTED=32;class UpdatingElement extends HTMLElement{constructor(){super(),this._updateState=0,this._instanceProperties=void 0,this._updatePromise=microtaskPromise,this._hasConnectedResolver=void 0,this._changedProperties=new Map,this._reflectingProperties=void 0,this.initialize()}static get observedAttributes(){this.finalize();const e=[];return this._classProperties.forEach((t,s)=>{const r=this._attributeNameForProperty(s,t);void 0!==r&&(this._attributeToPropertyMap.set(r,s),e.push(r))}),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const e=Object.getPrototypeOf(this)._classProperties;void 0!==e&&e.forEach((e,t)=>this._classProperties.set(t,e))}}static createProperty(e,t){if(void 0===t&&(t=defaultPropertyDeclaration),this._ensureClassProperties(),this._classProperties.set(e,t),t.noAccessor||this.prototype.hasOwnProperty(e))return;const s="symbol"==typeof e?Symbol():`__${e}`;Object.defineProperty(this.prototype,e,{get(){return this[s]},set(t){const r=this[e];this[s]=t,this.requestUpdate(e,r)},configurable:!0,enumerable:!0})}static finalize(){if(this.hasOwnProperty(JSCompiler_renameProperty("finalized",this))&&this.finalized)return;const e=Object.getPrototypeOf(this);if("function"==typeof e.finalize&&e.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const e=this.properties,t=[...Object.getOwnPropertyNames(e),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]];for(const s of t)this.createProperty(s,e[s])}}static _attributeNameForProperty(e,t){const s=t.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof e?e.toLowerCase():void 0}static _valueHasChanged(e,t,s){return void 0===s&&(s=notEqual),s(e,t)}static _propertyValueFromAttribute(e,t){const s=t.type,r=t.converter||defaultConverter,n="function"==typeof r?r:r.fromAttribute;return n?n(e,s):e}static _propertyValueToAttribute(e,t){if(void 0===t.reflect)return;const s=t.type,r=t.converter;return(r&&r.toAttribute||defaultConverter.toAttribute)(e,s)}initialize(){this._saveInstanceProperties()}_saveInstanceProperties(){this.constructor._classProperties.forEach((e,t)=>{if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(t,e)}})}_applyInstanceProperties(){this._instanceProperties.forEach((e,t)=>this[t]=e),this._instanceProperties=void 0}connectedCallback(){this._updateState=this._updateState|STATE_HAS_CONNECTED,this._hasConnectedResolver?(this._hasConnectedResolver(),this._hasConnectedResolver=void 0):this.requestUpdate()}disconnectedCallback(){}attributeChangedCallback(e,t,s){t!==s&&this._attributeToProperty(e,s)}_propertyToAttribute(e,t,s){void 0===s&&(s=defaultPropertyDeclaration);const r=this.constructor,n=r._attributeNameForProperty(e,s);if(void 0!==n){const e=r._propertyValueToAttribute(t,s);if(void 0===e)return;this._updateState=this._updateState|STATE_IS_REFLECTING_TO_ATTRIBUTE,null==e?this.removeAttribute(n):this.setAttribute(n,e),this._updateState=this._updateState&~STATE_IS_REFLECTING_TO_ATTRIBUTE}}_attributeToProperty(e,t){if(this._updateState&STATE_IS_REFLECTING_TO_ATTRIBUTE)return;const s=this.constructor,r=s._attributeToPropertyMap.get(e);if(void 0!==r){const e=s._classProperties.get(r)||defaultPropertyDeclaration;this._updateState=this._updateState|STATE_IS_REFLECTING_TO_PROPERTY,this[r]=s._propertyValueFromAttribute(t,e),this._updateState=this._updateState&~STATE_IS_REFLECTING_TO_PROPERTY}}requestUpdate(e,t){let s=!0;if(void 0!==e&&!this._changedProperties.has(e)){const r=this.constructor,n=r._classProperties.get(e)||defaultPropertyDeclaration;r._valueHasChanged(this[e],t,n.hasChanged)?(this._changedProperties.set(e,t),!0!==n.reflect||this._updateState&STATE_IS_REFLECTING_TO_PROPERTY||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,n))):s=!1}return!this._hasRequestedUpdate&&s&&this._enqueueUpdate(),this.updateComplete}async _enqueueUpdate(){let e;this._updateState=this._updateState|STATE_UPDATE_REQUESTED;const t=this._updatePromise;this._updatePromise=new Promise(t=>e=t),await t,this._hasConnected||await new Promise(e=>this._hasConnectedResolver=e);const s=this.performUpdate();null!=s&&"function"==typeof s.then&&await s,e(!this._hasRequestedUpdate)}get _hasConnected(){return this._updateState&STATE_HAS_CONNECTED}get _hasRequestedUpdate(){return this._updateState&STATE_UPDATE_REQUESTED}get hasUpdated(){return this._updateState&STATE_HAS_UPDATED}performUpdate(){if(this._instanceProperties&&this._applyInstanceProperties(),this.shouldUpdate(this._changedProperties)){const e=this._changedProperties;this.update(e),this._markUpdated(),this._updateState&STATE_HAS_UPDATED||(this._updateState=this._updateState|STATE_HAS_UPDATED,this.firstUpdated(e)),this.updated(e)}else this._markUpdated()}_markUpdated(){this._changedProperties=new Map,this._updateState=this._updateState&~STATE_UPDATE_REQUESTED}get updateComplete(){return this._updatePromise}shouldUpdate(){return!0}update(){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((e,t)=>this._propertyToAttribute(t,this[t],e)),this._reflectingProperties=void 0)}updated(){}firstUpdated(){}}UpdatingElement.finalized=!0;const supportsAdoptingStyleSheets="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,constructionToken=Symbol();class CSSResult{constructor(e,t){if(t!==constructionToken)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return void 0===this._styleSheet&&(supportsAdoptingStyleSheets?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const unsafeCSS=e=>new CSSResult(String(e),constructionToken),textFromCSSResult=e=>{if(e instanceof CSSResult)return e.cssText;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${e}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)},css=function(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),r=1;r<t;r++)s[r-1]=arguments[r];const n=s.reduce((t,s,r)=>t+textFromCSSResult(s)+e[r+1],e[0]);return new CSSResult(n,constructionToken)};function arrayFlat(e,t){void 0===t&&(t=[]);for(let s=0,r=e.length;s<r;s++){const r=e[s];Array.isArray(r)?arrayFlat(r,t):t.push(r)}return t}(window.litElementVersions||(window.litElementVersions=[])).push("2.0.1");const flattenStyles=e=>e.flat?e.flat(1/0):arrayFlat(e);class LitElement extends UpdatingElement{static finalize(){super.finalize(),this._styles=this.hasOwnProperty(JSCompiler_renameProperty("styles",this))?this._getUniqueStyles():this._styles||[]}static _getUniqueStyles(){const e=this.styles,t=[];if(Array.isArray(e)){flattenStyles(e).reduceRight((e,t)=>(e.add(t),e),new Set).forEach(e=>t.unshift(e))}else e&&t.push(e);return t}initialize(){super.initialize(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?supportsAdoptingStyleSheets?this.renderRoot.adoptedStyleSheets=e.map(e=>e.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(e=>e.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){super.update(e);const t=this.render();t instanceof TemplateResult&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(e=>{const t=document.createElement("style");t.textContent=e.cssText,this.renderRoot.appendChild(t)}))}render(){}}LitElement.finalized=!0,LitElement.render=render$1;var css$1=":focus{outline:none}:host{display:inline-block}:host,:host *{box-sizing:border-box;font-size:14px;font-size:var(--ts-font-size-default);line-height:20px;line-height:var(--ts-unit);font-family:Open Sans,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--ts-font-family);background:transparent;margin:0;padding:0}";class TSElement extends LitElement{static get styles(){return unsafeCSS(css$1)}}exports.TSElement=TSElement,exports.css=css,exports.unsafeCSS=unsafeCSS,exports.html=html; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const directives=new WeakMap,isDirective=e=>"function"==typeof e&&directives.has(e),isCEPolyfill=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,removeNodes=function(e,t,s){void 0===s&&(s=null);let r=t;for(;r!==s;){const t=r.nextSibling;e.removeChild(r),r=t}},noChange={},nothing={},marker="{{lit-"+String(Math.random()).slice(2)+"}}",nodeMarker="\x3c!--"+marker+"--\x3e",markerRegex=new RegExp(marker+"|"+nodeMarker),boundAttributeSuffix="$lit$";class Template{constructor(e,t){this.parts=[],this.element=t;let s=-1,r=0;const n=[],i=t=>{const o=t.content,a=document.createTreeWalker(o,133,null,!1);let l=0;for(;a.nextNode();){s++;const t=a.currentNode;if(1===t.nodeType){if(t.hasAttributes()){const n=t.attributes;let i=0;for(let e=0;e<n.length;e++)n[e].value.indexOf(marker)>=0&&i++;for(;i-- >0;){const n=e.strings[r],i=lastAttributeNameRegex.exec(n)[2],o=i.toLowerCase()+boundAttributeSuffix,a=t.getAttribute(o).split(markerRegex);this.parts.push({type:"attribute",index:s,name:i,strings:a}),t.removeAttribute(o),r+=a.length-1}}"TEMPLATE"===t.tagName&&i(t)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(marker)>=0){const i=t.parentNode,o=e.split(markerRegex),a=o.length-1;for(let e=0;e<a;e++)i.insertBefore(""===o[e]?createMarker():document.createTextNode(o[e]),t),this.parts.push({type:"node",index:++s});""===o[a]?(i.insertBefore(createMarker(),t),n.push(t)):t.data=o[a],r+=a}}else if(8===t.nodeType)if(t.data===marker){const e=t.parentNode;null!==t.previousSibling&&s!==l||(s++,e.insertBefore(createMarker(),t)),l=s,this.parts.push({type:"node",index:s}),null===t.nextSibling?t.data="":(n.push(t),s--),r++}else{let e=-1;for(;-1!==(e=t.data.indexOf(marker,e+1));)this.parts.push({type:"node",index:-1})}}};i(t);for(const e of n)e.parentNode.removeChild(e)}}const isTemplatePartActive=e=>-1!==e.index,createMarker=()=>document.createComment(""),lastAttributeNameRegex=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F \x09\x0a\x0c\x0d"'>=\/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class TemplateInstance{constructor(e,t,s){this._parts=[],this.template=e,this.processor=t,this.options=s}update(e){let t=0;for(const s of this._parts)void 0!==s&&s.setValue(e[t]),t++;for(const e of this._parts)void 0!==e&&e.commit()}_clone(){const e=isCEPolyfill?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=this.template.parts;let s=0,r=0;const n=e=>{const i=document.createTreeWalker(e,133,null,!1);let o=i.nextNode();for(;s<t.length&&null!==o;){const e=t[s];if(isTemplatePartActive(e))if(r===e.index){if("node"===e.type){const e=this.processor.handleTextExpression(this.options);e.insertAfterNode(o.previousSibling),this._parts.push(e)}else this._parts.push(...this.processor.handleAttributeExpressions(o,e.name,e.strings,this.options));s++}else r++,"TEMPLATE"===o.nodeName&&n(o.content),o=i.nextNode();else this._parts.push(void 0),s++}};return n(e),isCEPolyfill&&(document.adoptNode(e),customElements.upgrade(e)),e}}class TemplateResult{constructor(e,t,s,r){this.strings=e,this.values=t,this.type=s,this.processor=r}getHTML(){const e=this.strings.length-1;let t="";for(let s=0;s<e;s++){const e=this.strings[s],r=lastAttributeNameRegex.exec(e);t+=r?e.substr(0,r.index)+r[1]+r[2]+boundAttributeSuffix+r[3]+marker:e+nodeMarker}return t+this.strings[e]}getTemplateElement(){const e=document.createElement("template");return e.innerHTML=this.getHTML(),e}}const isPrimitive=e=>null===e||!("object"==typeof e||"function"==typeof e);class AttributeCommitter{constructor(e,t,s){this.dirty=!0,this.element=e,this.name=t,this.strings=s,this.parts=[];for(let e=0;e<s.length-1;e++)this.parts[e]=this._createPart()}_createPart(){return new AttributePart(this)}_getValue(){const e=this.strings,t=e.length-1;let s="";for(let r=0;r<t;r++){s+=e[r];const t=this.parts[r];if(void 0!==t){const e=t.value;if(null!=e&&(Array.isArray(e)||"string"!=typeof e&&e[Symbol.iterator]))for(const t of e)s+="string"==typeof t?t:String(t);else s+="string"==typeof e?e:String(e)}}return s+=e[t]}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class AttributePart{constructor(e){this.value=void 0,this.committer=e}setValue(e){e===noChange||isPrimitive(e)&&e===this.value||(this.value=e,isDirective(e)||(this.committer.dirty=!0))}commit(){for(;isDirective(this.value);){const e=this.value;this.value=noChange,e(this)}this.value!==noChange&&this.committer.commit()}}class NodePart{constructor(e){this.value=void 0,this._pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(createMarker()),this.endNode=e.appendChild(createMarker())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e._insert(this.startNode=createMarker()),e._insert(this.endNode=createMarker())}insertAfterPart(e){e._insert(this.startNode=createMarker()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this._pendingValue=e}commit(){for(;isDirective(this._pendingValue);){const e=this._pendingValue;this._pendingValue=noChange,e(this)}const e=this._pendingValue;e!==noChange&&(isPrimitive(e)?e!==this.value&&this._commitText(e):e instanceof TemplateResult?this._commitTemplateResult(e):e instanceof Node?this._commitNode(e):Array.isArray(e)||e[Symbol.iterator]?this._commitIterable(e):e===nothing?(this.value=nothing,this.clear()):this._commitText(e))}_insert(e){this.endNode.parentNode.insertBefore(e,this.endNode)}_commitNode(e){this.value!==e&&(this.clear(),this._insert(e),this.value=e)}_commitText(e){const t=this.startNode.nextSibling;e=null==e?"":e,t===this.endNode.previousSibling&&3===t.nodeType?t.data=e:this._commitNode(document.createTextNode("string"==typeof e?e:String(e))),this.value=e}_commitTemplateResult(e){const t=this.options.templateFactory(e);if(this.value instanceof TemplateInstance&&this.value.template===t)this.value.update(e.values);else{const s=new TemplateInstance(t,e.processor,this.options),r=s._clone();s.update(e.values),this._commitNode(r),this.value=s}}_commitIterable(e){Array.isArray(this.value)||(this.value=[],this.clear());const t=this.value;let s,r=0;for(const n of e)void 0===(s=t[r])&&(s=new NodePart(this.options),t.push(s),0===r?s.appendIntoPart(this):s.insertAfterPart(t[r-1])),s.setValue(n),s.commit(),r++;r<t.length&&(t.length=r,this.clear(s&&s.endNode))}clear(e){void 0===e&&(e=this.startNode),removeNodes(this.startNode.parentNode,e.nextSibling,this.endNode)}}class BooleanAttributePart{constructor(e,t,s){if(this.value=void 0,this._pendingValue=void 0,2!==s.length||""!==s[0]||""!==s[1])throw new Error("Boolean attributes can only contain a single expression");this.element=e,this.name=t,this.strings=s}setValue(e){this._pendingValue=e}commit(){for(;isDirective(this._pendingValue);){const e=this._pendingValue;this._pendingValue=noChange,e(this)}if(this._pendingValue===noChange)return;const e=!!this._pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)),this.value=e,this._pendingValue=noChange}}class PropertyCommitter extends AttributeCommitter{constructor(e,t,s){super(e,t,s),this.single=2===s.length&&""===s[0]&&""===s[1]}_createPart(){return new PropertyPart(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class PropertyPart extends AttributePart{}let eventOptionsSupported=!1;try{const e={get capture(){return eventOptionsSupported=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}class EventPart{constructor(e,t,s){this.value=void 0,this._pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=s,this._boundHandleEvent=(e=>this.handleEvent(e))}setValue(e){this._pendingValue=e}commit(){for(;isDirective(this._pendingValue);){const e=this._pendingValue;this._pendingValue=noChange,e(this)}if(this._pendingValue===noChange)return;const e=this._pendingValue,t=this.value,s=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive);s&&this.element.removeEventListener(this.eventName,this._boundHandleEvent,this._options),null==e||null!=t&&!s||(this._options=getOptions(e),this.element.addEventListener(this.eventName,this._boundHandleEvent,this._options)),this.value=e,this._pendingValue=noChange}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const getOptions=e=>e&&(eventOptionsSupported?{capture:e.capture,passive:e.passive,once:e.once}:e.capture);class DefaultTemplateProcessor{handleAttributeExpressions(e,t,s,r){const n=t[0];if("."===n){return new PropertyCommitter(e,t.slice(1),s).parts}return"@"===n?[new EventPart(e,t.slice(1),r.eventContext)]:"?"===n?[new BooleanAttributePart(e,t.slice(1),s)]:new AttributeCommitter(e,t,s).parts}handleTextExpression(e){return new NodePart(e)}}const defaultTemplateProcessor=new DefaultTemplateProcessor;function templateFactory(e){let t=templateCaches.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},templateCaches.set(e.type,t));let s=t.stringsArray.get(e.strings);if(void 0!==s)return s;const r=e.strings.join(marker);return void 0===(s=t.keyString.get(r))&&(s=new Template(e,e.getTemplateElement()),t.keyString.set(r,s)),t.stringsArray.set(e.strings,s),s}const templateCaches=new Map,parts=new WeakMap,render=(e,t,s)=>{let r=parts.get(t);void 0===r&&(removeNodes(t,t.firstChild),parts.set(t,r=new NodePart(Object.assign({templateFactory:templateFactory},s))),r.appendInto(t)),r.setValue(e),r.commit()};(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.0.0");const html=function(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),r=1;r<t;r++)s[r-1]=arguments[r];return new TemplateResult(e,s,"html",defaultTemplateProcessor)},walkerNodeFilter=133;function removeNodesFromTemplate(e,t){const s=e.element.content,r=e.parts,n=document.createTreeWalker(s,walkerNodeFilter,null,!1);let i=nextActiveIndexInTemplateParts(r),o=r[i],a=-1,l=0;const c=[];let h=null;for(;n.nextNode();){a++;const e=n.currentNode;for(e.previousSibling===h&&(h=null),t.has(e)&&(c.push(e),null===h&&(h=e)),null!==h&&l++;void 0!==o&&o.index===a;)o.index=null!==h?-1:o.index-l,o=r[i=nextActiveIndexInTemplateParts(r,i)]}c.forEach(e=>e.parentNode.removeChild(e))}const countNodes=e=>{let t=11===e.nodeType?0:1;const s=document.createTreeWalker(e,walkerNodeFilter,null,!1);for(;s.nextNode();)t++;return t},nextActiveIndexInTemplateParts=function(e,t){void 0===t&&(t=-1);for(let s=t+1;s<e.length;s++){const t=e[s];if(isTemplatePartActive(t))return s}return-1};function insertNodeIntoTemplate(e,t,s){void 0===s&&(s=null);const r=e.element.content,n=e.parts;if(null==s)return void r.appendChild(t);const i=document.createTreeWalker(r,walkerNodeFilter,null,!1);let o=nextActiveIndexInTemplateParts(n),a=0,l=-1;for(;i.nextNode();){for(l++,i.currentNode===s&&(a=countNodes(t),s.parentNode.insertBefore(t,s));-1!==o&&n[o].index===l;){if(a>0){for(;-1!==o;)n[o].index+=a,o=nextActiveIndexInTemplateParts(n,o);return}o=nextActiveIndexInTemplateParts(n,o)}}}const getTemplateCacheKey=(e,t)=>e+"--"+t;let compatibleShadyCSSVersion=!0;void 0===window.ShadyCSS?compatibleShadyCSSVersion=!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."),compatibleShadyCSSVersion=!1);const shadyTemplateFactory=e=>t=>{const s=getTemplateCacheKey(t.type,e);let r=templateCaches.get(s);void 0===r&&(r={stringsArray:new WeakMap,keyString:new Map},templateCaches.set(s,r));let n=r.stringsArray.get(t.strings);if(void 0!==n)return n;const i=t.strings.join(marker);if(void 0===(n=r.keyString.get(i))){const s=t.getTemplateElement();compatibleShadyCSSVersion&&window.ShadyCSS.prepareTemplateDom(s,e),n=new Template(t,s),r.keyString.set(i,n)}return r.stringsArray.set(t.strings,n),n},TEMPLATE_TYPES=["html","svg"],removeStylesFromLitTemplates=e=>{TEMPLATE_TYPES.forEach(t=>{const s=templateCaches.get(getTemplateCacheKey(t,e));void 0!==s&&s.keyString.forEach(e=>{const t=e.element.content,s=new Set;Array.from(t.querySelectorAll("style")).forEach(e=>{s.add(e)}),removeNodesFromTemplate(e,s)})})},shadyRenderSet=new Set,prepareTemplateStyles=(e,t,s)=>{shadyRenderSet.add(s);const r=e.querySelectorAll("style");if(0===r.length)return void window.ShadyCSS.prepareTemplateStyles(t.element,s);const n=document.createElement("style");for(let e=0;e<r.length;e++){const t=r[e];t.parentNode.removeChild(t),n.textContent+=t.textContent}if(removeStylesFromLitTemplates(s),insertNodeIntoTemplate(t,n,t.element.content.firstChild),window.ShadyCSS.prepareTemplateStyles(t.element,s),window.ShadyCSS.nativeShadow){const s=t.element.content.querySelector("style");e.insertBefore(s.cloneNode(!0),e.firstChild)}else{t.element.content.insertBefore(n,t.element.content.firstChild);const e=new Set;e.add(n),removeNodesFromTemplate(t,e)}},render$1=(e,t,s)=>{const r=s.scopeName,n=parts.has(t),i=t instanceof ShadowRoot&&compatibleShadyCSSVersion&&e instanceof TemplateResult,o=i&&!shadyRenderSet.has(r),a=o?document.createDocumentFragment():t;if(render(e,a,Object.assign({templateFactory:shadyTemplateFactory(r)},s)),o){const e=parts.get(a);parts.delete(a),e.value instanceof TemplateInstance&&prepareTemplateStyles(a,e.value.template,r),removeNodes(t,t.firstChild),t.appendChild(a),parts.set(t,e)}!n&&i&&window.ShadyCSS.styleElement(t.host)};function asyncGeneratorStep(e,t,s,r,n,i,o){try{var a=e[i](o),l=a.value}catch(e){return void s(e)}a.done?t(l):Promise.resolve(l).then(r,n)}function _asyncToGenerator(e){return function(){var t=this,s=arguments;return new Promise(function(r,n){var i=e.apply(t,s);function o(e){asyncGeneratorStep(i,r,n,o,a,"next",e)}function a(e){asyncGeneratorStep(i,r,n,o,a,"throw",e)}o(void 0)})}}window.JSCompiler_renameProperty=(e=>e);const defaultConverter={toAttribute(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){switch(t){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},notEqual=(e,t)=>t!==e&&(t==t||e==e),defaultPropertyDeclaration={attribute:!0,type:String,converter:defaultConverter,reflect:!1,hasChanged:notEqual},microtaskPromise=Promise.resolve(!0),STATE_HAS_UPDATED=1,STATE_UPDATE_REQUESTED=4,STATE_IS_REFLECTING_TO_ATTRIBUTE=8,STATE_IS_REFLECTING_TO_PROPERTY=16,STATE_HAS_CONNECTED=32;class UpdatingElement extends HTMLElement{constructor(){super(),this._updateState=0,this._instanceProperties=void 0,this._updatePromise=microtaskPromise,this._hasConnectedResolver=void 0,this._changedProperties=new Map,this._reflectingProperties=void 0,this.initialize()}static get observedAttributes(){this.finalize();const e=[];return this._classProperties.forEach((t,s)=>{const r=this._attributeNameForProperty(s,t);void 0!==r&&(this._attributeToPropertyMap.set(r,s),e.push(r))}),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const e=Object.getPrototypeOf(this)._classProperties;void 0!==e&&e.forEach((e,t)=>this._classProperties.set(t,e))}}static createProperty(e,t){if(void 0===t&&(t=defaultPropertyDeclaration),this._ensureClassProperties(),this._classProperties.set(e,t),t.noAccessor||this.prototype.hasOwnProperty(e))return;const s="symbol"==typeof e?Symbol():"__"+e;Object.defineProperty(this.prototype,e,{get(){return this[s]},set(t){const r=this[e];this[s]=t,this._requestUpdate(e,r)},configurable:!0,enumerable:!0})}static finalize(){if(this.hasOwnProperty(JSCompiler_renameProperty("finalized",this))&&this.finalized)return;const e=Object.getPrototypeOf(this);if("function"==typeof e.finalize&&e.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const e=this.properties,t=[...Object.getOwnPropertyNames(e),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]];for(const s of t)this.createProperty(s,e[s])}}static _attributeNameForProperty(e,t){const s=t.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof e?e.toLowerCase():void 0}static _valueHasChanged(e,t,s){return void 0===s&&(s=notEqual),s(e,t)}static _propertyValueFromAttribute(e,t){const s=t.type,r=t.converter||defaultConverter,n="function"==typeof r?r:r.fromAttribute;return n?n(e,s):e}static _propertyValueToAttribute(e,t){if(void 0===t.reflect)return;const s=t.type,r=t.converter;return(r&&r.toAttribute||defaultConverter.toAttribute)(e,s)}initialize(){this._saveInstanceProperties(),this._requestUpdate()}_saveInstanceProperties(){this.constructor._classProperties.forEach((e,t)=>{if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(t,e)}})}_applyInstanceProperties(){this._instanceProperties.forEach((e,t)=>this[t]=e),this._instanceProperties=void 0}connectedCallback(){this._updateState=this._updateState|STATE_HAS_CONNECTED,this._hasConnectedResolver&&(this._hasConnectedResolver(),this._hasConnectedResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(e,t,s){t!==s&&this._attributeToProperty(e,s)}_propertyToAttribute(e,t,s){void 0===s&&(s=defaultPropertyDeclaration);const r=this.constructor,n=r._attributeNameForProperty(e,s);if(void 0!==n){const e=r._propertyValueToAttribute(t,s);if(void 0===e)return;this._updateState=this._updateState|STATE_IS_REFLECTING_TO_ATTRIBUTE,null==e?this.removeAttribute(n):this.setAttribute(n,e),this._updateState=this._updateState&~STATE_IS_REFLECTING_TO_ATTRIBUTE}}_attributeToProperty(e,t){if(this._updateState&STATE_IS_REFLECTING_TO_ATTRIBUTE)return;const s=this.constructor,r=s._attributeToPropertyMap.get(e);if(void 0!==r){const e=s._classProperties.get(r)||defaultPropertyDeclaration;this._updateState=this._updateState|STATE_IS_REFLECTING_TO_PROPERTY,this[r]=s._propertyValueFromAttribute(t,e),this._updateState=this._updateState&~STATE_IS_REFLECTING_TO_PROPERTY}}_requestUpdate(e,t){let s=!0;if(void 0!==e){const r=this.constructor,n=r._classProperties.get(e)||defaultPropertyDeclaration;r._valueHasChanged(this[e],t,n.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,t),!0!==n.reflect||this._updateState&STATE_IS_REFLECTING_TO_PROPERTY||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,n))):s=!1}!this._hasRequestedUpdate&&s&&this._enqueueUpdate()}requestUpdate(e,t){return this._requestUpdate(e,t),this.updateComplete}_enqueueUpdate(){var e=this;return _asyncToGenerator(function*(){let t,s;e._updateState=e._updateState|STATE_UPDATE_REQUESTED;const r=e._updatePromise;e._updatePromise=new Promise((e,r)=>{t=e,s=r});try{yield r}catch(e){}e._hasConnected||(yield new Promise(t=>e._hasConnectedResolver=t));try{const t=e.performUpdate();null!=t&&(yield t)}catch(e){s(e)}t(!e._hasRequestedUpdate)})()}get _hasConnected(){return this._updateState&STATE_HAS_CONNECTED}get _hasRequestedUpdate(){return this._updateState&STATE_UPDATE_REQUESTED}get hasUpdated(){return this._updateState&STATE_HAS_UPDATED}performUpdate(){this._instanceProperties&&this._applyInstanceProperties();let e=!1;const t=this._changedProperties;try{(e=this.shouldUpdate(t))&&this.update(t)}catch(t){throw e=!1,t}finally{this._markUpdated()}e&&(this._updateState&STATE_HAS_UPDATED||(this._updateState=this._updateState|STATE_HAS_UPDATED,this.firstUpdated(t)),this.updated(t))}_markUpdated(){this._changedProperties=new Map,this._updateState=this._updateState&~STATE_UPDATE_REQUESTED}get updateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((e,t)=>this._propertyToAttribute(t,this[t],e)),this._reflectingProperties=void 0)}updated(e){}firstUpdated(e){}}UpdatingElement.finalized=!0;const supportsAdoptingStyleSheets="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,constructionToken=Symbol();class CSSResult{constructor(e,t){if(t!==constructionToken)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return void 0===this._styleSheet&&(supportsAdoptingStyleSheets?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const unsafeCSS=e=>new CSSResult(String(e),constructionToken),textFromCSSResult=e=>{if(e instanceof CSSResult)return e.cssText;throw new Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.")},css=function(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),r=1;r<t;r++)s[r-1]=arguments[r];const n=s.reduce((t,s,r)=>t+textFromCSSResult(s)+e[r+1],e[0]);return new CSSResult(n,constructionToken)};function arrayFlat(e,t){void 0===t&&(t=[]);for(let s=0,r=e.length;s<r;s++){const r=e[s];Array.isArray(r)?arrayFlat(r,t):t.push(r)}return t}(window.litElementVersions||(window.litElementVersions=[])).push("2.0.1");const flattenStyles=e=>e.flat?e.flat(1/0):arrayFlat(e);class LitElement extends UpdatingElement{static finalize(){super.finalize(),this._styles=this.hasOwnProperty(JSCompiler_renameProperty("styles",this))?this._getUniqueStyles():this._styles||[]}static _getUniqueStyles(){const e=this.styles,t=[];if(Array.isArray(e)){flattenStyles(e).reduceRight((e,t)=>(e.add(t),e),new Set).forEach(e=>t.unshift(e))}else e&&t.push(e);return t}initialize(){super.initialize(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?supportsAdoptingStyleSheets?this.renderRoot.adoptedStyleSheets=e.map(e=>e.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(e=>e.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){super.update(e);const t=this.render();t instanceof TemplateResult&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(e=>{const t=document.createElement("style");t.textContent=e.cssText,this.renderRoot.appendChild(t)}))}render(){}}LitElement.finalized=!0,LitElement.render=render$1;var css$1=":focus{outline:none}:host{display:inline-block}:host,:host *{box-sizing:border-box;font-size:14px;font-size:var(--ts-font-size-default);line-height:20px;line-height:var(--ts-unit);font-family:Open Sans,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--ts-font-family);background:transparent;margin:0;padding:0}";class TSElement extends LitElement{static get styles(){return unsafeCSS(css$1)}}exports.TSElement=TSElement,exports.css=css,exports.html=html,exports.unsafeCSS=unsafeCSS; |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((t=t||self).ts=t.ts||{},t.ts.elements=t.ts.elements||{}))}(this,function(t){"use strict";function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function n(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t,e,n){return(s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&o(i,n.prototype),i}).apply(null,arguments)}function a(t){var e="function"==typeof Map?new Map:void 0;return(a=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return s(t,arguments,i(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),o(r,t)})(t)}var u=new WeakMap,c=function(t){return"function"==typeof t&&u.has(t)},l=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,h=function(t,e,n){void 0===n&&(n=null);for(var r=e;r!==n;){var i=r.nextSibling;t.removeChild(r),r=i}},p={},f={},d="{{lit-"+String(Math.random()).slice(2)+"}}",v="\x3c!--"+d+"--\x3e",y=new RegExp(d+"|"+v),m=function(t,e){var n=this;this.parts=[],this.element=e;var r=-1,i=0,o=[],s=function(e){for(var a=e.content,u=document.createTreeWalker(a,133,null,!1),c=0;u.nextNode();){r++;var l=u.currentNode;if(1===l.nodeType){if(l.hasAttributes()){for(var h=l.attributes,p=0,f=0;f<h.length;f++)h[f].value.indexOf(d)>=0&&p++;for(;p-- >0;){var v=t.strings[i],m=S.exec(v)[2],g=m.toLowerCase()+"$lit$",b=l.getAttribute(g).split(y);n.parts.push({type:"attribute",index:r,name:m,strings:b}),l.removeAttribute(g),i+=b.length-1}}"TEMPLATE"===l.tagName&&s(l)}else if(3===l.nodeType){var w=l.data;if(w.indexOf(d)>=0){for(var x=l.parentNode,P=w.split(y),C=P.length-1,A=0;A<C;A++)x.insertBefore(""===P[A]?_():document.createTextNode(P[A]),l),n.parts.push({type:"node",index:++r});""===P[C]?(x.insertBefore(_(),l),o.push(l)):l.data=P[C],i+=C}}else if(8===l.nodeType)if(l.data===d){var N=l.parentNode;null!==l.previousSibling&&r!==c||(r++,N.insertBefore(_(),l)),c=r,n.parts.push({type:"node",index:r}),null===l.nextSibling?l.data="":(o.push(l),r--),i++}else for(var T=-1;-1!==(T=l.data.indexOf(d,T+1));)n.parts.push({type:"node",index:-1})}};s(e);for(var a=0;a<o.length;a++){var u=o[a];u.parentNode.removeChild(u)}},g=function(t){return-1!==t.index},_=function(){return document.createComment("")},S=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F \x09\x0a\x0c\x0d"'>=\/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,b=function(){function t(t,e,n){this._parts=[],this.template=t,this.processor=e,this.options=n}var e=t.prototype;return e.update=function(t){var e=0,n=this._parts,r=Array.isArray(n),i=0;for(n=r?n:n[Symbol.iterator]();;){var o;if(r){if(i>=n.length)break;o=n[i++]}else{if((i=n.next()).done)break;o=i.value}void 0!==o&&o.setValue(t[e]),e++}var s=this._parts,a=Array.isArray(s),u=0;for(s=a?s:s[Symbol.iterator]();;){var c;if(a){if(u>=s.length)break;c=s[u++]}else{if((u=s.next()).done)break;c=u.value}void 0!==c&&c.commit()}},e._clone=function(){var t=this,e=l?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),n=this.template.parts,r=0,i=0,o=function(e){for(var s=document.createTreeWalker(e,133,null,!1),a=s.nextNode();r<n.length&&null!==a;){var u=n[r];if(g(u))if(i===u.index){if("node"===u.type){var c=t.processor.handleTextExpression(t.options);c.insertAfterNode(a.previousSibling),t._parts.push(c)}else{var l;(l=t._parts).push.apply(l,t.processor.handleAttributeExpressions(a,u.name,u.strings,t.options))}r++}else i++,"TEMPLATE"===a.nodeName&&o(a.content),a=s.nextNode();else t._parts.push(void 0),r++}};return o(e),l&&(document.adoptNode(e),customElements.upgrade(e)),e},t}(),w=function(){function t(t,e,n,r){this.strings=t,this.values=e,this.type=n,this.processor=r}var e=t.prototype;return e.getHTML=function(){for(var t=this.strings.length-1,e="",n=0;n<t;n++){var r=this.strings[n],i=S.exec(r);e+=i?r.substr(0,i.index)+i[1]+i[2]+"$lit$"+i[3]+d:r+v}return e+this.strings[t]},e.getTemplateElement=function(){var t=document.createElement("template");return t.innerHTML=this.getHTML(),t},t}(),x=function(t){return null===t||!("object"==typeof t||"function"==typeof t)},P=function(){function t(t,e,n){this.dirty=!0,this.element=t,this.name=e,this.strings=n,this.parts=[];for(var r=0;r<n.length-1;r++)this.parts[r]=this._createPart()}var e=t.prototype;return e._createPart=function(){return new C(this)},e._getValue=function(){for(var t=this.strings,e=t.length-1,n="",r=0;r<e;r++){n+=t[r];var i=this.parts[r];if(void 0!==i){var o=i.value;if(null!=o&&(Array.isArray(o)||"string"!=typeof o&&o[Symbol.iterator])){var s=o,a=Array.isArray(s),u=0;for(s=a?s:s[Symbol.iterator]();;){var c;if(a){if(u>=s.length)break;c=s[u++]}else{if((u=s.next()).done)break;c=u.value}n+="string"==typeof c?c:String(c)}}else n+="string"==typeof o?o:String(o)}}return n+=t[e]},e.commit=function(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))},t}(),C=function(){function t(t){this.value=void 0,this.committer=t}var e=t.prototype;return e.setValue=function(t){t===p||x(t)&&t===this.value||(this.value=t,c(t)||(this.committer.dirty=!0))},e.commit=function(){for(;c(this.value);){var t=this.value;this.value=p,t(this)}this.value!==p&&this.committer.commit()},t}(),A=function(){function t(t){this.value=void 0,this._pendingValue=void 0,this.options=t}var e=t.prototype;return e.appendInto=function(t){this.startNode=t.appendChild(_()),this.endNode=t.appendChild(_())},e.insertAfterNode=function(t){this.startNode=t,this.endNode=t.nextSibling},e.appendIntoPart=function(t){t._insert(this.startNode=_()),t._insert(this.endNode=_())},e.insertAfterPart=function(t){t._insert(this.startNode=_()),this.endNode=t.endNode,t.endNode=this.startNode},e.setValue=function(t){this._pendingValue=t},e.commit=function(){for(;c(this._pendingValue);){var t=this._pendingValue;this._pendingValue=p,t(this)}var e=this._pendingValue;e!==p&&(x(e)?e!==this.value&&this._commitText(e):e instanceof w?this._commitTemplateResult(e):e instanceof Node?this._commitNode(e):Array.isArray(e)||e[Symbol.iterator]?this._commitIterable(e):e===f?(this.value=f,this.clear()):this._commitText(e))},e._insert=function(t){this.endNode.parentNode.insertBefore(t,this.endNode)},e._commitNode=function(t){this.value!==t&&(this.clear(),this._insert(t),this.value=t)},e._commitText=function(t){var e=this.startNode.nextSibling;t=null==t?"":t,e===this.endNode.previousSibling&&3===e.nodeType?e.data=t:this._commitNode(document.createTextNode("string"==typeof t?t:String(t))),this.value=t},e._commitTemplateResult=function(t){var e=this.options.templateFactory(t);if(this.value instanceof b&&this.value.template===e)this.value.update(t.values);else{var n=new b(e,t.processor,this.options),r=n._clone();n.update(t.values),this._commitNode(r),this.value=n}},e._commitIterable=function(e){Array.isArray(this.value)||(this.value=[],this.clear());var n,r=this.value,i=0,o=e,s=Array.isArray(o),a=0;for(o=s?o:o[Symbol.iterator]();;){var u;if(s){if(a>=o.length)break;u=o[a++]}else{if((a=o.next()).done)break;u=a.value}var c=u;void 0===(n=r[i])&&(n=new t(this.options),r.push(n),0===i?n.appendIntoPart(this):n.insertAfterPart(r[i-1])),n.setValue(c),n.commit(),i++}i<r.length&&(r.length=i,this.clear(n&&n.endNode))},e.clear=function(t){void 0===t&&(t=this.startNode),h(this.startNode.parentNode,t.nextSibling,this.endNode)},t}(),N=function(){function t(t,e,n){if(this.value=void 0,this._pendingValue=void 0,2!==n.length||""!==n[0]||""!==n[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=n}var e=t.prototype;return e.setValue=function(t){this._pendingValue=t},e.commit=function(){for(;c(this._pendingValue);){var t=this._pendingValue;this._pendingValue=p,t(this)}if(this._pendingValue!==p){var e=!!this._pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)),this.value=e,this._pendingValue=p}},t}(),T=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.single=2===r.length&&""===r[0]&&""===r[1],i}r(e,t);var n=e.prototype;return n._createPart=function(){return new E(this)},n._getValue=function(){return this.single?this.parts[0].value:t.prototype._getValue.call(this)},n.commit=function(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())},e}(P),E=function(t){function e(){return t.apply(this,arguments)||this}return r(e,t),e}(C),k=!1;try{var V={get capture(){return k=!0,!1}};window.addEventListener("test",V,V),window.removeEventListener("test",V,V)}catch(t){}var j=function(){function t(t,e,n){var r=this;this.value=void 0,this._pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=n,this._boundHandleEvent=function(t){return r.handleEvent(t)}}var e=t.prototype;return e.setValue=function(t){this._pendingValue=t},e.commit=function(){for(;c(this._pendingValue);){var t=this._pendingValue;this._pendingValue=p,t(this)}if(this._pendingValue!==p){var e=this._pendingValue,n=this.value,r=null==e||null!=n&&(e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive);r&&this.element.removeEventListener(this.eventName,this._boundHandleEvent,this._options),null==e||null!=n&&!r||(this._options=O(e),this.element.addEventListener(this.eventName,this._boundHandleEvent,this._options)),this.value=e,this._pendingValue=p}},e.handleEvent=function(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)},t}(),O=function(t){return t&&(k?{capture:t.capture,passive:t.passive,once:t.once}:t.capture)},R=new(function(){function t(){}var e=t.prototype;return e.handleAttributeExpressions=function(t,e,n,r){var i=e[0];return"."===i?new T(t,e.slice(1),n).parts:"@"===i?[new j(t,e.slice(1),r.eventContext)]:"?"===i?[new N(t,e.slice(1),n)]:new P(t,e,n).parts},e.handleTextExpression=function(t){return new A(t)},t}());function M(t){var e=U.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},U.set(t.type,e));var n=e.stringsArray.get(t.strings);if(void 0!==n)return n;var r=t.strings.join(d);return void 0===(n=e.keyString.get(r))&&(n=new m(t,t.getTemplateElement()),e.keyString.set(r,n)),e.stringsArray.set(t.strings,n),n}var U=new Map,z=new WeakMap;(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.0.0");var F=133;function L(t,e){for(var n=t.element.content,r=t.parts,i=document.createTreeWalker(n,F,null,!1),o=q(r),s=r[o],a=-1,u=0,c=[],l=null;i.nextNode();){a++;var h=i.currentNode;for(h.previousSibling===l&&(l=null),e.has(h)&&(c.push(h),null===l&&(l=h)),null!==l&&u++;void 0!==s&&s.index===a;)s.index=null!==l?-1:s.index-u,s=r[o=q(r,o)]}c.forEach(function(t){return t.parentNode.removeChild(t)})}var I=function(t){for(var e=11===t.nodeType?0:1,n=document.createTreeWalker(t,F,null,!1);n.nextNode();)e++;return e},q=function(t,e){void 0===e&&(e=-1);for(var n=e+1;n<t.length;n++){var r=t[n];if(g(r))return n}return-1};var $=function(t,e){return t+"--"+e},H=!0;void 0===window.ShadyCSS?H=!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."),H=!1);var B=function(t){return function(e){var n=$(e.type,t),r=U.get(n);void 0===r&&(r={stringsArray:new WeakMap,keyString:new Map},U.set(n,r));var i=r.stringsArray.get(e.strings);if(void 0!==i)return i;var o=e.strings.join(d);if(void 0===(i=r.keyString.get(o))){var s=e.getTemplateElement();H&&window.ShadyCSS.prepareTemplateDom(s,t),i=new m(e,s),r.keyString.set(o,i)}return r.stringsArray.set(e.strings,i),i}},W=["html","svg"],J=new Set,D=function(t,e,n){J.add(n);var r=t.querySelectorAll("style");if(0!==r.length){for(var i=document.createElement("style"),o=0;o<r.length;o++){var s=r[o];s.parentNode.removeChild(s),i.textContent+=s.textContent}if(function(t){W.forEach(function(e){var n=U.get($(e,t));void 0!==n&&n.keyString.forEach(function(t){var e=t.element.content,n=new Set;Array.from(e.querySelectorAll("style")).forEach(function(t){n.add(t)}),L(t,n)})})}(n),function(t,e,n){void 0===n&&(n=null);var r=t.element.content,i=t.parts;if(null!=n)for(var o=document.createTreeWalker(r,F,null,!1),s=q(i),a=0,u=-1;o.nextNode();)for(u++,o.currentNode===n&&(a=I(e),n.parentNode.insertBefore(e,n));-1!==s&&i[s].index===u;){if(a>0){for(;-1!==s;)i[s].index+=a,s=q(i,s);return}s=q(i,s)}else r.appendChild(e)}(e,i,e.element.content.firstChild),window.ShadyCSS.prepareTemplateStyles(e.element,n),window.ShadyCSS.nativeShadow){var a=e.element.content.querySelector("style");t.insertBefore(a.cloneNode(!0),t.firstChild)}else{e.element.content.insertBefore(i,e.element.content.firstChild);var u=new Set;u.add(i),L(e,u)}}else window.ShadyCSS.prepareTemplateStyles(e.element,n)};Function.prototype.$asyncbind=function t(e,n){function r(){return i.apply(e,arguments)}Function.prototype.$asyncbind||Object.defineProperty(Function.prototype,"$asyncbind",{value:t,enumerable:!1,configurable:!0,writable:!0}),t.trampoline||(t.trampoline=function(t,e,n,r,i){return function o(s){for(;s;){if(s.then)return s=s.then(o,r),i?void 0:s;try{if(s.pop){if(s.length)return s.pop()?e.call(t):s;s=n}else s=s.call(t)}catch(t){return r(t)}}}}),t.LazyThenable||(t.LazyThenable=function(){function t(t){return t&&t instanceof Object&&"function"==typeof t.then}function e(n,r,i){try{var o=i?i(r):r;if(n===o)return n.reject(new TypeError("Promise resolution loop"));t(o)?o.then(function(t){e(n,t)},function(t){n.reject(t)}):n.resolve(o)}catch(t){n.reject(t)}}function n(){}function r(){}function i(n,i){var o=new r;try{this._resolver(function(r){return t(r)?r.then(n,i):e(o,r,n)},function(t){e(o,t,i)})}catch(t){e(o,t,i)}return o}function o(t){this._resolver=t,this.then=i}return r.prototype={resolve:n,reject:n,then:function(t,e){this.resolve=t,this.reject=e}},o.resolve=function(t){return o.isThenable(t)?t:{then:function(e){return e(t)}}},o.isThenable=t,o}(),t.EagerThenable=t.Thenable=(t.EagerThenableFactory=function(t){t=t||"object"==typeof process&&process.nextTick||"function"==typeof setImmediate&&setImmediate||function(t){setTimeout(t,0)};var e=function(){var e=[],n=0,r=1024;function i(){for(;e.length-n;){try{e[n]()}catch(t){}e[n++]=void 0,n===r&&(e.splice(0,r),n=0)}}return function(r){e.push(r),e.length-n==1&&t(i)}}();function n(t){if(t){var e=this;t(function(t){e.resolve(t)},function(t){e.reject(t)})}}function r(t,e){if("function"==typeof t.y)try{var n=t.y.call(void 0,e);t.p.resolve(n)}catch(e){t.p.reject(e)}else t.p.resolve(e)}function i(t,e){if("function"==typeof t.n)try{var n=t.n.call(void 0,e);t.p.resolve(n)}catch(e){t.p.reject(e)}else t.p.reject(e)}return n.prototype={resolve:function(t){if(void 0===this.state){if(t===this)return this.reject(new TypeError("Attempt to resolve promise with self"));var n=this;if(t&&("function"==typeof t||"object"==typeof t))try{var i=0,o=t.then;if("function"==typeof o)return void o.call(t,function(t){i++||n.resolve(t)},function(t){i++||n.reject(t)})}catch(t){return void(i||this.reject(t))}this.state=r,this.v=t,n.c&&e(function(){for(var e=0,i=n.c.length;e<i;e++)r(n.c[e],t)})}},reject:function(t){if(void 0===this.state){this.state=i,this.v=t;var n=this.c;n&&e(function(){for(var e=0,r=n.length;e<r;e++)i(n[e],t)})}},then:function(t,r){var i=new n,o={y:t,n:r,p:i};if(void 0===this.state)this.c?this.c.push(o):this.c=[o];else{var s=this.state,a=this.v;e(function(){s(o,a)})}return i}},n.resolve=function(t){if(t&&t instanceof n)return t;var e=new n;return e.resolve(t),e},n.reject=function(t){if(t&&t instanceof n)return t;var e=new n;return e.reject(t),e},n.version="2.3.3-nodent",n})());var i=this;switch(n){case!0:return new t.Thenable(r);case 0:return new t.LazyThenable(r);case void 0:return r.then=r,r;default:return function(){try{return i.apply(e,arguments)}catch(t){return n(t)}}}},window.JSCompiler_renameProperty=function(t){return t};var G={toAttribute:function(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute:function(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}},K=function(t,e){return e!==t&&(e==e||t==t)},Q={attribute:!0,type:String,converter:G,reflect:!1,hasChanged:K},X=Promise.resolve(!0),Y=function(t){function e(){var e=t.call(this)||this;return e._updateState=0,e._instanceProperties=void 0,e._updatePromise=X,e._hasConnectedResolver=void 0,e._changedProperties=new Map,e._reflectingProperties=void 0,e.initialize(),e}r(e,t),e._ensureClassProperties=function(){var t=this;if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;var e=Object.getPrototypeOf(this)._classProperties;void 0!==e&&e.forEach(function(e,n){return t._classProperties.set(n,e)})}},e.createProperty=function(t,e){if(void 0===e&&(e=Q),this._ensureClassProperties(),this._classProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){var n="symbol"==typeof t?Symbol():"__"+t;Object.defineProperty(this.prototype,t,{get:function(){return this[n]},set:function(e){var r=this[t];this[n]=e,this.requestUpdate(t,r)},configurable:!0,enumerable:!0})}},e.finalize=function(){if(!this.hasOwnProperty(JSCompiler_renameProperty("finalized",this))||!this.finalized){var t=Object.getPrototypeOf(this);if("function"==typeof t.finalize&&t.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){var e=this.properties,n=[].concat(Object.getOwnPropertyNames(e),"function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]),r=Array.isArray(n),i=0;for(n=r?n:n[Symbol.iterator]();;){var o;if(r){if(i>=n.length)break;o=n[i++]}else{if((i=n.next()).done)break;o=i.value}var s=o;this.createProperty(s,e[s])}}}},e._attributeNameForProperty=function(t,e){var n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0},e._valueHasChanged=function(t,e,n){return void 0===n&&(n=K),n(t,e)},e._propertyValueFromAttribute=function(t,e){var n=e.type,r=e.converter||G,i="function"==typeof r?r:r.fromAttribute;return i?i(t,n):t},e._propertyValueToAttribute=function(t,e){if(void 0!==e.reflect){var n=e.type,r=e.converter;return(r&&r.toAttribute||G.toAttribute)(t,n)}};var i=e.prototype;return i.initialize=function(){this._saveInstanceProperties()},i._saveInstanceProperties=function(){var t=this;this.constructor._classProperties.forEach(function(e,n){if(t.hasOwnProperty(n)){var r=t[n];delete t[n],t._instanceProperties||(t._instanceProperties=new Map),t._instanceProperties.set(n,r)}})},i._applyInstanceProperties=function(){var t=this;this._instanceProperties.forEach(function(e,n){return t[n]=e}),this._instanceProperties=void 0},i.connectedCallback=function(){this._updateState=32|this._updateState,this._hasConnectedResolver?(this._hasConnectedResolver(),this._hasConnectedResolver=void 0):this.requestUpdate()},i.disconnectedCallback=function(){},i.attributeChangedCallback=function(t,e,n){e!==n&&this._attributeToProperty(t,n)},i._propertyToAttribute=function(t,e,n){void 0===n&&(n=Q);var r=this.constructor,i=r._attributeNameForProperty(t,n);if(void 0!==i){var o=r._propertyValueToAttribute(e,n);if(void 0===o)return;this._updateState=8|this._updateState,null==o?this.removeAttribute(i):this.setAttribute(i,o),this._updateState=-9&this._updateState}},i._attributeToProperty=function(t,e){if(!(8&this._updateState)){var n=this.constructor,r=n._attributeToPropertyMap.get(t);if(void 0!==r){var i=n._classProperties.get(r)||Q;this._updateState=16|this._updateState,this[r]=n._propertyValueFromAttribute(e,i),this._updateState=-17&this._updateState}}},i.requestUpdate=function(t,e){var n=!0;if(void 0!==t&&!this._changedProperties.has(t)){var r=this.constructor,i=r._classProperties.get(t)||Q;r._valueHasChanged(this[t],e,i.hasChanged)?(this._changedProperties.set(t,e),!0!==i.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,i))):n=!1}return!this._hasRequestedUpdate&&n&&this._enqueueUpdate(),this.updateComplete},i._enqueueUpdate=function(){return new Promise(function(t,e){var n,r,i,o;return n=this,this._updateState=4|this._updateState,i=this._updatePromise,this._updatePromise=new Promise(function(t){return r=t}),i.then(function(){if(!this._hasConnected)return new Promise(function(t){return n._hasConnectedResolver=t}).then(function(){return i.call(this)}.$asyncbind(this,e),e);function i(){if(null!=(o=this.performUpdate())&&"function"==typeof o.then)return o.then(function(){return n.call(this)}.$asyncbind(this,e),e);function n(){return r(!this._hasRequestedUpdate),t()}return n.call(this)}return i.call(this)}.$asyncbind(this,e),e)}.$asyncbind(this))},i.performUpdate=function(){if(this._instanceProperties&&this._applyInstanceProperties(),this.shouldUpdate(this._changedProperties)){var t=this._changedProperties;this.update(t),this._markUpdated(),1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(t)),this.updated(t)}else this._markUpdated()},i._markUpdated=function(){this._changedProperties=new Map,this._updateState=-5&this._updateState},i.shouldUpdate=function(){return!0},i.update=function(){var t=this;void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach(function(e,n){return t._propertyToAttribute(n,t[n],e)}),this._reflectingProperties=void 0)},i.updated=function(){},i.firstUpdated=function(){},n(e,[{key:"_hasConnected",get:function(){return 32&this._updateState}},{key:"_hasRequestedUpdate",get:function(){return 4&this._updateState}},{key:"hasUpdated",get:function(){return 1&this._updateState}},{key:"updateComplete",get:function(){return this._updatePromise}}],[{key:"observedAttributes",get:function(){var t=this;this.finalize();var e=[];return this._classProperties.forEach(function(n,r){var i=t._attributeNameForProperty(r,n);void 0!==i&&(t._attributeToPropertyMap.set(i,r),e.push(i))}),e}}]),e}(a(HTMLElement));Y.finalized=!0;var Z="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,tt=Symbol(),et=function(){function t(t,e){if(e!==tt)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}return t.prototype.toString=function(){return this.cssText},n(t,[{key:"styleSheet",get:function(){return void 0===this._styleSheet&&(Z?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}}]),t}(),nt=function(t){return new et(String(t),tt)};(window.litElementVersions||(window.litElementVersions=[])).push("2.0.1");var rt=function(t){return t.flat?t.flat(1/0):function t(e,n){void 0===n&&(n=[]);for(var r=0,i=e.length;r<i;r++){var o=e[r];Array.isArray(o)?t(o,n):n.push(o)}return n}(t)},it=function(t){function e(){return t.apply(this,arguments)||this}r(e,t),e.finalize=function(){t.finalize.call(this),this._styles=this.hasOwnProperty(JSCompiler_renameProperty("styles",this))?this._getUniqueStyles():this._styles||[]},e._getUniqueStyles=function(){var t=this.styles,e=[];Array.isArray(t)?rt(t).reduceRight(function(t,e){return t.add(e),t},new Set).forEach(function(t){return e.unshift(t)}):t&&e.push(t);return e};var n=e.prototype;return n.initialize=function(){t.prototype.initialize.call(this),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()},n.createRenderRoot=function(){return this.attachShadow({mode:"open"})},n.adoptStyles=function(){var t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?Z?this.renderRoot.adoptedStyleSheets=t.map(function(t){return t.styleSheet}):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map(function(t){return t.cssText}),this.localName))},n.connectedCallback=function(){t.prototype.connectedCallback.call(this),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)},n.update=function(e){var n=this;t.prototype.update.call(this,e);var r=this.render();r instanceof w&&this.constructor.render(r,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(function(t){var e=document.createElement("style");e.textContent=t.cssText,n.renderRoot.appendChild(e)}))},n.render=function(){},e}(Y);it.finalized=!0,it.render=function(t,e,n){var r=n.scopeName,i=z.has(e),o=e instanceof ShadowRoot&&H&&t instanceof w,s=o&&!J.has(r),a=s?document.createDocumentFragment():e;if(function(t,e,n){var r=z.get(e);void 0===r&&(h(e,e.firstChild),z.set(e,r=new A(Object.assign({templateFactory:M},n))),r.appendInto(e)),r.setValue(t),r.commit()}(t,a,Object.assign({templateFactory:B(r)},n)),s){var u=z.get(a);z.delete(a),u.value instanceof b&&D(a,u.value.template,r),h(e,e.firstChild),e.appendChild(a),z.set(e,u)}!i&&o&&window.ShadyCSS.styleElement(e.host)};var ot=function(t){function e(){return t.apply(this,arguments)||this}return r(e,t),n(e,null,[{key:"styles",get:function(){return nt(":focus{outline:none}:host{display:inline-block}:host,:host *{box-sizing:border-box;font-size:14px;font-size:var(--ts-font-size-default);line-height:20px;line-height:var(--ts-unit);font-family:Open Sans,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--ts-font-family);background:transparent;margin:0;padding:0}")}}]),e}(it);t.TSElement=ot,t.css=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i=n.reduce(function(e,n,r){return e+function(t){if(t instanceof et)return t.cssText;throw new Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.")}(n)+t[r+1]},t[0]);return new et(i,tt)},t.unsafeCSS=nt,t.html=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return new w(t,n,"html",R)},Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((t=t||self).ts=t.ts||{},t.ts.elements=t.ts.elements||{}))}(this,function(t){"use strict";function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function n(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t,e,n){return(s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&o(i,n.prototype),i}).apply(null,arguments)}function a(t){var e="function"==typeof Map?new Map:void 0;return(a=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return s(t,arguments,i(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),o(r,t)})(t)}var u=new WeakMap,c=function(t){return"function"==typeof t&&u.has(t)},l=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,h=function(t,e,n){void 0===n&&(n=null);for(var r=e;r!==n;){var i=r.nextSibling;t.removeChild(r),r=i}},p={},f={},d="{{lit-"+String(Math.random()).slice(2)+"}}",v="\x3c!--"+d+"--\x3e",y=new RegExp(d+"|"+v),m=function(t,e){var n=this;this.parts=[],this.element=e;var r=-1,i=0,o=[],s=function(e){for(var a=e.content,u=document.createTreeWalker(a,133,null,!1),c=0;u.nextNode();){r++;var l=u.currentNode;if(1===l.nodeType){if(l.hasAttributes()){for(var h=l.attributes,p=0,f=0;f<h.length;f++)h[f].value.indexOf(d)>=0&&p++;for(;p-- >0;){var v=t.strings[i],m=S.exec(v)[2],_=m.toLowerCase()+"$lit$",b=l.getAttribute(_).split(y);n.parts.push({type:"attribute",index:r,name:m,strings:b}),l.removeAttribute(_),i+=b.length-1}}"TEMPLATE"===l.tagName&&s(l)}else if(3===l.nodeType){var w=l.data;if(w.indexOf(d)>=0){for(var x=l.parentNode,P=w.split(y),C=P.length-1,A=0;A<C;A++)x.insertBefore(""===P[A]?g():document.createTextNode(P[A]),l),n.parts.push({type:"node",index:++r});""===P[C]?(x.insertBefore(g(),l),o.push(l)):l.data=P[C],i+=C}}else if(8===l.nodeType)if(l.data===d){var N=l.parentNode;null!==l.previousSibling&&r!==c||(r++,N.insertBefore(g(),l)),c=r,n.parts.push({type:"node",index:r}),null===l.nextSibling?l.data="":(o.push(l),r--),i++}else for(var T=-1;-1!==(T=l.data.indexOf(d,T+1));)n.parts.push({type:"node",index:-1})}};s(e);for(var a=0,u=o;a<u.length;a++){var c=u[a];c.parentNode.removeChild(c)}},_=function(t){return-1!==t.index},g=function(){return document.createComment("")},S=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F \x09\x0a\x0c\x0d"'>=\/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,b=function(){function t(t,e,n){this._parts=[],this.template=t,this.processor=e,this.options=n}var e=t.prototype;return e.update=function(t){var e=0,n=this._parts,r=Array.isArray(n),i=0;for(n=r?n:n[Symbol.iterator]();;){var o;if(r){if(i>=n.length)break;o=n[i++]}else{if((i=n.next()).done)break;o=i.value}void 0!==o&&o.setValue(t[e]),e++}var s=this._parts,a=Array.isArray(s),u=0;for(s=a?s:s[Symbol.iterator]();;){var c;if(a){if(u>=s.length)break;c=s[u++]}else{if((u=s.next()).done)break;c=u.value}void 0!==c&&c.commit()}},e._clone=function(){var t=this,e=l?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),n=this.template.parts,r=0,i=0,o=function(e){for(var s=document.createTreeWalker(e,133,null,!1),a=s.nextNode();r<n.length&&null!==a;){var u=n[r];if(_(u))if(i===u.index){if("node"===u.type){var c=t.processor.handleTextExpression(t.options);c.insertAfterNode(a.previousSibling),t._parts.push(c)}else{var l;(l=t._parts).push.apply(l,t.processor.handleAttributeExpressions(a,u.name,u.strings,t.options))}r++}else i++,"TEMPLATE"===a.nodeName&&o(a.content),a=s.nextNode();else t._parts.push(void 0),r++}};return o(e),l&&(document.adoptNode(e),customElements.upgrade(e)),e},t}(),w=function(){function t(t,e,n,r){this.strings=t,this.values=e,this.type=n,this.processor=r}var e=t.prototype;return e.getHTML=function(){for(var t=this.strings.length-1,e="",n=0;n<t;n++){var r=this.strings[n],i=S.exec(r);e+=i?r.substr(0,i.index)+i[1]+i[2]+"$lit$"+i[3]+d:r+v}return e+this.strings[t]},e.getTemplateElement=function(){var t=document.createElement("template");return t.innerHTML=this.getHTML(),t},t}(),x=function(t){return null===t||!("object"==typeof t||"function"==typeof t)},P=function(){function t(t,e,n){this.dirty=!0,this.element=t,this.name=e,this.strings=n,this.parts=[];for(var r=0;r<n.length-1;r++)this.parts[r]=this._createPart()}var e=t.prototype;return e._createPart=function(){return new C(this)},e._getValue=function(){for(var t=this.strings,e=t.length-1,n="",r=0;r<e;r++){n+=t[r];var i=this.parts[r];if(void 0!==i){var o=i.value;if(null!=o&&(Array.isArray(o)||"string"!=typeof o&&o[Symbol.iterator])){var s=o,a=Array.isArray(s),u=0;for(s=a?s:s[Symbol.iterator]();;){var c;if(a){if(u>=s.length)break;c=s[u++]}else{if((u=s.next()).done)break;c=u.value}n+="string"==typeof c?c:String(c)}}else n+="string"==typeof o?o:String(o)}}return n+=t[e]},e.commit=function(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))},t}(),C=function(){function t(t){this.value=void 0,this.committer=t}var e=t.prototype;return e.setValue=function(t){t===p||x(t)&&t===this.value||(this.value=t,c(t)||(this.committer.dirty=!0))},e.commit=function(){for(;c(this.value);){var t=this.value;this.value=p,t(this)}this.value!==p&&this.committer.commit()},t}(),A=function(){function t(t){this.value=void 0,this._pendingValue=void 0,this.options=t}var e=t.prototype;return e.appendInto=function(t){this.startNode=t.appendChild(g()),this.endNode=t.appendChild(g())},e.insertAfterNode=function(t){this.startNode=t,this.endNode=t.nextSibling},e.appendIntoPart=function(t){t._insert(this.startNode=g()),t._insert(this.endNode=g())},e.insertAfterPart=function(t){t._insert(this.startNode=g()),this.endNode=t.endNode,t.endNode=this.startNode},e.setValue=function(t){this._pendingValue=t},e.commit=function(){for(;c(this._pendingValue);){var t=this._pendingValue;this._pendingValue=p,t(this)}var e=this._pendingValue;e!==p&&(x(e)?e!==this.value&&this._commitText(e):e instanceof w?this._commitTemplateResult(e):e instanceof Node?this._commitNode(e):Array.isArray(e)||e[Symbol.iterator]?this._commitIterable(e):e===f?(this.value=f,this.clear()):this._commitText(e))},e._insert=function(t){this.endNode.parentNode.insertBefore(t,this.endNode)},e._commitNode=function(t){this.value!==t&&(this.clear(),this._insert(t),this.value=t)},e._commitText=function(t){var e=this.startNode.nextSibling;t=null==t?"":t,e===this.endNode.previousSibling&&3===e.nodeType?e.data=t:this._commitNode(document.createTextNode("string"==typeof t?t:String(t))),this.value=t},e._commitTemplateResult=function(t){var e=this.options.templateFactory(t);if(this.value instanceof b&&this.value.template===e)this.value.update(t.values);else{var n=new b(e,t.processor,this.options),r=n._clone();n.update(t.values),this._commitNode(r),this.value=n}},e._commitIterable=function(e){Array.isArray(this.value)||(this.value=[],this.clear());var n,r=this.value,i=0,o=e,s=Array.isArray(o),a=0;for(o=s?o:o[Symbol.iterator]();;){var u;if(s){if(a>=o.length)break;u=o[a++]}else{if((a=o.next()).done)break;u=a.value}var c=u;void 0===(n=r[i])&&(n=new t(this.options),r.push(n),0===i?n.appendIntoPart(this):n.insertAfterPart(r[i-1])),n.setValue(c),n.commit(),i++}i<r.length&&(r.length=i,this.clear(n&&n.endNode))},e.clear=function(t){void 0===t&&(t=this.startNode),h(this.startNode.parentNode,t.nextSibling,this.endNode)},t}(),N=function(){function t(t,e,n){if(this.value=void 0,this._pendingValue=void 0,2!==n.length||""!==n[0]||""!==n[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=n}var e=t.prototype;return e.setValue=function(t){this._pendingValue=t},e.commit=function(){for(;c(this._pendingValue);){var t=this._pendingValue;this._pendingValue=p,t(this)}if(this._pendingValue!==p){var e=!!this._pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)),this.value=e,this._pendingValue=p}},t}(),T=function(t){function e(e,n,r){var i=t.call(this,e,n,r)||this;return i.single=2===r.length&&""===r[0]&&""===r[1],i}r(e,t);var n=e.prototype;return n._createPart=function(){return new E(this)},n._getValue=function(){return this.single?this.parts[0].value:t.prototype._getValue.call(this)},n.commit=function(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())},e}(P),E=function(t){function e(){return t.apply(this,arguments)||this}return r(e,t),e}(C),k=!1;try{var V={get capture(){return k=!0,!1}};window.addEventListener("test",V,V),window.removeEventListener("test",V,V)}catch(t){}var j=function(){function t(t,e,n){var r=this;this.value=void 0,this._pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=n,this._boundHandleEvent=function(t){return r.handleEvent(t)}}var e=t.prototype;return e.setValue=function(t){this._pendingValue=t},e.commit=function(){for(;c(this._pendingValue);){var t=this._pendingValue;this._pendingValue=p,t(this)}if(this._pendingValue!==p){var e=this._pendingValue,n=this.value,r=null==e||null!=n&&(e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive);r&&this.element.removeEventListener(this.eventName,this._boundHandleEvent,this._options),null==e||null!=n&&!r||(this._options=O(e),this.element.addEventListener(this.eventName,this._boundHandleEvent,this._options)),this.value=e,this._pendingValue=p}},e.handleEvent=function(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)},t}(),O=function(t){return t&&(k?{capture:t.capture,passive:t.passive,once:t.once}:t.capture)},R=new(function(){function t(){}var e=t.prototype;return e.handleAttributeExpressions=function(t,e,n,r){var i=e[0];return"."===i?new T(t,e.slice(1),n).parts:"@"===i?[new j(t,e.slice(1),r.eventContext)]:"?"===i?[new N(t,e.slice(1),n)]:new P(t,e,n).parts},e.handleTextExpression=function(t){return new A(t)},t}());function M(t){var e=U.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},U.set(t.type,e));var n=e.stringsArray.get(t.strings);if(void 0!==n)return n;var r=t.strings.join(d);return void 0===(n=e.keyString.get(r))&&(n=new m(t,t.getTemplateElement()),e.keyString.set(r,n)),e.stringsArray.set(t.strings,n),n}var U=new Map,z=new WeakMap;(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.0.0");var F=133;function $(t,e){for(var n=t.element.content,r=t.parts,i=document.createTreeWalker(n,F,null,!1),o=L(r),s=r[o],a=-1,u=0,c=[],l=null;i.nextNode();){a++;var h=i.currentNode;for(h.previousSibling===l&&(l=null),e.has(h)&&(c.push(h),null===l&&(l=h)),null!==l&&u++;void 0!==s&&s.index===a;)s.index=null!==l?-1:s.index-u,s=r[o=L(r,o)]}c.forEach(function(t){return t.parentNode.removeChild(t)})}var q=function(t){for(var e=11===t.nodeType?0:1,n=document.createTreeWalker(t,F,null,!1);n.nextNode();)e++;return e},L=function(t,e){void 0===e&&(e=-1);for(var n=e+1;n<t.length;n++){var r=t[n];if(_(r))return n}return-1};var I=function(t,e){return t+"--"+e},H=!0;void 0===window.ShadyCSS?H=!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."),H=!1);var B=function(t){return function(e){var n=I(e.type,t),r=U.get(n);void 0===r&&(r={stringsArray:new WeakMap,keyString:new Map},U.set(n,r));var i=r.stringsArray.get(e.strings);if(void 0!==i)return i;var o=e.strings.join(d);if(void 0===(i=r.keyString.get(o))){var s=e.getTemplateElement();H&&window.ShadyCSS.prepareTemplateDom(s,t),i=new m(e,s),r.keyString.set(o,i)}return r.stringsArray.set(e.strings,i),i}},W=["html","svg"],J=new Set,D=function(t,e,n){J.add(n);var r=t.querySelectorAll("style");if(0!==r.length){for(var i=document.createElement("style"),o=0;o<r.length;o++){var s=r[o];s.parentNode.removeChild(s),i.textContent+=s.textContent}if(function(t){W.forEach(function(e){var n=U.get(I(e,t));void 0!==n&&n.keyString.forEach(function(t){var e=t.element.content,n=new Set;Array.from(e.querySelectorAll("style")).forEach(function(t){n.add(t)}),$(t,n)})})}(n),function(t,e,n){void 0===n&&(n=null);var r=t.element.content,i=t.parts;if(null!=n)for(var o=document.createTreeWalker(r,F,null,!1),s=L(i),a=0,u=-1;o.nextNode();)for(u++,o.currentNode===n&&(a=q(e),n.parentNode.insertBefore(e,n));-1!==s&&i[s].index===u;){if(a>0){for(;-1!==s;)i[s].index+=a,s=L(i,s);return}s=L(i,s)}else r.appendChild(e)}(e,i,e.element.content.firstChild),window.ShadyCSS.prepareTemplateStyles(e.element,n),window.ShadyCSS.nativeShadow){var a=e.element.content.querySelector("style");t.insertBefore(a.cloneNode(!0),t.firstChild)}else{e.element.content.insertBefore(i,e.element.content.firstChild);var u=new Set;u.add(i),$(e,u)}}else window.ShadyCSS.prepareTemplateStyles(e.element,n)};Function.prototype.$asyncbind=function t(e,n){function r(){return i.apply(e,arguments)}Function.prototype.$asyncbind||Object.defineProperty(Function.prototype,"$asyncbind",{value:t,enumerable:!1,configurable:!0,writable:!0}),t.trampoline||(t.trampoline=function(t,e,n,r,i){return function o(s){for(;s;){if(s.then)return s=s.then(o,r),i?void 0:s;try{if(s.pop){if(s.length)return s.pop()?e.call(t):s;s=n}else s=s.call(t)}catch(t){return r(t)}}}}),t.LazyThenable||(t.LazyThenable=function(){function t(t){return t&&t instanceof Object&&"function"==typeof t.then}function e(n,r,i){try{var o=i?i(r):r;if(n===o)return n.reject(new TypeError("Promise resolution loop"));t(o)?o.then(function(t){e(n,t)},function(t){n.reject(t)}):n.resolve(o)}catch(t){n.reject(t)}}function n(){}function r(){}function i(n,i){var o=new r;try{this._resolver(function(r){return t(r)?r.then(n,i):e(o,r,n)},function(t){e(o,t,i)})}catch(t){e(o,t,i)}return o}function o(t){this._resolver=t,this.then=i}return r.prototype={resolve:n,reject:n,then:function(t,e){this.resolve=t,this.reject=e}},o.resolve=function(t){return o.isThenable(t)?t:{then:function(e){return e(t)}}},o.isThenable=t,o}(),t.EagerThenable=t.Thenable=(t.EagerThenableFactory=function(t){t=t||"object"==typeof process&&process.nextTick||"function"==typeof setImmediate&&setImmediate||function(t){setTimeout(t,0)};var e=function(){var e=[],n=0,r=1024;function i(){for(;e.length-n;){try{e[n]()}catch(t){}e[n++]=void 0,n===r&&(e.splice(0,r),n=0)}}return function(r){e.push(r),e.length-n==1&&t(i)}}();function n(t){if(t){var e=this;t(function(t){e.resolve(t)},function(t){e.reject(t)})}}function r(t,e){if("function"==typeof t.y)try{var n=t.y.call(void 0,e);t.p.resolve(n)}catch(e){t.p.reject(e)}else t.p.resolve(e)}function i(t,e){if("function"==typeof t.n)try{var n=t.n.call(void 0,e);t.p.resolve(n)}catch(e){t.p.reject(e)}else t.p.reject(e)}return n.prototype={resolve:function(t){if(void 0===this.state){if(t===this)return this.reject(new TypeError("Attempt to resolve promise with self"));var n=this;if(t&&("function"==typeof t||"object"==typeof t))try{var i=0,o=t.then;if("function"==typeof o)return void o.call(t,function(t){i++||n.resolve(t)},function(t){i++||n.reject(t)})}catch(t){return void(i||this.reject(t))}this.state=r,this.v=t,n.c&&e(function(){for(var e=0,i=n.c.length;e<i;e++)r(n.c[e],t)})}},reject:function(t){if(void 0===this.state){this.state=i,this.v=t;var n=this.c;n&&e(function(){for(var e=0,r=n.length;e<r;e++)i(n[e],t)})}},then:function(t,r){var i=new n,o={y:t,n:r,p:i};if(void 0===this.state)this.c?this.c.push(o):this.c=[o];else{var s=this.state,a=this.v;e(function(){s(o,a)})}return i}},n.resolve=function(t){if(t&&t instanceof n)return t;var e=new n;return e.resolve(t),e},n.reject=function(t){if(t&&t instanceof n)return t;var e=new n;return e.reject(t),e},n.version="2.3.3-nodent",n})());var i=this;switch(n){case!0:return new t.Thenable(r);case 0:return new t.LazyThenable(r);case void 0:return r.then=r,r;default:return function(){try{return i.apply(e,arguments)}catch(t){return n(t)}}}},window.JSCompiler_renameProperty=function(t){return t};var G={toAttribute:function(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute:function(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}},K=function(t,e){return e!==t&&(e==e||t==t)},Q={attribute:!0,type:String,converter:G,reflect:!1,hasChanged:K},X=Promise.resolve(!0),Y=function(t){function e(){var e=t.call(this)||this;return e._updateState=0,e._instanceProperties=void 0,e._updatePromise=X,e._hasConnectedResolver=void 0,e._changedProperties=new Map,e._reflectingProperties=void 0,e.initialize(),e}r(e,t),e._ensureClassProperties=function(){var t=this;if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;var e=Object.getPrototypeOf(this)._classProperties;void 0!==e&&e.forEach(function(e,n){return t._classProperties.set(n,e)})}},e.createProperty=function(t,e){if(void 0===e&&(e=Q),this._ensureClassProperties(),this._classProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){var n="symbol"==typeof t?Symbol():"__"+t;Object.defineProperty(this.prototype,t,{get:function(){return this[n]},set:function(e){var r=this[t];this[n]=e,this._requestUpdate(t,r)},configurable:!0,enumerable:!0})}},e.finalize=function(){if(!this.hasOwnProperty(JSCompiler_renameProperty("finalized",this))||!this.finalized){var t=Object.getPrototypeOf(this);if("function"==typeof t.finalize&&t.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){var e=this.properties,n=[].concat(Object.getOwnPropertyNames(e),"function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]),r=Array.isArray(n),i=0;for(n=r?n:n[Symbol.iterator]();;){var o;if(r){if(i>=n.length)break;o=n[i++]}else{if((i=n.next()).done)break;o=i.value}var s=o;this.createProperty(s,e[s])}}}},e._attributeNameForProperty=function(t,e){var n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0},e._valueHasChanged=function(t,e,n){return void 0===n&&(n=K),n(t,e)},e._propertyValueFromAttribute=function(t,e){var n=e.type,r=e.converter||G,i="function"==typeof r?r:r.fromAttribute;return i?i(t,n):t},e._propertyValueToAttribute=function(t,e){if(void 0!==e.reflect){var n=e.type,r=e.converter;return(r&&r.toAttribute||G.toAttribute)(t,n)}};var i=e.prototype;return i.initialize=function(){this._saveInstanceProperties(),this._requestUpdate()},i._saveInstanceProperties=function(){var t=this;this.constructor._classProperties.forEach(function(e,n){if(t.hasOwnProperty(n)){var r=t[n];delete t[n],t._instanceProperties||(t._instanceProperties=new Map),t._instanceProperties.set(n,r)}})},i._applyInstanceProperties=function(){var t=this;this._instanceProperties.forEach(function(e,n){return t[n]=e}),this._instanceProperties=void 0},i.connectedCallback=function(){this._updateState=32|this._updateState,this._hasConnectedResolver&&(this._hasConnectedResolver(),this._hasConnectedResolver=void 0)},i.disconnectedCallback=function(){},i.attributeChangedCallback=function(t,e,n){e!==n&&this._attributeToProperty(t,n)},i._propertyToAttribute=function(t,e,n){void 0===n&&(n=Q);var r=this.constructor,i=r._attributeNameForProperty(t,n);if(void 0!==i){var o=r._propertyValueToAttribute(e,n);if(void 0===o)return;this._updateState=8|this._updateState,null==o?this.removeAttribute(i):this.setAttribute(i,o),this._updateState=-9&this._updateState}},i._attributeToProperty=function(t,e){if(!(8&this._updateState)){var n=this.constructor,r=n._attributeToPropertyMap.get(t);if(void 0!==r){var i=n._classProperties.get(r)||Q;this._updateState=16|this._updateState,this[r]=n._propertyValueFromAttribute(e,i),this._updateState=-17&this._updateState}}},i._requestUpdate=function(t,e){var n=!0;if(void 0!==t){var r=this.constructor,i=r._classProperties.get(t)||Q;r._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))):n=!1}!this._hasRequestedUpdate&&n&&this._enqueueUpdate()},i.requestUpdate=function(t,e){return this._requestUpdate(t,e),this.updateComplete},i._enqueueUpdate=function(){return new Promise(function(t,e){var n,r,i,o,s;n=this,this._updateState=4|this._updateState,o=this._updatePromise,this._updatePromise=new Promise(function(t,e){r=t,i=e});var a=function(){if(!this._hasConnected)return new Promise(function(t){return n._hasConnectedResolver=t}).then(function(){return o.call(this)}.$asyncbind(this,e),e);function o(){var n=function(){return r(!this._hasRequestedUpdate),t()}.$asyncbind(this,e),o=function(t){return i(t),n()}.$asyncbind(this,e);try{return null!=(s=this.performUpdate())?s.then(function(){return function(){return n()}.call(this)}.$asyncbind(this,o),o):function(){return n()}.call(this)}catch(t){o(t)}}return o.call(this)}.$asyncbind(this,e),u=function(){return a()}.$asyncbind(this,e);try{return o.then(function(){return a()}.$asyncbind(this,u),u)}catch(t){u(t)}}.$asyncbind(this))},i.performUpdate=function(){this._instanceProperties&&this._applyInstanceProperties();var t=!1,e=this._changedProperties;try{(t=this.shouldUpdate(e))&&this.update(e)}catch(e){throw t=!1,e}finally{this._markUpdated()}t&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(e)),this.updated(e))},i._markUpdated=function(){this._changedProperties=new Map,this._updateState=-5&this._updateState},i.shouldUpdate=function(){return!0},i.update=function(){var t=this;void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach(function(e,n){return t._propertyToAttribute(n,t[n],e)}),this._reflectingProperties=void 0)},i.updated=function(){},i.firstUpdated=function(){},n(e,[{key:"_hasConnected",get:function(){return 32&this._updateState}},{key:"_hasRequestedUpdate",get:function(){return 4&this._updateState}},{key:"hasUpdated",get:function(){return 1&this._updateState}},{key:"updateComplete",get:function(){return this._updatePromise}}],[{key:"observedAttributes",get:function(){var t=this;this.finalize();var e=[];return this._classProperties.forEach(function(n,r){var i=t._attributeNameForProperty(r,n);void 0!==i&&(t._attributeToPropertyMap.set(i,r),e.push(i))}),e}}]),e}(a(HTMLElement));Y.finalized=!0;var Z="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,tt=Symbol(),et=function(){function t(t,e){if(e!==tt)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}return t.prototype.toString=function(){return this.cssText},n(t,[{key:"styleSheet",get:function(){return void 0===this._styleSheet&&(Z?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}}]),t}(),nt=function(t){return new et(String(t),tt)};(window.litElementVersions||(window.litElementVersions=[])).push("2.0.1");var rt=function(t){return t.flat?t.flat(1/0):function t(e,n){void 0===n&&(n=[]);for(var r=0,i=e.length;r<i;r++){var o=e[r];Array.isArray(o)?t(o,n):n.push(o)}return n}(t)},it=function(t){function e(){return t.apply(this,arguments)||this}r(e,t),e.finalize=function(){t.finalize.call(this),this._styles=this.hasOwnProperty(JSCompiler_renameProperty("styles",this))?this._getUniqueStyles():this._styles||[]},e._getUniqueStyles=function(){var t=this.styles,e=[];Array.isArray(t)?rt(t).reduceRight(function(t,e){return t.add(e),t},new Set).forEach(function(t){return e.unshift(t)}):t&&e.push(t);return e};var n=e.prototype;return n.initialize=function(){t.prototype.initialize.call(this),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()},n.createRenderRoot=function(){return this.attachShadow({mode:"open"})},n.adoptStyles=function(){var t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?Z?this.renderRoot.adoptedStyleSheets=t.map(function(t){return t.styleSheet}):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map(function(t){return t.cssText}),this.localName))},n.connectedCallback=function(){t.prototype.connectedCallback.call(this),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)},n.update=function(e){var n=this;t.prototype.update.call(this,e);var r=this.render();r instanceof w&&this.constructor.render(r,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(function(t){var e=document.createElement("style");e.textContent=t.cssText,n.renderRoot.appendChild(e)}))},n.render=function(){},e}(Y);it.finalized=!0,it.render=function(t,e,n){var r=n.scopeName,i=z.has(e),o=e instanceof ShadowRoot&&H&&t instanceof w,s=o&&!J.has(r),a=s?document.createDocumentFragment():e;if(function(t,e,n){var r=z.get(e);void 0===r&&(h(e,e.firstChild),z.set(e,r=new A(Object.assign({templateFactory:M},n))),r.appendInto(e)),r.setValue(t),r.commit()}(t,a,Object.assign({templateFactory:B(r)},n)),s){var u=z.get(a);z.delete(a),u.value instanceof b&&D(a,u.value.template,r),h(e,e.firstChild),e.appendChild(a),z.set(e,u)}!i&&o&&window.ShadyCSS.styleElement(e.host)};var ot=function(t){function e(){return t.apply(this,arguments)||this}return r(e,t),n(e,null,[{key:"styles",get:function(){return nt(":focus{outline:none}:host{display:inline-block}:host,:host *{box-sizing:border-box;font-size:14px;font-size:var(--ts-font-size-default);line-height:20px;line-height:var(--ts-unit);font-family:Open Sans,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;font-family:var(--ts-font-family);background:transparent;margin:0;padding:0}")}}]),e}(it);t.TSElement=ot,t.css=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i=n.reduce(function(e,n,r){return e+function(t){if(t instanceof et)return t.cssText;throw new Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.")}(n)+t[r+1]},t[0]);return new et(i,tt)},t.html=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return new w(t,n,"html",R)},t.unsafeCSS=nt,Object.defineProperty(t,"__esModule",{value:!0})}); |
{ | ||
"name": "@tradeshift/elements", | ||
"version": "0.1.5", | ||
"version": "0.2.2", | ||
"src": "src/core.js", | ||
@@ -11,3 +11,3 @@ "main": "lib/core.cjs.js", | ||
], | ||
"gitHead": "5f9b1b04b0112904c38076978b4c78fff7781527" | ||
"gitHead": "e231a94943618177d98483e8012f23aca72bf77b" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
522685
275
1