@lipsjs/lips 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/dist/lips.min.js +2 -2
- package/dist/lips.min.js.map +12 -13
- package/dist/test.component.min.js +28 -2
- package/dist/test.component.min.js.map +16 -14
- package/dist/test.stress.min.js +11 -11
- package/dist/test.stress.min.js.map +13 -14
- package/dist/types/component.d.ts +6 -4
- package/dist/types/i18n.d.ts +1 -2
- package/dist/types/index.d.ts +4 -2
- package/dist/types/lips.d.ts +7 -4
- package/dist/types/metrics.d.ts +48 -0
- package/dist/types/utils.d.ts +16 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -29,6 +29,7 @@ Lips is a modern, runtime-based UI framework that brings fine-grained reactivity
|
|
|
29
29
|
<script>
|
|
30
30
|
const lips = new Lips();
|
|
31
31
|
|
|
32
|
+
// <counter/> component
|
|
32
33
|
const counter = {
|
|
33
34
|
state: { count: 0 },
|
|
34
35
|
handler: {
|
|
@@ -53,20 +54,20 @@ Lips is a modern, runtime-based UI framework that brings fine-grained reactivity
|
|
|
53
54
|
### Via NPM
|
|
54
55
|
|
|
55
56
|
```bash
|
|
56
|
-
npm install @
|
|
57
|
+
npm install @lipsjs/lips
|
|
57
58
|
```
|
|
58
59
|
|
|
59
60
|
### Via CDN
|
|
60
61
|
|
|
61
62
|
```html
|
|
62
|
-
<script src="https://cdn.jsdelivr.net/npm/@
|
|
63
|
+
<script src="https://cdn.jsdelivr.net/npm/@lipsjs/lips/dist/lips.min.js"></script>
|
|
63
64
|
```
|
|
64
65
|
|
|
65
66
|
## 📖 Documentation
|
|
66
67
|
|
|
67
68
|
For comprehensive documentation, examples, and API reference, visit:
|
|
68
69
|
|
|
69
|
-
[Full Lips Documentation](https://github.com/fabrice8/lips/
|
|
70
|
+
[Full Lips Documentation](https://github.com/fabrice8/lips/blob/master/docs/index.md)
|
|
70
71
|
|
|
71
72
|
## 🏗️ Building from Source
|
|
72
73
|
|
|
@@ -131,6 +132,8 @@ This project is licensed under the MIT License - see the LICENSE file for detail
|
|
|
131
132
|
- [Bun](https://bun.sh) for the fast JavaScript runtime and bundler
|
|
132
133
|
- [Cash-DOM](https://github.com/fabiospampinato/cash) for the lightweight jQuery alternative
|
|
133
134
|
- [Stylis](https://github.com/thysultan/stylis) for the CSS preprocessor
|
|
135
|
+
- [MarkoJS](https://github.com/marko-js/marko) for their inspiring syntax declaration struture.
|
|
136
|
+
- [SolidJS](https://github.com/solidjs/solid) for the signal based reactivity concept.
|
|
134
137
|
- All contributors who have helped make Lips better
|
|
135
138
|
|
|
136
139
|
---
|
package/dist/lips.min.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var ZZ=Object.create;var{defineProperty:T1,getPrototypeOf:JZ,getOwnPropertyNames:QZ}=Object;var WZ=Object.prototype.hasOwnProperty;var s0=(Z,Q,W)=>{W=Z!=null?ZZ(JZ(Z)):{};const q=Q||!Z||!Z.__esModule?T1(W,"default",{value:Z,enumerable:!0}):W;for(let Y of QZ(Z))if(!WZ.call(q,Y))T1(q,Y,{get:()=>Z[Y],enumerable:!0});return q};var XZ=(Z,Q)=>()=>(Q||Z((Q={exports:{}}).exports,Q),Q.exports);var m0=(Z,Q)=>{for(var W in Q)T1(Z,W,{get:Q[W],enumerable:!0,configurable:!0,set:(q)=>Q[W]=()=>q})};var u0=XZ((t1,a1)=>{(function(){var Z=document,Q=window,W=Z.documentElement,q=Z.createElement.bind(Z),Y=q("div"),B=q("table"),G=q("tbody"),X=q("tr"),D=Array.isArray,O=Array.prototype,j=O.concat,E=O.filter,x=O.indexOf,A=O.map,u=O.push,i=O.slice,e=O.some,r=O.splice,c=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,d=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,k=/<.+>/,y=/^\w+$/;function $(J,H){var z=o(H);return!J||!z&&!T(H)&&!P(H)?[]:!z&&d.test(J)?H.getElementsByClassName(J.slice(1).replace(/\\/g,"")):!z&&y.test(J)?H.getElementsByTagName(J):H.querySelectorAll(J)}var K=function(){function J(H,z){if(!H)return;if(L(H))return H;var M=H;if(S(H)){var I=z||Z;if(M=c.test(H)&&T(I)?I.getElementById(H.slice(1).replace(/\\/g,"")):k.test(H)?y1(H):L(I)?I.find(H):S(I)?U(I).find(H):$(H,I),!M)return}else if(V(H))return this.ready(H);if(M.nodeType||M===Q)M=[M];this.length=M.length;for(var N=0,f=this.length;N<f;N++)this[N]=M[N]}return J.prototype.init=function(H,z){return new J(H,z)},J}(),w=K.prototype,U=w.init;if(U.fn=U.prototype=w,w.length=0,w.splice=r,typeof Symbol==="function")w[Symbol.iterator]=O[Symbol.iterator];function L(J){return J instanceof K}function C(J){return!!J&&J===J.window}function T(J){return!!J&&J.nodeType===9}function o(J){return!!J&&J.nodeType===11}function P(J){return!!J&&J.nodeType===1}function h(J){return!!J&&J.nodeType===3}function v(J){return typeof J==="boolean"}function V(J){return typeof J==="function"}function S(J){return typeof J==="string"}function _(J){return J===void 0}function R(J){return J===null}function F(J){return!isNaN(parseFloat(J))&&isFinite(J)}function g(J){if(typeof J!=="object"||J===null)return!1;var H=Object.getPrototypeOf(J);return H===null||H===Object.prototype}U.isWindow=C,U.isFunction=V,U.isArray=D,U.isNumeric=F,U.isPlainObject=g;function b(J,H,z){if(z){var M=J.length;while(M--)if(H.call(J[M],M,J[M])===!1)return J}else if(g(J)){var I=Object.keys(J);for(var M=0,N=I.length;M<N;M++){var f=I[M];if(H.call(J[f],f,J[f])===!1)return J}}else for(var M=0,N=J.length;M<N;M++)if(H.call(J[M],M,J[M])===!1)return J;return J}U.each=b,w.each=function(J){return b(this,J)},w.empty=function(){return this.each(function(J,H){while(H.firstChild)H.removeChild(H.firstChild)})};function s(){var J=[];for(var H=0;H<arguments.length;H++)J[H]=arguments[H];var z=v(J[0])?J.shift():!1,M=J.shift(),I=J.length;if(!M)return{};if(!I)return s(z,U,M);for(var N=0;N<I;N++){var f=J[N];for(var m in f)if(z&&(D(f[m])||g(f[m]))){if(!M[m]||M[m].constructor!==f[m].constructor)M[m]=new f[m].constructor;s(z,M[m],f[m])}else M[m]=f[m]}return M}U.extend=s,w.extend=function(J){return s(w,J)};var l=/\S+/g;function p(J){return S(J)?J.match(l)||[]:[]}w.toggleClass=function(J,H){var z=p(J),M=!_(H);return this.each(function(I,N){if(!P(N))return;b(z,function(f,m){if(M)H?N.classList.add(m):N.classList.remove(m);else N.classList.toggle(m)})})},w.addClass=function(J){return this.toggleClass(J,!0)},w.removeAttr=function(J){var H=p(J);return this.each(function(z,M){if(!P(M))return;b(H,function(I,N){M.removeAttribute(N)})})};function D0(J,H){if(!J)return;if(S(J)){if(arguments.length<2){if(!this[0]||!P(this[0]))return;var z=this[0].getAttribute(J);return R(z)?void 0:z}if(_(H))return this;if(R(H))return this.removeAttr(J);return this.each(function(I,N){if(!P(N))return;N.setAttribute(J,H)})}for(var M in J)this.attr(M,J[M]);return this}w.attr=D0,w.removeClass=function(J){if(arguments.length)return this.toggleClass(J,!1);return this.attr("class","")},w.hasClass=function(J){return!!J&&e.call(this,function(H){return P(H)&&H.classList.contains(J)})},w.get=function(J){if(_(J))return i.call(this);return J=Number(J),this[J<0?J+this.length:J]},w.eq=function(J){return U(this.get(J))},w.first=function(){return this.eq(0)},w.last=function(){return this.eq(-1)};function Z0(J){if(_(J))return this.get().map(function(H){return P(H)||h(H)?H.textContent:""}).join("");return this.each(function(H,z){if(!P(z))return;z.textContent=J})}w.text=Z0;function n(J,H,z){if(!P(J))return;var M=Q.getComputedStyle(J,null);return z?M.getPropertyValue(H)||void 0:M[H]||J.style[H]}function q0(J,H){return parseInt(n(J,H),10)||0}function v0(J,H){return q0(J,"border".concat(H?"Left":"Top","Width"))+q0(J,"padding".concat(H?"Left":"Top"))+q0(J,"padding".concat(H?"Right":"Bottom"))+q0(J,"border".concat(H?"Right":"Bottom","Width"))}var T0={};function C0(J){if(T0[J])return T0[J];var H=q(J);Z.body.insertBefore(H,null);var z=n(H,"display");return Z.body.removeChild(H),T0[J]=z!=="none"?z:"block"}function K0(J){return n(J,"display")==="none"}function _0(J,H){var z=J&&(J.matches||J.webkitMatchesSelector||J.msMatchesSelector);return!!z&&!!H&&z.call(J,H)}function R0(J){return S(J)?function(H,z){return _0(z,J)}:V(J)?J:L(J)?function(H,z){return J.is(z)}:!J?function(){return!1}:function(H,z){return z===J}}w.filter=function(J){var H=R0(J);return U(E.call(this,function(z,M){return H.call(z,M,z)}))};function P0(J,H){return!H?J:J.filter(H)}w.detach=function(J){return P0(this,J).each(function(H,z){if(z.parentNode)z.parentNode.removeChild(z)}),this};var T5=/^\s*<(\w+)[^>]*>/,R5=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,k1={"*":Y,tr:G,td:X,th:X,thead:B,tbody:B,tfoot:B};function y1(J){if(!S(J))return[];if(R5.test(J))return[q(RegExp.$1)];var H=T5.test(J)&&RegExp.$1,z=k1[H]||k1["*"];return z.innerHTML=J,U(z.childNodes).detach().get()}U.parseHTML=y1,w.has=function(J){var H=S(J)?function(z,M){return $(J,M).length}:function(z,M){return M.contains(J)};return this.filter(H)},w.not=function(J){var H=R0(J);return this.filter(function(z,M){return(!S(J)||P(M))&&!H.call(M,z,M)})};function F0(J,H,z,M){var I=[],N=V(H),f=M&&R0(M);for(var m=0,U0=J.length;m<U0;m++)if(N){var W0=H(J[m]);if(W0.length)u.apply(I,W0)}else{var Y0=J[m][H];while(Y0!=null){if(M&&f(-1,Y0))break;I.push(Y0),Y0=z?Y0[H]:null}}return I}function v1(J){if(J.multiple&&J.options)return F0(E.call(J.options,function(H){return H.selected&&!H.disabled&&!H.parentNode.disabled}),"value");return J.value||""}function $5(J){if(!arguments.length)return this[0]&&v1(this[0]);return this.each(function(H,z){var M=z.multiple&&z.options;if(M||n1.test(z.type)){var I=D(J)?A.call(J,String):R(J)?[]:[String(J)];if(M)b(z.options,function(N,f){f.selected=I.indexOf(f.value)>=0},!0);else z.checked=I.indexOf(z.value)>=0}else z.value=_(J)||R(J)?"":J})}w.val=$5,w.is=function(J){var H=R0(J);return e.call(this,function(z,M){return H.call(z,M,z)})},U.guid=1;function j0(J){return J.length>1?E.call(J,function(H,z,M){return x.call(M,H)===z}):J}U.unique=j0,w.add=function(J,H){return U(j0(this.get().concat(U(J,H).get())))},w.children=function(J){return P0(U(j0(F0(this,function(H){return H.children}))),J)},w.parent=function(J){return P0(U(j0(F0(this,"parentNode"))),J)},w.index=function(J){var H=J?U(J)[0]:this[0],z=J?this:U(H).parent().children();return x.call(z,H)},w.closest=function(J){var H=this.filter(J);if(H.length)return H;var z=this.parent();if(!z.length)return H;return z.closest(J)},w.siblings=function(J){return P0(U(j0(F0(this,function(H){return U(H).parent().children().not(H)}))),J)},w.find=function(J){return U(j0(F0(this,function(H){return $(J,H)})))};var A5=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,_5=/^$|^module$|\/(java|ecma)script/i,x5=["type","src","nonce","noModule"];function b5(J,H){var z=U(J);z.filter("script").add(z.find("script")).each(function(M,I){if(_5.test(I.type)&&W.contains(I)){var N=q("script");N.text=I.textContent.replace(A5,""),b(x5,function(f,m){if(I[m])N[m]=I[m]}),H.head.insertBefore(N,null),H.head.removeChild(N)}})}function h5(J,H,z,M,I){if(M)J.insertBefore(H,z?J.firstChild:null);else if(J.nodeName==="HTML")J.parentNode.replaceChild(H,J);else J.parentNode.insertBefore(H,z?J:J.nextSibling);if(I)b5(H,J.ownerDocument)}function S0(J,H,z,M,I,N,f,m){return b(J,function(U0,W0){b(U(W0),function(Y0,$0){b(U(H),function(M0,o0){var C1=z?$0:o0,P1=z?o0:$0,B0=z?Y0:M0;h5(C1,!B0?P1:P1.cloneNode(!0),M,I,!B0)},m)},f)},N),H}w.after=function(){return S0(arguments,this,!1,!1,!1,!0,!0)},w.append=function(){return S0(arguments,this,!1,!1,!0)};function f5(J){if(!arguments.length)return this[0]&&this[0].innerHTML;if(_(J))return this;var H=/<script[\s>]/.test(J);return this.each(function(z,M){if(!P(M))return;if(H)U(M).empty().append(J);else M.innerHTML=J})}w.html=f5,w.appendTo=function(J){return S0(arguments,this,!0,!1,!0)},w.wrapInner=function(J){return this.each(function(H,z){var M=U(z),I=M.contents();I.length?I.wrapAll(J):M.append(J)})},w.before=function(){return S0(arguments,this,!1,!0)},w.wrapAll=function(J){var H=U(J),z=H[0];while(z.children.length)z=z.firstElementChild;return this.first().before(H),this.appendTo(z)},w.wrap=function(J){return this.each(function(H,z){var M=U(J)[0];U(z).wrapAll(!H?M:M.cloneNode(!0))})},w.insertAfter=function(J){return S0(arguments,this,!0,!1,!1,!1,!1,!0)},w.insertBefore=function(J){return S0(arguments,this,!0,!0)},w.prepend=function(){return S0(arguments,this,!1,!0,!0,!0,!0)},w.prependTo=function(J){return S0(arguments,this,!0,!0,!0,!1,!1,!0)},w.contents=function(){return U(j0(F0(this,function(J){return J.tagName==="IFRAME"?[J.contentDocument]:J.tagName==="TEMPLATE"?J.content.childNodes:J.childNodes})))},w.next=function(J,H,z){return P0(U(j0(F0(this,"nextElementSibling",H,z))),J)},w.nextAll=function(J){return this.next(J,!0)},w.nextUntil=function(J,H){return this.next(H,!0,J)},w.parents=function(J,H){return P0(U(j0(F0(this,"parentElement",!0,H))),J)},w.parentsUntil=function(J,H){return this.parents(H,J)},w.prev=function(J,H,z){return P0(U(j0(F0(this,"previousElementSibling",H,z))),J)},w.prevAll=function(J){return this.prev(J,!0)},w.prevUntil=function(J,H){return this.prev(H,!0,J)},w.map=function(J){return U(j.apply([],A.call(this,function(H,z){return J.call(H,z,H)})))},w.clone=function(){return this.map(function(J,H){return H.cloneNode(!0)})},w.offsetParent=function(){return this.map(function(J,H){var z=H.offsetParent;while(z&&n(z,"position")==="static")z=z.offsetParent;return z||W})},w.slice=function(J,H){return U(i.call(this,J,H))};var g5=/-([a-z])/g;function D1(J){return J.replace(g5,function(H,z){return z.toUpperCase()})}w.ready=function(J){var H=function(){return setTimeout(J,0,U)};if(Z.readyState!=="loading")H();else Z.addEventListener("DOMContentLoaded",H);return this},w.unwrap=function(){return this.parent().each(function(J,H){if(H.tagName==="BODY")return;var z=U(H);z.replaceWith(z.children())}),this},w.offset=function(){var J=this[0];if(!J)return;var H=J.getBoundingClientRect();return{top:H.top+Q.pageYOffset,left:H.left+Q.pageXOffset}},w.position=function(){var J=this[0];if(!J)return;var H=n(J,"position")==="fixed",z=H?J.getBoundingClientRect():this.offset();if(!H){var M=J.ownerDocument,I=J.offsetParent||M.documentElement;while((I===M.body||I===M.documentElement)&&n(I,"position")==="static")I=I.parentNode;if(I!==J&&P(I)){var N=U(I).offset();z.top-=N.top+q0(I,"borderTopWidth"),z.left-=N.left+q0(I,"borderLeftWidth")}}return{top:z.top-q0(J,"marginTop"),left:z.left-q0(J,"marginLeft")}};var m1={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};w.prop=function(J,H){if(!J)return;if(S(J)){if(J=m1[J]||J,arguments.length<2)return this[0]&&this[0][J];return this.each(function(M,I){I[J]=H})}for(var z in J)this.prop(z,J[z]);return this},w.removeProp=function(J){return this.each(function(H,z){delete z[m1[J]||J]})};var k5=/^--/;function j1(J){return k5.test(J)}var F1={},y5=Y.style,v5=["webkit","moz","ms"];function m5(J,H){if(H===void 0)H=j1(J);if(H)return J;if(!F1[J]){var z=D1(J),M="".concat(z[0].toUpperCase()).concat(z.slice(1)),I="".concat(z," ").concat(v5.join("".concat(M," "))).concat(M).split(" ");b(I,function(N,f){if(f in y5)return F1[J]=f,!1})}return F1[J]}var u5={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function u1(J,H,z){if(z===void 0)z=j1(J);return!z&&!u5[J]&&F(H)?"".concat(H,"px"):H}function d5(J,H){if(S(J)){var z=j1(J);if(J=m5(J,z),arguments.length<2)return this[0]&&n(this[0],J,z);if(!J)return this;return H=u1(J,H,z),this.each(function(I,N){if(!P(N))return;if(z)N.style.setProperty(J,H);else N.style[J]=H})}for(var M in J)this.css(M,J[M]);return this}w.css=d5;function d1(J,H){try{return J(H)}catch(z){return H}}var i5=/^\s+|\s+$/;function i1(J,H){var z=J.dataset[H]||J.dataset[D1(H)];if(i5.test(z))return z;return d1(JSON.parse,z)}function c5(J,H,z){z=d1(JSON.stringify,z),J.dataset[D1(H)]=z}function p5(J,H){if(!J){if(!this[0])return;var z={};for(var M in this[0].dataset)z[M]=i1(this[0],M);return z}if(S(J)){if(arguments.length<2)return this[0]&&i1(this[0],J);if(_(H))return this;return this.each(function(I,N){c5(N,J,H)})}for(var M in J)this.data(M,J[M]);return this}w.data=p5;function c1(J,H){var z=J.documentElement;return Math.max(J.body["scroll".concat(H)],z["scroll".concat(H)],J.body["offset".concat(H)],z["offset".concat(H)],z["client".concat(H)])}b([!0,!1],function(J,H){b(["Width","Height"],function(z,M){var I="".concat(H?"outer":"inner").concat(M);w[I]=function(N){if(!this[0])return;if(C(this[0]))return H?this[0]["inner".concat(M)]:this[0].document.documentElement["client".concat(M)];if(T(this[0]))return c1(this[0],M);return this[0]["".concat(H?"offset":"client").concat(M)]+(N&&H?q0(this[0],"margin".concat(z?"Top":"Left"))+q0(this[0],"margin".concat(z?"Bottom":"Right")):0)}})}),b(["Width","Height"],function(J,H){var z=H.toLowerCase();w[z]=function(M){if(!this[0])return _(M)?void 0:this;if(!arguments.length){if(C(this[0]))return this[0].document.documentElement["client".concat(H)];if(T(this[0]))return c1(this[0],H);return this[0].getBoundingClientRect()[z]-v0(this[0],!J)}var I=parseInt(M,10);return this.each(function(N,f){if(!P(f))return;var m=n(f,"boxSizing");f.style[z]=u1(z,I+(m==="border-box"?v0(f,!J):0))})}});var p1="___cd";w.toggle=function(J){return this.each(function(H,z){if(!P(z))return;var M=K0(z),I=_(J)?M:J;if(I){if(z.style.display=z[p1]||"",K0(z))z.style.display=C0(z.tagName)}else if(!M)z[p1]=n(z,"display"),z.style.display="none"})},w.hide=function(){return this.toggle(!1)},w.show=function(){return this.toggle(!0)};var o1="___ce",I1=".",L1={focus:"focusin",blur:"focusout"},s1={mouseenter:"mouseover",mouseleave:"mouseout"},o5=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function V1(J){return s1[J]||L1[J]||J}function N1(J){var H=J.split(I1);return[H[0],H.slice(1).sort()]}w.trigger=function(J,H){if(S(J)){var z=N1(J),M=z[0],I=z[1],N=V1(M);if(!N)return this;var f=o5.test(N)?"MouseEvents":"HTMLEvents";J=Z.createEvent(f),J.initEvent(N,!0,!0),J.namespace=I.join(I1),J.___ot=M}J.___td=H;var m=J.___ot in L1;return this.each(function(U0,W0){if(m&&V(W0[J.___ot]))W0["___i".concat(J.type)]=!0,W0[J.___ot](),W0["___i".concat(J.type)]=!1;W0.dispatchEvent(J)})};function l1(J){return J[o1]=J[o1]||{}}function s5(J,H,z,M,I){var N=l1(J);N[H]=N[H]||[],N[H].push([z,M,I]),J.addEventListener(H,I)}function r1(J,H){return!H||!e.call(H,function(z){return J.indexOf(z)<0})}function p0(J,H,z,M,I){var N=l1(J);if(!H)for(H in N)p0(J,H,z,M,I);else if(N[H])N[H]=N[H].filter(function(f){var m=f[0],U0=f[1],W0=f[2];if(I&&W0.guid!==I.guid||!r1(m,z)||M&&M!==U0)return!0;J.removeEventListener(H,W0)})}w.off=function(J,H,z){var M=this;if(_(J))this.each(function(N,f){if(!P(f)&&!T(f)&&!C(f))return;p0(f)});else if(!S(J))for(var I in J)this.off(I,J[I]);else{if(V(H))z=H,H="";b(p(J),function(N,f){var m=N1(f),U0=m[0],W0=m[1],Y0=V1(U0);M.each(function($0,M0){if(!P(M0)&&!T(M0)&&!C(M0))return;p0(M0,Y0,W0,H,z)})})}return this},w.remove=function(J){return P0(this,J).detach().off(),this},w.replaceWith=function(J){return this.before(J).remove()},w.replaceAll=function(J){return U(J).replaceWith(this),this};function l5(J,H,z,M,I){var N=this;if(!S(J)){for(var f in J)this.on(f,H,z,J[f],I);return this}if(!S(H))if(_(H)||R(H))H="";else if(_(z))z=H,H="";else M=z,z=H,H="";if(!V(M))M=z,z=void 0;if(!M)return this;return b(p(J),function(m,U0){var W0=N1(U0),Y0=W0[0],$0=W0[1],M0=V1(Y0),o0=Y0 in s1,C1=Y0 in L1;if(!M0)return;N.each(function(P1,B0){if(!P(B0)&&!T(B0)&&!C(B0))return;var S1=function(X0){if(X0.target["___i".concat(X0.type)])return X0.stopImmediatePropagation();if(X0.namespace&&!r1($0,X0.namespace.split(I1)))return;if(!H&&(C1&&(X0.target!==B0||X0.___ot===M0)||o0&&X0.relatedTarget&&B0.contains(X0.relatedTarget)))return;var E1=B0;if(H){var x0=X0.target;while(!_0(x0,H)){if(x0===B0)return;if(x0=x0.parentNode,!x0)return}E1=x0}Object.defineProperty(X0,"currentTarget",{configurable:!0,get:function(){return E1}}),Object.defineProperty(X0,"delegateTarget",{configurable:!0,get:function(){return B0}}),Object.defineProperty(X0,"data",{configurable:!0,get:function(){return z}});var e5=M.call(E1,X0,X0.___td);if(I)p0(B0,M0,$0,H,S1);if(e5===!1)X0.preventDefault(),X0.stopPropagation()};S1.guid=M.guid=M.guid||U.guid++,s5(B0,M0,$0,H,S1)})}),this}w.on=l5;function r5(J,H,z,M){return this.on(J,H,z,M,!0)}w.one=r5;var n5=/\r?\n/g;function t5(J,H){return"&".concat(encodeURIComponent(J),"=").concat(encodeURIComponent(H.replace(n5,"\r\n")))}var a5=/file|reset|submit|button|image/i,n1=/radio|checkbox/i;if(w.serialize=function(){var J="";return this.each(function(H,z){b(z.elements||[z],function(M,I){if(I.disabled||!I.name||I.tagName==="FIELDSET"||a5.test(I.type)||n1.test(I.type)&&!I.checked)return;var N=v1(I);if(!_(N)){var f=D(N)?N:[N];b(f,function(m,U0){J+=t5(I.name,U0)})}})}),J.slice(1)},typeof t1!=="undefined")a1.exports=U;else Q.cash=Q.$=U})()});var e1=s0(u0(),1);class l0{default=window.navigator.language;LANGUAGE_DICTIONARIES={};setLang(Z){if(this.default!==Z)return this.default=Z,!0;return!1}setDictionary(Z,Q){this.LANGUAGE_DICTIONARIES[Z]=Q}translate(Z,Q){if(Q&&this.default==Q)return{text:Z,lang:this.default};Q=Q||this.default;const[W,q]=Q.split("-");if(this.LANGUAGE_DICTIONARIES[W]&&Z in this.LANGUAGE_DICTIONARIES[W]){if(typeof this.LANGUAGE_DICTIONARIES[W][Z]==="object"){const Y=this.LANGUAGE_DICTIONARIES[W][Z];Z=Y[q||"*"]||Y["*"]}else if(typeof this.LANGUAGE_DICTIONARIES[W][Z]==="string")Z=this.LANGUAGE_DICTIONARIES[W][Z]}return{text:Z,lang:Q}}propagate(Z){const Q=this;function W(){const q=e1.default(this),Y=q.html(),B=q.attr("title"),G=q.attr("placeholder");let X;if(!/<\//.test(Y)&&q.text()){const{text:D,lang:O}=Q.translate(q.text());q.text(D),X=O}if(B){const{text:D,lang:O}=Q.translate(B);q.attr("title",D),X=O}if(G){const{text:D,lang:O}=Q.translate(G);q.attr("placeholder",D),X=O}X&&q.attr("lang",X)}return Z.children().each(W),Z}}class r0{pendingComponents=new Set;isPending=!1;callbacks=new Map;register(Z,Q){this.callbacks.set(Z,Q)}unregister(Z){this.callbacks.delete(Z)}queue(Z){if(!this.callbacks.has(Z))return;if(this.pendingComponents.add(Z),!this.isPending)this.isPending=!0,this.schedule()}schedule(){Promise.resolve().then(()=>this.process())}process(){const Z=Array.from(this.pendingComponents);this.pendingComponents.clear(),this.isPending=!1,Z.forEach((Q)=>{try{const W=this.callbacks.get(Q);if(W)W()}catch(W){console.error(`Error updating component ${Q}:`,W)}})}clear(){this.pendingComponents.clear(),this.isPending=!1}dispose(){this.pendingComponents.clear(),this.callbacks.clear(),this.isPending=!1}}class n0{subscriptions=new Map;tick=new r0;register(Z,Q){this.subscriptions.set(Z,Q),this.tick.register(Z,Q)}unregister(Z){this.subscriptions.delete(Z),this.tick.unregister(Z)}queueUpdate(Z){this.tick.queue(Z)}dispose(){this.subscriptions.clear(),this.tick.dispose()}prepareForPotentialUnload(){this.tick.clear(),this.subscriptions.forEach((Z,Q)=>{this.subscriptions.set(Q,()=>{})})}proxyState(Z,Q){const W=this,q=new WeakMap,Y=(G)=>{if(G instanceof Map)G.forEach((D,O)=>G.set(O,B(D)));else if(Array.isArray(G))G.forEach((D,O)=>G[O]=B(D));else if(typeof G==="object")Object.entries(G).forEach(([D,O])=>G[D]=B(O));let X=new Proxy(G,{get(D,O){if(O==="toJSON")return function(){const E=(x)=>{if(!x||typeof x!=="object")return x;if(q.has(x)){const A=q.get(x);if(A instanceof Map){const i={};return A.forEach((e,r)=>i[typeof r==="object"?JSON.stringify(r):String(r)]=E(e)),i}if(Array.isArray(A))return A.map((i)=>E(i));const u={};return Object.entries(A).forEach(([i,e])=>u[i]=E(e)),u}if(typeof x.toJSON==="function"&&!q.has(x))return x.toJSON();return x};return E(X)};if(O==="reset")return function(){X=null};const j=D[O];if(G instanceof Map&&typeof j==="function")return function(...E){const x=O.toString();if(x==="set"&&E.length>=2)E[1]=B(E[1]);const A=j.apply(D,E);return["set","delete","clear"].includes(x)&&W.queueUpdate(Z),A};if(Array.isArray(G)&&typeof j==="function")return function(...E){const x=O.toString();if(["push","unshift"].includes(x))E=E.map((u)=>B(u));else if(x==="splice"&&E.length>2)E=[E[0],E[1],...E.slice(2).map((u)=>B(u))];const A=j.apply(D,E);return["push","pop","shift","unshift","splice","sort","reverse","fill"].includes(x)&&W.queueUpdate(Z),A};return j},set(D,O,j){if(D[O]===j)return!0;if(j instanceof Map&&D[O]instanceof Map){const E=D[O];return E.clear(),j.forEach((x,A)=>E.set(A,B(x))),W.queueUpdate(Z),!0}return D[O]=B(j),W.queueUpdate(Z),!0}});return q.set(X,G),X},B=(G)=>{if(!G)return G;return G instanceof Map||Array.isArray(G)||typeof G==="object"?Y(G):G};return Y(Q)}}class t0{domObserver;observedComponents=new Map;TIMEOUT=1e4;constructor(){this.domObserver=new MutationObserver(()=>{this.observedComponents.forEach((Z,Q)=>{try{const W=Q.node;if(!W){this.unwatch(Q);return}if(Z.type==="attach"&&document.contains(W[0]))this.unwatch(Q),Q.emit("component:attached",Q),typeof Q.onAttach=="function"&&Q.onAttach.bind(Q)();else if(Z.type==="detach"&&!document.contains(W[0]))this.unwatch(Q),Q.emit("component:detached",Q),typeof Q.onDetach=="function"&&Q.onDetach.bind(Q)()}catch(W){console.log("DWS error --",W)}}),!this.observedComponents.size&&this.domObserver.disconnect()})}watch(Z,Q="attach"){const W=Z.node;if(!W)return;if(Q==="attach"&&document.contains(W[0])){Z.emit("component:attached",Z),typeof Z.onAttach=="function"&&Z.onAttach.bind(Z)();return}if(Q==="detach"&&!document.contains(W[0])){Z.emit("component:detached",Z),typeof Z.onDetach=="function"&&Z.onDetach.bind(Z)();return}this.unwatch(Z);const q=setTimeout(()=>{this.unwatch(Z),Z.emit(`component:${Q}ment-timeout`,Z)},this.TIMEOUT);this.observedComponents.set(Z,{timeout:q,type:Q}),this.observedComponents.size===1&&this.domObserver.observe(document.body,{childList:!0,subtree:!0}),Q==="attach"&&Z.once("component:attached",()=>this.watch(Z,"detach"))}unwatch(Z){const Q=this.observedComponents.get(Z);if(Q)clearTimeout(Q.timeout),this.observedComponents.delete(Z);!this.observedComponents.size&&this.domObserver.disconnect()}dispose(){this.domObserver.disconnect(),this.observedComponents.forEach((Z)=>clearTimeout(Z.timeout)),this.observedComponents.clear()}}class a0{pending=new Set;isPending=!1;component;metrics={batchCount:0,updatesProcessed:0,lastBatchSize:0,avgBatchSize:"0.00"};constructor(Z){this.component=Z}queue(Z){if(this.pending.add(Z),this.component.benchmark.inc("dependencyUpdateCount"),!this.isPending)this.isPending=!0,this.scheduleProcessing()}scheduleProcessing(){Promise.resolve().then(()=>this.processQueue())}processQueue(){const Z=Array.from(this.pending);if(this.metrics.batchCount++,this.metrics.lastBatchSize=Z.length,this.metrics.updatesProcessed+=Z.length,this.metrics.avgBatchSize=(this.metrics.updatesProcessed/this.metrics.batchCount).toFixed(2),this.pending.clear(),this.component.benchmark.trackBatch(Z.length),this.applyUpdates(Z),this.isPending=!1,this.pending.size>0)this.isPending=!0,this.scheduleProcessing()}applyUpdates(Z){Z.forEach(({dep:Q,dependent:W})=>{try{const q=W.update(W.memo,"batch-updator");if(q)typeof q.memo==="object"&&this.component.FGUD.get(Q)?.set(W.path,{...W,memo:q.memo}),typeof q.cleanup==="function"&&q.cleanup()}catch(q){console.error("Failed to update dependency --",q)}})}getMetrics(){return{batchCount:this.metrics.batchCount,lastBatchSize:this.metrics.lastBatchSize,avgBatchSize:this.metrics.avgBatchSize,totalUpdates:this.metrics.updatesProcessed}}}class e0{options={emit:!0};__events={};__once_events={};constructor(Z){if(Z)this.options=Z}on(Z,Q){if(!Array.isArray(this.__events[Z]))this.__events[Z]=[];return this.__events[Z].push(Q),this}once(Z,Q){if(!Array.isArray(this.__once_events[Z]))this.__once_events[Z]=[];return this.__once_events[Z].push(Q),this}off(Z){return delete this.__events[Z],delete this.__once_events[Z],this}emit(Z,...Q){if(!this.options.emit)return;const W=Q.map((q)=>typeof q.toJSON==="function"?q.toJSON():q);this.__events[Z]?.forEach((q)=>q(...W)),this.__once_events[Z]?.forEach((q)=>q(...W)),delete this.__once_events[Z]}}var t=s0(u0(),1);var R1=s0(u0(),1);function H0(Z,Q){if(Z===Q)return!1;if(typeof Z!=="object"||typeof Q!=="object")return!1;if(Z===null||Q===null)return!0;if(Z instanceof Set){if(!(Q instanceof Set))return!0;if(Z.size!==Q.size)return!0;if(Z5(Z)&&Z5(Q)){for(let G of Z)if(!Q.has(G))return!0;return!1}const B=new WeakMap;for(let G of Z){let X=!1;if(typeof G!=="object"){if(Q.has(G))X=!0}else for(let D of Q){if(typeof D!=="object")continue;if(!B.has(G))B.set(G,new WeakMap);const O=B.get(G);if(O.has(D)){if(X=O.get(D),X)break;continue}const j=!H0(G,D);if(O.set(D,j),j){X=!0;break}}if(!X)return!0}return!1}if(Z instanceof Map){if(!(Q instanceof Map))return!0;if(Z.size!==Q.size)return!0;if(J5(Z)&&J5(Q)){for(let[G,X]of Z)if(Q.get(G)!==X)return!0;return!1}const B=new WeakMap;for(let[G,X]of Z){if(typeof G!=="object"){if(!Q.has(G))return!0;const j=Q.get(G);if(typeof X!=="object"){if(X!==j)return!0;continue}if(typeof j!=="object"||H0(X,j))return!0;continue}let D=!1,O=!1;for(let[j,E]of Q){if(typeof j!=="object")continue;if(!B.has(G))B.set(G,new WeakMap);const x=B.get(G);if(x.has(j)){const[A,u]=x.get(j);if(A){D=!0,O=u;break}continue}if(!H0(G,j)){if(D=!0,O=typeof X==="object"&&typeof E==="object"?!H0(X,E):X===E,x.set(j,[!0,O]),O)break}else x.set(j,[!1,!1])}if(!D||!O)return!0}return!1}if(Array.isArray(Z)){if(!Array.isArray(Q))return!0;if(Z.length!==Q.length)return!0;for(let B=0;B<Z.length;B++){const G=Z[B],X=Q[B];if(G!==X&&(typeof G!=="object"||H0(G,X)))return!0}return!1}const W=Object.keys(Z),q=Object.keys(Q);if(W.length!==q.length)return!0;W.sort(),q.sort();const Y=W.length;for(let B=0;B<Y;B++)if(W[B]!==q[B])return!0;for(let B=0;B<Y;B++){const G=W[B],X=Z[G],D=Q[G];if(X===D)continue;if(X instanceof Date){if(!(D instanceof Date)||String(X)!==String(D))return!0;continue}if(X instanceof RegExp){if(!(D instanceof RegExp)||X.source!==D.source||X.flags!==D.flags)return!0;continue}if(X instanceof Map){if(!(D instanceof Map)||H0(X,D))return!0;continue}if(X instanceof Set){if(!(D instanceof Set)||H0(X,D))return!0;continue}if(X instanceof Function){if(!(D instanceof Function))return!0;continue}if(typeof X==="object"){if(typeof D!=="object")return!0;if(X===Z){if(D!==Q)return!0}else if(H0(X,D))return!0}else return!0}return!1}function E0(Z,Q){if(Z===Q)return!0;if(Z==null||Q==null)return Z===Q;const W=typeof Z;if(W!==typeof Q)return!1;if(W!=="object"){if(W==="number"&&isNaN(Z)&&isNaN(Q))return!0;return!1}if(Z instanceof Date)return Q instanceof Date&&Z.getTime()===Q.getTime();if(Z instanceof RegExp)return Q instanceof RegExp&&Z.source===Q.source&&Z.flags===Q.flags;if(Z instanceof Error)return Q instanceof Error&&Z.name===Q.name&&Z.message===Q.message&&(Z.stack===Q.stack||!Z.stack&&!Q.stack);if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView(Z)){if(!ArrayBuffer.isView(Q))return!1;if(Z.byteLength!==Q.byteLength)return!1;const X=new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength),D=new Uint8Array(Q.buffer,Q.byteOffset,Q.byteLength);for(let O=0;O<X.length;O++)if(X[O]!==D[O])return!1;return!0}if(Z instanceof Promise||Z instanceof WeakMap||Z instanceof WeakSet)return Z===Q;if(typeof Z==="function"){if(typeof Q!=="function")return!1;return Z.toString()===Q.toString()&&Z.name===Q.name}if(Z.constructor!==Q.constructor)return!1;if(Z instanceof Map||Z instanceof Set||Array.isArray(Z)||Object.getPrototypeOf(Z)===Object.prototype)return!H0(Z,Q);const Y=Object.getPrototypeOf(Z);if(Y!==Object.getPrototypeOf(Q))return!1;const B=Object.getOwnPropertyNames(Z),G=Object.getOwnPropertyNames(Q);if(B.length!==G.length)return!1;for(let X of B){if(!Object.prototype.hasOwnProperty.call(Q,X))return!1;if(!E0(Z[X],Q[X]))return!1}if(Y!==null&&Y!==Object.prototype){const X=Object.getOwnPropertyNames(Y),D=Object.getOwnPropertyNames(Object.getPrototypeOf(Q));if(X.length!==D.length)return!1;for(let O of X){if(O==="constructor")continue;if(!E0(Y[O],Object.getPrototypeOf(Q)[O]))return!1}}return!0}var Z5=function(Z){for(let Q of Z)if(typeof Q==="object"&&Q!==null)return!1;return!0},J5=function(Z){for(let[Q,W]of Z)if(typeof Q==="object"&&Q!==null||typeof W==="object"&&W!==null)return!1;return!0};function J0(Z,Q=new WeakMap){if(Z===null||typeof Z!=="object"||Z instanceof Promise)return Z;if(Q.has(Z))return Q.get(Z);if(Z instanceof Date)return new Date(Z.getTime());if(Z instanceof RegExp)return new RegExp(Z.source,Z.flags);if(Z instanceof Map){const Y=new Map;return Q.set(Z,Y),Z.forEach((B,G)=>Y.set(J0(G,Q),J0(B,Q))),Y}if(Z instanceof Set){const Y=new Set;return Q.set(Z,Y),Z.forEach((B)=>Y.add(J0(B,Q))),Y}if(Array.isArray(Z)){const Y=[];Q.set(Z,Y);for(let B=0;B<Z.length;B++)Y[B]=J0(Z[B],Q);return Y}if(ArrayBuffer.isView(Z))return new Z.constructor(Z);const W=Object.create(Object.getPrototypeOf(Z));Q.set(Z,W);const q=Object.getOwnPropertySymbols(Z);for(let Y of q)W[Y]=J0(Z[Y],Q);for(let Y in Z)if(Object.prototype.hasOwnProperty.call(Z,Y))W[Y]=J0(Z[Y],Q);return W}function W5(Z,Q){if(!Z||typeof Z!=="object")throw new TypeError("Original argument must be an object");if(!Q||typeof Q!=="object")throw new TypeError("ToSet argument must be an object");if(!Object.keys(Q).length)return{...Z};function W(Y,B,G){const X=B.split(/\.|\[|\]/).filter(Boolean);let D=Y;for(let O=0;O<X.length;O++){const j=X[O],E=!isNaN(Number(j)),x=O===X.length-1,A=!isNaN(Number(X[O+1]));if(x){D[j]=G;continue}if(!(j in D))D[j]=A?[]:{};else if(A&&!Array.isArray(D[j]))D[j]=[];else if(!A&&Array.isArray(D[j]))D[j]={};D=D[j]}}const q=J0(Z);try{for(let[Y,B]of Object.entries(Q)){if(typeof Y!=="string")throw new TypeError(`Invalid path: ${Y}`);if(!/^[a-zA-Z0-9_\-\[\].]+$/.test(Y))throw new Error(`Invalid path format: ${Y}`);W(q,Y,B)}}catch(Y){throw new Error(`Failed to assign value: ${Y.message}`)}return q}R1.default.fn.extend({attrs:function(){const Z={},Q=this[0];return Q&&Q.nodeType!==Node.TEXT_NODE&&R1.default.each(Q.attributes,function(){Z[this.name]=this.value}),Z}});var I0="syn:",O0="fn:",A0="on-",a=/^\.\.\./,Z1=/^\[(.*?)\]$/,Q5=["@html","@text"];class J1{debug;initialStats={renderCount:0,elementCount:0,renderTime:0,avgRenderTime:0,maxRenderTime:0,componentCount:0,componentUpdateCount:0,partialCount:0,partialUpdateCount:0,memoryUsage:void 0,domOperations:0,domInsertsCount:0,domUpdatesCount:0,domRemovalsCount:0,dependencyTrackCount:0,dependencyUpdateCount:0,batchSize:0,batchCount:0,errorCount:0};stats=this.reset();renderStartTime=0;renderTimes=[];measurementCount=0;maxMeasurements=100;loggingInterval=10;autoSaveInterval;constructor(Z=!1){if(this.debug=Z,this.debug)this.autoSaveInterval=window.setInterval(()=>this.storeMetrics(),5000)}storeMetrics(){try{const Z=JSON.parse(localStorage.getItem("lipsPerformanceMetrics")||"[]");Z.push({timestamp:Date.now(),metrics:{...this.stats}}),Z.length>100&&Z.shift(),localStorage.setItem("lipsPerformanceMetrics",JSON.stringify(Z))}catch(Z){}}startRender(){if(!this.debug)return;this.renderStartTime=performance.now()}endRender(){if(!this.debug||this.renderStartTime===0)return;const Z=performance.now()-this.renderStartTime;this.stats.renderTime=Z,this.stats.maxRenderTime=Math.max(this.stats.maxRenderTime,Z),this.renderTimes.push(Z),this.renderTimes.length>this.maxMeasurements&&this.renderTimes.shift(),this.stats.avgRenderTime=this.renderTimes.reduce((Q,W)=>Q+W,0)/this.renderTimes.length,this.renderStartTime=0,this.measurementCount++}inc(Z){if(!this.debug)return;if(typeof this.stats[Z]==="number")this.stats[Z]++}dec(Z){if(!this.debug)return;if(typeof this.stats[Z]==="number"&&this.stats[Z]>0)this.stats[Z]--}record(Z,Q){if(!this.debug)return;if(typeof this.stats[Z]!=="undefined")this.stats[Z]=Q}add(Z,Q){if(!this.debug)return;if(typeof this.stats[Z]==="number")this.stats[Z]+=Q}reset(){return this.renderTimes=[],this.measurementCount=0,this.stats=J0(this.initialStats)}log(){if(!this.debug)return;if(this.loggingInterval>1&&this.measurementCount%this.loggingInterval!==0)return;const Z={"Render Count":this.stats.renderCount,"Element Count":this.stats.elementCount,"Avg Render Time (ms)":this.stats.avgRenderTime.toFixed(2),"Max Render Time (ms)":this.stats.maxRenderTime.toFixed(2)},Q={"Component Count":this.stats.componentCount,"Component Updates":this.stats.componentUpdateCount},W={"Partial Count":this.stats.partialCount,"Partial Updates":this.stats.partialUpdateCount},q={"DOM Operations":this.stats.domOperations,"DOM Inserts":this.stats.domInsertsCount,"DOM Updates":this.stats.domUpdatesCount,"DOM Removals":this.stats.domRemovalsCount},Y={"Dependencies Tracked":this.stats.dependencyTrackCount,"Dependency Updates":this.stats.dependencyUpdateCount},B={"Batch Count":this.stats.batchCount,"Avg Batch Size":this.stats.batchCount>0?(this.stats.batchSize/this.stats.batchCount).toFixed(2):"0"};console.group("Lips Framework Performance Metrics"),console.table(Z),console.table(Q),console.table(W),console.table(q),console.table(Y),console.table(B),this.stats.memoryUsage&&console.log(`Memory Usage: ${this.stats.memoryUsage.toFixed(2)} MB`),this.stats.errorCount>0&&console.warn(`Errors encountered: ${this.stats.errorCount}`),console.groupEnd(),window.localStorage&&this.measurementCount%10===0&&this.storeMetrics()}trackMemory(){if(!this.debug||!window.performance?.memory)return;this.stats.memoryUsage=window.performance.memory.usedJSHeapSize/1048576}trackBatch(Z){if(!this.debug)return;this.stats.batchCount++,this.stats.batchSize+=Z}trackError(Z){if(!this.debug)return;this.stats.errorCount++,console.error("Lips Framework Error:",Z)}setLoggingInterval(Z){if(!this.debug)return;this.loggingInterval=Z}getSnapshot(){return J0(this.stats)}dispose(){if(!this.debug)return;this.autoSaveInterval&&clearInterval(this.autoSaveInterval)}}var C5=s0(u0(),1);var Q1="comm",W1="rule",X1="decl";var X5="@import";var H5="@namespace",q5="@keyframes";var z5="@layer";function H1(Z){return Z.trim()}function b0(Z,Q,W){return Z.replace(Q,W)}function Y5(Z,Q,W){return Z.indexOf(Q,W)}function L0(Z,Q){return Z.charCodeAt(Q)|0}function V0(Z,Q,W){return Z.slice(Q,W)}function z0(Z){return Z.length}function q1(Z){return Z.length}function h0(Z,Q){return Q.push(Z),Z}var $1=Math.abs,d0=String.fromCharCode;function Y1(Z,Q,W,q,Y,B,G,X){return{value:Z,root:Q,parent:W,type:q,props:Y,children:B,line:z1,column:f0,length:G,return:"",siblings:X}}function G5(){return Q0}function w5(){if(Q0=G0>0?L0(k0,--G0):0,f0--,Q0===10)f0=1,z1--;return Q0}function w0(){if(Q0=G0<B5?L0(k0,G0++):0,f0++,Q0===10)f0=1,z1++;return Q0}function N0(){return L0(k0,G0)}function i0(){return G0}function B1(Z,Q){return V0(k0,Z,Q)}function g0(Z){switch(Z){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function K5(Z){return z1=f0=1,B5=z0(k0=Z),G0=0,[]}function U5(Z){return k0="",Z}function G1(Z){return H1(B1(G0-1,A1(Z===91?Z+2:Z===40?Z+1:Z)))}function M5(Z){while(Q0=N0())if(Q0<33)w0();else break;return g0(Z)>2||g0(Q0)>3?"":" "}function O5(Z,Q){while(--Q&&w0())if(Q0<48||Q0>102||Q0>57&&Q0<65||Q0>70&&Q0<97)break;return B1(Z,i0()+(Q<6&&N0()==32&&w0()==32))}function A1(Z){while(w0())switch(Q0){case Z:return G0;case 34:case 39:if(Z!==34&&Z!==39)A1(Q0);break;case 40:if(Z===41)A1(Z);break;case 92:w0();break}return G0}function D5(Z,Q){while(w0())if(Z+Q0===57)break;else if(Z+Q0===84&&N0()===47)break;return"/*"+B1(Q,G0-1)+"*"+d0(Z===47?Z:w0())}function j5(Z){while(!g0(N0()))w0();return B1(Z,G0)}var z1=1,f0=1,B5=0,G0=0,Q0=0,k0="";function L5(Z){return U5(w1("",null,null,null,[""],Z=K5(Z),0,[0],Z))}function w1(Z,Q,W,q,Y,B,G,X,D){var O=0,j=0,E=G,x=0,A=0,u=0,i=1,e=1,r=1,c=0,d="",k=Y,y=B,$=q,K=d;while(e)switch(u=c,c=w0()){case 40:if(u!=108&&L0(K,E-1)==58){if(Y5(K+=b0(G1(c),"&","&\f"),"&\f",$1(O?X[O-1]:0))!=-1)r=-1;break}case 34:case 39:case 91:K+=G1(c);break;case 9:case 10:case 13:case 32:K+=M5(u);break;case 92:K+=O5(i0()-1,7);continue;case 47:switch(N0()){case 42:case 47:if(h0(qZ(D5(w0(),i0()),Q,W,D),D),(g0(u||1)==5||g0(N0()||1)==5)&&z0(K)&&V0(K,-1,void 0)!==" ")K+=" ";break;default:K+="/"}break;case 123*i:X[O++]=z0(K)*r;case 125*i:case 59:case 0:switch(c){case 0:case 125:e=0;case 59+j:if(r==-1)K=b0(K,/\f/g,"");if(A>0&&(z0(K)-E||i===0&&u===47))h0(A>32?I5(K+";",q,W,E-1,D):I5(b0(K," ","")+";",q,W,E-2,D),D);break;case 59:K+=";";default:if(h0($=F5(K,Q,W,O,j,Y,X,d,k=[],y=[],E,B),B),c===123)if(j===0)w1(K,Q,$,$,k,B,E,X,y);else{switch(x){case 99:if(L0(K,3)===110)break;case 108:if(L0(K,2)===97)break;default:j=0;case 100:case 109:case 115:}if(j)w1(Z,$,$,q&&h0(F5(Z,$,$,0,0,Y,X,d,Y,k=[],E,y),y),Y,y,E,X,q?k:y);else w1(K,$,$,$,[""],y,0,X,y)}}O=j=A=0,i=r=1,d=K="",E=G;break;case 58:E=1+z0(K),A=u;default:if(i<1){if(c==123)--i;else if(c==125&&i++==0&&w5()==125)continue}switch(K+=d0(c),c*i){case 38:r=j>0?1:(K+="\f",-1);break;case 44:X[O++]=(z0(K)-1)*r,r=1;break;case 64:if(N0()===45)K+=G1(w0());x=N0(),j=E=z0(d=K+=j5(i0())),c++;break;case 45:if(u===45&&z0(K)==2)i=0}}return B}function F5(Z,Q,W,q,Y,B,G,X,D,O,j,E){var x=Y-1,A=Y===0?B:[""],u=q1(A);for(var i=0,e=0,r=0;i<q;++i)for(var c=0,d=V0(Z,x+1,x=$1(e=G[i])),k=Z;c<u;++c)if(k=H1(e>0?A[c]+" "+d:b0(d,/&\f/g,A[c])))D[r++]=k;return Y1(Z,Q,W,Y===0?W1:X,D,O,j,E)}function qZ(Z,Q,W,q){return Y1(Z,Q,W,Q1,d0(G5()),V0(Z,2,-2),0,q)}function I5(Z,Q,W,q,Y){return Y1(Z,Q,W,X1,V0(Z,0,q),V0(Z,q+1,-1),q,Y)}function K1(Z,Q){var W="";for(var q=0;q<Z.length;q++)W+=Q(Z[q],q,Z,Q)||"";return W}function V5(Z,Q,W,q){switch(Z.type){case z5:if(Z.children.length)break;case X5:case H5:case X1:return Z.return=Z.return||Z.value;case Q1:return"";case q5:return Z.return=Z.value+"{"+K1(Z.children,q)+"}";case W1:if(!z0(Z.value=Z.props.join(",")))return""}return z0(W=K1(Z.children,q))?Z.return=Z.value+"{"+W+"}":""}function N5(Z){var Q=q1(Z);return function(W,q,Y,B){var G="";for(var X=0;X<Q;X++)G+=Z[X](W,q,Y,B)||"";return G}}class U1{nsp;settings;$head;constructor(Z,Q){if(typeof Z!=="string")throw new Error("Undefined or invalid styles attachement element(s) namespace");this.nsp=Z,this.$head=C5.default("head"),this.settings=Q||{},this.settings&&this.load(this.settings)}compile(Z){try{return K1(L5(Z),N5([V5]))}catch(Q){throw new Error(`Style compilation failed: ${Q.message}`)}}waitForStyles(Z){return new Promise((Q)=>{const W=new MutationObserver(()=>{const q=document.querySelector(Z);if(q&&getComputedStyle(q).cssText)W.disconnect(),Q()});W.observe(document.documentElement,{attributes:!0,childList:!0,subtree:!0})})}async inject(Z){if(!Z)throw new Error("Invalid injection arguments");const Q=`rel="${this.settings.meta?"@":""}${this.nsp}"`;Z=this.settings.meta?Z:`[rel="${this.nsp}"] { ${Z} }`;try{const W=this.compile(Z);if(!W)throw new Error(`<component:${this.nsp}> sheet compilation failed`);const q=document.createElement("style");q.setAttribute("rel",`${this.settings.meta?"@":""}${this.nsp}`),q.textContent=W;let Y=0;const B=this.$head.find(`style[${Q}]`);if(B.length)Y=parseInt(B.attr("dindex"))+1,B.remove();return q.setAttribute("dindex",String(Y)),this.settings.meta?document.head.prepend(q):document.head.appendChild(q),q}catch(W){throw new Error(`Style injection failed: ${W.message}`)}}async load(Z){if(this.settings=Z,typeof this.settings!=="object")throw new Error("Undefined styles settings");if(this.settings.sheet){const Q=await this.inject(this.settings.sheet);await this.waitForStyles(`style[rel="${this.settings.meta?"@":""}${this.nsp}"]`)}}get(){}async clear(){const Z=this.$head.find(`style[rel="${this.settings.meta?"@":""}${this.nsp}"]`);if(!Z.length)return;const Q=parseInt(Z.attr("dindex"));Q===0?Z.remove():Z.attr("dindex",String(Q-1))}async custom(){return{}}async style(){return{}}}var zZ=function(Z){const Q=/on-([a-zA-Z-]+)\s*\(/g;let W=Z,q;while((q=Q.exec(Z))!==null){const Y=q[1],B=q.index+q[0].length;let G=1,X=B;while(X<Z.length&&G>0){if(Z[X]==="(")G++;if(Z[X]===")")G--;X++}if(G===0){const D=Z.slice(B,X-1).trim(),O=Z.slice(0,q.index),j=`${A0}${Y}="${D}"`,E=Z.slice(X);W=O+j+E,Z=W,Q.lastIndex=O.length+j.length}}return W},YZ=function(Z){const Q=[];let q=Z.replace(/<([a-zA-Z][a-zA-Z0-9_-]*)((?:[^>'"]*|'[^']*'|"[^"]*")*?)(?:\/?>)/g,(Y,B,G)=>{return Q.push(G),`<${B}##TAG_ATTRS_${Q.length-1}##>`});for(let Y=0;Y<Q.length;Y++){const B=`##TAG_ATTRS_${Y}##`,G=Q[Y],X=BZ(G);q=q.replace(B,X)}return q},BZ=function(Z){let Q="",W=0,q=!1,Y="",B=0,G=0,X=0;while(W<Z.length){const D=Z[W];if((D==='"'||D==="'")&&(W===0||Z[W-1]!=="\\")){if(!q)q=!0,Y=D;else if(D===Y)q=!1}if(!q){if(D==="(")G++;else if(D===")")G--;else if(D==="{")X++;else if(D==="}")X--}if(!q&&G===0&&X===0&&(D===" "||W===Z.length-1)){let O=W;if(W===Z.length-1)O=W+1;const j=Z.substring(B,O).trim();if(j){const E=GZ(j);Q+=" "+E}B=W+1}W++}return Q},GZ=function(Z){const Q=Z.indexOf("=");if(Q===-1){if(Z.startsWith("...")||Z.startsWith("["))return Z;return`:${Z}="${!Z.startsWith("!")}"`}let W=Z.substring(0,Q).trim(),q=Z.substring(Q+1).trim();if(W.startsWith("@"))return W=!Q5.includes(W)?W.slice(1):W,`:${W}=${q}`;if(W.startsWith(O0)||W.startsWith(A0))return Z;if(q.startsWith('"')&&q.endsWith('"')||q.startsWith("'")&&q.endsWith("'")){const Y=q.substring(1,q.length-1);if(wZ(Y))return`:${W}="${Y}"`;return Z}else return`:${W}="${q}"`};function wZ(Z){if(/\bstate\.|\binput\.|\bself\.|\bcontext\./.test(Z))return!0;if(/[\+\*\/\%\(\)\{\}\[\]]|\?\s*:/.test(Z))return!0;if(/\b[a-zA-Z_][a-zA-Z0-9_]*\.[a-zA-Z_]/.test(Z))return!0;if(Z.includes("{")&&Z.includes("}"))return!0;return!1}function _1(Z){let Q=(Z||"").trim().replace(/>\s*</g,"><").replace(/\s{2,}/g," ").replace(/[\r\n\t]/g,"").replace(/<([a-zA-Z0-9_-]+)([^>]*?)\s*\/>/g,"<$1$2></$1>").replace(/<\{([^}]+)\}\s*(.*?)\/>/g,'<lips dtag="$1" $2></lips>').replace(/(<>)([\s\S]*?)(<\/>)/g,'<lips fragment="true">$2</lips>').replace(/<if\(\s*(.*?)\s*\)>/g,'<if @by="$1">').replace(/<else-if\(\s*(.*?)\s*\)>/g,'<else-if @by="$1">').replace(/<switch\(\s*(.*?)\s*\)>/g,'<switch @by="$1">').replace(/<async await\(\s*(.*?)\s*\)>/g,`<async ${O0}await="\$1">`).replace(/<log\(\s*(.*?)\s*\)>/g,'<log @args="$1">').replace(/\[(.*?)\]/g,(W)=>W.replace(/\s+/g,""));return Q=zZ(Q),Q=YZ(Q),Q}var KZ=function(Z,Q){if(Z.isDisposed)return;Q.add(Z),Z.dependencies.add(Q)},S5=function(Z){for(let Q of Z.dependencies)Q.delete(Z);Z.dependencies.clear()};function y0(Z,Q={maxSize:100}){const W=new Set,q=[{value:Z,timestamp:Date.now()}];let Y=0;const B=()=>{const O=M1[M1.length-1];return O&&KZ(O,W),q[Y].value},G=()=>{const O=[...W];if(P5)for(let j of O)P5.add(j);else for(let j of O)j.execute()};return[B,(O,j)=>{if(Object.is(q[Y].value,O))return;if(Y<q.length-1)q.splice(Y+1);if(q.push({value:O,timestamp:Date.now(),metadata:j}),q.length>Q.maxSize)q.shift(),Y=Math.max(0,Y-1);else Y++;G()},{undo(){if(Y>0)Y--,G()},redo(){if(Y<q.length-1)Y++,G()},jumpTo(O){if(O>=0&&O<q.length&&O!==Y)Y=O,G()},getHistory(){return[...q]},getCurrentIndex(){return Y},canUndo(){return Y>0},canRedo(){return Y<q.length-1},clear(){const O=q[0];q.length=0,q.push(O),Y=0,G()}}]}function O1(Z){let Q=!1;const W=()=>{if(Q)throw new Error("Circular dependency detected");if(q.isDisposed)return;Q=!0,S5(q),M1.push(q);try{Z()}finally{Q=!1,M1.pop()}},q={execute:W,dependencies:new Set,isDisposed:!1};return W(),{dispose:()=>{q.isDisposed=!0,S5(q)}}}var M1=[],P5=null;class c0 extends e0{declaration;$=null;input;state;static;context;__name__;__path__;__template__;__previous;__stylesheet;__macros=new Map;__renderCache=new Map;FGUD=new Map;PCC=new Map;VER=[];prepath="0";debug=!1;isRendered=!1;__setInput;__setState;__getState;UQS;ICE;lips;benchmark;__path="";__pathCounter=0;__renderDepth=0;constructor(Z,Q,{input:W,state:q,context:Y,_static:B,handler:G,stylesheet:X,macros:D,declaration:O},j){super();if(this.lips=j.lips,j?.debug)this.debug=j.debug;if(j?.prepath)this.prepath=j.prepath;if(this.__name__=Z,this.__path__=`${this.prepath}/${this.__name__}`,this.__template__=_1(Q),this.declaration=O||{name:Z},this.input=W||{},this.static=B||{},this.context={},this.state=this.lips.IUC.proxyState(this.__path__,q||{}),D&&this.setMacros(D),G&&this.setHandler(G),X&&this.setStylesheet(X),this.benchmark=new J1(this.debug),this.benchmark.inc("componentCount"),this.UQS=new a0(this),typeof this.onCreate=="function"&&this.onCreate.bind(this)(),this.emit("component:create",this),this.input&&Object.keys(this.input).length&&typeof this.onInput=="function")this.onInput.bind(this)(this.input),this.emit("component:input",this);this.__previous={input:J0(this.input),state:J0(this.state),context:J0(this.context)};const[E,x]=y0(this.input),[A,u]=y0(this.state),[i,e]=y0(this.context);this.__setInput=x,this.__setState=u,this.__getState=A,this.lips.IUC.register(this.__path__,()=>{H0(this.__previous?.state,this.state)&&this.__setState({...this.__getState(),...this.state})}),Array.isArray(Y)&&Y.length&&this.lips.useContext(Y,(r)=>{if(!H0(this.context,r))return;e(r),this.context=r,typeof this.onContext=="function"&&this.onContext.bind(this)(),this.emit("component:context",this)}),this.ICE=O1(()=>{const r=E(),c=A(),d=this.context=i();if(!this.isRendered){this.benchmark.reset();const{$log:k}=this.render("",void 0,void 0,this.FGUD);this.$=k,!O?.syntax&&this.$?.each((y,$)=>typeof $.setAttribute=="function"&&$.setAttribute("rel",this.__name__)),this.isRendered=!0,typeof this.onMount=="function"&&this.onMount.bind(this)(),this.emit("component:mount",this),this.lips.watcher.watch(this)}else this.__updateDepNodes__({state:c,input:r,context:d},this.__previous),typeof this.onUpdate=="function"&&this.onUpdate.bind(this)(),this.emit("component:update",this),this.__previous={input:J0(r),state:J0(c),context:J0(d)},this.input=r;this.benchmark.log(),typeof this.onRender=="function"&&this.onRender.bind(this)(),this.emit("component:render",this)})}setContext(Z,Q){this.lips.setContext(Z,Q)}setInput(Z){if(!H0(this.input,Z))return;this.__setInput(Z),typeof this.onInput=="function"&&this.onInput.bind(this)(Z)}subInput(Z){if(typeof Z!=="object")throw new Error("Invalid sub input data argument");return this.setInput(W5(this.input,Z)),this}setMacros(Z){const Q=_1(Z),W=t.default(Q);if(!W.length)return;const q=this;W.each(function(){const Y=t.default(this),{argv:B,attrs:G}=q.__getAttributes__(Y);if(!Object.keys(G))throw new Error("Invalid macro component definition");if(!G.literals.name)throw new Error("Undefined macro `name` attribute.");if(q.__macros.get(G.literals.name))console.warn(`Duplicate macro <${G.literals.name}> will be override`);if(!Y.contents()?.length)throw new Error("Invalid macro component definition. Template content expected.");q.__macros.set(G.literals.name,{argv:B,$node:Y})})}setHandler(Z){Object.entries(Z).map(([Q,W])=>this[Q]=W.bind(this))}setStylesheet(Z){const Q={sheet:Z,meta:this.__name__==="__ROOT__"};this.__stylesheet=new U1(this.__name__,Q)}get node(){if(!this.$)throw new Error("node() is expected to be call after component get rendered");return this.$}find(Z){return this.$?.find(Z)}render(Z,Q,W={},q,Y){const B=q||new Map,G=[];if(Q&&!Q.length)return console.warn("Undefined node element to render"),{$log:Q,dependencies:B};this.benchmark.startRender();const X=this;let D=t.default();function O(K){const w=j(K);return X.__pathCounter++,X.__path?`${X.__path}/${w}`:`${Z?Z+"/":"#"}${w}`}function j(K){return(K==="component"?"c":"")+X.__pathCounter}function E(K){return K!==null&&typeof K==="object"&&typeof K.mesh==="function"&&typeof K.update==="function"}function x(K){return K!==null&&typeof K==="object"&&typeof K.default&&typeof K.default==="string"}function A(K){if(!K.attr(":dtag")||K.prop("tagName")!=="LIPS")throw new Error("Invalid dynamic tag name");const w=K.attr(":dtag"),U=X.__evaluate__(w,W);if(E(U)||U===null)return r(K,w,U);else if(x(U))return c(K,{template:U});else return c(K,{name:U})}function u(K){const w=K.attr(":args"),U=O("log");if(!w)return;if(X.__evaluate__(`console.log(${w})`,W),X.__isReactive__(w,W))X.__extractExpressionDeps__(w,W).forEach((C)=>X.__trackDep__(B,C,{$fragment:null,path:U,update:(T)=>X.__evaluate__(`console.log(${w})`,T),memo:W,batch:!0}))}function i(K){const w=O("var"),{attrs:U}=X.__getAttributes__(K);if(!U)return;Object.entries(U.literals).forEach(([L,C])=>{if(W[L]&&W[L].type==="const")throw new Error(`Cannot override <const ${L}=[value]/> variable`);W[L]={value:C,type:"let"}}),Object.entries(U.expressions).forEach(([L,C])=>{if(a.test(L)){const T=(P,h)=>{const v=X.__evaluate__(L.replace(a,""),h||W);if(typeof v!=="object")throw new Error(`Invalid spread operator ${L}`);for(let V in v){if(W[V]&&W[V].type==="const")throw new Error(`Cannot override <const ${V}=[value]/> variable`);if(W[V]={value:v[V],type:"let"},h)h[V]=W[V],X.__updateVarDepNodes__(V,w,h)}if(P)return{memo:h}};X.__extractExpressionDeps__(L,W).forEach((P)=>X.__trackDep__(B,P,{$fragment:null,path:`${w}.${L}`,update:(h)=>T(!0,h),memo:W,batch:!0})),T()}else if(C){if(X.__isReactive__(C,W)){const T=X.__extractExpressionDeps__(C,W),o=(P,h)=>{if(W[L]&&W[L].type==="const")throw new Error(`Cannot override <const ${L}=[value]/> variable`);return P[L]=W[L]={value:X.__evaluate__(C,P),type:"let"},X.__updateVarDepNodes__(L,w,P),{memo:P}};T.forEach((P)=>X.__trackDep__(B,P,{$fragment:null,path:`${w}.${L}`,update:o,memo:W,batch:!0}))}if(W[L]&&W[L].type==="const")throw new Error(`Cannot override <const ${L}=[value]/> variable`);W[L]={value:X.__evaluate__(C,W),type:"let"}}}),X.benchmark.inc("elementCount")}function e(K){const{attrs:w}=X.__getAttributes__(K);if(!w)return;Object.entries(w.literals).forEach(([U,L])=>{if(W[U]&&W[U].type==="const")throw new Error(`<const ${U}=[value]/> variable already defined`);if(!L)return;W[U]={value:L,type:"const"}}),Object.entries(w.expressions).forEach(([U,L])=>{if(a.test(U)){const C=X.__evaluate__(U.replace(a,""),W);if(typeof C!=="object")throw new Error(`Invalid spread operator ${U}`);for(let T in C){if(W[T]&&W[T].type==="const")throw new Error(`<const ${T}=[value]/> by spread operator ${U}. [${T}] variable already defined`);W[T]={value:C[T],type:"const"}}}else{if(W[U]&&W[U].type==="const")throw new Error(`<const ${U}=[value]/> variable already defined`);if(!L)return;W[U]={value:X.__evaluate__(L,W),type:"const"}}}),X.benchmark.inc("elementCount")}function r(K,w,U){const{attrs:L}=X.__getAttributes__(K),C=O("element"),T=X.__getBoundaries__(C);let o=t.default(T.start),P={},h=U;if(h){L.literals&&Object.entries(L.literals).forEach(([V,S])=>P[V]={type:"arg",value:S}),L.expressions&&Object.entries(L.expressions).forEach(([V,S])=>{if(!h)return;if(a.test(V)){const _=X.__evaluate__(V.replace(a,""),W);if(typeof _!=="object")throw new Error(`Invalid spread operator ${V}`);for(let R in _){if(R!=="#"&&!h.argv.includes(R))continue;P[R]={type:"arg",value:_[R]}}}else{if(V!=="#"&&!h.argv.includes(V))return;P[V]={type:"arg",value:S?X.__evaluate__(S,W):!0}}});const v=h.mesh(P);if(v&&v.length)o=o.add(v);L.expressions&&Object.entries(L.expressions).forEach(([V,S])=>{if(!h)return;if(a.test(V)&&X.__isReactive__(V,W)){const _=X.__extractExpressionDeps__(V,W),R=(F,g)=>{if(!h)return;const b={},s=X.__evaluate__(V.replace(a,""),F);if(typeof s!=="object")throw new Error(`Invalid spread operator ${V}`);const l=[];for(let p in s){if(p!=="#"&&!h.argv.includes(p))continue;P[p]=b[p]={type:"arg",value:s[p]},(!F[p]||!E0(s[p],F[p].value))&&l.push(p)}l.length&&h.update(l,b,T)};_.forEach((F)=>X.__trackDep__(B,F,{$fragment:null,boundaries:T,path:`${C}.${V}`,update:R,memo:W,batch:!0}))}else if((V==="#"||h.argv.includes(V))&&X.__isReactive__(S,W)){const _=X.__extractExpressionDeps__(S,W),R=(F,g)=>{if(!h)return;const b=P[V]={type:"arg",value:S?X.__evaluate__(S,F):!0};h.update([V],{[V]:b},T)};_.forEach((F)=>X.__trackDep__(B,F,{$fragment:null,boundaries:T,path:`${C}.${V}`,update:R,memo:W,batch:!0}))}})}if(X.__isReactive__(w,W)){const v=(S,_)=>{const R=X.__evaluate__(w,S);let F;if(x(R))F=c(K,{template:R});else if(E(R))P="#"in P?{...S,...P["#"].value}:{...S,...P},h=R,F=h?h.mesh(P):null;if(!document.contains(T.start)||!document.contains(T.end))throw new Error("Dynamic element boundaries not found");const g=[];let b=T.start.nextSibling;while(b&&b!==T.end)g.push(b),b=b.nextSibling;t.default(g).remove(),F&&t.default(T.start).after(F)};X.__extractExpressionDeps__(w,W).forEach((S)=>X.__trackDep__(B,S,{$fragment:null,boundaries:T,path:C,update:v,batch:!0,memo:{...W,...P}}))}return o=o.add(T.end),o}function c(K,w){let U,L;if(w?.template)U=w.template,L=j("component");else{if(L=w?.name||K.prop("tagName")?.toLowerCase(),!L)throw new Error("Invalid component");if(L===X.__name__)throw new Error("Render component within itself is forbidden");U=X.lips.import(L)}if(!U||!L)throw new Error(`<${L}> template not found`);const C=O("component"),T=X.__getBoundaries__(C),{argv:o,attrs:P,events:h}=X.__getAttributes__(K),v={};let V={},S=t.default(T.start),_=X.PCC.get(C);P.literals&&Object.entries(P.literals).forEach(([F,g])=>{if(F=="key")return;V[F]=g}),P.functions&&Object.entries(P.functions).forEach(([F,g])=>{V[F]=X.__evaluateFunction__(g,[],W),U.declaration?.syntax?v[I0+O0+F]=g:v[O0+F]=g}),P.expressions&&Object.entries(P.expressions).forEach(([F,g])=>{if(F=="key")return;if(a.test(F)){const b=X.__evaluate__(F.replace(a,""),W);if(typeof b!=="object")throw new Error(`Invalid spread operator ${F}`);for(let s in b)V[s]=b[s]}else V[F]=g?X.__evaluate__(g,W):!0;U.declaration?.syntax?v[I0+F]=g:v[F]=g});const R=K.contents();if(R.length){if(V={...V,...X.__meshwire__({$node:K,fragmentPath:C,fragmentBoundaries:T,meshPath:null,argv:o,scope:W,xmlns:Y,useAttributes:!0,declaration:U.declaration},v)},U.declaration){if(U.declaration.tags)Object.entries(U.declaration?.tags).forEach(([F,{type:g,many:b}])=>{switch(g){case"nexted":{let s=K.next(F);if(!s.length)return;if(b){V[F]=[];let l=0,p=!1;while(!p){if(V[F].push(X.__meshwire__({$node:s,meshPath:`${F}[${l}]`,fragmentPath:C,fragmentBoundaries:T,argv:o,scope:W,xmlns:Y,useAttributes:!0,declaration:U.declaration},v)),!s.next(F).length){p=!0;break}s=s.next(F),l++}}else V[F]=X.__meshwire__({$node:s,meshPath:F,fragmentPath:C,fragmentBoundaries:T,argv:o,scope:W,xmlns:Y,useAttributes:!0,declaration:U.declaration},v)}break;case"child":{const s=K.children(F);if(b)V[F]=[],s.each(function(l){const p=t.default(this),{argv:D0}=X.__getAttributes__(p);V[F].push(X.__meshwire__({$node:p,meshPath:`${F}[${l}]`,fragmentPath:C,fragmentBoundaries:T,argv:D0,scope:W,xmlns:Y,useAttributes:!0,declaration:U.declaration},v))});else if(K.children(F).first().length){const l=K.children(F).first(),{argv:p}=X.__getAttributes__(l);V[F]=X.__meshwire__({$node:l,meshPath:F,fragmentPath:C,fragmentBoundaries:T,argv:p,scope:W,xmlns:Y,useAttributes:!0,declaration:U.declaration},v)}}break}});else if(U.declaration.contents)V.__contents__=R}}if(_)_.setInput(J0(V)),S=S.add(_.node);else{const{declaration:F,state:g,_static:b,handler:s,context:l,default:p,stylesheet:D0}=U;_=new c0(L,p||"",{state:J0(g),input:J0(V),context:l,_static:J0(b),handler:s,stylesheet:D0,declaration:F},{debug:X.debug,lips:X.lips,prepath:C}),S=S.add(_.node),X.PCC.set(C,_),Object.entries(h).forEach(([Z0,n])=>!!_&&X.__attachEvent__(_,Z0,n,W)),v&&Object.entries(v).forEach(([Z0,n])=>{let q0=!1,v0=!1;if(Z0.startsWith(I0))q0=!0,Z0=Z0.replace(I0,"");if(Z0.startsWith(O0))v0=!0,Z0=Z0.replace(O0,"");if(a.test(Z0)){const T0=(C0)=>{const K0={},_0=X.__evaluate__(Z0.replace(a,""),C0);if(typeof _0!=="object")throw new Error(`Invalid spread operator ${Z0}`);for(let R0 in _0)K0[R0]=_0[R0];_?.subInput(K0)};if(X.__isReactive__(Z0,W))X.__extractExpressionDeps__(n,W).forEach((K0)=>X.__trackDep__(B,K0,{$fragment:null,boundaries:T,path:`${C}.${Z0}`,update:T0,syntax:q0,memo:W,batch:!0}))}else{const T0=(C0)=>{const K0=v0?X.__evaluateFunction__(n,[],C0):n?X.__evaluate__(n,C0):!0;_?.subInput({[Z0]:K0})};if(X.__isReactive__(n,W))X.__extractExpressionDeps__(n,W).forEach((K0)=>X.__trackDep__(B,K0,{$fragment:null,boundaries:T,path:`${C}.${Z0}`,update:T0,syntax:q0,memo:W,batch:!0}))}}),S=S.add(T.end)}return X.benchmark.inc("componentCount"),S}function d(K){const w=K.prop("tagName")?.toLowerCase();if(!w)throw new Error("Invalid macro rendering call");const U=X.__macros.get(w);if(!U)throw new Error("Macro component not found");const L=O("macro"),C=X.__getBoundaries__(L),{attrs:T}=X.__getAttributes__(K),o={};let P={},h={},v=t.default(C.start);if(T.literals&&Object.entries(T.literals).forEach(([R,F])=>P[R]={value:F,type:"arg"}),T.expressions&&Object.entries(T.expressions).forEach(([R,F])=>{if(a.test(R)){const g=X.__evaluate__(R.replace(a,""),W);if(typeof g!=="object")throw new Error(`Invalid spread operator ${R}`);for(let b in g)if(h[b]=g[b],U.argv.includes(b))P[b]={value:g[b],type:"arg"};o[R]=F}else{const g=F?X.__evaluate__(F,W):!0;if(h[R]=g,U.argv.includes(R))P[R]={value:g,type:"arg"};if(U.argv.includes(R))o[R]=F}U.argv.forEach((g)=>{if(P[g]!==void 0)return;P[g]={value:!1,type:"arg"}})}),U.argv.includes("__"))P.__={value:h,type:"arg"};const V={$node:U.$node,meshPath:null,fragmentPath:L,fragmentBoundaries:C,argv:U.argv,scope:W,xmlns:Y,useAttributes:!0},S=X.__meshwire__(V,o),_=S.renderer.mesh(P);return v=v.add(_),o&&Object.entries(o).forEach(([R,F])=>{let g=!1;if(new RegExp(`^${I0}`).test(R))g=!0,R=R.replace(I0,"");if(a.test(R)){if(!X.__isReactive__(R,W))return;const b=X.__extractExpressionDeps__(R,W),s=(l)=>{const p={},D0=X.__evaluate__(R.replace(a,""),l);if(typeof D0!=="object")throw new Error(`Invalid spread operator ${R}`);const Z0=[];for(let n in D0)p[n]={value:D0[n],type:"arg"},(!l[n]||!E0(D0[n],l[n].value))&&Z0.push(n);return Z0.length&&S.renderer.update(Z0,p),{memo:{...l,...p}}};b.forEach((l)=>X.__trackDep__(B,l,{$fragment:null,boundaries:C,path:`${L}.${R}`,update:s,syntax:g,memo:{...W,...P},batch:!0}))}else if(X.__isReactive__(F,W)){const b=X.__extractExpressionDeps__(F,W),s=(l)=>{const p=l[R]={value:F?X.__evaluate__(F,l):!0,type:"arg"};return S.renderer.update([R],{[R]:p}),{memo:l}};b.forEach((l)=>X.__trackDep__(B,l,{$fragment:null,boundaries:C,path:`${L}.${R}`,update:s,syntax:g,memo:{...W,...P},batch:!0}))}}),v=v.add(C.end),X.benchmark.inc("elementCount"),v}function k(K){if(!K.length||!K.prop("tagName"))return K;const w=K.is("svg")||Y,U=w?t.default(document.createElementNS("http://www.w3.org/2000/svg",K.prop("tagName").toLowerCase())):t.default(`<${K.prop("tagName").toLowerCase()}/>`),L=K.contents(),C=O("element");L.length&&U.append(X.__withPath__(C,()=>X.render(C+".n",L,W,B,w).$log));const{attrs:T,events:o}=X.__getAttributes__(K);T.literals&&Object.entries(T.literals).forEach(([h,v])=>U.attr(h,v));const P=(h,v=!1)=>{h&&Object.entries(h).forEach(([V,S])=>{switch(V){case"@html":{const _=(R)=>{U.html(X.__evaluate__(S,R))};if(_(W),v&&X.__isReactive__(S,W))X.__extractExpressionDeps__(S,W).forEach((F)=>X.__trackDep__(B,F,{$fragment:U,path:`${C}.${V}`,update:_,memo:W,batch:!0}))}break;case"@text":{const _=(R)=>{let F=X.__evaluate__(S,R);if(!K.is("[no-translate]")){const{text:g}=X.lips.i18n.translate(F);F=g}U.text(F)};if(_(W),v&&X.__isReactive__(S,W))X.__extractExpressionDeps__(S,W).forEach((F)=>X.__trackDep__(B,F,{$fragment:U,path:`${C}.${V}`,update:_,memo:W,batch:!0}))}break;case"style":{const _=(R)=>{const F=X.__evaluate__(S,R);if(typeof F==="object"){let g="";Object.entries(F).forEach(([b,s])=>g+=`${b}:${s};`),g.length&&U.attr("style",g)}else U.attr("style",F)};if(_(W),v&&X.__isReactive__(S,W))X.__extractExpressionDeps__(S,W).forEach((F)=>X.__trackDep__(B,F,{$fragment:U,path:`${C}.${V}`,update:_,memo:W,batch:!0}))}break;default:{const _=(R)=>{const F=S?X.__evaluate__(S,R):S!==void 0?S:!0;F===void 0||F===!1?U.removeAttr(V):U.attr(V,F)};if(_(W),v&&X.__isReactive__(S,W))X.__extractExpressionDeps__(S,W).forEach((F)=>X.__trackDep__(B,F,{$fragment:U,path:`${C}.${V}`,update:_,memo:W,batch:!0}))}}})};return T.expressions&&Object.keys(T.expressions).forEach((h)=>{if(!a.test(h))return;const v=(V)=>{const S={},_=X.__evaluate__(h.replace(a,""),V);if(typeof _!=="object")throw new Error(`Invalid spread operator ${h}`);for(let R in _)S[R]=_[R];P(S)};if(delete T.expressions[h],v(W),h&&X.__isReactive__(h,W))X.__extractExpressionDeps__(h,W).forEach((S)=>X.__trackDep__(B,S,{$fragment:U,path:`${C}.${h}`,update:v,memo:W,batch:!0}))}),P(T.expressions,!0),o&&Object.entries(o).forEach(([h,v])=>{G.push({_event:h,$fragment:U,instruction:v,scope:W})}),X.benchmark.inc("elementCount"),X.benchmark.inc("domInsertsCount"),U}function y(K){const w=O("element"),U=K.text(),L=t.default(document.createTextNode(X.__interpolate__(U,W)));if(U&&X.__isReactive__(U,W)){const C=X.__extractTextDeps__(U,W),T=(o)=>{const P=X.__interpolate__(U,o);if(!L[0])return;L[0].textContent=P};C.forEach((o)=>X.__trackDep__(B,o,{path:w,$fragment:L,update:T,memo:W,batch:C.length>1}))}return X.benchmark.inc("elementCount"),X.benchmark.inc("domInsertsCount"),L}function $(K){if(K.get(0)?.nodeType===Node.COMMENT_NODE)return K;if(K.get(0)?.nodeType===Node.TEXT_NODE)return y(K);if(K.is("let"))return i(K);else if(K.is("const"))return e(K);else if(K.is("lips")&&K.attr(":dtag"))return A(K);else if(K.is("log"))return u(K);else if(X.__macros.has(K.prop("tagName")?.toLowerCase()))return d(K);else if(K.is("if, for, switch, async")||X.lips.has(K.prop("tagName")?.toLowerCase()))return c(K);else if(K.is("else-if, else"))return;return k(K)}try{this.__renderDepth++,Q=Q||t.default(this.__template__),Q.each(function(){const K=$(t.default(this));if(K)D=D.add(K)}),G.forEach(({$fragment:K,_event:w,instruction:U,scope:L})=>{this.__attachEvent__(K,w,U,L)}),X.benchmark.inc("renderCount")}catch(K){console.error("Rendering Failed --",K),X.benchmark.trackError(K)}finally{if(this.__renderDepth--,this.benchmark.endRender(),this.benchmark.trackMemory(),this.__renderDepth===0)this.__path="",this.__pathCounter=0}return{$log:D,dependencies:B,events:G}}destroy(){this.ICE.dispose(),this.benchmark.dispose(),this.lips.IUC.unregister(this.__path__),this.lips.watcher.unwatch(this),this.VER.forEach(({element:Z,_event:Q})=>this.__detachEvent__(Z,Q)),this.VER=[];for(let Z in this.PCC){const Q=this.PCC.get(Z);Q?.destroy(),Q?.delete(Z)}if(this.$?.remove(),this.PCC?.clear(),this.FGUD?.clear(),this.state.reset(),this.__macros.clear(),this.__stylesheet?.clear(),this.__previous=null,this.state=null,this.input=null,this.context=null,this.$)this.$.each((Z,Q)=>{t.default(Q).off()}),this.$=null;typeof this.onDestroy==="function"&&this.onDestroy.bind(this)(),this.emit("component:destroy",this)}__meshwire__(Z,Q){const W=this,{$node:q,meshPath:Y,fragmentPath:B,fragmentBoundaries:G,argv:X,scope:D,xmlns:O,declaration:j,useAttributes:E}=Z;let x,A=[];const u=[],i=(d,k,y)=>{const $=`${B}.${Y||"r"}${y!==void 0?`[${y}]`:""}`,{$log:K,dependencies:w,events:U}=W.render($,d,{...D,...k},void 0,O);if(u.push($),w?.forEach((L,C)=>{if(!W.FGUD?.has(C))W.FGUD.set(C,new Map);L.forEach((T,o)=>{T.partial?.length?T.partial.push($):T.partial=[$],W.FGUD.get(C)?.set(o,T)})}),W.benchmark.inc("partialCount"),y!==void 0){const L=W.__getBoundaries__($);A[y]={argvalues:k,boundaries:L};let C=t.default(L.start);return C=C.add(K),C=C.add(L.end),C}return K},e=(d,k,y)=>{if(W.benchmark.startRender(),d.forEach(($)=>{const K=W.FGUD.get($);if(!K)return;K.forEach((w)=>{const U=u.find((L)=>w.partial?.find((C)=>L==C));if(!w.partial||!U)return;if(y!==void 0&&!U.endsWith(`r[${y}]`))return;if(G?.start&&!document.contains(G.start)){console.warn(`${Y} -- partial boundaries missing in the DOM`),K.delete(w.path);return}if(w.memo?.[$]&&k?.[$]&&E0(w.memo[$],k[$]))return;if(w.memo={...D,...w.memo,...k},w.batch)W.UQS.queue({dep:$,dependent:w});else{const L=w.update(w.memo,"mesh-partial-updator");if(L)typeof L.memo==="object"&&K.set(w.path,{...w,memo:L.memo}),typeof L.cleanup==="function"&&L.cleanup()}W.benchmark.inc("dependencyUpdateCount")}),!K.size&&W.FGUD.delete($)}),y!==void 0&&A[y])A[y].argvalues=k;W.benchmark.inc("partialUpdateCount"),W.benchmark.endRender()},r=(d)=>{if(!A[d])return;const k=A[d].boundaries;if(delete A[d],!document.contains(k.start)||!document.contains(k.end)){console.warn(`Partial mesh item<${d}> boundaries missing`);return}const y=[];let $=k.start.nextSibling;while($&&$!==k.end)y.push($),$=$.nextSibling;t.default(y).remove(),k.start.remove(),k.end.remove()},c={renderer:{path:Y,argv:X,mesh(d,k=!1){if(x=q.contents(),!x?.length)return null;if(j?.iterator){const y=d?.["#"].value;if(!Array.isArray(d?.["#"].value))throw new Error("Invalid iterator argvalues");if(!y.length)return null;let $=t.default();return y.forEach((K,w)=>{if(!x?.length)return null;$=$.add(i(x,K,w))}),$}else return i(x,d)},update(d,k,y){if(!u.length)return;if(y=y||G,j?.iterator){const $=k?.["#"].value;if(!Array.isArray($))return;if(Array.isArray(A)){if(A.length===$.length){for(let w=0;w<$.length;w++)!E0(A[w].argvalues,$[w])&&e(Object.keys($[w]),$[w],w);return}const K=Math.min(A.length,$.length);for(let w=0;w<K;w++)e(Object.keys($[w]),$[w],w);if($.length>A.length){if(!x?.length)return;for(let w=A.length;w<$.length;w++){const U=i(x,$[w],w);t.default(y.end).before(U)}}else if($.length<A.length)for(let w=$.length;w<A.length;w++)r(w)}}else e(d,k)}}};if(E&&Y){const{attrs:d}=W.__getAttributes__(q);d.literals&&Object.entries(d.literals).forEach(([k,y])=>c[k]=y),d.expressions&&Object.entries(d.expressions).forEach(([k,y])=>{if(a.test(k)){const $=W.__evaluate__(k.replace(a,""),D);if(typeof $!=="object")throw new Error(`Invalid spread operator ${k}`);for(let K in $)c[K]=$[K];Q[`${j?.syntax?I0:""}${Y}.${k}`]=y}else c[k]=y?W.__evaluate__(y,D):!0,Q[`${j?.syntax?I0:""}${Y}.${k}`]=y})}return c}__getBoundaries__(Z){return this.benchmark.inc("domOperations"),this.benchmark.inc("domInsertsCount"),{start:document.createComment(`s:${this.prepath}.${Z}`),end:document.createComment(`e:${this.prepath}.${Z}`)}}__getAttributes__(Z){const Q=Z.attrs(),W={},q={literals:{},functions:{},expressions:{}};let Y=[];return Q&&Object.entries(Q).forEach(([B,G])=>{if(B==":dtag")return;if(B.startsWith(":")||B.startsWith(O0)||B.startsWith(A0)||a.test(B)||Z1.test(B))if(Z1.test(B)){const[X,D]=B.match(Z1)||[];Y=D.split(",")}else if(B.startsWith(A0))W[B.replace(A0,"")]=G;else if(B.startsWith(O0))q.functions[B.replace(O0,"")]=G;else{if(B.startsWith(":"))B=B.slice(1,B.length);q.expressions[B]=G||""}else q.literals[B]=G}),{argv:Y,events:W,attrs:q}}__withPath__(Z,Q){const W=this.__path;this.__path=Z;const q=Q();return this.__path=W,q}__getPathParent__(Z){const Q=Z.split("/");return Q.pop(),Q.join("/")}__hasSamePathParent__(Z,Q){return Z.startsWith(Q)}__evaluate__(Z,Q){try{Z=Z.trim();const W=this.state.toJSON();if(Q){const q={};for(let G in Q)q[G]=Q[G].value;const Y=`with( scope ){ return ${Z}; }`;return new Function("self","input","state","static","context","scope",Y)(this,this.input,W,this.static,this.context,q||{})}else{const q=`return ${Z}`;return new Function("self","input","state","static","context",q)(this,this.input,W,this.static,this.context)}}catch(W){return Z}}__evaluateFunction__(Z,Q,W){if(/(\s*\w+|\s*\([^)]*\)|\s*)\s*=>\s*(\s*\{[^}]*\}|\s*[^\n;"]+)/g.test(Z))return this.__evaluate__(Z,W)(...Q);else{let[q,...Y]=Z.split(/\s*,\s*/),B;if(q=this.__evaluate__(q,W),typeof q==="function")B=q;else{if(typeof this[q]!=="function")throw new Error(`Undefined <${q}> handler method`);B=this[q].bind(this)}if(typeof B!=="function")throw new Error(`Expected <${q}> to be a function or handler method`);let G=Y.map((X)=>this.__evaluate__(X,W));if(Q.length)G=[...G,...Q];return B(...G)}}__interpolate__(Z,Q){return Z.replace(/{\s*([^{}]+)\s*}/g,(W,q)=>this.__evaluate__(q,Q))}__attachEvent__(Z,Q,W,q){Z.on(Q,(...Y)=>this.__evaluateFunction__(W,Y,q)),this.VER.push({element:Z,_event:Q}),this.benchmark.inc("domUpdatesCount"),this.benchmark.inc("domRemovalsCount")}__detachEvent__(Z,Q){Z.off(Q),this.benchmark.inc("domOperations"),this.benchmark.inc("domRemovalsCount")}__extractTextDeps__(Z,Q){const W=new Set;return(Z.match(/{\s*([^{}]+)\s*}/g)||[]).forEach((Y)=>{const B=Y.replace(/[{}]/g,"").trim();this.__extractExpressionDeps__(B,Q).forEach((X)=>W.add(X))}),Array.from(W)}__extractExpressionDeps__(Z,Q){const W=/\b(state|input|context)(?:\.[a-zA-Z_]\w*)+(?=\[|\.|$|\s|;|,|\))/g,q=/\b(self)(?:\.[a-zA-Z_]\w*)+(?=\()/g;let Y=[...Array.from(Z.matchAll(W)),...Array.from(Z.matchAll(q))];if(Q&&Object.keys(Q).length){const B=new RegExp(`\\b(${Object.keys(Q).join("|")})`,"g");Y=[...Y,...Array.from(Z.matchAll(B))]}return[...new Set(Y.map((B)=>B[0]))]}__isReactive__(Z,Q){if(/(state|input|context|self)\.[\w.]+/.test(Z))return!0;if(Q&&Object.keys(Q).length&&new RegExp(Object.keys(Q).join("|")).test(Z))return!0;return!1}__trackDep__(Z,Q,W){if(W.memo&&W.memo[Q]&&W.memo[Q].type==="let")W.haslet=!0;!Z.has(Q)&&Z.set(Q,new Map),Z.get(Q)?.set(W.path,W),this.benchmark.inc("dependencyTrackCount")}__valueDep__(Z,Q){return Q.reduce((W,q)=>W?.[q],Z)}__shouldUpdate__(Z,Q,W,q){if(Z==="self")return!0;const Y=this.__valueDep__(q[Z],Q),B=this.__valueDep__(W[Z],Q);return!E0(Y,B)}__updateDepNodes__(Z,Q){if(!this.FGUD?.size)return;this.benchmark.inc("componentUpdateCount"),this.benchmark.startRender(),this.FGUD.forEach((W,q)=>{const[Y,...B]=q.split(".");if(!this.__shouldUpdate__(Y,B,Z,Q))return;W.forEach((G)=>{const{path:X,batch:D,$fragment:O,boundaries:j,update:E,memo:x,syntax:A}=G;try{if(!A&&(j?.start&&!document.contains(j.start))||O!==null&&!O.closest("body").length){W.delete(X);return}if(D)this.UQS.queue({dep:q,dependent:G});else{const u=E(x,"main-updator");if(u)typeof u.memo==="object"&&W.set(X,{...G,memo:u.memo}),typeof u.cleanup==="function"&&u.cleanup()}this.benchmark.inc("dependencyUpdateCount")}catch(u){console.error("failed to update dependency nodes --",u);return}}),!W.size&&this.FGUD?.delete(q)}),this.benchmark.endRender()}__updateVarDepNodes__(Z,Q,W){if(!this.FGUD?.size)return;this.benchmark.inc("partialUpdateCount"),this.benchmark.startRender(),this.FGUD.get(Z)?.forEach((Y,B)=>{if(!Y.haslet||!this.__hasSamePathParent__(B,this.__getPathParent__(Q)))return;if(Y.memo={...Y.memo,...W},Y.batch)this.UQS.queue({dep:Z,dependent:Y});else{const G=Y.update(Y.memo,"var-partial-updator");typeof G?.cleanup==="function"&&G.cleanup()}}),this.benchmark.endRender()}appendTo(Z){const Q=typeof Z=="string"?t.default(Z):Z;return this.$?.length&&Q.append(this.$),this.benchmark.inc("domOperations"),this}prependTo(Z){const Q=typeof Z=="string"?t.default(Z):Z;return this.$?.length&&Q.prepend(this.$),this.benchmark.inc("domOperations"),this}replaceWith(Z){const Q=typeof Z=="string"?t.default(Z):Z;return this.$?.length&&Q.replaceWith(this.$),this.benchmark.inc("domOperations"),this}}var x1={};m0(x1,{state:()=>{{return MZ}},handler:()=>{{return OZ}},default:()=>{{return DZ}},declaration:()=>{{return UZ}}});var UZ={name:"if",syntax:!0,tags:{"else-if":{type:"nexted",many:!0,optional:!0},else:{type:"nexted",optional:!0}}},MZ={renderer:null},OZ={onInput(){if(!this.input.renderer)return;if(this.input.by)this.state.renderer=this.input.renderer;else{let Z=!1;if(Array.isArray(this.input["else-if"])&&this.input["else-if"].length)this.input["else-if"].forEach((Q)=>{if(Z||!Q.by)return;this.state.renderer=Q.renderer,Z=!0});if(!Z)this.state.renderer=this.input.else?this.input.else.renderer:null}}},DZ="<{state.renderer}/>";var b1={};m0(b1,{state:()=>{{return FZ}},handler:()=>{{return LZ}},default:()=>{{return VZ}},declaration:()=>{{return jZ}},_static:()=>{{return IZ}}});var jZ={name:"for",syntax:!0,iterator:!0},FZ={argvlist:null},IZ={lastInput:null,processingBatch:!1},LZ={onInput(){if(this.static.processingBatch)return;if(!this.input.renderer)throw new Error("Undefined mesh renderer");let{in:Z,from:Q,to:W}=this.input;if(Z===void 0&&Q===void 0)throw new Error("Invalid <for> arguments");this.static.processingBatch=!0;try{if(Q!==void 0){if(Q=parseFloat(String(Q)),W==null)throw new Error("Expected <from> <to> attributes of the for loop to be defined");if(W=parseFloat(String(W)),Q===W)throw new Error("<from> and <to> attribute cannot have the same value");const q=Q<W,Y=Math.abs(W-Q)+1;if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===Y){const[G]=this.input.renderer.argv;if(G){let X=Q,D=!0;for(let O=0;O<this.state.argvlist.length;O++){if(this.state.argvlist[O][G].value!==X){D=!1;break}X=q?X+1:X-1}if(D)return;X=Q;for(let O=0;O<this.state.argvlist.length;O++)this.state.argvlist[O][G].value=X,X=q?X+1:X-1;return}}const B=[];for(let G=Q;q?G<=W:G>=W;q?G++:G--){const X={},[D]=this.input.renderer.argv;if(D)X[D]={value:G,type:"arg"};B.push(X)}this.state.argvlist=B}else if(Array.isArray(Z)){if(this.state.argvlist&&this.static.lastInput&&this.input.in===this.static.lastInput)return;if(!Z.length){console.warn("empty for loop <in> attribute Array value"),this.state.argvlist=[];return}if(this.static.lastInput=Z,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===Z.length){const[B,G]=this.input.renderer.argv;for(let X=0;X<Z.length;X++){const D=this.state.argvlist[X];if(B)D[B].value=Z[X]}return}const q=[];let Y=0;for(let B of Z){const G={},[X,D]=this.input.renderer.argv;if(X)G[X]={value:B,type:"arg"};if(D)G[D]={value:Y,type:"arg"};q.push(G),Y++}this.state.argvlist=q}else if(Z instanceof Map){if(this.state.argvlist&&this.static.lastInput&&this.input.in===this.static.lastInput)return;if(!Z.size){console.warn("empty for loop <in> attribute Map value"),this.state.argvlist=[];return}if(this.static.lastInput=Z,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===Z.size){const[B,G,X]=this.input.renderer.argv;let D=0;for(let[O,j]of Z){const E=this.state.argvlist[D];if(B)E[B].value=O;if(G)E[G].value=j;D++}return}const q=[];let Y=0;for(let[B,G]of Z){const X={},[D,O,j]=this.input.renderer.argv;if(D)X[D]={value:B,type:"arg"};if(O)X[O]={value:G,type:"arg"};if(j)X[j]={value:Y,type:"arg"};q.push(X),Y++}this.state.argvlist=q}else if(typeof Z=="object"){if(this.state.argvlist&&this.static.lastInput&&this.input.in===this.static.lastInput)return;if(!Object.keys(Z).length){console.warn("empty for loop <in> attribute Object value"),this.state.argvlist=[];return}this.static.lastInput=Z;const q=Object.keys(Z);if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===q.length){const[G,X,D]=this.input.renderer.argv;for(let O=0;O<q.length;O++){const j=q[O],E=this.state.argvlist[O];if(G)E[G].value=j;if(X)E[X].value=Z[j]}return}const Y=[];let B=0;for(let G in Z){const X={},[D,O,j]=this.input.renderer.argv;if(D)X[D]={value:G,type:"arg"};if(O)X[O]={value:Z[G],type:"arg"};if(j)X[j]={value:B,type:"arg"};Y.push(X),B++}this.state.argvlist=Y}}finally{this.static.processingBatch=!1}},updateItems(Z){if(!this.input.renderer)throw new Error("Undefined mesh renderer");if(!Array.isArray(Z)||!this.state.argvlist)return;this.static.processingBatch=!0;try{const[Q]=this.input.renderer?.argv;if(!Q)return;for(let{index:W,value:q}of Z)if(W>=0&&W<this.state.argvlist.length)this.state.argvlist[W][Q].value=q}finally{this.static.processingBatch=!1}},updateProperty(Z,Q){if(!this.input.renderer)throw new Error("Undefined mesh renderer");if(!this.state.argvlist)return;this.static.processingBatch=!0;try{for(let W=0;W<this.state.argvlist.length;W++){const q=this.state.argvlist[W];if(q[Z])q[Z].value=typeof Q==="function"?Q(q[Z].value,W):Q}}finally{this.static.processingBatch=!1}}},VZ="<{input.renderer} #=state.argvlist/>";var h1={};m0(h1,{state:()=>{{return CZ}},handler:()=>{{return PZ}},default:()=>{{return SZ}},declaration:()=>{{return NZ}}});var NZ={name:"async",syntax:!0,tags:{then:{type:"child"},catch:{type:"child",optional:!0},loading:{type:"child",optional:!0}}},CZ={renderer:null,props:{}},PZ={onInput(){if(!this.input.await)throw new Error("Undefined async <await> attribute");if(!(this.input.await instanceof Promise))throw new Error("Expected async <await> attribute value to be a function");if(this.input.loading)this.state.renderer=this.input.loading.renderer,this.state.props={};this.input.await.then((Z)=>{if(!this.input.then)return;this.state.renderer=this.input.then.renderer;const[Q]=this.input.then.renderer.argv;this.state.props={[Q]:{value:Z,type:"arg"}}}).catch((Z)=>{if(!this.input.catch)return;this.state.renderer=this.input.catch.renderer;const[Q]=this.input.then.renderer.argv;this.state.props={[Q]:{value:Z,type:"arg"}}})}},SZ="<{state.renderer} #=state.props/>";var f1={};m0(f1,{state:()=>{{return TZ}},handler:()=>{{return RZ}},default:()=>{{return $Z}},declaration:()=>{{return EZ}}});var EZ={name:"switch",syntax:!0,tags:{case:{type:"child",many:!0},default:{type:"child"}}},TZ={renderer:null},RZ={onInput(){let Z=[];for(let Q of this.input.case)if(Q.is==this.input.by||Array.isArray(Q.is)&&Q.is.includes(this.input.by))Array.isArray(Q.is)?Z=[...new Set([...Z,...Q.is])]:Z.push(Q.is),this.state.renderer=Q.renderer;if(!Z.includes(this.input.by))this.state.renderer=this.input.default?this.input.default.renderer:null}},$Z="<{state.renderer}/>";var g1={};m0(g1,{state:()=>{{return AZ}},handler:()=>{{return hZ}},default:()=>{{return fZ}},context:()=>{{return xZ}},_static:()=>{{return _Z}}});var bZ=function(Z){const Q={};return Z.split("&").map((q)=>{const[Y,B]=q.split("=");Q[Y]=B}),Q},AZ={page:null,params:{},query:{}},_Z={global:!1,routes:[],defaultPath:null,currentPath:null,currentRoute:null},xZ=["navigate"],hZ={onInput(){if(!this.input.routes)return;if(this.input.global)this.static.global=this.input.global;if(this.static.routes=this.input.routes.map(({path:Z,template:Q,default:W})=>{if(W)this.static.defaultPath=Z;const q=Z.match(/:[^\/]*(\/|$)/gi)||[],Y=Z.replaceAll("/","\\/").replaceAll(/:[^\/]*(\/|$)/gi,"([^\\/]+)(?:\\/|$)");return{path:Z,template:Q,default:W,pathVars:q,pathRegex:new RegExp(`${Y}\$`,"i")}}),this.input.global){const Z=window.location.pathname;this.static.defaultPath=this.static.defaultPath&&Z=="/"&&Z!==this.static.defaultPath?this.static.defaultPath:Z?Z+window.location.search:this.static.routes[0].path}},onAttach(){if(this.input.global)window.navigate=this.navigate.bind(this),window.addEventListener("popstate",(Z)=>Z.state&&this.navigate(Z.state.path,!0));this.setContext("navigate",this.navigate.bind(this)),this.static.defaultPath&&this.navigate(this.static.defaultPath)},navigate(Z,Q){!Q&&this.static.global&&history.pushState({path:Z},"",Z);const W=Z.split("?");Z=W[0];const q=W[1]?bZ(W[1]):{};let Y=null;if(this.static.currentRoute)Y={path:this.static.currentRoute.path,params:this.state.params},this.emit("before",{fromState:Y,toState:{path:Z,query:q}});const B=this.match(Z);if(!B){this.static.currentRoute=null,this.state.params={},this.state.query={},this.emit("not-found",Z);return}const{route:G,params:X}=B;this.emit("after",{fromState:Y,toState:{path:G.path,params:X,query:q}}),this.static.currentPath=Z,this.static.currentRoute=G,this.state.params=X,this.state.query=q,this.state.page=G.template},match(Z){const Q={};let W=!1;for(let q of this.static.routes){const{pathVars:Y,pathRegex:B}=q,G=Z.match(B);if(G!==null&&G.index===0){for(let X=0;X+1<G.length&&X<Y.length;X++)Q[Y[X].replaceAll(/[\/:]/g,"")]=G[X+1];W=q;break}}return W?{route:W,params:Q}:!1}},fZ="<{state.page} params=state.params query=state.query/>";class E5{debug=!1;store={};__root;i18n=new l0;watcher;IUC;__setContext;__getContext;constructor(Z){if(Z?.debug)this.debug=Z.debug;this.watcher=new t0,this.IUC=new n0;const[Q,W]=y0(Z?.context||{});this.__setContext=W,this.__getContext=Q,this.register("if",x1),this.register("for",b1),this.register("async",h1),this.register("switch",f1),this.register("router",g1)}register(Z,Q){return this.store[Z]=Q,this}unregister(Z){return delete this.store[Z],this}has(Z){return Z in this.store}import(Z){if(!this.has(Z))throw new Error(`<${Z}> component not found`);if(!this.store[Z].declaration?.syntax&&!this.store[Z].default)throw new Error(`Invalid <${Z}> component`);return this.store[Z]}render(Z,Q,W){const{default:q,...Y}=Q,B={debug:this.debug,prepath:"0",lips:this},G=new c0(Z,q||"",{...Y,input:W},B);return window.addEventListener("beforeunload",()=>{return this.dispose(),G.destroy(),null}),window.addEventListener("pagehide",(X)=>{!X.persisted&&this.dispose()}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState!=="hidden")return;this.IUC.prepareForPotentialUnload()}),G}root(Z,Q){return this.__root=this.render("__ROOT__",Z),this.__root.appendTo(Q),this.__root}language(Z){this.i18n.setLang(Z)&&this.__root?.rerender()}setContext(Z,Q){const W=this.__getContext();if(typeof Z==="string"){const q={...W,[Z]:Q};H0(W,q)&&this.__setContext(q)}else if(!Array.isArray(Z)){const q={...W,...Z};H0(W,q)&&this.__setContext(q)}else throw new Error("Invalid context data")}getContext(){return this.__getContext()}useContext(Z,Q){if(!Z.length)return;O1(()=>{const W=this.__getContext();if(!W)return;const q=Object.fromEntries(Z.map((Y)=>[Y,W[Y]]));q&&typeof Q==="function"&&Object.keys(q).length&&Q(q)})}dispose(){this.watcher?.dispose(),this.__root?.destroy()}}export{E5 as default};
|
|
1
|
+
var e5=Object.create;var{defineProperty:E1,getPrototypeOf:JJ,getOwnPropertyNames:ZJ}=Object;var QJ=Object.prototype.hasOwnProperty;var $1=(J,Q,W)=>{W=J!=null?e5(JJ(J)):{};const q=Q||!J||!J.__esModule?E1(W,"default",{value:J,enumerable:!0}):W;for(let Y of ZJ(J))if(!QJ.call(q,Y))E1(q,Y,{get:()=>J[Y],enumerable:!0});return q};var WJ=(J,Q)=>()=>(Q||J((Q={exports:{}}).exports,Q),Q.exports);var u0=(J,Q)=>{for(var W in Q)E1(J,W,{get:Q[W],enumerable:!0,configurable:!0,set:(q)=>Q[W]=()=>q})};var e0=WJ((t1,a1)=>{(function(){var J=document,Q=window,W=J.documentElement,q=J.createElement.bind(J),Y=q("div"),B=q("table"),w=q("tbody"),X=q("tr"),M=Array.isArray,D=Array.prototype,j=D.concat,$=D.filter,x=D.indexOf,A=D.map,u=D.push,i=D.slice,e=D.some,l=D.splice,c=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,d=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,k=/<.+>/,y=/^\w+$/;function R(Z,H){var z=r(H);return!Z||!z&&!S(H)&&!P(H)?[]:!z&&d.test(Z)?H.getElementsByClassName(Z.slice(1).replace(/\\/g,"")):!z&&y.test(Z)?H.getElementsByTagName(Z):H.querySelectorAll(Z)}var K=function(){function Z(H,z){if(!H)return;if(L(H))return H;var U=H;if(E(H)){var F=z||J;if(U=c.test(H)&&S(F)?F.getElementById(H.slice(1).replace(/\\/g,"")):k.test(H)?y1(H):L(F)?F.find(H):E(F)?O(F).find(H):R(H,F),!U)return}else if(N(H))return this.ready(H);if(U.nodeType||U===Q)U=[U];this.length=U.length;for(var C=0,f=this.length;C<f;C++)this[C]=U[C]}return Z.prototype.init=function(H,z){return new Z(H,z)},Z}(),G=K.prototype,O=G.init;if(O.fn=O.prototype=G,G.length=0,G.splice=l,typeof Symbol==="function")G[Symbol.iterator]=D[Symbol.iterator];function L(Z){return Z instanceof K}function V(Z){return!!Z&&Z===Z.window}function S(Z){return!!Z&&Z.nodeType===9}function r(Z){return!!Z&&Z.nodeType===11}function P(Z){return!!Z&&Z.nodeType===1}function b(Z){return!!Z&&Z.nodeType===3}function v(Z){return typeof Z==="boolean"}function N(Z){return typeof Z==="function"}function E(Z){return typeof Z==="string"}function _(Z){return Z===void 0}function T(Z){return Z===null}function I(Z){return!isNaN(parseFloat(Z))&&isFinite(Z)}function g(Z){if(typeof Z!=="object"||Z===null)return!1;var H=Object.getPrototypeOf(Z);return H===null||H===Object.prototype}O.isWindow=V,O.isFunction=N,O.isArray=M,O.isNumeric=I,O.isPlainObject=g;function h(Z,H,z){if(z){var U=Z.length;while(U--)if(H.call(Z[U],U,Z[U])===!1)return Z}else if(g(Z)){var F=Object.keys(Z);for(var U=0,C=F.length;U<C;U++){var f=F[U];if(H.call(Z[f],f,Z[f])===!1)return Z}}else for(var U=0,C=Z.length;U<C;U++)if(H.call(Z[U],U,Z[U])===!1)return Z;return Z}O.each=h,G.each=function(Z){return h(this,Z)},G.empty=function(){return this.each(function(Z,H){while(H.firstChild)H.removeChild(H.firstChild)})};function o(){var Z=[];for(var H=0;H<arguments.length;H++)Z[H]=arguments[H];var z=v(Z[0])?Z.shift():!1,U=Z.shift(),F=Z.length;if(!U)return{};if(!F)return o(z,O,U);for(var C=0;C<F;C++){var f=Z[C];for(var m in f)if(z&&(M(f[m])||g(f[m]))){if(!U[m]||U[m].constructor!==f[m].constructor)U[m]=new f[m].constructor;o(z,U[m],f[m])}else U[m]=f[m]}return U}O.extend=o,G.extend=function(Z){return o(G,Z)};var s=/\S+/g;function p(Z){return E(Z)?Z.match(s)||[]:[]}G.toggleClass=function(Z,H){var z=p(Z),U=!_(H);return this.each(function(F,C){if(!P(C))return;h(z,function(f,m){if(U)H?C.classList.add(m):C.classList.remove(m);else C.classList.toggle(m)})})},G.addClass=function(Z){return this.toggleClass(Z,!0)},G.removeAttr=function(Z){var H=p(Z);return this.each(function(z,U){if(!P(U))return;h(H,function(F,C){U.removeAttribute(C)})})};function D0(Z,H){if(!Z)return;if(E(Z)){if(arguments.length<2){if(!this[0]||!P(this[0]))return;var z=this[0].getAttribute(Z);return T(z)?void 0:z}if(_(H))return this;if(T(H))return this.removeAttr(Z);return this.each(function(F,C){if(!P(C))return;C.setAttribute(Z,H)})}for(var U in Z)this.attr(U,Z[U]);return this}G.attr=D0,G.removeClass=function(Z){if(arguments.length)return this.toggleClass(Z,!1);return this.attr("class","")},G.hasClass=function(Z){return!!Z&&e.call(this,function(H){return P(H)&&H.classList.contains(Z)})},G.get=function(Z){if(_(Z))return i.call(this);return Z=Number(Z),this[Z<0?Z+this.length:Z]},G.eq=function(Z){return O(this.get(Z))},G.first=function(){return this.eq(0)},G.last=function(){return this.eq(-1)};function J0(Z){if(_(Z))return this.get().map(function(H){return P(H)||b(H)?H.textContent:""}).join("");return this.each(function(H,z){if(!P(z))return;z.textContent=Z})}G.text=J0;function n(Z,H,z){if(!P(Z))return;var U=Q.getComputedStyle(Z,null);return z?U.getPropertyValue(H)||void 0:U[H]||Z.style[H]}function q0(Z,H){return parseInt(n(Z,H),10)||0}function m0(Z,H){return q0(Z,"border".concat(H?"Left":"Top","Width"))+q0(Z,"padding".concat(H?"Left":"Top"))+q0(Z,"padding".concat(H?"Right":"Bottom"))+q0(Z,"border".concat(H?"Right":"Bottom","Width"))}var $0={};function C0(Z){if($0[Z])return $0[Z];var H=q(Z);J.body.insertBefore(H,null);var z=n(H,"display");return J.body.removeChild(H),$0[Z]=z!=="none"?z:"block"}function K0(Z){return n(Z,"display")==="none"}function _0(Z,H){var z=Z&&(Z.matches||Z.webkitMatchesSelector||Z.msMatchesSelector);return!!z&&!!H&&z.call(Z,H)}function T0(Z){return E(Z)?function(H,z){return _0(z,Z)}:N(Z)?Z:L(Z)?function(H,z){return Z.is(z)}:!Z?function(){return!1}:function(H,z){return z===Z}}G.filter=function(Z){var H=T0(Z);return O($.call(this,function(z,U){return H.call(z,U,z)}))};function P0(Z,H){return!H?Z:Z.filter(H)}G.detach=function(Z){return P0(this,Z).each(function(H,z){if(z.parentNode)z.parentNode.removeChild(z)}),this};var E5=/^\s*<(\w+)[^>]*>/,$5=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,k1={"*":Y,tr:w,td:X,th:X,thead:B,tbody:B,tfoot:B};function y1(Z){if(!E(Z))return[];if($5.test(Z))return[q(RegExp.$1)];var H=E5.test(Z)&&RegExp.$1,z=k1[H]||k1["*"];return z.innerHTML=Z,O(z.childNodes).detach().get()}O.parseHTML=y1,G.has=function(Z){var H=E(Z)?function(z,U){return R(Z,U).length}:function(z,U){return U.contains(Z)};return this.filter(H)},G.not=function(Z){var H=T0(Z);return this.filter(function(z,U){return(!E(Z)||P(U))&&!H.call(U,z,U)})};function I0(Z,H,z,U){var F=[],C=N(H),f=U&&T0(U);for(var m=0,U0=Z.length;m<U0;m++)if(C){var W0=H(Z[m]);if(W0.length)u.apply(F,W0)}else{var Y0=Z[m][H];while(Y0!=null){if(U&&f(-1,Y0))break;F.push(Y0),Y0=z?Y0[H]:null}}return F}function v1(Z){if(Z.multiple&&Z.options)return I0($.call(Z.options,function(H){return H.selected&&!H.disabled&&!H.parentNode.disabled}),"value");return Z.value||""}function T5(Z){if(!arguments.length)return this[0]&&v1(this[0]);return this.each(function(H,z){var U=z.multiple&&z.options;if(U||n1.test(z.type)){var F=M(Z)?A.call(Z,String):T(Z)?[]:[String(Z)];if(U)h(z.options,function(C,f){f.selected=F.indexOf(f.value)>=0},!0);else z.checked=F.indexOf(z.value)>=0}else z.value=_(Z)||T(Z)?"":Z})}G.val=T5,G.is=function(Z){var H=T0(Z);return e.call(this,function(z,U){return H.call(z,U,z)})},O.guid=1;function j0(Z){return Z.length>1?$.call(Z,function(H,z,U){return x.call(U,H)===z}):Z}O.unique=j0,G.add=function(Z,H){return O(j0(this.get().concat(O(Z,H).get())))},G.children=function(Z){return P0(O(j0(I0(this,function(H){return H.children}))),Z)},G.parent=function(Z){return P0(O(j0(I0(this,"parentNode"))),Z)},G.index=function(Z){var H=Z?O(Z)[0]:this[0],z=Z?this:O(H).parent().children();return x.call(z,H)},G.closest=function(Z){var H=this.filter(Z);if(H.length)return H;var z=this.parent();if(!z.length)return H;return z.closest(Z)},G.siblings=function(Z){return P0(O(j0(I0(this,function(H){return O(H).parent().children().not(H)}))),Z)},G.find=function(Z){return O(j0(I0(this,function(H){return R(Z,H)})))};var R5=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,A5=/^$|^module$|\/(java|ecma)script/i,_5=["type","src","nonce","noModule"];function b5(Z,H){var z=O(Z);z.filter("script").add(z.find("script")).each(function(U,F){if(A5.test(F.type)&&W.contains(F)){var C=q("script");C.text=F.textContent.replace(R5,""),h(_5,function(f,m){if(F[m])C[m]=F[m]}),H.head.insertBefore(C,null),H.head.removeChild(C)}})}function x5(Z,H,z,U,F){if(U)Z.insertBefore(H,z?Z.firstChild:null);else if(Z.nodeName==="HTML")Z.parentNode.replaceChild(H,Z);else Z.parentNode.insertBefore(H,z?Z:Z.nextSibling);if(F)b5(H,Z.ownerDocument)}function S0(Z,H,z,U,F,C,f,m){return h(Z,function(U0,W0){h(O(W0),function(Y0,R0){h(O(H),function(O0,o0){var N1=z?R0:o0,C1=z?o0:R0,B0=z?Y0:O0;x5(N1,!B0?C1:C1.cloneNode(!0),U,F,!B0)},m)},f)},C),H}G.after=function(){return S0(arguments,this,!1,!1,!1,!0,!0)},G.append=function(){return S0(arguments,this,!1,!1,!0)};function h5(Z){if(!arguments.length)return this[0]&&this[0].innerHTML;if(_(Z))return this;var H=/<script[\s>]/.test(Z);return this.each(function(z,U){if(!P(U))return;if(H)O(U).empty().append(Z);else U.innerHTML=Z})}G.html=h5,G.appendTo=function(Z){return S0(arguments,this,!0,!1,!0)},G.wrapInner=function(Z){return this.each(function(H,z){var U=O(z),F=U.contents();F.length?F.wrapAll(Z):U.append(Z)})},G.before=function(){return S0(arguments,this,!1,!0)},G.wrapAll=function(Z){var H=O(Z),z=H[0];while(z.children.length)z=z.firstElementChild;return this.first().before(H),this.appendTo(z)},G.wrap=function(Z){return this.each(function(H,z){var U=O(Z)[0];O(z).wrapAll(!H?U:U.cloneNode(!0))})},G.insertAfter=function(Z){return S0(arguments,this,!0,!1,!1,!1,!1,!0)},G.insertBefore=function(Z){return S0(arguments,this,!0,!0)},G.prepend=function(){return S0(arguments,this,!1,!0,!0,!0,!0)},G.prependTo=function(Z){return S0(arguments,this,!0,!0,!0,!1,!1,!0)},G.contents=function(){return O(j0(I0(this,function(Z){return Z.tagName==="IFRAME"?[Z.contentDocument]:Z.tagName==="TEMPLATE"?Z.content.childNodes:Z.childNodes})))},G.next=function(Z,H,z){return P0(O(j0(I0(this,"nextElementSibling",H,z))),Z)},G.nextAll=function(Z){return this.next(Z,!0)},G.nextUntil=function(Z,H){return this.next(H,!0,Z)},G.parents=function(Z,H){return P0(O(j0(I0(this,"parentElement",!0,H))),Z)},G.parentsUntil=function(Z,H){return this.parents(H,Z)},G.prev=function(Z,H,z){return P0(O(j0(I0(this,"previousElementSibling",H,z))),Z)},G.prevAll=function(Z){return this.prev(Z,!0)},G.prevUntil=function(Z,H){return this.prev(H,!0,Z)},G.map=function(Z){return O(j.apply([],A.call(this,function(H,z){return Z.call(H,z,H)})))},G.clone=function(){return this.map(function(Z,H){return H.cloneNode(!0)})},G.offsetParent=function(){return this.map(function(Z,H){var z=H.offsetParent;while(z&&n(z,"position")==="static")z=z.offsetParent;return z||W})},G.slice=function(Z,H){return O(i.call(this,Z,H))};var f5=/-([a-z])/g;function M1(Z){return Z.replace(f5,function(H,z){return z.toUpperCase()})}G.ready=function(Z){var H=function(){return setTimeout(Z,0,O)};if(J.readyState!=="loading")H();else J.addEventListener("DOMContentLoaded",H);return this},G.unwrap=function(){return this.parent().each(function(Z,H){if(H.tagName==="BODY")return;var z=O(H);z.replaceWith(z.children())}),this},G.offset=function(){var Z=this[0];if(!Z)return;var H=Z.getBoundingClientRect();return{top:H.top+Q.pageYOffset,left:H.left+Q.pageXOffset}},G.position=function(){var Z=this[0];if(!Z)return;var H=n(Z,"position")==="fixed",z=H?Z.getBoundingClientRect():this.offset();if(!H){var U=Z.ownerDocument,F=Z.offsetParent||U.documentElement;while((F===U.body||F===U.documentElement)&&n(F,"position")==="static")F=F.parentNode;if(F!==Z&&P(F)){var C=O(F).offset();z.top-=C.top+q0(F,"borderTopWidth"),z.left-=C.left+q0(F,"borderLeftWidth")}}return{top:z.top-q0(Z,"marginTop"),left:z.left-q0(Z,"marginLeft")}};var m1={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};G.prop=function(Z,H){if(!Z)return;if(E(Z)){if(Z=m1[Z]||Z,arguments.length<2)return this[0]&&this[0][Z];return this.each(function(U,F){F[Z]=H})}for(var z in Z)this.prop(z,Z[z]);return this},G.removeProp=function(Z){return this.each(function(H,z){delete z[m1[Z]||Z]})};var g5=/^--/;function D1(Z){return g5.test(Z)}var j1={},k5=Y.style,y5=["webkit","moz","ms"];function v5(Z,H){if(H===void 0)H=D1(Z);if(H)return Z;if(!j1[Z]){var z=M1(Z),U="".concat(z[0].toUpperCase()).concat(z.slice(1)),F="".concat(z," ").concat(y5.join("".concat(U," "))).concat(U).split(" ");h(F,function(C,f){if(f in k5)return j1[Z]=f,!1})}return j1[Z]}var m5={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function u1(Z,H,z){if(z===void 0)z=D1(Z);return!z&&!m5[Z]&&I(H)?"".concat(H,"px"):H}function u5(Z,H){if(E(Z)){var z=D1(Z);if(Z=v5(Z,z),arguments.length<2)return this[0]&&n(this[0],Z,z);if(!Z)return this;return H=u1(Z,H,z),this.each(function(F,C){if(!P(C))return;if(z)C.style.setProperty(Z,H);else C.style[Z]=H})}for(var U in Z)this.css(U,Z[U]);return this}G.css=u5;function d1(Z,H){try{return Z(H)}catch(z){return H}}var d5=/^\s+|\s+$/;function i1(Z,H){var z=Z.dataset[H]||Z.dataset[M1(H)];if(d5.test(z))return z;return d1(JSON.parse,z)}function i5(Z,H,z){z=d1(JSON.stringify,z),Z.dataset[M1(H)]=z}function c5(Z,H){if(!Z){if(!this[0])return;var z={};for(var U in this[0].dataset)z[U]=i1(this[0],U);return z}if(E(Z)){if(arguments.length<2)return this[0]&&i1(this[0],Z);if(_(H))return this;return this.each(function(F,C){i5(C,Z,H)})}for(var U in Z)this.data(U,Z[U]);return this}G.data=c5;function c1(Z,H){var z=Z.documentElement;return Math.max(Z.body["scroll".concat(H)],z["scroll".concat(H)],Z.body["offset".concat(H)],z["offset".concat(H)],z["client".concat(H)])}h([!0,!1],function(Z,H){h(["Width","Height"],function(z,U){var F="".concat(H?"outer":"inner").concat(U);G[F]=function(C){if(!this[0])return;if(V(this[0]))return H?this[0]["inner".concat(U)]:this[0].document.documentElement["client".concat(U)];if(S(this[0]))return c1(this[0],U);return this[0]["".concat(H?"offset":"client").concat(U)]+(C&&H?q0(this[0],"margin".concat(z?"Top":"Left"))+q0(this[0],"margin".concat(z?"Bottom":"Right")):0)}})}),h(["Width","Height"],function(Z,H){var z=H.toLowerCase();G[z]=function(U){if(!this[0])return _(U)?void 0:this;if(!arguments.length){if(V(this[0]))return this[0].document.documentElement["client".concat(H)];if(S(this[0]))return c1(this[0],H);return this[0].getBoundingClientRect()[z]-m0(this[0],!Z)}var F=parseInt(U,10);return this.each(function(C,f){if(!P(f))return;var m=n(f,"boxSizing");f.style[z]=u1(z,F+(m==="border-box"?m0(f,!Z):0))})}});var p1="___cd";G.toggle=function(Z){return this.each(function(H,z){if(!P(z))return;var U=K0(z),F=_(Z)?U:Z;if(F){if(z.style.display=z[p1]||"",K0(z))z.style.display=C0(z.tagName)}else if(!U)z[p1]=n(z,"display"),z.style.display="none"})},G.hide=function(){return this.toggle(!1)},G.show=function(){return this.toggle(!0)};var o1="___ce",I1=".",F1={focus:"focusin",blur:"focusout"},s1={mouseenter:"mouseover",mouseleave:"mouseout"},p5=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function L1(Z){return s1[Z]||F1[Z]||Z}function V1(Z){var H=Z.split(I1);return[H[0],H.slice(1).sort()]}G.trigger=function(Z,H){if(E(Z)){var z=V1(Z),U=z[0],F=z[1],C=L1(U);if(!C)return this;var f=p5.test(C)?"MouseEvents":"HTMLEvents";Z=J.createEvent(f),Z.initEvent(C,!0,!0),Z.namespace=F.join(I1),Z.___ot=U}Z.___td=H;var m=Z.___ot in F1;return this.each(function(U0,W0){if(m&&N(W0[Z.___ot]))W0["___i".concat(Z.type)]=!0,W0[Z.___ot](),W0["___i".concat(Z.type)]=!1;W0.dispatchEvent(Z)})};function l1(Z){return Z[o1]=Z[o1]||{}}function o5(Z,H,z,U,F){var C=l1(Z);C[H]=C[H]||[],C[H].push([z,U,F]),Z.addEventListener(H,F)}function r1(Z,H){return!H||!e.call(H,function(z){return Z.indexOf(z)<0})}function p0(Z,H,z,U,F){var C=l1(Z);if(!H)for(H in C)p0(Z,H,z,U,F);else if(C[H])C[H]=C[H].filter(function(f){var m=f[0],U0=f[1],W0=f[2];if(F&&W0.guid!==F.guid||!r1(m,z)||U&&U!==U0)return!0;Z.removeEventListener(H,W0)})}G.off=function(Z,H,z){var U=this;if(_(Z))this.each(function(C,f){if(!P(f)&&!S(f)&&!V(f))return;p0(f)});else if(!E(Z))for(var F in Z)this.off(F,Z[F]);else{if(N(H))z=H,H="";h(p(Z),function(C,f){var m=V1(f),U0=m[0],W0=m[1],Y0=L1(U0);U.each(function(R0,O0){if(!P(O0)&&!S(O0)&&!V(O0))return;p0(O0,Y0,W0,H,z)})})}return this},G.remove=function(Z){return P0(this,Z).detach().off(),this},G.replaceWith=function(Z){return this.before(Z).remove()},G.replaceAll=function(Z){return O(Z).replaceWith(this),this};function s5(Z,H,z,U,F){var C=this;if(!E(Z)){for(var f in Z)this.on(f,H,z,Z[f],F);return this}if(!E(H))if(_(H)||T(H))H="";else if(_(z))z=H,H="";else U=z,z=H,H="";if(!N(U))U=z,z=void 0;if(!U)return this;return h(p(Z),function(m,U0){var W0=V1(U0),Y0=W0[0],R0=W0[1],O0=L1(Y0),o0=Y0 in s1,N1=Y0 in F1;if(!O0)return;C.each(function(C1,B0){if(!P(B0)&&!S(B0)&&!V(B0))return;var P1=function(X0){if(X0.target["___i".concat(X0.type)])return X0.stopImmediatePropagation();if(X0.namespace&&!r1(R0,X0.namespace.split(I1)))return;if(!H&&(N1&&(X0.target!==B0||X0.___ot===O0)||o0&&X0.relatedTarget&&B0.contains(X0.relatedTarget)))return;var S1=B0;if(H){var b0=X0.target;while(!_0(b0,H)){if(b0===B0)return;if(b0=b0.parentNode,!b0)return}S1=b0}Object.defineProperty(X0,"currentTarget",{configurable:!0,get:function(){return S1}}),Object.defineProperty(X0,"delegateTarget",{configurable:!0,get:function(){return B0}}),Object.defineProperty(X0,"data",{configurable:!0,get:function(){return z}});var a5=U.call(S1,X0,X0.___td);if(F)p0(B0,O0,R0,H,P1);if(a5===!1)X0.preventDefault(),X0.stopPropagation()};P1.guid=U.guid=U.guid||O.guid++,o5(B0,O0,R0,H,P1)})}),this}G.on=s5;function l5(Z,H,z,U){return this.on(Z,H,z,U,!0)}G.one=l5;var r5=/\r?\n/g;function n5(Z,H){return"&".concat(encodeURIComponent(Z),"=").concat(encodeURIComponent(H.replace(r5,"\r\n")))}var t5=/file|reset|submit|button|image/i,n1=/radio|checkbox/i;if(G.serialize=function(){var Z="";return this.each(function(H,z){h(z.elements||[z],function(U,F){if(F.disabled||!F.name||F.tagName==="FIELDSET"||t5.test(F.type)||n1.test(F.type)&&!F.checked)return;var C=v1(F);if(!_(C)){var f=M(C)?C:[C];h(f,function(m,U0){Z+=n5(F.name,U0)})}})}),Z.slice(1)},typeof t1!=="undefined")a1.exports=O;else Q.cash=Q.$=O})()});class s0{default=window.navigator.language;LANGUAGE_DICTIONARIES={};setLang(J){if(this.default!==J)return this.default=J,!0;return!1}setDictionary(J,Q){this.LANGUAGE_DICTIONARIES[J]=Q}translate(J,Q){if(Q&&this.default==Q)return{text:J,lang:this.default};Q=Q||this.default;const[W,q]=Q.split("-");if(this.LANGUAGE_DICTIONARIES[W]&&J in this.LANGUAGE_DICTIONARIES[W]){if(typeof this.LANGUAGE_DICTIONARIES[W][J]==="object"){const Y=this.LANGUAGE_DICTIONARIES[W][J];J=Y[q||"*"]||Y["*"]}else if(typeof this.LANGUAGE_DICTIONARIES[W][J]==="string")J=this.LANGUAGE_DICTIONARIES[W][J]}return{text:J,lang:Q}}format(J,Q,W){const{text:q}=this.translate(J,W);return q.replace(/{(\w+)}/g,(Y,B)=>Q[B]||"")}}class l0{pendingComponents=new Set;isPending=!1;callbacks=new Map;register(J,Q){this.callbacks.set(J,Q)}unregister(J){this.callbacks.delete(J)}queue(J){if(!this.callbacks.has(J))return;if(this.pendingComponents.add(J),!this.isPending)this.isPending=!0,this.schedule()}schedule(){Promise.resolve().then(()=>this.process())}process(){const J=Array.from(this.pendingComponents);this.pendingComponents.clear(),this.isPending=!1,J.forEach((Q)=>{try{const W=this.callbacks.get(Q);if(W)W()}catch(W){console.error(`Error updating component ${Q}:`,W)}})}clear(){this.pendingComponents.clear(),this.isPending=!1}dispose(){this.pendingComponents.clear(),this.callbacks.clear(),this.isPending=!1}}class r0{subscriptions=new Map;tick=new l0;register(J,Q){this.subscriptions.set(J,Q),this.tick.register(J,Q)}unregister(J){this.subscriptions.delete(J),this.tick.unregister(J)}queueUpdate(J){this.tick.queue(J)}dispose(){this.subscriptions.clear(),this.tick.dispose()}prepareForPotentialUnload(){this.tick.clear(),this.subscriptions.forEach((J,Q)=>{this.subscriptions.set(Q,()=>{})})}proxyState(J,Q){const W=this,q=new WeakMap,Y=(w)=>{if(w instanceof Map)w.forEach((M,D)=>w.set(D,B(M)));else if(Array.isArray(w))w.forEach((M,D)=>w[D]=B(M));else if(typeof w==="object")Object.entries(w).forEach(([M,D])=>w[M]=B(D));let X=new Proxy(w,{get(M,D){if(D==="toJSON")return function(){const $=(x)=>{if(!x||typeof x!=="object")return x;if(q.has(x)){const A=q.get(x);if(A instanceof Map){const i={};return A.forEach((e,l)=>i[typeof l==="object"?JSON.stringify(l):String(l)]=$(e)),i}if(Array.isArray(A))return A.map((i)=>$(i));const u={};return Object.entries(A).forEach(([i,e])=>u[i]=$(e)),u}if(typeof x.toJSON==="function"&&!q.has(x))return x.toJSON();return x};return $(X)};if(D==="reset")return function(){X=null};const j=M[D];if(w instanceof Map&&typeof j==="function")return function(...$){const x=D.toString();if(x==="set"&&$.length>=2)$[1]=B($[1]);const A=j.apply(M,$);return["set","delete","clear"].includes(x)&&W.queueUpdate(J),A};if(Array.isArray(w)&&typeof j==="function")return function(...$){const x=D.toString();if(["push","unshift"].includes(x))$=$.map((u)=>B(u));else if(x==="splice"&&$.length>2)$=[$[0],$[1],...$.slice(2).map((u)=>B(u))];const A=j.apply(M,$);return["push","pop","shift","unshift","splice","sort","reverse","fill"].includes(x)&&W.queueUpdate(J),A};return j},set(M,D,j){if(M[D]===j)return!0;if(j instanceof Map&&M[D]instanceof Map){const $=M[D];return $.clear(),j.forEach((x,A)=>$.set(A,B(x))),W.queueUpdate(J),!0}return M[D]=B(j),W.queueUpdate(J),!0}});return q.set(X,w),X},B=(w)=>{if(!w)return w;return w instanceof Map||Array.isArray(w)||typeof w==="object"?Y(w):w};return Y(Q)}}class n0{domObserver;observedComponents=new Map;TIMEOUT=1e4;constructor(){this.domObserver=new MutationObserver(()=>{this.observedComponents.forEach((J,Q)=>{try{const W=Q.node;if(!W){this.unwatch(Q);return}if(J.type==="attach"&&document.contains(W[0]))this.unwatch(Q),Q.emit("component:attached",Q),typeof Q.onAttach=="function"&&Q.onAttach.bind(Q)();else if(J.type==="detach"&&!document.contains(W[0]))this.unwatch(Q),Q.emit("component:detached",Q),typeof Q.onDetach=="function"&&Q.onDetach.bind(Q)()}catch(W){console.log("DWS error --",W)}}),!this.observedComponents.size&&this.domObserver.disconnect()})}watch(J,Q="attach"){const W=J.node;if(!W)return;if(Q==="attach"&&document.contains(W[0])){J.emit("component:attached",J),typeof J.onAttach=="function"&&J.onAttach.bind(J)();return}if(Q==="detach"&&!document.contains(W[0])){J.emit("component:detached",J),typeof J.onDetach=="function"&&J.onDetach.bind(J)();return}this.unwatch(J);const q=setTimeout(()=>{this.unwatch(J),J.emit(`component:${Q}ment-timeout`,J)},this.TIMEOUT);this.observedComponents.set(J,{timeout:q,type:Q}),this.observedComponents.size===1&&this.domObserver.observe(document.body,{childList:!0,subtree:!0}),Q==="attach"&&J.once("component:attached",()=>this.watch(J,"detach"))}unwatch(J){const Q=this.observedComponents.get(J);if(Q)clearTimeout(Q.timeout),this.observedComponents.delete(J);!this.observedComponents.size&&this.domObserver.disconnect()}dispose(){this.domObserver.disconnect(),this.observedComponents.forEach((J)=>clearTimeout(J.timeout)),this.observedComponents.clear()}}class t0{pending=new Set;isPending=!1;component;metrics={batchCount:0,updatesProcessed:0,lastBatchSize:0,avgBatchSize:"0.00"};constructor(J){this.component=J}queue(J){if(this.pending.add(J),this.component.metrics.inc("dependencyUpdateCount"),!this.isPending)this.isPending=!0,this.scheduleProcessing()}scheduleProcessing(){Promise.resolve().then(()=>this.processQueue())}processQueue(){const J=Array.from(this.pending);if(this.metrics.batchCount++,this.metrics.lastBatchSize=J.length,this.metrics.updatesProcessed+=J.length,this.metrics.avgBatchSize=(this.metrics.updatesProcessed/this.metrics.batchCount).toFixed(2),this.pending.clear(),this.component.metrics.trackBatch(J.length),this.applyUpdates(J),this.isPending=!1,this.pending.size>0)this.isPending=!0,this.scheduleProcessing()}applyUpdates(J){J.forEach(({dep:Q,dependent:W})=>{try{const q=W.update(W.memo,"batch-updator");if(q)typeof q.memo==="object"&&this.component.FGUD.get(Q)?.set(W.path,{...W,memo:q.memo}),typeof q.cleanup==="function"&&q.cleanup()}catch(q){console.error("Failed to update dependency --",q)}})}getMetrics(){return{batchCount:this.metrics.batchCount,lastBatchSize:this.metrics.lastBatchSize,avgBatchSize:this.metrics.avgBatchSize,totalUpdates:this.metrics.updatesProcessed}}}class a0{options={emit:!0};__events={};__once_events={};constructor(J){if(J)this.options=J}on(J,Q){if(!Array.isArray(this.__events[J]))this.__events[J]=[];return this.__events[J].push(Q),this}once(J,Q){if(!Array.isArray(this.__once_events[J]))this.__once_events[J]=[];return this.__once_events[J].push(Q),this}off(J){return delete this.__events[J],delete this.__once_events[J],this}emit(J,...Q){if(!this.options.emit)return;const W=Q.map((q)=>typeof q.toJSON==="function"?q.toJSON():q);this.__events[J]?.forEach((q)=>q(...W)),this.__once_events[J]?.forEach((q)=>q(...W)),delete this.__once_events[J]}}var T1=$1(e0(),1);function H0(J,Q){if(J===Q)return!1;if(typeof J!=="object"||typeof Q!=="object")return!1;if(J===null||Q===null)return!0;if(J instanceof Set){if(!(Q instanceof Set))return!0;if(J.size!==Q.size)return!0;if(e1(J)&&e1(Q)){for(let w of J)if(!Q.has(w))return!0;return!1}const B=new WeakMap;for(let w of J){let X=!1;if(typeof w!=="object"){if(Q.has(w))X=!0}else for(let M of Q){if(typeof M!=="object")continue;if(!B.has(w))B.set(w,new WeakMap);const D=B.get(w);if(D.has(M)){if(X=D.get(M),X)break;continue}const j=!H0(w,M);if(D.set(M,j),j){X=!0;break}}if(!X)return!0}return!1}if(J instanceof Map){if(!(Q instanceof Map))return!0;if(J.size!==Q.size)return!0;if(J5(J)&&J5(Q)){for(let[w,X]of J)if(Q.get(w)!==X)return!0;return!1}const B=new WeakMap;for(let[w,X]of J){if(typeof w!=="object"){if(!Q.has(w))return!0;const j=Q.get(w);if(typeof X!=="object"){if(X!==j)return!0;continue}if(typeof j!=="object"||H0(X,j))return!0;continue}let M=!1,D=!1;for(let[j,$]of Q){if(typeof j!=="object")continue;if(!B.has(w))B.set(w,new WeakMap);const x=B.get(w);if(x.has(j)){const[A,u]=x.get(j);if(A){M=!0,D=u;break}continue}if(!H0(w,j)){if(M=!0,D=typeof X==="object"&&typeof $==="object"?!H0(X,$):X===$,x.set(j,[!0,D]),D)break}else x.set(j,[!1,!1])}if(!M||!D)return!0}return!1}if(Array.isArray(J)){if(!Array.isArray(Q))return!0;if(J.length!==Q.length)return!0;for(let B=0;B<J.length;B++){const w=J[B],X=Q[B];if(w!==X&&(typeof w!=="object"||H0(w,X)))return!0}return!1}const W=Object.keys(J),q=Object.keys(Q);if(W.length!==q.length)return!0;W.sort(),q.sort();const Y=W.length;for(let B=0;B<Y;B++)if(W[B]!==q[B])return!0;for(let B=0;B<Y;B++){const w=W[B],X=J[w],M=Q[w];if(X===M)continue;if(X instanceof Date){if(!(M instanceof Date)||String(X)!==String(M))return!0;continue}if(X instanceof RegExp){if(!(M instanceof RegExp)||X.source!==M.source||X.flags!==M.flags)return!0;continue}if(X instanceof Map){if(!(M instanceof Map)||H0(X,M))return!0;continue}if(X instanceof Set){if(!(M instanceof Set)||H0(X,M))return!0;continue}if(X instanceof Function){if(!(M instanceof Function))return!0;continue}if(typeof X==="object"){if(typeof M!=="object")return!0;if(X===J){if(M!==Q)return!0}else if(H0(X,M))return!0}else return!0}return!1}function E0(J,Q){if(J===Q)return!0;if(J==null||Q==null)return J===Q;const W=typeof J;if(W!==typeof Q)return!1;if(W!=="object"){if(W==="number"&&isNaN(J)&&isNaN(Q))return!0;return!1}if(J instanceof Date)return Q instanceof Date&&J.getTime()===Q.getTime();if(J instanceof RegExp)return Q instanceof RegExp&&J.source===Q.source&&J.flags===Q.flags;if(J instanceof Error)return Q instanceof Error&&J.name===Q.name&&J.message===Q.message&&(J.stack===Q.stack||!J.stack&&!Q.stack);if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView(J)){if(!ArrayBuffer.isView(Q))return!1;if(J.byteLength!==Q.byteLength)return!1;const X=new Uint8Array(J.buffer,J.byteOffset,J.byteLength),M=new Uint8Array(Q.buffer,Q.byteOffset,Q.byteLength);for(let D=0;D<X.length;D++)if(X[D]!==M[D])return!1;return!0}if(J instanceof Promise||J instanceof WeakMap||J instanceof WeakSet)return J===Q;if(typeof J==="function"){if(typeof Q!=="function")return!1;return J.toString()===Q.toString()&&J.name===Q.name}if(J.constructor!==Q.constructor)return!1;if(J instanceof Map||J instanceof Set||Array.isArray(J)||Object.getPrototypeOf(J)===Object.prototype)return!H0(J,Q);const Y=Object.getPrototypeOf(J);if(Y!==Object.getPrototypeOf(Q))return!1;const B=Object.getOwnPropertyNames(J),w=Object.getOwnPropertyNames(Q);if(B.length!==w.length)return!1;for(let X of B){if(!Object.prototype.hasOwnProperty.call(Q,X))return!1;if(!E0(J[X],Q[X]))return!1}if(Y!==null&&Y!==Object.prototype){const X=Object.getOwnPropertyNames(Y),M=Object.getOwnPropertyNames(Object.getPrototypeOf(Q));if(X.length!==M.length)return!1;for(let D of X){if(D==="constructor")continue;if(!E0(Y[D],Object.getPrototypeOf(Q)[D]))return!1}}return!0}function e1(J){for(let Q of J)if(typeof Q==="object"&&Q!==null)return!1;return!0}function J5(J){for(let[Q,W]of J)if(typeof Q==="object"&&Q!==null||typeof W==="object"&&W!==null)return!1;return!0}function Z0(J,Q=new WeakMap){if(J===null||typeof J!=="object"||J instanceof Promise)return J;if(Q.has(J))return Q.get(J);if(J instanceof Date)return new Date(J.getTime());if(J instanceof RegExp)return new RegExp(J.source,J.flags);if(J instanceof Map){const Y=new Map;return Q.set(J,Y),J.forEach((B,w)=>Y.set(Z0(w,Q),Z0(B,Q))),Y}if(J instanceof Set){const Y=new Set;return Q.set(J,Y),J.forEach((B)=>Y.add(Z0(B,Q))),Y}if(Array.isArray(J)){const Y=[];Q.set(J,Y);for(let B=0;B<J.length;B++)Y[B]=Z0(J[B],Q);return Y}if(ArrayBuffer.isView(J))return new J.constructor(J);const W=Object.create(Object.getPrototypeOf(J));Q.set(J,W);const q=Object.getOwnPropertySymbols(J);for(let Y of q)W[Y]=Z0(J[Y],Q);for(let Y in J)if(Object.prototype.hasOwnProperty.call(J,Y))W[Y]=Z0(J[Y],Q);return W}function Q5(J,Q){if(!J||typeof J!=="object")throw new TypeError("Original argument must be an object");if(!Q||typeof Q!=="object")throw new TypeError("ToSet argument must be an object");if(!Object.keys(Q).length)return{...J};function W(Y,B,w){const X=B.split(/\.|\[|\]/).filter(Boolean);let M=Y;for(let D=0;D<X.length;D++){const j=X[D],$=!isNaN(Number(j)),x=D===X.length-1,A=!isNaN(Number(X[D+1]));if(x){M[j]=w;continue}if(!(j in M))M[j]=A?[]:{};else if(A&&!Array.isArray(M[j]))M[j]=[];else if(!A&&Array.isArray(M[j]))M[j]={};M=M[j]}}const q=Z0(J);try{for(let[Y,B]of Object.entries(Q)){if(typeof Y!=="string")throw new TypeError(`Invalid path: ${Y}`);if(!/^[a-zA-Z0-9_\-\[\].]+$/.test(Y))throw new Error(`Invalid path format: ${Y}`);W(q,Y,B)}}catch(Y){throw new Error(`Failed to assign value: ${Y.message}`)}return q}var F0="syn:",M0="fn:",A0="on-",a=/^\.\.\./,J1=/^\[(.*?)\]$/,Z5=["@html","@text"];T1.default.fn.extend({attrs:function(){const J={},Q=this[0];return Q&&Q.nodeType!==Node.TEXT_NODE&&T1.default.each(Q.attributes,function(){J[this.name]=this.value}),J}});class Z1{debug;initialStats={renderCount:0,elementCount:0,renderTime:0,avgRenderTime:0,maxRenderTime:0,componentCount:0,componentUpdateCount:0,partialCount:0,partialUpdateCount:0,memoryUsage:void 0,domOperations:0,domInsertsCount:0,domUpdatesCount:0,domRemovalsCount:0,dependencyTrackCount:0,dependencyUpdateCount:0,batchSize:0,batchCount:0,errorCount:0};stats=this.reset();renderStartTime=0;renderTimes=[];measurementCount=0;maxMeasurements=100;loggingInterval=10;autoSaveInterval;constructor(J=!1){if(this.debug=J,this.debug)this.autoSaveInterval=window.setInterval(()=>this.storeMetrics(),5000)}storeMetrics(){try{const J=JSON.parse(localStorage.getItem("lipsPerformanceMetrics")||"[]");J.push({timestamp:Date.now(),metrics:{...this.stats}}),J.length>100&&J.shift(),localStorage.setItem("lipsPerformanceMetrics",JSON.stringify(J))}catch(J){}}startRender(){if(!this.debug)return;this.renderStartTime=performance.now()}endRender(){if(!this.debug||this.renderStartTime===0)return;const J=performance.now()-this.renderStartTime;this.stats.renderTime=J,this.stats.maxRenderTime=Math.max(this.stats.maxRenderTime,J),this.renderTimes.push(J),this.renderTimes.length>this.maxMeasurements&&this.renderTimes.shift(),this.stats.avgRenderTime=this.renderTimes.reduce((Q,W)=>Q+W,0)/this.renderTimes.length,this.renderStartTime=0,this.measurementCount++}inc(J){if(!this.debug)return;if(typeof this.stats[J]==="number")this.stats[J]++}dec(J){if(!this.debug)return;if(typeof this.stats[J]==="number"&&this.stats[J]>0)this.stats[J]--}record(J,Q){if(!this.debug)return;if(typeof this.stats[J]!=="undefined")this.stats[J]=Q}add(J,Q){if(!this.debug)return;if(typeof this.stats[J]==="number")this.stats[J]+=Q}reset(){return this.renderTimes=[],this.measurementCount=0,this.stats=Z0(this.initialStats)}log(){if(!this.debug)return;if(this.loggingInterval>1&&this.measurementCount%this.loggingInterval!==0)return;const J={"Render Count":this.stats.renderCount,"Element Count":this.stats.elementCount,"Avg Render Time (ms)":this.stats.avgRenderTime.toFixed(2),"Max Render Time (ms)":this.stats.maxRenderTime.toFixed(2)},Q={"Component Count":this.stats.componentCount,"Component Updates":this.stats.componentUpdateCount},W={"Partial Count":this.stats.partialCount,"Partial Updates":this.stats.partialUpdateCount},q={"DOM Operations":this.stats.domOperations,"DOM Inserts":this.stats.domInsertsCount,"DOM Updates":this.stats.domUpdatesCount,"DOM Removals":this.stats.domRemovalsCount},Y={"Dependencies Tracked":this.stats.dependencyTrackCount,"Dependency Updates":this.stats.dependencyUpdateCount},B={"Batch Count":this.stats.batchCount,"Avg Batch Size":this.stats.batchCount>0?(this.stats.batchSize/this.stats.batchCount).toFixed(2):"0"};console.group("Lips Framework Performance Metrics"),console.table(J),console.table(Q),console.table(W),console.table(q),console.table(Y),console.table(B),this.stats.memoryUsage&&console.log(`Memory Usage: ${this.stats.memoryUsage.toFixed(2)} MB`),this.stats.errorCount>0&&console.warn(`Errors encountered: ${this.stats.errorCount}`),console.groupEnd(),window.localStorage&&this.measurementCount%10===0&&this.storeMetrics()}trackMemory(){if(!this.debug||!window.performance?.memory)return;this.stats.memoryUsage=window.performance.memory.usedJSHeapSize/1048576}trackBatch(J){if(!this.debug)return;this.stats.batchCount++,this.stats.batchSize+=J}trackError(J){if(!this.debug)return;this.stats.errorCount++,console.error("Lips Framework Error:",J)}setLoggingInterval(J){if(!this.debug)return;this.loggingInterval=J}getSnapshot(){return Z0(this.stats)}dispose(){if(!this.debug)return;this.autoSaveInterval&&clearInterval(this.autoSaveInterval)}}var t=$1(e0(),1);var N5=$1(e0(),1);var Q1="comm",W1="rule",X1="decl";var W5="@import";var X5="@namespace",H5="@keyframes";var q5="@layer";function H1(J){return J.trim()}function x0(J,Q,W){return J.replace(Q,W)}function z5(J,Q,W){return J.indexOf(Q,W)}function L0(J,Q){return J.charCodeAt(Q)|0}function V0(J,Q,W){return J.slice(Q,W)}function z0(J){return J.length}function q1(J){return J.length}function h0(J,Q){return Q.push(J),J}var R1=Math.abs,d0=String.fromCharCode;function Y1(J,Q,W,q,Y,B,w,X){return{value:J,root:Q,parent:W,type:q,props:Y,children:B,line:z1,column:f0,length:w,return:"",siblings:X}}function B5(){return Q0}function G5(){if(Q0=G0>0?L0(k0,--G0):0,f0--,Q0===10)f0=1,z1--;return Q0}function w0(){if(Q0=G0<Y5?L0(k0,G0++):0,f0++,Q0===10)f0=1,z1++;return Q0}function N0(){return L0(k0,G0)}function i0(){return G0}function B1(J,Q){return V0(k0,J,Q)}function g0(J){switch(J){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function w5(J){return z1=f0=1,Y5=z0(k0=J),G0=0,[]}function K5(J){return k0="",J}function G1(J){return H1(B1(G0-1,A1(J===91?J+2:J===40?J+1:J)))}function U5(J){while(Q0=N0())if(Q0<33)w0();else break;return g0(J)>2||g0(Q0)>3?"":" "}function O5(J,Q){while(--Q&&w0())if(Q0<48||Q0>102||Q0>57&&Q0<65||Q0>70&&Q0<97)break;return B1(J,i0()+(Q<6&&N0()==32&&w0()==32))}function A1(J){while(w0())switch(Q0){case J:return G0;case 34:case 39:if(J!==34&&J!==39)A1(Q0);break;case 40:if(J===41)A1(J);break;case 92:w0();break}return G0}function M5(J,Q){while(w0())if(J+Q0===57)break;else if(J+Q0===84&&N0()===47)break;return"/*"+B1(Q,G0-1)+"*"+d0(J===47?J:w0())}function D5(J){while(!g0(N0()))w0();return B1(J,G0)}var z1=1,f0=1,Y5=0,G0=0,Q0=0,k0="";function F5(J){return K5(w1("",null,null,null,[""],J=w5(J),0,[0],J))}function w1(J,Q,W,q,Y,B,w,X,M){var D=0,j=0,$=w,x=0,A=0,u=0,i=1,e=1,l=1,c=0,d="",k=Y,y=B,R=q,K=d;while(e)switch(u=c,c=w0()){case 40:if(u!=108&&L0(K,$-1)==58){if(z5(K+=x0(G1(c),"&","&\f"),"&\f",R1(D?X[D-1]:0))!=-1)l=-1;break}case 34:case 39:case 91:K+=G1(c);break;case 9:case 10:case 13:case 32:K+=U5(u);break;case 92:K+=O5(i0()-1,7);continue;case 47:switch(N0()){case 42:case 47:if(h0(HJ(M5(w0(),i0()),Q,W,M),M),(g0(u||1)==5||g0(N0()||1)==5)&&z0(K)&&V0(K,-1,void 0)!==" ")K+=" ";break;default:K+="/"}break;case 123*i:X[D++]=z0(K)*l;case 125*i:case 59:case 0:switch(c){case 0:case 125:e=0;case 59+j:if(l==-1)K=x0(K,/\f/g,"");if(A>0&&(z0(K)-$||i===0&&u===47))h0(A>32?I5(K+";",q,W,$-1,M):I5(x0(K," ","")+";",q,W,$-2,M),M);break;case 59:K+=";";default:if(h0(R=j5(K,Q,W,D,j,Y,X,d,k=[],y=[],$,B),B),c===123)if(j===0)w1(K,Q,R,R,k,B,$,X,y);else{switch(x){case 99:if(L0(K,3)===110)break;case 108:if(L0(K,2)===97)break;default:j=0;case 100:case 109:case 115:}if(j)w1(J,R,R,q&&h0(j5(J,R,R,0,0,Y,X,d,Y,k=[],$,y),y),Y,y,$,X,q?k:y);else w1(K,R,R,R,[""],y,0,X,y)}}D=j=A=0,i=l=1,d=K="",$=w;break;case 58:$=1+z0(K),A=u;default:if(i<1){if(c==123)--i;else if(c==125&&i++==0&&G5()==125)continue}switch(K+=d0(c),c*i){case 38:l=j>0?1:(K+="\f",-1);break;case 44:X[D++]=(z0(K)-1)*l,l=1;break;case 64:if(N0()===45)K+=G1(w0());x=N0(),j=$=z0(d=K+=D5(i0())),c++;break;case 45:if(u===45&&z0(K)==2)i=0}}return B}function j5(J,Q,W,q,Y,B,w,X,M,D,j,$){var x=Y-1,A=Y===0?B:[""],u=q1(A);for(var i=0,e=0,l=0;i<q;++i)for(var c=0,d=V0(J,x+1,x=R1(e=w[i])),k=J;c<u;++c)if(k=H1(e>0?A[c]+" "+d:x0(d,/&\f/g,A[c])))M[l++]=k;return Y1(J,Q,W,Y===0?W1:X,M,D,j,$)}function HJ(J,Q,W,q){return Y1(J,Q,W,Q1,d0(B5()),V0(J,2,-2),0,q)}function I5(J,Q,W,q,Y){return Y1(J,Q,W,X1,V0(J,0,q),V0(J,q+1,-1),q,Y)}function K1(J,Q){var W="";for(var q=0;q<J.length;q++)W+=Q(J[q],q,J,Q)||"";return W}function L5(J,Q,W,q){switch(J.type){case q5:if(J.children.length)break;case W5:case X5:case X1:return J.return=J.return||J.value;case Q1:return"";case H5:return J.return=J.value+"{"+K1(J.children,q)+"}";case W1:if(!z0(J.value=J.props.join(",")))return""}return z0(W=K1(J.children,q))?J.return=J.value+"{"+W+"}":""}function V5(J){var Q=q1(J);return function(W,q,Y,B){var w="";for(var X=0;X<Q;X++)w+=J[X](W,q,Y,B)||"";return w}}class y0{nsp;settings;$head;constructor(J,Q){if(typeof J!=="string")throw new Error("Undefined or invalid styles attachement element(s) namespace");this.nsp=J,this.$head=N5.default("head"),this.settings=Q||{},this.settings&&this.load(this.settings)}compile(J){try{return K1(F5(J),V5([L5]))}catch(Q){throw new Error(`Style compilation failed: ${Q.message}`)}}waitForStyles(J){return new Promise((Q)=>{const W=new MutationObserver(()=>{const q=document.querySelector(J);if(q&&getComputedStyle(q).cssText)W.disconnect(),Q()});W.observe(document.documentElement,{attributes:!0,childList:!0,subtree:!0})})}async inject(J){if(!J)throw new Error("Invalid injection arguments");const Q=`rel="${this.settings.meta?"@":""}${this.nsp}"`;J=this.settings.meta?J:`[rel="${this.nsp}"] { ${J} }`;try{const W=this.compile(J);if(!W)throw new Error(`<component:${this.nsp}> sheet compilation failed`);const q=document.createElement("style");q.setAttribute("rel",`${this.settings.meta?"@":""}${this.nsp}`),q.textContent=W;let Y=0;const B=this.$head.find(`style[${Q}]`);if(B.length)Y=parseInt(B.attr("dindex"))+1,B.remove();return q.setAttribute("dindex",String(Y)),this.settings.meta?document.head.prepend(q):document.head.appendChild(q),q}catch(W){throw new Error(`Style injection failed: ${W.message}`)}}async load(J){if(this.settings=J,typeof this.settings!=="object")throw new Error("Undefined styles settings");if(this.settings.sheet){const Q=await this.inject(this.settings.sheet);await this.waitForStyles(`style[rel="${this.settings.meta?"@":""}${this.nsp}"]`)}}get(){}async clear(){const J=this.$head.find(`style[rel="${this.settings.meta?"@":""}${this.nsp}"]`);if(!J.length)return;const Q=parseInt(J.attr("dindex"));Q===0?J.remove():J.attr("dindex",String(Q-1))}async custom(){return{}}async style(){return{}}}var qJ=function(J){const Q=/on-([a-zA-Z-]+)\s*\(/g;let W=J,q;while((q=Q.exec(J))!==null){const Y=q[1],B=q.index+q[0].length;let w=1,X=B;while(X<J.length&&w>0){if(J[X]==="(")w++;if(J[X]===")")w--;X++}if(w===0){const M=J.slice(B,X-1).trim(),D=J.slice(0,q.index),j=`${A0}${Y}="${M}"`,$=J.slice(X);W=D+j+$,J=W,Q.lastIndex=D.length+j.length}}return W},zJ=function(J){const Q=[];let q=J.replace(/<([a-zA-Z][a-zA-Z0-9_-]*)((?:[^>'"]*|'[^']*'|"[^"]*")*?)(?:\/?>)/g,(Y,B,w)=>{return Q.push(w),`<${B}##TAG_ATTRS_${Q.length-1}##>`});for(let Y=0;Y<Q.length;Y++){const B=`##TAG_ATTRS_${Y}##`,w=Q[Y],X=YJ(w);q=q.replace(B,X)}return q},YJ=function(J){let Q="",W=0,q=!1,Y="",B=0,w=0,X=0;while(W<J.length){const M=J[W];if((M==='"'||M==="'")&&(W===0||J[W-1]!=="\\")){if(!q)q=!0,Y=M;else if(M===Y)q=!1}if(!q){if(M==="(")w++;else if(M===")")w--;else if(M==="{")X++;else if(M==="}")X--}if(!q&&w===0&&X===0&&(M===" "||W===J.length-1)){let D=W;if(W===J.length-1)D=W+1;const j=J.substring(B,D).trim();if(j){const $=BJ(j);Q+=" "+$}B=W+1}W++}return Q},BJ=function(J){const Q=J.indexOf("=");if(Q===-1){if(J.startsWith("...")||J.startsWith("["))return J;return`:${J}="${!J.startsWith("!")}"`}let W=J.substring(0,Q).trim(),q=J.substring(Q+1).trim();if(W.startsWith("@"))return W=!Z5.includes(W)?W.slice(1):W,`:${W}=${q}`;if(W.startsWith(M0)||W.startsWith(A0))return J;if(q.startsWith('"')&&q.endsWith('"')||q.startsWith("'")&&q.endsWith("'")){const Y=q.substring(1,q.length-1);if(GJ(Y))return`:${W}="${Y}"`;return J}else return`:${W}="${q}"`};function GJ(J){if(/\bstate\.|\binput\.|\bself\.|\bcontext\./.test(J))return!0;if(/[\+\*\/\%\(\)\{\}\[\]]|\?\s*:/.test(J))return!0;if(/\b[a-zA-Z_][a-zA-Z0-9_]*\.[a-zA-Z_]/.test(J))return!0;if(J.includes("{")&&J.includes("}"))return!0;return!1}function _1(J){let Q=(J||"").trim().replace(/>\s*</g,"><").replace(/\s{2,}/g," ").replace(/[\r\n\t]/g,"").replace(/<([a-zA-Z0-9_-]+)([^>]*?)\s*\/>/g,"<$1$2></$1>").replace(/<\{([^}]+)\}\s*(.*?)(\/)>/g,(W,q,Y)=>{return Y.endsWith("<")?`<lips dtag="${q}" ${Y}/lips>`:`<lips dtag="${q}" ${Y}></lips>`}).replace(/(<>)([\s\S]*?)(<\/>)/g,'<lips fragment="true">$2</lips>').replace(/<if\(\s*(.*?)\s*\)>/g,'<if @by="$1">').replace(/<else-if\(\s*(.*?)\s*\)>/g,'<else-if @by="$1">').replace(/<switch\(\s*(.*?)\s*\)>/g,'<switch @by="$1">').replace(/<async await\(\s*(.*?)\s*\)>/g,`<async ${M0}await="\$1">`).replace(/<log\(\s*(.*?)\s*\)>/g,'<log @args="$1">').replace(/\[(.*?)\]/g,(W)=>W.replace(/\s+/g,""));return Q=qJ(Q),Q=zJ(Q),Q}var wJ=function(J,Q){if(J.isDisposed)return;Q.add(J),J.dependencies.add(Q)},P5=function(J){for(let Q of J.dependencies)Q.delete(J);J.dependencies.clear()};function v0(J,Q={maxSize:100}){const W=new Set,q=[{value:J,timestamp:Date.now()}];let Y=0;const B=()=>{const D=U1[U1.length-1];return D&&wJ(D,W),q[Y].value},w=()=>{const D=[...W];if(C5)for(let j of D)C5.add(j);else for(let j of D)j.execute()};return[B,(D,j)=>{if(Object.is(q[Y].value,D))return;if(Y<q.length-1)q.splice(Y+1);if(q.push({value:D,timestamp:Date.now(),metadata:j}),q.length>Q.maxSize)q.shift(),Y=Math.max(0,Y-1);else Y++;w()},{undo(){if(Y>0)Y--,w()},redo(){if(Y<q.length-1)Y++,w()},jumpTo(D){if(D>=0&&D<q.length&&D!==Y)Y=D,w()},getHistory(){return[...q]},getCurrentIndex(){return Y},canUndo(){return Y>0},canRedo(){return Y<q.length-1},clear(){const D=q[0];q.length=0,q.push(D),Y=0,w()}}]}function O1(J){let Q=!1;const W=()=>{if(Q)throw new Error("Circular dependency detected");if(q.isDisposed)return;Q=!0,P5(q),U1.push(q);try{J()}finally{Q=!1,U1.pop()}},q={execute:W,dependencies:new Set,isDisposed:!1};return W(),{dispose:()=>{q.isDisposed=!0,P5(q)}}}var U1=[],C5=null;class c0 extends a0{declaration;$=null;input;state;static;context;__name__;__path__;__template__;__previous;__macros=new Map;__translations=new Map;__renderCache=new Map;FGUD=new Map;PCC=new Map;VER=[];prepath="0";debug=!1;isRendered=!1;__setInput;__setState;__getState;UQS;ICE;lips;metrics;stylesheet;__path="";__pathCounter=0;__renderDepth=0;constructor(J,Q,{input:W,state:q,context:Y,_static:B,handler:w,stylesheet:X,macros:M,declaration:D},j){super();if(this.lips=j.lips,j?.debug)this.debug=j.debug||this.lips.debug;if(j?.prepath)this.prepath=j.prepath;if(this.__name__=J,this.__path__=`${this.prepath}/${this.__name__}`,this.__template__=_1(Q),console.log(this.__template__),this.declaration=D||{name:J},this.input=W||{},this.static=B||{},this.context={},this.state=this.lips.IUC.proxyState(this.__path__,q||{}),M&&this.setMacros(M),w&&this.setHandler(w),X&&this.setStylesheet(X),this.metrics=new Z1(this.debug),this.metrics.inc("componentCount"),this.UQS=new t0(this),typeof this.onCreate=="function"&&this.onCreate.bind(this)(),this.emit("component:create",this),this.input&&Object.keys(this.input).length&&typeof this.onInput=="function")this.onInput.bind(this)(this.input),this.emit("component:input",this);this.__previous={input:Z0(this.input),state:Z0(this.state),context:Z0(this.context)};const[$,x]=v0(this.input),[A,u]=v0(this.state),[i,e]=v0(this.context);this.__setInput=x,this.__setState=u,this.__getState=A,this.lips.IUC.register(this.__path__,()=>{H0(this.__previous?.state,this.state)&&this.__setState({...this.__getState(),...this.state})}),Array.isArray(Y)&&Y.length&&this.lips.useContext(Y,(l)=>{if(!H0(this.context,l))return;e(l),this.context=l,typeof this.onContext=="function"&&this.onContext.bind(this)(),this.emit("component:context",this)}),this.ICE=O1(()=>{const l=$(),c=A(),d=this.context=i();if(!this.isRendered){this.metrics.reset();const{$log:k}=this.render("",void 0,void 0,this.FGUD);this.$=k,!D?.syntax&&this.$?.each((y,R)=>typeof R.setAttribute=="function"&&R.setAttribute("rel",this.__name__)),this.isRendered=!0,typeof this.onMount=="function"&&this.onMount.bind(this)(),this.emit("component:mount",this),this.lips.watcher.watch(this)}else this.__updateDepNodes__({state:c,input:l,context:d},this.__previous),typeof this.onUpdate=="function"&&this.onUpdate.bind(this)(),this.emit("component:update",this),this.__previous={input:Z0(l),state:Z0(c),context:Z0(d)},this.input=l;this.metrics.log(),typeof this.onRender=="function"&&this.onRender.bind(this)(),this.emit("component:render",this)})}setContext(J,Q){this.lips.setContext(J,Q)}setInput(J){if(!H0(this.input,J))return;this.__setInput(J),typeof this.onInput=="function"&&this.onInput.bind(this)(J)}subInput(J){if(typeof J!=="object")throw new Error("Invalid sub input data argument");return this.setInput(Q5(this.input,J)),this}setMacros(J){const Q=_1(J),W=t.default(Q);if(!W.length)return;const q=this;W.each(function(){const Y=t.default(this),{argv:B,attrs:w}=q.__getAttributes__(Y);if(!Object.keys(w))throw new Error("Invalid macro component definition");if(!w.literals.name)throw new Error("Undefined macro `name` attribute.");if(q.__macros.get(w.literals.name))console.warn(`Duplicate macro <${w.literals.name}> will be override`);if(!Y.contents()?.length)throw new Error("Invalid macro component definition. Template content expected.");q.__macros.set(w.literals.name,{argv:B,$node:Y})})}setHandler(J){Object.entries(J).map(([Q,W])=>this[Q]=W.bind(this))}setStylesheet(J){const Q={sheet:J,meta:this.__name__==="__ROOT__"};this.stylesheet=new y0(this.__name__,Q)}get node(){if(!this.$)throw new Error("node() is expected to be call after component get rendered");return this.$}render(J,Q,W={},q,Y){const B=q||new Map,w=[];if(Q&&!Q.length)return console.warn("Undefined node element to render"),{$log:Q,dependencies:B};this.metrics.startRender();const X=this;let M=t.default();function D(K){const G=j(K);return X.__pathCounter++,X.__path?`${X.__path}/${G}`:`${J?J+"/":"#"}${G}`}function j(K){return(K==="component"?"c":"")+X.__pathCounter}function $(K){return K!==null&&typeof K==="object"&&typeof K.mesh==="function"&&typeof K.update==="function"}function x(K){return K!==null&&typeof K==="object"&&typeof K.default&&typeof K.default==="string"}function A(K){if(!K.attr(":dtag")||K.prop("tagName")!=="LIPS")throw new Error("Invalid dynamic tag name");const G=K.attr(":dtag"),O=X.__evaluate__(G,W);if($(O)||O===null)return l(K,G,O);else if(x(O))return c(K,{template:O});else return c(K,{name:O})}function u(K){const G=K.attr(":args"),O=D("log");if(!G)return;if(X.__evaluate__(`console.log(${G})`,W),X.__isReactive__(G,W))X.__extractExpressionDeps__(G,W).forEach((V)=>X.__trackDep__(B,V,{$fragment:null,path:O,update:(S)=>X.__evaluate__(`console.log(${G})`,S),memo:W,batch:!0}))}function i(K){const G=D("var"),{attrs:O}=X.__getAttributes__(K);if(!O)return;Object.entries(O.literals).forEach(([L,V])=>{if(W[L]&&W[L].type==="const")throw new Error(`Cannot override <const ${L}=[value]/> variable`);W[L]={value:V,type:"let"}}),Object.entries(O.expressions).forEach(([L,V])=>{if(a.test(L)){const S=(P,b)=>{const v=X.__evaluate__(L.replace(a,""),b||W);if(typeof v!=="object")throw new Error(`Invalid spread operator ${L}`);for(let N in v){if(W[N]&&W[N].type==="const")throw new Error(`Cannot override <const ${N}=[value]/> variable`);if(W[N]={value:v[N],type:"let"},b)b[N]=W[N],X.__updateVarDepNodes__(N,G,b)}if(P)return{memo:b}};X.__extractExpressionDeps__(L,W).forEach((P)=>X.__trackDep__(B,P,{$fragment:null,path:`${G}.${L}`,update:(b)=>S(!0,b),memo:W,batch:!0})),S()}else if(V){if(X.__isReactive__(V,W)){const S=X.__extractExpressionDeps__(V,W),r=(P,b)=>{if(W[L]&&W[L].type==="const")throw new Error(`Cannot override <const ${L}=[value]/> variable`);return P[L]=W[L]={value:X.__evaluate__(V,P),type:"let"},X.__updateVarDepNodes__(L,G,P),{memo:P}};S.forEach((P)=>X.__trackDep__(B,P,{$fragment:null,path:`${G}.${L}`,update:r,memo:W,batch:!0}))}if(W[L]&&W[L].type==="const")throw new Error(`Cannot override <const ${L}=[value]/> variable`);W[L]={value:X.__evaluate__(V,W),type:"let"}}}),X.metrics.inc("elementCount")}function e(K){const{attrs:G}=X.__getAttributes__(K);if(!G)return;Object.entries(G.literals).forEach(([O,L])=>{if(W[O]&&W[O].type==="const")throw new Error(`<const ${O}=[value]/> variable already defined`);if(!L)return;W[O]={value:L,type:"const"}}),Object.entries(G.expressions).forEach(([O,L])=>{if(a.test(O)){const V=X.__evaluate__(O.replace(a,""),W);if(typeof V!=="object")throw new Error(`Invalid spread operator ${O}`);for(let S in V){if(W[S]&&W[S].type==="const")throw new Error(`<const ${S}=[value]/> by spread operator ${O}. [${S}] variable already defined`);W[S]={value:V[S],type:"const"}}}else{if(W[O]&&W[O].type==="const")throw new Error(`<const ${O}=[value]/> variable already defined`);if(!L)return;W[O]={value:X.__evaluate__(L,W),type:"const"}}}),X.metrics.inc("elementCount")}function l(K,G,O){const{attrs:L}=X.__getAttributes__(K),V=D("element"),S=X.__getBoundaries__(V);let r=t.default(S.start),P={},b=O;if(b){L.literals&&Object.entries(L.literals).forEach(([N,E])=>P[N]={type:"arg",value:E}),L.expressions&&Object.entries(L.expressions).forEach(([N,E])=>{if(!b)return;if(a.test(N)){const _=X.__evaluate__(N.replace(a,""),W);if(typeof _!=="object")throw new Error(`Invalid spread operator ${N}`);for(let T in _){if(T!=="#"&&!b.argv.includes(T))continue;P[T]={type:"arg",value:_[T]}}}else{if(N!=="#"&&!b.argv.includes(N))return;P[N]={type:"arg",value:E?X.__evaluate__(E,W):!0}}});const v=b.mesh(P);if(v&&v.length)r=r.add(v);L.expressions&&Object.entries(L.expressions).forEach(([N,E])=>{if(!b)return;if(a.test(N)&&X.__isReactive__(N,W)){const _=X.__extractExpressionDeps__(N,W),T=(I,g)=>{if(!b)return;const h={},o=X.__evaluate__(N.replace(a,""),I);if(typeof o!=="object")throw new Error(`Invalid spread operator ${N}`);const s=[];for(let p in o){if(p!=="#"&&!b.argv.includes(p))continue;P[p]=h[p]={type:"arg",value:o[p]},(!I[p]||!E0(o[p],I[p].value))&&s.push(p)}s.length&&b.update(s,h,S)};_.forEach((I)=>X.__trackDep__(B,I,{$fragment:null,boundaries:S,path:`${V}.${N}`,update:T,memo:W,batch:!0}))}else if((N==="#"||b.argv.includes(N))&&X.__isReactive__(E,W)){const _=X.__extractExpressionDeps__(E,W),T=(I,g)=>{if(!b)return;const h=P[N]={type:"arg",value:E?X.__evaluate__(E,I):!0};b.update([N],{[N]:h},S)};_.forEach((I)=>X.__trackDep__(B,I,{$fragment:null,boundaries:S,path:`${V}.${N}`,update:T,memo:W,batch:!0}))}})}if(X.__isReactive__(G,W)){const v=(E,_)=>{const T=X.__evaluate__(G,E);let I;if(x(T))I=c(K,{template:T});else if($(T))P="#"in P?{...E,...P["#"].value}:{...E,...P},b=T,I=b?b.mesh(P):null;if(!document.contains(S.start)||!document.contains(S.end))throw new Error("Dynamic element boundaries not found");const g=[];let h=S.start.nextSibling;while(h&&h!==S.end)g.push(h),h=h.nextSibling;t.default(g).remove(),I&&t.default(S.start).after(I)};X.__extractExpressionDeps__(G,W).forEach((E)=>X.__trackDep__(B,E,{$fragment:null,boundaries:S,path:V,update:v,batch:!0,memo:{...W,...P}}))}return r=r.add(S.end),r}function c(K,G){let O,L;if(G?.template)O=G.template,L=j("component");else{if(L=G?.name||K.prop("tagName")?.toLowerCase(),!L)throw new Error("Invalid component");if(L===X.__name__)throw new Error("Render component within itself is forbidden");O=X.lips.import(L)}if(!O||!L)throw new Error(`<${L}> template not found`);const V=D("component"),S=X.__getBoundaries__(V),{argv:r,attrs:P,events:b}=X.__getAttributes__(K),v={};let N={},E=t.default(S.start),_=X.PCC.get(V);P.literals&&Object.entries(P.literals).forEach(([I,g])=>{if(I=="key")return;N[I]=g}),P.functions&&Object.entries(P.functions).forEach(([I,g])=>{N[I]=X.__evaluateFunction__(g,[],W),O.declaration?.syntax?v[F0+M0+I]=g:v[M0+I]=g}),P.expressions&&Object.entries(P.expressions).forEach(([I,g])=>{if(I=="key")return;if(a.test(I)){const h=X.__evaluate__(I.replace(a,""),W);if(typeof h!=="object")throw new Error(`Invalid spread operator ${I}`);for(let o in h)N[o]=h[o]}else N[I]=g?X.__evaluate__(g,W):!0;O.declaration?.syntax?v[F0+I]=g:v[I]=g});const T=K.contents();if(T.length){if(N={...N,...X.__meshwire__({$node:K,fragmentPath:V,fragmentBoundaries:S,meshPath:null,argv:r,scope:W,xmlns:Y,useAttributes:!0,declaration:O.declaration},v)},O.declaration){if(O.declaration.tags)Object.entries(O.declaration?.tags).forEach(([I,{type:g,many:h}])=>{switch(g){case"nexted":{let o=K.next(I);if(!o.length)return;if(h){N[I]=[];let s=0,p=!1;while(!p){if(N[I].push(X.__meshwire__({$node:o,meshPath:`${I}[${s}]`,fragmentPath:V,fragmentBoundaries:S,argv:r,scope:W,xmlns:Y,useAttributes:!0,declaration:O.declaration},v)),!o.next(I).length){p=!0;break}o=o.next(I),s++}}else N[I]=X.__meshwire__({$node:o,meshPath:I,fragmentPath:V,fragmentBoundaries:S,argv:r,scope:W,xmlns:Y,useAttributes:!0,declaration:O.declaration},v)}break;case"child":{const o=K.children(I);if(h)N[I]=[],o.each(function(s){const p=t.default(this),{argv:D0}=X.__getAttributes__(p);N[I].push(X.__meshwire__({$node:p,meshPath:`${I}[${s}]`,fragmentPath:V,fragmentBoundaries:S,argv:D0,scope:W,xmlns:Y,useAttributes:!0,declaration:O.declaration},v))});else if(K.children(I).first().length){const s=K.children(I).first(),{argv:p}=X.__getAttributes__(s);N[I]=X.__meshwire__({$node:s,meshPath:I,fragmentPath:V,fragmentBoundaries:S,argv:p,scope:W,xmlns:Y,useAttributes:!0,declaration:O.declaration},v)}}break}});else if(O.declaration.contents)N.__contents__=T}}if(_)_.setInput(Z0(N)),E=E.add(_.node);else{const{declaration:I,state:g,_static:h,handler:o,context:s,default:p,stylesheet:D0}=O;_=new c0(L,p||"",{state:Z0(g),input:Z0(N),context:s,_static:Z0(h),handler:o,stylesheet:D0,declaration:I},{debug:X.debug,lips:X.lips,prepath:V}),E=E.add(_.node),X.PCC.set(V,_),Object.entries(b).forEach(([J0,n])=>!!_&&X.__attachEvent__(_,J0,n,W)),v&&Object.entries(v).forEach(([J0,n])=>{let q0=!1,m0=!1;if(J0.startsWith(F0))q0=!0,J0=J0.replace(F0,"");if(J0.startsWith(M0))m0=!0,J0=J0.replace(M0,"");if(a.test(J0)){const $0=(C0)=>{const K0={},_0=X.__evaluate__(J0.replace(a,""),C0);if(typeof _0!=="object")throw new Error(`Invalid spread operator ${J0}`);for(let T0 in _0)K0[T0]=_0[T0];_?.subInput(K0)};if(X.__isReactive__(J0,W))X.__extractExpressionDeps__(n,W).forEach((K0)=>X.__trackDep__(B,K0,{$fragment:null,boundaries:S,path:`${V}.${J0}`,update:$0,syntax:q0,memo:W,batch:!0}))}else{const $0=(C0)=>{const K0=m0?X.__evaluateFunction__(n,[],C0):n?X.__evaluate__(n,C0):!0;_?.subInput({[J0]:K0})};if(X.__isReactive__(n,W))X.__extractExpressionDeps__(n,W).forEach((K0)=>X.__trackDep__(B,K0,{$fragment:null,boundaries:S,path:`${V}.${J0}`,update:$0,syntax:q0,memo:W,batch:!0}))}}),E=E.add(S.end)}return X.metrics.inc("componentCount"),E}function d(K){const G=K.prop("tagName")?.toLowerCase();if(!G)throw new Error("Invalid macro rendering call");const O=X.__macros.get(G);if(!O)throw new Error("Macro component not found");const L=D("macro"),V=X.__getBoundaries__(L),{attrs:S}=X.__getAttributes__(K),r={};let P={},b={},v=t.default(V.start);if(S.literals&&Object.entries(S.literals).forEach(([T,I])=>P[T]={value:I,type:"arg"}),S.expressions&&Object.entries(S.expressions).forEach(([T,I])=>{if(a.test(T)){const g=X.__evaluate__(T.replace(a,""),W);if(typeof g!=="object")throw new Error(`Invalid spread operator ${T}`);for(let h in g)if(b[h]=g[h],O.argv.includes(h))P[h]={value:g[h],type:"arg"};r[T]=I}else{const g=I?X.__evaluate__(I,W):!0;if(b[T]=g,O.argv.includes(T))P[T]={value:g,type:"arg"};if(O.argv.includes(T))r[T]=I}O.argv.forEach((g)=>{if(P[g]!==void 0)return;P[g]={value:!1,type:"arg"}})}),O.argv.includes("__"))P.__={value:b,type:"arg"};const N={$node:O.$node,meshPath:null,fragmentPath:L,fragmentBoundaries:V,argv:O.argv,scope:W,xmlns:Y,useAttributes:!0},E=X.__meshwire__(N,r),_=E.renderer.mesh(P);return v=v.add(_),r&&Object.entries(r).forEach(([T,I])=>{let g=!1;if(new RegExp(`^${F0}`).test(T))g=!0,T=T.replace(F0,"");if(a.test(T)){if(!X.__isReactive__(T,W))return;const h=X.__extractExpressionDeps__(T,W),o=(s)=>{const p={},D0=X.__evaluate__(T.replace(a,""),s);if(typeof D0!=="object")throw new Error(`Invalid spread operator ${T}`);const J0=[];for(let n in D0)p[n]={value:D0[n],type:"arg"},(!s[n]||!E0(D0[n],s[n].value))&&J0.push(n);return J0.length&&E.renderer.update(J0,p),{memo:{...s,...p}}};h.forEach((s)=>X.__trackDep__(B,s,{$fragment:null,boundaries:V,path:`${L}.${T}`,update:o,syntax:g,memo:{...W,...P},batch:!0}))}else if(X.__isReactive__(I,W)){const h=X.__extractExpressionDeps__(I,W),o=(s)=>{const p=s[T]={value:I?X.__evaluate__(I,s):!0,type:"arg"};return E.renderer.update([T],{[T]:p}),{memo:s}};h.forEach((s)=>X.__trackDep__(B,s,{$fragment:null,boundaries:V,path:`${L}.${T}`,update:o,syntax:g,memo:{...W,...P},batch:!0}))}}),v=v.add(V.end),X.metrics.inc("elementCount"),v}function k(K){if(!K.length||!K.prop("tagName"))return K;const G=K.is("svg")||Y,O=G?t.default(document.createElementNS("http://www.w3.org/2000/svg",K.prop("tagName").toLowerCase())):t.default(`<${K.prop("tagName").toLowerCase()}/>`),L=K.contents(),V=D("element");L.length&&O.append(X.__withPath__(V,()=>X.render(V+".n",L,W,B,G).$log));const{attrs:S,events:r}=X.__getAttributes__(K);S.literals&&Object.entries(S.literals).forEach(([b,v])=>O.attr(b,v));const P=(b,v=!1)=>{b&&Object.entries(b).forEach(([N,E])=>{switch(N){case"@html":{const _=(T)=>{O.html(X.__evaluate__(E,T))};if(_(W),v&&X.__isReactive__(E,W))X.__extractExpressionDeps__(E,W).forEach((I)=>X.__trackDep__(B,I,{$fragment:O,path:`${V}.${N}`,update:_,memo:W,batch:!0}))}break;case"@text":{const _=(T)=>{let I=X.__evaluate__(E,T);if(!K.is("[no-translate]")){const{text:g}=X.lips.i18n.translate(I);I=g}O.text(I)};if(_(W),v&&X.__isReactive__(E,W))X.__extractExpressionDeps__(E,W).forEach((I)=>X.__trackDep__(B,I,{$fragment:O,path:`${V}.${N}`,update:_,memo:W,batch:!0}))}break;case"style":{const _=(T)=>{const I=X.__evaluate__(E,T);if(typeof I==="object"){let g="";Object.entries(I).forEach(([h,o])=>g+=`${h}:${o};`),g.length&&O.attr("style",g)}else O.attr("style",I)};if(_(W),v&&X.__isReactive__(E,W))X.__extractExpressionDeps__(E,W).forEach((I)=>X.__trackDep__(B,I,{$fragment:O,path:`${V}.${N}`,update:_,memo:W,batch:!0}))}break;default:{const _=(T)=>{const I=E?X.__evaluate__(E,T):E!==void 0?E:!0;I===void 0||I===!1?O.removeAttr(N):O.attr(N,I)};if(_(W),v&&X.__isReactive__(E,W))X.__extractExpressionDeps__(E,W).forEach((I)=>X.__trackDep__(B,I,{$fragment:O,path:`${V}.${N}`,update:_,memo:W,batch:!0}))}}})};return S.expressions&&Object.keys(S.expressions).forEach((b)=>{if(!a.test(b))return;const v=(N)=>{const E={},_=X.__evaluate__(b.replace(a,""),N);if(typeof _!=="object")throw new Error(`Invalid spread operator ${b}`);for(let T in _)E[T]=_[T];P(E)};if(delete S.expressions[b],v(W),b&&X.__isReactive__(b,W))X.__extractExpressionDeps__(b,W).forEach((E)=>X.__trackDep__(B,E,{$fragment:O,path:`${V}.${b}`,update:v,memo:W,batch:!0}))}),P(S.expressions,!0),r&&Object.entries(r).forEach(([b,v])=>{w.push({_event:b,$fragment:O,instruction:v,scope:W})}),X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),O}function y(K){const G=K.text(),O=D("element"),L=!K.parent().is("[no-translate]"),V=t.default(document.createTextNode(X.__interpolate__(G,L,W)));if(G&&X.__isReactive__(G,W)){const S=X.__extractTextDeps__(G,W),r=(P)=>{const b=X.__interpolate__(G,L,P);if(!V[0])return;V[0].textContent=b};S.forEach((P)=>X.__trackDep__(B,P,{path:O,$fragment:V,update:r,memo:W,translate:L,batch:S.length>1}))}return X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),V}function R(K){if(K.get(0)?.nodeType===Node.COMMENT_NODE)return K;if(K.get(0)?.nodeType===Node.TEXT_NODE)return y(K);if(K.is("let"))return i(K);else if(K.is("const"))return e(K);else if(K.is("lips")&&K.attr(":dtag"))return A(K);else if(K.is("log"))return u(K);else if(X.__macros.has(K.prop("tagName")?.toLowerCase()))return d(K);else if(K.is("if, for, switch, async")||X.lips.has(K.prop("tagName")?.toLowerCase()))return c(K);else if(K.is("else-if, else"))return;return k(K)}try{this.__renderDepth++,Q=Q||t.default(this.__template__),Q.each(function(){const K=R(t.default(this));if(K)M=M.add(K)}),w.forEach(({$fragment:K,_event:G,instruction:O,scope:L})=>{this.__attachEvent__(K,G,O,L)}),X.metrics.inc("renderCount")}catch(K){console.error("Rendering Failed --",K),X.metrics.trackError(K)}finally{if(this.__renderDepth--,this.metrics.endRender(),this.metrics.trackMemory(),this.__renderDepth===0)this.__path="",this.__pathCounter=0}return{$log:M,dependencies:B,events:w}}destroy(){this.ICE.dispose(),this.stylesheet?.clear(),this.metrics.dispose(),this.lips.IUC.unregister(this.__path__),this.lips.watcher.unwatch(this),this.VER.forEach(({element:J,_event:Q})=>this.__detachEvent__(J,Q)),this.VER=[];for(let J in this.PCC){const Q=this.PCC.get(J);Q?.destroy(),Q?.delete(J)}if(this.$?.remove(),this.PCC?.clear(),this.FGUD?.clear(),this.state.reset(),this.__macros.clear(),this.__previous=null,this.state=null,this.input=null,this.context=null,this.$)this.$.each((J,Q)=>{t.default(Q).off()}),this.$=null;typeof this.onDestroy==="function"&&this.onDestroy.bind(this)(),this.emit("component:destroy",this)}__meshwire__(J,Q){const W=this,{$node:q,meshPath:Y,fragmentPath:B,fragmentBoundaries:w,argv:X,scope:M,xmlns:D,declaration:j,useAttributes:$}=J;let x,A=[];const u=[],i=(d,k,y)=>{const R=`${B}.${Y||"r"}${y!==void 0?`[${y}]`:""}`,{$log:K,dependencies:G,events:O}=W.render(R,d,{...M,...k},void 0,D);if(u.push(R),G?.forEach((L,V)=>{if(!W.FGUD?.has(V))W.FGUD.set(V,new Map);L.forEach((S,r)=>{S.partial?.length?S.partial.push(R):S.partial=[R],W.FGUD.get(V)?.set(r,S)})}),W.metrics.inc("partialCount"),y!==void 0){const L=W.__getBoundaries__(R);A[y]={argvalues:k,boundaries:L};let V=t.default(L.start);return V=V.add(K),V=V.add(L.end),V}return K},e=(d,k,y)=>{if(W.metrics.startRender(),d.forEach((R)=>{const K=W.FGUD.get(R);if(!K)return;K.forEach((G)=>{const O=u.find((L)=>G.partial?.find((V)=>L==V));if(!G.partial||!O)return;if(y!==void 0&&!O.endsWith(`r[${y}]`))return;if(w?.start&&!document.contains(w.start)){console.warn(`${Y} -- partial boundaries missing in the DOM`),K.delete(G.path);return}if(G.memo?.[R]&&k?.[R]&&E0(G.memo[R],k[R]))return;if(G.memo={...M,...G.memo,...k},G.batch)W.UQS.queue({dep:R,dependent:G});else{const L=G.update(G.memo,"mesh-partial-updator");if(L)typeof L.memo==="object"&&K.set(G.path,{...G,memo:L.memo}),typeof L.cleanup==="function"&&L.cleanup()}W.metrics.inc("dependencyUpdateCount")}),!K.size&&W.FGUD.delete(R)}),y!==void 0&&A[y])A[y].argvalues=k;W.metrics.inc("partialUpdateCount"),W.metrics.endRender()},l=(d)=>{if(!A[d])return;const k=A[d].boundaries;if(delete A[d],!document.contains(k.start)||!document.contains(k.end)){console.warn(`Partial mesh item<${d}> boundaries missing`);return}const y=[];let R=k.start.nextSibling;while(R&&R!==k.end)y.push(R),R=R.nextSibling;t.default(y).remove(),k.start.remove(),k.end.remove()},c={renderer:{path:Y,argv:X,mesh(d,k=!1){if(x=q.contents(),!x?.length)return null;if(j?.iterator){const y=d?.["#"].value;if(!Array.isArray(d?.["#"].value))throw new Error("Invalid iterator argvalues");if(!y.length)return null;let R=t.default();return y.forEach((K,G)=>{if(!x?.length)return null;R=R.add(i(x,K,G))}),R}else return i(x,d)},update(d,k,y){if(!u.length)return;if(y=y||w,j?.iterator){const R=k?.["#"].value;if(!Array.isArray(R))return;if(Array.isArray(A)){if(A.length===R.length){for(let G=0;G<R.length;G++)!E0(A[G].argvalues,R[G])&&e(Object.keys(R[G]),R[G],G);return}const K=Math.min(A.length,R.length);for(let G=0;G<K;G++)e(Object.keys(R[G]),R[G],G);if(R.length>A.length){if(!x?.length)return;for(let G=A.length;G<R.length;G++){const O=i(x,R[G],G);t.default(y.end).before(O)}}else if(R.length<A.length)for(let G=R.length;G<A.length;G++)l(G)}}else e(d,k)}}};if($&&Y){const{attrs:d}=W.__getAttributes__(q);d.literals&&Object.entries(d.literals).forEach(([k,y])=>c[k]=y),d.expressions&&Object.entries(d.expressions).forEach(([k,y])=>{if(a.test(k)){const R=W.__evaluate__(k.replace(a,""),M);if(typeof R!=="object")throw new Error(`Invalid spread operator ${k}`);for(let K in R)c[K]=R[K];Q[`${j?.syntax?F0:""}${Y}.${k}`]=y}else c[k]=y?W.__evaluate__(y,M):!0,Q[`${j?.syntax?F0:""}${Y}.${k}`]=y})}return c}__getBoundaries__(J){return this.metrics.inc("domOperations"),this.metrics.inc("domInsertsCount"),{start:document.createComment(`s:${this.prepath}.${J}`),end:document.createComment(`e:${this.prepath}.${J}`)}}__getAttributes__(J){const Q=J.attrs(),W={},q={literals:{},functions:{},expressions:{}};let Y=[];return Q&&Object.entries(Q).forEach(([B,w])=>{if(B==":dtag")return;if(B.startsWith(":")||B.startsWith(M0)||B.startsWith(A0)||a.test(B)||J1.test(B))if(J1.test(B)){const[X,M]=B.match(J1)||[];Y=M.split(",")}else if(B.startsWith(A0))W[B.replace(A0,"")]=w;else if(B.startsWith(M0))q.functions[B.replace(M0,"")]=w;else{if(B.startsWith(":"))B=B.slice(1,B.length);q.expressions[B]=w||""}else q.literals[B]=w}),{argv:Y,events:W,attrs:q}}__withPath__(J,Q){const W=this.__path;this.__path=J;const q=Q();return this.__path=W,q}__getPathParent__(J){const Q=J.split("/");return Q.pop(),Q.join("/")}__hasSamePathParent__(J,Q){return J.startsWith(Q)}__evaluate__(J,Q){try{J=J.trim();const W=(q)=>{const Y=this.state.toJSON();if(Q){const B={};for(let M in Q)B[M]=Q[M].value;const w=`with( scope ){ return ${q}; }`;return new Function("self","input","state","static","context","scope",w)(this,this.input,Y,this.static,this.context,B||{})}else{const B=`return ${q}`;return new Function("self","input","state","static","context",B)(this,this.input,Y,this.static,this.context)}};if(/{\s*([^{}]+)\s*}/.test(J))return J.replace(/{\s*([^{}]+)\s*}/g,(q,Y)=>W(Y));return W(J)}catch(W){return J}}__evaluateFunction__(J,Q,W){if(/(\s*\w+|\s*\([^)]*\)|\s*)\s*=>\s*(\s*\{[^}]*\}|\s*[^\n;"]+)/g.test(J))return this.__evaluate__(J,W)(...Q);else{let[q,...Y]=J.split(/\s*,\s*/),B;if(q=this.__evaluate__(q,W),typeof q==="function")B=q;else{if(typeof this[q]!=="function")throw new Error(`Undefined <${q}> handler method`);B=this[q].bind(this)}if(typeof B!=="function")throw new Error(`Expected <${q}> to be a function or handler method`);let w=Y.map((X)=>this.__evaluate__(X,W));if(Q.length)w=[...w,...Q];return B(...w)}}__interpolate__(J,Q,W){return J.replace(/{\s*([^{}]+)\s*}/g,(q,Y)=>this.__evaluate__(Y,W))}__attachEvent__(J,Q,W,q){J.on(Q,(...Y)=>this.__evaluateFunction__(W,Y,q)),this.VER.push({element:J,_event:Q}),this.metrics.inc("domUpdatesCount"),this.metrics.inc("domRemovalsCount")}__detachEvent__(J,Q){J.off(Q),this.metrics.inc("domOperations"),this.metrics.inc("domRemovalsCount")}__extractTextDeps__(J,Q){const W=new Set;return(J.match(/{\s*([^{}]+)\s*}/g)||[]).forEach((Y)=>{const B=Y.replace(/[{}]/g,"").trim();this.__extractExpressionDeps__(B,Q).forEach((X)=>W.add(X))}),Array.from(W)}__extractExpressionDeps__(J,Q){const W=/\b(state|input|context)(?:\.[a-zA-Z_]\w*)+(?=\[|\.|$|\s|;|,|\))/g,q=/\b(self)(?:\.[a-zA-Z_]\w*)+(?=\()/g;let Y=[...Array.from(J.matchAll(W)),...Array.from(J.matchAll(q))];if(Q&&Object.keys(Q).length){const B=new RegExp(`\\b(${Object.keys(Q).join("|")})`,"g");Y=[...Y,...Array.from(J.matchAll(B))]}return[...new Set(Y.map((B)=>B[0]))]}__isReactive__(J,Q){if(/(state|input|context|self)\.[\w.]+/.test(J))return!0;if(Q&&Object.keys(Q).length&&new RegExp(Object.keys(Q).join("|")).test(J))return!0;return!1}__trackDep__(J,Q,W){if(W.memo&&W.memo[Q]&&W.memo[Q].type==="let")W.haslet=!0;!J.has(Q)&&J.set(Q,new Map),J.get(Q)?.set(W.path,W),this.metrics.inc("dependencyTrackCount")}__trackTranslationDep__(J,Q,W){if(W.memo&&W.memo[Q]&&W.memo[Q].type==="let")W.haslet=!0;!J.has(Q)&&J.set(Q,new Map),J.get(Q)?.set(W.path,W),this.metrics.inc("dependencyTrackCount")}__valueDep__(J,Q){return Q.reduce((W,q)=>W?.[q],J)}__shouldUpdate__(J,Q,W,q){if(J==="self")return!0;const Y=this.__valueDep__(q[J],Q),B=this.__valueDep__(W[J],Q);return!E0(Y,B)}__updateDepNodes__(J,Q){if(!this.FGUD?.size)return;this.metrics.inc("componentUpdateCount"),this.metrics.startRender(),this.FGUD.forEach((W,q)=>{const[Y,...B]=q.split(".");if(!this.__shouldUpdate__(Y,B,J,Q))return;W.forEach((w)=>{const{path:X,batch:M,$fragment:D,boundaries:j,update:$,memo:x,syntax:A}=w;try{if(!A&&(j?.start&&!document.contains(j.start))||D!==null&&!D.closest("body").length){W.delete(X);return}if(M)this.UQS.queue({dep:q,dependent:w});else{const u=$(x,"main-updator");if(u)typeof u.memo==="object"&&W.set(X,{...w,memo:u.memo}),typeof u.cleanup==="function"&&u.cleanup()}this.metrics.inc("dependencyUpdateCount")}catch(u){console.error("failed to update dependency nodes --",u);return}}),!W.size&&this.FGUD?.delete(q)}),this.metrics.endRender()}__updateVarDepNodes__(J,Q,W){if(!this.FGUD?.size)return;this.metrics.inc("partialUpdateCount"),this.metrics.startRender(),this.FGUD.get(J)?.forEach((Y,B)=>{if(!Y.haslet||!this.__hasSamePathParent__(B,this.__getPathParent__(Q)))return;if(Y.memo={...Y.memo,...W},Y.batch)this.UQS.queue({dep:J,dependent:Y});else{const w=Y.update(Y.memo,"var-partial-updator");typeof w?.cleanup==="function"&&w.cleanup()}}),this.metrics.endRender()}appendTo(J){return(typeof J=="string"?t.default(J):J).append(this.node),this.metrics.inc("domOperations"),this}prependTo(J){return typeof J=="string"?t.default(J):J.prepend(this.node),this.metrics.inc("domOperations"),this}replaceWith(J){return(typeof J=="string"?t.default(J):J).replaceWith(this.node),this.metrics.inc("domOperations"),this}}var b1={};u0(b1,{state:()=>{{return UJ}},handler:()=>{{return OJ}},default:()=>{{return MJ}},declaration:()=>{{return KJ}}});var KJ={name:"if",syntax:!0,tags:{"else-if":{type:"nexted",many:!0,optional:!0},else:{type:"nexted",optional:!0}}},UJ={renderer:null},OJ={onInput(){if(!this.input.renderer)return;if(this.input.by)this.state.renderer=this.input.renderer;else{let J=!1;if(Array.isArray(this.input["else-if"])&&this.input["else-if"].length)this.input["else-if"].forEach((Q)=>{if(J||!Q.by)return;this.state.renderer=Q.renderer,J=!0});if(!J)this.state.renderer=this.input.else?this.input.else.renderer:null}}},MJ="<{state.renderer}/>";var x1={};u0(x1,{state:()=>{{return jJ}},handler:()=>{{return FJ}},default:()=>{{return LJ}},declaration:()=>{{return DJ}},_static:()=>{{return IJ}}});var DJ={name:"for",syntax:!0,iterator:!0},jJ={argvlist:null},IJ={lastInput:null,processingBatch:!1},FJ={onInput(){if(this.static.processingBatch)return;if(!this.input.renderer)throw new Error("Undefined mesh renderer");let{in:J,from:Q,to:W}=this.input;if(J===void 0&&Q===void 0)throw new Error("Invalid <for> arguments");this.static.processingBatch=!0;try{if(Q!==void 0){if(Q=parseFloat(String(Q)),W==null)throw new Error("Expected <from> <to> attributes of the for loop to be defined");if(W=parseFloat(String(W)),Q===W)throw new Error("<from> and <to> attribute cannot have the same value");const q=Q<W,Y=Math.abs(W-Q)+1;if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===Y){const[w]=this.input.renderer.argv;if(w){let X=Q,M=!0;for(let D=0;D<this.state.argvlist.length;D++){if(this.state.argvlist[D][w].value!==X){M=!1;break}X=q?X+1:X-1}if(M)return;X=Q;for(let D=0;D<this.state.argvlist.length;D++)this.state.argvlist[D][w].value=X,X=q?X+1:X-1;return}}const B=[];for(let w=Q;q?w<=W:w>=W;q?w++:w--){const X={},[M]=this.input.renderer.argv;if(M)X[M]={value:w,type:"arg"};B.push(X)}this.state.argvlist=B}else if(Array.isArray(J)){if(this.state.argvlist&&this.static.lastInput&&this.input.in===this.static.lastInput)return;if(!J.length){console.warn("empty for loop <in> attribute Array value"),this.state.argvlist=[];return}if(this.static.lastInput=J,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===J.length){const[B,w]=this.input.renderer.argv;for(let X=0;X<J.length;X++){const M=this.state.argvlist[X];if(B)M[B].value=J[X]}return}const q=[];let Y=0;for(let B of J){const w={},[X,M]=this.input.renderer.argv;if(X)w[X]={value:B,type:"arg"};if(M)w[M]={value:Y,type:"arg"};q.push(w),Y++}this.state.argvlist=q}else if(J instanceof Map){if(this.state.argvlist&&this.static.lastInput&&this.input.in===this.static.lastInput)return;if(!J.size){console.warn("empty for loop <in> attribute Map value"),this.state.argvlist=[];return}if(this.static.lastInput=J,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===J.size){const[B,w,X]=this.input.renderer.argv;let M=0;for(let[D,j]of J){const $=this.state.argvlist[M];if(B)$[B].value=D;if(w)$[w].value=j;M++}return}const q=[];let Y=0;for(let[B,w]of J){const X={},[M,D,j]=this.input.renderer.argv;if(M)X[M]={value:B,type:"arg"};if(D)X[D]={value:w,type:"arg"};if(j)X[j]={value:Y,type:"arg"};q.push(X),Y++}this.state.argvlist=q}else if(typeof J=="object"){if(this.state.argvlist&&this.static.lastInput&&this.input.in===this.static.lastInput)return;if(!Object.keys(J).length){console.warn("empty for loop <in> attribute Object value"),this.state.argvlist=[];return}this.static.lastInput=J;const q=Object.keys(J);if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===q.length){const[w,X,M]=this.input.renderer.argv;for(let D=0;D<q.length;D++){const j=q[D],$=this.state.argvlist[D];if(w)$[w].value=j;if(X)$[X].value=J[j]}return}const Y=[];let B=0;for(let w in J){const X={},[M,D,j]=this.input.renderer.argv;if(M)X[M]={value:w,type:"arg"};if(D)X[D]={value:J[w],type:"arg"};if(j)X[j]={value:B,type:"arg"};Y.push(X),B++}this.state.argvlist=Y}}finally{this.static.processingBatch=!1}},updateItems(J){if(!this.input.renderer)throw new Error("Undefined mesh renderer");if(!Array.isArray(J)||!this.state.argvlist)return;this.static.processingBatch=!0;try{const[Q]=this.input.renderer?.argv;if(!Q)return;for(let{index:W,value:q}of J)if(W>=0&&W<this.state.argvlist.length)this.state.argvlist[W][Q].value=q}finally{this.static.processingBatch=!1}},updateProperty(J,Q){if(!this.input.renderer)throw new Error("Undefined mesh renderer");if(!this.state.argvlist)return;this.static.processingBatch=!0;try{for(let W=0;W<this.state.argvlist.length;W++){const q=this.state.argvlist[W];if(q[J])q[J].value=typeof Q==="function"?Q(q[J].value,W):Q}}finally{this.static.processingBatch=!1}}},LJ="<{input.renderer} #=state.argvlist/>";var h1={};u0(h1,{state:()=>{{return NJ}},handler:()=>{{return CJ}},default:()=>{{return PJ}},declaration:()=>{{return VJ}}});var VJ={name:"async",syntax:!0,tags:{then:{type:"child"},catch:{type:"child",optional:!0},loading:{type:"child",optional:!0}}},NJ={renderer:null,props:{}},CJ={onInput(){if(!this.input.await)throw new Error("Undefined async <await> attribute");if(!(this.input.await instanceof Promise))throw new Error("Expected async <await> attribute value to be a function");if(this.input.loading)this.state.renderer=this.input.loading.renderer,this.state.props={};this.input.await.then((J)=>{if(!this.input.then)return;this.state.renderer=this.input.then.renderer;const[Q]=this.input.then.renderer.argv;this.state.props={[Q]:{value:J,type:"arg"}}}).catch((J)=>{if(!this.input.catch)return;this.state.renderer=this.input.catch.renderer;const[Q]=this.input.then.renderer.argv;this.state.props={[Q]:{value:J,type:"arg"}}})}},PJ="<{state.renderer} #=state.props/>";var f1={};u0(f1,{state:()=>{{return EJ}},handler:()=>{{return $J}},default:()=>{{return TJ}},declaration:()=>{{return SJ}}});var SJ={name:"switch",syntax:!0,tags:{case:{type:"child",many:!0},default:{type:"child"}}},EJ={renderer:null},$J={onInput(){let J=[];for(let Q of this.input.case)if(Q.is==this.input.by||Array.isArray(Q.is)&&Q.is.includes(this.input.by))Array.isArray(Q.is)?J=[...new Set([...J,...Q.is])]:J.push(Q.is),this.state.renderer=Q.renderer;if(!J.includes(this.input.by))this.state.renderer=this.input.default?this.input.default.renderer:null}},TJ="<{state.renderer}/>";var g1={};u0(g1,{state:()=>{{return RJ}},handler:()=>{{return xJ}},default:()=>{{return hJ}},context:()=>{{return _J}},_static:()=>{{return AJ}}});var bJ=function(J){const Q={};return J.split("&").map((q)=>{const[Y,B]=q.split("=");Q[Y]=B}),Q},RJ={page:null,params:{},query:{}},AJ={global:!1,routes:[],defaultPath:null,currentPath:null,currentRoute:null},_J=["navigate"],xJ={onInput(){if(!this.input.routes)return;if(this.input.global)this.static.global=this.input.global;if(this.static.routes=this.input.routes.map(({path:J,template:Q,default:W})=>{if(W)this.static.defaultPath=J;const q=J.match(/:[^\/]*(\/|$)/gi)||[],Y=J.replaceAll("/","\\/").replaceAll(/:[^\/]*(\/|$)/gi,"([^\\/]+)(?:\\/|$)");return{path:J,template:Q,default:W,pathVars:q,pathRegex:new RegExp(`${Y}\$`,"i")}}),this.input.global){const J=window.location.pathname;this.static.defaultPath=this.static.defaultPath&&J=="/"&&J!==this.static.defaultPath?this.static.defaultPath:J?J+window.location.search:this.static.routes[0].path}},onAttach(){if(this.input.global)window.navigate=this.navigate.bind(this),window.addEventListener("popstate",(J)=>J.state&&this.navigate(J.state.path,!0));this.setContext("navigate",this.navigate.bind(this)),this.static.defaultPath&&this.navigate(this.static.defaultPath)},navigate(J,Q){!Q&&this.static.global&&history.pushState({path:J},"",J);const W=J.split("?");J=W[0];const q=W[1]?bJ(W[1]):{};let Y=null;if(this.static.currentRoute)Y={path:this.static.currentRoute.path,params:this.state.params},this.emit("before",{fromState:Y,toState:{path:J,query:q}});const B=this.match(J);if(!B){this.static.currentRoute=null,this.state.params={},this.state.query={},this.emit("not-found",J);return}const{route:w,params:X}=B;this.emit("after",{fromState:Y,toState:{path:w.path,params:X,query:q}}),this.static.currentPath=J,this.static.currentRoute=w,this.state.params=X,this.state.query=q,this.state.page=w.template},match(J){const Q={};let W=!1;for(let q of this.static.routes){const{pathVars:Y,pathRegex:B}=q,w=J.match(B);if(w!==null&&w.index===0){for(let X=0;X+1<w.length&&X<Y.length;X++)Q[Y[X].replaceAll(/[\/:]/g,"")]=w[X+1];W=q;break}}return W?{route:W,params:Q}:!1}},hJ="<{state.page} params=state.params query=state.query/>";class S5{debug=!1;stylesheets=[];config={};store={};__root;i18n=new s0;watcher;IUC;__setContext;__getContext;constructor(J){if(this.config=J,this.config?.debug)this.debug=this.config.debug;this.watcher=new n0,this.IUC=new r0;const[Q,W]=v0(J?.context||{});this.__setContext=W,this.__getContext=Q,this.register("if",b1),this.register("for",x1),this.register("async",h1),this.register("switch",f1),this.register("router",g1)}register(J,Q){return this.store[J]=Q,this}unregister(J){return delete this.store[J],this}has(J){return J in this.store}import(J){if(!this.has(J))throw new Error(`<${J}> component not found`);if(!this.store[J].declaration?.syntax&&!this.store[J].default)throw new Error(`Invalid <${J}> component`);return this.store[J]}render(J,Q,W){const{default:q,...Y}=Q,B={debug:this.debug,prepath:"0",lips:this},w=new c0(J,q||"",{...Y,input:W},B);return window.addEventListener("beforeunload",()=>{return this.dispose(),w.destroy(),null}),window.addEventListener("pagehide",(X)=>{!X.persisted&&this.dispose()}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState!=="hidden")return;this.IUC.prepareForPotentialUnload()}),w}root(J,Q){if(this.__root=this.render("__ROOT__",J),this.__root.appendTo(Q),this.config?.stylesheets)this.stylesheets=this.config.stylesheets.map((W)=>new y0("root",{sheet:W,meta:!0}));return this.__root}language(J){this.i18n.setLang(J)&&this.__root?.rerender()}setContext(J,Q){const W=this.__getContext();if(typeof J==="string"){const q={...W,[J]:Q};H0(W,q)&&this.__setContext(q)}else if(!Array.isArray(J)){const q={...W,...J};H0(W,q)&&this.__setContext(q)}else throw new Error("Invalid context data")}getContext(){return this.__getContext()}useContext(J,Q){if(!J.length)return;O1(()=>{const W=this.__getContext();if(!W)return;const q=Object.fromEntries(J.map((Y)=>[Y,W[Y]]));q&&typeof Q==="function"&&Object.keys(q).length&&Q(q)})}dispose(){this.watcher?.dispose(),this.__root?.destroy(),this.stylesheets.forEach((J)=>J.clear())}}export{S5 as default};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=FB8480AEEA49549764756e2164756e21
|