taggedjs 2.8.26 → 2.8.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle.js +1 -1
- package/bundle.js.map +1 -1
- package/js/alterProp.function.d.ts +5 -5
- package/js/alterProp.function.js +19 -20
- package/js/alterProp.function.js.map +1 -1
- package/js/index.d.ts +1 -1
- package/js/index.js +1 -1
- package/js/index.js.map +1 -1
- package/js/interpolations/attributes/addSupportEventListener.function.d.ts +1 -1
- package/js/interpolations/attributes/bindSubjectCallback.function.d.ts +4 -2
- package/js/interpolations/attributes/bindSubjectCallback.function.js +14 -6
- package/js/interpolations/attributes/bindSubjectCallback.function.js.map +1 -1
- package/js/interpolations/attributes/getSupportWithState.function.d.ts +2 -0
- package/js/interpolations/attributes/getSupportWithState.function.js +10 -0
- package/js/interpolations/attributes/getSupportWithState.function.js.map +1 -0
- package/js/interpolations/attributes/getUpTags.function.d.ts +1 -1
- package/js/interpolations/attributes/getUpTags.function.js.map +1 -1
- package/js/interpolations/attributes/processAttribute.function.d.ts +3 -3
- package/js/interpolations/attributes/processAttribute.function.js +2 -7
- package/js/interpolations/attributes/processAttribute.function.js.map +1 -1
- package/js/interpolations/attributes/processAttributeCallback.function.d.ts +1 -1
- package/js/interpolations/attributes/processNameValueAttribute.function.d.ts +2 -2
- package/js/interpolations/attributes/renderTagArray.function.d.ts +1 -1
- package/js/interpolations/attributes/specialAttribute.d.ts +1 -1
- package/js/interpolations/attributes/updateAttribute.function.d.ts +1 -1
- package/js/interpolations/interpolateTemplate.d.ts +1 -1
- package/js/interpolations/optimizers/attachDomElements.function.d.ts +2 -4
- package/js/interpolations/optimizers/attachDomElements.function.js +5 -49
- package/js/interpolations/optimizers/attachDomElements.function.js.map +1 -1
- package/js/interpolations/optimizers/attachDynamicDom.function.d.ts +7 -0
- package/js/interpolations/optimizers/attachDynamicDom.function.js +28 -0
- package/js/interpolations/optimizers/attachDynamicDom.function.js.map +1 -0
- package/js/interpolations/optimizers/domProcessContextItem.function.d.ts +5 -0
- package/js/interpolations/optimizers/domProcessContextItem.function.js +18 -0
- package/js/interpolations/optimizers/domProcessContextItem.function.js.map +1 -0
- package/js/interpolations/optimizers/processDomContextItem.function.d.ts +5 -0
- package/js/interpolations/optimizers/processDomContextItem.function.js +18 -0
- package/js/interpolations/optimizers/processDomContextItem.function.js.map +1 -0
- package/js/interpolations/processSubscriptionUpdate.function.d.ts +1 -1
- package/js/interpolations/processSubscriptionUpdate.function.js +2 -2
- package/js/interpolations/processSubscriptionUpdate.function.js.map +1 -1
- package/js/interpolations/subscribeToTemplate.function.d.ts +1 -3
- package/js/interpolations/subscribeToTemplate.function.js +1 -29
- package/js/interpolations/subscribeToTemplate.function.js.map +1 -1
- package/js/isInstance.d.ts +1 -1
- package/js/isInstance.js.map +1 -1
- package/js/state/StateMemory.type.d.ts +2 -1
- package/js/state/callback.function.d.ts +1 -1
- package/js/state/callback.function.js +2 -6
- package/js/state/callback.function.js.map +1 -1
- package/js/state/callbackMaker.function.js +0 -1
- package/js/state/callbackMaker.function.js.map +1 -1
- package/js/state/callbackStateUpdate.function.d.ts +2 -7
- package/js/state/callbackStateUpdate.function.js +5 -31
- package/js/state/callbackStateUpdate.function.js.map +1 -1
- package/js/state/handleProviderChanges.function.d.ts +1 -1
- package/js/state/index.d.ts +1 -0
- package/js/state/index.js +1 -0
- package/js/state/index.js.map +1 -1
- package/js/state/letProp.function.js +10 -7
- package/js/state/letProp.function.js.map +1 -1
- package/js/state/providers.d.ts +1 -1
- package/js/state/providersChangeCheck.function.d.ts +1 -1
- package/js/state/setUse.function.d.ts +1 -1
- package/js/state/state.utils.d.ts +2 -3
- package/js/state/state.utils.js +3 -3
- package/js/state/state.utils.js.map +1 -1
- package/js/state/states.function.d.ts +1 -1
- package/js/state/states.function.js.map +1 -1
- package/js/state/states.utils.d.ts +2 -1
- package/js/state/states.utils.js +13 -25
- package/js/state/states.utils.js.map +1 -1
- package/js/state/subject.function.js +3 -3
- package/js/state/subject.function.js.map +1 -1
- package/js/state/subscribe.function.d.ts +18 -0
- package/js/state/subscribe.function.js +14 -0
- package/js/state/subscribe.function.js.map +1 -0
- package/js/state/syncStates.function.d.ts +4 -2
- package/js/state/syncStates.function.js +18 -13
- package/js/state/syncStates.function.js.map +1 -1
- package/js/state/tagClosed$.subject.d.ts +1 -1
- package/js/state/watch.function.js +2 -2
- package/js/state/watch.function.js.map +1 -1
- package/js/subject/ProcessInit.type.d.ts +6 -0
- package/js/subject/ProcessInit.type.js +2 -0
- package/js/subject/ProcessInit.type.js.map +1 -0
- package/js/subject/Subject.class.d.ts +2 -1
- package/js/subject/Subject.class.js.map +1 -1
- package/js/subject/ValueSubject.d.ts +1 -1
- package/js/subject/signal.function.d.ts +9 -15
- package/js/subject/signal.function.js +4 -0
- package/js/subject/signal.function.js.map +1 -1
- package/js/tag/AnySupport.type.d.ts +7 -0
- package/js/tag/AnySupport.type.js +2 -0
- package/js/tag/AnySupport.type.js.map +1 -0
- package/js/tag/BaseSupport.type.d.ts +1 -1
- package/js/tag/Context.types.d.ts +6 -7
- package/js/tag/Tag.type.d.ts +4 -2
- package/js/tag/ValueTypes.enum.d.ts +2 -2
- package/js/tag/ValueTypes.enum.js +4 -2
- package/js/tag/ValueTypes.enum.js.map +1 -1
- package/js/tag/afterRender.function.d.ts +1 -1
- package/js/tag/afterRender.function.js +7 -5
- package/js/tag/afterRender.function.js.map +1 -1
- package/js/tag/buildBeforeElement.function.d.ts +1 -2
- package/js/tag/buildBeforeElement.function.js +3 -2
- package/js/tag/buildBeforeElement.function.js.map +1 -1
- package/js/tag/checkDestroyPrevious.function.d.ts +1 -0
- package/js/tag/checkDestroyPrevious.function.js +4 -1
- package/js/tag/checkDestroyPrevious.function.js.map +1 -1
- package/js/tag/checkStateMismatch.function.d.ts +1 -1
- package/js/tag/checkTagValueChange.function.d.ts +3 -1
- package/js/tag/checkTagValueChange.function.js +7 -2
- package/js/tag/checkTagValueChange.function.js.map +1 -1
- package/js/tag/clonePropsBy.function.d.ts +1 -1
- package/js/tag/cloneValueArray.function.js +2 -0
- package/js/tag/cloneValueArray.function.js.map +1 -1
- package/js/tag/createHtmlSupport.function.d.ts +33 -0
- package/js/tag/createHtmlSupport.function.js +41 -0
- package/js/tag/createHtmlSupport.function.js.map +1 -0
- package/js/tag/createSupport.function.d.ts +6 -0
- package/js/tag/createSupport.function.js +8 -0
- package/js/tag/createSupport.function.js.map +1 -0
- package/js/tag/destroyContext.function.d.ts +8 -0
- package/js/tag/destroyContext.function.js +48 -0
- package/js/tag/destroyContext.function.js.map +1 -0
- package/js/tag/destroySupport.function.d.ts +1 -1
- package/js/tag/destroySupport.function.js +2 -2
- package/js/tag/destroySupport.function.js.map +1 -1
- package/js/tag/executeWrap.function.d.ts +1 -1
- package/js/tag/executeWrap.function.js +3 -2
- package/js/tag/executeWrap.function.js.map +1 -1
- package/js/tag/getDomTag.function.js +3 -0
- package/js/tag/getDomTag.function.js.map +1 -1
- package/js/tag/getSupport.function.d.ts +1 -0
- package/js/tag/getSupport.function.js +3 -3
- package/js/tag/getSupport.function.js.map +1 -1
- package/js/tag/getSupportInCycle.function.d.ts +1 -1
- package/js/tag/getTagWrap.function.d.ts +1 -1
- package/js/tag/getTagWrap.function.js +2 -2
- package/js/tag/getTagWrap.function.js.map +1 -1
- package/js/tag/getTemplaterResult.function.d.ts +8 -5
- package/js/tag/getTemplaterResult.function.js +3 -1
- package/js/tag/getTemplaterResult.function.js.map +1 -1
- package/js/tag/index.d.ts +4 -3
- package/js/tag/index.js.map +1 -1
- package/js/tag/isLikeTags.function.d.ts +1 -1
- package/js/tag/isLikeTags.function.js +0 -1
- package/js/tag/isLikeTags.function.js.map +1 -1
- package/js/tag/processUpdateAttrContext.function.d.ts +1 -1
- package/js/tag/processUpdateContext.function.d.ts +1 -1
- package/js/tag/render/renderExistingTag.function.d.ts +4 -2
- package/js/tag/render/renderExistingTag.function.js +2 -1
- package/js/tag/render/renderExistingTag.function.js.map +1 -1
- package/js/tag/render/renderSupport.function.d.ts +1 -1
- package/js/tag/render/renderSupport.function.js.map +1 -1
- package/js/tag/render/renderTagOnly.function.d.ts +2 -1
- package/js/tag/render/renderTagOnly.function.js +4 -16
- package/js/tag/render/renderTagOnly.function.js.map +1 -1
- package/js/tag/render/renderWithSupport.function.d.ts +3 -2
- package/js/tag/render/renderWithSupport.function.js +1 -1
- package/js/tag/render/renderWithSupport.function.js.map +1 -1
- package/js/tag/render/softDestroySupport.function.d.ts +1 -1
- package/js/tag/render/softDestroySupport.function.js +11 -12
- package/js/tag/render/softDestroySupport.function.js.map +1 -1
- package/js/tag/tag.function.js +9 -2
- package/js/tag/tag.function.js.map +1 -1
- package/js/tag/tagElement.d.ts +2 -1
- package/js/tag/tagElement.js +23 -20
- package/js/tag/tagElement.js.map +1 -1
- package/js/tag/tagRunner.d.ts +1 -1
- package/js/tag/update/compareArrayItems.function.d.ts +1 -1
- package/js/tag/update/compareArrayItems.function.js +1 -23
- package/js/tag/update/compareArrayItems.function.js.map +1 -1
- package/js/tag/update/createAndProcessContextItem.function.d.ts +7 -0
- package/js/tag/update/createAndProcessContextItem.function.js +32 -0
- package/js/tag/update/createAndProcessContextItem.function.js.map +1 -0
- package/js/tag/update/forceUpdateExistingValue.function.d.ts +7 -0
- package/js/tag/update/forceUpdateExistingValue.function.js +13 -0
- package/js/tag/update/forceUpdateExistingValue.function.js.map +1 -0
- package/js/tag/update/handleStillTag.function.d.ts +5 -0
- package/js/tag/update/handleStillTag.function.js +11 -0
- package/js/tag/update/handleStillTag.function.js.map +1 -0
- package/js/tag/update/oneRenderToSupport.function.d.ts +1 -1
- package/js/tag/update/processDomTagInit.function.d.ts +9 -0
- package/js/tag/update/processDomTagInit.function.js +23 -0
- package/js/tag/update/processDomTagInit.function.js.map +1 -0
- package/js/tag/update/processFirstSubject.utils.d.ts +2 -1
- package/js/tag/update/processFirstSubjectComponent.function.d.ts +2 -1
- package/js/tag/update/processFirstSubjectComponent.function.js +3 -3
- package/js/tag/update/processFirstSubjectComponent.function.js.map +1 -1
- package/js/tag/update/processFirstSubjectValue.function.d.ts +1 -1
- package/js/tag/update/processFirstSubjectValue.function.js +2 -62
- package/js/tag/update/processFirstSubjectValue.function.js.map +1 -1
- package/js/tag/update/processNewSubjectTag.function.d.ts +3 -3
- package/js/tag/update/processNewSubjectTag.function.js +2 -16
- package/js/tag/update/processNewSubjectTag.function.js.map +1 -1
- package/js/tag/update/processNewValue.function.d.ts +2 -1
- package/js/tag/update/processNewValue.function.js +3 -3
- package/js/tag/update/processNewValue.function.js.map +1 -1
- package/js/tag/update/processRenderOnceInit.function.d.ts +8 -0
- package/js/tag/update/processRenderOnceInit.function.js +17 -0
- package/js/tag/update/processRenderOnceInit.function.js.map +1 -0
- package/js/tag/update/processSubscribe.function.d.ts +9 -0
- package/js/tag/update/processSubscribe.function.js +10 -0
- package/js/tag/update/processSubscribe.function.js.map +1 -0
- package/js/tag/update/processTag.function.d.ts +2 -1
- package/js/tag/update/processTag.function.js +5 -7
- package/js/tag/update/processTag.function.js.map +1 -1
- package/js/tag/update/processTagArray.d.ts +1 -1
- package/js/tag/update/processTagArray.js +9 -42
- package/js/tag/update/processTagArray.js.map +1 -1
- package/js/tag/update/processTagComponentInit.function.d.ts +7 -0
- package/js/tag/update/processTagComponentInit.function.js +17 -0
- package/js/tag/update/processTagComponentInit.function.js.map +1 -0
- package/js/tag/update/processTagInit.function.d.ts +4 -0
- package/js/tag/update/processTagInit.function.js +11 -0
- package/js/tag/update/processTagInit.function.js.map +1 -0
- package/js/tag/update/processTagResult.function.d.ts +1 -1
- package/js/tag/update/processTagResult.function.js +1 -10
- package/js/tag/update/processTagResult.function.js.map +1 -1
- package/js/tag/update/setupSubscribe.function.d.ts +21 -0
- package/js/tag/update/setupSubscribe.function.js +85 -0
- package/js/tag/update/setupSubscribe.function.js.map +1 -0
- package/js/tag/update/syncPriorPropFunction.function.d.ts +1 -1
- package/js/tag/update/tryUpdateToTag.function.d.ts +7 -0
- package/js/tag/update/tryUpdateToTag.function.js +64 -0
- package/js/tag/update/tryUpdateToTag.function.js.map +1 -0
- package/js/tag/update/updateContextItemBySupport.function.d.ts +3 -0
- package/js/tag/update/updateContextItemBySupport.function.js +10 -0
- package/js/tag/update/updateContextItemBySupport.function.js.map +1 -0
- package/js/tag/update/updateExistingArray.function.d.ts +1 -1
- package/js/tag/update/updateExistingObject.function.d.ts +1 -1
- package/js/tag/update/updateExistingTagComponent.function.d.ts +2 -1
- package/js/tag/update/updateExistingTagComponent.function.js.map +1 -1
- package/js/tag/update/updateExistingValue.function.d.ts +3 -6
- package/js/tag/update/updateExistingValue.function.js +5 -99
- package/js/tag/update/updateExistingValue.function.js.map +1 -1
- package/js/tag/update/updateToDiffValue.function.d.ts +5 -0
- package/js/tag/update/updateToDiffValue.function.js +28 -0
- package/js/tag/update/updateToDiffValue.function.js.map +1 -0
- package/js/tag/updateSupportBy.function.d.ts +1 -1
- package/js/tag/updateSupportBy.function.js +3 -2
- package/js/tag/updateSupportBy.function.js.map +1 -1
- package/package.json +1 -1
package/bundle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function n(t){return t.renderCount=t.renderCount||0,t.global={}}t.d(e,{W9:()=>Q,cg:()=>c,m0:()=>s,rS:()=>yt,Y2:()=>r,ei:()=>Y,B7:()=>C,TU:()=>S,XF:()=>K,PC:()=>q,Ot:()=>k,Mj:()=>T,tD:()=>a,j8:()=>Oe,um:()=>Pe,E2:()=>gn,OH:()=>bn,TB:()=>Gt,Ii:()=>qt,yV:()=>Fe,zV:()=>v,ze:()=>hn,WJ:()=>j,aZ:()=>Xt,O:()=>Ft,Ie:()=>o,B4:()=>dt,Az:()=>Zn,Xi:()=>kn,pc:()=>ht,Ah:()=>n,ck:()=>jn,k6:()=>bt,Gk:()=>ot,zC:()=>St,cF:()=>tr,jU:()=>Kt,PB:()=>Yt,qy:()=>Gn,cy:()=>m,Tn:()=>h,Gv:()=>b,yL:()=>g,D8:()=>l,Ze:()=>p,_4:()=>d,mn:()=>f,z:()=>G,sA:()=>yn,MG:()=>vn,PL:()=>ze,nI:()=>Rt,PZ:()=>Ye,N_:()=>Ke,r5:()=>X,uc:()=>pn,pG:()=>qe,QB:()=>cn,R6:()=>Yn,Ll:()=>L,vP:()=>u,wk:()=>P,xP:()=>Z,bc:()=>z,ag:()=>mn,Tc:()=>wt,Hf:()=>qn,_A:()=>st,Ag:()=>gt,NU:()=>Cn,hW:()=>Sn,wB:()=>B,id:()=>x,MC:()=>E,SZ:()=>A});class r{get(t){return"todo"}}const o="";var s,c;!function(t){t.string="string",t.number="number",t.boolean="boolean",t[void 0]="undefined"}(s||(s={})),function(t){t.function="function",t.date="date",t.unknown="unknown",t.object="object"}(c||(c={}));const a={tag:"html",dom:"dom",templater:"templater",tagComponent:"tagComponent",tagArray:"tagArray",subject:"subject",tagJsSubject:"tagJsSubject",renderOnce:"renderOnce",stateRender:"stateRender",version:Date.now()};function u(t){return wn()?P((()=>i(t))):i(t)}function i(t){let e=t;const n=new Set;return{get value(){return e},set value(t){e!==t&&(e=t,n.forEach((e=>e(t))))},subscribe(t){t(e),n.add(t);const r=()=>n.delete(t);return r.unsubscribe=r,r}}}function l(t){switch(t){case s.string:case s.number:case s.boolean:return!0}return!1}function p(t){if(!t)return!1;switch(t.tagJsType){case a.dom:case a.tag:case a.templater:return!0}return!1}function f(t){const e=t?.tagJsType;return e===a.tagComponent||e===a.stateRender}function d(t){return b(t)&&typeof t.subscribe===c.function}function g(t){return t&&h(t.then)}function h(t){return typeof t===c.function}function b(t){return typeof t===c.object&&null!==t}function m(t){return Array.isArray(t)}function v(t){const e=new C;return e.subscribeWith=e=>{const n=[],r=[],o=(o,s)=>{n[s]=!0,r[s]=o;if(n.length===t.length){for(const t of n)if(!t)return;e(r,c)}},s=[...t],c=s.shift().subscribe((t=>o(t,0))),a=s.map(((t,e)=>t.subscribe((t=>o(t,e+1)))));return c.subscriptions=a,c},e}function y(t,e,n){const r=C.globalSubCount$;C.globalSubCount$.next(r.value+1);const o=function(){o.unsubscribe()};return o.callback=e,o.subscriptions=[],o.unsubscribe=function(){return function(t,e,n){!function(t,e){const n=t.findIndex((t=>t.callback===e));-1!==n&&t.splice(n,1)}(e,n);const r=C.globalSubCount$;C.globalSubCount$.next(r.value-1),t.unsubscribe=()=>t;const o=t.subscriptions;for(const t of o)t.unsubscribe();return t}(o,n,e)},o.add=t=>(o.subscriptions.push(t),o),o.next=t=>{e(t,o)},o}function w(t,e,n){const r=[...e],o=r.shift(),s=t=>{if(r.length)return w(t,r,n);n(t)};let c=s;const a=o(t,{setHandler:t=>c=t,next:s});c(a)}class C{value;onSubscription;methods=[];isSubject=!0;subscribers=[];subscribeWith;constructor(t,e){this.value=t,this.onSubscription=e}subscribe(t){const e=y(0,t,this.subscribers),n=this.subscribeWith;if(n){if(this.methods.length){const n=t;t=t=>{w(t,this.methods,(t=>n(t,e)))}}return n(t)}return this.subscribers.push(e),this.onSubscription&&this.onSubscription(e),e}next(t){this.value=t,this.emit()}set=this.next.bind(this);emit(){const t=this.value,e=this.subscribers;for(const n of e)n.callback(t,n)}toPromise(){return new Promise((t=>{this.subscribe(((e,n)=>{n.unsubscribe(),t(e)}))}))}toCallback(t){const e=this.subscribe(((n,r)=>{const o=r?.unsubscribe;o?o():setTimeout((()=>e.unsubscribe()),0),t(n)}));return this}pipe(...t){const e=new C(this.value);return e.setMethods(t),e.subscribeWith=t=>this.subscribe(t),e.next=t=>this.next(t),e}setMethods(t){this.methods=t}static all(t){return v(t.map((t=>{if(d(t))return t;return new C(t,(e=>(e.next(t),e)))})))}static globalSubCount$=new C(0)}class S extends C{value;onSubscription;_value;constructor(t,e){super(t,e),this.value=t,this.onSubscription=e,this._value=t,j(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 j(t){Object.defineProperty(t,"value",{set(e){t._value=e,t.emit()},get:()=>t._value})}class k extends C{value;constructor(t){super(t),this.value=t}subscribe(t){const e=super.subscribe(t);return t(this.value,e),e}}class T extends C{value;constructor(t){super(t),this.value=t,this._value=t,j(this)}subscribe(t){const e=super.subscribe(t);return t(this._value,e),e}}function x(t){return(e,n)=>{n.setHandler((()=>{})),t(e,n.next)}}function E(t){return(e,n)=>{n.setHandler((()=>{}));t(e).then((t=>n.next(t)))}}const A=t=>(e,n)=>{n.setHandler((()=>{}));const r=t(e).subscribe((t=>{r.unsubscribe(),n.next(t)}))};function P(t){return L.stateConfig.handlers.handler(t)}function O(t){const e=L.stateConfig;e.states[e.statesIndex]=t;return e.support.states[e.statesIndex]=t,++e.statesIndex,t(((...t)=>(P(t),t)))}function V(t){const e=L.stateConfig,n=e.support,r=e.statesIndex,o=e.prevSupport,s=o?.states[r],c=[];s(((...t)=>(c.push(t),t)));let a=0;return n.states[e.statesIndex]=t,++e.statesIndex,t(((...t)=>{e.stateArray.push({get:()=>t,defaultValue:t});const n=c[a];return++a,n}))}function J(t,e){e.handlers.handler=M,e.handlers.statesHandler=O,e.rearray=[],e.stateArray=[],e.states=[],e.statesIndex=0,e.support=t}function W(t,e,n,r){e.rearray=n,e.stateArray=[],e.states=r,e.statesIndex=0,e.handlers.handler=R,e.handlers.statesHandler=V,e.support=t}class N{}function I(t){const e=t.callback;if(!e)return t.defaultValue;const[n]=function(t){const[e]=t(N),[n]=t(e);return[e,n]}(e);return n}function R(){const t=L.stateConfig,e=t.rearray[t.stateArray.length];return t.stateArray.push(e),e.defaultValue}function M(t){const e=L.stateConfig;let n=t;if(typeof t===c.function&&(n=t()),typeof n===c.function){const t=n;n=function(...e){return t(...e)},n.original=t}const r={get:function(){return I(r)},defaultValue:n};return e.stateArray.push(r),n}const D=new C(void 0,(function(t){wn()||t.next()})),L={stateConfig:{stateArray:[],version:Date.now(),handlers:{handler:M,statesHandler:O}},tagClosed$:D};function $(t,e){for(let n=0;n<t.states.length;++n){let r;const o=t.states[n],s=e.states[n];o(((...t)=>(r=t,t))),s((()=>r))}}function _(t,e,n,r){for(let n=t.length-1;n>=0;--n){const r=t[n].get(),o=e[n].callback;o&&o(r)}for(let t=r.length-1;t>=0;--t){const e=[],o=(...t)=>(e.push(t),t);(0,r[t])(o);let s=0;const c=(...t)=>e[s++];n[t](c)}}const B=(t,e)=>U(t,e),H=t=>t;const U=(t,e,{init:n,before:r,final:o=H}={})=>{const s=P({pastResult:void 0,values:void 0}),c=s.values;if(void 0===c){if(r&&!r(t))return s.values=t,s.pastResult;const a=(n||e)(t,c);return s.pastResult=o(a),s.values=t,s.pastResult}if(t.every(((t,e)=>t===c[e])))return s.pastResult;if(r&&!r(t))return s.values=t,s.pastResult;const a=e(t,c);return s.pastResult=o(a),c.length=0,c.push(...t),s.pastResult};function F(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=P((()=>wn())),r=P((()=>new k(void 0))),o=P((()=>({stateArray:L.stateConfig.stateArray,states:L.stateConfig.states}))),s=(t,s)=>(U(t,((t,e)=>{const c=wn(),a=s(t,e);if(c!==n){const t=o.stateArray,e=n.subject.global.oldest;_(t,e.state,o.states,e.states)}r.next(a)}),e.setup),r);return s.setup=e.setup,F((()=>s),s),s}}),Object.defineProperty(e,"truthy",{get(){const e=t();return e.setup.before=t=>t.every((t=>t)),e}}),e}function z(t){return wn()?P((()=>new C(t))):new C(t)}function Z(t){return L.stateConfig.handlers.statesHandler(t)}function G(t){const e=u([]),n=u(0),r=u(0);let o=[],s=0;return r.value=n.value,t(((...t)=>(o=t,t))),B(o,(()=>{++s,e.value=o,t((()=>o))})),Z((()=>{if(s)return t(((...t)=>(e.value=t,n!=r?e.value:t))),r.value=n.value,void++n.value;t((()=>e.value))})),++s,e.value}F((()=>function(t){const e=(e,n)=>U(e,n,t);return e.setup=t,F((()=>e),e),e}({})),B),z._value=t=>{const e=P((function(){return{stateArray:L.stateConfig.stateArray,states:L.stateConfig.states}})),n=wn();return P((function(){return new k(t).pipe((t=>(_(n.state,e.stateArray,n.states,e.states),t)))}))},z.all=function(t){const e=P((()=>({stateArray:L.stateConfig.stateArray,states:L.stateConfig.states}))),n=wn();return C.all(t).pipe((t=>(_(n.state,e.stateArray,n.states,e.states),t)))};const X={create:t=>{const e=P((()=>({stateDiff:0,provider:void 0})));if(e.stateDiff){let t=e.stateDiff;for(;t--;)P(void 0);return P(void 0)}const n=P((()=>{const n=L.stateConfig,r=n.stateArray.length,o=t.prototype?new t:t(),s=n.support,c=n.stateArray.length-r,a={constructMethod:t,instance:o,stateDiff:c,owner:s,children:[]};e.provider=a;const u=s.subject.global;return(u.providers=u.providers||[]).push(a),e.stateDiff=c,o})),r=t,o=r.compareTo=r.toString();return e.provider.constructMethod.compareTo=o,n},inject:t=>P((()=>{const e=t,n=e.compareTo=e.compareTo||t.toString(),r=wn(),o=[];let s={ownerSupport:r.ownerSupport};for(;s.ownerSupport;){const t=s.ownerSupport.subject.global.providers;if(!t){s=s.ownerSupport;continue}const e=t.find((t=>{o.push(t);if(t.constructMethod.compareTo===n)return!0}));if(e){const t=r.subject.global;return(t.providers=t.providers||[]).push(e),e.children.push(r),e.instance}s=s.ownerSupport}const c=`Could not inject provider: ${t.name} ${t}`;throw console.warn(`${c}. Available providers`,o),new Error(c)}))};class q extends Error{details;constructor(t,e,n={}){super(t),this.name=q.name,this.details={...n,errorCode:e}}}class Q extends q{constructor(t,e){super(t,"array-no-key-error",e),this.name=Q.name}}class Y extends q{constructor(t,e){super(t,"state-mismatch-error",e),this.name=Y.name}}class K extends q{constructor(t,e){super(t,"sync-callback-error",e),this.name=K.name}}function tt(t,e){return et(t,e)}function et(t,e){if(null===t||typeof t!==c.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=m(t)?[]:Object.create(Object.getPrototypeOf(t));if(m(t))for(let r=0;r<t.length;r++)n[r]=et(t[r],e-1);else for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=et(t[r],e-1));return n}function nt(t,e,n){return rt(t,e,n)}function rt(t,e,n){return!(t!==e&&(r=t,o=e,!h(r)||!h(o)||r.toString()!==o.toString()))||(n<0||typeof t===c.object&&typeof e===c.object&&(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():m(t)&&m(e)?function(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!rt(t[r],e[r],n-1))return!1;return!0}(t,e,n-1):!m(t)&&!m(e)&&function(t,e,n){const r=Object.keys(t),o=Object.keys(e);if(0===r.length&&0===o.length)return!0;if(r.length!==o.length)return!1;for(const s of r){if(!o.includes(s)||!rt(t[s],e[s],n-1))return!1}return!0}(t,e,n-1)));var r,o}function ot(t,e){const n={propWatch:t,props:e,tagJsType:a.templater,key:function(t){return n.arrayValue=t,n}};return n}const st=[];function ct(t,e,n){return t.map((t=>function(t,e,n,r){if(p(t)||!t)return t;if(!e)return t;return at(t,e,n,r)}(t,e.ownerSupport,e,n)))}function at(t,e,n,r){if(!t)return t;if(t.tagJsType)return t;if(typeof t===c.function)return function(t,e){const n=t.mem;if(n)return t;const r=function(...t){return r.toCall(...t)};return r.original=t,r.mem=t,r.toCall=function(...t){return function(t,e,n){const r=n.subject.global,o=r?.newest||n,s=void 0===wn(),c=t(...e),a=function(){const t=o.subject.global;if(!1===s){if(!0===t.locked)return c}return function(t,e){const n=t.subject,r=ln(t.templater);if(r){return fn(e,t)}const o=n.global;o.locked=!0,un(o.newest,t,e,n),delete o.locked}(o,n),c};if(s)return a();return L.tagClosed$.toCallback(a),c}(r.mem,t,e)},Object.assign(r,t),r}(t,e);if(r===Et)return t;return it(t)?t:m(t)?function(t,e,n,r){for(let o=t.length-1;o>=0;--o){const s=t[o];if(t[o]=at(s,n,e,r+1),typeof s===c.function){if(s.mem)continue;ut(r+1,o,s,t,e)}}return t}(t,n,e,r):function(t,e,n,r){const o=Object.keys(t);for(const s of o){const o=t[s],a=at(o,n,e,r+1);if(t[s]===a)continue;const u=Object.getOwnPropertyDescriptor(t,s);if(!(u?.get||u?.set)&&(t[s]=a,typeof a===c.function)){if(o.mem)continue;ut(r+1,s,o,t,e)}}return t}(t,n,e,r)}function ut(t,e,n,r,o){if(t>0){const t=o.subject.global;r[e].subscription=t.destroy$.toCallback((function(){r[e]=n}))}}function it(t){return typeof t!==c.object||!t||t.tagJsType}function lt(t,e,n,r){const o=e.original;let s;t.tagJsType===a.stateRender?s=t():(s=o(...r),typeof s===c.function&&(s=s())),s.templater=t,t.tag=s;const u=L.stateConfig;return n.state=u.stateArray,n.states=u.states,n}function pt(t){return t.map(ft)}function ft(t,e){const n=t,r=t?.tagJsType;if(r)switch(r){case a.stateRender:return;case a.dom:case a.tag:case a.templater:return pt(n.values)}return m(t)?pt(n):tt(t,e)}function dt(t,e,n){const r={templater:t,subject:e,castedProps:n,appSupport:void 0},o=e.global;return o.blocked=[],o.destroy$=new C,r}function gt(t,e,n,r){e.state=[],e.states=[],e.appSupport=n;const o=t.props;return o&&(e.propsConfig=function(t,e,n){const r=t.templater;if(r.tagJsType!==a.stateRender){switch(r.propWatch){case yt.IMMUTABLE:return t.propsConfig={latest:e,castProps:n};case yt.SHALLOW:return t.propsConfig={latest:e.map((t=>ft(t,xt))),castProps:n}}return t.propsConfig={latest:e.map((t=>ft(t,Et))),castProps:n}}}(e,o,r)),e}function ht(t,e,n,r,o){const s={templater:t,subject:r,castedProps:o,appSupport:void 0};return s.ownerSupport=e,s.appSupport=n,s}function bt(t,e,n,r,o){const s=dt(t,r,o);return s.ownerSupport=e,gt(t,s,n,o)}function mt(t,e,n){const r=t.propWatch===yt.DEEP?Et:xt,o=t.props,s=e.propsConfig;let c=s.castProps;const a=n?.propsConfig,u=a?.castProps;u&&(s.castProps=u,c=rn(e,n,n.ownerSupport,o,r));return c||ct(o,e,0)}let vt=0;var yt;function wt(t,e=yt.SHALLOW){const n=function(...r){const o=ot(e,r);o.tagJsType=a.tagComponent;const s=function(t,e){return function(n,r,o){const s=mt(t,n,o),c=n.ownerSupport,a=bt(t,c,n.appSupport,r,s);return lt(t,e,a,s)}}(o,n);return s.original=t,o.wrapper=s,o},r=t;return n.original=t,r.tags=st,r.setUse=L,r.ValueTypes=a,r.tagIndex=vt++,st.push(n),n}function Ct(){throw new Error("Do not call tag.use as a function but instead set it as: `(props) => tag.use = (use) => html`` `")}function St(t,e,n){if(dn(t,e))return 11;switch(n){case yt.NONE:return 1;case yt.SHALLOW:return Tt(t,e);case yt.IMMUTABLE:return kt(t,e)}return function(t,e){let n=t,r=e;n=[...t],r=[...e||[]];if(!n.every(((t,e)=>function(t,e,n,r){const o=r[e];if(typeof t===c.object){const e={...t},n={...o||{}},r=Object.entries(e).every((([t,r])=>jt(r,n[t],(()=>{delete e[t],delete n[t]}))));return r}return jt(t,o,(()=>{n.splice(e,1),r.splice(e,1)}))}(t,e,n,r))))return 7;return!1}(t,e)}function jt(t,e,n){if(typeof t!==c.function)return!!nt(t,e,Et)&&4;if(typeof e!==c.function)return!1;const r=e?.original;r&&(e=r);t.original&&(t=t.original);return t.toString()===e.toString()?(n(),5):(n(),6)}function kt(t,e){const n=t.length;for(let r=0;r<n;++r){if(t[r]!==e[r])return 2}return!1}function Tt(t,e){const n=t.length;for(let r=0;r<n;++r){const n=t[r],o=e[r];if(m(n)&&m(o)){if(n===o)continue;return 3}if(typeof n!==c.function||typeof o!==c.function)if(typeof n!==c.object){if(n!==o)return 3.3}else if(typeof e===c.object){const t=Object.entries(n);for(const e of t){if(!At(e,o))return 3.1}}}return!1}!function(t){t.DEEP="deep",t.SHALLOW="shallow",t.NONE="none",t.IMMUTABLE="immutable"}(yt||(yt={})),wt.renderOnce=function(){throw new Error("Do not call tag.renderOnce as a function but instead set it as: `(props) => tag.renderOnce = () => html`` `")},wt.state=Ct,wt.use=Ct,wt.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`` `")},wt.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`` `")},wt.deepPropWatch=wt,wt.immutableProps=function(t){return wt(t,yt.IMMUTABLE)},wt.watchProps=function(t){return wt(t,yt.SHALLOW)},Object.defineProperty(wt,"renderOnce",{set(t){t.tagJsType=a.renderOnce}}),Object.defineProperty(wt,"state",{set(t){t.original={setUse:L,tags:st},t.tagJsType=a.stateRender}}),Object.defineProperty(wt,"use",{set(t){t.original={setUse:L,tags:st},t.tagJsType=a.stateRender}});const xt=3,Et=10;function At([t,e],n){const r=n[t];return typeof e===c.function&&typeof r===c.function||r===e}let Pt=[],Ot=[],Vt=[],Jt=[],Wt=[],Nt=[];const It={locks:0};function Rt(){if(!(It.locks>0)){for(let t=Pt.length-1;t>=0;--t){const e=Pt[t];e.parentNode.removeChild(e)}for(const t of Ot)t();for(const[t,e]of Vt)e.textContent=t;for(const t of Jt)t.relative.appendChild(t.element);for(const{element:t,relative:e}of Wt)e.parentNode.insertBefore(t,e);Pt=[],Ot=[],Jt=[],Wt=[],Vt=[];for(const t of Nt)t();Nt=[]}}function Mt(t,e){const n=document.createTextNode(t);return Wt.push({element:n,relative:e}),n}function Dt(t){switch(t){case void 0:case!1:case null:return o}return t}function Lt(t,e){const n=e.providers;if(n)for(const t of n)for(let n=t.children.length-1;n>=0;--n){t.children[n].subject.global===e&&t.children.splice(n,1)}e.destroy$&&e.destroy$.next(),t.subject.renderCount=0}function $t(t){for(const e of t){const t=e.lastArray;if(t){$t(t.map((t=>t.context)));continue}const n=e.global;if(!n)continue;const r=n.newest,o=n.subscriptions;o&&o.forEach((t=>t.unsubscribe())),f(r.templater)&&Lt(r,n);$t(n.context)}}function _t(t,e=[],n=[]){for(const r of t){const t=r.global;if(!t)continue;const o=t.newest;if(o){e.push(o);const r=t.subscriptions;r&&n.push(...r)}const s=t.context;s&&_t(s,e,n)}return{tags:e,subs:n}}function Bt(t,e){const n=t.context,r=t.destroys;if(r)return function(t,e,n){const r=[];if(t.forEach((t=>{const e=t();e instanceof Promise&&r.push(e)})),r.length){const t=Promise.all(r).then((()=>{++It.locks,Ht(e.context,n),Ut(e),--It.locks,Rt()}));return void n.push(t)}++It.locks,Ht(e.context,n),Ut(e),--It.locks,Rt()}(r,t,e);Ht(n,e),Ut(t)}function Ht(t,e){for(const n of t){if(n.withinOwnerElement)continue;const t=n.lastArray;if(t){Xt(n,t);continue}const r=n.simpleValueElm;if(r){delete n.simpleValueElm,Pt.push(r);continue}const o=n.global;if(void 0===o)continue;if(!0===o.deleted)continue;o.deleted=!0;o.oldest&&Bt(o,e)}}function Ut(t){t.htmlDomMeta.forEach((t=>{const e=t.marker;e&&Pt.push(e);const n=t.domElement;n&&Pt.push(n)}))}function Ft(t,e){const n=t.subject;e.deleted=!0,n.renderCount=0;const r=[];return $t(e.context),e.destroy$&&Lt(t,e),Bt(e,r),r}function zt(t,e,n,r,o){const s=t.length-1,c=e-r,a=c<0||s<c,u=n[e].context;if(a)return Zt(u,o),1;const i=function(t,e,n,r,o,s){const c=e&&t!==e.arrayValue;if(c)return Zt(n,r),o.splice(s,1),2;return 0}(u.value.arrayValue,t[e],u,o,n,e);return i}function Zt(t,e){!function(t,e){if(t){Ft(t.oldest,t)}else{const t=e.simpleValueElm;delete e.simpleValueElm,Pt.push(t)}}(t.global,t),++e.removed}function Gt(t,e){if(!m(t)){return Xt(e,e.lastArray),9}return!1}function Xt(t,e){const n={added:0,removed:0};for(let t=0;t<e.length;++t)Zt(e[t],n);delete t.lastArray}function qt(t,e){if(null==t||typeof t!==c.object)return function(t,e){const n=Dt(t),r=e.simpleValueElm;Vt.push([n,r])}(t,e),-1;const n=e.simpleValueElm;return delete e.simpleValueElm,Pt.push(n),6}function Qt(t,e){const n=t.templater,r=e.templater,o=n?.tag||t,s=r.tag;if(n?.tagJsType===a.stateRender)return n.dom===r.dom;switch(o.tagJsType){case a.dom:return s?.tagJsType===a.dom&&function(t,e){const n=t.dom,r=e.dom;return n===r}(o,s);case a.tag:{const n=function(t,e,n,r){const o=t.strings,s=e.strings;if(o.length!==s.length)return!1;if(!o.every(((t,e)=>s[e].length===t.length)))return!1;const a=n.templater.values||t.values,u=r.templater.values||e.values;return function(t,e){const n=t.length===e.length;if(!n)return!1;const r=e.every(((e,n)=>{const r=t[n];if(typeof e===c.function&&typeof r===c.function){return!!(e.toString()===r.toString())}return!0}));if(r)return!0;return!1}(a,u)}(o,s,t,e);return n}}throw new Error(`unknown tagJsType of ${o.tagJsType}`)}function Yt(t,e,n){Ot.push((()=>{Kt(t,e,n)}))}function Kt(t,e,n){void 0!==n&&!1!==n&&null!==n?t.setAttribute(e,n):t.removeAttribute(e)}function te(t,e,n,r,o,s){switch(r){case"init":{const t=s.added;return void Nt.push((()=>{e({target:n,stagger:t})}))}case"destroy":{const t=++s.removed,r=o.subject.global;return r.destroys=r.destroys||[],void r.destroys.push((()=>e({target:n,stagger:t})))}case"autofocus":return void Nt.push((()=>n.focus()));case"autoselect":return void Nt.push((()=>n.select()));case"style":{const r=t.split(".");return void Ot.push((()=>n.style[r[1]]=e))}case"class":return void function(t,e,n){const r=t.split(".");if(r.shift(),e){for(const t of r)Ot.push((()=>n.classList.add(t)));return}for(const t of r)Ot.push((()=>n.classList.remove(t)))}(t,e,n)}throw new Error(`Invalid special attribute of ${r}. ${t}`)}function ee(t,e){const n=function(t,e,n=[]){const r=t.subject;n.push({support:t,renderCount:r.renderCount,provider:e});const o=e.children;for(let t=o.length-1;t>=0;--t){const r=o[t],s=r.subject;n.push({support:r,renderCount:s.renderCount,provider:e})}return n}(t,e);return n}function ne(t,e=[]){const n=t.subject.global,r=ln(t.templater),o=t.ownerSupport;if(n.locked)return e.push(t),e;if(r)return ne(o,e);const s=t,c=f(s.templater),u=t.templater.tagJsType,i=o&&u!==a.stateRender&&(!c||function(t,e,n){const r=function(t,e){const n=t.props,r=e.propsConfig,o=r.latest;if(dn(n,o))return!0;switch(t.propWatch){case yt.IMMUTABLE:return kt(n,o);case yt.SHALLOW:return Tt(n,o)}return!nt(n,o,Et)}(e,n);if(t&&r)return!0;return!1}(o,s.templater,s)),l=function(t){const e=t.subject.global.providers;if(!e)return[];const n=[];for(const t of e){const e=ee(t.owner,t);n.push(...e.map((t=>t.support)))}return n}(s);return e.push(...l),i?(ne(o,e),c&&e.push(s),e):(e.push(s),e)}function re(t){++It.locks,t.forEach(oe),--It.locks,Rt()}function oe(t){const e=t.subject.global;e&&pn(e.newest)}const se="no-data-ever",ce="promise-no-data-ever";function ae(t,e){const n=e.subject.global,r=function(t,e){if(!0!==n.deleted)return function(t,e,n,r){let o=e;for(;o.ownerSupport&&!f(o.templater);)o=o.ownerSupport;const s=o.subject,c=s.global;c.locked=!0;const a=t.apply(n,r);delete c.locked;return function(t,e){const n=e.subject.global;return function(t,e,n){return re(ne(t)),function(t,e,n){if(g(t)){return e.subject.global.locked=!0,t.then((()=>{if(!0===n.deleted)return ce;delete e.subject.global.locked;return re(ne(e)),ce}))}return se}(e,t,n)}(e,t,n)}(a,o)}(r.tagFunction,r.support,t,e)};return r.tagFunction=t,r.support=e,r}const ue=["init","destroy"];function ie(t,e,n,r,o,s,c){if(c)return te(t,e,n,c,s,o);r(n,t,e)}function le(t,e,n,r){const o=t.appElement;"blur"===e&&(e="focusout");const s="_"+e,c=t.subject.global.events;if(!c[e]){const t=function(t){t.originalStopPropagation=t.stopPropagation,pe(t,s,t.target)};c[e]=t,o.addEventListener(e,t)}n[s]=r,n[e]=r}function pe(t,e,n){const r=n[e];if(r){let e=!1;if(t.stopPropagation=function(){e=!0,t.originalStopPropagation.call(t)},r(t),t.defaultPrevented||e)return}const o=n.parentNode;o&&pe(t,e,o)}function fe(t,e,n,r){const o=function(...e){return o.tagFunction(t,e)};o.tagFunction=e,o.support=n,le(n.appSupport,r,t,o)}function de(t){if(t.startsWith("class."))return"class";const e=function(t){switch(t){case"autoselect":return"autoselect";case"autofocus":return"autofocus";case"oninit":case"init":return"oninit";case"ondestroy":case"destroy":return"destroy"}return!1}(t);return!1!==e||!!t.startsWith("style.")&&"style"}const ge={added:0,removed:0};function he(t,e,n,r){if(n.isNameOnly)return function(t,e,n,r,o,s,a,u){if(n){if(Se(e))return void r.removeAttribute(n);if(typeof n===c.object)if(typeof e===c.object)for(const t in n)t in e||Ot.push((function(){r.removeAttribute(t)}));else for(const t in n)Ot.push((function(){r.removeAttribute(t)}))}me(t,e,r,o,s,a,u)}(t,e,n.value,n.element,r,n.howToSet,[],ge),void(n.value=e);const o=n.element;ve(e,n.attrName,n,o,r,n.howToSet,n.isSpecial,ge),n.value=e}function be(t,e,n,r,o,s,a,u,i){const l=Ce(e);if(l>=0){const e=t[l],c=Oe(e,s,!0);return c.isAttr=!0,c.element=n,c.howToSet=o,c.isNameOnly=!0,c.handler=(t,e)=>he(e,t,c,r),void me(t,e,n,r,o,s,u)}const p=Ce(i);if(p>=0){const i=t[p],l={isAttr:!0,element:n,attrName:e,checkValueChange:qt,withinOwnerElement:!0};s.push(l);return d(l.value)?function(t,e,n,r,o,s,c){s&&Ot.push((function(){n.removeAttribute(t)}));const a=e.value;if(d(a)){e.handler=je;const u=function(a){ve(a,t,e,n,r,o,s,c)},i=a.subscribe(u),l=e.global;(l.subscriptions=l.subscriptions||[]).push(i)}return void ve(e.value,t,e,n,r,o,s,c)}(e,l,n,r,o,a,u):(l.handler=(t,e)=>he(e,t,l,r),function(t,e,n,r,o,s,a,u){n.attrName=t,n.element=r,n.howToSet=o,typeof e===c.function?u&&ue.includes(t)?te(t,e,r,t,s,a):we(n,e,s,t,r):(n.attrName=t,n.element=r,n.howToSet=o,n.isSpecial=u,ie(t,e,r,o,a,s,u))}(e,i,l,n,o,r,u,a),void(l.value=i))}return ie(e,i,n,o,u,r,a)}function me(t,e,n,r,s,a,u){if(!Se(e))if(typeof e!==c.object)0!==e.length&&s(n,e,o);else for(const o in e){const c=e[o];be(t,o,n,r,s,a,de(o),u,c)}}function ve(t,e,n,r,o,s,c,u){return h(t)?function(t,e,n,r,o,s,c,u){const i=t.templater.wrapper;if((i?.tagJsType||i?.original?.tagJsType)!==a.renderOnce)return we(c,e,t,r,n);return ye(e,n,r,o,s,t,u)}(o,t,r,e,c,s,n,u):ye(t,r,e,c,s,o,u)}function ye(t,e,n,r,o,s,c){if(!1===r){switch(t){case void 0:case!1:case null:return void Ot.push((function(){e.removeAttribute(n)}))}if(h(t))return fe(e,t,s,n);o(e,n,t)}else te(n,t,e,r,s,c)}function we(t,e,n,r,o){const s=t.value;return s&&s.tagFunction&&s.support?(s.tagFunction=e,s.support=n,s):fe(o,e=ae(e,n),n,r)}function Ce(t){return b(t)&&"tagJsVar"in t?t.tagJsVar:-1}function Se(t){return null==t||!1===t}const je=()=>{},ke="object"==typeof document&&document.createElement("div");function Te(t,e,n,r,s,c,a,u,i=[]){const l=[];a&&void 0===u&&(u=document.createTextNode(o),Jt.push({element:u,relative:a}),a=void 0);for(let o=0;o<t.length;++o){const p=t[o],f=p.v;if(!isNaN(f)){const t=s.length;Ae(e[t],t,s,n,i,r,c,a,u);continue}const d={};if(l.push(d),"text"===p.nn){Ee(d,p,a,u);continue}const g=xe(d,p,e,n,s,r,a,u);p.ch&&(d.ch=Te(p.ch,e,n,r,s,c+1,g,u,i).dom)}return{subs:i,dom:l,context:s}}function xe(t,e,n,r,o,s,c,a){const u=t.domElement=document.createElement(e.nn);return e.at&&e.at.forEach((t=>{const e=t[0],c=t[1],a=t[2]||!1;be(n,e,u,r,Kt,o,a,s,c)})),c?Jt.push({element:u,relative:c}):Wt.push({element:u,relative:a}),u}function Ee(t,e,n,r){const o=t,s=o.tc=e.tc;ke.innerHTML=s;const c=o.domElement=document.createTextNode(ke.innerText);n?Jt.push({element:c,relative:n}):Wt.push({element:c,relative:r})}function Ae(t,e,n,r,s,c,a,u,i){const l=document.createTextNode(o),p=Oe(t,n,a>0);if(p.placeholder=l,u?Jt.push({relative:u,element:l}):Wt.push({relative:i,element:l}),d(t))return s.push({insertBefore:l,appendTo:u,subject:t,support:r,counts:c,contextItem:p}),void(p.handler=je);p.handler=(t,e,n,r)=>_e(r,t,n);r.subject.global.locked=!0,Ye(t,p,r,c,u,i);delete r.subject.global.locked,p.value=t}function Pe(t,e,n,r){const o=t.subject.global;o.oldest=t,o.newest=t,++It.locks;const s=function(t,e,n,r){const o=function(t){const e=t.templater,n=e.tag;if(n.tagJsType===a.dom)return n.dom;const r=n.strings;return Zn(r,n.values)}(t),s=t.templater.tag,c=s.values,u=[],i=t.subject.global;i.context=u;const l=Te(o,c,t,e,u,0,n,r);return l}(t,e,n,r);return o.htmlDomMeta=s.dom,--It.locks,s}function Oe(t,e,n){const r={value:t,checkValueChange:qt,withinOwnerElement:n};return e.push(r),r}function Ve(t,e,n){const r=e.global.newest;r.ownerSupport=t,e.checkValueChange=Fe;const o=Pe(r,n,void 0,e.placeholder);for(const t of o.subs)tn(t);return r}function Je(){return{tagJsType:a.templater}}function We(t,e,n){const r=ht(t,e,e.appSupport,n);return n.global.context=[],r}function Ne(t,e,n,r){const o=t[e],s=n[e];if(o===s.value)return;(0,s.handler)(o,t,r,s),s.value=o}function Ie(t,e){const n=t.subject.global.context;!function(t,e){const n=e.templater.tag||e.templater,r=e.templater.values||n.values,o=t.templater.tag;o.values=r}(t,e),++It.locks,function(t,e){const n=t.templater.tag.values;let r=0;const o=n.length;for(;r<o;)Ne(n,r,e,t),++r}(t,n),--It.locks,Rt()}function Re(t,e,r){r.checkValueChange=Fe;const o=t;let s=o.templater;s||(s=ot(yt.DEEP),s.tag=o,o.templater=s);const c=r.global=n(r),a=c.newest=bt(s,e,e.appSupport,r);return c.oldest=a,r}function Me(t,e,n,r,o){const s=void 0===t.lastArray;s&&(t.lastArray=[]);const c=t.lastArray;let a=t.placeholder,u=0;const i=[];if(!s){for(let t=0;t<c.length;++t){const n=c[t],o=zt(e,t,c,u,r);0!==o?2!==o?u+=o:t-=1:i.push(n)}t.lastArray=i}const l=e.length;for(let s=0;s<l;++s){a=De(e,s,t.lastArray,n,a,r,o).placeholder}}function De(t,e,n,r,o,s,c){const a=t[e],u=n[e];return u?function(t,e,n,r,o,s,c,a){const u=n.length>o;if(u)return _e(e,t,r),e;const i=Le(t,s,r,c,n,a);return i}(a,u.context,n,r,e,o,s,c):Le(a,o,r,s,n,c)}function Le(t,e,n,r,o,s){const c={value:t,checkValueChange:qt,withinOwnerElement:!1};r.added=r.added+1;const u=document.createTextNode("");return c.placeholder=u,s||Wt.push({element:u,relative:e}),function(t,e,n){const r=t.tagJsType;if(r)switch(r){case a.templater:Re(t.tag,e,n);break;case a.tag:case a.dom:Re(t,e,n)}}(t,n,c),Ye(t,c,n,r,s),c.value=t,o.push({context:c,global:c.global}),s&&Jt.push({element:u,relative:s}),c}const $e={added:0,removed:0};function _e(t,e,n){if(e===t.value)return;const r=t.checkValueChange(e,t);if(-1===r)return;const o=e&&e.tagJsType;if(o){if(o===a.renderOnce)return;Ue(t,e,n)}else m(e)?Me(t,e,n,{added:0,removed:0}):typeof e!==c.function?r&&function(t,e){e.checkValueChange=qt;const n=e.placeholder,r=Dt(t);e.simpleValueElm=Mt(r,n)}(e,t):t.value=e}function Be(t,e,r){if(!e.global.newest)return void en(t,e,r,{added:0,removed:0});!function(t,e,r){const o=r.global,s=o.newest,c=s.templater.wrapper,u=e.templater.wrapper;let i=!1;const l=e.templater.tagJsType,p=a.stateRender===l||a.renderOnce===l;if(p)i=e.templater.tagJsType===a.renderOnce||Qt(s,e);else if(c&&u){i=c.original===u.original}const f=e.templater;if(!i)return void function(t,e,r){const o=t.global,s=o.oldest;Ft(s,o),n(t);const c=en(e,t,r,{added:0,removed:0})}(r,f,t);const d=p||function(t,e){return St(e.props,t.propsConfig.latest,t.templater.propWatch)}(s,f);if(!d){return void function(t,e,n,r,o){const s=t.props,c=rn(e,n,r,s,o),a=e.propsConfig;a.castProps=c;const u=n.propsConfig;u.latest=a.latest}(f,e,s,t,f.propWatch===yt.DEEP?Et:xt)}if(o.locked)return void o.blocked.push(e);pn(e),++r.renderCount}(r,bt(t,r,r.appSupport,e),e)}function He(t,e,n,r){typeof n!==c.function&&function(t,e,n,r){const o=bt(n.templater||n,r,r.appSupport,e);Ie(t.subject.global.oldest,o)}(t,e,n,r)}function Ue(t,e,r){const o=e.tagJsType;if(f(e))return void 0===t.global&&n(t),Be(e,t,r),!0;const s=t.global;if(s){const n=s.newest;if(n)return He(n,t,e,r),!0}switch(o){case a.templater:return Ve(r,t,$e),!0;case a.tag:case a.dom:return function(t,e,r){const o=t;let s=o.templater;s||(s=Je(),o.templater=s,s.tag=o),(e.global?e.global:n(e)).newest=We(s,r,e),Ve(r,e,$e)}(e,t,r),!0}return!1}function Fe(t,e){const r=e.global,o=r?.newest;if(p(t)){return!Qt(t,o)&&(Ft(o,r),n(e),7)}const s=t?.tagJsType;if(s){return!0===Ue(e,t,r.newest.ownerSupport)&&-1}return 0===o.subject.renderCount?(delete e.global,e.renderCount=0,Nt.push((()=>{Ft(o,r),Nt.shift(),Rt()})),8):(Ft(o,r),delete e.global,e.renderCount=0,8)}function ze(t,e,n){const r=ot(yt.DEEP);r.tagJsType=t.tagJsType;const o=We(r,n,e);function s(){return r.tag=t(),o}return r.wrapper=s,s.tagJsType=t.tagJsType,s.original=t.original||t,o}function Ze(t,e){const n=t.rearray;n.length&&n.length!==t.stateArray.length&&function(t,e,n){const r=`Saved states between renders are inconsistent. Expected ${t.length} states got ${n.stateArray.length}.`,o=e.templater?.wrapper;let s=o;(o?.original||o?.original)&&(s=o.original);const c={oldStates:n.stateArray,newStates:n.rearray,tagFunction:s,templater:e.templater},a=new Y(r,c);throw console.error(Ge,c),a}(n,e,t)}const Ge="State tracking requires same number of state calls on every render. This error typically occurs when a state call is only reachable behind a condition. Also, wrapping tags that have state, with tag(), often helps when tag is only reachable by a condition.";function Xe(t,e){const n=t.subject;++n.renderCount;const r=L.stateConfig;delete r.support,t.state=r.stateArray,L.tagClosed$.next(e),Ze(r,t),n.global.newest=t}function qe(t,e,n,r){const o=n.global,s=n.renderCount,c=e?.state,u=L.stateConfig;if(c){const n=e.states;u.prevSupport=e,W(t,L.stateConfig,c,n)}else J(t,u);const i=t.templater;let l;if(i.tagJsType===a.stateRender){l=lt(i,i,bt(i,r,t.appSupport,n)),l.states=t.states}else{l=(0,i.wrapper)(t,n,e),l.states=t.states}return Xe(l,r),n.renderCount>s+1?o.newest:l}function Qe(t,e,n,r,o,s){n.checkValueChange=Fe;const c=We(t,e,n);c.ownerSupport=e;const a=Pe(c,r,o,o?void 0:s);for(const t of a.dom)t.marker&&(o?Jt.push({element:t.marker,relative:o}):Wt.push({element:t.marker,relative:s})),t.domElement&&(o?Jt.push({element:t.domElement,relative:o}):Wt.push({element:t.domElement,relative:s}));let u=-1;const i=a.subs.length-1;for(;u++<i;){tn(a.subs[u])}return c}function Ye(t,e,r,o,s,c){const u=t?.tagJsType;return u?function(t,e,r,o,s,c,u){switch(++e.renderCount,t){case a.templater:return e.checkValueChange=Fe,c?Qe(r,o,e,s,c,u):Ve(o,e,s);case a.dom:case a.tag:{e.checkValueChange=Fe;const t=r;let a=t.templater;a||(a=function(t){const e=Je();return e.tag=t,t.templater=e,e}(t));const i=n(e);return c?Qe(a,o,e,s,c,u):(i.newest=We(a,o,e),e.checkValueChange=Fe,Ve(o,e,s))}case a.stateRender:case a.tagComponent:if(n(e),e.checkValueChange=Fe,c){const t=function(t,e,n,r,o){const s=bt(t,n,n.appSupport,e),c=s.propsConfig;if(c){const e=t.tagJsType!==a.tagComponent?[]:mt(t,s);c.castProps=e}const u=e.global,{support:i}=cn(s,u.newest,e,n);return function(t,e,n){let r=Jt.length;const o=Pe(t,e,n,void 0);for(const t of o.dom)t.domElement&&Jt.splice(r++,0,{element:t.domElement,relative:n}),t.marker&&Jt.splice(r++,0,{element:t.marker,relative:n});const s=o.subs;for(const t of s)tn(t)}(i,r,o),i}(r,e,o,s,c);return t}return en(r,e,o,s);case a.renderOnce:{n(e);const t=ze(r,e,o);qe(t,void 0,e,o);const a=Qe(t.templater,o,e,s,c,u);return e.checkValueChange=Fe,a}}}(u,e,t,r,o,s,c):m(t)?(Me(e,t,r,o,s),void(e.checkValueChange=Gt)):void(d(t)||function(t,e,n){const r=Dt(t),o=Mt(r,n);e.simpleValueElm=o,e.checkValueChange=qt}(t,e,e.placeholder))}function Ke(t,e,n){const r=n.subject.global,o=t===e.value;r.deleted||o||(_e(e,t,n),L.stateConfig.support||Rt())}function tn({subject:t,support:e,counts:n,contextItem:r,appendTo:o}){let s=function(t){Ye(t,r,e,{...n},c?o:void 0),c||L.stateConfig.support||Rt(),s=function(t){Ke(t,r,e)}};let c=!0;const a=t.subscribe((function(t){s(t)}));r.subject=t,c=!1;const u=e.subject.global;(u.subscriptions=u.subscriptions||[]).push(a)}function en(t,e,n,r){const o=bt(t,n,n.appSupport,e),s=o.propsConfig;if(s){const e=t.tagJsType!==a.tagComponent?[]:mt(t,o);s.castProps=e}const c=e.global,{support:u}=cn(o,c.newest,e,n);return function(t,e,n){n.checkValueChange=Fe;const r=Pe(t,e,void 0,n.placeholder).subs;for(const t of r)tn(t)}(u,r,e),u}function nn(t,e,n,r,o,s){return null==t||s>o?e:typeof t===c.function?e.mem?(t.mem=e.mem,e):(t.mem=e,t):it(e)?e:m(e)?function(t,e,n,r,o,s){for(let c=t.length-1;c>=0;--c){const a=t[c],u=e[c];t[c]=nn(u,a,n,r,s,o+1)}return t}(e,t,n,r,s,o):function(t,e,n,r,o,s){const c=Object.keys(t);for(const a of c){const c=t[a],u=nn(e[a],c,n,r,s,o+1);if(c===u)continue;const i=Object.getOwnPropertyDescriptor(t,a)?.set;i||(t[a]=u)}return t}(e,t,n,r,s,o)}function rn(t,e,n,r,o,s=-1){if(0===o)throw new Error("before here");const c=e.subject.global.newest;if(!c){const e=ct(r,t,s);r.push(...e);return t.propsConfig.castProps=e,r}const a=(e=c||e).propsConfig.castProps,u=[];for(let e=0;e<r.length;++e){const c=r[e],i=nn(a[e],c,t,n,o,s+1);u.push(i)}return t.propsConfig.castProps=u,u}function on(t){const e=t.subject.global,{subs:r,tags:o}=_t(e.context);sn(t);for(const t of o)sn(t);e.subscriptions&&r.forEach((t=>t.unsubscribe())),n(t.subject)}function sn(t){const e=t.subject,n=e.global;!0!==n.deleted&&(n.deleted=!0,e.renderCount=0,Bt(n,[]))}function cn(t,e,n,r){const o=e?.templater,s=o?.tag,c=qe(t,e,n,r),u=!e||Qt(e,c);if(u){if(e){const t=e.templater.tag;t&&n.renderCount>0&&function(t,e,n){if(t.tagJsType===a.dom){const r=n?.dom;return void(r!==t.dom&&on(e))}if(n){const r=n.strings;if(r){const n=r?.length;n!==t.strings.length&&on(e)}}}(t,e,s)}}else{!function(t,e){const n=t.subject.global;let r=-1;const o=n.providers=n.providers||[],s=o.length-1;for(;r++<s;){const t=o[r];let s=-1;const c=t.children.length-1;for(;s++<c;)if(n===t.children[s].subject.global)return t.children.splice(s,1),void t.children.push(e)}}(e,c),on(e);const t=c.subject.global;t.oldest=c,t.newest=c}const i=e?.ownerSupport;return c.ownerSupport=r||i,{support:c,wasLikeTags:u}}const an={added:0,removed:0};function un(t,e,n,r){const o=r.global,{support:s,wasLikeTags:c}=cn(e,t,r,n);return c?(Ie(o.oldest,s),s):(Ve(n,r,an),s)}function ln(t){return a.templater===t.tagJsType}function pn(t){const e=t.subject.global,n=ln(t.templater),r=t.ownerSupport;if(e.locked)return e.blocked.push(t),t;if(n){return fn(r,t)}e.locked=!0;const o=t.subject;e.blocked.length&&(t=e.blocked.pop(),e.blocked=[]);const s=un(e.newest,t,r,o);return delete e.locked,s}function fn(t,e){const n=t.subject.global;if(!n||!0===n.deleted)return e;return pn(n.newest||t)}function dn(t,e){return t.length!==e.length}function gn(t){const e=wn();if(!e)throw mn;return hn(e,L.stateConfig,t)}function hn(t,e,n){const r=e.stateArray,o=e.states;return function(...e){return t.subject.renderCount>0?function(t,e,n,...r){const o=t.subject.global.newest;$(o,t);const s=e(...r);return $(t,o),pn(o),g(s)&&s.finally((()=>{$(t,o),pn(o)})),s}(t,n,{stateArray:r,states:o},...e):n(...e)}}const bn=()=>{const t=wn();if(!t)throw mn;const e=L.stateConfig;return function(n){return hn(t,e,n)}},mn=new K("callback() was called outside of synchronous rendering. Use `callback = callbackMaker()` to create a callback that could be called out of sync with rendering");function vn(t){P(t)}function yn(t){P((function(){wn().subject.global.destroy$.toCallback(t)}))}function wn(){return L.stateConfig.support}const Cn=":tagvar",Sn=":";function jn(t,e){const n={values:e,ownerSupport:wn(),tagJsType:a.tag,strings:t,key:t=>(n.arrayValue=t,n),html:function(t,e){return n.children={strings:t,values:e},n}};return n}function kn(t,e){const n={values:e,ownerSupport:wn(),dom:t,tagJsType:a.dom,key:function(t){return n.arrayValue=t,n},html:{dom:function(t,e){return n.children={dom:t,values:e},n}}};return n}const Tn=/(:tagvar\d+:)/,xn="ondoubleclick",En=/([:_a-zA-Z0-9\-.]+)\s*(?:=\s*"([^"]*)"|=\s*(\S+))?/g,An=/<\/?([a-zA-Z0-9-]+)((?:\s+[a-zA-Z_:*][\w:.-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)+\s*|\s*)\/?>/g;function Pn(t){const e=[],n=[],r=[];let o=null,s=-1,c=0;const a=new RegExp(An,"g");for(t=function(t){return t.replace(On,(function(t){return t.replace(/\[l t\]/g,"[l t]").replace(/\[g t\]/g,"[g t]").replace(/</g,"[l t]").replace(/>/g,"[g t]")}))}(t);c<t.length;){const u=a.exec(t);if(!u)break;const[i,l,p]=u,f=i.startsWith("</"),d=i.endsWith("/>");if(c<u.index){const e=t.slice(c,u.index);if(e.trim()){Nn(e).forEach((t=>{t.startsWith(Cn)&&(t=Cn+ ++s+Sn),Jn(o,n,t)}))}}if(c=u.index+i.length,f){o=r.pop()||null;continue}const g=[];let h;for(;null!==(h=En.exec(p));){const t=h[1]||h[3]||h[5];let n=h[2]||h[4]||h[6];if(void 0===t)continue;const r=""!==h[2],o=void 0===n&&r,c=t.toLowerCase(),a=c.startsWith("on")?Vn(c):c;if(o){if(t.slice(0,Cn.length)===Cn){const t=Cn+ ++s+Sn;e.push(["at",t]),g.push([t]);continue}if(h[0].startsWith(t)&&h[0].slice(t.length,h[0].length).search(/\s+$/)>=0){g.push([a]);continue}n=Cn+ ++s+Sn}r||(n=h[2]);const u=[a,n],i=de(c);i&&u.push(i),g.push(u)}const b={nn:l};g.length&&(b.at=g),o?(o.ch||(o.ch=[]),o.ch.push(b)):n.push(b),d||(r.push(o),o=b)}if(c<t.length){const e=t.slice(c);if(e.trim()){Nn(e).forEach((t=>(t.startsWith(Cn)&&++s,Jn(o,n,t))))}}return n}const On=new RegExp("(\x3c!--[\\s\\S]*?--\x3e)","g");function Vn(t){if(t.startsWith("on")){return t.length===xn.length&&t===xn?"dblclick":t.slice(2,t.length)}return t}function Jn(t,e,n){!function(t,e,n){t?(t.ch||(t.ch=[]),t.ch.push(n)):e.push(n)}(t,e,{nn:"text",tc:Wn(n)})}function Wn(t){return t.replace(/(\[l t\]!--[\s\S]*?--\[g t\])/g,(function(t){return t.replace(/\[l t\]/g,"<").replace(/\[g t\]/g,">").replace(/\[l t\]/g,"[l t]").replace(/\[g t\]/g,"[g t]")}))}function Nn(t){return t.split(Tn).filter((t=>""!==t))}const In=/(^:tagvar\d+:|:tagvar\d+:$)/g,Rn="__safeTagVar";function Mn(t,e){return function(t,e){const n=t.map(((t,n)=>n<e.length?t+Cn+n+Sn:t));return function(t,e,n){const r=n.length-e.length;if(r>0)for(let n=r;n>0;--n)t.push(Cn+(e.length+n-1)+Sn)}(n,t,e),n}(t.map((t=>t.replace(In,((t,e)=>Rn+e)))),e)}const Dn=new RegExp(Cn+"(\\d+)"+Sn,"g"),Ln="ch";function $n(t,e,n=[],r=[]){const o=t;for(let t=0;t<o.length;t++){const s=[...r,t],c=o[t];if(c.at){const t=c.at;c.at=Bn(t,e)}if(c.ch){const t=c.ch,r=[...s,Ln];c.ch=$n(t,e,n,r)}t=_n(c,e,o,t)}return o}function _n(t,e,n,r){if("text"!==t.nn)return r;const o=t;let c,a=o.tc;if(typeof a!==s.string)return r;for(;null!==(c=Dn.exec(a));){const t=c[1],o=parseInt(t,10);if(!isNaN(o)&&o<e){const t=Cn+o+Sn,e=a.slice(c.index+t.length);n.splice(r,1,{nn:"text",v:o}),a=e,Dn.lastIndex=0}}return o.tc=a,r}function Bn(t,e){return t.map((t=>{const[n,r,o]=t;if(n.startsWith(Cn)){const t=parseInt(n.replace(Cn,""),10);if(!isNaN(t)&&t<e)return[{tagJsVar:t}]}if(typeof r===s.string&&r.startsWith(Cn)){const t=parseInt(r.replace(Cn,""),10);if(!isNaN(t)&&t<e)return[n,{tagJsVar:t},o]}return t}))}const Hn="__safeTagVar";const Un=/__safeTagVar(\d+)/g;function Fn(t){if(t.at&&(t.at=t.at?t.at.map((t=>{if(1===t.length)return t;const[,e]=t;if(typeof e===s.string&&e.startsWith(Hn)){const n=parseInt(e.replace(Hn,""),10);t[1]=Cn+n+Sn}return t})):[]),t.ch){const e=t.ch;for(let t=0;t<e.length;t++){const n=e[t];if("text"===n.nn){if(typeof n.tc!==s.string)return;n.tc=n.tc.replace(Un,((t,e)=>Cn+e+Sn))}Fn(n)}0===e.length&&delete t.ch}}const zn={};function Zn(t,e){const n=function(t){const e=t.map((t=>t.length));return e.push(t.length),Number(e.join(""))}(t),r=zn[n],o=r&&function(t,e,n){if(n&&n.strings.length===t.length&&n.strings.every(((e,n)=>e===t[n]))&&n.values.length===e.length)return!0;return!1}(t,e,r);if(o)return r.domMetaMap;const s=function(t,e){return Mn(t,e),Pn(Mn(t,e).join(""))}(t,e),c=$n(s,e.length);c.forEach(Fn);const a={interpolation:void 0,string:void 0,strings:t,values:e,domMetaMap:c};return zn[n]=a,c}function Gn(t,...e){const n=jn(t,e),r=ot(yt.NONE);return r.tag=n,n.templater=r,n}Gn.dom=function(t,...e){return kn(t,e)};const Xn=[];function qn(t,e,r){const o=Xn.findIndex((t=>t.element===e));if(o>=0){const t=Xn[o].support;Ft(t,t.subject.global),Xn.splice(o,1),console.warn("Found and destroyed app element already rendered to element",{element:e})}let s=()=>l(r);s.propWatch=yt.NONE,s.tagJsType=a.stateRender,s.props=[r],s.isApp=!0;const u=function(t,e){const r={value:t,checkValueChange:Fe,withinOwnerElement:!1,renderCount:0,global:void 0},o=n(r);return o.events={},Qn(t,r,e),r}(s,e),i=u.global;J(i.newest,L.stateConfig);let l=t(r);const p=typeof l==c.function;p||(f(l)?(i.newest.propsConfig={latest:[r],castProps:[r]},s.propWatch=l.propWatch,s.tagJsType=l.tagJsType,s.wrapper=l.wrapper,s=l):(s.tag=l,l=t));const d=document.createTextNode("");st.push(s.wrapper||{original:s});const g=Yn(s,d,e,u,p);if(i.isApp=!0,p&&(l.tag=g.templater.tag),!e)throw new Error(`Cannot tagElement, element received is type ${typeof e} and not type Element`);e.destroy=function(){const t=i.events;for(const n in t){const r=t[n];e.removeEventListener(n,r)}i.events={},++It.locks;const n=Ft(g,i);return--It.locks,Rt(),n},++It.locks;const h=function(t,e,n,r,o,s){const c=Pe(t,{added:0,removed:0},e,void 0);n.oldest=t,n.newest=t;let u=r.setUse;if(r.tagJsType!==a.stateRender){const t=o.original;u=t.setUse,t.isApp=!0}e.setUse=u,e.ValueTypes=a,Xn.push({element:e,support:t});const i=document.createDocumentFragment();i.appendChild(s);for(const t of c.dom)Kn(t,i);for(const t of c.subs)tn(t);return i}(g,e,i,s,t,d);return--It.locks,Rt(),e.appendChild(h),{support:g,tags:st,ValueTypes:a}}function Qn(t,e,n){const r=e.global,o=dt(t,e);return gt(t,o,o),o.appElement=n,r.oldest=r.oldest||o,r.newest=o,o}function Yn(t,e,n,r,o){r.placeholder=e;const s=r.global,c=s.newest,u=s.oldest;if(c===u||W(c,L.stateConfig,u.state,u.states),t.tagJsType===a.stateRender){const e=t.wrapper||{original:t};if(!o){const e=Qn(t,r,n);return Xe(e),e}const s=lt(t,e,c);return Xe(s),s}const i=(0,t.wrapper)(c,r);return Xe(i),i}function Kn(t,e){t.domElement&&e.appendChild(t.domElement),t.marker&&e.appendChild(t.marker)}const tr={tagElement:qn,renderWithSupport:cn,renderSupport:pn,renderTagOnly:qe,paint:Rt};var er=e.W9,nr=e.cg,rr=e.m0,or=e.rS,sr=e.Y2,cr=e.ei,ar=e.B7,ur=e.TU,ir=e.XF,lr=e.PC,pr=e.Ot,fr=e.Mj,dr=e.tD,gr=e.j8,hr=e.um,br=e.E2,mr=e.OH,vr=e.TB,yr=e.Ii,wr=e.yV,Cr=e.zV,Sr=e.ze,jr=e.WJ,kr=e.aZ,Tr=e.O,xr=e.Ie,Er=e.B4,Ar=e.Az,Pr=e.Xi,Or=e.pc,Vr=e.Ah,Jr=e.ck,Wr=e.k6,Nr=e.Gk,Ir=e.zC,Rr=e.cF,Mr=e.jU,Dr=e.PB,Lr=e.qy,$r=e.cy,_r=e.Tn,Br=e.Gv,Hr=e.yL,Ur=e.D8,Fr=e.Ze,zr=e._4,Zr=e.mn,Gr=e.z,Xr=e.sA,qr=e.MG,Qr=e.PL,Yr=e.nI,Kr=e.PZ,to=e.N_,eo=e.r5,no=e.uc,ro=e.pG,oo=e.QB,so=e.R6,co=e.Ll,ao=e.vP,uo=e.wk,io=e.xP,lo=e.bc,po=e.ag,fo=e.Tc,go=e.Hf,ho=e._A,bo=e.Ag,mo=e.NU,vo=e.hW,yo=e.wB,wo=e.id,Co=e.MC,So=e.SZ;export{er as ArrayNoKeyError,nr as BasicTypes,rr as ImmutableTypes,or as PropWatches,sr as RouteQuery,cr as StateMismatchError,ar as Subject,ur as Subjective,ir as SyncCallbackError,lr as TagError,pr as ValueSubject,fr as ValueSubjective,dr as ValueTypes,gr as addOneContext,hr as buildBeforeElement,br as callback,mr as callbackMaker,vr as checkArrayValueChange,yr as checkSimpleValueChange,wr as checkTagValueChange,Cr as combineLatest,Sr as createTrigger,jr as defineValueOn,kr as destroyArray,Tr as destroySupport,xr as empty,Er as getBaseSupport,Ar as getDomMeta,Pr as getDomTag,Or as getHtmlSupport,Vr as getNewGlobal,Jr as getStringTag,Wr as getSupport,Nr as getTemplaterResult,Ir as hasPropChanges,Rr as hmr,Mr as howToSetFirstInputValue,Dr as howToSetInputValue,Lr as html,$r as isArray,_r as isFunction,Br as isObject,Hr as isPromise,Ur as isSimpleType,Fr as isStaticTag,zr as isSubjectInstance,Zr as isTagComponent,Gr as letProp,Xr as onDestroy,qr as onInit,Qr as oneRenderToSupport,Yr as paint,Kr as processFirstSubjectValue,to as processSubUpdate,eo as providers,no as renderSupport,ro as renderTagOnly,oo as renderWithSupport,so as runWrapper,co as setUseMemory,ao as signal,uo as state,io as states,lo as subject,po as syncError,fo as tag,go as tagElement,ho as tags,bo as upgradeBaseToSupport,mo as variablePrefix,vo as variableSuffix,yo as watch,wo as willCallback,Co as willPromise,So as willSubscribe};
|
|
1
|
+
var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function n(t){return t.renderCount=t.renderCount||0,t.global={}}t.d(e,{W9:()=>de,cg:()=>c,m0:()=>s,rS:()=>Se,Y2:()=>r,ei:()=>ge,B7:()=>R,TU:()=>L,XF:()=>he,PC:()=>fe,Ot:()=>ln,Mj:()=>pn,tD:()=>a,j8:()=>Yt,um:()=>Qt,E2:()=>Tn,OH:()=>En,TB:()=>Jt,Ii:()=>Nt,yV:()=>se,zV:()=>I,pf:()=>qe,ze:()=>jn,WJ:()=>M,Ng:()=>Wt,VI:()=>ce,aZ:()=>It,O:()=>Ot,Ie:()=>o,B4:()=>Ge,Az:()=>sr,Xi:()=>Rn,Ah:()=>n,ck:()=>Wn,Gk:()=>ie,zC:()=>$e,cF:()=>dr,jU:()=>Q,PB:()=>q,qy:()=>cr,cy:()=>S,Tn:()=>C,Gv:()=>k,yL:()=>w,D8:()=>b,Ze:()=>m,_4:()=>y,mn:()=>v,z:()=>kn,sA:()=>On,MG:()=>An,PL:()=>pe,nI:()=>h,PZ:()=>_t,N_:()=>fr,r5:()=>Sn,uc:()=>Me,pG:()=>ye,QB:()=>Je,R6:()=>lr,Ll:()=>B,vP:()=>an,wk:()=>hn,xP:()=>Cn,bc:()=>wn,B1:()=>Pn,ag:()=>xn,Tc:()=>Te,Hf:()=>ur,_A:()=>le,Ag:()=>Xe,NU:()=>In,hW:()=>Nn,wB:()=>bn,id:()=>fn,MC:()=>dn,SZ:()=>gn});class r{get(t){return"todo"}}const o="";var s,c;!function(t){t.string="string",t.number="number",t.boolean="boolean",t[void 0]="undefined"}(s||(s={})),function(t){t.function="function",t.date="date",t.unknown="unknown",t.object="object"}(c||(c={}));const a={tag:"html",dom:"dom",templater:"templater",tagComponent:"tagComponent",tagArray:"tagArray",subscribe:"subscribe",signal:"signal",renderOnce:"renderOnce",stateRender:"stateRender",version:Date.now()};let u=[],i=[],l=[],p=[],f=[],d=[];const g={locks:0};function h(){if(!(g.locks>0)){for(let t=u.length-1;t>=0;--t){const e=u[t];e.parentNode.removeChild(e)}for(const t of i)t();for(const[t,e]of l)e.textContent=t;for(const t of p)t.relative.appendChild(t.element);for(const{element:t,relative:e}of f)e.parentNode.insertBefore(t,e);u=[],i=[],p=[],f=[],l=[];for(const t of d)t();d=[]}}function b(t){switch(t){case s.string:case s.number:case s.boolean:return!0}return!1}function m(t){if(!t)return!1;switch(t.tagJsType){case a.dom:case a.tag:case a.templater:return!0}return!1}function v(t){const e=t?.tagJsType;return e===a.tagComponent||e===a.stateRender}function y(t){return k(t)&&typeof t.subscribe===c.function}function w(t){return t&&C(t.then)}function C(t){return typeof t===c.function}function k(t){return typeof t===c.object&&null!==t}function S(t){return Array.isArray(t)}function T(t){let e=t;for(;e.ownerSupport&&!v(e.templater);)e=e.ownerSupport;return e.subject.global.newest||e}function j(t){const e=B.stateConfig;return e.states[e.statesIndex]=t,++e.statesIndex,t(((...t)=>t))}function E(t){const e=B.stateConfig,n=e.statesIndex,r=T(e.prevSupport).states[n];let o=[];r((function(...t){return o=t,t}));return e.states[e.statesIndex]=t,++e.statesIndex,t(((...t)=>o))}function x(t,e){e.handlers.handler=J,e.handlers.statesHandler=j,e.rearray=[],e.stateArray=[],e.states=[],e.statesIndex=0,e.support=t}function A(t,e,n,r){n.rearray=r,n.stateArray=[],n.states=[],n.statesIndex=0,n.handlers.handler=V,n.handlers.statesHandler=E,n.prevSupport=e}class O{}function P(t){const e=t.callback;if(!e)return t.defaultValue;const[n]=function(t){const[e]=t(O),[n]=t(e);return[e,n]}(e);return n}function V(){const t=B.stateConfig,e=t.rearray[t.stateArray.length];return t.stateArray.push(e),e.defaultValue}function J(t){const e=B.stateConfig;let n=t;if(typeof t===c.function&&(n=t()),typeof n===c.function){const t=n;n=function(...e){return t(...e)},n.original=t}const r={get:function(){return P(r)},defaultValue:n};return e.stateArray.push(r),n}function I(t){const e=new R;return e.subscribeWith=e=>{const n=[],r=[],o=(o,s)=>{n[s]=!0,r[s]=o;if(n.length===t.length){for(const t of n)if(!t)return;e(r,c)}},s=[...t],c=s.shift().subscribe((t=>o(t,0))),a=s.map(((t,e)=>t.subscribe((t=>o(t,e+1)))));return c.subscriptions=a,c},e}function N(t,e,n){const r=R.globalSubCount$;R.globalSubCount$.next(r.value+1);const o=function(){o.unsubscribe()};return o.callback=e,o.subscriptions=[],o.unsubscribe=function(){return function(t,e,n){!function(t,e){const n=t.findIndex((t=>t.callback===e));-1!==n&&t.splice(n,1)}(e,n);const r=R.globalSubCount$;R.globalSubCount$.next(r.value-1),t.unsubscribe=()=>t;const o=t.subscriptions;for(const t of o)t.unsubscribe();return t}(o,n,e)},o.add=t=>(o.subscriptions.push(t),o),o.next=t=>{e(t,o)},o}function W(t,e,n){const r=[...e],o=r.shift(),s=t=>{if(r.length)return W(t,r,n);n(t)};let c=s;const a=o(t,{setHandler:t=>c=t,next:s});c(a)}class R{value;onSubscription;methods=[];isSubject=!0;subscribers=[];subscribeWith;constructor(t,e){this.value=t,this.onSubscription=e}subscribe(t){const e=N(0,t,this.subscribers),n=this.subscribeWith;if(n){if(this.methods.length){const n=t;t=t=>{W(t,this.methods,(t=>n(t,e)))}}return n(t)}return this.subscribers.push(e),this.onSubscription&&this.onSubscription(e),e}next(t){this.value=t,this.emit()}set=this.next.bind(this);emit(){const t=this.value,e=this.subscribers;for(const n of e)n.callback(t,n)}toPromise(){return new Promise((t=>{this.subscribe(((e,n)=>{n.unsubscribe(),t(e)}))}))}toCallback(t){const e=this.subscribe(((n,r)=>{const o=r?.unsubscribe;o?o():setTimeout((()=>e.unsubscribe()),0),t(n)}));return this}pipe(...t){const e=new R(this.value);return e.setMethods(t),e.subscribeWith=t=>this.subscribe(t),e.next=t=>this.next(t),e}setMethods(t){this.methods=t}static all(t){return I(t.map((t=>{if(y(t))return t;return new R(t,(e=>(e.next(t),e)))})))}static globalSubCount$=new R(0)}class L extends R{value;onSubscription;_value;constructor(t,e){super(t,e),this.value=t,this.onSubscription=e,this._value=t,M(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 M(t){Object.defineProperty(t,"value",{set(e){t._value=e,t.emit()},get:()=>t._value})}const D=new R(void 0,(function(t){Vn()||t.next()})),B={stateConfig:{stateArray:[],version:Date.now(),handlers:{handler:J,statesHandler:j}},tagClosed$:D};function $(t,e){for(let n=0;n<t.length;++n){_(t[n],e[n])}}function _(t,e){let n;t(((...t)=>(n=t,t)),1),e((()=>n),2)}function H(t,e,n,r){for(let n=t.length-1;n>=0;--n){const r=t[n].get(),o=e[n].callback;o&&o(r)}for(let t=r.length-1;t>=0;--t){const e=[],o=(...t)=>(e.push(t),t);(0,r[t])(o);let s=0;const c=(...t)=>e[s++];n[t](c)}}function U(t,e){return F(t,e)}function F(t,e){if(null===t||typeof t!==c.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=S(t)?[]:Object.create(Object.getPrototypeOf(t));if(S(t))for(let r=0;r<t.length;r++)n[r]=F(t[r],e-1);else for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=F(t[r],e-1));return n}function z(t,e,n){return Z(t,e,n)}function Z(t,e,n){return!(t!==e&&(r=t,o=e,!C(r)||!C(o)||r.toString()!==o.toString()))||(n<0||typeof t===c.object&&typeof e===c.object&&(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():S(t)&&S(e)?function(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!Z(t[r],e[r],n-1))return!1;return!0}(t,e,n-1):!S(t)&&!S(e)&&function(t,e,n){const r=Object.keys(t),o=Object.keys(e);if(0===r.length&&0===o.length)return!0;if(r.length!==o.length)return!1;for(const s of r){if(!o.includes(s)||!Z(t[s],e[s],n-1))return!1}return!0}(t,e,n-1)));var r,o}function G(t){return t.map(X)}function X(t,e){const n=t,r=t?.tagJsType;if(r)switch(r){case a.signal:case a.subscribe:case a.stateRender:return;case a.dom:case a.tag:case a.templater:return G(n.values)}return S(t)?G(n):U(t,e)}function q(t,e,n){i.push((()=>{Q(t,e,n)}))}function Q(t,e,n){void 0!==n&&!1!==n&&null!==n?t.setAttribute(e,n):t.removeAttribute(e)}function Y(t,e,n,r,o,s){switch(r){case"init":{const t=s.added;return void d.push((()=>{e({target:n,stagger:t})}))}case"destroy":{const t=++s.removed,r=o.subject.global;return r.destroys=r.destroys||[],void r.destroys.push((()=>e({target:n,stagger:t})))}case"autofocus":return void d.push((()=>n.focus()));case"autoselect":return void d.push((()=>n.select()));case"style":{const r=t.split(".");return void i.push((()=>n.style[r[1]]=e))}case"class":return void function(t,e,n){const r=t.split(".");if(r.shift(),e){for(const t of r)i.push((()=>n.classList.add(t)));return}for(const t of r)i.push((()=>n.classList.remove(t)))}(t,e,n)}throw new Error(`Invalid special attribute of ${r}. ${t}`)}function K(t,e){const n=function(t,e,n=[]){const r=t.subject;n.push({support:t,renderCount:r.renderCount,provider:e});const o=e.children;for(let t=o.length-1;t>=0;--t){const r=o[t],s=r.subject;n.push({support:r,renderCount:s.renderCount,provider:e})}return n}(t,e);return n}function tt(t,e=[]){const n=t.subject.global,r=Le(t.templater),o=t.ownerSupport;if(n.locked)return e.push(t),e;if(r)return tt(o,e);const s=t,c=v(s.templater),u=t.templater.tagJsType,i=o&&u!==a.stateRender&&(!c||function(t,e,n){const r=function(t,e){const n=t.props,r=e.propsConfig,o=r.latest;if(Be(n,o))return!0;switch(t.propWatch){case Se.IMMUTABLE:return He(n,o);case Se.SHALLOW:return Ue(n,o)}return!z(n,o,ze)}(e,n);if(t&&r)return!0;return!1}(o,s.templater,s)),l=function(t){const e=t.subject.global.providers;if(!e)return[];const n=[];for(const t of e){const e=K(t.owner,t);n.push(...e.map((t=>t.support)))}return n}(s);return e.push(...l),i?(tt(o,e),c&&e.push(s),e):(e.push(s),e)}function et(t){++g.locks,t.forEach(nt),--g.locks,h()}function nt(t){const e=t.subject.global;e&&Me(e.newest)}const rt="no-data-ever",ot="promise-no-data-ever";function st(t,e){const n=e.subject.global,r=function(t,e){if(!0!==n.deleted)return function(t,e,n,r,o){const s=T(e),c=s.subject,a=c.global;a.locked=!0;const u=t.apply(r,o);delete a.locked;const i=function(t,e){const n=e.subject.global;return function(t,e,n){return et(tt(t)),function(t,e,n){if(w(t)){return e.subject.global.locked=!0,t.then((()=>{if(!0===n.deleted)return ot;delete e.subject.global.locked;return et(tt(e)),ot}))}return rt}(e,t,n)}(e,t,n)}(u,s);return i}(r.tagFunction,r.support,r.states,t,e)};r.tagFunction=t;const o=T(e);r.support=e;const s=o.states;return r.states=s,r}const ct=["init","destroy"];function at(t,e,n,r,o,s,c){if(c)return Y(t,e,n,c,s,o);r(n,t,e)}function ut(t,e,n,r){const o=t.appElement;"blur"===e&&(e="focusout");const s="_"+e,c=t.subject.global.events;if(!c[e]){const t=function(t){t.originalStopPropagation=t.stopPropagation,it(t,s,t.target)};c[e]=t,o.addEventListener(e,t)}n[s]=r,n[e]=r}function it(t,e,n){const r=n[e];if(r){let e=!1;if(t.stopPropagation=function(){e=!0,t.originalStopPropagation.call(t)},r(t),t.defaultPrevented||e)return}const o=n.parentNode;o&&it(t,e,o)}function lt(t,e,n,r){const o=function(...e){return o.tagFunction(t,e)};o.tagFunction=e,o.support=n,ut(n.appSupport,r,t,o)}function pt(t){if(t.startsWith("class."))return"class";const e=function(t){switch(t){case"autoselect":return"autoselect";case"autofocus":return"autofocus";case"oninit":case"init":return"oninit";case"ondestroy":case"destroy":return"destroy"}return!1}(t);return!1!==e||!!t.startsWith("style.")&&"style"}const ft={added:0,removed:0};function dt(t,e,n,r){if(n.isNameOnly)return function(t,e,n,r,o,s,a,u){if(n){if(wt(e))return void r.removeAttribute(n);if(typeof n===c.object)if(typeof e===c.object)for(const t in n)t in e||i.push((function(){r.removeAttribute(t)}));else for(const t in n)i.push((function(){r.removeAttribute(t)}))}ht(t,e,r,o,s,a,u)}(t,e,n.value,n.element,r,n.howToSet,[],ft),void(n.value=e);const o=n.element;bt(e,n.attrName,n,o,r,n.howToSet,n.isSpecial,ft),n.value=e}function gt(t,e,n,r,o,s,a,u,l){const p=yt(e);if(p>=0){const e=t[p],c=Yt(e,s,!0);return c.isAttr=!0,c.element=n,c.howToSet=o,c.isNameOnly=!0,c.handler=(t,e)=>dt(e,t,c,r),void ht(t,e,n,r,o,s,u)}const f=yt(l);if(f>=0){const l=t[f],p={isAttr:!0,element:n,attrName:e,checkValueChange:Nt,delete:Wt,withinOwnerElement:!0};s.push(p);return y(p.value)?function(t,e,n,r,o,s,c){s&&i.push((function(){n.removeAttribute(t)}));const a=e.value;if(y(a)){e.handler=zt;const u=function(a){bt(a,t,e,n,r,o,s,c)},i=a.subscribe(u),l=e.global;(l.subscriptions=l.subscriptions||[]).push(i)}return void bt(e.value,t,e,n,r,o,s,c)}(e,p,n,r,o,a,u):(p.handler=(t,e)=>dt(e,t,p,r),function(t,e,n,r,o,s,a,u){n.attrName=t,n.element=r,n.howToSet=o,typeof e===c.function?u&&ct.includes(t)?Y(t,e,r,t,s,a):vt(n,e,s,t,r):(n.attrName=t,n.element=r,n.howToSet=o,n.isSpecial=u,at(t,e,r,o,a,s,u))}(e,l,p,n,o,r,u,a),void(p.value=l))}return at(e,l,n,o,u,r,a)}function ht(t,e,n,r,s,a,u){if(!wt(e))if(typeof e!==c.object)0!==e.length&&s(n,e,o);else for(const o in e){const c=e[o];gt(t,o,n,r,s,a,pt(o),u,c)}}function bt(t,e,n,r,o,s,c,u){return C(t)?function(t,e,n,r,o,s,c,u){const i=t.templater.wrapper;if((i?.tagJsType||i?.original?.tagJsType)!==a.renderOnce)return vt(c,e,t,r,n);return mt(e,n,r,o,s,t,u)}(o,t,r,e,c,s,n,u):mt(t,r,e,c,s,o,u)}function mt(t,e,n,r,o,s,c){if(!1===r){switch(t){case void 0:case!1:case null:return void i.push((function(){e.removeAttribute(n)}))}if(C(t))return lt(e,t,s,n);o(e,n,t)}else Y(n,t,e,r,s,c)}function vt(t,e,n,r,o){return lt(o,e=st(e,n),n,r)}function yt(t){return k(t)&&"tagJsVar"in t?t.tagJsVar:-1}function wt(t){return null==t||!1===t}function Ct(t,e){const n=document.createTextNode(t);return f.push({element:n,relative:e}),n}function kt(t){switch(t){case void 0:case!1:case null:return o}return t}function St(t,e){const n=e.providers;if(n)for(const t of n)for(let n=t.children.length-1;n>=0;--n){t.children[n].subject.global===e&&t.children.splice(n,1)}e.destroy$&&e.destroy$.next(),t.subject.renderCount=0}function Tt(t){for(const e of t){const t=e.lastArray;if(t){Tt(t);continue}const n=e.global;if(!n)continue;const r=n.newest,o=n.subscriptions;o&&o.forEach((t=>t.unsubscribe())),v(r.templater)&&St(r,n);Tt(n.context)}}function jt(t,e=[],n=[]){for(const r of t){const t=r.global;if(!t)continue;const o=t.newest;if(o){e.push(o);const r=t.subscriptions;r&&n.push(...r)}const s=t.context;s&&jt(s,e,n)}return{tags:e,subs:n}}function Et(t,e){const n=t.context,r=t.destroys;if(r)return function(t,e,n){const r=[];if(t.forEach((t=>{const e=t();e instanceof Promise&&r.push(e)})),r.length){const t=Promise.all(r).then((()=>{++g.locks,xt(e.context,n),At(e),--g.locks,h()}));return void n.push(t)}++g.locks,xt(e.context,n),At(e),--g.locks,h()}(r,t,e);xt(n,e),At(t)}function xt(t,e){for(const n of t){if(n.withinOwnerElement)continue;const t=n.lastArray;if(t){It(n,t);continue}const r=n.simpleValueElm;if(r){delete n.simpleValueElm,u.push(r);continue}const o=n.global;if(void 0===o)continue;if(!0===o.deleted)continue;o.deleted=!0;o.oldest&&Et(o,e)}}function At(t){t.htmlDomMeta.forEach((t=>{const e=t.marker;e&&u.push(e);const n=t.domElement;n&&u.push(n)}))}function Ot(t,e){const n=t.subject;e.deleted=!0,n.renderCount=0;const r=[];return Tt(e.context),e.destroy$&&St(t,e),Et(e,r),r}function Pt(t,e,n,r,o){const s=t.length-1,c=e-r,a=c<0||s<c,u=n[e];if(a)return Vt(u,o),1;const i=function(t,e,n,r,o,s){const c=e&&t!==e.arrayValue;if(c)return Vt(n,r),o.splice(s,1),2;return 0}(u.value.arrayValue,t[e],u,o,n,e);return i}function Vt(t,e){!function(t,e){if(t){Ot(t.oldest,t)}else{const t=e.simpleValueElm;delete e.simpleValueElm,u.push(t)}}(t.global,t),++e.removed}function Jt(t,e){if(!S(t)){return It(e,e.lastArray),9}return!1}function It(t,e){const n={added:0,removed:0};for(let t=0;t<e.length;++t)Vt(e[t],n);delete t.lastArray}function Nt(t,e){return null==t||typeof t!==c.object?(function(t,e){const n=kt(t),r=e.simpleValueElm;l.push([n,r])}(t,e),-1):(Wt(e),6)}function Wt(t){const e=t.simpleValueElm;delete t.simpleValueElm,u.push(e)}function Rt(t,e,n,r,o){const s=Ge(t,r,o);return s.ownerSupport=e,Xe(t,s,n,o)}function Lt(t,e,n){e!==t.value&&rn(t,e,n)}function Mt(t,e,r){if(!e.global.newest)return void xe(t,e,r,{added:0,removed:0});!function(t,e,r){const o=r.global,s=o.newest,c=s.templater.wrapper,u=e.templater.wrapper;let i=!1;const l=e.templater.tagJsType,p=a.stateRender===l||a.renderOnce===l;if(p)i=e.templater.tagJsType===a.renderOnce||oe(s,e);else if(c&&u){i=c.original===u.original}const f=e.templater;if(!i)return void function(t,e,r){const o=t.global,s=o.oldest;Ot(s,o),n(t);const c=xe(e,t,r,{added:0,removed:0})}(r,f,t);const d=p||function(t,e){const n=e.props,r=t.propsConfig,o=r.latest,s=$e(n,o,t.templater.propWatch);return s}(s,f);if(!d){return void function(t,e,n,r,o){const s=t.props,c=Oe(e,n,r,s,o),a=e.propsConfig;a.castProps=c;const u=n.propsConfig;u.latest=a.latest}(f,e,s,t,f.propWatch===Se.DEEP?ze:Fe)}if(o.locked)return void o.blocked.push(e);Me(e),++r.renderCount}(r,Rt(t,r,r.appSupport,e),e)}function Dt(t,e,n,r,o){const s=document.createTextNode(""),c={value:t,checkValueChange:Nt,delete:Wt,withinOwnerElement:!1,placeholder:s};return n.added=n.added+1,o||f.push({element:s,relative:r}),Ht(t,c,e,n,o,r),o&&p.push({element:s,relative:o}),c}function Bt(t,e,n,r,o){const s=void 0===t.lastArray;s&&(t.lastArray=[]);const c=t.lastArray;let a=t.placeholder,u=0;const i=[];if(!s){for(let t=0;t<c.length;++t){const n=c[t],o=Pt(e,t,c,u,r);0!==o?2!==o?u+=o:t-=1:i.push(n)}t.lastArray=i}const l=e.length;for(let s=0;s<l;++s){a=$t(e,s,t.lastArray,n,a,r,o).placeholder}}function $t(t,e,n,r,o,s,c){const a=t[e],u=n[e];if(u)return function(t,e,n,r,o,s,c,a){const u=n.length>o;if(u)return Lt(e,t,r),e;const i=Dt(t,r,c,s,a);return n.push(i),i}(a,u,n,r,e,o,s,c);const i=Dt(a,r,s,o,c);return n.push(i),i}function _t(t,e,n,r,o,s){const c=t?.tagJsType;return c?t.processInit(t,e,n,r,o,s):S(t)?(Bt(e,t,n,r,o),void(e.checkValueChange=Jt)):void function(t,e,n){const r=kt(t),o=Ct(r,n);e.simpleValueElm=o,e.checkValueChange=Nt}(t,e,e.placeholder)}function Ht(t,e,n,r,o,s){e.handler=Ut;n.subject.global.locked=!0,_t(t,e,n,r,o,s);delete n.subject.global.locked,e.value=t}function Ut(t,e,n,r){return Lt(r,t,n)}function Ft(t,e,n,r,s,c,a){const u=document.createTextNode(o),i=Yt(t,e,s>0);i.placeholder=u,c?p.push({relative:c,element:u}):f.push({relative:a,element:u}),Ht(t,i,n,r,c,a)}const zt=()=>{},Zt="object"==typeof document&&document.createElement("div");function Gt(t,e,n,r,s,c,a,u){const i=[];a&&void 0===u&&(u=document.createTextNode(o),p.push({element:u,relative:a}),a=void 0);for(let o=0;o<t.length;++o){const l=t[o],p=l.v;if(!isNaN(p)){Ft(e[s.length],s,n,r,c,a,u);continue}const f={};if(i.push(f),"text"===l.nn){qt(f,l,a,u);continue}const d=Xt(f,l,e,n,s,r,a,u);l.ch&&(f.ch=Gt(l.ch,e,n,r,s,c+1,d,u).dom)}return{dom:i,context:s}}function Xt(t,e,n,r,o,s,c,a){const u=t.domElement=document.createElement(e.nn);return e.at&&e.at.forEach((t=>{const e=t[0],c=t[1],a=t[2]||!1;gt(n,e,u,r,Q,o,a,s,c)})),c?p.push({element:u,relative:c}):f.push({element:u,relative:a}),u}function qt(t,e,n,r){const o=t,s=o.tc=e.tc;Zt.innerHTML=s;const c=o.domElement=document.createTextNode(Zt.innerText);n?p.push({element:c,relative:n}):f.push({element:c,relative:r})}function Qt(t,e,n,r){const o=t.subject;o.delete=ce;const s=o.global;s.oldest=t,s.newest=t,++g.locks;const c=function(t,e,n,r){const o=function(t){const e=t.templater,n=e.tag;if(n.tagJsType===a.dom)return n.dom;const r=n.strings;return sr(r,n.values)}(t),s=t.templater.tag,c=s.values,u=[],i=t.subject.global;i.context=u;const l=Gt(o,c,t,e,u,0,n,r);return l}(t,e,n,r);return s.htmlDomMeta=c.dom,--g.locks,c}function Yt(t,e,n){const r={value:t,checkValueChange:Nt,delete:Wt,withinOwnerElement:n};return e.push(r),r}function Kt(t,e,n){return t.map((t=>function(t,e,n,r){if(m(t)||!t)return t;if(!e)return t;return te(t,e,n,r)}(t,e.ownerSupport,e,n)))}function te(t,e,n,r,o){if(!t)return t;if(t.tagJsType)return t;if(typeof t===c.function)return function(t,e,n){const r=t.mem;if(r)return t;const o=function(...t){return o.toCall(...t)};return o.original=t,o.mem=t,o.toCall=function(...t){return function(t,e,n,r){const o=r.subject.global,s=o?.newest||r,c=void 0===Vn(),a=t.apply(e,n),u=function(){const t=s.subject.global;return t&&!0!==t.locked?(function(t,e){const n=t.subject,r=Le(t.templater);if(r){return De(e,t)}const o=n.global;o.locked=!0,Re(o.newest,t,e,n),delete o.locked}(s,r),a):a};if(c)return u();return B.tagClosed$.toCallback(u),a}(o.mem,e,t,n)},Object.assign(o,t),o}(t,o,e);if(r===ze)return t;return ne(t)?t:S(t)?function(t,e,n,r){for(let o=t.length-1;o>=0;--o){const s=t[o];if(t[o]=te(s,n,e,r+1,t),typeof s===c.function){if(s.mem)continue;ee(r+1,o,s,t,e)}}return t}(t,n,e,r):function(t,e,n,r){const o=Object.keys(t);for(const s of o){const o=t[s],a=te(o,n,e,r+1,t);if(t[s]===a)continue;const u=Object.getOwnPropertyDescriptor(t,s);if(!(u?.get||u?.set)&&(t[s]=a,typeof a===c.function)){if(o.mem)continue;ee(r+1,s,o,t,e)}}return t}(t,n,e,r)}function ee(t,e,n,r,o){if(t>0){const t=o.subject.global;r[e].subscription=t.destroy$.toCallback((function(){r[e]=n}))}}function ne(t){return typeof t!==c.object||!t||t.tagJsType}function re(t,e,n,r){const o=e.original,s=t.tagJsType===a.stateRender,u=B.stateConfig;let i;return u.support=n,s?i=t():(i=o(...r),typeof i===c.function&&(i=i())),i.templater=t,t.tag=i,n.state=u.stateArray,n.states=u.states,n}function oe(t,e){const n=t.templater,r=e.templater,o=n?.tag||t,s=r.tag;if(n?.tagJsType===a.stateRender)return n.dom===r.dom;switch(o.tagJsType){case a.dom:return s?.tagJsType===a.dom&&function(t,e){const n=t.dom,r=e.dom;return n===r}(o,s);case a.tag:{const n=function(t,e,n,r){const o=t.strings,s=e.strings;if(o.length!==s.length)return!1;if(!o.every(((t,e)=>s[e].length===t.length)))return!1;const a=n.templater.values||t.values,u=r.templater.values||e.values;return function(t,e){const n=t.length===e.length;if(!n)return!1;const r=e.every(((e,n)=>{const r=t[n];if(typeof e===c.function&&typeof r===c.function){return!!(e.toString()===r.toString())}return!0}));if(r)return!0;return!1}(a,u)}(o,s,t,e);return n}}throw new Error(`unknown tagJsType of ${o.tagJsType}`)}function se(t,e){const r=e.global,o=r?.newest;if(m(t)){return!oe(t,o)&&(Ot(o,r),n(e),7)}const s=t?.tagJsType;if(s){return!0===en(e,t,r.newest.ownerSupport)&&-1}return 0===o.subject.renderCount?(delete e.global,e.renderCount=0,d.push((()=>{Ot(o,r),d.shift(),h()})),8):(ce(e),8)}function ce(t){const e=t.global,n=e?.newest;Ot(n,e),delete t.global,t.renderCount=0}function ae(t,e,n,r,o,s){e.checkValueChange=se;const c=Ke(t,n,e);c.ownerSupport=n;const a=Qt(c,r,o,o?void 0:s);for(const t of a.dom)t.marker&&(o?p.push({element:t.marker,relative:o}):f.push({element:t.marker,relative:s})),t.domElement&&(o?p.push({element:t.domElement,relative:o}):f.push({element:t.domElement,relative:s}));return c}function ue(t,e,n,r,o,s){return e.checkValueChange=se,o?ae(t,e,n,r,o,s):Qe(n,e,r)}function ie(t,e){const n={tagJsType:a.templater,processInit:ue,propWatch:t,props:e,key:function(t){return n.arrayValue=t,n}};return n}const le=[];function pe(t,e,n){const r=ie(Se.DEEP);r.tagJsType=t.tagJsType;const o=Ke(r,n,e);function s(){return r.tag=t(),o}return r.wrapper=s,s.tagJsType=t.tagJsType,s.original=t.original||t,o}class fe extends Error{details;constructor(t,e,n={}){super(t),this.name=fe.name,this.details={...n,errorCode:e}}}class de extends fe{constructor(t,e){super(t,"array-no-key-error",e),this.name=de.name}}class ge extends fe{constructor(t,e){super(t,"state-mismatch-error",e),this.name=ge.name}}class he extends fe{constructor(t,e){super(t,"sync-callback-error",e),this.name=he.name}}function be(t,e){const n=t.rearray;n.length&&n.length!==t.stateArray.length&&function(t,e,n){const r=`Saved states between renders are inconsistent. Expected ${t.length} states got ${n.stateArray.length}.`,o=e.templater?.wrapper;let s=o;(o?.original||o?.original)&&(s=o.original);const c={oldStates:n.stateArray,newStates:n.rearray,tagFunction:s,templater:e.templater},a=new ge(r,c);throw console.error(me,c),a}(n,e,t)}const me="State tracking requires same number of state calls on every render. This error typically occurs when a state call is only reachable behind a condition. Also, wrapping tags that have state, with tag(), often helps when tag is only reachable by a condition.";function ve(t,e){const n=t.subject;++n.renderCount;const r=B.stateConfig;t.state=r.stateArray,t.states=r.states,n.global.newest=t,be(r,t),delete r.prevSupport,delete r.support,delete r.stateArray,delete r.states,B.tagClosed$.next(e)}function ye(t,e,n,r){const o=e?.state,s=B.stateConfig;o?A(0,e,B.stateConfig,o):x(t,s);const c=t.templater;let u;if(c.tagJsType===a.stateRender){const e=c;u=Rt(c,r,t.appSupport,n),re(c,e,u)}else{u=(0,c.wrapper)(t,n,e)}return ve(u,r),u}function we(t,e,r,o,s,c){n(e);const a=pe(t,e,r);ye(a,void 0,e,r);const u=ae(a.templater,e,r,o,s,c);return e.checkValueChange=se,u}function Ce(t,e,r,o,s){if(n(e),e.checkValueChange=se,s){const n=function(t,e,n,r,o){const s=Rt(t,n,n.appSupport,e),c=s.propsConfig;if(c){const e=t.tagJsType!==a.tagComponent?[]:Ee(t,s);c.castProps=e}const u=e.global,{support:i}=Je(s,u.newest,e,n);return function(t,e,n){let r=p.length;const o=Qt(t,e,n,void 0);for(const t of o.dom)t.domElement&&p.splice(r++,0,{element:t.domElement,relative:n}),t.marker&&p.splice(r++,0,{element:t.marker,relative:n})}(i,r,o),i}(t,e,r,o,s);return n}return xe(t,e,r,o)}let ke=0;var Se;function Te(t,e=Se.SHALLOW){const n=function(...r){const o=ie(e,r);o.tagJsType=a.tagComponent,o.processInit=Ce;const s=function(t,e){const n=function(n,r,o){const s=Ee(t,n,o),c=n.ownerSupport,a=Rt(t,c,n.appSupport,r,s);return re(t,e,a,s)};return n}(o,n);return s.original=t,o.wrapper=s,o},r=t;return n.original=t,r.tags=le,r.setUse=B,r.ValueTypes=a,r.tagIndex=ke++,le.push(n),n}function je(){throw new Error("Do not call tag.use as a function but instead set it as: `(props) => tag.use = (use) => html`` `")}function Ee(t,e,n){const r=t.propWatch===Se.DEEP?ze:Fe,o=t.props,s=e.propsConfig;let c=s.castProps;const a=n?.propsConfig,u=a?.castProps;u&&(s.castProps=u,c=Oe(e,n,n.ownerSupport,o,r));return c||Kt(o,e,0)}function xe(t,e,n,r){const o=Rt(t,n,n.appSupport,e),s=o.propsConfig;if(s){const e=t.tagJsType!==a.tagComponent?[]:Ee(t,o);s.castProps=e}const c=e.global,{support:u}=Je(o,c.newest,e,n);return function(t,e,n){n.checkValueChange=se,Qt(t,e,void 0,n.placeholder)}(u,r,e),u}function Ae(t,e,n,r,o,s){return null==t||s>o?e:typeof t===c.function?e.mem?(t.mem=e.mem,e):(t.mem=e,t):ne(e)?e:S(e)?function(t,e,n,r,o,s){for(let c=t.length-1;c>=0;--c){const a=t[c],u=e[c];t[c]=Ae(u,a,n,r,s,o+1)}return t}(e,t,n,r,s,o):function(t,e,n,r,o,s){const c=Object.keys(t);for(const a of c){const c=t[a],u=Ae(e[a],c,n,r,s,o+1);if(c===u)continue;const i=Object.getOwnPropertyDescriptor(t,a)?.set;i||(t[a]=u)}return t}(e,t,n,r,s,o)}function Oe(t,e,n,r,o,s=-1){if(0===o)throw new Error("before here");const c=e.subject.global.newest;if(!c){const e=Kt(r,t,s);r.push(...e);return t.propsConfig.castProps=e,r}const a=(e=c||e).propsConfig.castProps,u=[];for(let e=0;e<r.length;++e){const c=r[e],i=Ae(a[e],c,t,n,o,s+1);u.push(i)}return t.propsConfig.castProps=u,u}function Pe(t){const e=t.subject,r=e.global,{subs:o,tags:s}=jt(r.context);Ve(r);for(const t of s){const e=t.subject.global;if(!0===e.deleted)return;Ve(e)}r.subscriptions&&o.forEach((t=>t.unsubscribe())),n(e)}function Ve(t){t.deleted=!0,Et(t,[])}function Je(t,e,n,r){const o=e?.templater,s=o?.tag,c=ye(t,e,n,r),u=!e||oe(e,c);if(u){if(e){const t=e.templater.tag;t&&n.renderCount>0&&function(t,e,n){if(t.tagJsType===a.dom){const r=n?.dom;return void(r!==t.dom&&Pe(e))}if(n){const r=n.strings;if(r){const n=r?.length;n!==t.strings.length&&Pe(e)}}}(t,e,s)}}else{!function(t,e){const n=t.subject.global;let r=-1;const o=n.providers=n.providers||[],s=o.length-1;for(;r++<s;){const t=o[r];let s=-1;const c=t.children.length-1;for(;s++<c;)if(n===t.children[s].subject.global)return t.children.splice(s,1),void t.children.push(e)}}(e,c),Pe(e);const t=c.subject.global;t.oldest=c,t.newest=c}const i=e?.ownerSupport;return c.ownerSupport=r||i,{support:c,wasLikeTags:u}}function Ie(t,e,n,r){const o=t[e],s=n[e];if(o===s.value)return;(0,s.handler)(o,t,r,s),s.value=o}function Ne(t,e){const n=t.subject.global.context;!function(t,e){const n=e.templater,r=e.templater.tag,o=n.values||r.values,s=t.templater.tag;s.values=o}(t,e),++g.locks,function(t,e){const n=t.templater.tag.values;let r=0;const o=n.length;for(;r<o;)Ie(n,r,e,t),++r}(t,n),--g.locks,h()}!function(t){t.DEEP="deep",t.SHALLOW="shallow",t.NONE="none",t.IMMUTABLE="immutable"}(Se||(Se={})),Te.renderOnce=function(){throw new Error("Do not call tag.renderOnce as a function but instead set it as: `(props) => tag.renderOnce = () => html`` `")},Te.state=je,Te.use=je,Te.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`` `")},Te.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`` `")},Te.deepPropWatch=Te,Te.immutableProps=function(t){return Te(t,Se.IMMUTABLE)},Te.watchProps=function(t){return Te(t,Se.SHALLOW)},Object.defineProperty(Te,"renderOnce",{set(t){t.tagJsType=a.renderOnce,t.processInit=we}}),Object.defineProperty(Te,"state",{set(t){t.original={setUse:B,tags:le},t.tagJsType=a.stateRender,t.processInit=Ce}}),Object.defineProperty(Te,"use",{set(t){t.original={setUse:B,tags:le},t.tagJsType=a.stateRender,t.processInit=Ce}});const We={added:0,removed:0};function Re(t,e,n,r){const o=r.global,{support:s,wasLikeTags:c}=Je(e,t,r,n);return c?(Ne(o.oldest,s),s):(Qe(n,r,We),s)}function Le(t){return a.templater===t.tagJsType}function Me(t){const e=t.subject.global,n=Le(t.templater),r=t.ownerSupport;if(e.locked)return e.blocked.push(t),t;if(n){return De(r,t)}e.locked=!0;const o=t.subject;e.blocked.length&&(t=e.blocked.pop(),e.blocked=[]);const s=Re(e.newest,t,r,o);return delete e.locked,s}function De(t,e){const n=t.subject.global;if(!n||!0===n.deleted)return e;return Me(n.newest||t)}function Be(t,e){return t.length!==e.length}function $e(t,e,n){if(Be(t,e))return 11;switch(n){case Se.NONE:return 1;case Se.SHALLOW:return Ue(t,e);case Se.IMMUTABLE:return He(t,e)}return function(t,e){let n=t,r=e;n=[...t],r=[...e||[]];if(!n.every(((t,e)=>function(t,e,n,r){const o=r[e];if(typeof t===c.object){const e={...t},n={...o||{}},r=Object.entries(e).every((([t,r])=>_e(r,n[t],(()=>{delete e[t],delete n[t]}))));return r}return _e(t,o,(()=>{n.splice(e,1),r.splice(e,1)}))}(t,e,n,r))))return 7;return!1}(t,e)}function _e(t,e,n){if(typeof t!==c.function)return!!z(t,e,ze)&&4;if(typeof e!==c.function)return!1;const r=e?.original;r&&(e=r);t.original&&(t=t.original);return t.toString()===e.toString()?(n(),5):(n(),6)}function He(t,e){const n=t.length;for(let r=0;r<n;++r){if(t[r]!==e[r])return 2}return!1}function Ue(t,e){const n=t.length;for(let r=0;r<n;++r){const n=t[r],o=e[r];if(S(n)&&S(o)){if(n===o)continue;return 3}if(typeof n!==c.function||typeof o!==c.function)if(typeof n!==c.object){if(n!==o)return 3.3}else if(typeof e===c.object){const t=Object.entries(n);for(const e of t){if(!Ze(e,o))return 3.1}}}return!1}const Fe=3,ze=10;function Ze([t,e],n){const r=n[t];return typeof e===c.function&&typeof r===c.function||r===e}function Ge(t,e,n){const r={templater:t,subject:e,castedProps:n,appSupport:void 0},o=e.global;return o.blocked=[],o.destroy$=new R,r}function Xe(t,e,n,r){e.appSupport=n;const o=t.props;return o&&(e.propsConfig=function(t,e,n){const r=t.templater;if(r.tagJsType!==a.stateRender){switch(r.propWatch){case Se.IMMUTABLE:return t.propsConfig={latest:e,castProps:n};case Se.SHALLOW:return t.propsConfig={latest:e.map((t=>X(t,Fe))),castProps:n}}return t.propsConfig={latest:e.map((t=>X(t,ze))),castProps:n}}}(e,o,r)),e}function qe(t,e,n,r,o){const s={templater:t,subject:r,castedProps:o,appSupport:void 0};return s.ownerSupport=e,s.appSupport=n,s}function Qe(t,e,n){const r=e.global.newest;r.ownerSupport=t,e.checkValueChange=se;return Qt(r,n,void 0,e.placeholder),r}function Ye(){return{tagJsType:a.templater,processInit:ue}}function Ke(t,e,n){const r=qe(t,e,e.appSupport,n);return n.global.context=[],r}const tn={added:0,removed:0};function en(t,e,r){const o=e.tagJsType;if(v(e))return void 0===t.global&&n(t),Mt(e,t,r),!0;const s=t.global;if(s){const n=s.newest;if(n)return typeof e===c.function||function(t,e,n,r){const o=Rt(n.templater||n,r,r.appSupport,e);Ne(t.subject.global.oldest,o)}(n,t,e,r),!0}switch(o){case a.templater:return Qe(r,t,tn),!0;case a.tag:case a.dom:return function(t,e,r){const o=t;let s=o.templater;s||(s=Ye(),o.templater=s,s.tag=o);const c=e.global?e.global:n(e);c.newest=Ke(s,r,e),Qe(r,e,tn)}(e,t,r),!0;case a.subscribe:return e.processInit(e,t,r,{added:0,removed:0},void 0,t.placeholder),!0}return!1}function nn(t,e,n,r){const o=t&&t.tagJsType;if(o){if(o===a.renderOnce)return;en(e,t,n)}else S(t)?Bt(e,t,n,{added:0,removed:0}):typeof t!==c.function?r&&function(t,e){e.checkValueChange=Nt;const n=e.placeholder,r=kt(t);e.simpleValueElm=Ct(r,n)}(t,e):e.value=t}function rn(t,e,n){const r=t.checkValueChange(e,t);-1!==r&&nn(e,t,n,r)}function on(t,e,n,r,o,s,c){let u;s&&(u=c=document.createTextNode(""),p.push({element:c,relative:s}));const i=function(t,e,n,r,o,s){const c=T(n);let a;let u=function(t){l.callback&&(t=l.callback(t)),l.hasEmitted=!0,l.contextItem=Dt(t,n,r,s),u=function(t){rn(l.contextItem,t,n),p||B.stateConfig.support||h()}};const i=function(t){a=t;const e=c.subject.global.newest;var n;n=c,$(e.states,n.states),l.callback&&(t=l.callback(t)),u(t)},l={hasEmitted:!1,handler:i,getLastValue:()=>a,callback:o,states:c.states};let p=!0;return l.subscription=t.subscribe(i),p=!1,l}(t,0,n,r,o,c),l=e.delete=()=>{if(i.contextItem.delete(i.contextItem),i.subscription.unsubscribe(),u){u.parentNode.removeChild(u)}};e.handler=(t,e,n)=>{if(!t||!t.tagJsType||t.tagJsType!==a.subscribe)return l(),99;if(!i.hasEmitted)return;i.callback=t.callback,i.handler(i.getLastValue());const r=T(n);i.states=r.states}}function sn(t,e,n,r,o,s){return on(t.Observable,e,n,r,t.callback,o,s)}function cn(t,e,n,r,o){on(t,e,n,r,void 0,o)}function an(t){return Vn()?hn((()=>un(t))):un(t)}function un(t){let e=t;const n=new Set;return{tagJsType:a.signal,processInit:cn,get value(){return e},set value(t){e!==t&&(e=t,n.forEach((e=>e(t))))},subscribe(t){t(e),n.add(t);const r=()=>n.delete(t);return r.unsubscribe=r,r}}}class ln extends R{value;constructor(t){super(t),this.value=t}subscribe(t){const e=super.subscribe(t);return t(this.value,e),e}}class pn extends R{value;constructor(t){super(t),this.value=t,this._value=t,M(this)}subscribe(t){const e=super.subscribe(t);return t(this._value,e),e}}function fn(t){return(e,n)=>{n.setHandler((()=>{})),t(e,n.next)}}function dn(t){return(e,n)=>{n.setHandler((()=>{}));t(e).then((t=>n.next(t)))}}const gn=t=>(e,n)=>{n.setHandler((()=>{}));const r=t(e).subscribe((t=>{r.unsubscribe(),n.next(t)}))};function hn(t){return B.stateConfig.handlers.handler(t)}const bn=(t,e)=>vn(t,e),mn=t=>t;const vn=(t,e,{init:n,before:r,final:o=mn}={})=>{const s=hn({pastResult:void 0,values:void 0}),c=s.values;if(void 0===c){if(r&&!r(t))return s.values=t,s.pastResult;const a=(n||e)(t,c);return s.pastResult=o(a),s.values=t,s.pastResult}if(t.every(((t,e)=>t===c[e])))return s.pastResult;if(r&&!r(t))return s.values=t,s.pastResult;const a=e(t,c);return s.pastResult=o(a),c.length=0,c.push(...t),s.pastResult};function yn(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=hn((()=>Vn())),r=hn((()=>new ln(void 0))),o=hn((()=>({stateArray:B.stateConfig.stateArray,states:B.stateConfig.states}))),s=(t,s)=>(vn(t,((t,e)=>{const c=Vn(),a=s(t,e);if(c!==n){const t=o.stateArray,e=n.subject.global.oldest;H(t,e.state,o.states,e.states)}r.next(a)}),e.setup),r);return s.setup=e.setup,yn((()=>s),s),s}}),Object.defineProperty(e,"truthy",{get(){const e=t();return e.setup.before=t=>t.every((t=>t)),e}}),e}function wn(t){return Vn()?hn((()=>new R(t))):new R(t)}function Cn(t){return B.stateConfig.handlers.statesHandler(t)}function kn(t){const e=an([]),n=an(0),r=an(0);let o=[],s=0;return r.value=n.value,t(((...t)=>(o=t,e.value))),bn(o,(()=>{++s,e.value=o,t((()=>o))})),Cn(((o,c)=>{if(s)return t(((...t)=>(c&&1!==c||(e.value=t),e.value))),r.value=n.value,void++n.value;t((()=>e.value))})),++s,e.value}yn((()=>function(t){const e=(e,n)=>vn(e,n,t);return e.setup=t,yn((()=>e),e),e}({})),bn),wn._value=t=>{const e=hn((function(){return{stateArray:B.stateConfig.stateArray,states:B.stateConfig.states}})),n=Vn();return hn((function(){return new ln(t).pipe((t=>(H(n.state,e.stateArray,n.states,e.states),t)))}))},wn.all=function(t){const e=hn((()=>({stateArray:B.stateConfig.stateArray,states:B.stateConfig.states}))),n=Vn();return R.all(t).pipe((t=>(H(n.state,e.stateArray,n.states,e.states),t)))};const Sn={create:t=>{const e=hn((()=>({stateDiff:0,provider:void 0})));if(e.stateDiff){let t=e.stateDiff;for(;t--;)hn(void 0);return hn(void 0)}const n=hn((()=>{const n=B.stateConfig,r=n.stateArray.length,o=t.prototype?new t:t(),s=n.support,c=n.stateArray.length-r,a={constructMethod:t,instance:o,stateDiff:c,owner:s,children:[]};e.provider=a;const u=s.subject.global;return(u.providers=u.providers||[]).push(a),e.stateDiff=c,o})),r=t,o=r.compareTo=r.toString();return e.provider.constructMethod.compareTo=o,n},inject:t=>hn((()=>{const e=t,n=e.compareTo=e.compareTo||t.toString(),r=Vn(),o=[];let s={ownerSupport:r.ownerSupport};for(;s.ownerSupport;){const t=s.ownerSupport.subject.global.providers;if(!t){s=s.ownerSupport;continue}const e=t.find((t=>{o.push(t);if(t.constructMethod.compareTo===n)return!0}));if(e){const t=r.subject.global;return(t.providers=t.providers||[]).push(e),e.children.push(r),e.instance}s=s.ownerSupport}const c=`Could not inject provider: ${t.name} ${t}`;throw console.warn(`${c}. Available providers`,o),new Error(c)}))};function Tn(t){const e=Vn();if(!e)throw xn;return jn(e,B.stateConfig,t)}function jn(t,e,n){const r=e.states;return function(...e){return t.subject.renderCount>0?function(t,e,n,...r){const o=t.subject.global.newest;$(o.states,e);const s=n(...r);return $(e,o.states),Me(o),w(s)&&s.finally((()=>{$(e,o.states),Me(o)})),s}(t,r,n,...e):n(...e)}}const En=()=>{const t=Vn();if(!t)throw xn;const e=B.stateConfig;return function(n){return jn(t,e,n)}},xn=new he("callback() was called outside of synchronous rendering. Use `callback = callbackMaker()` to create a callback that could be called out of sync with rendering");function An(t){hn(t)}function On(t){hn((function(){Vn().subject.global.destroy$.toCallback(t)}))}function Pn(t,e){return{tagJsType:a.subscribe,processInit:sn,Observable:t,callback:e,states:T(Vn()).states}}function Vn(){return B.stateConfig.support}function Jn(t,e,r,o,s,c){e.checkValueChange=se;const a=t;let u=a.templater;u||(u=function(t){const e=Ye();return e.tag=t,t.templater=e,e}(a));const i=n(e);return s?ae(u,e,r,o,s,c):(i.newest=Ke(u,r,e),e.checkValueChange=se,Qe(r,e,o))}const In=":tagvar",Nn=":";function Wn(t,e){const n={values:e,ownerSupport:Vn(),tagJsType:a.tag,processInit:Jn,strings:t,key:t=>(n.arrayValue=t,n),html:function(t,e){return n.children={strings:t,values:e},n}};return n}function Rn(t,e){const n={values:e,ownerSupport:Vn(),dom:t,tagJsType:a.dom,processInit:Jn,key:function(t){return n.arrayValue=t,n},html:{dom:function(t,e){return n.children={dom:t,values:e},n}}};return n}const Ln=/(:tagvar\d+:)/,Mn="ondoubleclick",Dn=/([:_a-zA-Z0-9\-.]+)\s*(?:=\s*"([^"]*)"|=\s*(\S+))?/g,Bn=/<\/?([a-zA-Z0-9-]+)((?:\s+[a-zA-Z_:*][\w:.-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)+\s*|\s*)\/?>/g;function $n(t){const e=[],n=[],r=[];let o=null,s=-1,c=0;const a=new RegExp(Bn,"g");for(t=function(t){return t.replace(_n,(function(t){return t.replace(/\[l t\]/g,"[l t]").replace(/\[g t\]/g,"[g t]").replace(/</g,"[l t]").replace(/>/g,"[g t]")}))}(t);c<t.length;){const u=a.exec(t);if(!u)break;const[i,l,p]=u,f=i.startsWith("</"),d=i.endsWith("/>");if(c<u.index){const e=t.slice(c,u.index);if(e.trim()){zn(e).forEach((t=>{t.startsWith(In)&&(t=In+ ++s+Nn),Un(o,n,t)}))}}if(c=u.index+i.length,f){o=r.pop()||null;continue}const g=[];let h;for(;null!==(h=Dn.exec(p));){const t=h[1]||h[3]||h[5];let n=h[2]||h[4]||h[6];if(void 0===t)continue;const r=""!==h[2],o=void 0===n&&r,c=t.toLowerCase(),a=c.startsWith("on")?Hn(c):c;if(o){if(t.slice(0,In.length)===In){const t=In+ ++s+Nn;e.push(["at",t]),g.push([t]);continue}if(h[0].startsWith(t)&&h[0].slice(t.length,h[0].length).search(/\s+$/)>=0){g.push([a]);continue}n=In+ ++s+Nn}r||(n=h[2]);const u=[a,n],i=pt(c);i&&u.push(i),g.push(u)}const b={nn:l};g.length&&(b.at=g),o?(o.ch||(o.ch=[]),o.ch.push(b)):n.push(b),d||(r.push(o),o=b)}if(c<t.length){const e=t.slice(c);if(e.trim()){zn(e).forEach((t=>(t.startsWith(In)&&++s,Un(o,n,t))))}}return n}const _n=new RegExp("(\x3c!--[\\s\\S]*?--\x3e)","g");function Hn(t){if(t.startsWith("on")){return t.length===Mn.length&&t===Mn?"dblclick":t.slice(2,t.length)}return t}function Un(t,e,n){!function(t,e,n){t?(t.ch||(t.ch=[]),t.ch.push(n)):e.push(n)}(t,e,{nn:"text",tc:Fn(n)})}function Fn(t){return t.replace(/(\[l t\]!--[\s\S]*?--\[g t\])/g,(function(t){return t.replace(/\[l t\]/g,"<").replace(/\[g t\]/g,">").replace(/\[l t\]/g,"[l t]").replace(/\[g t\]/g,"[g t]")}))}function zn(t){return t.split(Ln).filter((t=>""!==t))}const Zn=/(^:tagvar\d+:|:tagvar\d+:$)/g,Gn="__safeTagVar";function Xn(t,e){return function(t,e){const n=t.map(((t,n)=>n<e.length?t+In+n+Nn:t));return function(t,e,n){const r=n.length-e.length;if(r>0)for(let n=r;n>0;--n)t.push(In+(e.length+n-1)+Nn)}(n,t,e),n}(t.map((t=>t.replace(Zn,((t,e)=>Gn+e)))),e)}const qn=new RegExp(In+"(\\d+)"+Nn,"g"),Qn="ch";function Yn(t,e,n=[],r=[]){const o=t;for(let t=0;t<o.length;t++){const s=[...r,t],c=o[t];if(c.at){const t=c.at;c.at=tr(t,e)}if(c.ch){const t=c.ch,r=[...s,Qn];c.ch=Yn(t,e,n,r)}t=Kn(c,e,o,t)}return o}function Kn(t,e,n,r){if("text"!==t.nn)return r;const o=t;let c,a=o.tc;if(typeof a!==s.string)return r;for(;null!==(c=qn.exec(a));){const t=c[1],o=parseInt(t,10);if(!isNaN(o)&&o<e){const t=In+o+Nn,e=a.slice(c.index+t.length);n.splice(r,1,{nn:"text",v:o}),a=e,qn.lastIndex=0}}return o.tc=a,r}function tr(t,e){return t.map((t=>{const[n,r,o]=t;if(n.startsWith(In)){const t=parseInt(n.replace(In,""),10);if(!isNaN(t)&&t<e)return[{tagJsVar:t}]}if(typeof r===s.string&&r.startsWith(In)){const t=parseInt(r.replace(In,""),10);if(!isNaN(t)&&t<e)return[n,{tagJsVar:t},o]}return t}))}const er="__safeTagVar";const nr=/__safeTagVar(\d+)/g;function rr(t){if(t.at&&(t.at=t.at?t.at.map((t=>{if(1===t.length)return t;const[,e]=t;if(typeof e===s.string&&e.startsWith(er)){const n=parseInt(e.replace(er,""),10);t[1]=In+n+Nn}return t})):[]),t.ch){const e=t.ch;for(let t=0;t<e.length;t++){const n=e[t];if("text"===n.nn){if(typeof n.tc!==s.string)return;n.tc=n.tc.replace(nr,((t,e)=>In+e+Nn))}rr(n)}0===e.length&&delete t.ch}}const or={};function sr(t,e){const n=function(t){const e=t.map((t=>t.length));return e.push(t.length),Number(e.join(""))}(t),r=or[n],o=r&&function(t,e,n){if(n&&n.strings.length===t.length&&n.strings.every(((e,n)=>e===t[n]))&&n.values.length===e.length)return!0;return!1}(t,e,r);if(o)return r.domMetaMap;const s=function(t,e){return Xn(t,e),$n(Xn(t,e).join(""))}(t,e),c=Yn(s,e.length);c.forEach(rr);const a={interpolation:void 0,string:void 0,strings:t,values:e,domMetaMap:c};return or[n]=a,c}function cr(t,...e){const n=Wn(t,e),r=ie(Se.NONE);return r.tag=n,n.templater=r,n}cr.dom=function(t,...e){return Rn(t,e)};const ar=[];function ur(t,e,r){const o=ar.findIndex((t=>t.element===e));if(o>=0){const t=ar[o].support;Ot(t,t.subject.global),ar.splice(o,1),console.warn("Found and destroyed app element already rendered to element",{element:e})}let s=()=>l(r);s.propWatch=Se.NONE,s.tagJsType=a.stateRender,s.props=[r],s.isApp=!0;const u=function(t,e){const r={value:t,checkValueChange:se,delete:ce,withinOwnerElement:!1,renderCount:0,global:void 0},o=n(r);return o.events={},ir(t,r,e),r}(s,e),i=u.global;x(i.newest,B.stateConfig);let l=t(r);const p=typeof l==c.function;p||(v(l)?(i.newest.propsConfig={latest:[r],castProps:[r]},s.propWatch=l.propWatch,s.tagJsType=l.tagJsType,s.wrapper=l.wrapper,s=l):(s.tag=l,l=t));const f=document.createTextNode("");le.push(s.wrapper||{original:s});const d=lr(s,f,e,u,p);if(i.isApp=!0,p&&(l.tag=d.templater.tag),!e)throw new Error(`Cannot tagElement, element received is type ${typeof e} and not type Element`);e.destroy=function(){const t=i.events;for(const n in t){const r=t[n];e.removeEventListener(n,r)}i.events={},++g.locks;const n=Ot(d,i);return--g.locks,h(),n},++g.locks;const b=function(t,e,n,r,o,s){const c=Qt(t,{added:0,removed:0},e,void 0);n.oldest=t,n.newest=t;let u=r.setUse;if(r.tagJsType!==a.stateRender){const t=o.original;u=t.setUse,t.isApp=!0}e.setUse=u,e.ValueTypes=a,ar.push({element:e,support:t});const i=document.createDocumentFragment();i.appendChild(s);for(const t of c.dom)pr(t,i);return i}(d,e,i,s,t,f);return--g.locks,h(),e.appendChild(b),{support:d,tags:le,ValueTypes:a}}function ir(t,e,n){const r=e.global,o=Ge(t,e);return Xe(t,o,o),o.appElement=n,r.oldest=r.oldest||o,r.newest=o,o}function lr(t,e,n,r,o){r.placeholder=e;const s=r.global,c=s.oldest,u=s.newest===c,i=Rt(t,s.newest,s.newest.appSupport,r);if(u||A(0,s.newest,B.stateConfig,c.state),t.tagJsType===a.stateRender)return function(t,e,n,r,o){const s=t.wrapper||{original:t};if(!e){const e=ir(t,r,o);return ve(e),e}return re(t,s,n),ve(n),n}(t,o,i,r,n);const l=(0,t.wrapper)(i,r);return ve(i),l}function pr(t,e){t.domElement&&e.appendChild(t.domElement),t.marker&&e.appendChild(t.marker)}function fr(t,e,n){n.subject.global.deleted||(Lt(e,t,n),B.stateConfig.support||h())}const dr={tagElement:ur,renderWithSupport:Je,renderSupport:Me,renderTagOnly:ye,paint:h};var gr=e.W9,hr=e.cg,br=e.m0,mr=e.rS,vr=e.Y2,yr=e.ei,wr=e.B7,Cr=e.TU,kr=e.XF,Sr=e.PC,Tr=e.Ot,jr=e.Mj,Er=e.tD,xr=e.j8,Ar=e.um,Or=e.E2,Pr=e.OH,Vr=e.TB,Jr=e.Ii,Ir=e.yV,Nr=e.zV,Wr=e.pf,Rr=e.ze,Lr=e.WJ,Mr=e.Ng,Dr=e.VI,Br=e.aZ,$r=e.O,_r=e.Ie,Hr=e.B4,Ur=e.Az,Fr=e.Xi,zr=e.Ah,Zr=e.ck,Gr=e.Gk,Xr=e.zC,qr=e.cF,Qr=e.jU,Yr=e.PB,Kr=e.qy,to=e.cy,eo=e.Tn,no=e.Gv,ro=e.yL,oo=e.D8,so=e.Ze,co=e._4,ao=e.mn,uo=e.z,io=e.sA,lo=e.MG,po=e.PL,fo=e.nI,go=e.PZ,ho=e.N_,bo=e.r5,mo=e.uc,vo=e.pG,yo=e.QB,wo=e.R6,Co=e.Ll,ko=e.vP,So=e.wk,To=e.xP,jo=e.bc,Eo=e.B1,xo=e.ag,Ao=e.Tc,Oo=e.Hf,Po=e._A,Vo=e.Ag,Jo=e.NU,Io=e.hW,No=e.wB,Wo=e.id,Ro=e.MC,Lo=e.SZ;export{gr as ArrayNoKeyError,hr as BasicTypes,br as ImmutableTypes,mr as PropWatches,vr as RouteQuery,yr as StateMismatchError,wr as Subject,Cr as Subjective,kr as SyncCallbackError,Sr as TagError,Tr as ValueSubject,jr as ValueSubjective,Er as ValueTypes,xr as addOneContext,Ar as buildBeforeElement,Or as callback,Pr as callbackMaker,Vr as checkArrayValueChange,Jr as checkSimpleValueChange,Ir as checkTagValueChange,Nr as combineLatest,Wr as createHtmlSupport,Rr as createTrigger,Lr as defineValueOn,Mr as deleteSimpleValue,Dr as destorySupportByContextItem,Br as destroyArray,$r as destroySupport,_r as empty,Hr as getBaseSupport,Ur as getDomMeta,Fr as getDomTag,zr as getNewGlobal,Zr as getStringTag,Gr as getTemplaterResult,Xr as hasPropChanges,qr as hmr,Qr as howToSetFirstInputValue,Yr as howToSetInputValue,Kr as html,to as isArray,eo as isFunction,no as isObject,ro as isPromise,oo as isSimpleType,so as isStaticTag,co as isSubjectInstance,ao as isTagComponent,uo as letProp,io as onDestroy,lo as onInit,po as oneRenderToSupport,fo as paint,go as processFirstSubjectValue,ho as processSubUpdate,bo as providers,mo as renderSupport,vo as renderTagOnly,yo as renderWithSupport,wo as runWrapper,Co as setUseMemory,ko as signal,So as state,To as states,jo as subject,Eo as subscribe,xo as syncError,Ao as tag,Oo as tagElement,Po as tags,Vo as upgradeBaseToSupport,Jo as variablePrefix,Io as variableSuffix,No as watch,Wo as willCallback,Ro as willPromise,Lo as willSubscribe};
|
|
2
2
|
//# sourceMappingURL=bundle.js.map
|