Socket
Socket
Sign inDemoInstall

@neuronet.io/vido

Package Overview
Dependencies
Maintainers
1
Versions
212
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neuronet.io/vido - npm Package Compare versions

Comparing version 4.1.4 to 4.1.5

95

dist/StyleMap.js
import { Directive, directive } from 'lit-html/directive.js';
import { noChange } from 'lit-html';
const elements = new WeakMap();
class _StyleMap extends Directive {

@@ -19,3 +20,2 @@ update(part, params) {

this.execute = this.execute.bind(this);
this.updateStyle = this.updateStyle.bind(this);
this.schedule = options.schedule;

@@ -46,57 +46,78 @@ }

}
updateStyle(elementStyle, currentElementStyles, styleParts) {
for (const part of styleParts) {
if (!part)
continue;
let [name, value] = part.split(':');
name = name.trim().toLowerCase();
value = value.trim().toLowerCase();
if (name)
currentElementStyles[name] = value;
updateStyle(elementStyle, currentElementStyles, style) {
const previous = style.previousStyle;
for (const name of currentElementStyles) {
if (this.style[name] === undefined) {
if (!style.toRemove.includes(name))
style.toRemove.push(name);
}
}
for (const name in currentElementStyles) {
if (!name)
for (const name in previous) {
if (!(name in this.style))
continue;
const camelCase = name
.split('-')
.map((p, i) => (i > 0 ? (p.length >= 2 ? p[0].toUpperCase() + p.substring(1) : '') : p))
.join();
if (this.style[name] === undefined && this.style[camelCase] === undefined) {
if (!name.includes('-')) {
delete elementStyle[name];
}
else {
elementStyle.removeProperty(name);
}
// @ts-ignore
if (this.style[name] === undefined && currentElementStyles.includes(name)) {
if (!style.toRemove.includes(name))
style.toRemove.push(name);
}
}
for (let name in this.style) {
if (!name)
for (const name in this.style) {
if (!(name in this.style))
continue;
const value = this.style[name].toLowerCase().trim();
name = name.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, '-$&').toLowerCase();
if (currentElementStyles[name] === value) {
const value = this.style[name];
const prev = previous[name];
if (prev !== undefined && prev === value && currentElementStyles.includes(name)) {
continue;
}
if (!name.includes('-')) {
elementStyle[name] = value;
style.toUpdate.push(name);
}
if (style.toRemove.length || style.toUpdate.length) {
for (const name of style.toRemove) {
elementStyle.removeProperty(name);
if (elementStyle[name])
delete elementStyle[name];
}
else {
elementStyle.setProperty(name, value);
for (const name of style.toUpdate) {
const value = this.style[name];
if (!name.includes('-')) {
elementStyle[name] = value;
}
else {
elementStyle.setProperty(name, value);
}
}
style.previousStyle = Object.assign({}, this.style);
}
}
execute(part) {
const elementStyle = part.element.style;
let currentElementStyles = {};
const styleParts = elementStyle.cssText.split(';');
const element = part.element;
let style;
if (!elements.has(element)) {
style = {
toUpdate: [],
toRemove: [],
previousStyle: {},
};
elements.set(element, style);
}
else {
style = elements.get(element);
}
style.toRemove.length = 0;
style.toUpdate.length = 0;
const elementStyle = element.style;
const currentElementStyles = element.style.cssText
.split(';')
.map((item) => item.substr(0, item.indexOf(':')).trim())
.filter((item) => !!item);
if (this.schedule) {
requestAnimationFrame(() => {
this.updateStyle(elementStyle, currentElementStyles, styleParts);
this.updateStyle(elementStyle, currentElementStyles, style);
});
}
else {
this.updateStyle(elementStyle, currentElementStyles, styleParts);
this.updateStyle(elementStyle, currentElementStyles, style);
}
elements.set(element, style);
}
}

@@ -148,2 +148,3 @@ /**

const elements = new WeakMap();
class _StyleMap extends i$4 {

@@ -165,3 +166,2 @@ update(part, params) {

this.execute = this.execute.bind(this);
this.updateStyle = this.updateStyle.bind(this);
this.schedule = options.schedule;

@@ -192,56 +192,77 @@ }

}
updateStyle(elementStyle, currentElementStyles, styleParts) {
for (const part of styleParts) {
if (!part)
continue;
let [name, value] = part.split(':');
name = name.trim().toLowerCase();
value = value.trim().toLowerCase();
if (name)
currentElementStyles[name] = value;
updateStyle(elementStyle, currentElementStyles, style) {
const previous = style.previousStyle;
for (const name of currentElementStyles) {
if (this.style[name] === undefined) {
if (!style.toRemove.includes(name))
style.toRemove.push(name);
}
}
for (const name in currentElementStyles) {
if (!name)
for (const name in previous) {
if (!(name in this.style))
continue;
const camelCase = name
.split('-')
.map((p, i) => (i > 0 ? (p.length >= 2 ? p[0].toUpperCase() + p.substring(1) : '') : p))
.join();
if (this.style[name] === undefined && this.style[camelCase] === undefined) {
if (!name.includes('-')) {
delete elementStyle[name];
}
else {
elementStyle.removeProperty(name);
}
// @ts-ignore
if (this.style[name] === undefined && currentElementStyles.includes(name)) {
if (!style.toRemove.includes(name))
style.toRemove.push(name);
}
}
for (let name in this.style) {
if (!name)
for (const name in this.style) {
if (!(name in this.style))
continue;
const value = this.style[name].toLowerCase().trim();
name = name.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, '-$&').toLowerCase();
if (currentElementStyles[name] === value) {
const value = this.style[name];
const prev = previous[name];
if (prev !== undefined && prev === value && currentElementStyles.includes(name)) {
continue;
}
if (!name.includes('-')) {
elementStyle[name] = value;
style.toUpdate.push(name);
}
if (style.toRemove.length || style.toUpdate.length) {
for (const name of style.toRemove) {
elementStyle.removeProperty(name);
if (elementStyle[name])
delete elementStyle[name];
}
else {
elementStyle.setProperty(name, value);
for (const name of style.toUpdate) {
const value = this.style[name];
if (!name.includes('-')) {
elementStyle[name] = value;
}
else {
elementStyle.setProperty(name, value);
}
}
style.previousStyle = Object.assign({}, this.style);
}
}
execute(part) {
const elementStyle = part.element.style;
let currentElementStyles = {};
const styleParts = elementStyle.cssText.split(';');
const element = part.element;
let style;
if (!elements.has(element)) {
style = {
toUpdate: [],
toRemove: [],
previousStyle: {},
};
elements.set(element, style);
}
else {
style = elements.get(element);
}
style.toRemove.length = 0;
style.toUpdate.length = 0;
const elementStyle = element.style;
const currentElementStyles = element.style.cssText
.split(';')
.map((item) => item.substr(0, item.indexOf(':')).trim())
.filter((item) => !!item);
if (this.schedule) {
requestAnimationFrame(() => {
this.updateStyle(elementStyle, currentElementStyles, styleParts);
this.updateStyle(elementStyle, currentElementStyles, style);
});
}
else {
this.updateStyle(elementStyle, currentElementStyles, styleParts);
this.updateStyle(elementStyle, currentElementStyles, style);
}
elements.set(element, style);
}

@@ -248,0 +269,0 @@ }

@@ -6,3 +6,3 @@ /**

*/
var t;const e=globalThis.trustedTypes,s=e?e.createPolicy("lit-html",{createHTML:t=>t}):void 0,n=`lit$${(Math.random()+"").slice(9)}$`,i="?"+n,o=`<${i}>`,r=document,h=(t="")=>r.createComment(t),l=t=>null===t||"object"!=typeof t&&"function"!=typeof t,c=Array.isArray,a=t=>{var e;return c(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])},d=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,u=/-->/g,p=/>/g,v=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,m=/'/g,y=/"/g,f=/^(?:script|style|textarea)$/i,g=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),$=g(1),A=g(2),_=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),x=new WeakMap,C=(t,e,s)=>{var n,i;const o=null!==(n=null==s?void 0:s.renderBefore)&&void 0!==n?n:e;let r=o._$litPart$;if(void 0===r){const t=null!==(i=null==s?void 0:s.renderBefore)&&void 0!==i?i:null;o._$litPart$=r=new P(e.insertBefore(h(),t),t,void 0,null!=s?s:{})}return r._$AI(t),r},w=r.createTreeWalker(r,129,null,!1),E=(t,e)=>{const i=t.length-1,r=[];let h,l=2===e?"<svg>":"",c=d;for(let e=0;e<i;e++){const s=t[e];let i,a,g=-1,$=0;for(;$<s.length&&(c.lastIndex=$,a=c.exec(s),null!==a);)$=c.lastIndex,c===d?"!--"===a[1]?c=u:void 0!==a[1]?c=p:void 0!==a[2]?(f.test(a[2])&&(h=RegExp("</"+a[2],"g")),c=v):void 0!==a[3]&&(c=v):c===v?">"===a[0]?(c=null!=h?h:d,g=-1):void 0===a[1]?g=-2:(g=c.lastIndex-a[2].length,i=a[1],c=void 0===a[3]?v:'"'===a[3]?y:m):c===y||c===m?c=v:c===u||c===p?c=d:(c=v,h=void 0);const A=c===v&&t[e+1].startsWith("/>")?" ":"";l+=c===d?s+o:g>=0?(r.push(i),s.slice(0,g)+"$lit$"+s.slice(g)+n+A):s+n+(-2===g?(r.push(void 0),e):A)}const a=l+(t[i]||"<?>")+(2===e?"</svg>":"");return[void 0!==s?s.createHTML(a):a,r]};class I{constructor({strings:t,_$litType$:s},o){let r;this.parts=[];let l=0,c=0;const a=t.length-1,d=this.parts,[u,p]=E(t,s);if(this.el=I.createElement(u,o),w.currentNode=this.el.content,2===s){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(r=w.nextNode())&&d.length<a;){if(1===r.nodeType){if(r.hasAttributes()){const t=[];for(const e of r.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(n)){const s=p[c++];if(t.push(e),void 0!==s){const t=r.getAttribute(s.toLowerCase()+"$lit$").split(n),e=/([.?@])?(.*)/.exec(s);d.push({type:1,index:l,name:e[2],strings:t,ctor:"."===e[1]?X:"?"===e[1]?H:"@"===e[1]?S:Y})}else d.push({type:6,index:l})}for(const e of t)r.removeAttribute(e)}if(f.test(r.tagName)){const t=r.textContent.split(n),s=t.length-1;if(s>0){r.textContent=e?e.emptyScript:"";for(let e=0;e<s;e++)r.append(t[e],h()),w.nextNode(),d.push({type:2,index:++l});r.append(t[s],h())}}}else if(8===r.nodeType)if(r.data===i)d.push({type:2,index:l});else{let t=-1;for(;-1!==(t=r.data.indexOf(n,t+1));)d.push({type:7,index:l}),t+=n.length-1}l++}}static createElement(t,e){const s=r.createElement("template");return s.innerHTML=t,s}}function T(t,e,s=t,n){var i,o,r,h;if(e===_)return e;let c=void 0!==n?null===(i=s._$Cl)||void 0===i?void 0:i[n]:s._$Cu;const a=l(e)?void 0:e._$litDirective$;return(null==c?void 0:c.constructor)!==a&&(null===(o=null==c?void 0:c._$AO)||void 0===o||o.call(c,!1),void 0===a?c=void 0:(c=new a(t),c._$AT(t,s,n)),void 0!==n?(null!==(r=(h=s)._$Cl)&&void 0!==r?r:h._$Cl=[])[n]=c:s._$Cu=c),void 0!==c&&(e=T(t,c._$AS(t,e.values),c,n)),e}class M{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:s},parts:n}=this._$AD,i=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:r).importNode(s,!0);w.currentNode=i;let o=w.nextNode(),h=0,l=0,c=n[0];for(;void 0!==c;){if(h===c.index){let e;2===c.type?e=new P(o,o.nextSibling,this,t):1===c.type?e=new c.ctor(o,c.name,c.strings,this,t):6===c.type&&(e=new L(o,this,t)),this.v.push(e),c=n[++l]}h!==(null==c?void 0:c.index)&&(o=w.nextNode(),h++)}return i}m(t){let e=0;for(const s of this.v)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class P{constructor(t,e,s,n){var i;this.type=2,this._$AH=b,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cg=null===(i=null==n?void 0:n.isConnected)||void 0===i||i}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=T(this,t,e),l(t)?t===b||null==t||""===t?(this._$AH!==b&&this._$AR(),this._$AH=b):t!==this._$AH&&t!==_&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.S(t):a(t)?this.M(t):this.$(t)}A(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}S(t){this._$AH!==t&&(this._$AR(),this._$AH=this.A(t))}$(t){this._$AH!==b&&l(this._$AH)?this._$AA.nextSibling.data=t:this.S(r.createTextNode(t)),this._$AH=t}T(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=I.createElement(n.h,this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.m(s);else{const t=new M(i,this),e=t.p(this.options);t.m(s),this.S(e),this._$AH=t}}_$AC(t){let e=x.get(t.strings);return void 0===e&&x.set(t.strings,e=new I(t)),e}M(t){c(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new P(this.A(h()),this.A(h()),this,this.options)):s=e[n],s._$AI(i),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cg=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class Y{constructor(t,e,s,n,i){this.type=1,this._$AH=b,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=i,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=b}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let o=!1;if(void 0===i)t=T(this,t,e,0),o=!l(t)||t!==this._$AH&&t!==_,o&&(this._$AH=t);else{const n=t;let r,h;for(t=i[0],r=0;r<i.length-1;r++)h=T(this,n[s+r],e,r),h===_&&(h=this._$AH[r]),o||(o=!l(h)||h!==this._$AH[r]),h===b?t=b:t!==b&&(t+=(null!=h?h:"")+i[r+1]),this._$AH[r]=h}o&&!n&&this.k(t)}k(t){t===b?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class X extends Y{constructor(){super(...arguments),this.type=3}k(t){this.element[this.name]=t===b?void 0:t}}class H extends Y{constructor(){super(...arguments),this.type=4}k(t){t&&t!==b?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)}}class S extends Y{constructor(t,e,s,n,i){super(t,e,s,n,i),this.type=5}_$AI(t,e=this){var s;if((t=null!==(s=T(this,t,e,0))&&void 0!==s?s:b)===_)return;const n=this._$AH,i=t===b&&n!==b||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,o=t!==b&&(n===b||i);i&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t)}}class L{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){T(this,t)}}const N={P:"$lit$",V:n,L:i,I:1,N:E,R:M,D:a,j:T,H:P,O:Y,F:H,B:S,W:X,Z:L},U=window.litHtmlPolyfillSupport;null==U||U(I,P),(null!==(t=globalThis.litHtmlVersions)&&void 0!==t?t:globalThis.litHtmlVersions=[]).push("2.0.1");var B=Object.freeze({__proto__:null,_$LH:N,html:$,noChange:_,nothing:b,render:C,svg:A});
var t;const e=globalThis.trustedTypes,s=e?e.createPolicy("lit-html",{createHTML:t=>t}):void 0,n=`lit$${(Math.random()+"").slice(9)}$`,i="?"+n,o=`<${i}>`,r=document,h=(t="")=>r.createComment(t),l=t=>null===t||"object"!=typeof t&&"function"!=typeof t,c=Array.isArray,a=t=>{var e;return c(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])},d=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,u=/-->/g,p=/>/g,v=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,y=/'/g,m=/"/g,f=/^(?:script|style|textarea)$/i,g=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),$=g(1),A=g(2),_=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),x=new WeakMap,C=(t,e,s)=>{var n,i;const o=null!==(n=null==s?void 0:s.renderBefore)&&void 0!==n?n:e;let r=o._$litPart$;if(void 0===r){const t=null!==(i=null==s?void 0:s.renderBefore)&&void 0!==i?i:null;o._$litPart$=r=new P(e.insertBefore(h(),t),t,void 0,null!=s?s:{})}return r._$AI(t),r},w=r.createTreeWalker(r,129,null,!1),E=(t,e)=>{const i=t.length-1,r=[];let h,l=2===e?"<svg>":"",c=d;for(let e=0;e<i;e++){const s=t[e];let i,a,g=-1,$=0;for(;$<s.length&&(c.lastIndex=$,a=c.exec(s),null!==a);)$=c.lastIndex,c===d?"!--"===a[1]?c=u:void 0!==a[1]?c=p:void 0!==a[2]?(f.test(a[2])&&(h=RegExp("</"+a[2],"g")),c=v):void 0!==a[3]&&(c=v):c===v?">"===a[0]?(c=null!=h?h:d,g=-1):void 0===a[1]?g=-2:(g=c.lastIndex-a[2].length,i=a[1],c=void 0===a[3]?v:'"'===a[3]?m:y):c===m||c===y?c=v:c===u||c===p?c=d:(c=v,h=void 0);const A=c===v&&t[e+1].startsWith("/>")?" ":"";l+=c===d?s+o:g>=0?(r.push(i),s.slice(0,g)+"$lit$"+s.slice(g)+n+A):s+n+(-2===g?(r.push(void 0),e):A)}const a=l+(t[i]||"<?>")+(2===e?"</svg>":"");return[void 0!==s?s.createHTML(a):a,r]};class I{constructor({strings:t,_$litType$:s},o){let r;this.parts=[];let l=0,c=0;const a=t.length-1,d=this.parts,[u,p]=E(t,s);if(this.el=I.createElement(u,o),w.currentNode=this.el.content,2===s){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(r=w.nextNode())&&d.length<a;){if(1===r.nodeType){if(r.hasAttributes()){const t=[];for(const e of r.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(n)){const s=p[c++];if(t.push(e),void 0!==s){const t=r.getAttribute(s.toLowerCase()+"$lit$").split(n),e=/([.?@])?(.*)/.exec(s);d.push({type:1,index:l,name:e[2],strings:t,ctor:"."===e[1]?X:"?"===e[1]?H:"@"===e[1]?S:Y})}else d.push({type:6,index:l})}for(const e of t)r.removeAttribute(e)}if(f.test(r.tagName)){const t=r.textContent.split(n),s=t.length-1;if(s>0){r.textContent=e?e.emptyScript:"";for(let e=0;e<s;e++)r.append(t[e],h()),w.nextNode(),d.push({type:2,index:++l});r.append(t[s],h())}}}else if(8===r.nodeType)if(r.data===i)d.push({type:2,index:l});else{let t=-1;for(;-1!==(t=r.data.indexOf(n,t+1));)d.push({type:7,index:l}),t+=n.length-1}l++}}static createElement(t,e){const s=r.createElement("template");return s.innerHTML=t,s}}function T(t,e,s=t,n){var i,o,r,h;if(e===_)return e;let c=void 0!==n?null===(i=s._$Cl)||void 0===i?void 0:i[n]:s._$Cu;const a=l(e)?void 0:e._$litDirective$;return(null==c?void 0:c.constructor)!==a&&(null===(o=null==c?void 0:c._$AO)||void 0===o||o.call(c,!1),void 0===a?c=void 0:(c=new a(t),c._$AT(t,s,n)),void 0!==n?(null!==(r=(h=s)._$Cl)&&void 0!==r?r:h._$Cl=[])[n]=c:s._$Cu=c),void 0!==c&&(e=T(t,c._$AS(t,e.values),c,n)),e}class M{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:s},parts:n}=this._$AD,i=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:r).importNode(s,!0);w.currentNode=i;let o=w.nextNode(),h=0,l=0,c=n[0];for(;void 0!==c;){if(h===c.index){let e;2===c.type?e=new P(o,o.nextSibling,this,t):1===c.type?e=new c.ctor(o,c.name,c.strings,this,t):6===c.type&&(e=new N(o,this,t)),this.v.push(e),c=n[++l]}h!==(null==c?void 0:c.index)&&(o=w.nextNode(),h++)}return i}m(t){let e=0;for(const s of this.v)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class P{constructor(t,e,s,n){var i;this.type=2,this._$AH=b,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cg=null===(i=null==n?void 0:n.isConnected)||void 0===i||i}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=T(this,t,e),l(t)?t===b||null==t||""===t?(this._$AH!==b&&this._$AR(),this._$AH=b):t!==this._$AH&&t!==_&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.S(t):a(t)?this.M(t):this.$(t)}A(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}S(t){this._$AH!==t&&(this._$AR(),this._$AH=this.A(t))}$(t){this._$AH!==b&&l(this._$AH)?this._$AA.nextSibling.data=t:this.S(r.createTextNode(t)),this._$AH=t}T(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=I.createElement(n.h,this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.m(s);else{const t=new M(i,this),e=t.p(this.options);t.m(s),this.S(e),this._$AH=t}}_$AC(t){let e=x.get(t.strings);return void 0===e&&x.set(t.strings,e=new I(t)),e}M(t){c(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new P(this.A(h()),this.A(h()),this,this.options)):s=e[n],s._$AI(i),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cg=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class Y{constructor(t,e,s,n,i){this.type=1,this._$AH=b,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=i,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=b}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let o=!1;if(void 0===i)t=T(this,t,e,0),o=!l(t)||t!==this._$AH&&t!==_,o&&(this._$AH=t);else{const n=t;let r,h;for(t=i[0],r=0;r<i.length-1;r++)h=T(this,n[s+r],e,r),h===_&&(h=this._$AH[r]),o||(o=!l(h)||h!==this._$AH[r]),h===b?t=b:t!==b&&(t+=(null!=h?h:"")+i[r+1]),this._$AH[r]=h}o&&!n&&this.k(t)}k(t){t===b?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class X extends Y{constructor(){super(...arguments),this.type=3}k(t){this.element[this.name]=t===b?void 0:t}}class H extends Y{constructor(){super(...arguments),this.type=4}k(t){t&&t!==b?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)}}class S extends Y{constructor(t,e,s,n,i){super(t,e,s,n,i),this.type=5}_$AI(t,e=this){var s;if((t=null!==(s=T(this,t,e,0))&&void 0!==s?s:b)===_)return;const n=this._$AH,i=t===b&&n!==b||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,o=t!==b&&(n===b||i);i&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t)}}class N{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){T(this,t)}}const L={P:"$lit$",V:n,L:i,I:1,N:E,R:M,D:a,j:T,H:P,O:Y,F:H,B:S,W:X,Z:N},U=window.litHtmlPolyfillSupport;null==U||U(I,P),(null!==(t=globalThis.litHtmlVersions)&&void 0!==t?t:globalThis.litHtmlVersions=[]).push("2.0.1");var B=Object.freeze({__proto__:null,_$LH:L,html:$,noChange:_,nothing:b,render:C,svg:A});
/**

@@ -12,3 +12,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/const D={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},k=t=>(...e)=>({_$litDirective$:t,values:e});class O{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
*/const D={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},R=t=>(...e)=>({_$litDirective$:t,values:e});class k{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
/**

@@ -18,3 +18,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/const{H:R}=N,j=(t,e)=>{var s,n;return void 0===e?void 0!==(null===(s=t)||void 0===s?void 0:s._$litType$):(null===(n=t)||void 0===n?void 0:n._$litType$)===e},z=t=>void 0===t.strings,W=()=>document.createComment(""),F=(t,e,s)=>{var n;const i=t._$AA.parentNode,o=void 0===e?t._$AB:e._$AA;if(void 0===s){const e=i.insertBefore(W(),o),n=i.insertBefore(W(),o);s=new R(e,n,t,t.options)}else{const e=s._$AB.nextSibling,r=s._$AM,h=r!==t;if(h){let e;null===(n=s._$AQ)||void 0===n||n.call(s,t),s._$AM=t,void 0!==s._$AP&&(e=t._$AU)!==r._$AU&&s._$AP(e)}if(e!==o||h){let t=s._$AA;for(;t!==e;){const e=t.nextSibling;i.insertBefore(t,o),t=e}}}return s},V=(t,e,s=t)=>(t._$AI(e,s),t),G={},K=(t,e=G)=>t._$AH=e,Z=t=>t._$AH,q=t=>{var e;null===(e=t._$AP)||void 0===e||e.call(t,!1,!0);let s=t._$AA;const n=t._$AB.nextSibling;for(;s!==n;){const t=s.nextSibling;s.remove(),s=t}},J=t=>{t._$AR()},Q=(t,e)=>{var s,n;const i=t._$AN;if(void 0===i)return!1;for(const t of i)null===(n=(s=t)._$AO)||void 0===n||n.call(s,e,!1),Q(t,e);return!0},tt=t=>{let e,s;do{if(void 0===(e=t._$AM))break;s=e._$AN,s.delete(t),t=e}while(0===(null==s?void 0:s.size))},et=t=>{for(let e;e=t._$AM;t=e){let s=e._$AN;if(void 0===s)e._$AN=s=new Set;else if(s.has(t))break;s.add(t),it(e)}};
*/const{H:O}=L,W=(t,e)=>{var s,n;return void 0===e?void 0!==(null===(s=t)||void 0===s?void 0:s._$litType$):(null===(n=t)||void 0===n?void 0:n._$litType$)===e},j=t=>void 0===t.strings,z=()=>document.createComment(""),F=(t,e,s)=>{var n;const i=t._$AA.parentNode,o=void 0===e?t._$AB:e._$AA;if(void 0===s){const e=i.insertBefore(z(),o),n=i.insertBefore(z(),o);s=new O(e,n,t,t.options)}else{const e=s._$AB.nextSibling,r=s._$AM,h=r!==t;if(h){let e;null===(n=s._$AQ)||void 0===n||n.call(s,t),s._$AM=t,void 0!==s._$AP&&(e=t._$AU)!==r._$AU&&s._$AP(e)}if(e!==o||h){let t=s._$AA;for(;t!==e;){const e=t.nextSibling;i.insertBefore(t,o),t=e}}}return s},V=(t,e,s=t)=>(t._$AI(e,s),t),G={},K=(t,e=G)=>t._$AH=e,q=t=>t._$AH,Z=t=>{var e;null===(e=t._$AP)||void 0===e||e.call(t,!1,!0);let s=t._$AA;const n=t._$AB.nextSibling;for(;s!==n;){const t=s.nextSibling;s.remove(),s=t}},J=t=>{t._$AR()},Q=(t,e)=>{var s,n;const i=t._$AN;if(void 0===i)return!1;for(const t of i)null===(n=(s=t)._$AO)||void 0===n||n.call(s,e,!1),Q(t,e);return!0},tt=t=>{let e,s;do{if(void 0===(e=t._$AM))break;s=e._$AN,s.delete(t),t=e}while(0===(null==s?void 0:s.size))},et=t=>{for(let e;e=t._$AM;t=e){let s=e._$AN;if(void 0===s)e._$AN=s=new Set;else if(s.has(t))break;s.add(t),it(e)}};
/**

@@ -24,3 +24,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/function st(t){void 0!==this._$AN?(tt(this),this._$AM=t,et(this)):this._$AM=t}function nt(t,e=!1,s=0){const n=this._$AH,i=this._$AN;if(void 0!==i&&0!==i.size)if(e)if(Array.isArray(n))for(let t=s;t<n.length;t++)Q(n[t],!1),tt(n[t]);else null!=n&&(Q(n,!1),tt(n));else Q(this,t)}const it=t=>{var e,s,n,i;t.type==D.CHILD&&(null!==(e=(n=t)._$AP)&&void 0!==e||(n._$AP=nt),null!==(s=(i=t)._$AQ)&&void 0!==s||(i._$AQ=st))};class ot extends O{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),et(this),this.isConnected=t._$AU}_$AO(t,e=!0){var s,n;t!==this.isConnected&&(this.isConnected=t,t?null===(s=this.reconnected)||void 0===s||s.call(this):null===(n=this.disconnected)||void 0===n||n.call(this)),e&&(Q(this,t),tt(this))}setValue(t){if(z(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}
*/function st(t){void 0!==this._$AN?(tt(this),this._$AM=t,et(this)):this._$AM=t}function nt(t,e=!1,s=0){const n=this._$AH,i=this._$AN;if(void 0!==i&&0!==i.size)if(e)if(Array.isArray(n))for(let t=s;t<n.length;t++)Q(n[t],!1),tt(n[t]);else null!=n&&(Q(n,!1),tt(n));else Q(this,t)}const it=t=>{var e,s,n,i;t.type==D.CHILD&&(null!==(e=(n=t)._$AP)&&void 0!==e||(n._$AP=nt),null!==(s=(i=t)._$AQ)&&void 0!==s||(i._$AQ=st))};class ot extends k{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),et(this),this.isConnected=t._$AU}_$AO(t,e=!0){var s,n;t!==this.isConnected&&(this.isConnected=t,t?null===(s=this.reconnected)||void 0===s||s.call(this):null===(n=this.disconnected)||void 0===n||n.call(this)),e&&(Q(this,t),tt(this))}setValue(t){if(j(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}
/**

@@ -35,3 +35,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/class lt extends ot{constructor(){super(...arguments),this._$CG=new rt(this),this._$CK=new ht}render(t,e){return _}update(t,[e,s]){if(this.isConnected||this.disconnected(),e===this._$CJ)return;this._$CJ=e;let n=0;const{_$CG:i,_$CK:o}=this;return(async(t,e)=>{for await(const s of t)if(!1===await e(s))return})(e,(async t=>{for(;o.get();)await o.get();const r=i.deref();if(void 0!==r){if(r._$CJ!==e)return!1;void 0!==s&&(t=s(t,n)),r.commitValue(t,n),n++}return!0})),_}commitValue(t,e){this.setValue(t)}disconnected(){this._$CG.disconnect(),this._$CK.pause()}reconnected(){this._$CG.reconnect(this),this._$CK.resume()}}const ct=k(lt),at=k(class extends lt{constructor(t){if(super(t),t.type!==D.CHILD)throw Error("asyncAppend can only be used in child expressions")}update(t,e){return this._$CX=t,super.update(t,e)}commitValue(t,e){0===e&&J(this._$CX);const s=F(this._$CX);V(s,t)}}),dt=k(class extends O{constructor(t){super(t),this.tt=new WeakMap}render(t){return[t]}update(t,[e]){if(j(this.it)&&(!j(e)||this.it.strings!==e.strings)){const e=Z(t).pop();let s=this.tt.get(this.it.strings);if(void 0===s){const t=document.createDocumentFragment();s=C(b,t),s.setConnected(!1),this.tt.set(this.it.strings,s)}K(s,[e]),F(s,void 0,e)}if(j(e)){if(!j(this.it)||this.it.strings!==e.strings){const s=this.tt.get(e.strings);if(void 0!==s){const e=Z(s).pop();J(t),F(t,void 0,e),K(t,[e])}}this.it=e}else this.it=void 0;return this.render(e)}}),ut={},pt=k(class extends O{constructor(){super(...arguments),this.ot=ut}render(t,e){return e()}update(t,[e,s]){if(Array.isArray(e)){if(Array.isArray(this.ot)&&this.ot.length===e.length&&e.every(((t,e)=>t===this.ot[e])))return _}else if(this.ot===e)return _;return this.ot=Array.isArray(e)?Array.from(e):e,this.render(e,s)}}),vt=t=>null!=t?t:b
*/class lt extends ot{constructor(){super(...arguments),this._$CG=new rt(this),this._$CK=new ht}render(t,e){return _}update(t,[e,s]){if(this.isConnected||this.disconnected(),e===this._$CJ)return;this._$CJ=e;let n=0;const{_$CG:i,_$CK:o}=this;return(async(t,e)=>{for await(const s of t)if(!1===await e(s))return})(e,(async t=>{for(;o.get();)await o.get();const r=i.deref();if(void 0!==r){if(r._$CJ!==e)return!1;void 0!==s&&(t=s(t,n)),r.commitValue(t,n),n++}return!0})),_}commitValue(t,e){this.setValue(t)}disconnected(){this._$CG.disconnect(),this._$CK.pause()}reconnected(){this._$CG.reconnect(this),this._$CK.resume()}}const ct=R(lt),at=R(class extends lt{constructor(t){if(super(t),t.type!==D.CHILD)throw Error("asyncAppend can only be used in child expressions")}update(t,e){return this._$CX=t,super.update(t,e)}commitValue(t,e){0===e&&J(this._$CX);const s=F(this._$CX);V(s,t)}}),dt=R(class extends k{constructor(t){super(t),this.tt=new WeakMap}render(t){return[t]}update(t,[e]){if(W(this.it)&&(!W(e)||this.it.strings!==e.strings)){const e=q(t).pop();let s=this.tt.get(this.it.strings);if(void 0===s){const t=document.createDocumentFragment();s=C(b,t),s.setConnected(!1),this.tt.set(this.it.strings,s)}K(s,[e]),F(s,void 0,e)}if(W(e)){if(!W(this.it)||this.it.strings!==e.strings){const s=this.tt.get(e.strings);if(void 0!==s){const e=q(s).pop();J(t),F(t,void 0,e),K(t,[e])}}this.it=e}else this.it=void 0;return this.render(e)}}),ut={},pt=R(class extends k{constructor(){super(...arguments),this.ot=ut}render(t,e){return e()}update(t,[e,s]){if(Array.isArray(e)){if(Array.isArray(this.ot)&&this.ot.length===e.length&&e.every(((t,e)=>t===this.ot[e])))return _}else if(this.ot===e)return _;return this.ot=Array.isArray(e)?Array.from(e):e,this.render(e,s)}}),vt=t=>null!=t?t:b
/**

@@ -41,3 +41,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/,mt=(t,e,s)=>{const n=new Map;for(let i=e;i<=s;i++)n.set(t[i],i);return n},yt=k(class extends O{constructor(t){if(super(t),t.type!==D.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,s){let n;void 0===s?s=e:void 0!==e&&(n=e);const i=[],o=[];let r=0;for(const e of t)i[r]=n?n(e,r):r,o[r]=s(e,r),r++;return{values:o,keys:i}}render(t,e,s){return this.dt(t,e,s).values}update(t,[e,s,n]){var i;const o=Z(t),{values:r,keys:h}=this.dt(e,s,n);if(!Array.isArray(o))return this.ct=h,r;const l=null!==(i=this.ct)&&void 0!==i?i:this.ct=[],c=[];let a,d,u=0,p=o.length-1,v=0,m=r.length-1;for(;u<=p&&v<=m;)if(null===o[u])u++;else if(null===o[p])p--;else if(l[u]===h[v])c[v]=V(o[u],r[v]),u++,v++;else if(l[p]===h[m])c[m]=V(o[p],r[m]),p--,m--;else if(l[u]===h[m])c[m]=V(o[u],r[m]),F(t,c[m+1],o[u]),u++,m--;else if(l[p]===h[v])c[v]=V(o[p],r[v]),F(t,o[u],o[p]),p--,v++;else if(void 0===a&&(a=mt(h,v,m),d=mt(l,u,p)),a.has(l[u]))if(a.has(l[p])){const e=d.get(h[v]),s=void 0!==e?o[e]:null;if(null===s){const e=F(t,o[u]);V(e,r[v]),c[v]=e}else c[v]=V(s,r[v]),F(t,o[u],s),o[e]=null;v++}else q(o[p]),p--;else q(o[u]),u++;for(;v<=m;){const e=F(t,c[m+1]);V(e,r[v]),c[v++]=e}for(;u<=p;){const t=o[u++];null!==t&&q(t)}return this.ct=h,K(t,c),_}});
*/,yt=(t,e,s)=>{const n=new Map;for(let i=e;i<=s;i++)n.set(t[i],i);return n},mt=R(class extends k{constructor(t){if(super(t),t.type!==D.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,s){let n;void 0===s?s=e:void 0!==e&&(n=e);const i=[],o=[];let r=0;for(const e of t)i[r]=n?n(e,r):r,o[r]=s(e,r),r++;return{values:o,keys:i}}render(t,e,s){return this.dt(t,e,s).values}update(t,[e,s,n]){var i;const o=q(t),{values:r,keys:h}=this.dt(e,s,n);if(!Array.isArray(o))return this.ct=h,r;const l=null!==(i=this.ct)&&void 0!==i?i:this.ct=[],c=[];let a,d,u=0,p=o.length-1,v=0,y=r.length-1;for(;u<=p&&v<=y;)if(null===o[u])u++;else if(null===o[p])p--;else if(l[u]===h[v])c[v]=V(o[u],r[v]),u++,v++;else if(l[p]===h[y])c[y]=V(o[p],r[y]),p--,y--;else if(l[u]===h[y])c[y]=V(o[u],r[y]),F(t,c[y+1],o[u]),u++,y--;else if(l[p]===h[v])c[v]=V(o[p],r[v]),F(t,o[u],o[p]),p--,v++;else if(void 0===a&&(a=yt(h,v,y),d=yt(l,u,p)),a.has(l[u]))if(a.has(l[p])){const e=d.get(h[v]),s=void 0!==e?o[e]:null;if(null===s){const e=F(t,o[u]);V(e,r[v]),c[v]=e}else c[v]=V(s,r[v]),F(t,o[u],s),o[e]=null;v++}else Z(o[p]),p--;else Z(o[u]),u++;for(;v<=y;){const e=F(t,c[y+1]);V(e,r[v]),c[v++]=e}for(;u<=p;){const t=o[u++];null!==t&&Z(t)}return this.ct=h,K(t,c),_}});
/**

@@ -53,3 +53,3 @@ * @license

*/
class ft extends O{constructor(t){if(super(t),this.it=b,t.type!==D.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===b||null==t)return this.vt=void 0,this.it=t;if(t===_)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this.vt;this.it=t;const e=[t];return e.raw=e,this.vt={_$litType$:this.constructor.resultType,strings:e,values:[]}}}ft.directiveName="unsafeHTML",ft.resultType=1;const gt=k(ft),$t=t=>!(t=>null===t||"object"!=typeof t&&"function"!=typeof t)(t)&&"function"==typeof t.then;
class ft extends k{constructor(t){if(super(t),this.it=b,t.type!==D.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===b||null==t)return this.vt=void 0,this.it=t;if(t===_)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this.vt;this.it=t;const e=[t];return e.raw=e,this.vt={_$litType$:this.constructor.resultType,strings:e,values:[]}}}ft.directiveName="unsafeHTML",ft.resultType=1;const gt=R(ft),$t=t=>!(t=>null===t||"object"!=typeof t&&"function"!=typeof t)(t)&&"function"==typeof t.then;
/**

@@ -59,3 +59,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/const At=k(class extends ot{constructor(){super(...arguments),this._$Cft=1073741823,this._$Cwt=[],this._$CG=new rt(this),this._$CK=new ht}render(...t){var e;return null!==(e=t.find((t=>!$t(t))))&&void 0!==e?e:_}update(t,e){const s=this._$Cwt;let n=s.length;this._$Cwt=e;const i=this._$CG,o=this._$CK;this.isConnected||this.disconnected();for(let t=0;t<e.length&&!(t>this._$Cft);t++){const r=e[t];if(!$t(r))return this._$Cft=t,r;t<n&&r===s[t]||(this._$Cft=1073741823,n=0,Promise.resolve(r).then((async t=>{for(;o.get();)await o.get();const e=i.deref();if(void 0!==e){const s=e._$Cwt.indexOf(r);s>-1&&s<e._$Cft&&(e._$Cft=s,e.setValue(t))}})))}return _}disconnected(){this._$CG.disconnect(),this._$CK.pause()}reconnected(){this._$CG.reconnect(this),this._$CK.resume()}}),_t=k(class extends O{constructor(t){if(super(t),t.type!==D.PROPERTY&&t.type!==D.ATTRIBUTE&&t.type!==D.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!z(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===_||e===b)return e;const s=t.element,n=t.name;if(t.type===D.PROPERTY){if(e===s[n])return _}else if(t.type===D.BOOLEAN_ATTRIBUTE){if(!!e===s.hasAttribute(n))return _}else if(t.type===D.ATTRIBUTE&&s.getAttribute(n)===e+"")return _;return K(t),e}}),bt=new WeakMap;
*/const At=R(class extends ot{constructor(){super(...arguments),this._$Cft=1073741823,this._$Cwt=[],this._$CG=new rt(this),this._$CK=new ht}render(...t){var e;return null!==(e=t.find((t=>!$t(t))))&&void 0!==e?e:_}update(t,e){const s=this._$Cwt;let n=s.length;this._$Cwt=e;const i=this._$CG,o=this._$CK;this.isConnected||this.disconnected();for(let t=0;t<e.length&&!(t>this._$Cft);t++){const r=e[t];if(!$t(r))return this._$Cft=t,r;t<n&&r===s[t]||(this._$Cft=1073741823,n=0,Promise.resolve(r).then((async t=>{for(;o.get();)await o.get();const e=i.deref();if(void 0!==e){const s=e._$Cwt.indexOf(r);s>-1&&s<e._$Cft&&(e._$Cft=s,e.setValue(t))}})))}return _}disconnected(){this._$CG.disconnect(),this._$CK.pause()}reconnected(){this._$CG.reconnect(this),this._$CK.resume()}}),_t=R(class extends k{constructor(t){if(super(t),t.type!==D.PROPERTY&&t.type!==D.ATTRIBUTE&&t.type!==D.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!j(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===_||e===b)return e;const s=t.element,n=t.name;if(t.type===D.PROPERTY){if(e===s[n])return _}else if(t.type===D.BOOLEAN_ATTRIBUTE){if(!!e===s.hasAttribute(n))return _}else if(t.type===D.ATTRIBUTE&&s.getAttribute(n)===e+"")return _;return K(t),e}}),bt=new WeakMap;
/**

@@ -65,3 +65,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/const xt=k(class extends O{render(t){return b}update(t,e){if("boolean"!=typeof e[0])throw new Error("[vido] Detach directive argument should be a boolean.");let s=e[0];const n=t.element;if(s)bt.has(t)||bt.set(t,{element:n,nextSibling:n.nextSibling,previousSibling:n.previousSibling,parent:n.parentNode}),n.remove();else{const e=bt.get(t);e&&(e.nextSibling&&e.nextSibling.parentNode?e.nextSibling.parentNode.insertBefore(e.element,e.nextSibling):e.previousSibling&&e.previousSibling.parentNode?e.previousSibling.parentNode.appendChild(e.element):e.parent&&e.parent.appendChild(e.element),bt.delete(t))}return this.render(s)}}),Ct=k(class extends O{constructor(t){var e;if(super(t),t.type!==D.ATTRIBUTE||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,s)=>{const n=t[s];return null==n?e:e+`${s=s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`}),"")}update(t,[e]){const{style:s}=t.element;if(void 0===this.ut){this.ut=new Set;for(const t in e)this.ut.add(t);return this.render(e)}this.ut.forEach((t=>{null==e[t]&&(this.ut.delete(t),t.includes("-")?s.removeProperty(t):s[t]="")}));for(const t in e){const n=e[t];null!=n&&(this.ut.add(t),t.includes("-")?s.setProperty(t,n):s[t]=n)}return _}});
*/const xt=R(class extends k{render(t){return b}update(t,e){if("boolean"!=typeof e[0])throw new Error("[vido] Detach directive argument should be a boolean.");let s=e[0];const n=t.element;if(s)bt.has(t)||bt.set(t,{element:n,nextSibling:n.nextSibling,previousSibling:n.previousSibling,parent:n.parentNode}),n.remove();else{const e=bt.get(t);e&&(e.nextSibling&&e.nextSibling.parentNode?e.nextSibling.parentNode.insertBefore(e.element,e.nextSibling):e.previousSibling&&e.previousSibling.parentNode?e.previousSibling.parentNode.appendChild(e.element):e.parent&&e.parent.appendChild(e.element),bt.delete(t))}return this.render(s)}}),Ct=R(class extends k{constructor(t){var e;if(super(t),t.type!==D.ATTRIBUTE||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,s)=>{const n=t[s];return null==n?e:e+`${s=s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`}),"")}update(t,[e]){const{style:s}=t.element;if(void 0===this.ut){this.ut=new Set;for(const t in e)this.ut.add(t);return this.render(e)}this.ut.forEach((t=>{null==e[t]&&(this.ut.delete(t),t.includes("-")?s.removeProperty(t):s[t]="")}));for(const t in e){const n=e[t];null!=n&&(this.ut.add(t),t.includes("-")?s.setProperty(t,n):s[t]=n)}return _}}),wt=new WeakMap;
/**

@@ -71,3 +71,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/class wt extends O{update(t,e){return e[0].execute(t),_}render(t){return t.toString()}}class Et{constructor(t,e={schedule:!1}){this.schedule=!1,this.style=t,this._directive=k(wt),this.execute=this.execute.bind(this),this.updateStyle=this.updateStyle.bind(this),this.schedule=e.schedule}directive(){return this._directive(this)}setStyle(t){this.style=t}toString(){return Object.keys(this.style).reduce(((t,e)=>{const s=this.style[e];return null==s?t:t+`${e=e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}updateStyle(t,e,s){for(const t of s){if(!t)continue;let[s,n]=t.split(":");s=s.trim().toLowerCase(),n=n.trim().toLowerCase(),s&&(e[s]=n)}for(const s in e){if(!s)continue;const e=s.split("-").map(((t,e)=>e>0?t.length>=2?t[0].toUpperCase()+t.substring(1):"":t)).join();void 0===this.style[s]&&void 0===this.style[e]&&(s.includes("-")?t.removeProperty(s):delete t[s])}for(let s in this.style){if(!s)continue;const n=this.style[s].toLowerCase().trim();s=s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase(),e[s]!==n&&(s.includes("-")?t.setProperty(s,n):t[s]=n)}}execute(t){const e=t.element.style;let s={};const n=e.cssText.split(";");this.schedule?requestAnimationFrame((()=>{this.updateStyle(e,s,n)})):this.updateStyle(e,s,n)}}
*/class Et extends k{update(t,e){return e[0].execute(t),_}render(t){return t.toString()}}class It{constructor(t,e={schedule:!1}){this.schedule=!1,this.style=t,this._directive=R(Et),this.execute=this.execute.bind(this),this.schedule=e.schedule}directive(){return this._directive(this)}setStyle(t){this.style=t}toString(){return Object.keys(this.style).reduce(((t,e)=>{const s=this.style[e];return null==s?t:t+`${e=e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}updateStyle(t,e,s){const n=s.previousStyle;for(const t of e)void 0===this.style[t]&&(s.toRemove.includes(t)||s.toRemove.push(t));for(const t in n)t in this.style&&void 0===this.style[t]&&e.includes(t)&&(s.toRemove.includes(t)||s.toRemove.push(t));for(const t in this.style){if(!(t in this.style))continue;const i=this.style[t],o=n[t];void 0!==o&&o===i&&e.includes(t)||s.toUpdate.push(t)}if(s.toRemove.length||s.toUpdate.length){for(const e of s.toRemove)t.removeProperty(e),t[e]&&delete t[e];for(const e of s.toUpdate){const s=this.style[e];e.includes("-")?t.setProperty(e,s):t[e]=s}s.previousStyle=Object.assign({},this.style)}}execute(t){const e=t.element;let s;wt.has(e)?s=wt.get(e):(s={toUpdate:[],toRemove:[],previousStyle:{}},wt.set(e,s)),s.toRemove.length=0,s.toUpdate.length=0;const n=e.style,i=e.style.cssText.split(";").map((t=>t.substr(0,t.indexOf(":")).trim())).filter((t=>!!t));this.schedule?requestAnimationFrame((()=>{this.updateStyle(n,i,s)})):this.updateStyle(n,i,s),wt.set(e,s)}}
/**

@@ -77,3 +77,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/const It=k(class extends O{constructor(t){var e;if(super(t),t.type!==D.ATTRIBUTE||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){var s,n;if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.et=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!(null===(s=this.et)||void 0===s?void 0:s.has(t))&&this.st.add(t);return this.render(e)}const i=t.element.classList;this.st.forEach((t=>{t in e||(i.remove(t),this.st.delete(t))}));for(const t in e){const s=!!e[t];s===this.st.has(t)||(null===(n=this.et)||void 0===n?void 0:n.has(t))||(s?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return _}});class Tt{constructor(){this.isAction=!0}}Tt.prototype.isAction=!0;const Mt={element:document.createTextNode(""),axis:"xy",threshold:10,onDown(){},onMove(){},onUp(){},onWheel(){}},Pt="undefined"!=typeof PointerEvent;let Yt=0;class Xt extends Tt{constructor(t,e){super(),this.moving="",this.initialX=0,this.initialY=0,this.lastY=0,this.lastX=0,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onWheel=this.onWheel.bind(this),this.element=t,this.id=++Yt,this.options=Object.assign(Object.assign({},Mt),e.pointerOptions),Pt?(t.addEventListener("pointerdown",this.onPointerDown),document.addEventListener("pointermove",this.onPointerMove),document.addEventListener("pointerup",this.onPointerUp)):(t.addEventListener("touchstart",this.onPointerDown),document.addEventListener("touchmove",this.onPointerMove,{passive:!1}),document.addEventListener("touchend",this.onPointerUp),document.addEventListener("touchcancel",this.onPointerUp),t.addEventListener("mousedown",this.onPointerDown),document.addEventListener("mousemove",this.onPointerMove,{passive:!1}),document.addEventListener("mouseup",this.onPointerUp))}normalizeMouseWheelEvent(t){let e=t.deltaX||0,s=t.deltaY||0,n=t.deltaZ||0;const i=t.deltaMode,o=parseInt(getComputedStyle(t.target).getPropertyValue("line-height"));let r=1;switch(i){case 1:r=o;break;case 2:r=window.height}return e*=r,s*=r,n*=r,{x:e,y:s,z:n,event:t}}onWheel(t){const e=this.normalizeMouseWheelEvent(t);this.options.onWheel(e)}normalizePointerEvent(t){let e={x:0,y:0,pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0,event:t};switch(t.type){case"wheel":const s=this.normalizeMouseWheelEvent(t);e.x=s.x,e.y=s.y,e.pageX=e.x,e.pageY=e.y,e.screenX=e.x,e.screenY=e.y,e.clientX=e.x,e.clientY=e.y;break;case"touchstart":case"touchmove":case"touchend":case"touchcancel":e.x=t.changedTouches[0].screenX,e.y=t.changedTouches[0].screenY,e.pageX=t.changedTouches[0].pageX,e.pageY=t.changedTouches[0].pageY,e.screenX=t.changedTouches[0].screenX,e.screenY=t.changedTouches[0].screenY,e.clientX=t.changedTouches[0].clientX,e.clientY=t.changedTouches[0].clientY;break;default:e.x=t.x,e.y=t.y,e.pageX=t.pageX,e.pageY=t.pageY,e.screenX=t.screenX,e.screenY=t.screenY,e.clientX=t.clientX,e.clientY=t.clientY}return e}onPointerDown(t){if("mousedown"===t.type&&0!==t.button)return;this.moving="xy";const e=this.normalizePointerEvent(t);this.lastX=e.x,this.lastY=e.y,this.initialX=e.x,this.initialY=e.y,this.options.onDown(e)}handleX(t){let e=t.x-this.lastX;return this.lastY=t.y,this.lastX=t.x,e}handleY(t){let e=t.y-this.lastY;return this.lastY=t.y,this.lastX=t.x,e}onPointerMove(t){if(""===this.moving||"mousemove"===t.type&&0!==t.button)return;const e=this.normalizePointerEvent(t);if("x|y"===this.options.axis){let s=0,n=0;("x"===this.moving||"xy"===this.moving&&Math.abs(e.x-this.initialX)>this.options.threshold)&&(this.moving="x",s=this.handleX(e)),("y"===this.moving||"xy"===this.moving&&Math.abs(e.y-this.initialY)>this.options.threshold)&&(this.moving="y",n=this.handleY(e)),this.options.onMove({movementX:s,movementY:n,x:e.x,y:e.y,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t})}else if("xy"===this.options.axis){let s=0,n=0;Math.abs(e.x-this.initialX)>this.options.threshold&&(s=this.handleX(e)),Math.abs(e.y-this.initialY)>this.options.threshold&&(n=this.handleY(e)),this.options.onMove({movementX:s,movementY:n,x:e.x,y:e.y,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t})}else if("x"===this.options.axis)("x"===this.moving||"xy"===this.moving&&Math.abs(e.x-this.initialX)>this.options.threshold)&&(this.moving="x",this.options.onMove({movementX:this.handleX(e),movementY:0,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t}));else if("y"===this.options.axis){let s=0;("y"===this.moving||"xy"===this.moving&&Math.abs(e.y-this.initialY)>this.options.threshold)&&(this.moving="y",s=this.handleY(e)),this.options.onMove({movementX:0,movementY:s,x:e.x,y:e.y,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t})}}onPointerUp(t){this.moving="";const e=this.normalizePointerEvent(t);this.options.onUp({movementX:0,movementY:0,x:e.x,y:e.y,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t}),this.lastY=0,this.lastX=0}destroy(t){Pt?(t.removeEventListener("pointerdown",this.onPointerDown),document.removeEventListener("pointermove",this.onPointerMove),document.removeEventListener("pointerup",this.onPointerUp)):(t.removeEventListener("mousedown",this.onPointerDown),document.removeEventListener("mousemove",this.onPointerMove),document.removeEventListener("mouseup",this.onPointerUp),t.removeEventListener("touchstart",this.onPointerDown),document.removeEventListener("touchmove",this.onPointerMove),document.removeEventListener("touchend",this.onPointerUp),document.removeEventListener("touchcancel",this.onPointerUp))}}function Ht(t){let e=0;return function(s){e||(e=requestAnimationFrame((function(){e=0,t.apply(void 0,[s])})))}}function St(t){return t&&t.constructor?"Object"===t.constructor.name:"object"==typeof t&&null!==t}function Lt(t,...e){const s=e.shift();if(St(t)&&St(s))for(const e in s)if(St(s[e]))"function"==typeof s[e].clone?t[e]=s[e].clone():(void 0===t[e]&&(t[e]={}),t[e]=Lt(t[e],s[e]));else if(Array.isArray(s[e])){t[e]=new Array(s[e].length);let n=0;for(let i of s[e])St(i)?"function"==typeof i.clone?t[e][n]=i.clone():t[e][n]=Lt({},i):t[e][n]=i,n++}else t[e]=s[e];return e.length?Lt(t,...e):t}function Nt(t){if(void 0!==t.actions){const e=t.actions.map((t=>{const e=Object.assign({},t),s=Object.assign({},e.props);return delete s.state,delete s.api,delete e.element,e.props=s,e}));t.actions=e}return Lt({},t)}var Ut={mergeDeep:Lt,clone:Nt,schedule:Ht};class Bt{constructor(t,e){this.slotInstances={},this.destroyed=!1,this.vido=t,this.props=e,this.destroy=this.destroy.bind(this),this.change=this.change.bind(this),this.html=this.html.bind(this),this.getInstances=this.getInstances.bind(this),this.setComponents=this.setComponents.bind(this),this.vido.onDestroy((()=>{this.destroy()}))}setComponents(t){if(t&&!this.destroyed){for(const e in t){const s=t[e];void 0===this.slotInstances[e]&&(this.slotInstances[e]=[]);for(const t of this.slotInstances[e])t.destroy();this.slotInstances[e].length=0;for(const t of s)this.slotInstances[e].push(this.vido.createComponent(t,this.props))}this.vido.update()}}destroy(){if(!this.destroyed){for(const t in this.slotInstances){for(const e of this.slotInstances[t])e.destroy();this.slotInstances[t].length=0}this.destroyed=!0}}change(t,e){if(!this.destroyed)for(const s in this.slotInstances){const n=this.slotInstances[s];for(const s of n)s.change(t,e)}}getInstances(t){return this.destroyed?[]:void 0===t?this.slotInstances:this.slotInstances[t]}html(t,e){if(this.destroyed)return;if(!this.slotInstances[t]||0===this.slotInstances[t].length)return e;let s=e;for(const e of this.slotInstances[t])s=e.html(s);return s}getProps(){return this.props}isDestroyed(){return this.destroyed}}class Dt extends O{update(t,e){if("function"!=typeof e[0])throw new Error("[vido] GetElementDirective argument should be a function.");(0,e[0])(t.element)}render(){return b}}function kt(t,e){let s=0;const n=new Map;let i,o,r=new Map,h=0;const l=[],c=Promise.resolve(),a={},d=function(t){return class extends O{update(e,s){const n=e.element,i=s[0],o=s[1],r=s[2];for(const e of o)if(void 0!==e){let s;if(t.has(i))for(const o of t.get(i))if(o.componentAction.create===e&&o.element===n){s=o;break}if(s)s.props=r;else{void 0!==n.vido&&delete n.vido;const s={instance:i,componentAction:{create:e,update(){},destroy(){}},element:n,props:r};let o=[];t.has(i)&&(o=t.get(i)),o.push(s),t.set(i,o)}}}render(t,e,s){return b}}}(r);class u{constructor(t){this.instance=t}create(t,e){const s=k(d);return()=>s(this.instance,t,e)}}const p=function(t,e,s){return class{constructor(t,e,s={}){this.destroyed=!1,this.instance=t,this.name=e.name,this.vidoInstance=e,this.props=s,this.destroy=this.destroy.bind(this),this.update=this.update.bind(this),this.change=this.change.bind(this),this.html=this.html.bind(this)}destroy(){this.destroyed||(this.vidoInstance.debug&&(console.groupCollapsed(`destroying component ${this.instance}`),console.log(s({components:t.keys(),actionsByInstance:e})),console.trace(),console.groupEnd()),this.vidoInstance.destroyComponent(this.instance,this.vidoInstance),this.destroyed=!0)}update(n){return this.vidoInstance.debug&&(console.groupCollapsed(`updating component ${this.instance}`),console.log(s({components:t.keys(),actionsByInstance:e})),console.trace(),console.groupEnd()),this.vidoInstance.updateTemplate(n)}change(n,i={}){this.vidoInstance.debug&&(console.groupCollapsed(`changing component ${this.instance}`),console.log(s({props:this.props,newProps:n,components:t.keys(),actionsByInstance:e})),console.trace(),console.groupEnd());const o=t.get(this.instance);o&&o.change(n,i)}html(e={}){const s=t.get(this.instance);if(s&&!s.destroyed)return s.update(e,this.vidoInstance)}_getComponents(){return t}_getActions(){return e}}}(n,r,Nt),v=function(t,e,s){return class{constructor(t,e,s){this.destroyed=!1,this.instance=t,this.vidoInstance=e,this.renderFunction=s,this.destroy=this.destroy.bind(this),this.update=this.update.bind(this),this.change=this.change.bind(this)}destroy(){if(!this.destroyed){this.vidoInstance.debug&&(console.groupCollapsed(`component destroy method fired ${this.instance}`),console.log(s({props:this.vidoInstance.props,components:t.keys(),destroyable:this.vidoInstance.destroyable,actionsByInstance:e})),console.trace(),console.groupEnd()),this.content&&"function"==typeof this.content.destroy&&this.content.destroy();for(const t of this.vidoInstance.destroyable)t();this.vidoInstance.onChangeFunctions.length=0,this.vidoInstance.destroyable.length=0,this.vidoInstance.destroyed=!0,this.destroyed=!0,this.vidoInstance.update()}}update(n={}){return this.vidoInstance.debug&&(console.groupCollapsed(`component update method fired ${this.instance}`),console.log(s({components:t.keys(),actionsByInstance:e})),console.trace(),console.groupEnd()),this.renderFunction(n)}change(n,i={leave:!1}){const o=n;this.vidoInstance.debug&&(console.groupCollapsed(`component change method fired ${this.instance}`),console.log(s({props:o,components:t.keys(),onChangeFunctions:this.vidoInstance.onChangeFunctions,changedProps:n,actionsByInstance:e})),console.trace(),console.groupEnd());for(const t of this.vidoInstance.onChangeFunctions)t(n,i)}}}(n,r,Nt);class m{constructor(s="",i=""){this.instance="",this.name="",this.destroyable=[],this.destroyed=!1,this.onChangeFunctions=[],this.debug=!1,this.state=t,this.api=e,this.lastProps={},this.html=$,this.svg=A,this.directive=k,this.asyncAppend=at,this.asyncReplace=ct,this.cache=dt,this.classMap=It,this.styleMap=Ct,this.StyleMap=Et,this.guard=pt,this.live=_t,this.ifDefined=vt,this.repeat=yt,this.unsafeHTML=gt,this.until=At,this.schedule=Ht,this.getElement=k(Dt),this.actionsByInstance=()=>{},this.detach=xt,this.PointerAction=Xt,this.Action=Tt,this.Slots=Bt,this._components=n,this._actions=r,this.instance=s,this.reuseComponents=this.reuseComponents.bind(this),this.onDestroy=this.onDestroy.bind(this),this.onChange=this.onChange.bind(this),this.update=this.update.bind(this),this.destroyComponent=this.destroyComponent.bind(this);for(const t in a)this[t]=a[t].bind(this);this.name=i,this.Actions=new u(s)}static addMethod(t,e){a[t]=e}onDestroy(t){this.destroyable.push(t)}onChange(t){this.onChangeFunctions.push(t)}update(t){return this.updateTemplate(t)}reuseComponents(t,e,s,n,i=!0,o=!1){const r=[],h=t.length,l=e.length;let c=!1;!i||void 0!==e&&0!==e.length||(c=!0);let a=0;if(h<l){let i=l-h;for(;i;){const o=e[l-i],h=this.createComponent(n,s(o));t.push(h),r.push(h),i--}}else if(h>l){let e=h-l;for(i&&(c=!0,a=h-e);e;){const s=h-e;i||(r.push(t[s]),t[s].destroy()),e--}i||(t.length=l)}let d=0;o&&console.log("modified components",r),o&&console.log("current components",t),o&&console.log("data array",e);for(const n of t){const t=e[d];o&&console.log(`reuse components data at '${d}'`,t),n&&!r.includes(n)&&(o&&console.log("getProps fn result",s(t)),n.change(s(t),{leave:c&&d>=a})),d++}}createComponent(t,e={}){const i=t.name+":"+s++;let o;o=new m(i,t.name);const h=new p(i,o,e),l=new v(i,o,t(o,e));return n.set(i,l),n.get(i).change(e),o.debug&&(console.groupCollapsed(`component created ${i}`),console.log(Nt({props:e,components:n.keys(),actionsByInstance:r})),console.trace(),console.groupEnd()),h}destroyComponent(t,e){if(e.debug&&(console.groupCollapsed(`destroying component ${t}...`),console.log(Nt({components:n.keys(),actionsByInstance:r})),console.trace(),console.groupEnd()),r.has(t))for(const e of r.get(t))"function"==typeof e.componentAction.destroy&&e.componentAction.destroy(e.element,e.props);r.delete(t);const s=n.get(t);s?(s.destroy(),n.delete(t),e.debug&&(console.groupCollapsed(`component destroyed ${t}`),console.log(Nt({components:n.keys(),actionsByInstance:r})),console.trace(),console.groupEnd())):console.warn(`No component to destroy! [${t}]`)}executeActions(){for(const t of r.values()){for(const e of t)if(void 0===e.element.vido){const t=n.get(e.instance);e.isActive=function(){return t&&!1===t.destroyed};const s=e.componentAction,i=s.create;if(void 0!==i){let t;t=i.prototype&&(i.prototype.isAction||i.prototype.update||i.prototype.destroy)||i.isAction?new i(e.element,e.props):i(e.element,e.props),void 0!==t&&("function"==typeof t?s.destroy=t:("function"==typeof t.update&&(s.update=t.update.bind(t)),"function"==typeof t.destroy&&(s.destroy=t.destroy.bind(t))))}}else e.element.vido=e.props,"function"==typeof e.componentAction.update&&e.isActive()&&e.componentAction.update(e.element,e.props);for(const e of t)e.element.vido=e.props}}updateTemplate(t){return t&&l.push(t),new Promise((t=>{const e=++h,s=this;c.then((function(){if(e===h){h=0,s.render();for(const t of l)t();l.length=0,t(null)}}))}))}createApp(t){o=t.element;const e=this.createComponent(t.component,t.props);return i=e.instance,this.render(),e}render(){const t=n.get(i);t?(C(t.update(),o),this.executeActions()):o&&o.remove()}}return new m}kt.prototype.lithtml=B,kt.prototype.Action=Tt,kt.prototype.Directive=O,kt.prototype.schedule=Ht,kt.prototype.detach=xt,kt.prototype.styleMap=Ct,kt.prototype.classMap=It,kt.prototype.StyleMap=Et,kt.prototype.PointerAction=Xt,kt.prototype.asyncAppend=at,kt.prototype.asyncReplace=ct,kt.prototype.cache=dt,kt.prototype.guard=pt,kt.prototype.live=_t,kt.prototype.ifDefined=vt,kt.prototype.repeat=yt,kt.prototype.unsafeHTML=gt,kt.prototype.until=At,kt.prototype.Slots=Bt;const Ot=B;export{Tt as Action,O as Directive,D as PartType,Xt as PointerAction,Bt as Slots,Et as StyleMap,N as _$LH,at as asyncAppend,ct as asyncReplace,dt as cache,It as classMap,kt as default,xt as detach,k as directive,pt as guard,Ut as helpers,$ as html,vt as ifDefined,Ot as lit,B as lithtml,_ as noChange,b as nothing,C as render,yt as repeat,Ht as schedule,Ct as styleMap,A as svg,gt as unsafeHTML,At as until};
*/const Tt=R(class extends k{constructor(t){var e;if(super(t),t.type!==D.ATTRIBUTE||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){var s,n;if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.et=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!(null===(s=this.et)||void 0===s?void 0:s.has(t))&&this.st.add(t);return this.render(e)}const i=t.element.classList;this.st.forEach((t=>{t in e||(i.remove(t),this.st.delete(t))}));for(const t in e){const s=!!e[t];s===this.st.has(t)||(null===(n=this.et)||void 0===n?void 0:n.has(t))||(s?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return _}});class Mt{constructor(){this.isAction=!0}}Mt.prototype.isAction=!0;const Pt={element:document.createTextNode(""),axis:"xy",threshold:10,onDown(){},onMove(){},onUp(){},onWheel(){}},Yt="undefined"!=typeof PointerEvent;let Xt=0;class Ht extends Mt{constructor(t,e){super(),this.moving="",this.initialX=0,this.initialY=0,this.lastY=0,this.lastX=0,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onWheel=this.onWheel.bind(this),this.element=t,this.id=++Xt,this.options=Object.assign(Object.assign({},Pt),e.pointerOptions),Yt?(t.addEventListener("pointerdown",this.onPointerDown),document.addEventListener("pointermove",this.onPointerMove),document.addEventListener("pointerup",this.onPointerUp)):(t.addEventListener("touchstart",this.onPointerDown),document.addEventListener("touchmove",this.onPointerMove,{passive:!1}),document.addEventListener("touchend",this.onPointerUp),document.addEventListener("touchcancel",this.onPointerUp),t.addEventListener("mousedown",this.onPointerDown),document.addEventListener("mousemove",this.onPointerMove,{passive:!1}),document.addEventListener("mouseup",this.onPointerUp))}normalizeMouseWheelEvent(t){let e=t.deltaX||0,s=t.deltaY||0,n=t.deltaZ||0;const i=t.deltaMode,o=parseInt(getComputedStyle(t.target).getPropertyValue("line-height"));let r=1;switch(i){case 1:r=o;break;case 2:r=window.height}return e*=r,s*=r,n*=r,{x:e,y:s,z:n,event:t}}onWheel(t){const e=this.normalizeMouseWheelEvent(t);this.options.onWheel(e)}normalizePointerEvent(t){let e={x:0,y:0,pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0,event:t};switch(t.type){case"wheel":const s=this.normalizeMouseWheelEvent(t);e.x=s.x,e.y=s.y,e.pageX=e.x,e.pageY=e.y,e.screenX=e.x,e.screenY=e.y,e.clientX=e.x,e.clientY=e.y;break;case"touchstart":case"touchmove":case"touchend":case"touchcancel":e.x=t.changedTouches[0].screenX,e.y=t.changedTouches[0].screenY,e.pageX=t.changedTouches[0].pageX,e.pageY=t.changedTouches[0].pageY,e.screenX=t.changedTouches[0].screenX,e.screenY=t.changedTouches[0].screenY,e.clientX=t.changedTouches[0].clientX,e.clientY=t.changedTouches[0].clientY;break;default:e.x=t.x,e.y=t.y,e.pageX=t.pageX,e.pageY=t.pageY,e.screenX=t.screenX,e.screenY=t.screenY,e.clientX=t.clientX,e.clientY=t.clientY}return e}onPointerDown(t){if("mousedown"===t.type&&0!==t.button)return;this.moving="xy";const e=this.normalizePointerEvent(t);this.lastX=e.x,this.lastY=e.y,this.initialX=e.x,this.initialY=e.y,this.options.onDown(e)}handleX(t){let e=t.x-this.lastX;return this.lastY=t.y,this.lastX=t.x,e}handleY(t){let e=t.y-this.lastY;return this.lastY=t.y,this.lastX=t.x,e}onPointerMove(t){if(""===this.moving||"mousemove"===t.type&&0!==t.button)return;const e=this.normalizePointerEvent(t);if("x|y"===this.options.axis){let s=0,n=0;("x"===this.moving||"xy"===this.moving&&Math.abs(e.x-this.initialX)>this.options.threshold)&&(this.moving="x",s=this.handleX(e)),("y"===this.moving||"xy"===this.moving&&Math.abs(e.y-this.initialY)>this.options.threshold)&&(this.moving="y",n=this.handleY(e)),this.options.onMove({movementX:s,movementY:n,x:e.x,y:e.y,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t})}else if("xy"===this.options.axis){let s=0,n=0;Math.abs(e.x-this.initialX)>this.options.threshold&&(s=this.handleX(e)),Math.abs(e.y-this.initialY)>this.options.threshold&&(n=this.handleY(e)),this.options.onMove({movementX:s,movementY:n,x:e.x,y:e.y,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t})}else if("x"===this.options.axis)("x"===this.moving||"xy"===this.moving&&Math.abs(e.x-this.initialX)>this.options.threshold)&&(this.moving="x",this.options.onMove({movementX:this.handleX(e),movementY:0,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t}));else if("y"===this.options.axis){let s=0;("y"===this.moving||"xy"===this.moving&&Math.abs(e.y-this.initialY)>this.options.threshold)&&(this.moving="y",s=this.handleY(e)),this.options.onMove({movementX:0,movementY:s,x:e.x,y:e.y,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t})}}onPointerUp(t){this.moving="";const e=this.normalizePointerEvent(t);this.options.onUp({movementX:0,movementY:0,x:e.x,y:e.y,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t}),this.lastY=0,this.lastX=0}destroy(t){Yt?(t.removeEventListener("pointerdown",this.onPointerDown),document.removeEventListener("pointermove",this.onPointerMove),document.removeEventListener("pointerup",this.onPointerUp)):(t.removeEventListener("mousedown",this.onPointerDown),document.removeEventListener("mousemove",this.onPointerMove),document.removeEventListener("mouseup",this.onPointerUp),t.removeEventListener("touchstart",this.onPointerDown),document.removeEventListener("touchmove",this.onPointerMove),document.removeEventListener("touchend",this.onPointerUp),document.removeEventListener("touchcancel",this.onPointerUp))}}function St(t){let e=0;return function(s){e||(e=requestAnimationFrame((function(){e=0,t.apply(void 0,[s])})))}}function Nt(t){return t&&t.constructor?"Object"===t.constructor.name:"object"==typeof t&&null!==t}function Lt(t,...e){const s=e.shift();if(Nt(t)&&Nt(s))for(const e in s)if(Nt(s[e]))"function"==typeof s[e].clone?t[e]=s[e].clone():(void 0===t[e]&&(t[e]={}),t[e]=Lt(t[e],s[e]));else if(Array.isArray(s[e])){t[e]=new Array(s[e].length);let n=0;for(let i of s[e])Nt(i)?"function"==typeof i.clone?t[e][n]=i.clone():t[e][n]=Lt({},i):t[e][n]=i,n++}else t[e]=s[e];return e.length?Lt(t,...e):t}function Ut(t){if(void 0!==t.actions){const e=t.actions.map((t=>{const e=Object.assign({},t),s=Object.assign({},e.props);return delete s.state,delete s.api,delete e.element,e.props=s,e}));t.actions=e}return Lt({},t)}var Bt={mergeDeep:Lt,clone:Ut,schedule:St};class Dt{constructor(t,e){this.slotInstances={},this.destroyed=!1,this.vido=t,this.props=e,this.destroy=this.destroy.bind(this),this.change=this.change.bind(this),this.html=this.html.bind(this),this.getInstances=this.getInstances.bind(this),this.setComponents=this.setComponents.bind(this),this.vido.onDestroy((()=>{this.destroy()}))}setComponents(t){if(t&&!this.destroyed){for(const e in t){const s=t[e];void 0===this.slotInstances[e]&&(this.slotInstances[e]=[]);for(const t of this.slotInstances[e])t.destroy();this.slotInstances[e].length=0;for(const t of s)this.slotInstances[e].push(this.vido.createComponent(t,this.props))}this.vido.update()}}destroy(){if(!this.destroyed){for(const t in this.slotInstances){for(const e of this.slotInstances[t])e.destroy();this.slotInstances[t].length=0}this.destroyed=!0}}change(t,e){if(!this.destroyed)for(const s in this.slotInstances){const n=this.slotInstances[s];for(const s of n)s.change(t,e)}}getInstances(t){return this.destroyed?[]:void 0===t?this.slotInstances:this.slotInstances[t]}html(t,e){if(this.destroyed)return;if(!this.slotInstances[t]||0===this.slotInstances[t].length)return e;let s=e;for(const e of this.slotInstances[t])s=e.html(s);return s}getProps(){return this.props}isDestroyed(){return this.destroyed}}class Rt extends k{update(t,e){if("function"!=typeof e[0])throw new Error("[vido] GetElementDirective argument should be a function.");(0,e[0])(t.element)}render(){return b}}function kt(t,e){let s=0;const n=new Map;let i,o,r=new Map,h=0;const l=[],c=Promise.resolve(),a={},d=function(t){return class extends k{update(e,s){const n=e.element,i=s[0],o=s[1],r=s[2];for(const e of o)if(void 0!==e){let s;if(t.has(i))for(const o of t.get(i))if(o.componentAction.create===e&&o.element===n){s=o;break}if(s)s.props=r;else{void 0!==n.vido&&delete n.vido;const s={instance:i,componentAction:{create:e,update(){},destroy(){}},element:n,props:r};let o=[];t.has(i)&&(o=t.get(i)),o.push(s),t.set(i,o)}}}render(t,e,s){return b}}}(r);class u{constructor(t){this.instance=t}create(t,e){const s=R(d);return()=>s(this.instance,t,e)}}const p=function(t,e,s){return class{constructor(t,e,s={}){this.destroyed=!1,this.instance=t,this.name=e.name,this.vidoInstance=e,this.props=s,this.destroy=this.destroy.bind(this),this.update=this.update.bind(this),this.change=this.change.bind(this),this.html=this.html.bind(this)}destroy(){this.destroyed||(this.vidoInstance.debug&&(console.groupCollapsed(`destroying component ${this.instance}`),console.log(s({components:t.keys(),actionsByInstance:e})),console.trace(),console.groupEnd()),this.vidoInstance.destroyComponent(this.instance,this.vidoInstance),this.destroyed=!0)}update(n){return this.vidoInstance.debug&&(console.groupCollapsed(`updating component ${this.instance}`),console.log(s({components:t.keys(),actionsByInstance:e})),console.trace(),console.groupEnd()),this.vidoInstance.updateTemplate(n)}change(n,i={}){this.vidoInstance.debug&&(console.groupCollapsed(`changing component ${this.instance}`),console.log(s({props:this.props,newProps:n,components:t.keys(),actionsByInstance:e})),console.trace(),console.groupEnd());const o=t.get(this.instance);o&&o.change(n,i)}html(e={}){const s=t.get(this.instance);if(s&&!s.destroyed)return s.update(e,this.vidoInstance)}_getComponents(){return t}_getActions(){return e}}}(n,r,Ut),v=function(t,e,s){return class{constructor(t,e,s){this.destroyed=!1,this.instance=t,this.vidoInstance=e,this.renderFunction=s,this.destroy=this.destroy.bind(this),this.update=this.update.bind(this),this.change=this.change.bind(this)}destroy(){if(!this.destroyed){this.vidoInstance.debug&&(console.groupCollapsed(`component destroy method fired ${this.instance}`),console.log(s({props:this.vidoInstance.props,components:t.keys(),destroyable:this.vidoInstance.destroyable,actionsByInstance:e})),console.trace(),console.groupEnd()),this.content&&"function"==typeof this.content.destroy&&this.content.destroy();for(const t of this.vidoInstance.destroyable)t();this.vidoInstance.onChangeFunctions.length=0,this.vidoInstance.destroyable.length=0,this.vidoInstance.destroyed=!0,this.destroyed=!0,this.vidoInstance.update()}}update(n={}){return this.vidoInstance.debug&&(console.groupCollapsed(`component update method fired ${this.instance}`),console.log(s({components:t.keys(),actionsByInstance:e})),console.trace(),console.groupEnd()),this.renderFunction(n)}change(n,i={leave:!1}){const o=n;this.vidoInstance.debug&&(console.groupCollapsed(`component change method fired ${this.instance}`),console.log(s({props:o,components:t.keys(),onChangeFunctions:this.vidoInstance.onChangeFunctions,changedProps:n,actionsByInstance:e})),console.trace(),console.groupEnd());for(const t of this.vidoInstance.onChangeFunctions)t(n,i)}}}(n,r,Ut);class y{constructor(s="",i=""){this.instance="",this.name="",this.destroyable=[],this.destroyed=!1,this.onChangeFunctions=[],this.debug=!1,this.state=t,this.api=e,this.lastProps={},this.html=$,this.svg=A,this.directive=R,this.asyncAppend=at,this.asyncReplace=ct,this.cache=dt,this.classMap=Tt,this.styleMap=Ct,this.StyleMap=It,this.guard=pt,this.live=_t,this.ifDefined=vt,this.repeat=mt,this.unsafeHTML=gt,this.until=At,this.schedule=St,this.getElement=R(Rt),this.actionsByInstance=()=>{},this.detach=xt,this.PointerAction=Ht,this.Action=Mt,this.Slots=Dt,this._components=n,this._actions=r,this.instance=s,this.reuseComponents=this.reuseComponents.bind(this),this.onDestroy=this.onDestroy.bind(this),this.onChange=this.onChange.bind(this),this.update=this.update.bind(this),this.destroyComponent=this.destroyComponent.bind(this);for(const t in a)this[t]=a[t].bind(this);this.name=i,this.Actions=new u(s)}static addMethod(t,e){a[t]=e}onDestroy(t){this.destroyable.push(t)}onChange(t){this.onChangeFunctions.push(t)}update(t){return this.updateTemplate(t)}reuseComponents(t,e,s,n,i=!0,o=!1){const r=[],h=t.length,l=e.length;let c=!1;!i||void 0!==e&&0!==e.length||(c=!0);let a=0;if(h<l){let i=l-h;for(;i;){const o=e[l-i],h=this.createComponent(n,s(o));t.push(h),r.push(h),i--}}else if(h>l){let e=h-l;for(i&&(c=!0,a=h-e);e;){const s=h-e;i||(r.push(t[s]),t[s].destroy()),e--}i||(t.length=l)}let d=0;o&&console.log("modified components",r),o&&console.log("current components",t),o&&console.log("data array",e);for(const n of t){const t=e[d];o&&console.log(`reuse components data at '${d}'`,t),n&&!r.includes(n)&&(o&&console.log("getProps fn result",s(t)),n.change(s(t),{leave:c&&d>=a})),d++}}createComponent(t,e={}){const i=t.name+":"+s++;let o;o=new y(i,t.name);const h=new p(i,o,e),l=new v(i,o,t(o,e));return n.set(i,l),n.get(i).change(e),o.debug&&(console.groupCollapsed(`component created ${i}`),console.log(Ut({props:e,components:n.keys(),actionsByInstance:r})),console.trace(),console.groupEnd()),h}destroyComponent(t,e){if(e.debug&&(console.groupCollapsed(`destroying component ${t}...`),console.log(Ut({components:n.keys(),actionsByInstance:r})),console.trace(),console.groupEnd()),r.has(t))for(const e of r.get(t))"function"==typeof e.componentAction.destroy&&e.componentAction.destroy(e.element,e.props);r.delete(t);const s=n.get(t);s?(s.destroy(),n.delete(t),e.debug&&(console.groupCollapsed(`component destroyed ${t}`),console.log(Ut({components:n.keys(),actionsByInstance:r})),console.trace(),console.groupEnd())):console.warn(`No component to destroy! [${t}]`)}executeActions(){for(const t of r.values()){for(const e of t)if(void 0===e.element.vido){const t=n.get(e.instance);e.isActive=function(){return t&&!1===t.destroyed};const s=e.componentAction,i=s.create;if(void 0!==i){let t;t=i.prototype&&(i.prototype.isAction||i.prototype.update||i.prototype.destroy)||i.isAction?new i(e.element,e.props):i(e.element,e.props),void 0!==t&&("function"==typeof t?s.destroy=t:("function"==typeof t.update&&(s.update=t.update.bind(t)),"function"==typeof t.destroy&&(s.destroy=t.destroy.bind(t))))}}else e.element.vido=e.props,"function"==typeof e.componentAction.update&&e.isActive()&&e.componentAction.update(e.element,e.props);for(const e of t)e.element.vido=e.props}}updateTemplate(t){return t&&l.push(t),new Promise((t=>{const e=++h,s=this;c.then((function(){if(e===h){h=0,s.render();for(const t of l)t();l.length=0,t(null)}}))}))}createApp(t){o=t.element;const e=this.createComponent(t.component,t.props);return i=e.instance,this.render(),e}render(){const t=n.get(i);t?(C(t.update(),o),this.executeActions()):o&&o.remove()}}return new y}kt.prototype.lithtml=B,kt.prototype.Action=Mt,kt.prototype.Directive=k,kt.prototype.schedule=St,kt.prototype.detach=xt,kt.prototype.styleMap=Ct,kt.prototype.classMap=Tt,kt.prototype.StyleMap=It,kt.prototype.PointerAction=Ht,kt.prototype.asyncAppend=at,kt.prototype.asyncReplace=ct,kt.prototype.cache=dt,kt.prototype.guard=pt,kt.prototype.live=_t,kt.prototype.ifDefined=vt,kt.prototype.repeat=mt,kt.prototype.unsafeHTML=gt,kt.prototype.until=At,kt.prototype.Slots=Dt;const Ot=B;export{Mt as Action,k as Directive,D as PartType,Ht as PointerAction,Dt as Slots,It as StyleMap,L as _$LH,at as asyncAppend,ct as asyncReplace,dt as cache,Tt as classMap,kt as default,xt as detach,R as directive,pt as guard,Bt as helpers,$ as html,vt as ifDefined,Ot as lit,B as lithtml,_ as noChange,b as nothing,C as render,mt as repeat,St as schedule,Ct as styleMap,A as svg,gt as unsafeHTML,At as until};
//# sourceMappingURL=vido.min.js.map

@@ -6,3 +6,3 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Vido=e()}(this,(function(){"use strict";

* SPDX-License-Identifier: BSD-3-Clause
*/var t;const e=globalThis.trustedTypes,s=e?e.createPolicy("lit-html",{createHTML:t=>t}):void 0,n=`lit$${(Math.random()+"").slice(9)}$`,i="?"+n,o=`<${i}>`,r=document,h=(t="")=>r.createComment(t),l=t=>null===t||"object"!=typeof t&&"function"!=typeof t,c=Array.isArray,a=t=>{var e;return c(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])},d=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,u=/-->/g,p=/>/g,v=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,f=/'/g,m=/"/g,y=/^(?:script|style|textarea)$/i,g=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),$=g(1),A=g(2),_=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),x=new WeakMap,C=(t,e,s)=>{var n,i;const o=null!==(n=null==s?void 0:s.renderBefore)&&void 0!==n?n:e;let r=o._$litPart$;if(void 0===r){const t=null!==(i=null==s?void 0:s.renderBefore)&&void 0!==i?i:null;o._$litPart$=r=new P(e.insertBefore(h(),t),t,void 0,null!=s?s:{})}return r._$AI(t),r},w=r.createTreeWalker(r,129,null,!1),M=(t,e)=>{const i=t.length-1,r=[];let h,l=2===e?"<svg>":"",c=d;for(let e=0;e<i;e++){const s=t[e];let i,a,g=-1,$=0;for(;$<s.length&&(c.lastIndex=$,a=c.exec(s),null!==a);)$=c.lastIndex,c===d?"!--"===a[1]?c=u:void 0!==a[1]?c=p:void 0!==a[2]?(y.test(a[2])&&(h=RegExp("</"+a[2],"g")),c=v):void 0!==a[3]&&(c=v):c===v?">"===a[0]?(c=null!=h?h:d,g=-1):void 0===a[1]?g=-2:(g=c.lastIndex-a[2].length,i=a[1],c=void 0===a[3]?v:'"'===a[3]?m:f):c===m||c===f?c=v:c===u||c===p?c=d:(c=v,h=void 0);const A=c===v&&t[e+1].startsWith("/>")?" ":"";l+=c===d?s+o:g>=0?(r.push(i),s.slice(0,g)+"$lit$"+s.slice(g)+n+A):s+n+(-2===g?(r.push(void 0),e):A)}const a=l+(t[i]||"<?>")+(2===e?"</svg>":"");return[void 0!==s?s.createHTML(a):a,r]};class I{constructor({strings:t,_$litType$:s},o){let r;this.parts=[];let l=0,c=0;const a=t.length-1,d=this.parts,[u,p]=M(t,s);if(this.el=I.createElement(u,o),w.currentNode=this.el.content,2===s){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(r=w.nextNode())&&d.length<a;){if(1===r.nodeType){if(r.hasAttributes()){const t=[];for(const e of r.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(n)){const s=p[c++];if(t.push(e),void 0!==s){const t=r.getAttribute(s.toLowerCase()+"$lit$").split(n),e=/([.?@])?(.*)/.exec(s);d.push({type:1,index:l,name:e[2],strings:t,ctor:"."===e[1]?S:"?"===e[1]?T:"@"===e[1]?H:E})}else d.push({type:6,index:l})}for(const e of t)r.removeAttribute(e)}if(y.test(r.tagName)){const t=r.textContent.split(n),s=t.length-1;if(s>0){r.textContent=e?e.emptyScript:"";for(let e=0;e<s;e++)r.append(t[e],h()),w.nextNode(),d.push({type:2,index:++l});r.append(t[s],h())}}}else if(8===r.nodeType)if(r.data===i)d.push({type:2,index:l});else{let t=-1;for(;-1!==(t=r.data.indexOf(n,t+1));)d.push({type:7,index:l}),t+=n.length-1}l++}}static createElement(t,e){const s=r.createElement("template");return s.innerHTML=t,s}}function Y(t,e,s=t,n){var i,o,r,h;if(e===_)return e;let c=void 0!==n?null===(i=s._$Cl)||void 0===i?void 0:i[n]:s._$Cu;const a=l(e)?void 0:e._$litDirective$;return(null==c?void 0:c.constructor)!==a&&(null===(o=null==c?void 0:c._$AO)||void 0===o||o.call(c,!1),void 0===a?c=void 0:(c=new a(t),c._$AT(t,s,n)),void 0!==n?(null!==(r=(h=s)._$Cl)&&void 0!==r?r:h._$Cl=[])[n]=c:s._$Cu=c),void 0!==c&&(e=Y(t,c._$AS(t,e.values),c,n)),e}class X{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:s},parts:n}=this._$AD,i=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:r).importNode(s,!0);w.currentNode=i;let o=w.nextNode(),h=0,l=0,c=n[0];for(;void 0!==c;){if(h===c.index){let e;2===c.type?e=new P(o,o.nextSibling,this,t):1===c.type?e=new c.ctor(o,c.name,c.strings,this,t):6===c.type&&(e=new N(o,this,t)),this.v.push(e),c=n[++l]}h!==(null==c?void 0:c.index)&&(o=w.nextNode(),h++)}return i}m(t){let e=0;for(const s of this.v)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class P{constructor(t,e,s,n){var i;this.type=2,this._$AH=b,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cg=null===(i=null==n?void 0:n.isConnected)||void 0===i||i}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Y(this,t,e),l(t)?t===b||null==t||""===t?(this._$AH!==b&&this._$AR(),this._$AH=b):t!==this._$AH&&t!==_&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.S(t):a(t)?this.M(t):this.$(t)}A(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}S(t){this._$AH!==t&&(this._$AR(),this._$AH=this.A(t))}$(t){this._$AH!==b&&l(this._$AH)?this._$AA.nextSibling.data=t:this.S(r.createTextNode(t)),this._$AH=t}T(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=I.createElement(n.h,this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.m(s);else{const t=new X(i,this),e=t.p(this.options);t.m(s),this.S(e),this._$AH=t}}_$AC(t){let e=x.get(t.strings);return void 0===e&&x.set(t.strings,e=new I(t)),e}M(t){c(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new P(this.A(h()),this.A(h()),this,this.options)):s=e[n],s._$AI(i),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cg=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class E{constructor(t,e,s,n,i){this.type=1,this._$AH=b,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=i,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=b}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let o=!1;if(void 0===i)t=Y(this,t,e,0),o=!l(t)||t!==this._$AH&&t!==_,o&&(this._$AH=t);else{const n=t;let r,h;for(t=i[0],r=0;r<i.length-1;r++)h=Y(this,n[s+r],e,r),h===_&&(h=this._$AH[r]),o||(o=!l(h)||h!==this._$AH[r]),h===b?t=b:t!==b&&(t+=(null!=h?h:"")+i[r+1]),this._$AH[r]=h}o&&!n&&this.k(t)}k(t){t===b?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class S extends E{constructor(){super(...arguments),this.type=3}k(t){this.element[this.name]=t===b?void 0:t}}class T extends E{constructor(){super(...arguments),this.type=4}k(t){t&&t!==b?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)}}class H extends E{constructor(t,e,s,n,i){super(t,e,s,n,i),this.type=5}_$AI(t,e=this){var s;if((t=null!==(s=Y(this,t,e,0))&&void 0!==s?s:b)===_)return;const n=this._$AH,i=t===b&&n!==b||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,o=t!==b&&(n===b||i);i&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t)}}class N{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){Y(this,t)}}const L={P:"$lit$",V:n,L:i,I:1,N:M,R:X,D:a,j:Y,H:P,O:E,F:T,B:H,W:S,Z:N},k=window.litHtmlPolyfillSupport;null==k||k(I,P),(null!==(t=globalThis.litHtmlVersions)&&void 0!==t?t:globalThis.litHtmlVersions=[]).push("2.0.1");var U=Object.freeze({__proto__:null,_$LH:L,html:$,noChange:_,nothing:b,render:C,svg:A});
*/var t;const e=globalThis.trustedTypes,s=e?e.createPolicy("lit-html",{createHTML:t=>t}):void 0,n=`lit$${(Math.random()+"").slice(9)}$`,i="?"+n,o=`<${i}>`,r=document,h=(t="")=>r.createComment(t),l=t=>null===t||"object"!=typeof t&&"function"!=typeof t,c=Array.isArray,a=t=>{var e;return c(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])},d=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,u=/-->/g,p=/>/g,v=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,f=/'/g,y=/"/g,m=/^(?:script|style|textarea)$/i,g=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),$=g(1),A=g(2),_=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),x=new WeakMap,C=(t,e,s)=>{var n,i;const o=null!==(n=null==s?void 0:s.renderBefore)&&void 0!==n?n:e;let r=o._$litPart$;if(void 0===r){const t=null!==(i=null==s?void 0:s.renderBefore)&&void 0!==i?i:null;o._$litPart$=r=new P(e.insertBefore(h(),t),t,void 0,null!=s?s:{})}return r._$AI(t),r},w=r.createTreeWalker(r,129,null,!1),M=(t,e)=>{const i=t.length-1,r=[];let h,l=2===e?"<svg>":"",c=d;for(let e=0;e<i;e++){const s=t[e];let i,a,g=-1,$=0;for(;$<s.length&&(c.lastIndex=$,a=c.exec(s),null!==a);)$=c.lastIndex,c===d?"!--"===a[1]?c=u:void 0!==a[1]?c=p:void 0!==a[2]?(m.test(a[2])&&(h=RegExp("</"+a[2],"g")),c=v):void 0!==a[3]&&(c=v):c===v?">"===a[0]?(c=null!=h?h:d,g=-1):void 0===a[1]?g=-2:(g=c.lastIndex-a[2].length,i=a[1],c=void 0===a[3]?v:'"'===a[3]?y:f):c===y||c===f?c=v:c===u||c===p?c=d:(c=v,h=void 0);const A=c===v&&t[e+1].startsWith("/>")?" ":"";l+=c===d?s+o:g>=0?(r.push(i),s.slice(0,g)+"$lit$"+s.slice(g)+n+A):s+n+(-2===g?(r.push(void 0),e):A)}const a=l+(t[i]||"<?>")+(2===e?"</svg>":"");return[void 0!==s?s.createHTML(a):a,r]};class I{constructor({strings:t,_$litType$:s},o){let r;this.parts=[];let l=0,c=0;const a=t.length-1,d=this.parts,[u,p]=M(t,s);if(this.el=I.createElement(u,o),w.currentNode=this.el.content,2===s){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(r=w.nextNode())&&d.length<a;){if(1===r.nodeType){if(r.hasAttributes()){const t=[];for(const e of r.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(n)){const s=p[c++];if(t.push(e),void 0!==s){const t=r.getAttribute(s.toLowerCase()+"$lit$").split(n),e=/([.?@])?(.*)/.exec(s);d.push({type:1,index:l,name:e[2],strings:t,ctor:"."===e[1]?S:"?"===e[1]?T:"@"===e[1]?H:E})}else d.push({type:6,index:l})}for(const e of t)r.removeAttribute(e)}if(m.test(r.tagName)){const t=r.textContent.split(n),s=t.length-1;if(s>0){r.textContent=e?e.emptyScript:"";for(let e=0;e<s;e++)r.append(t[e],h()),w.nextNode(),d.push({type:2,index:++l});r.append(t[s],h())}}}else if(8===r.nodeType)if(r.data===i)d.push({type:2,index:l});else{let t=-1;for(;-1!==(t=r.data.indexOf(n,t+1));)d.push({type:7,index:l}),t+=n.length-1}l++}}static createElement(t,e){const s=r.createElement("template");return s.innerHTML=t,s}}function Y(t,e,s=t,n){var i,o,r,h;if(e===_)return e;let c=void 0!==n?null===(i=s._$Cl)||void 0===i?void 0:i[n]:s._$Cu;const a=l(e)?void 0:e._$litDirective$;return(null==c?void 0:c.constructor)!==a&&(null===(o=null==c?void 0:c._$AO)||void 0===o||o.call(c,!1),void 0===a?c=void 0:(c=new a(t),c._$AT(t,s,n)),void 0!==n?(null!==(r=(h=s)._$Cl)&&void 0!==r?r:h._$Cl=[])[n]=c:s._$Cu=c),void 0!==c&&(e=Y(t,c._$AS(t,e.values),c,n)),e}class X{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:s},parts:n}=this._$AD,i=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:r).importNode(s,!0);w.currentNode=i;let o=w.nextNode(),h=0,l=0,c=n[0];for(;void 0!==c;){if(h===c.index){let e;2===c.type?e=new P(o,o.nextSibling,this,t):1===c.type?e=new c.ctor(o,c.name,c.strings,this,t):6===c.type&&(e=new N(o,this,t)),this.v.push(e),c=n[++l]}h!==(null==c?void 0:c.index)&&(o=w.nextNode(),h++)}return i}m(t){let e=0;for(const s of this.v)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class P{constructor(t,e,s,n){var i;this.type=2,this._$AH=b,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cg=null===(i=null==n?void 0:n.isConnected)||void 0===i||i}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Y(this,t,e),l(t)?t===b||null==t||""===t?(this._$AH!==b&&this._$AR(),this._$AH=b):t!==this._$AH&&t!==_&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.S(t):a(t)?this.M(t):this.$(t)}A(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}S(t){this._$AH!==t&&(this._$AR(),this._$AH=this.A(t))}$(t){this._$AH!==b&&l(this._$AH)?this._$AA.nextSibling.data=t:this.S(r.createTextNode(t)),this._$AH=t}T(t){var e;const{values:s,_$litType$:n}=t,i="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=I.createElement(n.h,this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===i)this._$AH.m(s);else{const t=new X(i,this),e=t.p(this.options);t.m(s),this.S(e),this._$AH=t}}_$AC(t){let e=x.get(t.strings);return void 0===e&&x.set(t.strings,e=new I(t)),e}M(t){c(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new P(this.A(h()),this.A(h()),this,this.options)):s=e[n],s._$AI(i),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cg=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class E{constructor(t,e,s,n,i){this.type=1,this._$AH=b,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=i,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=b}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){const i=this.strings;let o=!1;if(void 0===i)t=Y(this,t,e,0),o=!l(t)||t!==this._$AH&&t!==_,o&&(this._$AH=t);else{const n=t;let r,h;for(t=i[0],r=0;r<i.length-1;r++)h=Y(this,n[s+r],e,r),h===_&&(h=this._$AH[r]),o||(o=!l(h)||h!==this._$AH[r]),h===b?t=b:t!==b&&(t+=(null!=h?h:"")+i[r+1]),this._$AH[r]=h}o&&!n&&this.k(t)}k(t){t===b?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class S extends E{constructor(){super(...arguments),this.type=3}k(t){this.element[this.name]=t===b?void 0:t}}class T extends E{constructor(){super(...arguments),this.type=4}k(t){t&&t!==b?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)}}class H extends E{constructor(t,e,s,n,i){super(t,e,s,n,i),this.type=5}_$AI(t,e=this){var s;if((t=null!==(s=Y(this,t,e,0))&&void 0!==s?s:b)===_)return;const n=this._$AH,i=t===b&&n!==b||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,o=t!==b&&(n===b||i);i&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t)}}class N{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){Y(this,t)}}const U={P:"$lit$",V:n,L:i,I:1,N:M,R:X,D:a,j:Y,H:P,O:E,F:T,B:H,W:S,Z:N},L=window.litHtmlPolyfillSupport;null==L||L(I,P),(null!==(t=globalThis.litHtmlVersions)&&void 0!==t?t:globalThis.litHtmlVersions=[]).push("2.0.1");var k=Object.freeze({__proto__:null,_$LH:U,html:$,noChange:_,nothing:b,render:C,svg:A});
/**

@@ -12,3 +12,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/const D=1,B=2,j=3,z=4,O=t=>(...e)=>({_$litDirective$:t,values:e});class W{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
*/const D=1,B=2,O=3,R=4,j=t=>(...e)=>({_$litDirective$:t,values:e});class W{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
/**

@@ -18,3 +18,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/const{H:F}=L,V=(t,e)=>{var s,n;return void 0===e?void 0!==(null===(s=t)||void 0===s?void 0:s._$litType$):(null===(n=t)||void 0===n?void 0:n._$litType$)===e},R=t=>void 0===t.strings,G=()=>document.createComment(""),K=(t,e,s)=>{var n;const i=t._$AA.parentNode,o=void 0===e?t._$AB:e._$AA;if(void 0===s){const e=i.insertBefore(G(),o),n=i.insertBefore(G(),o);s=new F(e,n,t,t.options)}else{const e=s._$AB.nextSibling,r=s._$AM,h=r!==t;if(h){let e;null===(n=s._$AQ)||void 0===n||n.call(s,t),s._$AM=t,void 0!==s._$AP&&(e=t._$AU)!==r._$AU&&s._$AP(e)}if(e!==o||h){let t=s._$AA;for(;t!==e;){const e=t.nextSibling;i.insertBefore(t,o),t=e}}}return s},Z=(t,e,s=t)=>(t._$AI(e,s),t),q={},J=(t,e=q)=>t._$AH=e,Q=t=>t._$AH,tt=t=>{var e;null===(e=t._$AP)||void 0===e||e.call(t,!1,!0);let s=t._$AA;const n=t._$AB.nextSibling;for(;s!==n;){const t=s.nextSibling;s.remove(),s=t}},et=t=>{t._$AR()},st=(t,e)=>{var s,n;const i=t._$AN;if(void 0===i)return!1;for(const t of i)null===(n=(s=t)._$AO)||void 0===n||n.call(s,e,!1),st(t,e);return!0},nt=t=>{let e,s;do{if(void 0===(e=t._$AM))break;s=e._$AN,s.delete(t),t=e}while(0===(null==s?void 0:s.size))},it=t=>{for(let e;e=t._$AM;t=e){let s=e._$AN;if(void 0===s)e._$AN=s=new Set;else if(s.has(t))break;s.add(t),ht(e)}};
*/const{H:z}=U,F=(t,e)=>{var s,n;return void 0===e?void 0!==(null===(s=t)||void 0===s?void 0:s._$litType$):(null===(n=t)||void 0===n?void 0:n._$litType$)===e},V=t=>void 0===t.strings,G=()=>document.createComment(""),K=(t,e,s)=>{var n;const i=t._$AA.parentNode,o=void 0===e?t._$AB:e._$AA;if(void 0===s){const e=i.insertBefore(G(),o),n=i.insertBefore(G(),o);s=new z(e,n,t,t.options)}else{const e=s._$AB.nextSibling,r=s._$AM,h=r!==t;if(h){let e;null===(n=s._$AQ)||void 0===n||n.call(s,t),s._$AM=t,void 0!==s._$AP&&(e=t._$AU)!==r._$AU&&s._$AP(e)}if(e!==o||h){let t=s._$AA;for(;t!==e;){const e=t.nextSibling;i.insertBefore(t,o),t=e}}}return s},q=(t,e,s=t)=>(t._$AI(e,s),t),Z={},J=(t,e=Z)=>t._$AH=e,Q=t=>t._$AH,tt=t=>{var e;null===(e=t._$AP)||void 0===e||e.call(t,!1,!0);let s=t._$AA;const n=t._$AB.nextSibling;for(;s!==n;){const t=s.nextSibling;s.remove(),s=t}},et=t=>{t._$AR()},st=(t,e)=>{var s,n;const i=t._$AN;if(void 0===i)return!1;for(const t of i)null===(n=(s=t)._$AO)||void 0===n||n.call(s,e,!1),st(t,e);return!0},nt=t=>{let e,s;do{if(void 0===(e=t._$AM))break;s=e._$AN,s.delete(t),t=e}while(0===(null==s?void 0:s.size))},it=t=>{for(let e;e=t._$AM;t=e){let s=e._$AN;if(void 0===s)e._$AN=s=new Set;else if(s.has(t))break;s.add(t),ht(e)}};
/**

@@ -24,3 +24,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/function ot(t){void 0!==this._$AN?(nt(this),this._$AM=t,it(this)):this._$AM=t}function rt(t,e=!1,s=0){const n=this._$AH,i=this._$AN;if(void 0!==i&&0!==i.size)if(e)if(Array.isArray(n))for(let t=s;t<n.length;t++)st(n[t],!1),nt(n[t]);else null!=n&&(st(n,!1),nt(n));else st(this,t)}const ht=t=>{var e,s,n,i;t.type==B&&(null!==(e=(n=t)._$AP)&&void 0!==e||(n._$AP=rt),null!==(s=(i=t)._$AQ)&&void 0!==s||(i._$AQ=ot))};class lt extends W{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),it(this),this.isConnected=t._$AU}_$AO(t,e=!0){var s,n;t!==this.isConnected&&(this.isConnected=t,t?null===(s=this.reconnected)||void 0===s||s.call(this):null===(n=this.disconnected)||void 0===n||n.call(this)),e&&(st(this,t),nt(this))}setValue(t){if(R(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}
*/function ot(t){void 0!==this._$AN?(nt(this),this._$AM=t,it(this)):this._$AM=t}function rt(t,e=!1,s=0){const n=this._$AH,i=this._$AN;if(void 0!==i&&0!==i.size)if(e)if(Array.isArray(n))for(let t=s;t<n.length;t++)st(n[t],!1),nt(n[t]);else null!=n&&(st(n,!1),nt(n));else st(this,t)}const ht=t=>{var e,s,n,i;t.type==B&&(null!==(e=(n=t)._$AP)&&void 0!==e||(n._$AP=rt),null!==(s=(i=t)._$AQ)&&void 0!==s||(i._$AQ=ot))};class lt extends W{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),it(this),this.isConnected=t._$AU}_$AO(t,e=!0){var s,n;t!==this.isConnected&&(this.isConnected=t,t?null===(s=this.reconnected)||void 0===s||s.call(this):null===(n=this.disconnected)||void 0===n||n.call(this)),e&&(st(this,t),nt(this))}setValue(t){if(V(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}
/**

@@ -35,3 +35,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/class dt extends lt{constructor(){super(...arguments),this._$CG=new ct(this),this._$CK=new at}render(t,e){return _}update(t,[e,s]){if(this.isConnected||this.disconnected(),e===this._$CJ)return;this._$CJ=e;let n=0;const{_$CG:i,_$CK:o}=this;return(async(t,e)=>{for await(const s of t)if(!1===await e(s))return})(e,(async t=>{for(;o.get();)await o.get();const r=i.deref();if(void 0!==r){if(r._$CJ!==e)return!1;void 0!==s&&(t=s(t,n)),r.commitValue(t,n),n++}return!0})),_}commitValue(t,e){this.setValue(t)}disconnected(){this._$CG.disconnect(),this._$CK.pause()}reconnected(){this._$CG.reconnect(this),this._$CK.resume()}}const ut=O(dt),pt=O(class extends dt{constructor(t){if(super(t),t.type!==B)throw Error("asyncAppend can only be used in child expressions")}update(t,e){return this._$CX=t,super.update(t,e)}commitValue(t,e){0===e&&et(this._$CX);const s=K(this._$CX);Z(s,t)}}),vt=O(class extends W{constructor(t){super(t),this.tt=new WeakMap}render(t){return[t]}update(t,[e]){if(V(this.it)&&(!V(e)||this.it.strings!==e.strings)){const e=Q(t).pop();let s=this.tt.get(this.it.strings);if(void 0===s){const t=document.createDocumentFragment();s=C(b,t),s.setConnected(!1),this.tt.set(this.it.strings,s)}J(s,[e]),K(s,void 0,e)}if(V(e)){if(!V(this.it)||this.it.strings!==e.strings){const s=this.tt.get(e.strings);if(void 0!==s){const e=Q(s).pop();et(t),K(t,void 0,e),J(t,[e])}}this.it=e}else this.it=void 0;return this.render(e)}}),ft={},mt=O(class extends W{constructor(){super(...arguments),this.ot=ft}render(t,e){return e()}update(t,[e,s]){if(Array.isArray(e)){if(Array.isArray(this.ot)&&this.ot.length===e.length&&e.every(((t,e)=>t===this.ot[e])))return _}else if(this.ot===e)return _;return this.ot=Array.isArray(e)?Array.from(e):e,this.render(e,s)}}),yt=t=>null!=t?t:b
*/class dt extends lt{constructor(){super(...arguments),this._$CG=new ct(this),this._$CK=new at}render(t,e){return _}update(t,[e,s]){if(this.isConnected||this.disconnected(),e===this._$CJ)return;this._$CJ=e;let n=0;const{_$CG:i,_$CK:o}=this;return(async(t,e)=>{for await(const s of t)if(!1===await e(s))return})(e,(async t=>{for(;o.get();)await o.get();const r=i.deref();if(void 0!==r){if(r._$CJ!==e)return!1;void 0!==s&&(t=s(t,n)),r.commitValue(t,n),n++}return!0})),_}commitValue(t,e){this.setValue(t)}disconnected(){this._$CG.disconnect(),this._$CK.pause()}reconnected(){this._$CG.reconnect(this),this._$CK.resume()}}const ut=j(dt),pt=j(class extends dt{constructor(t){if(super(t),t.type!==B)throw Error("asyncAppend can only be used in child expressions")}update(t,e){return this._$CX=t,super.update(t,e)}commitValue(t,e){0===e&&et(this._$CX);const s=K(this._$CX);q(s,t)}}),vt=j(class extends W{constructor(t){super(t),this.tt=new WeakMap}render(t){return[t]}update(t,[e]){if(F(this.it)&&(!F(e)||this.it.strings!==e.strings)){const e=Q(t).pop();let s=this.tt.get(this.it.strings);if(void 0===s){const t=document.createDocumentFragment();s=C(b,t),s.setConnected(!1),this.tt.set(this.it.strings,s)}J(s,[e]),K(s,void 0,e)}if(F(e)){if(!F(this.it)||this.it.strings!==e.strings){const s=this.tt.get(e.strings);if(void 0!==s){const e=Q(s).pop();et(t),K(t,void 0,e),J(t,[e])}}this.it=e}else this.it=void 0;return this.render(e)}}),ft={},yt=j(class extends W{constructor(){super(...arguments),this.ot=ft}render(t,e){return e()}update(t,[e,s]){if(Array.isArray(e)){if(Array.isArray(this.ot)&&this.ot.length===e.length&&e.every(((t,e)=>t===this.ot[e])))return _}else if(this.ot===e)return _;return this.ot=Array.isArray(e)?Array.from(e):e,this.render(e,s)}}),mt=t=>null!=t?t:b
/**

@@ -41,3 +41,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/,gt=(t,e,s)=>{const n=new Map;for(let i=e;i<=s;i++)n.set(t[i],i);return n},$t=O(class extends W{constructor(t){if(super(t),t.type!==B)throw Error("repeat() can only be used in text expressions")}dt(t,e,s){let n;void 0===s?s=e:void 0!==e&&(n=e);const i=[],o=[];let r=0;for(const e of t)i[r]=n?n(e,r):r,o[r]=s(e,r),r++;return{values:o,keys:i}}render(t,e,s){return this.dt(t,e,s).values}update(t,[e,s,n]){var i;const o=Q(t),{values:r,keys:h}=this.dt(e,s,n);if(!Array.isArray(o))return this.ct=h,r;const l=null!==(i=this.ct)&&void 0!==i?i:this.ct=[],c=[];let a,d,u=0,p=o.length-1,v=0,f=r.length-1;for(;u<=p&&v<=f;)if(null===o[u])u++;else if(null===o[p])p--;else if(l[u]===h[v])c[v]=Z(o[u],r[v]),u++,v++;else if(l[p]===h[f])c[f]=Z(o[p],r[f]),p--,f--;else if(l[u]===h[f])c[f]=Z(o[u],r[f]),K(t,c[f+1],o[u]),u++,f--;else if(l[p]===h[v])c[v]=Z(o[p],r[v]),K(t,o[u],o[p]),p--,v++;else if(void 0===a&&(a=gt(h,v,f),d=gt(l,u,p)),a.has(l[u]))if(a.has(l[p])){const e=d.get(h[v]),s=void 0!==e?o[e]:null;if(null===s){const e=K(t,o[u]);Z(e,r[v]),c[v]=e}else c[v]=Z(s,r[v]),K(t,o[u],s),o[e]=null;v++}else tt(o[p]),p--;else tt(o[u]),u++;for(;v<=f;){const e=K(t,c[f+1]);Z(e,r[v]),c[v++]=e}for(;u<=p;){const t=o[u++];null!==t&&tt(t)}return this.ct=h,J(t,c),_}});
*/,gt=(t,e,s)=>{const n=new Map;for(let i=e;i<=s;i++)n.set(t[i],i);return n},$t=j(class extends W{constructor(t){if(super(t),t.type!==B)throw Error("repeat() can only be used in text expressions")}dt(t,e,s){let n;void 0===s?s=e:void 0!==e&&(n=e);const i=[],o=[];let r=0;for(const e of t)i[r]=n?n(e,r):r,o[r]=s(e,r),r++;return{values:o,keys:i}}render(t,e,s){return this.dt(t,e,s).values}update(t,[e,s,n]){var i;const o=Q(t),{values:r,keys:h}=this.dt(e,s,n);if(!Array.isArray(o))return this.ct=h,r;const l=null!==(i=this.ct)&&void 0!==i?i:this.ct=[],c=[];let a,d,u=0,p=o.length-1,v=0,f=r.length-1;for(;u<=p&&v<=f;)if(null===o[u])u++;else if(null===o[p])p--;else if(l[u]===h[v])c[v]=q(o[u],r[v]),u++,v++;else if(l[p]===h[f])c[f]=q(o[p],r[f]),p--,f--;else if(l[u]===h[f])c[f]=q(o[u],r[f]),K(t,c[f+1],o[u]),u++,f--;else if(l[p]===h[v])c[v]=q(o[p],r[v]),K(t,o[u],o[p]),p--,v++;else if(void 0===a&&(a=gt(h,v,f),d=gt(l,u,p)),a.has(l[u]))if(a.has(l[p])){const e=d.get(h[v]),s=void 0!==e?o[e]:null;if(null===s){const e=K(t,o[u]);q(e,r[v]),c[v]=e}else c[v]=q(s,r[v]),K(t,o[u],s),o[e]=null;v++}else tt(o[p]),p--;else tt(o[u]),u++;for(;v<=f;){const e=K(t,c[f+1]);q(e,r[v]),c[v++]=e}for(;u<=p;){const t=o[u++];null!==t&&tt(t)}return this.ct=h,J(t,c),_}});
/**

@@ -53,3 +53,3 @@ * @license

*/
class At extends W{constructor(t){if(super(t),this.it=b,t.type!==B)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===b||null==t)return this.vt=void 0,this.it=t;if(t===_)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this.vt;this.it=t;const e=[t];return e.raw=e,this.vt={_$litType$:this.constructor.resultType,strings:e,values:[]}}}At.directiveName="unsafeHTML",At.resultType=1;const _t=O(At),bt=t=>!(t=>null===t||"object"!=typeof t&&"function"!=typeof t)(t)&&"function"==typeof t.then;
class At extends W{constructor(t){if(super(t),this.it=b,t.type!==B)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===b||null==t)return this.vt=void 0,this.it=t;if(t===_)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this.vt;this.it=t;const e=[t];return e.raw=e,this.vt={_$litType$:this.constructor.resultType,strings:e,values:[]}}}At.directiveName="unsafeHTML",At.resultType=1;const _t=j(At),bt=t=>!(t=>null===t||"object"!=typeof t&&"function"!=typeof t)(t)&&"function"==typeof t.then;
/**

@@ -59,3 +59,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/const xt=O(class extends lt{constructor(){super(...arguments),this._$Cft=1073741823,this._$Cwt=[],this._$CG=new ct(this),this._$CK=new at}render(...t){var e;return null!==(e=t.find((t=>!bt(t))))&&void 0!==e?e:_}update(t,e){const s=this._$Cwt;let n=s.length;this._$Cwt=e;const i=this._$CG,o=this._$CK;this.isConnected||this.disconnected();for(let t=0;t<e.length&&!(t>this._$Cft);t++){const r=e[t];if(!bt(r))return this._$Cft=t,r;t<n&&r===s[t]||(this._$Cft=1073741823,n=0,Promise.resolve(r).then((async t=>{for(;o.get();)await o.get();const e=i.deref();if(void 0!==e){const s=e._$Cwt.indexOf(r);s>-1&&s<e._$Cft&&(e._$Cft=s,e.setValue(t))}})))}return _}disconnected(){this._$CG.disconnect(),this._$CK.pause()}reconnected(){this._$CG.reconnect(this),this._$CK.resume()}}),Ct=O(class extends W{constructor(t){if(super(t),t.type!==j&&t.type!==D&&t.type!==z)throw Error("The `live` directive is not allowed on child or event bindings");if(!R(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===_||e===b)return e;const s=t.element,n=t.name;if(t.type===j){if(e===s[n])return _}else if(t.type===z){if(!!e===s.hasAttribute(n))return _}else if(t.type===D&&s.getAttribute(n)===e+"")return _;return J(t),e}}),wt=new WeakMap;
*/const xt=j(class extends lt{constructor(){super(...arguments),this._$Cft=1073741823,this._$Cwt=[],this._$CG=new ct(this),this._$CK=new at}render(...t){var e;return null!==(e=t.find((t=>!bt(t))))&&void 0!==e?e:_}update(t,e){const s=this._$Cwt;let n=s.length;this._$Cwt=e;const i=this._$CG,o=this._$CK;this.isConnected||this.disconnected();for(let t=0;t<e.length&&!(t>this._$Cft);t++){const r=e[t];if(!bt(r))return this._$Cft=t,r;t<n&&r===s[t]||(this._$Cft=1073741823,n=0,Promise.resolve(r).then((async t=>{for(;o.get();)await o.get();const e=i.deref();if(void 0!==e){const s=e._$Cwt.indexOf(r);s>-1&&s<e._$Cft&&(e._$Cft=s,e.setValue(t))}})))}return _}disconnected(){this._$CG.disconnect(),this._$CK.pause()}reconnected(){this._$CG.reconnect(this),this._$CK.resume()}}),Ct=j(class extends W{constructor(t){if(super(t),t.type!==O&&t.type!==D&&t.type!==R)throw Error("The `live` directive is not allowed on child or event bindings");if(!V(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===_||e===b)return e;const s=t.element,n=t.name;if(t.type===O){if(e===s[n])return _}else if(t.type===R){if(!!e===s.hasAttribute(n))return _}else if(t.type===D&&s.getAttribute(n)===e+"")return _;return J(t),e}}),wt=new WeakMap;
/**

@@ -65,3 +65,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/const Mt=O(class extends W{render(t){return b}update(t,e){if("boolean"!=typeof e[0])throw new Error("[vido] Detach directive argument should be a boolean.");let s=e[0];const n=t.element;if(s)wt.has(t)||wt.set(t,{element:n,nextSibling:n.nextSibling,previousSibling:n.previousSibling,parent:n.parentNode}),n.remove();else{const e=wt.get(t);e&&(e.nextSibling&&e.nextSibling.parentNode?e.nextSibling.parentNode.insertBefore(e.element,e.nextSibling):e.previousSibling&&e.previousSibling.parentNode?e.previousSibling.parentNode.appendChild(e.element):e.parent&&e.parent.appendChild(e.element),wt.delete(t))}return this.render(s)}}),It=O(class extends W{constructor(t){var e;if(super(t),t.type!==D||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,s)=>{const n=t[s];return null==n?e:e+`${s=s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`}),"")}update(t,[e]){const{style:s}=t.element;if(void 0===this.ut){this.ut=new Set;for(const t in e)this.ut.add(t);return this.render(e)}this.ut.forEach((t=>{null==e[t]&&(this.ut.delete(t),t.includes("-")?s.removeProperty(t):s[t]="")}));for(const t in e){const n=e[t];null!=n&&(this.ut.add(t),t.includes("-")?s.setProperty(t,n):s[t]=n)}return _}});
*/const Mt=j(class extends W{render(t){return b}update(t,e){if("boolean"!=typeof e[0])throw new Error("[vido] Detach directive argument should be a boolean.");let s=e[0];const n=t.element;if(s)wt.has(t)||wt.set(t,{element:n,nextSibling:n.nextSibling,previousSibling:n.previousSibling,parent:n.parentNode}),n.remove();else{const e=wt.get(t);e&&(e.nextSibling&&e.nextSibling.parentNode?e.nextSibling.parentNode.insertBefore(e.element,e.nextSibling):e.previousSibling&&e.previousSibling.parentNode?e.previousSibling.parentNode.appendChild(e.element):e.parent&&e.parent.appendChild(e.element),wt.delete(t))}return this.render(s)}}),It=j(class extends W{constructor(t){var e;if(super(t),t.type!==D||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,s)=>{const n=t[s];return null==n?e:e+`${s=s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`}),"")}update(t,[e]){const{style:s}=t.element;if(void 0===this.ut){this.ut=new Set;for(const t in e)this.ut.add(t);return this.render(e)}this.ut.forEach((t=>{null==e[t]&&(this.ut.delete(t),t.includes("-")?s.removeProperty(t):s[t]="")}));for(const t in e){const n=e[t];null!=n&&(this.ut.add(t),t.includes("-")?s.setProperty(t,n):s[t]=n)}return _}}),Yt=new WeakMap;
/**

@@ -71,3 +71,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/class Yt extends W{update(t,e){return e[0].execute(t),_}render(t){return t.toString()}}class Xt{constructor(t,e={schedule:!1}){this.schedule=!1,this.style=t,this._directive=O(Yt),this.execute=this.execute.bind(this),this.updateStyle=this.updateStyle.bind(this),this.schedule=e.schedule}directive(){return this._directive(this)}setStyle(t){this.style=t}toString(){return Object.keys(this.style).reduce(((t,e)=>{const s=this.style[e];return null==s?t:t+`${e=e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}updateStyle(t,e,s){for(const t of s){if(!t)continue;let[s,n]=t.split(":");s=s.trim().toLowerCase(),n=n.trim().toLowerCase(),s&&(e[s]=n)}for(const s in e){if(!s)continue;const e=s.split("-").map(((t,e)=>e>0?t.length>=2?t[0].toUpperCase()+t.substring(1):"":t)).join();void 0===this.style[s]&&void 0===this.style[e]&&(s.includes("-")?t.removeProperty(s):delete t[s])}for(let s in this.style){if(!s)continue;const n=this.style[s].toLowerCase().trim();s=s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase(),e[s]!==n&&(s.includes("-")?t.setProperty(s,n):t[s]=n)}}execute(t){const e=t.element.style;let s={};const n=e.cssText.split(";");this.schedule?requestAnimationFrame((()=>{this.updateStyle(e,s,n)})):this.updateStyle(e,s,n)}}
*/class Xt extends W{update(t,e){return e[0].execute(t),_}render(t){return t.toString()}}class Pt{constructor(t,e={schedule:!1}){this.schedule=!1,this.style=t,this._directive=j(Xt),this.execute=this.execute.bind(this),this.schedule=e.schedule}directive(){return this._directive(this)}setStyle(t){this.style=t}toString(){return Object.keys(this.style).reduce(((t,e)=>{const s=this.style[e];return null==s?t:t+`${e=e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}updateStyle(t,e,s){const n=s.previousStyle;for(const t of e)void 0===this.style[t]&&(s.toRemove.includes(t)||s.toRemove.push(t));for(const t in n)t in this.style&&void 0===this.style[t]&&e.includes(t)&&(s.toRemove.includes(t)||s.toRemove.push(t));for(const t in this.style){if(!(t in this.style))continue;const i=this.style[t],o=n[t];void 0!==o&&o===i&&e.includes(t)||s.toUpdate.push(t)}if(s.toRemove.length||s.toUpdate.length){for(const e of s.toRemove)t.removeProperty(e),t[e]&&delete t[e];for(const e of s.toUpdate){const s=this.style[e];e.includes("-")?t.setProperty(e,s):t[e]=s}s.previousStyle=Object.assign({},this.style)}}execute(t){const e=t.element;let s;Yt.has(e)?s=Yt.get(e):(s={toUpdate:[],toRemove:[],previousStyle:{}},Yt.set(e,s)),s.toRemove.length=0,s.toUpdate.length=0;const n=e.style,i=e.style.cssText.split(";").map((t=>t.substr(0,t.indexOf(":")).trim())).filter((t=>!!t));this.schedule?requestAnimationFrame((()=>{this.updateStyle(n,i,s)})):this.updateStyle(n,i,s),Yt.set(e,s)}}
/**

@@ -77,3 +77,3 @@ * @license

* SPDX-License-Identifier: BSD-3-Clause
*/const Pt=O(class extends W{constructor(t){var e;if(super(t),t.type!==D||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){var s,n;if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.et=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!(null===(s=this.et)||void 0===s?void 0:s.has(t))&&this.st.add(t);return this.render(e)}const i=t.element.classList;this.st.forEach((t=>{t in e||(i.remove(t),this.st.delete(t))}));for(const t in e){const s=!!e[t];s===this.st.has(t)||(null===(n=this.et)||void 0===n?void 0:n.has(t))||(s?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return _}});class Et{constructor(){this.isAction=!0}}Et.prototype.isAction=!0;const St={element:document.createTextNode(""),axis:"xy",threshold:10,onDown(){},onMove(){},onUp(){},onWheel(){}},Tt="undefined"!=typeof PointerEvent;let Ht=0;class Nt extends Et{constructor(t,e){super(),this.moving="",this.initialX=0,this.initialY=0,this.lastY=0,this.lastX=0,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onWheel=this.onWheel.bind(this),this.element=t,this.id=++Ht,this.options=Object.assign(Object.assign({},St),e.pointerOptions),Tt?(t.addEventListener("pointerdown",this.onPointerDown),document.addEventListener("pointermove",this.onPointerMove),document.addEventListener("pointerup",this.onPointerUp)):(t.addEventListener("touchstart",this.onPointerDown),document.addEventListener("touchmove",this.onPointerMove,{passive:!1}),document.addEventListener("touchend",this.onPointerUp),document.addEventListener("touchcancel",this.onPointerUp),t.addEventListener("mousedown",this.onPointerDown),document.addEventListener("mousemove",this.onPointerMove,{passive:!1}),document.addEventListener("mouseup",this.onPointerUp))}normalizeMouseWheelEvent(t){let e=t.deltaX||0,s=t.deltaY||0,n=t.deltaZ||0;const i=t.deltaMode,o=parseInt(getComputedStyle(t.target).getPropertyValue("line-height"));let r=1;switch(i){case 1:r=o;break;case 2:r=window.height}return e*=r,s*=r,n*=r,{x:e,y:s,z:n,event:t}}onWheel(t){const e=this.normalizeMouseWheelEvent(t);this.options.onWheel(e)}normalizePointerEvent(t){let e={x:0,y:0,pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0,event:t};switch(t.type){case"wheel":const s=this.normalizeMouseWheelEvent(t);e.x=s.x,e.y=s.y,e.pageX=e.x,e.pageY=e.y,e.screenX=e.x,e.screenY=e.y,e.clientX=e.x,e.clientY=e.y;break;case"touchstart":case"touchmove":case"touchend":case"touchcancel":e.x=t.changedTouches[0].screenX,e.y=t.changedTouches[0].screenY,e.pageX=t.changedTouches[0].pageX,e.pageY=t.changedTouches[0].pageY,e.screenX=t.changedTouches[0].screenX,e.screenY=t.changedTouches[0].screenY,e.clientX=t.changedTouches[0].clientX,e.clientY=t.changedTouches[0].clientY;break;default:e.x=t.x,e.y=t.y,e.pageX=t.pageX,e.pageY=t.pageY,e.screenX=t.screenX,e.screenY=t.screenY,e.clientX=t.clientX,e.clientY=t.clientY}return e}onPointerDown(t){if("mousedown"===t.type&&0!==t.button)return;this.moving="xy";const e=this.normalizePointerEvent(t);this.lastX=e.x,this.lastY=e.y,this.initialX=e.x,this.initialY=e.y,this.options.onDown(e)}handleX(t){let e=t.x-this.lastX;return this.lastY=t.y,this.lastX=t.x,e}handleY(t){let e=t.y-this.lastY;return this.lastY=t.y,this.lastX=t.x,e}onPointerMove(t){if(""===this.moving||"mousemove"===t.type&&0!==t.button)return;const e=this.normalizePointerEvent(t);if("x|y"===this.options.axis){let s=0,n=0;("x"===this.moving||"xy"===this.moving&&Math.abs(e.x-this.initialX)>this.options.threshold)&&(this.moving="x",s=this.handleX(e)),("y"===this.moving||"xy"===this.moving&&Math.abs(e.y-this.initialY)>this.options.threshold)&&(this.moving="y",n=this.handleY(e)),this.options.onMove({movementX:s,movementY:n,x:e.x,y:e.y,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t})}else if("xy"===this.options.axis){let s=0,n=0;Math.abs(e.x-this.initialX)>this.options.threshold&&(s=this.handleX(e)),Math.abs(e.y-this.initialY)>this.options.threshold&&(n=this.handleY(e)),this.options.onMove({movementX:s,movementY:n,x:e.x,y:e.y,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t})}else if("x"===this.options.axis)("x"===this.moving||"xy"===this.moving&&Math.abs(e.x-this.initialX)>this.options.threshold)&&(this.moving="x",this.options.onMove({movementX:this.handleX(e),movementY:0,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t}));else if("y"===this.options.axis){let s=0;("y"===this.moving||"xy"===this.moving&&Math.abs(e.y-this.initialY)>this.options.threshold)&&(this.moving="y",s=this.handleY(e)),this.options.onMove({movementX:0,movementY:s,x:e.x,y:e.y,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t})}}onPointerUp(t){this.moving="";const e=this.normalizePointerEvent(t);this.options.onUp({movementX:0,movementY:0,x:e.x,y:e.y,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t}),this.lastY=0,this.lastX=0}destroy(t){Tt?(t.removeEventListener("pointerdown",this.onPointerDown),document.removeEventListener("pointermove",this.onPointerMove),document.removeEventListener("pointerup",this.onPointerUp)):(t.removeEventListener("mousedown",this.onPointerDown),document.removeEventListener("mousemove",this.onPointerMove),document.removeEventListener("mouseup",this.onPointerUp),t.removeEventListener("touchstart",this.onPointerDown),document.removeEventListener("touchmove",this.onPointerMove),document.removeEventListener("touchend",this.onPointerUp),document.removeEventListener("touchcancel",this.onPointerUp))}}function Lt(t){let e=0;return function(s){e||(e=requestAnimationFrame((function(){e=0,t.apply(void 0,[s])})))}}function kt(t){return t&&t.constructor?"Object"===t.constructor.name:"object"==typeof t&&null!==t}function Ut(t,...e){const s=e.shift();if(kt(t)&&kt(s))for(const e in s)if(kt(s[e]))"function"==typeof s[e].clone?t[e]=s[e].clone():(void 0===t[e]&&(t[e]={}),t[e]=Ut(t[e],s[e]));else if(Array.isArray(s[e])){t[e]=new Array(s[e].length);let n=0;for(let i of s[e])kt(i)?"function"==typeof i.clone?t[e][n]=i.clone():t[e][n]=Ut({},i):t[e][n]=i,n++}else t[e]=s[e];return e.length?Ut(t,...e):t}function Dt(t){if(void 0!==t.actions){const e=t.actions.map((t=>{const e=Object.assign({},t),s=Object.assign({},e.props);return delete s.state,delete s.api,delete e.element,e.props=s,e}));t.actions=e}return Ut({},t)}class Bt{constructor(t,e){this.slotInstances={},this.destroyed=!1,this.vido=t,this.props=e,this.destroy=this.destroy.bind(this),this.change=this.change.bind(this),this.html=this.html.bind(this),this.getInstances=this.getInstances.bind(this),this.setComponents=this.setComponents.bind(this),this.vido.onDestroy((()=>{this.destroy()}))}setComponents(t){if(t&&!this.destroyed){for(const e in t){const s=t[e];void 0===this.slotInstances[e]&&(this.slotInstances[e]=[]);for(const t of this.slotInstances[e])t.destroy();this.slotInstances[e].length=0;for(const t of s)this.slotInstances[e].push(this.vido.createComponent(t,this.props))}this.vido.update()}}destroy(){if(!this.destroyed){for(const t in this.slotInstances){for(const e of this.slotInstances[t])e.destroy();this.slotInstances[t].length=0}this.destroyed=!0}}change(t,e){if(!this.destroyed)for(const s in this.slotInstances){const n=this.slotInstances[s];for(const s of n)s.change(t,e)}}getInstances(t){return this.destroyed?[]:void 0===t?this.slotInstances:this.slotInstances[t]}html(t,e){if(this.destroyed)return;if(!this.slotInstances[t]||0===this.slotInstances[t].length)return e;let s=e;for(const e of this.slotInstances[t])s=e.html(s);return s}getProps(){return this.props}isDestroyed(){return this.destroyed}}class jt extends W{update(t,e){if("function"!=typeof e[0])throw new Error("[vido] GetElementDirective argument should be a function.");(0,e[0])(t.element)}render(){return b}}function zt(t,e){let s=0;const n=new Map;let i,o,r=new Map,h=0;const l=[],c=Promise.resolve(),a={},d=function(t){return class extends W{update(e,s){const n=e.element,i=s[0],o=s[1],r=s[2];for(const e of o)if(void 0!==e){let s;if(t.has(i))for(const o of t.get(i))if(o.componentAction.create===e&&o.element===n){s=o;break}if(s)s.props=r;else{void 0!==n.vido&&delete n.vido;const s={instance:i,componentAction:{create:e,update(){},destroy(){}},element:n,props:r};let o=[];t.has(i)&&(o=t.get(i)),o.push(s),t.set(i,o)}}}render(t,e,s){return b}}}(r);class u{constructor(t){this.instance=t}create(t,e){const s=O(d);return()=>s(this.instance,t,e)}}const p=function(t,e,s){return class{constructor(t,e,s={}){this.destroyed=!1,this.instance=t,this.name=e.name,this.vidoInstance=e,this.props=s,this.destroy=this.destroy.bind(this),this.update=this.update.bind(this),this.change=this.change.bind(this),this.html=this.html.bind(this)}destroy(){this.destroyed||(this.vidoInstance.debug&&(console.groupCollapsed(`destroying component ${this.instance}`),console.log(s({components:t.keys(),actionsByInstance:e})),console.trace(),console.groupEnd()),this.vidoInstance.destroyComponent(this.instance,this.vidoInstance),this.destroyed=!0)}update(n){return this.vidoInstance.debug&&(console.groupCollapsed(`updating component ${this.instance}`),console.log(s({components:t.keys(),actionsByInstance:e})),console.trace(),console.groupEnd()),this.vidoInstance.updateTemplate(n)}change(n,i={}){this.vidoInstance.debug&&(console.groupCollapsed(`changing component ${this.instance}`),console.log(s({props:this.props,newProps:n,components:t.keys(),actionsByInstance:e})),console.trace(),console.groupEnd());const o=t.get(this.instance);o&&o.change(n,i)}html(e={}){const s=t.get(this.instance);if(s&&!s.destroyed)return s.update(e,this.vidoInstance)}_getComponents(){return t}_getActions(){return e}}}(n,r,Dt),v=function(t,e,s){return class{constructor(t,e,s){this.destroyed=!1,this.instance=t,this.vidoInstance=e,this.renderFunction=s,this.destroy=this.destroy.bind(this),this.update=this.update.bind(this),this.change=this.change.bind(this)}destroy(){if(!this.destroyed){this.vidoInstance.debug&&(console.groupCollapsed(`component destroy method fired ${this.instance}`),console.log(s({props:this.vidoInstance.props,components:t.keys(),destroyable:this.vidoInstance.destroyable,actionsByInstance:e})),console.trace(),console.groupEnd()),this.content&&"function"==typeof this.content.destroy&&this.content.destroy();for(const t of this.vidoInstance.destroyable)t();this.vidoInstance.onChangeFunctions.length=0,this.vidoInstance.destroyable.length=0,this.vidoInstance.destroyed=!0,this.destroyed=!0,this.vidoInstance.update()}}update(n={}){return this.vidoInstance.debug&&(console.groupCollapsed(`component update method fired ${this.instance}`),console.log(s({components:t.keys(),actionsByInstance:e})),console.trace(),console.groupEnd()),this.renderFunction(n)}change(n,i={leave:!1}){const o=n;this.vidoInstance.debug&&(console.groupCollapsed(`component change method fired ${this.instance}`),console.log(s({props:o,components:t.keys(),onChangeFunctions:this.vidoInstance.onChangeFunctions,changedProps:n,actionsByInstance:e})),console.trace(),console.groupEnd());for(const t of this.vidoInstance.onChangeFunctions)t(n,i)}}}(n,r,Dt);class f{constructor(s="",i=""){this.instance="",this.name="",this.destroyable=[],this.destroyed=!1,this.onChangeFunctions=[],this.debug=!1,this.state=t,this.api=e,this.lastProps={},this.html=$,this.svg=A,this.directive=O,this.asyncAppend=pt,this.asyncReplace=ut,this.cache=vt,this.classMap=Pt,this.styleMap=It,this.StyleMap=Xt,this.guard=mt,this.live=Ct,this.ifDefined=yt,this.repeat=$t,this.unsafeHTML=_t,this.until=xt,this.schedule=Lt,this.getElement=O(jt),this.actionsByInstance=()=>{},this.detach=Mt,this.PointerAction=Nt,this.Action=Et,this.Slots=Bt,this._components=n,this._actions=r,this.instance=s,this.reuseComponents=this.reuseComponents.bind(this),this.onDestroy=this.onDestroy.bind(this),this.onChange=this.onChange.bind(this),this.update=this.update.bind(this),this.destroyComponent=this.destroyComponent.bind(this);for(const t in a)this[t]=a[t].bind(this);this.name=i,this.Actions=new u(s)}static addMethod(t,e){a[t]=e}onDestroy(t){this.destroyable.push(t)}onChange(t){this.onChangeFunctions.push(t)}update(t){return this.updateTemplate(t)}reuseComponents(t,e,s,n,i=!0,o=!1){const r=[],h=t.length,l=e.length;let c=!1;!i||void 0!==e&&0!==e.length||(c=!0);let a=0;if(h<l){let i=l-h;for(;i;){const o=e[l-i],h=this.createComponent(n,s(o));t.push(h),r.push(h),i--}}else if(h>l){let e=h-l;for(i&&(c=!0,a=h-e);e;){const s=h-e;i||(r.push(t[s]),t[s].destroy()),e--}i||(t.length=l)}let d=0;o&&console.log("modified components",r),o&&console.log("current components",t),o&&console.log("data array",e);for(const n of t){const t=e[d];o&&console.log(`reuse components data at '${d}'`,t),n&&!r.includes(n)&&(o&&console.log("getProps fn result",s(t)),n.change(s(t),{leave:c&&d>=a})),d++}}createComponent(t,e={}){const i=t.name+":"+s++;let o;o=new f(i,t.name);const h=new p(i,o,e),l=new v(i,o,t(o,e));return n.set(i,l),n.get(i).change(e),o.debug&&(console.groupCollapsed(`component created ${i}`),console.log(Dt({props:e,components:n.keys(),actionsByInstance:r})),console.trace(),console.groupEnd()),h}destroyComponent(t,e){if(e.debug&&(console.groupCollapsed(`destroying component ${t}...`),console.log(Dt({components:n.keys(),actionsByInstance:r})),console.trace(),console.groupEnd()),r.has(t))for(const e of r.get(t))"function"==typeof e.componentAction.destroy&&e.componentAction.destroy(e.element,e.props);r.delete(t);const s=n.get(t);s?(s.destroy(),n.delete(t),e.debug&&(console.groupCollapsed(`component destroyed ${t}`),console.log(Dt({components:n.keys(),actionsByInstance:r})),console.trace(),console.groupEnd())):console.warn(`No component to destroy! [${t}]`)}executeActions(){for(const t of r.values()){for(const e of t)if(void 0===e.element.vido){const t=n.get(e.instance);e.isActive=function(){return t&&!1===t.destroyed};const s=e.componentAction,i=s.create;if(void 0!==i){let t;t=i.prototype&&(i.prototype.isAction||i.prototype.update||i.prototype.destroy)||i.isAction?new i(e.element,e.props):i(e.element,e.props),void 0!==t&&("function"==typeof t?s.destroy=t:("function"==typeof t.update&&(s.update=t.update.bind(t)),"function"==typeof t.destroy&&(s.destroy=t.destroy.bind(t))))}}else e.element.vido=e.props,"function"==typeof e.componentAction.update&&e.isActive()&&e.componentAction.update(e.element,e.props);for(const e of t)e.element.vido=e.props}}updateTemplate(t){return t&&l.push(t),new Promise((t=>{const e=++h,s=this;c.then((function(){if(e===h){h=0,s.render();for(const t of l)t();l.length=0,t(null)}}))}))}createApp(t){o=t.element;const e=this.createComponent(t.component,t.props);return i=e.instance,this.render(),e}render(){const t=n.get(i);t?(C(t.update(),o),this.executeActions()):o&&o.remove()}}return new f}return zt.prototype.lithtml=U,zt.prototype.Action=Et,zt.prototype.Directive=W,zt.prototype.schedule=Lt,zt.prototype.detach=Mt,zt.prototype.styleMap=It,zt.prototype.classMap=Pt,zt.prototype.StyleMap=Xt,zt.prototype.PointerAction=Nt,zt.prototype.asyncAppend=pt,zt.prototype.asyncReplace=ut,zt.prototype.cache=vt,zt.prototype.guard=mt,zt.prototype.live=Ct,zt.prototype.ifDefined=yt,zt.prototype.repeat=$t,zt.prototype.unsafeHTML=_t,zt.prototype.until=xt,zt.prototype.Slots=Bt,zt}));
*/const Et=j(class extends W{constructor(t){var e;if(super(t),t.type!==D||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){var s,n;if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.et=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!(null===(s=this.et)||void 0===s?void 0:s.has(t))&&this.st.add(t);return this.render(e)}const i=t.element.classList;this.st.forEach((t=>{t in e||(i.remove(t),this.st.delete(t))}));for(const t in e){const s=!!e[t];s===this.st.has(t)||(null===(n=this.et)||void 0===n?void 0:n.has(t))||(s?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return _}});class St{constructor(){this.isAction=!0}}St.prototype.isAction=!0;const Tt={element:document.createTextNode(""),axis:"xy",threshold:10,onDown(){},onMove(){},onUp(){},onWheel(){}},Ht="undefined"!=typeof PointerEvent;let Nt=0;class Ut extends St{constructor(t,e){super(),this.moving="",this.initialX=0,this.initialY=0,this.lastY=0,this.lastX=0,this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onWheel=this.onWheel.bind(this),this.element=t,this.id=++Nt,this.options=Object.assign(Object.assign({},Tt),e.pointerOptions),Ht?(t.addEventListener("pointerdown",this.onPointerDown),document.addEventListener("pointermove",this.onPointerMove),document.addEventListener("pointerup",this.onPointerUp)):(t.addEventListener("touchstart",this.onPointerDown),document.addEventListener("touchmove",this.onPointerMove,{passive:!1}),document.addEventListener("touchend",this.onPointerUp),document.addEventListener("touchcancel",this.onPointerUp),t.addEventListener("mousedown",this.onPointerDown),document.addEventListener("mousemove",this.onPointerMove,{passive:!1}),document.addEventListener("mouseup",this.onPointerUp))}normalizeMouseWheelEvent(t){let e=t.deltaX||0,s=t.deltaY||0,n=t.deltaZ||0;const i=t.deltaMode,o=parseInt(getComputedStyle(t.target).getPropertyValue("line-height"));let r=1;switch(i){case 1:r=o;break;case 2:r=window.height}return e*=r,s*=r,n*=r,{x:e,y:s,z:n,event:t}}onWheel(t){const e=this.normalizeMouseWheelEvent(t);this.options.onWheel(e)}normalizePointerEvent(t){let e={x:0,y:0,pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0,event:t};switch(t.type){case"wheel":const s=this.normalizeMouseWheelEvent(t);e.x=s.x,e.y=s.y,e.pageX=e.x,e.pageY=e.y,e.screenX=e.x,e.screenY=e.y,e.clientX=e.x,e.clientY=e.y;break;case"touchstart":case"touchmove":case"touchend":case"touchcancel":e.x=t.changedTouches[0].screenX,e.y=t.changedTouches[0].screenY,e.pageX=t.changedTouches[0].pageX,e.pageY=t.changedTouches[0].pageY,e.screenX=t.changedTouches[0].screenX,e.screenY=t.changedTouches[0].screenY,e.clientX=t.changedTouches[0].clientX,e.clientY=t.changedTouches[0].clientY;break;default:e.x=t.x,e.y=t.y,e.pageX=t.pageX,e.pageY=t.pageY,e.screenX=t.screenX,e.screenY=t.screenY,e.clientX=t.clientX,e.clientY=t.clientY}return e}onPointerDown(t){if("mousedown"===t.type&&0!==t.button)return;this.moving="xy";const e=this.normalizePointerEvent(t);this.lastX=e.x,this.lastY=e.y,this.initialX=e.x,this.initialY=e.y,this.options.onDown(e)}handleX(t){let e=t.x-this.lastX;return this.lastY=t.y,this.lastX=t.x,e}handleY(t){let e=t.y-this.lastY;return this.lastY=t.y,this.lastX=t.x,e}onPointerMove(t){if(""===this.moving||"mousemove"===t.type&&0!==t.button)return;const e=this.normalizePointerEvent(t);if("x|y"===this.options.axis){let s=0,n=0;("x"===this.moving||"xy"===this.moving&&Math.abs(e.x-this.initialX)>this.options.threshold)&&(this.moving="x",s=this.handleX(e)),("y"===this.moving||"xy"===this.moving&&Math.abs(e.y-this.initialY)>this.options.threshold)&&(this.moving="y",n=this.handleY(e)),this.options.onMove({movementX:s,movementY:n,x:e.x,y:e.y,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t})}else if("xy"===this.options.axis){let s=0,n=0;Math.abs(e.x-this.initialX)>this.options.threshold&&(s=this.handleX(e)),Math.abs(e.y-this.initialY)>this.options.threshold&&(n=this.handleY(e)),this.options.onMove({movementX:s,movementY:n,x:e.x,y:e.y,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t})}else if("x"===this.options.axis)("x"===this.moving||"xy"===this.moving&&Math.abs(e.x-this.initialX)>this.options.threshold)&&(this.moving="x",this.options.onMove({movementX:this.handleX(e),movementY:0,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t}));else if("y"===this.options.axis){let s=0;("y"===this.moving||"xy"===this.moving&&Math.abs(e.y-this.initialY)>this.options.threshold)&&(this.moving="y",s=this.handleY(e)),this.options.onMove({movementX:0,movementY:s,x:e.x,y:e.y,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t})}}onPointerUp(t){this.moving="";const e=this.normalizePointerEvent(t);this.options.onUp({movementX:0,movementY:0,x:e.x,y:e.y,initialX:this.initialX,initialY:this.initialY,lastX:this.lastX,lastY:this.lastY,event:t}),this.lastY=0,this.lastX=0}destroy(t){Ht?(t.removeEventListener("pointerdown",this.onPointerDown),document.removeEventListener("pointermove",this.onPointerMove),document.removeEventListener("pointerup",this.onPointerUp)):(t.removeEventListener("mousedown",this.onPointerDown),document.removeEventListener("mousemove",this.onPointerMove),document.removeEventListener("mouseup",this.onPointerUp),t.removeEventListener("touchstart",this.onPointerDown),document.removeEventListener("touchmove",this.onPointerMove),document.removeEventListener("touchend",this.onPointerUp),document.removeEventListener("touchcancel",this.onPointerUp))}}function Lt(t){let e=0;return function(s){e||(e=requestAnimationFrame((function(){e=0,t.apply(void 0,[s])})))}}function kt(t){return t&&t.constructor?"Object"===t.constructor.name:"object"==typeof t&&null!==t}function Dt(t,...e){const s=e.shift();if(kt(t)&&kt(s))for(const e in s)if(kt(s[e]))"function"==typeof s[e].clone?t[e]=s[e].clone():(void 0===t[e]&&(t[e]={}),t[e]=Dt(t[e],s[e]));else if(Array.isArray(s[e])){t[e]=new Array(s[e].length);let n=0;for(let i of s[e])kt(i)?"function"==typeof i.clone?t[e][n]=i.clone():t[e][n]=Dt({},i):t[e][n]=i,n++}else t[e]=s[e];return e.length?Dt(t,...e):t}function Bt(t){if(void 0!==t.actions){const e=t.actions.map((t=>{const e=Object.assign({},t),s=Object.assign({},e.props);return delete s.state,delete s.api,delete e.element,e.props=s,e}));t.actions=e}return Dt({},t)}class Ot{constructor(t,e){this.slotInstances={},this.destroyed=!1,this.vido=t,this.props=e,this.destroy=this.destroy.bind(this),this.change=this.change.bind(this),this.html=this.html.bind(this),this.getInstances=this.getInstances.bind(this),this.setComponents=this.setComponents.bind(this),this.vido.onDestroy((()=>{this.destroy()}))}setComponents(t){if(t&&!this.destroyed){for(const e in t){const s=t[e];void 0===this.slotInstances[e]&&(this.slotInstances[e]=[]);for(const t of this.slotInstances[e])t.destroy();this.slotInstances[e].length=0;for(const t of s)this.slotInstances[e].push(this.vido.createComponent(t,this.props))}this.vido.update()}}destroy(){if(!this.destroyed){for(const t in this.slotInstances){for(const e of this.slotInstances[t])e.destroy();this.slotInstances[t].length=0}this.destroyed=!0}}change(t,e){if(!this.destroyed)for(const s in this.slotInstances){const n=this.slotInstances[s];for(const s of n)s.change(t,e)}}getInstances(t){return this.destroyed?[]:void 0===t?this.slotInstances:this.slotInstances[t]}html(t,e){if(this.destroyed)return;if(!this.slotInstances[t]||0===this.slotInstances[t].length)return e;let s=e;for(const e of this.slotInstances[t])s=e.html(s);return s}getProps(){return this.props}isDestroyed(){return this.destroyed}}class Rt extends W{update(t,e){if("function"!=typeof e[0])throw new Error("[vido] GetElementDirective argument should be a function.");(0,e[0])(t.element)}render(){return b}}function jt(t,e){let s=0;const n=new Map;let i,o,r=new Map,h=0;const l=[],c=Promise.resolve(),a={},d=function(t){return class extends W{update(e,s){const n=e.element,i=s[0],o=s[1],r=s[2];for(const e of o)if(void 0!==e){let s;if(t.has(i))for(const o of t.get(i))if(o.componentAction.create===e&&o.element===n){s=o;break}if(s)s.props=r;else{void 0!==n.vido&&delete n.vido;const s={instance:i,componentAction:{create:e,update(){},destroy(){}},element:n,props:r};let o=[];t.has(i)&&(o=t.get(i)),o.push(s),t.set(i,o)}}}render(t,e,s){return b}}}(r);class u{constructor(t){this.instance=t}create(t,e){const s=j(d);return()=>s(this.instance,t,e)}}const p=function(t,e,s){return class{constructor(t,e,s={}){this.destroyed=!1,this.instance=t,this.name=e.name,this.vidoInstance=e,this.props=s,this.destroy=this.destroy.bind(this),this.update=this.update.bind(this),this.change=this.change.bind(this),this.html=this.html.bind(this)}destroy(){this.destroyed||(this.vidoInstance.debug&&(console.groupCollapsed(`destroying component ${this.instance}`),console.log(s({components:t.keys(),actionsByInstance:e})),console.trace(),console.groupEnd()),this.vidoInstance.destroyComponent(this.instance,this.vidoInstance),this.destroyed=!0)}update(n){return this.vidoInstance.debug&&(console.groupCollapsed(`updating component ${this.instance}`),console.log(s({components:t.keys(),actionsByInstance:e})),console.trace(),console.groupEnd()),this.vidoInstance.updateTemplate(n)}change(n,i={}){this.vidoInstance.debug&&(console.groupCollapsed(`changing component ${this.instance}`),console.log(s({props:this.props,newProps:n,components:t.keys(),actionsByInstance:e})),console.trace(),console.groupEnd());const o=t.get(this.instance);o&&o.change(n,i)}html(e={}){const s=t.get(this.instance);if(s&&!s.destroyed)return s.update(e,this.vidoInstance)}_getComponents(){return t}_getActions(){return e}}}(n,r,Bt),v=function(t,e,s){return class{constructor(t,e,s){this.destroyed=!1,this.instance=t,this.vidoInstance=e,this.renderFunction=s,this.destroy=this.destroy.bind(this),this.update=this.update.bind(this),this.change=this.change.bind(this)}destroy(){if(!this.destroyed){this.vidoInstance.debug&&(console.groupCollapsed(`component destroy method fired ${this.instance}`),console.log(s({props:this.vidoInstance.props,components:t.keys(),destroyable:this.vidoInstance.destroyable,actionsByInstance:e})),console.trace(),console.groupEnd()),this.content&&"function"==typeof this.content.destroy&&this.content.destroy();for(const t of this.vidoInstance.destroyable)t();this.vidoInstance.onChangeFunctions.length=0,this.vidoInstance.destroyable.length=0,this.vidoInstance.destroyed=!0,this.destroyed=!0,this.vidoInstance.update()}}update(n={}){return this.vidoInstance.debug&&(console.groupCollapsed(`component update method fired ${this.instance}`),console.log(s({components:t.keys(),actionsByInstance:e})),console.trace(),console.groupEnd()),this.renderFunction(n)}change(n,i={leave:!1}){const o=n;this.vidoInstance.debug&&(console.groupCollapsed(`component change method fired ${this.instance}`),console.log(s({props:o,components:t.keys(),onChangeFunctions:this.vidoInstance.onChangeFunctions,changedProps:n,actionsByInstance:e})),console.trace(),console.groupEnd());for(const t of this.vidoInstance.onChangeFunctions)t(n,i)}}}(n,r,Bt);class f{constructor(s="",i=""){this.instance="",this.name="",this.destroyable=[],this.destroyed=!1,this.onChangeFunctions=[],this.debug=!1,this.state=t,this.api=e,this.lastProps={},this.html=$,this.svg=A,this.directive=j,this.asyncAppend=pt,this.asyncReplace=ut,this.cache=vt,this.classMap=Et,this.styleMap=It,this.StyleMap=Pt,this.guard=yt,this.live=Ct,this.ifDefined=mt,this.repeat=$t,this.unsafeHTML=_t,this.until=xt,this.schedule=Lt,this.getElement=j(Rt),this.actionsByInstance=()=>{},this.detach=Mt,this.PointerAction=Ut,this.Action=St,this.Slots=Ot,this._components=n,this._actions=r,this.instance=s,this.reuseComponents=this.reuseComponents.bind(this),this.onDestroy=this.onDestroy.bind(this),this.onChange=this.onChange.bind(this),this.update=this.update.bind(this),this.destroyComponent=this.destroyComponent.bind(this);for(const t in a)this[t]=a[t].bind(this);this.name=i,this.Actions=new u(s)}static addMethod(t,e){a[t]=e}onDestroy(t){this.destroyable.push(t)}onChange(t){this.onChangeFunctions.push(t)}update(t){return this.updateTemplate(t)}reuseComponents(t,e,s,n,i=!0,o=!1){const r=[],h=t.length,l=e.length;let c=!1;!i||void 0!==e&&0!==e.length||(c=!0);let a=0;if(h<l){let i=l-h;for(;i;){const o=e[l-i],h=this.createComponent(n,s(o));t.push(h),r.push(h),i--}}else if(h>l){let e=h-l;for(i&&(c=!0,a=h-e);e;){const s=h-e;i||(r.push(t[s]),t[s].destroy()),e--}i||(t.length=l)}let d=0;o&&console.log("modified components",r),o&&console.log("current components",t),o&&console.log("data array",e);for(const n of t){const t=e[d];o&&console.log(`reuse components data at '${d}'`,t),n&&!r.includes(n)&&(o&&console.log("getProps fn result",s(t)),n.change(s(t),{leave:c&&d>=a})),d++}}createComponent(t,e={}){const i=t.name+":"+s++;let o;o=new f(i,t.name);const h=new p(i,o,e),l=new v(i,o,t(o,e));return n.set(i,l),n.get(i).change(e),o.debug&&(console.groupCollapsed(`component created ${i}`),console.log(Bt({props:e,components:n.keys(),actionsByInstance:r})),console.trace(),console.groupEnd()),h}destroyComponent(t,e){if(e.debug&&(console.groupCollapsed(`destroying component ${t}...`),console.log(Bt({components:n.keys(),actionsByInstance:r})),console.trace(),console.groupEnd()),r.has(t))for(const e of r.get(t))"function"==typeof e.componentAction.destroy&&e.componentAction.destroy(e.element,e.props);r.delete(t);const s=n.get(t);s?(s.destroy(),n.delete(t),e.debug&&(console.groupCollapsed(`component destroyed ${t}`),console.log(Bt({components:n.keys(),actionsByInstance:r})),console.trace(),console.groupEnd())):console.warn(`No component to destroy! [${t}]`)}executeActions(){for(const t of r.values()){for(const e of t)if(void 0===e.element.vido){const t=n.get(e.instance);e.isActive=function(){return t&&!1===t.destroyed};const s=e.componentAction,i=s.create;if(void 0!==i){let t;t=i.prototype&&(i.prototype.isAction||i.prototype.update||i.prototype.destroy)||i.isAction?new i(e.element,e.props):i(e.element,e.props),void 0!==t&&("function"==typeof t?s.destroy=t:("function"==typeof t.update&&(s.update=t.update.bind(t)),"function"==typeof t.destroy&&(s.destroy=t.destroy.bind(t))))}}else e.element.vido=e.props,"function"==typeof e.componentAction.update&&e.isActive()&&e.componentAction.update(e.element,e.props);for(const e of t)e.element.vido=e.props}}updateTemplate(t){return t&&l.push(t),new Promise((t=>{const e=++h,s=this;c.then((function(){if(e===h){h=0,s.render();for(const t of l)t();l.length=0,t(null)}}))}))}createApp(t){o=t.element;const e=this.createComponent(t.component,t.props);return i=e.instance,this.render(),e}render(){const t=n.get(i);t?(C(t.update(),o),this.executeActions()):o&&o.remove()}}return new f}return jt.prototype.lithtml=k,jt.prototype.Action=St,jt.prototype.Directive=W,jt.prototype.schedule=Lt,jt.prototype.detach=Mt,jt.prototype.styleMap=It,jt.prototype.classMap=Et,jt.prototype.StyleMap=Pt,jt.prototype.PointerAction=Ut,jt.prototype.asyncAppend=pt,jt.prototype.asyncReplace=ut,jt.prototype.cache=vt,jt.prototype.guard=yt,jt.prototype.live=Ct,jt.prototype.ifDefined=mt,jt.prototype.repeat=$t,jt.prototype.unsafeHTML=_t,jt.prototype.until=xt,jt.prototype.Slots=Ot,jt}));
//# sourceMappingURL=vido.umd.min.js.map
{
"name": "@neuronet.io/vido",
"version": "4.1.4",
"version": "4.1.5",
"description": "Compilation-less and eval free frontend framework for fast scalable apps.",

@@ -5,0 +5,0 @@ "main": "dist/vido.js",

@@ -13,4 +13,4 @@ import { AttributePart } from 'lit-html/directive.js';

toString(): string;
updateStyle(elementStyle: any, currentElementStyles: any, styleParts: any): void;
updateStyle(elementStyle: any, currentElementStyles: any, style: any): void;
execute(part: AttributePart): void;
}

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 too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc