taggedjs 3.0.5 → 3.0.9

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 CHANGED
@@ -1,2 +1,2 @@
1
- var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function n(t){return t.renderCount=t.renderCount||0,t.varCounter=0,t.state={newer:{state:[],states:[]}},t.global={blocked:[]}}t.d(e,{W9:()=>Nr,cg:()=>I,m0:()=>k,rS:()=>Zo,Y2:()=>o,ei:()=>Ur,B7:()=>q,TU:()=>Z,XF:()=>$r,PC:()=>Hr,Ot:()=>Tr,Mj:()=>Vr,tD:()=>S,a:()=>ya,Gf:()=>c,xe:()=>rs,YO:()=>_r,b:()=>Ja,rf:()=>Fs,br:()=>va,um:()=>Zn,x6:()=>Ls,E2:()=>Wr,OH:()=>Br,TB:()=>Ft,Ii:()=>Rt,mX:()=>mo,yV:()=>fe,EI:()=>de,aY:()=>Aa,zV:()=>G,pf:()=>ur,ze:()=>Rr,Go:()=>ot,bD:()=>st,WJ:()=>Y,wL:()=>yo,Ng:()=>Wt,O:()=>ue,r3:()=>ia,y4:()=>na,Ie:()=>J,lI:()=>ca,$F:()=>Ea,vP:()=>Sa,hp:()=>Ae,qr:()=>aa,ts:()=>fr,B4:()=>ar,HD:()=>Gr,Az:()=>qn,Xi:()=>ns,sV:()=>To,Ah:()=>n,f5:()=>Me,Gk:()=>oo,j_:()=>dr,h1:()=>Gs,h2:()=>Xs,h3:()=>Ks,h4:()=>qs,h5:()=>Zs,h6:()=>Ys,zC:()=>Qo,d5:()=>Us,wx:()=>sa,cF:()=>Ma,Hc:()=>So,PB:()=>Jt,uq:()=>It,hr:()=>zs,qy:()=>os,gM:()=>Ns,gx:()=>Ss,hF:()=>Ds,cy:()=>D,Tn:()=>P,Gv:()=>j,yL:()=>L,D8:()=>E,Ze:()=>A,_4:()=>O,mn:()=>M,Pf:()=>xa,o1:()=>ua,z:()=>Pr,li:()=>ea,nf:()=>Rs,iW:()=>oa,mI:()=>Ws,C$:()=>Ia,et:()=>As,Vg:()=>_s,ol:()=>Qs,sA:()=>Fo,TG:()=>xo,MG:()=>Wo,PL:()=>ao,uK:()=>js,CG:()=>ko,p:()=>wa,nI:()=>h,Fs:()=>Vo,AS:()=>la,r5:()=>Dr,M$:()=>Ee,uc:()=>je,QB:()=>Oe,uW:()=>ra,Lt:()=>Ps,Jv:()=>Et,TA:()=>St,Jn:()=>At,Ll:()=>tt,L6:()=>wr,EX:()=>Ca,Ln:()=>Ta,wk:()=>$o,xP:()=>Lr,ko:()=>Va,iF:()=>Bs,bc:()=>Or,B1:()=>bo,RX:()=>fo,lR:()=>ka,ag:()=>Fr,tp:()=>pa,Tc:()=>Yo,Hf:()=>ss,zc:()=>ht,_A:()=>ro,T_:()=>ma,td:()=>da,g0:()=>Hs,pd:()=>ba,th:()=>ga,VQ:()=>ha,DD:()=>$s,tr:()=>fa,ul:()=>ta,Ag:()=>cr,Pc:()=>Xt,NU:()=>dn,wB:()=>Sr,id:()=>Jr,MC:()=>kr,SZ:()=>Ir});class o{get(t){return"todo"}}function r(){return tt.stateConfig.support}function s(t){return Kr(t.context),tt.stateConfig.support=t}const a=function(){};function c(t){}let u=[];const i=[];let l=[],p=[],f=[];const d={locks:0,removeLocks:0};function g(t,e){e.textContent=t}function h(){d.locks>0||(++d.locks,function(){const t=i.length;(function(){for(const t of i)t[0](...t[1])})(),i.splice(0,t);for(const t of l)t[0](...t[1]);for(const t of p)t[0](...t[1]);for(const t of u)t[0](...t[1])}(),--d.locks,function(){u=[],l=[],p=[];const t=f;f=[];for(const e of t)e[0](...e[1])}())}function m(t,e){i.push([b,[t,e]])}function b(t,e){t.parentNode.removeChild(t)}function y(t,e,n){t.parentNode.insertBefore(e,t)}function v(t,e){t.appendChild(e)}const x="object"==typeof document&&document.createElement("div");function w(t){return x.innerHTML=t,document.createTextNode(x.innerHTML)}function C(t,e,n=a,o){const r=w(e);y(t,r),n(r)}function T(t,e,n=a){x.innerHTML=e;const o=document.createTextNode(x.textContent);y(t,o),n(o)}function V(t,e,n){x.innerHTML=e;const o=document.createTextNode(x.textContent);v(t,o),n(o)}const J="";var k,I;!function(t){t.string="string",t.number="number",t.boolean="boolean",t[void 0]="undefined"}(k||(k={})),function(t){t.function="function",t.date="date",t.unknown="unknown",t.object="object"}(I||(I={}));const S={tag:"html",dom:"dom",templater:"templater",tagComponent:"tagComponent",tagArray:"tagArray",host:"host",subscribe:"subscribe",signal:"signal",renderOnce:"renderOnce",stateRender:"stateRender",version:Date.now()};function E(t){switch(t){case k.string:case k.number:case k.boolean:return!0}return!1}function A(t){if(!t)return!1;switch(t.tagJsType){case S.dom:case S.tag:case S.templater:return!0}return!1}function M(t){const e=t?.tagJsType;return e===S.tagComponent||e===S.stateRender}function O(t){return j(t)&&typeof t.subscribe===I.function}function L(t){return t&&P(t.then)}function P(t){return typeof t===I.function}function j(t){return typeof t===I.object&&null!==t}function D(t){return Array.isArray(t)}function H(t){const e=t.state;return e&&e.newest&&e.newest?e.newest:t.parentContext?H(t.parentContext):void 0}function N(t){let e=t;for(;e.ownerSupport&&!M(e.templater);)e=e.ownerSupport;const n=e.context.state;return n&&n.newest||e}function U(...t){return t}function $(t){const e=tt.stateConfig;return e.states[e.statesIndex]=t,++e.statesIndex,t(U)}function W(t){const e=tt.stateConfig,n=e.statesIndex,o=N(e.prevSupport).context.state.older.states[n];let r=[];o((function(...t){return r=t,o.lastValues=r,t}));return e.states[e.statesIndex]=t,++e.statesIndex,t((function(...t){return r}))}function R(t){Kr(t);const e=tt.stateConfig;e.handlers.handler=z,e.handlers.statesHandler=$,e.rearray=[];const n=e.state=[],o=e.states=[];e.statesIndex=0;(t.state=t.state||{}).newer={state:n,states:o}}class B{}function F(t){const e=t.callback;if(!e)return t.defaultValue;const[n]=function(t){const[e]=t(B),[n]=t(e);return[e,n]}(e);return n}function _(){const t=tt.stateConfig,e=t.rearray[t.state.length];return t.state.push(e),e.defaultValue}function z(t){const e=tt.stateConfig,n=Gr();if(!n||!n.state){const t="State requested but TaggedJs is not currently rendering a tag or host";throw console.error(t,{config:e,context:n}),new Error(t)}const o=n.state.newer;e.state=o.state;let r=t;if(typeof t===I.function&&(r=t()),typeof r===I.function){const t=r;r=function(...e){return t(...e)},r.original=t}const s={get:function(){return F(s)},defaultValue:r};return e.state.push(s),r}function G(t){const e=new q;return e.subscribeWith=e=>{const n=[],o=[],r=(r,s)=>{n[s]=!0,o[s]=r;if(n.length===t.length){for(const t of n)if(!t)return;e(o,a)}},s=[...t],a=s.shift().subscribe((t=>r(t,0))),c=s.map(((t,e)=>t.subscribe((t=>r(t,e+1)))));return a.subscriptions=c,a},e}function X(t,e,n){const o=q.globalSubCount$;q.globalSubCount$.next(o.value+1);const r=function(){r.unsubscribe()};return r.callback=e,r.subscriptions=[],r.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 o=q.globalSubCount$;q.globalSubCount$.next(o.value-1),t.unsubscribe=()=>t;const r=t.subscriptions;for(const t of r)t.unsubscribe();return t}(r,n,e)},r.add=t=>(r.subscriptions.push(t),r),r.next=t=>{e(t,r)},r}function K(t,e,n){const o=[...e],r=o.shift(),s=t=>{if(o.length)return K(t,o,n);n(t)};let a=s;const c=r(t,{setHandler:t=>a=t,next:s});a(c)}class q{onSubscription;methods=[];isSubject=!0;subscribers=[];subscribeWith;value;constructor(t,e){this.onSubscription=e,arguments.length>0&&(this.value=t)}subscribe(t){const e=X(0,t,this.subscribers),n=this.subscribeWith;if(n){if(this.methods.length){const n=t;t=t=>{K(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,o)=>{const r=o?.unsubscribe;r?r():setTimeout((()=>e.unsubscribe()),0),t(n)}));return e}pipe(...t){const e=[];"value"in this&&e.push(this.value);const n=new q(...e);return n.setMethods(t),n.subscribeWith=t=>this.subscribe(t),n.next=t=>this.next(t),n}setMethods(t){this.methods=t}static all(t){return G(t.map((t=>{if(O(t))return t;return new q(t,(e=>(e.next(t),e)))})))}static globalSubCount$=new q(0)}class Z extends q{_value;constructor(...t){super(...t),this._value=t[0],Y(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 Y(t){Object.defineProperty(t,"value",{set(e){t._value=e,t.emit()},get:()=>t._value})}const Q=new q(void 0,(function(t){r()||t.next()})),tt={stateConfig:{state:[],version:Date.now(),handlers:{handler:z,statesHandler:$}},tagClosed$:Q};function et(t,e,n){if(e.deleted)return;const o=t[e.valueIndex],r=e.tagJsVar;Kr(e),r.processUpdate(o,e,n,t),qr(),e.value=o}function nt(t,e){const n=t.context.contexts;!function(t,e){const n=e.templater,o=e.templater.tag,r=n.values||o.values,s=t.templater.tag;s.values=r}(t,e),++d.locks,function(t,e){const n=t.templater.tag.values;for(const o of e)et(n,o,t)}(t,n),--d.locks,h()}function ot(t,e){return rt(t,e)}function rt(t,e){if(null===t||typeof t!==I.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=D(t)?[]:Object.create(Object.getPrototypeOf(t));if(D(t))for(let o=0;o<t.length;o++)n[o]=rt(t[o],e-1);else for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=rt(t[o],e-1));return n}function st(t,e,n){return at(t,e,n)}function at(t,e,n){return!(t!==e&&(o=t,r=e,!P(o)||!P(r)||o.toString()!==r.toString()))||(n<0||typeof t===I.object&&typeof e===I.object&&(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():D(t)&&D(e)?function(t,e,n){if(t.length!==e.length)return!1;for(let o=0;o<t.length;o++)if(!at(t[o],e[o],n-1))return!1;return!0}(t,e,n-1):!D(t)&&!D(e)&&function(t,e,n){const o=Object.keys(t),r=Object.keys(e);if(0===o.length&&0===r.length)return!0;if(o.length!==r.length)return!1;for(const s of o){if(!r.includes(s)||!at(t[s],e[s],n-1))return!1}return!0}(t,e,n-1)));var o,r}function ct(t){return t.map(ut)}function ut(t,e){const n=t,o=t?.tagJsType;if(o)switch(o){case S.signal:case S.subscribe:case S.stateRender:return;case S.dom:case S.tag:case S.templater:return ct(n.values)}return D(t)?ct(n):ot(t,e)}function it(t,e){const n=t.length;for(let o=0;o<n;++o){const n=t[o],r=e[o];if(D(n)&&D(r)){if(n===r)continue;return 3}if(typeof n!==I.function||typeof r!==I.function)if(typeof n!==I.object){if(n!==r)return 3.3}else if(typeof e===I.object){const t=Object.entries(n);for(const e of t){if(!lt(e,r))return 3.1}}}return!1}function lt([t,e],n){const o=n[t];return typeof e===I.function&&typeof o===I.function||o===e}function pt(t,e){const n=t.context.providers;if(n)for(const t of n)for(let n=t.children.length-1;n>=0;--n){t.children[n].context.global===e&&t.children.splice(n,1)}t.context.destroy$.next(),t.context.renderCount=0}function ft(t,e){for(const n of t){const t=n.lastArray;if(t){ft(t,e);continue}const o=n.value;if(o?.tagJsType===S.subscribe){o.destroy(n,e),n.deleted=!0;continue}const r=n.global;if(!r)continue;const s=n.state.newest,a=r.subscriptions;a&&a.forEach(gt),M(s.templater)&&pt(s,r);ft(n.contexts,s),r.deleted=!0}}function dt(t,e=[],n=[]){for(const o of t){const t=o.global;if(!t)continue;const r=o.state.newest;if(r){e.push(r);const o=t.subscriptions;o&&n.push(...o)}const s=o.contexts;s&&dt(s,e,n)}return{tags:e,subs:n}}function gt(t){t.unsubscribe()}function ht(t,e,n){const o=e.tagJsVar.tagJsType;return o&&["tag-conversion","element"].includes(o)?(e.tagJsVar.processUpdate(t,e,n,[]),e.value=t,0):t===e.value?0:(++e.updateCount,fr(e,t,n))}function mt(t,e,n,o,r){const s=e.context;s.locked=3,n.element=n.element||o,Kr(n),n.tagJsVar.processInit(t,n,e,r,o),qr(),n.value=t,delete s.locked}function bt(t){switch(t){case void 0:case!1:case null:return J}return t}function yt(t){if(t.startsWith("class."))return"class";const e=function(t){switch(t){case"autoselect":case"autoSelect":return"autoselect";case"autofocus":case"autoFocus":return"autofocus"}return!1}(t);return!1!==e?e:!!t.startsWith("style.")&&"style"}function vt(t,e,n,o){switch(o){case"autofocus":return void f.push([Vt,[n]]);case"autoselect":return void f.push([Tt,[n]]);case"style":{const o=t.split(".");return void l.push([xt,[n,o,e]])}case"class":return void function(t,e,n){const o=t.split(".");if(o.shift(),e){for(const t of o)l.push([wt,[n,t]]);return}for(const t of o)l.push([Ct,[n,t]])}(t,e,n)}throw new Error(`Invalid special attribute of ${o}. ${t}`)}function xt(t,e,n){const o=e[1];t.style[o]=n,t.style.setProperty(o,n)}function wt(t,e){t.classList.add(e)}function Ct(t,e){t.classList.remove(e)}function Tt(t){t.select()}function Vt(t){t.focus()}function Jt(t,e,n){if(j(n))return kt(t,e,n);l.push([St,[t,e,n]])}function kt(t,e,n){"object"!=typeof t[e]&&(t[e]={});for(const o in n){const r=n[o];l.push([Ot,[t,e,o,r]])}if(t[e].setProperty)for(const o in n){const r=n[o];l.push([Mt,[t,e,o,r]])}}function It(t,e,n){t.setAttribute(e,"")}function St(t,e,n){if(j(n))return kt(t,e,n);At(t,e,n)}function Et(t,e,n){t[e]=!!n}function At(t,e,n){t[e]=n,void 0!==n&&!1!==n&&null!==n?t.setAttribute(e,n):t.removeAttribute(e)}function Mt(t,e,n,o){t[e].setProperty(n,o)}function Ot(t,e,n,o){t[e][n]=o}function Lt(t,e,n,o,r,s,a){return n.element=o,n.howToSet=r,n.attrName=t,n.isSpecial=a,e?.tagJsType?function(t,e,n,o,r){e.processInitAttribute(t,e,r,e,n,o,St),n.tagJsVar=e}(t,e,n,s,o):Pt(t,e,o,r,a,n)}function Pt(t,e,n,o,r,s){return"function"==typeof e?function(t,e,n,o,r){const s=t(),c={tagJsType:"dynamic-attr",matchesInjection:t=>{const e=u.tagJsVar;if(e.matchesInjection)return e.matchesInjection(t,u)},hasValueChanged:(e,n,o)=>{const r=t();return u.tagJsVar.hasValueChanged(r,u,o)},processInit:a,processInitAttribute:a,destroy:(t,e)=>{u.tagJsVar.destroy(u,e)},processUpdate:(t,e,n,o)=>{++e.updateCount;const r=t();u.tagJsVar.processUpdate(r,u,n,o),u.value=r}},u={updateCount:0,isAttr:!0,element:o,parentContext:e,value:s,tagJsVar:Xt(s),valueIndex:-1,withinOwnerElement:!0,destroy$:new q,render$:new q},i={updateCount:0,isAttr:!0,contexts:[u],element:o,parentContext:e,value:t,tagJsVar:c,valueIndex:-1,withinOwnerElement:!0,destroy$:new q,render$:new q};return u.tagJsVar.processInitAttribute(n,s,o,u.tagJsVar,u,{},r),i}(e,s,t,n,o):r?vt(t,e,n,r):void o(n,t,e)}function jt(t,e,n,o,r,s){const a=e.tagJsVar,c=t;if(a.hasValueChanged(c,e,n)>0){a.destroy(e,n),o.removeAttribute(r);const c=Xt(t);return c.isAttr=!0,c.processInitAttribute(r,t,o,c,e,n,s),void(e.tagJsVar=c)}}function Dt(t,e,n,o,r,s,a){o.destroy=Ht,o.hasValueChanged=Rt,o.processUpdate=(e,o,r)=>jt(e,o,r,n,t,a);const c=yt(t);Pt(t,e,n,a,c,r),r.tagJsVar=o}function Ht(t){const e=t.element,n=t.attrName;e.removeAttribute(n)}function Nt(t){return{tagJsType:"simple",value:t,processInitAttribute:Dt,processInit:$t,destroy:Wt,hasValueChanged:Bt,processUpdate:Ut}}function Ut(t,e,n){return t===e.value?0:fr(e,t,n)}function $t(t,e,n,o,r){const s=bt(t);o=e.placeholder;const a=e.paint=[C,[o,s,function(t){e.simpleValueElm=t,delete e.paint},"processSimpleValueInit"]];u.push(a)}function Wt(t){if(!t.simpleValueElm&&t.paint)return void(t.paint[0]=a);const e=t.simpleValueElm;delete t.simpleValueElm,m(e,"deleteSimpleValue")}function Rt(t,e){return null==t||t===e.value?0:6}function Bt(t,e){return null!=t&&typeof t===I.object?(Wt(e),6):(function(t,e){const n=bt(t);if(e.paint)return void(e.paint[1][1]=n);const o=e.simpleValueElm;l.push([g,[n,o]])}(t,e),0)}function Ft(t,e){return D(t)?0:(ne(e),9)}function _t(t){return{tagJsType:"array",value:t,processInitAttribute:a,processInit:Gt,processUpdate:zt,hasValueChanged:Ft,destroy:ne}}function zt(t,e,n){if(++e.updateCount,Array.isArray(t))return void Zt(e,t,n);0===ht(t,e,n)&&Zt(e,t,n)}function Gt(t,e,n,o,r){Zt(e,t,n,r)}function Xt(t){const e=t?.tagJsType;return e?t:function(t){if(D(t))return _t(t);return Nt(t)}(t)}function Kt(t,e,n,o){return{updateCount:0,value:t,destroy$:new q,render$:new q,tagJsVar:Xt(t),withinOwnerElement:n,parentContext:o,valueIndex:o.varCounter}}function qt(t,e,n,o,r){const s=document.createTextNode(J),a=Kt(t,0,!0,e.context);return a.withinOwnerElement=!1,a.placeholder=s,r||(a.placeholder=o),mt(t,e,a,r,o),r&&p.push([v,[r,s]]),a}function Zt(t,e,n,o){const r=void 0===t.lastArray;r&&(t.lastArray=[]);const s=t.lastArray;let a=t.placeholder,c=0;const u=[];if(!r){for(let t=0;t<s.length;++t){const n=s[t],o=te(e,t,s,c);0!==o?2!==o?c+=o:t-=1:u.push(n)}t.lastArray=u}const i=e.length;for(let r=0;r<i;++r){a=Yt(e,r,t.lastArray,n,a,o).placeholder}}function Yt(t,e,n,o,r,s){const a=Qt(t[e]),c=n[e];if(c)return function(t,e,n,o,r,s,a){const c=n.length>r;if(c)return Array.isArray(t)?(e.tagJsVar.processUpdate(t,e,o,[]),e.value=t,e):(ht(t,e,o),e);const u=qt(t,o,0,s,a);return n.push(u),u}(a,c,n,o,e,r,s);const u=qt(a,o,0,r,s);return n.push(u),u}function Qt(t){if("function"==typeof t&&void 0===t.tagJsType){t=t()}return t}function te(t,e,n,o){const r=t.length-1,s=e-o,a=s<0||r<s,c=n[e];if(a)return ee(c),1;const u=function(t,e,n,o,r){const s=e&&t!==e.arrayValue;if(s)return ee(n),o.splice(r,1),2;return 0}(c.value.arrayValue,Qt(t[e]),c,n,e);return u}function ee(t){!function(t,e){if(t&&e.state?.oldest){return void ue(e.state.oldest,t)}e.tagJsVar.destroy(e,{})}(t.global,t)}function ne(t){++t.updateCount;oe(t,t.lastArray)}function oe(t,e){for(let t=0;t<e.length;++t)ee(e[t]);delete t.lastArray}function re(t){for(let e=t.length-1;e>=0;--e){se(t[e]),t.splice(e,1)}}function se(t){const e=t.marker;e&&m(e,"destroyMarker");m(t.domElement,"destroyClone")}function ae(t,e){!function(t,e){for(const n of t){if(n.withinOwnerElement){const t=n.tagJsVar;if(t&&"host"===t.tagJsType){const o=n.supportOwner,r=t.destroy(n,o);L(r)&&e.push(r)}continue}const t=n.lastArray;if(t){oe(n,t);continue}const o=n.simpleValueElm;if(o){delete n.simpleValueElm,m(o,"smartRemoveByContext");continue}const r=n.global;if(void 0===r)continue;r.deleted=!0;const s=n.state?.oldest;s&&ae(n,e)}}(t.contexts,e),ce(t)}function ce(t){re(t.htmlDomMeta)}function ue(t,e){const n=t.context;e.deleted=!0,n.renderCount=0;const o=[];return ft(n.contexts,t),t.templater.wrapper&&pt(t,e),ae(n,o),delete n.state,delete n.contexts,delete n.returnValue,delete n.providers,o}function ie(t,e){const n=le(t,e);return!(n||!e.templater.tag?._innerHTML||!le(t.outerHTML,e))||n}function le(t,e){const n=t.templater,o=e.templater,r=n?.tag||t,s=o.tag;if(n?.tagJsType===S.stateRender)return n.dom===o.dom;switch(r.tagJsType){case S.dom:return s?.tagJsType===S.dom&&function(t,e){const n=t.dom,o=e.dom;return n===o}(r,s);case S.tag:{const n=function(t,e,n,o){const r=t.strings,s=e.strings;if(r.length!==s.length)return!1;if(!r.every(((t,e)=>s[e].length===t.length)))return!1;const a=n.templater.values||t.values,c=o.templater.values||e.values;return function(t,e){const n=t.length===e.length;if(!n)return!1;const o=e.every((function(e,n){const o=t[n];if(typeof e===I.function&&typeof o===I.function){return!!(e.toString()===o.toString())}return!0}));if(o)return!0;return!1}(a,c)}(r,s,t,e);return n}}throw new Error(`unknown tagJsType of ${r.tagJsType}`)}function pe(t){++t.updateCount;const e=t.global;ue(t.state.newest,e),function(t){t.htmlDomMeta=[],delete t.contexts,delete t.state,delete t.global,t.renderCount=0}(t)}function fe(t,e){const n=e.state?.newest;if(A(t)){return ie(t,n)?0:7}const o=t?.tagJsType;return o?t.wrapper?.original===e.value.wrapper?.original?0:88:8}function de(t,e){const o=e.global,r=e.state?.newest;if(A(t)){return ie(t,r)?(lr(e,t,r),0):(ue(r,o),n(e),7)}const s=t?.tagJsType;if(s){return!0===lr(e,t,e.state.newest.ownerSupport)?0:88}return pe(e),8}function ge(t,e,n,o,r,s,a){const c=document.createTextNode(J),i=function(t,e,n,o){const r=Kt(t,0,n,o);return e.push(r),++o.varCounter,r}(t,e,r>0,o);return i.placeholder=c,i.element=s,s?p.push([v,[s,c]]):u.push([y,[a,c,"attachDynamicDom.attachDynamicDom"]]),mt(t,n,i,s,a),i}function he(t,e){const n=function(t,e,n=[]){const o=t.context;n.push({support:t,renderCount:o.renderCount,provider:e});const r=e.children;for(let t=r.length-1;t>=0;--t){const o=r[t],s=o.context;n.push({support:o,renderCount:s.renderCount,provider:e})}return n}(t,e);return n}function me(t){return t.support}function be(t){const e=t.context;return Pe(t.templater)?De(t):Le(t,t,e)}function ye(t,e,n){return t}function ve(t){return typeof t!==I.object||!t||t.tagJsType}function xe(t,e,n,o,r,s){return null==t||s>r?e:typeof t===I.function?e.mem?(t.mem=e.mem,e):(t.mem=e,t):ve(e)?e:D(e)?function(t,e,n,o,r,s){for(let a=t.length-1;a>=0;--a){const c=t[a],u=e[a];t[a]=xe(u,c,n,o,s,r+1)}return t}(e,t,n,o,s,r):function(t,e,n,o,r,s){const a=Object.keys(t);for(const c of a){const a=t[c],u=xe(e[c],a,n,o,s,r+1);if(a===u)continue;const i=Object.getOwnPropertyDescriptor(t,c)?.set;i||(t[c]=u)}return t}(e,t,n,o,s,r)}function we(t,e,o){const r=o.global,s=o.state.newest,a=s.templater.wrapper;let c=e.templater.wrapper,u=!1;const i=e.templater.tagJsType,l=S.stateRender===i||S.renderOnce===i;if(l)u=e.templater.tagJsType===S.renderOnce||ie(s,e);else if(a&&c){const t=s.templater.tag?._innerHTML;t&&(c=e.outerHTML);u=a.original===c.original}const p=e.templater;if(!u)return void function(t,e,o){const r=t.global;ue(t.state.oldest,r),n(t),e.processInit(e,t,o,t.placeholder)}(o,p,t);const f=l||function(t,e){const n=e.props,o=t.propsConfig,r=o.latest,s=Qo(n,r,t.templater.propWatch);return s}(s,p);if(f)o.locked?r.blocked.push(e):(je(e),++o.renderCount);else{!function(t,e,n,o,r){const s=t.props,a=Ce(e,n,o,s,r),c=e.propsConfig;c.castProps=a;const u=n.propsConfig;u.latest=c.latest}(p,e,s,t,p.propWatch===Zo.DEEP?or:nr)}}function Ce(t,e,n,o,r,s=-1){const a=e.context;if(!a.global||!a.state.newest){const e=ye(o);o.push(...e);return t.propsConfig.castProps=e,o}const c=(e=a.state.newest||e).propsConfig.castProps,u=[];for(let e=0;e<o.length;++e){const a=o[e],i=xe(c[e],a,t,n,r,s+1);u.push(i)}return t.propsConfig.castProps=u,u}function Te(t){const e=t.context,o=e.global,{subs:r,tags:s}=dt(e.contexts);Ve(e);for(const t of s){if(!0===t.context.global.deleted)return;Ve(t.context)}o.subscriptions&&r.forEach(gt),n(e)}function Ve(t){t.global.deleted=!0,ae(t,[]),delete t.contexts}function Je(t,e,n,o){const r=e.original,a=t.tagJsType===S.stateRender,c=tt.stateConfig;let u;return s(n),a?u=t():(u=r(...o),typeof u===I.function&&void 0===u.tagJsType&&(u=u())),n.context.returnValue=u,n.returnValue=u,u.templater=t,t.tag=u,n.context.state.newer={...c},qr(),n}function ke(t){!function(t){const e=tt.stateConfig,n=t||e.context;n.state=n.state||{},n.state.newer={...e};const o=e.support;n.state.newest=o}(t),function(){const t=tt.stateConfig;delete t.prevSupport,delete t.support,delete t.state,delete t.states,qr()}()}function Ie(t,e,n,o){let r;const s=t.templater;if(s.tagJsType===S.stateRender){const e=s;r=ir(s,n,o,t.appSupport),Je(s,e,r)}else{r=(0,s.wrapper)(t,n,e)}return function(t,e){++t.context.renderCount,ke(t.context),tt.tagClosed$.next(e)}(r,o),r.ownerSupport=t.ownerSupport,r}function Se(t){const e=tt.stateConfig;return e.rearray=t,e.state=[],e.states=[],e.statesIndex=0,e.handlers.handler=_,e.handlers.statesHandler=W,e}function Ee(t,e,n,o){return function(t,e,n){Se(n),tt.stateConfig.prevSupport=e,s(t)}(t,e,n.state.older.state),Ie(t,e,n,o)}function Ae(t,e,n,o){R(t.context),s(t);const r=Ie(t,e,n,o);return qr(),r}function Me(t){const e=t?.context,n=e?.state;return n?.older?.state}function Oe(t,e,n){let o;o=Me(e)?Ee(t,e,n):Ae(t,e,n);const r=!e||ie(e,o);if(r){if(e){const t=e.templater.tag;if(t&&n.renderCount>0){const n=e?.templater,o=n?.tag;!function(t,e,n){if(t.tagJsType===S.dom){const o=n?.dom;return void(o!==t.dom&&Te(e))}if(n){const o=n.strings;if(o){const n=o?.length;n!==t.strings.length&&Te(e)}}}(t,e,o)}}}else{!function(t,e){const n=t.context,o=n.global;let r=-1;const s=n.providers=n.providers||[],a=s.length-1;for(;r++<a;){const t=s[r];let n=-1;const a=t.children.length-1;for(;n++<a;)if(o===t.children[n].context.global)return t.children.splice(n,1),void t.children.push(e)}}(e,o),Te(e);const t=o.context;t.state.oldest=o,t.state.newest=o}return o.ownerSupport=t.ownerSupport,{support:o,wasLikeTags:r}}function Le(t,e,n){const o=Oe(e,t,n);if(o.wasLikeTags){return nt(n.state.oldest,o.support),o.support}return Yn(e,n)}function Pe(t){return S.templater===t.tagJsType}function je(t){const e=t.context,n=e.global,o=Pe(t.templater);if(e.locked)return n.blocked.push(t),t;if(o){return De(t)}e.locked=4,n.blocked.length&&(t=n.blocked.pop(),n.blocked=[]);const r=Le(e.state.newest,t,e);return delete e.locked,r}function De(t){return je(N(t).context.state.newest)}function He(t,e){const n=e.context.global;if(n&&n.deleted)return!1;const o=function(t,e){const n=t.props,o=e.propsConfig,r=o.latest;if(Ne(n,r))return!0;switch(t.propWatch){case Zo.IMMUTABLE:return er(n,r);case Zo.SHALLOW:return it(n,r)}return!st(n,r,or)}(t,e);return!!o}function Ne(t,e){return t.length!==e.length}function Ue(t,e=[]){const n=t.context,o=Pe(t.templater),r=t.ownerSupport;if(n.locked)return e.push(t),e;if(o)return Ue(r,e);const s=t.context.global;if(s&&!0===s.deleted)return e;const a=t,c=M(a.templater),u=t.templater.tagJsType,i=r&&u!==S.stateRender&&(!c||He(a.templater,a));if(a.context.providers){const t=function(t){const e=t.context.providers;if(!e)return[];const n=[];for(const t of e){const e=he(t.owner,t);n.push(...e.map(me))}return n}(a);e.push(...t)}return i?(Ue(r,e),c&&e.push(a),e):(e.push(a),e)}function $e(t){++d.locks,t.forEach(We),--d.locks,h()}function We(t){const e=t.context;if(!e.global)return void e.tagJsVar.processUpdate(e.value,e,t.ownerSupport,[]);je(e.state.newest)}function Re(t,e){for(let n=0;n<t.length;++n){ze(t[n],e[n])}}let Be;function Fe(...t){return Be=t,t}function _e(){return Be}function ze(t,e){t(Fe,1),e(_e,2)}function Ge(t,e,n,o){for(let n=t.length-1;n>=0;--n){const o=t[n].get(),r=e[n].callback;r&&r(o)}for(let t=o.length-1;t>=0;--t){Ke.length=0,Xe=0;(0,o[t])(qe),n[t](Ze)}}let Xe=0;const Ke=[];function qe(...t){return Ke.push(t),t}function Ze(...t){return Ke[Xe++]}function Ye(t,e,{resolvePromise:n,resolveValue:o}){if(L(t)){return e.context.locked=2,t.then(function(t,e){return n=>{const o=t.context,r=o.global;if(delete o.locked,!0===o.deleted||!0===r?.deleted)return e(n);!function(t,e){const n=t.context.state,o=e.context.state;Re(n.newer.states,o.newer.states)}(t,o.state.newest);return $e(Ue(t)),e(n)}}(e,n))}return o(t)}function Qe(t,e){const n=e.context.global,o=function(t,e){if(!0!==n.deleted)return function(t,e,n,o){const r=N(e),s=r.context;s.locked=1;const a=t.apply(n,o);delete s.locked;return tn(a,r)}(o.tagFunction,o.support,t,e)};return o.tagFunction=t,o.support=e,o}function tn(t,e){const n=e.context.global;if(n?.deleted)return;return $e(Ue(e)),Ye(t,e,{resolvePromise:on,resolveValue:rn})}const en="no-data-ever",nn="promise-no-data-ever";function on(){return nn}function rn(){return en}function sn(t,e,n){const o=n[e];if(o){let e=!1;if(t.originalStopPropagation=t.stopPropagation,t.stopPropagation=function(){e=!0,t.originalStopPropagation.call(t),t.stopPropagation=t.originalStopPropagation,delete t.originalStopPropagation},o(t),t.defaultPrevented||e)return}const r=n.parentNode;r&&sn(t,e,r)}function an(t,e,n,o){const r=t.appElement,s=function(t){"blur"===t&&(t="focusout");return"_"+t}(e);"blur"===e&&(e="focusout");const a=t.context.events;if(!a[e]){const t=function(t){sn(t,s,t.target)};a[e]=t,r.addEventListener(e,t)}n[s]=o,n[e]=o}function cn(t,e,n,o){const r=function(...e){return r.tagFunction(t,e)};r.tagFunction=e,r.support=n,an(n.appSupport,o,t,r)}function un(t){return null==t||!1===t}function ln(t,e,n,o,r,s,a){if(un(e))return;const c=[];if(typeof e===I.object){for(const r in e){const u=yt(r),i=vn(r,e[r],t,n,o,St,s,a,u);void 0!==i&&(Array.isArray(i)?c.push(...i):c.push(i))}return c}0!==e.length&&r(n,e,J)}function pn(t,e){t.removeAttribute(e)}function fn(t,e,n,o){const r=e,s=t;if(s?.tagJsType){const o=e.value;return o?.tagJsType?void o.hasValueChanged(s,e,n):(s.isAttr=!0,Kr(e),s.processInitAttribute(r.attrName,t,r.element,s,r,n,St),qr(),void(r.tagJsVar=s))}if(r.isNameOnly)return function(t,e,n,o,r,s,a,c){if(n){if(un(e)||""===e)return void o.removeAttribute(n);if(typeof n===I.object)if(typeof e===I.object)for(const t in n)t in e||l.push([pn,[o,t]]);else for(const t in n)l.push([pn,[o,t]])}const u=ln(t,e,o,r,s,a,c);u&&a.push(...u)}(o,t,r.value,r.element,n,r.howToSet,[],r.parentContext),void(r.value=t);const a=r.element;!function(t,e,n,o,r,s,a){if(P(t))return function(t,e,n,o,r,s,a){const c=t.templater.wrapper;if((c?.tagJsType||c?.original?.tagJsType)!==S.renderOnce)return wn(e,t,o,n);return xn(e,n,o,r,s,t)}(r,t,o,e,a,s);xn(t,o,e,a,s,r)}(t,r.attrName,0,a,n,r.howToSet,r.isSpecial),e.value=t}const dn=":tagvar",gn=":",hn=new RegExp(dn+"(\\d+)"+gn,"g");function mn(t){return t.search&&t.startsWith(dn)?t.search(hn):-1}function bn(t,e,n,o,r,s,a){const c=o.length,u=[];function i(o){const s=function(t,e,n){return t.reduce(((t,o)=>{if(mn(o)>=0){const o=n++,r=e[o];return t.push(r),t}return t.push(o),t}),[])}(e,o,c).join("");r(n,t,s)}return e.forEach((e=>{if(mn(e)>=0){const r=o.length,c=Xt(e),l={updateCount:0,isAttr:!0,element:n,attrName:t,withinOwnerElement:!0,tagJsVar:c,valueIndex:a.varCounter,parentContext:a,destroy$:new q,render$:new q};c.processUpdate=function(t,e,n,o){++e.updateCount,i(o)};const p=s[r];l.value=p,u.push(l),++a.varCounter}})),i(s),u}function yn(t){return j(t)&&"tagJsVar"in t?t.tagJsVar:-1}function vn(t,e,n,o,r,s,a,c,u){const i=yn(t);let l=i>=0||void 0===e&&"string"!=typeof t,p=n[i];e?.tagJsType?p=e:t?.tagJsType&&(l=!0,p=t,e=t);const f=p;if(f?.tagJsType)return function(t,e,n,o,r,s,a,c,u){const i=Kt(t,0,!0,n);return i.element=c,i.valueIndex=r,i.isAttr=!0,i.isNameOnly=u,i.stateOwner=N(s),i.supportOwner=s,Kr(i),o.processInitAttribute(a,t,c,o,i,s,St),qr(),i.oldTagJsVar=i.tagJsVar,i.tagJsVar=o,i}(e,0,c,f,i,r,t,o,l);if(l){-1===i&&l&&(p=t);const e=Kt(p,0,!0,c);e.valueIndex=i,e.isAttr=!0,e.element=o,e.isNameOnly=!0,e.howToSet=s;e.tagJsVar.processUpdate=fn;const u=ln(n,p,o,r,s,a,c);return u&&a.push(...u),e}if(Array.isArray(e))return bn(t,e,o,[],s,n,r.context);const d=yn(e);if(d>=0){return function(t,e,n,o,r,s,a,c,u){if(typeof e===I.function)return++r.varCounter,wn(e,a,t,n);const i=Xt(e),l={updateCount:0,isAttr:!0,element:n,attrName:t,howToSet:s,value:e,withinOwnerElement:!0,tagJsVar:i,destroy$:new q,render$:new q,valueIndex:u,parentContext:r};return o.push(l),i.processUpdate=fn,Lt(t,e,l,n,s,a,c),l.value=e,l}(t,n[d],o,[],c,s,r,u,d)}return Pt(t,e,o,s,u,c)}function xn(t,e,n,o,r,s){if(!1===o){switch(t){case void 0:case!1:case null:return void l.push([Cn,[e,n]])}if(P(t))return cn(e,t,s,n);r(e,n,t)}else vt(n,t,e,o)}function wn(t,e,n,o){return cn(o,t=Qe(t,e),e,n)}function Cn(t,e){t.removeAttribute(e)}function Tn(t,e,n,o,r){for(const s of t){const t=s[0],a=s[1],c=s[2]||!1;let u=s.length>1?St:It;s[3]&&(u=s[3]);const i=r.contexts,l=vn(t,a,e,n,o,u,i,r,c)||void 0;"object"==typeof l&&(i.push(l),++r.varCounter)}}function Vn(t,e,n,o,r,s,a){e.at&&Tn(e.at,n,t,o,r),s?p.push([v,[s,t,"appendToAttachDomElement"]]):u.push([y,[a,t,"insertBeforeAttachDomElement"]])}function Jn(t,e,n,o,r,s,a){const c=n.context,u=c.contexts;o=c;const i=[];s&&void 0===a&&(a=document.createTextNode(J),p.push([v,[s,a]]),s=void 0);for(let c=0;c<t.length;++c){const l=t[c],p=l.v;if(!isNaN(p)){const t=Number(p),c=e[t];if(P(c)&&void 0===c.tagJsType){++o.varCounter;continue}ge(c,u,n,o,r,s,a).valueIndex=t;continue}const f={};if(i.push(f),"text"===l.nn){kn(f,l,s,a);continue}const d=f.domElement=document.createElement(l.nn),g={updateCount:0,isAttrs:!0,element:d,parentContext:o,contexts:[],destroy$:new q,render$:new q,tagJsVar:{tagJsType:"new-parent-context"},valueIndex:-1,withinOwnerElement:!0,varCounter:0};Vn(d,l,e,n,g,s,a),g.element=d,l.ch&&(f.ch=Jn(l.ch,e,n,g,r+1,d,a).dom)}return{dom:i,contexts:u}}function kn(t,e,n,o){const r=t,s=r.tc=e.tc;n?p.push([V,[n,s,function(t){r.domElement=t}]]):u.push([T,[o,s,function(t){r.domElement=t}]])}const In=/(:tagvar\d+:)/,Sn="ondoubleclick",En=/([:_a-zA-Z0-9\-.]+)\s*(?:=\s*"([^"]*)"|=\s*(\S+))?/g,An=/<\/?([a-zA-Z0-9-]+)((?:\s+[a-zA-Z_:*][\w:.-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)+\s*|\s*)\/?>/g;function Mn(t){const e=[],n=[],o=[];let r=null,s=-1,a=0;const c=new RegExp(An,"g");for(t=function(t){return t.replace(On,(function(t){return t.replace(/\[l t\]/g,"[l&nbsp;t]").replace(/\[g t\]/g,"[g&nbsp;t]").replace(/</g,"[l t]").replace(/>/g,"[g t]")}))}(t);a<t.length;){const u=c.exec(t);if(!u)break;const[i,l,p]=u,f=i.startsWith("</"),d=i.endsWith("/>");if(a<u.index){const e=t.slice(a,u.index);if(e.trim()){const t=jn(e);for(let e of t)e.startsWith(dn)&&e.search(In)>=0&&-1===e.search(Wn)&&(e=dn+ ++s+gn),Ln(r,n,e)}}if(a=u.index+i.length,f){r=o.pop()||null;continue}const g=[];let h;for(;null!==(h=En.exec(p));)s=Hn(h,s,e,g);const m={nn:l};g.length&&(m.at=g),r?(r.ch||(r.ch=[]),r.ch.push(m)):n.push(m),d||(o.push(r),r=m)}if(a<t.length){const e=t.slice(a);if(e.trim()){const t=jn(e);for(const e of t)e.startsWith(dn)&&++s,Ln(r,n,e)}}return n}const On=new RegExp("(\x3c!--[\\s\\S]*?--\x3e)","g");function Ln(t,e,n){!function(t,e,n){t?(t.ch||(t.ch=[]),t.ch.push(n)):e.push(n)}(t,e,{nn:"text",tc:Pn(n)})}function Pn(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&nbsp;t\]/g,"[l t]").replace(/\[g&nbsp;t\]/g,"[g t]")}))}function jn(t){return t.split(In).filter(Dn)}function Dn(t){return""!==t}function Hn(t,e,n,o){const r=t[1]||t[3]||t[5];let s=t[2]||t[4]||t[6];if(void 0===r)return e;const a=""!==t[2],c=void 0===s&&a,u=r.toLowerCase(),i=u.startsWith("on")?function(t){if(t.startsWith("on"))return t.length===Sn.length&&t===Sn?"dblclick":t.slice(2,t.length);return t}(u):u;if(c){if(r.slice(0,dn.length)===dn){const t=dn+ ++e+gn;return n.push(["at",t]),o.push([t]),e}if(t[0].startsWith(r)&&t[0].slice(r.length,t[0].length).search(/\s+$/)>=0)return o.push([i]),e;const a=t[3];if(a.search(Wn)>=0){s=a;const t=[i,s];return o.push(t),e}s=dn+ ++e+gn}a||(s=t[2]);const l=s.split(Un).filter((t=>t.length>0));l.length>1&&(s=l,l.forEach((t=>{t.search(hn)>=0&&++e})));const p=[i,s],f=yt(u);return f&&p.push(f),"style"===i?(o.unshift(p),e):(o.push(p),e)}const Nn=new RegExp(dn+"(\\d+)"+gn,"gi"),Un=new RegExp("("+dn+"\\d+"+gn+")","gi"),$n=dn.slice(0,dn.length-1),Wn=new RegExp($n+"&#x72;(\\d+)"+gn,"gi"),Rn=$n+"&#x72;$1"+gn;function Bn(t,e){const n=function(t,e){const n=t;return function(t,e){const n=[];for(let o=0;o<t.length;++o){const r=t[o].replace(Nn,Rn);o<e.length?n.push(r+dn+o+gn):n.push(r)}return function(t,e,n){const o=n.length-e.length;if(o>0)for(let n=o;n>0;--n)t.push(dn+(e.length+n-1)+gn)}(n,t,e),n}(n,e)}(t,e).join("");return Mn(n)}const Fn="ch";function _n(t,e,n=[],o=[]){const r=t;for(let t=0;t<r.length;t++){const s=[...o,t],a=r[t];if(a.at){const t=a.at;a.at=Gn(t,e)}if(a.ch){const t=a.ch,o=[...s,Fn];a.ch=_n(t,e,n,o)}t=zn(a,e,r,t)}return r}function zn(t,e,n,o){if("text"!==t.nn)return o;const r=t;let s,a=r.tc;if(typeof a!==k.string)return o;for(;null!==(s=hn.exec(a));){const t=s[1],r=parseInt(t,10);if(!isNaN(r)&&r<e){const t=dn+r+gn,e=a.slice(s.index+t.length);n.splice(o,1,{nn:"text",v:r}),a=e,hn.lastIndex=0}}return r.tc=a,o}function Gn(t,e){const n=[];for(const o of t){const[t,r,s]=o;if(t.startsWith(dn)){const o=parseInt(t.replace(dn,""),10);if(!isNaN(o)&&o<e){n.push([{tagJsVar:o}]);continue}}if(typeof r===k.string&&r.startsWith(dn)){const o=parseInt(r.replace(dn,""),10);if(!isNaN(o)&&o<e){n.push([t,{tagJsVar:o},s]);continue}}n.push(o)}return n}function Xn(t){return t.length}const Kn={};function qn(t,e){const n=function(t){const e=t.map(Xn);return e.push(t.length),Number(e.join(""))}(t),o=Kn[n],r=o&&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,o);if(r)return o.domMetaMap;const s=_n(Bn(t,e),e.length),a={interpolation:void 0,string:void 0,strings:t,values:e,domMetaMap:s};return Kn[n]=a,s}function Zn(t,e,n){const o=t.context;o.state=o.state||{};const r=o.state;r.oldest=t,r.newest=t,o.state.older=o.state.newer,++d.locks;const s=function(t,e,n,o){const r=function(t){const e=t.templater,n=e.tag;if(n.tagJsType===S.dom)return n.dom;const o=n.strings;return qn(o,n.values)}(t),s=t.templater.tag,a=s.values,c=[],u=t.context;e=u,u.contexts=c;const i=Jn(r,a,t,e,0,n,o);return i}(t,t.context,e,n);return o.htmlDomMeta=s.dom,--d.locks,s}function Yn(t,e){const n=e.state.newest,o=e.placeholder;return n.ownerSupport=t,Zn(n,void 0,o),n}function Qn(t){const e={tagJsType:S.templater,processInitAttribute:a,processInit:no,processUpdate:a,hasValueChanged:de,destroy:a,propWatch:"shallow",key:a};return e.tag=t,t.templater=e,e}function to(t,e,n){const o=ur(t,e,e.appSupport,n);return n.contexts=n.contexts||[],o}function eo(t,e,n,o,r){const s=to(t,n,e);s.ownerSupport=n;const a=Zn(s,o,o?void 0:r);for(const t of a.dom)t.marker&&(o?p.push([v,[o,t.marker]]):u.push([y,[r,t.marker,"subMarker"]])),t.domElement&&(o?p.push([v,[o,t.domElement,"subAppendTo"]]):u.push([y,[r,t.domElement,"subInsertBefore"]]));return s}function no(t,e,n,o,r){return e.state={},r?eo(t,e,n,r,o):Yn(n,e)}function oo(t,e){const n={tagJsType:S.templater,processInit:no,processInitAttribute:a,processUpdate:ht,hasValueChanged:de,destroy:pe,propWatch:t,props:e,key:function(t){return n.arrayValue=t,n},matchesInjection:(t,e)=>n.wrapper===t||n.wrapper?.original===t?.original?e:void 0};return n}const ro=[];function so(t,e,n){const o=t.propWatch===Zo.DEEP?or:nr,r=t.props,s=e.propsConfig;let a=s.castProps;const c=n?.propsConfig,u=c?.castProps;u&&(s.castProps=u,a=Ce(e,n,n.ownerSupport,r,o));return a||ye(r)}function ao(t,e,n){const o=oo(Zo.DEEP);o.tagJsType=t.tagJsType;const r=to(o,n,e);function s(){return o.tag=t(),r}return o.wrapper=s,s.tagJsType=t.tagJsType,s.original=t.original||t,r}function co(t,e,o,r,s){n(e);const a=ao(t,e,o);return Ae(a,void 0,e),eo(a.templater,e,o,s,r)}function uo(t,e,n,o,r){const s=hr(t,e,n,o,r);return s.hasEmitted||io(t,s),s}function io(t,e){const n=t.Observables[0];if(!e.hasEmitted)return"withDefault"in t?void e.subValueHandler(t.withDefault,0):"value"in n?void e.subValueHandler(n.value,0):void 0;const o=e.lastValues[0].value;e.subValueHandler(o,0)}function lo(t,e,n,o,r,s){e.destroy=br;const a=yt(t),c=function(e,o){Pt(t,e,n,St,a,r),vr(o)},u=mr(e.Observables,s,c,e,r);return r.subContext=u,r.value=e,r.tagJsVar=e,e.processUpdate=function(e,o,s){return jt(e,r,s,n,t,St)},{subContext:u,onOutput:c}}function po(t,e,n,o,r,s){const{subContext:a}=lo(t,e,n,0,r,s);a.hasEmitted||function(t,e){const n=e.tagJsVar,o=n.onOutput,r=t.Observables;let s=r[0]?.value||t.withDefault;t.callback&&(s=t.callback(s));o(s,!0,e)}(e,a)}function fo(t,e,n){return{onOutput:a,tagJsType:S.subscribe,processInitAttribute:po,processInit:uo,hasValueChanged:go,processUpdate:a,destroy:yr,callback:n,withDefault:e,Observables:[t]}}function go(t,e){if(!t?.tagJsType)return 1;const n=t.Observables;if(!n)return 2;const o=e.value.Observables;if(!o||o.length!==n.length)return 3;return n.every(((t,e)=>t===o[e]))?0:4}function ho(t,e,n,o){if(!e||!e.tagJsType||e.tagJsType!==t){return o.tagJsVar.destroy(o,n),pr(e,o,n,99),99}}function mo(t,e,n){const o=e.subContext,r=ho(S.subscribe,t,n,e);return r||(o&&o.hasEmitted?(o.tagJsVar=t,o.valuesHandler(o.lastValues,0),0):0)}function bo(t,e){return{onOutput:a,tagJsType:S.subscribe,processInitAttribute:lo,processInit:hr,hasValueChanged:go,processUpdate:mo,destroy:yr,callback:e,Observables:[t]}}function yo(t,e){++t.updateCount;const n=vo(t.subContext,e);return delete t.subContext,n}function vo(t,e){t.deleted=!0;const n=t.appendMarker;if(n&&(m(n,"deleteSubContext"),delete t.appendMarker),!t.hasEmitted)return;const o=t.contextItem;return o.tagJsVar.destroy(o,e),76}function xo(t,e,n,o){return e.hasEmitted=!0,e.contextItem=qt(t,n,0,o)}function wo(t,e,n){++e.updateCount;const o=t.owner._innerHTML;o.processInit=o.oldProcessInit;const r=e.subContext?.contextItem;fr(r,o,n)}function Co(t,e,n,o,r){e.subContext={},t.processUpdate=wo,function(t,e,n,o,r){const{appendMarker:s,insertBefore:a}=dr(r,o),c=n.subContext;c.appendMarker=s;const u=t.owner,i=u._innerHTML;i.processInit=i.oldProcessInit,xo(i,c,e,a)}(t,n,e,o,r)}function To(){return{tagJsType:"innerHTML",hasValueChanged:()=>0,processInitAttribute:a,processInit:Co,processUpdate:wo,destroy:yo}}function Vo(t,e){return{onOutput:a,tagJsType:S.subscribe,processInitAttribute:a,hasValueChanged:go,processInit:Jo,processUpdate:a,destroy:yr,callback:e,Observables:t}}function Jo(t,e,n,o,r){return hr({tagJsType:S.subscribe,states:[],Observables:t},e,n,void 0,r)}function ko(t){if(!t)return a;const e=Gr();if(!e)throw new Error("output must be used in render sync with a parent context");const n=H(e);if(!n)throw new Error("output must be used in render sync fashion");if(!0===t.wrapped)return t;const o=(...e)=>{const o=n.ownerSupport;return Io(e,t,o.context)};return o.wrapped=!0,o}function Io(t,e,n){const o=n.state,r=o.newer.states,s=o.older?o.older.states:r,a=o.newest;Re(r,s);const c=e(...t);return Re(s,r),f.push([()=>{const t=a.context.global;if(void 0===t||!0===t.deleted)return++d.locks,a.context.tagJsVar.processUpdate(a.context.value,a.context,a,[]),--d.locks,void h();++d.locks,be(a),--d.locks,h()},[]]),c}function So(t,e={}){const n={tagJsType:S.host,processInitAttribute:Ao,hasValueChanged:()=>0,processInit:Mo,processUpdate:Eo,destroy:Oo,options:{callback:t,...e},matchesInjection(e,n){const o=e?.options;if(!o)return!1;const r=o?.callback;return r===t&&n}},o=(...n)=>({...o,options:{arguments:n,...e,callback:t}});return Object.assign(o,n),o}function Eo(t,e,n){if(P(t)&&!t?.tagJsType)throw new Error("issue on its way");const o=ho(S.host,t,n,e);if(o)return o;const r=e.tagJsVar.options,s=t;var a;Kr(a=e),Se(a.state.newer.state);const c=s.options.arguments||r.arguments||[];e.returnValue=s.options.callback(...c),ke(e)}function Ao(t,e,n,o,r){return Mo(o,r)}function Mo(t,e){const n=e.element,o=e.state={};R(e),function(t,e,n,o){const r=e.options.arguments||[],s=e.options.callback(...r);n.returnValue=s;const a=e.options;a.onInit&&a.onInit(t,e,n,o)}(n,t,e,o),ke(e)}function Oo(t){++t.updateCount;const e=t,n=e.tagJsVar,o=n.options;if(e.destroy$.subscribers.length&&(Kr(t),Io([],e.destroy$.next.bind(e.destroy$),t),qr()),o.onDestroy){const r=e.element;return Io([],(function(){Kr(t);const s=o.onDestroy(r,n,e,e.state);return qr(),s}),t.stateOwner.context)}}function Lo(t,e,n,o){const r={tagJsType:"tag-conversion",processInitAttribute:a,processInit:(r,s,a)=>{const c=t.returnValue;return e.tagJsVar.processInit(c,e,n,o.placeholder)},processUpdate:(t,o,s)=>{if(o.locked||o.deleted)return;++o.updateCount;const a=o.value.tagJsType,c=t?.tagJsType,u=c!==a;if(fe(t,o)||u||r.hasValueChanged(t,o,n))return r.destroy(o,n),void pr(t,o,s,789);o.locked=467,o.render$.next();const i=o.returnValue;!function(t,e,n,o,r){const s=ye(e.props);t.value.props=s;const a=r.propsConfig;a&&(a.castProps=s);if(t.updatesHandler=n.updatesHandler,n.updatesHandler){Kr(n);(0,n.updatesHandler)(s),qr()}t.tagJsVar.processUpdate(o,t,r,[]),t.value=o}(e,t,o,i,n),delete o.locked},hasValueChanged:(n,o,r)=>{const s=t.returnValue;return e.tagJsVar.hasValueChanged(s,e,r)},destroy:(o,r)=>{++t.updateCount,t.deleted=!0,delete t.returnValue;const s=e.tagJsVar.destroy(e,n);return L(s)?s.then((()=>{const e=Ho(t,r);return h(),e})):Ho(t,r)}};return r}function Po(t,e,n){const o=t.context,r=t.returnValue,s=Xt(r);delete o.global,o.contexts=[];const a={updateCount:0,value:r,tagJsVar:s,destroy$:new q,render$:new q,placeholder:o.placeholder,valueIndex:-1,withinOwnerElement:!0,parentContext:o,contexts:o.contexts},c=Lo(o,a,t,n);return o.tagJsVar=c,s.processInit(r,a,t,n.placeholder),t}function jo(t,e,n){const o=ir(t,e,n,n?.appSupport),r=o.propsConfig;if(r){const e=t.tagJsType!==S.tagComponent?[]:so(t,o);r.castProps=e}return Ae(o,e.state.newest,e)}function Do(t,e,n){const o=jo(t,e,n),r=o.templater.tag;return["dom","html"].includes(r.tagJsType)?(Zn(o,void 0,e.placeholder),o):Po(o,o.ownerSupport,e)}function Ho(t,e){delete t.returnValue,delete t.global,t.contexts=[],t.htmlDomMeta=[],delete t.updatesHandler}function No(t,e,n,o){const r=jo(t,e,n),s=r.templater.tag;return["dom","html"].includes(s.tagJsType)?function(t,e){const n=Zn(t,e,void 0);for(const t of n.dom)t.domElement&&p.push([v,[e,t.domElement]]),t.marker&&p.push([v,[e,t.marker]]);return t}(r,o):Po(r,0,e)}function Uo(t,e,o,r,s){return n(e),s?No(t,e,o,s):Do(t,e,o)}function $o(t){return tt.stateConfig.handlers.handler(t)}function Wo(t){return $o((()=>{const e=t();if(Gr().global){return Ye(e,r(),{resolvePromise:Ro,resolveValue:Bo})}})),Yo}function Ro(t){return t}function Bo(t){return t}function Fo(t){return $o((function(){Gr().destroy$.toCallback(t)})),Yo}bo.all=function(t,e){return bo(q.all(t),e)},So.onInit=t=>So((()=>{}),{onInit:t}),So.onDestroy=t=>So((()=>{}),{onDestroy:t});let _o=0;const zo=Xo("click"),Go=Xo("mousedown");function Xo(t){return function(e){const n=Wr(e);return $o((()=>{Xr().addEventListener(t,n)})),n}}const Ko={get:Xr,onclick:zo,click:zo,onClick:zo,mousedown:Go,onmousedown:Go,onMouseDown:Go};function qo(t,e){Object.defineProperty(Yo,t,{get:()=>e,set:t=>e(t)})}var Zo;function Yo(t,e=Zo.SHALLOW){const n=function(...o){const r=oo(e,o);r.tagJsType=S.tagComponent,r.processInit=Uo,r.hasValueChanged=de;const s=function(t,e){return function(n,o,r){const s=so(t,n,r),a=n.ownerSupport,c=ir(t,o,a,n.appSupport,s);return Je(t,e,c,s)}}(r,n);return s.original=t,r.wrapper=s,r},o=t;n.original=t,o.tags=ro,o.setUse=tt,o.ValueTypes=S,o.tagIndex=_o++,ro.push(n);const r=n;return r.updates=t=>(Gr().updatesHandler=t,!0),r.getInnerHTML=To,r}function Qo(t,e,n){if(Ne(t,e))return 11;switch(n){case Zo.NONE:return 1;case Zo.SHALLOW:return it(t,e);case Zo.IMMUTABLE:return er(t,e)}return function(t,e){let n=t,o=e;n=[...t],o=[...e||[]];if(!n.every(((t,e)=>function(t,e,n,o){const r=o[e];if(typeof t===I.object){const e={...t},n={...r||{}},o=Object.entries(e).every((([t,o])=>tr(o,n[t],(()=>{delete e[t],delete n[t]}))));return o}return tr(t,r,(function(){n.splice(e,1),o.splice(e,1)}))}(t,e,n,o))))return 7;return!1}(t,e)}function tr(t,e,n){if(typeof t!==I.function)return!!st(t,e,or)&&4;if(typeof e!==I.function)return!1;const o=e?.original;o&&(e=o);t.original&&(t=t.original);return t.toString()===e.toString()?(n(),5):(n(),6)}function er(t,e){const n=t.length;for(let o=0;o<n;++o){if(t[o]!==e[o])return 2}return!1}qo("onclick",zo),qo("click",zo),qo("onMouseDown",Go),qo("onmousedown",Go),qo("mousedown",Go),function(t){t.DEEP="deep",t.SHALLOW="shallow",t.NONE="none",t.IMMUTABLE="immutable"}(Zo||(Zo={})),Yo.element=Ko,Yo.renderOnce=function(){throw new Error("Do not call tag.renderOnce as a function but instead set it as: `(props) => tag.renderOnce = () => html`` `")},Yo.use=function(){throw new Error("Do not call tag.use as a function but instead set it as: `(props) => tag.use = (use) => html`` `")},Yo.deepPropWatch=Yo,Yo.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`` `")},Yo.inject=function(t){const e=Gr();if(!e)throw new Error("tag.inject can only be called within a tag or host context");let n=e.parentContext;for(;n;){const e=n.contexts;if(e)for(const n of e)if(n.isAttr&&n.tagJsVar?.matchesInjection){const e=n.tagJsVar.matchesInjection(t,n);if(void 0!==e)return e.returnValue}if(n.tagJsVar?.matchesInjection&&n.tagJsVar.matchesInjection(t,n))return n.returnValue;n=n.parentContext}const o=`Could not find parent context for tag.inject ${t}`;throw console.error(o,{targetItem:t,context:e}),new Error(o)},Yo.onInit=Wo,Yo.onDestroy=Fo,Yo.onRender=function(t){const e=Gr(),n=n=>{const o=Gr();Kr(e);const r=t();return qr(),Kr(o),r},o=e.render$.subscribe((()=>n())),r=n();return Yo.onDestroy((()=>o.unsubscribe())),r},Yo.getInnerHTML=To,Yo.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`` `")},Yo.immutableProps=function(t){return Yo(t,Zo.IMMUTABLE)},Yo.watchProps=function(t){return Yo(t,Zo.SHALLOW)},Object.defineProperty(Yo,"renderOnce",{set(t){t.tagJsType=S.renderOnce,t.processInit=co,t.processUpdate=ht,t.destroy=pe,t.hasValueChanged=function(){return 0}}}),Object.defineProperty(Yo,"use",{set(t){t.original={setUse:tt,tags:ro},t.tagJsType=S.stateRender,t.processInit=Uo,t.processUpdate=ht,t.hasValueChanged=de,t.destroy=pe}});const nr=3,or=10;function rr(t){return ut(t,nr)}function sr(t){return ut(t,or)}function ar(t,e,n){const o={templater:t,context:e,castedProps:n,appSupport:void 0};return e.global.blocked=[],e.state||(e.state={newer:{state:[],states:[]}}),o}function cr(t,e,n,o){e.appSupport=n||e;const r=t.props;return r&&(e.propsConfig=function(t,e,n){const o=t.templater;if(o.tagJsType!==S.stateRender){switch(o.propWatch){case Zo.IMMUTABLE:return t.propsConfig={latest:e,castProps:n};case Zo.SHALLOW:return t.propsConfig={latest:e.map(rr),castProps:n}}return t.propsConfig={latest:e.map(sr),castProps:n}}}(e,r,o)),e}function ur(t,e,n,o,r){const s={templater:t,context:o,castedProps:r,appSupport:void 0};return s.ownerSupport=e,s.appSupport=n,s}function ir(t,e,n,o,r){const s=ar(t,e,r);return s.ownerSupport=n||s,s.ownerSupport.appSupport=o||s.ownerSupport,cr(t,s,o,r)}function lr(t,e,o){if(M(e))return void 0===t.global&&n(t),t.oldTagJsVar=t.tagJsVar,t.tagJsVar=e,function(t,e,n){if(!e.state.newest)return void t.processInit(t,e,n,e.placeholder);const o=ir(t,e,n,n.appSupport);we(n,o,e)}(e,t,o),!0;if(t.global){t.oldTagJsVar=t.tagJsVar,t.tagJsVar=e;const n=t.state.newest;if(n)return typeof e===I.function||function(t,e,n,o){let r=n.templater||n;const s=t.templater.tag;s&&s._innerHTML&&(r=n.outerHTML||n._innerHTML.outerHTML);const a=ir(r,e,o,o.appSupport);nt(t.context.state.oldest,a)}(n,t,e,o),!0}return e.processInit(e,t,o,t.placeholder),t.oldTagJsVar=t.tagJsVar,t.tagJsVar=e,!0}function pr(t,e,n,o){const r=t&&t.tagJsType;if(delete e.deleted,r){if(r===S.renderOnce)return;lr(e,t,n)}else{if(D(t))return Zt(e,t,n),e.oldTagJsVar=e.tagJsVar,void(e.tagJsVar=_t(t));typeof t!==I.function?o&&function(t,e){e.value=t,e.oldTagJsVar=e.tagJsVar,e.tagJsVar=Nt(t);const n=e.placeholder,o=bt(t),r=e.paint=[C,[n,o,function(t){e.simpleValueElm=t,delete e.paint},"processNowRegularValue"]];u.push(r)}(t,e):e.value=t}}function fr(t,e,n){const o=t.tagJsVar.hasValueChanged(e,t,n);return 0===o||pr(e,t,n,o),o}function dr(t,e){let n;return t&&(n=e=document.createTextNode(J),p.push([v,[t,e]])),{appendMarker:n,insertBefore:e}}function gr(t,e,n){const o=mo(t,e,n);if(!0!==e.hasEmitted){const t=e.value.Observables;if(!t)return;if(!("value"in t[0]))return}if(0===o&&t.callback){io(t,e.subContext)}}function hr(t,e,n,o,r){const s=t.Observables,{appendMarker:a,insertBefore:c}=dr(r,o);let u=function(t,e,o){xo(t,o,n,c),vr(e),u=o.tagJsVar.onOutput=function(t,e,o){const r=o.contextItem;fr(r,t,n),r.tagJsVar.processUpdate(t,r,n,[t]),r.value=t,vr(e)}};const i=mr(s,n,((t,e,n)=>u(t,e,n)),t,e);return i.appendMarker=a,e.subContext=i,t.processUpdate=gr,t.onOutput=u,i}function mr(t,e,n,o,r){function s(t,e){u.lastValues[e]={value:t,tagJsVar:Xt(t),oldTagJsVar:u.lastValues[e]?.tagJsVar},a(u.lastValues,e)}function a(t,e){const o=u.tagJsVar,s=o?.callback;if(s){Kr(r);const e=o.callback(...t.map((t=>t.value)));return n(e,c,u),void qr()}const a=t[e].value;n(a,c,u)}let c=!0;const u={lastValues:[],subValueHandler:s,valuesHandler:a,tagJsVar:o,subscriptions:[]};return t.forEach(((t,e)=>{c=!0,u.subscriptions.push(t.subscribe((t=>s(t,e)))),c=!1})),o.onOutput=n,u}function br(t){const e=t.subContext;if(!e)return;e.subscriptions.forEach((t=>t.unsubscribe())),delete t.subContext}function yr(t,e){++t.updateCount;const n=t.subContext;return br(t),vo(n,e)}function vr(t){t||tt.stateConfig.support||h()}function xr(t,e,n,o,r){hr({tagJsType:S.subscribe,states:[],Observables:[t]},e,n,o,r)}function wr(t){return r()?$o((()=>Cr(t))):Cr(t)}function Cr(t){let e=t;const n=new Set,o=t=>{n.forEach((e=>e(t)))};return{tagJsType:S.signal,hasValueChanged:go,processInitAttribute:a,processInit:xr,processUpdate:gr,get value(){return e},set value(t){e!==t&&(e=t,o(t))},destroy:yr,emit:o,subscribe(t){t(e),n.add(t);const o=()=>n.delete(t);return o.unsubscribe=o,o}}}class Tr extends q{value;constructor(t){super(t),this.value=t}subscribe(t){const e=super.subscribe(t);return t(this.value,e),e}}class Vr extends q{value;constructor(t){super(t),this.value=t,this._value=t,Y(this)}subscribe(t){const e=super.subscribe(t);return t(this._value,e),e}}function Jr(t){return(e,n)=>{n.setHandler((()=>{})),t(e,n.next)}}function kr(t){return(e,n)=>{n.setHandler((()=>{}));t(e).then((t=>n.next(t)))}}const Ir=t=>(e,n)=>{n.setHandler((()=>{}));const o=t(e).subscribe((t=>{o.unsubscribe(),n.next(t)}))},Sr=(t,e)=>Ar(t,e).pastResult,Er=t=>t;const Ar=(t,e,{init:n,before:o,final:r=Er}={})=>{const s=$o({pastResult:void 0,values:void 0}),a="function"==typeof t?t():t,c=void 0===s.values;let u=0;function i(t){if(void 0===s.values){if(o&&!o(t))return s.values=t,s;const a=(n||e)(t,s.values);return s.pastResult=r(a),s.values=t,s}if(t.every(((t,e)=>t===s.values[e])))return s;if(o&&!o(t))return s.values=t,s;const a=e(t,s.values);return s.pastResult=r(a),s.values.length=0,s.values.push(...t),s}return c&&"function"==typeof t&&Yo.onRender((()=>{if(++u,1===u)return;i(t())})),i(a)};function Mr(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=$o((()=>r())),o=$o((()=>new Tr(void 0))),s=$o((()=>({state:tt.stateConfig.state,states:tt.stateConfig.states}))),a=(t,a)=>(Ar(t,((t,e)=>{const c=r(),u=a(t,e);if(c!==n){const t=s.state,e=n.context.state.older;if(e){Ge(t,e.state,s.states,e.states)}}o.next(u)}),e.setup),o);return a.setup=e.setup,Mr((()=>a),a),a}}),Object.defineProperty(e,"truthy",{get(){const e=t();return e.setup.before=t=>t.every((t=>t)),e}}),e}function Or(t){return r()?$o((()=>new q(t))):new q(t)}function Lr(t){return tt.stateConfig.handlers.statesHandler(t)}function Pr(t){const e=wr([]),n=wr(0),o=wr(0);let r=[],s=0;return o.value=n.value,t(((...t)=>(r=t,e.value))),Sr(r,(()=>{++s,e.value=r,t((()=>r))})),Lr(((r,a)=>{if(s)return t(((...t)=>(a&&1!==a||(e.value=t),e.value))),o.value=n.value,void++n.value;t((()=>e.value))})),++s,e.value}function jr(){return{stateDiff:0,provider:void 0}}Mr((()=>function(t){const e=(e,n)=>Ar(e,n,t).pastResult;return e.setup=t,Mr((()=>e),e),e}({})),Sr),Or._value=t=>{const e=$o((function(){return{state:tt.stateConfig.state,states:tt.stateConfig.states}})),n=r();return $o((function(){return new Tr(t).pipe((t=>{const o=n.context.state.newer;return Ge(o.state,e.state,o.states,e.states),t}))}))},Or.all=function(t){const e=$o((()=>({state:tt.stateConfig.state,states:tt.stateConfig.states}))),n=r();return q.all(t).pipe((t=>{const o=n.context.state.newer;return o&&Ge(o.state,e.state,o.states,e.states),t}))};const Dr={create:t=>{const e=$o(jr);if(e.stateDiff){let t=e.stateDiff;for(;t--;)$o(void 0);return $o(void 0)}const n=$o((()=>{const n=tt.stateConfig,o=n.state.length,r=t.prototype?new t:t(),s=n.support,a=n.state.length-o,c={constructMethod:t,instance:r,stateDiff:a,owner:s,children:[]};e.provider=c;const u=s.context;return(u.providers=u.providers||[]).push(c),e.stateDiff=a,r})),o=t,r=o.compareTo=o.toString();return e.provider.constructMethod.compareTo=r,n},inject:function(t){return $o((function(){const e=t,n=e.compareTo=e.compareTo||t.toString(),o=r(),s=[];let a={ownerSupport:o.ownerSupport};for(;a.ownerSupport;){const t=a.ownerSupport.context.providers;if(!t){a=a.ownerSupport;continue}const e=t.find((t=>{s.push(t);if(t.constructMethod.compareTo===n)return!0}));if(e){const t=o.context;return(t.providers=t.providers||[]).push(e),e.children.push(o),e.instance}a=a.ownerSupport}const c=`Could not inject provider: ${t.name} ${t}`;throw console.warn(`${c}. Available providers`,s),new Error(c)}))}};class Hr extends Error{details;constructor(t,e,n={}){super(t),this.name=Hr.name,this.details={...n,errorCode:e}}}class Nr extends Hr{constructor(t,e){super(t,"array-no-key-error",e),this.name=Nr.name}}class Ur extends Hr{constructor(t,e){super(t,"state-mismatch-error",e),this.name=Ur.name}}class $r extends Hr{constructor(t,e){super(t,"sync-callback-error",e),this.name=$r.name}}function Wr(t){const e=Gr(),n=$o({callback:t}),o=$o((()=>Rr(e,tt.stateConfig,n)));return n.callback=t,o}function Rr(t,e,n){const o=e.states;return function(...e){const r=function(t,e,n,...o){const r=n(...o),s=H(t);if(!s)return r;if(s.context.global)je(s);else{const t=s.context;t.tagJsVar.processUpdate(t.value,t,s.ownerSupport,[])}return L(r)&&r.finally((()=>{if(t.global)je(s);else{const t=s.context;t.tagJsVar.processUpdate(t.value,t,s.ownerSupport,[])}})),r}(t,o,n.callback,...e);return h(),r}}const Br=()=>{const t=Gr();if(!t)throw Fr;const e=tt.stateConfig;return function(n){return Rr(t,e,{callback:n})}},Fr=new $r("callback() was called outside of synchronous rendering. Use `callback = callbackMaker()` to create a callback that could be called out of sync with rendering");function _r(t=[]){return r()?$o((()=>zr(Cr(t)))):zr(Cr(t))}function zr(t){const e=["push","pop","splice","shift","unshift"],n=["map","reduce","forEach","every"],o=new Proxy(t,{get(r,s){return isNaN(s)?"length"===s?t.value.length:e.includes(s)?o[a=s]=(...e)=>{const n=t.value[a](...e);return t.emit(t.value),n}:n.includes(s)?t.value[s].bind(t.value):t[s]:t.value[s];var a},set:(e,n,o)=>isNaN(n)?"length"===n?(t.value.length=o,t.emit(t.value),!0):(t[n]=o,!0):(t.value[n]=o,t.emit(t.value),!0)});return o}function Gr(){return tt.stateConfig.context}function Xr(){return Gr().element}function Kr(t){return tt.stateConfig.context=t}function qr(){delete tt.stateConfig.context}function Zr(t,e,o,r,s){const a=t;let c=a.templater;if(c||(c=Qn(a)),n(e),s)return eo(c,e,o,s,r);return(e.state=e.state||{}).newest=to(c,o,e),Yn(o,e)}function Yr(t,e,n,o,r){Zr(t.outerHTML,e,n,o,r);e.tagJsVar.processUpdate=function(t,e,n){fr(e,t?.outerHTML||t,n)},t.hasValueChanged=Qr}function Qr(t,e){return de(t,e)}function ts(t,e){const n={values:e,ownerSupport:r(),tagJsType:S.tag,processInitAttribute:a,processInit:Zr,processUpdate:ht,hasValueChanged:de,destroy:pe,strings:t,key:t=>es(t,n),setHTML:function(t){return t.outerHTML=n,n._innerHTML=t,t.oldProcessInit=t.processInit,t.processInit=Yr,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 es(t,e){return es(t,e),e.arrayValue=t,e}function ns(t,e){const n={values:e,ownerSupport:r(),dom:t,tagJsType:S.dom,processInitAttribute:a,processInit:Zr,processUpdate:ht,hasValueChanged:de,destroy:pe,key:function(t){return n.arrayValue=t,n},setHTML:function(t){return t.outerHTML=n,n._innerHTML=t,t.oldProcessInit=t.processInit,t.processInit=Yr,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 os(t,...e){const n=ts(t,e),o=oo(Zo.NONE);return o.tag=n,n.templater=o,n}os.dom=function(t,...e){return ns(t,e)},"object"==typeof document&&(document.taggedJs&&console.warn("🏷️🏷️ Multiple versions of taggedjs are loaded. May cause issues."),document.taggedJs=!0);const rs=[];function ss(t,e,o){const r=rs.findIndex((t=>t.element===e));if(r>=0){const t=rs[r].support;ue(t,t.context.global),rs.splice(r,1),console.warn("Found and destroyed app element already rendered to element",{element:e})}let c=()=>p(o);c.propWatch=Zo.NONE,c.tagJsType=S.stateRender,c.processUpdate=ht,c.props=[o],c.isApp=!0;const u=function(t,e){const o={tagJsType:"templater",hasValueChanged:de,destroy:pe,processInitAttribute:a,processInit:function(){console.debug("do nothing app function")},processUpdate:ht},r={updateCount:0,value:t,valueIndex:0,varCounter:0,destroy$:new q,render$:new q,withinOwnerElement:!1,renderCount:0,global:void 0,state:{},tagJsVar:o};return n(r),r.events={},function(t,e,n){const o=ar(t,e);cr(t,o,o),o.appElement=n,e.state.oldest||(e.state.oldest=o,e.state.older=e.state.newer),e.state.newest=o}(t,r,e),r}(c,e),i=u.global,l=u.state.newest;R(l.context),s(l);let p=t(o);const f=typeof p==I.function;f||(M(p)?(u.state.newest.propsConfig={latest:[o],castProps:[o]},c.propWatch=p.propWatch,c.tagJsType=p.tagJsType,c.wrapper=p.wrapper,c=p):(c.tag=p,p=t));const g=function(t,e,n,o,r,s,a){const c=document.createTextNode(J);if(ro.push(n.wrapper||{original:n}),s.placeholder=c,e.isApp=!0,!r)throw new Error(`Cannot tagElement, element received is type ${typeof r} and not type Element`);r.destroy=function(){const t=s.events;for(const e in t){const n=t[e];r.removeEventListener(e,n)}s.events={},++d.locks;const n=ue(i,e);return--d.locks,h(),n},++d.locks;const u=document.createDocumentFragment();u.appendChild(c);const i=Do(n,s,{appSupport:{appElement:r,context:s},appElement:r});return i.appElement=r,a&&(o.tag=i.templater.tag),--d.locks,h(),r.appendChild(u),{support:i,tags:ro,ValueTypes:S}}(0,i,c,p,e,u,f);return qr(),g}function as(t,e){return function(n,o,r){if(s=o,Array.isArray(s)&&Object.prototype.hasOwnProperty.call(s,"raw")){const s=o.reduce(((t,e,n)=>t+e+(r[n]??"")),"");return e(n,[t,s])}var s;return e(n,[t,o])}}function cs(t,e,n){function o(t){return o.toCallback(t)}return o.toCallback=n,t.listeners.push([e,o]),t.allListeners.push([e,o]),t}function us(t,e){const n=Es(t,t.elementFunctions);return n.attributes.push(e),gs(e[0])?ds(e[0],n):gs(e[1])&&ds(e[1],n),n}const is=as("style",us),ls=as("id",us);function ps(t,e){return t.attributes.push(e),gs(e[0])?ds(e[0],t):gs(e[1])&&ds(e[1],t),t}function fs(t){function e(e){return function(n){return function(t,e,n){return cs(Es(t,t.elementFunctions),e,n)}(t,e,n)}}return{onClose:e("onclose"),onDoubleClick:e("ondblclick"),onClick:e("click"),onBlur:e("onblur"),onChange:e("onchange"),onMousedown:e("onmousedown"),onMouseup:e("onmouseup"),onKeydown:e("onkeydown"),onKeyup:e("onkeyup"),attr:(...e)=>us(t,e),key:function(t){return this.arrayValue=t,this},style:(e,...n)=>is(t,e,n),id:(e,...n)=>ls(t,e,n)}}function ds(t,e){e.contexts||(e.contexts=[]),e.contexts.push(t)}function gs(t){return Array.isArray(t)||P(t)||t?.tagJsType}function hs(t,e){return(n,o)=>ps(n,[t,o,!1,e])}function ms(t){return(e,n)=>cs(e,t,n)}const bs={onClose:ms("onclose"),onClick:ms("click"),onDoubleClick:ms("ondblclick"),onDblClick:ms("ondblclick"),onBlur:ms("onblur"),onChange:ms("onchange"),onMousedown:ms("onmousedown"),onMouseDown:ms("onmousedown"),onMouseup:ms("onmouseup"),onMouseUp:ms("onmouseup"),onKeyup:ms("onkeyup"),onKeyUp:ms("onkeyup"),onKeydown:ms("onkeydown"),onKeyDown:ms("onkeydown")},ys={checked:hs("checked",Et),selected:hs("selected",Et),class:hs("class",(function(t,e,n){j(n)?Object.entries(n).forEach((([e,n])=>{n?t.classList.add(e):t.classList.remove(e)})):At(t,e,n)})),...bs};function vs(t,e){++t.updateCount;const n=t.contexts,o=[];if(n.length&&(xs(n,e,o),n.length=0,o.length)){const e=t.htmlDomMeta;return t.deleted=!0,Promise.all(o).then((()=>{++d.locks,re(e),t.htmlDomMeta=[],--d.locks,h()}))}ce(t),t.htmlDomMeta=[],delete t.contexts,t.deleted=!0}function xs(t,e,n){const o=t[0],r=o.tagJsVar.destroy(o,e);return o.deleted=!0,L(r)?n.push(r.then((()=>{if(t.length>1)return xs(t.slice(1,t.length),e,n)}))):(o.htmlDomMeta&&(ce(o),delete o.htmlDomMeta),t.length>1?xs(t.slice(1,t.length),e,n):void 0)}function ws(t,e,n){if(e.locked||!0===e.deleted)return;++e.updateCount;if(Cs(t,e))return vs(e,n),e.htmlDomMeta=[],delete e.deleted,void pr(t,e,n,789);const o=e.contexts,r=t.contexts||[],s=e.tagJsVar.allListeners;if(t.allListeners.forEach(((t,e)=>{s[e][1].toCallback=t[1].toCallback})),o.length!==r.length)throw console.info("context mismatch",{value:t,context:e,conValues:o.map((t=>t.value)),vContexts:r,deleted:e.deleted}),new Error("super issue discovered");e.locked=79,o.forEach(((t,e)=>{t.tagJsVar.processUpdate(r[e],t,n)})),delete e.locked}function Cs(t,e){if(e.value===t)return 0;if(!t||"element"!==t.tagJsType)return 1;if(t.innerHTML.length!==e.value.innerHTML.length)return 1;return t.attributes.length!==e.value.attributes.length?1:0}function Ts(t,e,n,o,r){t.forEach((t=>{switch(typeof t){case"string":case"boolean":case"number":return Js(t,o,r);case"function":{if("element"===t.tagJsType)break;const s=function(t,e,n,o,r){const s=[],c={updateCount:0,parentContext:n,contexts:s,element:e,value:t,htmlDomMeta:[],tagJsVar:{tagJsType:"dynamic-text",hasValueChanged:()=>0,processInit:a,processInitAttribute:a,destroy:(t,e)=>{++c.updateCount,s.forEach((t=>t.tagJsVar.destroy(t,e)))},processUpdate:(t,e,n,o)=>{++c.updateCount,Kr(i);let r=t(i);const s=c.underFunction;delete c.underFunction,r instanceof Function&&!r.tagJsType&&(s&&r.toString()===s.toString()?r=i.value:(c.underFunction=r,r=r()));const a=i.tagJsVar.processUpdate(r,i,n,o);return i.value=r,e.value=t,qr(),a}},valueIndex:-1,withinOwnerElement:!0,destroy$:new q,render$:new q};Kr(c);let u=t();P(u)&&!u.tagJsType&&(c.underFunction=u,u=u());const i=Vs(u,c,e,o,r);return n.contexts.push(c),qr(),i}(t,o,e,n,r);return s}}if(null==t)return Js(t,o,r);if("element"!==t.tagJsType)return Vs(t,e,o,n,r);{const s=ks(t,e,n,e.contexts);u.push([r,[o,s]]);e.htmlDomMeta.push({nn:s.tagName,domElement:s,at:[]})}}))}function Vs(t,e,n,o,r){const s=Kt(t,0,!0,e);return e.contexts.push(s),s.element=n,s.placeholder=document.createTextNode(""),u.push([r,[n,s.placeholder]]),Kr(s),s.tagJsVar.processInit(t,s,o,s.placeholder),qr(),s}function Js(t,e,n){const o=bt(t),r=document.createTextNode(o);return u.push([n,[e,r]]),r}function ks(t,e,n,o){const r=document.createElement(t.tagName);return e.element=r,t.attributes.forEach((t=>{const e=t[0];"string"==typeof e&&(t[2]=yt(e))})),Tn(t.attributes,[],r,n,e),Ts(t.innerHTML,e,n,r,v),t.listeners.forEach(((e,o)=>function(t,e,n,o,r){const s=(...o)=>{const r=t.listeners[e][1],s=N(n),a=s.context.updateCount;s.context.locked=1,++d.locks;const c=r(...o);--d.locks,delete s.context.locked;return a===s.context.updateCount?tn(c,s):(h(),L(c)?c.then((()=>($e([s.context.state.newest]),"promise-no-data-ever"))):"no-data-ever")};an(n.appSupport,o[0],r,s)}(t,o,n,e,r))),r}function Is(t,e,n,o){e.contexts=e.contexts||[],e.htmlDomMeta=[],e.locked=34;const r=ks(t,e,n,e.contexts);delete e.locked,u.push([y,[o,r,"htmlTag.processInit"]]);const s={nn:t.tagName,domElement:r,at:t.attributes};return e.htmlDomMeta=[s],r}function Ss(t){const e=Es({tagJsType:"element",processInitAttribute:a,processInit:Is,destroy:vs,processUpdate:ws,hasValueChanged:Cs,tagName:t,innerHTML:[],attributes:[],listeners:[],allListeners:[],elementFunctions:fs},fs);return e.tagName=t,e}function Es(t,e){const n=(...t)=>{const e={...n};var o,r;return e.attributes=[...n.attributes],e.listeners=[...n.listeners],e.allListeners=[...n.allListeners],t.length>0&&"object"==typeof t[0]&&!Array.isArray(t[0])&&!t[0].tagJsType&&(o=e,r=t[0],Object.entries(r).reduce(((t,[e,n])=>e in ys?ys[e](o,n):ps(o,[e,n,!1,St])),o),t.splice(0,1)),e.innerHTML=t,t.forEach((t=>{if(gs(t))return"element"===t.tagJsType?(e.allListeners.push(...t.allListeners),void(t.contexts&&(e.contexts?e.contexts.push(...t.contexts):e.contexts=t.contexts))):void function(t,e){e.contexts||(e.contexts=[]);e.contexts.push(t)}(t,e)})),e};return Object.assign(n,t),Object.assign(n,fs(n)),n.attributes=[...t.attributes],n.listeners=[...t.listeners],n.allListeners=[...t.allListeners],n}const As=function(){const t=Es({tagJsType:"element",processInitAttribute:a,processInit:Ms,destroy:Os,processUpdate:ws,hasValueChanged:Cs,tagName:"no-element",innerHTML:[],attributes:[],listeners:[],allListeners:[],elementFunctions:fs});return t.tagName="no-element",t}();function Ms(t,e,n,o){e.contexts=e.contexts||[],e.htmlDomMeta=[],Ts(t.innerHTML,e,n,o,y)}function Os(t,e){++t.updateCount;const n=t.contexts,o=[];if(n.length&&(xs(n,e,o),n.length=0,o.length)){const e=t.htmlDomMeta;return Promise.all(o).then((()=>{++d.locks,re(e),--d.locks,h()}))}}const Ls=Ss("button"),Ps=Ss("select"),js=Ss("option"),Ds=Ss("input"),Hs=Ss("textarea"),Ns=Ss("html"),Us=Ss("head"),$s=Ss("title"),Ws=Ss("meta"),Rs=Ss("link"),Bs=Ss("style"),Fs=Ss("body"),_s=Ss("noscript"),zs=Ss("hr"),Gs=Ss("h1"),Xs=Ss("h2"),Ks=Ss("h3"),qs=Ss("h4"),Zs=Ss("h5"),Ys=Ss("h6"),Qs=Ss("ol"),ta=Ss("ul"),ea=Ss("li"),na=Ss("div"),oa=Ss("main"),ra=Ss("section"),sa=Ss("header"),aa=Ss("footer"),ca=Ss("fieldset"),ua=Ss("legend"),ia=Ss("dialog"),la=Ss("pre"),pa=Ss("table"),fa=Ss("tr"),da=Ss("td"),ga=Ss("th"),ha=Ss("thead"),ma=Ss("tbody"),ba=Ss("tfoot"),ya=Ss("a"),va=Ss("br"),xa=Ss("label"),wa=Ss("p"),Ca=Ss("small"),Ta=Ss("span"),Va=Ss("strong"),Ja=Ss("b"),ka=Ss("sup"),Ia=Ss("nav"),Sa=Ss("figure"),Ea=Ss("figcaption"),Aa=Ss("code"),Ma={tagElement:ss,renderWithSupport:Oe,renderSupport:je,firstTagRender:Ae,reRenderTag:Ee,paint:h};var Oa=e.W9,La=e.cg,Pa=e.m0,ja=e.rS,Da=e.Y2,Ha=e.ei,Na=e.B7,Ua=e.TU,$a=e.XF,Wa=e.PC,Ra=e.Ot,Ba=e.Mj,Fa=e.tD,_a=e.a,za=e.Gf,Ga=e.xe,Xa=e.YO,Ka=e.b,qa=e.rf,Za=e.br,Ya=e.um,Qa=e.x6,tc=e.E2,ec=e.OH,nc=e.TB,oc=e.Ii,rc=e.mX,sc=e.yV,ac=e.EI,cc=e.aY,uc=e.zV,ic=e.pf,lc=e.ze,pc=e.Go,fc=e.bD,dc=e.WJ,gc=e.wL,hc=e.Ng,mc=e.O,bc=e.r3,yc=e.y4,vc=e.Ie,xc=e.lI,wc=e.$F,Cc=e.vP,Tc=e.hp,Vc=e.qr,Jc=e.ts,kc=e.B4,Ic=e.HD,Sc=e.Az,Ec=e.Xi,Ac=e.sV,Mc=e.Ah,Oc=e.f5,Lc=e.Gk,Pc=e.j_,jc=e.h1,Dc=e.h2,Hc=e.h3,Nc=e.h4,Uc=e.h5,$c=e.h6,Wc=e.zC,Rc=e.d5,Bc=e.wx,Fc=e.cF,_c=e.Hc,zc=e.PB,Gc=e.uq,Xc=e.hr,Kc=e.qy,qc=e.gM,Zc=e.gx,Yc=e.hF,Qc=e.cy,tu=e.Tn,eu=e.Gv,nu=e.yL,ou=e.D8,ru=e.Ze,su=e._4,au=e.mn,cu=e.Pf,uu=e.o1,iu=e.z,lu=e.li,pu=e.nf,fu=e.iW,du=e.mI,gu=e.C$,hu=e.et,mu=e.Vg,bu=e.ol,yu=e.sA,vu=e.TG,xu=e.MG,wu=e.PL,Cu=e.uK,Tu=e.CG,Vu=e.p,Ju=e.nI,ku=e.Fs,Iu=e.AS,Su=e.r5,Eu=e.M$,Au=e.uc,Mu=e.QB,Ou=e.uW,Lu=e.Lt,Pu=e.Jv,ju=e.TA,Du=e.Jn,Hu=e.Ll,Nu=e.L6,Uu=e.EX,$u=e.Ln,Wu=e.wk,Ru=e.xP,Bu=e.ko,Fu=e.iF,_u=e.bc,zu=e.B1,Gu=e.RX,Xu=e.lR,Ku=e.ag,qu=e.tp,Zu=e.Tc,Yu=e.Hf,Qu=e.zc,ti=e._A,ei=e.T_,ni=e.td,oi=e.g0,ri=e.pd,si=e.th,ai=e.VQ,ci=e.DD,ui=e.tr,ii=e.ul,li=e.Ag,pi=e.Pc,fi=e.NU,di=e.wB,gi=e.id,hi=e.MC,mi=e.SZ;export{Oa as ArrayNoKeyError,La as BasicTypes,Pa as ImmutableTypes,ja as PropWatches,Da as RouteQuery,Ha as StateMismatchError,Na as Subject,Ua as Subjective,$a as SyncCallbackError,Wa as TagError,Ra as ValueSubject,Ba as ValueSubjective,Fa as ValueTypes,_a as a,za as addPaintRemoveAwait,Ga as appElements,Xa as array,Ka as b,qa as body,Za as br,Ya as buildBeforeElement,Qa as button,tc as callback,ec as callbackMaker,nc as checkArrayValueChange,oc as checkSimpleValueChange,rc as checkStillSubscription,sc as checkTagValueChange,ac as checkTagValueChangeAndUpdate,cc as code,uc as combineLatest,ic as createHtmlSupport,lc as createTrigger,pc as deepClone,fc as deepEqual,dc as defineValueOn,gc as deleteContextSubContext,hc as deleteSimpleValue,mc as destroySupport,bc as dialog,yc as div,vc as empty,xc as fieldset,wc as figcaption,Cc as figure,Tc as firstTagRender,Vc as footer,Jc as forceUpdateExistingValue,kc as getBaseSupport,Ic as getContextInCycle,Sc as getDomMeta,Ec as getDomTag,Ac as getInnerHTML,Mc as getNewGlobal,Oc as getSupportOlderState,Lc as getTemplaterResult,Pc as guaranteeInsertBefore,jc as h1,Dc as h2,Hc as h3,Nc as h4,Uc as h5,$c as h6,Wc as hasPropChanges,Rc as head,Bc as header,Fc as hmr,_c as host,zc as howToSetInputValue,Gc as howToSetStandAloneAttr,Xc as hr,Kc as html,qc as htmlDoc,Zc as htmlTag,Yc as input,Qc as isArray,tu as isFunction,eu as isObject,nu as isPromise,ou as isSimpleType,ru as isStaticTag,su as isSubjectInstance,au as isTagComponent,cu as label,uu as legend,iu as letProp,lu as li,pu as link,fu as main,du as meta,gu as nav,hu as noElement,mu as noscript,bu as ol,yu as onDestroy,vu as onFirstSubContext,xu as onInit,wu as oneRenderToSupport,Cu as option,Tu as output,Vu as p,Ju as paint,ku as pipe,Iu as pre,Su as providers,Eu as reRenderTag,Au as renderSupport,Mu as renderWithSupport,Ou as section,Lu as select,Pu as setBooleanAttribute,ju as setNonFunctionInputValue,Du as setSimpleAttribute,Hu as setUseMemory,Nu as signal,Uu as small,$u as span,Wu as state,Ru as states,Bu as strong,Fu as style,_u as subject,zu as subscribe,Gu as subscribeWith,Xu as sup,Ku as syncError,qu as table,Zu as tag,Yu as tagElement,Qu as tagValueUpdateHandler,ti as tags,ei as tbody,ni as td,oi as textarea,ri as tfoot,si as th,ai as thead,ci as title,ui as tr,ii as ul,li as upgradeBaseToSupport,pi as valueToTagJsVar,fi as variablePrefix,di as watch,gi as willCallback,hi as willPromise,mi as willSubscribe};
1
+ var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function n(t){return t.renderCount=t.renderCount||0,t.varCounter=0,t.state={newer:{state:[],states:[]}},t.global={blocked:[]}}t.d(e,{W9:()=>Nr,cg:()=>I,m0:()=>k,rS:()=>Zo,Y2:()=>o,ei:()=>Ur,B7:()=>q,TU:()=>Z,XF:()=>$r,PC:()=>Hr,Ot:()=>Tr,Mj:()=>Vr,tD:()=>S,a:()=>xa,Gf:()=>c,xe:()=>rs,YO:()=>_r,b:()=>Ia,rf:()=>zs,br:()=>wa,um:()=>Zn,x6:()=>js,E2:()=>Wr,OH:()=>Br,TB:()=>Ft,Ii:()=>Rt,mX:()=>mo,yV:()=>fe,EI:()=>de,aY:()=>Oa,zV:()=>G,pf:()=>ur,ze:()=>Rr,Go:()=>ot,bD:()=>st,WJ:()=>Y,wL:()=>yo,Ng:()=>Wt,O:()=>ue,r3:()=>pa,y4:()=>ra,Ie:()=>J,lI:()=>ia,$F:()=>Ma,vP:()=>Aa,hp:()=>Ae,qr:()=>ua,ts:()=>fr,B4:()=>ar,HD:()=>Gr,Az:()=>qn,Xi:()=>ns,sV:()=>To,Ah:()=>n,f5:()=>Me,Gk:()=>oo,j_:()=>dr,h1:()=>Ks,h2:()=>qs,h3:()=>Zs,h4:()=>Ys,h5:()=>Qs,h6:()=>ta,zC:()=>Qo,d5:()=>Ws,wx:()=>ca,cF:()=>La,Hc:()=>So,PB:()=>Jt,uq:()=>It,hr:()=>Xs,qy:()=>os,gM:()=>$s,gx:()=>As,hF:()=>Ns,cy:()=>D,Tn:()=>P,Gv:()=>j,yL:()=>L,D8:()=>E,Ze:()=>A,_4:()=>O,mn:()=>M,Pf:()=>Ca,o1:()=>la,z:()=>Pr,li:()=>oa,nf:()=>Fs,iW:()=>sa,mI:()=>Bs,C$:()=>Ea,et:()=>Os,Vg:()=>Gs,ol:()=>ea,sA:()=>Fo,TG:()=>xo,MG:()=>Wo,PL:()=>ao,uK:()=>Hs,CG:()=>ko,p:()=>Ta,nI:()=>h,Fs:()=>Vo,AS:()=>fa,r5:()=>Dr,M$:()=>Ee,uc:()=>je,QB:()=>Oe,uW:()=>aa,Lt:()=>Ds,Jv:()=>Et,TA:()=>St,Jn:()=>At,Ll:()=>tt,L6:()=>wr,EX:()=>Va,Ln:()=>Ja,wk:()=>$o,xP:()=>Lr,ko:()=>ka,iF:()=>_s,bc:()=>Or,B1:()=>bo,RX:()=>fo,lR:()=>Sa,ag:()=>Fr,tp:()=>da,Tc:()=>Yo,Hf:()=>ss,zc:()=>ht,_A:()=>ro,T_:()=>ya,td:()=>ha,g0:()=>Us,pd:()=>va,th:()=>ma,VQ:()=>ba,DD:()=>Rs,tr:()=>ga,ul:()=>na,Ag:()=>cr,Pc:()=>Xt,NU:()=>dn,wB:()=>Sr,id:()=>Jr,MC:()=>kr,SZ:()=>Ir});class o{get(t){return"todo"}}function r(){return tt.stateConfig.support}function s(t){return Kr(t.context),tt.stateConfig.support=t}const a=function(){};function c(t){}let u=[];const i=[];let l=[],p=[],f=[];const d={locks:0,removeLocks:0};function g(t,e){e.textContent=t}function h(){d.locks>0||(++d.locks,function(){const t=i.length;(function(){for(const t of i)t[0](...t[1])})(),i.splice(0,t);for(const t of l)t[0](...t[1]);for(const t of p)t[0](...t[1]);for(const t of u)t[0](...t[1])}(),--d.locks,function(){u=[],l=[],p=[];const t=f;f=[];for(const e of t)e[0](...e[1])}())}function m(t,e){i.push([b,[t,e]])}function b(t,e){t.parentNode.removeChild(t)}function y(t,e,n){t.parentNode.insertBefore(e,t)}function v(t,e){t.appendChild(e)}const x="object"==typeof document&&document.createElement("div");function w(t){return x.innerHTML=t,document.createTextNode(x.innerHTML)}function C(t,e,n=a,o){const r=w(e);y(t,r),n(r)}function T(t,e,n=a){x.innerHTML=e;const o=document.createTextNode(x.textContent);y(t,o),n(o)}function V(t,e,n){x.innerHTML=e;const o=document.createTextNode(x.textContent);v(t,o),n(o)}const J="";var k,I;!function(t){t.string="string",t.number="number",t.boolean="boolean",t[void 0]="undefined"}(k||(k={})),function(t){t.function="function",t.date="date",t.unknown="unknown",t.object="object"}(I||(I={}));const S={tag:"html",dom:"dom",templater:"templater",tagComponent:"tagComponent",tagArray:"tagArray",host:"host",subscribe:"subscribe",signal:"signal",renderOnce:"renderOnce",stateRender:"stateRender",version:Date.now()};function E(t){switch(t){case k.string:case k.number:case k.boolean:return!0}return!1}function A(t){if(!t)return!1;switch(t.tagJsType){case S.dom:case S.tag:case S.templater:return!0}return!1}function M(t){const e=t?.tagJsType;return e===S.tagComponent||e===S.stateRender}function O(t){return j(t)&&typeof t.subscribe===I.function}function L(t){return t&&P(t.then)}function P(t){return typeof t===I.function}function j(t){return typeof t===I.object&&null!==t}function D(t){return Array.isArray(t)}function H(t){const e=t.state;return e&&e.newest&&e.newest?e.newest:t.parentContext?H(t.parentContext):void 0}function N(t){let e=t;for(;e.ownerSupport&&!M(e.templater);)e=e.ownerSupport;const n=e.context.state;return n&&n.newest||e}function U(...t){return t}function $(t){const e=tt.stateConfig;return e.states[e.statesIndex]=t,++e.statesIndex,t(U)}function W(t){const e=tt.stateConfig,n=e.statesIndex,o=N(e.prevSupport).context.state.older.states[n];let r=[];o((function(...t){return r=t,o.lastValues=r,t}));return e.states[e.statesIndex]=t,++e.statesIndex,t((function(...t){return r}))}function R(t){Kr(t);const e=tt.stateConfig;e.handlers.handler=z,e.handlers.statesHandler=$,e.rearray=[];const n=e.state=[],o=e.states=[];e.statesIndex=0;(t.state=t.state||{}).newer={state:n,states:o}}class B{}function F(t){const e=t.callback;if(!e)return t.defaultValue;const[n]=function(t){const[e]=t(B),[n]=t(e);return[e,n]}(e);return n}function _(){const t=tt.stateConfig,e=t.rearray[t.state.length];return t.state.push(e),e.defaultValue}function z(t){const e=tt.stateConfig,n=Gr();if(!n||!n.state){const t="State requested but TaggedJs is not currently rendering a tag or host";throw console.error(t,{config:e,context:n}),new Error(t)}const o=n.state.newer;e.state=o.state;let r=t;if(typeof t===I.function&&(r=t()),typeof r===I.function){const t=r;r=function(...e){return t(...e)},r.original=t}const s={get:function(){return F(s)},defaultValue:r};return e.state.push(s),r}function G(t){const e=new q;return e.subscribeWith=e=>{const n=[],o=[],r=(r,s)=>{n[s]=!0,o[s]=r;if(n.length===t.length){for(const t of n)if(!t)return;e(o,a)}},s=[...t],a=s.shift().subscribe((t=>r(t,0))),c=s.map(((t,e)=>t.subscribe((t=>r(t,e+1)))));return a.subscriptions=c,a},e}function X(t,e,n){const o=q.globalSubCount$;q.globalSubCount$.next(o.value+1);const r=function(){r.unsubscribe()};return r.callback=e,r.subscriptions=[],r.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 o=q.globalSubCount$;q.globalSubCount$.next(o.value-1),t.unsubscribe=()=>t;const r=t.subscriptions;for(const t of r)t.unsubscribe();return t}(r,n,e)},r.add=t=>(r.subscriptions.push(t),r),r.next=t=>{e(t,r)},r}function K(t,e,n){const o=[...e],r=o.shift(),s=t=>{if(o.length)return K(t,o,n);n(t)};let a=s;const c=r(t,{setHandler:t=>a=t,next:s});a(c)}class q{onSubscription;methods=[];isSubject=!0;subscribers=[];subscribeWith;value;constructor(t,e){this.onSubscription=e,arguments.length>0&&(this.value=t)}subscribe(t){const e=X(0,t,this.subscribers),n=this.subscribeWith;if(n){if(this.methods.length){const n=t;t=t=>{K(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,o)=>{const r=o?.unsubscribe;r?r():setTimeout((()=>e.unsubscribe()),0),t(n)}));return e}pipe(...t){const e=[];"value"in this&&e.push(this.value);const n=new q(...e);return n.setMethods(t),n.subscribeWith=t=>this.subscribe(t),n.next=t=>this.next(t),n}setMethods(t){this.methods=t}static all(t){return G(t.map((t=>{if(O(t))return t;return new q(t,(e=>(e.next(t),e)))})))}static globalSubCount$=new q(0)}class Z extends q{_value;constructor(...t){super(...t),this._value=t[0],Y(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 Y(t){Object.defineProperty(t,"value",{set(e){t._value=e,t.emit()},get:()=>t._value})}const Q=new q(void 0,(function(t){r()||t.next()})),tt={stateConfig:{state:[],version:Date.now(),handlers:{handler:z,statesHandler:$}},tagClosed$:Q};function et(t,e,n){if(e.deleted)return;const o=t[e.valueIndex],r=e.tagJsVar;Kr(e),r.processUpdate(o,e,n,t),qr(),e.value=o}function nt(t,e){const n=t.context.contexts;!function(t,e){const n=e.templater,o=e.templater.tag,r=n.values||o.values,s=t.templater.tag;s.values=r}(t,e),++d.locks,function(t,e){const n=t.templater.tag.values;for(const o of e)et(n,o,t)}(t,n),--d.locks,h()}function ot(t,e){return rt(t,e)}function rt(t,e){if(null===t||typeof t!==I.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=D(t)?[]:Object.create(Object.getPrototypeOf(t));if(D(t))for(let o=0;o<t.length;o++)n[o]=rt(t[o],e-1);else for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=rt(t[o],e-1));return n}function st(t,e,n){return at(t,e,n)}function at(t,e,n){return!(t!==e&&(o=t,r=e,!P(o)||!P(r)||o.toString()!==r.toString()))||(n<0||typeof t===I.object&&typeof e===I.object&&(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():D(t)&&D(e)?function(t,e,n){if(t.length!==e.length)return!1;for(let o=0;o<t.length;o++)if(!at(t[o],e[o],n-1))return!1;return!0}(t,e,n-1):!D(t)&&!D(e)&&function(t,e,n){const o=Object.keys(t),r=Object.keys(e);if(0===o.length&&0===r.length)return!0;if(o.length!==r.length)return!1;for(const s of o){if(!r.includes(s)||!at(t[s],e[s],n-1))return!1}return!0}(t,e,n-1)));var o,r}function ct(t){return t.map(ut)}function ut(t,e){const n=t,o=t?.tagJsType;if(o)switch(o){case S.signal:case S.subscribe:case S.stateRender:return;case S.dom:case S.tag:case S.templater:return ct(n.values)}return D(t)?ct(n):ot(t,e)}function it(t,e){const n=t.length;for(let o=0;o<n;++o){const n=t[o],r=e[o];if(D(n)&&D(r)){if(n===r)continue;return 3}if(typeof n!==I.function||typeof r!==I.function)if(typeof n!==I.object){if(n!==r)return 3.3}else{if(!n&&!r)continue;if(typeof e===I.object){const t=Object.entries(n);for(const e of t){if(!lt(e,r))return 3.1}}}}return!1}function lt([t,e],n){const o=n[t];return typeof e===I.function&&typeof o===I.function||o===e}function pt(t,e){const n=t.context.providers;if(n)for(const t of n)for(let n=t.children.length-1;n>=0;--n){t.children[n].context.global===e&&t.children.splice(n,1)}t.context.destroy$.next(),t.context.renderCount=0}function ft(t,e){for(const n of t){const t=n.lastArray;if(t){ft(t,e);continue}const o=n.value;if(o?.tagJsType===S.subscribe){o.destroy(n,e),n.deleted=!0;continue}const r=n.global;if(!r)continue;const s=n.state.newest,a=r.subscriptions;a&&a.forEach(gt),M(s.templater)&&pt(s,r);ft(n.contexts,s),r.deleted=!0}}function dt(t,e=[],n=[]){for(const o of t){const t=o.global;if(!t)continue;const r=o.state.newest;if(r){e.push(r);const o=t.subscriptions;o&&n.push(...o)}const s=o.contexts;s&&dt(s,e,n)}return{tags:e,subs:n}}function gt(t){t.unsubscribe()}function ht(t,e,n){const o=e.tagJsVar.tagJsType;return o&&["tag-conversion","element"].includes(o)?(e.tagJsVar.processUpdate(t,e,n,[]),e.value=t,0):t===e.value?0:(++e.updateCount,fr(e,t,n))}function mt(t,e,n,o,r){const s=e.context;s.locked=3,n.element=n.element||o,Kr(n),n.tagJsVar.processInit(t,n,e,r,o),qr(),n.value=t,delete s.locked}function bt(t){switch(t){case void 0:case!1:case null:return J}return t}function yt(t){if(t.startsWith("class."))return"class";const e=function(t){switch(t){case"autoselect":case"autoSelect":return"autoselect";case"autofocus":case"autoFocus":return"autofocus"}return!1}(t);return!1!==e?e:!!t.startsWith("style.")&&"style"}function vt(t,e,n,o){switch(o){case"autofocus":return void f.push([Vt,[n]]);case"autoselect":return void f.push([Tt,[n]]);case"style":{const o=t.split(".");return void l.push([xt,[n,o,e]])}case"class":return void function(t,e,n){const o=t.split(".");if(o.shift(),e){for(const t of o)l.push([wt,[n,t]]);return}for(const t of o)l.push([Ct,[n,t]])}(t,e,n)}throw new Error(`Invalid special attribute of ${o}. ${t}`)}function xt(t,e,n){const o=e[1];t.style[o]=n,t.style.setProperty(o,n)}function wt(t,e){t.classList.add(e)}function Ct(t,e){t.classList.remove(e)}function Tt(t){t.select()}function Vt(t){t.focus()}function Jt(t,e,n){if(j(n))return kt(t,e,n);l.push([St,[t,e,n]])}function kt(t,e,n){"object"!=typeof t[e]&&(t[e]={});for(const o in n){const r=n[o];l.push([Ot,[t,e,o,r]])}if(t[e].setProperty)for(const o in n){const r=n[o];l.push([Mt,[t,e,o,r]])}}function It(t,e,n){t.setAttribute(e,"")}function St(t,e,n){if(j(n))return kt(t,e,n);At(t,e,n)}function Et(t,e,n){t[e]=!!n}function At(t,e,n){t[e]=n,void 0!==n&&!1!==n&&null!==n?t.setAttribute(e,n):t.removeAttribute(e)}function Mt(t,e,n,o){t[e].setProperty(n,o)}function Ot(t,e,n,o){t[e][n]=o}function Lt(t,e,n,o,r,s,a){return n.element=o,n.howToSet=r,n.attrName=t,n.isSpecial=a,e?.tagJsType?function(t,e,n,o,r){e.processInitAttribute(t,e,r,e,n,o,St),n.tagJsVar=e}(t,e,n,s,o):Pt(t,e,o,r,a,n)}function Pt(t,e,n,o,r,s){return"function"==typeof e?function(t,e,n,o,r){const s=t(),c={tagJsType:"dynamic-attr",matchesInjection:t=>{const e=u.tagJsVar;if(e.matchesInjection)return e.matchesInjection(t,u)},hasValueChanged:(e,n,o)=>{const r=t();return u.tagJsVar.hasValueChanged(r,u,o)},processInit:a,processInitAttribute:a,destroy:(t,e)=>{u.tagJsVar.destroy(u,e)},processUpdate:(t,e,n,o)=>{++e.updateCount;const r=t();u.tagJsVar.processUpdate(r,u,n,o),u.value=r}},u={updateCount:0,isAttr:!0,element:o,parentContext:e,value:s,tagJsVar:Xt(s),valueIndex:-1,withinOwnerElement:!0,destroy$:new q,render$:new q},i={updateCount:0,isAttr:!0,contexts:[u],element:o,parentContext:e,value:t,tagJsVar:c,valueIndex:-1,withinOwnerElement:!0,destroy$:new q,render$:new q};return u.tagJsVar.processInitAttribute(n,s,o,u.tagJsVar,u,{},r),i}(e,s,t,n,o):r?vt(t,e,n,r):void o(n,t,e)}function jt(t,e,n,o,r,s){const a=e.tagJsVar,c=t;if(a.hasValueChanged(c,e,n)>0){a.destroy(e,n),o.removeAttribute(r);const c=Xt(t);return c.isAttr=!0,c.processInitAttribute(r,t,o,c,e,n,s),void(e.tagJsVar=c)}}function Dt(t,e,n,o,r,s,a){o.destroy=Ht,o.hasValueChanged=Rt,o.processUpdate=(e,o,r)=>jt(e,o,r,n,t,a);const c=yt(t);Pt(t,e,n,a,c,r),r.tagJsVar=o}function Ht(t){const e=t.element,n=t.attrName;e.removeAttribute(n)}function Nt(t){return{tagJsType:"simple",value:t,processInitAttribute:Dt,processInit:$t,destroy:Wt,hasValueChanged:Bt,processUpdate:Ut}}function Ut(t,e,n){return t===e.value?0:fr(e,t,n)}function $t(t,e,n,o,r){const s=bt(t);o=e.placeholder;const a=e.paint=[C,[o,s,function(t){e.simpleValueElm=t,delete e.paint},"processSimpleValueInit"]];u.push(a)}function Wt(t){if(!t.simpleValueElm&&t.paint)return void(t.paint[0]=a);const e=t.simpleValueElm;delete t.simpleValueElm,m(e,"deleteSimpleValue")}function Rt(t,e){return null==t||t===e.value?0:6}function Bt(t,e){return null!=t&&typeof t===I.object?(Wt(e),6):(function(t,e){const n=bt(t);if(e.paint)return void(e.paint[1][1]=n);const o=e.simpleValueElm;l.push([g,[n,o]])}(t,e),0)}function Ft(t,e){return D(t)?0:(ne(e),9)}function _t(t){return{tagJsType:"array",value:t,processInitAttribute:a,processInit:Gt,processUpdate:zt,hasValueChanged:Ft,destroy:ne}}function zt(t,e,n){if(++e.updateCount,Array.isArray(t))return void Zt(e,t,n);0===ht(t,e,n)&&Zt(e,t,n)}function Gt(t,e,n,o,r){Zt(e,t,n,r)}function Xt(t){const e=t?.tagJsType;return e?t:function(t){if(D(t))return _t(t);return Nt(t)}(t)}function Kt(t,e,n,o){return{updateCount:0,value:t,destroy$:new q,render$:new q,tagJsVar:Xt(t),withinOwnerElement:n,parentContext:o,valueIndex:o.varCounter}}function qt(t,e,n,o,r){const s=document.createTextNode(J),a=Kt(t,0,!0,e.context);return a.withinOwnerElement=!1,a.placeholder=s,r||(a.placeholder=o),mt(t,e,a,r,o),r&&p.push([v,[r,s]]),a}function Zt(t,e,n,o){const r=void 0===t.lastArray;r&&(t.lastArray=[]);const s=t.lastArray;let a=t.placeholder,c=0;const u=[];if(!r){for(let t=0;t<s.length;++t){const n=s[t],o=te(e,t,s,c);0!==o?2!==o?c+=o:t-=1:u.push(n)}t.lastArray=u}const i=e.length;for(let r=0;r<i;++r){a=Yt(e,r,t.lastArray,n,a,o).placeholder}}function Yt(t,e,n,o,r,s){const a=Qt(t[e]),c=n[e];if(c)return function(t,e,n,o,r,s,a){const c=n.length>r;if(c)return Array.isArray(t)?(e.tagJsVar.processUpdate(t,e,o,[]),e.value=t,e):(ht(t,e,o),e);const u=qt(t,o,0,s,a);return n.push(u),u}(a,c,n,o,e,r,s);const u=qt(a,o,0,r,s);return n.push(u),u}function Qt(t){if("function"==typeof t&&void 0===t.tagJsType){t=t()}return t}function te(t,e,n,o){const r=t.length-1,s=e-o,a=s<0||r<s,c=n[e];if(a)return ee(c),1;const u=function(t,e,n,o,r){const s=e&&t!==e.arrayValue;if(s)return ee(n),o.splice(r,1),2;return 0}(c.value.arrayValue,Qt(t[e]),c,n,e);return u}function ee(t){!function(t,e){if(t&&e.state?.oldest){return void ue(e.state.oldest,t)}e.tagJsVar.destroy(e,{})}(t.global,t)}function ne(t){++t.updateCount;oe(t,t.lastArray)}function oe(t,e){for(let t=0;t<e.length;++t)ee(e[t]);delete t.lastArray}function re(t){for(let e=t.length-1;e>=0;--e){se(t[e]),t.splice(e,1)}}function se(t){const e=t.marker;e&&m(e,"destroyMarker");m(t.domElement,"destroyClone")}function ae(t,e){!function(t,e){for(const n of t){if(n.withinOwnerElement){const t=n.tagJsVar;if(t&&"host"===t.tagJsType){const o=n.supportOwner,r=t.destroy(n,o);L(r)&&e.push(r)}continue}const t=n.lastArray;if(t){oe(n,t);continue}const o=n.simpleValueElm;if(o){delete n.simpleValueElm,m(o,"smartRemoveByContext");continue}const r=n.global;if(void 0===r)continue;r.deleted=!0;const s=n.state?.oldest;s&&ae(n,e)}}(t.contexts,e),ce(t)}function ce(t){re(t.htmlDomMeta)}function ue(t,e){const n=t.context;e.deleted=!0,n.renderCount=0;const o=[];return ft(n.contexts,t),t.templater.wrapper&&pt(t,e),ae(n,o),delete n.state,delete n.contexts,delete n.returnValue,delete n.providers,o}function ie(t,e){const n=le(t,e);return!(n||!e.templater.tag?._innerHTML||!le(t.outerHTML,e))||n}function le(t,e){const n=t.templater,o=e.templater,r=n?.tag||t,s=o.tag;if(n?.tagJsType===S.stateRender)return n.dom===o.dom;switch(r.tagJsType){case S.dom:return s?.tagJsType===S.dom&&function(t,e){const n=t.dom,o=e.dom;return n===o}(r,s);case S.tag:{const n=function(t,e,n,o){const r=t.strings,s=e.strings;if(r.length!==s.length)return!1;if(!r.every(((t,e)=>s[e].length===t.length)))return!1;const a=n.templater.values||t.values,c=o.templater.values||e.values;return function(t,e){const n=t.length===e.length;if(!n)return!1;const o=e.every((function(e,n){const o=t[n];if(typeof e===I.function&&typeof o===I.function){return!!(e.toString()===o.toString())}return!0}));if(o)return!0;return!1}(a,c)}(r,s,t,e);return n}}throw new Error(`unknown tagJsType of ${r.tagJsType}`)}function pe(t){++t.updateCount;const e=t.global;ue(t.state.newest,e),function(t){t.htmlDomMeta=[],delete t.contexts,delete t.state,delete t.global,t.renderCount=0}(t)}function fe(t,e){const n=e.state?.newest;if(A(t)){return ie(t,n)?0:7}const o=t?.tagJsType;return o?t.wrapper?.original===e.value.wrapper?.original?0:88:8}function de(t,e){const o=e.global,r=e.state?.newest;if(A(t)){return ie(t,r)?(lr(e,t,r),0):(ue(r,o),n(e),7)}const s=t?.tagJsType;if(s){return!0===lr(e,t,e.state.newest.ownerSupport)?0:88}return pe(e),8}function ge(t,e,n,o,r,s,a){const c=document.createTextNode(J),i=function(t,e,n,o){const r=Kt(t,0,n,o);return e.push(r),++o.varCounter,r}(t,e,r>0,o);return i.placeholder=c,i.element=s,s?p.push([v,[s,c]]):u.push([y,[a,c,"attachDynamicDom.attachDynamicDom"]]),mt(t,n,i,s,a),i}function he(t,e){const n=function(t,e,n=[]){const o=t.context;n.push({support:t,renderCount:o.renderCount,provider:e});const r=e.children;for(let t=r.length-1;t>=0;--t){const o=r[t],s=o.context;n.push({support:o,renderCount:s.renderCount,provider:e})}return n}(t,e);return n}function me(t){return t.support}function be(t){const e=t.context;return Pe(t.templater)?De(t):Le(t,t,e)}function ye(t,e,n){return t}function ve(t){return typeof t!==I.object||!t||t.tagJsType}function xe(t,e,n,o,r,s){return null==t||s>r?e:typeof t===I.function?e.mem?(t.mem=e.mem,e):(t.mem=e,t):ve(e)?e:D(e)?function(t,e,n,o,r,s){for(let a=t.length-1;a>=0;--a){const c=t[a],u=e[a];t[a]=xe(u,c,n,o,s,r+1)}return t}(e,t,n,o,s,r):function(t,e,n,o,r,s){const a=Object.keys(t);for(const c of a){const a=t[c],u=xe(e[c],a,n,o,s,r+1);if(a===u)continue;const i=Object.getOwnPropertyDescriptor(t,c)?.set;i||(t[c]=u)}return t}(e,t,n,o,s,r)}function we(t,e,o){const r=o.global,s=o.state.newest,a=s.templater.wrapper;let c=e.templater.wrapper,u=!1;const i=e.templater.tagJsType,l=S.stateRender===i||S.renderOnce===i;if(l)u=e.templater.tagJsType===S.renderOnce||ie(s,e);else if(a&&c){const t=s.templater.tag?._innerHTML;t&&(c=e.outerHTML);u=a.original===c.original}const p=e.templater;if(!u)return void function(t,e,o){const r=t.global;ue(t.state.oldest,r),n(t),e.processInit(e,t,o,t.placeholder)}(o,p,t);const f=l||function(t,e){const n=e.props,o=t.propsConfig,r=o.latest,s=Qo(n,r,t.templater.propWatch);return s}(s,p);if(f)o.locked?r.blocked.push(e):(je(e),++o.renderCount);else{!function(t,e,n,o,r){const s=t.props,a=Ce(e,n,o,s,r),c=e.propsConfig;c.castProps=a;const u=n.propsConfig;u.latest=c.latest}(p,e,s,t,p.propWatch===Zo.DEEP?or:nr)}}function Ce(t,e,n,o,r,s=-1){const a=e.context;if(!a.global||!a.state.newest){const e=ye(o);o.push(...e);return t.propsConfig.castProps=e,o}const c=(e=a.state.newest||e).propsConfig.castProps,u=[];for(let e=0;e<o.length;++e){const a=o[e],i=xe(c[e],a,t,n,r,s+1);u.push(i)}return t.propsConfig.castProps=u,u}function Te(t){const e=t.context,o=e.global,{subs:r,tags:s}=dt(e.contexts);Ve(e);for(const t of s){if(!0===t.context.global.deleted)return;Ve(t.context)}o.subscriptions&&r.forEach(gt),n(e)}function Ve(t){t.global.deleted=!0,ae(t,[]),delete t.contexts}function Je(t,e,n,o){const r=e.original,a=t.tagJsType===S.stateRender,c=tt.stateConfig;let u;return s(n),a?u=t():(u=r(...o),typeof u===I.function&&void 0===u.tagJsType&&(u=u())),n.context.returnValue=u,n.returnValue=u,u.templater=t,t.tag=u,n.context.state.newer={...c},qr(),n}function ke(t){!function(t){const e=tt.stateConfig,n=t||e.context;n.state=n.state||{},n.state.newer={...e};const o=e.support;n.state.newest=o}(t),function(){const t=tt.stateConfig;delete t.prevSupport,delete t.support,delete t.state,delete t.states,qr()}()}function Ie(t,e,n,o){let r;const s=t.templater;if(s.tagJsType===S.stateRender){const e=s;r=ir(s,n,o,t.appSupport),Je(s,e,r)}else{r=(0,s.wrapper)(t,n,e)}return function(t,e){++t.context.renderCount,ke(t.context),tt.tagClosed$.next(e)}(r,o),r.ownerSupport=t.ownerSupport,r}function Se(t){const e=tt.stateConfig;return e.rearray=t,e.state=[],e.states=[],e.statesIndex=0,e.handlers.handler=_,e.handlers.statesHandler=W,e}function Ee(t,e,n,o){return function(t,e,n){Se(n),tt.stateConfig.prevSupport=e,s(t)}(t,e,n.state.older.state),Ie(t,e,n,o)}function Ae(t,e,n,o){R(t.context),s(t);const r=Ie(t,e,n,o);return qr(),r}function Me(t){const e=t?.context,n=e?.state;return n?.older?.state}function Oe(t,e,n){let o;o=Me(e)?Ee(t,e,n):Ae(t,e,n);const r=!e||ie(e,o);if(r){if(e){const t=e.templater.tag;if(t&&n.renderCount>0){const n=e?.templater,o=n?.tag;!function(t,e,n){if(t.tagJsType===S.dom){const o=n?.dom;return void(o!==t.dom&&Te(e))}if(n){const o=n.strings;if(o){const n=o?.length;n!==t.strings.length&&Te(e)}}}(t,e,o)}}}else{!function(t,e){const n=t.context,o=n.global;let r=-1;const s=n.providers=n.providers||[],a=s.length-1;for(;r++<a;){const t=s[r];let n=-1;const a=t.children.length-1;for(;n++<a;)if(o===t.children[n].context.global)return t.children.splice(n,1),void t.children.push(e)}}(e,o),Te(e);const t=o.context;t.state.oldest=o,t.state.newest=o}return o.ownerSupport=t.ownerSupport,{support:o,wasLikeTags:r}}function Le(t,e,n){const o=Oe(e,t,n);if(o.wasLikeTags){return nt(n.state.oldest,o.support),o.support}return Yn(e,n)}function Pe(t){return S.templater===t.tagJsType}function je(t){const e=t.context,n=e.global,o=Pe(t.templater);if(e.locked)return n.blocked.push(t),t;if(o){return De(t)}e.locked=4,n.blocked.length&&(t=n.blocked.pop(),n.blocked=[]);const r=Le(e.state.newest,t,e);return delete e.locked,r}function De(t){return je(N(t).context.state.newest)}function He(t,e){const n=e.context.global;if(n&&n.deleted)return!1;const o=function(t,e){const n=t.props,o=e.propsConfig,r=o.latest;if(Ne(n,r))return!0;switch(t.propWatch){case Zo.IMMUTABLE:return er(n,r);case Zo.SHALLOW:return it(n,r)}return!st(n,r,or)}(t,e);return!!o}function Ne(t,e){return t.length!==e.length}function Ue(t,e=[]){const n=t.context,o=Pe(t.templater),r=t.ownerSupport;if(n.locked)return e.push(t),e;if(o)return Ue(r,e);const s=t.context.global;if(s&&!0===s.deleted)return e;const a=t,c=M(a.templater),u=t.templater.tagJsType,i=r&&u!==S.stateRender&&(!c||He(a.templater,a));if(a.context.providers){const t=function(t){const e=t.context.providers;if(!e)return[];const n=[];for(const t of e){const e=he(t.owner,t);n.push(...e.map(me))}return n}(a);e.push(...t)}return i?(Ue(r,e),c&&e.push(a),e):(e.push(a),e)}function $e(t){++d.locks,t.forEach(We),--d.locks,h()}function We(t){const e=t.context;if(!e.global)return void e.tagJsVar.processUpdate(e.value,e,t.ownerSupport,[]);je(e.state.newest)}function Re(t,e){for(let n=0;n<t.length;++n){ze(t[n],e[n])}}let Be;function Fe(...t){return Be=t,t}function _e(){return Be}function ze(t,e){t(Fe,1),e(_e,2)}function Ge(t,e,n,o){for(let n=t.length-1;n>=0;--n){const o=t[n].get(),r=e[n].callback;r&&r(o)}for(let t=o.length-1;t>=0;--t){Ke.length=0,Xe=0;(0,o[t])(qe),n[t](Ze)}}let Xe=0;const Ke=[];function qe(...t){return Ke.push(t),t}function Ze(...t){return Ke[Xe++]}function Ye(t,e,{resolvePromise:n,resolveValue:o}){if(L(t)){return e.context.locked=2,t.then(function(t,e){return n=>{const o=t.context,r=o.global;if(delete o.locked,!0===o.deleted||!0===r?.deleted)return e(n);!function(t,e){const n=t.context.state,o=e.context.state;Re(n.newer.states,o.newer.states)}(t,o.state.newest);return $e(Ue(t)),e(n)}}(e,n))}return o(t)}function Qe(t,e){const n=e.context.global,o=function(t,e){if(!0!==n.deleted)return function(t,e,n,o){const r=N(e),s=r.context;s.locked=1;const a=t.apply(n,o);delete s.locked;return tn(a,r)}(o.tagFunction,o.support,t,e)};return o.tagFunction=t,o.support=e,o}function tn(t,e){const n=e.context.global;if(n?.deleted)return;return $e(Ue(e)),Ye(t,e,{resolvePromise:on,resolveValue:rn})}const en="no-data-ever",nn="promise-no-data-ever";function on(){return nn}function rn(){return en}function sn(t,e,n){const o=n[e];if(o){let e=!1;if(t.originalStopPropagation=t.stopPropagation,t.stopPropagation=function(){e=!0,t.originalStopPropagation.call(t),t.stopPropagation=t.originalStopPropagation,delete t.originalStopPropagation},o(t),t.defaultPrevented||e)return}const r=n.parentNode;r&&sn(t,e,r)}function an(t,e,n,o){const r=t.appElement,s=function(t){"blur"===t&&(t="focusout");return"_"+t}(e);"blur"===e&&(e="focusout");const a=t.context.events;if(!a[e]){const t=function(t){sn(t,s,t.target)};a[e]=t,r.addEventListener(e,t)}n[s]=o,n[e]=o}function cn(t,e,n,o){const r=function(...e){return r.tagFunction(t,e)};r.tagFunction=e,r.support=n,an(n.appSupport,o,t,r)}function un(t){return null==t||!1===t}function ln(t,e,n,o,r,s,a){if(un(e))return;const c=[];if(typeof e===I.object){for(const r in e){const u=yt(r),i=vn(r,e[r],t,n,o,St,s,a,u);void 0!==i&&(Array.isArray(i)?c.push(...i):c.push(i))}return c}0!==e.length&&r(n,e,J)}function pn(t,e){t.removeAttribute(e)}function fn(t,e,n,o){const r=e,s=t;if(s?.tagJsType){const o=e.value;return o?.tagJsType?void o.hasValueChanged(s,e,n):(s.isAttr=!0,Kr(e),s.processInitAttribute(r.attrName,t,r.element,s,r,n,St),qr(),void(r.tagJsVar=s))}if(r.isNameOnly)return function(t,e,n,o,r,s,a,c){if(n){if(un(e)||""===e)return void o.removeAttribute(n);if(typeof n===I.object)if(typeof e===I.object)for(const t in n)t in e||l.push([pn,[o,t]]);else for(const t in n)l.push([pn,[o,t]])}const u=ln(t,e,o,r,s,a,c);u&&a.push(...u)}(o,t,r.value,r.element,n,r.howToSet,[],r.parentContext),void(r.value=t);const a=r.element;!function(t,e,n,o,r,s,a){if(P(t))return function(t,e,n,o,r,s,a){const c=t.templater.wrapper;if((c?.tagJsType||c?.original?.tagJsType)!==S.renderOnce)return wn(e,t,o,n);return xn(e,n,o,r,s,t)}(r,t,o,e,a,s);xn(t,o,e,a,s,r)}(t,r.attrName,0,a,n,r.howToSet,r.isSpecial),e.value=t}const dn=":tagvar",gn=":",hn=new RegExp(dn+"(\\d+)"+gn,"g");function mn(t){return t.search&&t.startsWith(dn)?t.search(hn):-1}function bn(t,e,n,o,r,s,a){const c=o.length,u=[];function i(o){const s=function(t,e,n){return t.reduce(((t,o)=>{if(mn(o)>=0){const o=n++,r=e[o];return t.push(r),t}return t.push(o),t}),[])}(e,o,c).join("");r(n,t,s)}return e.forEach((e=>{if(mn(e)>=0){const r=o.length,c=Xt(e),l={updateCount:0,isAttr:!0,element:n,attrName:t,withinOwnerElement:!0,tagJsVar:c,valueIndex:a.varCounter,parentContext:a,destroy$:new q,render$:new q};c.processUpdate=function(t,e,n,o){++e.updateCount,i(o)};const p=s[r];l.value=p,u.push(l),++a.varCounter}})),i(s),u}function yn(t){return j(t)&&"tagJsVar"in t?t.tagJsVar:-1}function vn(t,e,n,o,r,s,a,c,u){const i=yn(t);let l=i>=0||void 0===e&&"string"!=typeof t,p=n[i];e?.tagJsType?p=e:t?.tagJsType&&(l=!0,p=t,e=t);const f=p;if(f?.tagJsType)return function(t,e,n,o,r,s,a,c,u){const i=Kt(t,0,!0,n);return i.element=c,i.valueIndex=r,i.isAttr=!0,i.isNameOnly=u,i.stateOwner=N(s),i.supportOwner=s,Kr(i),o.processInitAttribute(a,t,c,o,i,s,St),qr(),i.oldTagJsVar=i.tagJsVar,i.tagJsVar=o,i}(e,0,c,f,i,r,t,o,l);if(l){-1===i&&l&&(p=t);const e=Kt(p,0,!0,c);e.valueIndex=i,e.isAttr=!0,e.element=o,e.isNameOnly=!0,e.howToSet=s;e.tagJsVar.processUpdate=fn;const u=ln(n,p,o,r,s,a,c);return u&&a.push(...u),e}if(Array.isArray(e))return bn(t,e,o,[],s,n,r.context);const d=yn(e);if(d>=0){return function(t,e,n,o,r,s,a,c,u){if(typeof e===I.function)return++r.varCounter,wn(e,a,t,n);const i=Xt(e),l={updateCount:0,isAttr:!0,element:n,attrName:t,howToSet:s,value:e,withinOwnerElement:!0,tagJsVar:i,destroy$:new q,render$:new q,valueIndex:u,parentContext:r};return o.push(l),i.processUpdate=fn,Lt(t,e,l,n,s,a,c),l.value=e,l}(t,n[d],o,[],c,s,r,u,d)}return Pt(t,e,o,s,u,c)}function xn(t,e,n,o,r,s){if(!1===o){switch(t){case void 0:case!1:case null:return void l.push([Cn,[e,n]])}if(P(t))return cn(e,t,s,n);r(e,n,t)}else vt(n,t,e,o)}function wn(t,e,n,o){return cn(o,t=Qe(t,e),e,n)}function Cn(t,e){t.removeAttribute(e)}function Tn(t,e,n,o,r){for(const s of t){const t=s[0],a=s[1],c=s[2]||!1;let u=s.length>1?St:It;s[3]&&(u=s[3]);const i=r.contexts,l=vn(t,a,e,n,o,u,i,r,c)||void 0;"object"==typeof l&&(i.push(l),++r.varCounter)}}function Vn(t,e,n,o,r,s,a){e.at&&Tn(e.at,n,t,o,r),s?p.push([v,[s,t,"appendToAttachDomElement"]]):u.push([y,[a,t,"insertBeforeAttachDomElement"]])}function Jn(t,e,n,o,r,s,a){const c=n.context,u=c.contexts;o=c;const i=[];s&&void 0===a&&(a=document.createTextNode(J),p.push([v,[s,a]]),s=void 0);for(let c=0;c<t.length;++c){const l=t[c],p=l.v;if(!isNaN(p)){const t=Number(p),c=e[t];if(P(c)&&void 0===c.tagJsType){++o.varCounter;continue}ge(c,u,n,o,r,s,a).valueIndex=t;continue}const f={};if(i.push(f),"text"===l.nn){kn(f,l,s,a);continue}const d=f.domElement=document.createElement(l.nn),g={updateCount:0,isAttrs:!0,element:d,parentContext:o,contexts:[],destroy$:new q,render$:new q,tagJsVar:{tagJsType:"new-parent-context"},valueIndex:-1,withinOwnerElement:!0,varCounter:0};Vn(d,l,e,n,g,s,a),g.element=d,l.ch&&(f.ch=Jn(l.ch,e,n,g,r+1,d,a).dom)}return{dom:i,contexts:u}}function kn(t,e,n,o){const r=t,s=r.tc=e.tc;n?p.push([V,[n,s,function(t){r.domElement=t}]]):u.push([T,[o,s,function(t){r.domElement=t}]])}const In=/(:tagvar\d+:)/,Sn="ondoubleclick",En=/([:_a-zA-Z0-9\-.]+)\s*(?:=\s*"([^"]*)"|=\s*(\S+))?/g,An=/<\/?([a-zA-Z0-9-]+)((?:\s+[a-zA-Z_:*][\w:.-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)+\s*|\s*)\/?>/g;function Mn(t){const e=[],n=[],o=[];let r=null,s=-1,a=0;const c=new RegExp(An,"g");for(t=function(t){return t.replace(On,(function(t){return t.replace(/\[l t\]/g,"[l&nbsp;t]").replace(/\[g t\]/g,"[g&nbsp;t]").replace(/</g,"[l t]").replace(/>/g,"[g t]")}))}(t);a<t.length;){const u=c.exec(t);if(!u)break;const[i,l,p]=u,f=i.startsWith("</"),d=i.endsWith("/>");if(a<u.index){const e=t.slice(a,u.index);if(e.trim()){const t=jn(e);for(let e of t)e.startsWith(dn)&&e.search(In)>=0&&-1===e.search(Wn)&&(e=dn+ ++s+gn),Ln(r,n,e)}}if(a=u.index+i.length,f){r=o.pop()||null;continue}const g=[];let h;for(;null!==(h=En.exec(p));)s=Hn(h,s,e,g);const m={nn:l};g.length&&(m.at=g),r?(r.ch||(r.ch=[]),r.ch.push(m)):n.push(m),d||(o.push(r),r=m)}if(a<t.length){const e=t.slice(a);if(e.trim()){const t=jn(e);for(const e of t)e.startsWith(dn)&&++s,Ln(r,n,e)}}return n}const On=new RegExp("(\x3c!--[\\s\\S]*?--\x3e)","g");function Ln(t,e,n){!function(t,e,n){t?(t.ch||(t.ch=[]),t.ch.push(n)):e.push(n)}(t,e,{nn:"text",tc:Pn(n)})}function Pn(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&nbsp;t\]/g,"[l t]").replace(/\[g&nbsp;t\]/g,"[g t]")}))}function jn(t){return t.split(In).filter(Dn)}function Dn(t){return""!==t}function Hn(t,e,n,o){const r=t[1]||t[3]||t[5];let s=t[2]||t[4]||t[6];if(void 0===r)return e;const a=""!==t[2],c=void 0===s&&a,u=r.toLowerCase(),i=u.startsWith("on")?function(t){if(t.startsWith("on"))return t.length===Sn.length&&t===Sn?"dblclick":t.slice(2,t.length);return t}(u):u;if(c){if(r.slice(0,dn.length)===dn){const t=dn+ ++e+gn;return n.push(["at",t]),o.push([t]),e}if(t[0].startsWith(r)&&t[0].slice(r.length,t[0].length).search(/\s+$/)>=0)return o.push([i]),e;const a=t[3];if(a.search(Wn)>=0){s=a;const t=[i,s];return o.push(t),e}s=dn+ ++e+gn}a||(s=t[2]);const l=s.split(Un).filter((t=>t.length>0));l.length>1&&(s=l,l.forEach((t=>{t.search(hn)>=0&&++e})));const p=[i,s],f=yt(u);return f&&p.push(f),"style"===i?(o.unshift(p),e):(o.push(p),e)}const Nn=new RegExp(dn+"(\\d+)"+gn,"gi"),Un=new RegExp("("+dn+"\\d+"+gn+")","gi"),$n=dn.slice(0,dn.length-1),Wn=new RegExp($n+"&#x72;(\\d+)"+gn,"gi"),Rn=$n+"&#x72;$1"+gn;function Bn(t,e){const n=function(t,e){const n=t;return function(t,e){const n=[];for(let o=0;o<t.length;++o){const r=t[o].replace(Nn,Rn);o<e.length?n.push(r+dn+o+gn):n.push(r)}return function(t,e,n){const o=n.length-e.length;if(o>0)for(let n=o;n>0;--n)t.push(dn+(e.length+n-1)+gn)}(n,t,e),n}(n,e)}(t,e).join("");return Mn(n)}const Fn="ch";function _n(t,e,n=[],o=[]){const r=t;for(let t=0;t<r.length;t++){const s=[...o,t],a=r[t];if(a.at){const t=a.at;a.at=Gn(t,e)}if(a.ch){const t=a.ch,o=[...s,Fn];a.ch=_n(t,e,n,o)}t=zn(a,e,r,t)}return r}function zn(t,e,n,o){if("text"!==t.nn)return o;const r=t;let s,a=r.tc;if(typeof a!==k.string)return o;for(;null!==(s=hn.exec(a));){const t=s[1],r=parseInt(t,10);if(!isNaN(r)&&r<e){const t=dn+r+gn,e=a.slice(s.index+t.length);n.splice(o,1,{nn:"text",v:r}),a=e,hn.lastIndex=0}}return r.tc=a,o}function Gn(t,e){const n=[];for(const o of t){const[t,r,s]=o;if(t.startsWith(dn)){const o=parseInt(t.replace(dn,""),10);if(!isNaN(o)&&o<e){n.push([{tagJsVar:o}]);continue}}if(typeof r===k.string&&r.startsWith(dn)){const o=parseInt(r.replace(dn,""),10);if(!isNaN(o)&&o<e){n.push([t,{tagJsVar:o},s]);continue}}n.push(o)}return n}function Xn(t){return t.length}const Kn={};function qn(t,e){const n=function(t){const e=t.map(Xn);return e.push(t.length),Number(e.join(""))}(t),o=Kn[n],r=o&&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,o);if(r)return o.domMetaMap;const s=_n(Bn(t,e),e.length),a={interpolation:void 0,string:void 0,strings:t,values:e,domMetaMap:s};return Kn[n]=a,s}function Zn(t,e,n){const o=t.context;o.state=o.state||{};const r=o.state;r.oldest=t,r.newest=t,o.state.older=o.state.newer,++d.locks;const s=function(t,e,n,o){const r=function(t){const e=t.templater,n=e.tag;if(n.tagJsType===S.dom)return n.dom;const o=n.strings;return qn(o,n.values)}(t),s=t.templater.tag,a=s.values,c=[],u=t.context;e=u,u.contexts=c;const i=Jn(r,a,t,e,0,n,o);return i}(t,t.context,e,n);return o.htmlDomMeta=s.dom,--d.locks,s}function Yn(t,e){const n=e.state.newest,o=e.placeholder;return n.ownerSupport=t,Zn(n,void 0,o),n}function Qn(t){const e={tagJsType:S.templater,processInitAttribute:a,processInit:no,processUpdate:a,hasValueChanged:de,destroy:a,propWatch:"shallow",key:a};return e.tag=t,t.templater=e,e}function to(t,e,n){const o=ur(t,e,e.appSupport,n);return n.contexts=n.contexts||[],o}function eo(t,e,n,o,r){const s=to(t,n,e);s.ownerSupport=n;const a=Zn(s,o,o?void 0:r);for(const t of a.dom)t.marker&&(o?p.push([v,[o,t.marker]]):u.push([y,[r,t.marker,"subMarker"]])),t.domElement&&(o?p.push([v,[o,t.domElement,"subAppendTo"]]):u.push([y,[r,t.domElement,"subInsertBefore"]]));return s}function no(t,e,n,o,r){return e.state={},r?eo(t,e,n,r,o):Yn(n,e)}function oo(t,e){const n={tagJsType:S.templater,processInit:no,processInitAttribute:a,processUpdate:ht,hasValueChanged:de,destroy:pe,propWatch:t,props:e,key:function(t){return n.arrayValue=t,n},matchesInjection:(t,e)=>n.wrapper===t||n.wrapper?.original===t?.original?e:void 0};return n}const ro=[];function so(t,e,n){const o=t.propWatch===Zo.DEEP?or:nr,r=t.props,s=e.propsConfig;let a=s.castProps;const c=n?.propsConfig,u=c?.castProps;u&&(s.castProps=u,a=Ce(e,n,n.ownerSupport,r,o));return a||ye(r)}function ao(t,e,n){const o=oo(Zo.DEEP);o.tagJsType=t.tagJsType;const r=to(o,n,e);function s(){return o.tag=t(),r}return o.wrapper=s,s.tagJsType=t.tagJsType,s.original=t.original||t,r}function co(t,e,o,r,s){n(e);const a=ao(t,e,o);return Ae(a,void 0,e),eo(a.templater,e,o,s,r)}function uo(t,e,n,o,r){const s=hr(t,e,n,o,r);return s.hasEmitted||io(t,s),s}function io(t,e){const n=t.Observables[0];if(!e.hasEmitted)return"withDefault"in t?void e.subValueHandler(t.withDefault,0):"value"in n?void e.subValueHandler(n.value,0):void 0;const o=e.lastValues[0].value;e.subValueHandler(o,0)}function lo(t,e,n,o,r,s){e.destroy=br;const a=yt(t),c=function(e,o){Pt(t,e,n,St,a,r),vr(o)},u=mr(e.Observables,s,c,e,r);return r.subContext=u,r.value=e,r.tagJsVar=e,e.processUpdate=function(e,o,s){return jt(e,r,s,n,t,St)},{subContext:u,onOutput:c}}function po(t,e,n,o,r,s){const{subContext:a}=lo(t,e,n,0,r,s);a.hasEmitted||function(t,e){const n=e.tagJsVar,o=n.onOutput,r=t.Observables;let s=r[0]?.value||t.withDefault;t.callback&&(s=t.callback(s));o(s,!0,e)}(e,a)}function fo(t,e,n){return{onOutput:a,tagJsType:S.subscribe,processInitAttribute:po,processInit:uo,hasValueChanged:go,processUpdate:a,destroy:yr,callback:n,withDefault:e,Observables:[t]}}function go(t,e){if(!t?.tagJsType)return 1;const n=t.Observables;if(!n)return 2;const o=e.value.Observables;if(!o||o.length!==n.length)return 3;return n.every(((t,e)=>t===o[e]))?0:4}function ho(t,e,n,o){if(!e||!e.tagJsType||e.tagJsType!==t){return o.tagJsVar.destroy(o,n),pr(e,o,n,99),99}}function mo(t,e,n){const o=e.subContext,r=ho(S.subscribe,t,n,e);return r||(o&&o.hasEmitted?(o.tagJsVar=t,o.valuesHandler(o.lastValues,0),0):0)}function bo(t,e){return{onOutput:a,tagJsType:S.subscribe,processInitAttribute:lo,processInit:hr,hasValueChanged:go,processUpdate:mo,destroy:yr,callback:e,Observables:[t]}}function yo(t,e){++t.updateCount;const n=vo(t.subContext,e);return delete t.subContext,n}function vo(t,e){t.deleted=!0;const n=t.appendMarker;if(n&&(m(n,"deleteSubContext"),delete t.appendMarker),!t.hasEmitted)return;const o=t.contextItem;return o.tagJsVar.destroy(o,e),76}function xo(t,e,n,o){return e.hasEmitted=!0,e.contextItem=qt(t,n,0,o)}function wo(t,e,n){++e.updateCount;const o=t.owner._innerHTML;o.processInit=o.oldProcessInit;const r=e.subContext?.contextItem;fr(r,o,n)}function Co(t,e,n,o,r){e.subContext={},t.processUpdate=wo,function(t,e,n,o,r){const{appendMarker:s,insertBefore:a}=dr(r,o),c=n.subContext;c.appendMarker=s;const u=t.owner,i=u._innerHTML;i.processInit=i.oldProcessInit,xo(i,c,e,a)}(t,n,e,o,r)}function To(){return{tagJsType:"innerHTML",hasValueChanged:()=>0,processInitAttribute:a,processInit:Co,processUpdate:wo,destroy:yo}}function Vo(t,e){return{onOutput:a,tagJsType:S.subscribe,processInitAttribute:a,hasValueChanged:go,processInit:Jo,processUpdate:a,destroy:yr,callback:e,Observables:t}}function Jo(t,e,n,o,r){return hr({tagJsType:S.subscribe,states:[],Observables:t},e,n,void 0,r)}function ko(t){if(!t)return a;const e=Gr();if(!e)throw new Error("output must be used in render sync with a parent context");const n=H(e);if(!n)throw new Error("output must be used in render sync fashion");if(!0===t.wrapped)return t;const o=(...e)=>{const o=n.ownerSupport;return Io(e,t,o.context)};return o.wrapped=!0,o}function Io(t,e,n){const o=n.state,r=o.newer.states,s=o.older?o.older.states:r,a=o.newest;Re(r,s);const c=e(...t);return Re(s,r),f.push([()=>{const t=a.context.global;if(void 0===t||!0===t.deleted)return++d.locks,a.context.tagJsVar.processUpdate(a.context.value,a.context,a,[]),--d.locks,void h();++d.locks,be(a),--d.locks,h()},[]]),c}function So(t,e={}){const n={tagJsType:S.host,processInitAttribute:Ao,hasValueChanged:()=>0,processInit:Mo,processUpdate:Eo,destroy:Oo,options:{callback:t,...e},matchesInjection(e,n){const o=e?.options;if(!o)return!1;const r=o?.callback;return r===t&&n}},o=(...n)=>({...o,options:{arguments:n,...e,callback:t}});return Object.assign(o,n),o}function Eo(t,e,n){if(P(t)&&!t?.tagJsType)throw new Error("issue on its way");const o=ho(S.host,t,n,e);if(o)return o;const r=e.tagJsVar.options,s=t;var a;Kr(a=e),Se(a.state.newer.state);const c=s.options.arguments||r.arguments||[];e.returnValue=s.options.callback(...c),ke(e)}function Ao(t,e,n,o,r){return Mo(o,r)}function Mo(t,e){const n=e.element,o=e.state={};R(e),function(t,e,n,o){const r=e.options.arguments||[],s=e.options.callback(...r);n.returnValue=s;const a=e.options;a.onInit&&a.onInit(t,e,n,o)}(n,t,e,o),ke(e)}function Oo(t){++t.updateCount;const e=t,n=e.tagJsVar,o=n.options;if(e.destroy$.subscribers.length&&(Kr(t),Io([],e.destroy$.next.bind(e.destroy$),t),qr()),o.onDestroy){const r=e.element;return Io([],(function(){Kr(t);const s=o.onDestroy(r,n,e,e.state);return qr(),s}),t.stateOwner.context)}}function Lo(t,e,n,o){const r={tagJsType:"tag-conversion",processInitAttribute:a,processInit:(r,s,a)=>{const c=t.returnValue;return e.tagJsVar.processInit(c,e,n,o.placeholder)},processUpdate:(t,o,s)=>{if(o.locked||o.deleted)return;++o.updateCount;const a=o.value.tagJsType,c=t?.tagJsType,u=c!==a;if(fe(t,o)||u||r.hasValueChanged(t,o,n))return r.destroy(o,n),void pr(t,o,s,789);o.locked=467,o.render$.next();const i=o.returnValue;!function(t,e,n,o,r){const s=ye(e.props);t.value.props=s;const a=r.propsConfig;a&&(a.castProps=s);if(t.updatesHandler=n.updatesHandler,n.updatesHandler){Kr(n);(0,n.updatesHandler)(s),qr()}t.tagJsVar.processUpdate(o,t,r,[]),t.value=o}(e,t,o,i,n),delete o.locked},hasValueChanged:(n,o,r)=>{const s=t.returnValue;return e.tagJsVar.hasValueChanged(s,e,r)},destroy:(o,r)=>{++t.updateCount,t.deleted=!0,delete t.returnValue;const s=e.tagJsVar.destroy(e,n);return L(s)?s.then((()=>{const e=Ho(t,r);return h(),e})):Ho(t,r)}};return r}function Po(t,e,n){const o=t.context,r=t.returnValue,s=Xt(r);delete o.global,o.contexts=[];const a={updateCount:0,value:r,tagJsVar:s,destroy$:new q,render$:new q,placeholder:o.placeholder,valueIndex:-1,withinOwnerElement:!0,parentContext:o,contexts:o.contexts},c=Lo(o,a,t,n);return o.tagJsVar=c,s.processInit(r,a,t,n.placeholder),t}function jo(t,e,n){const o=ir(t,e,n,n?.appSupport),r=o.propsConfig;if(r){const e=t.tagJsType!==S.tagComponent?[]:so(t,o);r.castProps=e}return Ae(o,e.state.newest,e)}function Do(t,e,n){const o=jo(t,e,n),r=o.templater.tag;return["dom","html"].includes(r.tagJsType)?(Zn(o,void 0,e.placeholder),o):Po(o,o.ownerSupport,e)}function Ho(t,e){delete t.returnValue,delete t.global,t.contexts=[],t.htmlDomMeta=[],delete t.updatesHandler}function No(t,e,n,o){const r=jo(t,e,n),s=r.templater.tag;return["dom","html"].includes(s.tagJsType)?function(t,e){const n=Zn(t,e,void 0);for(const t of n.dom)t.domElement&&p.push([v,[e,t.domElement]]),t.marker&&p.push([v,[e,t.marker]]);return t}(r,o):Po(r,0,e)}function Uo(t,e,o,r,s){return n(e),s?No(t,e,o,s):Do(t,e,o)}function $o(t){return tt.stateConfig.handlers.handler(t)}function Wo(t){return $o((()=>{const e=t();if(Gr().global){return Ye(e,r(),{resolvePromise:Ro,resolveValue:Bo})}})),Yo}function Ro(t){return t}function Bo(t){return t}function Fo(t){return $o((function(){Gr().destroy$.toCallback(t)})),Yo}bo.all=function(t,e){return bo(q.all(t),e)},So.onInit=t=>So((()=>{}),{onInit:t}),So.onDestroy=t=>So((()=>{}),{onDestroy:t});let _o=0;const zo=Xo("click"),Go=Xo("mousedown");function Xo(t){return function(e){const n=Wr(e);return $o((()=>{Xr().addEventListener(t,n)})),n}}const Ko={get:Xr,onclick:zo,click:zo,onClick:zo,mousedown:Go,onmousedown:Go,onMouseDown:Go};function qo(t,e){Object.defineProperty(Yo,t,{get:()=>e,set:t=>e(t)})}var Zo;function Yo(t,e=Zo.SHALLOW){const n=function(...o){const r=oo(e,o);r.tagJsType=S.tagComponent,r.processInit=Uo,r.hasValueChanged=de;const s=function(t,e){return function(n,o,r){const s=so(t,n,r),a=n.ownerSupport,c=ir(t,o,a,n.appSupport,s);return Je(t,e,c,s)}}(r,n);return s.original=t,r.wrapper=s,r},o=t;n.original=t,o.tags=ro,o.setUse=tt,o.ValueTypes=S,o.tagIndex=_o++,ro.push(n);const r=n;return r.updates=t=>(Gr().updatesHandler=t,!0),r.getInnerHTML=To,r}function Qo(t,e,n){if(Ne(t,e))return 11;switch(n){case Zo.NONE:return 1;case Zo.SHALLOW:return it(t,e);case Zo.IMMUTABLE:return er(t,e)}return function(t,e){let n=t,o=e;n=[...t],o=[...e||[]];if(!n.every(((t,e)=>function(t,e,n,o){const r=o[e];if(typeof t===I.object){const e={...t},n={...r||{}},o=Object.entries(e).every((([t,o])=>tr(o,n[t],(()=>{delete e[t],delete n[t]}))));return o}return tr(t,r,(function(){n.splice(e,1),o.splice(e,1)}))}(t,e,n,o))))return 7;return!1}(t,e)}function tr(t,e,n){if(typeof t!==I.function)return!!st(t,e,or)&&4;if(typeof e!==I.function)return!1;const o=e?.original;o&&(e=o);t.original&&(t=t.original);return t.toString()===e.toString()?(n(),5):(n(),6)}function er(t,e){const n=t.length;for(let o=0;o<n;++o){if(t[o]!==e[o])return 2}return!1}qo("onclick",zo),qo("click",zo),qo("onMouseDown",Go),qo("onmousedown",Go),qo("mousedown",Go),function(t){t.DEEP="deep",t.SHALLOW="shallow",t.NONE="none",t.IMMUTABLE="immutable"}(Zo||(Zo={})),Yo.element=Ko,Yo.renderOnce=function(){throw new Error("Do not call tag.renderOnce as a function but instead set it as: `(props) => tag.renderOnce = () => html`` `")},Yo.use=function(){throw new Error("Do not call tag.use as a function but instead set it as: `(props) => tag.use = (use) => html`` `")},Yo.deepPropWatch=Yo,Yo.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`` `")},Yo.inject=function(t){const e=Gr();if(!e)throw new Error("tag.inject can only be called within a tag or host context");let n=e.parentContext;for(;n;){const e=n.contexts;if(e)for(const n of e)if(n.isAttr&&n.tagJsVar?.matchesInjection){const e=n.tagJsVar.matchesInjection(t,n);if(void 0!==e)return e.returnValue}if(n.tagJsVar?.matchesInjection&&n.tagJsVar.matchesInjection(t,n))return n.returnValue;n=n.parentContext}const o=`Could not find parent context for tag.inject ${t}`;throw console.error(o,{targetItem:t,context:e}),new Error(o)},Yo.onInit=Wo,Yo.onDestroy=Fo,Yo.onRender=function(t){const e=Gr(),n=n=>{const o=Gr();Kr(e);const r=t();return qr(),Kr(o),r},o=e.render$.subscribe((()=>n())),r=n();return Yo.onDestroy((()=>o.unsubscribe())),r},Yo.getInnerHTML=To,Yo.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`` `")},Yo.immutableProps=function(t){return Yo(t,Zo.IMMUTABLE)},Yo.watchProps=function(t){return Yo(t,Zo.SHALLOW)},Object.defineProperty(Yo,"renderOnce",{set(t){t.tagJsType=S.renderOnce,t.processInit=co,t.processUpdate=ht,t.destroy=pe,t.hasValueChanged=function(){return 0}}}),Object.defineProperty(Yo,"use",{set(t){t.original={setUse:tt,tags:ro},t.tagJsType=S.stateRender,t.processInit=Uo,t.processUpdate=ht,t.hasValueChanged=de,t.destroy=pe}});const nr=3,or=10;function rr(t){return ut(t,nr)}function sr(t){return ut(t,or)}function ar(t,e,n){const o={templater:t,context:e,castedProps:n,appSupport:void 0};return e.global.blocked=[],e.state||(e.state={newer:{state:[],states:[]}}),o}function cr(t,e,n,o){e.appSupport=n||e;const r=t.props;return r&&(e.propsConfig=function(t,e,n){const o=t.templater;if(o.tagJsType!==S.stateRender){switch(o.propWatch){case Zo.IMMUTABLE:return t.propsConfig={latest:e,castProps:n};case Zo.SHALLOW:return t.propsConfig={latest:e.map(rr),castProps:n}}return t.propsConfig={latest:e.map(sr),castProps:n}}}(e,r,o)),e}function ur(t,e,n,o,r){const s={templater:t,context:o,castedProps:r,appSupport:void 0};return s.ownerSupport=e,s.appSupport=n,s}function ir(t,e,n,o,r){const s=ar(t,e,r);return s.ownerSupport=n||s,s.ownerSupport.appSupport=o||s.ownerSupport,cr(t,s,o,r)}function lr(t,e,o){if(M(e))return void 0===t.global&&n(t),t.oldTagJsVar=t.tagJsVar,t.tagJsVar=e,function(t,e,n){if(!e.state.newest)return void t.processInit(t,e,n,e.placeholder);const o=ir(t,e,n,n.appSupport);we(n,o,e)}(e,t,o),!0;if(t.global){t.oldTagJsVar=t.tagJsVar,t.tagJsVar=e;const n=t.state.newest;if(n)return typeof e===I.function||function(t,e,n,o){let r=n.templater||n;const s=t.templater.tag;s&&s._innerHTML&&(r=n.outerHTML||n._innerHTML.outerHTML);const a=ir(r,e,o,o.appSupport);nt(t.context.state.oldest,a)}(n,t,e,o),!0}return e.processInit(e,t,o,t.placeholder),t.oldTagJsVar=t.tagJsVar,t.tagJsVar=e,!0}function pr(t,e,n,o){const r=t&&t.tagJsType;if(delete e.deleted,r){if(r===S.renderOnce)return;lr(e,t,n)}else{if(D(t))return Zt(e,t,n),e.oldTagJsVar=e.tagJsVar,void(e.tagJsVar=_t(t));typeof t!==I.function?o&&function(t,e){e.value=t,e.oldTagJsVar=e.tagJsVar,e.tagJsVar=Nt(t);const n=e.placeholder,o=bt(t),r=e.paint=[C,[n,o,function(t){e.simpleValueElm=t,delete e.paint},"processNowRegularValue"]];u.push(r)}(t,e):e.value=t}}function fr(t,e,n){const o=t.tagJsVar.hasValueChanged(e,t,n);return 0===o||pr(e,t,n,o),o}function dr(t,e){let n;return t&&(n=e=document.createTextNode(J),p.push([v,[t,e]])),{appendMarker:n,insertBefore:e}}function gr(t,e,n){const o=mo(t,e,n);if(!0!==e.hasEmitted){const t=e.value.Observables;if(!t)return;if(!("value"in t[0]))return}if(0===o&&t.callback){io(t,e.subContext)}}function hr(t,e,n,o,r){const s=t.Observables,{appendMarker:a,insertBefore:c}=dr(r,o);let u=function(t,e,o){xo(t,o,n,c),vr(e),u=o.tagJsVar.onOutput=function(t,e,o){const r=o.contextItem;fr(r,t,n),r.tagJsVar.processUpdate(t,r,n,[t]),r.value=t,vr(e)}};const i=mr(s,n,((t,e,n)=>u(t,e,n)),t,e);return i.appendMarker=a,e.subContext=i,t.processUpdate=gr,t.onOutput=u,i}function mr(t,e,n,o,r){function s(t,e){u.lastValues[e]={value:t,tagJsVar:Xt(t),oldTagJsVar:u.lastValues[e]?.tagJsVar},a(u.lastValues,e)}function a(t,e){const o=u.tagJsVar,s=o?.callback;if(s){Kr(r);const e=o.callback(...t.map((t=>t.value)));return n(e,c,u),void qr()}const a=t[e].value;n(a,c,u)}let c=!0;const u={lastValues:[],subValueHandler:s,valuesHandler:a,tagJsVar:o,subscriptions:[]};return t.forEach(((t,e)=>{c=!0,u.subscriptions.push(t.subscribe((t=>s(t,e)))),c=!1})),o.onOutput=n,u}function br(t){const e=t.subContext;if(!e)return;e.subscriptions.forEach((t=>t.unsubscribe())),delete t.subContext}function yr(t,e){++t.updateCount;const n=t.subContext;return br(t),vo(n,e)}function vr(t){t||tt.stateConfig.support||h()}function xr(t,e,n,o,r){hr({tagJsType:S.subscribe,states:[],Observables:[t]},e,n,o,r)}function wr(t){return r()?$o((()=>Cr(t))):Cr(t)}function Cr(t){let e=t;const n=new Set,o=t=>{n.forEach((e=>e(t)))};return{tagJsType:S.signal,hasValueChanged:go,processInitAttribute:a,processInit:xr,processUpdate:gr,get value(){return e},set value(t){e!==t&&(e=t,o(t))},destroy:yr,emit:o,subscribe(t){t(e),n.add(t);const o=()=>n.delete(t);return o.unsubscribe=o,o}}}class Tr extends q{value;constructor(t){super(t),this.value=t}subscribe(t){const e=super.subscribe(t);return t(this.value,e),e}}class Vr extends q{value;constructor(t){super(t),this.value=t,this._value=t,Y(this)}subscribe(t){const e=super.subscribe(t);return t(this._value,e),e}}function Jr(t){return(e,n)=>{n.setHandler((()=>{})),t(e,n.next)}}function kr(t){return(e,n)=>{n.setHandler((()=>{}));t(e).then((t=>n.next(t)))}}const Ir=t=>(e,n)=>{n.setHandler((()=>{}));const o=t(e).subscribe((t=>{o.unsubscribe(),n.next(t)}))},Sr=(t,e)=>Ar(t,e).pastResult,Er=t=>t;const Ar=(t,e,{init:n,before:o,final:r=Er}={})=>{const s=$o({pastResult:void 0,values:void 0}),a="function"==typeof t?t():t,c=void 0===s.values;let u=0;function i(t){if(void 0===s.values){if(o&&!o(t))return s.values=t,s;const a=(n||e)(t,s.values);return s.pastResult=r(a),s.values=t,s}if(t.every(((t,e)=>t===s.values[e])))return s;if(o&&!o(t))return s.values=t,s;const a=e(t,s.values);return s.pastResult=r(a),s.values.length=0,s.values.push(...t),s}return c&&"function"==typeof t&&Yo.onRender((()=>{if(++u,1===u)return;i(t())})),i(a)};function Mr(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=$o((()=>r())),o=$o((()=>new Tr(void 0))),s=$o((()=>({state:tt.stateConfig.state,states:tt.stateConfig.states}))),a=(t,a)=>(Ar(t,((t,e)=>{const c=r(),u=a(t,e);if(c!==n){const t=s.state,e=n.context.state.older;if(e){Ge(t,e.state,s.states,e.states)}}o.next(u)}),e.setup),o);return a.setup=e.setup,Mr((()=>a),a),a}}),Object.defineProperty(e,"truthy",{get(){const e=t();return e.setup.before=t=>t.every((t=>t)),e}}),e}function Or(t){return r()?$o((()=>new q(t))):new q(t)}function Lr(t){return tt.stateConfig.handlers.statesHandler(t)}function Pr(t){const e=wr([]),n=wr(0),o=wr(0);let r=[],s=0;return o.value=n.value,t(((...t)=>(r=t,e.value))),Sr(r,(()=>{++s,e.value=r,t((()=>r))})),Lr(((r,a)=>{if(s)return t(((...t)=>(a&&1!==a||(e.value=t),e.value))),o.value=n.value,void++n.value;t((()=>e.value))})),++s,e.value}function jr(){return{stateDiff:0,provider:void 0}}Mr((()=>function(t){const e=(e,n)=>Ar(e,n,t).pastResult;return e.setup=t,Mr((()=>e),e),e}({})),Sr),Or._value=t=>{const e=$o((function(){return{state:tt.stateConfig.state,states:tt.stateConfig.states}})),n=r();return $o((function(){return new Tr(t).pipe((t=>{const o=n.context.state.newer;return Ge(o.state,e.state,o.states,e.states),t}))}))},Or.all=function(t){const e=$o((()=>({state:tt.stateConfig.state,states:tt.stateConfig.states}))),n=r();return q.all(t).pipe((t=>{const o=n.context.state.newer;return o&&Ge(o.state,e.state,o.states,e.states),t}))};const Dr={create:t=>{const e=$o(jr);if(e.stateDiff){let t=e.stateDiff;for(;t--;)$o(void 0);return $o(void 0)}const n=$o((()=>{const n=tt.stateConfig,o=n.state.length,r=t.prototype?new t:t(),s=n.support,a=n.state.length-o,c={constructMethod:t,instance:r,stateDiff:a,owner:s,children:[]};e.provider=c;const u=s.context;return(u.providers=u.providers||[]).push(c),e.stateDiff=a,r})),o=t,r=o.compareTo=o.toString();return e.provider.constructMethod.compareTo=r,n},inject:function(t){return $o((function(){const e=t,n=e.compareTo=e.compareTo||t.toString(),o=r(),s=[];let a={ownerSupport:o.ownerSupport};for(;a.ownerSupport;){const t=a.ownerSupport.context.providers;if(!t){a=a.ownerSupport;continue}const e=t.find((t=>{s.push(t);if(t.constructMethod.compareTo===n)return!0}));if(e){const t=o.context;return(t.providers=t.providers||[]).push(e),e.children.push(o),e.instance}a=a.ownerSupport}const c=`Could not inject provider: ${t.name} ${t}`;throw console.warn(`${c}. Available providers`,s),new Error(c)}))}};class Hr extends Error{details;constructor(t,e,n={}){super(t),this.name=Hr.name,this.details={...n,errorCode:e}}}class Nr extends Hr{constructor(t,e){super(t,"array-no-key-error",e),this.name=Nr.name}}class Ur extends Hr{constructor(t,e){super(t,"state-mismatch-error",e),this.name=Ur.name}}class $r extends Hr{constructor(t,e){super(t,"sync-callback-error",e),this.name=$r.name}}function Wr(t){const e=Gr(),n=$o({callback:t}),o=$o((()=>Rr(e,tt.stateConfig,n)));return n.callback=t,o}function Rr(t,e,n){const o=e.states;return function(...e){const r=function(t,e,n,...o){const r=n(...o),s=H(t);if(!s)return r;if(s.context.global)je(s);else{const t=s.context;t.tagJsVar.processUpdate(t.value,t,s.ownerSupport,[])}return L(r)&&r.finally((()=>{if(t.global)je(s);else{const t=s.context;t.tagJsVar.processUpdate(t.value,t,s.ownerSupport,[])}})),r}(t,o,n.callback,...e);return h(),r}}const Br=()=>{const t=Gr();if(!t)throw Fr;const e=tt.stateConfig;return function(n){return Rr(t,e,{callback:n})}},Fr=new $r("callback() was called outside of synchronous rendering. Use `callback = callbackMaker()` to create a callback that could be called out of sync with rendering");function _r(t=[]){return r()?$o((()=>zr(Cr(t)))):zr(Cr(t))}function zr(t){const e=["push","pop","splice","shift","unshift"],n=["map","reduce","forEach","every"],o=new Proxy(t,{get(r,s){return isNaN(s)?"length"===s?t.value.length:e.includes(s)?o[a=s]=(...e)=>{const n=t.value[a](...e);return t.emit(t.value),n}:n.includes(s)?t.value[s].bind(t.value):t[s]:t.value[s];var a},set:(e,n,o)=>isNaN(n)?"length"===n?(t.value.length=o,t.emit(t.value),!0):(t[n]=o,!0):(t.value[n]=o,t.emit(t.value),!0)});return o}function Gr(){return tt.stateConfig.context}function Xr(){return Gr().element}function Kr(t){return tt.stateConfig.context=t}function qr(){delete tt.stateConfig.context}function Zr(t,e,o,r,s){const a=t;let c=a.templater;if(c||(c=Qn(a)),n(e),s)return eo(c,e,o,s,r);return(e.state=e.state||{}).newest=to(c,o,e),Yn(o,e)}function Yr(t,e,n,o,r){Zr(t.outerHTML,e,n,o,r);e.tagJsVar.processUpdate=function(t,e,n){fr(e,t?.outerHTML||t,n)},t.hasValueChanged=Qr}function Qr(t,e){return de(t,e)}function ts(t,e){const n={values:e,ownerSupport:r(),tagJsType:S.tag,processInitAttribute:a,processInit:Zr,processUpdate:ht,hasValueChanged:de,destroy:pe,strings:t,key:t=>es(t,n),setHTML:function(t){return t.outerHTML=n,n._innerHTML=t,t.oldProcessInit=t.processInit,t.processInit=Yr,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 es(t,e){return es(t,e),e.arrayValue=t,e}function ns(t,e){const n={values:e,ownerSupport:r(),dom:t,tagJsType:S.dom,processInitAttribute:a,processInit:Zr,processUpdate:ht,hasValueChanged:de,destroy:pe,key:function(t){return n.arrayValue=t,n},setHTML:function(t){return t.outerHTML=n,n._innerHTML=t,t.oldProcessInit=t.processInit,t.processInit=Yr,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 os(t,...e){const n=ts(t,e),o=oo(Zo.NONE);return o.tag=n,n.templater=o,n}os.dom=function(t,...e){return ns(t,e)},"object"==typeof document&&(document.taggedJs&&console.warn("🏷️🏷️ Multiple versions of taggedjs are loaded. May cause issues."),document.taggedJs=!0);const rs=[];function ss(t,e,o){const r=rs.findIndex((t=>t.element===e));if(r>=0){const t=rs[r].support;ue(t,t.context.global),rs.splice(r,1),console.warn("Found and destroyed app element already rendered to element",{element:e})}let c=()=>p(o);c.propWatch=Zo.NONE,c.tagJsType=S.stateRender,c.processUpdate=ht,c.props=[o],c.isApp=!0;const u=function(t,e){const o={tagJsType:"templater",hasValueChanged:de,destroy:pe,processInitAttribute:a,processInit:function(){console.debug("do nothing app function")},processUpdate:ht},r={updateCount:0,value:t,valueIndex:0,varCounter:0,destroy$:new q,render$:new q,withinOwnerElement:!1,renderCount:0,global:void 0,state:{},tagJsVar:o};return n(r),r.events={},function(t,e,n){const o=ar(t,e);cr(t,o,o),o.appElement=n,e.state.oldest||(e.state.oldest=o,e.state.older=e.state.newer),e.state.newest=o}(t,r,e),r}(c,e),i=u.global,l=u.state.newest;R(l.context),s(l);let p=t(o);const f=typeof p==I.function;f||(M(p)?(u.state.newest.propsConfig={latest:[o],castProps:[o]},c.propWatch=p.propWatch,c.tagJsType=p.tagJsType,c.wrapper=p.wrapper,c=p):(c.tag=p,p=t));const g=function(t,e,n,o,r,s,a){const c=document.createTextNode(J);if(ro.push(n.wrapper||{original:n}),s.placeholder=c,e.isApp=!0,!r)throw new Error(`Cannot tagElement, element received is type ${typeof r} and not type Element`);r.destroy=function(){const t=s.events;for(const e in t){const n=t[e];r.removeEventListener(e,n)}s.events={},++d.locks;const n=ue(i,e);return--d.locks,h(),n},++d.locks;const u=document.createDocumentFragment();u.appendChild(c);const i=Do(n,s,{appSupport:{appElement:r,context:s},appElement:r});return i.appElement=r,a&&(o.tag=i.templater.tag),--d.locks,h(),r.appendChild(u),{support:i,tags:ro,ValueTypes:S}}(0,i,c,p,e,u,f);return qr(),g}function as(t,e){return function(n,o,r){if(s=o,Array.isArray(s)&&Object.prototype.hasOwnProperty.call(s,"raw")){const s=o.reduce(((t,e,n)=>t+e+(r[n]??"")),"");return e(n,[t,s])}var s;return e(n,[t,o])}}function cs(t,e,n){function o(t){return o.toCallback(t)}return o.toCallback=n,t.listeners.push([e,o]),t.allListeners.push([e,o]),t}function us(t,e){const n=Ms(t,t.elementFunctions);return n.attributes.push(e),ms(e[0])?hs(e[0],n):ms(e[1])&&hs(e[1],n),n}const is=as("style",us),ls=as("id",us),ps=as("class",us),fs=as("href",us);function ds(t,e){return t.attributes.push(e),ms(e[0])?hs(e[0],t):ms(e[1])&&hs(e[1],t),t}function gs(t){function e(e){return function(n){return function(t,e,n){return cs(Ms(t,t.elementFunctions),e,n)}(t,e,n)}}return{onClose:e("onclose"),onDoubleClick:e("ondblclick"),onClick:e("click"),onBlur:e("onblur"),onChange:e("onchange"),onMousedown:e("onmousedown"),onMouseup:e("onmouseup"),onKeydown:e("onkeydown"),onKeyup:e("onkeyup"),attr:(...e)=>us(t,e),key:function(t){return this.arrayValue=t,this},style:(e,...n)=>is(t,e,n),id:(e,...n)=>ls(t,e,n),class:(e,...n)=>ps(t,e,n),href:(e,...n)=>fs(t,e,n)}}function hs(t,e){e.contexts||(e.contexts=[]),e.contexts.push(t)}function ms(t){return Array.isArray(t)||P(t)||t?.tagJsType}function bs(t,e){return(n,o)=>ds(n,[t,o,!1,e])}function ys(t){return(e,n)=>cs(e,t,n)}const vs={onClose:ys("onclose"),onClick:ys("click"),onDoubleClick:ys("ondblclick"),onDblClick:ys("ondblclick"),onBlur:ys("onblur"),onChange:ys("onchange"),onMousedown:ys("onmousedown"),onMouseDown:ys("onmousedown"),onMouseup:ys("onmouseup"),onMouseUp:ys("onmouseup"),onKeyup:ys("onkeyup"),onKeyUp:ys("onkeyup"),onKeydown:ys("onkeydown"),onKeyDown:ys("onkeydown")},xs={checked:bs("checked",Et),selected:bs("selected",Et),class:bs("class",(function(t,e,n){j(n)?Object.entries(n).forEach((([e,n])=>{n?t.classList.add(e):t.classList.remove(e)})):At(t,e,n)})),...vs};function ws(t,e){++t.updateCount;const n=t.contexts,o=[];if(n.length&&(Cs(n,e,o),n.length=0,o.length)){const e=t.htmlDomMeta;return t.deleted=!0,Promise.all(o).then((()=>{++d.locks,re(e),t.htmlDomMeta=[],--d.locks,h()}))}ce(t),t.htmlDomMeta=[],delete t.contexts,t.deleted=!0}function Cs(t,e,n){const o=t[0],r=o.tagJsVar.destroy(o,e);return o.deleted=!0,L(r)?n.push(r.then((()=>{if(t.length>1)return Cs(t.slice(1,t.length),e,n)}))):(o.htmlDomMeta&&(ce(o),delete o.htmlDomMeta),t.length>1?Cs(t.slice(1,t.length),e,n):void 0)}function Ts(t,e,n){if(e.locked||!0===e.deleted)return;++e.updateCount;if(Vs(t,e))return ws(e,n),e.htmlDomMeta=[],delete e.deleted,void pr(t,e,n,789);const o=e.contexts,r=t.contexts||[],s=e.tagJsVar.allListeners;if(t.allListeners.forEach(((t,e)=>{s[e][1].toCallback=t[1].toCallback})),o.length!==r.length)throw console.info("context mismatch",{value:t,context:e,conValues:o.map((t=>t.value)),vContexts:r,deleted:e.deleted}),new Error("super issue discovered");e.locked=79,o.forEach(((t,e)=>{t.tagJsVar.processUpdate(r[e],t,n)})),delete e.locked}function Vs(t,e){if(e.value===t)return 0;if(!t||"element"!==t.tagJsType)return 1;if(t.innerHTML.length!==e.value.innerHTML.length)return 1;return t.attributes.length!==e.value.attributes.length?1:0}function Js(t,e,n,o,r){t.forEach((t=>{switch(typeof t){case"string":case"boolean":case"number":return Is(t,o,r);case"function":{if("element"===t.tagJsType)break;const s=function(t,e,n,o,r){const s=[],c={updateCount:0,parentContext:n,contexts:s,element:e,value:t,htmlDomMeta:[],tagJsVar:{tagJsType:"dynamic-text",hasValueChanged:()=>0,processInit:a,processInitAttribute:a,destroy:(t,e)=>{++c.updateCount,s.forEach((t=>t.tagJsVar.destroy(t,e)))},processUpdate:(t,e,n,o)=>{++c.updateCount,Kr(i);let r=t(i);const s=c.underFunction;delete c.underFunction,r instanceof Function&&!r.tagJsType&&(s&&r.toString()===s.toString()?r=i.value:(c.underFunction=r,r=r()));const a=i.tagJsVar.processUpdate(r,i,n,o);return i.value=r,e.value=t,qr(),a}},valueIndex:-1,withinOwnerElement:!0,destroy$:new q,render$:new q};Kr(c);let u=t();P(u)&&!u.tagJsType&&(c.underFunction=u,u=u());const i=ks(u,c,e,o,r);return n.contexts.push(c),qr(),i}(t,o,e,n,r);return s}}if(null==t)return Is(t,o,r);if("element"!==t.tagJsType)return ks(t,e,o,n,r);{const s=Ss(t,e,n,e.contexts);u.push([r,[o,s]]);e.htmlDomMeta.push({nn:s.tagName,domElement:s,at:[]})}}))}function ks(t,e,n,o,r){const s=Kt(t,0,!0,e);return e.contexts.push(s),s.element=n,s.placeholder=document.createTextNode(""),u.push([r,[n,s.placeholder]]),Kr(s),s.tagJsVar.processInit(t,s,o,s.placeholder),qr(),s}function Is(t,e,n){const o=bt(t),r=document.createTextNode(o);return u.push([n,[e,r]]),r}function Ss(t,e,n,o){const r=document.createElement(t.tagName);return e.element=r,t.attributes.forEach((t=>{const e=t[0];"string"==typeof e&&(t[2]=yt(e))})),Tn(t.attributes,[],r,n,e),Js(t.innerHTML,e,n,r,v),t.listeners.forEach(((e,o)=>function(t,e,n,o,r){const s=(...o)=>{const r=t.listeners[e][1],s=N(n),a=s.context.updateCount;s.context.locked=1,++d.locks;const c=r(...o);--d.locks,delete s.context.locked;return a===s.context.updateCount?tn(c,s):(h(),L(c)?c.then((()=>($e([s.context.state.newest]),"promise-no-data-ever"))):"no-data-ever")};an(n.appSupport,o[0],r,s)}(t,o,n,e,r))),r}function Es(t,e,n,o){e.contexts=e.contexts||[],e.htmlDomMeta=[],e.locked=34;const r=Ss(t,e,n,e.contexts);delete e.locked,u.push([y,[o,r,"htmlTag.processInit"]]);const s={nn:t.tagName,domElement:r,at:t.attributes};return e.htmlDomMeta=[s],r}function As(t){const e=Ms({tagJsType:"element",processInitAttribute:a,processInit:Es,destroy:ws,processUpdate:Ts,hasValueChanged:Vs,tagName:t,innerHTML:[],attributes:[],listeners:[],allListeners:[],elementFunctions:gs},gs);return e.tagName=t,e}function Ms(t,e){const n=(...t)=>{const e={...n};var o,r;return e.attributes=[...n.attributes],e.listeners=[...n.listeners],e.allListeners=[...n.allListeners],t.length>0&&"object"==typeof t[0]&&!Array.isArray(t[0])&&!t[0].tagJsType&&(o=e,r=t[0],Object.entries(r).reduce(((t,[e,n])=>e in xs?xs[e](o,n):ds(o,[e,n,!1,St])),o),t.splice(0,1)),e.innerHTML=t,t.forEach((t=>{if(ms(t))return"element"===t.tagJsType?(e.allListeners.push(...t.allListeners),void(t.contexts&&(e.contexts?e.contexts.push(...t.contexts):e.contexts=t.contexts))):void function(t,e){e.contexts||(e.contexts=[]);e.contexts.push(t)}(t,e)})),e};return Object.assign(n,t),Object.assign(n,gs(n)),n.attributes=[...t.attributes],n.listeners=[...t.listeners],n.allListeners=[...t.allListeners],n}const Os=function(){const t=Ms({tagJsType:"element",processInitAttribute:a,processInit:Ls,destroy:Ps,processUpdate:Ts,hasValueChanged:Vs,tagName:"no-element",innerHTML:[],attributes:[],listeners:[],allListeners:[],elementFunctions:gs});return t.tagName="no-element",t}();function Ls(t,e,n,o){e.contexts=e.contexts||[],e.htmlDomMeta=[],Js(t.innerHTML,e,n,o,y)}function Ps(t,e){++t.updateCount;const n=t.contexts,o=[];if(n.length&&(Cs(n,e,o),n.length=0,o.length)){const e=t.htmlDomMeta;return Promise.all(o).then((()=>{++d.locks,re(e),--d.locks,h()}))}}const js=As("button"),Ds=As("select"),Hs=As("option"),Ns=As("input"),Us=As("textarea"),$s=As("html"),Ws=As("head"),Rs=As("title"),Bs=As("meta"),Fs=As("link"),_s=As("style"),zs=As("body"),Gs=As("noscript"),Xs=As("hr"),Ks=As("h1"),qs=As("h2"),Zs=As("h3"),Ys=As("h4"),Qs=As("h5"),ta=As("h6"),ea=As("ol"),na=As("ul"),oa=As("li"),ra=As("div"),sa=As("main"),aa=As("section"),ca=As("header"),ua=As("footer"),ia=As("fieldset"),la=As("legend"),pa=As("dialog"),fa=As("pre"),da=As("table"),ga=As("tr"),ha=As("td"),ma=As("th"),ba=As("thead"),ya=As("tbody"),va=As("tfoot"),xa=As("a"),wa=As("br"),Ca=As("label"),Ta=As("p"),Va=As("small"),Ja=As("span"),ka=As("strong"),Ia=As("b"),Sa=As("sup"),Ea=As("nav"),Aa=As("figure"),Ma=As("figcaption"),Oa=As("code"),La={tagElement:ss,renderWithSupport:Oe,renderSupport:je,firstTagRender:Ae,reRenderTag:Ee,paint:h};var Pa=e.W9,ja=e.cg,Da=e.m0,Ha=e.rS,Na=e.Y2,Ua=e.ei,$a=e.B7,Wa=e.TU,Ra=e.XF,Ba=e.PC,Fa=e.Ot,_a=e.Mj,za=e.tD,Ga=e.a,Xa=e.Gf,Ka=e.xe,qa=e.YO,Za=e.b,Ya=e.rf,Qa=e.br,tc=e.um,ec=e.x6,nc=e.E2,oc=e.OH,rc=e.TB,sc=e.Ii,ac=e.mX,cc=e.yV,uc=e.EI,ic=e.aY,lc=e.zV,pc=e.pf,fc=e.ze,dc=e.Go,gc=e.bD,hc=e.WJ,mc=e.wL,bc=e.Ng,yc=e.O,vc=e.r3,xc=e.y4,wc=e.Ie,Cc=e.lI,Tc=e.$F,Vc=e.vP,Jc=e.hp,kc=e.qr,Ic=e.ts,Sc=e.B4,Ec=e.HD,Ac=e.Az,Mc=e.Xi,Oc=e.sV,Lc=e.Ah,Pc=e.f5,jc=e.Gk,Dc=e.j_,Hc=e.h1,Nc=e.h2,Uc=e.h3,$c=e.h4,Wc=e.h5,Rc=e.h6,Bc=e.zC,Fc=e.d5,_c=e.wx,zc=e.cF,Gc=e.Hc,Xc=e.PB,Kc=e.uq,qc=e.hr,Zc=e.qy,Yc=e.gM,Qc=e.gx,tu=e.hF,eu=e.cy,nu=e.Tn,ou=e.Gv,ru=e.yL,su=e.D8,au=e.Ze,cu=e._4,uu=e.mn,iu=e.Pf,lu=e.o1,pu=e.z,fu=e.li,du=e.nf,gu=e.iW,hu=e.mI,mu=e.C$,bu=e.et,yu=e.Vg,vu=e.ol,xu=e.sA,wu=e.TG,Cu=e.MG,Tu=e.PL,Vu=e.uK,Ju=e.CG,ku=e.p,Iu=e.nI,Su=e.Fs,Eu=e.AS,Au=e.r5,Mu=e.M$,Ou=e.uc,Lu=e.QB,Pu=e.uW,ju=e.Lt,Du=e.Jv,Hu=e.TA,Nu=e.Jn,Uu=e.Ll,$u=e.L6,Wu=e.EX,Ru=e.Ln,Bu=e.wk,Fu=e.xP,_u=e.ko,zu=e.iF,Gu=e.bc,Xu=e.B1,Ku=e.RX,qu=e.lR,Zu=e.ag,Yu=e.tp,Qu=e.Tc,ti=e.Hf,ei=e.zc,ni=e._A,oi=e.T_,ri=e.td,si=e.g0,ai=e.pd,ci=e.th,ui=e.VQ,ii=e.DD,li=e.tr,pi=e.ul,fi=e.Ag,di=e.Pc,gi=e.NU,hi=e.wB,mi=e.id,bi=e.MC,yi=e.SZ;export{Pa as ArrayNoKeyError,ja as BasicTypes,Da as ImmutableTypes,Ha as PropWatches,Na as RouteQuery,Ua as StateMismatchError,$a as Subject,Wa as Subjective,Ra as SyncCallbackError,Ba as TagError,Fa as ValueSubject,_a as ValueSubjective,za as ValueTypes,Ga as a,Xa as addPaintRemoveAwait,Ka as appElements,qa as array,Za as b,Ya as body,Qa as br,tc as buildBeforeElement,ec as button,nc as callback,oc as callbackMaker,rc as checkArrayValueChange,sc as checkSimpleValueChange,ac as checkStillSubscription,cc as checkTagValueChange,uc as checkTagValueChangeAndUpdate,ic as code,lc as combineLatest,pc as createHtmlSupport,fc as createTrigger,dc as deepClone,gc as deepEqual,hc as defineValueOn,mc as deleteContextSubContext,bc as deleteSimpleValue,yc as destroySupport,vc as dialog,xc as div,wc as empty,Cc as fieldset,Tc as figcaption,Vc as figure,Jc as firstTagRender,kc as footer,Ic as forceUpdateExistingValue,Sc as getBaseSupport,Ec as getContextInCycle,Ac as getDomMeta,Mc as getDomTag,Oc as getInnerHTML,Lc as getNewGlobal,Pc as getSupportOlderState,jc as getTemplaterResult,Dc as guaranteeInsertBefore,Hc as h1,Nc as h2,Uc as h3,$c as h4,Wc as h5,Rc as h6,Bc as hasPropChanges,Fc as head,_c as header,zc as hmr,Gc as host,Xc as howToSetInputValue,Kc as howToSetStandAloneAttr,qc as hr,Zc as html,Yc as htmlDoc,Qc as htmlTag,tu as input,eu as isArray,nu as isFunction,ou as isObject,ru as isPromise,su as isSimpleType,au as isStaticTag,cu as isSubjectInstance,uu as isTagComponent,iu as label,lu as legend,pu as letProp,fu as li,du as link,gu as main,hu as meta,mu as nav,bu as noElement,yu as noscript,vu as ol,xu as onDestroy,wu as onFirstSubContext,Cu as onInit,Tu as oneRenderToSupport,Vu as option,Ju as output,ku as p,Iu as paint,Su as pipe,Eu as pre,Au as providers,Mu as reRenderTag,Ou as renderSupport,Lu as renderWithSupport,Pu as section,ju as select,Du as setBooleanAttribute,Hu as setNonFunctionInputValue,Nu as setSimpleAttribute,Uu as setUseMemory,$u as signal,Wu as small,Ru as span,Bu as state,Fu as states,_u as strong,zu as style,Gu as subject,Xu as subscribe,Ku as subscribeWith,qu as sup,Zu as syncError,Yu as table,Qu as tag,ti as tagElement,ei as tagValueUpdateHandler,ni as tags,oi as tbody,ri as td,si as textarea,ai as tfoot,ci as th,ui as thead,ii as title,li as tr,pi as ul,fi as upgradeBaseToSupport,di as valueToTagJsVar,gi as variablePrefix,hi as watch,mi as willCallback,bi as willPromise,yi as willSubscribe};
2
2
  //# sourceMappingURL=bundle.js.map