taggedjs 2.8.1 → 2.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/bundle.js +1 -1
  2. package/bundle.js.map +1 -1
  3. package/js/alterProp.function.d.ts +2 -2
  4. package/js/index.d.ts +2 -2
  5. package/js/index.js +1 -1
  6. package/js/index.js.map +1 -1
  7. package/js/interpolations/attributes/addSupportEventListener.function.d.ts +1 -1
  8. package/js/interpolations/attributes/bindSubjectCallback.function.d.ts +2 -2
  9. package/js/interpolations/attributes/getUpTags.function.d.ts +1 -1
  10. package/js/interpolations/attributes/processAttribute.function.d.ts +1 -1
  11. package/js/interpolations/attributes/processAttribute.function.js +6 -5
  12. package/js/interpolations/attributes/processAttribute.function.js.map +1 -1
  13. package/js/interpolations/attributes/processAttributeCallback.function.d.ts +1 -1
  14. package/js/interpolations/attributes/processNameValueAttribute.function.d.ts +2 -2
  15. package/js/interpolations/attributes/renderTagArray.function.d.ts +1 -1
  16. package/js/interpolations/attributes/specialAttribute.d.ts +2 -1
  17. package/js/interpolations/attributes/specialAttribute.js +1 -2
  18. package/js/interpolations/attributes/specialAttribute.js.map +1 -1
  19. package/js/interpolations/interpolateTemplate.d.ts +1 -1
  20. package/js/interpolations/optimizers/attachDomElements.function.d.ts +1 -1
  21. package/js/interpolations/optimizers/htmlInterpolationToDomMeta.function.js +1 -1
  22. package/js/interpolations/optimizers/htmlInterpolationToDomMeta.function.js.map +1 -1
  23. package/js/interpolations/optimizers/replacePlaceholders.function.js +1 -1
  24. package/js/interpolations/optimizers/replacePlaceholders.function.js.map +1 -1
  25. package/js/interpolations/optimizers/restorePlaceholders.function.js +1 -1
  26. package/js/interpolations/optimizers/restorePlaceholders.function.js.map +1 -1
  27. package/js/interpolations/processSubscriptionUpdate.function.d.ts +1 -1
  28. package/js/interpolations/subscribeToTemplate.function.d.ts +1 -1
  29. package/js/isInstance.d.ts +3 -3
  30. package/js/state/StateMemory.type.d.ts +1 -1
  31. package/js/state/callback.function.d.ts +1 -1
  32. package/js/state/callbackStateUpdate.function.d.ts +1 -1
  33. package/js/state/handleProviderChanges.function.d.ts +1 -1
  34. package/js/state/providers.d.ts +1 -1
  35. package/js/state/providersChangeCheck.function.d.ts +1 -1
  36. package/js/state/setUse.function.d.ts +1 -1
  37. package/js/state/state.utils.d.ts +1 -1
  38. package/js/tag/BaseSupport.type.d.ts +1 -1
  39. package/js/tag/Context.types.d.ts +2 -2
  40. package/js/tag/TagMaker.type.d.ts +1 -1
  41. package/js/tag/afterRender.function.d.ts +1 -1
  42. package/js/tag/buildBeforeElement.function.d.ts +1 -1
  43. package/js/tag/checkDestroyPrevious.function.d.ts +1 -1
  44. package/js/tag/checkStateMismatch.function.d.ts +1 -1
  45. package/js/tag/clonePropsBy.function.d.ts +1 -1
  46. package/js/tag/cloneValueArray.function.d.ts +1 -1
  47. package/js/tag/destroySupport.function.d.ts +1 -1
  48. package/js/tag/executeWrap.function.d.ts +2 -2
  49. package/js/tag/getChildTagsToDestroy.function.d.ts +1 -1
  50. package/js/tag/getDomTag.function.d.ts +49 -0
  51. package/js/tag/getDomTag.function.js +43 -0
  52. package/js/tag/getDomTag.function.js.map +1 -0
  53. package/js/tag/getSupport.function.d.ts +35 -2
  54. package/js/tag/getSupport.function.js +40 -1
  55. package/js/tag/getSupport.function.js.map +1 -1
  56. package/js/tag/getSupportInCycle.function.d.ts +1 -1
  57. package/js/tag/getTagWrap.function.d.ts +2 -2
  58. package/js/tag/getTemplaterResult.function.d.ts +50 -0
  59. package/js/tag/getTemplaterResult.function.js +14 -0
  60. package/js/tag/getTemplaterResult.function.js.map +1 -0
  61. package/js/tag/hasSupportChanged.function.d.ts +1 -1
  62. package/js/tag/html.d.ts +1 -1
  63. package/js/tag/html.js +2 -2
  64. package/js/tag/html.js.map +1 -1
  65. package/js/tag/index.d.ts +3 -3
  66. package/js/tag/index.js +3 -3
  67. package/js/tag/index.js.map +1 -1
  68. package/js/tag/isLastRunMatched.function.d.ts +1 -1
  69. package/js/tag/isLikeTags.function.d.ts +2 -2
  70. package/js/tag/processUpdateAttrContext.function.d.ts +1 -1
  71. package/js/tag/processUpdateContext.function.d.ts +1 -1
  72. package/js/tag/render/renderExistingTag.function.d.ts +1 -1
  73. package/js/tag/render/renderSupport.function.d.ts +2 -2
  74. package/js/tag/render/renderTagOnly.function.d.ts +1 -1
  75. package/js/tag/render/renderWithSupport.function.d.ts +1 -1
  76. package/js/tag/render/softDestroySupport.function.d.ts +1 -1
  77. package/js/tag/smartRemoveKids.function.d.ts +1 -1
  78. package/js/tag/tag.d.ts +1 -1
  79. package/js/tag/tag.js +1 -1
  80. package/js/tag/tag.js.map +1 -1
  81. package/js/tag/tag.types.d.ts +1 -1
  82. package/js/tag/tag.utils.d.ts +2 -2
  83. package/js/tag/tagElement.d.ts +2 -2
  84. package/js/tag/tagElement.js +1 -1
  85. package/js/tag/tagElement.js.map +1 -1
  86. package/js/tag/tagRunner.d.ts +1 -1
  87. package/js/tag/update/getNewGlobal.function.d.ts +1 -1
  88. package/js/tag/update/oneRenderToSupport.function.d.ts +2 -2
  89. package/js/tag/update/oneRenderToSupport.function.js +1 -1
  90. package/js/tag/update/oneRenderToSupport.function.js.map +1 -1
  91. package/js/tag/update/processFirstSubject.utils.d.ts +2 -2
  92. package/js/tag/update/processFirstSubjectComponent.function.d.ts +2 -2
  93. package/js/tag/update/processFirstSubjectValue.function.d.ts +2 -2
  94. package/js/tag/update/processNewSubjectTag.function.d.ts +2 -2
  95. package/js/tag/update/processNewValue.function.d.ts +1 -1
  96. package/js/tag/update/processNewValue.function.js +1 -1
  97. package/js/tag/update/processNewValue.function.js.map +1 -1
  98. package/js/tag/update/processTag.function.d.ts +3 -3
  99. package/js/tag/update/processTag.function.js +1 -1
  100. package/js/tag/update/processTag.function.js.map +1 -1
  101. package/js/tag/update/processTagArray.d.ts +3 -3
  102. package/js/tag/update/processTagResult.function.d.ts +1 -1
  103. package/js/tag/update/updateExistingTagComponent.function.d.ts +1 -1
  104. package/js/tag/update/updateExistingValue.function.d.ts +1 -1
  105. package/js/tag/update/validateTemplater.function.d.ts +1 -1
  106. package/js/tag/updateSupportBy.function.d.ts +1 -1
  107. 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=0,t.global={}}t.d(e,{W9:()=>X,cg:()=>c,m0:()=>s,rS:()=>vt,Y2:()=>r,ei:()=>q,B7:()=>C,TU:()=>j,XF:()=>Q,PC:()=>Z,Ot:()=>k,Mj:()=>T,tD:()=>a,j8:()=>le,um:()=>ie,E2:()=>sn,OH:()=>an,TB:()=>Ne,Ii:()=>Ie,yV:()=>_e,zV:()=>v,ze:()=>cn,WJ:()=>S,aZ:()=>Re,O:()=>Ee,Ie:()=>o,B4:()=>pt,Az:()=>Dn,Xi:()=>bn,pc:()=>dt,Ah:()=>n,ck:()=>hn,Gk:()=>nt,cF:()=>zn,PB:()=>Mt,qy:()=>Ln,cy:()=>m,Tn:()=>h,Gv:()=>b,yL:()=>g,D8:()=>l,Ze:()=>p,_4:()=>d,mn:()=>f,Eb:()=>bt,z:()=>z,sA:()=>pn,MG:()=>ln,PL:()=>Me,nI:()=>Rt,PZ:()=>Ue,N_:()=>Fe,r5:()=>G,uc:()=>nn,pG:()=>Be,QB:()=>Ye,R6:()=>Un,Ll:()=>M,vP:()=>u,wk:()=>O,xP:()=>F,bc:()=>U,ag:()=>un,Tc:()=>yt,Hf:()=>Bn,_A:()=>rt,Ag:()=>ft,NU:()=>dn,hW:()=>gn,wB:()=>L,id:()=>A,MC:()=>E,zC:()=>x});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 fn()?O((()=>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){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 j extends C{value;onSubscription;_value;constructor(t,e){super(t,e),this.value=t,this.onSubscription=e,this._value=t,S(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 S(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,S(this)}subscribe(t){const e=super.subscribe(t);return t(this._value,e),e}}function A(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 x=t=>(e,n)=>{n.setHandler((()=>{}));const r=t(e).subscribe((t=>{r.unsubscribe(),n.next(t)}))};function O(t){return M.stateConfig.handlers.handler(t)}function P(t){const e=M.stateConfig;e.states[e.statesIndex]=t;return e.support.states[e.statesIndex]=t,++e.statesIndex,t(((...t)=>(O(t),t)))}function V(t){const e=M.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=_,e.handlers.statesHandler=P,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=I,e.handlers.statesHandler=V,e.support=t}class N{}function R(t){const e=t.callback;if(!e)return t.defaultValue;const[n]=function(t){const e=t(N),[n]=e,[r]=t(n);return[n,r]}(e);return n}function I(){const t=M.stateConfig,e=t.rearray[t.stateArray.length];return t.stateArray.push(e),e.defaultValue}function _(t){const e=M.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 R(r)},defaultValue:n};return e.stateArray.push(r),n}const M={stateConfig:{stateArray:[],version:Date.now(),handlers:{handler:_,statesHandler:P}}};function D(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);r[t](o);let s=0;const c=t=>e[s++];n[t](c)}}const L=(t,e)=>B(t,e),$=t=>t;const B=(t,e,{init:n,before:r,final:o=$}={})=>{const s=O({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 H(t,e){return Object.defineProperty(e,"noInit",{get(){const e=t();return e.setup.init=()=>{},e}}),Object.defineProperty(e,"asSubject",{get(){const e=t(),n=O((()=>fn())),r=O((()=>new k(void 0))),o=O((()=>({stateArray:M.stateConfig.stateArray,states:M.stateConfig.states}))),s=(t,s)=>(B(t,((t,e)=>{const c=fn(),a=s(t,e);if(c!==n){const t=o.stateArray,e=n.subject.global.oldest;D(t,e.state,o.states,e.states)}r.next(a)}),e.setup),r);return s.setup=e.setup,H((()=>s),s),s}}),Object.defineProperty(e,"truthy",{get(){const e=t();return e.setup.before=t=>t.every((t=>t)),e}}),e}function U(t,e){return fn()?O((()=>new C(t))):new C(t)}function F(t){return M.stateConfig.handlers.statesHandler(t)}function z(t){const e=u([]),n=u(0),r=u(0);let o=[],s=0;return r.value=n.value,t(((...t)=>(o=t,t))),L(o,(()=>{++s,e.value=o,t((()=>o))})),F((()=>{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}H((()=>function(t){const e=(e,n)=>B(e,n,t);return e.setup=t,H((()=>e),e),e}({})),L),U._value=t=>{const e=O((function(){return{stateArray:M.stateConfig.stateArray,states:M.stateConfig.states}})),n=fn();return O((function(){return new k(t).pipe((t=>(D(n.state,e.stateArray,n.states,e.states),t)))}))},U.all=function(t){const e=O((()=>({stateArray:M.stateConfig.stateArray,states:M.stateConfig.states}))),n=fn();return C.all(t).pipe((t=>(D(n.state,e.stateArray,n.states,e.states),t)))};const G={create:t=>{const e=O((()=>({stateDiff:0,provider:void 0})));if(e.stateDiff){let t=e.stateDiff;for(;t--;)O(void 0);return O(void 0)}const n=O((()=>{const n=M.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=>O((()=>{const e=t,n=e.compareTo=e.compareTo||t.toString(),r=fn(),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 Z extends Error{details;constructor(t,e,n={}){super(t),this.name=Z.name,this.details={...n,errorCode:e}}}class X extends Z{constructor(t,e){super(t,"array-no-key-error",e),this.name=X.name}}class q extends Z{constructor(t,e){super(t,"state-mismatch-error",e),this.name=q.name}}class Q extends Z{constructor(t,e){super(t,"sync-callback-error",e),this.name=Q.name}}function Y(t,e){return K(t,e)}function K(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]=K(t[r],e-1);else for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=K(t[r],e-1));return n}function tt(t,e,n){return et(t,e,n)}function et(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(!et(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)||!et(t[s],e[s],n-1))return!1}return!0}(t,e,n-1)));var r,o}function nt(t,e){const n={propWatch:t,props:e,tagJsType:a.templater,key:function(t){return n.arrayValue=t,n}};return n}const rt=[];function ot(t,e,n){return t.map((t=>function(t,e,n,r){if(p(t)||!t)return t;if(!e)return t;return st(t,e,n,r)}(t,e.ownerSupport,e,n)))}function st(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===fn(),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=en(t.templater);if(r){return rn(e,t)}const o=n.global;o.locked=!0,tn(o.newest,t,e,n),delete o.locked}(o,n),c};if(s)return a();return M.tagClosed$.toCallback(a),c}(r.mem,t,e)},Object.assign(r,t),r}(t,e);if(r===Tt)return t;return at(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]=st(s,n,e,r+1),typeof s===c.function){if(s.mem)continue;ct(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=st(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;ct(r+1,s,o,t,e)}}return t}(t,n,e,r)}function ct(t,e,n,r,o){if(t>0){const t=o.subject.global;r[e].subscription=t.destroy$.toCallback((function(){r[e]=n}))}}function at(t){return typeof t!==c.object||!t||t.tagJsType}function ut(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=M.stateConfig;return n.state=u.stateArray,n.states=u.states,n}function it(t){return t.map(lt)}function lt(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 it(n.values)}return m(t)?it(n):Y(t,e)}function pt(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 ft(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 vt.IMMUTABLE:return t.propsConfig={latest:e,castProps:n};case vt.SHALLOW:return t.propsConfig={latest:e.map((t=>lt(t,kt))),castProps:n}}return t.propsConfig={latest:e.map((t=>lt(t,Tt))),castProps:n}}}(e,o,r)),e}function dt(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 gt(t,e,n,r,o){const s=pt(t,r,o);return s.ownerSupport=e,ft(t,s,n,o)}function ht(t,e,n){const r=t.propWatch===vt.DEEP?Tt:kt,o=t.props,s=e.propsConfig;let c=s.castProps;const a=n?.propsConfig,u=a?.castProps;u&&(s.castProps=u,c=Ze(e,n,n.ownerSupport,o,r));return c||ot(o,e,0)}function bt(t){return{set html(e){e.arrayValue=t}}}let mt=0;var vt;function yt(t,e=vt.SHALLOW){const n=function(...r){const o=nt(e,r);o.tagJsType=a.tagComponent;const s=function(t,e){return function(n,r,o){const s=ht(t,n,o),c=n.ownerSupport,a=gt(t,c,n.appSupport,r,s);return ut(t,e,a,s)}}(o,n);return s.original=t,o.wrapper=s,o},r=t;return n.original=t,r.tags=rt,r.setUse=M,r.ValueTypes=a,r.tagIndex=mt++,rt.push(n),n}function wt(){throw new Error("Do not call tag.use as a function but instead set it as: `(props) => tag.use = (use) => html`` `")}function Ct(t,e){const n=function(t,e,n){const r=on(t,e);if(r)return 11;switch(n){case vt.NONE:return 1;case vt.SHALLOW:return St(t,e);case vt.IMMUTABLE:return jt(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])=>At(r,n[t],(()=>{delete e[t],delete n[t]}))));return r}return At(t,o,(()=>{n.splice(e,1),r.splice(e,1)}))}(t,e,n,r))))return 7;return!1}(t,e)}(e.props,t.propsConfig.latest,t.templater.propWatch);return n}function jt(t,e){const n=t.length;for(let r=0;r<n;++r){if(t[r]!==e[r])return 2}return!1}function St(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(!Et(e,o))return 3.1}}}return!1}!function(t){t.DEEP="deep",t.SHALLOW="shallow",t.NONE="none",t.IMMUTABLE="immutable"}(vt||(vt={})),yt.renderOnce=function(){throw new Error("Do not call tag.renderOnce as a function but instead set it as: `(props) => tag.renderOnce = () => html`` `")},yt.state=wt,yt.use=wt,yt.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`` `")},yt.key=bt,yt.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`` `")},yt.deepPropWatch=yt,yt.immutableProps=function(t){return yt(t,vt.IMMUTABLE)},yt.watchProps=function(t){return yt(t,vt.SHALLOW)},Object.defineProperty(yt,"renderOnce",{set(t){t.tagJsType=a.renderOnce}}),Object.defineProperty(yt,"state",{set(t){t.original={setUse:M,tags:rt},t.tagJsType=a.stateRender}}),Object.defineProperty(yt,"use",{set(t){t.original={setUse:M,tags:rt},t.tagJsType=a.stateRender}});const kt=3,Tt=10;function At(t,e,n){if(typeof t!==c.function)return!!tt(t,e,Tt)&&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 Et([t,e],n){const r=n[t];return typeof e===c.function&&typeof r===c.function||r===e}let xt=[],Ot=[],Pt=[],Vt=[],Jt=[],Wt=[];const Nt={locks:0};function Rt(){if(!(Nt.locks>0)){++Nt.locks;for(const t of xt){t.parentNode.removeChild(t)}for(const t of Ot)t();for(const[t,e]of Pt)e.textContent=t;for(const t of Vt)t.relative.appendChild(t.element);for(const{element:t,relative:e}of Jt)e.parentNode.insertBefore(t,e);for(const t of Wt)t();xt=[],Ot=[],Vt=[],Jt=[],Wt=[],Pt=[],--Nt.locks}}function It(t,e){const n=document.createTextNode(t);return Jt.push({element:n,relative:e}),n}function _t(t){switch(t){case void 0:case!1:case null:return o}return t}function Mt(t,e,n){Ot.push((()=>{void 0!==n&&!1!==n&&null!==n?t.setAttribute(e,n):t.removeAttribute(e)}))}function Dt(t,e,n,r,o,s){switch(r){case"init":{const t=s.added;return void Wt.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 Wt.push((()=>n.focus()));case"autoselect":return void Wt.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 Lt(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 $t(t,e=[]){const n=t.subject.global,r=en(t.templater),o=t.ownerSupport;if(n.locked)return e.push(t),e;if(r)return $t(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(on(n,o))return!0;switch(t.propWatch){case vt.IMMUTABLE:return jt(n,o);case vt.SHALLOW:return St(n,o)}return!tt(n,o,Tt)}(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=Lt(t.owner,t);n.push(...e.map((t=>t.support)))}return n}(s);return e.push(...l),i?($t(o,e),c&&e.push(s),e):(e.push(s),e)}function Bt(t){++Nt.locks,t.forEach(Ht),--Nt.locks,Rt()}function Ht(t){const e=t.subject.global;e&&nn(e.newest)}const Ut="no-data-ever",Ft="promise-no-data-ever";function zt(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.global;s.locked=!0;const c=t.apply(n,r);return function(t,e){const n=e.subject.global;return delete n.locked,function(t,e,n){return Bt($t(t)),function(t,e,n){if(g(t)){return e.subject.global.locked=!0,t.then((()=>{if(!0===n.deleted)return Ft;delete e.subject.global.locked;return Bt($t(e)),Ft}))}return Ut}(e,t,n)}(e,t,n)}(c,o)}(r.tagFunction,r.support,t,e)};return r.tagFunction=t,r.support=e,r}const Gt=["init","destroy"];function Zt(t,e,n,r,o,s,c){if(c)return Dt(t,e,n,c,s,o);r(n,t,e)}function Xt(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,qt(t,s,t.target)};c[e]=t,o.addEventListener(e,t)}n[s]=r,n[e]=r}function qt(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&&qt(t,e,o)}function Qt(t,e,n,r){const o=function(...e){return o.tagFunction(t,e)};o.tagFunction=e,o.support=n,Xt(n.appSupport,r,t,o)}function Yt(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"}function Kt(t,e,n,r,o,s,a,u,i){const l=oe(e);if(l>=0){const e=t[l],c=le(e,s,!0);return c.isAttr=!0,c.element=n,c.howToSet=o,c.isNameOnly=!0,void te(t,e,n,r,o,s,u)}const p=oe(i);if(p>=0){const i=t[p],l={isAttr:!0,element:n,attrName:e,checkValueChange:Ie,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)){const u=function(a){ee(a,t,e,n,r,o,s,c)},i=a.subscribe(u),l=e.global;(l.subscriptions=l.subscriptions||[]).push(i)}return void ee(e.value,t,e,n,r,o,s,c)}(e,l,n,r,o,a,u):(function(t,e,n,r,o,s,a,u){n.attrName=t,n.element=r,n.howToSet=o,typeof e===c.function?u&&Gt.includes(t)?Dt(t,e,r,t,s,a):re(n,e,s,t,r):(n.attrName=t,n.element=r,n.howToSet=o,n.isSpecial=u,Zt(t,e,r,o,a,s,u))}(e,i,l,n,o,r,u,a),void(l.value=i))}return Zt(e,i,n,o,u,r,a)}function te(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];Kt(t,o,n,r,s,a,Yt(o),u,c)}}function ee(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 re(c,e,t,r,n);return ne(e,n,r,o,s,t,u)}(o,t,r,e,c,s,n,u):ne(t,r,e,c,s,o,u)}function ne(t,e,n,r,o,s,c){switch(t){case void 0:case!1:case null:return void Ot.push((function(){e.removeAttribute(n)}))}if(!1===r)return h(t)?Qt(e,t,s,n):void o(e,n,t);Dt(n,t,e,r,s,c)}function re(t,e,n,r,o){const s=t.value;return s&&s.tagFunction&&s.support?(s.tagFunction=e,s.support=n,s):Qt(o,e=zt(e,n),n,r)}function oe(t){return b(t)&&"tagJsVar"in t?t.tagJsVar:-1}function se(t){return null==t||!1===t}const ce="object"==typeof document&&document.createElement("div");function ae(t,e,n,r,o,s,c,a,u=[]){const i=[];for(const l of t){const t={};i.push(t);const p=l.v;if(!isNaN(p)){ue(e,o,c,n,u,r,s);continue}if("text"===l.nn){const n=t,r=n.tc=l.tc;ce.innerHTML=r;const s=n.domElement=document.createTextNode(ce.innerText);s.id=`tp_${o.length}_${e.length}`,c?Vt.push({element:s,relative:c}):Jt.push({element:s,relative:a});continue}const f=t.domElement=document.createElement(l.nn);l.at&&l.at.map((t=>{const s=t[0],c=t[1],a=t[2]||!1;Kt(e,s,f,n,Mt,o,a,r,c)})),c?Vt.push({element:f,relative:c}):Jt.push({element:f,relative:a}),l.ch&&(t.ch=ae(l.ch,e,n,r,o,s+1,f,a,u).dom)}return{subs:u,dom:i,context:o}}function ue(t,e,n,r,s,c,a){const u=t[e.length],i=document.createTextNode(o);i.id=`dvp_${e.length}_${t.length}`;const l=le(u,e,a>0);if(l.placeholder=i,n?Vt.push({relative:n,element:i}):Jt.push({element:i,relative:r.subject.placeholder}),d(u))return void s.push({insertBefore:i,appendTo:n,subject:u,support:r,counts:c,contextItem:l});r.subject.global.locked=!0,Ue(u,l,r,c,`rvp_${e.length}_${t.length}`,n);delete r.subject.global.locked,l.value=u}function ie(t,e,n,r){const o=t.subject.global;o.oldest=t,o.newest=t,++Nt.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;return Dn(n.strings,n.values)}(t),s=t.templater.tag,c=s.values,u=[],i=t.subject.global;i.context=u;const l=ae(o,c,t,e,u,0,n,r);return l}(t,e,n,r);return o.htmlDomMeta=s.dom,--Nt.locks,s}function le(t,e,n){const r={value:t,checkValueChange:Ie,withinOwnerElement:n};return e.push(r),r}function pe(t,e,n){const r=e.global.newest;r.ownerSupport=t,e.checkValueChange=_e;const o=ie(r,n,void 0,e.placeholder);for(const t of o.subs)ze(t);return r}function fe(){return{tagJsType:a.templater}}function de(t,e,n){const r=dt(t,e,e.appSupport,n);return n.global.context=[],r}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)}))}te(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;ee(e,n.attrName,n,o,r,n.howToSet,n.isSpecial,ge),n.value=e}function be(t,e,n,r){const o=t[e],s=n[e];if(!d(o)){if(s.isAttr){if(o===s.value)return;he(t,o,s,r),s.value=o}ye(s,o,r),s.value=o}}function me(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),++Nt.locks,function(t,e){const n=t.templater.tag.values;let r=0;const o=n.length;for(;r<o;)be(n,r,e,t),++r}(t,n),--Nt.locks,Rt()}const ve={added:0,removed:0};function ye(t,e,r){if(e===t.value)return;const o=t.checkValueChange(e,t);if(-1===o)return;const s=e&&e.tagJsType;if(s){if(s===a.renderOnce)return;if(f(e))return t.global||n(t),void function(t,e,r){const o=e.global;if(!o.newest)return void Ge(t,e,r,{added:0,removed:0});const s=gt(t,r,r.appSupport,e);!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||We(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;Ee(s),n(t);const c=Ge(e,t,r,{added:0,removed:0})}(r,f,t);const d=p||Ct(s,f);if(!d){return void function(t,e,n,r,o){const s=t.props,c=Ze(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===vt.DEEP?Tt:kt)}if(o.locked)return void o.blocked.push(e);nn(e)}(r,s,e)}(e,t,r)}const u=t.global;if(u){const n=u.newest;if(n)return void function(t,e,n,r){if(typeof n===c.function)return;!function(t,e,n,r){const o=n.templater||n,s=gt(o,r,r.appSupport,e),c=t.subject.global;me(c.oldest,s)}(t,e,n,r)}(n,t,e,r)}if(s)switch(s){case a.templater:return void pe(r,t,ve);case a.tag:case a.dom:{const o=e;let s=o.templater;s||(s=fe(),o.templater=s,s.tag=o);return(t.global?t.global:n(t)).newest=de(s,r,t),void pe(r,t,ve)}}m(e)?xe(t,e,r,{added:0,removed:0}):typeof e!==c.function?o&&function(t,e){e.checkValueChange=Ie;const n=e.placeholder,r=_t(t);e.simpleValueElm=It(r,n)}(e,t):t.value=e}function we(t,e,r){r.checkValueChange=_e;const o=t;let s=o.templater;s||(s=nt(vt.DEEP),s.tag=o,o.templater=s);const c=r.global=n(r),a=c.newest=gt(s,e,e.appSupport,r);return c.oldest=a,r}function Ce(t){const e=t.subject.global,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 je(t){for(const e of t){const t=e.lastArray;if(t){je(t);continue}const n=e.global;if(!n)continue;const r=n.newest,o=n.subscriptions;o&&o.forEach((t=>t.unsubscribe())),f(r.templater)&&Ce(r);je(n.context)}}function Se(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&&Se(s,e,n)}return{tags:e,subs:n}}function ke(t,e){const n=t.subject.global,r=n.htmlDomMeta,o=n.context;n.deleted=!0;const s=n.destroys;if(s)return function(t,e,n,r){const o=[];if(t.forEach((t=>{const e=t();e instanceof Promise&&o.push(e)})),o.length){const t=Promise.all(o).then((()=>{Te(e,n),Ae(r),Rt()}));return void n.push(t)}Te(e,n),Ae(r),Rt()}(s,o,e,r);Te(o,e),Ae(r)}function Te(t,e){for(const n of t){if(n.withinOwnerElement)continue;const t=n.lastArray;if(t){Re(n,t);continue}const r=n.simpleValueElm;if(r){delete n.simpleValueElm,xt.push(r);continue}const o=n.global;if(void 0===o)continue;if(!0===o.deleted)continue;o.deleted=!0;const s=o.oldest;s&&ke(s,e)}}function Ae(t){t.forEach((t=>{const e=t.marker;e&&xt.push(e);const n=t.domElement;n&&xt.push(n)}))}function Ee(t){const e=t.subject.global;e.deleted=!0,t.subject.renderCount=0;const n=[];return je(e.context),e.destroy$&&Ce(t),ke(t,n),n}function xe(t,e,n,r,o){t.lastArray||(t.lastArray=[]);const s=t.lastArray;let c=t.placeholder,a=0;const u=[];for(let t=0;t<s.length;++t){const n=s[t],o=Je(n,e,t,s,a,r);0!==o?(a+=o,2===o&&(t-=1)):u.push(n)}t.lastArray=u;const i=o,l=e.length;for(let t=0;t<l;++t){c=Oe(e,t,u,n,c,r,i).placeholder}}function Oe(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 ye(e,t,r),e;const i=Pe(t,s,r,c,n,a);return i}(a,u,n,r,e,o,s,c):Pe(a,o,r,s,n,c)}function Pe(t,e,n,r,o,s){const c={value:t,checkValueChange:Ie,withinOwnerElement:!1};r.added=r.added+1;const u=document.createTextNode("");return c.placeholder=u,s||Jt.push({element:u,relative:e}),function(t,e,n){const r=t.tagJsType;if(r)switch(r){case a.templater:we(t.tag,e,n);break;case a.tag:case a.dom:we(t,e,n)}}(t,n,c),Ue(t,c,n,r,`rvp_${o.length}_array`,s),c.value=t,o.push(c),s&&Vt.push({element:u,relative:s}),c}function Ve(t,e){const n=t.global;if(n){const t=n.oldest;n.deleted=!0,Ee(t),n.deleted=!0}else{const e=t.simpleValueElm;delete t.simpleValueElm,xt.push(e)}++e.removed}function Je(t,e,n,r,o,s){const c=e.length-1,a=n-o,u=a<0||c<a,i=r[n];return u?(Ve(i,s),++o,1):r[n].value.arrayValue!==e[n].arrayValue?(Ve(i,s),r.splice(n,1),++o,2):0}function We(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 Ne(t,e){if(!m(t)){return Re(e,e.lastArray),9}return!1}function Re(t,e){const n={added:0,removed:0};for(let t=0;t<e.length;++t)Ve(e[t],n);delete t.lastArray}function Ie(t,e){if(null==t||typeof t!==c.object)return function(t,e){const n=_t(t),r=e.simpleValueElm;Pt.push([n,r])}(t,e),-1;const n=e.simpleValueElm;return delete e.simpleValueElm,xt.push(n),6}function _e(t,e){const r=e.global,o=r?.newest;if(p(t)){return!We(t,o)&&(Ee(o),n(e),7)}const s=t?.tagJsType;return!s&&(Ee(o),delete e.global,e.renderCount=0,8)}function Me(t,e,n){const r=nt(vt.DEEP);r.tagJsType=t.tagJsType;const o=de(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 De(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 q(r,c);throw console.error(Le,c),a}(n,e,t)}M.tagClosed$=new C(void 0,(function(t){fn()||t.next()}));const Le="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 $e(t,e){const n=t.subject;++n.renderCount;const r=M.stateConfig;delete r.support,t.state=r.stateArray,M.tagClosed$.next(e),De(r,t),n.global.newest=t}function Be(t,e,n,r){const o=n.global,s=n.renderCount,c=e?.state,u=M.stateConfig;if(c){const n=e.states;u.prevSupport=e,W(t,M.stateConfig,c,n)}else J(t,u);const i=t.templater;let l;if(i.tagJsType===a.stateRender){l=ut(i,i,gt(i,r,t.appSupport,n)),l.states=t.states}else{l=(0,i.wrapper)(t,n,e),l.states=t.states}return $e(l,r),n.renderCount>s+1?o.newest:l}function He(t,e,n,r,o){n.checkValueChange=_e;const s=de(t,e,n);s.ownerSupport=e;const c=ie(s,o,r,void 0);for(const t of c.dom)t.marker&&Vt.push({element:t.marker,relative:r}),t.domElement&&Vt.push({element:t.domElement,relative:r});let a=-1;const u=c.subs.length-1;for(;a++<u;){ze(c.subs[a])}return s}function Ue(t,e,r,o,s,c){const u=t?.tagJsType;if(u)switch(u){case a.templater:return e.checkValueChange=_e,c?He(t,r,e,c,o):pe(r,e,o);case a.dom:case a.tag:{e.checkValueChange=_e;const s=t;let a=s.templater;a||(a=function(t){const e=fe();return e.tag=t,t.templater=e,e}(s));const u=n(e);return c?He(a,r,e,c,o):(u.newest=de(a,r,e),e.checkValueChange=_e,pe(r,e,o))}case a.stateRender:case a.tagComponent:if(n(e),e.checkValueChange=_e,c){const n=function(t,e,n,r,o){const s=gt(t,n,n.appSupport,e),c=s.propsConfig;if(c){const e=t.tagJsType!==a.tagComponent?[]:ht(t,s);c.castProps=e}const u=e.global,{support:i}=Ye(s,u.newest,e,n);return function(t,e,n){let r=Vt.length;const o=ie(t,e,n,void 0);for(const t of o.dom)t.domElement&&Vt.splice(r++,0,{element:t.domElement,relative:n}),t.marker&&Vt.splice(r++,0,{element:t.marker,relative:n});const s=o.subs;for(const t of s)ze(t)}(i,r,o),i}(t,e,r,o,c);return n}return Ge(t,e,r,o);case a.renderOnce:{n(e);const s=Me(t,e,r);Be(s,void 0,e,r);const a=He(s.templater,r,e,c,o);return e.checkValueChange=_e,a}}if(m(t))return xe(e,t,r,o,c),void(e.checkValueChange=Ne);d(t)||function(t,e,n,r){const o=_t(t),s=It(o,n);s.id=r,e.simpleValueElm=s,e.checkValueChange=Ie}(t,e,e.placeholder,s)}function Fe(t,e,n){t!==e.value&&(ye(e,t,n),M.stateConfig.support||Rt())}function ze({subject:t,support:e,counts:n,contextItem:r,appendTo:o}){let s=function(t){Ue(t,r,e,{...n},`rvp_-1_${e.templater.tag?.values.length}`,c?o:void 0),c||M.stateConfig.support||Rt(),s=function(t){Fe(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 Ge(t,e,n,r){const o=gt(t,n,n.appSupport,e),s=o.propsConfig;if(s){const e=t.tagJsType!==a.tagComponent?[]:ht(t,o);s.castProps=e}const c=e.global,{support:u}=Ye(o,c.newest,e,n);return function(t,e,n){n.checkValueChange=_e;const r=ie(t,e,void 0,n.placeholder).subs;for(const t of r)ze(t)}(u,r,e),u}function Ze(t,e,n,r,o,s=-1){const c=e.subject.global.newest;if(!c){const e=ot(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=Xe(a[e],c,t,n,s+1,o);u.push(i)}return t.propsConfig.castProps=u,u}function Xe(t,e,n,r,o,s){return typeof t===c.function?e.mem?(t.mem=e.mem,e):(t.mem=e,t):s===o||at(e)?e:m(e)?function(t,e,n,r,o){for(let s=t.length-1;s>=0;--s){const c=t[s];t[s]=Xe(e[s],c,n,r,o+1,s)}return t}(e,t,n,r,s):void 0===t?e:function(t,e,n,r,o,s){const c=Object.keys(t);for(const a of c){const c=t[a],u=Xe(e[a],c,n,r,s,o+1);if(t[a]===u)continue;const i=Object.getOwnPropertyDescriptor(t,a)?.set;i||(t[a]=u)}return t}(e,t,n,r,s,o)}function qe(t){const e=t.subject.global,{subs:r,tags:o}=Se(e.context);Qe(t);for(const t of o)Qe(t);e.subscriptions&&r.forEach((t=>t.unsubscribe())),n(t.subject)}function Qe(t){const e=t.subject,n=e.global;!0!==n.deleted&&(n.deleted=!0,e.renderCount=0,ke(t,[]))}function Ye(t,e,n,r){const o=e?.templater,s=o?.tag,c=Be(t,e,n,r),u=!e||We(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&&qe(e))}if(n){const r=n.strings;if(r){const n=r?.length;n!==t.strings.length&&qe(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),qe(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 Ke={added:0,removed:0};function tn(t,e,n,r){const o=r.global,{support:s,wasLikeTags:c}=Ye(e,t,r,n);return c?(me(o.oldest,s),s):(pe(n,r,Ke),s)}function en(t){return a.templater===t.tagJsType}function nn(t){const e=t.subject.global,n=en(t.templater),r=t.ownerSupport;if(e.locked)return e.blocked.push(t),t;if(n)return rn(r,t);e.locked=!0;const o=t.subject;e.blocked.length&&(t=e.blocked.pop(),e.blocked=[]),delete e.locked;return tn(e.newest,t,r,o)}function rn(t,e){const n=t.subject.global;if(!n||!0===n.deleted)return e;return nn(n.newest||t)}function on(t,e){return t.length!==e.length}function sn(t){const e=fn();if(!e)throw un;return cn(e,M.stateConfig,t)}function cn(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,s=(t=o.newest).state;D(s,n.stateArray,t.states,n.states);const c=e(...r);return D(n.stateArray,s,n.states,t.states),nn(t),g(c)&&c.finally((()=>{D(n.stateArray,s,n.states,t.states),nn(t)})),c}(t,n,{stateArray:r,states:o},...e):n(...e)}}const an=()=>{const t=fn();if(!t)throw un;const e=M.stateConfig;return function(n){return cn(t,e,n)}},un=new Q("callback() was called outside of synchronous rendering. Use `callback = callbackMaker()` to create a callback that could be called out of sync with rendering");function ln(t){O(t)}function pn(t){O((function(){fn().subject.global.destroy$.toCallback(t)}))}function fn(){return M.stateConfig.support}const dn=":tagvar",gn=":";function hn(t,e){const n={values:e,ownerSupport:fn(),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 bn(t,e){const n={values:e,ownerSupport:fn(),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 mn="ondoubleclick",vn=/(:tagvar\d+:)/,yn=/(^:tagvar\d+:|:tagvar\d+:$)/g,wn="__safeTagVar",Cn=/([:_a-zA-Z0-9\-.]+)\s*(?:=\s*"([^"]*)"|=\s*(\S+))?/g,jn=/<\/?([a-zA-Z0-9-]+)((?:\s+[a-zA-Z_:][\w:.-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)+\s*|\s*)\/?>/g;function Sn(t,e){kn(t,e);const n=function(t){const e=[],n=[],r=[];let o=null,s=-1,c=0;const a=new RegExp(jn,"g");t=function(t){return t.replace(En,(function(t){return t.replace(/\[l t\]/g,"[l&nbsp;t]").replace(/\[g t\]/g,"[g&nbsp;t]").replace(/</g,"[l t]").replace(/>/g,"[g t]")}))}(t);for(;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()){Tn(e).forEach((t=>{t.startsWith(dn)&&(t=dn+ ++s+gn),An(o,n,t)}))}}if(c=u.index+i.length,f){o=r.pop()||null;continue}const g=[];let h;for(;null!==(h=Cn.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")?On(c):c;if(o){if(t.slice(0,dn.length)===dn){const t=dn+ ++s+gn;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=dn+ ++s+gn}r||(n=h[2]);const u=[a,n],i=Yt(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()){Tn(e).forEach((t=>(t.startsWith(dn)&&++s,An(o,n,t))))}}return n}(kn(t,e).join(""));return n}function kn(t,e){return function(t,e){const n=t.map(((t,n)=>n<e.length?t+dn+n+gn:t));return function(t,e,n){const r=n.length-e.length;if(r>0)for(let n=r;n>0;--n)t.push(dn+(e.length+n-1)+gn)}(n,t,e),n}(t.map((t=>t.replace(yn,((t,e)=>wn+e)))),e)}function Tn(t){return t.split(vn).filter((t=>""!==t))}function An(t,e,n){!function(t,e,n){t?(t.ch||(t.ch=[]),t.ch.push(n)):e.push(n)}(t,e,{nn:"text",tc:xn(n)})}const En=new RegExp("(\x3c!--[\\s\\S]*?--\x3e)","g");function xn(t){return t.replace(/(\[l t\]!--[\s\S]*?--\[g t\])/g,(function(t){return t.replace(/\[l t\]/g,"<").replace(/\[g t\]/g,">").replace(/\[l&nbsp;t\]/g,"[l t]").replace(/\[g&nbsp;t\]/g,"[g t]")}))}function On(t){if(t.startsWith("on")){return t.length===mn.length&&t===mn?"dblclick":t.slice(2,t.length)}return t}const Pn=new RegExp(dn+"(\\d+)"+gn,"g"),Vn="ch";function Jn(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=Nn(t,e)}if(c.ch){const t=c.ch,r=[...s,Vn];c.ch=Jn(t,e,n,r)}t=Wn(c,e,o,t)}return o}function Wn(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=Pn.exec(a));){const t=c[1],o=parseInt(t,10);if(!isNaN(o)&&o<e){const t=dn+o+gn,e=a.slice(c.index+t.length);n.splice(r,1,{nn:"text",v:o}),a=e,Pn.lastIndex=0}}return o.tc=a,r}function Nn(t,e){return t.map((t=>{const[n,r,o]=t;if(n.startsWith(dn)){const t=parseInt(n.replace(dn,""),10);if(!isNaN(t)&&t<e)return[{tagJsVar:t}]}if(typeof r===s.string&&r.startsWith(dn)){const t=parseInt(r.replace(dn,""),10);if(!isNaN(t)&&t<e)return[n,{tagJsVar:t},o]}return t}))}const Rn="__safeTagVar";const In=/__safeTagVar(\d+)/g;function _n(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(Rn)){const n=parseInt(e.replace(Rn,""),10);t[1]=dn+n+gn}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(In,((t,e)=>dn+e+gn))}_n(n)}0===e.length&&delete t.ch}}const Mn={};function Dn(t,e){const n=function(t){const e=t.map((t=>t.length));return e.push(t.length),Number(e.join(""))}(t),r=Mn[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=Jn(Sn(t,e),e.length);s.forEach(_n);const c={interpolation:void 0,string:void 0,strings:t,values:e,domMetaMap:s};return Mn[n]=c,s}function Ln(t,...e){const n=hn(t,e),r=nt(vt.NONE);return r.tag=n,n.templater=r,n}Ln.dom=function(t,...e){return bn(t,e)};const $n=[];function Bn(t,e,r){const o=$n.findIndex((t=>t.element===e));o>=0&&(Ee($n[o].support),$n.splice(o,1),console.warn("Found and destroyed app element already rendered to element",{element:e}));let s=()=>l(r);s.propWatch=vt.NONE,s.tagJsType=a.stateRender,s.props=[r],s.isApp=!0;const u=function(t,e){const r={value:t,checkValueChange:_e,withinOwnerElement:!1,renderCount:0,global:void 0},o=n(r);return o.events={},Hn(t,r,e),r}(s,e),i=u.global;J(i.newest,M.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("");rt.push(s.wrapper||{original:s});const g=Un(s,d,e,u,p);i.isApp=!0,p&&(l.tag=g.templater.tag),e.destroy=function(){const t=i.events;for(const n in t){const r=t[n];e.removeEventListener(n,r)}i.events={};const n=Ee(g);return Rt(),n},++Nt.locks;const h=ie(g,{added:0,removed:0},e,void 0);i.oldest=g,i.newest=g;let b=s.setUse;if(s.tagJsType!==a.stateRender){const e=t.original;b=e.setUse,e.isApp=!0}e.setUse=b,e.ValueTypes=a,$n.push({element:e,support:g});const m=document.createDocumentFragment();m.appendChild(d);for(const t of h.dom)Fn(t,m);for(const t of h.subs)ze(t);return--Nt.locks,Rt(),e.appendChild(m),{support:g,tags:rt,ValueTypes:a}}function Hn(t,e,n){const r=e.global,o=pt(t,e);return ft(t,o,o),o.appElement=n,r.oldest=r.oldest||o,r.newest=o,o}function Un(t,e,n,r,o){r.placeholder=e;const s=r.global,c=s.newest,u=s.oldest;if(c===u||W(c,M.stateConfig,u.state,u.states),t.tagJsType===a.stateRender){const e=t.wrapper||{original:t};if(!o){const e=Hn(t,r,n);return $e(e),e}const s=ut(t,e,c);return $e(s),s}const i=(0,t.wrapper)(c,r);return $e(i),i}function Fn(t,e){t.domElement&&e.appendChild(t.domElement),t.marker&&e.appendChild(t.marker)}const zn={tagElement:Bn,renderWithSupport:Ye,renderSupport:nn,renderTagOnly:Be,paint:Rt};var Gn=e.W9,Zn=e.cg,Xn=e.m0,qn=e.rS,Qn=e.Y2,Yn=e.ei,Kn=e.B7,tr=e.TU,er=e.XF,nr=e.PC,rr=e.Ot,or=e.Mj,sr=e.tD,cr=e.j8,ar=e.um,ur=e.E2,ir=e.OH,lr=e.TB,pr=e.Ii,fr=e.yV,dr=e.zV,gr=e.ze,hr=e.WJ,br=e.aZ,mr=e.O,vr=e.Ie,yr=e.B4,wr=e.Az,Cr=e.Xi,jr=e.pc,Sr=e.Ah,kr=e.ck,Tr=e.Gk,Ar=e.cF,Er=e.PB,xr=e.qy,Or=e.cy,Pr=e.Tn,Vr=e.Gv,Jr=e.yL,Wr=e.D8,Nr=e.Ze,Rr=e._4,Ir=e.mn,_r=e.Eb,Mr=e.z,Dr=e.sA,Lr=e.MG,$r=e.PL,Br=e.nI,Hr=e.PZ,Ur=e.N_,Fr=e.r5,zr=e.uc,Gr=e.pG,Zr=e.QB,Xr=e.R6,qr=e.Ll,Qr=e.vP,Yr=e.wk,Kr=e.xP,to=e.bc,eo=e.ag,no=e.Tc,ro=e.Hf,oo=e._A,so=e.Ag,co=e.NU,ao=e.hW,uo=e.wB,io=e.id,lo=e.MC,po=e.zC;export{Gn as ArrayNoKeyError,Zn as BasicTypes,Xn as ImmutableTypes,qn as PropWatches,Qn as RouteQuery,Yn as StateMismatchError,Kn as Subject,tr as Subjective,er as SyncCallbackError,nr as TagError,rr as ValueSubject,or as ValueSubjective,sr as ValueTypes,cr as addOneContext,ar as buildBeforeElement,ur as callback,ir as callbackMaker,lr as checkArrayValueChange,pr as checkSimpleValueChange,fr as checkTagValueChange,dr as combineLatest,gr as createTrigger,hr as defineValueOn,br as destroyArray,mr as destroySupport,vr as empty,yr as getBaseSupport,wr as getDomMeta,Cr as getDomTag,jr as getHtmlSupport,Sr as getNewGlobal,kr as getStringTag,Tr as getTemplaterResult,Ar as hmr,Er as howToSetInputValue,xr as html,Or as isArray,Pr as isFunction,Vr as isObject,Jr as isPromise,Wr as isSimpleType,Nr as isStaticTag,Rr as isSubjectInstance,Ir as isTagComponent,_r as key,Mr as letProp,Dr as onDestroy,Lr as onInit,$r as oneRenderToSupport,Br as paint,Hr as processFirstSubjectValue,Ur as processSubUpdate,Fr as providers,zr as renderSupport,Gr as renderTagOnly,Zr as renderWithSupport,Xr as runWrapper,qr as setUseMemory,Qr as signal,Yr as state,Kr as states,to as subject,eo as syncError,no as tag,ro as tagElement,oo as tags,so as upgradeBaseToSupport,co as variablePrefix,ao as variableSuffix,uo as watch,io as willCallback,lo as willPromise,po 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=0,t.global={}}t.d(e,{W9:()=>X,cg:()=>c,m0:()=>s,rS:()=>vt,Y2:()=>r,ei:()=>q,B7:()=>C,TU:()=>j,XF:()=>Q,PC:()=>Z,Ot:()=>k,Mj:()=>T,tD:()=>a,j8:()=>le,um:()=>ie,E2:()=>sn,OH:()=>an,TB:()=>Ne,Ii:()=>Ie,yV:()=>_e,zV:()=>v,ze:()=>cn,WJ:()=>S,aZ:()=>Re,O:()=>Ee,Ie:()=>o,B4:()=>pt,Az:()=>Dn,Xi:()=>bn,pc:()=>dt,Ah:()=>n,ck:()=>hn,k6:()=>gt,Gk:()=>nt,cF:()=>zn,PB:()=>Mt,qy:()=>Ln,cy:()=>m,Tn:()=>h,Gv:()=>b,yL:()=>g,D8:()=>l,Ze:()=>p,_4:()=>d,mn:()=>f,Eb:()=>bt,z:()=>z,sA:()=>pn,MG:()=>ln,PL:()=>Me,nI:()=>Rt,PZ:()=>Ue,N_:()=>Fe,r5:()=>G,uc:()=>nn,pG:()=>Be,QB:()=>Ye,R6:()=>Un,Ll:()=>M,vP:()=>u,wk:()=>O,xP:()=>F,bc:()=>U,ag:()=>un,Tc:()=>yt,Hf:()=>Bn,_A:()=>rt,Ag:()=>ft,NU:()=>dn,hW:()=>gn,wB:()=>L,id:()=>A,MC:()=>E,zC:()=>x});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 fn()?O((()=>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){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 j extends C{value;onSubscription;_value;constructor(t,e){super(t,e),this.value=t,this.onSubscription=e,this._value=t,S(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 S(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,S(this)}subscribe(t){const e=super.subscribe(t);return t(this._value,e),e}}function A(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 x=t=>(e,n)=>{n.setHandler((()=>{}));const r=t(e).subscribe((t=>{r.unsubscribe(),n.next(t)}))};function O(t){return M.stateConfig.handlers.handler(t)}function P(t){const e=M.stateConfig;e.states[e.statesIndex]=t;return e.support.states[e.statesIndex]=t,++e.statesIndex,t(((...t)=>(O(t),t)))}function V(t){const e=M.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=_,e.handlers.statesHandler=P,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=I,e.handlers.statesHandler=V,e.support=t}class N{}function R(t){const e=t.callback;if(!e)return t.defaultValue;const[n]=function(t){const e=t(N),[n]=e,[r]=t(n);return[n,r]}(e);return n}function I(){const t=M.stateConfig,e=t.rearray[t.stateArray.length];return t.stateArray.push(e),e.defaultValue}function _(t){const e=M.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 R(r)},defaultValue:n};return e.stateArray.push(r),n}const M={stateConfig:{stateArray:[],version:Date.now(),handlers:{handler:_,statesHandler:P}}};function D(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);r[t](o);let s=0;const c=t=>e[s++];n[t](c)}}const L=(t,e)=>B(t,e),$=t=>t;const B=(t,e,{init:n,before:r,final:o=$}={})=>{const s=O({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 H(t,e){return Object.defineProperty(e,"noInit",{get(){const e=t();return e.setup.init=()=>{},e}}),Object.defineProperty(e,"asSubject",{get(){const e=t(),n=O((()=>fn())),r=O((()=>new k(void 0))),o=O((()=>({stateArray:M.stateConfig.stateArray,states:M.stateConfig.states}))),s=(t,s)=>(B(t,((t,e)=>{const c=fn(),a=s(t,e);if(c!==n){const t=o.stateArray,e=n.subject.global.oldest;D(t,e.state,o.states,e.states)}r.next(a)}),e.setup),r);return s.setup=e.setup,H((()=>s),s),s}}),Object.defineProperty(e,"truthy",{get(){const e=t();return e.setup.before=t=>t.every((t=>t)),e}}),e}function U(t,e){return fn()?O((()=>new C(t))):new C(t)}function F(t){return M.stateConfig.handlers.statesHandler(t)}function z(t){const e=u([]),n=u(0),r=u(0);let o=[],s=0;return r.value=n.value,t(((...t)=>(o=t,t))),L(o,(()=>{++s,e.value=o,t((()=>o))})),F((()=>{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}H((()=>function(t){const e=(e,n)=>B(e,n,t);return e.setup=t,H((()=>e),e),e}({})),L),U._value=t=>{const e=O((function(){return{stateArray:M.stateConfig.stateArray,states:M.stateConfig.states}})),n=fn();return O((function(){return new k(t).pipe((t=>(D(n.state,e.stateArray,n.states,e.states),t)))}))},U.all=function(t){const e=O((()=>({stateArray:M.stateConfig.stateArray,states:M.stateConfig.states}))),n=fn();return C.all(t).pipe((t=>(D(n.state,e.stateArray,n.states,e.states),t)))};const G={create:t=>{const e=O((()=>({stateDiff:0,provider:void 0})));if(e.stateDiff){let t=e.stateDiff;for(;t--;)O(void 0);return O(void 0)}const n=O((()=>{const n=M.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=>O((()=>{const e=t,n=e.compareTo=e.compareTo||t.toString(),r=fn(),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 Z extends Error{details;constructor(t,e,n={}){super(t),this.name=Z.name,this.details={...n,errorCode:e}}}class X extends Z{constructor(t,e){super(t,"array-no-key-error",e),this.name=X.name}}class q extends Z{constructor(t,e){super(t,"state-mismatch-error",e),this.name=q.name}}class Q extends Z{constructor(t,e){super(t,"sync-callback-error",e),this.name=Q.name}}function Y(t,e){return K(t,e)}function K(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]=K(t[r],e-1);else for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=K(t[r],e-1));return n}function tt(t,e,n){return et(t,e,n)}function et(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(!et(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)||!et(t[s],e[s],n-1))return!1}return!0}(t,e,n-1)));var r,o}function nt(t,e){const n={propWatch:t,props:e,tagJsType:a.templater,key:function(t){return n.arrayValue=t,n}};return n}const rt=[];function ot(t,e,n){return t.map((t=>function(t,e,n,r){if(p(t)||!t)return t;if(!e)return t;return st(t,e,n,r)}(t,e.ownerSupport,e,n)))}function st(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===fn(),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=en(t.templater);if(r){return rn(e,t)}const o=n.global;o.locked=!0,tn(o.newest,t,e,n),delete o.locked}(o,n),c};if(s)return a();return M.tagClosed$.toCallback(a),c}(r.mem,t,e)},Object.assign(r,t),r}(t,e);if(r===Tt)return t;return at(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]=st(s,n,e,r+1),typeof s===c.function){if(s.mem)continue;ct(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=st(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;ct(r+1,s,o,t,e)}}return t}(t,n,e,r)}function ct(t,e,n,r,o){if(t>0){const t=o.subject.global;r[e].subscription=t.destroy$.toCallback((function(){r[e]=n}))}}function at(t){return typeof t!==c.object||!t||t.tagJsType}function ut(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=M.stateConfig;return n.state=u.stateArray,n.states=u.states,n}function it(t){return t.map(lt)}function lt(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 it(n.values)}return m(t)?it(n):Y(t,e)}function pt(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 ft(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 vt.IMMUTABLE:return t.propsConfig={latest:e,castProps:n};case vt.SHALLOW:return t.propsConfig={latest:e.map((t=>lt(t,kt))),castProps:n}}return t.propsConfig={latest:e.map((t=>lt(t,Tt))),castProps:n}}}(e,o,r)),e}function dt(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 gt(t,e,n,r,o){const s=pt(t,r,o);return s.ownerSupport=e,ft(t,s,n,o)}function ht(t,e,n){const r=t.propWatch===vt.DEEP?Tt:kt,o=t.props,s=e.propsConfig;let c=s.castProps;const a=n?.propsConfig,u=a?.castProps;u&&(s.castProps=u,c=Ze(e,n,n.ownerSupport,o,r));return c||ot(o,e,0)}function bt(t){return{set html(e){e.arrayValue=t}}}let mt=0;var vt;function yt(t,e=vt.SHALLOW){const n=function(...r){const o=nt(e,r);o.tagJsType=a.tagComponent;const s=function(t,e){return function(n,r,o){const s=ht(t,n,o),c=n.ownerSupport,a=gt(t,c,n.appSupport,r,s);return ut(t,e,a,s)}}(o,n);return s.original=t,o.wrapper=s,o},r=t;return n.original=t,r.tags=rt,r.setUse=M,r.ValueTypes=a,r.tagIndex=mt++,rt.push(n),n}function wt(){throw new Error("Do not call tag.use as a function but instead set it as: `(props) => tag.use = (use) => html`` `")}function Ct(t,e){const n=function(t,e,n){const r=on(t,e);if(r)return 11;switch(n){case vt.NONE:return 1;case vt.SHALLOW:return St(t,e);case vt.IMMUTABLE:return jt(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])=>At(r,n[t],(()=>{delete e[t],delete n[t]}))));return r}return At(t,o,(()=>{n.splice(e,1),r.splice(e,1)}))}(t,e,n,r))))return 7;return!1}(t,e)}(e.props,t.propsConfig.latest,t.templater.propWatch);return n}function jt(t,e){const n=t.length;for(let r=0;r<n;++r){if(t[r]!==e[r])return 2}return!1}function St(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(!Et(e,o))return 3.1}}}return!1}!function(t){t.DEEP="deep",t.SHALLOW="shallow",t.NONE="none",t.IMMUTABLE="immutable"}(vt||(vt={})),yt.renderOnce=function(){throw new Error("Do not call tag.renderOnce as a function but instead set it as: `(props) => tag.renderOnce = () => html`` `")},yt.state=wt,yt.use=wt,yt.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`` `")},yt.key=bt,yt.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`` `")},yt.deepPropWatch=yt,yt.immutableProps=function(t){return yt(t,vt.IMMUTABLE)},yt.watchProps=function(t){return yt(t,vt.SHALLOW)},Object.defineProperty(yt,"renderOnce",{set(t){t.tagJsType=a.renderOnce}}),Object.defineProperty(yt,"state",{set(t){t.original={setUse:M,tags:rt},t.tagJsType=a.stateRender}}),Object.defineProperty(yt,"use",{set(t){t.original={setUse:M,tags:rt},t.tagJsType=a.stateRender}});const kt=3,Tt=10;function At(t,e,n){if(typeof t!==c.function)return!!tt(t,e,Tt)&&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 Et([t,e],n){const r=n[t];return typeof e===c.function&&typeof r===c.function||r===e}let xt=[],Ot=[],Pt=[],Vt=[],Jt=[],Wt=[];const Nt={locks:0};function Rt(){if(!(Nt.locks>0)){++Nt.locks;for(const t of xt){t.parentNode.removeChild(t)}for(const t of Ot)t();for(const[t,e]of Pt)e.textContent=t;for(const t of Vt)t.relative.appendChild(t.element);for(const{element:t,relative:e}of Jt)e.parentNode.insertBefore(t,e);for(const t of Wt)t();xt=[],Ot=[],Vt=[],Jt=[],Wt=[],Pt=[],--Nt.locks}}function It(t,e){const n=document.createTextNode(t);return Jt.push({element:n,relative:e}),n}function _t(t){switch(t){case void 0:case!1:case null:return o}return t}function Mt(t,e,n){Ot.push((()=>{void 0!==n&&!1!==n&&null!==n?t.setAttribute(e,n):t.removeAttribute(e)}))}function Dt(t,e,n,r,o,s){switch(r){case"init":{const t=s.added;return void Wt.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 Wt.push((()=>n.focus()));case"autoselect":return void Wt.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 Lt(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 $t(t,e=[]){const n=t.subject.global,r=en(t.templater),o=t.ownerSupport;if(n.locked)return e.push(t),e;if(r)return $t(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(on(n,o))return!0;switch(t.propWatch){case vt.IMMUTABLE:return jt(n,o);case vt.SHALLOW:return St(n,o)}return!tt(n,o,Tt)}(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=Lt(t.owner,t);n.push(...e.map((t=>t.support)))}return n}(s);return e.push(...l),i?($t(o,e),c&&e.push(s),e):(e.push(s),e)}function Bt(t){++Nt.locks,t.forEach(Ht),--Nt.locks,Rt()}function Ht(t){const e=t.subject.global;e&&nn(e.newest)}const Ut="no-data-ever",Ft="promise-no-data-ever";function zt(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.global;s.locked=!0;const c=t.apply(n,r);return function(t,e){const n=e.subject.global;return delete n.locked,function(t,e,n){return Bt($t(t)),function(t,e,n){if(g(t)){return e.subject.global.locked=!0,t.then((()=>{if(!0===n.deleted)return Ft;delete e.subject.global.locked;return Bt($t(e)),Ft}))}return Ut}(e,t,n)}(e,t,n)}(c,o)}(r.tagFunction,r.support,t,e)};return r.tagFunction=t,r.support=e,r}const Gt=["init","destroy"];function Zt(t,e,n,r,o,s,c){if(c)return Dt(t,e,n,c,s,o);r(n,t,e)}function Xt(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,qt(t,s,t.target)};c[e]=t,o.addEventListener(e,t)}n[s]=r,n[e]=r}function qt(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&&qt(t,e,o)}function Qt(t,e,n,r){const o=function(...e){return o.tagFunction(t,e)};o.tagFunction=e,o.support=n,Xt(n.appSupport,r,t,o)}function Yt(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"}function Kt(t,e,n,r,o,s,a,u,i){const l=oe(e);if(l>=0){const e=t[l],c=le(e,s,!0);return c.isAttr=!0,c.element=n,c.howToSet=o,c.isNameOnly=!0,void te(t,e,n,r,o,s,u)}const p=oe(i);if(p>=0){const i=t[p],l={isAttr:!0,element:n,attrName:e,checkValueChange:Ie,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)){const u=function(a){ee(a,t,e,n,r,o,s,c)},i=a.subscribe(u),l=e.global;(l.subscriptions=l.subscriptions||[]).push(i)}return void ee(e.value,t,e,n,r,o,s,c)}(e,l,n,r,o,a,u):(function(t,e,n,r,o,s,a,u){n.attrName=t,n.element=r,n.howToSet=o,typeof e===c.function?u&&Gt.includes(t)?Dt(t,e,r,t,s,a):re(n,e,s,t,r):(n.attrName=t,n.element=r,n.howToSet=o,n.isSpecial=u,Zt(t,e,r,o,a,s,u))}(e,i,l,n,o,r,u,a),void(l.value=i))}return Zt(e,i,n,o,u,r,a)}function te(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];Kt(t,o,n,r,s,a,Yt(o),u,c)}}function ee(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 re(c,e,t,r,n);return ne(e,n,r,o,s,t,u)}(o,t,r,e,c,s,n,u):ne(t,r,e,c,s,o,u)}function ne(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 Qt(e,t,s,n);o(e,n,t)}else Dt(n,t,e,r,s,c)}function re(t,e,n,r,o){const s=t.value;return s&&s.tagFunction&&s.support?(s.tagFunction=e,s.support=n,s):Qt(o,e=zt(e,n),n,r)}function oe(t){return b(t)&&"tagJsVar"in t?t.tagJsVar:-1}function se(t){return null==t||!1===t}const ce="object"==typeof document&&document.createElement("div");function ae(t,e,n,r,o,s,c,a,u=[]){const i=[];for(const l of t){const t={};i.push(t);const p=l.v;if(!isNaN(p)){ue(e,o,c,n,u,r,s);continue}if("text"===l.nn){const n=t,r=n.tc=l.tc;ce.innerHTML=r;const s=n.domElement=document.createTextNode(ce.innerText);s.id=`tp_${o.length}_${e.length}`,c?Vt.push({element:s,relative:c}):Jt.push({element:s,relative:a});continue}const f=t.domElement=document.createElement(l.nn);l.at&&l.at.map((t=>{const s=t[0],c=t[1],a=t[2]||!1;Kt(e,s,f,n,Mt,o,a,r,c)})),c?Vt.push({element:f,relative:c}):Jt.push({element:f,relative:a}),l.ch&&(t.ch=ae(l.ch,e,n,r,o,s+1,f,a,u).dom)}return{subs:u,dom:i,context:o}}function ue(t,e,n,r,s,c,a){const u=t[e.length],i=document.createTextNode(o);i.id=`dvp_${e.length}_${t.length}`;const l=le(u,e,a>0);if(l.placeholder=i,n?Vt.push({relative:n,element:i}):Jt.push({element:i,relative:r.subject.placeholder}),d(u))return void s.push({insertBefore:i,appendTo:n,subject:u,support:r,counts:c,contextItem:l});r.subject.global.locked=!0,Ue(u,l,r,c,`rvp_${e.length}_${t.length}`,n);delete r.subject.global.locked,l.value=u}function ie(t,e,n,r){const o=t.subject.global;o.oldest=t,o.newest=t,++Nt.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;return Dn(n.strings,n.values)}(t),s=t.templater.tag,c=s.values,u=[],i=t.subject.global;i.context=u;const l=ae(o,c,t,e,u,0,n,r);return l}(t,e,n,r);return o.htmlDomMeta=s.dom,--Nt.locks,s}function le(t,e,n){const r={value:t,checkValueChange:Ie,withinOwnerElement:n};return e.push(r),r}function pe(t,e,n){const r=e.global.newest;r.ownerSupport=t,e.checkValueChange=_e;const o=ie(r,n,void 0,e.placeholder);for(const t of o.subs)ze(t);return r}function fe(){return{tagJsType:a.templater}}function de(t,e,n){const r=dt(t,e,e.appSupport,n);return n.global.context=[],r}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)}))}te(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;ee(e,n.attrName,n,o,r,n.howToSet,n.isSpecial,ge),n.value=e}function be(t,e,n,r){const o=t[e],s=n[e];if(!d(o)){if(s.isAttr){if(o===s.value)return;he(t,o,s,r),s.value=o}ye(s,o,r),s.value=o}}function me(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),++Nt.locks,function(t,e){const n=t.templater.tag.values;let r=0;const o=n.length;for(;r<o;)be(n,r,e,t),++r}(t,n),--Nt.locks,Rt()}const ve={added:0,removed:0};function ye(t,e,r){if(e===t.value)return;const o=t.checkValueChange(e,t);if(-1===o)return;const s=e&&e.tagJsType;if(s){if(s===a.renderOnce)return;if(f(e))return t.global||n(t),void function(t,e,r){const o=e.global;if(!o.newest)return void Ge(t,e,r,{added:0,removed:0});const s=gt(t,r,r.appSupport,e);!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||We(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;Ee(s),n(t);const c=Ge(e,t,r,{added:0,removed:0})}(r,f,t);const d=p||Ct(s,f);if(!d){return void function(t,e,n,r,o){const s=t.props,c=Ze(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===vt.DEEP?Tt:kt)}if(o.locked)return void o.blocked.push(e);nn(e)}(r,s,e)}(e,t,r)}const u=t.global;if(u){const n=u.newest;if(n)return void function(t,e,n,r){if(typeof n===c.function)return;!function(t,e,n,r){const o=n.templater||n,s=gt(o,r,r.appSupport,e),c=t.subject.global;me(c.oldest,s)}(t,e,n,r)}(n,t,e,r)}if(s)switch(s){case a.templater:return void pe(r,t,ve);case a.tag:case a.dom:{const o=e;let s=o.templater;s||(s=fe(),o.templater=s,s.tag=o);return(t.global?t.global:n(t)).newest=de(s,r,t),void pe(r,t,ve)}}m(e)?xe(t,e,r,{added:0,removed:0}):typeof e!==c.function?o&&function(t,e){e.checkValueChange=Ie;const n=e.placeholder,r=_t(t);e.simpleValueElm=It(r,n)}(e,t):t.value=e}function we(t,e,r){r.checkValueChange=_e;const o=t;let s=o.templater;s||(s=nt(vt.DEEP),s.tag=o,o.templater=s);const c=r.global=n(r),a=c.newest=gt(s,e,e.appSupport,r);return c.oldest=a,r}function Ce(t){const e=t.subject.global,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 je(t){for(const e of t){const t=e.lastArray;if(t){je(t);continue}const n=e.global;if(!n)continue;const r=n.newest,o=n.subscriptions;o&&o.forEach((t=>t.unsubscribe())),f(r.templater)&&Ce(r);je(n.context)}}function Se(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&&Se(s,e,n)}return{tags:e,subs:n}}function ke(t,e){const n=t.subject.global,r=n.htmlDomMeta,o=n.context;n.deleted=!0;const s=n.destroys;if(s)return function(t,e,n,r){const o=[];if(t.forEach((t=>{const e=t();e instanceof Promise&&o.push(e)})),o.length){const t=Promise.all(o).then((()=>{Te(e,n),Ae(r),Rt()}));return void n.push(t)}Te(e,n),Ae(r),Rt()}(s,o,e,r);Te(o,e),Ae(r)}function Te(t,e){for(const n of t){if(n.withinOwnerElement)continue;const t=n.lastArray;if(t){Re(n,t);continue}const r=n.simpleValueElm;if(r){delete n.simpleValueElm,xt.push(r);continue}const o=n.global;if(void 0===o)continue;if(!0===o.deleted)continue;o.deleted=!0;const s=o.oldest;s&&ke(s,e)}}function Ae(t){t.forEach((t=>{const e=t.marker;e&&xt.push(e);const n=t.domElement;n&&xt.push(n)}))}function Ee(t){const e=t.subject.global;e.deleted=!0,t.subject.renderCount=0;const n=[];return je(e.context),e.destroy$&&Ce(t),ke(t,n),n}function xe(t,e,n,r,o){t.lastArray||(t.lastArray=[]);const s=t.lastArray;let c=t.placeholder,a=0;const u=[];for(let t=0;t<s.length;++t){const n=s[t],o=Je(n,e,t,s,a,r);0!==o?(a+=o,2===o&&(t-=1)):u.push(n)}t.lastArray=u;const i=o,l=e.length;for(let t=0;t<l;++t){c=Oe(e,t,u,n,c,r,i).placeholder}}function Oe(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 ye(e,t,r),e;const i=Pe(t,s,r,c,n,a);return i}(a,u,n,r,e,o,s,c):Pe(a,o,r,s,n,c)}function Pe(t,e,n,r,o,s){const c={value:t,checkValueChange:Ie,withinOwnerElement:!1};r.added=r.added+1;const u=document.createTextNode("");return c.placeholder=u,s||Jt.push({element:u,relative:e}),function(t,e,n){const r=t.tagJsType;if(r)switch(r){case a.templater:we(t.tag,e,n);break;case a.tag:case a.dom:we(t,e,n)}}(t,n,c),Ue(t,c,n,r,`rvp_${o.length}_array`,s),c.value=t,o.push(c),s&&Vt.push({element:u,relative:s}),c}function Ve(t,e){const n=t.global;if(n){const t=n.oldest;n.deleted=!0,Ee(t),n.deleted=!0}else{const e=t.simpleValueElm;delete t.simpleValueElm,xt.push(e)}++e.removed}function Je(t,e,n,r,o,s){const c=e.length-1,a=n-o,u=a<0||c<a,i=r[n];return u?(Ve(i,s),++o,1):r[n].value.arrayValue!==e[n].arrayValue?(Ve(i,s),r.splice(n,1),++o,2):0}function We(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 Ne(t,e){if(!m(t)){return Re(e,e.lastArray),9}return!1}function Re(t,e){const n={added:0,removed:0};for(let t=0;t<e.length;++t)Ve(e[t],n);delete t.lastArray}function Ie(t,e){if(null==t||typeof t!==c.object)return function(t,e){const n=_t(t),r=e.simpleValueElm;Pt.push([n,r])}(t,e),-1;const n=e.simpleValueElm;return delete e.simpleValueElm,xt.push(n),6}function _e(t,e){const r=e.global,o=r?.newest;if(p(t)){return!We(t,o)&&(Ee(o),n(e),7)}const s=t?.tagJsType;return!s&&(Ee(o),delete e.global,e.renderCount=0,8)}function Me(t,e,n){const r=nt(vt.DEEP);r.tagJsType=t.tagJsType;const o=de(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 De(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 q(r,c);throw console.error(Le,c),a}(n,e,t)}M.tagClosed$=new C(void 0,(function(t){fn()||t.next()}));const Le="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 $e(t,e){const n=t.subject;++n.renderCount;const r=M.stateConfig;delete r.support,t.state=r.stateArray,M.tagClosed$.next(e),De(r,t),n.global.newest=t}function Be(t,e,n,r){const o=n.global,s=n.renderCount,c=e?.state,u=M.stateConfig;if(c){const n=e.states;u.prevSupport=e,W(t,M.stateConfig,c,n)}else J(t,u);const i=t.templater;let l;if(i.tagJsType===a.stateRender){l=ut(i,i,gt(i,r,t.appSupport,n)),l.states=t.states}else{l=(0,i.wrapper)(t,n,e),l.states=t.states}return $e(l,r),n.renderCount>s+1?o.newest:l}function He(t,e,n,r,o){n.checkValueChange=_e;const s=de(t,e,n);s.ownerSupport=e;const c=ie(s,o,r,void 0);for(const t of c.dom)t.marker&&Vt.push({element:t.marker,relative:r}),t.domElement&&Vt.push({element:t.domElement,relative:r});let a=-1;const u=c.subs.length-1;for(;a++<u;){ze(c.subs[a])}return s}function Ue(t,e,r,o,s,c){const u=t?.tagJsType;if(u)switch(u){case a.templater:return e.checkValueChange=_e,c?He(t,r,e,c,o):pe(r,e,o);case a.dom:case a.tag:{e.checkValueChange=_e;const s=t;let a=s.templater;a||(a=function(t){const e=fe();return e.tag=t,t.templater=e,e}(s));const u=n(e);return c?He(a,r,e,c,o):(u.newest=de(a,r,e),e.checkValueChange=_e,pe(r,e,o))}case a.stateRender:case a.tagComponent:if(n(e),e.checkValueChange=_e,c){const n=function(t,e,n,r,o){const s=gt(t,n,n.appSupport,e),c=s.propsConfig;if(c){const e=t.tagJsType!==a.tagComponent?[]:ht(t,s);c.castProps=e}const u=e.global,{support:i}=Ye(s,u.newest,e,n);return function(t,e,n){let r=Vt.length;const o=ie(t,e,n,void 0);for(const t of o.dom)t.domElement&&Vt.splice(r++,0,{element:t.domElement,relative:n}),t.marker&&Vt.splice(r++,0,{element:t.marker,relative:n});const s=o.subs;for(const t of s)ze(t)}(i,r,o),i}(t,e,r,o,c);return n}return Ge(t,e,r,o);case a.renderOnce:{n(e);const s=Me(t,e,r);Be(s,void 0,e,r);const a=He(s.templater,r,e,c,o);return e.checkValueChange=_e,a}}if(m(t))return xe(e,t,r,o,c),void(e.checkValueChange=Ne);d(t)||function(t,e,n,r){const o=_t(t),s=It(o,n);s.id=r,e.simpleValueElm=s,e.checkValueChange=Ie}(t,e,e.placeholder,s)}function Fe(t,e,n){t!==e.value&&(ye(e,t,n),M.stateConfig.support||Rt())}function ze({subject:t,support:e,counts:n,contextItem:r,appendTo:o}){let s=function(t){Ue(t,r,e,{...n},`rvp_-1_${e.templater.tag?.values.length}`,c?o:void 0),c||M.stateConfig.support||Rt(),s=function(t){Fe(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 Ge(t,e,n,r){const o=gt(t,n,n.appSupport,e),s=o.propsConfig;if(s){const e=t.tagJsType!==a.tagComponent?[]:ht(t,o);s.castProps=e}const c=e.global,{support:u}=Ye(o,c.newest,e,n);return function(t,e,n){n.checkValueChange=_e;const r=ie(t,e,void 0,n.placeholder).subs;for(const t of r)ze(t)}(u,r,e),u}function Ze(t,e,n,r,o,s=-1){const c=e.subject.global.newest;if(!c){const e=ot(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=Xe(a[e],c,t,n,s+1,o);u.push(i)}return t.propsConfig.castProps=u,u}function Xe(t,e,n,r,o,s){return typeof t===c.function?e.mem?(t.mem=e.mem,e):(t.mem=e,t):s===o||at(e)?e:m(e)?function(t,e,n,r,o){for(let s=t.length-1;s>=0;--s){const c=t[s];t[s]=Xe(e[s],c,n,r,o+1,s)}return t}(e,t,n,r,s):void 0===t?e:function(t,e,n,r,o,s){const c=Object.keys(t);for(const a of c){const c=t[a],u=Xe(e[a],c,n,r,s,o+1);if(t[a]===u)continue;const i=Object.getOwnPropertyDescriptor(t,a)?.set;i||(t[a]=u)}return t}(e,t,n,r,s,o)}function qe(t){const e=t.subject.global,{subs:r,tags:o}=Se(e.context);Qe(t);for(const t of o)Qe(t);e.subscriptions&&r.forEach((t=>t.unsubscribe())),n(t.subject)}function Qe(t){const e=t.subject,n=e.global;!0!==n.deleted&&(n.deleted=!0,e.renderCount=0,ke(t,[]))}function Ye(t,e,n,r){const o=e?.templater,s=o?.tag,c=Be(t,e,n,r),u=!e||We(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&&qe(e))}if(n){const r=n.strings;if(r){const n=r?.length;n!==t.strings.length&&qe(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),qe(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 Ke={added:0,removed:0};function tn(t,e,n,r){const o=r.global,{support:s,wasLikeTags:c}=Ye(e,t,r,n);return c?(me(o.oldest,s),s):(pe(n,r,Ke),s)}function en(t){return a.templater===t.tagJsType}function nn(t){const e=t.subject.global,n=en(t.templater),r=t.ownerSupport;if(e.locked)return e.blocked.push(t),t;if(n)return rn(r,t);e.locked=!0;const o=t.subject;e.blocked.length&&(t=e.blocked.pop(),e.blocked=[]),delete e.locked;return tn(e.newest,t,r,o)}function rn(t,e){const n=t.subject.global;if(!n||!0===n.deleted)return e;return nn(n.newest||t)}function on(t,e){return t.length!==e.length}function sn(t){const e=fn();if(!e)throw un;return cn(e,M.stateConfig,t)}function cn(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,s=(t=o.newest).state;D(s,n.stateArray,t.states,n.states);const c=e(...r);return D(n.stateArray,s,n.states,t.states),nn(t),g(c)&&c.finally((()=>{D(n.stateArray,s,n.states,t.states),nn(t)})),c}(t,n,{stateArray:r,states:o},...e):n(...e)}}const an=()=>{const t=fn();if(!t)throw un;const e=M.stateConfig;return function(n){return cn(t,e,n)}},un=new Q("callback() was called outside of synchronous rendering. Use `callback = callbackMaker()` to create a callback that could be called out of sync with rendering");function ln(t){O(t)}function pn(t){O((function(){fn().subject.global.destroy$.toCallback(t)}))}function fn(){return M.stateConfig.support}const dn=":tagvar",gn=":";function hn(t,e){const n={values:e,ownerSupport:fn(),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 bn(t,e){const n={values:e,ownerSupport:fn(),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 mn="ondoubleclick",vn=/(:tagvar\d+:)/,yn=/(^:tagvar\d+:|:tagvar\d+:$)/g,wn="__safeTagVar",Cn=/([:_a-zA-Z0-9\-.]+)\s*(?:=\s*"([^"]*)"|=\s*(\S+))?/g,jn=/<\/?([a-zA-Z0-9-]+)((?:\s+[a-zA-Z_:][\w:.-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)+\s*|\s*)\/?>/g;function Sn(t,e){kn(t,e);const n=function(t){const e=[],n=[],r=[];let o=null,s=-1,c=0;const a=new RegExp(jn,"g");t=function(t){return t.replace(En,(function(t){return t.replace(/\[l t\]/g,"[l&nbsp;t]").replace(/\[g t\]/g,"[g&nbsp;t]").replace(/</g,"[l t]").replace(/>/g,"[g t]")}))}(t);for(;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()){Tn(e).forEach((t=>{t.startsWith(dn)&&(t=dn+ ++s+gn),An(o,n,t)}))}}if(c=u.index+i.length,f){o=r.pop()||null;continue}const g=[];let h;for(;null!==(h=Cn.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")?On(c):c;if(o){if(t.slice(0,dn.length)===dn){const t=dn+ ++s+gn;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=dn+ ++s+gn}r||(n=h[2]);const u=[a,n],i=Yt(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()){Tn(e).forEach((t=>(t.startsWith(dn)&&++s,An(o,n,t))))}}return n}(kn(t,e).join(""));return n}function kn(t,e){return function(t,e){const n=t.map(((t,n)=>n<e.length?t+dn+n+gn:t));return function(t,e,n){const r=n.length-e.length;if(r>0)for(let n=r;n>0;--n)t.push(dn+(e.length+n-1)+gn)}(n,t,e),n}(t.map((t=>t.replace(yn,((t,e)=>wn+e)))),e)}function Tn(t){return t.split(vn).filter((t=>""!==t))}function An(t,e,n){!function(t,e,n){t?(t.ch||(t.ch=[]),t.ch.push(n)):e.push(n)}(t,e,{nn:"text",tc:xn(n)})}const En=new RegExp("(\x3c!--[\\s\\S]*?--\x3e)","g");function xn(t){return t.replace(/(\[l t\]!--[\s\S]*?--\[g t\])/g,(function(t){return t.replace(/\[l t\]/g,"<").replace(/\[g t\]/g,">").replace(/\[l&nbsp;t\]/g,"[l t]").replace(/\[g&nbsp;t\]/g,"[g t]")}))}function On(t){if(t.startsWith("on")){return t.length===mn.length&&t===mn?"dblclick":t.slice(2,t.length)}return t}const Pn=new RegExp(dn+"(\\d+)"+gn,"g"),Vn="ch";function Jn(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=Nn(t,e)}if(c.ch){const t=c.ch,r=[...s,Vn];c.ch=Jn(t,e,n,r)}t=Wn(c,e,o,t)}return o}function Wn(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=Pn.exec(a));){const t=c[1],o=parseInt(t,10);if(!isNaN(o)&&o<e){const t=dn+o+gn,e=a.slice(c.index+t.length);n.splice(r,1,{nn:"text",v:o}),a=e,Pn.lastIndex=0}}return o.tc=a,r}function Nn(t,e){return t.map((t=>{const[n,r,o]=t;if(n.startsWith(dn)){const t=parseInt(n.replace(dn,""),10);if(!isNaN(t)&&t<e)return[{tagJsVar:t}]}if(typeof r===s.string&&r.startsWith(dn)){const t=parseInt(r.replace(dn,""),10);if(!isNaN(t)&&t<e)return[n,{tagJsVar:t},o]}return t}))}const Rn="__safeTagVar";const In=/__safeTagVar(\d+)/g;function _n(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(Rn)){const n=parseInt(e.replace(Rn,""),10);t[1]=dn+n+gn}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(In,((t,e)=>dn+e+gn))}_n(n)}0===e.length&&delete t.ch}}const Mn={};function Dn(t,e){const n=function(t){const e=t.map((t=>t.length));return e.push(t.length),Number(e.join(""))}(t),r=Mn[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=Jn(Sn(t,e),e.length);s.forEach(_n);const c={interpolation:void 0,string:void 0,strings:t,values:e,domMetaMap:s};return Mn[n]=c,s}function Ln(t,...e){const n=hn(t,e),r=nt(vt.NONE);return r.tag=n,n.templater=r,n}Ln.dom=function(t,...e){return bn(t,e)};const $n=[];function Bn(t,e,r){const o=$n.findIndex((t=>t.element===e));o>=0&&(Ee($n[o].support),$n.splice(o,1),console.warn("Found and destroyed app element already rendered to element",{element:e}));let s=()=>l(r);s.propWatch=vt.NONE,s.tagJsType=a.stateRender,s.props=[r],s.isApp=!0;const u=function(t,e){const r={value:t,checkValueChange:_e,withinOwnerElement:!1,renderCount:0,global:void 0},o=n(r);return o.events={},Hn(t,r,e),r}(s,e),i=u.global;J(i.newest,M.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("");rt.push(s.wrapper||{original:s});const g=Un(s,d,e,u,p);i.isApp=!0,p&&(l.tag=g.templater.tag),e.destroy=function(){const t=i.events;for(const n in t){const r=t[n];e.removeEventListener(n,r)}i.events={};const n=Ee(g);return Rt(),n},++Nt.locks;const h=ie(g,{added:0,removed:0},e,void 0);i.oldest=g,i.newest=g;let b=s.setUse;if(s.tagJsType!==a.stateRender){const e=t.original;b=e.setUse,e.isApp=!0}e.setUse=b,e.ValueTypes=a,$n.push({element:e,support:g});const m=document.createDocumentFragment();m.appendChild(d);for(const t of h.dom)Fn(t,m);for(const t of h.subs)ze(t);return--Nt.locks,Rt(),e.appendChild(m),{support:g,tags:rt,ValueTypes:a}}function Hn(t,e,n){const r=e.global,o=pt(t,e);return ft(t,o,o),o.appElement=n,r.oldest=r.oldest||o,r.newest=o,o}function Un(t,e,n,r,o){r.placeholder=e;const s=r.global,c=s.newest,u=s.oldest;if(c===u||W(c,M.stateConfig,u.state,u.states),t.tagJsType===a.stateRender){const e=t.wrapper||{original:t};if(!o){const e=Hn(t,r,n);return $e(e),e}const s=ut(t,e,c);return $e(s),s}const i=(0,t.wrapper)(c,r);return $e(i),i}function Fn(t,e){t.domElement&&e.appendChild(t.domElement),t.marker&&e.appendChild(t.marker)}const zn={tagElement:Bn,renderWithSupport:Ye,renderSupport:nn,renderTagOnly:Be,paint:Rt};var Gn=e.W9,Zn=e.cg,Xn=e.m0,qn=e.rS,Qn=e.Y2,Yn=e.ei,Kn=e.B7,tr=e.TU,er=e.XF,nr=e.PC,rr=e.Ot,or=e.Mj,sr=e.tD,cr=e.j8,ar=e.um,ur=e.E2,ir=e.OH,lr=e.TB,pr=e.Ii,fr=e.yV,dr=e.zV,gr=e.ze,hr=e.WJ,br=e.aZ,mr=e.O,vr=e.Ie,yr=e.B4,wr=e.Az,Cr=e.Xi,jr=e.pc,Sr=e.Ah,kr=e.ck,Tr=e.k6,Ar=e.Gk,Er=e.cF,xr=e.PB,Or=e.qy,Pr=e.cy,Vr=e.Tn,Jr=e.Gv,Wr=e.yL,Nr=e.D8,Rr=e.Ze,Ir=e._4,_r=e.mn,Mr=e.Eb,Dr=e.z,Lr=e.sA,$r=e.MG,Br=e.PL,Hr=e.nI,Ur=e.PZ,Fr=e.N_,zr=e.r5,Gr=e.uc,Zr=e.pG,Xr=e.QB,qr=e.R6,Qr=e.Ll,Yr=e.vP,Kr=e.wk,to=e.xP,eo=e.bc,no=e.ag,ro=e.Tc,oo=e.Hf,so=e._A,co=e.Ag,ao=e.NU,uo=e.hW,io=e.wB,lo=e.id,po=e.MC,fo=e.zC;export{Gn as ArrayNoKeyError,Zn as BasicTypes,Xn as ImmutableTypes,qn as PropWatches,Qn as RouteQuery,Yn as StateMismatchError,Kn as Subject,tr as Subjective,er as SyncCallbackError,nr as TagError,rr as ValueSubject,or as ValueSubjective,sr as ValueTypes,cr as addOneContext,ar as buildBeforeElement,ur as callback,ir as callbackMaker,lr as checkArrayValueChange,pr as checkSimpleValueChange,fr as checkTagValueChange,dr as combineLatest,gr as createTrigger,hr as defineValueOn,br as destroyArray,mr as destroySupport,vr as empty,yr as getBaseSupport,wr as getDomMeta,Cr as getDomTag,jr as getHtmlSupport,Sr as getNewGlobal,kr as getStringTag,Tr as getSupport,Ar as getTemplaterResult,Er as hmr,xr as howToSetInputValue,Or as html,Pr as isArray,Vr as isFunction,Jr as isObject,Wr as isPromise,Nr as isSimpleType,Rr as isStaticTag,Ir as isSubjectInstance,_r as isTagComponent,Mr as key,Dr as letProp,Lr as onDestroy,$r as onInit,Br as oneRenderToSupport,Hr as paint,Ur as processFirstSubjectValue,Fr as processSubUpdate,zr as providers,Gr as renderSupport,Zr as renderTagOnly,Xr as renderWithSupport,qr as runWrapper,Qr as setUseMemory,Yr as signal,Kr as state,to as states,eo as subject,no as syncError,ro as tag,oo as tagElement,so as tags,co as upgradeBaseToSupport,ao as variablePrefix,uo as variableSuffix,io as watch,lo as willCallback,po as willPromise,fo as willSubscribe};
2
2
  //# sourceMappingURL=bundle.js.map