@base-framework/base 3.9.9 → 3.9.10

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 (106) hide show
  1. package/dist/base.js +1 -1
  2. package/dist/chunks/{chunk-VH3TSUK5.js → chunk-6VPBF5VF.js} +2 -2
  3. package/dist/chunks/{chunk-G5VVBURO.js → chunk-AO5L25YQ.js} +2 -2
  4. package/dist/chunks/chunk-CNIJE66G.js +2 -0
  5. package/dist/chunks/chunk-DWOYCZYJ.js +2 -0
  6. package/dist/chunks/chunk-FXJIFTW5.js +2 -0
  7. package/dist/chunks/chunk-GNJZ6CEA.js +2 -0
  8. package/dist/chunks/chunk-KNBYBDOP.js +2 -0
  9. package/dist/chunks/chunk-KRDITJSA.js +2 -0
  10. package/dist/chunks/chunk-MNKLSGJQ.js +2 -0
  11. package/dist/chunks/chunk-QXTQMPCM.js +2 -0
  12. package/dist/chunks/chunk-T3WI7GCT.js +2 -0
  13. package/dist/chunks/chunk-TDLN57VY.js +2 -0
  14. package/dist/chunks/chunk-TFVBKZUB.js +2 -0
  15. package/dist/chunks/chunk-VRFEYZE5.js +2 -0
  16. package/dist/chunks/chunk-W37VRHGC.js +2 -0
  17. package/dist/meta.json +1 -0
  18. package/dist/modules/component.js +1 -1
  19. package/dist/modules/data.js +1 -1
  20. package/dist/modules/router.js +1 -1
  21. package/dist/modules/state.js +1 -1
  22. package/dist/types/modules/data/types/model/model-request.d.ts +2 -0
  23. package/dist/types/modules/layout/base-layout-methods.d.ts +1 -0
  24. package/dist/types/modules/layout/directives/core/core-directives.d.ts +7 -0
  25. package/dist/types/modules/layout/directives/core/reactive-directives.d.ts +6 -0
  26. package/dist/types/modules/layout/directives/core/router-directives.d.ts +11 -0
  27. package/dist/types/modules/layout/directives/directive-registry.d.ts +5 -0
  28. package/dist/types/modules/router/router-registry.d.ts +2 -0
  29. package/package.json +1 -1
  30. package/dist/chunks/chunk-34NO3R7F.js +0 -2
  31. package/dist/chunks/chunk-3QRSJNYG.js +0 -2
  32. package/dist/chunks/chunk-3X6POBEJ.js +0 -2
  33. package/dist/chunks/chunk-42TNSLMZ.js +0 -2
  34. package/dist/chunks/chunk-4PON5V2J.js +0 -2
  35. package/dist/chunks/chunk-4T7YWUSM.js +0 -2
  36. package/dist/chunks/chunk-53IY3DRV.js +0 -2
  37. package/dist/chunks/chunk-5EC6D6BF.js +0 -2
  38. package/dist/chunks/chunk-5J4KRUCV.js +0 -2
  39. package/dist/chunks/chunk-5RE4LAGC.js +0 -2
  40. package/dist/chunks/chunk-6WNRG62Q.js +0 -2
  41. package/dist/chunks/chunk-7PHW6IVG.js +0 -2
  42. package/dist/chunks/chunk-7RJQZEA3.js +0 -2
  43. package/dist/chunks/chunk-7ZSQCHMH.js +0 -2
  44. package/dist/chunks/chunk-C25U5UGH.js +0 -2
  45. package/dist/chunks/chunk-DS5IUTRI.js +0 -2
  46. package/dist/chunks/chunk-DSZVEGNA.js +0 -2
  47. package/dist/chunks/chunk-DYPO4XWL.js +0 -2
  48. package/dist/chunks/chunk-DZCEWMDW.js +0 -2
  49. package/dist/chunks/chunk-EJIWXHRN.js +0 -2
  50. package/dist/chunks/chunk-EZ5NGKIX.js +0 -2
  51. package/dist/chunks/chunk-FHDFGN7E.js +0 -2
  52. package/dist/chunks/chunk-FRCLWWKS.js +0 -2
  53. package/dist/chunks/chunk-G66XUIA2.js +0 -2
  54. package/dist/chunks/chunk-GBGA24AR.js +0 -2
  55. package/dist/chunks/chunk-GRNW37TV.js +0 -2
  56. package/dist/chunks/chunk-GRUPEAJC.js +0 -2
  57. package/dist/chunks/chunk-GV7CJS33.js +0 -2
  58. package/dist/chunks/chunk-HLGMGV22.js +0 -2
  59. package/dist/chunks/chunk-HT53RXU3.js +0 -2
  60. package/dist/chunks/chunk-IA7UI2XV.js +0 -2
  61. package/dist/chunks/chunk-IAPRMNTT.js +0 -2
  62. package/dist/chunks/chunk-IHAOOHJB.js +0 -2
  63. package/dist/chunks/chunk-IHTCTRTS.js +0 -2
  64. package/dist/chunks/chunk-IJTDFF7P.js +0 -2
  65. package/dist/chunks/chunk-J2CPWQ6H.js +0 -2
  66. package/dist/chunks/chunk-J4K3HIHH.js +0 -2
  67. package/dist/chunks/chunk-K7USFO4X.js +0 -2
  68. package/dist/chunks/chunk-KJTST4FO.js +0 -2
  69. package/dist/chunks/chunk-L4273GAO.js +0 -2
  70. package/dist/chunks/chunk-LX7KL4UO.js +0 -2
  71. package/dist/chunks/chunk-M6RVE2QG.js +0 -2
  72. package/dist/chunks/chunk-MBW4R52W.js +0 -2
  73. package/dist/chunks/chunk-MUCZUIHP.js +0 -2
  74. package/dist/chunks/chunk-MXSQXT7V.js +0 -2
  75. package/dist/chunks/chunk-N7GGZFCN.js +0 -2
  76. package/dist/chunks/chunk-NMWVJDVT.js +0 -2
  77. package/dist/chunks/chunk-NU5QKZAD.js +0 -2
  78. package/dist/chunks/chunk-O2LH36GF.js +0 -2
  79. package/dist/chunks/chunk-P6ZMMTA3.js +0 -2
  80. package/dist/chunks/chunk-PDIOOIMW.js +0 -2
  81. package/dist/chunks/chunk-PWZKB5MT.js +0 -2
  82. package/dist/chunks/chunk-QBEU5CYI.js +0 -2
  83. package/dist/chunks/chunk-QH2X3RWR.js +0 -2
  84. package/dist/chunks/chunk-QPFMAZXH.js +0 -2
  85. package/dist/chunks/chunk-QZANICYR.js +0 -2
  86. package/dist/chunks/chunk-RDE5VST7.js +0 -2
  87. package/dist/chunks/chunk-REMYPPWA.js +0 -2
  88. package/dist/chunks/chunk-RUWEOCXU.js +0 -2
  89. package/dist/chunks/chunk-SHTKCUQM.js +0 -2
  90. package/dist/chunks/chunk-SM7TAP7I.js +0 -2
  91. package/dist/chunks/chunk-SN4TNKC2.js +0 -2
  92. package/dist/chunks/chunk-UE5UCB2S.js +0 -2
  93. package/dist/chunks/chunk-UEAKRA7Z.js +0 -2
  94. package/dist/chunks/chunk-UL4LXNVS.js +0 -2
  95. package/dist/chunks/chunk-UOSGJOHK.js +0 -2
  96. package/dist/chunks/chunk-UQGSGBNZ.js +0 -2
  97. package/dist/chunks/chunk-W4RXLHJN.js +0 -2
  98. package/dist/chunks/chunk-WGCUX2GL.js +0 -2
  99. package/dist/chunks/chunk-WZCKX2VG.js +0 -2
  100. package/dist/chunks/chunk-XHKEEED5.js +0 -2
  101. package/dist/chunks/chunk-XM44ID52.js +0 -2
  102. package/dist/chunks/chunk-YM4XRLRU.js +0 -2
  103. package/dist/chunks/chunk-YOKXNCFA.js +0 -2
  104. package/dist/chunks/chunk-YRFEJDMK.js +0 -2
  105. package/dist/chunks/chunk-YUIJEWKU.js +0 -2
  106. package/dist/chunks/chunk-ZUZXAZXR.js +0 -2
@@ -1,2 +0,0 @@
1
- import{b as P}from"./chunk-3QRSJNYG.js";import{a as ft,b as pt,c as mt,d as C,e as x,f as b}from"./chunk-34NO3R7F.js";import{a as H,b as lt}from"./chunk-SN4TNKC2.js";import{a as ht,c as T,d as ut,e as dt,f as L}from"./chunk-QH2X3RWR.js";import{b as p,c as f}from"./chunk-QPFMAZXH.js";var M={items:new Map,add(s,t){return this.items.set(s,t),this},get(s){return this.items.get(s)??null}};p.addType("components",s=>{if(!s)return;let t=s.component;!t||!t.isUnit||(t.persistToken&&t.parent&&t.parent.removePersistedChild(t.persistToken),t.rendered===!0&&(t.prepareDestroy(),t.cleanUpAfterDestroy()))});var de=0,G=class{constructor(t,e,r){this.isUnit=!0,this.data=null,this.persist=null,this.nest=null,this.state=null,this.panel=null,this.parent=null,this.unitType=null,this.u,this.id="",this.cached=[],this.init();let n,i;if(t==null)n={},i=[];else{let o=typeof t;o==="string"||o==="number"?(n={},i=[{tag:"text",textContent:t}]):Array.isArray(t)?(n={},i=t):(n=t||{},i=typeof e=="string"?[{tag:"text",textContent:e}]:e)}this.setupProps(n),this.children=i||[],this.persistedChildren={},this.persistedCount=0,this.onCreated(),this.rendered=!1,this.container=null}init(){this.id="cp-"+de++,this.unitType=this.u||this.constructor.name.toLowerCase()}declareProps(){}addPersistedChild(t){let e=t.key,r=t.cache,n;r!=null&&e!=null?n="pk:"+r+":"+e:r!=null?n="pk:"+r:e!=null?n="pk:"+e:n="pc"+this.persistedCount++;let i=this.persistedChildren[n];return i&&t.unitType===i.unitType&&t.resumeScope(i),t.persistToken=n,this.persistedChildren[n]=t,n}removePersistedChild(t){this.rendered&&(!t||!this.persistedChildren[t]||delete this.persistedChildren[t])}setupProps(t){if(this.declareProps(),!(!t||typeof t!="object"))for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this[e]=t[e],e==="data"&&(this.n=!0))}getChildScope(){return this}getParentContext(){return this.parent?this.parent.getContext():null}setupContext(){if(this.U)return;let t=this.getParentContext(),e=this.setContext(t);if(e){this.context=e;return}this.context=t,this.setupAddingContext()}setupAddingContext(){let t=this.context,e=this.addContext(t);if(!e)return;let r=e[0];r&&(this.addingContext=!0,this.contextBranchName=r,this.addContextBranch(r,e[1]))}addContextBranch(t,e){this.context??={},this.context[t]=e}setContext(t){return null}addContext(t){return null}removeContext(){this.addingContext&&this.removeContextBranch(this.contextBranchName)}removeContextBranch(t){t&&delete this.context[t]}getContext(){return this.context}onCreated(){}render(){return{}}F(t){return t&&(t.id||(t.id=this.getId()),t.cache="panel",t)}W(){return this.render()}prepareLayout(){let t=this.W();return this.F(t)}afterBuild(){p.add(this.panel,"components",{component:this}),this.rendered=!0,this.afterLayout()}afterLayout(){this.afterSetup()}if(t,e){return t?e||t:null}map(t,e){let r=[];if(!t||t.length<1)return r;for(let n=0,i=t.length;n<i;n++){let o=e(t[n],n);r.push(o)}return r}removeAll(t){return L.removeAll(t)}getId(t){let e=this.id;return typeof t=="string"&&(e+="-"+t),e}cacheEle(t,e){e&&(this[e]=t,this.cached.push(e))}initialize(){this.setupContext(),this.beforeSetup()}beforeSetup(){}afterSetup(){}setup(t){this.setContainer(t),this.initialize()}setContainer(t){this.container=t}q(){this.prepareDestroy(),this.removeContext();let t=this.panel;t&&L.removeElement(t),this.cleanUpAfterDestroy()}cleanUpAfterDestroy(){this.panel=null,this.container=null;let t=this.cached;for(let e=0,r=t.length;e<r;e++)this[t[e]]=null;this.cached=[],this.persist!==!0&&(this.persistedChildren={},this.persistToken=null)}prepareDestroy(){this.persistedCount=0,this.rendered=!1,this.beforeDestroy(),this.data&&typeof this.data.unlink=="function"&&this.data.unlink()}beforeDestroy(){}destroy(){this.q()}};var I=class{static resume(t,e){if(t.n){this.B(t,e);return}this.H(t,e)}static refresh(t){let e=t.setData();e&&t.data&&t.data.set(e.stage),this.refreshContext(t)}static refreshContext(t){let e=t.context;if(!e||!e.data)return;let r=t.getParentContext();if(!r||!r.data)return;let n=r.data.stage,i=e.data.stage,o=null;for(let a in n){if(!Object.prototype.hasOwnProperty.call(n,a))continue;let c=n[a];c!==i[a]&&(o===null&&(o={}),o[a]=c)}o!==null&&(typeof e.data.s=="function"?e.data.s(o):e.data.set(o))}static B(t,e){let r=t.setData();if(!r){t.data=e;return}if(e&&e.stage){let n=e.e||r.e,i=!n&&(e.t||r.t),o=this.L(e.stage,r.stage,n,i);H.isEmpty(o)||r.s(o)}typeof r.flushPending=="function"&&r.flushPending(),t.data=r}static L(t,e,r,n){let i={};for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o))continue;if(n){Object.prototype.hasOwnProperty.call(e,o)||(i[o]=t[o]);continue}let a=t[o];!r&&a==null||a!==e[o]&&(i[o]=a)}return i}static H(t,e){if(!t.data){t.data=e;return}if(e&&e.e){t.data=e;return}if(e&&e.stage){let r=e.t||t.data.t,n=this.N(e.stage,t.data.stage,r);H.isEmpty(n)||t.data.s(n)}t.data&&typeof t.data.flushPending=="function"&&t.data.flushPending()}static N(t,e,r){let n={};for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;if(r){Object.prototype.hasOwnProperty.call(e,i)||(n[i]=t[i]);continue}let o=t[i];o!=null&&o!==e[i]&&(n[i]=o)}return n}};var F=class{constructor(){this.events=[]}addEvents(t){let e=t.length;if(!(e<1))for(let r=0;r<e;r++){let n=t[r];this.on(n[0],n[1],n[2],n[3])}}on(t,e,r,n){f.on(t,e,r,n),this.events.push({event:t,obj:e,callBack:r,capture:n})}off(t,e,r,n){f.off(t,e,r,n);let i,o=this.events;for(let a=0,c=o.length;a<c;a++)if(i=o[a],i.event===t&&i.obj===e){o.splice(a,1);break}}set(){let t=this.events;for(let e=0,r=t.length;e<r;e++){let n=t[e];f.on(n.event,n.obj,n.callBack,n.capture)}}unset(){let t=this.events;for(let e=0,r=t.length;e<r;e++){let n=t[e];f.off(n.event,n.obj,n.callBack,n.capture)}}reset(){this.unset(),this.events=[]}};var N=class{constructor(t,e){this.remoteStates=[];let r=this.convertStates(e);this.addStatesToTarget(t,r)}addStates(t,e){let r=this.convertStates(e);this.addStatesToTarget(t,r)}createState(t,e,r,n){return{action:t,state:e,callBack:r,targetId:n,token:null}}convertStates(t){let e=[];for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;if(r==="remotes"){this.setupRemoteStates(t[r],e);continue}let n=null,i=null,o=t[r];o&&typeof o=="object"&&(i=o.callBack,n=o.id||o.targetId,o=o.state),e.push(this.createState(r,o,i,n))}return e}setupRemoteStates(t,e){for(let r=0,n=t.length;r<n;r++){let i=t[r];if(i)for(let o in i){if(!Object.prototype.hasOwnProperty.call(i,o)||o==="id")continue;let a=null,c=i[o],l=c!==null?c:void 0;l&&typeof l=="object"&&(a=l.callBack,l=l.state),e.push(this.createState(o,l,a,i.id))}}}removeRemoteStates(t){let e=this.remoteStates;e&&this.removeActions(t,e)}removeActions(t,e){if(!(e.length<1))for(let r=0,n=e.length;r<n;r++){let i=e[r];i.token&&this.unbindRemoteState(t,i.token),i.targetId&&P.remove(i.targetId,i.action,i.token)}}restore(t){P.restore(t.id,t);let e=this.remoteStates;if(e)for(let r=0,n=e.length;r<n;r++){let i=e[r];i.token=this.bindRemoteState(t,i.action,i.targetId)}}bindRemoteState(t,e,r){let n=P.getTarget(r);return t.link(n,e)}unbindRemoteState(t,e){t.unlink(e)}addStatesToTarget(t,e){let r=this.remoteStates;for(let n=0,i=e.length;n<i;n++){let o=e[n],a=this.addAction(t,o);o.targetId&&(o.token=a,r.push(o))}}addAction(t,e){let r,n=e.action,i=e.targetId;i&&(r=this.bindRemoteState(t,n,i)),typeof e.state<"u"&&t.addAction(n,e.state);let o=e.callBack;return typeof o=="function"&&t.on(n,o),r||null}};var g=class extends G{constructor(t,e,r){super(t,e,r),this.isComponent=!0,this.stateResumed=!1,this.stateTargetId=null,this.n=this.n??!1,this.V()}setData(){return null}V(){if(this.data)return;let t=this.setData();t&&(this.data=t)}resumeScope(t){if(this._(t.data),this.state=t.state,this.stateHelper=t.stateHelper,this.persistedChildren=t.persistedChildren,t.context){let e=t.context.data;e&&e.t===!0&&e.e!==!0||(this.context=t.context,this.U=!0)}this.id=t.id,this.G()}_(t){I.resume(this,t)}Y(){I.refresh(this)}G(){I.refreshContext(this)}initialize(){this.setupContext(),this.addStates(),this.beforeSetup()}afterLayout(){this.addEvents(),this.afterSetup()}setupStateTarget(t){let e=t||this.stateTargetId||this.id;this.state=P.getTarget(String(e))}setupStates(){return{}}addStates(){let t=this.state;if(t){this.stateResumed=!0,this.stateHelper.restore(t);return}let e=this.setupStates();H.isEmpty(e)||this.setStateHelper(e)}setStateHelper(t={}){this.state||(this.setupStateTarget(),this.stateHelper=new N(this.state??{},t))}addState(t){!this.stateHelper||this.stateResumed==!0||this.stateHelper.addStates(this.state,t)}removeStates(){let t=this.state;t&&(this.stateHelper.removeRemoteStates(t),t.remove(),this.stateResumed=!1)}onFlush(t){let e=this.data??this?.context?.data??null;e&&e.onFlush(t)}setEventHelper(){this.events||(this.events=new F)}setupEvents(){return[]}addEvents(){let t=this.setupEvents();t.length<1||(this.setEventHelper(),this.events&&this.events.addEvents(t))}removeEvents(){let t=this.events;t&&t.reset()}prepareDestroy(){this.persistedCount=0,this.rendered=!1,this.beforeDestroy(),this.removeEvents(),this.removeStates(),this.removeContext(),this.data&&this.persist!==!0&&this.data.unlink()}};var gt={created:"onCreated",setStates:"setupStates",state:"setupStates",events:"setupEvents",before:"beforeSetup",render:"render",after:"afterSetup",destroy:"beforeDestroy"};var fe=(s,t)=>typeof s!="function"&&t==="setupStates"?()=>s:s,et=(s,t)=>{if(!s)return t;let e=Object.keys(s);for(let r=0,n=e.length;r<n;r++){let i=e[r],o=s[i],a=gt[i]||i;t[a]=fe(o,a)}return t},pe=s=>et(s,{}),me=0,yt=(s,t)=>{class e extends s{}return Object.assign(e.prototype,t),e.prototype.u="jot"+me++,e},R=(s,t=g)=>{s||(s={});let e,r=typeof s;return r==="object"&&s.render?(e=pe(s),yt(t,e)):(e={render:r==="function"?s:()=>s},yt(t,e))};var rt=(s,t)=>({attr:s,directive:t});var S=(s,t)=>({key:s,value:t});var xt=(s,t,e,r)=>({tag:s,attr:t,directives:e,children:r});var St=null,ge=()=>St||(St=M.get("watch")),w=class{static getTag(t){return t.tag||"div"}static setupChildren(t){t.nest&&(t.children=t.nest,delete t.nest)}static setElementContent(t,e,r,n){return t==="text"?(n.push({tag:"text",textContent:e}),!0):t==="html"||t==="innerHTML"?(r.push(S("innerHTML",e)),!0):!1}static setTextAsWatcher(t,e,r){t.push(rt(S(e,b.getWatcherSettings(r,ut(e))),ge()))}static setButtonType(t,e,r){if(t==="button"){let n=e.type||"button";r.push(S("type",n))}}static parse(t,e){let r=[],n=[],i=t.tag||"div";i==="button"&&r.push(S("type",t.type||"button"));let o=[],a,c;for(let l in t){if(!Object.prototype.hasOwnProperty.call(t,l)||l==="tag"||(a=t[l],a==null))continue;if(l==="children"||l==="nest"){if(Array.isArray(a))for(let d=0;d<a.length;d++)o.push(a[d]);else o.push(a);continue}if((c=M.get(l))!==null){n.push(rt(S(l,a),c));continue}let h=typeof a;if(h==="object"){if(b.isWatching(a)){this.setTextAsWatcher(n,l,a);continue}o.push(a);continue}if(h==="function"){let d=a,y=function(m){d.call(this,m,e)};y.originalCallback=d,r.push(S(l,y));continue}if(h==="string"&&a.includes("[[")){this.setTextAsWatcher(n,l,a);continue}if(l==="text"){o.push({tag:"text",textContent:a});continue}if(l==="html"||l==="innerHTML"){r.push(S("innerHTML",a));continue}r.push(S(l,a))}return xt(i,r,n,o)}};var A=class{build(t,e,r){}setupComponent(t,e,r){let n=r?.getChildScope();t.parent=n,n&&n.persist===!0&&t.persist!==!1&&(t.persist=!0,t.parent.addPersistedChild(t)),t.cache&&n&&(n[t.cache]=t),t.setup(e)}buildComponent(t){let e=t.prepareLayout(),r=this.build(e,t.container,t);return t.afterBuild(),t.component&&typeof t.onCreated=="function"&&t.onCreated(t),r}createComponent(t,e,r){return this.setupComponent(t,e,r),this.buildComponent(t),t}setDirectives(t,e,r){}removeNode(t){}removeAll(t){}};var _=class extends A{build(t,e,r){let n=x.createDocFragment();if(Array.isArray(t))for(let i=0,o=t.length;i<o;i++)this.buildElement(t[i],n,r);else this.buildElement(t,n,r);return e&&typeof e=="object"&&e.appendChild(n),n}buildElement(t,e,r){if(t){if(t.isUnit===!0){this.createComponent(t,e,r);return}this.createElement(t,e,r)}}createElement(t,e,r){let n=r?.getChildScope();if(t.data||t.state){this.createTempComponent(t,e,n);return}let i=w.parse(t,n),o=this.createNode(i,e,n);this.cache(o,t.cache,r);let a=i.children;for(let l=0,h=a.length;l<h;l++){let d=a[l];d!==null&&this.buildElement(d,o,r)}let c=i.directives;c.length&&this.setDirectives(o,c,n)}createTempComponent(t,e,r){let n={cache:t.cache,key:t.key,persist:t.persist,n:!0,setData:()=>t.data,...et(t.methods||{},{}),render(){return{...t,data:null,state:null,methods:null,key:null,persist:null}}};t.state&&(n.setupStateTarget=function(o){this.state=t.state});let i=new g(n);this.createComponent(i,e,r)}setDirectives(t,e,r){for(let n=0,i=e.length;n<i;n++)this.handleDirective(t,e[n],r)}handleDirective(t,e,r){e.directive(t,e.attr.value,r)}cache(t,e,r){r&&e&&r.cacheEle(t,e)}createNode(t,e,r){let n=t.tag;if(n==="text"){let i=t.attr[0],o=i?i.value:"";return x.createText(o,e)}else if(n==="comment"){let i=t.attr[0],o=i?i.value:"";return x.createComment(o,e)}return x.create(n,t.attr,e,r)}removeNode(t){x.removeElement(t)}removeAll(t){x.removeAll(t)}};var ye=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source"]),E=class{static create(t,e=[],r=""){let n="",i="";for(let o=0,a=e.length;o<a;o++){let c=e[o],l=c.key,h=c.value;if(l==="text"||l==="textContent"){n+=h;continue}if(l==="html"||l==="innerHTML"){n+=h;continue}if(typeof h=="function"){let d="on"+dt(l);i?i+=" "+d+'="'+h+'"':i=d+'="'+h+'"';continue}i?i+=" "+l+'="'+h+'"':i=l+'="'+h+'"'}return ye.has(t)?"<"+t+" "+i+" />":"<"+t+" "+i+">"+n+r+"</"+t+">"}static createText(t){return t}static createComment(t){return"<!-- "+t+" -->"}};var j=class extends A{build(t,e,r){if(Array.isArray(t)){let n="";for(let i=0,o=t.length;i<o;i++)n+=this.buildElement(t[i],r);return n}return this.buildElement(t,r)}createComponent(t,e,r){return this.setupComponent(t,e,r),this.buildComponent(t)}buildElement(t,e){return t?t.isUnit===!0?this.createComponent(t,{},e):this.createElement(t,e):""}createElement(t,e){let r=w.parse(t,e),n=r.children,i="";for(let o=0,a=n.length;o<a;o++){let c=n[o];c!==null&&(i+=this.buildElement(c,e))}return this.createNode(r,i)}createNode(t,e){let r=t.tag;if(r==="text"){let n=t.attr[0],i=n?n.value:"";return E.createText(i)}else if(r==="comment"){let n=t.attr[0],i=n?n.value:"";return E.createComment(i)}return E.create(r,t.attr,e)}removeAll(t){}};var Q=class{static browserIsSupported(){return typeof window<"u"&&typeof document=="object"}static setup(){return this.browserIsSupported()?new _:new j}};var k=Q.setup(),xe=s=>typeof s=="object"&&s.isUnit===!0,Se=s=>{let t=R(s);return t?new t:null},u=class{static render(t,e,r){return!t||(xe(t)||(t=Se(t)),!t)?null:k.createComponent(t,e,r)}static build(t,e,r){return k.build(t,e,r)}static rebuild(t,e,r){return k.removeAll(e),this.build(t,e,r)}static setDirectives(t,e,r){k.setDirectives(t,e,r)}static createNode(t,e,r){return k.createNode(t,e,r)}static removeNode(t){k.removeNode(t)}static removeAll(t){k.removeAll(t)}};lt.augment({buildLayout(s,t,e){u.build(s,t,e)}});var st=[],we=s=>st.indexOf(s)!==-1,ve=s=>({tag:"script",src:s.src,async:!1,load(t){st.push(s.src);let e=s.load;e&&e()}}),Ce=s=>({tag:"link",rel:"stylesheet",type:"text/css",href:s.src,load(t){st.push(s.src);let e=s.load;e&&e()}}),z=class{constructor(t){this.percent=0,this.loaded=0,this.total=0,this.callBack=t||null}add(t){this.total++;let e,r=this.update.bind(this);t.indexOf(".css")!==-1?e=Ce({load:r,src:t}):e=ve({load:r,src:t}),u.build(e,document.head)}addFiles(t){t&&t.forEach(e=>{we(e)||this.add(e)})}update(){if(this.updateProgress()<100)return;let e=this.callBack;e&&e()}updateProgress(){return++this.loaded,this.percent=Math.floor(this.loaded/this.total*100)}};var ke=s=>s?typeof s?.prototype?.constructor=="function":!1,B=class{static process(t,e){let r=t.default;return r?e.callback?e.callback(r):(ke(r)?r=new r:r=r(),r.isUnit===!0&&(r.route=e.route,e.persist&&(r.persist=!0)),r):null}static render(t,e,r){let n=u.build(t,null,r),i=n.firstChild||t?.panel;return e.after(n),i}};var J=class{static load(t,e,r){return t.then(n=>(e&&e(n),n)).catch(n=>{console.error("Error loading module:",n),r&&r(n)})}};var Te=s=>({tag:"comment",textContent:"import placeholder",onCreated:s.onCreated}),O=new Map,be=s=>{if(O.has(s)){let r=O.get(s);return r&&typeof r.then!="function"?Promise.resolve(r):r}let t=typeof s,e;if(t==="string")e=import(s);else if(t==="function")e=s();else return s;return e.then(r=>{O.set(s,r)}),O.set(s,e),e},Pe=s=>{if(!O.has(s))return null;let t=O.get(s);return t&&typeof t.then=="function"?null:t||null},wt=R({declareProps(){this.loaded=!1,this.generation=0},render(){return Te({onCreated:s=>{if(this.src){if(this.layout){this.layoutRoot=B.render(this.layout,this.panel,this.parent);return}if(this.depends){new z(()=>{this.loadAndRender(s)}).addFiles(this.depends);return}this.loadAndRender(s)}}})},loadAndRender(s){let t=this.generation,e=Pe(this.src);if(e){this.renderModule(s,e);return}J.load(be(this.src),r=>{t===this.generation&&this.renderModule(s,r)},r=>{t===this.generation&&(this.loaded=!1)})},renderModule(s,t){this.loaded=!0;let e=this.layout||B.process(t,{callback:this.callback,route:this.route,persist:this.persist});this.layout=e,this.layoutRoot=B.render(e,s,this.parent)},shouldUpdate(s){return this.updateLayout===!0?!0:this.updateLayout=s&&s.isUnit&&typeof s.update=="function"},updateModuleLayout(s){let t=this.layout;this.shouldUpdate(t)&&t&&t.update(s)},update(s){this.loaded===!0&&this.updateModuleLayout(s)},destroy(){this.generation++,this.layoutRoot&&(u.removeNode(this.layoutRoot),this.persist!==!0&&(this.layoutRoot=null,this.layout=null,this.loaded=!1,this.updateLayout=!1))}});var vt=s=>{let t=typeof s;return(t==="string"||t==="function"||s instanceof Promise)&&(s={src:s}),new wt(s)};var Ie=0,D=class{constructor(t){this.router=t,this.locationId="base-app-router-"+Ie++,this.callBack=this.check.bind(this)}setup(){return this.addEvent(),this}check(t){}getScrollPosition(){return{x:window.scrollX,y:window.scrollY}}scrollTo(t){window.scrollTo(t.x,t.y)}addEvent(){return this}};var kt=typeof navigator<"u"&&/iPad|iPhone|iPod/.test(navigator.userAgent||"")&&!window.MSStream,Ct=()=>{kt&&requestAnimationFrame(()=>requestAnimationFrame(()=>{let s=window.scrollX,t=window.scrollY;window.scrollTo(0,t+1),document.documentElement.offsetHeight,window.scrollTo(s,t)}))},Y=class extends D{addEvent(){return f.on("popstate",window,this.callBack),kt&&(this.pageShowCallBack=this.onPageShow.bind(this),f.on("pageshow",window,this.pageShowCallBack)),this}removeEvent(){return f.off("popstate",window,this.callBack),this.pageShowCallBack&&f.off("pageshow",window,this.pageShowCallBack),this}onPageShow(t){t.persisted&&Ct()}check(t){let e=t.state;if(!e||e.location!==this.locationId)return!1;t.preventDefault(),t.stopPropagation(),this.router.checkActiveRoutes(e.uri);let r=e.scrollPosition;r&&this.scrollTo(r),Ct()}createState(t,e={}){let r=this.getScrollPosition();return e=e===null?{}:e,{location:this.locationId,...e,scrollPosition:r,uri:t}}addState(t,e,r=!1){let n=window.history,i=n.state;if(i&&i.uri===t)return this;!r&&i&&i.location===this.locationId&&(i.scrollPosition=this.getScrollPosition(),n.replaceState(i,"",window.location.href));let o=this.createState(t,e);return r||(o.scrollPosition={x:0,y:0}),n[r===!1?"pushState":"replaceState"](o,null,t),this}};var K=class extends D{addEvent(){return f.on("hashchange",window,this.callBack),this}removeEvent(){return f.off("hashchange",window,this.callBack),this}check(t){this.router.checkActiveRoutes(t.newURL)}addState(t,e,r){return window.location.hash=t,this}};var V=class{static browserIsSupported(){return typeof window=="object"&&"history"in window&&"pushState"in window.history}static setup(t){return this.browserIsSupported()?new Y(t).setup():new K(t).setup()}};var nt=class extends g{getChildScope(){return this.parent}},Tt=s=>R(s,nt);var $=class{constructor(t,e){this.route=t,this.template=e.component,this.component=null,this.hasTemplate=!1,this.setup=!1,this.container=e.container,this.persist=e.persist,this.parent=e.parent}focus(t){this.setup===!1&&(this.route&&typeof this.route.flushPending=="function"&&this.route.flushPending(),this.create()),this.update(t)}setupTemplate(){let e=typeof this.template;e==="function"?this.initializeComponent():e==="object"&&this.initializeTemplateObject(),this.hasTemplate=!0}initializeComponent(){this.template=this.template(),this.initializeTemplateObject()}transferSettings(t){this.persist=this.persist&&t.persist!==!1,Object.assign(t,{route:this.route,persist:this.persist}),this.component=t}initializeTemplateObject(){let t=this.template;if(!t)return;t.isUnit||(this.template=new(Tt(t)));let e=this.template;this.transferSettings(e)}create(){if(this.setupTemplate(),!this.hasTemplate)return;this.setup=!0;let t=this.component;u.render(t,this.container,this.parent)}remove(){if(this.setup!==!0)return;this.setup=!1;let t=this.component;t&&(typeof t.destroy=="function"&&t.destroy(),this.component=null)}update(t){let e=this.component;e&&typeof e.update=="function"&&e.update(t)}};var bt=s=>{if(!s.length)return null;let t={};for(let e=0,r=s.length;e<r;e++)t[s[e]]=null;return t},Pt=s=>{let t=[];if(!s)return t;let e=/[*?]/g;s=s.replace(e,"");let r=/:(.[^./?&($]+)\?*/g,n=s.match(r);if(n===null)return t;for(let i=0,o=n.length;i<o;i++){let a=n[i];a&&t.push(a.replace(":",""))}return t};var Re=/(\/):[^/(]*?\?/g,Ae=/\//g,Ee=/(\?\/+\*?)/g,Be=/(:[^/?&($]+)/g,Oe=/(\*)/g,De=s=>s.replace(Re,t=>t.replace(Ae,"(?:$|/)")),Ue=s=>(s=s.replace(Ee,"?/*"),s.replace(Be,t=>t.indexOf(".")<0?"([^/|?]+)":"([^/|?]+.*)")),He=s=>s.replace(Oe,".*"),Le=(s,t)=>s+=t[t.length-1]==="*"?"":"$",It=s=>{if(!s)return"";let t=s;return t=De(t),t=Ue(t),t=He(t),t=Le(t,s),t};var Me=0,Rt=(s,t="")=>{let e=s||"",r=typeof t=="string"&&t?t:e,n=null,i=[],o=r.match(/#\{([^}]+)\}/);o&&o[1]&&(n=o[1].trim(),r=r.replace(o[0],""),e=e.replace(o[0],""));let a=r.indexOf("?");if(a>-1){let h=r.substring(a+1);if(h.indexOf("=")>-1){let d=h.split("&");for(let m=0,W=d.length;m<W;m++){let tt=d[m];if(!tt)continue;let[he,ue=""]=tt.split("="),ct=(he||"").trim();ct&&i.push({key:ct,value:(ue||"").trim()})}r=r.substring(0,a);let y=e.indexOf("?");y>-1&&(e=e.substring(0,y))}}let c=n!==null||i.length>0;return c&&!r&&(e="*"),{uriPath:e,requiredHash:n,requiredQuery:i,hasConditions:c}},qe=s=>{if(!s)return"";let t=s.indexOf("?"),e=s.indexOf("#"),r=s.length;return t>-1&&(r=t),e>-1&&e<r&&(r=e),s.substring(0,r)},We=s=>{if(!s)return"";let t=s.indexOf("#");return t===-1?"":s.substring(t+1)},Ge=s=>{if(!s)return"";let t=s.indexOf("?");if(t===-1)return"";let e=s.indexOf("#",t);return e===-1?s.substring(t+1):s.substring(t+1,e)},X=class extends pt{constructor(t,e){let r=t.baseUri,i=Rt(r,t.rawUri).uriPath,o=Pt(i),a=bt(o),c=super(a);return this.uri=r,this.matchUri=i,this.paramKeys=o,this.titleCallBack=e,this.setupRoute(t),this.set("active",!1),c}setup(){this.stage={},this.routeId=null,this.uri=null,this.rawUri=null,this.matchUri="",this.uriQuery=/$^/,this.controller=null,this.paramKeys=[],this.requiredHash=null,this.requiredQuery=[],this.hasConditions=!1,this.titleCallBack=()=>{},this.path=null,this.referralPath=null,this.params=null,this.callBack=null,this.title=null,this.preventScroll=!1,this.scrollTo=null}setupRoute(t){this.routeId=t.id||"bs-rte-"+Me++,this.rawUri=t.rawUri||null,this.path=null,this.referralPath=null;let e=Rt(this.uri,this.rawUri||"");this.matchUri=e.uriPath,this.requiredHash=e.requiredHash,this.requiredQuery=e.requiredQuery,this.hasConditions=e.hasConditions;let r=It(this.matchUri);this.uriQuery=new RegExp("^"+r),this.params=null,this.setupComponentHelper(t),this.callBack=t.callBack,this.title=t.title,this.preventScroll=t.preventScroll||!1,this.scrollTo=t.scrollTo||null}setTitle(t){this.title=t,this.titleCallBack(this,t)}deactivate(){this.set("active",!1);let t=this.controller;t&&t.remove()}getLayout(t){if(t.component)return t.component;let e=t.import;return e?vt(e):null}setupComponentHelper(t){let e=this.getLayout(t);if(!e)return;let{container:r,persist:n,parent:i}=t,o={component:e,container:r,persist:n,parent:i},a=ft(this);this.controller=new $(a,o)}resumeRoute(t){let e=this.controller;e&&(e.container=t)}setPath(t,e){this.path=t,this.referralPath=e}select(){this.set("active",!0);let t=this.stage,e=this.callBack;typeof e=="function"&&e(t);let r=this.controller;r&&r.focus(t);let n=this.path;if(!n)return;let i=n.split("#")[1];i&&this.scrollToId(i)}scrollToId(t){if(!t)return;let e=document.getElementById(t);e&&e.scrollIntoView(!0)}match(t){let e=!1,r=this.hasConditions?qe(t):t,n=this.uriQuery||/$^/,i=r.match(n);return i===null?(this.resetParams(),e):Array.isArray(i)?this.matchConditions(t)?(this.setParams(i,1),e=i,e):(this.resetParams(),!1):e}matchConditions(t){if(!this.hasConditions)return!0;if(this.requiredHash!==null&&We(t)!==this.requiredHash)return!1;let e=this.requiredQuery||[];if(e.length>0){let r=Ge(t);if(!r)return!1;let n=new URLSearchParams(r);for(let i=0,o=e.length;i<o;i++){let a=e[i];if(!n.has(a.key)||n.get(a.key)!==a.value)return!1}}return!0}resetParams(){this.stage={}}setParams(t,e=0){if(!Array.isArray(t))return;let r=this.paramKeys;if(!r)return;let n={};for(let i=0,o=r.length;i<o;i++){let a=r[i];typeof a<"u"&&(n[a]=t[i+e])}this.set(n)}getParams(){return this.stage}};var Fe=s=>{let t=/\w\S*/;return s.replace(t,e=>e.charAt(0).toUpperCase()+e.substring(1).toLowerCase())},Ne=(s,t)=>{if(s.indexOf(":")===-1)return s;let e=t.stage;for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){let n=new RegExp(":"+r,"gi");s=s.replace(n,e[r])}return s},_e=(s,t)=>t&&(typeof t=="function"&&(t=t(s.stage)),t=Ne(t,s),Fe(t)),je=(s,t)=>(t!==""&&(s+=" - "+t),s),At=(s,t,e)=>t&&(t=_e(s,t),je(t,e));var Et={removeSlashes(s){return typeof s!="string"?"":(s[0]==="/"&&(s=s.substring(1)),s[s.length-1]==="/"&&(s=s.substring(0,s.length-1)),s)}};var Qe=()=>typeof window<"u"?window.location:{},it=class{constructor(){this.version="1.0.2",this.baseURI="/",this.title="",this.lastPath=null,this.path=null,this.lastMatchedRoute=null,this.lastScrollGroup=null,this.currentGroupId=null,this.scrollWaitToken=0,this.history=null,this.callBackLink=null,this.location=Qe(),this.routes=[],this.switches=new Map,this.switchCount=0,this.data=new mt({path:""})}setupHistory(){this.history=V.setup(this)}createRoute(t){let e=t.uri||"*";return t.rawUri=e,t.baseUri=this.createURI(e),new X(t,this.updateTitle.bind(this))}add(t){if(typeof t!="object"){let r=arguments;t={uri:r[0],component:r[1],callBack:r[2],title:r[3],id:r[4],container:r[5]}}let e=this.createRoute(t);return this.addRoute(e),e}addRoute(t){this.routes.push(t),this.checkRoute(t,this.getPath())}resume(t,e){t.resumeRoute(e),this.addRoute(t)}getBasePath(){if(!this.basePath){let t=this.baseURI||"";t[t.length-1]!=="/"&&(t+="/"),this.basePath=t}return this.basePath}createURI(t){return this.getBasePath()+Et.removeSlashes(t)}getRoute(t){let e=this.routes,r=e.length;if(r>0)for(let n=0;n<r;n++){let i=e[n];if(i.uri===t)return i}return null}getRouteById(t){let e=this.routes,r=e.length;if(r>0)for(let n=0;n<r;n++){let i=e[n];if(i.routeId===t)return i}return!1}removeRoute(t){let e=this.routes,r=e.indexOf(t);r>-1&&e.splice(r,1),this.lastMatchedRoute===t&&(this.lastMatchedRoute=null)}addSwitch(t){let e=this.switchCount++,r=this.getSwitchGroup(e);for(let n=0,i=t.length;n<i;n++){let o=t[n];if(!o)continue;let a=this.createRoute(o);r.push(a)}return this.checkGroupForRegistration(e,r),e}resumeSwitch(t,e){let r=this.switchCount++,n=this.getSwitchGroup(r);for(let i=0,o=t.length;i<o;i++){let c=t[i].component.route;c.resumeRoute(e),n.push(c)}return this.checkGroupForRegistration(r,n),r}checkGroupForRegistration(t,e){let r=this.scrollIntent,n=this.currentGroupId;this.scrollIntent=null,this.currentGroupId=t,this.checkGroup(e,this.getPath()),this.currentGroupId=n;let i=this.scrollIntent;i&&i.type==="target"&&i.groupId!==null&&i.groupId!==void 0&&(this.lastScrollGroup=i.groupId),this.scrollIntent=r}getSwitchGroup(t){let e=this.switches.get(t);if(e)return e;let r=[];return this.switches.set(t,r),r}removeSwitch(t){this.switches.delete(t)}remove(t){t=this.createURI(t);let e=this.getRoute(t);return e&&this.removeRoute(e),this}setup(t,e){this.baseURI=t||"/",this.updateBaseTag(this.baseURI),this.title=typeof e<"u"?e:"",this.setupHistory(),this.data.path=this.getPath(),this.callBackLink=this.checkLink.bind(this),f.on("click",document,this.callBackLink);let r=this.getEndPoint();return this.navigate(r,null,!0),this}updateBaseTag(t){let e=document.getElementsByTagName("base");e.length&&(e[0].href=t)}getParentLink(t){return t.closest("a")}checkLink(t){if(t.ctrlKey===!0)return!0;let e=t.target.closest("a");if(!e||e.target==="_blank"||e.dataset.cancelRoute)return!0;let r=e.getAttribute("href");if(r!==null){let n=this.baseURI,i=n!=="/"?r.replace(n,""):r,o=e.dataset.replace==="true";return this.navigate(i,null,o),t.preventDefault(),t.stopPropagation(),!1}}reset(){let t=this.routes;for(let e=0,r=t.length;e<r;e++){let n=t[e];n&&typeof n.deactivate=="function"&&n.deactivate()}return this.routes=[],this.switches=new Map,this.switchCount=0,this.lastMatchedRoute=null,this}activate(){return this.checkActiveRoutes(),this}navigate(t,e,r){return t=this.createURI(t),this.history.addState(t,e,r),this.activate(),this}updatePath(){let t=this.getPath();this.data.path=t}updateTitle(t){if(!t||!t.title)return this;let e=t.title;return document.title=At(t,e,this.title),this}checkActiveRoutes(t){if(this.lastPath=this.path,t=t||this.getPath(),this.path=t,this.scrollIntent=null,this.scrollWaitToken++,this.lastMatchedRoute&&this.check(this.lastMatchedRoute,t))this.select(this.lastMatchedRoute);else{let e=this.routes,r=e.length;for(let n=0;n<r;n++){let i=e[n];typeof i>"u"||this.checkRoute(i,t)}}this.checkSwitches(t),this.applyScrollIntent(),this.updatePath()}checkSwitches(t){let e=this.switches;for(let[r,n]of e.entries())this.currentGroupId=r,this.checkGroup(n,t);this.currentGroupId=null}checkGroup(t,e){let r=t.length;if(!r)return;let n=null;for(let a=0;a<r;a++)if(t[a].get("active")){n=t[a];break}n&&n.match(e)===!1&&n.deactivate();let i;for(let a=0;a<r;a++){let c=t[a];if(typeof c>"u")continue;if(i){c.deactivate();continue}c.match(e)!==!1&&i===void 0&&c.controller&&(i=c,this.select(c))}let o=t[0];i||this.select(o,!0)}checkRoute(t,e){let r=this.check(t,e);return r!==!1?(this.select(t),this.lastMatchedRoute=t):t.deactivate(),r}check(t,e){return t?(e=e||this.getPath(),t.match(e)!==!1):!1}select(t,e){t&&(t.setPath(this.path,this.lastPath),t.select(),this.updateTitle(t),e!==!0&&(t.scrollTo?this.scrollIntent={type:"target",selector:t.scrollTo,groupId:this.currentGroupId}:t.preventScroll!==!0&&!this.scrollIntent&&(this.scrollIntent={type:"top"})))}applyScrollIntent(){let t=this.scrollIntent;if(this.scrollIntent=null,!t)return;if(t.type==="top"){this.lastScrollGroup=null,this.checkToScroll(),this.reassertScrollTop();return}if(t.type!=="target")return;let e=t.groupId!==null&&t.groupId!==void 0,r=e&&this.lastScrollGroup===t.groupId;r||(typeof window<"u"&&window.scrollTo(0,0),this.reassertScrollTop()),this.lastScrollGroup=e?t.groupId:null,r&&this.scrollToTarget(t.selector)}reassertScrollTop(){if(typeof window>"u"||typeof requestAnimationFrame>"u")return;let t=++this.scrollWaitToken;requestAnimationFrame(()=>{t===this.scrollWaitToken&&(window.scrollY>0||window.pageYOffset>0)&&window.scrollTo(0,0)})}scrollToTarget(t){if(typeof t!="string"||typeof document>"u")return;let e=c=>{let l=window.getComputedStyle(c),h=l.position==="sticky",d;if(h){let W=c.style.position;c.style.position="static",d=c.getBoundingClientRect().top+window.scrollY,c.style.position=W}else d=c.getBoundingClientRect().top+window.scrollY;let y=h&&parseFloat(l.top)||0,m=d-y;window.scrollY>m&&window.scrollTo(0,m)},r=document.querySelector(t);if(r){e(r);return}if(typeof requestAnimationFrame>"u")return;let n=++this.scrollWaitToken,i=30,o=0,a=()=>{if(n!==this.scrollWaitToken)return;let c=document.querySelector(t);if(c){e(c);return}++o<i&&requestAnimationFrame(a)};requestAnimationFrame(a)}checkToScroll(){this.shouldScrollToTop()&&window.scrollTo(0,0)}cleanPath(t){return t?t.split("?")[0].split("#")[0]:"/"}shouldScrollToTop(){let t=this.cleanPath(this.getPath()),r=this.cleanPath(this.lastPath).split("/"),n=t.split("/");if(r.length!==n.length)return!0;let i=r[r.length-1],o=n[n.length-1];return i!==o}getEndPoint(){return this.getPath().replace(this.baseURI,"")||"/"}destroy(){typeof this.callBackLink=="function"&&f.off("click",document,this.callBackLink)}getPath(){let t=this.location,e=this.path=t.pathname;return this.history.type==="hash"?t.hash.replace("#",""):e+t.search+t.hash}},v=new it;var Bt=(s,t)=>({attr:s,value:t}),ze=(s,t)=>{if(!t.startsWith(s))return!1;let e=t[s.length];return e===void 0||e==="/"||e==="#"||e==="."||e==="?"},ot=class extends g{beforeSetup(){this.selectedClass=this.activeClass||"active"}render(){let t=this.href,e=this.text,r=this.setupWatchers(t,e);return{tag:"a",class:this.class||this.className||null,onState:["selected",{[this.selectedClass]:!0}],href:this.getString(t),text:this.getString(e),nest:this.nest||this.children,dataStateSet:this.dataSet,"data-replace":this.replace?"true":null,watch:r}}getLinkPath(){return this?.panel?.pathname||null}getString(t){let e=typeof t;return e!=="object"&&e!=="undefined"?t:null}setupWatchers(t,e){let r=this.exact===!0,n=v.data,i=[];return t&&typeof t=="object"&&i.push(Bt("href",t)),e&&typeof e=="object"&&i.push(Bt("text",e)),i.push({value:["[[path]]",n],callBack:(o,a)=>{if(typeof a.pathname>"u")return;let c=a.pathname+a.search+a.hash,l=a.hash||a.search?c:a.pathname,h=r?o===c:ze(l,o);this.update(h)}}),i}setupStates(){return{selected:!1}}update(t){this.state&&(this.state.selected=t)}};var Ot=(s,t,e=null)=>{if(!s)return;let r=null,n=!1,i=()=>{n||(n=!0,r&&(clearTimeout(r),r=null),f.off("animationend",s,o),s&&s.classList.remove(t),e&&e())},o=a=>{a.target===s&&i()};f.on("animationend",s,o),requestAnimationFrame(()=>{if(!s){i();return}s.classList.add(t);try{let a=window.getComputedStyle(s),c=parseFloat(a.animationDuration)*1e3||1e3,l=parseFloat(a.animationDelay)*1e3||0;r=setTimeout(i,c+l+100)}catch{r=setTimeout(i,1e3)}})},Dt=(s,t,e)=>{Ot(s,t)},Ut=(s,t,e)=>{let r=()=>{s&&s.remove&&s.remove()};Je(s,()=>Ot(s,t,r),e)};p.addType("manual-destroy",s=>{if(!s)return!1;s.callBack(s.ele,s.parent)});var Je=(s,t,e)=>{p.add(s,"manual-destroy",{ele:s,callBack:t,parent:e})};var q=(s,t,e,r)=>{if(Array.isArray(e[0])){e.forEach(n=>{n&&q(s,t,n,r)});return}Ye(s,t,e,r)},Ye=(s,t,e,r)=>{let n,i;if(e.length<3?[n,i]=e:[t,n,i]=e,!t||!n)return;if(typeof t.on!="function"){console.warn('Watcher directive: Data source does not have an "on" method. Make sure your component has data, state, or context.data initialized before using watchers like onSet, watch, or [[prop]] syntax.',s,t);return}let o=Ke(s,n,i,r);T.watch(s,t,n,o)},Ke=(s,t,e,r)=>typeof e=="object"?n=>{Xe(s,e,n)}:n=>{$e(s,e,t,n,r)},Ht=new WeakSet,Ve=(s,t,e)=>{!s||!s.isUnit&&!s.isComponent||Ht.has(e)||(Ht.add(e),console.warn('[Watcher] Reactive callback for "'+t+'" returned a Component/Unit instance. The entire subtree will be destroyed and recreated on every change, which can trigger expensive deep publishes during persistence/resume. Consider mounting the component once and exposing a refresh()/update() method, or returning a plain layout object instead.',e))},$e=(s,t,e,r,n)=>{let i=t(r,s,n);switch(typeof i){case"object":Ve(i,e,s),u.rebuild(i,s,n);break;case"string":let o=ht(s);if(o!=="textContent"){s.setAttribute(o,i);break}L.addHtml(s,i);break}},Xe=(s,t,e)=>{let r=Object.keys(t);for(let n=0,i=r.length;n<i;n++){let o=r[n];o&&(t[o]===e?s.classList.add(o):s.classList.remove(o))}};var U=(s,t,e)=>{let r=C(e);q(s,r,t,e)};var Lt=(s,t,e)=>{t&&s.setAttribute("role",t)},Ze=s=>(t,e)=>{let r=t?"true":"false";e.setAttribute(s,r)},Mt=(s,t,e)=>{if(!t)return;let r=t.role;r&&(s.setAttribute("role",r),t.role=null);let n=Object.keys(t);for(let i=0,o=n.length;i<o;i++){let a=n[i],c=t[a];if(c===null)continue;let l="aria-"+a;if(Array.isArray(c)){let h=c.slice();h.push(Ze(l)),U(s,h,e)}else s.setAttribute(l,c)}};var qt=(s,t,e)=>{if(!t)return;let r=w.parse(t,e);x.addAttributes(s,r.attr,e),u.setDirectives(s,r.directives,e)};p.addType("context",s=>{if(!s)return!1;s.parent.removeContextBranch(s.branch)});var at=s=>s?s.getContext():null,Wt=(s,t,e)=>{if(typeof t!="function")return;let r=at(e),n=t(r);qt(s,n,e)},Gt=(s,t,e)=>{if(typeof t!="function")return;let r=at(e);t(r)},Ft=(s,t,e)=>{if(typeof t!="function"||!e)return;let r=at(e),n=t(r);n&&e.addContextBranch(n[0],n[1])};var Nt=(s,t,e)=>{};var _t=(s,t,e)=>{if(!e)return;let r=e.z?e.z:e.render();console.log("Debug: ","ele: ",s),console.log("Data: ",t),console.log("Layout: ",r),console.log("parent: ",e)};var jt=(s,t,e)=>{},Qt=(s,t,e)=>{if(!t||!e)return;let r=t(e,s);r&&u.build(r,s,e)},zt=(s,t,e)=>{if(!t||!e)return;let r=e.getId(t);s.id=r},Jt=(s,t,e)=>{if(!t||!e)return;let r=t(e.data,s);r&&u.build(r,s,e)},Yt=(s,t,e)=>{if(!t||!e)return;let r=t(e.state,s);r&&u.build(r,s,e)},Kt=(s,t,e)=>{if(!t||!e)return;let r=e.state,n=t(r);if(!e.state){e.setStateHelper(n);return}e.addState(n)},Vt=(s,t,e)=>{if(!(!t||!e)){if(e.events||e.setEventHelper(),t[2]){let r=t[2];t[2]=n=>{r(n,e)}}e.events.on(t[0],t[1],t[2],t[3])}};var $t=(s,t,e)=>{let r,n,i;if(typeof t=="string"){if(r=C(e),!r)return;n=t}else if(Array.isArray(t))if(typeof t[0]!="object"){let o=C(e);if(!o)return;r=o,n=t[0],i=t[1]}else[r,n,i]=t;T.bind(s,r,n,i)};var Z=(s,t,e)=>{q(s,e.state,t,e)};var Xt=s=>(t,e)=>{let[r,n,i="active"]=s,o=t===n?i:"";e.dataset[r]=o},Zt=(s,t,e)=>{if(!t)return;let r=t.length-1,n=t[r],i=t.slice(0,r);i.push(Xt(n)),U(s,i,e)},te=(s,t,e)=>{if(!t)return;let r=t.length-1,n=t[r],i=t.slice(0,r);i.push(Xt(n)),Z(s,i,e)};var ee=(s,t,e)=>{let r,n,i,o;if(t.length<3){let c=C(e);if(!c)return;r=c,[n,i,o]=t}else[r,n,i,o]=t;let a=o!==!1;T.watch(s,r,n,c=>{if(u.removeAll(s),!c||c.length<1)return;let l=[];for(let h=0,d=c.length;h<d;h++){let y=a?r.scope(n+"["+h+"]"):null,m=i(c[h],h,y,l);m!==null&&l.push(m)}return u.build(l,s,e)})};var re=(s,t,e)=>{let r=t[0];if(!r||r.length<1)return;let n=t[1],i=[];for(let o=0,a=r.length;o<a;o++){let c=r[o];if(!c)continue;let l=n(c,o);l!==null&&i.push(l)}u.build(i,s,e)};var se=(s,t,e)=>{t(s,e)};p.addType("destroyed",s=>{if(!s)return!1;s.callBack(s.ele,s.parent)});var ne=(s,t,e)=>{tr(s,t,e)},tr=(s,t,e)=>{p.add(s,"destroyed",{ele:s,callBack:t,parent:e})};var ie=(s,t,e)=>{if(t)if(Array.isArray(t)&&typeof t[0]!="string")for(let r=0,n=t.length;r<n;r++)b.setup(s,t[r],e);else b.setup(s,t,e)};p.addType("routes",s=>{if(!s)return!1;let t=s.route;t&&v.removeRoute(t)});var ae=(s,t,e)=>{if(t)if(Array.isArray(t))for(let r=0,n=t.length;r<n;r++){let i=t[r];i&&oe(s,i,e)}else oe(s,t,e)},oe=(s,t,e)=>{t.container=s,t.parent=e;let r=v.add(t);er(s,r)},er=(s,t)=>{p.add(s,"routes",{route:t})};var ce=(s,t,e)=>{};p.addType("switch",s=>{if(!s)return!1;let t=s.id;v.removeSwitch(t)});var le=(s,t,e)=>{let r=t[0];for(let i=0,o=t.length;i<o;i++){let a=t[i];a&&(a.container=s,a.parent=e)}let n=v.addSwitch(t);rr(s,n)},rr=(s,t)=>{p.add(s,"switch",{id:t})};M.add("cache",jt).add("onCreated",se).add("onDestroyed",ne).add("bind",$t).add("data",Nt).add("state",ce).add("onSet",U).add("onState",Z).add("animateIn",Dt).add("animateOut",Ut).add("watch",ie).add("useParent",Qt).add("useData",Jt).add("useState",Yt).add("getId",zt).add("addState",Kt).add("addEvent",Vt).add("map",re).add("for",ee).add("useContext",Gt).add("addContext",Ft).add("context",Wt).add("role",Lt).add("aria",Mt).add("route",ae).add("debug",_t).add("dataSet",Zt).add("dataStateSet",te).add("switch",le);export{M as a,G as b,g as c,gt as d,R as e,u as f,vt as g,ot as h,it as i,v as j};
2
- //# sourceMappingURL=chunk-J2CPWQ6H.js.map
@@ -1,2 +0,0 @@
1
- import{a as C,d as V}from"./chunk-FRCLWWKS.js";import{b as q,c as g,d as F,e as G,f as $}from"./chunk-E3C6NOMV.js";import{a as D,c as N,d as M}from"./chunk-R5DHGQZV.js";var z=new WeakMap,I=new WeakMap;function K(n){if(!n||typeof n!="object")return n;let t=I.get(n);return t!==void 0?t:n}var J=new WeakMap;function ot(n,t,e,r){let s=z.get(n);s||(s=new Map,z.set(n,s));let i=s.get(e);if(i)return i;let o=new Proxy(n,Q(t,e,r));return s.set(e,o),I.set(o,n),o}function X(n,t){let e=t.charCodeAt(0),r=e>=48&&e<=57;return n===""?r?"["+t+"]":t:r?n+"["+t+"]":n+"."+t}function Q(n,t="",e=""){return{get(r,s,i){let o=r[s];if(t===""&&s in r){if(typeof o=="function"){let u=J.get(r);u||(u=new Map,J.set(r,u));let h=u.get(s);if(h)return h;let l=o.bind(r);return u.set(s,l),l}return o}if(o=(r[e]||r)[s],o!==null&&typeof o=="object"){let u=X(t,s);return ot(o,n,u,e)}return o},set(r,s,i,o){if(t===""&&s in r)return r[s]=i,!0;let c=X(t,s);return n.set(c,i),!0}}}var Y=(n,t="stage")=>{let e=new Proxy(n,Q(n,"",t));return I.set(e,n),e};var k=class{static resume(t,e){if(!t)return null;let r=localStorage.getItem(t);if(r===null)return e!==void 0?e:void 0;try{let s=JSON.parse(r);return s===null&&e!==void 0?e:s}catch(s){return console.warn('[LocalData] Failed to parse stored value for key "'+t+'". Removing corrupted entry.',s),localStorage.removeItem(t),e!==void 0?e:void 0}}static store(t,e){if(!t||!e)return!1;try{let r=JSON.stringify(e);return localStorage.setItem(t,r),!0}catch(r){return console.error('[LocalData] Failed to store data for key "'+t+'".',r),!1}}static remove(t){return t?(localStorage.removeItem(t),!0):!1}};var E=(n={})=>{let t={};if(!D.isObject(n))return t;let e=Object.keys(n);for(let r=0,s=e.length;r<s;r++){let i=e[r],o=n[i];typeof o!="function"&&(t[i]=o)}return t};var ct=0,Z=new Map,m={CHANGE:"change",DELETE:"delete"},j=(n,t)=>{let e=Z.get(n);return e||(e={change:`${n}:change`,delete:`${n}:delete`},Z.set(n,e)),t==="change"?e.change:e.delete},b=class{constructor(t={}){this.dirty=!1,this._retainState=!1,this._refreshState=!1,this.links=new Map,this._init(),this.setup(),this.dataTypeId="bd",this.eventSub=new q;let e=E(t);this.set(e);let r=Y(this);return this._proxy=r,r}retainState(){return this._retainState=!0,this._proxy||this}refreshState(){return this._refreshState=!0,this._proxy||this}setup(){this.stage={}}_init(){let t=++ct;this._dataNumber=t,this._id=`dt-${t}`,this._dataId=`${this._id}:`}onFlush(t){this.eventSub.onFlush(t)}flushPending(){this.eventSub.flush()}getDataId(){return String(this._id)}remove(){this.unlink(),this.eventSub.reset()}on(t,e){let r=j(t,m.CHANGE);return this.eventSub.on(r,e)}off(t,e){let r=j(t,m.CHANGE);this.eventSub.off(r,e)}_setAttr(t,e,r=this,s=!1){let i=this.stage[t];e!==i&&(this.stage[t]=e,this._publish(t,e,r,m.CHANGE))}publishLocalEvent(t,e,r,s){let i=j(t,s);this.eventSub.publish(i,e,r)}_publish(t,e,r,s){this.publishLocalEvent(t,e,r,s),r=r||this,g.publish(this._dataId+t,e,r)}set(t,e,r){if(typeof t!="object")return this._setAttr(t,e,r),this;let s=Object.keys(t);for(let i=0;i<s.length;i++){let o=s[i],c=t[o];typeof c!="function"&&this._setAttr(o,c,e,r)}return this}_silentSet(t){let e=this.stage,r=Object.keys(t);for(let s=0,i=r.length;s<i;s++){let o=r[s];e[o]=t[o]}}getModelData(){return this.stage}_deleteAttr(t,e,r=this){delete t[e],this.publishLocalEvent(e,null,r,m.DELETE)}toggle(t){return typeof t>"u"?this:(this.set(t,!this.get(t)),this)}increment(t,e=null){if(typeof t>"u")return this;e=e!==null&&typeof e=="number"?e:1;let r=this.get(t);return this.set(t,r+e),this}decrement(t,e=null){if(typeof t>"u")return this;e=e!==null&&typeof e=="number"?e:1;let r=this.get(t);return this.set(t,r-e),this}concat(t,e){if(typeof t>"u")return this;let r=this.get(t);return this.set(t,r+e),this}ifNull(t,e){return this.get(t)===null&&this.set(t,e),this}setKey(t,e){return this.key=e!=null?t+":v"+e:t,this}resume(t){let e=k.resume(String(this.key),t);return e?(this.set(e),this):this}store(){let t=this.get();return k.store(String(this.key),t)}delete(t){return typeof t=="string"?(this._deleteAttr(this.stage,t),this):(this.setup(),this)}_getAttr(t,e){return t[e]}get(t){return typeof t<"u"?this._getAttr(this.stage,t):this.getModelData()}link(t,e,r){if(arguments.length===1&&t.isData===!0&&(e=t.get()),typeof e!="object")return this.remoteLink(t,e,r);let s=[];return Object.entries(e).forEach(([i])=>{s.push(this.remoteLink(t,i))}),s}remoteLink(t,e,r){let s=r||e,i=t.get(e);typeof i<"u"&&this.get(e)!==i&&this.set(e,i);let o=t.on(e,(u,h)=>{if(h===this)return!1;this.set(s,u,t)}),c=this.on(s,(u,h)=>{if(h===t)return!1;t.set(e,u,this)});return this.addLink(o,t,e,c),t.addLink(c,this,s,o),o}addLink(t,e,r,s){this.links.set(t,{data:e,attr:r,pair:s})}unlink(t){if(t){this.removeLink(t);return}let e=this.links;e.size!==0&&(e.forEach((r,s)=>{this.removeLink(s,!1)}),e.clear())}removeLink(t,e=!0){let r=this.links.get(t);if(r){let s=r.data;r.attr&&s.off(r.attr,t);let i=r.pair,o=i&&s.links;if(o){let c=o.get(i);c&&(o.delete(i),c.attr&&this.off(c.attr,i))}}e!==!1&&this.links.delete(t)}};b.prototype.isData=!0;var U=class{constructor(t=1e3){this.cache=new Map,this.maxSize=t}get(t){return this.cache.get(t)}set(t,e){if(this.cache.delete(t),this.cache.set(t,e),this.cache.size>this.maxSize){let r=this.cache.keys().next().value;this.cache.delete(r)}}clear(){this.cache.clear()}},tt=new Set(["__proto__","prototype","constructor"]),p={deepDataPattern:/(\w+)|(?:\[(\d)\))/g,segmentCache:new U(1e3),hasDeepData(n){return n.indexOf(".")!==-1||n.indexOf("[")!==-1},isSafeAttr(n){return!tt.has(n)},getSegments(n){let t=this.segmentCache.get(n);if(t!==void 0)return t;let e=this.deepDataPattern;if(t=n.match(e),t){for(let r=0,s=t.length;r<s;r++)if(tt.has(t[r])){console.warn("[Data] Blocked unsafe path segment in: "+n),t=null;break}}return this.segmentCache.set(n,t),t}};var x=class{static set(t,e,r){if(!p.hasDeepData(e)){if(!p.isSafeAttr(e))return;t[e]=r;return}let s,i=p.getSegments(e);if(!i)return;let o=i.length,c=o-1;for(let u=0;u<o;u++){let h=i[u];if(u===c){t[h]=r;break}if(t[h]===void 0){let l=h.charCodeAt(0);t[h]=l<48||l>57?{}:[]}t=t[h]}}static delete(t,e){if(!p.hasDeepData(e)){if(!p.isSafeAttr(e))return;delete t[e];return}let r=p.getSegments(e);if(!r)return;let s=r.length,i=s-1;for(let o=0;o<s;o++){let c=r[o],u=t[c];if(u===void 0)break;if(o===i){if(Array.isArray(t)){let h=Number(c);Number.isInteger(h)&&h>=0&&h<t.length&&t.splice(h,1);break}delete t[c];break}t=u}}static get(t,e){if(!p.hasDeepData(e))return t[e]??void 0;let r=p.getSegments(e);if(!r)return;let s=r.length,i=s-1;for(let o=0;o<s;o++){let c=r[o],u=t[c]??void 0;if(u===void 0)break;if(t=u,o===i)return t}}};var et=new Set,P=class{static MAX_DEPTH=50;static publishDeep(t,e,r,s){if(!p.hasDeepData(e)){this.publish(e,r,s);return}let i,o=p.getSegments(e);if(!o)return;let c=o.length,u=c-1,h="";for(let l=0;l<c;l++){let a=o[l];t=t[a];let f=a.charCodeAt(0);l>0?(f<48||f>57)&&(h+="."+a):h=a;let d;if(l===u)d=r;else{let y=o[l+1],A=y.charCodeAt(0);if(A>=48&&A<=57){h+="["+y+"]";continue}let _={};_[y]=t[y],d=_}this.publish(h,d,s)}}static publish(t,e,r,s=null,i=0){if(t=t||"",r(t,e),!(!e||typeof e!="object"||(e=K(e),s===null&&(et.clear(),s=et),!s))){if(s.has(e)){console.warn("[Publisher] Circular reference detected at path:",t);return}if(i>=this.MAX_DEPTH){console.warn("[Publisher] Max depth exceeded at path:",t,"- stopping recursion");return}s.add(e),Array.isArray(e)?this.publishArray(t,e,r,s,i):this.publishObject(t,e,r,s,i)}}static publishArray(t,e,r,s,i){let o=e.length;for(let c=0;c<o;c++){let u=e[c],h=t+"["+c+"]";this._checkPublish(h,u,r,s,i)}}static publishObject(t,e,r,s,i){let o=Object.keys(e);for(let c=0,u=o.length;c<u;c++){let h=o[c],l=e[h],a=t+"."+h;this._checkPublish(a,l,r,s,i)}}static _checkPublish(t,e,r,s,i){if(!e||typeof e!="object"){r(t,e);return}this.publish(t,e,r,s,i+1)}};var S=class extends b{setup(){this.attributes={},this.stage={}}_setAttr(t,e,r,s){typeof e!="object"&&e===this.get(t)||(!r&&s!==!0?x.set(this.attributes,t,e):this.dirty===!1&&(this.dirty=!0),x.set(this.stage,t,e),r=r||this,this._publish(t,e,r,m.CHANGE))}_silentSet(t){let e=this.stage,r=this.attributes,s=Object.keys(t);for(let i=0,o=s.length;i<o;i++){let c=s[i],u=t[c];e[c]=u,r[c]=u}}linkAttr(t,e){let r=t.get(e);if(!r)return;let s=Object.keys(r);for(let i=0,o=s.length;i<o;i++){let c=s[i];this.link(t,e+"."+c,c)}}scope(t,e){let r=this.get(t);if(!r)return!1;e=e||this.constructor;let s=new e(r);return s.linkAttr(this,t),s}splice(t,e){return this.delete(t+"["+e+"]"),this.refresh(t),this}push(t,e){let r=this.get(t);return Array.isArray(r)===!1&&(r=[]),r.push(e),this.set(t,r),this}concat(t,e){let r=this.get(t);return Array.isArray(r)===!1&&(r=[]),r=r.concat(e),this.set(t,r),this}unshift(t,e){let r=this.get(t);return Array.isArray(r)===!1&&(r=[]),r.unshift(e),this.set(t,r),this}shift(t){let e=this.get(t);if(Array.isArray(e)===!1)return null;let r=e.shift();return this.set(t,e),r}getIndex(t,e,r){let s=this.get(t);return Array.isArray(s)===!1?-1:typeof s[0]!="object"?s.indexOf(e):s.findIndex(o=>o[e]===r)}pop(t){let e=this.get(t);if(Array.isArray(e)===!1)return null;let r=e.pop();return this.set(t,e),r}refresh(t){return this.set(t,this.get(t)),this}_publish(t,e,r,s){if(this._publishAttr(t,e,r,s),!e||typeof e!="object")return;let i=t.length,o=s===m.CHANGE?":change":":"+s,c=o.length,u=i+c;for(let l of this.eventSub.getMessages()){if(l.length<=u||!l.endsWith(o)||!l.startsWith(t))continue;let a=l.charCodeAt(i);if(a!==46&&a!==91)continue;let f=l.slice(0,l.length-c);this._publishAttr(f,this.get(f),r,s)}let h=g.getPrefixMessages(this._dataId);if(h){let l=this._dataId.length;for(let a of h){if(a.length-l<=i||!a.startsWith(t,l))continue;let d=a.charCodeAt(l+i);if(d!==46&&d!==91)continue;let y=a.slice(l);g.publish(a,this.get(y),r)}}}_publishAttr(t,e,r,s){let i=this._dataId+t;g.publish(i,e,r),this.publishLocalEvent(t,e,r,s)}mergeStage(){this.attributes=C.clone(this.stage),this.dirty=!1}getModelData(){return this.mergeStage(),this.attributes}revert(){this.set(this.attributes),this.dirty=!1}_deleteAttr(t,e,r=this){x.delete(t,e),this._delCommitter=r;let s=this._deleteCb||(this._deleteCb=(i,o)=>this.publishLocalEvent(i,o,this._delCommitter,m.DELETE));P.publish(e,e,s)}_getAttr(t,e){return x.get(t,e)}};var ut={"\n":"\\n","\r":"\\n"," ":"\\t"},ht=(n,t)=>{typeof n!="string"&&(n=String(n));let e=t?/[\n\r\t]/g:/\t/g;return n.replace(e,r=>ut[r])},rt=(n,t)=>{if(typeof n!="string")return n;n=ht(n,t),n=encodeURIComponent(n);let e=/%22/g;return n.replace(e,'"')},W=(n,t)=>{let e=typeof n;if(e==="undefined")return n;if(e!=="object")return n=rt(n),n;let r=Array.isArray(n)?[...n]:{...n};return Object.keys(r).forEach(s=>{let i=r[s];i!==null&&(r[s]=typeof i=="string"?W(i,t):rt(i,t))}),r};function st(n){if(typeof n>"u"||n.length<1)return!1;try{return JSON.parse(n)}catch(t){return console.warn("[Encode] Failed to parse JSON.",t),!1}}function v(n){return typeof n<"u"?JSON.stringify(n):null}var O=class{static prepareJsonUrl(t,e=!1){let r=typeof t=="object"?C.clone(t):t,s=W(r,e);return v(s)}static json={encode:v,decode:st};static xmlParse(t){return typeof t>"u"?!1:new DOMParser().parseFromString(t,"text/xml")}};var H=n=>n.data?n.data:n.context&&n.context.data?n.context.data:n.state?n.state:null;var T=class extends ${static create(t,e,r,s){let i=document.createElement(t);return this.addAttributes(i,e,s),r.appendChild(i),i}static addAttributes(t,e,r){if(!(!e||e.length<1))for(let s=0,i=e.length;s<i;s++){let o=e[s];this.addAttr(t,o.key,o.value,r)}}static addAttr(t,e,r,s){if(r===""||!e||e==="children")return;if(e==="innerHTML"){t.innerHTML=r;return}if(typeof r==="function"){if(e=G(e),r.originalCallback)N.add(e,t,r,!1,!0,r.originalCallback);else{let c=r,u=function(h){c.call(this,h,s)};N.add(e,t,u,!1,!0,c)}return}if(e.charCodeAt(4)===45){t.setAttribute(e,r);return}let o=F(e);t[o]=r}static addContent(t,e){e&&(e.textContent!==null?t.textContent=e.textContent:e.innerHTML&&(t.innerHTML=e.innerHTML))}static append(t,e){t.appendChild(e)}};var nt=/(\[\[(.*?(?:\[\d+\])?)\]\])/g,it=new Map,R={isWatching(n){if(Array.isArray(n)){let t=n[0];return typeof t=="string"&&t.includes("[[")}return this.hasParams(n)},hasParams(n){return typeof n=="string"&&n.includes("[[")},_getWatcherProps(n){let t=it.get(n);if(t!==void 0)return t;let e=n.match(nt),r=e?e.map(s=>s.slice(2,-2)):null;return it.set(n,r),r},updateAttr(n,t,e){switch(t){case"text":case"textContent":n.textContent=e;break;case"disabled":n.disabled=!e;break;case"checked":n.checked=!!e;break;case"required":n.required=!!e;break;case"src":if(n.tagName==="IMG"){n.src=e&&(e.indexOf(".")!==-1||e.indexOf("blob:")!==-1)?e:"";break}n.src=e;break;default:T.addAttr(n,t,e);break}},replaceParams(n,t,e=!1){let r=0;return n.replace(nt,function(s,i,o){let c=e?t[r]:t;r++;let u=c.get(o);return u??""})},_getWatcherCallBack(n,t,e,r,s){let i=this._getWatcherProps(e);if(i&&i.length===1&&e.length===i[0].length+4){let o=i[0],c=s?t[0]:t;return()=>{let u=c.get(o);this.updateAttr(n,r,u!=null?String(u):"")}}return()=>{let o=this.replaceParams(e,t,s);this.updateAttr(n,r,o)}},getValue(n,t){let e=n.value;return Array.isArray(e)===!1?[e,H(t)]:(e.length<2&&e.push(H(t)),e)},getPropValues(n,t,e){let r=[];for(let s=0,i=t.length;s<i;s++){let c=(e?n[s]:n).get(t[s])??"";r.push(c)}return r},getCallBack(n,t,e,r,s,i){let o=n.attr||"textContent",c=n.callBack;if(typeof c=="function"){let u=i||this._getWatcherProps(r)||[],h=u.length>1;return(l,a)=>{l=h!==!0?l:this.getPropValues(e,u,s);let f=c(l,t,a);typeof f<"u"&&this.updateAttr(t,o,f)}}return this._getWatcherCallBack(t,e,r,o,s)},addDataWatcher(n,t,e){let r=this.getValue(t,e),s=r[1]??e?.data??e?.context?.data??e?.state??null;if(!s)return;let i=r[0],o=Array.isArray(s),c=this._getWatcherProps(i);if(!c)return;let u=this.getCallBack(t,n,s,i,o,c);if(!o)c.length>1?g.watchMany(n,s,c,u):this.addWatcher(n,s,c[0],u);else for(let h=0,l=c.length;h<l;h++)this.addWatcher(n,s[h],c[h],u)},getWatcherSettings(n,t=null){if(typeof n=="string")return{attr:t,value:n};if(Array.isArray(n)){let e=n[n.length-1];e&&typeof e=="object"&&(e=t!==null?t:null);let r=n[1]&&typeof n[1]=="object"?[n[0],n[1]]:[n[0]];return typeof e=="function"?{attr:t,value:r,callBack:e}:{attr:e||"textContent",value:r}}return n},setup(n,t,e){t&&this.addDataWatcher(n,this.getWatcherSettings(t),e)},addWatcher(n,t,e,r){g.watch(n,t,e,r)}};var w=class{constructor(t){this.model=t,this.objectType=this.objectType||"item",this.url="",this.validateCallBack=null,this.init()}init(){let t=this.model;t&&t.url&&(this.url=t.url)}isValid(){let t=this.validate();if(t!==!1){let e=this.validateCallBack;typeof e=="function"&&e(t)}return t}validate(){return!0}getDefaultParams(){return""}setupParams(t){let e=this.getDefaultParams();return t=this.addParams(t,e),t}objectToString(t){let e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r+"="+t[r]);return e.join("&")}addParams(t,e){if(t=t||{},typeof t=="string"&&(t=M.parseQueryString(t,!1)),!e)return this._isFormData(t)?t:this.objectToString(t);if(typeof e=="string"&&(e=M.parseQueryString(e,!1)),this._isFormData(t))for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.append(r,e[r]);else t=Object.assign(t,e),t=this.objectToString(t);return t}get(t,e){let r=this.model.get("id"),s="id="+r,i=r?`/${r}`:"",o=this.model;return this._get(i,s,t,e,c=>{if(c){let u=this.getObject(c);u&&o.set(u)}})}getObject(t){return t[this.objectType]||t||!1}setupObjectData(){let t=this.model.get();return this.objectType+"="+O.prepareJsonUrl(t)}setup(t,e){if(!this.isValid())return;let r=this.setupObjectData(),s=this.model.id,i=s!=null?`/${s}`:"";return this._put(i,r,t,e)}add(t,e){if(!this.isValid())return;let r=this.setupObjectData(),s=this.model.id,i=s!=null?`/${s}`:"";return this._post(i,r,t,e)}update(t,e){if(!this.isValid())return;let r=this.setupObjectData(),s=this.model.id,i=s!=null?`/${s}`:"";return this._patch(i,r,t,e)}delete(t,e){let r=this.model.get("id"),s=typeof r<"u"?"id="+r:this.setupObjectData(),i=r!=null?`/${r}`:"";return this._delete(i,s,t,e)}getAllParams(t,e,r,s){let i=this.model.get();t=isNaN(Number(t))?0:t,e=isNaN(Number(e))?50:e;let o=i.search||"",c=f=>{try{return JSON.stringify(f)}catch(d){return console.error("[ModelService] Failed to serialize request param.",d),""}},u=i.filter||"";typeof u=="object"&&(u=c(u));let h=i.dates||"";typeof h=="object"&&(h=c(h));let l=i.orderBy||"";typeof l=="object"&&(l=c(l));let a=i.groupBy||"";return Array.isArray(a)&&(a=c(a)),"&filter="+encodeURIComponent(u)+"&offset="+t+"&limit="+e+"&dates="+encodeURIComponent(h)+"&orderBy="+encodeURIComponent(l)+"&groupBy="+encodeURIComponent(a)+"&search="+encodeURIComponent(o)+"&lastCursor="+(typeof r<"u"&&r!==null?encodeURIComponent(r):"")+"&since="+(typeof s<"u"&&s!==null?encodeURIComponent(s):"")}all(t,e,r,s,i=null,o=null){let c=this.getAllParams(r,s,i,o);return this._get("",c,t,e)}getUrl(t){let e=this.url;if(!t)return this.replaceUrl(e);t[0]==="/"&&(t=t.substring(1));let r=t[0]==="?"?e+t:e+"/"+t;return this.replaceUrl(r)}setupRequest(t,e,r,s,i){let o={url:this.getUrl(t),method:e,params:r,completed:(u,h)=>{typeof i=="function"&&i(u),this.getResponse(u,s,h)}};return this._isFormData(r)&&(o.headers={}),V(o)}setupEventSource(t,e,r,s,i=!0){let o=null,c,u=!1,h=!1,l=()=>{c&&(clearTimeout(c),c=void 0)},a=()=>{if(u||!i||h)return;l(),c=setTimeout(()=>{c=void 0,f()},3e3)},f=()=>{if(u||h)return;if(o){try{o.close()}catch{}o=null}h=!0;let d=this.getUrl(t),y=e?"?"+e:"";o=new EventSource(d+y,{withCredentials:!0}),o.onopen=()=>{h=!1,l(),s&&s()},o.onerror=()=>{h=!1,o&&o.readyState===EventSource.CLOSED&&(o=null,a())},o.onmessage=A=>{try{let _=JSON.parse(A.data);r&&r(_)}catch{}}};return f(),{get source(){return o},close:()=>{if(u=!0,h=!1,l(),o){try{o.close()}catch{}o=null}}}}replaceUrl(t){return R.isWatching(t)&&(t=R.replaceParams(t,this.model)),t.endsWith("/")&&(t=t.substring(0,t.length-1)),t}_isFormData(t){return t instanceof FormData}request(t,e,r,s){return this._request("","POST",t,e,r,s)}_get(t,e,r,s,i){return e=this.setupParams(e),e=this.addParams(e,r),t=t||"",e&&(t+="?"+e),this.setupRequest(t,"GET","",s,i)}_post(t,e,r,s,i){return this._request(t,"POST",e,r,s,i)}_put(t,e,r,s,i){return this._request(t,"PUT",e,r,s,i)}_patch(t,e,r,s,i){return this._request(t,"PATCH",e,r,s,i)}_delete(t,e,r,s,i){return this._request(t,"DELETE",e,r,s,i)}_request(t,e,r,s,i,o){return r=this.setupParams(r),r=this.addParams(r,s),this.setupRequest(t,e,r,i,o)}getResponse(t,e,r){typeof e=="function"&&e(t,r)}static extend(t){if(!t)return{};let e=this;class r extends e{constructor(i){super(i)}}return Object.assign(r.prototype,t),r}};var lt=n=>{let t={};if(!D.isObject(n)||!n.defaults)return t;let{defaults:e}=n;return Object.keys(e).forEach(r=>{let s=e[r];typeof s!="function"&&(t[r]=s)}),delete n.defaults,t},at=n=>{if(!n||typeof n.xhr!="object")return{};let t={...n.xhr};return delete n.xhr,t},ft=0,L=class extends S{constructor(t){let e=super(t);return this.initialize(),e}setup(){this.attributes={},this.stage={},this.url=this.url||"",this.xhr=this.xhr||{}}initialize(){}static extend(t={}){let e=this,r=at(t),s=e.prototype.service.extend(r),i=lt(t);class o extends e{constructor(u){let h={...i,...E(u)};super(h),this.xhr=new s(this)}dataTypeId=`bm${ft++}`}return Object.assign(o.prototype,t),o.prototype.service=s,o}};L.prototype.service=w;var B=class extends b{};export{Y as a,b,S as c,H as d,T as e,R as f,L as g,B as h};
2
- //# sourceMappingURL=chunk-J4K3HIHH.js.map
@@ -1,2 +0,0 @@
1
- import{b as I}from"./chunk-SM7TAP7I.js";import{a as ft,b as pt,c as mt,d as v,e as y,f as R}from"./chunk-W4RXLHJN.js";import{a as H,b as ht}from"./chunk-PDIOOIMW.js";import{a as ut,c as P,d as dt,f as L}from"./chunk-5RE4LAGC.js";import{b as p,c as f}from"./chunk-R5DHGQZV.js";var M={items:new Map,add(s,t){return this.items.set(s,t),this},get(s){return this.items.get(s)??null}};p.addType("components",s=>{if(!s)return;let t=s.component;!t||!t.isUnit||(t.persistToken&&t.parent&&t.parent.removePersistedChild(t.persistToken),t.rendered===!0&&(t.prepareDestroy(),t.cleanUpAfterDestroy()))});var de=0,W=class{constructor(t,e,r){this.isUnit=!0,this.data=null,this.persist=null,this.nest=null,this.state=null,this.panel=null,this.parent=null,this.unitType=null,this._classId,this.id="",this.cached=[],this.init();let n,i;if(t==null)n={},i=[];else{let o=typeof t;o==="string"||o==="number"?(n={},i=[{tag:"text",textContent:t}]):Array.isArray(t)?(n={},i=t):(n=t||{},i=typeof e=="string"?[{tag:"text",textContent:e}]:e)}this.setupProps(n),this.children=i||[],this.persistedChildren={},this.persistedCount=0,this.onCreated(),this.rendered=!1,this.container=null}init(){this.id="cp-"+de++,this.unitType=this._classId||this.constructor.name.toLowerCase()}declareProps(){}addPersistedChild(t){let e=t.key,r=t.cache,n;r!=null&&e!=null?n="pk:"+r+":"+e:r!=null?n="pk:"+r:e!=null?n="pk:"+e:n="pc"+this.persistedCount++;let i=this.persistedChildren[n];return i&&t.unitType===i.unitType&&t.resumeScope(i),t.persistToken=n,this.persistedChildren[n]=t,n}removePersistedChild(t){this.rendered&&(!t||!this.persistedChildren[t]||delete this.persistedChildren[t])}setupProps(t){if(this.declareProps(),!(!t||typeof t!="object"))for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this[e]=t[e],e==="data"&&(this._externalData=!0))}getChildScope(){return this}getParentContext(){return this.parent?this.parent.getContext():null}setupContext(){if(this._contextResumed)return;let t=this.getParentContext(),e=this.setContext(t);if(e){this.context=e;return}this.context=t,this.setupAddingContext()}setupAddingContext(){let t=this.context,e=this.addContext(t);if(!e)return;let r=e[0];r&&(this.addingContext=!0,this.contextBranchName=r,this.addContextBranch(r,e[1]))}addContextBranch(t,e){this.context??={},this.context[t]=e}setContext(t){return null}addContext(t){return null}removeContext(){this.addingContext&&this.removeContextBranch(this.contextBranchName)}removeContextBranch(t){t&&delete this.context[t]}getContext(){return this.context}onCreated(){}render(){return{}}_cacheRoot(t){return t&&(t.id||(t.id=this.getId()),t.cache="panel",t)}_createLayout(){return this.render()}prepareLayout(){let t=this._createLayout();return this._cacheRoot(t)}afterBuild(){p.add(this.panel,"components",{component:this}),this.rendered=!0,this.afterLayout()}afterLayout(){this.afterSetup()}if(t,e){return t?e||t:null}map(t,e){let r=[];if(!t||t.length<1)return r;for(let n=0,i=t.length;n<i;n++){let o=e(t[n],n);r.push(o)}return r}removeAll(t){return L.removeAll(t)}getId(t){let e=this.id;return typeof t=="string"&&(e+="-"+t),e}cacheEle(t,e){e&&(this[e]=t,this.cached.push(e))}initialize(){this.setupContext(),this.beforeSetup()}beforeSetup(){}afterSetup(){}setup(t){this.setContainer(t),this.initialize()}setContainer(t){this.container=t}_remove(){this.prepareDestroy(),this.removeContext();let t=this.panel;t&&L.removeElement(t),this.cleanUpAfterDestroy()}cleanUpAfterDestroy(){this.panel=null,this.container=null;let t=this.cached;for(let e=0,r=t.length;e<r;e++)this[t[e]]=null;this.cached=[],this.persist!==!0&&(this.persistedChildren={},this.persistToken=null)}prepareDestroy(){this.persistedCount=0,this.rendered=!1;try{this.beforeDestroy()}catch(t){console.error("Error in beforeDestroy:",t)}this.data&&typeof this.data.unlink=="function"&&this.data.unlink()}beforeDestroy(){}destroy(){this._remove()}};var A=class{static resume(t,e){if(t._externalData){this._resumeExternal(t,e);return}this._resumeOwned(t,e)}static refresh(t){let e=t.setData();e&&t.data&&t.data.set(e.stage),this.refreshContext(t)}static refreshContext(t){let e=t.context;if(!e||!e.data)return;let r=t.getParentContext();if(!r||!r.data)return;let n=r.data.stage,i=e.data.stage,o=null;for(let a in n){if(!Object.prototype.hasOwnProperty.call(n,a))continue;let l=n[a];l!==i[a]&&(o===null&&(o={}),o[a]=l)}o!==null&&(typeof e.data._silentSet=="function"?e.data._silentSet(o):e.data.set(o))}static _resumeExternal(t,e){let r=t.setData();if(!r){t.data=e;return}if(e&&e.stage){let n=e._retainState||r._retainState,i=!n&&(e._refreshState||r._refreshState),o=this._buildExternalUpdates(e.stage,r.stage,n,i);H.isEmpty(o)||r._silentSet(o)}typeof r.flushPending=="function"&&r.flushPending(),t.data=r}static _buildExternalUpdates(t,e,r,n){let i={};for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o))continue;if(n){Object.prototype.hasOwnProperty.call(e,o)||(i[o]=t[o]);continue}let a=t[o];!r&&a==null||a!==e[o]&&(i[o]=a)}return i}static _resumeOwned(t,e){if(!t.data){t.data=e;return}if(e&&e._retainState){t.data=e;return}if(e&&e.stage){let r=e._refreshState||t.data._refreshState,n=this._buildOwnedUpdates(e.stage,t.data.stage,r);H.isEmpty(n)||t.data._silentSet(n)}t.data&&typeof t.data.flushPending=="function"&&t.data.flushPending()}static _buildOwnedUpdates(t,e,r){let n={};for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;if(r){Object.prototype.hasOwnProperty.call(e,i)||(n[i]=t[i]);continue}let o=t[i];o!=null&&o!==e[i]&&(n[i]=o)}return n}};var G=class{constructor(){this.events=[]}addEvents(t){let e=t.length;if(!(e<1))for(let r=0;r<e;r++){let n=t[r];this.on(n[0],n[1],n[2],n[3])}}on(t,e,r,n){f.on(t,e,r,n),this.events.push({event:t,obj:e,callBack:r,capture:n})}off(t,e,r,n){f.off(t,e,r,n);let i,o=this.events;for(let a=0,l=o.length;a<l;a++)if(i=o[a],i.event===t&&i.obj===e&&i.callBack===r&&i.capture===n){o.splice(a,1);break}}set(){let t=this.events;for(let e=0,r=t.length;e<r;e++){let n=t[e];f.on(n.event,n.obj,n.callBack,n.capture)}}unset(){let t=this.events;for(let e=0,r=t.length;e<r;e++){let n=t[e];f.off(n.event,n.obj,n.callBack,n.capture)}}reset(){this.unset(),this.events=[]}};var F=class{constructor(t,e){this.remoteStates=[];let r=this.convertStates(e);this.addStatesToTarget(t,r)}addStates(t,e){let r=this.convertStates(e);this.addStatesToTarget(t,r)}createState(t,e,r,n){return{action:t,state:e,callBack:r,targetId:n,token:null}}convertStates(t){let e=[];for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;if(r==="remotes"){this.setupRemoteStates(t[r],e);continue}let n=null,i=null,o=t[r];o&&typeof o=="object"&&(i=o.callBack,n=o.id||o.targetId,o=o.state),e.push(this.createState(r,o,i,n))}return e}setupRemoteStates(t,e){for(let r=0,n=t.length;r<n;r++){let i=t[r];if(i)for(let o in i){if(!Object.prototype.hasOwnProperty.call(i,o)||o==="id")continue;let a=null,l=i[o],c=l!==null?l:void 0;c&&typeof c=="object"&&(a=c.callBack,c=c.state),e.push(this.createState(o,c,a,i.id))}}}removeRemoteStates(t){let e=this.remoteStates;e&&this.removeActions(t,e)}removeActions(t,e){if(!(e.length<1))for(let r=0,n=e.length;r<n;r++){let i=e[r];i.token&&this.unbindRemoteState(t,i.token),i.targetId&&I.remove(i.targetId,i.action,i.token)}}restore(t){I.restore(t.id,t);let e=this.remoteStates;if(e)for(let r=0,n=e.length;r<n;r++){let i=e[r];i.token=this.bindRemoteState(t,i.action,i.targetId)}}bindRemoteState(t,e,r){let n=I.getTarget(r);return t.link(n,e)}unbindRemoteState(t,e){t.unlink(e)}addStatesToTarget(t,e){let r=this.remoteStates;for(let n=0,i=e.length;n<i;n++){let o=e[n],a=this.addAction(t,o);o.targetId&&(o.token=a,r.push(o))}}addAction(t,e){let r,n=e.action,i=e.targetId;i&&(r=this.bindRemoteState(t,n,i)),typeof e.state<"u"&&t.addAction(n,e.state);let o=e.callBack;return typeof o=="function"&&t.on(n,o),r||null}};var x=class extends W{constructor(t,e,r){super(t,e,r),this.isComponent=!0,this.stateResumed=!1,this.stateTargetId=null,this._externalData=this._externalData??!1,this._setupData()}setData(){return null}_setupData(){if(this.data)return;let t=this.setData();t&&(this.data=t)}resumeScope(t){if(this._resumeData(t.data),this.state=t.state,this.stateHelper=t.stateHelper,this.persistedChildren=t.persistedChildren,t.context){let e=t.context.data;e&&e._refreshState===!0&&e._retainState!==!0||(this.context=t.context,this._contextResumed=!0)}this.id=t.id,this._refreshContextData()}_resumeData(t){A.resume(this,t)}_refreshData(){A.refresh(this)}_refreshContextData(){A.refreshContext(this)}initialize(){this.setupContext(),this.addStates(),this.beforeSetup()}afterLayout(){this.addEvents(),this.afterSetup()}setupStateTarget(t){let e=t||this.stateTargetId||this.id;this.state=I.getTarget(String(e))}setupStates(){return{}}addStates(){let t=this.state;if(t){this.stateResumed=!0,this.stateHelper.restore(t);return}let e=this.setupStates();H.isEmpty(e)||this.setStateHelper(e)}setStateHelper(t={}){this.state||(this.setupStateTarget(),this.stateHelper=new F(this.state??{},t))}addState(t){!this.stateHelper||this.stateResumed===!0||this.stateHelper.addStates(this.state,t)}removeStates(){let t=this.state;t&&(this.stateHelper.removeRemoteStates(t),t.remove(),this.stateResumed=!1)}onFlush(t){let e=this.data??this?.context?.data??null;e&&e.onFlush(t)}setEventHelper(){this.events||(this.events=new G)}setupEvents(){return[]}addEvents(){let t=this.setupEvents();t.length<1||(this.setEventHelper(),this.events&&this.events.addEvents(t))}removeEvents(){let t=this.events;t&&t.reset()}prepareDestroy(){this.persistedCount=0,this.rendered=!1;try{this.beforeDestroy()}catch(t){console.error("Error in beforeDestroy:",t)}this.removeEvents(),this.removeStates(),this.removeContext(),this.data&&this.persist!==!0&&this.data.unlink()}};var gt={created:"onCreated",setStates:"setupStates",state:"setupStates",events:"setupEvents",before:"beforeSetup",render:"render",after:"afterSetup",destroy:"beforeDestroy"};var fe=(s,t)=>typeof s!="function"&&t==="setupStates"?()=>s:s,tt=(s,t)=>{if(!s)return t;let e=Object.keys(s);for(let r=0,n=e.length;r<n;r++){let i=e[r],o=s[i],a=gt[i]||i;t[a]=fe(o,a)}return t},pe=s=>tt(s,{}),me=0,yt=(s,t)=>{class e extends s{}return Object.assign(e.prototype,t),e.prototype._classId="jot"+me++,e},E=(s,t=x)=>{s||(s={});let e,r=typeof s;return r==="object"&&s.render?(e=pe(s),yt(t,e)):(e={render:r==="function"?s:()=>s},yt(t,e))};var et=(s,t)=>({attr:s,directive:t});var S=(s,t)=>({key:s,value:t});var xt=(s,t,e,r)=>({tag:s,attr:t,directives:e,children:r});var St=null,ge=()=>St||(St=M.get("watch")),w=class{static getTag(t){return t.tag||"div"}static setupChildren(t){t.nest&&(t.children=t.nest,delete t.nest)}static setElementContent(t,e,r,n){return t==="text"?(n.push({tag:"text",textContent:e}),!0):t==="html"||t==="innerHTML"?(r.push(S("innerHTML",e)),!0):!1}static setTextAsWatcher(t,e,r){t.push(et(S(e,R.getWatcherSettings(r,dt(e))),ge()))}static setButtonType(t,e,r){if(t==="button"){let n=e.type||"button";r.push(S("type",n))}}static parse(t,e){let r=[],n=[],i=t.tag||"div";i==="button"&&r.push(S("type",t.type||"button"));let o=[],a,l;for(let c in t){if(!Object.prototype.hasOwnProperty.call(t,c)||c==="tag"||(a=t[c],a==null))continue;if(c==="children"||c==="nest"){if(Array.isArray(a))for(let u=0;u<a.length;u++)o.push(a[u]);else o.push(a);continue}if((l=M.get(c))!==null){n.push(et(S(c,a),l));continue}let h=typeof a;if(h==="object"){if(R.isWatching(a)){this.setTextAsWatcher(n,c,a);continue}o.push(a);continue}if(h==="function"){let u=a,g=function(m){u.call(this,m,e)};g.originalCallback=u,r.push(S(c,g));continue}if(h==="string"&&a.includes("[[")){this.setTextAsWatcher(n,c,a);continue}if(c==="text"){o.push({tag:"text",textContent:a});continue}if(c==="html"||c==="innerHTML"){r.push(S("innerHTML",a));continue}r.push(S(c,a))}return xt(i,r,n,o)}};var D=class{build(t,e,r){}setupComponent(t,e,r){let n=r?.getChildScope();t.parent=n,n&&n.persist===!0&&t.persist!==!1&&(t.persist=!0,t.parent.addPersistedChild(t)),t.cache&&n&&(n[t.cache]=t),t.setup(e)}buildComponent(t){let e=t.prepareLayout(),r=this.build(e,t.container,t);return t.afterBuild(),t.component&&typeof t.onCreated=="function"&&t.onCreated(t),r}createComponent(t,e,r){return this.setupComponent(t,e,r),this.buildComponent(t),t}setDirectives(t,e,r){}removeNode(t){}removeAll(t){}};var ye=s=>{for(let e in s)if(e!=="tag"&&e!=="textContent")return!1;let t=s.textContent;return typeof t=="string"?t.indexOf("[[")===-1:typeof t!="object"},N=class extends D{build(t,e,r){let n=y.createDocFragment();if(Array.isArray(t))for(let i=0,o=t.length;i<o;i++)this.buildElement(t[i],n,r);else this.buildElement(t,n,r);return e&&typeof e=="object"&&e.appendChild(n),n}buildElement(t,e,r){if(t){if(t.isUnit===!0){this.createComponent(t,e,r);return}this.createElement(t,e,r)}}createElement(t,e,r){if(t.tag==="text"&&ye(t)){let c=t.textContent;y.createText(c??"",e);return}let n=r?.getChildScope();if(t.data||t.state){this.createTempComponent(t,e,n);return}let i=w.parse(t,n),o=this.createNode(i,e,n);this.cache(o,t.cache,r);let a=i.children;for(let c=0,h=a.length;c<h;c++){let u=a[c];u!==null&&this.buildElement(u,o,r)}let l=i.directives;l.length&&this.setDirectives(o,l,n)}createTempComponent(t,e,r){let n={cache:t.cache,key:t.key,persist:t.persist,_externalData:!0,setData:()=>t.data,...tt(t.methods||{},{}),render(){return{...t,data:null,state:null,methods:null,key:null,persist:null}}};t.state&&(n.setupStateTarget=function(o){this.state=t.state});let i=new x(n);this.createComponent(i,e,r)}setDirectives(t,e,r){for(let n=0,i=e.length;n<i;n++)this.handleDirective(t,e[n],r)}handleDirective(t,e,r){e.directive(t,e.attr.value,r)}cache(t,e,r){r&&e&&r.cacheEle(t,e)}createNode(t,e,r){let n=t.tag;if(n==="text"){let i=t.attr[0],o=i?i.value:"";return y.createText(o,e)}else if(n==="comment"){let i=t.attr[0],o=i?i.value:"";return y.createComment(o,e)}return y.create(n,t.attr,e,r)}removeNode(t){y.removeElement(t)}removeAll(t){y.removeAll(t)}};var xe=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source"]),Se=/[&<>"]/,rt=s=>{let t=typeof s=="string"?s:String(s);return Se.test(t)?t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):t},O=class{static create(t,e=[],r=""){let n="",i="";for(let o=0,a=e.length;o<a;o++){let l=e[o],c=l.key,h=l.value;if(c==="text"||c==="textContent"){n+=rt(h);continue}if(c==="html"||c==="innerHTML"){n+=h;continue}if(typeof h=="function")continue;let u=c+'="'+rt(h)+'"';i?i+=" "+u:i=u}return xe.has(t)?"<"+t+" "+i+" />":"<"+t+" "+i+">"+n+r+"</"+t+">"}static createText(t){return rt(t)}static createComment(t){return"<!-- "+t+" -->"}};var Q=class extends D{build(t,e,r){if(Array.isArray(t)){let n="";for(let i=0,o=t.length;i<o;i++)n+=this.buildElement(t[i],r);return n}return this.buildElement(t,r)}createComponent(t,e,r){return this.setupComponent(t,e,r),this.buildComponent(t)}buildElement(t,e){return t?t.isUnit===!0?this.createComponent(t,{},e):this.createElement(t,e):""}createElement(t,e){let r=w.parse(t,e),n=r.children,i="";for(let o=0,a=n.length;o<a;o++){let l=n[o];l!==null&&(i+=this.buildElement(l,e))}return this.createNode(r,i)}createNode(t,e){let r=t.tag;if(r==="text"){let n=t.attr[0],i=n?n.value:"";return O.createText(i)}else if(r==="comment"){let n=t.attr[0],i=n?n.value:"";return O.createComment(i)}return O.create(r,t.attr,e)}removeAll(t){}};var z=class{static browserIsSupported(){return typeof window<"u"&&typeof document=="object"}static setup(){return this.browserIsSupported()?new N:new Q}};var k=z.setup(),we=s=>typeof s=="object"&&s.isUnit===!0,Ce=s=>{let t=E(s);return t?new t:null},d=class{static render(t,e,r){return!t||(we(t)||(t=Ce(t)),!t)?null:k.createComponent(t,e,r)}static build(t,e,r){return k.build(t,e,r)}static rebuild(t,e,r){return k.removeAll(e),this.build(t,e,r)}static setDirectives(t,e,r){k.setDirectives(t,e,r)}static createNode(t,e,r){return k.createNode(t,e,r)}static removeNode(t){k.removeNode(t)}static removeAll(t){k.removeAll(t)}};ht.augment({buildLayout(s,t,e){d.build(s,t,e)}});var st=[],ve=s=>st.indexOf(s)!==-1,ke=s=>({tag:"script",src:s.src,async:!1,load(t){st.push(s.src);let e=s.load;e&&e()}}),be=s=>({tag:"link",rel:"stylesheet",type:"text/css",href:s.src,load(t){st.push(s.src);let e=s.load;e&&e()}}),j=class{constructor(t){this.percent=0,this.loaded=0,this.total=0,this.callBack=t||null}add(t){this.total++;let e,r=this.update.bind(this);t.indexOf(".css")!==-1?e=be({load:r,src:t}):e=ke({load:r,src:t}),d.build(e,document.head)}addFiles(t){t&&t.forEach(e=>{ve(e)||this.add(e)})}update(){if(this.updateProgress()<100)return;let e=this.callBack;e&&e()}updateProgress(){return++this.loaded,this.percent=Math.floor(this.loaded/this.total*100)}};var Te=s=>s?typeof s?.prototype?.constructor=="function":!1,b=class{static process(t,e){let r=t.default;return r?e.callback?e.callback(r):(Te(r)?r=new r:r=r(),r.isUnit===!0&&(r.route=e.route,e.persist&&(r.persist=!0)),r):null}static render(t,e,r){let n=d.build(t,null,r),i=n.firstChild||t?.panel;return e.after(n),i}};var $=class{static load(t,e,r){return t.then(n=>(e&&e(n),n)).catch(n=>{console.error("Error loading module:",n),r&&r(n)})}};var Pe=s=>({tag:"comment",textContent:"import placeholder",onCreated:s.onCreated}),T=new Map,Re=s=>{if(T.has(s)){let r=T.get(s);return r&&typeof r.then!="function"?Promise.resolve(r):r}let t=typeof s,e;if(t==="string")e=import(s);else if(t==="function")e=s();else return s;return e.then(r=>{T.set(s,r)}).catch(()=>{T.delete(s)}),T.set(s,e),e},Ie=s=>{if(!T.has(s))return null;let t=T.get(s);return t&&typeof t.then=="function"?null:t||null},wt=E({declareProps(){this.loaded=!1,this.errorRoot=null,this.generation=0},render(){return Pe({onCreated:s=>{if(this.src){if(this.layout){this.layoutRoot=b.render(this.layout,this.panel,this.parent);return}if(this.depends){new j(()=>{this.loadAndRender(s)}).addFiles(this.depends);return}this.loadAndRender(s)}}})},loadAndRender(s){let t=this.generation,e=Ie(this.src);if(e){this.renderModule(s,e);return}$.load(Re(this.src),r=>{t===this.generation&&this.renderModule(s,r)},r=>{t===this.generation&&(this.loaded=!1,this.renderError(s,r))})},renderError(s,t){let e=()=>this.retry(s),r=this.fallback,n=typeof r=="function"?r(t,e):r||{class:"base-import-error",children:[{tag:"span",text:"Failed to load content."},{tag:"button",type:"button",text:"Retry",click:e}]};n&&(this.errorRoot=b.render(n,s,this.parent))},retry(s){this.removeErrorLayout(),this.loadAndRender(s)},removeErrorLayout(){this.errorRoot&&(d.removeNode(this.errorRoot),this.errorRoot=null)},renderModule(s,t){this.loaded=!0;let e=this.layout||b.process(t,{callback:this.callback,route:this.route,persist:this.persist});this.layout=e,this.layoutRoot=b.render(e,s,this.parent)},shouldUpdate(s){return this.updateLayout===!0?!0:this.updateLayout=s&&s.isUnit&&typeof s.update=="function"},updateModuleLayout(s){let t=this.layout;this.shouldUpdate(t)&&t&&t.update(s)},update(s){this.loaded===!0&&this.updateModuleLayout(s)},destroy(){this.generation++,this.removeErrorLayout(),this.layoutRoot&&(d.removeNode(this.layoutRoot),this.persist!==!0&&(this.layoutRoot=null,this.layout=null,this.loaded=!1,this.updateLayout=!1))}});var Ct=s=>{let t=typeof s;return(t==="string"||t==="function"||s instanceof Promise)&&(s={src:s}),new wt(s)};var Ae=0,B=class{constructor(t){this.router=t,this.locationId="base-app-router-"+Ae++,this.callBack=this.check.bind(this)}setup(){return this.addEvent(),this}check(t){}getScrollPosition(){return{x:window.scrollX,y:window.scrollY}}scrollTo(t){window.scrollTo(t.x,t.y)}addEvent(){return this}};var kt=typeof navigator<"u"&&/iPad|iPhone|iPod/.test(navigator.userAgent||"")&&!window.MSStream,vt=()=>{kt&&requestAnimationFrame(()=>requestAnimationFrame(()=>{let s=window.scrollX,t=window.scrollY;window.scrollTo(0,t+1),document.documentElement.offsetHeight,window.scrollTo(s,t)}))},J=class extends B{addEvent(){return f.on("popstate",window,this.callBack),kt&&(this.pageShowCallBack=this.onPageShow.bind(this),f.on("pageshow",window,this.pageShowCallBack)),this}removeEvent(){return f.off("popstate",window,this.callBack),this.pageShowCallBack&&f.off("pageshow",window,this.pageShowCallBack),this}onPageShow(t){t.persisted&&vt()}check(t){let e=t.state;if(!e||e.location!==this.locationId)return!1;t.preventDefault(),t.stopPropagation(),this.router.checkActiveRoutes(e.uri);let r=e.scrollPosition;r&&this.scrollTo(r),vt()}createState(t,e={}){let r=this.getScrollPosition();return e=e===null?{}:e,{location:this.locationId,...e,scrollPosition:r,uri:t}}addState(t,e,r=!1){let n=window.history,i=n.state;if(i&&i.uri===t)return this;!r&&i&&i.location===this.locationId&&(i.scrollPosition=this.getScrollPosition(),n.replaceState(i,"",window.location.href));let o=this.createState(t,e);return r||(o.scrollPosition={x:0,y:0}),n[r===!1?"pushState":"replaceState"](o,null,t),this}};var Y=class extends B{addEvent(){return f.on("hashchange",window,this.callBack),this}removeEvent(){return f.off("hashchange",window,this.callBack),this}check(t){this.router.checkActiveRoutes(t.newURL)}addState(t,e,r){return window.location.hash=t,this}};var K=class{static browserIsSupported(){return typeof window=="object"&&"history"in window&&"pushState"in window.history}static setup(t){return this.browserIsSupported()?new J(t).setup():new Y(t).setup()}};var nt=class extends x{getChildScope(){return this.parent}},bt=s=>E(s,nt);var V=class{constructor(t,e){this.route=t,this.template=e.component,this.component=null,this.hasTemplate=!1,this.setup=!1,this.container=e.container,this.persist=e.persist,this.parent=e.parent}focus(t){this.setup===!1&&(this.route&&typeof this.route.flushPending=="function"&&this.route.flushPending(),this.create()),this.update(t)}setupTemplate(){let e=typeof this.template;e==="function"?this.initializeComponent():e==="object"&&this.initializeTemplateObject(),this.hasTemplate=!0}initializeComponent(){this.template=this.template(),this.initializeTemplateObject()}transferSettings(t){this.persist=this.persist&&t.persist!==!1,Object.assign(t,{route:this.route,persist:this.persist}),this.component=t}initializeTemplateObject(){let t=this.template;if(!t)return;t.isUnit||(this.template=new(bt(t)));let e=this.template;this.transferSettings(e)}create(){if(this.setupTemplate(),!this.hasTemplate)return;this.setup=!0;let t=this.component;d.render(t,this.container,this.parent)}remove(){if(this.setup!==!0)return;this.setup=!1;let t=this.component;t&&(typeof t.destroy=="function"&&t.destroy(),this.component=null)}update(t){let e=this.component;e&&typeof e.update=="function"&&e.update(t)}};var Tt=s=>{if(!s.length)return null;let t={};for(let e=0,r=s.length;e<r;e++)t[s[e]]=null;return t},Pt=s=>{let t=[];if(!s)return t;let e=/[*?]/g;s=s.replace(e,"");let r=/:(.[^./?&($]+)\?*/g,n=s.match(r);if(n===null)return t;for(let i=0,o=n.length;i<o;i++){let a=n[i];a&&t.push(a.replace(":",""))}return t};var Ee=/(\/):[^/(]*?\?/g,De=/\//g,Oe=/(\?\/+\*?)/g,Be=/(:[^/?&($]+)/g,_e=/(\*)/g,Ue=s=>s.replace(Ee,t=>t.replace(De,"(?:$|/)")),He=s=>(s=s.replace(Oe,"?/*"),s.replace(Be,t=>t.indexOf(".")<0?"([^/|?]+)":"([^/|?]+.*)")),Le=s=>s.replace(_e,".*"),Me=(s,t)=>s+=t[t.length-1]==="*"?"":"$",Rt=s=>{if(!s)return"";let t=s;return t=Ue(t),t=He(t),t=Le(t),t=Me(t,s),t};var qe=0,It=(s,t="")=>{let e=s||"",r=typeof t=="string"&&t?t:e,n=null,i=[],o=r.match(/#\{([^}]+)\}/);o&&o[1]&&(n=o[1].trim(),r=r.replace(o[0],""),e=e.replace(o[0],""));let a=r.indexOf("?");if(a>-1){let h=r.substring(a+1);if(h.indexOf("=")>-1){let u=h.split("&");for(let m=0,U=u.length;m<U;m++){let ct=u[m];if(!ct)continue;let[he,ue=""]=ct.split("="),lt=(he||"").trim();lt&&i.push({key:lt,value:(ue||"").trim()})}r=r.substring(0,a);let g=e.indexOf("?");g>-1&&(e=e.substring(0,g))}}let l=n!==null||i.length>0;return l&&!r&&(e="*"),{uriPath:e,requiredHash:n,requiredQuery:i,hasConditions:l}},We=s=>{if(!s)return"";let t=s.indexOf("?"),e=s.indexOf("#"),r=s.length;return t>-1&&(r=t),e>-1&&e<r&&(r=e),s.substring(0,r)},Ge=s=>{if(!s)return"";let t=s.indexOf("#");return t===-1?"":s.substring(t+1)},Fe=s=>{if(!s)return"";let t=s.indexOf("?");if(t===-1)return"";let e=s.indexOf("#",t);return e===-1?s.substring(t+1):s.substring(t+1,e)},X=class extends pt{constructor(t,e){let r=t.baseUri,i=It(r,t.rawUri).uriPath,o=Pt(i),a=Tt(o),l=super(a);return this.uri=r,this.matchUri=i,this.paramKeys=o,this.titleCallBack=e,this.setupRoute(t),this.set("active",!1),l}setup(){this.stage={},this.routeId=null,this.uri=null,this.rawUri=null,this.matchUri="",this.uriQuery=/$^/,this.controller=null,this.paramKeys=[],this.requiredHash=null,this.requiredQuery=[],this.hasConditions=!1,this.titleCallBack=()=>{},this.path=null,this.referralPath=null,this.params=null,this.callBack=null,this.title=null,this.preventScroll=!1,this.scrollTo=null}setupRoute(t){this.routeId=t.id||"bs-rte-"+qe++,this.rawUri=t.rawUri||null,this.path=null,this.referralPath=null;let e=It(this.uri,this.rawUri||"");this.matchUri=e.uriPath,this.requiredHash=e.requiredHash,this.requiredQuery=e.requiredQuery,this.hasConditions=e.hasConditions;let r=Rt(this.matchUri);this.uriQuery=new RegExp("^"+r),this.params=null,this.setupComponentHelper(t),this.callBack=t.callBack,this.title=t.title,this.preventScroll=t.preventScroll||!1,this.scrollTo=t.scrollTo||null}setTitle(t){this.title=t,this.titleCallBack(this,t)}deactivate(){this.set("active",!1);let t=this.controller;t&&t.remove()}getLayout(t){if(t.component)return t.component;let e=t.import;return e?Ct(e):null}setupComponentHelper(t){let e=this.getLayout(t);if(!e)return;let{container:r,persist:n,parent:i}=t,o={component:e,container:r,persist:n,parent:i},a=ft(this);this.controller=new V(a,o)}resumeRoute(t){let e=this.controller;e&&(e.container=t)}setPath(t,e){this.path=t,this.referralPath=e}select(){this.set("active",!0);let t=this.stage,e=this.callBack;typeof e=="function"&&e(t);let r=this.controller;r&&r.focus(t);let n=this.path;if(!n)return;let i=n.split("#")[1];i&&this.scrollToId(i)}scrollToId(t){if(!t)return;let e=document.getElementById(t);e&&e.scrollIntoView(!0)}match(t){let e=!1,r=We(t),n=this.uriQuery||/$^/,i=r.match(n);return i===null?(this.resetParams(),e):Array.isArray(i)?this.matchConditions(t)?(this.setParams(i,1),e=i,e):(this.resetParams(),!1):e}matchConditions(t){if(!this.hasConditions)return!0;if(this.requiredHash!==null&&Ge(t)!==this.requiredHash)return!1;let e=this.requiredQuery||[];if(e.length>0){let r=Fe(t);if(!r)return!1;let n=new URLSearchParams(r);for(let i=0,o=e.length;i<o;i++){let a=e[i];if(!n.has(a.key)||n.get(a.key)!==a.value)return!1}}return!0}resetParams(){this.stage={}}setParams(t,e=0){if(!Array.isArray(t))return;let r=this.paramKeys;if(!r)return;let n={};for(let i=0,o=r.length;i<o;i++){let a=r[i];typeof a<"u"&&(n[a]=t[i+e])}this.set(n)}getParams(){return this.stage}};var Ne=s=>{let t=/\w\S*/;return s.replace(t,e=>e.charAt(0).toUpperCase()+e.substring(1).toLowerCase())},Qe=s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),ze=(s,t)=>{if(s.indexOf(":")===-1)return s;let e=t.stage;for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){let n=new RegExp(":"+Qe(r),"gi");s=s.replace(n,()=>e[r])}return s},je=(s,t)=>t&&(typeof t=="function"&&(t=t(s.stage)),t=ze(t,s),Ne(t)),$e=(s,t)=>(t!==""&&(s+=" - "+t),s),At=(s,t,e)=>t&&(t=je(s,t),$e(t,e));var Et={removeSlashes(s){return typeof s!="string"?"":(s[0]==="/"&&(s=s.substring(1)),s[s.length-1]==="/"&&(s=s.substring(0,s.length-1)),s)}};var Je=()=>typeof window<"u"?window.location:{},it=class{constructor(){this.version="1.0.2",this.baseURI="/",this.title="",this.lastPath=null,this.path=null,this.lastMatchedRoute=null,this.lastScrollGroup=null,this.currentGroupId=null,this.scrollWaitToken=0,this.history=null,this.callBackLink=null,this.location=Je(),this.routes=[],this.switches=new Map,this.switchCount=0,this.data=new mt({path:""})}setupHistory(){this.history=K.setup(this)}createRoute(t){let e=t.uri||"*";return t.rawUri=e,t.baseUri=this.createURI(e),new X(t,this.updateTitle.bind(this))}add(t){if(typeof t!="object"){let r=arguments;t={uri:r[0],component:r[1],callBack:r[2],title:r[3],id:r[4],container:r[5]}}let e=this.createRoute(t);return this.addRoute(e),e}addRoute(t){this.routes.push(t),this.checkRoute(t,this.getPath())}resume(t,e){t.resumeRoute(e),this.addRoute(t)}getBasePath(){if(!this.basePath){let t=this.baseURI||"";t[t.length-1]!=="/"&&(t+="/"),this.basePath=t}return this.basePath}createURI(t){let e=this.getBasePath(),r=Et.removeSlashes(t);return r=r.replace(/^(?:\.\/)+/,""),r==="."&&(r=""),e+r}getRoute(t){let e=this.routes,r=e.length;if(r>0)for(let n=0;n<r;n++){let i=e[n];if(i.uri===t)return i}return null}getRouteById(t){let e=this.routes,r=e.length;if(r>0)for(let n=0;n<r;n++){let i=e[n];if(i.routeId===t)return i}return!1}removeRoute(t){let e=this.routes,r=e.indexOf(t);r>-1&&e.splice(r,1),this.lastMatchedRoute===t&&(this.lastMatchedRoute=null)}addSwitch(t){let e=this.switchCount++,r=this.getSwitchGroup(e);for(let n=0,i=t.length;n<i;n++){let o=t[n];if(!o)continue;let a=this.createRoute(o);r.push(a)}return this.checkGroupForRegistration(e,r),e}resumeSwitch(t,e){let r=this.switchCount++,n=this.getSwitchGroup(r);for(let i=0,o=t.length;i<o;i++){let l=t[i].component.route;l.resumeRoute(e),n.push(l)}return this.checkGroupForRegistration(r,n),r}checkGroupForRegistration(t,e){let r=this.scrollIntent,n=this.currentGroupId;this.scrollIntent=null,this.currentGroupId=t,this.checkGroup(e,this.getPath()),this.currentGroupId=n;let i=this.scrollIntent;i&&i.type==="target"&&i.groupId!==null&&i.groupId!==void 0&&(this.lastScrollGroup=i.groupId),this.scrollIntent=r}getSwitchGroup(t){let e=this.switches.get(t);if(e)return e;let r=[];return this.switches.set(t,r),r}removeSwitch(t){this.switches.delete(t)}remove(t){t=this.createURI(t);let e=this.getRoute(t);return e&&this.removeRoute(e),this}setup(t,e){this.baseURI=t||"/",this.updateBaseTag(this.baseURI),this.title=typeof e<"u"?e:"",this.setupHistory(),this.data.path=this.getPath(),this.callBackLink=this.checkLink.bind(this),f.on("click",document,this.callBackLink);let r=this.getEndPoint();return this.navigate(r,null,!0),this}updateBaseTag(t){let e=document.getElementsByTagName("base");e.length&&(e[0].href=t)}getParentLink(t){return t.closest("a")}checkLink(t){if(t.ctrlKey===!0)return!0;let e=t.target.closest("a");if(!e||e.target==="_blank"||e.dataset.cancelRoute)return!0;let r=e.getAttribute("href");if(r!==null){let n=this.baseURI,i=n!=="/"?r.replace(n,""):r,o=e.dataset.replace==="true";return this.navigate(i,null,o),t.preventDefault(),t.stopPropagation(),!1}}reset(){let t=this.routes;for(let e=0,r=t.length;e<r;e++){let n=t[e];n&&typeof n.deactivate=="function"&&n.deactivate()}return this.routes=[],this.switches=new Map,this.switchCount=0,this.lastMatchedRoute=null,this}activate(){return this.checkActiveRoutes(),this}navigate(t,e,r){return t=this.createURI(t),this.history.addState(t,e,r),this.activate(),this}updatePath(){let t=this.getPath();this.data.path=t}updateTitle(t){if(!t||!t.title)return this;let e=t.title;return document.title=At(t,e,this.title),this}checkActiveRoutes(t){if(this.lastPath=this.path,t=t||this.getPath(),this.path=t,this.scrollIntent=null,this.scrollWaitToken++,this.lastMatchedRoute&&this.check(this.lastMatchedRoute,t))this.select(this.lastMatchedRoute);else{let e=this.routes,r=e.length;for(let n=0;n<r;n++){let i=e[n];typeof i>"u"||this.checkRoute(i,t)}}this.checkSwitches(t),this.applyScrollIntent(),this.updatePath()}checkSwitches(t){let e=this.switches;for(let[r,n]of e.entries())this.currentGroupId=r,this.checkGroup(n,t);this.currentGroupId=null}checkGroup(t,e){let r=t.length;if(!r)return;let n=null;for(let l=0;l<r;l++)if(t[l].get("active")){n=t[l];break}let i=!1;n&&(n.match(e)===!1?n.deactivate():i=!0);let o;for(let l=0;l<r;l++){let c=t[l];if(typeof c>"u")continue;if(o){c.deactivate();continue}(c===n?i:c.match(e))!==!1&&o===void 0&&c.controller&&(o=c,this.select(c))}let a=t[0];o||this.select(a,!0)}checkRoute(t,e){let r=this.check(t,e);return r!==!1?(this.select(t),this.lastMatchedRoute=t):t.deactivate(),r}check(t,e){return t?(e=e||this.getPath(),t.match(e)!==!1):!1}select(t,e){t&&(t.setPath(this.path,this.lastPath),t.select(),this.updateTitle(t),e!==!0&&(t.scrollTo?this.scrollIntent={type:"target",selector:t.scrollTo,groupId:this.currentGroupId}:t.preventScroll!==!0&&!this.scrollIntent&&(this.scrollIntent={type:"top"})))}applyScrollIntent(){let t=this.scrollIntent;if(this.scrollIntent=null,!t)return;if(t.type==="top"){this.lastScrollGroup=null,this.checkToScroll(),this.reassertScrollTop();return}if(t.type!=="target")return;let e=t.groupId!==null&&t.groupId!==void 0,r=e&&this.lastScrollGroup===t.groupId;r||(typeof window<"u"&&window.scrollTo(0,0),this.reassertScrollTop()),this.lastScrollGroup=e?t.groupId:null,r&&this.scrollToTarget(t.selector)}reassertScrollTop(){if(typeof window>"u"||typeof requestAnimationFrame>"u")return;let t=++this.scrollWaitToken;requestAnimationFrame(()=>{t===this.scrollWaitToken&&(window.scrollY>0||window.pageYOffset>0)&&window.scrollTo(0,0)})}scrollToTarget(t){if(typeof t!="string"||typeof document>"u")return;let e=a=>{let l=window.getComputedStyle(a),c=l.position==="sticky",h;if(c){let m=a.style.position;a.style.position="static",h=a.getBoundingClientRect().top+window.scrollY,a.style.position=m}else h=a.getBoundingClientRect().top+window.scrollY;let u=c&&parseFloat(l.top)||0,g=h-u;window.scrollY>g&&window.scrollTo(0,g)};if(typeof requestAnimationFrame>"u"){let a=document.querySelector(t);a&&e(a);return}let r=++this.scrollWaitToken,n=30,i=0,o=()=>{if(r!==this.scrollWaitToken)return;let a=document.querySelector(t);if(a){e(a);return}++i<n&&requestAnimationFrame(o)};requestAnimationFrame(o)}checkToScroll(){this.shouldScrollToTop()&&window.scrollTo(0,0)}cleanPath(t){return t?t.split("?")[0].split("#")[0]:"/"}shouldScrollToTop(){let t=this.cleanPath(this.getPath()),r=this.cleanPath(this.lastPath).split("/"),n=t.split("/");if(r.length!==n.length)return!0;let i=r[r.length-1],o=n[n.length-1];return i!==o}getEndPoint(){return this.getPath().replace(this.baseURI,"")||"/"}destroy(){typeof this.callBackLink=="function"&&f.off("click",document,this.callBackLink)}getPath(){let t=this.location,e=this.path=t.pathname;return this.history.type==="hash"?t.hash.replace("#",""):e+t.search+t.hash}},C=new it;var Dt=(s,t)=>({attr:s,value:t}),Ye=(s,t)=>{if(!t.startsWith(s))return!1;let e=t[s.length];return e===void 0||e==="/"||e==="#"||e==="."||e==="?"},ot=class extends x{beforeSetup(){this.selectedClass=this.activeClass||"active"}render(){let t=this.href,e=this.text,r=this.setupWatchers(t,e);return{tag:"a",class:this.class||this.className||null,onState:["selected",{[this.selectedClass]:!0}],href:this.getString(t),text:this.getString(e),nest:this.nest||this.children,dataStateSet:this.dataSet,"data-replace":this.replace?"true":null,watch:r}}getLinkPath(){return this?.panel?.pathname||null}getString(t){let e=typeof t;return e!=="object"&&e!=="undefined"?t:null}setupWatchers(t,e){let r=this.exact===!0,n=C.data,i=[];t&&typeof t=="object"&&i.push(Dt("href",t)),e&&typeof e=="object"&&i.push(Dt("text",e));let o=null,a="",l="";return i.push({value:["[[path]]",n],callBack:(c,h)=>{if(typeof h.pathname>"u")return;let u=h.getAttribute("href");if(u!==o){o=u;let m=h.pathname+h.search+h.hash;a=m,l=h.hash||h.search?m:h.pathname}let g=r?c===a:Ye(l,c);this.update(g)}}),i}setupStates(){return{selected:!1}}update(t){this.state&&(this.state.selected=t)}};var Ot=(s,t,e=null)=>{if(!s)return;let r=null,n=!1,i=()=>{n||(n=!0,r&&(clearTimeout(r),r=null),f.off("animationend",s,o),s&&s.classList.remove(t),e&&e())},o=a=>{a.target===s&&i()};f.on("animationend",s,o),requestAnimationFrame(()=>{if(!s){i();return}s.classList.add(t);try{let a=window.getComputedStyle(s),l=parseFloat(a.animationDuration)*1e3||1e3,c=parseFloat(a.animationDelay)*1e3||0;r=setTimeout(i,l+c+100)}catch{r=setTimeout(i,1e3)}})},Bt=(s,t,e)=>{Ot(s,t)},_t=(s,t,e)=>{let r=()=>{s&&s.remove&&s.remove()};Ke(s,()=>Ot(s,t,r),e)};p.addType("manual-destroy",s=>{if(!s)return!1;s.callBack(s.ele,s.parent)});var Ke=(s,t,e)=>{p.add(s,"manual-destroy",{ele:s,callBack:t,parent:e})};var q=(s,t,e,r)=>{if(Array.isArray(e[0])){e.forEach(n=>{n&&q(s,t,n,r)});return}Ve(s,t,e,r)},Ve=(s,t,e,r)=>{let n,i;if(e.length<3?[n,i]=e:[t,n,i]=e,!t||!n)return;if(typeof t.on!="function"){console.warn('Watcher directive: Data source does not have an "on" method. Make sure your component has data, state, or context.data initialized before using watchers like onSet, watch, or [[prop]] syntax.',s,t);return}let o=Xe(s,n,i,r);P.watch(s,t,n,o)},Xe=(s,t,e,r)=>typeof e=="object"?n=>{er(s,e,n)}:n=>{tr(s,e,t,n,r)},Ut=new WeakSet,Ze=(s,t,e)=>{!s||!s.isUnit&&!s.isComponent||Ut.has(e)||(Ut.add(e),console.warn('[Watcher] Reactive callback for "'+t+'" returned a Component/Unit instance. The entire subtree will be destroyed and recreated on every change, which can trigger expensive deep publishes during persistence/resume. Consider mounting the component once and exposing a refresh()/update() method, or returning a plain layout object instead.',e))},tr=(s,t,e,r,n)=>{let i=t(r,s,n);switch(typeof i){case"object":Ze(i,e,s),d.rebuild(i,s,n);break;case"string":let o=ut(s);if(o!=="textContent"){s.setAttribute(o,i);break}L.addHtml(s,i);break}},er=(s,t,e)=>{let r=Object.keys(t);for(let n=0,i=r.length;n<i;n++){let o=r[n];o&&(t[o]===e?s.classList.add(o):s.classList.remove(o))}};var _=(s,t,e)=>{let r=v(e);q(s,r,t,e)};var Ht=(s,t,e)=>{t&&s.setAttribute("role",t)},rr=s=>(t,e)=>{let r=t?"true":"false";e.setAttribute(s,r)},Lt=(s,t,e)=>{if(!t)return;let r=t.role;r&&(s.setAttribute("role",r),t.role=null);let n=Object.keys(t);for(let i=0,o=n.length;i<o;i++){let a=n[i],l=t[a];if(l===null)continue;let c="aria-"+a;if(Array.isArray(l)){let h=l.slice();h.push(rr(c)),_(s,h,e)}else s.setAttribute(c,l)}};var Mt=(s,t,e)=>{if(!t)return;let r=w.parse(t,e);y.addAttributes(s,r.attr,e),d.setDirectives(s,r.directives,e)};p.addType("context",s=>{if(!s)return!1;s.parent.removeContextBranch(s.branch)});var at=s=>s?s.getContext():null,qt=(s,t,e)=>{if(typeof t!="function")return;let r=at(e),n=t(r);Mt(s,n,e)},Wt=(s,t,e)=>{if(typeof t!="function")return;let r=at(e);t(r)},Gt=(s,t,e)=>{if(typeof t!="function"||!e)return;let r=at(e),n=t(r);n&&e.addContextBranch(n[0],n[1])};var Ft=(s,t,e)=>{};var Nt=(s,t,e)=>{if(!e)return;let r=e._layout?e._layout:e.render();console.log("Debug: ","ele: ",s),console.log("Data: ",t),console.log("Layout: ",r),console.log("parent: ",e)};var Qt=(s,t,e)=>{},zt=(s,t,e)=>{if(!t||!e)return;let r=t(e,s);r&&d.build(r,s,e)},jt=(s,t,e)=>{if(!t||!e)return;let r=e.getId(t);s.id=r},$t=(s,t,e)=>{if(!t||!e)return;let r=t(e.data,s);r&&d.build(r,s,e)},Jt=(s,t,e)=>{if(!t||!e)return;let r=t(e.state,s);r&&d.build(r,s,e)},Yt=(s,t,e)=>{if(!t||!e)return;let r=e.state,n=t(r);if(!e.state){e.setStateHelper(n);return}e.addState(n)},Kt=(s,t,e)=>{if(!(!t||!e)){if(e.events||e.setEventHelper(),t[2]){let r=t[2];t[2]=n=>{r(n,e)}}e.events.on(t[0],t[1],t[2],t[3])}};var Vt=(s,t,e)=>{let r,n,i;if(typeof t=="string"){if(r=v(e),!r)return;n=t}else if(Array.isArray(t))if(typeof t[0]!="object"){let o=v(e);if(!o)return;r=o,n=t[0],i=t[1]}else[r,n,i]=t;P.bind(s,r,n,i)};var Z=(s,t,e)=>{q(s,e.state,t,e)};var Xt=s=>(t,e)=>{let[r,n,i="active"]=s,o=t===n?i:"";e.dataset[r]=o},Zt=(s,t,e)=>{if(!t)return;let r=t.length-1,n=t[r],i=t.slice(0,r);i.push(Xt(n)),_(s,i,e)},te=(s,t,e)=>{if(!t)return;let r=t.length-1,n=t[r],i=t.slice(0,r);i.push(Xt(n)),Z(s,i,e)};var ee=(s,t,e)=>{let r,n,i,o;if(typeof t[0]=="string"||t.length<3){let c=v(e);if(!c)return;r=c,[n,i,o]=t}else[r,n,i,o]=t;let a=o!==!1,l=n+"[";P.watch(s,r,n,c=>{if(d.removeAll(s),!c||c.length<1)return;let h=[];for(let u=0,g=c.length;u<g;u++){let m=a?r.scope(l+u+"]"):null,U=i(c[u],u,m,h);U!==null&&h.push(U)}return d.build(h,s,e)})};var re=(s,t,e)=>{let r=t[0];if(!r||r.length<1)return;let n=t[1],i=[];for(let o=0,a=r.length;o<a;o++){let l=r[o];if(!l)continue;let c=n(l,o);c!==null&&i.push(c)}d.build(i,s,e)};var se=(s,t,e)=>{t(s,e)};p.addType("destroyed",s=>{if(!s)return!1;s.callBack(s.ele,s.parent)});var ne=(s,t,e)=>{sr(s,t,e)},sr=(s,t,e)=>{p.add(s,"destroyed",{ele:s,callBack:t,parent:e})};var ie=(s,t,e)=>{if(t)if(Array.isArray(t)&&typeof t[0]!="string")for(let r=0,n=t.length;r<n;r++)R.setup(s,t[r],e);else R.setup(s,t,e)};p.addType("routes",s=>{if(!s)return!1;let t=s.route;t&&C.removeRoute(t)});var ae=(s,t,e)=>{if(t)if(Array.isArray(t))for(let r=0,n=t.length;r<n;r++){let i=t[r];i&&oe(s,i,e)}else oe(s,t,e)},oe=(s,t,e)=>{t.container=s,t.parent=e;let r=C.add(t);nr(s,r)},nr=(s,t)=>{p.add(s,"routes",{route:t})};var ce=(s,t,e)=>{};p.addType("switch",s=>{if(!s)return!1;let t=s.id;C.removeSwitch(t)});var le=(s,t,e)=>{let r=t[0];for(let i=0,o=t.length;i<o;i++){let a=t[i];a&&(a.container=s,a.parent=e)}let n=C.addSwitch(t);ir(s,n)},ir=(s,t)=>{p.add(s,"switch",{id:t})};M.add("cache",Qt).add("onCreated",se).add("onDestroyed",ne).add("bind",Vt).add("data",Ft).add("state",ce).add("onSet",_).add("onState",Z).add("animateIn",Bt).add("animateOut",_t).add("watch",ie).add("useParent",zt).add("useData",$t).add("useState",Jt).add("getId",jt).add("addState",Yt).add("addEvent",Kt).add("map",re).add("for",ee).add("useContext",Wt).add("addContext",Gt).add("context",qt).add("role",Ht).add("aria",Lt).add("route",ae).add("debug",Nt).add("dataSet",Zt).add("dataStateSet",te).add("switch",le);export{M as a,W as b,x as c,gt as d,E as e,d as f,Ct as g,ot as h,it as i,C as j};
2
- //# sourceMappingURL=chunk-K7USFO4X.js.map
@@ -1,2 +0,0 @@
1
- import{i as g}from"./chunk-NU5QKZAD.js";var i=class extends g{setup(){this.stage={}}addAction(t,e){return typeof e<"u"&&this.set(t,e),this}getState(t){return this.get(t)}removeAction(t,e){if(e)return this.off(t,e),this;let s=this.stage;return typeof s[t]<"u"&&delete s[t],this}};var n=class extends i{constructor(t){super(),this.id=t}setup(){this.stage={},this.id=""}};var h=class{static targets=new Map;static ownerCounts=new Map;static restore(t,e){this.targets.set(t,e),this.addOwner(t)}static getTarget(t){return this.targets.has(t)||this.targets.set(t,new n(t)),this.targets.get(t)}static attach(t){let e=this.getTarget(t);return this.addOwner(t),e}static addOwner(t){this.ownerCounts.set(t,(this.ownerCounts.get(t)||0)+1)}static detach(t){let e=this.ownerCounts.get(t);if(e===void 0)return;if(e>1){this.ownerCounts.set(t,e-1);return}this.ownerCounts.delete(t);let s=this.targets.get(t);s&&(s.remove(),this.targets.delete(t))}static getActionState(t,e){return this.getTarget(t).get(e)}static add(t,e,s){let r=this.getTarget(t);return e&&r.addAction(e,s),r}static addAction(t,e,s){return this.add(t,e,s)}static removeAction(t,e,s){if(s){this.off(t,e,s);return}let r=this.getTarget(t);r&&e&&r.removeAction(e)}static on(t,e,s){let r=this.getTarget(t);return e?r.on(e,s):null}static off(t,e,s){this.remove(t,e,s)}static remove(t,e,s){let r=this.targets,o=r.get(t);if(o){if(e){o.off(e,s);return}this.targets.delete(t),this.ownerCounts.delete(t)}}static set(t,e,s){this.getTarget(t).set(e,s)}};export{i as a,h as b};
2
- //# sourceMappingURL=chunk-KJTST4FO.js.map
@@ -1,2 +0,0 @@
1
- import{b as I}from"./chunk-IAPRMNTT.js";import{a as ft,b as pt,c as mt,d as v,e as y,f as R}from"./chunk-WGCUX2GL.js";import{a as H,b as ht}from"./chunk-PDIOOIMW.js";import{a as ut,c as P,d as dt,f as L}from"./chunk-NMWVJDVT.js";import{b as p,c as f}from"./chunk-R5DHGQZV.js";var M={items:new Map,add(s,t){return this.items.set(s,t),this},get(s){return this.items.get(s)??null}};p.addType("components",s=>{if(!s)return;let t=s.component;!t||!t.isUnit||(t.persistToken&&t.parent&&t.parent.removePersistedChild(t.persistToken),t.rendered===!0&&(t.prepareDestroy(),t.cleanUpAfterDestroy()))});var de=0,G=class{constructor(t,e,r){this.isUnit=!0,this.data=null,this.persist=null,this.nest=null,this.state=null,this.panel=null,this.parent=null,this.unitType=null,this._classId,this.id="",this.cached=[],this.init();let n,i;if(t==null)n={},i=[];else{let o=typeof t;o==="string"||o==="number"?(n={},i=[{tag:"text",textContent:t}]):Array.isArray(t)?(n={},i=t):(n=t||{},i=typeof e=="string"?[{tag:"text",textContent:e}]:e)}this.setupProps(n),this.children=i||[],this.persistedChildren={},this.persistedCount=0,this.onCreated(),this.rendered=!1,this.container=null}init(){this.id="cp-"+de++,this.unitType=this._classId||this.constructor.name.toLowerCase()}declareProps(){}addPersistedChild(t){let e=t.key,r=t.cache,n;r!=null&&e!=null?n="pk:"+r+":"+e:r!=null?n="pk:"+r:e!=null?n="pk:"+e:n="pc"+this.persistedCount++;let i=this.persistedChildren[n];return i&&t.unitType===i.unitType&&t.resumeScope(i),t.persistToken=n,this.persistedChildren[n]=t,n}removePersistedChild(t){this.rendered&&(!t||!this.persistedChildren[t]||delete this.persistedChildren[t])}setupProps(t){if(this.declareProps(),!(!t||typeof t!="object"))for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this[e]=t[e],e==="data"&&(this._externalData=!0))}getChildScope(){return this}getParentContext(){return this.parent?this.parent.getContext():null}setupContext(){if(this._contextResumed)return;let t=this.getParentContext(),e=this.setContext(t);if(e){this.context=e;return}this.context=t,this.setupAddingContext()}setupAddingContext(){let t=this.context,e=this.addContext(t);if(!e)return;let r=e[0];r&&(this.addingContext=!0,this.contextBranchName=r,this.addContextBranch(r,e[1]))}addContextBranch(t,e){this.context??={},this.context[t]=e}setContext(t){return null}addContext(t){return null}removeContext(){this.addingContext&&this.removeContextBranch(this.contextBranchName)}removeContextBranch(t){t&&delete this.context[t]}getContext(){return this.context}onCreated(){}render(){return{}}_cacheRoot(t){return t&&(t.id||(t.id=this.getId()),t.cache="panel",t)}_createLayout(){return this.render()}prepareLayout(){let t=this._createLayout();return this._cacheRoot(t)}afterBuild(){p.add(this.panel,"components",{component:this}),this.rendered=!0,this.afterLayout()}afterLayout(){this.afterSetup()}if(t,e){return t?e||t:null}map(t,e){let r=[];if(!t||t.length<1)return r;for(let n=0,i=t.length;n<i;n++){let o=e(t[n],n);r.push(o)}return r}removeAll(t){return L.removeAll(t)}getId(t){let e=this.id;return typeof t=="string"&&(e+="-"+t),e}cacheEle(t,e){e&&(this[e]=t,this.cached.push(e))}initialize(){this.setupContext(),this.beforeSetup()}beforeSetup(){}afterSetup(){}setup(t){this.setContainer(t),this.initialize()}setContainer(t){this.container=t}_remove(){this.prepareDestroy(),this.removeContext();let t=this.panel;t&&L.removeElement(t),this.cleanUpAfterDestroy()}cleanUpAfterDestroy(){this.panel=null,this.container=null;let t=this.cached;for(let e=0,r=t.length;e<r;e++)this[t[e]]=null;this.cached=[],this.persist!==!0&&(this.persistedChildren={},this.persistToken=null)}prepareDestroy(){this.persistedCount=0,this.rendered=!1;try{this.beforeDestroy()}catch(t){console.error("Error in beforeDestroy:",t)}this.data&&typeof this.data.unlink=="function"&&this.data.unlink()}beforeDestroy(){}destroy(){this._remove()}};var A=class{static resume(t,e){if(t._externalData){this._resumeExternal(t,e);return}this._resumeOwned(t,e)}static refresh(t){let e=t.setData();e&&t.data&&t.data.set(e.stage),this.refreshContext(t)}static refreshContext(t){let e=t.context;if(!e||!e.data)return;let r=t.getParentContext();if(!r||!r.data)return;let n=r.data.stage,i=e.data.stage,o=null;for(let a in n){if(!Object.prototype.hasOwnProperty.call(n,a))continue;let l=n[a];l!==i[a]&&(o===null&&(o={}),o[a]=l)}o!==null&&(typeof e.data._silentSet=="function"?e.data._silentSet(o):e.data.set(o))}static _resumeExternal(t,e){let r=t.setData();if(!r){t.data=e;return}if(e&&e.stage){let n=e._retainState||r._retainState,i=!n&&(e._refreshState||r._refreshState),o=this._buildExternalUpdates(e.stage,r.stage,n,i);H.isEmpty(o)||r._silentSet(o)}typeof r.flushPending=="function"&&r.flushPending(),t.data=r}static _buildExternalUpdates(t,e,r,n){let i={};for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o))continue;if(n){Object.prototype.hasOwnProperty.call(e,o)||(i[o]=t[o]);continue}let a=t[o];!r&&a==null||a!==e[o]&&(i[o]=a)}return i}static _resumeOwned(t,e){if(!t.data){t.data=e;return}if(e&&e._retainState){t.data=e;return}if(e&&e.stage){let r=e._refreshState||t.data._refreshState,n=this._buildOwnedUpdates(e.stage,t.data.stage,r);H.isEmpty(n)||t.data._silentSet(n)}t.data&&typeof t.data.flushPending=="function"&&t.data.flushPending()}static _buildOwnedUpdates(t,e,r){let n={};for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;if(r){Object.prototype.hasOwnProperty.call(e,i)||(n[i]=t[i]);continue}let o=t[i];o!=null&&o!==e[i]&&(n[i]=o)}return n}};var W=class{constructor(){this.events=[]}addEvents(t){let e=t.length;if(!(e<1))for(let r=0;r<e;r++){let n=t[r];this.on(n[0],n[1],n[2],n[3])}}on(t,e,r,n){f.on(t,e,r,n),this.events.push({event:t,obj:e,callBack:r,capture:n})}off(t,e,r,n){f.off(t,e,r,n);let i,o=this.events;for(let a=0,l=o.length;a<l;a++)if(i=o[a],i.event===t&&i.obj===e&&i.callBack===r&&i.capture===n){o.splice(a,1);break}}set(){let t=this.events;for(let e=0,r=t.length;e<r;e++){let n=t[e];f.on(n.event,n.obj,n.callBack,n.capture)}}unset(){let t=this.events;for(let e=0,r=t.length;e<r;e++){let n=t[e];f.off(n.event,n.obj,n.callBack,n.capture)}}reset(){this.unset(),this.events=[]}};var F=class{constructor(t,e){this.remoteStates=[];let r=this.convertStates(e);this.addStatesToTarget(t,r)}addStates(t,e){let r=this.convertStates(e);this.addStatesToTarget(t,r)}createState(t,e,r,n){return{action:t,state:e,callBack:r,targetId:n,token:null}}convertStates(t){let e=[];for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;if(r==="remotes"){this.setupRemoteStates(t[r],e);continue}let n=null,i=null,o=t[r];o&&typeof o=="object"&&(i=o.callBack,n=o.id||o.targetId,o=o.state),e.push(this.createState(r,o,i,n))}return e}setupRemoteStates(t,e){for(let r=0,n=t.length;r<n;r++){let i=t[r];if(i)for(let o in i){if(!Object.prototype.hasOwnProperty.call(i,o)||o==="id")continue;let a=null,l=i[o],c=l!==null?l:void 0;c&&typeof c=="object"&&(a=c.callBack,c=c.state),e.push(this.createState(o,c,a,i.id))}}}removeRemoteStates(t){let e=this.remoteStates;e&&this.removeActions(t,e)}removeActions(t,e){if(!(e.length<1))for(let r=0,n=e.length;r<n;r++){let i=e[r];i.token&&this.unbindRemoteState(t,i.token),i.targetId&&I.remove(i.targetId,i.action,i.token)}}restore(t){I.restore(t.id,t);let e=this.remoteStates;if(e)for(let r=0,n=e.length;r<n;r++){let i=e[r];i.token=this.bindRemoteState(t,i.action,i.targetId)}}bindRemoteState(t,e,r){let n=I.getTarget(r);return t.link(n,e)}unbindRemoteState(t,e){t.unlink(e)}addStatesToTarget(t,e){let r=this.remoteStates;for(let n=0,i=e.length;n<i;n++){let o=e[n],a=this.addAction(t,o);o.targetId&&(o.token=a,r.push(o))}}addAction(t,e){let r,n=e.action,i=e.targetId;i&&(r=this.bindRemoteState(t,n,i)),typeof e.state<"u"&&t.addAction(n,e.state);let o=e.callBack;return typeof o=="function"&&t.on(n,o),r||null}};var x=class extends G{constructor(t,e,r){super(t,e,r),this.isComponent=!0,this.stateResumed=!1,this.stateTargetId=null,this._externalData=this._externalData??!1,this._setupData()}setData(){return null}_setupData(){if(this.data)return;let t=this.setData();t&&(this.data=t)}resumeScope(t){if(this._resumeData(t.data),this.state=t.state,this.stateHelper=t.stateHelper,this.persistedChildren=t.persistedChildren,t.context){let e=t.context.data;e&&e._refreshState===!0&&e._retainState!==!0||(this.context=t.context,this._contextResumed=!0)}this.id=t.id,this._refreshContextData()}_resumeData(t){A.resume(this,t)}_refreshData(){A.refresh(this)}_refreshContextData(){A.refreshContext(this)}initialize(){this.setupContext(),this.addStates(),this.beforeSetup()}afterLayout(){this.addEvents(),this.afterSetup()}setupStateTarget(t){let e=t||this.stateTargetId||this.id;this.state=I.getTarget(String(e))}setupStates(){return{}}addStates(){let t=this.state;if(t){this.stateResumed=!0,this.stateHelper.restore(t);return}let e=this.setupStates();H.isEmpty(e)||this.setStateHelper(e)}setStateHelper(t={}){this.state||(this.setupStateTarget(),this.stateHelper=new F(this.state??{},t))}addState(t){!this.stateHelper||this.stateResumed===!0||this.stateHelper.addStates(this.state,t)}removeStates(){let t=this.state;t&&(this.stateHelper.removeRemoteStates(t),t.remove(),this.stateResumed=!1)}onFlush(t){let e=this.data??this?.context?.data??null;e&&e.onFlush(t)}setEventHelper(){this.events||(this.events=new W)}setupEvents(){return[]}addEvents(){let t=this.setupEvents();t.length<1||(this.setEventHelper(),this.events&&this.events.addEvents(t))}removeEvents(){let t=this.events;t&&t.reset()}prepareDestroy(){this.persistedCount=0,this.rendered=!1;try{this.beforeDestroy()}catch(t){console.error("Error in beforeDestroy:",t)}this.removeEvents(),this.removeStates(),this.removeContext(),this.data&&this.persist!==!0&&this.data.unlink()}};var gt={created:"onCreated",setStates:"setupStates",state:"setupStates",events:"setupEvents",before:"beforeSetup",render:"render",after:"afterSetup",destroy:"beforeDestroy"};var fe=(s,t)=>typeof s!="function"&&t==="setupStates"?()=>s:s,tt=(s,t)=>{if(!s)return t;let e=Object.keys(s);for(let r=0,n=e.length;r<n;r++){let i=e[r],o=s[i],a=gt[i]||i;t[a]=fe(o,a)}return t},pe=s=>tt(s,{}),me=0,yt=(s,t)=>{class e extends s{}return Object.assign(e.prototype,t),e.prototype._classId="jot"+me++,e},E=(s,t=x)=>{s||(s={});let e,r=typeof s;return r==="object"&&s.render?(e=pe(s),yt(t,e)):(e={render:r==="function"?s:()=>s},yt(t,e))};var et=(s,t)=>({attr:s,directive:t});var S=(s,t)=>({key:s,value:t});var xt=(s,t,e,r)=>({tag:s,attr:t,directives:e,children:r});var St=null,ge=()=>St||(St=M.get("watch")),w=class{static getTag(t){return t.tag||"div"}static setupChildren(t){t.nest&&(t.children=t.nest,delete t.nest)}static setElementContent(t,e,r,n){return t==="text"?(n.push({tag:"text",textContent:e}),!0):t==="html"||t==="innerHTML"?(r.push(S("innerHTML",e)),!0):!1}static setTextAsWatcher(t,e,r){t.push(et(S(e,R.getWatcherSettings(r,dt(e))),ge()))}static setButtonType(t,e,r){if(t==="button"){let n=e.type||"button";r.push(S("type",n))}}static parse(t,e){let r=[],n=[],i=t.tag||"div";i==="button"&&r.push(S("type",t.type||"button"));let o=[],a,l;for(let c in t){if(!Object.prototype.hasOwnProperty.call(t,c)||c==="tag"||(a=t[c],a==null))continue;if(c==="children"||c==="nest"){if(Array.isArray(a))for(let u=0;u<a.length;u++)o.push(a[u]);else o.push(a);continue}if((l=M.get(c))!==null){n.push(et(S(c,a),l));continue}let h=typeof a;if(h==="object"){if(R.isWatching(a)){this.setTextAsWatcher(n,c,a);continue}o.push(a);continue}if(h==="function"){let u=a,g=function(m){u.call(this,m,e)};g.originalCallback=u,r.push(S(c,g));continue}if(h==="string"&&a.includes("[[")){this.setTextAsWatcher(n,c,a);continue}if(c==="text"){o.push({tag:"text",textContent:a});continue}if(c==="html"||c==="innerHTML"){r.push(S("innerHTML",a));continue}r.push(S(c,a))}return xt(i,r,n,o)}};var D=class{build(t,e,r){}setupComponent(t,e,r){let n=r?.getChildScope();t.parent=n,n&&n.persist===!0&&t.persist!==!1&&(t.persist=!0,t.parent.addPersistedChild(t)),t.cache&&n&&(n[t.cache]=t),t.setup(e)}buildComponent(t){let e=t.prepareLayout(),r=this.build(e,t.container,t);return t.afterBuild(),t.component&&typeof t.onCreated=="function"&&t.onCreated(t),r}createComponent(t,e,r){return this.setupComponent(t,e,r),this.buildComponent(t),t}setDirectives(t,e,r){}removeNode(t){}removeAll(t){}};var ye=s=>{for(let e in s)if(e!=="tag"&&e!=="textContent")return!1;let t=s.textContent;return typeof t=="string"?t.indexOf("[[")===-1:typeof t!="object"},N=class extends D{build(t,e,r){let n=y.createDocFragment();if(Array.isArray(t))for(let i=0,o=t.length;i<o;i++)this.buildElement(t[i],n,r);else this.buildElement(t,n,r);return e&&typeof e=="object"&&e.appendChild(n),n}buildElement(t,e,r){if(t){if(t.isUnit===!0){this.createComponent(t,e,r);return}this.createElement(t,e,r)}}createElement(t,e,r){if(t.tag==="text"&&ye(t)){let c=t.textContent;y.createText(c??"",e);return}let n=r?.getChildScope();if(t.data||t.state){this.createTempComponent(t,e,n);return}let i=w.parse(t,n),o=this.createNode(i,e,n);this.cache(o,t.cache,r);let a=i.children;for(let c=0,h=a.length;c<h;c++){let u=a[c];u!==null&&this.buildElement(u,o,r)}let l=i.directives;l.length&&this.setDirectives(o,l,n)}createTempComponent(t,e,r){let n={cache:t.cache,key:t.key,persist:t.persist,_externalData:!0,setData:()=>t.data,...tt(t.methods||{},{}),render(){return{...t,data:null,state:null,methods:null,key:null,persist:null}}};t.state&&(n.setupStateTarget=function(o){this.state=t.state});let i=new x(n);this.createComponent(i,e,r)}setDirectives(t,e,r){for(let n=0,i=e.length;n<i;n++)this.handleDirective(t,e[n],r)}handleDirective(t,e,r){e.directive(t,e.attr.value,r)}cache(t,e,r){r&&e&&r.cacheEle(t,e)}createNode(t,e,r){let n=t.tag;if(n==="text"){let i=t.attr[0],o=i?i.value:"";return y.createText(o,e)}else if(n==="comment"){let i=t.attr[0],o=i?i.value:"";return y.createComment(o,e)}return y.create(n,t.attr,e,r)}removeNode(t){y.removeElement(t)}removeAll(t){y.removeAll(t)}};var xe=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source"]),Se=/[&<>"]/,rt=s=>{let t=typeof s=="string"?s:String(s);return Se.test(t)?t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):t},O=class{static create(t,e=[],r=""){let n="",i="";for(let o=0,a=e.length;o<a;o++){let l=e[o],c=l.key,h=l.value;if(c==="text"||c==="textContent"){n+=rt(h);continue}if(c==="html"||c==="innerHTML"){n+=h;continue}if(typeof h=="function")continue;let u=c+'="'+rt(h)+'"';i?i+=" "+u:i=u}return xe.has(t)?"<"+t+" "+i+" />":"<"+t+" "+i+">"+n+r+"</"+t+">"}static createText(t){return rt(t)}static createComment(t){return"<!-- "+t+" -->"}};var Q=class extends D{build(t,e,r){if(Array.isArray(t)){let n="";for(let i=0,o=t.length;i<o;i++)n+=this.buildElement(t[i],r);return n}return this.buildElement(t,r)}createComponent(t,e,r){return this.setupComponent(t,e,r),this.buildComponent(t)}buildElement(t,e){return t?t.isUnit===!0?this.createComponent(t,{},e):this.createElement(t,e):""}createElement(t,e){let r=w.parse(t,e),n=r.children,i="";for(let o=0,a=n.length;o<a;o++){let l=n[o];l!==null&&(i+=this.buildElement(l,e))}return this.createNode(r,i)}createNode(t,e){let r=t.tag;if(r==="text"){let n=t.attr[0],i=n?n.value:"";return O.createText(i)}else if(r==="comment"){let n=t.attr[0],i=n?n.value:"";return O.createComment(i)}return O.create(r,t.attr,e)}removeAll(t){}};var z=class{static browserIsSupported(){return typeof window<"u"&&typeof document=="object"}static setup(){return this.browserIsSupported()?new N:new Q}};var k=z.setup(),we=s=>typeof s=="object"&&s.isUnit===!0,Ce=s=>{let t=E(s);return t?new t:null},d=class{static render(t,e,r){return!t||(we(t)||(t=Ce(t)),!t)?null:k.createComponent(t,e,r)}static build(t,e,r){return k.build(t,e,r)}static rebuild(t,e,r){return k.removeAll(e),this.build(t,e,r)}static setDirectives(t,e,r){k.setDirectives(t,e,r)}static createNode(t,e,r){return k.createNode(t,e,r)}static removeNode(t){k.removeNode(t)}static removeAll(t){k.removeAll(t)}};ht.augment({buildLayout(s,t,e){d.build(s,t,e)}});var st=[],ve=s=>st.indexOf(s)!==-1,ke=s=>({tag:"script",src:s.src,async:!1,load(t){st.push(s.src);let e=s.load;e&&e()}}),Te=s=>({tag:"link",rel:"stylesheet",type:"text/css",href:s.src,load(t){st.push(s.src);let e=s.load;e&&e()}}),j=class{constructor(t){this.percent=0,this.loaded=0,this.total=0,this.callBack=t||null}add(t){this.total++;let e,r=this.update.bind(this);t.indexOf(".css")!==-1?e=Te({load:r,src:t}):e=ke({load:r,src:t}),d.build(e,document.head)}addFiles(t){t&&t.forEach(e=>{ve(e)||this.add(e)})}update(){if(this.updateProgress()<100)return;let e=this.callBack;e&&e()}updateProgress(){return++this.loaded,this.percent=Math.floor(this.loaded/this.total*100)}};var be=s=>s?typeof s?.prototype?.constructor=="function":!1,T=class{static process(t,e){let r=t.default;return r?e.callback?e.callback(r):(be(r)?r=new r:r=r(),r.isUnit===!0&&(r.route=e.route,e.persist&&(r.persist=!0)),r):null}static render(t,e,r){let n=d.build(t,null,r),i=n.firstChild||t?.panel;return e.after(n),i}};var $=class{static load(t,e,r){return t.then(n=>(e&&e(n),n)).catch(n=>{console.error("Error loading module:",n),r&&r(n)})}};var Pe=s=>({tag:"comment",textContent:"import placeholder",onCreated:s.onCreated}),b=new Map,Re=s=>{if(b.has(s)){let r=b.get(s);return r&&typeof r.then!="function"?Promise.resolve(r):r}let t=typeof s,e;if(t==="string")e=import(s);else if(t==="function")e=s();else return s;return e.then(r=>{b.set(s,r)}).catch(()=>{b.delete(s)}),b.set(s,e),e},Ie=s=>{if(!b.has(s))return null;let t=b.get(s);return t&&typeof t.then=="function"?null:t||null},wt=E({declareProps(){this.loaded=!1,this.errorRoot=null,this.generation=0},render(){return Pe({onCreated:s=>{if(this.src){if(this.layout){this.layoutRoot=T.render(this.layout,this.panel,this.parent);return}if(this.depends){new j(()=>{this.loadAndRender(s)}).addFiles(this.depends);return}this.loadAndRender(s)}}})},loadAndRender(s){let t=this.generation,e=Ie(this.src);if(e){this.renderModule(s,e);return}$.load(Re(this.src),r=>{t===this.generation&&this.renderModule(s,r)},r=>{t===this.generation&&(this.loaded=!1,this.renderError(s,r))})},renderError(s,t){let e=()=>this.retry(s),r=this.fallback,n=typeof r=="function"?r(t,e):r||{class:"base-import-error",children:[{tag:"span",text:"Failed to load content."},{tag:"button",type:"button",text:"Retry",click:e}]};n&&(this.errorRoot=T.render(n,s,this.parent))},retry(s){this.removeErrorLayout(),this.loadAndRender(s)},removeErrorLayout(){this.errorRoot&&(d.removeNode(this.errorRoot),this.errorRoot=null)},renderModule(s,t){this.loaded=!0;let e=this.layout||T.process(t,{callback:this.callback,route:this.route,persist:this.persist});this.layout=e,this.layoutRoot=T.render(e,s,this.parent)},shouldUpdate(s){return this.updateLayout===!0?!0:this.updateLayout=s&&s.isUnit&&typeof s.update=="function"},updateModuleLayout(s){let t=this.layout;this.shouldUpdate(t)&&t&&t.update(s)},update(s){this.loaded===!0&&this.updateModuleLayout(s)},destroy(){this.generation++,this.removeErrorLayout(),this.layoutRoot&&(d.removeNode(this.layoutRoot),this.persist!==!0&&(this.layoutRoot=null,this.layout=null,this.loaded=!1,this.updateLayout=!1))}});var Ct=s=>{let t=typeof s;return(t==="string"||t==="function"||s instanceof Promise)&&(s={src:s}),new wt(s)};var Ae=0,B=class{constructor(t){this.router=t,this.locationId="base-app-router-"+Ae++,this.callBack=this.check.bind(this)}setup(){return this.addEvent(),this}check(t){}getScrollPosition(){return{x:window.scrollX,y:window.scrollY}}scrollTo(t){window.scrollTo(t.x,t.y)}addEvent(){return this}};var kt=typeof navigator<"u"&&/iPad|iPhone|iPod/.test(navigator.userAgent||"")&&!window.MSStream,vt=()=>{kt&&requestAnimationFrame(()=>requestAnimationFrame(()=>{let s=window.scrollX,t=window.scrollY;window.scrollTo(0,t+1),document.documentElement.offsetHeight,window.scrollTo(s,t)}))},J=class extends B{addEvent(){return f.on("popstate",window,this.callBack),kt&&(this.pageShowCallBack=this.onPageShow.bind(this),f.on("pageshow",window,this.pageShowCallBack)),this}removeEvent(){return f.off("popstate",window,this.callBack),this.pageShowCallBack&&f.off("pageshow",window,this.pageShowCallBack),this}onPageShow(t){t.persisted&&vt()}check(t){let e=t.state;if(!e||e.location!==this.locationId)return!1;t.preventDefault(),t.stopPropagation(),this.router.checkActiveRoutes(e.uri);let r=e.scrollPosition;r&&this.scrollTo(r),vt()}createState(t,e={}){let r=this.getScrollPosition();return e=e===null?{}:e,{location:this.locationId,...e,scrollPosition:r,uri:t}}addState(t,e,r=!1){let n=window.history,i=n.state;if(i&&i.uri===t)return this;!r&&i&&i.location===this.locationId&&(i.scrollPosition=this.getScrollPosition(),n.replaceState(i,"",window.location.href));let o=this.createState(t,e);return r||(o.scrollPosition={x:0,y:0}),n[r===!1?"pushState":"replaceState"](o,null,t),this}};var Y=class extends B{addEvent(){return f.on("hashchange",window,this.callBack),this}removeEvent(){return f.off("hashchange",window,this.callBack),this}check(t){this.router.checkActiveRoutes(t.newURL)}addState(t,e,r){return window.location.hash=t,this}};var K=class{static browserIsSupported(){return typeof window=="object"&&"history"in window&&"pushState"in window.history}static setup(t){return this.browserIsSupported()?new J(t).setup():new Y(t).setup()}};var nt=class extends x{getChildScope(){return this.parent}},Tt=s=>E(s,nt);var V=class{constructor(t,e){this.route=t,this.template=e.component,this.component=null,this.hasTemplate=!1,this.setup=!1,this.container=e.container,this.persist=e.persist,this.parent=e.parent}focus(t){this.setup===!1&&(this.route&&typeof this.route.flushPending=="function"&&this.route.flushPending(),this.create()),this.update(t)}setupTemplate(){let e=typeof this.template;e==="function"?this.initializeComponent():e==="object"&&this.initializeTemplateObject(),this.hasTemplate=!0}initializeComponent(){this.template=this.template(),this.initializeTemplateObject()}transferSettings(t){this.persist=this.persist&&t.persist!==!1,Object.assign(t,{route:this.route,persist:this.persist}),this.component=t}initializeTemplateObject(){let t=this.template;if(!t)return;t.isUnit||(this.template=new(Tt(t)));let e=this.template;this.transferSettings(e)}create(){if(this.setupTemplate(),!this.hasTemplate)return;this.setup=!0;let t=this.component;d.render(t,this.container,this.parent)}remove(){if(this.setup!==!0)return;this.setup=!1;let t=this.component;t&&(typeof t.destroy=="function"&&t.destroy(),this.component=null)}update(t){let e=this.component;e&&typeof e.update=="function"&&e.update(t)}};var bt=s=>{if(!s.length)return null;let t={};for(let e=0,r=s.length;e<r;e++)t[s[e]]=null;return t},Pt=s=>{let t=[];if(!s)return t;let e=/[*?]/g;s=s.replace(e,"");let r=/:(.[^./?&($]+)\?*/g,n=s.match(r);if(n===null)return t;for(let i=0,o=n.length;i<o;i++){let a=n[i];a&&t.push(a.replace(":",""))}return t};var Ee=/(\/):[^/(]*?\?/g,De=/\//g,Oe=/(\?\/+\*?)/g,Be=/(:[^/?&($]+)/g,_e=/(\*)/g,Ue=s=>s.replace(Ee,t=>t.replace(De,"(?:$|/)")),He=s=>(s=s.replace(Oe,"?/*"),s.replace(Be,t=>t.indexOf(".")<0?"([^/|?]+)":"([^/|?]+.*)")),Le=s=>s.replace(_e,".*"),Me=(s,t)=>s+=t[t.length-1]==="*"?"":"$",Rt=s=>{if(!s)return"";let t=s;return t=Ue(t),t=He(t),t=Le(t),t=Me(t,s),t};var qe=0,It=(s,t="")=>{let e=s||"",r=typeof t=="string"&&t?t:e,n=null,i=[],o=r.match(/#\{([^}]+)\}/);o&&o[1]&&(n=o[1].trim(),r=r.replace(o[0],""),e=e.replace(o[0],""));let a=r.indexOf("?");if(a>-1){let h=r.substring(a+1);if(h.indexOf("=")>-1){let u=h.split("&");for(let m=0,U=u.length;m<U;m++){let ct=u[m];if(!ct)continue;let[he,ue=""]=ct.split("="),lt=(he||"").trim();lt&&i.push({key:lt,value:(ue||"").trim()})}r=r.substring(0,a);let g=e.indexOf("?");g>-1&&(e=e.substring(0,g))}}let l=n!==null||i.length>0;return l&&!r&&(e="*"),{uriPath:e,requiredHash:n,requiredQuery:i,hasConditions:l}},Ge=s=>{if(!s)return"";let t=s.indexOf("?"),e=s.indexOf("#"),r=s.length;return t>-1&&(r=t),e>-1&&e<r&&(r=e),s.substring(0,r)},We=s=>{if(!s)return"";let t=s.indexOf("#");return t===-1?"":s.substring(t+1)},Fe=s=>{if(!s)return"";let t=s.indexOf("?");if(t===-1)return"";let e=s.indexOf("#",t);return e===-1?s.substring(t+1):s.substring(t+1,e)},X=class extends pt{constructor(t,e){let r=t.baseUri,i=It(r,t.rawUri).uriPath,o=Pt(i),a=bt(o),l=super(a);return this.uri=r,this.matchUri=i,this.paramKeys=o,this.titleCallBack=e,this.setupRoute(t),this.set("active",!1),l}setup(){this.stage={},this.routeId=null,this.uri=null,this.rawUri=null,this.matchUri="",this.uriQuery=/$^/,this.controller=null,this.paramKeys=[],this.requiredHash=null,this.requiredQuery=[],this.hasConditions=!1,this.titleCallBack=()=>{},this.path=null,this.referralPath=null,this.params=null,this.callBack=null,this.title=null,this.preventScroll=!1,this.scrollTo=null}setupRoute(t){this.routeId=t.id||"bs-rte-"+qe++,this.rawUri=t.rawUri||null,this.path=null,this.referralPath=null;let e=It(this.uri,this.rawUri||"");this.matchUri=e.uriPath,this.requiredHash=e.requiredHash,this.requiredQuery=e.requiredQuery,this.hasConditions=e.hasConditions;let r=Rt(this.matchUri);this.uriQuery=new RegExp("^"+r),this.params=null,this.setupComponentHelper(t),this.callBack=t.callBack,this.title=t.title,this.preventScroll=t.preventScroll||!1,this.scrollTo=t.scrollTo||null}setTitle(t){this.title=t,this.titleCallBack(this,t)}deactivate(){this.set("active",!1);let t=this.controller;t&&t.remove()}getLayout(t){if(t.component)return t.component;let e=t.import;return e?Ct(e):null}setupComponentHelper(t){let e=this.getLayout(t);if(!e)return;let{container:r,persist:n,parent:i}=t,o={component:e,container:r,persist:n,parent:i},a=ft(this);this.controller=new V(a,o)}resumeRoute(t){let e=this.controller;e&&(e.container=t)}setPath(t,e){this.path=t,this.referralPath=e}select(){this.set("active",!0);let t=this.stage,e=this.callBack;typeof e=="function"&&e(t);let r=this.controller;r&&r.focus(t);let n=this.path;if(!n)return;let i=n.split("#")[1];i&&this.scrollToId(i)}scrollToId(t){if(!t)return;let e=document.getElementById(t);e&&e.scrollIntoView(!0)}match(t){let e=!1,r=Ge(t),n=this.uriQuery||/$^/,i=r.match(n);return i===null?(this.resetParams(),e):Array.isArray(i)?this.matchConditions(t)?(this.setParams(i,1),e=i,e):(this.resetParams(),!1):e}matchConditions(t){if(!this.hasConditions)return!0;if(this.requiredHash!==null&&We(t)!==this.requiredHash)return!1;let e=this.requiredQuery||[];if(e.length>0){let r=Fe(t);if(!r)return!1;let n=new URLSearchParams(r);for(let i=0,o=e.length;i<o;i++){let a=e[i];if(!n.has(a.key)||n.get(a.key)!==a.value)return!1}}return!0}resetParams(){this.stage={}}setParams(t,e=0){if(!Array.isArray(t))return;let r=this.paramKeys;if(!r)return;let n={};for(let i=0,o=r.length;i<o;i++){let a=r[i];typeof a<"u"&&(n[a]=t[i+e])}this.set(n)}getParams(){return this.stage}};var Ne=s=>{let t=/\w\S*/;return s.replace(t,e=>e.charAt(0).toUpperCase()+e.substring(1).toLowerCase())},Qe=s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),ze=(s,t)=>{if(s.indexOf(":")===-1)return s;let e=t.stage;for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){let n=new RegExp(":"+Qe(r),"gi");s=s.replace(n,()=>e[r])}return s},je=(s,t)=>t&&(typeof t=="function"&&(t=t(s.stage)),t=ze(t,s),Ne(t)),$e=(s,t)=>(t!==""&&(s+=" - "+t),s),At=(s,t,e)=>t&&(t=je(s,t),$e(t,e));var Et={removeSlashes(s){return typeof s!="string"?"":(s[0]==="/"&&(s=s.substring(1)),s[s.length-1]==="/"&&(s=s.substring(0,s.length-1)),s)}};var Je=()=>typeof window<"u"?window.location:{},it=class{constructor(){this.version="1.0.2",this.baseURI="/",this.title="",this.lastPath=null,this.path=null,this.lastMatchedRoute=null,this.lastScrollGroup=null,this.currentGroupId=null,this.scrollWaitToken=0,this.history=null,this.callBackLink=null,this.location=Je(),this.routes=[],this.switches=new Map,this.switchCount=0,this.data=new mt({path:""})}setupHistory(){this.history=K.setup(this)}createRoute(t){let e=t.uri||"*";return t.rawUri=e,t.baseUri=this.createURI(e),new X(t,this.updateTitle.bind(this))}add(t){if(typeof t!="object"){let r=arguments;t={uri:r[0],component:r[1],callBack:r[2],title:r[3],id:r[4],container:r[5]}}let e=this.createRoute(t);return this.addRoute(e),e}addRoute(t){this.routes.push(t),this.checkRoute(t,this.getPath())}resume(t,e){t.resumeRoute(e),this.addRoute(t)}getBasePath(){if(!this.basePath){let t=this.baseURI||"";t[t.length-1]!=="/"&&(t+="/"),this.basePath=t}return this.basePath}createURI(t){let e=this.getBasePath(),r=Et.removeSlashes(t);return r=r.replace(/^(?:\.\/)+/,""),r==="."&&(r=""),e+r}getRoute(t){let e=this.routes,r=e.length;if(r>0)for(let n=0;n<r;n++){let i=e[n];if(i.uri===t)return i}return null}getRouteById(t){let e=this.routes,r=e.length;if(r>0)for(let n=0;n<r;n++){let i=e[n];if(i.routeId===t)return i}return!1}removeRoute(t){let e=this.routes,r=e.indexOf(t);r>-1&&e.splice(r,1),this.lastMatchedRoute===t&&(this.lastMatchedRoute=null)}addSwitch(t){let e=this.switchCount++,r=this.getSwitchGroup(e);for(let n=0,i=t.length;n<i;n++){let o=t[n];if(!o)continue;let a=this.createRoute(o);r.push(a)}return this.checkGroupForRegistration(e,r),e}resumeSwitch(t,e){let r=this.switchCount++,n=this.getSwitchGroup(r);for(let i=0,o=t.length;i<o;i++){let l=t[i].component.route;l.resumeRoute(e),n.push(l)}return this.checkGroupForRegistration(r,n),r}checkGroupForRegistration(t,e){let r=this.scrollIntent,n=this.currentGroupId;this.scrollIntent=null,this.currentGroupId=t,this.checkGroup(e,this.getPath()),this.currentGroupId=n;let i=this.scrollIntent;i&&i.type==="target"&&i.groupId!==null&&i.groupId!==void 0&&(this.lastScrollGroup=i.groupId),this.scrollIntent=r}getSwitchGroup(t){let e=this.switches.get(t);if(e)return e;let r=[];return this.switches.set(t,r),r}removeSwitch(t){this.switches.delete(t)}remove(t){t=this.createURI(t);let e=this.getRoute(t);return e&&this.removeRoute(e),this}setup(t,e){this.baseURI=t||"/",this.updateBaseTag(this.baseURI),this.title=typeof e<"u"?e:"",this.setupHistory(),this.data.path=this.getPath(),this.callBackLink=this.checkLink.bind(this),f.on("click",document,this.callBackLink);let r=this.getEndPoint();return this.navigate(r,null,!0),this}updateBaseTag(t){let e=document.getElementsByTagName("base");e.length&&(e[0].href=t)}getParentLink(t){return t.closest("a")}checkLink(t){if(t.ctrlKey===!0)return!0;let e=t.target.closest("a");if(!e||e.target==="_blank"||e.dataset.cancelRoute)return!0;let r=e.getAttribute("href");if(r!==null){let n=this.baseURI,i=n!=="/"?r.replace(n,""):r,o=e.dataset.replace==="true";return this.navigate(i,null,o),t.preventDefault(),t.stopPropagation(),!1}}reset(){let t=this.routes;for(let e=0,r=t.length;e<r;e++){let n=t[e];n&&typeof n.deactivate=="function"&&n.deactivate()}return this.routes=[],this.switches=new Map,this.switchCount=0,this.lastMatchedRoute=null,this}activate(){return this.checkActiveRoutes(),this}navigate(t,e,r){return t=this.createURI(t),this.history.addState(t,e,r),this.updatePath(),this.activate(),this}updatePath(){let t=this.getPath();this.data.path=t}updateTitle(t){if(!t||!t.title)return this;let e=t.title;return document.title=At(t,e,this.title),this}checkActiveRoutes(t){if(this.lastPath=this.path,t=t||this.getPath(),this.path=t,this.updatePath(),this.scrollIntent=null,this.scrollWaitToken++,this.lastMatchedRoute&&this.check(this.lastMatchedRoute,t))this.select(this.lastMatchedRoute);else{let e=this.routes,r=e.length;for(let n=0;n<r;n++){let i=e[n];typeof i>"u"||this.checkRoute(i,t)}}this.checkSwitches(t),this.applyScrollIntent()}checkSwitches(t){let e=this.switches;for(let[r,n]of e.entries())this.currentGroupId=r,this.checkGroup(n,t);this.currentGroupId=null}checkGroup(t,e){let r=t.length;if(!r)return;let n=null;for(let a=0;a<r;a++)if(t[a].get("active")){n=t[a];break}let i=!1;n&&(i=n.match(e)!==!1);let o;for(let a=0;a<r;a++){let l=t[a];if(typeof l>"u")continue;(l===n?i:l.match(e))!==!1&&o===void 0&&l.controller&&(o=l)}if(!o){n&&n!==t[0]&&n.deactivate(),this.select(t[0],!0);return}this.select(o),n&&n!==o&&n.deactivate();for(let a=0;a<r;a++){let l=t[a];l&&l!==o&&l!==n&&l.deactivate()}}checkRoute(t,e){let r=this.check(t,e);return r!==!1?(this.select(t),this.lastMatchedRoute=t):t.deactivate(),r}check(t,e){return t?(e=e||this.getPath(),t.match(e)!==!1):!1}select(t,e){t&&(t.setPath(this.path,this.lastPath),t.select(),this.updateTitle(t),e!==!0&&(t.scrollTo?this.scrollIntent={type:"target",selector:t.scrollTo,groupId:this.currentGroupId}:t.preventScroll!==!0&&!this.scrollIntent&&(this.scrollIntent={type:"top"})))}applyScrollIntent(){let t=this.scrollIntent;if(this.scrollIntent=null,!t)return;if(t.type==="top"){this.lastScrollGroup=null,this.checkToScroll(),this.reassertScrollTop();return}if(t.type!=="target")return;let e=t.groupId!==null&&t.groupId!==void 0,r=e&&this.lastScrollGroup===t.groupId;r||(typeof window<"u"&&window.scrollTo(0,0),this.reassertScrollTop()),this.lastScrollGroup=e?t.groupId:null,r&&this.scrollToTarget(t.selector)}reassertScrollTop(){if(typeof window>"u"||typeof requestAnimationFrame>"u")return;let t=++this.scrollWaitToken;requestAnimationFrame(()=>{t===this.scrollWaitToken&&(window.scrollY>0||window.pageYOffset>0)&&window.scrollTo(0,0)})}scrollToTarget(t){if(typeof t!="string"||typeof document>"u")return;let e=a=>{let l=window.getComputedStyle(a),c=l.position==="sticky",h;if(c){let m=a.style.position;a.style.position="static",h=a.getBoundingClientRect().top+window.scrollY,a.style.position=m}else h=a.getBoundingClientRect().top+window.scrollY;let u=c&&parseFloat(l.top)||0,g=h-u;window.scrollY>g&&window.scrollTo(0,g)};if(typeof requestAnimationFrame>"u"){let a=document.querySelector(t);a&&e(a);return}let r=++this.scrollWaitToken,n=30,i=0,o=()=>{if(r!==this.scrollWaitToken)return;let a=document.querySelector(t);if(a){e(a);return}++i<n&&requestAnimationFrame(o)};requestAnimationFrame(o)}checkToScroll(){this.shouldScrollToTop()&&window.scrollTo(0,0)}cleanPath(t){return t?t.split("?")[0].split("#")[0]:"/"}shouldScrollToTop(){let t=this.cleanPath(this.getPath()),r=this.cleanPath(this.lastPath).split("/"),n=t.split("/");if(r.length!==n.length)return!0;let i=r[r.length-1],o=n[n.length-1];return i!==o}getEndPoint(){return this.getPath().replace(this.baseURI,"")||"/"}destroy(){typeof this.callBackLink=="function"&&f.off("click",document,this.callBackLink)}getPath(){let t=this.location,e=this.path=t.pathname;return this.history.type==="hash"?t.hash.replace("#",""):e+t.search+t.hash}},C=new it;var Dt=(s,t)=>({attr:s,value:t}),Ye=(s,t)=>{if(!t.startsWith(s))return!1;let e=t[s.length];return e===void 0||e==="/"||e==="#"||e==="."||e==="?"},ot=class extends x{beforeSetup(){this.selectedClass=this.activeClass||"active"}render(){let t=this.href,e=this.text,r=this.setupWatchers(t,e);return{tag:"a",class:this.class||this.className||null,onState:["selected",{[this.selectedClass]:!0}],href:this.getString(t),text:this.getString(e),nest:this.nest||this.children,dataStateSet:this.dataSet,"data-replace":this.replace?"true":null,watch:r}}getLinkPath(){return this?.panel?.pathname||null}getString(t){let e=typeof t;return e!=="object"&&e!=="undefined"?t:null}setupWatchers(t,e){let r=this.exact===!0,n=C.data,i=[];t&&typeof t=="object"&&i.push(Dt("href",t)),e&&typeof e=="object"&&i.push(Dt("text",e));let o=null,a="",l="";return i.push({value:["[[path]]",n],callBack:(c,h)=>{if(typeof h.pathname>"u")return;let u=h.getAttribute("href");if(u!==o){o=u;let m=h.pathname+h.search+h.hash;a=m,l=h.hash||h.search?m:h.pathname}let g=r?c===a:Ye(l,c);this.update(g)}}),i}setupStates(){return{selected:!1}}update(t){this.state&&(this.state.selected=t)}};var Ot=(s,t,e=null)=>{if(!s)return;let r=null,n=!1,i=()=>{n||(n=!0,r&&(clearTimeout(r),r=null),f.off("animationend",s,o),s&&s.classList.remove(t),e&&e())},o=a=>{a.target===s&&i()};f.on("animationend",s,o),requestAnimationFrame(()=>{if(!s){i();return}s.classList.add(t);try{let a=window.getComputedStyle(s),l=parseFloat(a.animationDuration)*1e3||1e3,c=parseFloat(a.animationDelay)*1e3||0;r=setTimeout(i,l+c+100)}catch{r=setTimeout(i,1e3)}})},Bt=(s,t,e)=>{Ot(s,t)},_t=(s,t,e)=>{let r=()=>{s&&s.remove&&s.remove()};Ke(s,()=>Ot(s,t,r),e)};p.addType("manual-destroy",s=>{if(!s)return!1;s.callBack(s.ele,s.parent)});var Ke=(s,t,e)=>{p.add(s,"manual-destroy",{ele:s,callBack:t,parent:e})};var q=(s,t,e,r)=>{if(Array.isArray(e[0])){e.forEach(n=>{n&&q(s,t,n,r)});return}Ve(s,t,e,r)},Ve=(s,t,e,r)=>{let n,i;if(e.length<3?[n,i]=e:[t,n,i]=e,!t||!n)return;if(typeof t.on!="function"){console.warn('Watcher directive: Data source does not have an "on" method. Make sure your component has data, state, or context.data initialized before using watchers like onSet, watch, or [[prop]] syntax.',s,t);return}let o=Xe(s,n,i,r);P.watch(s,t,n,o)},Xe=(s,t,e,r)=>typeof e=="object"?n=>{er(s,e,n)}:n=>{tr(s,e,t,n,r)},Ut=new WeakSet,Ze=(s,t,e)=>{!s||!s.isUnit&&!s.isComponent||Ut.has(e)||Ut.add(e)},tr=(s,t,e,r,n)=>{let i=t(r,s,n);switch(typeof i){case"object":Ze(i,e,s),d.rebuild(i,s,n);break;case"string":let o=ut(s);if(o!=="textContent"){s.setAttribute(o,i);break}L.addHtml(s,i);break}},er=(s,t,e)=>{let r=Object.keys(t);for(let n=0,i=r.length;n<i;n++){let o=r[n];o&&(t[o]===e?s.classList.add(o):s.classList.remove(o))}};var _=(s,t,e)=>{let r=v(e);q(s,r,t,e)};var Ht=(s,t,e)=>{t&&s.setAttribute("role",t)},rr=s=>(t,e)=>{let r=t?"true":"false";e.setAttribute(s,r)},Lt=(s,t,e)=>{if(!t)return;let r=t.role;r&&(s.setAttribute("role",r),t.role=null);let n=Object.keys(t);for(let i=0,o=n.length;i<o;i++){let a=n[i],l=t[a];if(l===null)continue;let c="aria-"+a;if(Array.isArray(l)){let h=l.slice();h.push(rr(c)),_(s,h,e)}else s.setAttribute(c,l)}};var Mt=(s,t,e)=>{if(!t)return;let r=w.parse(t,e);y.addAttributes(s,r.attr,e),d.setDirectives(s,r.directives,e)};p.addType("context",s=>{if(!s)return!1;s.parent.removeContextBranch(s.branch)});var at=s=>s?s.getContext():null,qt=(s,t,e)=>{if(typeof t!="function")return;let r=at(e),n=t(r);Mt(s,n,e)},Gt=(s,t,e)=>{if(typeof t!="function")return;let r=at(e);t(r)},Wt=(s,t,e)=>{if(typeof t!="function"||!e)return;let r=at(e),n=t(r);n&&e.addContextBranch(n[0],n[1])};var Ft=(s,t,e)=>{};var Nt=(s,t,e)=>{if(!e)return;let r=e._layout?e._layout:e.render();console.log("Debug: ","ele: ",s),console.log("Data: ",t),console.log("Layout: ",r),console.log("parent: ",e)};var Qt=(s,t,e)=>{},zt=(s,t,e)=>{if(!t||!e)return;let r=t(e,s);r&&d.build(r,s,e)},jt=(s,t,e)=>{if(!t||!e)return;let r=e.getId(t);s.id=r},$t=(s,t,e)=>{if(!t||!e)return;let r=t(e.data,s);r&&d.build(r,s,e)},Jt=(s,t,e)=>{if(!t||!e)return;let r=t(e.state,s);r&&d.build(r,s,e)},Yt=(s,t,e)=>{if(!t||!e)return;let r=e.state,n=t(r);if(!e.state){e.setStateHelper(n);return}e.addState(n)},Kt=(s,t,e)=>{if(!(!t||!e)){if(e.events||e.setEventHelper(),t[2]){let r=t[2];t[2]=n=>{r(n,e)}}e.events.on(t[0],t[1],t[2],t[3])}};var Vt=(s,t,e)=>{let r,n,i;if(typeof t=="string"){if(r=v(e),!r)return;n=t}else if(Array.isArray(t))if(typeof t[0]!="object"){let o=v(e);if(!o)return;r=o,n=t[0],i=t[1]}else[r,n,i]=t;P.bind(s,r,n,i)};var Z=(s,t,e)=>{q(s,e.state,t,e)};var Xt=s=>(t,e)=>{let[r,n,i="active"]=s,o=t===n?i:"";e.dataset[r]=o},Zt=(s,t,e)=>{if(!t)return;let r=t.length-1,n=t[r],i=t.slice(0,r);i.push(Xt(n)),_(s,i,e)},te=(s,t,e)=>{if(!t)return;let r=t.length-1,n=t[r],i=t.slice(0,r);i.push(Xt(n)),Z(s,i,e)};var ee=(s,t,e)=>{let r,n,i,o;if(typeof t[0]=="string"||t.length<3){let c=v(e);if(!c)return;r=c,[n,i,o]=t}else[r,n,i,o]=t;let a=o!==!1,l=n+"[";P.watch(s,r,n,c=>{if(d.removeAll(s),!c||c.length<1)return;let h=[];for(let u=0,g=c.length;u<g;u++){let m=a?r.scope(l+u+"]"):null,U=i(c[u],u,m,h);U!==null&&h.push(U)}return d.build(h,s,e)})};var re=(s,t,e)=>{let r=t[0];if(!r||r.length<1)return;let n=t[1],i=[];for(let o=0,a=r.length;o<a;o++){let l=r[o];if(!l)continue;let c=n(l,o);c!==null&&i.push(c)}d.build(i,s,e)};var se=(s,t,e)=>{t(s,e)};p.addType("destroyed",s=>{if(!s)return!1;s.callBack(s.ele,s.parent)});var ne=(s,t,e)=>{sr(s,t,e)},sr=(s,t,e)=>{p.add(s,"destroyed",{ele:s,callBack:t,parent:e})};var ie=(s,t,e)=>{if(t)if(Array.isArray(t)&&typeof t[0]!="string")for(let r=0,n=t.length;r<n;r++)R.setup(s,t[r],e);else R.setup(s,t,e)};p.addType("routes",s=>{if(!s)return!1;let t=s.route;t&&C.removeRoute(t)});var ae=(s,t,e)=>{if(t)if(Array.isArray(t))for(let r=0,n=t.length;r<n;r++){let i=t[r];i&&oe(s,i,e)}else oe(s,t,e)},oe=(s,t,e)=>{t.container=s,t.parent=e;let r=C.add(t);nr(s,r)},nr=(s,t)=>{p.add(s,"routes",{route:t})};var ce=(s,t,e)=>{};p.addType("switch",s=>{if(!s)return!1;let t=s.id;C.removeSwitch(t)});var le=(s,t,e)=>{let r=t[0];for(let i=0,o=t.length;i<o;i++){let a=t[i];a&&(a.container=s,a.parent=e)}let n=C.addSwitch(t);ir(s,n)},ir=(s,t)=>{p.add(s,"switch",{id:t})};M.add("cache",Qt).add("onCreated",se).add("onDestroyed",ne).add("bind",Vt).add("data",Ft).add("state",ce).add("onSet",_).add("onState",Z).add("animateIn",Bt).add("animateOut",_t).add("watch",ie).add("useParent",zt).add("useData",$t).add("useState",Jt).add("getId",jt).add("addState",Yt).add("addEvent",Kt).add("map",re).add("for",ee).add("useContext",Gt).add("addContext",Wt).add("context",qt).add("role",Ht).add("aria",Lt).add("route",ae).add("debug",Nt).add("dataSet",Zt).add("dataStateSet",te).add("switch",le);export{M as a,G as b,x as c,gt as d,E as e,d as f,Ct as g,ot as h,it as i,C as j};
2
- //# sourceMappingURL=chunk-L4273GAO.js.map
@@ -1,2 +0,0 @@
1
- import{a as D,d as q}from"./chunk-ILT4B3VY.js";import{b as F,c as g,d as z,e as G,f as $}from"./chunk-E3C6NOMV.js";import{a as E,c as M,d as j}from"./chunk-R5DHGQZV.js";var m=class{constructor(t=1e3){this.cache=new Map,this.maxSize=t,this.lastKey=void 0}get(t){let e=this.cache,s=e.get(t);if(!(s===void 0&&!e.has(t)))return e.size>=this.maxSize&&t!==this.lastKey&&(e.delete(t),e.set(t,s),this.lastKey=t),s}has(t){return this.cache.has(t)}set(t,e){let s=this.cache;if(s.delete(t),s.set(t,e),this.lastKey=t,s.size>this.maxSize){let r=s.keys().next().value;s.delete(r)}}delete(t){this.cache.delete(t),t===this.lastKey&&(this.lastKey=void 0)}clear(){this.cache.clear(),this.lastKey=void 0}};var I=new WeakMap,U=new WeakMap;function X(n){if(!n||typeof n!="object")return n;let t=U.get(n);return t!==void 0?t:n}var J=new WeakMap;function ot(n,t,e,s){let r=I.get(n);r||(r=new Map,I.set(n,r));let i=r.get(e);if(i)return i;let o=new Proxy(n,Q(t,e,s));return r.set(e,o),U.set(o,n),o}function ct(n){n&&typeof n=="object"&&I.delete(n)}function K(n,t){let e=t.charCodeAt(0),s=e>=48&&e<=57;return n===""?s?"["+t+"]":t:s?n+"["+t+"]":n+"."+t}function Q(n,t="",e=""){return{get(s,r,i){let o=s[r];if(t===""&&r in s){if(typeof o=="function"){let u=J.get(s);u||(u=new Map,J.set(s,u));let h=u.get(r);if(h)return h;let l=o.bind(s);return u.set(r,l),l}return o}if(o=(s[e]||s)[r],o!==null&&typeof o=="object"){let u=K(t,r);return ot(o,n,u,e)}return o},set(s,r,i,o){if(t===""&&r in s)return s[r]=i,!0;let u=(s[e]||s)[r],h=K(t,r);return n.set(h,i),u!==i&&u!==null&&typeof u=="object"&&ct(u),!0}}}var Y=(n,t="stage")=>{let e=new Proxy(n,Q(n,"",t));return U.set(e,n),e};var C=class{static resume(t,e){if(!t)return null;let s=localStorage.getItem(t);if(s===null)return e!==void 0?e:void 0;try{let r=JSON.parse(s);return r===null&&e!==void 0?e:r}catch(r){return console.warn('[LocalData] Failed to parse stored value for key "'+t+'". Removing corrupted entry.',r),localStorage.removeItem(t),e!==void 0?e:void 0}}static store(t,e){if(!t||!e)return!1;try{let s=JSON.stringify(e);return localStorage.setItem(t,s),!0}catch(s){return console.error('[LocalData] Failed to store data for key "'+t+'".',s),!1}}static remove(t){return t?(localStorage.removeItem(t),!0):!1}};var P=(n={})=>{let t={};if(!E.isObject(n))return t;let e=Object.keys(n);for(let s=0,r=e.length;s<r;s++){let i=e[s],o=n[i];typeof o!="function"&&(t[i]=o)}return t};var ut=0,Z=new m(2e3),b={CHANGE:"change",DELETE:"delete"},W=(n,t)=>{let e=Z.get(n);return e||(e={change:`${n}:change`,delete:`${n}:delete`},Z.set(n,e)),t==="change"?e.change:e.delete},x=class{constructor(t={}){this.dirty=!1,this._retainState=!1,this._refreshState=!1,this.links=new Map,this._init(),this.setup(),this.dataTypeId="bd",this.eventSub=new F;let e=P(t);this.set(e);let s=Y(this);return this._proxy=s,s}retainState(){return this._retainState=!0,this._proxy||this}refreshState(){return this._refreshState=!0,this._proxy||this}setup(){this.stage={}}_init(){let t=++ut;this._dataNumber=t,this._id=`dt-${t}`,this._dataId=`${this._id}:`}onFlush(t){this.eventSub.onFlush(t)}flushPending(){this.eventSub.flush()}getDataId(){return String(this._id)}remove(){this.unlink(),this.eventSub.reset()}on(t,e){let s=W(t,b.CHANGE);return this.eventSub.on(s,e)}off(t,e){let s=W(t,b.CHANGE);this.eventSub.off(s,e)}_setAttr(t,e,s=this,r=!1){let i=this.stage[t];e!==i&&(this.stage[t]=e,this._publish(t,e,s,b.CHANGE))}publishLocalEvent(t,e,s,r){let i=W(t,r);this.eventSub.publish(i,e,s)}_publish(t,e,s,r){this.publishLocalEvent(t,e,s,r),s=s||this,g.publish(this._dataId+t,e,s)}set(t,e,s){if(typeof t!="object")return this._setAttr(t,e,s),this;let r=Object.keys(t);for(let i=0;i<r.length;i++){let o=r[i],c=t[o];typeof c!="function"&&this._setAttr(o,c,e,s)}return this}_silentSet(t){let e=this.stage,s=Object.keys(t);for(let r=0,i=s.length;r<i;r++){let o=s[r];e[o]=t[o]}}getModelData(){return this.stage}_deleteAttr(t,e,s=this){delete t[e],this.publishLocalEvent(e,null,s,b.DELETE)}toggle(t){return typeof t>"u"?this:(this.set(t,!this.get(t)),this)}increment(t,e=null){if(typeof t>"u")return this;e=e!==null&&typeof e=="number"?e:1;let s=this.get(t);return this.set(t,s+e),this}decrement(t,e=null){if(typeof t>"u")return this;e=e!==null&&typeof e=="number"?e:1;let s=this.get(t);return this.set(t,s-e),this}concat(t,e){if(typeof t>"u")return this;let s=this.get(t);return this.set(t,s+e),this}ifNull(t,e){return this.get(t)===null&&this.set(t,e),this}setKey(t,e){return this.key=e!=null?t+":v"+e:t,this}resume(t){let e=C.resume(String(this.key),t);return e?(this.set(e),this):this}store(){let t=this.get();return C.store(String(this.key),t)}delete(t){return typeof t=="string"?(this._deleteAttr(this.stage,t),this):(this.setup(),this)}_getAttr(t,e){return t[e]}get(t){return typeof t<"u"?this._getAttr(this.stage,t):this.getModelData()}link(t,e,s){if(arguments.length===1&&t.isData===!0&&(e=t.get()),typeof e!="object")return this.remoteLink(t,e,s);let r=[];return Object.entries(e).forEach(([i])=>{r.push(this.remoteLink(t,i))}),r}remoteLink(t,e,s){let r=s||e,i=t.get(e);typeof i<"u"&&this.get(e)!==i&&this.set(e,i);let o=t.on(e,(u,h)=>{if(h===this)return!1;this.set(r,u,t)}),c=this.on(r,(u,h)=>{if(h===t)return!1;t.set(e,u,this)});return this.addLink(o,t,e,c),t.addLink(c,this,r,o),o}addLink(t,e,s,r){this.links.set(t,{data:e,attr:s,pair:r})}unlink(t){if(t){this.removeLink(t);return}let e=this.links;e.size!==0&&(e.forEach((s,r)=>{this.removeLink(r,!1)}),e.clear())}removeLink(t,e=!0){let s=this.links.get(t);if(s){let r=s.data;s.attr&&r.off(s.attr,t);let i=s.pair,o=i&&r.links;if(o){let c=o.get(i);c&&(o.delete(i),c.attr&&this.off(c.attr,i))}}e!==!1&&this.links.delete(t)}};x.prototype.isData=!0;var tt=new Set(["__proto__","prototype","constructor"]),ht=n=>{let t=[],e=n.length,s=0;for(let r=0;r<e;r++){let i=n[r];i!=="."&&i!=="["&&i!=="]"||(r>s&&t.push(n.substring(s,r)),s=r+1)}return e>s&&t.push(n.substring(s)),t.length>0?t:null},p={deepDataPattern:/(\w+)|(?:\[(\d)\))/g,segmentCache:new m(1e3),hasDeepData(n){return n.indexOf(".")!==-1||n.indexOf("[")!==-1},isSafeAttr(n){return!tt.has(n)},getSegments(n){let t=this.segmentCache.get(n);if(t!==void 0)return t;if(t=ht(n),t){for(let e=0,s=t.length;e<s;e++)if(tt.has(t[e])){console.warn("[Data] Blocked unsafe path segment in: "+n),t=null;break}}return this.segmentCache.set(n,t),t}};var A=class{static set(t,e,s){if(!p.hasDeepData(e)){if(!p.isSafeAttr(e))return;t[e]=s;return}let r,i=p.getSegments(e);if(!i)return;let o=i.length,c=o-1;for(let u=0;u<o;u++){let h=i[u];if(u===c){t[h]=s;break}if(t[h]===void 0){let l=h.charCodeAt(0);t[h]=l<48||l>57?{}:[]}t=t[h]}}static delete(t,e){if(!p.hasDeepData(e)){if(!p.isSafeAttr(e))return;delete t[e];return}let s=p.getSegments(e);if(!s)return;let r=s.length,i=r-1;for(let o=0;o<r;o++){let c=s[o],u=t[c];if(u===void 0)break;if(o===i){if(Array.isArray(t)){let h=Number(c);Number.isInteger(h)&&h>=0&&h<t.length&&t.splice(h,1);break}delete t[c];break}t=u}}static get(t,e){if(!p.hasDeepData(e))return t[e]??void 0;let s=p.getSegments(e);if(!s)return;let r=s.length,i=r-1;for(let o=0;o<r;o++){let c=s[o],u=t[c]??void 0;if(u===void 0)break;if(t=u,o===i)return t}}};var et=new Set,T=class{static MAX_DEPTH=50;static publishDeep(t,e,s,r){if(!p.hasDeepData(e)){this.publish(e,s,r);return}let i,o=p.getSegments(e);if(!o)return;let c=o.length,u=c-1,h="";for(let l=0;l<c;l++){let a=o[l];t=t[a];let f=a.charCodeAt(0);l>0?(f<48||f>57)&&(h+="."+a):h=a;let d;if(l===u)d=s;else{let y=o[l+1],_=y.charCodeAt(0);if(_>=48&&_<=57){h+="["+y+"]";continue}let S={};S[y]=t[y],d=S}this.publish(h,d,r)}}static publish(t,e,s,r=null,i=0){if(t=t||"",s(t,e),!(!e||typeof e!="object"||(e=X(e),r===null&&(et.clear(),r=et),!r))){if(r.has(e)){console.warn("[Publisher] Circular reference detected at path:",t);return}if(i>=this.MAX_DEPTH){console.warn("[Publisher] Max depth exceeded at path:",t,"- stopping recursion");return}r.add(e),Array.isArray(e)?this.publishArray(t,e,s,r,i):this.publishObject(t,e,s,r,i)}}static publishArray(t,e,s,r,i){let o=e.length;for(let c=0;c<o;c++){let u=e[c],h=t+"["+c+"]";this._checkPublish(h,u,s,r,i)}}static publishObject(t,e,s,r,i){let o=Object.keys(e);for(let c=0,u=o.length;c<u;c++){let h=o[c],l=e[h],a=t+"."+h;this._checkPublish(a,l,s,r,i)}}static _checkPublish(t,e,s,r,i){if(!e||typeof e!="object"){s(t,e);return}this.publish(t,e,s,r,i+1)}};var k=class extends x{setup(){this.attributes={},this.stage={}}_setAttr(t,e,s,r){typeof e!="object"&&e===this.get(t)||(!s&&r!==!0?A.set(this.attributes,t,e):this.dirty===!1&&(this.dirty=!0),A.set(this.stage,t,e),s=s||this,this._publish(t,e,s,b.CHANGE))}_silentSet(t){let e=this.stage,s=this.attributes,r=Object.keys(t);for(let i=0,o=r.length;i<o;i++){let c=r[i],u=t[c];e[c]=u,s[c]=u}}linkAttr(t,e){let s=t.get(e);if(!s)return;let r=Object.keys(s);for(let i=0,o=r.length;i<o;i++){let c=r[i];this.link(t,e+"."+c,c)}}scope(t,e){let s=this.get(t);if(!s)return!1;e=e||this.constructor;let r=new e(s);return r.linkAttr(this,t),r}splice(t,e){return this.delete(t+"["+e+"]"),this.refresh(t),this}push(t,e){let s=this.get(t);return Array.isArray(s)===!1&&(s=[]),s.push(e),this.set(t,s),this}concat(t,e){let s=this.get(t);return Array.isArray(s)===!1&&(s=[]),s=s.concat(e),this.set(t,s),this}unshift(t,e){let s=this.get(t);return Array.isArray(s)===!1&&(s=[]),s.unshift(e),this.set(t,s),this}shift(t){let e=this.get(t);if(Array.isArray(e)===!1)return null;let s=e.shift();return this.set(t,e),s}getIndex(t,e,s){let r=this.get(t);return Array.isArray(r)===!1?-1:typeof r[0]!="object"?r.indexOf(e):r.findIndex(o=>o[e]===s)}pop(t){let e=this.get(t);if(Array.isArray(e)===!1)return null;let s=e.pop();return this.set(t,e),s}refresh(t){return this.set(t,this.get(t)),this}_publish(t,e,s,r){if(this._publishAttr(t,e,s,r),!e||typeof e!="object")return;let i=t.length,o=r===b.CHANGE?":change":":"+r,c=o.length,u=i+c;for(let l of this.eventSub.getMessages()){if(l.length<=u||!l.endsWith(o)||!l.startsWith(t))continue;let a=l.charCodeAt(i);if(a!==46&&a!==91)continue;let f=l.slice(0,l.length-c);this._publishAttr(f,this.get(f),s,r)}let h=g.getPrefixMessages(this._dataId);if(h){let l=this._dataId.length;for(let a of h){if(a.length-l<=i||!a.startsWith(t,l))continue;let d=a.charCodeAt(l+i);if(d!==46&&d!==91)continue;let y=a.slice(l);g.publish(a,this.get(y),s)}}}_publishAttr(t,e,s,r){let i=this._dataId+t;g.publish(i,e,s),this.publishLocalEvent(t,e,s,r)}mergeStage(){this.attributes=D.clone(this.stage),this.dirty=!1}getModelData(){return this.mergeStage(),this.attributes}revert(){this.set(this.attributes),this.dirty=!1}_deleteAttr(t,e,s=this){A.delete(t,e),this._delCommitter=s;let r=this._deleteCb||(this._deleteCb=i=>this._publishAttr(i,null,this._delCommitter,b.DELETE));T.publish(e,null,r)}_getAttr(t,e){return A.get(t,e)}};var lt={"\n":"\\n","\r":"\\n"," ":"\\t"},at=(n,t)=>{typeof n!="string"&&(n=String(n));let e=t?/[\n\r\t]/g:/\t/g;return n.replace(e,s=>lt[s])},st=(n,t)=>{if(typeof n!="string")return n;n=at(n,t),n=encodeURIComponent(n);let e=/%22/g;return n.replace(e,'"')},v=(n,t)=>{let e=typeof n;if(e==="undefined")return n;if(e!=="object")return n=st(n),n;let s=Array.isArray(n)?[...n]:{...n};return Object.keys(s).forEach(r=>{let i=s[r];i!==null&&(s[r]=typeof i=="string"?v(i,t):st(i,t))}),s};function rt(n){if(typeof n>"u"||n.length<1)return!1;try{return JSON.parse(n)}catch(t){return console.warn("[Encode] Failed to parse JSON.",t),!1}}function H(n){return typeof n<"u"?JSON.stringify(n):null}var O=class{static prepareJsonUrl(t,e=!1){let s=typeof t=="object"?D.clone(t):t,r=v(s,e);return H(r)}static json={encode:H,decode:rt};static xmlParse(t){return typeof t>"u"?!1:new DOMParser().parseFromString(t,"text/xml")}};var R=n=>n.data?n.data:n.context&&n.context.data?n.context.data:n.state?n.state:null;var w=class extends ${static create(t,e,s,r){let i=document.createElement(t);return this.addAttributes(i,e,r),s.appendChild(i),i}static addAttributes(t,e,s){if(!(!e||e.length<1))for(let r=0,i=e.length;r<i;r++){let o=e[r];this.addAttr(t,o.key,o.value,s)}}static addAttr(t,e,s,r){if(s===""||!e||e==="children")return;if(e==="innerHTML"){t.innerHTML=s;return}if(typeof s==="function"){if(e=G(e),s.originalCallback)M.add(e,t,s,!1,!0,s.originalCallback);else{let c=s,u=function(h){c.call(this,h,r)};M.add(e,t,u,!1,!0,c)}return}if(e.charCodeAt(4)===45){t.setAttribute(e,s);return}let o=z(e);t[o]=s}static addContent(t,e){e&&(e.textContent!==null?t.textContent=e.textContent:e.innerHTML&&(t.innerHTML=e.innerHTML))}static append(t,e){t.appendChild(e)}};var nt=/(\[\[(.*?(?:\[\d+\])?)\]\])/g,it=new m(1e3),B={isWatching(n){if(Array.isArray(n)){let t=n[0];return typeof t=="string"&&t.includes("[[")}return this.hasParams(n)},hasParams(n){return typeof n=="string"&&n.includes("[[")},_getWatcherProps(n){let t=it.get(n);if(t!==void 0)return t;let e=n.match(nt),s=e?e.map(r=>r.slice(2,-2)):null;return it.set(n,s),s},updateAttr(n,t,e){switch(t){case"text":case"textContent":n.textContent=e;break;case"disabled":n.disabled=!e;break;case"checked":n.checked=!!e;break;case"required":n.required=!!e;break;case"src":if(n.tagName==="IMG"){n.src=e&&(e.indexOf(".")!==-1||e.indexOf("blob:")!==-1)?e:"";break}n.src=e;break;default:w.addAttr(n,t,e);break}},replaceParams(n,t,e=!1){let s=0;return n.replace(nt,function(r,i,o){let c=e?t[s]:t;s++;let u=c.get(o);return u??""})},_getWatcherCallBack(n,t,e,s,r){let i=this._getWatcherProps(e);if(i&&i.length===1&&e.length===i[0].length+4){let o=i[0],c=r?t[0]:t;return()=>{let u=c.get(o);this.updateAttr(n,s,u!=null?String(u):"")}}return()=>{let o=this.replaceParams(e,t,r);this.updateAttr(n,s,o)}},getValue(n,t){let e=n.value;return Array.isArray(e)===!1?[e,R(t)]:(e.length<2&&e.push(R(t)),e)},getPropValues(n,t,e){let s=[];for(let r=0,i=t.length;r<i;r++){let c=(e?n[r]:n).get(t[r])??"";s.push(c)}return s},getCallBack(n,t,e,s,r,i){let o=n.attr||"textContent",c=n.callBack;if(typeof c=="function"){let u=i||this._getWatcherProps(s)||[],h=u.length>1;return(l,a)=>{l=h!==!0?l:this.getPropValues(e,u,r);let f=c(l,t,a);typeof f<"u"&&this.updateAttr(t,o,f)}}return this._getWatcherCallBack(t,e,s,o,r)},addDataWatcher(n,t,e){let s=this.getValue(t,e),r=s[1]??e?.data??e?.context?.data??e?.state??null;if(!r)return;let i=s[0],o=Array.isArray(r),c=this._getWatcherProps(i);if(!c)return;let u=this.getCallBack(t,n,r,i,o,c);if(!o)c.length>1?g.watchMany(n,r,c,u):this.addWatcher(n,r,c[0],u);else for(let h=0,l=c.length;h<l;h++)this.addWatcher(n,r[h],c[h],u)},getWatcherSettings(n,t=null){if(typeof n=="string")return{attr:t,value:n};if(Array.isArray(n)){let e=n[n.length-1];e&&typeof e=="object"&&(e=t!==null?t:null);let s=n[1]&&typeof n[1]=="object"?[n[0],n[1]]:[n[0]];return typeof e=="function"?{attr:t,value:s,callBack:e}:{attr:e||"textContent",value:s}}return n},setup(n,t,e){t&&this.addDataWatcher(n,this.getWatcherSettings(t),e)},addWatcher(n,t,e,s){g.watch(n,t,e,s)}};var L=class{constructor(t){this.model=t,this.objectType=this.objectType||"item",this.url="",this.validateCallBack=null,this.init()}init(){let t=this.model;t&&t.url&&(this.url=t.url)}isValid(){let t=this.validate();if(t!==!1){let e=this.validateCallBack;typeof e=="function"&&e(t)}return t}validate(){return!0}getDefaultParams(){return""}setupParams(t){let e=this.getDefaultParams();return t=this.addParams(t,e),t}objectToString(t){let e=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.push(s+"="+t[s]);return e.join("&")}addParams(t,e){if(t=t||{},typeof t=="string"&&(t=j.parseQueryString(t,!1)),!e)return this._isFormData(t)?t:this.objectToString(t);if(typeof e=="string"&&(e=j.parseQueryString(e,!1)),this._isFormData(t))for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.append(s,e[s]);else t=Object.assign(t,e),t=this.objectToString(t);return t}get(t,e){let s=this.model.get("id"),r="id="+s,i=s?`/${s}`:"",o=this.model;return this._get(i,r,t,e,c=>{if(c){let u=this.getObject(c);u&&o.set(u)}})}getObject(t){return t[this.objectType]||t||!1}setupObjectData(){let t=this.model.get();return this.objectType+"="+O.prepareJsonUrl(t)}setup(t,e){if(!this.isValid())return;let s=this.setupObjectData(),r=this.model.id,i=r!=null?`/${r}`:"";return this._put(i,s,t,e)}add(t,e){if(!this.isValid())return;let s=this.setupObjectData(),r=this.model.id,i=r!=null?`/${r}`:"";return this._post(i,s,t,e)}update(t,e){if(!this.isValid())return;let s=this.setupObjectData(),r=this.model.id,i=r!=null?`/${r}`:"";return this._patch(i,s,t,e)}delete(t,e){let s=this.model.get("id"),r=typeof s<"u"?"id="+s:this.setupObjectData(),i=s!=null?`/${s}`:"";return this._delete(i,r,t,e)}getAllParams(t,e,s,r){let i=this.model.get();t=isNaN(Number(t))?0:t,e=isNaN(Number(e))?50:e;let o=i.search||"",c=f=>{try{return JSON.stringify(f)}catch(d){return console.error("[ModelService] Failed to serialize request param.",d),""}},u=i.filter||"";typeof u=="object"&&(u=c(u));let h=i.dates||"";typeof h=="object"&&(h=c(h));let l=i.orderBy||"";typeof l=="object"&&(l=c(l));let a=i.groupBy||"";return Array.isArray(a)&&(a=c(a)),"&filter="+encodeURIComponent(u)+"&offset="+t+"&limit="+e+"&dates="+encodeURIComponent(h)+"&orderBy="+encodeURIComponent(l)+"&groupBy="+encodeURIComponent(a)+"&search="+encodeURIComponent(o)+"&lastCursor="+(typeof s<"u"&&s!==null?encodeURIComponent(s):"")+"&since="+(typeof r<"u"&&r!==null?encodeURIComponent(r):"")}all(t,e,s,r,i=null,o=null){let c=this.getAllParams(s,r,i,o);return this._get("",c,t,e)}getUrl(t){let e=this.url;if(!t)return this.replaceUrl(e);t[0]==="/"&&(t=t.substring(1));let s=t[0]==="?"?e+t:e+"/"+t;return this.replaceUrl(s)}setupRequest(t,e,s,r,i){let o={url:this.getUrl(t),method:e,params:s,completed:(u,h)=>{typeof i=="function"&&i(u),this.getResponse(u,r,h)}};return this._isFormData(s)&&(o.headers={}),q(o)}setupEventSource(t,e,s,r,i=!0){let o=null,c,u=!1,h=!1,l=()=>{c&&(clearTimeout(c),c=void 0)},a=()=>{if(u||!i||h)return;l(),c=setTimeout(()=>{c=void 0,f()},3e3)},f=()=>{if(u||h)return;if(o){try{o.close()}catch{}o=null}h=!0;let d=this.getUrl(t),y=e?"?"+e:"";o=new EventSource(d+y,{withCredentials:!0}),o.onopen=()=>{h=!1,l(),r&&r()},o.onerror=()=>{h=!1,o&&o.readyState===EventSource.CLOSED&&(o=null,a())},o.onmessage=_=>{try{let S=JSON.parse(_.data);s&&s(S)}catch{}}};return f(),{get source(){return o},close:()=>{if(u=!0,h=!1,l(),o){try{o.close()}catch{}o=null}}}}replaceUrl(t){return B.isWatching(t)&&(t=B.replaceParams(t,this.model)),t.endsWith("/")&&(t=t.substring(0,t.length-1)),t}_isFormData(t){return t instanceof FormData}request(t,e,s,r){return this._request("","POST",t,e,s,r)}_get(t,e,s,r,i){return e=this.setupParams(e),e=this.addParams(e,s),t=t||"",e&&(t+="?"+e),this.setupRequest(t,"GET","",r,i)}_post(t,e,s,r,i){return this._request(t,"POST",e,s,r,i)}_put(t,e,s,r,i){return this._request(t,"PUT",e,s,r,i)}_patch(t,e,s,r,i){return this._request(t,"PATCH",e,s,r,i)}_delete(t,e,s,r,i){return this._request(t,"DELETE",e,s,r,i)}_request(t,e,s,r,i,o){return s=this.setupParams(s),s=this.addParams(s,r),this.setupRequest(t,e,s,i,o)}getResponse(t,e,s){typeof e=="function"&&e(t,s)}static extend(t){if(!t)return{};let e=this;class s extends e{constructor(i){super(i)}}return Object.assign(s.prototype,t),s}};var ft=n=>{let t={};if(!E.isObject(n)||!n.defaults)return t;let{defaults:e}=n;return Object.keys(e).forEach(s=>{let r=e[s];typeof r!="function"&&(t[s]=r)}),delete n.defaults,t},dt=n=>{if(!n||typeof n.xhr!="object")return{};let t={...n.xhr};return delete n.xhr,t},pt=0,N=class extends k{constructor(t){let e=super(t);return this.initialize(),e}setup(){this.attributes={},this.stage={},this.url=this.url||"",this.xhr=this.xhr||{}}initialize(){}static extend(t={}){let e=this,s=dt(t),r=e.prototype.service.extend(s),i=ft(t);class o extends e{constructor(u){let h={...i,...P(u)};super(h),this.xhr=new r(this)}dataTypeId=`bm${pt++}`}return Object.assign(o.prototype,t),o.prototype.service=r,o}};N.prototype.service=L;var V=class extends x{};export{m as a,Y as b,x as c,k as d,R as e,w as f,B as g,N as h,V as i};
2
- //# sourceMappingURL=chunk-LX7KL4UO.js.map
@@ -1,2 +0,0 @@
1
- import{b as P}from"./chunk-DZCEWMDW.js";import{a as ft,b as pt,c as mt,d as C,e as x,f as T}from"./chunk-UQGSGBNZ.js";import{a as U,b as lt}from"./chunk-SN4TNKC2.js";import{a as ht,c as b,d as ut,e as dt,f as H}from"./chunk-EJIWXHRN.js";import{b as p,c as f}from"./chunk-QPFMAZXH.js";var L={items:new Map,add(s,t){return this.items.set(s,t),this},get(s){return this.items.get(s)??null}};p.addType("components",s=>{if(!s)return;let t=s.component;!t||!t.isUnit||(t.persistToken&&t.parent&&t.parent.removePersistedChild(t.persistToken),t.rendered===!0&&(t.prepareDestroy(),t.cleanUpAfterDestroy()))});var de=0,W=class{constructor(t,e,r){this.isUnit=!0,this.data=null,this.persist=null,this.nest=null,this.state=null,this.panel=null,this.parent=null,this.unitType=null,this._classId,this.id="",this.cached=[],this.init();let n,i;if(t==null)n={},i=[];else{let o=typeof t;o==="string"||o==="number"?(n={},i=[{tag:"text",textContent:t}]):Array.isArray(t)?(n={},i=t):(n=t||{},i=typeof e=="string"?[{tag:"text",textContent:e}]:e)}this.setupProps(n),this.children=i||[],this.persistedChildren={},this.persistedCount=0,this.onCreated(),this.rendered=!1,this.container=null}init(){this.id="cp-"+de++,this.unitType=this._classId||this.constructor.name.toLowerCase()}declareProps(){}addPersistedChild(t){let e=t.key,r=e!=null?"pk:"+e:"pc"+this.persistedCount++,n=this.persistedChildren[r];return n&&t.unitType===n.unitType&&t.resumeScope(n),t.persistToken=r,this.persistedChildren[r]=t,r}removePersistedChild(t){this.rendered&&(!t||!this.persistedChildren[t]||delete this.persistedChildren[t])}setupProps(t){if(this.declareProps(),!(!t||typeof t!="object"))for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this[e]=t[e],e==="data"&&(this._externalData=!0))}getChildScope(){return this}getParentContext(){return this.parent?this.parent.getContext():null}setupContext(){if(this._contextResumed)return;let t=this.getParentContext(),e=this.setContext(t);if(e){this.context=e;return}this.context=t,this.setupAddingContext()}setupAddingContext(){let t=this.context,e=this.addContext(t);if(!e)return;let r=e[0];r&&(this.addingContext=!0,this.contextBranchName=r,this.addContextBranch(r,e[1]))}addContextBranch(t,e){this.context??={},this.context[t]=e}setContext(t){return null}addContext(t){return null}removeContext(){this.addingContext&&this.removeContextBranch(this.contextBranchName)}removeContextBranch(t){t&&delete this.context[t]}getContext(){return this.context}onCreated(){}render(){return{}}_cacheRoot(t){return t&&(t.id||(t.id=this.getId()),t.cache="panel",t)}_createLayout(){return this.render()}prepareLayout(){let t=this._createLayout();return this._cacheRoot(t)}afterBuild(){p.add(this.panel,"components",{component:this}),this.rendered=!0,this.afterLayout()}afterLayout(){this.afterSetup()}if(t,e){return t?e||t:null}map(t,e){let r=[];if(!t||t.length<1)return r;for(let n=0,i=t.length;n<i;n++){let o=e(t[n],n);r.push(o)}return r}removeAll(t){return H.removeAll(t)}getId(t){let e=this.id;return typeof t=="string"&&(e+="-"+t),e}cacheEle(t,e){e&&(this[e]=t,this.cached.push(e))}initialize(){this.setupContext(),this.beforeSetup()}beforeSetup(){}afterSetup(){}setup(t){this.setContainer(t),this.initialize()}setContainer(t){this.container=t}_remove(){this.prepareDestroy(),this.removeContext();let t=this.panel;t&&H.removeElement(t),this.cleanUpAfterDestroy()}cleanUpAfterDestroy(){this.panel=null,this.container=null;let t=this.cached;for(let e=0,r=t.length;e<r;e++)this[t[e]]=null;this.cached=[],this.persist!==!0&&(this.persistedChildren={},this.persistToken=null)}prepareDestroy(){this.persistedCount=0,this.rendered=!1,this.beforeDestroy(),this.data&&typeof this.data.unlink=="function"&&this.data.unlink()}beforeDestroy(){}destroy(){this._remove()}};var I=class{static resume(t,e){if(t._externalData){this._resumeExternal(t,e);return}this._resumeOwned(t,e)}static refresh(t){let e=t.setData();e&&t.data&&t.data.set(e.stage),this.refreshContext(t)}static refreshContext(t){let e=t.context;if(!e||!e.data)return;let r=t.getParentContext();if(!r||!r.data)return;let n=r.data.stage,i=e.data.stage,o=null;for(let a in n){if(!Object.prototype.hasOwnProperty.call(n,a))continue;let c=n[a];c!==i[a]&&(o===null&&(o={}),o[a]=c)}o!==null&&(typeof e.data._silentSet=="function"?e.data._silentSet(o):e.data.set(o))}static _resumeExternal(t,e){let r=t.setData();if(!r){t.data=e;return}if(e&&e.stage){let n=e._retainState||r._retainState,i=!n&&(e._refreshState||r._refreshState),o=this._buildExternalUpdates(e.stage,r.stage,n,i);U.isEmpty(o)||r._silentSet(o)}typeof r.flushPending=="function"&&r.flushPending(),t.data=r}static _buildExternalUpdates(t,e,r,n){let i={};for(let o in t){if(!Object.prototype.hasOwnProperty.call(t,o))continue;if(n){Object.prototype.hasOwnProperty.call(e,o)||(i[o]=t[o]);continue}let a=t[o];!r&&a==null||a!==e[o]&&(i[o]=a)}return i}static _resumeOwned(t,e){if(!t.data){t.data=e;return}if(e&&e._retainState){t.data=e;return}if(e&&e.stage){let r=e._refreshState||t.data._refreshState,n=this._buildOwnedUpdates(e.stage,t.data.stage,r);U.isEmpty(n)||t.data._silentSet(n)}t.data&&typeof t.data.flushPending=="function"&&t.data.flushPending()}static _buildOwnedUpdates(t,e,r){let n={};for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;if(r){Object.prototype.hasOwnProperty.call(e,i)||(n[i]=t[i]);continue}let o=t[i];o!=null&&o!==e[i]&&(n[i]=o)}return n}};var G=class{constructor(){this.events=[]}addEvents(t){let e=t.length;if(!(e<1))for(let r=0;r<e;r++){let n=t[r];this.on(n[0],n[1],n[2],n[3])}}on(t,e,r,n){f.on(t,e,r,n),this.events.push({event:t,obj:e,callBack:r,capture:n})}off(t,e,r,n){f.off(t,e,r,n);let i,o=this.events;for(let a=0,c=o.length;a<c;a++)if(i=o[a],i.event===t&&i.obj===e){o.splice(a,1);break}}set(){let t=this.events;for(let e=0,r=t.length;e<r;e++){let n=t[e];f.on(n.event,n.obj,n.callBack,n.capture)}}unset(){let t=this.events;for(let e=0,r=t.length;e<r;e++){let n=t[e];f.off(n.event,n.obj,n.callBack,n.capture)}}reset(){this.unset(),this.events=[]}};var F=class{constructor(t,e){this.remoteStates=[];let r=this.convertStates(e);this.addStatesToTarget(t,r)}addStates(t,e){let r=this.convertStates(e);this.addStatesToTarget(t,r)}createState(t,e,r,n){return{action:t,state:e,callBack:r,targetId:n,token:null}}convertStates(t){let e=[];for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;if(r==="remotes"){this.setupRemoteStates(t[r],e);continue}let n=null,i=null,o=t[r];o&&typeof o=="object"&&(i=o.callBack,n=o.id||o.targetId,o=o.state),e.push(this.createState(r,o,i,n))}return e}setupRemoteStates(t,e){for(let r=0,n=t.length;r<n;r++){let i=t[r];if(i)for(let o in i){if(!Object.prototype.hasOwnProperty.call(i,o)||o==="id")continue;let a=null,c=i[o],l=c!==null?c:void 0;l&&typeof l=="object"&&(a=l.callBack,l=l.state),e.push(this.createState(o,l,a,i.id))}}}removeRemoteStates(t){let e=this.remoteStates;e&&this.removeActions(t,e)}removeActions(t,e){if(!(e.length<1))for(let r=0,n=e.length;r<n;r++){let i=e[r];i.token&&this.unbindRemoteState(t,i.token),i.targetId&&P.remove(i.targetId,i.action,i.token)}}restore(t){P.restore(t.id,t);let e=this.remoteStates;if(e)for(let r=0,n=e.length;r<n;r++){let i=e[r];i.token=this.bindRemoteState(t,i.action,i.targetId)}}bindRemoteState(t,e,r){let n=P.getTarget(r);return t.link(n,e)}unbindRemoteState(t,e){t.unlink(e)}addStatesToTarget(t,e){let r=this.remoteStates;for(let n=0,i=e.length;n<i;n++){let o=e[n],a=this.addAction(t,o);o.targetId&&(o.token=a,r.push(o))}}addAction(t,e){let r,n=e.action,i=e.targetId;i&&(r=this.bindRemoteState(t,n,i)),typeof e.state<"u"&&t.addAction(n,e.state);let o=e.callBack;return typeof o=="function"&&t.on(n,o),r||null}};var g=class extends W{constructor(t,e,r){super(t,e,r),this.isComponent=!0,this.stateResumed=!1,this.stateTargetId=null,this._externalData=this._externalData??!1,this._setupData()}setData(){return null}_setupData(){if(this.data)return;let t=this.setData();t&&(this.data=t)}resumeScope(t){this._resumeData(t.data),this.state=t.state,this.stateHelper=t.stateHelper,this.persistedChildren=t.persistedChildren,t.context&&(this.context=t.context),this.id=t.id,this._refreshContextData()}_resumeData(t){I.resume(this,t)}_refreshData(){I.refresh(this)}_refreshContextData(){I.refreshContext(this)}initialize(){this.setupContext(),this.addStates(),this.beforeSetup()}afterLayout(){this.addEvents(),this.afterSetup()}setupStateTarget(t){let e=t||this.stateTargetId||this.id;this.state=P.getTarget(String(e))}setupStates(){return{}}addStates(){let t=this.state;if(t){this.stateResumed=!0,this.stateHelper.restore(t);return}let e=this.setupStates();U.isEmpty(e)||this.setStateHelper(e)}setStateHelper(t={}){this.state||(this.setupStateTarget(),this.stateHelper=new F(this.state??{},t))}addState(t){!this.stateHelper||this.stateResumed==!0||this.stateHelper.addStates(this.state,t)}removeStates(){let t=this.state;t&&(this.stateHelper.removeRemoteStates(t),t.remove(),this.stateResumed=!1)}onFlush(t){let e=this.data??this?.context?.data??null;e&&e.onFlush(t)}setEventHelper(){this.events||(this.events=new G)}setupEvents(){return[]}addEvents(){let t=this.setupEvents();t.length<1||(this.setEventHelper(),this.events&&this.events.addEvents(t))}removeEvents(){let t=this.events;t&&t.reset()}prepareDestroy(){this.persistedCount=0,this.rendered=!1,this.beforeDestroy(),this.removeEvents(),this.removeStates(),this.removeContext(),this.data&&this.persist!==!0&&this.data.unlink()}};var gt={created:"onCreated",setStates:"setupStates",state:"setupStates",events:"setupEvents",before:"beforeSetup",render:"render",after:"afterSetup",destroy:"beforeDestroy"};var fe=(s,t)=>typeof s!="function"&&t==="setupStates"?()=>s:s,et=(s,t)=>{if(!s)return t;let e=Object.keys(s);for(let r=0,n=e.length;r<n;r++){let i=e[r],o=s[i],a=gt[i]||i;t[a]=fe(o,a)}return t},pe=s=>et(s,{}),me=0,yt=(s,t)=>{class e extends s{}return Object.assign(e.prototype,t),e.prototype._classId="jot"+me++,e},R=(s,t=g)=>{s||(s={});let e,r=typeof s;return r==="object"&&s.render?(e=pe(s),yt(t,e)):(e={render:r==="function"?s:()=>s},yt(t,e))};var rt=(s,t)=>({attr:s,directive:t});var S=(s,t)=>({key:s,value:t});var xt=(s,t,e,r)=>({tag:s,attr:t,directives:e,children:r});var St=null,ge=()=>St||(St=L.get("watch")),w=class{static getTag(t){return t.tag||"div"}static setupChildren(t){t.nest&&(t.children=t.nest,delete t.nest)}static setElementContent(t,e,r,n){return t==="text"?(n.push({tag:"text",textContent:e}),!0):t==="html"||t==="innerHTML"?(r.push(S("innerHTML",e)),!0):!1}static setTextAsWatcher(t,e,r){t.push(rt(S(e,T.getWatcherSettings(r,ut(e))),ge()))}static setButtonType(t,e,r){if(t==="button"){let n=e.type||"button";r.push(S("type",n))}}static parse(t,e){let r=[],n=[],i=t.tag||"div";i==="button"&&r.push(S("type",t.type||"button"));let o=[],a,c;for(let l in t){if(!Object.prototype.hasOwnProperty.call(t,l)||l==="tag"||(a=t[l],a==null))continue;if(l==="children"||l==="nest"){if(Array.isArray(a))for(let d=0;d<a.length;d++)o.push(a[d]);else o.push(a);continue}if((c=L.get(l))!==null){n.push(rt(S(l,a),c));continue}let h=typeof a;if(h==="object"){if(T.isWatching(a)){this.setTextAsWatcher(n,l,a);continue}o.push(a);continue}if(h==="function"){let d=a,y=function(m){d.call(this,m,e)};y.originalCallback=d,r.push(S(l,y));continue}if(h==="string"&&a.includes("[[")){this.setTextAsWatcher(n,l,a);continue}if(l==="text"){o.push({tag:"text",textContent:a});continue}if(l==="html"||l==="innerHTML"){r.push(S("innerHTML",a));continue}r.push(S(l,a))}return xt(i,r,n,o)}};var A=class{build(t,e,r){}setupComponent(t,e,r){let n=r?.getChildScope();t.parent=n,n&&n.persist===!0&&t.persist!==!1&&(t.persist=!0,t.parent.addPersistedChild(t)),t.cache&&n&&(n[t.cache]=t),t.setup(e)}buildComponent(t){let e=t.prepareLayout(),r=this.build(e,t.container,t);return t.afterBuild(),t.component&&typeof t.onCreated=="function"&&t.onCreated(t),r}createComponent(t,e,r){return this.setupComponent(t,e,r),this.buildComponent(t),t}setDirectives(t,e,r){}removeNode(t){}removeAll(t){}};var N=class extends A{build(t,e,r){let n=x.createDocFragment();if(Array.isArray(t))for(let i=0,o=t.length;i<o;i++)this.buildElement(t[i],n,r);else this.buildElement(t,n,r);return e&&typeof e=="object"&&e.appendChild(n),n}buildElement(t,e,r){if(t){if(t.isUnit===!0){this.createComponent(t,e,r);return}this.createElement(t,e,r)}}createElement(t,e,r){let n=r?.getChildScope();if(t.data||t.state){this.createTempComponent(t,e,n);return}let i=w.parse(t,n),o=this.createNode(i,e,n);this.cache(o,t.cache,r);let a=i.children;for(let l=0,h=a.length;l<h;l++){let d=a[l];d!==null&&this.buildElement(d,o,r)}let c=i.directives;c.length&&this.setDirectives(o,c,n)}createTempComponent(t,e,r){let n={cache:t.cache,key:t.key,_externalData:!0,setData:()=>t.data,...et(t.methods||{},{}),render(){return{...t,data:null,state:null,methods:null,key:null}}};t.state&&(n.setupStateTarget=function(o){this.state=t.state});let i=new g(n);this.createComponent(i,e,r)}setDirectives(t,e,r){for(let n=0,i=e.length;n<i;n++)this.handleDirective(t,e[n],r)}handleDirective(t,e,r){e.directive(t,e.attr.value,r)}cache(t,e,r){r&&e&&r.cacheEle(t,e)}createNode(t,e,r){let n=t.tag;if(n==="text"){let i=t.attr[0],o=i?i.value:"";return x.createText(o,e)}else if(n==="comment"){let i=t.attr[0],o=i?i.value:"";return x.createComment(o,e)}return x.create(n,t.attr,e,r)}removeNode(t){x.removeElement(t)}removeAll(t){x.removeAll(t)}};var ye=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source"]),E=class{static create(t,e=[],r=""){let n="",i="";for(let o=0,a=e.length;o<a;o++){let c=e[o],l=c.key,h=c.value;if(l==="text"||l==="textContent"){n+=h;continue}if(l==="html"||l==="innerHTML"){n+=h;continue}if(typeof h=="function"){let d="on"+dt(l);i?i+=" "+d+'="'+h+'"':i=d+'="'+h+'"';continue}i?i+=" "+l+'="'+h+'"':i=l+'="'+h+'"'}return ye.has(t)?"<"+t+" "+i+" />":"<"+t+" "+i+">"+n+r+"</"+t+">"}static createText(t){return t}static createComment(t){return"<!-- "+t+" -->"}};var j=class extends A{build(t,e,r){if(Array.isArray(t)){let n="";for(let i=0,o=t.length;i<o;i++)n+=this.buildElement(t[i],r);return n}return this.buildElement(t,r)}createComponent(t,e,r){return this.setupComponent(t,e,r),this.buildComponent(t)}buildElement(t,e){return t?t.isUnit===!0?this.createComponent(t,{},e):this.createElement(t,e):""}createElement(t,e){let r=w.parse(t,e),n=r.children,i="";for(let o=0,a=n.length;o<a;o++){let c=n[o];c!==null&&(i+=this.buildElement(c,e))}return this.createNode(r,i)}createNode(t,e){let r=t.tag;if(r==="text"){let n=t.attr[0],i=n?n.value:"";return E.createText(i)}else if(r==="comment"){let n=t.attr[0],i=n?n.value:"";return E.createComment(i)}return E.create(r,t.attr,e)}removeAll(t){}};var Q=class{static browserIsSupported(){return typeof window<"u"&&typeof document=="object"}static setup(){return this.browserIsSupported()?new N:new j}};var k=Q.setup(),xe=s=>typeof s=="object"&&s.isUnit===!0,Se=s=>{let t=R(s);return t?new t:null},u=class{static render(t,e,r){return!t||(xe(t)||(t=Se(t)),!t)?null:k.createComponent(t,e,r)}static build(t,e,r){return k.build(t,e,r)}static rebuild(t,e,r){return k.removeAll(e),this.build(t,e,r)}static setDirectives(t,e,r){k.setDirectives(t,e,r)}static createNode(t,e,r){return k.createNode(t,e,r)}static removeNode(t){k.removeNode(t)}static removeAll(t){k.removeAll(t)}};lt.augment({buildLayout(s,t,e){u.build(s,t,e)}});var st=[],we=s=>st.indexOf(s)!==-1,ve=s=>({tag:"script",src:s.src,async:!1,load(t){st.push(s.src);let e=s.load;e&&e()}}),Ce=s=>({tag:"link",rel:"stylesheet",type:"text/css",href:s.src,load(t){st.push(s.src);let e=s.load;e&&e()}}),z=class{constructor(t){this.percent=0,this.loaded=0,this.total=0,this.callBack=t||null}add(t){this.total++;let e,r=this.update.bind(this);t.indexOf(".css")!==-1?e=Ce({load:r,src:t}):e=ve({load:r,src:t}),u.build(e,document.head)}addFiles(t){t&&t.forEach(e=>{we(e)||this.add(e)})}update(){if(this.updateProgress()<100)return;let e=this.callBack;e&&e()}updateProgress(){return++this.loaded,this.percent=Math.floor(this.loaded/this.total*100)}};var ke=s=>s?typeof s?.prototype?.constructor=="function":!1,D=class{static process(t,e){let r=t.default;return r?e.callback?e.callback(r):(ke(r)?r=new r:r=r(),r.isUnit===!0&&(r.route=e.route,e.persist&&(r.persist=!0)),r):null}static render(t,e,r){let n=u.build(t,null,r),i=n.firstChild||t?.panel;return e.after(n),i}};var J=class{static load(t,e,r){return t.then(n=>(e&&e(n),n)).catch(n=>{console.error("Error loading module:",n),r&&r(n)})}};var be=s=>({tag:"comment",textContent:"import placeholder",onCreated:s.onCreated}),O=new Map,Te=s=>{if(O.has(s)){let r=O.get(s);return r&&typeof r.then!="function"?Promise.resolve(r):r}let t=typeof s,e;if(t==="string")e=import(s);else if(t==="function")e=s();else return s;return e.then(r=>{O.set(s,r)}),O.set(s,e),e},Pe=s=>{if(!O.has(s))return null;let t=O.get(s);return t&&typeof t.then=="function"?null:t||null},wt=R({declareProps(){this.loaded=!1,this.generation=0},render(){return be({onCreated:s=>{if(this.src){if(this.layout){this.layoutRoot=D.render(this.layout,this.panel,this.parent);return}if(this.depends){new z(()=>{this.loadAndRender(s)}).addFiles(this.depends);return}this.loadAndRender(s)}}})},loadAndRender(s){let t=this.generation,e=Pe(this.src);if(e){this.renderModule(s,e);return}J.load(Te(this.src),r=>{t===this.generation&&this.renderModule(s,r)},r=>{t===this.generation&&(this.loaded=!1)})},renderModule(s,t){this.loaded=!0;let e=this.layout||D.process(t,{callback:this.callback,route:this.route,persist:this.persist});this.layout=e,this.layoutRoot=D.render(e,s,this.parent)},shouldUpdate(s){return this.updateLayout===!0?!0:this.updateLayout=s&&s.isUnit&&typeof s.update=="function"},updateModuleLayout(s){let t=this.layout;this.shouldUpdate(t)&&t&&t.update(s)},update(s){this.loaded===!0&&this.updateModuleLayout(s)},destroy(){this.generation++,this.layoutRoot&&(u.removeNode(this.layoutRoot),this.persist!==!0&&(this.layoutRoot=null,this.layout=null,this.loaded=!1,this.updateLayout=!1))}});var vt=s=>{let t=typeof s;return(t==="string"||t==="function"||s instanceof Promise)&&(s={src:s}),new wt(s)};var Ie=0,B=class{constructor(t){this.router=t,this.locationId="base-app-router-"+Ie++,this.callBack=this.check.bind(this)}setup(){return this.addEvent(),this}check(t){}getScrollPosition(){return{x:window.scrollX,y:window.scrollY}}scrollTo(t){window.scrollTo(t.x,t.y)}addEvent(){return this}};var kt=typeof navigator<"u"&&/iPad|iPhone|iPod/.test(navigator.userAgent||"")&&!window.MSStream,Ct=()=>{kt&&requestAnimationFrame(()=>requestAnimationFrame(()=>{let s=window.scrollX,t=window.scrollY;window.scrollTo(0,t+1),document.documentElement.offsetHeight,window.scrollTo(s,t)}))},Y=class extends B{addEvent(){return f.on("popstate",window,this.callBack),kt&&(this.pageShowCallBack=this.onPageShow.bind(this),f.on("pageshow",window,this.pageShowCallBack)),this}removeEvent(){return f.off("popstate",window,this.callBack),this.pageShowCallBack&&f.off("pageshow",window,this.pageShowCallBack),this}onPageShow(t){t.persisted&&Ct()}check(t){let e=t.state;if(!e||e.location!==this.locationId)return!1;t.preventDefault(),t.stopPropagation(),this.router.checkActiveRoutes(e.uri);let r=e.scrollPosition;r&&this.scrollTo(r),Ct()}createState(t,e={}){let r=this.getScrollPosition();return e=e===null?{}:e,{location:this.locationId,...e,scrollPosition:r,uri:t}}addState(t,e,r=!1){let n=window.history,i=n.state;if(i&&i.uri===t)return this;!r&&i&&i.location===this.locationId&&(i.scrollPosition=this.getScrollPosition(),n.replaceState(i,"",window.location.href));let o=this.createState(t,e);return r||(o.scrollPosition={x:0,y:0}),n[r===!1?"pushState":"replaceState"](o,null,t),this}};var K=class extends B{addEvent(){return f.on("hashchange",window,this.callBack),this}removeEvent(){return f.off("hashchange",window,this.callBack),this}check(t){this.router.checkActiveRoutes(t.newURL)}addState(t,e,r){return window.location.hash=t,this}};var V=class{static browserIsSupported(){return typeof window=="object"&&"history"in window&&"pushState"in window.history}static setup(t){return this.browserIsSupported()?new Y(t).setup():new K(t).setup()}};var nt=class extends g{getChildScope(){return this.parent}},bt=s=>R(s,nt);var $=class{constructor(t,e){this.route=t,this.template=e.component,this.component=null,this.hasTemplate=!1,this.setup=!1,this.container=e.container,this.persist=e.persist,this.parent=e.parent}focus(t){this.setup===!1&&(this.route&&typeof this.route.flushPending=="function"&&this.route.flushPending(),this.create()),this.update(t)}setupTemplate(){let e=typeof this.template;e==="function"?this.initializeComponent():e==="object"&&this.initializeTemplateObject(),this.hasTemplate=!0}initializeComponent(){this.template=this.template(),this.initializeTemplateObject()}transferSettings(t){this.persist=this.persist&&t.persist!==!1,Object.assign(t,{route:this.route,persist:this.persist}),this.component=t}initializeTemplateObject(){let t=this.template;if(!t)return;t.isUnit||(this.template=new(bt(t)));let e=this.template;this.transferSettings(e)}create(){if(this.setupTemplate(),!this.hasTemplate)return;this.setup=!0;let t=this.component;u.render(t,this.container,this.parent)}remove(){if(this.setup!==!0)return;this.setup=!1;let t=this.component;t&&(typeof t.destroy=="function"&&t.destroy(),this.component=null)}update(t){let e=this.component;e&&typeof e.update=="function"&&e.update(t)}};var Tt=s=>{if(!s.length)return null;let t={};for(let e=0,r=s.length;e<r;e++)t[s[e]]=null;return t},Pt=s=>{let t=[];if(!s)return t;let e=/[*?]/g;s=s.replace(e,"");let r=/:(.[^./?&($]+)\?*/g,n=s.match(r);if(n===null)return t;for(let i=0,o=n.length;i<o;i++){let a=n[i];a&&t.push(a.replace(":",""))}return t};var Re=/(\/):[^/(]*?\?/g,Ae=/\//g,Ee=/(\?\/+\*?)/g,De=/(:[^/?&($]+)/g,Oe=/(\*)/g,Be=s=>s.replace(Re,t=>t.replace(Ae,"(?:$|/)")),_e=s=>(s=s.replace(Ee,"?/*"),s.replace(De,t=>t.indexOf(".")<0?"([^/|?]+)":"([^/|?]+.*)")),Ue=s=>s.replace(Oe,".*"),He=(s,t)=>s+=t[t.length-1]==="*"?"":"$",It=s=>{if(!s)return"";let t=s;return t=Be(t),t=_e(t),t=Ue(t),t=He(t,s),t};var Le=0,Rt=(s,t="")=>{let e=s||"",r=typeof t=="string"&&t?t:e,n=null,i=[],o=r.match(/#\{([^}]+)\}/);o&&o[1]&&(n=o[1].trim(),r=r.replace(o[0],""),e=e.replace(o[0],""));let a=r.indexOf("?");if(a>-1){let h=r.substring(a+1);if(h.indexOf("=")>-1){let d=h.split("&");for(let m=0,q=d.length;m<q;m++){let tt=d[m];if(!tt)continue;let[he,ue=""]=tt.split("="),ct=(he||"").trim();ct&&i.push({key:ct,value:(ue||"").trim()})}r=r.substring(0,a);let y=e.indexOf("?");y>-1&&(e=e.substring(0,y))}}let c=n!==null||i.length>0;return c&&!r&&(e="*"),{uriPath:e,requiredHash:n,requiredQuery:i,hasConditions:c}},Me=s=>{if(!s)return"";let t=s.indexOf("?"),e=s.indexOf("#"),r=s.length;return t>-1&&(r=t),e>-1&&e<r&&(r=e),s.substring(0,r)},qe=s=>{if(!s)return"";let t=s.indexOf("#");return t===-1?"":s.substring(t+1)},We=s=>{if(!s)return"";let t=s.indexOf("?");if(t===-1)return"";let e=s.indexOf("#",t);return e===-1?s.substring(t+1):s.substring(t+1,e)},X=class extends pt{constructor(t,e){let r=t.baseUri,i=Rt(r,t.rawUri).uriPath,o=Pt(i),a=Tt(o),c=super(a);return this.uri=r,this.matchUri=i,this.paramKeys=o,this.titleCallBack=e,this.setupRoute(t),this.set("active",!1),c}setup(){this.stage={},this.routeId=null,this.uri=null,this.rawUri=null,this.matchUri="",this.uriQuery=/$^/,this.controller=null,this.paramKeys=[],this.requiredHash=null,this.requiredQuery=[],this.hasConditions=!1,this.titleCallBack=()=>{},this.path=null,this.referralPath=null,this.params=null,this.callBack=null,this.title=null,this.preventScroll=!1,this.scrollTo=null}setupRoute(t){this.routeId=t.id||"bs-rte-"+Le++,this.rawUri=t.rawUri||null,this.path=null,this.referralPath=null;let e=Rt(this.uri,this.rawUri||"");this.matchUri=e.uriPath,this.requiredHash=e.requiredHash,this.requiredQuery=e.requiredQuery,this.hasConditions=e.hasConditions;let r=It(this.matchUri);this.uriQuery=new RegExp("^"+r),this.params=null,this.setupComponentHelper(t),this.callBack=t.callBack,this.title=t.title,this.preventScroll=t.preventScroll||!1,this.scrollTo=t.scrollTo||null}setTitle(t){this.title=t,this.titleCallBack(this,t)}deactivate(){this.set("active",!1);let t=this.controller;t&&t.remove()}getLayout(t){if(t.component)return t.component;let e=t.import;return e?vt(e):null}setupComponentHelper(t){let e=this.getLayout(t);if(!e)return;let{container:r,persist:n,parent:i}=t,o={component:e,container:r,persist:n,parent:i},a=ft(this);this.controller=new $(a,o)}resumeRoute(t){let e=this.controller;e&&(e.container=t)}setPath(t,e){this.path=t,this.referralPath=e}select(){this.set("active",!0);let t=this.stage,e=this.callBack;typeof e=="function"&&e(t);let r=this.controller;r&&r.focus(t);let n=this.path;if(!n)return;let i=n.split("#")[1];i&&this.scrollToId(i)}scrollToId(t){if(!t)return;let e=document.getElementById(t);e&&e.scrollIntoView(!0)}match(t){let e=!1,r=this.hasConditions?Me(t):t,n=this.uriQuery||/$^/,i=r.match(n);return i===null?(this.resetParams(),e):Array.isArray(i)?this.matchConditions(t)?(this.setParams(i,1),e=i,e):(this.resetParams(),!1):e}matchConditions(t){if(!this.hasConditions)return!0;if(this.requiredHash!==null&&qe(t)!==this.requiredHash)return!1;let e=this.requiredQuery||[];if(e.length>0){let r=We(t);if(!r)return!1;let n=new URLSearchParams(r);for(let i=0,o=e.length;i<o;i++){let a=e[i];if(!n.has(a.key)||n.get(a.key)!==a.value)return!1}}return!0}resetParams(){this.stage={}}setParams(t,e=0){if(!Array.isArray(t))return;let r=this.paramKeys;if(!r)return;let n={};for(let i=0,o=r.length;i<o;i++){let a=r[i];typeof a<"u"&&(n[a]=t[i+e])}this.set(n)}getParams(){return this.stage}};var Ge=s=>{let t=/\w\S*/;return s.replace(t,e=>e.charAt(0).toUpperCase()+e.substring(1).toLowerCase())},Fe=(s,t)=>{if(s.indexOf(":")===-1)return s;let e=t.stage;for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){let n=new RegExp(":"+r,"gi");s=s.replace(n,e[r])}return s},Ne=(s,t)=>t&&(typeof t=="function"&&(t=t(s.stage)),t=Fe(t,s),Ge(t)),je=(s,t)=>(t!==""&&(s+=" - "+t),s),At=(s,t,e)=>t&&(t=Ne(s,t),je(t,e));var Et={removeSlashes(s){return typeof s!="string"?"":(s[0]==="/"&&(s=s.substring(1)),s[s.length-1]==="/"&&(s=s.substring(0,s.length-1)),s)}};var Qe=()=>typeof window<"u"?window.location:{},it=class{constructor(){this.version="1.0.2",this.baseURI="/",this.title="",this.lastPath=null,this.path=null,this.lastMatchedRoute=null,this.lastScrollGroup=null,this.currentGroupId=null,this.scrollWaitToken=0,this.history=null,this.callBackLink=null,this.location=Qe(),this.routes=[],this.switches=new Map,this.switchCount=0,this.data=new mt({path:""})}setupHistory(){this.history=V.setup(this)}createRoute(t){let e=t.uri||"*";return t.rawUri=e,t.baseUri=this.createURI(e),new X(t,this.updateTitle.bind(this))}add(t){if(typeof t!="object"){let r=arguments;t={uri:r[0],component:r[1],callBack:r[2],title:r[3],id:r[4],container:r[5]}}let e=this.createRoute(t);return this.addRoute(e),e}addRoute(t){this.routes.push(t),this.checkRoute(t,this.getPath())}resume(t,e){t.resumeRoute(e),this.addRoute(t)}getBasePath(){if(!this.basePath){let t=this.baseURI||"";t[t.length-1]!=="/"&&(t+="/"),this.basePath=t}return this.basePath}createURI(t){return this.getBasePath()+Et.removeSlashes(t)}getRoute(t){let e=this.routes,r=e.length;if(r>0)for(let n=0;n<r;n++){let i=e[n];if(i.uri===t)return i}return null}getRouteById(t){let e=this.routes,r=e.length;if(r>0)for(let n=0;n<r;n++){let i=e[n];if(i.routeId===t)return i}return!1}removeRoute(t){let e=this.routes,r=e.indexOf(t);r>-1&&e.splice(r,1),this.lastMatchedRoute===t&&(this.lastMatchedRoute=null)}addSwitch(t){let e=this.switchCount++,r=this.getSwitchGroup(e);for(let n=0,i=t.length;n<i;n++){let o=t[n];if(!o)continue;let a=this.createRoute(o);r.push(a)}return this.checkGroupForRegistration(e,r),e}resumeSwitch(t,e){let r=this.switchCount++,n=this.getSwitchGroup(r);for(let i=0,o=t.length;i<o;i++){let c=t[i].component.route;c.resumeRoute(e),n.push(c)}return this.checkGroupForRegistration(r,n),r}checkGroupForRegistration(t,e){let r=this.scrollIntent,n=this.currentGroupId;this.scrollIntent=null,this.currentGroupId=t,this.checkGroup(e,this.getPath()),this.currentGroupId=n;let i=this.scrollIntent;i&&i.type==="target"&&i.groupId!==null&&i.groupId!==void 0&&(this.lastScrollGroup=i.groupId),this.scrollIntent=r}getSwitchGroup(t){let e=this.switches.get(t);if(e)return e;let r=[];return this.switches.set(t,r),r}removeSwitch(t){this.switches.delete(t)}remove(t){t=this.createURI(t);let e=this.getRoute(t);return e&&this.removeRoute(e),this}setup(t,e){this.baseURI=t||"/",this.updateBaseTag(this.baseURI),this.title=typeof e<"u"?e:"",this.setupHistory(),this.data.path=this.getPath(),this.callBackLink=this.checkLink.bind(this),f.on("click",document,this.callBackLink);let r=this.getEndPoint();return this.navigate(r,null,!0),this}updateBaseTag(t){let e=document.getElementsByTagName("base");e.length&&(e[0].href=t)}getParentLink(t){return t.closest("a")}checkLink(t){if(t.ctrlKey===!0)return!0;let e=t.target.closest("a");if(!e||e.target==="_blank"||e.dataset.cancelRoute)return!0;let r=e.getAttribute("href");if(r!==null){let n=this.baseURI,i=n!=="/"?r.replace(n,""):r,o=e.dataset.replace==="true";return this.navigate(i,null,o),t.preventDefault(),t.stopPropagation(),!1}}reset(){let t=this.routes;for(let e=0,r=t.length;e<r;e++){let n=t[e];n&&typeof n.deactivate=="function"&&n.deactivate()}return this.routes=[],this.switches=new Map,this.switchCount=0,this.lastMatchedRoute=null,this}activate(){return this.checkActiveRoutes(),this}navigate(t,e,r){return t=this.createURI(t),this.history.addState(t,e,r),this.activate(),this}updatePath(){let t=this.getPath();this.data.path=t}updateTitle(t){if(!t||!t.title)return this;let e=t.title;return document.title=At(t,e,this.title),this}checkActiveRoutes(t){if(this.lastPath=this.path,t=t||this.getPath(),this.path=t,this.scrollIntent=null,this.scrollWaitToken++,this.lastMatchedRoute&&this.check(this.lastMatchedRoute,t))this.select(this.lastMatchedRoute);else{let e=this.routes,r=e.length;for(let n=0;n<r;n++){let i=e[n];typeof i>"u"||this.checkRoute(i,t)}}this.checkSwitches(t),this.applyScrollIntent(),this.updatePath()}checkSwitches(t){let e=this.switches;for(let[r,n]of e.entries())this.currentGroupId=r,this.checkGroup(n,t);this.currentGroupId=null}checkGroup(t,e){let r=t.length;if(!r)return;let n=null;for(let a=0;a<r;a++)if(t[a].get("active")){n=t[a];break}n&&n.match(e)===!1&&n.deactivate();let i;for(let a=0;a<r;a++){let c=t[a];if(typeof c>"u")continue;if(i){c.deactivate();continue}c.match(e)!==!1&&i===void 0&&c.controller&&(i=c,this.select(c))}let o=t[0];i||this.select(o,!0)}checkRoute(t,e){let r=this.check(t,e);return r!==!1?(this.select(t),this.lastMatchedRoute=t):t.deactivate(),r}check(t,e){return t?(e=e||this.getPath(),t.match(e)!==!1):!1}select(t,e){t&&(t.setPath(this.path,this.lastPath),t.select(),this.updateTitle(t),e!==!0&&(t.scrollTo?this.scrollIntent={type:"target",selector:t.scrollTo,groupId:this.currentGroupId}:t.preventScroll!==!0&&!this.scrollIntent&&(this.scrollIntent={type:"top"})))}applyScrollIntent(){let t=this.scrollIntent;if(this.scrollIntent=null,!t)return;if(t.type==="top"){this.lastScrollGroup=null,this.checkToScroll(),this.reassertScrollTop();return}if(t.type!=="target")return;let e=t.groupId!==null&&t.groupId!==void 0,r=e&&this.lastScrollGroup===t.groupId;r||(typeof window<"u"&&window.scrollTo(0,0),this.reassertScrollTop()),this.lastScrollGroup=e?t.groupId:null,r&&this.scrollToTarget(t.selector)}reassertScrollTop(){if(typeof window>"u"||typeof requestAnimationFrame>"u")return;let t=++this.scrollWaitToken;requestAnimationFrame(()=>{t===this.scrollWaitToken&&(window.scrollY>0||window.pageYOffset>0)&&window.scrollTo(0,0)})}scrollToTarget(t){if(typeof t!="string"||typeof document>"u")return;let e=c=>{let l=window.getComputedStyle(c),h=l.position==="sticky",d;if(h){let q=c.style.position;c.style.position="static",d=c.getBoundingClientRect().top+window.scrollY,c.style.position=q}else d=c.getBoundingClientRect().top+window.scrollY;let y=h&&parseFloat(l.top)||0,m=d-y;window.scrollY>m&&window.scrollTo(0,m)},r=document.querySelector(t);if(r){e(r);return}if(typeof requestAnimationFrame>"u")return;let n=++this.scrollWaitToken,i=30,o=0,a=()=>{if(n!==this.scrollWaitToken)return;let c=document.querySelector(t);if(c){e(c);return}++o<i&&requestAnimationFrame(a)};requestAnimationFrame(a)}checkToScroll(){this.shouldScrollToTop()&&window.scrollTo(0,0)}cleanPath(t){return t?t.split("?")[0].split("#")[0]:"/"}shouldScrollToTop(){let t=this.cleanPath(this.getPath()),r=this.cleanPath(this.lastPath).split("/"),n=t.split("/");if(r.length!==n.length)return!0;let i=r[r.length-1],o=n[n.length-1];return i!==o}getEndPoint(){return this.getPath().replace(this.baseURI,"")||"/"}destroy(){typeof this.callBackLink=="function"&&f.off("click",document,this.callBackLink)}getPath(){let t=this.location,e=this.path=t.pathname;return this.history.type==="hash"?t.hash.replace("#",""):e+t.search+t.hash}},v=new it;var Dt=(s,t)=>({attr:s,value:t}),ze=(s,t)=>{if(!t.startsWith(s))return!1;let e=t[s.length];return e===void 0||e==="/"||e==="#"||e==="."||e==="?"},ot=class extends g{beforeSetup(){this.selectedClass=this.activeClass||"active"}render(){let t=this.href,e=this.text,r=this.setupWatchers(t,e);return{tag:"a",class:this.class||this.className||null,onState:["selected",{[this.selectedClass]:!0}],href:this.getString(t),text:this.getString(e),nest:this.nest||this.children,dataStateSet:this.dataSet,"data-replace":this.replace?"true":null,watch:r}}getLinkPath(){return this?.panel?.pathname||null}getString(t){let e=typeof t;return e!=="object"&&e!=="undefined"?t:null}setupWatchers(t,e){let r=this.exact===!0,n=v.data,i=[];return t&&typeof t=="object"&&i.push(Dt("href",t)),e&&typeof e=="object"&&i.push(Dt("text",e)),i.push({value:["[[path]]",n],callBack:(o,a)=>{if(typeof a.pathname>"u")return;let c=a.pathname+a.search+a.hash,l=a.hash||a.search?c:a.pathname,h=r?o===c:ze(l,o);this.update(h)}}),i}setupStates(){return{selected:!1}}update(t){this.state&&(this.state.selected=t)}};var Ot=(s,t,e=null)=>{if(!s)return;let r=null,n=!1,i=()=>{n||(n=!0,r&&(clearTimeout(r),r=null),f.off("animationend",s,o),s&&s.classList.remove(t),e&&e())},o=a=>{a.target===s&&i()};f.on("animationend",s,o),requestAnimationFrame(()=>{if(!s){i();return}s.classList.add(t);try{let a=window.getComputedStyle(s),c=parseFloat(a.animationDuration)*1e3||1e3,l=parseFloat(a.animationDelay)*1e3||0;r=setTimeout(i,c+l+100)}catch{r=setTimeout(i,1e3)}})},Bt=(s,t,e)=>{Ot(s,t)},_t=(s,t,e)=>{let r=()=>{s&&s.remove&&s.remove()};Je(s,()=>Ot(s,t,r),e)};p.addType("manual-destroy",s=>{if(!s)return!1;s.callBack(s.ele,s.parent)});var Je=(s,t,e)=>{p.add(s,"manual-destroy",{ele:s,callBack:t,parent:e})};var M=(s,t,e,r)=>{if(Array.isArray(e[0])){e.forEach(n=>{n&&M(s,t,n,r)});return}Ye(s,t,e,r)},Ye=(s,t,e,r)=>{let n,i;if(e.length<3?[n,i]=e:[t,n,i]=e,!t||!n)return;if(typeof t.on!="function"){console.warn('Watcher directive: Data source does not have an "on" method. Make sure your component has data, state, or context.data initialized before using watchers like onSet, watch, or [[prop]] syntax.',s,t);return}let o=Ke(s,n,i,r);b.watch(s,t,n,o)},Ke=(s,t,e,r)=>typeof e=="object"?n=>{Xe(s,e,n)}:n=>{$e(s,e,t,n,r)},Ut=new WeakSet,Ve=(s,t,e)=>{!s||!s.isUnit&&!s.isComponent||Ut.has(e)||(Ut.add(e),console.warn('[Watcher] Reactive callback for "'+t+'" returned a Component/Unit instance. The entire subtree will be destroyed and recreated on every change, which can trigger expensive deep publishes during persistence/resume. Consider mounting the component once and exposing a refresh()/update() method, or returning a plain layout object instead.',e))},$e=(s,t,e,r,n)=>{let i=t(r,s,n);switch(typeof i){case"object":Ve(i,e,s),u.rebuild(i,s,n);break;case"string":let o=ht(s);if(o!=="textContent"){s.setAttribute(o,i);break}H.addHtml(s,i);break}},Xe=(s,t,e)=>{let r=Object.keys(t);for(let n=0,i=r.length;n<i;n++){let o=r[n];o&&(t[o]===e?s.classList.add(o):s.classList.remove(o))}};var _=(s,t,e)=>{let r=C(e);M(s,r,t,e)};var Ht=(s,t,e)=>{t&&s.setAttribute("role",t)},Ze=s=>(t,e)=>{let r=t?"true":"false";e.setAttribute(s,r)},Lt=(s,t,e)=>{if(!t)return;let r=t.role;r&&(s.setAttribute("role",r),t.role=null);let n=Object.keys(t);for(let i=0,o=n.length;i<o;i++){let a=n[i],c=t[a];if(c===null)continue;let l="aria-"+a;if(Array.isArray(c)){let h=c.slice();h.push(Ze(l)),_(s,h,e)}else s.setAttribute(l,c)}};var Mt=(s,t,e)=>{if(!t)return;let r=w.parse(t,e);x.addAttributes(s,r.attr,e),u.setDirectives(s,r.directives,e)};p.addType("context",s=>{if(!s)return!1;s.parent.removeContextBranch(s.branch)});var at=s=>s?s.getContext():null,qt=(s,t,e)=>{if(typeof t!="function")return;let r=at(e),n=t(r);Mt(s,n,e)},Wt=(s,t,e)=>{if(typeof t!="function")return;let r=at(e);t(r)},Gt=(s,t,e)=>{if(typeof t!="function"||!e)return;let r=at(e),n=t(r);n&&e.addContextBranch(n[0],n[1])};var Ft=(s,t,e)=>{};var Nt=(s,t,e)=>{if(!e)return;let r=e._layout?e._layout:e.render();console.log("Debug: ","ele: ",s),console.log("Data: ",t),console.log("Layout: ",r),console.log("parent: ",e)};var jt=(s,t,e)=>{},Qt=(s,t,e)=>{if(!t||!e)return;let r=t(e,s);r&&u.build(r,s,e)},zt=(s,t,e)=>{if(!t||!e)return;let r=e.getId(t);s.id=r},Jt=(s,t,e)=>{if(!t||!e)return;let r=t(e.data,s);r&&u.build(r,s,e)},Yt=(s,t,e)=>{if(!t||!e)return;let r=t(e.state,s);r&&u.build(r,s,e)},Kt=(s,t,e)=>{if(!t||!e)return;let r=e.state,n=t(r);if(!e.state){e.setStateHelper(n);return}e.addState(n)},Vt=(s,t,e)=>{if(!(!t||!e)){if(e.events||e.setEventHelper(),t[2]){let r=t[2];t[2]=n=>{r(n,e)}}e.events.on(t[0],t[1],t[2],t[3])}};var $t=(s,t,e)=>{let r,n,i;if(typeof t=="string"){if(r=C(e),!r)return;n=t}else if(Array.isArray(t))if(typeof t[0]!="object"){let o=C(e);if(!o)return;r=o,n=t[0],i=t[1]}else[r,n,i]=t;b.bind(s,r,n,i)};var Z=(s,t,e)=>{M(s,e.state,t,e)};var Xt=s=>(t,e)=>{let[r,n,i="active"]=s,o=t===n?i:"";e.dataset[r]=o},Zt=(s,t,e)=>{if(!t)return;let r=t.length-1,n=t[r],i=t.slice(0,r);i.push(Xt(n)),_(s,i,e)},te=(s,t,e)=>{if(!t)return;let r=t.length-1,n=t[r],i=t.slice(0,r);i.push(Xt(n)),Z(s,i,e)};var ee=(s,t,e)=>{let r,n,i,o;if(t.length<3){let c=C(e);if(!c)return;r=c,[n,i,o]=t}else[r,n,i,o]=t;let a=o!==!1;b.watch(s,r,n,c=>{if(u.removeAll(s),!c||c.length<1)return;let l=[];for(let h=0,d=c.length;h<d;h++){let y=a?r.scope(n+"["+h+"]"):null,m=i(c[h],h,y,l);m!==null&&l.push(m)}return u.build(l,s,e)})};var re=(s,t,e)=>{let r=t[0];if(!r||r.length<1)return;let n=t[1],i=[];for(let o=0,a=r.length;o<a;o++){let c=r[o];if(!c)continue;let l=n(c,o);l!==null&&i.push(l)}u.build(i,s,e)};var se=(s,t,e)=>{t(s,e)};p.addType("destroyed",s=>{if(!s)return!1;s.callBack(s.ele,s.parent)});var ne=(s,t,e)=>{tr(s,t,e)},tr=(s,t,e)=>{p.add(s,"destroyed",{ele:s,callBack:t,parent:e})};var ie=(s,t,e)=>{if(t)if(Array.isArray(t)&&typeof t[0]!="string")for(let r=0,n=t.length;r<n;r++)T.setup(s,t[r],e);else T.setup(s,t,e)};p.addType("routes",s=>{if(!s)return!1;let t=s.route;t&&v.removeRoute(t)});var ae=(s,t,e)=>{if(t)if(Array.isArray(t))for(let r=0,n=t.length;r<n;r++){let i=t[r];i&&oe(s,i,e)}else oe(s,t,e)},oe=(s,t,e)=>{t.container=s,t.parent=e;let r=v.add(t);er(s,r)},er=(s,t)=>{p.add(s,"routes",{route:t})};var ce=(s,t,e)=>{};p.addType("switch",s=>{if(!s)return!1;let t=s.id;v.removeSwitch(t)});var le=(s,t,e)=>{let r=t[0];for(let i=0,o=t.length;i<o;i++){let a=t[i];a&&(a.container=s,a.parent=e)}let n=v.addSwitch(t);rr(s,n)},rr=(s,t)=>{p.add(s,"switch",{id:t})};L.add("cache",jt).add("onCreated",se).add("onDestroyed",ne).add("bind",$t).add("data",Ft).add("state",ce).add("onSet",_).add("onState",Z).add("animateIn",Bt).add("animateOut",_t).add("watch",ie).add("useParent",Qt).add("useData",Jt).add("useState",Yt).add("getId",zt).add("addState",Kt).add("addEvent",Vt).add("map",re).add("for",ee).add("useContext",Wt).add("addContext",Gt).add("context",qt).add("role",Ht).add("aria",Lt).add("route",ae).add("debug",Nt).add("dataSet",Zt).add("dataStateSet",te).add("switch",le);export{L as a,W as b,g as c,gt as d,R as e,u as f,vt as g,ot as h,it as i,v as j};
2
- //# sourceMappingURL=chunk-M6RVE2QG.js.map