taggedjs 3.1.18 → 3.1.23

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