taggedjs 2.8.35 → 2.8.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle.js +1 -1
- package/bundle.js.map +1 -1
- package/js/render/update/updateExistingTagComponent.function.js.map +1 -1
- package/js/tag/Tag.type.d.ts +5 -3
- package/js/tag/checkTagValueChange.function.d.ts +1 -1
- package/js/tag/getDomTag.function.js +27 -13
- package/js/tag/getDomTag.function.js.map +1 -1
- package/js/tagJsVars/getInnerHTML.function.d.ts +5 -1
- package/js/tagJsVars/getInnerHTML.function.js.map +1 -1
- package/package.json +1 -1
package/bundle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function n(t){return t.renderCount=t.renderCount||0,t.global={}}t.d(e,{W9:()=>Xe,cg:()=>A,m0:()=>E,rS:()=>Hn,Y2:()=>r,ei:()=>qe,B7:()=>yt,TU:()=>vt,XF:()=>Qe,PC:()=>Ze,Ot:()=>Ve,Mj:()=>Me,tD:()=>O,j8:()=>pn,xe:()=>eo,um:()=>ln,E2:()=>Ye,OH:()=>tn,TB:()=>Qt,Ii:()=>Nt,m3:()=>ke,yV:()=>un,zV:()=>ht,pf:()=>ce,ze:()=>Ke,WJ:()=>wt,Ng:()=>Ht,HG:()=>Gr,aZ:()=>Kt,Ey:()=>Yt,O:()=>Zt,F3:()=>an,Ie:()=>x,ts:()=>Ce,B4:()=>oe,Az:()=>H,Xi:()=>Zr,sV:()=>co,Ah:()=>n,ck:()=>qr,Gk:()=>mn,j_:()=>je,zC:()=>Wn,cF:()=>uo,jU:()=>W,PB:()=>N,qy:()=>Qr,cy:()=>K,Tn:()=>Q,Gv:()=>Y,yL:()=>q,D8:()=>G,Ze:()=>z,_4:()=>X,mn:()=>Z,z:()=>Fe,sA:()=>rn,TG:()=>Se,MG:()=>nn,PL:()=>xn,CG:()=>ro,nI:()=>Nr,PZ:()=>le,r5:()=>ze,uc:()=>Yn,pG:()=>Pn,QB:()=>Xn,Ll:()=>Ct,vP:()=>Ie,wk:()=>We,xP:()=>Ue,bc:()=>_e,B1:()=>on,RX:()=>sn,ag:()=>en,Tc:()=>Nn,Hf:()=>no,_A:()=>yn,Ag:()=>se,NU:()=>o,wB:()=>Re,id:()=>Le,MC:()=>He,SZ:()=>Ne});class r{get(t){return"todo"}}const o=":tagvar",s=":";function c(t){if(t.startsWith("class."))return"class";const e=function(t){switch(t){case"autoselect":return"autoselect";case"autofocus":return"autofocus";case"oninit":case"init":return"oninit";case"ondestroy":case"destroy":return"destroy"}return!1}(t);return!1!==e||!!t.startsWith("style.")&&"style"}const u=new RegExp(o+"(\\d+)"+s,"g");function a(t){return t.search&&t.startsWith(o)?t.search(u):-1}const i=/(:tagvar\d+:)/,l="ondoubleclick",p=/([:_a-zA-Z0-9\-.]+)\s*(?:=\s*"([^"]*)"|=\s*(\S+))?/g,f=/<\/?([a-zA-Z0-9-]+)((?:\s+[a-zA-Z_:*][\w:.-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)+\s*|\s*)\/?>/g;function d(t){const e=[],n=[],r=[];let c=null,u=-1,a=0;const l=new RegExp(f,"g");for(t=function(t){return t.replace(g,(function(t){return t.replace(/\[l t\]/g,"[l t]").replace(/\[g t\]/g,"[g t]").replace(/</g,"[l t]").replace(/>/g,"[g t]")}))}(t);a<t.length;){const f=l.exec(t);if(!f)break;const[d,g,b]=f,y=d.startsWith("</"),w=d.endsWith("/>");if(a<f.index){const e=t.slice(a,f.index);if(e.trim()){const t=m(e);for(let e of t)e.startsWith(o)&&e.search(i)>=0&&-1===e.search(k)&&(e=o+ ++u+s),h(c,n,e)}}if(a=f.index+d.length,y){c=r.pop()||null;continue}const T=[];let C;for(;null!==(C=p.exec(b));)u=v(C,u,e,T);const S={nn:g};T.length&&(S.at=T),c?(c.ch||(c.ch=[]),c.ch.push(S)):n.push(S),w||(r.push(c),c=S)}if(a<t.length){const e=t.slice(a);if(e.trim()){const t=m(e);for(const e of t)e.startsWith(o)&&++u,h(c,n,e)}}return n}const g=new RegExp("(\x3c!--[\\s\\S]*?--\x3e)","g");function h(t,e,n){!function(t,e,n){t?(t.ch||(t.ch=[]),t.ch.push(n)):e.push(n)}(t,e,{nn:"text",tc:b(n)})}function b(t){return t.replace(/(\[l t\]!--[\s\S]*?--\[g t\])/g,(function(t){return t.replace(/\[l t\]/g,"<").replace(/\[g t\]/g,">").replace(/\[l t\]/g,"[l t]").replace(/\[g t\]/g,"[g t]")}))}function m(t){return t.split(i).filter(y)}function y(t){return""!==t}function v(t,e,n,r){const a=t[1]||t[3]||t[5];let i=t[2]||t[4]||t[6];if(void 0===a)return e;const p=""!==t[2],f=void 0===i&&p,d=a.toLowerCase(),g=d.startsWith("on")?function(t){if(t.startsWith("on"))return t.length===l.length&&t===l?"dblclick":t.slice(2,t.length);return t}(d):d;if(f){if(a.slice(0,o.length)===o){const t=o+ ++e+s;return n.push(["at",t]),r.push([t]),e}if(t[0].startsWith(a)&&t[0].slice(a.length,t[0].length).search(/\s+$/)>=0)return r.push([g]),e;const c=t[3];if(c.search(k)>=0){i=c;const t=[g,i];return r.push(t),e}i=o+ ++e+s}p||(i=t[2]);const h=i.split(T).filter((t=>t.length>0));h.length>1&&(i=h,h.forEach((t=>{t.search(u)>=0&&++e})));const b=[g,i],m=c(d);return m&&b.push(m),r.push(b),e}const w=new RegExp(o+"(\\d+)"+s,"gi"),T=new RegExp("("+o+"\\d+"+s+")","gi"),C=o.slice(0,o.length-1),k=new RegExp(C+"r(\\d+)"+s,"gi"),S=C+"r$1"+s;function j(t,e){const n=function(t,e){const n=t;return function(t,e){const n=[];for(let r=0;r<t.length;++r){const c=t[r].replace(w,S);r<e.length?n.push(c+o+r+s):n.push(c)}return function(t,e,n){const r=n.length-e.length;if(r>0)for(let n=r;n>0;--n)t.push(o+(e.length+n-1)+s)}(n,t,e),n}(n,e)}(t,e).join("");return d(n)}const x="";var E,A;!function(t){t.string="string",t.number="number",t.boolean="boolean",t[void 0]="undefined"}(E||(E={})),function(t){t.function="function",t.date="date",t.unknown="unknown",t.object="object"}(A||(A={}));const O={tag:"html",dom:"dom",templater:"templater",tagComponent:"tagComponent",tagArray:"tagArray",subscribe:"subscribe",signal:"signal",renderOnce:"renderOnce",stateRender:"stateRender",version:Date.now()},P="ch";function I(t,e,n=[],r=[]){const o=t;for(let t=0;t<o.length;t++){const s=[...r,t],c=o[t];if(c.at){const t=c.at;c.at=V(t,e)}if(c.ch){const t=c.ch,r=[...s,P];c.ch=I(t,e,n,r)}t=J(c,e,o,t)}return o}function J(t,e,n,r){if("text"!==t.nn)return r;const c=t;let a,i=c.tc;if(typeof i!==E.string)return r;for(;null!==(a=u.exec(i));){const t=a[1],c=parseInt(t,10);if(!isNaN(c)&&c<e){const t=o+c+s,e=i.slice(a.index+t.length);n.splice(r,1,{nn:"text",v:c}),i=e,u.lastIndex=0}}return c.tc=i,r}function V(t,e){const n=[];for(const r of t){const[t,s,c]=r;if(t.startsWith(o)){const r=parseInt(t.replace(o,""),10);if(!isNaN(r)&&r<e){n.push([{tagJsVar:r}]);continue}}if(typeof s===E.string&&s.startsWith(o)){const r=parseInt(s.replace(o,""),10);if(!isNaN(r)&&r<e){n.push([t,{tagJsVar:r},c]);continue}}n.push(r)}return n}function M(t){return t.length}const L={};function H(t,e){const n=function(t){const e=t.map(M);return e.push(t.length),Number(e.join(""))}(t),r=L[n],o=r&&function(t,e,n){if(n&&n.strings.length===t.length&&n.strings.every(((e,n)=>e===t[n]))&&n.values.length===e.length)return!0;return!1}(t,e,r);if(o)return r.domMetaMap;const s=I(j(t,e),e.length),c={interpolation:void 0,string:void 0,strings:t,values:e,domMetaMap:s};return L[n]=c,s}function N(t,e,n){Jr.push([W,[t,e,n]])}function W(t,e,n){void 0!==n&&!1!==n&&null!==n?t.setAttribute(e,n):t.removeAttribute(e)}function R(t,e,n,r,o,s){switch(r){case"init":{const t=s.added++;return void Lr.push([F,[n,t,e]])}case"destroy":{const t=s.removed++,r=o.subject.global;return r.destroys=r.destroys||[],void r.destroys.push((()=>e({target:n,stagger:t})))}case"autofocus":return void Lr.push([U,[n]]);case"autoselect":return void Lr.push([_,[n]]);case"style":{const r=t.split(".");return void Jr.push([D,[n,r,e]])}case"class":return void function(t,e,n){const r=t.split(".");if(r.shift(),e){for(const t of r)Jr.push([B,[n,t]]);return}for(const t of r)Jr.push([$,[n,t]])}(t,e,n)}throw new Error(`Invalid special attribute of ${r}. ${t}`)}function D(t,e,n){const r=e[1];t.style[r]=n,t.style.setProperty(r,n)}function B(t,e){t.classList.add(e)}function $(t,e){t.classList.remove(e)}function _(t){t.select()}function U(t){t.focus()}function F(t,e,n){n({target:t,stagger:e})}function G(t){switch(t){case E.string:case E.number:case E.boolean:return!0}return!1}function z(t){if(!t)return!1;switch(t.tagJsType){case O.dom:case O.tag:case O.templater:return!0}return!1}function Z(t){const e=t?.tagJsType;return e===O.tagComponent||e===O.stateRender}function X(t){return Y(t)&&typeof t.subscribe===A.function}function q(t){return t&&Q(t.then)}function Q(t){return typeof t===A.function}function Y(t){return typeof t===A.object&&null!==t}function K(t){return Array.isArray(t)}function tt(t,e){return et(t,e)}function et(t,e){if(null===t||typeof t!==A.object)return t;if(e<0)return t;if(t instanceof Date)return new Date(t);if(t instanceof RegExp)return new RegExp(t);const n=K(t)?[]:Object.create(Object.getPrototypeOf(t));if(K(t))for(let r=0;r<t.length;r++)n[r]=et(t[r],e-1);else for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=et(t[r],e-1));return n}function nt(t,e,n){return rt(t,e,n)}function rt(t,e,n){return!(t!==e&&(r=t,o=e,!Q(r)||!Q(o)||r.toString()!==o.toString()))||(n<0||typeof t===A.object&&typeof e===A.object&&(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():K(t)&&K(e)?function(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!rt(t[r],e[r],n-1))return!1;return!0}(t,e,n-1):!K(t)&&!K(e)&&function(t,e,n){const r=Object.keys(t),o=Object.keys(e);if(0===r.length&&0===o.length)return!0;if(r.length!==o.length)return!1;for(const s of r){if(!o.includes(s)||!rt(t[s],e[s],n-1))return!1}return!0}(t,e,n-1)));var r,o}function ot(){return Ct.stateConfig.support}function st(t){let e=t;for(;e.ownerSupport&&!Z(e.templater);)e=e.ownerSupport;return e.subject.global.newest||e}function ct(...t){return t}function ut(t){const e=Ct.stateConfig;return e.states[e.statesIndex]=t,++e.statesIndex,t(ct)}function at(t){const e=Ct.stateConfig,n=e.statesIndex,r=st(e.prevSupport).states[n];let o=[];r((function(...t){return o=t,t}));return e.states[e.statesIndex]=t,++e.statesIndex,t((function(...t){return o}))}function it(t,e){e.handlers.handler=gt,e.handlers.statesHandler=ut,e.rearray=[],e.stateArray=[],e.states=[],e.statesIndex=0,e.support=t}function lt(t,e,n,r){n.rearray=r,n.stateArray=[],n.states=[],n.statesIndex=0,n.handlers.handler=dt,n.handlers.statesHandler=at,n.prevSupport=e}class pt{}function ft(t){const e=t.callback;if(!e)return t.defaultValue;const[n]=function(t){const[e]=t(pt),[n]=t(e);return[e,n]}(e);return n}function dt(){const t=Ct.stateConfig,e=t.rearray[t.stateArray.length];return t.stateArray.push(e),e.defaultValue}function gt(t){const e=Ct.stateConfig;let n=t;if(typeof t===A.function&&(n=t()),typeof n===A.function){const t=n;n=function(...e){return t(...e)},n.original=t}const r={get:function(){return ft(r)},defaultValue:n};return e.stateArray.push(r),n}function ht(t){const e=new yt;return e.subscribeWith=e=>{const n=[],r=[],o=(o,s)=>{n[s]=!0,r[s]=o;if(n.length===t.length){for(const t of n)if(!t)return;e(r,c)}},s=[...t],c=s.shift().subscribe((t=>o(t,0))),u=s.map(((t,e)=>t.subscribe((t=>o(t,e+1)))));return c.subscriptions=u,c},e}function bt(t,e,n){const r=yt.globalSubCount$;yt.globalSubCount$.next(r.value+1);const o=function(){o.unsubscribe()};return o.callback=e,o.subscriptions=[],o.unsubscribe=function(){return function(t,e,n){!function(t,e){const n=t.findIndex((t=>t.callback===e));-1!==n&&t.splice(n,1)}(e,n);const r=yt.globalSubCount$;yt.globalSubCount$.next(r.value-1),t.unsubscribe=()=>t;const o=t.subscriptions;for(const t of o)t.unsubscribe();return t}(o,n,e)},o.add=t=>(o.subscriptions.push(t),o),o.next=t=>{e(t,o)},o}function mt(t,e,n){const r=[...e],o=r.shift(),s=t=>{if(r.length)return mt(t,r,n);n(t)};let c=s;const u=o(t,{setHandler:t=>c=t,next:s});c(u)}class yt{value;onSubscription;methods=[];isSubject=!0;subscribers=[];subscribeWith;constructor(t,e){this.value=t,this.onSubscription=e}subscribe(t){const e=bt(0,t,this.subscribers),n=this.subscribeWith;if(n){if(this.methods.length){const n=t;t=t=>{mt(t,this.methods,(t=>n(t,e)))}}return n(t)}return this.subscribers.push(e),this.onSubscription&&this.onSubscription(e),e}next(t){this.value=t,this.emit()}set=this.next.bind(this);emit(){const t=this.value,e=this.subscribers;for(const n of e)n.callback(t,n)}toPromise(){return new Promise((t=>{this.subscribe(((e,n)=>{n.unsubscribe(),t(e)}))}))}toCallback(t){const e=this.subscribe(((n,r)=>{const o=r?.unsubscribe;o?o():setTimeout((()=>e.unsubscribe()),0),t(n)}));return this}pipe(...t){const e=new yt(this.value);return e.setMethods(t),e.subscribeWith=t=>this.subscribe(t),e.next=t=>this.next(t),e}setMethods(t){this.methods=t}static all(t){return ht(t.map((t=>{if(X(t))return t;return new yt(t,(e=>(e.next(t),e)))})))}static globalSubCount$=new yt(0)}class vt extends yt{value;onSubscription;_value;constructor(t,e){super(t,e),this.value=t,this.onSubscription=e,this._value=t,wt(this)}next(t){this._value=t,this.emit()}emit(){const t=this._value,e=this.subscribers;for(const n of e)n.callback(t,n)}}function wt(t){Object.defineProperty(t,"value",{set(e){t._value=e,t.emit()},get:()=>t._value})}const Tt=new yt(void 0,(function(t){ot()||t.next()})),Ct={stateConfig:{stateArray:[],version:Date.now(),handlers:{handler:gt,statesHandler:ut}},tagClosed$:Tt};function kt(t,e){for(let n=0;n<t.length;++n){Et(t[n],e[n])}}let St;function jt(...t){return St=t,t}function xt(){return St}function Et(t,e){t(jt,1),e(xt,2)}function At(t,e,n,r){for(let n=t.length-1;n>=0;--n){const r=t[n].get(),o=e[n].callback;o&&o(r)}for(let t=r.length-1;t>=0;--t){Pt.length=0,Ot=0;(0,r[t])(It),n[t](Jt)}}let Ot=0;const Pt=[];function It(...t){return Pt.push(t),t}function Jt(...t){return Pt[Ot++]}function Vt(t){switch(t){case void 0:case!1:case null:return x}return t}function Mt(t){return{tagJsType:"simple",value:t,processInit:Lt,checkValueChange:Nt,delete:Ht}}function Lt(t,e,n,r,o,s){const c=Vt(t);s=e.placeholder;const u=e.paint=[_r,[s,c,t=>{e.simpleValueElm=t,delete e.paint}]];Ir.push(u)}function Ht(t){const e=t.simpleValueElm;if(delete t.simpleValueElm,delete t.tagJsVar,void 0===t.paint)Ir.push([Wr,[e]]);else{const e=Ir.findIndex((e=>e===t.paint));Ir.splice(e,1)}}function Nt(t,e){return null==t||typeof t!==A.object?(function(t,e){const n=Vt(t);if(e.paint)return void(e.paint[1][1]=n);const r=e.simpleValueElm;Vr.push([n,r])}(t,e),-1):(Ht(e),6)}function Wt(t,e){const n=e.providers;if(n)for(const t of n)for(let n=t.children.length-1;n>=0;--n){t.children[n].subject.global===e&&t.children.splice(n,1)}e.destroy$&&e.destroy$.next(),t.subject.renderCount=0}function Rt(t,e){for(const n of t){const t=n.lastArray;if(t){Rt(t,e);continue}const r=n.value;if(r?.tagJsType===O.subscribe){r.delete(n,e);continue}const o=n.global;if(!o)continue;const s=o.newest,c=o.subscriptions;c&&c.forEach(Bt),Z(s.templater)&&Wt(s,o);Rt(o.context,s)}}function Dt(t,e=[],n=[]){for(const r of t){const t=r.global;if(!t)continue;const o=t.newest;if(o){e.push(o);const r=t.subscriptions;r&&n.push(...r)}const s=t.context;s&&Dt(s,e,n)}return{tags:e,subs:n}}function Bt(t){t.unsubscribe()}function $t(t,e){const n=t.context,r=t.destroys;if(r)return function(t,e,n){if(_t.length=0,t.forEach(Ut),_t.length){const t=Promise.all(_t).then((()=>{++Hr.locks,Ft(e.context,n),Gt(e),--Hr.locks,Nr()}));return void n.push(t)}++Hr.locks,Ft(e.context,n),Gt(e),--Hr.locks,Nr()}(r,t,e);Ft(n,e),Gt(t)}const _t=[];function Ut(t){const e=t();e instanceof Promise&&_t.push(e)}function Ft(t,e){for(const n of t){if(n.withinOwnerElement)continue;const t=n.lastArray;if(t){Kt(n,t);continue}const r=n.simpleValueElm;if(r){delete n.simpleValueElm,Ir.push([Wr,[r]]);continue}const o=n.global;if(void 0===o)continue;if(!0===o.deleted)continue;o.deleted=!0;o.oldest&&$t(o,e)}}function Gt(t){t.htmlDomMeta.forEach(zt)}function zt(t){const e=t.marker;e&&Ir.push([Wr,[e]]);const n=t.domElement;n&&Ir.push([Wr,[n]])}function Zt(t,e){const n=t.subject;e.deleted=!0,n.renderCount=0;const r=[];return Rt(e.context,t),e.destroy$&&Wt(t,e),$t(e,r),r}function Xt(t,e,n,r){const o=t.length-1,s=e-r,c=s<0||o<s,u=n[e];if(c)return qt(u),1;const a=function(t,e,n,r,o){const s=e&&t!==e.arrayValue;if(s)return qt(n),r.splice(o,1),2;return 0}(u.value.arrayValue,t[e],u,n,e);return a}function qt(t){!function(t,e){if(t){return void Zt(t.oldest,t)}const n=e.simpleValueElm;delete e.simpleValueElm,Ir.push([Wr,[n]])}(t.global,t)}function Qt(t,e){return!K(t)&&(Yt(e),9)}function Yt(t){Kt(t,t.lastArray)}function Kt(t,e){for(let t=0;t<e.length;++t)qt(e[t]);delete t.lastArray}function te(t){return t.map(ee)}function ee(t,e){const n=t,r=t?.tagJsType;if(r)switch(r){case O.signal:case O.subscribe:case O.stateRender:return;case O.dom:case O.tag:case O.templater:return te(n.values)}return K(t)?te(n):tt(t,e)}function ne(t){return ee(t,$n)}function re(t){return ee(t,_n)}function oe(t,e,n){const r={templater:t,subject:e,castedProps:n,appSupport:void 0},o=e.global;return o.blocked=[],o.destroy$=new yt,r}function se(t,e,n,r){e.appSupport=n;const o=t.props;return o&&(e.propsConfig=function(t,e,n){const r=t.templater;if(r.tagJsType!==O.stateRender){switch(r.propWatch){case Hn.IMMUTABLE:return t.propsConfig={latest:e,castProps:n};case Hn.SHALLOW:return t.propsConfig={latest:e.map(ne),castProps:n}}return t.propsConfig={latest:e.map(re),castProps:n}}}(e,o,r)),e}function ce(t,e,n,r,o){const s={templater:t,subject:r,castedProps:o,appSupport:void 0};return s.ownerSupport=e,s.appSupport=n,s}function ue(t,e,n,r,o){const s=oe(t,r,o);return s.ownerSupport=e,se(t,s,n,o)}function ae(t,e,n,r,o){t!==n.value&&Ce(n,t,e,o)}function ie(t,e,r,o){if(!e.global.newest)return void t.processInit(t,e,r,o,void 0,e.placeholder);!function(t,e,r){const o=r.global,s=o.newest,c=s.templater.wrapper,u=e.templater.wrapper;let a=!1;const i=e.templater.tagJsType,l=O.stateRender===i||O.renderOnce===i;if(l)a=e.templater.tagJsType===O.renderOnce||cn(s,e);else if(c&&u){a=c.original===u.original}const p=e.templater;if(!a)return void function(t,e,r){const o=t.global,s=o.oldest;Zt(s,o),n(t),e.processInit(e,t,r,{added:0,removed:0},void 0,t.placeholder)}(r,p,t);const f=l||function(t,e){const n=e.props,r=t.propsConfig,o=r.latest,s=Wn(n,o,t.templater.propWatch);return s}(s,p);if(!f){return void function(t,e,n,r,o){const s=t.props,c=Gn(e,n,r,s,o),u=e.propsConfig;u.castProps=c;const a=n.propsConfig;a.latest=u.latest}(p,e,s,t,p.propWatch===Hn.DEEP?_n:$n)}if(o.locked)return void o.blocked.push(e);Yn(e),++r.renderCount}(r,ue(t,r,r.appSupport,e),e)}function le(t,e,n,r,o,s){const c=me(t);return e.tagJsVar=c,c.processInit(t,e,n,r,o,s)}function pe(t,e,n,r,o,s){n.handler=ae;e.subject.global.locked=!0,le(t,n,e,r,o,s);delete e.subject.global.locked,n.value=t}function fe(t,e,n,r,o){const s=document.createTextNode(x),c={value:t,withinOwnerElement:!1,placeholder:s};return o||Ir.push([Rr,[r,s]]),pe(t,e,c,n,o,r),o&&Mr.push([Dr,[o,s]]),c}function de(t,e,n,r,o){const s=void 0===t.lastArray;s&&(t.lastArray=[]);const c=t.lastArray;let u=t.placeholder,a=0;const i=[];if(!s){for(let t=0;t<c.length;++t){const n=c[t],r=Xt(e,t,c,a);0!==r?2!==r?a+=r:t-=1:i.push(n)}t.lastArray=i}const l=e.length;for(let s=0;s<l;++s){u=ge(e,s,t.lastArray,n,u,r,o).placeholder}}function ge(t,e,n,r,o,s,c){const u=t[e],a=n[e];if(a)return function(t,e,n,r,o,s,c,u){const a=n.length>o;if(a)return ae(t,r,e,0,c),e;const i=fe(t,r,c,s,u);return n.push(i),i}(u,a,n,r,e,o,s,c);const i=fe(u,r,s,o,c);return n.push(i),i}function he(t){return{tagJsType:"array",value:t,processInit:be,checkValueChange:Qt,delete:Yt}}function be(t,e,n,r,o){de(e,t,n,r,o)}function me(t){const e=t?.tagJsType;return e?t:function(t){if(K(t))return he(t);return Mt(t)}(t)}function ye(t,e,n,r,o){const s=t[e],c=n[e];if(s===c.value)return;(0,c.handler)(s,r,c,t,o),c.value=s,c.tagJsVar=me(s)}function ve(t,e){const n=t.subject.global.context;!function(t,e){const n=e.templater,r=e.templater.tag,o=n.values||r.values,s=t.templater.tag;s.values=o}(t,e),++Hr.locks,function(t,e){const n=t.templater.tag.values;let r=0;const o=n.length,s={added:0,removed:0};for(;r<o;)ye(n,r,e,t,s),++r}(t,n),--Hr.locks,Nr()}function we(t,e,r,o){if(Z(e))return void 0===t.global&&n(t),ie(e,t,r,o),!0;const s=t.global;if(s){const n=s.newest;if(n)return typeof e===A.function||function(t,e,n,r){const o=ue(n.templater||n,r,r.appSupport,e);ve(t.subject.global.oldest,o)}(n,t,e,r),!0}return e.processInit(e,t,r,o,void 0,t.placeholder),!0}function Te(t,e,n,r,o){const s=t&&t.tagJsType;if(s){if(s===O.renderOnce)return;we(e,t,n,o)}else{if(K(t))return de(e,t,n,o),void(e.tagJsVar=he(t));typeof t!==A.function?r&&function(t,e){e.value=t,e.tagJsVar=Mt(t);const n=e.placeholder,r=Vt(t),o=e.paint=[_r,[n,r,t=>{e.simpleValueElm=t,delete e.paint}]];Ir.push(o)}(t,e):e.value=t}}function Ce(t,e,n,r){const o=t.tagJsVar.checkValueChange(e,t,r);-1!==o&&Te(e,t,n,o,r)}function ke(t,e,n,r,o){if(!t||!t.tagJsType||t.tagJsType!==O.subscribe){return n.tagJsVar.delete(n,e),Te(t,n,e,99,o),99}const s=n.subContext;return s.hasEmitted?(s.callback=t.callback,s.valueHandler(s.lastValue),-1):-1}function Se(t,e,n,r,o){e.hasEmitted=!0,e.contextItem=fe(t,n,r,o)}function je(t,e){let n;return t&&(n=e=document.createTextNode(x),Mr.push([Dr,[t,e]])),{appendMarker:n,insertBefore:e}}function xe(t,e,n,r,o,s,c){const{appendMarker:u,insertBefore:a}=je(s,c),i=function(t,e,n,r,o){const s=st(e);let c=function(t){Se(t,i,e,n,r),c=function(t){Ce(i.contextItem,t,e,{added:0,removed:0}),a||Ct.stateConfig.support||Nr()}};function u(t){i.lastValue=t;const e=s.subject.global.newest;var n;n=s,kt(e.states,n.states),i.callback&&(t=i.callback(t)),c(t)}let a=!0;const i={valueHandler:u,callback:o};return i.subscription=t.subscribe(u),a=!1,i}(t,n,r,a,o);return i.appendMarker=u,e.subContext=i,e.handler=ke,i}function Ee(t,e){return t.subContext.subscription.unsubscribe(),Gr(t,e)}function Ae(t,e,n,r,o,s){return xe(t.Observable,e,n,r,t.callback,o,s)}function Oe(t,e,n,r,o,s){const c=t.Observable,u=xe(c,e,n,r,t.callback,o,s);return u.hasEmitted||u.valueHandler(c.value||t.withDefault),u}function Pe(t,e,n,r,o){xe(t,e,n,r,void 0,o)}function Ie(t){return ot()?We((()=>Je(t))):Je(t)}function Je(t){let e=t;const n=new Set;return{tagJsType:O.signal,processInit:Pe,get value(){return e},set value(t){e!==t&&(e=t,n.forEach((e=>e(t))))},subscribe(t){t(e),n.add(t);const r=()=>n.delete(t);return r.unsubscribe=r,r}}}class Ve extends yt{value;constructor(t){super(t),this.value=t}subscribe(t){const e=super.subscribe(t);return t(this.value,e),e}}class Me extends yt{value;constructor(t){super(t),this.value=t,this._value=t,wt(this)}subscribe(t){const e=super.subscribe(t);return t(this._value,e),e}}function Le(t){return(e,n)=>{n.setHandler((()=>{})),t(e,n.next)}}function He(t){return(e,n)=>{n.setHandler((()=>{}));t(e).then((t=>n.next(t)))}}const Ne=t=>(e,n)=>{n.setHandler((()=>{}));const r=t(e).subscribe((t=>{r.unsubscribe(),n.next(t)}))};function We(t){return Ct.stateConfig.handlers.handler(t)}const Re=(t,e)=>Be(t,e),De=t=>t;const Be=(t,e,{init:n,before:r,final:o=De}={})=>{const s=We({pastResult:void 0,values:void 0}),c=s.values;if(void 0===c){if(r&&!r(t))return s.values=t,s.pastResult;const u=(n||e)(t,c);return s.pastResult=o(u),s.values=t,s.pastResult}if(t.every(((t,e)=>t===c[e])))return s.pastResult;if(r&&!r(t))return s.values=t,s.pastResult;const u=e(t,c);return s.pastResult=o(u),c.length=0,c.push(...t),s.pastResult};function $e(t,e){return Object.defineProperty(e,"noInit",{get(){const e=t();return e.setup.init=()=>{},e}}),Object.defineProperty(e,"asSubject",{get(){const e=t(),n=We((()=>ot())),r=We((()=>new Ve(void 0))),o=We((()=>({stateArray:Ct.stateConfig.stateArray,states:Ct.stateConfig.states}))),s=(t,s)=>(Be(t,((t,e)=>{const c=ot(),u=s(t,e);if(c!==n){const t=o.stateArray,e=n.subject.global.oldest;At(t,e.state,o.states,e.states)}r.next(u)}),e.setup),r);return s.setup=e.setup,$e((()=>s),s),s}}),Object.defineProperty(e,"truthy",{get(){const e=t();return e.setup.before=t=>t.every((t=>t)),e}}),e}function _e(t){return ot()?We((()=>new yt(t))):new yt(t)}function Ue(t){return Ct.stateConfig.handlers.statesHandler(t)}function Fe(t){const e=Ie([]),n=Ie(0),r=Ie(0);let o=[],s=0;return r.value=n.value,t(((...t)=>(o=t,e.value))),Re(o,(()=>{++s,e.value=o,t((()=>o))})),Ue(((o,c)=>{if(s)return t(((...t)=>(c&&1!==c||(e.value=t),e.value))),r.value=n.value,void++n.value;t((()=>e.value))})),++s,e.value}function Ge(){return{stateDiff:0,provider:void 0}}$e((()=>function(t){const e=(e,n)=>Be(e,n,t);return e.setup=t,$e((()=>e),e),e}({})),Re),_e._value=t=>{const e=We((function(){return{stateArray:Ct.stateConfig.stateArray,states:Ct.stateConfig.states}})),n=ot();return We((function(){return new Ve(t).pipe((t=>(At(n.state,e.stateArray,n.states,e.states),t)))}))},_e.all=function(t){const e=We((()=>({stateArray:Ct.stateConfig.stateArray,states:Ct.stateConfig.states}))),n=ot();return yt.all(t).pipe((t=>(At(n.state,e.stateArray,n.states,e.states),t)))};const ze={create:t=>{const e=We(Ge);if(e.stateDiff){let t=e.stateDiff;for(;t--;)We(void 0);return We(void 0)}const n=We((()=>{const n=Ct.stateConfig,r=n.stateArray.length,o=t.prototype?new t:t(),s=n.support,c=n.stateArray.length-r,u={constructMethod:t,instance:o,stateDiff:c,owner:s,children:[]};e.provider=u;const a=s.subject.global;return(a.providers=a.providers||[]).push(u),e.stateDiff=c,o})),r=t,o=r.compareTo=r.toString();return e.provider.constructMethod.compareTo=o,n},inject:function(t){return We((function(){const e=t,n=e.compareTo=e.compareTo||t.toString(),r=ot(),o=[];let s={ownerSupport:r.ownerSupport};for(;s.ownerSupport;){const t=s.ownerSupport.subject.global.providers;if(!t){s=s.ownerSupport;continue}const e=t.find((t=>{o.push(t);if(t.constructMethod.compareTo===n)return!0}));if(e){const t=r.subject.global;return(t.providers=t.providers||[]).push(e),e.children.push(r),e.instance}s=s.ownerSupport}const c=`Could not inject provider: ${t.name} ${t}`;throw console.warn(`${c}. Available providers`,o),new Error(c)}))}};class Ze extends Error{details;constructor(t,e,n={}){super(t),this.name=Ze.name,this.details={...n,errorCode:e}}}class Xe extends Ze{constructor(t,e){super(t,"array-no-key-error",e),this.name=Xe.name}}class qe extends Ze{constructor(t,e){super(t,"state-mismatch-error",e),this.name=qe.name}}class Qe extends Ze{constructor(t,e){super(t,"sync-callback-error",e),this.name=Qe.name}}function Ye(t){const e=ot();if(!e)throw en;return Ke(e,Ct.stateConfig,t)}function Ke(t,e,n){const r=e.states;return function(...e){return t.subject.renderCount>0?function(t,e,n,...r){const o=t.subject.global.newest,s=n(...r);return Yn(o),q(s)&&s.finally((()=>{Yn(o)})),s}(t,r,n,...e):n(...e)}}const tn=()=>{const t=ot();if(!t)throw en;const e=Ct.stateConfig;return function(n){return Ke(t,e,n)}},en=new Qe("callback() was called outside of synchronous rendering. Use `callback = callbackMaker()` to create a callback that could be called out of sync with rendering");function nn(t){We(t)}function rn(t){We((function(){ot().subject.global.destroy$.toCallback(t)}))}function on(t,e){return{tagJsType:O.subscribe,processInit:Ae,delete:Ee,checkValueChange:function(){return console.debug("weird to be here"),-1},Observable:t,callback:e,states:st(ot()).states}}function sn(t,e,n){return{tagJsType:O.subscribe,processInit:Oe,delete:Ee,checkValueChange:function(){return-1},Observable:t,callback:n,withDefault:e,states:st(ot()).states}}function cn(t,e){const n=t.templater,r=e.templater,o=n?.tag||t,s=r.tag;if(n?.tagJsType===O.stateRender)return n.dom===r.dom;switch(o.tagJsType){case O.dom:return s?.tagJsType===O.dom&&function(t,e){const n=t.dom,r=e.dom;return n===r}(o,s);case O.tag:{const n=function(t,e,n,r){const o=t.strings,s=e.strings;if(o.length!==s.length)return!1;if(!o.every(((t,e)=>s[e].length===t.length)))return!1;const c=n.templater.values||t.values,u=r.templater.values||e.values;return function(t,e){const n=t.length===e.length;if(!n)return!1;const r=e.every((function(e,n){const r=t[n];if(typeof e===A.function&&typeof r===A.function){return!!(e.toString()===r.toString())}return!0}));if(r)return!0;return!1}(c,u)}(o,s,t,e);return n}}throw new Error(`unknown tagJsType of ${o.tagJsType}`)}function un(t,e,r){const o=e.global;if(!o)return 663;const s=o?.newest;if(z(t)){return cn(t,s)?77:(Zt(s,o),n(e),7)}const c=t?.tagJsType;if(c){return!0===we(e,t,o.newest.ownerSupport,r)?-1:88}return an(e),8}function an(t){const e=t.global,n=e?.newest;Zt(n,e),delete t.global,t.renderCount=0}function ln(t,e,n,r){const o=t.subject.global;o.oldest=t,o.newest=t,++Hr.locks;const s=function(t,e,n,r){const o=function(t){const e=t.templater,n=e.tag;if(n.tagJsType===O.dom)return n.dom;const r=n.strings;return H(r,n.values)}(t),s=t.templater.tag,c=s.values,u=[],a=t.subject.global;a.context=u;const i=Ar(o,c,t,e,u,0,n,r);return i}(t,e,n,r);return o.htmlDomMeta=s.dom,--Hr.locks,s}function pn(t,e,n){const r={value:t,withinOwnerElement:n};return e.push(r),r}function fn(t,e,n){const r=e.global.newest;r.ownerSupport=t;return ln(r,n,void 0,e.placeholder),r}function dn(t){const e={tagJsType:O.templater,processInit:bn,checkValueChange:un};return e.tag=t,t.templater=e,e}function gn(t,e,n){const r=ce(t,e,e.appSupport,n);return n.global.context=[],r}function hn(t,e,n,r,o,s){const c=gn(t,n,e);c.ownerSupport=n;const u=ln(c,r,o,o?void 0:s);for(const t of u.dom)t.marker&&(o?Mr.push([Dr,[o,t.marker]]):Ir.push([Rr,[s,t.marker]])),t.domElement&&(o?Mr.push([Dr,[o,t.domElement]]):Ir.push([Rr,[s,t.domElement]]));return c}function bn(t,e,n,r,o,s){return o?hn(t,e,n,r,o,s):fn(n,e,r)}function mn(t,e){const n={tagJsType:O.templater,processInit:bn,checkValueChange:un,delete:an,propWatch:t,props:e,key:function(t){return n.arrayValue=t,n}};return n}const yn=[];function vn(t,e,n){return t.map((function(t){return function(t,e,n,r){if(z(t)||!t)return t;if(!e)return t;return wn(t,e,n,r)}(t,e.ownerSupport,e,n)}))}function wn(t,e,n,r,o){if(!t)return t;if(t.tagJsType)return t;if(typeof t===A.function)return r<=1?function(t,e,n){const r=t.mem;if(r)return t;const o=function(...t){return function(t,e,n,r){const o=r.subject.global,s=o?.newest||r,c=void 0===ot(),u=t.apply(e,n),a=function(){const t=s.subject.global;return t&&!0!==t.locked?(kn(s,r),u):u};if(c)return a();return Ct.tagClosed$.toCallback(a),u}(o.mem,e,t,n)};return o.original=t,o.mem=t,Object.assign(o,t),o}(t,o,e):t;if(r===_n)return t;return Cn(t)?t:K(t)?function(t,e,n,r){for(let o=t.length-1;o>=0;--o){const s=t[o];if(t[o]=wn(s,n,e,r+1,t),typeof s===A.function){if(s.mem)continue;Tn(r+1,o,s,t,e)}}return t}(t,n,e,r):function(t,e,n,r){const o=Object.keys(t);for(const s of o){const o=t[s],c=wn(o,n,e,r+1,t);if(t[s]===c)continue;const u=Object.getOwnPropertyDescriptor(t,s);if(!(u?.get||u?.set)&&(t[s]=c,typeof c===A.function)){if(o.mem)continue;Tn(r+1,s,o,t,e)}}return t}(t,n,e,r)}function Tn(t,e,n,r,o){if(t>0){const t=o.subject.global;r[e].subscription=t.destroy$.toCallback((function(){r[e]=n}))}}function Cn(t){return typeof t!==A.object||!t||t.tagJsType}function kn(t,e){const n=t.subject;if(Qn(t.templater)){return Kn(e,t)}const r=n.global;r.locked=!0,qn(r.newest,t,e,n),delete r.locked}function Sn(t,e,n,r){const o=e.original,s=t.tagJsType===O.stateRender,c=Ct.stateConfig;let u;return c.support=n,s?u=t():(u=o(...r),typeof u===A.function&&(u=u())),u.templater=t,t.tag=u,n.state=c.stateArray,n.states=c.states,n}function jn(t,e,n){const r=t.propWatch===Hn.DEEP?_n:$n,o=t.props,s=e.propsConfig;let c=s.castProps;const u=n?.propsConfig,a=u?.castProps;a&&(s.castProps=a,c=Gn(e,n,n.ownerSupport,o,r));return c||vn(o,e,0)}function xn(t,e,n){const r=mn(Hn.DEEP);r.tagJsType=t.tagJsType;const o=gn(r,n,e);function s(){return r.tag=t(),o}return r.wrapper=s,s.tagJsType=t.tagJsType,s.original=t.original||t,o}function En(t,e){const n=t.rearray;n.length&&n.length!==t.stateArray.length&&function(t,e,n){const r=`Saved states between renders are inconsistent. Expected ${t.length} states got ${n.stateArray.length}.`,o=e.templater?.wrapper;let s=o;(o?.original||o?.original)&&(s=o.original);const c={oldStates:n.stateArray,newStates:n.rearray,tagFunction:s,templater:e.templater},u=new qe(r,c);throw console.error(An,c),u}(n,e,t)}const An="State tracking requires same number of state calls on every render. This error typically occurs when a state call is only reachable behind a condition. Also, wrapping tags that have state, with tag(), often helps when tag is only reachable by a condition.";function On(t,e){const n=t.subject;++n.renderCount;const r=Ct.stateConfig;t.state=r.stateArray,t.states=r.states,n.global.newest=t,En(r,t),delete r.prevSupport,delete r.support,delete r.stateArray,delete r.states,Ct.tagClosed$.next(e)}function Pn(t,e,n,r){!function(t,e){const n=e?.state,r=Ct.stateConfig;if(n)return void lt(0,e,Ct.stateConfig,n);it(t,r)}(t,e);const o=t.templater;let s;if(o.tagJsType===O.stateRender){const e=o;s=ue(o,r,t.appSupport,n),Sn(o,e,s)}else{s=(0,o.wrapper)(t,n,e)}return On(s,r),s}function In(t,e,r,o,s,c){n(e);const u=xn(t,e,r);Pn(u,void 0,e,r);return hn(u.templater,e,r,o,s,c)}function Jn(t,e,n,r){const o=ue(t,n,n.appSupport,e),s=o.propsConfig;if(s){const e=t.tagJsType!==O.tagComponent?[]:jn(t,o);s.castProps=e}const c=e.global,{support:u}=Xn(o,c.newest,e,n);return function(t,e,n){ln(t,e,void 0,n.placeholder)}(u,r,e),u}function Vn(t,e,n,r,o){const s=ue(t,n,n.appSupport,e),c=s.propsConfig;if(c){const e=t.tagJsType!==O.tagComponent?[]:jn(t,s);c.castProps=e}const u=e.global,{support:a}=Xn(s,u.newest,e,n);return function(t,e,n){let r=Mr.length;const o=ln(t,e,n,void 0);for(const t of o.dom)t.domElement&&Mr.splice(r++,0,[Dr,[n,t.domElement]]),t.marker&&Mr.splice(r++,0,[Dr,[n,t.marker]])}(a,r,o),a}function Mn(t,e,r,o,s){if(n(e),s){return Vn(t,e,r,o,s)}return Jn(t,e,r,o)}let Ln=0;var Hn;function Nn(t,e=Hn.SHALLOW){const n=function(...r){const o=mn(e,r);o.tagJsType=O.tagComponent,o.processInit=Mn;const s=function(t,e){return function(n,r,o){const s=jn(t,n,o),c=n.ownerSupport,u=ue(t,c,n.appSupport,r,s);return Sn(t,e,u,s)}}(o,n);return s.original=t,o.wrapper=s,o},r=t;return n.original=t,r.tags=yn,r.setUse=Ct,r.ValueTypes=O,r.tagIndex=Ln++,yn.push(n),n}function Wn(t,e,n){if(er(t,e))return 11;switch(n){case Hn.NONE:return 1;case Hn.SHALLOW:return Bn(t,e);case Hn.IMMUTABLE:return Dn(t,e)}return function(t,e){let n=t,r=e;n=[...t],r=[...e||[]];if(!n.every(((t,e)=>function(t,e,n,r){const o=r[e];if(typeof t===A.object){const e={...t},n={...o||{}},r=Object.entries(e).every((([t,r])=>Rn(r,n[t],(()=>{delete e[t],delete n[t]}))));return r}return Rn(t,o,(function(){n.splice(e,1),r.splice(e,1)}))}(t,e,n,r))))return 7;return!1}(t,e)}function Rn(t,e,n){if(typeof t!==A.function)return!!nt(t,e,_n)&&4;if(typeof e!==A.function)return!1;const r=e?.original;r&&(e=r);t.original&&(t=t.original);return t.toString()===e.toString()?(n(),5):(n(),6)}function Dn(t,e){const n=t.length;for(let r=0;r<n;++r){if(t[r]!==e[r])return 2}return!1}function Bn(t,e){const n=t.length;for(let r=0;r<n;++r){const n=t[r],o=e[r];if(K(n)&&K(o)){if(n===o)continue;return 3}if(typeof n!==A.function||typeof o!==A.function)if(typeof n!==A.object){if(n!==o)return 3.3}else if(typeof e===A.object){const t=Object.entries(n);for(const e of t){if(!Un(e,o))return 3.1}}}return!1}!function(t){t.DEEP="deep",t.SHALLOW="shallow",t.NONE="none",t.IMMUTABLE="immutable"}(Hn||(Hn={})),Nn.renderOnce=function(){throw new Error("Do not call tag.renderOnce as a function but instead set it as: `(props) => tag.renderOnce = () => html`` `")},Nn.use=function(){throw new Error("Do not call tag.use as a function but instead set it as: `(props) => tag.use = (use) => html`` `")},Nn.deepPropWatch=Nn,Nn.route=function(t){throw new Error("Do not call tag.route as a function but instead set it as: `tag.route = (routeProps: RouteProps) => (state) => html`` `")},Nn.app=function(t){throw new Error("Do not call tag.route as a function but instead set it as: `tag.route = (routeProps: RouteProps) => (state) => html`` `")},Nn.immutableProps=function(t){return Nn(t,Hn.IMMUTABLE)},Nn.watchProps=function(t){return Nn(t,Hn.SHALLOW)},Object.defineProperty(Nn,"renderOnce",{set(t){t.tagJsType=O.renderOnce,t.processInit=In,t.delete=an,t.checkValueChange=function(){return-1}}}),Object.defineProperty(Nn,"use",{set(t){t.original={setUse:Ct,tags:yn},t.tagJsType=O.stateRender,t.processInit=Mn,t.checkValueChange=un,t.delete=an}});const $n=3,_n=10;function Un([t,e],n){const r=n[t];return typeof e===A.function&&typeof r===A.function||r===e}function Fn(t,e,n,r,o,s){return null==t||s>o?e:typeof t===A.function?e.mem?(t.mem=e.mem,e):(t.mem=e,t):Cn(e)?e:K(e)?function(t,e,n,r,o,s){for(let c=t.length-1;c>=0;--c){const u=t[c],a=e[c];t[c]=Fn(a,u,n,r,s,o+1)}return t}(e,t,n,r,s,o):function(t,e,n,r,o,s){const c=Object.keys(t);for(const u of c){const c=t[u],a=Fn(e[u],c,n,r,s,o+1);if(c===a)continue;const i=Object.getOwnPropertyDescriptor(t,u)?.set;i||(t[u]=a)}return t}(e,t,n,r,s,o)}function Gn(t,e,n,r,o,s=-1){const c=e.subject.global.newest;if(!c){const e=vn(r,t,s);r.push(...e);return t.propsConfig.castProps=e,r}const u=(e=c||e).propsConfig.castProps,a=[];for(let e=0;e<r.length;++e){const c=r[e],i=Fn(u[e],c,t,n,o,s+1);a.push(i)}return t.propsConfig.castProps=a,a}function zn(t){const e=t.subject,r=e.global,{subs:o,tags:s}=Dt(r.context);Zn(r);for(const t of s){const e=t.subject.global;if(!0===e.deleted)return;Zn(e)}r.subscriptions&&o.forEach(Bt),n(e)}function Zn(t){t.deleted=!0,$t(t,[])}function Xn(t,e,n,r){const o=e?.templater,s=o?.tag,c=Pn(t,e,n,r),u=!e||cn(e,c);if(u){if(e){const t=e.templater.tag;t&&n.renderCount>0&&function(t,e,n){if(t.tagJsType===O.dom){const r=n?.dom;return void(r!==t.dom&&zn(e))}if(n){const r=n.strings;if(r){const n=r?.length;n!==t.strings.length&&zn(e)}}}(t,e,s)}}else{!function(t,e){const n=t.subject.global;let r=-1;const o=n.providers=n.providers||[],s=o.length-1;for(;r++<s;){const t=o[r];let s=-1;const c=t.children.length-1;for(;s++<c;)if(n===t.children[s].subject.global)return t.children.splice(s,1),void t.children.push(e)}}(e,c),zn(e);const t=c.subject.global;t.oldest=c,t.newest=c}const a=e?.ownerSupport;return c.ownerSupport=r||a,{support:c,wasLikeTags:u}}function qn(t,e,n,r){const o=r.global,{support:s,wasLikeTags:c}=Xn(e,t,r,n);return c?(ve(o.oldest,s),s):(fn(n,r,{added:0,removed:0}),s)}function Qn(t){return O.templater===t.tagJsType}function Yn(t){const e=t.subject.global,n=Qn(t.templater),r=t.ownerSupport;if(e.locked)return e.blocked.push(t),t;if(n){return Kn(r,t)}e.locked=!0;const o=t.subject;e.blocked.length&&(t=e.blocked.pop(),e.blocked=[]);const s=qn(e.newest,t,r,o);return delete e.locked,s}function Kn(t,e){const n=t.subject.global;if(!n||!0===n.deleted)return e;return Yn(n.newest||t)}function tr(t,e,n){const r=function(t,e){const n=t.props,r=e.propsConfig,o=r.latest;if(er(n,o))return!0;switch(t.propWatch){case Hn.IMMUTABLE:return Dn(n,o);case Hn.SHALLOW:return Bn(n,o)}return!nt(n,o,_n)}(e,n);return!(!t||!r)}function er(t,e){return t.length!==e.length}function nr(t,e){const n=function(t,e,n=[]){const r=t.subject;n.push({support:t,renderCount:r.renderCount,provider:e});const o=e.children;for(let t=o.length-1;t>=0;--t){const r=o[t],s=r.subject;n.push({support:r,renderCount:s.renderCount,provider:e})}return n}(t,e);return n}function rr(t){return t.support}function or(t,e=[]){const n=t.subject.global,r=Qn(t.templater),o=t.ownerSupport;if(n.locked)return e.push(t),e;if(r)return or(o,e);const s=t,c=Z(s.templater),u=t.templater.tagJsType,a=o&&u!==O.stateRender&&(!c||tr(o,s.templater,s)),i=function(t){const e=t.subject.global.providers;if(!e)return[];const n=[];for(const t of e){const e=nr(t.owner,t);n.push(...e.map(rr))}return n}(s);return e.push(...i),a?(or(o,e),c&&e.push(s),e):(e.push(s),e)}function sr(t){++Hr.locks,t.forEach(cr),--Hr.locks,Nr()}function cr(t){const e=t.subject.global;e&&Yn(e.newest)}const ur="no-data-ever",ar="promise-no-data-ever";function ir(t,e){const n=e.subject.global,r=function(t,e){if(!0!==n.deleted)return function(t,e,n,r,o){const s=st(e),c=s.subject,u=c.global;u.locked=!0;const a=t.apply(r,o);delete u.locked;const i=function(t,e){const n=e.subject.global;return function(t,e,n){return sr(or(t)),function(t,e,n){if(q(t)){return e.subject.global.locked=!0,t.then((()=>{if(!0===n.deleted)return ar;delete e.subject.global.locked;return sr(or(e)),ar}))}return ur}(e,t,n)}(e,t,n)}(a,s);return i}(r.tagFunction,r.support,r.states,t,e)};r.tagFunction=t;const o=st(e);r.support=e;const s=o.states;return r.states=s,r}const lr=["init","destroy"];function pr(t,e,n,r,o,s,c){if(c)return R(t,e,n,c,s,o);r(n,t,e)}function fr(t,e,n,r){const o=t.appElement;"blur"===e&&(e="focusout");const s="_"+e,c=t.subject.global.events;if(!c[e]){const t=function(t){t.originalStopPropagation=t.stopPropagation,dr(t,s,t.target)};c[e]=t,o.addEventListener(e,t)}n[s]=r,n[e]=r}function dr(t,e,n){const r=n[e];if(r){let e=!1;if(t.stopPropagation=function(){e=!0,t.originalStopPropagation.call(t)},r(t),t.defaultPrevented||e)return}const o=n.parentNode;o&&dr(t,e,o)}function gr(t,e,n,r){const o=function(...e){return o.tagFunction(t,e)};o.tagFunction=e,o.support=n,fr(n.appSupport,r,t,o)}function hr(t){return null==t||!1===t}function br(t,e){t.removeAttribute(e)}function mr(t,e,n,r){if(n.isNameOnly)return function(t,e,n,r,o,s,c,u){if(n){if(hr(e))return void r.removeAttribute(n);if(typeof n===A.object)if(typeof e===A.object)for(const t in n)t in e||Jr.push([br,[r,t]]);else for(const t in n)Jr.push([br,[r,t]])}Cr(t,e,r,o,s,c,u)}(r,t,n.value,n.element,e,n.howToSet,[],{added:0,removed:0}),void(n.value=t);const o=n.element;!function(t,e,n,r,o,s,c,u){if(Q(t))return function(t,e,n,r,o,s,c,u){const a=t.templater.wrapper;if((a?.tagJsType||a?.original?.tagJsType)!==O.renderOnce)return Sr(c,e,t,r,n);return kr(e,n,r,o,s,t,u)}(o,t,r,e,c,s,n,u);kr(t,r,e,c,s,o,u)}(t,n.attrName,n,o,e,n.howToSet,n.isSpecial,{added:0,removed:0}),n.value=t}function yr(t,e,n,r,o,s,c,u){const i=r.length;function l(r){const s=function(t,e,n){return t.reduce(((t,r)=>{if(a(r)>=0){const r=n++,o=e[r];return t.push(o),t}return t.push(r),t}),[])}(e,r,i).join("");o(n,t,s)}e.forEach((e=>{if(a(e)>=0){const e=r.length,o={isAttr:!0,element:n,attrName:t,withinOwnerElement:!0,handler:(t,e,n,r)=>{l(r)}},s=u[e];o.value=s,r.push(o)}})),l(u)}function vr(t,e,n,r,o,s,c,u){const a={isAttr:!0,element:n,attrName:t,withinOwnerElement:!0};r.push(a),a.handler=mr,function(t,e,n,r,o,s,c,u){n.element=r,n.howToSet=o,typeof e===A.function?u&&lr.includes(t)?R(t,e,r,t,s,c):Sr(n,e,s,t,r):(n.attrName=t,n.isSpecial=u,pr(t,e,r,o,c,s,u))}(t,e,a,n,o,s,c,u),a.value=e}function wr(t){return Y(t)&&"tagJsVar"in t?t.tagJsVar:-1}function Tr(t,e,n,r,o,s,c,u,a){const i=wr(e);if(i>=0){const e=t[i],c=pn(e,s,!0);return c.isAttr=!0,c.element=n,c.howToSet=o,c.isNameOnly=!0,c.handler=mr,void Cr(t,e,n,r,o,s,u)}if(Array.isArray(a))return yr(e,a,n,s,o,0,0,t);const l=wr(a);if(l>=0){return vr(e,t[l],n,s,o,r,u,c)}return pr(e,a,n,o,u,r,c)}function Cr(t,e,n,r,o,s,u){if(!hr(e))if(typeof e!==A.object)0!==e.length&&o(n,e,x);else for(const a in e){const i=e[a];Tr(t,a,n,r,o,s,c(a),u,i)}}function kr(t,e,n,r,o,s,c){if(!1===r){switch(t){case void 0:case!1:case null:return void Jr.push([jr,[e,n]])}if(Q(t))return gr(e,t,s,n);o(e,n,t)}else R(n,t,e,r,s,c)}function Sr(t,e,n,r,o){return gr(o,e=ir(e,n),n,r)}function jr(t,e){t.removeAttribute(e)}function xr(t,e,n,r,o,s,c){const u=document.createTextNode(x),a=pn(t,e,o>0);a.placeholder=u,s?Mr.push([Dr,[s,u]]):Ir.push([Rr,[c,u]]),pe(t,n,a,r,s,c)}const Er=function(){};function Ar(t,e,n,r,o,s,c,u){const a=[];c&&void 0===u&&(u=document.createTextNode(x),Mr.push([Dr,[c,u]]),c=void 0);for(let i=0;i<t.length;++i){const l=t[i],p=l.v;if(!isNaN(p)){xr(e[o.length],o,n,r,s,c,u);continue}const f={};if(a.push(f),"text"===l.nn){Pr(f,l,c,u);continue}const d=Or(f,l,e,n,o,r,c,u);l.ch&&(f.ch=Ar(l.ch,e,n,r,o,s+1,d,u).dom)}return{dom:a,context:o}}function Or(t,e,n,r,o,s,c,u){const a=t.domElement=document.createElement(e.nn);if(e.at)for(const t of e.at){const e=t[0],c=t[1];Tr(n,e,a,r,W,o,t[2]||!1,s,c)}return c?Mr.push([Dr,[c,a]]):Ir.push([Rr,[u,a]]),a}function Pr(t,e,n,r){const o=t,s=o.tc=e.tc;n?Mr.push([Fr,[n,s,t=>o.domElement=t]]):Ir.push([Ur,[r,s,t=>o.domElement=t]])}let Ir=[],Jr=[],Vr=[],Mr=[],Lr=[];const Hr={locks:0};function Nr(){if(!(Hr.locks>0)){for(const t of Jr)t[0](...t[1]);for(const[t,e]of Vr)e.textContent=t;for(const t of Mr)t[0](...t[1]);for(const t of Ir)t[0](...t[1]);Ir=[],Jr=[],Mr=[],Vr=[];for(const t of Lr)t[0](...t[1]);Lr=[]}}function Wr(t){t.parentNode.removeChild(t)}function Rr(t,e){t.parentNode.insertBefore(e,t)}function Dr(t,e){t.appendChild(e)}const Br="object"==typeof document&&document.createElement("div");function $r(t){return Br.innerHTML=t,document.createTextNode(Br.innerHTML)}function _r(t,e,n=Er){const r=$r(e);Rr(t,r),n(r)}function Ur(t,e,n=Er){Br.innerHTML=e;const r=document.createTextNode(Br.textContent);Rr(t,r),n(r)}function Fr(t,e,n){Br.innerHTML=e;const r=document.createTextNode(Br.textContent);Dr(t,r),n(r)}function Gr(t,e){const n=t.subContext;n.deleted=!0,delete t.subContext;const r=n.appendMarker;if(r&&(Ir.push([Wr,[r]]),delete n.appendMarker),delete t.delete,t.handler=ae,!n.hasEmitted)return;const o=n.contextItem;return o.tagJsVar.delete(o,e),77}function zr(t,e,r,o,s,c){const u=t;let a=u.templater;a||(a=dn(u));const i=n(e);return s?hn(a,e,r,o,s,c):(i.newest=gn(a,r,e),fn(r,e,o))}function Zr(t,e){const n={values:e,ownerSupport:ot(),dom:t,tagJsType:O.dom,processInit:zr,checkValueChange:un,delete:an,key:function(t){return n.arrayValue=t,n},setInnerHTML:function(t){return t.owner=n,n},html:{dom:function(t,e){return n.children={dom:t,values:e},n}}};return Object.defineProperty(n,"innerHTML",{set(t){t.outerHTML=n,n._innerHTML=t,t.oldProcessInit=t.processInit,t.processInit=Xr}}),n}function Xr(t,e,n,r,o,s){zr(t.outerHTML,e,n,r,o,s),e.handler=(t,e,n,r,o)=>{Ce(n,t?.outerHTML||t,e,o)},t.checkValueChange=function(t,e,n){return function(t,e,n){return un(t,e,n)}(t,e,n)}}function qr(t,e){const n={values:e,ownerSupport:ot(),tagJsType:O.tag,processInit:zr,checkValueChange:un,delete:an,strings:t,key:t=>(n.arrayValue=t,n),setInnerHTML:function(t){return t.owner=n,n},html:function(t,e){return n.children={strings:t,values:e},n}};return Object.defineProperty(n,"innerHTML",{set(t){t.outerHTML=n,t.processInit=Xr}}),n}function Qr(t,...e){const n=qr(t,e),r=mn(Hn.NONE);return r.tag=n,n.templater=r,n}function Yr(t,e){t.domElement&&e.appendChild(t.domElement),t.marker&&e.appendChild(t.marker)}function Kr(t,e,n){const r=e.global,o=oe(t,e);return se(t,o,o),o.appElement=n,r.oldest=r.oldest||o,r.newest=o,o}function to(t,e,n,r,o,s,c){const u=document.createTextNode(x);yn.push(n.wrapper||{original:n});const a=function(t,e,n,r,o){r.placeholder=e;const s=r.global,c=s.oldest,u=s.newest===c,a=ue(t,s.newest,s.newest.appSupport,r);u||lt(0,s.newest,Ct.stateConfig,c.state);if(t.tagJsType===O.stateRender)return function(t,e,n,r,o){const s=t.wrapper||{original:t};if(!e){const e=Kr(t,r,o);return On(e),e}return Sn(t,s,n),On(n),n}(t,o,a,r,n);const i=t.wrapper,l=i(a,r);return On(a),l}(n,u,o,s,c);if(e.isApp=!0,c&&(r.tag=a.templater.tag),!o)throw new Error(`Cannot tagElement, element received is type ${typeof o} and not type Element`);o.destroy=function(){const t=e.events;for(const e in t){const n=t[e];o.removeEventListener(e,n)}e.events={},++Hr.locks;const n=Zt(a,e);return--Hr.locks,Nr(),n},++Hr.locks;const i=function(t,e,n,r,o,s){console.debug("🏷️ Building element into tag...",{element:e,app:o});const c=ln(t,{added:0,removed:0},e,void 0);n.oldest=t,n.newest=t;let u=r.setUse;if(r.tagJsType!==O.stateRender){const t=o.original;u=t.setUse,t.isApp=!0}e.setUse=u,e.ValueTypes=O,eo.push({element:e,support:t});const a=document.createDocumentFragment();a.appendChild(s);for(const t of c.dom)Yr(t,a);return console.debug("🏷️ Element Tag DOM built ✅"),a}(a,o,e,n,t,u);return--Hr.locks,Nr(),o.appendChild(i),{support:a,tags:yn,ValueTypes:O}}Qr.dom=function(t,...e){return Zr(t,e)};const eo=[];function no(t,e,r){const o=eo.findIndex((t=>t.element===e));if(o>=0){const t=eo[o].support;Zt(t,t.subject.global),eo.splice(o,1),console.warn("Found and destroyed app element already rendered to element",{element:e})}let s=()=>a(r);s.propWatch=Hn.NONE,s.tagJsType=O.stateRender,s.props=[r],s.isApp=!0;const c=function(t,e){const r={value:t,withinOwnerElement:!1,renderCount:0,global:void 0,tagJsVar:{tagJsType:"templater",checkValueChange:un,delete:an,processInit:function(){console.debug("do nothing app function")}}},o=n(r);return o.events={},Kr(t,r,e),r}(s,e),u=c.global;it(u.newest,Ct.stateConfig);let a=t(r);const i=typeof a==A.function;return i||(Z(a)?(u.newest.propsConfig={latest:[r],castProps:[r]},s.propWatch=a.propWatch,s.tagJsType=a.tagJsType,s.wrapper=a.wrapper,s=a):(s.tag=a,a=t)),to(t,u,s,a,e,c,i)}function ro(t){if(!t)return Er;const e=ot();if(!e)throw new Error("output must be used in render sync fashion");return(...n)=>{const r=e.ownerSupport,o=r.subject.global.newest;kt(o.states,r.states);const s=t(...n);kt(r.states,o.states);return kn(o,o.ownerSupport.subject.global.newest),s}}function oo(t,e,n,r,o){const s=t.owner._innerHTML;s.processInit=s.oldProcessInit;const c=n.subContext?.contextItem;Ce(c,s,e,o)}function so(t,e,n,r,o,s){e.subContext={},e.handler=oo,function(t,e,n,r,o,s){const{appendMarker:c,insertBefore:u}=je(s,o),a=n.subContext;a.appendMarker=c;const i=t.owner,l=i._innerHTML;l.processInit=l.oldProcessInit,Se(l,a,e,r,u)}(t,n,e,r,s,o)}function co(){return{tagJsType:"innerHTML",processInit:so,delete:Gr,checkValueChange:()=>console.debug("weird innerHTML check")}}const uo={tagElement:no,renderWithSupport:Xn,renderSupport:Yn,renderTagOnly:Pn,paint:Nr};var ao=e.W9,io=e.cg,lo=e.m0,po=e.rS,fo=e.Y2,go=e.ei,ho=e.B7,bo=e.TU,mo=e.XF,yo=e.PC,vo=e.Ot,wo=e.Mj,To=e.tD,Co=e.j8,ko=e.xe,So=e.um,jo=e.E2,xo=e.OH,Eo=e.TB,Ao=e.Ii,Oo=e.m3,Po=e.yV,Io=e.zV,Jo=e.pf,Vo=e.ze,Mo=e.WJ,Lo=e.Ng,Ho=e.HG,No=e.aZ,Wo=e.Ey,Ro=e.O,Do=e.F3,Bo=e.Ie,$o=e.ts,_o=e.B4,Uo=e.Az,Fo=e.Xi,Go=e.sV,zo=e.Ah,Zo=e.ck,Xo=e.Gk,qo=e.j_,Qo=e.zC,Yo=e.cF,Ko=e.jU,ts=e.PB,es=e.qy,ns=e.cy,rs=e.Tn,os=e.Gv,ss=e.yL,cs=e.D8,us=e.Ze,as=e._4,is=e.mn,ls=e.z,ps=e.sA,fs=e.TG,ds=e.MG,gs=e.PL,hs=e.CG,bs=e.nI,ms=e.PZ,ys=e.r5,vs=e.uc,ws=e.pG,Ts=e.QB,Cs=e.Ll,ks=e.vP,Ss=e.wk,js=e.xP,xs=e.bc,Es=e.B1,As=e.RX,Os=e.ag,Ps=e.Tc,Is=e.Hf,Js=e._A,Vs=e.Ag,Ms=e.NU,Ls=e.wB,Hs=e.id,Ns=e.MC,Ws=e.SZ;export{ao as ArrayNoKeyError,io as BasicTypes,lo as ImmutableTypes,po as PropWatches,fo as RouteQuery,go as StateMismatchError,ho as Subject,bo as Subjective,mo as SyncCallbackError,yo as TagError,vo as ValueSubject,wo as ValueSubjective,To as ValueTypes,Co as addOneContext,ko as appElements,So as buildBeforeElement,jo as callback,xo as callbackMaker,Eo as checkArrayValueChange,Ao as checkSimpleValueChange,Oo as checkSubContext,Po as checkTagValueChange,Io as combineLatest,Jo as createHtmlSupport,Vo as createTrigger,Mo as defineValueOn,Lo as deleteSimpleValue,Ho as deleteSubContext,No as destroyArray,Wo as destroyArrayContextItem,Ro as destroySupport,Do as destroySupportByContextItem,Bo as empty,$o as forceUpdateExistingValue,_o as getBaseSupport,Uo as getDomMeta,Fo as getDomTag,Go as getInnerHTML,zo as getNewGlobal,Zo as getStringTag,Xo as getTemplaterResult,qo as guaranteeInsertBefore,Qo as hasPropChanges,Yo as hmr,Ko as howToSetFirstInputValue,ts as howToSetInputValue,es as html,ns as isArray,rs as isFunction,os as isObject,ss as isPromise,cs as isSimpleType,us as isStaticTag,as as isSubjectInstance,is as isTagComponent,ls as letProp,ps as onDestroy,fs as onFirstSubContext,ds as onInit,gs as oneRenderToSupport,hs as output,bs as paint,ms as processFirstSubjectValue,ys as providers,vs as renderSupport,ws as renderTagOnly,Ts as renderWithSupport,Cs as setUseMemory,ks as signal,Ss as state,js as states,xs as subject,Es as subscribe,As as subscribeWith,Os as syncError,Ps as tag,Is as tagElement,Js as tags,Vs as upgradeBaseToSupport,Ms as variablePrefix,Ls as watch,Hs as willCallback,Ns as willPromise,Ws as willSubscribe};
|
|
1
|
+
var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function n(t){return t.renderCount=t.renderCount||0,t.global={}}t.d(e,{W9:()=>Xe,cg:()=>A,m0:()=>E,rS:()=>Hn,Y2:()=>r,ei:()=>qe,B7:()=>yt,TU:()=>vt,XF:()=>Qe,PC:()=>Ze,Ot:()=>Ve,Mj:()=>Me,tD:()=>O,j8:()=>pn,xe:()=>eo,um:()=>ln,E2:()=>Ye,OH:()=>tn,TB:()=>Qt,Ii:()=>Nt,m3:()=>ke,yV:()=>un,zV:()=>ht,pf:()=>ce,ze:()=>Ke,WJ:()=>wt,Ng:()=>Ht,HG:()=>Gr,aZ:()=>Kt,Ey:()=>Yt,O:()=>Zt,F3:()=>an,Ie:()=>x,ts:()=>Ce,B4:()=>oe,Az:()=>H,Xi:()=>Zr,sV:()=>co,Ah:()=>n,ck:()=>qr,Gk:()=>mn,j_:()=>je,zC:()=>Wn,cF:()=>uo,jU:()=>W,PB:()=>N,qy:()=>Qr,cy:()=>K,Tn:()=>Q,Gv:()=>Y,yL:()=>q,D8:()=>G,Ze:()=>z,_4:()=>X,mn:()=>Z,z:()=>Fe,sA:()=>rn,TG:()=>Se,MG:()=>nn,PL:()=>xn,CG:()=>ro,nI:()=>Nr,PZ:()=>le,r5:()=>ze,uc:()=>Yn,pG:()=>Pn,QB:()=>Xn,Ll:()=>Ct,vP:()=>Ie,wk:()=>We,xP:()=>Ue,bc:()=>_e,B1:()=>on,RX:()=>sn,ag:()=>en,Tc:()=>Nn,Hf:()=>no,_A:()=>yn,Ag:()=>se,NU:()=>o,wB:()=>Re,id:()=>Le,MC:()=>He,SZ:()=>Ne});class r{get(t){return"todo"}}const o=":tagvar",s=":";function c(t){if(t.startsWith("class."))return"class";const e=function(t){switch(t){case"autoselect":return"autoselect";case"autofocus":return"autofocus";case"oninit":case"init":return"oninit";case"ondestroy":case"destroy":return"destroy"}return!1}(t);return!1!==e||!!t.startsWith("style.")&&"style"}const u=new RegExp(o+"(\\d+)"+s,"g");function a(t){return t.search&&t.startsWith(o)?t.search(u):-1}const i=/(:tagvar\d+:)/,l="ondoubleclick",p=/([:_a-zA-Z0-9\-.]+)\s*(?:=\s*"([^"]*)"|=\s*(\S+))?/g,f=/<\/?([a-zA-Z0-9-]+)((?:\s+[a-zA-Z_:*][\w:.-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)+\s*|\s*)\/?>/g;function d(t){const e=[],n=[],r=[];let c=null,u=-1,a=0;const l=new RegExp(f,"g");for(t=function(t){return t.replace(g,(function(t){return t.replace(/\[l t\]/g,"[l t]").replace(/\[g t\]/g,"[g t]").replace(/</g,"[l t]").replace(/>/g,"[g t]")}))}(t);a<t.length;){const f=l.exec(t);if(!f)break;const[d,g,b]=f,y=d.startsWith("</"),w=d.endsWith("/>");if(a<f.index){const e=t.slice(a,f.index);if(e.trim()){const t=m(e);for(let e of t)e.startsWith(o)&&e.search(i)>=0&&-1===e.search(k)&&(e=o+ ++u+s),h(c,n,e)}}if(a=f.index+d.length,y){c=r.pop()||null;continue}const T=[];let C;for(;null!==(C=p.exec(b));)u=v(C,u,e,T);const S={nn:g};T.length&&(S.at=T),c?(c.ch||(c.ch=[]),c.ch.push(S)):n.push(S),w||(r.push(c),c=S)}if(a<t.length){const e=t.slice(a);if(e.trim()){const t=m(e);for(const e of t)e.startsWith(o)&&++u,h(c,n,e)}}return n}const g=new RegExp("(\x3c!--[\\s\\S]*?--\x3e)","g");function h(t,e,n){!function(t,e,n){t?(t.ch||(t.ch=[]),t.ch.push(n)):e.push(n)}(t,e,{nn:"text",tc:b(n)})}function b(t){return t.replace(/(\[l t\]!--[\s\S]*?--\[g t\])/g,(function(t){return t.replace(/\[l t\]/g,"<").replace(/\[g t\]/g,">").replace(/\[l t\]/g,"[l t]").replace(/\[g t\]/g,"[g t]")}))}function m(t){return t.split(i).filter(y)}function y(t){return""!==t}function v(t,e,n,r){const a=t[1]||t[3]||t[5];let i=t[2]||t[4]||t[6];if(void 0===a)return e;const p=""!==t[2],f=void 0===i&&p,d=a.toLowerCase(),g=d.startsWith("on")?function(t){if(t.startsWith("on"))return t.length===l.length&&t===l?"dblclick":t.slice(2,t.length);return t}(d):d;if(f){if(a.slice(0,o.length)===o){const t=o+ ++e+s;return n.push(["at",t]),r.push([t]),e}if(t[0].startsWith(a)&&t[0].slice(a.length,t[0].length).search(/\s+$/)>=0)return r.push([g]),e;const c=t[3];if(c.search(k)>=0){i=c;const t=[g,i];return r.push(t),e}i=o+ ++e+s}p||(i=t[2]);const h=i.split(T).filter((t=>t.length>0));h.length>1&&(i=h,h.forEach((t=>{t.search(u)>=0&&++e})));const b=[g,i],m=c(d);return m&&b.push(m),r.push(b),e}const w=new RegExp(o+"(\\d+)"+s,"gi"),T=new RegExp("("+o+"\\d+"+s+")","gi"),C=o.slice(0,o.length-1),k=new RegExp(C+"r(\\d+)"+s,"gi"),S=C+"r$1"+s;function j(t,e){const n=function(t,e){const n=t;return function(t,e){const n=[];for(let r=0;r<t.length;++r){const c=t[r].replace(w,S);r<e.length?n.push(c+o+r+s):n.push(c)}return function(t,e,n){const r=n.length-e.length;if(r>0)for(let n=r;n>0;--n)t.push(o+(e.length+n-1)+s)}(n,t,e),n}(n,e)}(t,e).join("");return d(n)}const x="";var E,A;!function(t){t.string="string",t.number="number",t.boolean="boolean",t[void 0]="undefined"}(E||(E={})),function(t){t.function="function",t.date="date",t.unknown="unknown",t.object="object"}(A||(A={}));const O={tag:"html",dom:"dom",templater:"templater",tagComponent:"tagComponent",tagArray:"tagArray",subscribe:"subscribe",signal:"signal",renderOnce:"renderOnce",stateRender:"stateRender",version:Date.now()},P="ch";function I(t,e,n=[],r=[]){const o=t;for(let t=0;t<o.length;t++){const s=[...r,t],c=o[t];if(c.at){const t=c.at;c.at=V(t,e)}if(c.ch){const t=c.ch,r=[...s,P];c.ch=I(t,e,n,r)}t=J(c,e,o,t)}return o}function J(t,e,n,r){if("text"!==t.nn)return r;const c=t;let a,i=c.tc;if(typeof i!==E.string)return r;for(;null!==(a=u.exec(i));){const t=a[1],c=parseInt(t,10);if(!isNaN(c)&&c<e){const t=o+c+s,e=i.slice(a.index+t.length);n.splice(r,1,{nn:"text",v:c}),i=e,u.lastIndex=0}}return c.tc=i,r}function V(t,e){const n=[];for(const r of t){const[t,s,c]=r;if(t.startsWith(o)){const r=parseInt(t.replace(o,""),10);if(!isNaN(r)&&r<e){n.push([{tagJsVar:r}]);continue}}if(typeof s===E.string&&s.startsWith(o)){const r=parseInt(s.replace(o,""),10);if(!isNaN(r)&&r<e){n.push([t,{tagJsVar:r},c]);continue}}n.push(r)}return n}function M(t){return t.length}const L={};function H(t,e){const n=function(t){const e=t.map(M);return e.push(t.length),Number(e.join(""))}(t),r=L[n],o=r&&function(t,e,n){if(n&&n.strings.length===t.length&&n.strings.every(((e,n)=>e===t[n]))&&n.values.length===e.length)return!0;return!1}(t,e,r);if(o)return r.domMetaMap;const s=I(j(t,e),e.length),c={interpolation:void 0,string:void 0,strings:t,values:e,domMetaMap:s};return L[n]=c,s}function N(t,e,n){Jr.push([W,[t,e,n]])}function W(t,e,n){void 0!==n&&!1!==n&&null!==n?t.setAttribute(e,n):t.removeAttribute(e)}function R(t,e,n,r,o,s){switch(r){case"init":{const t=s.added++;return void Lr.push([F,[n,t,e]])}case"destroy":{const t=s.removed++,r=o.subject.global;return r.destroys=r.destroys||[],void r.destroys.push((()=>e({target:n,stagger:t})))}case"autofocus":return void Lr.push([U,[n]]);case"autoselect":return void Lr.push([_,[n]]);case"style":{const r=t.split(".");return void Jr.push([D,[n,r,e]])}case"class":return void function(t,e,n){const r=t.split(".");if(r.shift(),e){for(const t of r)Jr.push([B,[n,t]]);return}for(const t of r)Jr.push([$,[n,t]])}(t,e,n)}throw new Error(`Invalid special attribute of ${r}. ${t}`)}function D(t,e,n){const r=e[1];t.style[r]=n,t.style.setProperty(r,n)}function B(t,e){t.classList.add(e)}function $(t,e){t.classList.remove(e)}function _(t){t.select()}function U(t){t.focus()}function F(t,e,n){n({target:t,stagger:e})}function G(t){switch(t){case E.string:case E.number:case E.boolean:return!0}return!1}function z(t){if(!t)return!1;switch(t.tagJsType){case O.dom:case O.tag:case O.templater:return!0}return!1}function Z(t){const e=t?.tagJsType;return e===O.tagComponent||e===O.stateRender}function X(t){return Y(t)&&typeof t.subscribe===A.function}function q(t){return t&&Q(t.then)}function Q(t){return typeof t===A.function}function Y(t){return typeof t===A.object&&null!==t}function K(t){return Array.isArray(t)}function tt(t,e){return et(t,e)}function et(t,e){if(null===t||typeof t!==A.object)return t;if(e<0)return t;if(t instanceof Date)return new Date(t);if(t instanceof RegExp)return new RegExp(t);const n=K(t)?[]:Object.create(Object.getPrototypeOf(t));if(K(t))for(let r=0;r<t.length;r++)n[r]=et(t[r],e-1);else for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=et(t[r],e-1));return n}function nt(t,e,n){return rt(t,e,n)}function rt(t,e,n){return!(t!==e&&(r=t,o=e,!Q(r)||!Q(o)||r.toString()!==o.toString()))||(n<0||typeof t===A.object&&typeof e===A.object&&(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():K(t)&&K(e)?function(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!rt(t[r],e[r],n-1))return!1;return!0}(t,e,n-1):!K(t)&&!K(e)&&function(t,e,n){const r=Object.keys(t),o=Object.keys(e);if(0===r.length&&0===o.length)return!0;if(r.length!==o.length)return!1;for(const s of r){if(!o.includes(s)||!rt(t[s],e[s],n-1))return!1}return!0}(t,e,n-1)));var r,o}function ot(){return Ct.stateConfig.support}function st(t){let e=t;for(;e.ownerSupport&&!Z(e.templater);)e=e.ownerSupport;return e.subject.global.newest||e}function ct(...t){return t}function ut(t){const e=Ct.stateConfig;return e.states[e.statesIndex]=t,++e.statesIndex,t(ct)}function at(t){const e=Ct.stateConfig,n=e.statesIndex,r=st(e.prevSupport).states[n];let o=[];r((function(...t){return o=t,t}));return e.states[e.statesIndex]=t,++e.statesIndex,t((function(...t){return o}))}function it(t,e){e.handlers.handler=gt,e.handlers.statesHandler=ut,e.rearray=[],e.stateArray=[],e.states=[],e.statesIndex=0,e.support=t}function lt(t,e,n,r){n.rearray=r,n.stateArray=[],n.states=[],n.statesIndex=0,n.handlers.handler=dt,n.handlers.statesHandler=at,n.prevSupport=e}class pt{}function ft(t){const e=t.callback;if(!e)return t.defaultValue;const[n]=function(t){const[e]=t(pt),[n]=t(e);return[e,n]}(e);return n}function dt(){const t=Ct.stateConfig,e=t.rearray[t.stateArray.length];return t.stateArray.push(e),e.defaultValue}function gt(t){const e=Ct.stateConfig;let n=t;if(typeof t===A.function&&(n=t()),typeof n===A.function){const t=n;n=function(...e){return t(...e)},n.original=t}const r={get:function(){return ft(r)},defaultValue:n};return e.stateArray.push(r),n}function ht(t){const e=new yt;return e.subscribeWith=e=>{const n=[],r=[],o=(o,s)=>{n[s]=!0,r[s]=o;if(n.length===t.length){for(const t of n)if(!t)return;e(r,c)}},s=[...t],c=s.shift().subscribe((t=>o(t,0))),u=s.map(((t,e)=>t.subscribe((t=>o(t,e+1)))));return c.subscriptions=u,c},e}function bt(t,e,n){const r=yt.globalSubCount$;yt.globalSubCount$.next(r.value+1);const o=function(){o.unsubscribe()};return o.callback=e,o.subscriptions=[],o.unsubscribe=function(){return function(t,e,n){!function(t,e){const n=t.findIndex((t=>t.callback===e));-1!==n&&t.splice(n,1)}(e,n);const r=yt.globalSubCount$;yt.globalSubCount$.next(r.value-1),t.unsubscribe=()=>t;const o=t.subscriptions;for(const t of o)t.unsubscribe();return t}(o,n,e)},o.add=t=>(o.subscriptions.push(t),o),o.next=t=>{e(t,o)},o}function mt(t,e,n){const r=[...e],o=r.shift(),s=t=>{if(r.length)return mt(t,r,n);n(t)};let c=s;const u=o(t,{setHandler:t=>c=t,next:s});c(u)}class yt{value;onSubscription;methods=[];isSubject=!0;subscribers=[];subscribeWith;constructor(t,e){this.value=t,this.onSubscription=e}subscribe(t){const e=bt(0,t,this.subscribers),n=this.subscribeWith;if(n){if(this.methods.length){const n=t;t=t=>{mt(t,this.methods,(t=>n(t,e)))}}return n(t)}return this.subscribers.push(e),this.onSubscription&&this.onSubscription(e),e}next(t){this.value=t,this.emit()}set=this.next.bind(this);emit(){const t=this.value,e=this.subscribers;for(const n of e)n.callback(t,n)}toPromise(){return new Promise((t=>{this.subscribe(((e,n)=>{n.unsubscribe(),t(e)}))}))}toCallback(t){const e=this.subscribe(((n,r)=>{const o=r?.unsubscribe;o?o():setTimeout((()=>e.unsubscribe()),0),t(n)}));return this}pipe(...t){const e=new yt(this.value);return e.setMethods(t),e.subscribeWith=t=>this.subscribe(t),e.next=t=>this.next(t),e}setMethods(t){this.methods=t}static all(t){return ht(t.map((t=>{if(X(t))return t;return new yt(t,(e=>(e.next(t),e)))})))}static globalSubCount$=new yt(0)}class vt extends yt{value;onSubscription;_value;constructor(t,e){super(t,e),this.value=t,this.onSubscription=e,this._value=t,wt(this)}next(t){this._value=t,this.emit()}emit(){const t=this._value,e=this.subscribers;for(const n of e)n.callback(t,n)}}function wt(t){Object.defineProperty(t,"value",{set(e){t._value=e,t.emit()},get:()=>t._value})}const Tt=new yt(void 0,(function(t){ot()||t.next()})),Ct={stateConfig:{stateArray:[],version:Date.now(),handlers:{handler:gt,statesHandler:ut}},tagClosed$:Tt};function kt(t,e){for(let n=0;n<t.length;++n){Et(t[n],e[n])}}let St;function jt(...t){return St=t,t}function xt(){return St}function Et(t,e){t(jt,1),e(xt,2)}function At(t,e,n,r){for(let n=t.length-1;n>=0;--n){const r=t[n].get(),o=e[n].callback;o&&o(r)}for(let t=r.length-1;t>=0;--t){Pt.length=0,Ot=0;(0,r[t])(It),n[t](Jt)}}let Ot=0;const Pt=[];function It(...t){return Pt.push(t),t}function Jt(...t){return Pt[Ot++]}function Vt(t){switch(t){case void 0:case!1:case null:return x}return t}function Mt(t){return{tagJsType:"simple",value:t,processInit:Lt,checkValueChange:Nt,delete:Ht}}function Lt(t,e,n,r,o,s){const c=Vt(t);s=e.placeholder;const u=e.paint=[_r,[s,c,t=>{e.simpleValueElm=t,delete e.paint}]];Ir.push(u)}function Ht(t){const e=t.simpleValueElm;if(delete t.simpleValueElm,delete t.tagJsVar,void 0===t.paint)Ir.push([Wr,[e]]);else{const e=Ir.findIndex((e=>e===t.paint));Ir.splice(e,1)}}function Nt(t,e){return null==t||typeof t!==A.object?(function(t,e){const n=Vt(t);if(e.paint)return void(e.paint[1][1]=n);const r=e.simpleValueElm;Vr.push([n,r])}(t,e),-1):(Ht(e),6)}function Wt(t,e){const n=e.providers;if(n)for(const t of n)for(let n=t.children.length-1;n>=0;--n){t.children[n].subject.global===e&&t.children.splice(n,1)}e.destroy$&&e.destroy$.next(),t.subject.renderCount=0}function Rt(t,e){for(const n of t){const t=n.lastArray;if(t){Rt(t,e);continue}const r=n.value;if(r?.tagJsType===O.subscribe){r.delete(n,e);continue}const o=n.global;if(!o)continue;const s=o.newest,c=o.subscriptions;c&&c.forEach(Bt),Z(s.templater)&&Wt(s,o);Rt(o.context,s)}}function Dt(t,e=[],n=[]){for(const r of t){const t=r.global;if(!t)continue;const o=t.newest;if(o){e.push(o);const r=t.subscriptions;r&&n.push(...r)}const s=t.context;s&&Dt(s,e,n)}return{tags:e,subs:n}}function Bt(t){t.unsubscribe()}function $t(t,e){const n=t.context,r=t.destroys;if(r)return function(t,e,n){if(_t.length=0,t.forEach(Ut),_t.length){const t=Promise.all(_t).then((()=>{++Hr.locks,Ft(e.context,n),Gt(e),--Hr.locks,Nr()}));return void n.push(t)}++Hr.locks,Ft(e.context,n),Gt(e),--Hr.locks,Nr()}(r,t,e);Ft(n,e),Gt(t)}const _t=[];function Ut(t){const e=t();e instanceof Promise&&_t.push(e)}function Ft(t,e){for(const n of t){if(n.withinOwnerElement)continue;const t=n.lastArray;if(t){Kt(n,t);continue}const r=n.simpleValueElm;if(r){delete n.simpleValueElm,Ir.push([Wr,[r]]);continue}const o=n.global;if(void 0===o)continue;if(!0===o.deleted)continue;o.deleted=!0;o.oldest&&$t(o,e)}}function Gt(t){t.htmlDomMeta.forEach(zt)}function zt(t){const e=t.marker;e&&Ir.push([Wr,[e]]);const n=t.domElement;n&&Ir.push([Wr,[n]])}function Zt(t,e){const n=t.subject;e.deleted=!0,n.renderCount=0;const r=[];return Rt(e.context,t),e.destroy$&&Wt(t,e),$t(e,r),r}function Xt(t,e,n,r){const o=t.length-1,s=e-r,c=s<0||o<s,u=n[e];if(c)return qt(u),1;const a=function(t,e,n,r,o){const s=e&&t!==e.arrayValue;if(s)return qt(n),r.splice(o,1),2;return 0}(u.value.arrayValue,t[e],u,n,e);return a}function qt(t){!function(t,e){if(t){return void Zt(t.oldest,t)}const n=e.simpleValueElm;delete e.simpleValueElm,Ir.push([Wr,[n]])}(t.global,t)}function Qt(t,e){return!K(t)&&(Yt(e),9)}function Yt(t){Kt(t,t.lastArray)}function Kt(t,e){for(let t=0;t<e.length;++t)qt(e[t]);delete t.lastArray}function te(t){return t.map(ee)}function ee(t,e){const n=t,r=t?.tagJsType;if(r)switch(r){case O.signal:case O.subscribe:case O.stateRender:return;case O.dom:case O.tag:case O.templater:return te(n.values)}return K(t)?te(n):tt(t,e)}function ne(t){return ee(t,$n)}function re(t){return ee(t,_n)}function oe(t,e,n){const r={templater:t,subject:e,castedProps:n,appSupport:void 0},o=e.global;return o.blocked=[],o.destroy$=new yt,r}function se(t,e,n,r){e.appSupport=n;const o=t.props;return o&&(e.propsConfig=function(t,e,n){const r=t.templater;if(r.tagJsType!==O.stateRender){switch(r.propWatch){case Hn.IMMUTABLE:return t.propsConfig={latest:e,castProps:n};case Hn.SHALLOW:return t.propsConfig={latest:e.map(ne),castProps:n}}return t.propsConfig={latest:e.map(re),castProps:n}}}(e,o,r)),e}function ce(t,e,n,r,o){const s={templater:t,subject:r,castedProps:o,appSupport:void 0};return s.ownerSupport=e,s.appSupport=n,s}function ue(t,e,n,r,o){const s=oe(t,r,o);return s.ownerSupport=e,se(t,s,n,o)}function ae(t,e,n,r,o){t!==n.value&&Ce(n,t,e,o)}function ie(t,e,r,o){if(!e.global.newest)return void t.processInit(t,e,r,o,void 0,e.placeholder);!function(t,e,r){const o=r.global,s=o.newest,c=s.templater.wrapper,u=e.templater.wrapper;let a=!1;const i=e.templater.tagJsType,l=O.stateRender===i||O.renderOnce===i;if(l)a=e.templater.tagJsType===O.renderOnce||cn(s,e);else if(c&&u){a=c.original===u.original}const p=e.templater;if(!a)return void function(t,e,r){const o=t.global,s=o.oldest;Zt(s,o),n(t),e.processInit(e,t,r,{added:0,removed:0},void 0,t.placeholder)}(r,p,t);const f=l||function(t,e){const n=e.props,r=t.propsConfig,o=r.latest,s=Wn(n,o,t.templater.propWatch);return s}(s,p);if(!f){return void function(t,e,n,r,o){const s=t.props,c=Gn(e,n,r,s,o),u=e.propsConfig;u.castProps=c;const a=n.propsConfig;a.latest=u.latest}(p,e,s,t,p.propWatch===Hn.DEEP?_n:$n)}if(o.locked)return void o.blocked.push(e);Yn(e),++r.renderCount}(r,ue(t,r,r.appSupport,e),e)}function le(t,e,n,r,o,s){const c=me(t);return e.tagJsVar=c,c.processInit(t,e,n,r,o,s)}function pe(t,e,n,r,o,s){n.handler=ae;e.subject.global.locked=!0,le(t,n,e,r,o,s);delete e.subject.global.locked,n.value=t}function fe(t,e,n,r,o){const s=document.createTextNode(x),c={value:t,withinOwnerElement:!1,placeholder:s};return o||Ir.push([Rr,[r,s]]),pe(t,e,c,n,o,r),o&&Mr.push([Dr,[o,s]]),c}function de(t,e,n,r,o){const s=void 0===t.lastArray;s&&(t.lastArray=[]);const c=t.lastArray;let u=t.placeholder,a=0;const i=[];if(!s){for(let t=0;t<c.length;++t){const n=c[t],r=Xt(e,t,c,a);0!==r?2!==r?a+=r:t-=1:i.push(n)}t.lastArray=i}const l=e.length;for(let s=0;s<l;++s){u=ge(e,s,t.lastArray,n,u,r,o).placeholder}}function ge(t,e,n,r,o,s,c){const u=t[e],a=n[e];if(a)return function(t,e,n,r,o,s,c,u){const a=n.length>o;if(a)return ae(t,r,e,0,c),e;const i=fe(t,r,c,s,u);return n.push(i),i}(u,a,n,r,e,o,s,c);const i=fe(u,r,s,o,c);return n.push(i),i}function he(t){return{tagJsType:"array",value:t,processInit:be,checkValueChange:Qt,delete:Yt}}function be(t,e,n,r,o){de(e,t,n,r,o)}function me(t){const e=t?.tagJsType;return e?t:function(t){if(K(t))return he(t);return Mt(t)}(t)}function ye(t,e,n,r,o){const s=t[e],c=n[e];if(s===c.value)return;(0,c.handler)(s,r,c,t,o),c.value=s,c.tagJsVar=me(s)}function ve(t,e){const n=t.subject.global.context;!function(t,e){const n=e.templater,r=e.templater.tag,o=n.values||r.values,s=t.templater.tag;s.values=o}(t,e),++Hr.locks,function(t,e){const n=t.templater.tag.values;let r=0;const o=n.length,s={added:0,removed:0};for(;r<o;)ye(n,r,e,t,s),++r}(t,n),--Hr.locks,Nr()}function we(t,e,r,o){if(Z(e))return void 0===t.global&&n(t),ie(e,t,r,o),!0;const s=t.global;if(s){const n=s.newest;if(n)return typeof e===A.function||function(t,e,n,r){const o=ue(n.templater||n,r,r.appSupport,e);ve(t.subject.global.oldest,o)}(n,t,e,r),!0}return e.processInit(e,t,r,o,void 0,t.placeholder),!0}function Te(t,e,n,r,o){const s=t&&t.tagJsType;if(s){if(s===O.renderOnce)return;we(e,t,n,o)}else{if(K(t))return de(e,t,n,o),void(e.tagJsVar=he(t));typeof t!==A.function?r&&function(t,e){e.value=t,e.tagJsVar=Mt(t);const n=e.placeholder,r=Vt(t),o=e.paint=[_r,[n,r,t=>{e.simpleValueElm=t,delete e.paint}]];Ir.push(o)}(t,e):e.value=t}}function Ce(t,e,n,r){const o=t.tagJsVar.checkValueChange(e,t,r);-1!==o&&Te(e,t,n,o,r)}function ke(t,e,n,r,o){if(!t||!t.tagJsType||t.tagJsType!==O.subscribe){return n.tagJsVar.delete(n,e),Te(t,n,e,99,o),99}const s=n.subContext;return s.hasEmitted?(s.callback=t.callback,s.valueHandler(s.lastValue),-1):-1}function Se(t,e,n,r,o){e.hasEmitted=!0,e.contextItem=fe(t,n,r,o)}function je(t,e){let n;return t&&(n=e=document.createTextNode(x),Mr.push([Dr,[t,e]])),{appendMarker:n,insertBefore:e}}function xe(t,e,n,r,o,s,c){const{appendMarker:u,insertBefore:a}=je(s,c),i=function(t,e,n,r,o){const s=st(e);let c=function(t){Se(t,i,e,n,r),c=function(t){Ce(i.contextItem,t,e,{added:0,removed:0}),a||Ct.stateConfig.support||Nr()}};function u(t){i.lastValue=t;const e=s.subject.global.newest;var n;n=s,kt(e.states,n.states),i.callback&&(t=i.callback(t)),c(t)}let a=!0;const i={valueHandler:u,callback:o};return i.subscription=t.subscribe(u),a=!1,i}(t,n,r,a,o);return i.appendMarker=u,e.subContext=i,e.handler=ke,i}function Ee(t,e){return t.subContext.subscription.unsubscribe(),Gr(t,e)}function Ae(t,e,n,r,o,s){return xe(t.Observable,e,n,r,t.callback,o,s)}function Oe(t,e,n,r,o,s){const c=t.Observable,u=xe(c,e,n,r,t.callback,o,s);return u.hasEmitted||u.valueHandler(c.value||t.withDefault),u}function Pe(t,e,n,r,o){xe(t,e,n,r,void 0,o)}function Ie(t){return ot()?We((()=>Je(t))):Je(t)}function Je(t){let e=t;const n=new Set;return{tagJsType:O.signal,processInit:Pe,get value(){return e},set value(t){e!==t&&(e=t,n.forEach((e=>e(t))))},subscribe(t){t(e),n.add(t);const r=()=>n.delete(t);return r.unsubscribe=r,r}}}class Ve extends yt{value;constructor(t){super(t),this.value=t}subscribe(t){const e=super.subscribe(t);return t(this.value,e),e}}class Me extends yt{value;constructor(t){super(t),this.value=t,this._value=t,wt(this)}subscribe(t){const e=super.subscribe(t);return t(this._value,e),e}}function Le(t){return(e,n)=>{n.setHandler((()=>{})),t(e,n.next)}}function He(t){return(e,n)=>{n.setHandler((()=>{}));t(e).then((t=>n.next(t)))}}const Ne=t=>(e,n)=>{n.setHandler((()=>{}));const r=t(e).subscribe((t=>{r.unsubscribe(),n.next(t)}))};function We(t){return Ct.stateConfig.handlers.handler(t)}const Re=(t,e)=>Be(t,e),De=t=>t;const Be=(t,e,{init:n,before:r,final:o=De}={})=>{const s=We({pastResult:void 0,values:void 0}),c=s.values;if(void 0===c){if(r&&!r(t))return s.values=t,s.pastResult;const u=(n||e)(t,c);return s.pastResult=o(u),s.values=t,s.pastResult}if(t.every(((t,e)=>t===c[e])))return s.pastResult;if(r&&!r(t))return s.values=t,s.pastResult;const u=e(t,c);return s.pastResult=o(u),c.length=0,c.push(...t),s.pastResult};function $e(t,e){return Object.defineProperty(e,"noInit",{get(){const e=t();return e.setup.init=()=>{},e}}),Object.defineProperty(e,"asSubject",{get(){const e=t(),n=We((()=>ot())),r=We((()=>new Ve(void 0))),o=We((()=>({stateArray:Ct.stateConfig.stateArray,states:Ct.stateConfig.states}))),s=(t,s)=>(Be(t,((t,e)=>{const c=ot(),u=s(t,e);if(c!==n){const t=o.stateArray,e=n.subject.global.oldest;At(t,e.state,o.states,e.states)}r.next(u)}),e.setup),r);return s.setup=e.setup,$e((()=>s),s),s}}),Object.defineProperty(e,"truthy",{get(){const e=t();return e.setup.before=t=>t.every((t=>t)),e}}),e}function _e(t){return ot()?We((()=>new yt(t))):new yt(t)}function Ue(t){return Ct.stateConfig.handlers.statesHandler(t)}function Fe(t){const e=Ie([]),n=Ie(0),r=Ie(0);let o=[],s=0;return r.value=n.value,t(((...t)=>(o=t,e.value))),Re(o,(()=>{++s,e.value=o,t((()=>o))})),Ue(((o,c)=>{if(s)return t(((...t)=>(c&&1!==c||(e.value=t),e.value))),r.value=n.value,void++n.value;t((()=>e.value))})),++s,e.value}function Ge(){return{stateDiff:0,provider:void 0}}$e((()=>function(t){const e=(e,n)=>Be(e,n,t);return e.setup=t,$e((()=>e),e),e}({})),Re),_e._value=t=>{const e=We((function(){return{stateArray:Ct.stateConfig.stateArray,states:Ct.stateConfig.states}})),n=ot();return We((function(){return new Ve(t).pipe((t=>(At(n.state,e.stateArray,n.states,e.states),t)))}))},_e.all=function(t){const e=We((()=>({stateArray:Ct.stateConfig.stateArray,states:Ct.stateConfig.states}))),n=ot();return yt.all(t).pipe((t=>(At(n.state,e.stateArray,n.states,e.states),t)))};const ze={create:t=>{const e=We(Ge);if(e.stateDiff){let t=e.stateDiff;for(;t--;)We(void 0);return We(void 0)}const n=We((()=>{const n=Ct.stateConfig,r=n.stateArray.length,o=t.prototype?new t:t(),s=n.support,c=n.stateArray.length-r,u={constructMethod:t,instance:o,stateDiff:c,owner:s,children:[]};e.provider=u;const a=s.subject.global;return(a.providers=a.providers||[]).push(u),e.stateDiff=c,o})),r=t,o=r.compareTo=r.toString();return e.provider.constructMethod.compareTo=o,n},inject:function(t){return We((function(){const e=t,n=e.compareTo=e.compareTo||t.toString(),r=ot(),o=[];let s={ownerSupport:r.ownerSupport};for(;s.ownerSupport;){const t=s.ownerSupport.subject.global.providers;if(!t){s=s.ownerSupport;continue}const e=t.find((t=>{o.push(t);if(t.constructMethod.compareTo===n)return!0}));if(e){const t=r.subject.global;return(t.providers=t.providers||[]).push(e),e.children.push(r),e.instance}s=s.ownerSupport}const c=`Could not inject provider: ${t.name} ${t}`;throw console.warn(`${c}. Available providers`,o),new Error(c)}))}};class Ze extends Error{details;constructor(t,e,n={}){super(t),this.name=Ze.name,this.details={...n,errorCode:e}}}class Xe extends Ze{constructor(t,e){super(t,"array-no-key-error",e),this.name=Xe.name}}class qe extends Ze{constructor(t,e){super(t,"state-mismatch-error",e),this.name=qe.name}}class Qe extends Ze{constructor(t,e){super(t,"sync-callback-error",e),this.name=Qe.name}}function Ye(t){const e=ot();if(!e)throw en;return Ke(e,Ct.stateConfig,t)}function Ke(t,e,n){const r=e.states;return function(...e){return t.subject.renderCount>0?function(t,e,n,...r){const o=t.subject.global.newest,s=n(...r);return Yn(o),q(s)&&s.finally((()=>{Yn(o)})),s}(t,r,n,...e):n(...e)}}const tn=()=>{const t=ot();if(!t)throw en;const e=Ct.stateConfig;return function(n){return Ke(t,e,n)}},en=new Qe("callback() was called outside of synchronous rendering. Use `callback = callbackMaker()` to create a callback that could be called out of sync with rendering");function nn(t){We(t)}function rn(t){We((function(){ot().subject.global.destroy$.toCallback(t)}))}function on(t,e){return{tagJsType:O.subscribe,processInit:Ae,delete:Ee,checkValueChange:function(){return console.debug("weird to be here"),-1},Observable:t,callback:e,states:st(ot()).states}}function sn(t,e,n){return{tagJsType:O.subscribe,processInit:Oe,delete:Ee,checkValueChange:function(){return-1},Observable:t,callback:n,withDefault:e,states:st(ot()).states}}function cn(t,e){const n=t.templater,r=e.templater,o=n?.tag||t,s=r.tag;if(n?.tagJsType===O.stateRender)return n.dom===r.dom;switch(o.tagJsType){case O.dom:return s?.tagJsType===O.dom&&function(t,e){const n=t.dom,r=e.dom;return n===r}(o,s);case O.tag:{const n=function(t,e,n,r){const o=t.strings,s=e.strings;if(o.length!==s.length)return!1;if(!o.every(((t,e)=>s[e].length===t.length)))return!1;const c=n.templater.values||t.values,u=r.templater.values||e.values;return function(t,e){const n=t.length===e.length;if(!n)return!1;const r=e.every((function(e,n){const r=t[n];if(typeof e===A.function&&typeof r===A.function){return!!(e.toString()===r.toString())}return!0}));if(r)return!0;return!1}(c,u)}(o,s,t,e);return n}}throw new Error(`unknown tagJsType of ${o.tagJsType}`)}function un(t,e,r){const o=e.global;if(!o)return 663;const s=o?.newest;if(z(t)){return cn(t,s)?77:(Zt(s,o),n(e),7)}const c=t?.tagJsType;if(c){return!0===we(e,t,o.newest.ownerSupport,r)?-1:88}return an(e),8}function an(t){const e=t.global,n=e?.newest;Zt(n,e),delete t.global,t.renderCount=0}function ln(t,e,n,r){const o=t.subject.global;o.oldest=t,o.newest=t,++Hr.locks;const s=function(t,e,n,r){const o=function(t){const e=t.templater,n=e.tag;if(n.tagJsType===O.dom)return n.dom;const r=n.strings;return H(r,n.values)}(t),s=t.templater.tag,c=s.values,u=[],a=t.subject.global;a.context=u;const i=Ar(o,c,t,e,u,0,n,r);return i}(t,e,n,r);return o.htmlDomMeta=s.dom,--Hr.locks,s}function pn(t,e,n){const r={value:t,withinOwnerElement:n};return e.push(r),r}function fn(t,e,n){const r=e.global.newest;r.ownerSupport=t;return ln(r,n,void 0,e.placeholder),r}function dn(t){const e={tagJsType:O.templater,processInit:bn,checkValueChange:un};return e.tag=t,t.templater=e,e}function gn(t,e,n){const r=ce(t,e,e.appSupport,n);return n.global.context=[],r}function hn(t,e,n,r,o,s){const c=gn(t,n,e);c.ownerSupport=n;const u=ln(c,r,o,o?void 0:s);for(const t of u.dom)t.marker&&(o?Mr.push([Dr,[o,t.marker]]):Ir.push([Rr,[s,t.marker]])),t.domElement&&(o?Mr.push([Dr,[o,t.domElement]]):Ir.push([Rr,[s,t.domElement]]));return c}function bn(t,e,n,r,o,s){return o?hn(t,e,n,r,o,s):fn(n,e,r)}function mn(t,e){const n={tagJsType:O.templater,processInit:bn,checkValueChange:un,delete:an,propWatch:t,props:e,key:function(t){return n.arrayValue=t,n}};return n}const yn=[];function vn(t,e,n){return t.map((function(t){return function(t,e,n,r){if(z(t)||!t)return t;if(!e)return t;return wn(t,e,n,r)}(t,e.ownerSupport,e,n)}))}function wn(t,e,n,r,o){if(!t)return t;if(t.tagJsType)return t;if(typeof t===A.function)return r<=1?function(t,e,n){const r=t.mem;if(r)return t;const o=function(...t){return function(t,e,n,r){const o=r.subject.global,s=o?.newest||r,c=void 0===ot(),u=t.apply(e,n),a=function(){const t=s.subject.global;return t&&!0!==t.locked?(kn(s,r),u):u};if(c)return a();return Ct.tagClosed$.toCallback(a),u}(o.mem,e,t,n)};return o.original=t,o.mem=t,Object.assign(o,t),o}(t,o,e):t;if(r===_n)return t;return Cn(t)?t:K(t)?function(t,e,n,r){for(let o=t.length-1;o>=0;--o){const s=t[o];if(t[o]=wn(s,n,e,r+1,t),typeof s===A.function){if(s.mem)continue;Tn(r+1,o,s,t,e)}}return t}(t,n,e,r):function(t,e,n,r){const o=Object.keys(t);for(const s of o){const o=t[s],c=wn(o,n,e,r+1,t);if(t[s]===c)continue;const u=Object.getOwnPropertyDescriptor(t,s);if(!(u?.get||u?.set)&&(t[s]=c,typeof c===A.function)){if(o.mem)continue;Tn(r+1,s,o,t,e)}}return t}(t,n,e,r)}function Tn(t,e,n,r,o){if(t>0){const t=o.subject.global;r[e].subscription=t.destroy$.toCallback((function(){r[e]=n}))}}function Cn(t){return typeof t!==A.object||!t||t.tagJsType}function kn(t,e){const n=t.subject;if(Qn(t.templater)){return Kn(e,t)}const r=n.global;r.locked=!0,qn(r.newest,t,e,n),delete r.locked}function Sn(t,e,n,r){const o=e.original,s=t.tagJsType===O.stateRender,c=Ct.stateConfig;let u;return c.support=n,s?u=t():(u=o(...r),typeof u===A.function&&(u=u())),u.templater=t,t.tag=u,n.state=c.stateArray,n.states=c.states,n}function jn(t,e,n){const r=t.propWatch===Hn.DEEP?_n:$n,o=t.props,s=e.propsConfig;let c=s.castProps;const u=n?.propsConfig,a=u?.castProps;a&&(s.castProps=a,c=Gn(e,n,n.ownerSupport,o,r));return c||vn(o,e,0)}function xn(t,e,n){const r=mn(Hn.DEEP);r.tagJsType=t.tagJsType;const o=gn(r,n,e);function s(){return r.tag=t(),o}return r.wrapper=s,s.tagJsType=t.tagJsType,s.original=t.original||t,o}function En(t,e){const n=t.rearray;n.length&&n.length!==t.stateArray.length&&function(t,e,n){const r=`Saved states between renders are inconsistent. Expected ${t.length} states got ${n.stateArray.length}.`,o=e.templater?.wrapper;let s=o;(o?.original||o?.original)&&(s=o.original);const c={oldStates:n.stateArray,newStates:n.rearray,tagFunction:s,templater:e.templater},u=new qe(r,c);throw console.error(An,c),u}(n,e,t)}const An="State tracking requires same number of state calls on every render. This error typically occurs when a state call is only reachable behind a condition. Also, wrapping tags that have state, with tag(), often helps when tag is only reachable by a condition.";function On(t,e){const n=t.subject;++n.renderCount;const r=Ct.stateConfig;t.state=r.stateArray,t.states=r.states,n.global.newest=t,En(r,t),delete r.prevSupport,delete r.support,delete r.stateArray,delete r.states,Ct.tagClosed$.next(e)}function Pn(t,e,n,r){!function(t,e){const n=e?.state,r=Ct.stateConfig;if(n)return void lt(0,e,Ct.stateConfig,n);it(t,r)}(t,e);const o=t.templater;let s;if(o.tagJsType===O.stateRender){const e=o;s=ue(o,r,t.appSupport,n),Sn(o,e,s)}else{s=(0,o.wrapper)(t,n,e)}return On(s,r),s}function In(t,e,r,o,s,c){n(e);const u=xn(t,e,r);Pn(u,void 0,e,r);return hn(u.templater,e,r,o,s,c)}function Jn(t,e,n,r){const o=ue(t,n,n.appSupport,e),s=o.propsConfig;if(s){const e=t.tagJsType!==O.tagComponent?[]:jn(t,o);s.castProps=e}const c=e.global,{support:u}=Xn(o,c.newest,e,n);return function(t,e,n){ln(t,e,void 0,n.placeholder)}(u,r,e),u}function Vn(t,e,n,r,o){const s=ue(t,n,n.appSupport,e),c=s.propsConfig;if(c){const e=t.tagJsType!==O.tagComponent?[]:jn(t,s);c.castProps=e}const u=e.global,{support:a}=Xn(s,u.newest,e,n);return function(t,e,n){let r=Mr.length;const o=ln(t,e,n,void 0);for(const t of o.dom)t.domElement&&Mr.splice(r++,0,[Dr,[n,t.domElement]]),t.marker&&Mr.splice(r++,0,[Dr,[n,t.marker]])}(a,r,o),a}function Mn(t,e,r,o,s){if(n(e),s){return Vn(t,e,r,o,s)}return Jn(t,e,r,o)}let Ln=0;var Hn;function Nn(t,e=Hn.SHALLOW){const n=function(...r){const o=mn(e,r);o.tagJsType=O.tagComponent,o.processInit=Mn;const s=function(t,e){return function(n,r,o){const s=jn(t,n,o),c=n.ownerSupport,u=ue(t,c,n.appSupport,r,s);return Sn(t,e,u,s)}}(o,n);return s.original=t,o.wrapper=s,o},r=t;return n.original=t,r.tags=yn,r.setUse=Ct,r.ValueTypes=O,r.tagIndex=Ln++,yn.push(n),n}function Wn(t,e,n){if(er(t,e))return 11;switch(n){case Hn.NONE:return 1;case Hn.SHALLOW:return Bn(t,e);case Hn.IMMUTABLE:return Dn(t,e)}return function(t,e){let n=t,r=e;n=[...t],r=[...e||[]];if(!n.every(((t,e)=>function(t,e,n,r){const o=r[e];if(typeof t===A.object){const e={...t},n={...o||{}},r=Object.entries(e).every((([t,r])=>Rn(r,n[t],(()=>{delete e[t],delete n[t]}))));return r}return Rn(t,o,(function(){n.splice(e,1),r.splice(e,1)}))}(t,e,n,r))))return 7;return!1}(t,e)}function Rn(t,e,n){if(typeof t!==A.function)return!!nt(t,e,_n)&&4;if(typeof e!==A.function)return!1;const r=e?.original;r&&(e=r);t.original&&(t=t.original);return t.toString()===e.toString()?(n(),5):(n(),6)}function Dn(t,e){const n=t.length;for(let r=0;r<n;++r){if(t[r]!==e[r])return 2}return!1}function Bn(t,e){const n=t.length;for(let r=0;r<n;++r){const n=t[r],o=e[r];if(K(n)&&K(o)){if(n===o)continue;return 3}if(typeof n!==A.function||typeof o!==A.function)if(typeof n!==A.object){if(n!==o)return 3.3}else if(typeof e===A.object){const t=Object.entries(n);for(const e of t){if(!Un(e,o))return 3.1}}}return!1}!function(t){t.DEEP="deep",t.SHALLOW="shallow",t.NONE="none",t.IMMUTABLE="immutable"}(Hn||(Hn={})),Nn.renderOnce=function(){throw new Error("Do not call tag.renderOnce as a function but instead set it as: `(props) => tag.renderOnce = () => html`` `")},Nn.use=function(){throw new Error("Do not call tag.use as a function but instead set it as: `(props) => tag.use = (use) => html`` `")},Nn.deepPropWatch=Nn,Nn.route=function(t){throw new Error("Do not call tag.route as a function but instead set it as: `tag.route = (routeProps: RouteProps) => (state) => html`` `")},Nn.app=function(t){throw new Error("Do not call tag.route as a function but instead set it as: `tag.route = (routeProps: RouteProps) => (state) => html`` `")},Nn.immutableProps=function(t){return Nn(t,Hn.IMMUTABLE)},Nn.watchProps=function(t){return Nn(t,Hn.SHALLOW)},Object.defineProperty(Nn,"renderOnce",{set(t){t.tagJsType=O.renderOnce,t.processInit=In,t.delete=an,t.checkValueChange=function(){return-1}}}),Object.defineProperty(Nn,"use",{set(t){t.original={setUse:Ct,tags:yn},t.tagJsType=O.stateRender,t.processInit=Mn,t.checkValueChange=un,t.delete=an}});const $n=3,_n=10;function Un([t,e],n){const r=n[t];return typeof e===A.function&&typeof r===A.function||r===e}function Fn(t,e,n,r,o,s){return null==t||s>o?e:typeof t===A.function?e.mem?(t.mem=e.mem,e):(t.mem=e,t):Cn(e)?e:K(e)?function(t,e,n,r,o,s){for(let c=t.length-1;c>=0;--c){const u=t[c],a=e[c];t[c]=Fn(a,u,n,r,s,o+1)}return t}(e,t,n,r,s,o):function(t,e,n,r,o,s){const c=Object.keys(t);for(const u of c){const c=t[u],a=Fn(e[u],c,n,r,s,o+1);if(c===a)continue;const i=Object.getOwnPropertyDescriptor(t,u)?.set;i||(t[u]=a)}return t}(e,t,n,r,s,o)}function Gn(t,e,n,r,o,s=-1){const c=e.subject.global.newest;if(!c){const e=vn(r,t,s);r.push(...e);return t.propsConfig.castProps=e,r}const u=(e=c||e).propsConfig.castProps,a=[];for(let e=0;e<r.length;++e){const c=r[e],i=Fn(u[e],c,t,n,o,s+1);a.push(i)}return t.propsConfig.castProps=a,a}function zn(t){const e=t.subject,r=e.global,{subs:o,tags:s}=Dt(r.context);Zn(r);for(const t of s){const e=t.subject.global;if(!0===e.deleted)return;Zn(e)}r.subscriptions&&o.forEach(Bt),n(e)}function Zn(t){t.deleted=!0,$t(t,[])}function Xn(t,e,n,r){const o=e?.templater,s=o?.tag,c=Pn(t,e,n,r),u=!e||cn(e,c);if(u){if(e){const t=e.templater.tag;t&&n.renderCount>0&&function(t,e,n){if(t.tagJsType===O.dom){const r=n?.dom;return void(r!==t.dom&&zn(e))}if(n){const r=n.strings;if(r){const n=r?.length;n!==t.strings.length&&zn(e)}}}(t,e,s)}}else{!function(t,e){const n=t.subject.global;let r=-1;const o=n.providers=n.providers||[],s=o.length-1;for(;r++<s;){const t=o[r];let s=-1;const c=t.children.length-1;for(;s++<c;)if(n===t.children[s].subject.global)return t.children.splice(s,1),void t.children.push(e)}}(e,c),zn(e);const t=c.subject.global;t.oldest=c,t.newest=c}const a=e?.ownerSupport;return c.ownerSupport=r||a,{support:c,wasLikeTags:u}}function qn(t,e,n,r){const o=r.global,{support:s,wasLikeTags:c}=Xn(e,t,r,n);return c?(ve(o.oldest,s),s):(fn(n,r,{added:0,removed:0}),s)}function Qn(t){return O.templater===t.tagJsType}function Yn(t){const e=t.subject.global,n=Qn(t.templater),r=t.ownerSupport;if(e.locked)return e.blocked.push(t),t;if(n){return Kn(r,t)}e.locked=!0;const o=t.subject;e.blocked.length&&(t=e.blocked.pop(),e.blocked=[]);const s=qn(e.newest,t,r,o);return delete e.locked,s}function Kn(t,e){const n=t.subject.global;if(!n||!0===n.deleted)return e;return Yn(n.newest||t)}function tr(t,e,n){const r=function(t,e){const n=t.props,r=e.propsConfig,o=r.latest;if(er(n,o))return!0;switch(t.propWatch){case Hn.IMMUTABLE:return Dn(n,o);case Hn.SHALLOW:return Bn(n,o)}return!nt(n,o,_n)}(e,n);return!(!t||!r)}function er(t,e){return t.length!==e.length}function nr(t,e){const n=function(t,e,n=[]){const r=t.subject;n.push({support:t,renderCount:r.renderCount,provider:e});const o=e.children;for(let t=o.length-1;t>=0;--t){const r=o[t],s=r.subject;n.push({support:r,renderCount:s.renderCount,provider:e})}return n}(t,e);return n}function rr(t){return t.support}function or(t,e=[]){const n=t.subject.global,r=Qn(t.templater),o=t.ownerSupport;if(n.locked)return e.push(t),e;if(r)return or(o,e);const s=t,c=Z(s.templater),u=t.templater.tagJsType,a=o&&u!==O.stateRender&&(!c||tr(o,s.templater,s)),i=function(t){const e=t.subject.global.providers;if(!e)return[];const n=[];for(const t of e){const e=nr(t.owner,t);n.push(...e.map(rr))}return n}(s);return e.push(...i),a?(or(o,e),c&&e.push(s),e):(e.push(s),e)}function sr(t){++Hr.locks,t.forEach(cr),--Hr.locks,Nr()}function cr(t){const e=t.subject.global;e&&Yn(e.newest)}const ur="no-data-ever",ar="promise-no-data-ever";function ir(t,e){const n=e.subject.global,r=function(t,e){if(!0!==n.deleted)return function(t,e,n,r,o){const s=st(e),c=s.subject,u=c.global;u.locked=!0;const a=t.apply(r,o);delete u.locked;const i=function(t,e){const n=e.subject.global;return function(t,e,n){return sr(or(t)),function(t,e,n){if(q(t)){return e.subject.global.locked=!0,t.then((()=>{if(!0===n.deleted)return ar;delete e.subject.global.locked;return sr(or(e)),ar}))}return ur}(e,t,n)}(e,t,n)}(a,s);return i}(r.tagFunction,r.support,r.states,t,e)};r.tagFunction=t;const o=st(e);r.support=e;const s=o.states;return r.states=s,r}const lr=["init","destroy"];function pr(t,e,n,r,o,s,c){if(c)return R(t,e,n,c,s,o);r(n,t,e)}function fr(t,e,n,r){const o=t.appElement;"blur"===e&&(e="focusout");const s="_"+e,c=t.subject.global.events;if(!c[e]){const t=function(t){t.originalStopPropagation=t.stopPropagation,dr(t,s,t.target)};c[e]=t,o.addEventListener(e,t)}n[s]=r,n[e]=r}function dr(t,e,n){const r=n[e];if(r){let e=!1;if(t.stopPropagation=function(){e=!0,t.originalStopPropagation.call(t)},r(t),t.defaultPrevented||e)return}const o=n.parentNode;o&&dr(t,e,o)}function gr(t,e,n,r){const o=function(...e){return o.tagFunction(t,e)};o.tagFunction=e,o.support=n,fr(n.appSupport,r,t,o)}function hr(t){return null==t||!1===t}function br(t,e){t.removeAttribute(e)}function mr(t,e,n,r){if(n.isNameOnly)return function(t,e,n,r,o,s,c,u){if(n){if(hr(e))return void r.removeAttribute(n);if(typeof n===A.object)if(typeof e===A.object)for(const t in n)t in e||Jr.push([br,[r,t]]);else for(const t in n)Jr.push([br,[r,t]])}Cr(t,e,r,o,s,c,u)}(r,t,n.value,n.element,e,n.howToSet,[],{added:0,removed:0}),void(n.value=t);const o=n.element;!function(t,e,n,r,o,s,c,u){if(Q(t))return function(t,e,n,r,o,s,c,u){const a=t.templater.wrapper;if((a?.tagJsType||a?.original?.tagJsType)!==O.renderOnce)return Sr(c,e,t,r,n);return kr(e,n,r,o,s,t,u)}(o,t,r,e,c,s,n,u);kr(t,r,e,c,s,o,u)}(t,n.attrName,n,o,e,n.howToSet,n.isSpecial,{added:0,removed:0}),n.value=t}function yr(t,e,n,r,o,s,c,u){const i=r.length;function l(r){const s=function(t,e,n){return t.reduce(((t,r)=>{if(a(r)>=0){const r=n++,o=e[r];return t.push(o),t}return t.push(r),t}),[])}(e,r,i).join("");o(n,t,s)}e.forEach((e=>{if(a(e)>=0){const e=r.length,o={isAttr:!0,element:n,attrName:t,withinOwnerElement:!0,handler:(t,e,n,r)=>{l(r)}},s=u[e];o.value=s,r.push(o)}})),l(u)}function vr(t,e,n,r,o,s,c,u){const a={isAttr:!0,element:n,attrName:t,withinOwnerElement:!0};r.push(a),a.handler=mr,function(t,e,n,r,o,s,c,u){n.element=r,n.howToSet=o,typeof e===A.function?u&&lr.includes(t)?R(t,e,r,t,s,c):Sr(n,e,s,t,r):(n.attrName=t,n.isSpecial=u,pr(t,e,r,o,c,s,u))}(t,e,a,n,o,s,c,u),a.value=e}function wr(t){return Y(t)&&"tagJsVar"in t?t.tagJsVar:-1}function Tr(t,e,n,r,o,s,c,u,a){const i=wr(e);if(i>=0){const e=t[i],c=pn(e,s,!0);return c.isAttr=!0,c.element=n,c.howToSet=o,c.isNameOnly=!0,c.handler=mr,void Cr(t,e,n,r,o,s,u)}if(Array.isArray(a))return yr(e,a,n,s,o,0,0,t);const l=wr(a);if(l>=0){return vr(e,t[l],n,s,o,r,u,c)}return pr(e,a,n,o,u,r,c)}function Cr(t,e,n,r,o,s,u){if(!hr(e))if(typeof e!==A.object)0!==e.length&&o(n,e,x);else for(const a in e){const i=e[a];Tr(t,a,n,r,o,s,c(a),u,i)}}function kr(t,e,n,r,o,s,c){if(!1===r){switch(t){case void 0:case!1:case null:return void Jr.push([jr,[e,n]])}if(Q(t))return gr(e,t,s,n);o(e,n,t)}else R(n,t,e,r,s,c)}function Sr(t,e,n,r,o){return gr(o,e=ir(e,n),n,r)}function jr(t,e){t.removeAttribute(e)}function xr(t,e,n,r,o,s,c){const u=document.createTextNode(x),a=pn(t,e,o>0);a.placeholder=u,s?Mr.push([Dr,[s,u]]):Ir.push([Rr,[c,u]]),pe(t,n,a,r,s,c)}const Er=function(){};function Ar(t,e,n,r,o,s,c,u){const a=[];c&&void 0===u&&(u=document.createTextNode(x),Mr.push([Dr,[c,u]]),c=void 0);for(let i=0;i<t.length;++i){const l=t[i],p=l.v;if(!isNaN(p)){xr(e[o.length],o,n,r,s,c,u);continue}const f={};if(a.push(f),"text"===l.nn){Pr(f,l,c,u);continue}const d=Or(f,l,e,n,o,r,c,u);l.ch&&(f.ch=Ar(l.ch,e,n,r,o,s+1,d,u).dom)}return{dom:a,context:o}}function Or(t,e,n,r,o,s,c,u){const a=t.domElement=document.createElement(e.nn);if(e.at)for(const t of e.at){const e=t[0],c=t[1];Tr(n,e,a,r,W,o,t[2]||!1,s,c)}return c?Mr.push([Dr,[c,a]]):Ir.push([Rr,[u,a]]),a}function Pr(t,e,n,r){const o=t,s=o.tc=e.tc;n?Mr.push([Fr,[n,s,t=>o.domElement=t]]):Ir.push([Ur,[r,s,t=>o.domElement=t]])}let Ir=[],Jr=[],Vr=[],Mr=[],Lr=[];const Hr={locks:0};function Nr(){if(!(Hr.locks>0)){for(const t of Jr)t[0](...t[1]);for(const[t,e]of Vr)e.textContent=t;for(const t of Mr)t[0](...t[1]);for(const t of Ir)t[0](...t[1]);Ir=[],Jr=[],Mr=[],Vr=[];for(const t of Lr)t[0](...t[1]);Lr=[]}}function Wr(t){t.parentNode.removeChild(t)}function Rr(t,e){t.parentNode.insertBefore(e,t)}function Dr(t,e){t.appendChild(e)}const Br="object"==typeof document&&document.createElement("div");function $r(t){return Br.innerHTML=t,document.createTextNode(Br.innerHTML)}function _r(t,e,n=Er){const r=$r(e);Rr(t,r),n(r)}function Ur(t,e,n=Er){Br.innerHTML=e;const r=document.createTextNode(Br.textContent);Rr(t,r),n(r)}function Fr(t,e,n){Br.innerHTML=e;const r=document.createTextNode(Br.textContent);Dr(t,r),n(r)}function Gr(t,e){const n=t.subContext;n.deleted=!0,delete t.subContext;const r=n.appendMarker;if(r&&(Ir.push([Wr,[r]]),delete n.appendMarker),delete t.delete,t.handler=ae,!n.hasEmitted)return;const o=n.contextItem;return o.tagJsVar.delete(o,e),77}function zr(t,e,r,o,s,c){const u=t;let a=u.templater;a||(a=dn(u));const i=n(e);return s?hn(a,e,r,o,s,c):(i.newest=gn(a,r,e),fn(r,e,o))}function Zr(t,e){const n={values:e,ownerSupport:ot(),dom:t,tagJsType:O.dom,processInit:zr,checkValueChange:un,delete:an,key:function(t){return n.arrayValue=t,n},setHTML:function(t){return t.outerHTML=n,n._innerHTML=t,t.oldProcessInit=t.processInit,t.processInit=Xr,n},acceptInnerHTML:function(t){return t.owner=n,n},html:{dom:function(t,e){return n.children={dom:t,values:e},n}}};return Object.defineProperty(n,"innerHTML",{set:t=>n.setHTML(t)}),n}function Xr(t,e,n,r,o,s){zr(t.outerHTML,e,n,r,o,s),e.handler=(t,e,n,r,o)=>{Ce(n,t?.outerHTML||t,e,o)},t.checkValueChange=function(t,e,n){return function(t,e,n){return un(t,e,n)}(t,e,n)}}function qr(t,e){const n={values:e,ownerSupport:ot(),tagJsType:O.tag,processInit:zr,checkValueChange:un,delete:an,strings:t,key:t=>(n.arrayValue=t,n),setHTML:function(t){return t.outerHTML=n,n._innerHTML=t,t.oldProcessInit=t.processInit,t.processInit=Xr,n},acceptInnerHTML:function(t){return t.owner=n,n},html:function(t,e){return n.children={strings:t,values:e},n}};return Object.defineProperty(n,"innerHTML",{set:t=>n.setHTML(t)}),n}function Qr(t,...e){const n=qr(t,e),r=mn(Hn.NONE);return r.tag=n,n.templater=r,n}function Yr(t,e){t.domElement&&e.appendChild(t.domElement),t.marker&&e.appendChild(t.marker)}function Kr(t,e,n){const r=e.global,o=oe(t,e);return se(t,o,o),o.appElement=n,r.oldest=r.oldest||o,r.newest=o,o}function to(t,e,n,r,o,s,c){const u=document.createTextNode(x);yn.push(n.wrapper||{original:n});const a=function(t,e,n,r,o){r.placeholder=e;const s=r.global,c=s.oldest,u=s.newest===c,a=ue(t,s.newest,s.newest.appSupport,r);u||lt(0,s.newest,Ct.stateConfig,c.state);if(t.tagJsType===O.stateRender)return function(t,e,n,r,o){const s=t.wrapper||{original:t};if(!e){const e=Kr(t,r,o);return On(e),e}return Sn(t,s,n),On(n),n}(t,o,a,r,n);const i=t.wrapper,l=i(a,r);return On(a),l}(n,u,o,s,c);if(e.isApp=!0,c&&(r.tag=a.templater.tag),!o)throw new Error(`Cannot tagElement, element received is type ${typeof o} and not type Element`);o.destroy=function(){const t=e.events;for(const e in t){const n=t[e];o.removeEventListener(e,n)}e.events={},++Hr.locks;const n=Zt(a,e);return--Hr.locks,Nr(),n},++Hr.locks;const i=function(t,e,n,r,o,s){console.debug("🏷️ Building element into tag...",{element:e,app:o});const c=ln(t,{added:0,removed:0},e,void 0);n.oldest=t,n.newest=t;let u=r.setUse;if(r.tagJsType!==O.stateRender){const t=o.original;u=t.setUse,t.isApp=!0}e.setUse=u,e.ValueTypes=O,eo.push({element:e,support:t});const a=document.createDocumentFragment();a.appendChild(s);for(const t of c.dom)Yr(t,a);return console.debug("🏷️ Element Tag DOM built ✅"),a}(a,o,e,n,t,u);return--Hr.locks,Nr(),o.appendChild(i),{support:a,tags:yn,ValueTypes:O}}Qr.dom=function(t,...e){return Zr(t,e)};const eo=[];function no(t,e,r){const o=eo.findIndex((t=>t.element===e));if(o>=0){const t=eo[o].support;Zt(t,t.subject.global),eo.splice(o,1),console.warn("Found and destroyed app element already rendered to element",{element:e})}let s=()=>a(r);s.propWatch=Hn.NONE,s.tagJsType=O.stateRender,s.props=[r],s.isApp=!0;const c=function(t,e){const r={value:t,withinOwnerElement:!1,renderCount:0,global:void 0,tagJsVar:{tagJsType:"templater",checkValueChange:un,delete:an,processInit:function(){console.debug("do nothing app function")}}},o=n(r);return o.events={},Kr(t,r,e),r}(s,e),u=c.global;it(u.newest,Ct.stateConfig);let a=t(r);const i=typeof a==A.function;return i||(Z(a)?(u.newest.propsConfig={latest:[r],castProps:[r]},s.propWatch=a.propWatch,s.tagJsType=a.tagJsType,s.wrapper=a.wrapper,s=a):(s.tag=a,a=t)),to(t,u,s,a,e,c,i)}function ro(t){if(!t)return Er;const e=ot();if(!e)throw new Error("output must be used in render sync fashion");return(...n)=>{const r=e.ownerSupport,o=r.subject.global.newest;kt(o.states,r.states);const s=t(...n);kt(r.states,o.states);return kn(o,o.ownerSupport.subject.global.newest),s}}function oo(t,e,n,r,o){const s=t.owner._innerHTML;s.processInit=s.oldProcessInit;const c=n.subContext?.contextItem;Ce(c,s,e,o)}function so(t,e,n,r,o,s){e.subContext={},e.handler=oo,function(t,e,n,r,o,s){const{appendMarker:c,insertBefore:u}=je(s,o),a=n.subContext;a.appendMarker=c;const i=t.owner,l=i._innerHTML;l.processInit=l.oldProcessInit,Se(l,a,e,r,u)}(t,n,e,r,s,o)}function co(){return{tagJsType:"innerHTML",processInit:so,delete:Gr,checkValueChange:()=>console.debug("weird innerHTML check")}}const uo={tagElement:no,renderWithSupport:Xn,renderSupport:Yn,renderTagOnly:Pn,paint:Nr};var ao=e.W9,io=e.cg,lo=e.m0,po=e.rS,fo=e.Y2,go=e.ei,ho=e.B7,bo=e.TU,mo=e.XF,yo=e.PC,vo=e.Ot,wo=e.Mj,To=e.tD,Co=e.j8,ko=e.xe,So=e.um,jo=e.E2,xo=e.OH,Eo=e.TB,Ao=e.Ii,Oo=e.m3,Po=e.yV,Io=e.zV,Jo=e.pf,Vo=e.ze,Mo=e.WJ,Lo=e.Ng,Ho=e.HG,No=e.aZ,Wo=e.Ey,Ro=e.O,Do=e.F3,Bo=e.Ie,$o=e.ts,_o=e.B4,Uo=e.Az,Fo=e.Xi,Go=e.sV,zo=e.Ah,Zo=e.ck,Xo=e.Gk,qo=e.j_,Qo=e.zC,Yo=e.cF,Ko=e.jU,ts=e.PB,es=e.qy,ns=e.cy,rs=e.Tn,os=e.Gv,ss=e.yL,cs=e.D8,us=e.Ze,as=e._4,is=e.mn,ls=e.z,ps=e.sA,fs=e.TG,ds=e.MG,gs=e.PL,hs=e.CG,bs=e.nI,ms=e.PZ,ys=e.r5,vs=e.uc,ws=e.pG,Ts=e.QB,Cs=e.Ll,ks=e.vP,Ss=e.wk,js=e.xP,xs=e.bc,Es=e.B1,As=e.RX,Os=e.ag,Ps=e.Tc,Is=e.Hf,Js=e._A,Vs=e.Ag,Ms=e.NU,Ls=e.wB,Hs=e.id,Ns=e.MC,Ws=e.SZ;export{ao as ArrayNoKeyError,io as BasicTypes,lo as ImmutableTypes,po as PropWatches,fo as RouteQuery,go as StateMismatchError,ho as Subject,bo as Subjective,mo as SyncCallbackError,yo as TagError,vo as ValueSubject,wo as ValueSubjective,To as ValueTypes,Co as addOneContext,ko as appElements,So as buildBeforeElement,jo as callback,xo as callbackMaker,Eo as checkArrayValueChange,Ao as checkSimpleValueChange,Oo as checkSubContext,Po as checkTagValueChange,Io as combineLatest,Jo as createHtmlSupport,Vo as createTrigger,Mo as defineValueOn,Lo as deleteSimpleValue,Ho as deleteSubContext,No as destroyArray,Wo as destroyArrayContextItem,Ro as destroySupport,Do as destroySupportByContextItem,Bo as empty,$o as forceUpdateExistingValue,_o as getBaseSupport,Uo as getDomMeta,Fo as getDomTag,Go as getInnerHTML,zo as getNewGlobal,Zo as getStringTag,Xo as getTemplaterResult,qo as guaranteeInsertBefore,Qo as hasPropChanges,Yo as hmr,Ko as howToSetFirstInputValue,ts as howToSetInputValue,es as html,ns as isArray,rs as isFunction,os as isObject,ss as isPromise,cs as isSimpleType,us as isStaticTag,as as isSubjectInstance,is as isTagComponent,ls as letProp,ps as onDestroy,fs as onFirstSubContext,ds as onInit,gs as oneRenderToSupport,hs as output,bs as paint,ms as processFirstSubjectValue,ys as providers,vs as renderSupport,ws as renderTagOnly,Ts as renderWithSupport,Cs as setUseMemory,ks as signal,Ss as state,js as states,xs as subject,Es as subscribe,As as subscribeWith,Os as syncError,Ps as tag,Is as tagElement,Js as tags,Vs as upgradeBaseToSupport,Ms as variablePrefix,Ls as watch,Hs as willCallback,Ns as willPromise,Ws as willSubscribe};
|
|
2
2
|
//# sourceMappingURL=bundle.js.map
|