@lipsjs/lips 0.0.10 → 0.0.11
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/dist/lips.min.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var W8=Object.create;var{defineProperty:S0,getPrototypeOf:X8,getOwnPropertyNames:H8}=Object;var z8=Object.prototype.hasOwnProperty;var P0=(J,Q,W)=>{W=J!=null?W8(X8(J)):{};const z=Q||!J||!J.__esModule?S0(W,"default",{value:J,enumerable:!0}):W;for(let q of H8(J))if(!z8.call(z,q))S0(z,q,{get:()=>J[q],enumerable:!0});return z};var q8=(J,Q)=>()=>(Q||J((Q={exports:{}}).exports,Q),Q.exports);var k1=(J,Q)=>{for(var W in Q)S0(J,W,{get:Q[W],enumerable:!0,configurable:!0,set:(z)=>Q[W]=()=>z})};var t1=q8((J5,Z5)=>{(function(){var J=document,Q=window,W=J.documentElement,z=J.createElement.bind(J),q=z("div"),Y=z("table"),G=z("tbody"),X=z("tr"),D=Array.isArray,M=Array.prototype,F=M.concat,T=M.filter,h=M.indexOf,x=M.map,u=M.push,o=M.slice,a=M.some,r=M.splice,s=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,i=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,y=/<.+>/,v=/^\w+$/;function _(Z,H){var B=l(H);return!Z||!B&&!S(H)&&!$(H)?[]:!B&&i.test(Z)?H.getElementsByClassName(Z.slice(1).replace(/\\/g,"")):!B&&v.test(Z)?H.getElementsByTagName(Z):H.querySelectorAll(Z)}var U=function(){function Z(H,B){if(!H)return;if(C(H))return H;var O=H;if(P(H)){var L=B||J;if(O=s.test(H)&&S(L)?L.getElementById(H.slice(1).replace(/\\/g,"")):y.test(H)?u0(H):C(L)?L.find(H):P(L)?K(L).find(H):_(H,L),!O)return}else if(V(H))return this.ready(H);if(O.nodeType||O===Q)O=[O];this.length=O.length;for(var E=0,k=this.length;E<k;E++)this[E]=O[E]}return Z.prototype.init=function(H,B){return new Z(H,B)},Z}(),w=U.prototype,K=w.init;if(K.fn=K.prototype=w,w.length=0,w.splice=r,typeof Symbol==="function")w[Symbol.iterator]=M[Symbol.iterator];function C(Z){return Z instanceof U}function I(Z){return!!Z&&Z===Z.window}function S(Z){return!!Z&&Z.nodeType===9}function l(Z){return!!Z&&Z.nodeType===11}function $(Z){return!!Z&&Z.nodeType===1}function g(Z){return!!Z&&Z.nodeType===3}function f(Z){return typeof Z==="boolean"}function V(Z){return typeof Z==="function"}function P(Z){return typeof Z==="string"}function A(Z){return Z===void 0}function N(Z){return Z===null}function j(Z){return!isNaN(parseFloat(Z))&&isFinite(Z)}function R(Z){if(typeof Z!=="object"||Z===null)return!1;var H=Object.getPrototypeOf(Z);return H===null||H===Object.prototype}K.isWindow=I,K.isFunction=V,K.isArray=D,K.isNumeric=j,K.isPlainObject=R;function b(Z,H,B){if(B){var O=Z.length;while(O--)if(H.call(Z[O],O,Z[O])===!1)return Z}else if(R(Z)){var L=Object.keys(Z);for(var O=0,E=L.length;O<E;O++){var k=L[O];if(H.call(Z[k],k,Z[k])===!1)return Z}}else for(var O=0,E=Z.length;O<E;O++)if(H.call(Z[O],O,Z[O])===!1)return Z;return Z}K.each=b,w.each=function(Z){return b(this,Z)},w.empty=function(){return this.each(function(Z,H){while(H.firstChild)H.removeChild(H.firstChild)})};function c(){var Z=[];for(var H=0;H<arguments.length;H++)Z[H]=arguments[H];var B=f(Z[0])?Z.shift():!1,O=Z.shift(),L=Z.length;if(!O)return{};if(!L)return c(B,K,O);for(var E=0;E<L;E++){var k=Z[E];for(var d in k)if(B&&(D(k[d])||R(k[d]))){if(!O[d]||O[d].constructor!==k[d].constructor)O[d]=new k[d].constructor;c(B,O[d],k[d])}else O[d]=k[d]}return O}K.extend=c,w.extend=function(Z){return c(w,Z)};var p=/\S+/g;function m(Z){return P(Z)?Z.match(p)||[]:[]}w.toggleClass=function(Z,H){var B=m(Z),O=!A(H);return this.each(function(L,E){if(!$(E))return;b(B,function(k,d){if(O)H?E.classList.add(d):E.classList.remove(d);else E.classList.toggle(d)})})},w.addClass=function(Z){return this.toggleClass(Z,!0)},w.removeAttr=function(Z){var H=m(Z);return this.each(function(B,O){if(!$(O))return;b(H,function(L,E){O.removeAttribute(E)})})};function Z1(Z,H){if(!Z)return;if(P(Z)){if(arguments.length<2){if(!this[0]||!$(this[0]))return;var B=this[0].getAttribute(Z);return N(B)?void 0:B}if(A(H))return this;if(N(H))return this.removeAttr(Z);return this.each(function(L,E){if(!$(E))return;E.setAttribute(Z,H)})}for(var O in Z)this.attr(O,Z[O]);return this}w.attr=Z1,w.removeClass=function(Z){if(arguments.length)return this.toggleClass(Z,!1);return this.attr("class","")},w.hasClass=function(Z){return!!Z&&a.call(this,function(H){return $(H)&&H.classList.contains(Z)})},w.get=function(Z){if(A(Z))return o.call(this);return Z=Number(Z),this[Z<0?Z+this.length:Z]},w.eq=function(Z){return K(this.get(Z))},w.first=function(){return this.eq(0)},w.last=function(){return this.eq(-1)};function D1(Z){if(A(Z))return this.get().map(function(H){return $(H)||g(H)?H.textContent:""}).join("");return this.each(function(H,B){if(!$(B))return;B.textContent=Z})}w.text=D1;function Q1(Z,H,B){if(!$(Z))return;var O=Q.getComputedStyle(Z,null);return B?O.getPropertyValue(H)||void 0:O[H]||Z.style[H]}function O1(Z,H){return parseInt(Q1(Z,H),10)||0}function k0(Z,H){return O1(Z,"border".concat(H?"Left":"Top","Width"))+O1(Z,"padding".concat(H?"Left":"Top"))+O1(Z,"padding".concat(H?"Right":"Bottom"))+O1(Z,"border".concat(H?"Right":"Bottom","Width"))}var K0={};function T5(Z){if(K0[Z])return K0[Z];var H=z(Z);J.body.insertBefore(H,null);var B=Q1(H,"display");return J.body.removeChild(H),K0[Z]=B!=="none"?B:"block"}function f0(Z){return Q1(Z,"display")==="none"}function y0(Z,H){var B=Z&&(Z.matches||Z.webkitMatchesSelector||Z.msMatchesSelector);return!!B&&!!H&&B.call(Z,H)}function m1(Z){return P(Z)?function(H,B){return y0(B,Z)}:V(Z)?Z:C(Z)?function(H,B){return Z.is(B)}:!Z?function(){return!1}:function(H,B){return B===Z}}w.filter=function(Z){var H=m1(Z);return K(T.call(this,function(B,O){return H.call(B,O,B)}))};function C1(Z,H){return!H?Z:Z.filter(H)}w.detach=function(Z){return C1(this,Z).each(function(H,B){if(B.parentNode)B.parentNode.removeChild(B)}),this};var A5=/^\s*<(\w+)[^>]*>/,_5=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,v0={"*":q,tr:G,td:X,th:X,thead:Y,tbody:Y,tfoot:Y};function u0(Z){if(!P(Z))return[];if(_5.test(Z))return[z(RegExp.$1)];var H=A5.test(Z)&&RegExp.$1,B=v0[H]||v0["*"];return B.innerHTML=Z,K(B.childNodes).detach().get()}K.parseHTML=u0,w.has=function(Z){var H=P(Z)?function(B,O){return _(Z,O).length}:function(B,O){return O.contains(Z)};return this.filter(H)},w.not=function(Z){var H=m1(Z);return this.filter(function(B,O){return(!P(Z)||$(O))&&!H.call(O,B,O)})};function j1(Z,H,B,O){var L=[],E=V(H),k=O&&m1(O);for(var d=0,w1=Z.length;d<w1;d++)if(E){var W1=H(Z[d]);if(W1.length)u.apply(L,W1)}else{var q1=Z[d][H];while(q1!=null){if(O&&k(-1,q1))break;L.push(q1),q1=B?q1[H]:null}}return L}function m0(Z){if(Z.multiple&&Z.options)return j1(T.call(Z.options,function(H){return H.selected&&!H.disabled&&!H.parentNode.disabled}),"value");return Z.value||""}function b5(Z){if(!arguments.length)return this[0]&&m0(this[0]);return this.each(function(H,B){var O=B.multiple&&B.options;if(O||a0.test(B.type)){var L=D(Z)?x.call(Z,String):N(Z)?[]:[String(Z)];if(O)b(B.options,function(E,k){k.selected=L.indexOf(k.value)>=0},!0);else B.checked=L.indexOf(B.value)>=0}else B.value=A(Z)||N(Z)?"":Z})}w.val=b5,w.is=function(Z){var H=m1(Z);return a.call(this,function(B,O){return H.call(B,O,B)})},K.guid=1;function M1(Z){return Z.length>1?T.call(Z,function(H,B,O){return h.call(O,H)===B}):Z}K.unique=M1,w.add=function(Z,H){return K(M1(this.get().concat(K(Z,H).get())))},w.children=function(Z){return C1(K(M1(j1(this,function(H){return H.children}))),Z)},w.parent=function(Z){return C1(K(M1(j1(this,"parentNode"))),Z)},w.index=function(Z){var H=Z?K(Z)[0]:this[0],B=Z?this:K(H).parent().children();return h.call(B,H)},w.closest=function(Z){var H=this.filter(Z);if(H.length)return H;var B=this.parent();if(!B.length)return H;return B.closest(Z)},w.siblings=function(Z){return C1(K(M1(j1(this,function(H){return K(H).parent().children().not(H)}))),Z)},w.find=function(Z){return K(M1(j1(this,function(H){return _(Z,H)})))};var x5=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,g5=/^$|^module$|\/(java|ecma)script/i,h5=["type","src","nonce","noModule"];function k5(Z,H){var B=K(Z);B.filter("script").add(B.find("script")).each(function(O,L){if(g5.test(L.type)&&W.contains(L)){var E=z("script");E.text=L.textContent.replace(x5,""),b(h5,function(k,d){if(L[d])E[d]=L[d]}),H.head.insertBefore(E,null),H.head.removeChild(E)}})}function f5(Z,H,B,O,L){if(O)Z.insertBefore(H,B?Z.firstChild:null);else if(Z.nodeName==="HTML")Z.parentNode.replaceChild(H,Z);else Z.parentNode.insertBefore(H,B?Z:Z.nextSibling);if(L)k5(H,Z.ownerDocument)}function N1(Z,H,B,O,L,E,k,d){return b(Z,function(w1,W1){b(K(W1),function(q1,E1){b(K(H),function(K1,i1){var L0=B?E1:i1,V0=B?i1:E1,Y1=B?q1:K1;f5(L0,!Y1?V0:V0.cloneNode(!0),O,L,!Y1)},d)},k)},E),H}w.after=function(){return N1(arguments,this,!1,!1,!1,!0,!0)},w.append=function(){return N1(arguments,this,!1,!1,!0)};function y5(Z){if(!arguments.length)return this[0]&&this[0].innerHTML;if(A(Z))return this;var H=/<script[\s>]/.test(Z);return this.each(function(B,O){if(!$(O))return;if(H)K(O).empty().append(Z);else O.innerHTML=Z})}w.html=y5,w.appendTo=function(Z){return N1(arguments,this,!0,!1,!0)},w.wrapInner=function(Z){return this.each(function(H,B){var O=K(B),L=O.contents();L.length?L.wrapAll(Z):O.append(Z)})},w.before=function(){return N1(arguments,this,!1,!0)},w.wrapAll=function(Z){var H=K(Z),B=H[0];while(B.children.length)B=B.firstElementChild;return this.first().before(H),this.appendTo(B)},w.wrap=function(Z){return this.each(function(H,B){var O=K(Z)[0];K(B).wrapAll(!H?O:O.cloneNode(!0))})},w.insertAfter=function(Z){return N1(arguments,this,!0,!1,!1,!1,!1,!0)},w.insertBefore=function(Z){return N1(arguments,this,!0,!0)},w.prepend=function(){return N1(arguments,this,!1,!0,!0,!0,!0)},w.prependTo=function(Z){return N1(arguments,this,!0,!0,!0,!1,!1,!0)},w.contents=function(){return K(M1(j1(this,function(Z){return Z.tagName==="IFRAME"?[Z.contentDocument]:Z.tagName==="TEMPLATE"?Z.content.childNodes:Z.childNodes})))},w.next=function(Z,H,B){return C1(K(M1(j1(this,"nextElementSibling",H,B))),Z)},w.nextAll=function(Z){return this.next(Z,!0)},w.nextUntil=function(Z,H){return this.next(H,!0,Z)},w.parents=function(Z,H){return C1(K(M1(j1(this,"parentElement",!0,H))),Z)},w.parentsUntil=function(Z,H){return this.parents(H,Z)},w.prev=function(Z,H,B){return C1(K(M1(j1(this,"previousElementSibling",H,B))),Z)},w.prevAll=function(Z){return this.prev(Z,!0)},w.prevUntil=function(Z,H){return this.prev(H,!0,Z)},w.map=function(Z){return K(F.apply([],x.call(this,function(H,B){return Z.call(H,B,H)})))},w.clone=function(){return this.map(function(Z,H){return H.cloneNode(!0)})},w.offsetParent=function(){return this.map(function(Z,H){var B=H.offsetParent;while(B&&Q1(B,"position")==="static")B=B.offsetParent;return B||W})},w.slice=function(Z,H){return K(o.call(this,Z,H))};var v5=/-([a-z])/g;function U0(Z){return Z.replace(v5,function(H,B){return B.toUpperCase()})}w.ready=function(Z){var H=function(){return setTimeout(Z,0,K)};if(J.readyState!=="loading")H();else J.addEventListener("DOMContentLoaded",H);return this},w.unwrap=function(){return this.parent().each(function(Z,H){if(H.tagName==="BODY")return;var B=K(H);B.replaceWith(B.children())}),this},w.offset=function(){var Z=this[0];if(!Z)return;var H=Z.getBoundingClientRect();return{top:H.top+Q.pageYOffset,left:H.left+Q.pageXOffset}},w.position=function(){var Z=this[0];if(!Z)return;var H=Q1(Z,"position")==="fixed",B=H?Z.getBoundingClientRect():this.offset();if(!H){var O=Z.ownerDocument,L=Z.offsetParent||O.documentElement;while((L===O.body||L===O.documentElement)&&Q1(L,"position")==="static")L=L.parentNode;if(L!==Z&&$(L)){var E=K(L).offset();B.top-=E.top+O1(L,"borderTopWidth"),B.left-=E.left+O1(L,"borderLeftWidth")}}return{top:B.top-O1(Z,"marginTop"),left:B.left-O1(Z,"marginLeft")}};var d0={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};w.prop=function(Z,H){if(!Z)return;if(P(Z)){if(Z=d0[Z]||Z,arguments.length<2)return this[0]&&this[0][Z];return this.each(function(O,L){L[Z]=H})}for(var B in Z)this.prop(B,Z[B]);return this},w.removeProp=function(Z){return this.each(function(H,B){delete B[d0[Z]||Z]})};var u5=/^--/;function O0(Z){return u5.test(Z)}var M0={},m5=q.style,d5=["webkit","moz","ms"];function i5(Z,H){if(H===void 0)H=O0(Z);if(H)return Z;if(!M0[Z]){var B=U0(Z),O="".concat(B[0].toUpperCase()).concat(B.slice(1)),L="".concat(B," ").concat(d5.join("".concat(O," "))).concat(O).split(" ");b(L,function(E,k){if(k in m5)return M0[Z]=k,!1})}return M0[Z]}var c5={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 i0(Z,H,B){if(B===void 0)B=O0(Z);return!B&&!c5[Z]&&j(H)?"".concat(H,"px"):H}function p5(Z,H){if(P(Z)){var B=O0(Z);if(Z=i5(Z,B),arguments.length<2)return this[0]&&Q1(this[0],Z,B);if(!Z)return this;return H=i0(Z,H,B),this.each(function(L,E){if(!$(E))return;if(B)E.style.setProperty(Z,H);else E.style[Z]=H})}for(var O in Z)this.css(O,Z[O]);return this}w.css=p5;function c0(Z,H){try{return Z(H)}catch(B){return H}}var o5=/^\s+|\s+$/;function p0(Z,H){var B=Z.dataset[H]||Z.dataset[U0(H)];if(o5.test(B))return B;return c0(JSON.parse,B)}function s5(Z,H,B){B=c0(JSON.stringify,B),Z.dataset[U0(H)]=B}function l5(Z,H){if(!Z){if(!this[0])return;var B={};for(var O in this[0].dataset)B[O]=p0(this[0],O);return B}if(P(Z)){if(arguments.length<2)return this[0]&&p0(this[0],Z);if(A(H))return this;return this.each(function(L,E){s5(E,Z,H)})}for(var O in Z)this.data(O,Z[O]);return this}w.data=l5;function o0(Z,H){var B=Z.documentElement;return Math.max(Z.body["scroll".concat(H)],B["scroll".concat(H)],Z.body["offset".concat(H)],B["offset".concat(H)],B["client".concat(H)])}b([!0,!1],function(Z,H){b(["Width","Height"],function(B,O){var L="".concat(H?"outer":"inner").concat(O);w[L]=function(E){if(!this[0])return;if(I(this[0]))return H?this[0]["inner".concat(O)]:this[0].document.documentElement["client".concat(O)];if(S(this[0]))return o0(this[0],O);return this[0]["".concat(H?"offset":"client").concat(O)]+(E&&H?O1(this[0],"margin".concat(B?"Top":"Left"))+O1(this[0],"margin".concat(B?"Bottom":"Right")):0)}})}),b(["Width","Height"],function(Z,H){var B=H.toLowerCase();w[B]=function(O){if(!this[0])return A(O)?void 0:this;if(!arguments.length){if(I(this[0]))return this[0].document.documentElement["client".concat(H)];if(S(this[0]))return o0(this[0],H);return this[0].getBoundingClientRect()[B]-k0(this[0],!Z)}var L=parseInt(O,10);return this.each(function(E,k){if(!$(k))return;var d=Q1(k,"boxSizing");k.style[B]=i0(B,L+(d==="border-box"?k0(k,!Z):0))})}});var s0="___cd";w.toggle=function(Z){return this.each(function(H,B){if(!$(B))return;var O=f0(B),L=A(Z)?O:Z;if(L){if(B.style.display=B[s0]||"",f0(B))B.style.display=T5(B.tagName)}else if(!O)B[s0]=Q1(B,"display"),B.style.display="none"})},w.hide=function(){return this.toggle(!1)},w.show=function(){return this.toggle(!0)};var l0="___ce",D0=".",j0={focus:"focusin",blur:"focusout"},r0={mouseenter:"mouseover",mouseleave:"mouseout"},r5=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function F0(Z){return r0[Z]||j0[Z]||Z}function I0(Z){var H=Z.split(D0);return[H[0],H.slice(1).sort()]}w.trigger=function(Z,H){if(P(Z)){var B=I0(Z),O=B[0],L=B[1],E=F0(O);if(!E)return this;var k=r5.test(E)?"MouseEvents":"HTMLEvents";Z=J.createEvent(k),Z.initEvent(E,!0,!0),Z.namespace=L.join(D0),Z.___ot=O}Z.___td=H;var d=Z.___ot in j0;return this.each(function(w1,W1){if(d&&V(W1[Z.___ot]))W1["___i".concat(Z.type)]=!0,W1[Z.___ot](),W1["___i".concat(Z.type)]=!1;W1.dispatchEvent(Z)})};function n0(Z){return Z[l0]=Z[l0]||{}}function n5(Z,H,B,O,L){var E=n0(Z);E[H]=E[H]||[],E[H].push([B,O,L]),Z.addEventListener(H,L)}function t0(Z,H){return!H||!a.call(H,function(B){return Z.indexOf(B)<0})}function d1(Z,H,B,O,L){var E=n0(Z);if(!H)for(H in E)d1(Z,H,B,O,L);else if(E[H])E[H]=E[H].filter(function(k){var d=k[0],w1=k[1],W1=k[2];if(L&&W1.guid!==L.guid||!t0(d,B)||O&&O!==w1)return!0;Z.removeEventListener(H,W1)})}w.off=function(Z,H,B){var O=this;if(A(Z))this.each(function(E,k){if(!$(k)&&!S(k)&&!I(k))return;d1(k)});else if(!P(Z))for(var L in Z)this.off(L,Z[L]);else{if(V(H))B=H,H="";b(m(Z),function(E,k){var d=I0(k),w1=d[0],W1=d[1],q1=F0(w1);O.each(function(E1,K1){if(!$(K1)&&!S(K1)&&!I(K1))return;d1(K1,q1,W1,H,B)})})}return this},w.remove=function(Z){return C1(this,Z).detach().off(),this},w.replaceWith=function(Z){return this.before(Z).remove()},w.replaceAll=function(Z){return K(Z).replaceWith(this),this};function t5(Z,H,B,O,L){var E=this;if(!P(Z)){for(var k in Z)this.on(k,H,B,Z[k],L);return this}if(!P(H))if(A(H)||N(H))H="";else if(A(B))B=H,H="";else O=B,B=H,H="";if(!V(O))O=B,B=void 0;if(!O)return this;return b(m(Z),function(d,w1){var W1=I0(w1),q1=W1[0],E1=W1[1],K1=F0(q1),i1=q1 in r0,L0=q1 in j0;if(!K1)return;E.each(function(V0,Y1){if(!$(Y1)&&!S(Y1)&&!I(Y1))return;var C0=function(X1){if(X1.target["___i".concat(X1.type)])return X1.stopImmediatePropagation();if(X1.namespace&&!t0(E1,X1.namespace.split(D0)))return;if(!H&&(L0&&(X1.target!==Y1||X1.___ot===K1)||i1&&X1.relatedTarget&&Y1.contains(X1.relatedTarget)))return;var N0=Y1;if(H){var T1=X1.target;while(!y0(T1,H)){if(T1===Y1)return;if(T1=T1.parentNode,!T1)return}N0=T1}Object.defineProperty(X1,"currentTarget",{configurable:!0,get:function(){return N0}}),Object.defineProperty(X1,"delegateTarget",{configurable:!0,get:function(){return Y1}}),Object.defineProperty(X1,"data",{configurable:!0,get:function(){return B}});var Q8=O.call(N0,X1,X1.___td);if(L)d1(Y1,K1,E1,H,C0);if(Q8===!1)X1.preventDefault(),X1.stopPropagation()};C0.guid=O.guid=O.guid||K.guid++,n5(Y1,K1,E1,H,C0)})}),this}w.on=t5;function a5(Z,H,B,O){return this.on(Z,H,B,O,!0)}w.one=a5;var e5=/\r?\n/g;function J8(Z,H){return"&".concat(encodeURIComponent(Z),"=").concat(encodeURIComponent(H.replace(e5,"\r\n")))}var Z8=/file|reset|submit|button|image/i,a0=/radio|checkbox/i;if(w.serialize=function(){var Z="";return this.each(function(H,B){b(B.elements||[B],function(O,L){if(L.disabled||!L.name||L.tagName==="FIELDSET"||Z8.test(L.type)||a0.test(L.type)&&!L.checked)return;var E=m0(L);if(!A(E)){var k=D(E)?E:[E];b(k,function(d,w1){Z+=J8(L.name,w1)})}})}),Z.slice(1)},typeof J5!=="undefined")Z5.exports=K;else Q.cash=Q.$=K})()});var c1=function(J,Q){if(!Q)return J;return J.replace(/{(\w+)}/g,(W,z)=>{return Q[z]!==void 0?Q[z].toString():`{${z}}`})},e0=(J,Q,W,z,q)=>{switch(J){case"plural":{if(typeof W==="string"){console.warn("Plural format value cannot be a string");return}if(z.count===void 0){console.warn("Plural format requires <count> parameter or use * by default.");let X=W["*"];if(typeof X==="object")X=X[q||"*"];return c1(X,z)}if(typeof z.count==="string")z.count=Number(z.count);let Y="*";if(z.count.toString()in W)Y=z.count.toString();let G=W[Y]||W["*"];if(typeof G==="object")G=G[q||"*"];return c1(G,z)}case"condition":{if(typeof W==="string"){console.warn("Condition format value cannot be a string");return}let Y;for(let G in W)try{if(new Function("params",`with( params ){ return ${G}; }`)(z||{})){Y=W[G];break}}catch(X){console.warn(`Invalid <${Q}(${G})> condition expression`)}if(Y===void 0)return;if(typeof Y==="object")Y=Y[q||"*"];return c1(Y,z)}case"variable":default:{const Y=typeof W==="object"?W[q||"*"]:W;if(typeof Y==="object"){console.warn(`Invalid <${Q}> variable variant definition`);return}return c1(Y,z)}}};class p1{currentLang=window.navigator.language;DICTIONARIES={};set lang(J){if(this.currentLang===J)return;this.currentLang=J}get lang(){return this.currentLang}setDictionary(J,Q){this.DICTIONARIES[J]=Q}translate(J,Q){if(Q&&this.currentLang===Q)return{text:J,lang:this.currentLang};Q=Q||this.currentLang;const[W,z]=Q.split("-");if(this.DICTIONARIES[W]&&J in this.DICTIONARIES[W]){if(typeof this.DICTIONARIES[W][J]==="object"){const q=this.DICTIONARIES[W][J];J=q[z||"*"]||q["*"]}else if(typeof this.DICTIONARIES[W][J]==="string")J=this.DICTIONARIES[W][J]}return{text:J,lang:Q}}format(J,Q,W){W=W||this.currentLang;const[z,q]=W.split("-");if(!this.DICTIONARIES[z]){console.warn(`Undefined <${W}> format dictionary`);return}if(!this.DICTIONARIES[z][J]){console.warn(`Undefined <${W}[${J}]> format reference`);return}const Y=this.DICTIONARIES[z][J];if(typeof Y==="string"){console.warn(`Invalid <${W}[${J}]> format reference. Expected object`);return}if(typeof Y!=="object"||Y===null||Array.isArray(Y)){console.warn(`Invalid <${W}[${J}]> format value`);return}return e0(Y.type,J,Y.value,Q,q)}}class o1{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 s1{subscriptions=new Map;tick=new o1;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,z=new WeakMap,q=(G)=>{if(G instanceof Map)G.forEach((D,M)=>G.set(M,Y(D)));else if(Array.isArray(G))G.forEach((D,M)=>G[M]=Y(D));else if(typeof G==="object")Object.entries(G).forEach(([D,M])=>G[D]=Y(M));let X=new Proxy(G,{get(D,M){if(M==="toJSON")return function(){const T=(h)=>{if(!h||typeof h!=="object")return h;if(z.has(h)){const x=z.get(h);if(x instanceof Map){const o={};return x.forEach((a,r)=>o[typeof r==="object"?JSON.stringify(r):String(r)]=T(a)),o}if(Array.isArray(x))return x.map((o)=>T(o));const u={};return Object.entries(x).forEach(([o,a])=>u[o]=T(a)),u}if(typeof h.toJSON==="function"&&!z.has(h))return h.toJSON();return h};return T(X)};if(M==="reset")return function(){X=null};const F=D[M];if(G instanceof Map&&typeof F==="function")return function(...T){const h=M.toString();if(h==="set"&&T.length>=2)T[1]=Y(T[1]);const x=F.apply(D,T);return["set","delete","clear"].includes(h)&&W.queueUpdate(J),x};if(Array.isArray(G)&&typeof F==="function")return function(...T){const h=M.toString();if(["push","unshift"].includes(h))T=T.map((u)=>Y(u));else if(h==="splice"&&T.length>2)T=[T[0],T[1],...T.slice(2).map((u)=>Y(u))];const x=F.apply(D,T);return["push","pop","shift","unshift","splice","sort","reverse","fill"].includes(h)&&W.queueUpdate(J),x};return F},set(D,M,F){if(D[M]===F)return!0;if(F instanceof Map&&D[M]instanceof Map){const T=D[M];return T.clear(),F.forEach((h,x)=>T.set(x,Y(h))),W.queueUpdate(J),!0}return D[M]=Y(F),W.queueUpdate(J),!0}});return z.set(X,G),X},Y=(G)=>{if(!G)return G;return G instanceof Map||Array.isArray(G)||typeof G==="object"?q(G):G};return q(Q)}}class l1{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 z=setTimeout(()=>{this.unwatch(J),J.emit(`component:${Q}ment-timeout`,J)},this.TIMEOUT);this.observedComponents.set(J,{timeout:z,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 r1{pending=new Map;isPending=!1;component;metrics={batchCount:0,updatesProcessed:0,lastBatchSize:0,avgBatchSize:"0.00"};constructor(J){this.component=J}queue(J){if(this.pending.set(J.dependent.path,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.values());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 z=W.update(W.memo,"batch-updator");if(z)typeof z.memo==="object"&&this.component.FGUD.get(Q)?.set(W.path,{...W,memo:z.memo}),typeof z.cleanup==="function"&&z.cleanup()}catch(z){console.error("Failed to update dependency --",z)}})}getMetrics(){return{batchCount:this.metrics.batchCount,lastBatchSize:this.metrics.lastBatchSize,avgBatchSize:this.metrics.avgBatchSize,totalUpdates:this.metrics.updatesProcessed}}}class n1{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((z)=>typeof z.toJSON==="function"?z.toJSON():z);this.__events[J]?.forEach((z)=>z(...W)),this.__once_events[J]?.forEach((z)=>z(...W)),delete this.__once_events[J]}}var E0=P0(t1(),1);function H1(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(Q5(J)&&Q5(Q)){for(let G of J)if(!Q.has(G))return!0;return!1}const Y=new WeakMap;for(let G of J){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(!Y.has(G))Y.set(G,new WeakMap);const M=Y.get(G);if(M.has(D)){if(X=M.get(D),X)break;continue}const F=!H1(G,D);if(M.set(D,F),F){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(W5(J)&&W5(Q)){for(let[G,X]of J)if(Q.get(G)!==X)return!0;return!1}const Y=new WeakMap;for(let[G,X]of J){if(typeof G!=="object"){if(!Q.has(G))return!0;const F=Q.get(G);if(typeof X!=="object"){if(X!==F)return!0;continue}if(typeof F!=="object"||H1(X,F))return!0;continue}let D=!1,M=!1;for(let[F,T]of Q){if(typeof F!=="object")continue;if(!Y.has(G))Y.set(G,new WeakMap);const h=Y.get(G);if(h.has(F)){const[x,u]=h.get(F);if(x){D=!0,M=u;break}continue}if(!H1(G,F)){if(D=!0,M=typeof X==="object"&&typeof T==="object"?!H1(X,T):X===T,h.set(F,[!0,M]),M)break}else h.set(F,[!1,!1])}if(!D||!M)return!0}return!1}if(Array.isArray(J)){if(!Array.isArray(Q))return!0;if(J.length!==Q.length)return!0;for(let Y=0;Y<J.length;Y++){const G=J[Y],X=Q[Y];if(G!==X&&(typeof G!=="object"||H1(G,X)))return!0}return!1}const W=Object.keys(J),z=Object.keys(Q);if(W.length!==z.length)return!0;W.sort(),z.sort();const q=W.length;for(let Y=0;Y<q;Y++)if(W[Y]!==z[Y])return!0;for(let Y=0;Y<q;Y++){const G=W[Y],X=J[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)||H1(X,D))return!0;continue}if(X instanceof Set){if(!(D instanceof Set)||H1(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===J){if(D!==Q)return!0}else if(H1(X,D))return!0}else return!0}return!1}function S1(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),D=new Uint8Array(Q.buffer,Q.byteOffset,Q.byteLength);for(let M=0;M<X.length;M++)if(X[M]!==D[M])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!H1(J,Q);const q=Object.getPrototypeOf(J);if(q!==Object.getPrototypeOf(Q))return!1;const Y=Object.getOwnPropertyNames(J),G=Object.getOwnPropertyNames(Q);if(Y.length!==G.length)return!1;for(let X of Y){if(!Object.prototype.hasOwnProperty.call(Q,X))return!1;if(!S1(J[X],Q[X]))return!1}if(q!==null&&q!==Object.prototype){const X=Object.getOwnPropertyNames(q),D=Object.getOwnPropertyNames(Object.getPrototypeOf(Q));if(X.length!==D.length)return!1;for(let M of X){if(M==="constructor")continue;if(!S1(q[M],Object.getPrototypeOf(Q)[M]))return!1}}return!0}function Q5(J){for(let Q of J)if(typeof Q==="object"&&Q!==null)return!1;return!0}function W5(J){for(let[Q,W]of J)if(typeof Q==="object"&&Q!==null||typeof W==="object"&&W!==null)return!1;return!0}function e(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 q=new Map;return Q.set(J,q),J.forEach((Y,G)=>q.set(e(G,Q),e(Y,Q))),q}if(J instanceof Set){const q=new Set;return Q.set(J,q),J.forEach((Y)=>q.add(e(Y,Q))),q}if(Array.isArray(J)){const q=[];Q.set(J,q);for(let Y=0;Y<J.length;Y++)q[Y]=e(J[Y],Q);return q}if(ArrayBuffer.isView(J))return new J.constructor(J);const W=Object.create(Object.getPrototypeOf(J));Q.set(J,W);const z=Object.getOwnPropertySymbols(J);for(let q of z)W[q]=e(J[q],Q);for(let q in J)if(Object.prototype.hasOwnProperty.call(J,q))W[q]=e(J[q],Q);return W}function H5(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(q,Y,G){const X=Y.split(/\.|\[|\]/).filter(Boolean);let D=q;for(let M=0;M<X.length;M++){const F=X[M],T=!isNaN(Number(F)),h=M===X.length-1,x=!isNaN(Number(X[M+1]));if(h){D[F]=G;continue}if(!(F in D))D[F]=x?[]:{};else if(x&&!Array.isArray(D[F]))D[F]=[];else if(!x&&Array.isArray(D[F]))D[F]={};D=D[F]}}const z=e(J);try{for(let[q,Y]of Object.entries(Q)){if(typeof q!=="string")throw new TypeError(`Invalid path: ${q}`);if(!/^[a-zA-Z0-9_\-\[\].]+$/.test(q))throw new Error(`Invalid path format: ${q}`);W(z,q,Y)}}catch(q){throw new Error(`Failed to assign value: ${q.message}`)}return z}var P1="i18n",F1="syn:",U1="fn:",$1="on-",t=/^\.\.\./,a1=/^\[(.*?)\]$/,$0=/{\s*([^{}]+)\s*}/g,X5=["@html","@text","@format"];E0.default.fn.extend({attrs:function(){const J={},Q=this[0];return Q&&Q.nodeType!==Node.TEXT_NODE&&E0.default.each(Q.attributes,function(){J[this.name]=this.value}),J}});class e1{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,i18nTrackCount:0,i18nUpdateCount: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=e(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},z={"DOM Operations":this.stats.domOperations,"DOM Inserts":this.stats.domInsertsCount,"DOM Updates":this.stats.domUpdatesCount,"DOM Removals":this.stats.domRemovalsCount},q={"i18n Tracked":this.stats.i18nTrackCount,"i18n Updates":this.stats.i18nUpdateCount},Y={"Dependencies Tracked":this.stats.dependencyTrackCount,"Dependency Updates":this.stats.dependencyUpdateCount},G={"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(z),console.table(q),console.table(Y),console.table(G),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 e(this.stats)}dispose(){if(!this.debug)return;this.autoSaveInterval&&clearInterval(this.autoSaveInterval)}}var n=P0(t1(),1);var P5=P0(t1(),1);var J0="comm",Z0="rule",Q0="decl";var z5="@import";var q5="@namespace",Y5="@keyframes";var B5="@layer";function W0(J){return J.trim()}function A1(J,Q,W){return J.replace(Q,W)}function G5(J,Q,W){return J.indexOf(Q,W)}function I1(J,Q){return J.charCodeAt(Q)|0}function L1(J,Q,W){return J.slice(Q,W)}function z1(J){return J.length}function X0(J){return J.length}function _1(J,Q){return Q.push(J),J}var R0=Math.abs,f1=String.fromCharCode;function z0(J,Q,W,z,q,Y,G,X){return{value:J,root:Q,parent:W,type:z,props:q,children:Y,line:H0,column:b1,length:G,return:"",siblings:X}}function K5(){return J1}function U5(){if(J1=B1>0?I1(g1,--B1):0,b1--,J1===10)b1=1,H0--;return J1}function G1(){if(J1=B1<w5?I1(g1,B1++):0,b1++,J1===10)b1=1,H0++;return J1}function V1(){return I1(g1,B1)}function y1(){return B1}function q0(J,Q){return L1(g1,J,Q)}function x1(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 O5(J){return H0=b1=1,w5=z1(g1=J),B1=0,[]}function M5(J){return g1="",J}function Y0(J){return W0(q0(B1-1,T0(J===91?J+2:J===40?J+1:J)))}function D5(J){while(J1=V1())if(J1<33)G1();else break;return x1(J)>2||x1(J1)>3?"":" "}function j5(J,Q){while(--Q&&G1())if(J1<48||J1>102||J1>57&&J1<65||J1>70&&J1<97)break;return q0(J,y1()+(Q<6&&V1()==32&&G1()==32))}function T0(J){while(G1())switch(J1){case J:return B1;case 34:case 39:if(J!==34&&J!==39)T0(J1);break;case 40:if(J===41)T0(J);break;case 92:G1();break}return B1}function F5(J,Q){while(G1())if(J+J1===57)break;else if(J+J1===84&&V1()===47)break;return"/*"+q0(Q,B1-1)+"*"+f1(J===47?J:G1())}function I5(J){while(!x1(V1()))G1();return q0(J,B1)}var H0=1,b1=1,w5=0,B1=0,J1=0,g1="";function C5(J){return M5(B0("",null,null,null,[""],J=O5(J),0,[0],J))}function B0(J,Q,W,z,q,Y,G,X,D){var M=0,F=0,T=G,h=0,x=0,u=0,o=1,a=1,r=1,s=0,i="",y=q,v=Y,_=z,U=i;while(a)switch(u=s,s=G1()){case 40:if(u!=108&&I1(U,T-1)==58){if(G5(U+=A1(Y0(s),"&","&\f"),"&\f",R0(M?X[M-1]:0))!=-1)r=-1;break}case 34:case 39:case 91:U+=Y0(s);break;case 9:case 10:case 13:case 32:U+=D5(u);break;case 92:U+=j5(y1()-1,7);continue;case 47:switch(V1()){case 42:case 47:if(_1(B8(F5(G1(),y1()),Q,W,D),D),(x1(u||1)==5||x1(V1()||1)==5)&&z1(U)&&L1(U,-1,void 0)!==" ")U+=" ";break;default:U+="/"}break;case 123*o:X[M++]=z1(U)*r;case 125*o:case 59:case 0:switch(s){case 0:case 125:a=0;case 59+F:if(r==-1)U=A1(U,/\f/g,"");if(x>0&&(z1(U)-T||o===0&&u===47))_1(x>32?V5(U+";",z,W,T-1,D):V5(A1(U," ","")+";",z,W,T-2,D),D);break;case 59:U+=";";default:if(_1(_=L5(U,Q,W,M,F,q,X,i,y=[],v=[],T,Y),Y),s===123)if(F===0)B0(U,Q,_,_,y,Y,T,X,v);else{switch(h){case 99:if(I1(U,3)===110)break;case 108:if(I1(U,2)===97)break;default:F=0;case 100:case 109:case 115:}if(F)B0(J,_,_,z&&_1(L5(J,_,_,0,0,q,X,i,q,y=[],T,v),v),q,v,T,X,z?y:v);else B0(U,_,_,_,[""],v,0,X,v)}}M=F=x=0,o=r=1,i=U="",T=G;break;case 58:T=1+z1(U),x=u;default:if(o<1){if(s==123)--o;else if(s==125&&o++==0&&U5()==125)continue}switch(U+=f1(s),s*o){case 38:r=F>0?1:(U+="\f",-1);break;case 44:X[M++]=(z1(U)-1)*r,r=1;break;case 64:if(V1()===45)U+=Y0(G1());h=V1(),F=T=z1(i=U+=I5(y1())),s++;break;case 45:if(u===45&&z1(U)==2)o=0}}return Y}function L5(J,Q,W,z,q,Y,G,X,D,M,F,T){var h=q-1,x=q===0?Y:[""],u=X0(x);for(var o=0,a=0,r=0;o<z;++o)for(var s=0,i=L1(J,h+1,h=R0(a=G[o])),y=J;s<u;++s)if(y=W0(a>0?x[s]+" "+i:A1(i,/&\f/g,x[s])))D[r++]=y;return z0(J,Q,W,q===0?Z0:X,D,M,F,T)}function B8(J,Q,W,z){return z0(J,Q,W,J0,f1(K5()),L1(J,2,-2),0,z)}function V5(J,Q,W,z,q){return z0(J,Q,W,Q0,L1(J,0,z),L1(J,z+1,-1),z,q)}function G0(J,Q){var W="";for(var z=0;z<J.length;z++)W+=Q(J[z],z,J,Q)||"";return W}function N5(J,Q,W,z){switch(J.type){case B5:if(J.children.length)break;case z5:case q5:case Q0:return J.return=J.return||J.value;case J0:return"";case Y5:return J.return=J.value+"{"+G0(J.children,z)+"}";case Z0:if(!z1(J.value=J.props.join(",")))return""}return z1(W=G0(J.children,z))?J.return=J.value+"{"+W+"}":""}function S5(J){var Q=X0(J);return function(W,z,q,Y){var G="";for(var X=0;X<Q;X++)G+=J[X](W,z,q,Y)||"";return G}}class h1{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=P5.default("head"),this.settings=Q||{},this.settings&&this.load(this.settings)}compile(J){try{return G0(C5(J),S5([N5]))}catch(Q){throw new Error(`Style compilation failed: ${Q.message}`)}}waitForStyles(J){return new Promise((Q)=>{const W=new MutationObserver(()=>{const z=document.querySelector(J);if(z&&getComputedStyle(z).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 z=document.createElement("style");z.setAttribute("rel",`${this.settings.meta?"@":""}${this.nsp}`),z.textContent=W;let q=0;const Y=this.$head.find(`style[${Q}]`);if(Y.length)q=parseInt(Y.attr("dindex"))+1,Y.remove();return z.setAttribute("dindex",String(q)),this.settings.meta?document.head.prepend(z):document.head.appendChild(z),z}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 G8=function(J){const Q=/on-([a-zA-Z-]+)\s*\(/g;let W=J,z;while((z=Q.exec(J))!==null){const q=z[1],Y=z.index+z[0].length;let G=1,X=Y;while(X<J.length&&G>0){if(J[X]==="(")G++;if(J[X]===")")G--;X++}if(G===0){const D=J.slice(Y,X-1).trim(),M=J.slice(0,z.index),F=`${$1}${q}="${D}"`,T=J.slice(X);W=M+F+T,J=W,Q.lastIndex=M.length+F.length}}return W},w8=function(J){const Q=[];let z=J.replace(/<([a-zA-Z][a-zA-Z0-9_-]*)((?:[^>'"]*|'[^']*'|"[^"]*")*?)(?:\/?>)/g,(q,Y,G)=>{return Q.push(G),`<${Y}##TAG_ATTRS_${Q.length-1}##>`});for(let q=0;q<Q.length;q++){const Y=`##TAG_ATTRS_${q}##`,G=Q[q],X=K8(G);z=z.replace(Y,X)}return z},K8=function(J){let Q="",W=0,z=!1,q="",Y=0,G=0,X=0;while(W<J.length){const D=J[W];if((D==='"'||D==="'")&&(W===0||J[W-1]!=="\\")){if(!z)z=!0,q=D;else if(D===q)z=!1}if(!z){if(D==="(")G++;else if(D===")")G--;else if(D==="{")X++;else if(D==="}")X--}if(!z&&G===0&&X===0&&(D===" "||W===J.length-1)){let M=W;if(W===J.length-1)M=W+1;const F=J.substring(Y,M).trim();if(F){const T=U8(F);Q+=" "+T}Y=W+1}W++}return Q},U8=function(J){const Q=J.indexOf("=");if(Q===-1){if(J===P1||J.startsWith("...")||J.startsWith("["))return J;return`:${J}="${!J.startsWith("!")}"`}let W=J.substring(0,Q).trim(),z=J.substring(Q+1).trim();if(W.startsWith("@"))return W=!X5.includes(W)?W.slice(1):W,`:${W}=${z}`;if(W.startsWith(U1)||W.startsWith($1))return J;if(z.startsWith('"')&&z.endsWith('"')||z.startsWith("'")&&z.endsWith("'")){const q=z.substring(1,z.length-1);if(O8(q))return`:${W}="${q}"`;return J}else return`:${W}="${z}"`};function O8(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 A0(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,z,q)=>{return q.endsWith("<")?`<lips dtag="${z}" ${q}/lips>`:`<lips dtag="${z}" ${q}></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 ${U1}await="\$1">`).replace(/<log\(\s*(.*?)\s*\)>/g,'<log @args="$1">').replace(/\[(.*?)\]/g,(W)=>W.replace(/\s+/g,""));return Q=G8(Q),Q=w8(Q),Q}var M8=function(J,Q){if(J.isDisposed)return;Q.add(J),J.dependencies.add(Q)},$5=function(J){for(let Q of J.dependencies)Q.delete(J);J.dependencies.clear()};function R1(J,Q={maxSize:100}){const W=new Set,z=[{value:J,timestamp:Date.now()}];let q=0;const Y=()=>{const M=w0[w0.length-1];return M&&M8(M,W),z[q].value},G=()=>{const M=[...W];if(E5)for(let F of M)E5.add(F);else for(let F of M)F.execute()};return[Y,(M,F)=>{if(Object.is(z[q].value,M))return;if(q<z.length-1)z.splice(q+1);if(z.push({value:M,timestamp:Date.now(),metadata:F}),z.length>Q.maxSize)z.shift(),q=Math.max(0,q-1);else q++;G()},{undo(){if(q>0)q--,G()},redo(){if(q<z.length-1)q++,G()},jumpTo(M){if(M>=0&&M<z.length&&M!==q)q=M,G()},getHistory(){return[...z]},getCurrentIndex(){return q},canUndo(){return q>0},canRedo(){return q<z.length-1},clear(){const M=z[0];z.length=0,z.push(M),q=0,G()}}]}function v1(J){let Q=!1;const W=()=>{if(Q)throw new Error("Circular dependency detected");if(z.isDisposed)return;Q=!0,$5(z),w0.push(z);try{J()}finally{Q=!1,w0.pop()}},z={execute:W,dependencies:new Set,isDisposed:!1};return W(),{dispose:()=>{z.isDisposed=!0,$5(z)}}}var w0=[],E5=null;class u1 extends n1{declaration;$=null;input;state;static;context;__name__;__path__;__lang__;__template__;__previous;__macros=new Map;__i18nDeps=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:z,context:q,_static:Y,handler:G,stylesheet:X,macros:D,declaration:M},F){super();if(this.lips=F.lips,F?.debug)this.debug=F.debug||this.lips.debug;if(F?.prepath)this.prepath=F.prepath;if(this.__name__=J,this.__lang__=this.lips.i18n.lang,this.__path__=`${this.prepath}/${this.__name__}`,this.__template__=A0(Q),this.declaration=M||{name:J},this.input=W||{},this.static=Y||{},this.context={},this.state=this.lips.IUC.proxyState(this.__path__,z||{}),D&&this.setMacros(D),G&&this.setHandler(G),X&&this.setStylesheet(X),this.metrics=new e1(this.debug),this.metrics.inc("componentCount"),this.UQS=new r1(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:e(this.input),state:e(this.state),context:e(this.context)};const[T,h]=R1(this.input),[x,u]=R1(this.state),[o,a]=R1(this.context);this.__setInput=h,this.__setState=u,this.__getState=x,this.lips.IUC.register(this.__path__,()=>{H1(this.__previous?.state,this.state)&&this.__setState({...this.__getState(),...this.state})}),Array.isArray(q)&&q.length&&this.lips.useContext(q,(r)=>{if(!H1(this.context,r))return;a(r),this.context=r,typeof this.onContext=="function"&&this.onContext.bind(this)(),this.emit("component:context",this)}),this.lips.useTranslator("*",(r)=>{if(r===this.__lang__)return;this.__updateI18nDepNodes__(),this.__lang__=r}),this.ICE=v1(()=>{const r=T(),s=x(),i=this.context=o();if(!this.isRendered){this.metrics.reset();const{$log:y}=this.render("",void 0,void 0,this.FGUD);this.$=y,!M?.syntax&&this.$?.each((v,_)=>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:s,input:r,context:i},this.__previous),typeof this.onUpdate=="function"&&this.onUpdate.bind(this)(),this.emit("component:update",this),this.__previous={input:e(r),state:e(s),context:e(i)},this.input=r;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(!H1(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(H5(this.input,J)),this}setMacros(J){const Q=A0(J),W=n.default(Q);if(!W.length)return;const z=this;W.each(function(){const q=n.default(this),{argv:Y,attrs:G}=z.__getAttributes__(q);if(!Object.keys(G))throw new Error("Invalid macro component definition");if(!G.literals.name)throw new Error("Undefined macro `name` attribute.");if(z.__macros.get(G.literals.name))console.warn(`Duplicate macro <${G.literals.name}> will be override`);if(!q.contents()?.length)throw new Error("Invalid macro component definition. Template content expected.");z.__macros.set(G.literals.name,{argv:Y,$node:q})})}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 h1(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={},z,q){const Y=z||new Map,G=[];if(Q&&!Q.length)return console.warn("Undefined node element to render"),{$log:Q,dependencies:Y};this.metrics.startRender();const X=this;let D=n.default();function M(U){const w=F(U);return X.__pathCounter++,X.__path?`${X.__path}/${w}`:`${J?J+"/":"#"}${w}`}function F(U){return(U==="component"?"c":"")+X.__pathCounter}function T(U){return U!==null&&typeof U==="object"&&typeof U.mesh==="function"&&typeof U.update==="function"}function h(U){return U!==null&&typeof U==="object"&&typeof U.default&&typeof U.default==="string"}function x(U){if(!U.attr(":dtag")||U.prop("tagName")!=="LIPS")throw new Error("Invalid dynamic tag name");const w=U.attr(":dtag"),K=X.__evaluate__(w,W);if(T(K)||K===null)return r(U,w,K);else if(h(K))return s(U,{template:K});else return s(U,{name:K})}function u(U){const w=U.attr(":args"),K=M("log");if(!w)return;if(X.__evaluate__(`console.log(${w})`,W),X.__isReactive__(w,W))X.__extractExpressionDeps__(w,W).forEach((I)=>X.__trackDep__(Y,I,{nodetype:"log",target:"argument",$fragment:null,path:K,update:(S)=>X.__evaluate__(`console.log(${w})`,S),memo:W,batch:!0}))}function o(U){const w=M("var"),{attrs:K}=X.__getAttributes__(U);if(!K)return;Object.entries(K.literals).forEach(([C,I])=>{if(W[C]&&W[C].type==="const")throw new Error(`Cannot override <const ${C}=[value]/> variable`);W[C]={value:I,type:"let"}}),Object.entries(K.expressions).forEach(([C,I])=>{if(t.test(C)){const S=($,g)=>{const f=X.__evaluate__(C.replace(t,""),g||W);if(typeof f!=="object")throw new Error(`Invalid spread operator ${C}`);for(let V in f){if(W[V]&&W[V].type==="const")throw new Error(`Cannot override <const ${V}=[value]/> variable`);if(W[V]={value:f[V],type:"let"},g)g[V]=W[V],X.__updateVarDepNodes__(V,w,g)}if($)return{memo:g}};X.__extractExpressionDeps__(C,W).forEach(($)=>X.__trackDep__(Y,$,{nodetype:"let",target:"spread-attr",$fragment:null,path:`${w}.${C}`,update:(g)=>S(!0,g),memo:W,batch:!0})),S()}else if(I){if(X.__isReactive__(I,W)){const S=X.__extractExpressionDeps__(I,W),l=($,g)=>{if(W[C]&&W[C].type==="const")throw new Error(`Cannot override <const ${C}=[value]/> variable`);return $[C]=W[C]={value:X.__evaluate__(I,$),type:"let"},X.__updateVarDepNodes__(C,w,$),{memo:$}};S.forEach(($)=>X.__trackDep__(Y,$,{nodetype:"let",target:"attr",$fragment:null,path:`${w}.${C}`,update:l,memo:W,batch:!0}))}if(W[C]&&W[C].type==="const")throw new Error(`Cannot override <const ${C}=[value]/> variable`);W[C]={value:X.__evaluate__(I,W),type:"let"}}}),X.metrics.inc("elementCount")}function a(U){const{attrs:w}=X.__getAttributes__(U);if(!w)return;Object.entries(w.literals).forEach(([K,C])=>{if(W[K]&&W[K].type==="const")throw new Error(`<const ${K}=[value]/> variable already defined`);if(!C)return;W[K]={value:C,type:"const"}}),Object.entries(w.expressions).forEach(([K,C])=>{if(t.test(K)){const I=X.__evaluate__(K.replace(t,""),W);if(typeof I!=="object")throw new Error(`Invalid spread operator ${K}`);for(let S in I){if(W[S]&&W[S].type==="const")throw new Error(`<const ${S}=[value]/> by spread operator ${K}. [${S}] variable already defined`);W[S]={value:I[S],type:"const"}}}else{if(W[K]&&W[K].type==="const")throw new Error(`<const ${K}=[value]/> variable already defined`);if(!C)return;W[K]={value:X.__evaluate__(C,W),type:"const"}}}),X.metrics.inc("elementCount")}function r(U,w,K){const{attrs:C}=X.__getAttributes__(U),I=M("element"),S=X.__getBoundaries__(I);let l=n.default(S.start),$={},g=K;if(g){C.literals&&Object.entries(C.literals).forEach(([V,P])=>$[V]={type:"arg",value:P}),C.expressions&&Object.entries(C.expressions).forEach(([V,P])=>{if(!g)return;if(t.test(V)){const A=X.__evaluate__(V.replace(t,""),W);if(typeof A!=="object")throw new Error(`Invalid spread operator ${V}`);for(let N in A){if(N!=="#"&&!g.argv.includes(N))continue;$[N]={type:"arg",value:A[N]}}}else{if(V!=="#"&&!g.argv.includes(V))return;$[V]={type:"arg",value:P?X.__evaluate__(P,W):!0}}});const f=g.mesh($);if(f&&f.length)l=l.add(f);C.expressions&&Object.entries(C.expressions).forEach(([V,P])=>{if(!g)return;if(t.test(V)&&X.__isReactive__(V,W)){const A=X.__extractExpressionDeps__(V,W),N=(j,R)=>{if(!g)return;const b={},c=X.__evaluate__(V.replace(t,""),j);if(typeof c!=="object")throw new Error(`Invalid spread operator ${V}`);const p=[];for(let m in c){if(m!=="#"&&!g.argv.includes(m))continue;$[m]=b[m]={type:"arg",value:c[m]},(!j[m]||!S1(c[m],j[m].value))&&p.push(m)}p.length&&g.update(p,b,S)};A.forEach((j)=>X.__trackDep__(Y,j,{nodetype:"dynamic",target:"spread-attr",$fragment:null,boundaries:S,path:`${I}.${V}`,update:N,memo:W,batch:!0}))}else if((V==="#"||g.argv.includes(V))&&X.__isReactive__(P,W)){const A=X.__extractExpressionDeps__(P,W),N=(j,R)=>{if(!g)return;const b=$[V]={type:"arg",value:P?X.__evaluate__(P,j):!0};g.update([V],{[V]:b},S)};A.forEach((j)=>X.__trackDep__(Y,j,{nodetype:"dynamic",target:"attr",$fragment:null,boundaries:S,path:`${I}.${V}`,update:N,memo:W,batch:!0}))}})}if(X.__isReactive__(w,W)){const f=(P,A)=>{const N=X.__evaluate__(w,P);let j;if(h(N))j=s(U,{template:N});else if(T(N))$="#"in $?{...P,...$["#"].value}:{...P,...$},g=N,j=g?g.mesh($):null;if(!document.contains(S.start)||!document.contains(S.end))return;const R=[];let b=S.start.nextSibling;while(b&&b!==S.end)R.push(b),b=b.nextSibling;n.default(R).remove(),j&&n.default(S.start).after(j)};X.__extractExpressionDeps__(w,W).forEach((P)=>X.__trackDep__(Y,P,{nodetype:"dynamic",target:"dtag",$fragment:null,boundaries:S,path:I,update:f,batch:!0,memo:{...W,...$}}))}return l=l.add(S.end),l}function s(U,w){let K,C;if(w?.template)K=w.template,C=F("component");else{if(C=w?.name||U.prop("tagName")?.toLowerCase(),!C)throw new Error("Invalid component");if(C===X.__name__)throw new Error("Render component within itself is forbidden");K=X.lips.import(C)}if(!K||!C)throw new Error(`<${C}> template not found`);const I=M("component"),S=X.__getBoundaries__(I),{argv:l,attrs:$,events:g}=X.__getAttributes__(U),f={};let V={},P=n.default(S.start),A=X.PCC.get(I);$.literals&&Object.entries($.literals).forEach(([j,R])=>{if(j=="key")return;V[j]=R}),$.functions&&Object.entries($.functions).forEach(([j,R])=>{V[j]=X.__evaluateFunction__(R,[],W),K.declaration?.syntax?f[F1+U1+j]=R:f[U1+j]=R}),$.expressions&&Object.entries($.expressions).forEach(([j,R])=>{if(j=="key")return;if(t.test(j)){const b=X.__evaluate__(j.replace(t,""),W);if(typeof b!=="object")throw new Error(`Invalid spread operator ${j}`);for(let c in b)V[c]=b[c]}else V[j]=R?X.__evaluate__(R,W):!0;K.declaration?.syntax?f[F1+j]=R:f[j]=R});const N=U.contents();if(N.length){if(V={...V,...X.__meshwire__({$node:U,fragmentPath:I,fragmentBoundaries:S,meshPath:null,argv:l,scope:W,xmlns:q,useAttributes:!0,declaration:K.declaration},f)},K.declaration){if(K.declaration.tags)Object.entries(K.declaration?.tags).forEach(([j,{type:R,many:b}])=>{switch(R){case"nexted":{let c=U.next(j);if(!c.length)return;if(b){V[j]=[];let p=0,m=!1;while(!m){if(V[j].push(X.__meshwire__({$node:c,meshPath:`${j}[${p}]`,fragmentPath:I,fragmentBoundaries:S,argv:l,scope:W,xmlns:q,useAttributes:!0,declaration:K.declaration},f)),!c.next(j).length){m=!0;break}c=c.next(j),p++}}else V[j]=X.__meshwire__({$node:c,meshPath:j,fragmentPath:I,fragmentBoundaries:S,argv:l,scope:W,xmlns:q,useAttributes:!0,declaration:K.declaration},f)}break;case"child":{const c=U.children(j);if(b)V[j]=[],c.each(function(p){const m=n.default(this),{argv:Z1}=X.__getAttributes__(m);V[j].push(X.__meshwire__({$node:m,meshPath:`${j}[${p}]`,fragmentPath:I,fragmentBoundaries:S,argv:Z1,scope:W,xmlns:q,useAttributes:!0,declaration:K.declaration},f))});else if(U.children(j).first().length){const p=U.children(j).first(),{argv:m}=X.__getAttributes__(p);V[j]=X.__meshwire__({$node:p,meshPath:j,fragmentPath:I,fragmentBoundaries:S,argv:m,scope:W,xmlns:q,useAttributes:!0,declaration:K.declaration},f)}}break}});else if(K.declaration.contents)V.__contents__=N}}if(A)A.setInput(e(V)),P=P.add(A.node);else{const{declaration:j,state:R,_static:b,handler:c,context:p,default:m,stylesheet:Z1}=K;A=new u1(C,m||"",{state:e(R),input:e(V),context:p,_static:e(b),handler:c,stylesheet:Z1,declaration:j},{debug:X.debug,lips:X.lips,prepath:I}),P=P.add(A.node),X.PCC.set(I,A)}return P=P.add(S.end),Object.entries(g).forEach(([j,R])=>!!A&&X.__attachEvent__(A,j,R,W)),f&&Object.entries(f).forEach(([j,R])=>{let b=!1,c=!1;if(j.startsWith(F1))b=!0,j=j.replace(F1,"");if(j.startsWith(U1))c=!0,j=j.replace(U1,"");if(t.test(j)){const p=(m)=>{const Z1={},D1=X.__evaluate__(j.replace(t,""),m);if(typeof D1!=="object")throw new Error(`Invalid spread operator ${j}`);for(let Q1 in D1)Z1[Q1]=D1[Q1];A?.subInput(Z1)};if(X.__isReactive__(j,W))X.__extractExpressionDeps__(j,W).forEach((Z1)=>X.__trackDep__(Y,Z1,{nodetype:"component",target:"spread-attr",$fragment:null,boundaries:S,path:`${I}.${j}`,update:p,syntax:b,memo:W,batch:!0}))}else{const p=(m)=>{const Z1=c?X.__evaluateFunction__(R,[],m):R?X.__evaluate__(R,m):!0;A?.subInput({[j]:Z1})};if(X.__isReactive__(R,W))X.__extractExpressionDeps__(R,W).forEach((Z1)=>X.__trackDep__(Y,Z1,{nodetype:"component",target:"attr",$fragment:null,boundaries:S,path:`${I}.${j}`,update:p,syntax:b,memo:W,batch:!0}))}}),X.metrics.inc("componentCount"),P}function i(U){const w=U.prop("tagName")?.toLowerCase();if(!w)throw new Error("Invalid macro rendering call");const K=X.__macros.get(w);if(!K)throw new Error("Macro component not found");const C=M("macro"),I=X.__getBoundaries__(C),{attrs:S}=X.__getAttributes__(U),l={};let $={},g={},f=n.default(I.start);if(S.literals&&Object.entries(S.literals).forEach(([N,j])=>$[N]={value:j,type:"arg"}),S.expressions&&Object.entries(S.expressions).forEach(([N,j])=>{if(t.test(N)){const R=X.__evaluate__(N.replace(t,""),W);if(typeof R!=="object")throw new Error(`Invalid spread operator ${N}`);for(let b in R)if(g[b]=R[b],K.argv.includes(b))$[b]={value:R[b],type:"arg"};l[N]=j}else{const R=j?X.__evaluate__(j,W):!0;if(g[N]=R,K.argv.includes(N))$[N]={value:R,type:"arg"},l[N]=j}K.argv.forEach((R)=>{if($[R]!==void 0)return;$[R]={value:!1,type:"arg"}})}),K.argv.includes("__"))$.__={value:g,type:"arg"};const V={$node:K.$node,meshPath:null,fragmentPath:C,fragmentBoundaries:I,argv:K.argv,scope:W,xmlns:q,useAttributes:!0},P=X.__meshwire__(V,l),A=P.renderer.mesh($);return f=f.add(A),l&&Object.entries(l).forEach(([N,j])=>{let R=!1;if(new RegExp(`^${F1}`).test(N))R=!0,N=N.replace(F1,"");if(t.test(N)){if(!X.__isReactive__(N,W))return;const b=X.__extractExpressionDeps__(N,W),c=(p)=>{const m={},Z1=X.__evaluate__(N.replace(t,""),p);if(typeof Z1!=="object")throw new Error(`Invalid spread operator ${N}`);const D1=[];for(let Q1 in Z1)m[Q1]={value:Z1[Q1],type:"arg"},(!p[Q1]||!S1(Z1[Q1],p[Q1].value))&&D1.push(Q1);return D1.length&&P.renderer.update(D1,m),{memo:{...p,...m}}};b.forEach((p)=>X.__trackDep__(Y,p,{nodetype:"macro",target:"spread-attr",$fragment:null,boundaries:I,path:`${C}.${N}`,update:c,syntax:R,memo:{...W,...$},batch:!0}))}else if(X.__isReactive__(j,W)){const b=X.__extractExpressionDeps__(j,W),c=(p)=>{const m=p[N]={value:j?X.__evaluate__(j,p):!0,type:"arg"};return P.renderer.update([N],{[N]:m}),{memo:p}};b.forEach((p)=>X.__trackDep__(Y,p,{nodetype:"macro",target:"attr",$fragment:null,boundaries:I,path:`${C}.${N}`,update:c,syntax:R,memo:{...W,...$},batch:!0}))}}),f=f.add(I.end),X.metrics.inc("elementCount"),f}function y(U){if(!U.length||!U.prop("tagName"))return U;const w=U.is("svg")||q,K=w?n.default(document.createElementNS("http://www.w3.org/2000/svg",U.prop("tagName").toLowerCase())):n.default(`<${U.prop("tagName").toLowerCase()}/>`),C=U.contents(),I=M("element");C.length&&K.append(X.__withPath__(I,()=>X.render(I+".n",C,W,Y,w).$log));const{attrs:S,events:l}=X.__getAttributes__(U);S.literals&&Object.entries(S.literals).forEach(([g,f])=>{if(g===P1)return;const V=U.is(`[${P1}]`)&&["title","placeholder"].includes(g);K.attr(g,V?X.lips.i18n.translate(f).text:f);const P=(A)=>{K.attr(g,V?X.lips.i18n.translate(f).text:f),V&&X.__trackTranslationDep__({nodetype:"element",target:"attr",path:I,$fragment:K,update:P,memo:A})};V&&X.__trackTranslationDep__({nodetype:"element",target:"attr",path:I,$fragment:K,update:P,memo:W})});const $=(g,f=!1)=>{g&&Object.entries(g).forEach(([V,P])=>{switch(V){case"@html":{const A=(N)=>{K.html(X.__evaluate__(P,N))};if(A(W),f&&X.__isReactive__(P,W))X.__extractExpressionDeps__(P,W).forEach((j)=>X.__trackDep__(Y,j,{nodetype:"element",target:"meta-attr",$fragment:K,path:`${I}.${V}`,update:A,memo:W,batch:!0}))}break;case"@text":{const A=U.is(`[${P1}]`),N=(j)=>{K.text(X.__evaluate__(P,j,A)),A&&X.__trackTranslationDep__({nodetype:"element",target:"meta-attr",path:I,$fragment:K,update:N,memo:j})};if(N(W),f&&X.__isReactive__(P,W))X.__extractExpressionDeps__(P,W).forEach((R)=>X.__trackDep__(Y,R,{nodetype:"element",target:"meta-attr",$fragment:K,path:`${I}.${V}`,update:N,memo:W,batch:!0}));A&&X.__trackTranslationDep__({nodetype:"element",target:"meta-attr",path:I,$fragment:K,update:N,memo:W})}break;case"@format":{const[A,N]=P.split(",").map((R)=>R.trim());if(!A)throw new Error("Invalid @format reference");if(!N)throw new Error("Invalid @format parameters");const j=(R)=>{const b=X.__evaluate__(`!${N.trim()}`,R);if(typeof b!=="object")throw new Error("Invalid @format parameters");const c=X.lips.i18n.format(A,b);c!==void 0&&K.text(c),X.__trackTranslationDep__({nodetype:"element",target:"meta-attr",path:I,$fragment:K,update:j,memo:R})};j(W),X.__extractExpressionDeps__(N,W).forEach((R)=>X.__trackDep__(Y,R,{nodetype:"element",target:"meta-attr",$fragment:K,path:`${I}.${V}`,update:j,memo:W,batch:!0}))}break;case"style":{const A=(N)=>{const j=X.__evaluate__(P,N);if(typeof j==="object"){let R="";Object.entries(j).forEach(([b,c])=>R+=`${b}:${c};`),R.length&&K.attr("style",R)}else K.attr("style",j)};if(A(W),f&&X.__isReactive__(P,W))X.__extractExpressionDeps__(P,W).forEach((j)=>X.__trackDep__(Y,j,{nodetype:"element",target:"attr",$fragment:K,path:`${I}.${V}`,update:A,memo:W,batch:!0}))}break;default:{const A=U.is(`[${P1}]`)&&["title","placeholder"].includes(V),N=(j)=>{const R=P?X.__evaluate__(P,j,A):P!==void 0?P:!0;if(R===void 0||R===!1)K.removeAttr(V);else K.attr(V,R),A&&X.__trackTranslationDep__({nodetype:"element",target:"attr",path:I,$fragment:K,update:N,memo:j})};if(N(W),f&&X.__isReactive__(P,W))X.__extractExpressionDeps__(P,W).forEach((R)=>X.__trackDep__(Y,R,{nodetype:"element",target:"attr",$fragment:K,path:`${I}.${V}`,update:N,memo:W,batch:!0}));A&&X.__trackTranslationDep__({nodetype:"element",target:"attr",path:I,$fragment:K,update:N,memo:W})}}})};return S.expressions&&Object.keys(S.expressions).forEach((g)=>{if(!t.test(g))return;const f=(V)=>{const P={},A=X.__evaluate__(g.replace(t,""),V);if(typeof A!=="object")throw new Error(`Invalid spread operator ${g}`);for(let N in A)P[N]=A[N];$(P)};if(delete S.expressions[g],f(W),g&&X.__isReactive__(g,W))X.__extractExpressionDeps__(g,W).forEach((P)=>X.__trackDep__(Y,P,{nodetype:"element",target:"spread-attr",$fragment:K,path:`${I}.${g}`,update:f,memo:W,batch:!0}))}),$(S.expressions,!0),l&&Object.entries(l).forEach(([g,f])=>{G.push({_event:g,$fragment:K,instruction:f,scope:W})}),X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),K}function v(U){const w=U.text(),K=M("element"),C=U.parent().is(`[${P1}]`),I=n.default(document.createTextNode(X.__interpolate__(w,W,C))),S=(l)=>{const $=X.__interpolate__(w,l,C);if(!I[0])return;I[0].textContent=$,C&&X.__trackTranslationDep__({nodetype:"text",target:"value",path:K,$fragment:I,update:S,memo:l||W})};if(w&&X.__isReactive__(w,W)){const l=X.__extractTextDeps__(w,W);l.forEach(($)=>X.__trackDep__(Y,$,{nodetype:"text",target:"value",path:K,$fragment:I,update:S,memo:W,batch:l.length>1}))}return C&&X.__trackTranslationDep__({nodetype:"text",target:"value",path:K,$fragment:I,update:S,memo:W}),X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),I}function _(U){if(U.get(0)?.nodeType===Node.COMMENT_NODE)return U;if(U.get(0)?.nodeType===Node.TEXT_NODE)return v(U);if(U.is("let"))return o(U);else if(U.is("const"))return a(U);else if(U.is("lips")&&U.attr(":dtag"))return x(U);else if(U.is("log"))return u(U);else if(X.__macros.has(U.prop("tagName")?.toLowerCase()))return i(U);else if(U.is("if, for, switch, async")||X.lips.has(U.prop("tagName")?.toLowerCase()))return s(U);else if(U.is("else-if, else"))return;return y(U)}try{this.__renderDepth++,Q=Q||n.default(this.__template__),Q.each(function(){const U=_(n.default(this));if(U)D=D.add(U)}),G.forEach(({$fragment:U,_event:w,instruction:K,scope:C})=>{this.__attachEvent__(U,w,K,C)}),X.metrics.inc("renderCount")}catch(U){console.error("Rendering Failed --",U),X.metrics.trackError(U)}finally{if(this.__renderDepth--,this.metrics.endRender(),this.metrics.trackMemory(),this.__renderDepth===0)this.__path="",this.__pathCounter=0}return{$log:D,dependencies:Y,events:G}}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.__macros.clear(),this.__i18nDeps.clear(),this.__previous=null,this.state=null,this.input=null,this.context=null,this.$)this.$.each((J,Q)=>{n.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:z,meshPath:q,fragmentPath:Y,fragmentBoundaries:G,argv:X,scope:D,xmlns:M,declaration:F,useAttributes:T}=J;let h,x=[];const u=[],o=(i,y,v)=>{const _=`${Y}.${q||"r"}${v!==void 0?`[${v}]`:""}`,{$log:U,dependencies:w,events:K}=W.__withPath__(_,()=>W.render(_,i,{...D,...y},void 0,M));if(u.push(_),w?.forEach((C,I)=>{if(!W.FGUD?.has(I))W.FGUD.set(I,new Map);C.forEach((S,l)=>{S.partial?.length?S.partial.push(_):S.partial=[_],W.FGUD.get(I)?.set(l,S)})}),W.metrics.inc("partialCount"),v!==void 0){const C=W.__getBoundaries__(_);x[v]={argvalues:y,boundaries:C};let I=n.default(C.start);return I=I.add(U),I=I.add(C.end),I}return U},a=(i,y,v)=>{W.metrics.startRender();const _=v!==void 0?u.filter((U)=>U.endsWith(`r[${v}]`)):u;if(i.forEach((U)=>{const w=W.FGUD.get(U);if(!w)return;w.forEach((K)=>{const C=_.find((I)=>{return K.partial?.find((S)=>I==S||W.__hasSamePathParent__(S,I))});if(!K.partial||!C)return;if(G?.start&&!document.contains(G.start)){console.warn(`${q} -- partial boundaries missing in the DOM`),w.delete(K.path);return}if(K.memo?.[U]&&y?.[U]&&S1(K.memo[U],y[U]))return;if(K.memo={...D,...K.memo,...y},K.batch)W.UQS.queue({dep:U,dependent:K});else{const I=K.update(K.memo,"mesh-partial-updator");if(I)typeof I.memo==="object"&&w.set(K.path,{...K,memo:I.memo}),typeof I.cleanup==="function"&&I.cleanup()}W.metrics.inc("dependencyUpdateCount")}),!w.size&&W.FGUD.delete(U)}),v!==void 0&&x[v])x[v].argvalues=y;W.metrics.inc("partialUpdateCount"),W.metrics.endRender()},r=(i)=>{if(!x[i])return;const y=x[i].boundaries;if(x.splice(i,1),!document.contains(y.start)||!document.contains(y.end)){console.warn(`Partial mesh item<${i}> boundaries missing`);return}const v=[];let _=y.start.nextSibling;while(_&&_!==y.end)v.push(_),_=_.nextSibling;n.default(v).remove(),y.start.remove(),y.end.remove()},s={renderer:{path:q,argv:X,mesh(i,y=!1){if(h=z.contents(),!h?.length)return null;if(F?.iterator){const v=i?.["#"].value;if(!Array.isArray(i?.["#"].value))throw new Error("Invalid iterator argvalues");if(!v.length)return null;let _=n.default();return v.forEach((U,w)=>{if(!h?.length)return null;_=_.add(o(h,U,w))}),_}else return o(h,i)},update(i,y,v){if(!u.length)return;if(v=v||G,F?.iterator){const _=y?.["#"].value;if(!Array.isArray(_))return;if(Array.isArray(x)){if(x.length===_.length){for(let w=0;w<_.length;w++)!S1(x[w].argvalues,_[w])&&a(Object.keys(_[w]),_[w],w);return}const U=Math.min(x.length,_.length);for(let w=0;w<U;w++)a(Object.keys(_[w]),_[w],w);if(_.length>x.length){if(!h?.length)return;for(let w=x.length;w<_.length;w++){const K=o(h,_[w],w);n.default(v.end).before(K)}}else if(_.length<x.length)for(let w=x.length-1;w>=_.length;w--)r(w)}}else a(i,y)}}};if(T&&q){const{attrs:i}=W.__getAttributes__(z);i.literals&&Object.entries(i.literals).forEach(([y,v])=>s[y]=v),i.expressions&&Object.entries(i.expressions).forEach(([y,v])=>{if(t.test(y)){const _=W.__evaluate__(y.replace(t,""),D);if(typeof _!=="object")throw new Error(`Invalid spread operator ${y}`);for(let U in _)s[U]=_[U];Q[`${F?.syntax?F1:""}${q}.${y}`]=v}else s[y]=v?W.__evaluate__(v,D):!0,Q[`${F?.syntax?F1:""}${q}.${y}`]=v})}return s}__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={},z={literals:{},functions:{},expressions:{}};let q=[];return Q&&Object.entries(Q).forEach(([Y,G])=>{if(Y==":dtag")return;if(Y.startsWith(":")||Y.startsWith(U1)||Y.startsWith($1)||t.test(Y)||a1.test(Y))if(a1.test(Y)){const[X,D]=Y.match(a1)||[];q=D.split(",")}else if(Y.startsWith($1))W[Y.replace($1,"")]=G;else if(Y.startsWith(U1))z.functions[Y.replace(U1,"")]=G;else{if(Y.startsWith(":"))Y=Y.slice(1,Y.length);z.expressions[Y]=G||""}else z.literals[Y]=G}),{argv:q,events:W,attrs:z}}__withPath__(J,Q){const W=this.__path;this.__path=J;const z=Q();return this.__path=W,z}__getPathParent__(J){const Q=J.split("/");if(Q.length>1)Q.pop();return Q.join("/")}__hasSamePathParent__(J,Q){return J.startsWith(Q)}__evaluate__(J,Q,W){try{J=J.trim();const z=(q)=>{const Y=this.state.toJSON();if(Q){const G={};for(let M in Q)G[M]=Q[M].value;const X=`with( scope ){ return ${q}; }`;return new Function("self","input","state","static","context","scope",X)(this,this.input,Y,this.static,this.context,G||{})}else{const G=`return ${q}`;return new Function("self","input","state","static","context",G)(this,this.input,Y,this.static,this.context)}};if(/{\s*([^{}]+)\s*}/.test(J)){if(J.startsWith("!{")&&J.endsWith("}"))return z(J.slice(1));return J.replace($0,(q,Y)=>z(Y))}return z(J)}catch(z){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[z,...q]=J.split(/\s*,\s*/),Y;if(z=this.__evaluate__(z,W),typeof z==="function")Y=z;else{if(typeof this[z]!=="function")throw new Error(`Undefined <${z}> handler method`);Y=this[z].bind(this)}if(typeof Y!=="function")throw new Error(`Expected <${z}> to be a function or handler method`);let G=q.map((X)=>this.__evaluate__(X,W));if(Q.length)G=[...G,...Q];return Y(...G)}}__interpolate__(J,Q,W){if(J=J.replace($0,(z,q)=>this.__evaluate__(q,Q)),W)J=this.lips.i18n.translate(J).text;return J}__attachEvent__(J,Q,W,z){J.on(Q,(...q)=>this.__evaluateFunction__(W,q,z)),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((q)=>{const Y=q.replace(/[{}]/g,"").trim();this.__extractExpressionDeps__(Y,Q).forEach((X)=>W.add(X))}),Array.from(W)}__extractExpressionDeps__(J,Q){const W=/\b(state|input|context)(?:\.[a-zA-Z_]\w*)+(?=\[|\.|$|\s|;|,|\))/g,z=/\b(self)(?:\.[a-zA-Z_]\w*)+(?=\()/g;let q=[...Array.from(J.matchAll(W)),...Array.from(J.matchAll(z))];if(Q&&Object.keys(Q).length){const Y=new RegExp(`\\b(${Object.keys(Q).join("|")})`,"g");q=[...q,...Array.from(J.matchAll(Y))]}return[...new Set(q.map((Y)=>Y[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){this.__i18nDeps.set(J.path,J),this.metrics.inc("i18nTrackCount")}__valueDep__(J,Q){return Q.reduce((W,z)=>W?.[z],J)}__shouldUpdate__(J,Q,W,z){if(J==="self")return!0;const q=this.__valueDep__(z[J],Q),Y=this.__valueDep__(W[J],Q);return!S1(q,Y)}__updateDepNodes__(J,Q){if(!this.FGUD?.size)return;this.metrics.inc("componentUpdateCount"),this.metrics.startRender(),this.FGUD.forEach((W,z)=>{const[q,...Y]=z.split(".");if(!this.__shouldUpdate__(q,Y,J,Q))return;W.forEach((G)=>{const{path:X,batch:D,$fragment:M,boundaries:F,update:T,memo:h,syntax:x}=G;try{if(!x&&(F?.start&&!document.contains(F.start))||M!==null&&!M.closest("body").length){W.delete(X);return}if(D)this.UQS.queue({dep:z,dependent:G});else{const u=T(h,"main-updator");if(u)typeof u.memo==="object"&&W.set(X,{...G,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(z)}),this.metrics.endRender()}__updateVarDepNodes__(J,Q,W){if(!this.FGUD?.size)return;this.metrics.inc("partialUpdateCount"),this.metrics.startRender(),this.FGUD.get(J)?.forEach((q,Y)=>{if(!q.haslet||!this.__hasSamePathParent__(Y,this.__getPathParent__(Q)))return;if(q.memo={...q.memo,...W},q.batch)this.UQS.queue({dep:J,dependent:q});else{const G=q.update(q.memo,"var-partial-updator");typeof G?.cleanup==="function"&&G.cleanup()}}),this.metrics.endRender()}__updateI18nDepNodes__(){if(!this.__i18nDeps?.size)return;this.metrics.inc("i18nUpdateCount"),this.metrics.startRender(),this.__i18nDeps?.forEach((J,Q)=>{if(!J.$fragment.closest("body").length){this.__i18nDeps.delete(Q);return}J.update(J.memo,"i18n-partial-updator")}),this.metrics.endRender()}appendTo(J){return(typeof J=="string"?n.default(J):J).append(this.node),this.metrics.inc("domOperations"),this}prependTo(J){return typeof J=="string"?n.default(J):J.prepend(this.node),this.metrics.inc("domOperations"),this}replaceWith(J){return(typeof J=="string"?n.default(J):J).replaceWith(this.node),this.metrics.inc("domOperations"),this}}var _0={};k1(_0,{state:()=>{{return j8}},handler:()=>{{return F8}},default:()=>{{return I8}},declaration:()=>{{return D8}}});var D8={name:"if",syntax:!0,tags:{"else-if":{type:"nexted",many:!0,optional:!0},else:{type:"nexted",optional:!0}}},j8={renderer:null},F8={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}}},I8="<{state.renderer}/>";var b0={};k1(b0,{state:()=>{{return V8}},handler:()=>{{return N8}},default:()=>{{return S8}},declaration:()=>{{return L8}},_static:()=>{{return C8}}});var L8={name:"for",syntax:!0,iterator:!0},V8={argvlist:null},C8={lastIn:null,processingBatch:!1},N8={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 z=Q<W,q=Math.abs(W-Q)+1;if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===q){const[G]=this.input.renderer.argv;if(G){let X=Q,D=!0;for(let M=0;M<this.state.argvlist.length;M++){if(this.state.argvlist[M][G].value!==X){D=!1;break}X=z?X+1:X-1}if(D)return;X=Q;for(let M=0;M<this.state.argvlist.length;M++)this.state.argvlist[M][G].value=X,X=z?X+1:X-1;return}}const Y=[];for(let G=Q;z?G<=W:G>=W;z?G++:G--){const X={},[D]=this.input.renderer.argv;if(D)X[D]={value:G,type:"arg"};Y.push(X)}this.state.argvlist=Y}else if(Array.isArray(J)){if(this.state.argvlist&&this.static.lastIn&&this.input.in===this.static.lastIn)return;if(!J.length){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute array value will not update");this.state.argvlist=[];return}if(this.static.lastIn=J,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===J.length){const[Y,G]=this.input.renderer.argv;for(let X=0;X<J.length;X++){const D=this.state.argvlist[X];if(Y)D[Y].value=J[X]}return}const z=[];let q=0;for(let Y of J){const G={},[X,D]=this.input.renderer.argv;if(X)G[X]={value:Y,type:"arg"};if(D)G[D]={value:q,type:"arg"};z.push(G),q++}this.state.argvlist=z}else if(J instanceof Map){if(this.state.argvlist&&this.static.lastIn&&this.input.in===this.static.lastIn)return;if(!J.size){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute map value will not update");this.state.argvlist=[];return}if(this.static.lastIn=J,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===J.size){const[Y,G,X]=this.input.renderer.argv;let D=0;for(let[M,F]of J){const T=this.state.argvlist[D];if(Y)T[Y].value=M;if(G)T[G].value=F;D++}return}const z=[];let q=0;for(let[Y,G]of J){const X={},[D,M,F]=this.input.renderer.argv;if(D)X[D]={value:Y,type:"arg"};if(M)X[M]={value:G,type:"arg"};if(F)X[F]={value:q,type:"arg"};z.push(X),q++}this.state.argvlist=z}else if(typeof J=="object"){if(this.state.argvlist&&this.static.lastIn&&this.input.in===this.static.lastIn)return;if(!Object.keys(J).length){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute object value will not update");this.state.argvlist=[];return}this.static.lastIn=J;const z=Object.keys(J);if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===z.length){const[G,X,D]=this.input.renderer.argv;for(let M=0;M<z.length;M++){const F=z[M],T=this.state.argvlist[M];if(G)T[G].value=F;if(X)T[X].value=J[F]}return}const q=[];let Y=0;for(let G in J){const X={},[D,M,F]=this.input.renderer.argv;if(D)X[D]={value:G,type:"arg"};if(M)X[M]={value:J[G],type:"arg"};if(F)X[F]={value:Y,type:"arg"};q.push(X),Y++}this.state.argvlist=q}}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:z}of J)if(W>=0&&W<this.state.argvlist.length)this.state.argvlist[W][Q].value=z}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 z=this.state.argvlist[W];if(z[J])z[J].value=typeof Q==="function"?Q(z[J].value,W):Q}}finally{this.static.processingBatch=!1}}},S8="<{input.renderer} #=state.argvlist/>";var x0={};k1(x0,{state:()=>{{return E8}},handler:()=>{{return $8}},default:()=>{{return R8}},declaration:()=>{{return P8}}});var P8={name:"async",syntax:!0,tags:{then:{type:"child"},catch:{type:"child",optional:!0},loading:{type:"child",optional:!0}}},E8={renderer:null,props:{}},$8={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"}}})}},R8="<{state.renderer} #=state.props/>";var g0={};k1(g0,{state:()=>{{return A8}},handler:()=>{{return _8}},default:()=>{{return b8}},declaration:()=>{{return T8}}});var T8={name:"switch",syntax:!0,tags:{case:{type:"child",many:!0},default:{type:"child"}}},A8={renderer:null},_8={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}},b8="<{state.renderer}/>";var h0={};k1(h0,{state:()=>{{return x8}},handler:()=>{{return f8}},default:()=>{{return y8}},context:()=>{{return h8}},_static:()=>{{return g8}}});var k8=function(J){const Q={};return J.split("&").map((z)=>{const[q,Y]=z.split("=");Q[q]=Y}),Q},x8={page:null,params:{},query:{}},g8={global:!1,routes:[],defaultPath:null,currentPath:null,currentRoute:null},h8=["navigate"],f8={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 z=J.match(/:[^\/]*(\/|$)/gi)||[],q=J.replaceAll("/","\\/").replaceAll(/:[^\/]*(\/|$)/gi,"([^\\/]+)(?:\\/|$)");return{path:J,template:Q,default:W,pathVars:z,pathRegex:new RegExp(`${q}\$`,"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 z=W[1]?k8(W[1]):{};let q=null;if(this.static.currentRoute)q={path:this.static.currentRoute.path,params:this.state.params},this.emit("before",{fromState:q,toState:{path:J,query:z}});const Y=this.match(J);if(!Y){this.static.currentRoute=null,this.state.params={},this.state.query={},this.emit("not-found",J);return}const{route:G,params:X}=Y;this.emit("after",{fromState:q,toState:{path:G.path,params:X,query:z}}),this.static.currentPath=J,this.static.currentRoute=G,this.state.params=X,this.state.query=z,this.state.page=G.template},match(J){const Q={};let W=!1;for(let z of this.static.routes){const{pathVars:q,pathRegex:Y}=z,G=J.match(Y);if(G!==null&&G.index===0){for(let X=0;X+1<G.length&&X<q.length;X++)Q[q[X].replaceAll(/[\/:]/g,"")]=G[X+1];W=z;break}}return W?{route:W,params:Q}:!1}},y8="<{state.page} params=state.params query=state.query/>";class R5{debug=!1;stylesheets=[];config={};store={};__root;i18n=new p1;watcher;IUC;__setLang;__getLang;__setContext;__getContext;constructor(J){if(this.config=J,this.config?.debug)this.debug=this.config.debug;this.watcher=new l1,this.IUC=new s1;const[Q,W]=R1(this.i18n.lang),[z,q]=R1(J?.context||{});this.__setLang=W,this.__getLang=Q,this.__setContext=q,this.__getContext=z,this.register("if",_0),this.register("for",b0),this.register("async",x0),this.register("switch",g0),this.register("router",h0)}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:z,...q}=Q,Y={debug:this.debug,prepath:"0",lips:this},G=new u1(J,z||"",{...q,input:W},Y);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(J,Q){if(this.__root=this.render("__ROOT__",J),this.__root.appendTo(Q),this.config?.stylesheets)this.stylesheets=this.config.stylesheets.map((W)=>new h1("root",{sheet:W,meta:!0}));return this.__root}setLanguage(J){this.i18n.lang=J,this.__setLang(J)}getLanguage(){return this.__getLang()}setContext(J,Q){const W=this.__getContext();if(typeof J==="string"){const z={...W,[J]:Q};H1(W,z)&&this.__setContext(z)}else if(!Array.isArray(J)){const z={...W,...J};H1(W,z)&&this.__setContext(z)}else throw new Error("Invalid context data")}getContext(){return this.__getContext()}useContext(J,Q){if(!J.length)return;v1(()=>{const W=this.__getContext();if(!W)return;const z=Object.fromEntries(J.map((q)=>[q,W[q]]));z&&typeof Q==="function"&&Object.keys(z).length&&Q(z)})}useTranslator(J,Q){v1(()=>{const W=this.__getLang();if(!W)return;(J==="*"||Array.isArray(J)&&J.includes(W))&&typeof Q==="function"&&Q(W)})}dispose(){this.watcher?.dispose(),this.__root?.destroy(),this.stylesheets.forEach((J)=>J.clear())}}export{R5 as default};
|
|
1
|
+
var W8=Object.create;var{defineProperty:S0,getPrototypeOf:X8,getOwnPropertyNames:H8}=Object;var z8=Object.prototype.hasOwnProperty;var P0=(J,Q,W)=>{W=J!=null?W8(X8(J)):{};const z=Q||!J||!J.__esModule?S0(W,"default",{value:J,enumerable:!0}):W;for(let q of H8(J))if(!z8.call(z,q))S0(z,q,{get:()=>J[q],enumerable:!0});return z};var q8=(J,Q)=>()=>(Q||J((Q={exports:{}}).exports,Q),Q.exports);var h1=(J,Q)=>{for(var W in Q)S0(J,W,{get:Q[W],enumerable:!0,configurable:!0,set:(z)=>Q[W]=()=>z})};var t1=q8((J5,Z5)=>{(function(){var J=document,Q=window,W=J.documentElement,z=J.createElement.bind(J),q=z("div"),Y=z("table"),G=z("tbody"),X=z("tr"),D=Array.isArray,O=Array.prototype,I=O.concat,T=O.filter,k=O.indexOf,x=O.map,m=O.push,o=O.slice,a=O.some,n=O.splice,s=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,i=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,y=/<.+>/,v=/^\w+$/;function b(Z,H){var B=l(H);return!Z||!B&&!S(H)&&!$(H)?[]:!B&&i.test(Z)?H.getElementsByClassName(Z.slice(1).replace(/\\/g,"")):!B&&v.test(Z)?H.getElementsByTagName(Z):H.querySelectorAll(Z)}var U=function(){function Z(H,B){if(!H)return;if(C(H))return H;var M=H;if(P(H)){var L=B||J;if(M=s.test(H)&&S(L)?L.getElementById(H.slice(1).replace(/\\/g,"")):y.test(H)?m0(H):C(L)?L.find(H):P(L)?K(L).find(H):b(H,L),!M)return}else if(V(H))return this.ready(H);if(M.nodeType||M===Q)M=[M];this.length=M.length;for(var E=0,h=this.length;E<h;E++)this[E]=M[E]}return Z.prototype.init=function(H,B){return new Z(H,B)},Z}(),w=U.prototype,K=w.init;if(K.fn=K.prototype=w,w.length=0,w.splice=n,typeof Symbol==="function")w[Symbol.iterator]=O[Symbol.iterator];function C(Z){return Z instanceof U}function F(Z){return!!Z&&Z===Z.window}function S(Z){return!!Z&&Z.nodeType===9}function l(Z){return!!Z&&Z.nodeType===11}function $(Z){return!!Z&&Z.nodeType===1}function g(Z){return!!Z&&Z.nodeType===3}function f(Z){return typeof Z==="boolean"}function V(Z){return typeof Z==="function"}function P(Z){return typeof Z==="string"}function A(Z){return Z===void 0}function N(Z){return Z===null}function j(Z){return!isNaN(parseFloat(Z))&&isFinite(Z)}function R(Z){if(typeof Z!=="object"||Z===null)return!1;var H=Object.getPrototypeOf(Z);return H===null||H===Object.prototype}K.isWindow=F,K.isFunction=V,K.isArray=D,K.isNumeric=j,K.isPlainObject=R;function _(Z,H,B){if(B){var M=Z.length;while(M--)if(H.call(Z[M],M,Z[M])===!1)return Z}else if(R(Z)){var L=Object.keys(Z);for(var M=0,E=L.length;M<E;M++){var h=L[M];if(H.call(Z[h],h,Z[h])===!1)return Z}}else for(var M=0,E=Z.length;M<E;M++)if(H.call(Z[M],M,Z[M])===!1)return Z;return Z}K.each=_,w.each=function(Z){return _(this,Z)},w.empty=function(){return this.each(function(Z,H){while(H.firstChild)H.removeChild(H.firstChild)})};function c(){var Z=[];for(var H=0;H<arguments.length;H++)Z[H]=arguments[H];var B=f(Z[0])?Z.shift():!1,M=Z.shift(),L=Z.length;if(!M)return{};if(!L)return c(B,K,M);for(var E=0;E<L;E++){var h=Z[E];for(var d in h)if(B&&(D(h[d])||R(h[d]))){if(!M[d]||M[d].constructor!==h[d].constructor)M[d]=new h[d].constructor;c(B,M[d],h[d])}else M[d]=h[d]}return M}K.extend=c,w.extend=function(Z){return c(w,Z)};var p=/\S+/g;function u(Z){return P(Z)?Z.match(p)||[]:[]}w.toggleClass=function(Z,H){var B=u(Z),M=!A(H);return this.each(function(L,E){if(!$(E))return;_(B,function(h,d){if(M)H?E.classList.add(d):E.classList.remove(d);else E.classList.toggle(d)})})},w.addClass=function(Z){return this.toggleClass(Z,!0)},w.removeAttr=function(Z){var H=u(Z);return this.each(function(B,M){if(!$(M))return;_(H,function(L,E){M.removeAttribute(E)})})};function Z1(Z,H){if(!Z)return;if(P(Z)){if(arguments.length<2){if(!this[0]||!$(this[0]))return;var B=this[0].getAttribute(Z);return N(B)?void 0:B}if(A(H))return this;if(N(H))return this.removeAttr(Z);return this.each(function(L,E){if(!$(E))return;E.setAttribute(Z,H)})}for(var M in Z)this.attr(M,Z[M]);return this}w.attr=Z1,w.removeClass=function(Z){if(arguments.length)return this.toggleClass(Z,!1);return this.attr("class","")},w.hasClass=function(Z){return!!Z&&a.call(this,function(H){return $(H)&&H.classList.contains(Z)})},w.get=function(Z){if(A(Z))return o.call(this);return Z=Number(Z),this[Z<0?Z+this.length:Z]},w.eq=function(Z){return K(this.get(Z))},w.first=function(){return this.eq(0)},w.last=function(){return this.eq(-1)};function D1(Z){if(A(Z))return this.get().map(function(H){return $(H)||g(H)?H.textContent:""}).join("");return this.each(function(H,B){if(!$(B))return;B.textContent=Z})}w.text=D1;function Q1(Z,H,B){if(!$(Z))return;var M=Q.getComputedStyle(Z,null);return B?M.getPropertyValue(H)||void 0:M[H]||Z.style[H]}function M1(Z,H){return parseInt(Q1(Z,H),10)||0}function h0(Z,H){return M1(Z,"border".concat(H?"Left":"Top","Width"))+M1(Z,"padding".concat(H?"Left":"Top"))+M1(Z,"padding".concat(H?"Right":"Bottom"))+M1(Z,"border".concat(H?"Right":"Bottom","Width"))}var K0={};function T5(Z){if(K0[Z])return K0[Z];var H=z(Z);J.body.insertBefore(H,null);var B=Q1(H,"display");return J.body.removeChild(H),K0[Z]=B!=="none"?B:"block"}function f0(Z){return Q1(Z,"display")==="none"}function y0(Z,H){var B=Z&&(Z.matches||Z.webkitMatchesSelector||Z.msMatchesSelector);return!!B&&!!H&&B.call(Z,H)}function u1(Z){return P(Z)?function(H,B){return y0(B,Z)}:V(Z)?Z:C(Z)?function(H,B){return Z.is(B)}:!Z?function(){return!1}:function(H,B){return B===Z}}w.filter=function(Z){var H=u1(Z);return K(T.call(this,function(B,M){return H.call(B,M,B)}))};function C1(Z,H){return!H?Z:Z.filter(H)}w.detach=function(Z){return C1(this,Z).each(function(H,B){if(B.parentNode)B.parentNode.removeChild(B)}),this};var A5=/^\s*<(\w+)[^>]*>/,b5=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,v0={"*":q,tr:G,td:X,th:X,thead:Y,tbody:Y,tfoot:Y};function m0(Z){if(!P(Z))return[];if(b5.test(Z))return[z(RegExp.$1)];var H=A5.test(Z)&&RegExp.$1,B=v0[H]||v0["*"];return B.innerHTML=Z,K(B.childNodes).detach().get()}K.parseHTML=m0,w.has=function(Z){var H=P(Z)?function(B,M){return b(Z,M).length}:function(B,M){return M.contains(Z)};return this.filter(H)},w.not=function(Z){var H=u1(Z);return this.filter(function(B,M){return(!P(Z)||$(M))&&!H.call(M,B,M)})};function j1(Z,H,B,M){var L=[],E=V(H),h=M&&u1(M);for(var d=0,w1=Z.length;d<w1;d++)if(E){var W1=H(Z[d]);if(W1.length)m.apply(L,W1)}else{var q1=Z[d][H];while(q1!=null){if(M&&h(-1,q1))break;L.push(q1),q1=B?q1[H]:null}}return L}function u0(Z){if(Z.multiple&&Z.options)return j1(T.call(Z.options,function(H){return H.selected&&!H.disabled&&!H.parentNode.disabled}),"value");return Z.value||""}function _5(Z){if(!arguments.length)return this[0]&&u0(this[0]);return this.each(function(H,B){var M=B.multiple&&B.options;if(M||a0.test(B.type)){var L=D(Z)?x.call(Z,String):N(Z)?[]:[String(Z)];if(M)_(B.options,function(E,h){h.selected=L.indexOf(h.value)>=0},!0);else B.checked=L.indexOf(B.value)>=0}else B.value=A(Z)||N(Z)?"":Z})}w.val=_5,w.is=function(Z){var H=u1(Z);return a.call(this,function(B,M){return H.call(B,M,B)})},K.guid=1;function O1(Z){return Z.length>1?T.call(Z,function(H,B,M){return k.call(M,H)===B}):Z}K.unique=O1,w.add=function(Z,H){return K(O1(this.get().concat(K(Z,H).get())))},w.children=function(Z){return C1(K(O1(j1(this,function(H){return H.children}))),Z)},w.parent=function(Z){return C1(K(O1(j1(this,"parentNode"))),Z)},w.index=function(Z){var H=Z?K(Z)[0]:this[0],B=Z?this:K(H).parent().children();return k.call(B,H)},w.closest=function(Z){var H=this.filter(Z);if(H.length)return H;var B=this.parent();if(!B.length)return H;return B.closest(Z)},w.siblings=function(Z){return C1(K(O1(j1(this,function(H){return K(H).parent().children().not(H)}))),Z)},w.find=function(Z){return K(O1(j1(this,function(H){return b(Z,H)})))};var x5=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,g5=/^$|^module$|\/(java|ecma)script/i,k5=["type","src","nonce","noModule"];function h5(Z,H){var B=K(Z);B.filter("script").add(B.find("script")).each(function(M,L){if(g5.test(L.type)&&W.contains(L)){var E=z("script");E.text=L.textContent.replace(x5,""),_(k5,function(h,d){if(L[d])E[d]=L[d]}),H.head.insertBefore(E,null),H.head.removeChild(E)}})}function f5(Z,H,B,M,L){if(M)Z.insertBefore(H,B?Z.firstChild:null);else if(Z.nodeName==="HTML")Z.parentNode.replaceChild(H,Z);else Z.parentNode.insertBefore(H,B?Z:Z.nextSibling);if(L)h5(H,Z.ownerDocument)}function N1(Z,H,B,M,L,E,h,d){return _(Z,function(w1,W1){_(K(W1),function(q1,E1){_(K(H),function(K1,i1){var L0=B?E1:i1,V0=B?i1:E1,Y1=B?q1:K1;f5(L0,!Y1?V0:V0.cloneNode(!0),M,L,!Y1)},d)},h)},E),H}w.after=function(){return N1(arguments,this,!1,!1,!1,!0,!0)},w.append=function(){return N1(arguments,this,!1,!1,!0)};function y5(Z){if(!arguments.length)return this[0]&&this[0].innerHTML;if(A(Z))return this;var H=/<script[\s>]/.test(Z);return this.each(function(B,M){if(!$(M))return;if(H)K(M).empty().append(Z);else M.innerHTML=Z})}w.html=y5,w.appendTo=function(Z){return N1(arguments,this,!0,!1,!0)},w.wrapInner=function(Z){return this.each(function(H,B){var M=K(B),L=M.contents();L.length?L.wrapAll(Z):M.append(Z)})},w.before=function(){return N1(arguments,this,!1,!0)},w.wrapAll=function(Z){var H=K(Z),B=H[0];while(B.children.length)B=B.firstElementChild;return this.first().before(H),this.appendTo(B)},w.wrap=function(Z){return this.each(function(H,B){var M=K(Z)[0];K(B).wrapAll(!H?M:M.cloneNode(!0))})},w.insertAfter=function(Z){return N1(arguments,this,!0,!1,!1,!1,!1,!0)},w.insertBefore=function(Z){return N1(arguments,this,!0,!0)},w.prepend=function(){return N1(arguments,this,!1,!0,!0,!0,!0)},w.prependTo=function(Z){return N1(arguments,this,!0,!0,!0,!1,!1,!0)},w.contents=function(){return K(O1(j1(this,function(Z){return Z.tagName==="IFRAME"?[Z.contentDocument]:Z.tagName==="TEMPLATE"?Z.content.childNodes:Z.childNodes})))},w.next=function(Z,H,B){return C1(K(O1(j1(this,"nextElementSibling",H,B))),Z)},w.nextAll=function(Z){return this.next(Z,!0)},w.nextUntil=function(Z,H){return this.next(H,!0,Z)},w.parents=function(Z,H){return C1(K(O1(j1(this,"parentElement",!0,H))),Z)},w.parentsUntil=function(Z,H){return this.parents(H,Z)},w.prev=function(Z,H,B){return C1(K(O1(j1(this,"previousElementSibling",H,B))),Z)},w.prevAll=function(Z){return this.prev(Z,!0)},w.prevUntil=function(Z,H){return this.prev(H,!0,Z)},w.map=function(Z){return K(I.apply([],x.call(this,function(H,B){return Z.call(H,B,H)})))},w.clone=function(){return this.map(function(Z,H){return H.cloneNode(!0)})},w.offsetParent=function(){return this.map(function(Z,H){var B=H.offsetParent;while(B&&Q1(B,"position")==="static")B=B.offsetParent;return B||W})},w.slice=function(Z,H){return K(o.call(this,Z,H))};var v5=/-([a-z])/g;function U0(Z){return Z.replace(v5,function(H,B){return B.toUpperCase()})}w.ready=function(Z){var H=function(){return setTimeout(Z,0,K)};if(J.readyState!=="loading")H();else J.addEventListener("DOMContentLoaded",H);return this},w.unwrap=function(){return this.parent().each(function(Z,H){if(H.tagName==="BODY")return;var B=K(H);B.replaceWith(B.children())}),this},w.offset=function(){var Z=this[0];if(!Z)return;var H=Z.getBoundingClientRect();return{top:H.top+Q.pageYOffset,left:H.left+Q.pageXOffset}},w.position=function(){var Z=this[0];if(!Z)return;var H=Q1(Z,"position")==="fixed",B=H?Z.getBoundingClientRect():this.offset();if(!H){var M=Z.ownerDocument,L=Z.offsetParent||M.documentElement;while((L===M.body||L===M.documentElement)&&Q1(L,"position")==="static")L=L.parentNode;if(L!==Z&&$(L)){var E=K(L).offset();B.top-=E.top+M1(L,"borderTopWidth"),B.left-=E.left+M1(L,"borderLeftWidth")}}return{top:B.top-M1(Z,"marginTop"),left:B.left-M1(Z,"marginLeft")}};var d0={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};w.prop=function(Z,H){if(!Z)return;if(P(Z)){if(Z=d0[Z]||Z,arguments.length<2)return this[0]&&this[0][Z];return this.each(function(M,L){L[Z]=H})}for(var B in Z)this.prop(B,Z[B]);return this},w.removeProp=function(Z){return this.each(function(H,B){delete B[d0[Z]||Z]})};var m5=/^--/;function M0(Z){return m5.test(Z)}var O0={},u5=q.style,d5=["webkit","moz","ms"];function i5(Z,H){if(H===void 0)H=M0(Z);if(H)return Z;if(!O0[Z]){var B=U0(Z),M="".concat(B[0].toUpperCase()).concat(B.slice(1)),L="".concat(B," ").concat(d5.join("".concat(M," "))).concat(M).split(" ");_(L,function(E,h){if(h in u5)return O0[Z]=h,!1})}return O0[Z]}var c5={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 i0(Z,H,B){if(B===void 0)B=M0(Z);return!B&&!c5[Z]&&j(H)?"".concat(H,"px"):H}function p5(Z,H){if(P(Z)){var B=M0(Z);if(Z=i5(Z,B),arguments.length<2)return this[0]&&Q1(this[0],Z,B);if(!Z)return this;return H=i0(Z,H,B),this.each(function(L,E){if(!$(E))return;if(B)E.style.setProperty(Z,H);else E.style[Z]=H})}for(var M in Z)this.css(M,Z[M]);return this}w.css=p5;function c0(Z,H){try{return Z(H)}catch(B){return H}}var o5=/^\s+|\s+$/;function p0(Z,H){var B=Z.dataset[H]||Z.dataset[U0(H)];if(o5.test(B))return B;return c0(JSON.parse,B)}function s5(Z,H,B){B=c0(JSON.stringify,B),Z.dataset[U0(H)]=B}function l5(Z,H){if(!Z){if(!this[0])return;var B={};for(var M in this[0].dataset)B[M]=p0(this[0],M);return B}if(P(Z)){if(arguments.length<2)return this[0]&&p0(this[0],Z);if(A(H))return this;return this.each(function(L,E){s5(E,Z,H)})}for(var M in Z)this.data(M,Z[M]);return this}w.data=l5;function o0(Z,H){var B=Z.documentElement;return Math.max(Z.body["scroll".concat(H)],B["scroll".concat(H)],Z.body["offset".concat(H)],B["offset".concat(H)],B["client".concat(H)])}_([!0,!1],function(Z,H){_(["Width","Height"],function(B,M){var L="".concat(H?"outer":"inner").concat(M);w[L]=function(E){if(!this[0])return;if(F(this[0]))return H?this[0]["inner".concat(M)]:this[0].document.documentElement["client".concat(M)];if(S(this[0]))return o0(this[0],M);return this[0]["".concat(H?"offset":"client").concat(M)]+(E&&H?M1(this[0],"margin".concat(B?"Top":"Left"))+M1(this[0],"margin".concat(B?"Bottom":"Right")):0)}})}),_(["Width","Height"],function(Z,H){var B=H.toLowerCase();w[B]=function(M){if(!this[0])return A(M)?void 0:this;if(!arguments.length){if(F(this[0]))return this[0].document.documentElement["client".concat(H)];if(S(this[0]))return o0(this[0],H);return this[0].getBoundingClientRect()[B]-h0(this[0],!Z)}var L=parseInt(M,10);return this.each(function(E,h){if(!$(h))return;var d=Q1(h,"boxSizing");h.style[B]=i0(B,L+(d==="border-box"?h0(h,!Z):0))})}});var s0="___cd";w.toggle=function(Z){return this.each(function(H,B){if(!$(B))return;var M=f0(B),L=A(Z)?M:Z;if(L){if(B.style.display=B[s0]||"",f0(B))B.style.display=T5(B.tagName)}else if(!M)B[s0]=Q1(B,"display"),B.style.display="none"})},w.hide=function(){return this.toggle(!1)},w.show=function(){return this.toggle(!0)};var l0="___ce",D0=".",j0={focus:"focusin",blur:"focusout"},n0={mouseenter:"mouseover",mouseleave:"mouseout"},n5=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function I0(Z){return n0[Z]||j0[Z]||Z}function F0(Z){var H=Z.split(D0);return[H[0],H.slice(1).sort()]}w.trigger=function(Z,H){if(P(Z)){var B=F0(Z),M=B[0],L=B[1],E=I0(M);if(!E)return this;var h=n5.test(E)?"MouseEvents":"HTMLEvents";Z=J.createEvent(h),Z.initEvent(E,!0,!0),Z.namespace=L.join(D0),Z.___ot=M}Z.___td=H;var d=Z.___ot in j0;return this.each(function(w1,W1){if(d&&V(W1[Z.___ot]))W1["___i".concat(Z.type)]=!0,W1[Z.___ot](),W1["___i".concat(Z.type)]=!1;W1.dispatchEvent(Z)})};function r0(Z){return Z[l0]=Z[l0]||{}}function r5(Z,H,B,M,L){var E=r0(Z);E[H]=E[H]||[],E[H].push([B,M,L]),Z.addEventListener(H,L)}function t0(Z,H){return!H||!a.call(H,function(B){return Z.indexOf(B)<0})}function d1(Z,H,B,M,L){var E=r0(Z);if(!H)for(H in E)d1(Z,H,B,M,L);else if(E[H])E[H]=E[H].filter(function(h){var d=h[0],w1=h[1],W1=h[2];if(L&&W1.guid!==L.guid||!t0(d,B)||M&&M!==w1)return!0;Z.removeEventListener(H,W1)})}w.off=function(Z,H,B){var M=this;if(A(Z))this.each(function(E,h){if(!$(h)&&!S(h)&&!F(h))return;d1(h)});else if(!P(Z))for(var L in Z)this.off(L,Z[L]);else{if(V(H))B=H,H="";_(u(Z),function(E,h){var d=F0(h),w1=d[0],W1=d[1],q1=I0(w1);M.each(function(E1,K1){if(!$(K1)&&!S(K1)&&!F(K1))return;d1(K1,q1,W1,H,B)})})}return this},w.remove=function(Z){return C1(this,Z).detach().off(),this},w.replaceWith=function(Z){return this.before(Z).remove()},w.replaceAll=function(Z){return K(Z).replaceWith(this),this};function t5(Z,H,B,M,L){var E=this;if(!P(Z)){for(var h in Z)this.on(h,H,B,Z[h],L);return this}if(!P(H))if(A(H)||N(H))H="";else if(A(B))B=H,H="";else M=B,B=H,H="";if(!V(M))M=B,B=void 0;if(!M)return this;return _(u(Z),function(d,w1){var W1=F0(w1),q1=W1[0],E1=W1[1],K1=I0(q1),i1=q1 in n0,L0=q1 in j0;if(!K1)return;E.each(function(V0,Y1){if(!$(Y1)&&!S(Y1)&&!F(Y1))return;var C0=function(X1){if(X1.target["___i".concat(X1.type)])return X1.stopImmediatePropagation();if(X1.namespace&&!t0(E1,X1.namespace.split(D0)))return;if(!H&&(L0&&(X1.target!==Y1||X1.___ot===K1)||i1&&X1.relatedTarget&&Y1.contains(X1.relatedTarget)))return;var N0=Y1;if(H){var T1=X1.target;while(!y0(T1,H)){if(T1===Y1)return;if(T1=T1.parentNode,!T1)return}N0=T1}Object.defineProperty(X1,"currentTarget",{configurable:!0,get:function(){return N0}}),Object.defineProperty(X1,"delegateTarget",{configurable:!0,get:function(){return Y1}}),Object.defineProperty(X1,"data",{configurable:!0,get:function(){return B}});var Q8=M.call(N0,X1,X1.___td);if(L)d1(Y1,K1,E1,H,C0);if(Q8===!1)X1.preventDefault(),X1.stopPropagation()};C0.guid=M.guid=M.guid||K.guid++,r5(Y1,K1,E1,H,C0)})}),this}w.on=t5;function a5(Z,H,B,M){return this.on(Z,H,B,M,!0)}w.one=a5;var e5=/\r?\n/g;function J8(Z,H){return"&".concat(encodeURIComponent(Z),"=").concat(encodeURIComponent(H.replace(e5,"\r\n")))}var Z8=/file|reset|submit|button|image/i,a0=/radio|checkbox/i;if(w.serialize=function(){var Z="";return this.each(function(H,B){_(B.elements||[B],function(M,L){if(L.disabled||!L.name||L.tagName==="FIELDSET"||Z8.test(L.type)||a0.test(L.type)&&!L.checked)return;var E=u0(L);if(!A(E)){var h=D(E)?E:[E];_(h,function(d,w1){Z+=J8(L.name,w1)})}})}),Z.slice(1)},typeof J5!=="undefined")Z5.exports=K;else Q.cash=Q.$=K})()});var c1=function(J,Q){if(!Q)return J;return J.replace(/{(\w+)}/g,(W,z)=>{return Q[z]!==void 0?Q[z].toString():`{${z}}`})},e0=(J,Q,W,z,q)=>{switch(J){case"plural":{if(typeof W==="string"){console.warn("Plural format value cannot be a string");return}if(z.count===void 0){console.warn("Plural format requires <count> parameter or use * by default.");let X=W["*"];if(typeof X==="object")X=X[q||"*"];return c1(X,z)}if(typeof z.count==="string")z.count=Number(z.count);let Y="*";if(z.count.toString()in W)Y=z.count.toString();let G=W[Y]||W["*"];if(typeof G==="object")G=G[q||"*"];return c1(G,z)}case"condition":{if(typeof W==="string"){console.warn("Condition format value cannot be a string");return}let Y;for(let G in W)try{if(new Function("params",`with( params ){ return ${G}; }`)(z||{})){Y=W[G];break}}catch(X){console.warn(`Invalid <${Q}(${G})> condition expression`)}if(Y===void 0)return;if(typeof Y==="object")Y=Y[q||"*"];return c1(Y,z)}case"variable":default:{const Y=typeof W==="object"?W[q||"*"]:W;if(typeof Y==="object"){console.warn(`Invalid <${Q}> variable variant definition`);return}return c1(Y,z)}}};class p1{currentLang=window.navigator.language;DICTIONARIES={};set lang(J){if(this.currentLang===J)return;this.currentLang=J}get lang(){return this.currentLang}setDictionary(J,Q){this.DICTIONARIES[J]=Q}translate(J,Q){if(Q&&this.currentLang===Q)return{text:J,lang:this.currentLang};Q=Q||this.currentLang;const[W,z]=Q.split("-");if(this.DICTIONARIES[W]&&J in this.DICTIONARIES[W]){if(typeof this.DICTIONARIES[W][J]==="object"){const q=this.DICTIONARIES[W][J];J=q[z||"*"]||q["*"]}else if(typeof this.DICTIONARIES[W][J]==="string")J=this.DICTIONARIES[W][J]}return{text:J,lang:Q}}format(J,Q,W){W=W||this.currentLang;const[z,q]=W.split("-");if(!this.DICTIONARIES[z]){console.warn(`Undefined <${W}> format dictionary`);return}if(!this.DICTIONARIES[z][J]){console.warn(`Undefined <${W}[${J}]> format reference`);return}const Y=this.DICTIONARIES[z][J];if(typeof Y==="string"){console.warn(`Invalid <${W}[${J}]> format reference. Expected object`);return}if(typeof Y!=="object"||Y===null||Array.isArray(Y)){console.warn(`Invalid <${W}[${J}]> format value`);return}return e0(Y.type,J,Y.value,Q,q)}}class o1{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 s1{subscriptions=new Map;tick=new o1;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,z=new WeakMap,q=(G)=>{if(G instanceof Map)G.forEach((D,O)=>G.set(O,Y(D)));else if(Array.isArray(G))G.forEach((D,O)=>G[O]=Y(D));else if(typeof G==="object")Object.entries(G).forEach(([D,O])=>G[D]=Y(O));let X=new Proxy(G,{get(D,O){if(O==="toJSON")return function(){const T=(k)=>{if(!k||typeof k!=="object")return k;if(z.has(k)){const x=z.get(k);if(x instanceof Map){const o={};return x.forEach((a,n)=>o[typeof n==="object"?JSON.stringify(n):String(n)]=T(a)),o}if(Array.isArray(x))return x.map((o)=>T(o));const m={};return Object.entries(x).forEach(([o,a])=>m[o]=T(a)),m}if(typeof k.toJSON==="function"&&!z.has(k))return k.toJSON();return k};return T(X)};if(O==="reset")return function(){X=null};const I=D[O];if(G instanceof Map&&typeof I==="function")return function(...T){const k=O.toString();if(k==="set"&&T.length>=2)T[1]=Y(T[1]);const x=I.apply(D,T);return["set","delete","clear"].includes(k)&&W.queueUpdate(J),x};if(Array.isArray(G)&&typeof I==="function")return function(...T){const k=O.toString();if(["push","unshift"].includes(k))T=T.map((m)=>Y(m));else if(k==="splice"&&T.length>2)T=[T[0],T[1],...T.slice(2).map((m)=>Y(m))];const x=I.apply(D,T);return["push","pop","shift","unshift","splice","sort","reverse","fill"].includes(k)&&W.queueUpdate(J),x};return I},set(D,O,I){if(D[O]===I)return!0;if(I instanceof Map&&D[O]instanceof Map){const T=D[O];return T.clear(),I.forEach((k,x)=>T.set(x,Y(k))),W.queueUpdate(J),!0}return D[O]=Y(I),W.queueUpdate(J),!0}});return z.set(X,G),X},Y=(G)=>{if(!G)return G;return G instanceof Map||Array.isArray(G)||typeof G==="object"?q(G):G};return q(Q)}}class l1{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"),typeof Q.onAttach=="function"&&Q.onAttach.bind(Q)();else if(J.type==="detach"&&!document.contains(W[0]))this.unwatch(Q),Q.emit("component:detached"),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"),typeof J.onAttach=="function"&&J.onAttach.bind(J)();return}if(Q==="detach"&&!document.contains(W[0])){J.emit("component:detached"),typeof J.onDetach=="function"&&J.onDetach.bind(J)();return}this.unwatch(J);const z=setTimeout(()=>{this.unwatch(J),J.emit(`component:${Q}ment-timeout`)},this.TIMEOUT);this.observedComponents.set(J,{timeout:z,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 n1{pending=new Map;isPending=!1;component;metrics={batchCount:0,updatesProcessed:0,lastBatchSize:0,avgBatchSize:"0.00"};constructor(J){this.component=J}queue(J){if(this.pending.set(J.dependent.path,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.values());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 z=W.update(W.memo,"batch-updator");if(z)typeof z.memo==="object"&&this.component.FGUD.get(Q)?.set(W.path,{...W,memo:z.memo}),typeof z.cleanup==="function"&&z.cleanup()}catch(z){console.error("Failed to update dependency --",z)}})}getMetrics(){return{batchCount:this.metrics.batchCount,lastBatchSize:this.metrics.lastBatchSize,avgBatchSize:this.metrics.avgBatchSize,totalUpdates:this.metrics.updatesProcessed}}}class r1{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)=>{if(typeof q.toJSON==="function")return q.toJSON();if(Array.isArray(q))return q.map(W);if(typeof q==="object")for(let Y in q)q[Y]=W(q[Y]);return q},z=Q.map(W);this.__events[J]?.forEach((q)=>q(...z)),this.__once_events[J]?.forEach((q)=>q(...z)),delete this.__once_events[J]}}var E0=P0(t1(),1);function H1(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(Q5(J)&&Q5(Q)){for(let G of J)if(!Q.has(G))return!0;return!1}const Y=new WeakMap;for(let G of J){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(!Y.has(G))Y.set(G,new WeakMap);const O=Y.get(G);if(O.has(D)){if(X=O.get(D),X)break;continue}const I=!H1(G,D);if(O.set(D,I),I){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(W5(J)&&W5(Q)){for(let[G,X]of J)if(Q.get(G)!==X)return!0;return!1}const Y=new WeakMap;for(let[G,X]of J){if(typeof G!=="object"){if(!Q.has(G))return!0;const I=Q.get(G);if(typeof X!=="object"){if(X!==I)return!0;continue}if(typeof I!=="object"||H1(X,I))return!0;continue}let D=!1,O=!1;for(let[I,T]of Q){if(typeof I!=="object")continue;if(!Y.has(G))Y.set(G,new WeakMap);const k=Y.get(G);if(k.has(I)){const[x,m]=k.get(I);if(x){D=!0,O=m;break}continue}if(!H1(G,I)){if(D=!0,O=typeof X==="object"&&typeof T==="object"?!H1(X,T):X===T,k.set(I,[!0,O]),O)break}else k.set(I,[!1,!1])}if(!D||!O)return!0}return!1}if(Array.isArray(J)){if(!Array.isArray(Q))return!0;if(J.length!==Q.length)return!0;for(let Y=0;Y<J.length;Y++){const G=J[Y],X=Q[Y];if(G!==X&&(typeof G!=="object"||H1(G,X)))return!0}return!1}const W=Object.keys(J),z=Object.keys(Q);if(W.length!==z.length)return!0;W.sort(),z.sort();const q=W.length;for(let Y=0;Y<q;Y++)if(W[Y]!==z[Y])return!0;for(let Y=0;Y<q;Y++){const G=W[Y],X=J[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)||H1(X,D))return!0;continue}if(X instanceof Set){if(!(D instanceof Set)||H1(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===J){if(D!==Q)return!0}else if(H1(X,D))return!0}else return!0}return!1}function S1(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),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(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!H1(J,Q);const q=Object.getPrototypeOf(J);if(q!==Object.getPrototypeOf(Q))return!1;const Y=Object.getOwnPropertyNames(J),G=Object.getOwnPropertyNames(Q);if(Y.length!==G.length)return!1;for(let X of Y){if(!Object.prototype.hasOwnProperty.call(Q,X))return!1;if(!S1(J[X],Q[X]))return!1}if(q!==null&&q!==Object.prototype){const X=Object.getOwnPropertyNames(q),D=Object.getOwnPropertyNames(Object.getPrototypeOf(Q));if(X.length!==D.length)return!1;for(let O of X){if(O==="constructor")continue;if(!S1(q[O],Object.getPrototypeOf(Q)[O]))return!1}}return!0}function Q5(J){for(let Q of J)if(typeof Q==="object"&&Q!==null)return!1;return!0}function W5(J){for(let[Q,W]of J)if(typeof Q==="object"&&Q!==null||typeof W==="object"&&W!==null)return!1;return!0}function e(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 q=new Map;return Q.set(J,q),J.forEach((Y,G)=>q.set(e(G,Q),e(Y,Q))),q}if(J instanceof Set){const q=new Set;return Q.set(J,q),J.forEach((Y)=>q.add(e(Y,Q))),q}if(Array.isArray(J)){const q=[];Q.set(J,q);for(let Y=0;Y<J.length;Y++)q[Y]=e(J[Y],Q);return q}if(ArrayBuffer.isView(J))return new J.constructor(J);const W=Object.create(Object.getPrototypeOf(J));Q.set(J,W);const z=Object.getOwnPropertySymbols(J);for(let q of z)W[q]=e(J[q],Q);for(let q in J)if(Object.prototype.hasOwnProperty.call(J,q))W[q]=e(J[q],Q);return W}function H5(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(q,Y,G){const X=Y.split(/\.|\[|\]/).filter(Boolean);let D=q;for(let O=0;O<X.length;O++){const I=X[O],T=!isNaN(Number(I)),k=O===X.length-1,x=!isNaN(Number(X[O+1]));if(k){D[I]=G;continue}if(!(I in D))D[I]=x?[]:{};else if(x&&!Array.isArray(D[I]))D[I]=[];else if(!x&&Array.isArray(D[I]))D[I]={};D=D[I]}}const z=e(J);try{for(let[q,Y]of Object.entries(Q)){if(typeof q!=="string")throw new TypeError(`Invalid path: ${q}`);if(!/^[a-zA-Z0-9_\-\[\].]+$/.test(q))throw new Error(`Invalid path format: ${q}`);W(z,q,Y)}}catch(q){throw new Error(`Failed to assign value: ${q.message}`)}return z}var P1="i18n",I1="syn:",U1="fn:",$1="on-",t=/^\.\.\./,a1=/^\[(.*?)\]$/,$0=/{\s*([^{}]+)\s*}/g,X5=["@html","@text","@format"];E0.default.fn.extend({attrs:function(){const J={},Q=this[0];return Q&&Q.nodeType!==Node.TEXT_NODE&&E0.default.each(Q.attributes,function(){J[this.name]=this.value}),J}});class e1{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,i18nTrackCount:0,i18nUpdateCount: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=e(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},z={"DOM Operations":this.stats.domOperations,"DOM Inserts":this.stats.domInsertsCount,"DOM Updates":this.stats.domUpdatesCount,"DOM Removals":this.stats.domRemovalsCount},q={"i18n Tracked":this.stats.i18nTrackCount,"i18n Updates":this.stats.i18nUpdateCount},Y={"Dependencies Tracked":this.stats.dependencyTrackCount,"Dependency Updates":this.stats.dependencyUpdateCount},G={"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(z),console.table(q),console.table(Y),console.table(G),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 e(this.stats)}dispose(){if(!this.debug)return;this.autoSaveInterval&&clearInterval(this.autoSaveInterval)}}var r=P0(t1(),1);var P5=P0(t1(),1);var J0="comm",Z0="rule",Q0="decl";var z5="@import";var q5="@namespace",Y5="@keyframes";var B5="@layer";function W0(J){return J.trim()}function A1(J,Q,W){return J.replace(Q,W)}function G5(J,Q,W){return J.indexOf(Q,W)}function F1(J,Q){return J.charCodeAt(Q)|0}function L1(J,Q,W){return J.slice(Q,W)}function z1(J){return J.length}function X0(J){return J.length}function b1(J,Q){return Q.push(J),J}var R0=Math.abs,f1=String.fromCharCode;function z0(J,Q,W,z,q,Y,G,X){return{value:J,root:Q,parent:W,type:z,props:q,children:Y,line:H0,column:_1,length:G,return:"",siblings:X}}function K5(){return J1}function U5(){if(J1=B1>0?F1(g1,--B1):0,_1--,J1===10)_1=1,H0--;return J1}function G1(){if(J1=B1<w5?F1(g1,B1++):0,_1++,J1===10)_1=1,H0++;return J1}function V1(){return F1(g1,B1)}function y1(){return B1}function q0(J,Q){return L1(g1,J,Q)}function x1(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 M5(J){return H0=_1=1,w5=z1(g1=J),B1=0,[]}function O5(J){return g1="",J}function Y0(J){return W0(q0(B1-1,T0(J===91?J+2:J===40?J+1:J)))}function D5(J){while(J1=V1())if(J1<33)G1();else break;return x1(J)>2||x1(J1)>3?"":" "}function j5(J,Q){while(--Q&&G1())if(J1<48||J1>102||J1>57&&J1<65||J1>70&&J1<97)break;return q0(J,y1()+(Q<6&&V1()==32&&G1()==32))}function T0(J){while(G1())switch(J1){case J:return B1;case 34:case 39:if(J!==34&&J!==39)T0(J1);break;case 40:if(J===41)T0(J);break;case 92:G1();break}return B1}function I5(J,Q){while(G1())if(J+J1===57)break;else if(J+J1===84&&V1()===47)break;return"/*"+q0(Q,B1-1)+"*"+f1(J===47?J:G1())}function F5(J){while(!x1(V1()))G1();return q0(J,B1)}var H0=1,_1=1,w5=0,B1=0,J1=0,g1="";function C5(J){return O5(B0("",null,null,null,[""],J=M5(J),0,[0],J))}function B0(J,Q,W,z,q,Y,G,X,D){var O=0,I=0,T=G,k=0,x=0,m=0,o=1,a=1,n=1,s=0,i="",y=q,v=Y,b=z,U=i;while(a)switch(m=s,s=G1()){case 40:if(m!=108&&F1(U,T-1)==58){if(G5(U+=A1(Y0(s),"&","&\f"),"&\f",R0(O?X[O-1]:0))!=-1)n=-1;break}case 34:case 39:case 91:U+=Y0(s);break;case 9:case 10:case 13:case 32:U+=D5(m);break;case 92:U+=j5(y1()-1,7);continue;case 47:switch(V1()){case 42:case 47:if(b1(B8(I5(G1(),y1()),Q,W,D),D),(x1(m||1)==5||x1(V1()||1)==5)&&z1(U)&&L1(U,-1,void 0)!==" ")U+=" ";break;default:U+="/"}break;case 123*o:X[O++]=z1(U)*n;case 125*o:case 59:case 0:switch(s){case 0:case 125:a=0;case 59+I:if(n==-1)U=A1(U,/\f/g,"");if(x>0&&(z1(U)-T||o===0&&m===47))b1(x>32?V5(U+";",z,W,T-1,D):V5(A1(U," ","")+";",z,W,T-2,D),D);break;case 59:U+=";";default:if(b1(b=L5(U,Q,W,O,I,q,X,i,y=[],v=[],T,Y),Y),s===123)if(I===0)B0(U,Q,b,b,y,Y,T,X,v);else{switch(k){case 99:if(F1(U,3)===110)break;case 108:if(F1(U,2)===97)break;default:I=0;case 100:case 109:case 115:}if(I)B0(J,b,b,z&&b1(L5(J,b,b,0,0,q,X,i,q,y=[],T,v),v),q,v,T,X,z?y:v);else B0(U,b,b,b,[""],v,0,X,v)}}O=I=x=0,o=n=1,i=U="",T=G;break;case 58:T=1+z1(U),x=m;default:if(o<1){if(s==123)--o;else if(s==125&&o++==0&&U5()==125)continue}switch(U+=f1(s),s*o){case 38:n=I>0?1:(U+="\f",-1);break;case 44:X[O++]=(z1(U)-1)*n,n=1;break;case 64:if(V1()===45)U+=Y0(G1());k=V1(),I=T=z1(i=U+=F5(y1())),s++;break;case 45:if(m===45&&z1(U)==2)o=0}}return Y}function L5(J,Q,W,z,q,Y,G,X,D,O,I,T){var k=q-1,x=q===0?Y:[""],m=X0(x);for(var o=0,a=0,n=0;o<z;++o)for(var s=0,i=L1(J,k+1,k=R0(a=G[o])),y=J;s<m;++s)if(y=W0(a>0?x[s]+" "+i:A1(i,/&\f/g,x[s])))D[n++]=y;return z0(J,Q,W,q===0?Z0:X,D,O,I,T)}function B8(J,Q,W,z){return z0(J,Q,W,J0,f1(K5()),L1(J,2,-2),0,z)}function V5(J,Q,W,z,q){return z0(J,Q,W,Q0,L1(J,0,z),L1(J,z+1,-1),z,q)}function G0(J,Q){var W="";for(var z=0;z<J.length;z++)W+=Q(J[z],z,J,Q)||"";return W}function N5(J,Q,W,z){switch(J.type){case B5:if(J.children.length)break;case z5:case q5:case Q0:return J.return=J.return||J.value;case J0:return"";case Y5:return J.return=J.value+"{"+G0(J.children,z)+"}";case Z0:if(!z1(J.value=J.props.join(",")))return""}return z1(W=G0(J.children,z))?J.return=J.value+"{"+W+"}":""}function S5(J){var Q=X0(J);return function(W,z,q,Y){var G="";for(var X=0;X<Q;X++)G+=J[X](W,z,q,Y)||"";return G}}class k1{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=P5.default("head"),this.settings=Q||{},this.settings&&this.load(this.settings)}compile(J){try{return G0(C5(J),S5([N5]))}catch(Q){throw new Error(`Style compilation failed: ${Q.message}`)}}waitForStyles(J){return new Promise((Q)=>{const W=new MutationObserver(()=>{const z=document.querySelector(J);if(z&&getComputedStyle(z).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 z=document.createElement("style");z.setAttribute("rel",`${this.settings.meta?"@":""}${this.nsp}`),z.textContent=W;let q=0;const Y=this.$head.find(`style[${Q}]`);if(Y.length)q=parseInt(Y.attr("dindex"))+1,Y.remove();return z.setAttribute("dindex",String(q)),this.settings.meta?document.head.prepend(z):document.head.appendChild(z),z}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 G8=function(J){const Q=/on-([a-zA-Z-]+)\s*\(/g;let W=J,z;while((z=Q.exec(J))!==null){const q=z[1],Y=z.index+z[0].length;let G=1,X=Y;while(X<J.length&&G>0){if(J[X]==="(")G++;if(J[X]===")")G--;X++}if(G===0){const D=J.slice(Y,X-1).trim(),O=J.slice(0,z.index),I=`${$1}${q}="${D}"`,T=J.slice(X);W=O+I+T,J=W,Q.lastIndex=O.length+I.length}}return W},w8=function(J){const Q=[];let z=J.replace(/<([a-zA-Z][a-zA-Z0-9_-]*)((?:[^>'"]*|'[^']*'|"[^"]*")*?)(?:\/?>)/g,(q,Y,G)=>{return Q.push(G),`<${Y}##TAG_ATTRS_${Q.length-1}##>`});for(let q=0;q<Q.length;q++){const Y=`##TAG_ATTRS_${q}##`,G=Q[q],X=K8(G);z=z.replace(Y,X)}return z},K8=function(J){let Q="",W=0,z=!1,q="",Y=0,G=0,X=0;while(W<J.length){const D=J[W];if((D==='"'||D==="'")&&(W===0||J[W-1]!=="\\")){if(!z)z=!0,q=D;else if(D===q)z=!1}if(!z){if(D==="(")G++;else if(D===")")G--;else if(D==="{")X++;else if(D==="}")X--}if(!z&&G===0&&X===0&&(D===" "||W===J.length-1)){let O=W;if(W===J.length-1)O=W+1;const I=J.substring(Y,O).trim();if(I){const T=U8(I);Q+=" "+T}Y=W+1}W++}return Q},U8=function(J){const Q=J.indexOf("=");if(Q===-1){if(J===P1||J.startsWith("...")||J.startsWith("["))return J;return`:${J}="${!J.startsWith("!")}"`}let W=J.substring(0,Q).trim(),z=J.substring(Q+1).trim();if(W.startsWith("@"))return W=!X5.includes(W)?W.slice(1):W,`:${W}=${z}`;if(W.startsWith(U1)||W.startsWith($1))return J;if(z.startsWith('"')&&z.endsWith('"')||z.startsWith("'")&&z.endsWith("'")){const q=z.substring(1,z.length-1);if(M8(q))return`:${W}="${q}"`;return J}else return`:${W}="${z}"`};function M8(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 A0(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,z,q)=>{return q.endsWith("<")?`<lips dtag="${z}" ${q}/lips>`:`<lips dtag="${z}" ${q}></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 ${U1}await="\$1">`).replace(/<log\(\s*(.*?)\s*\)>/g,'<log @args="$1">').replace(/\[(.*?)\]/g,(W)=>W.replace(/\s+/g,""));return Q=G8(Q),Q=w8(Q),Q}var O8=function(J,Q){if(J.isDisposed)return;Q.add(J),J.dependencies.add(Q)},$5=function(J){for(let Q of J.dependencies)Q.delete(J);J.dependencies.clear()};function R1(J,Q={maxSize:100}){const W=new Set,z=[{value:J,timestamp:Date.now()}];let q=0;const Y=()=>{const O=w0[w0.length-1];return O&&O8(O,W),z[q].value},G=()=>{const O=[...W];if(E5)for(let I of O)E5.add(I);else for(let I of O)I.execute()};return[Y,(O,I)=>{if(Object.is(z[q].value,O))return;if(q<z.length-1)z.splice(q+1);if(z.push({value:O,timestamp:Date.now(),metadata:I}),z.length>Q.maxSize)z.shift(),q=Math.max(0,q-1);else q++;G()},{undo(){if(q>0)q--,G()},redo(){if(q<z.length-1)q++,G()},jumpTo(O){if(O>=0&&O<z.length&&O!==q)q=O,G()},getHistory(){return[...z]},getCurrentIndex(){return q},canUndo(){return q>0},canRedo(){return q<z.length-1},clear(){const O=z[0];z.length=0,z.push(O),q=0,G()}}]}function v1(J){let Q=!1;const W=()=>{if(Q)throw new Error("Circular dependency detected");if(z.isDisposed)return;Q=!0,$5(z),w0.push(z);try{J()}finally{Q=!1,w0.pop()}},z={execute:W,dependencies:new Set,isDisposed:!1};return W(),{dispose:()=>{z.isDisposed=!0,$5(z)}}}var w0=[],E5=null;class m1 extends r1{declaration;$=null;input;state;static;context;__name__;__path__;__lang__;__template__;__previous;__macros=new Map;__i18nDeps=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:z,context:q,_static:Y,handler:G,stylesheet:X,macros:D,declaration:O},I){super();if(this.lips=I.lips,I?.debug)this.debug=I.debug||this.lips.debug;if(I?.prepath)this.prepath=I.prepath;if(this.__name__=J,this.__lang__=this.lips.i18n.lang,this.__path__=`${this.prepath}/${this.__name__}`,this.__template__=A0(Q),this.declaration=O||{name:J},this.input=W||{},this.static=Y||{},this.context={},this.state=this.lips.IUC.proxyState(this.__path__,z||{}),D&&this.setMacros(D),G&&this.setHandler(G),X&&this.setStylesheet(X),this.metrics=new e1(this.debug),this.metrics.inc("componentCount"),this.UQS=new n1(this),typeof this.onCreate=="function"&&this.onCreate.bind(this)(),this.emit("component:create"),this.input&&Object.keys(this.input).length&&typeof this.onInput=="function")this.onInput.bind(this)(this.input),this.emit("component:input");this.__previous={input:e(this.input),state:e(this.state),context:e(this.context)};const[T,k]=R1(this.input),[x,m]=R1(this.state),[o,a]=R1(this.context);this.__setInput=k,this.__setState=m,this.__getState=x,this.lips.IUC.register(this.__path__,()=>{H1(this.__previous?.state,this.state)&&this.__setState({...this.__getState(),...this.state})}),Array.isArray(q)&&q.length&&this.lips.useContext(q,(n)=>{if(!H1(this.context,n))return;a(n),this.context=n,typeof this.onContext=="function"&&this.onContext.bind(this)(),this.emit("component:context")}),this.lips.useTranslator("*",(n)=>{if(n===this.__lang__)return;this.__updateI18nDepNodes__(),this.__lang__=n}),this.ICE=v1(()=>{const n=T(),s=x(),i=this.context=o();if(!this.isRendered){this.metrics.reset();const{$log:y}=this.render("",void 0,void 0,this.FGUD);this.$=y,!O?.syntax&&this.$?.each((v,b)=>{typeof b.setAttribute=="function"&&b.setAttribute("rel",this.__name__)}),this.isRendered=!0,typeof this.onMount=="function"&&this.onMount.bind(this)(),this.emit("component:mount"),this.lips.watcher.watch(this)}else this.__updateDepNodes__({state:s,input:n,context:i},this.__previous),typeof this.onUpdate=="function"&&this.onUpdate.bind(this)(),this.emit("component:update"),this.__previous={input:e(n),state:e(s),context:e(i)},this.input=n;this.metrics.log(),typeof this.onRender=="function"&&this.onRender.bind(this)(),this.emit("component:render")})}setContext(J,Q){this.lips.setContext(J,Q)}setInput(J){if(!H1(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(H5(this.input,J)),this}setMacros(J){const Q=A0(J),W=r.default(Q);if(!W.length)return;const z=this;W.each(function(){const q=r.default(this),{argv:Y,attrs:G}=z.__getAttributes__(q);if(!Object.keys(G))throw new Error("Invalid macro component definition");if(!G.literals.name)throw new Error("Undefined macro `name` attribute.");if(z.__macros.get(G.literals.name))console.warn(`Duplicate macro <${G.literals.name}> will be override`);if(!q.contents()?.length)throw new Error("Invalid macro component definition. Template content expected.");z.__macros.set(G.literals.name,{argv:Y,$node:q})})}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 k1(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={},z,q){const Y=z||new Map,G=[];if(Q&&!Q.length)return console.warn("Undefined node element to render"),{$log:Q,dependencies:Y};this.metrics.startRender();const X=this;let D=r.default();function O(U){const w=I(U);return X.__pathCounter++,X.__path?`${X.__path}/${w}`:`${J?J+"/":"#"}${w}`}function I(U){return(U==="component"?"c":"")+X.__pathCounter}function T(U){return U!==null&&typeof U==="object"&&typeof U.mesh==="function"&&typeof U.update==="function"}function k(U){return U!==null&&typeof U==="object"&&typeof U.default&&typeof U.default==="string"}function x(U){if(!U.attr(":dtag")||U.prop("tagName")!=="LIPS")throw new Error("Invalid dynamic tag name");const w=U.attr(":dtag"),K=X.__evaluate__(w,W);if(T(K)||K===null)return n(U,w,K);else if(k(K))return s(U,{template:K});else return s(U,{name:K})}function m(U){const w=U.attr(":args"),K=O("log");if(!w)return;if(X.__evaluate__(`console.log(${w})`,W),X.__isReactive__(w,W))X.__extractExpressionDeps__(w,W).forEach((F)=>X.__trackDep__(Y,F,{nodetype:"log",target:"argument",$fragment:null,path:K,update:(S)=>X.__evaluate__(`console.log(${w})`,S),memo:W,batch:!0}))}function o(U){const w=O("var"),{attrs:K}=X.__getAttributes__(U);if(!K)return;Object.entries(K.literals).forEach(([C,F])=>{if(W[C]&&W[C].type==="const")throw new Error(`Cannot override <const ${C}=[value]/> variable`);W[C]={value:F,type:"let"}}),Object.entries(K.expressions).forEach(([C,F])=>{if(t.test(C)){const S=($,g)=>{const f=X.__evaluate__(C.replace(t,""),g||W);if(typeof f!=="object")throw new Error(`Invalid spread operator ${C}`);for(let V in f){if(W[V]&&W[V].type==="const")throw new Error(`Cannot override <const ${V}=[value]/> variable`);if(W[V]={value:f[V],type:"let"},g)g[V]=W[V],X.__updateVarDepNodes__(V,w,g)}if($)return{memo:g}};X.__extractExpressionDeps__(C,W).forEach(($)=>X.__trackDep__(Y,$,{nodetype:"let",target:"spread-attr",$fragment:null,path:`${w}.${C}`,update:(g)=>S(!0,g),memo:W,batch:!0})),S()}else if(F){if(X.__isReactive__(F,W)){const S=X.__extractExpressionDeps__(F,W),l=($,g)=>{if(W[C]&&W[C].type==="const")throw new Error(`Cannot override <const ${C}=[value]/> variable`);return $[C]=W[C]={value:X.__evaluate__(F,$),type:"let"},X.__updateVarDepNodes__(C,w,$),{memo:$}};S.forEach(($)=>X.__trackDep__(Y,$,{nodetype:"let",target:"attr",$fragment:null,path:`${w}.${C}`,update:l,memo:W,batch:!0}))}if(W[C]&&W[C].type==="const")throw new Error(`Cannot override <const ${C}=[value]/> variable`);W[C]={value:X.__evaluate__(F,W),type:"let"}}}),X.metrics.inc("elementCount")}function a(U){const{attrs:w}=X.__getAttributes__(U);if(!w)return;Object.entries(w.literals).forEach(([K,C])=>{if(W[K]&&W[K].type==="const")throw new Error(`<const ${K}=[value]/> variable already defined`);if(!C)return;W[K]={value:C,type:"const"}}),Object.entries(w.expressions).forEach(([K,C])=>{if(t.test(K)){const F=X.__evaluate__(K.replace(t,""),W);if(typeof F!=="object")throw new Error(`Invalid spread operator ${K}`);for(let S in F){if(W[S]&&W[S].type==="const")throw new Error(`<const ${S}=[value]/> by spread operator ${K}. [${S}] variable already defined`);W[S]={value:F[S],type:"const"}}}else{if(W[K]&&W[K].type==="const")throw new Error(`<const ${K}=[value]/> variable already defined`);if(!C)return;W[K]={value:X.__evaluate__(C,W),type:"const"}}}),X.metrics.inc("elementCount")}function n(U,w,K){const{attrs:C}=X.__getAttributes__(U),F=O("element"),S=X.__getBoundaries__(F);let l=r.default(S.start),$={},g=K;if(g){C.literals&&Object.entries(C.literals).forEach(([V,P])=>$[V]={type:"arg",value:P}),C.expressions&&Object.entries(C.expressions).forEach(([V,P])=>{if(!g)return;if(t.test(V)){const A=X.__evaluate__(V.replace(t,""),W);if(typeof A!=="object")throw new Error(`Invalid spread operator ${V}`);for(let N in A){if(N!=="#"&&!g.argv.includes(N))continue;$[N]={type:"arg",value:A[N]}}}else{if(V!=="#"&&!g.argv.includes(V))return;$[V]={type:"arg",value:P?X.__evaluate__(P,W):!0}}});const f=g.mesh($);if(f&&f.length)l=l.add(f);C.expressions&&Object.entries(C.expressions).forEach(([V,P])=>{if(!g)return;if(t.test(V)&&X.__isReactive__(V,W)){const A=X.__extractExpressionDeps__(V,W),N=(j,R)=>{if(!g)return;const _={},c=X.__evaluate__(V.replace(t,""),j);if(typeof c!=="object")throw new Error(`Invalid spread operator ${V}`);const p=[];for(let u in c){if(u!=="#"&&!g.argv.includes(u))continue;$[u]=_[u]={type:"arg",value:c[u]},(!j[u]||!S1(c[u],j[u].value))&&p.push(u)}p.length&&g.update(p,_,S)};A.forEach((j)=>X.__trackDep__(Y,j,{nodetype:"dynamic",target:"spread-attr",$fragment:null,boundaries:S,path:`${F}.${V}`,update:N,memo:W,batch:!0}))}else if((V==="#"||g.argv.includes(V))&&X.__isReactive__(P,W)){const A=X.__extractExpressionDeps__(P,W),N=(j,R)=>{if(!g)return;const _=$[V]={type:"arg",value:P?X.__evaluate__(P,j):!0};g.update([V],{[V]:_},S)};A.forEach((j)=>X.__trackDep__(Y,j,{nodetype:"dynamic",target:"attr",$fragment:null,boundaries:S,path:`${F}.${V}`,update:N,memo:W,batch:!0}))}})}if(X.__isReactive__(w,W)){const f=(P,A)=>{const N=X.__evaluate__(w,P);let j;if(k(N))j=s(U,{template:N});else if(T(N))$="#"in $?{...P,...$["#"].value}:{...P,...$},g=N,j=g?g.mesh($):null;if(!document.contains(S.start)||!document.contains(S.end))return;const R=[];let _=S.start.nextSibling;while(_&&_!==S.end)R.push(_),_=_.nextSibling;r.default(R).remove(),j&&r.default(S.start).after(j)};X.__extractExpressionDeps__(w,W).forEach((P)=>X.__trackDep__(Y,P,{nodetype:"dynamic",target:"dtag",$fragment:null,boundaries:S,path:F,update:f,batch:!0,memo:{...W,...$}}))}return l=l.add(S.end),l}function s(U,w){let K,C;if(w?.template)K=w.template,C=I("component");else{if(C=w?.name||U.prop("tagName")?.toLowerCase(),!C)throw new Error("Invalid component");if(C===X.__name__)throw new Error("Render component within itself is forbidden");K=X.lips.import(C)}if(!K||!C)throw new Error(`<${C}> template not found`);const F=O("component"),S=X.__getBoundaries__(F),{argv:l,attrs:$,events:g}=X.__getAttributes__(U),f={};let V={},P=r.default(S.start),A=X.PCC.get(F);$.literals&&Object.entries($.literals).forEach(([j,R])=>{if(j=="key")return;V[j]=R}),$.functions&&Object.entries($.functions).forEach(([j,R])=>{V[j]=X.__evaluateFunction__(R,[],W),K.declaration?.syntax?f[I1+U1+j]=R:f[U1+j]=R}),$.expressions&&Object.entries($.expressions).forEach(([j,R])=>{if(j=="key")return;if(t.test(j)){const _=X.__evaluate__(j.replace(t,""),W);if(typeof _!=="object")throw new Error(`Invalid spread operator ${j}`);for(let c in _)V[c]=_[c]}else V[j]=R?X.__evaluate__(R,W):!0;K.declaration?.syntax?f[I1+j]=R:f[j]=R});const N=U.contents();if(N.length){if(V={...V,...X.__meshwire__({$node:U,fragmentPath:F,fragmentBoundaries:S,meshPath:null,argv:l,scope:W,xmlns:q,useAttributes:!0,declaration:K.declaration},f)},K.declaration){if(K.declaration.tags)Object.entries(K.declaration?.tags).forEach(([j,{type:R,many:_}])=>{switch(R){case"nexted":{let c=U.next(j);if(!c.length)return;if(_){V[j]=[];let p=0,u=!1;while(!u){if(V[j].push(X.__meshwire__({$node:c,meshPath:`${j}[${p}]`,fragmentPath:F,fragmentBoundaries:S,argv:l,scope:W,xmlns:q,useAttributes:!0,declaration:K.declaration},f)),!c.next(j).length){u=!0;break}c=c.next(j),p++}}else V[j]=X.__meshwire__({$node:c,meshPath:j,fragmentPath:F,fragmentBoundaries:S,argv:l,scope:W,xmlns:q,useAttributes:!0,declaration:K.declaration},f)}break;case"child":{const c=U.children(j);if(_)V[j]=[],c.each(function(p){const u=r.default(this),{argv:Z1}=X.__getAttributes__(u);V[j].push(X.__meshwire__({$node:u,meshPath:`${j}[${p}]`,fragmentPath:F,fragmentBoundaries:S,argv:Z1,scope:W,xmlns:q,useAttributes:!0,declaration:K.declaration},f))});else if(U.children(j).first().length){const p=U.children(j).first(),{argv:u}=X.__getAttributes__(p);V[j]=X.__meshwire__({$node:p,meshPath:j,fragmentPath:F,fragmentBoundaries:S,argv:u,scope:W,xmlns:q,useAttributes:!0,declaration:K.declaration},f)}}break}});else if(K.declaration.contents)V.__contents__=N}}if(A)A.setInput(e(V)),P=P.add(A.node);else{const{declaration:j,state:R,_static:_,handler:c,context:p,default:u,stylesheet:Z1}=K;A=new m1(C,u||"",{state:e(R),input:e(V),context:p,_static:e(_),handler:c,stylesheet:Z1,declaration:j},{debug:X.debug,lips:X.lips,prepath:F}),P=P.add(A.node),X.PCC.set(F,A)}return P=P.add(S.end),Object.entries(g).forEach(([j,R])=>!!A&&X.__attachEvent__(A,j,R,W)),f&&Object.entries(f).forEach(([j,R])=>{let _=!1,c=!1;if(j.startsWith(I1))_=!0,j=j.replace(I1,"");if(j.startsWith(U1))c=!0,j=j.replace(U1,"");if(t.test(j)){const p=(u)=>{const Z1={},D1=X.__evaluate__(j.replace(t,""),u);if(typeof D1!=="object")throw new Error(`Invalid spread operator ${j}`);for(let Q1 in D1)Z1[Q1]=D1[Q1];A?.subInput(Z1)};if(X.__isReactive__(j,W))X.__extractExpressionDeps__(j,W).forEach((Z1)=>X.__trackDep__(Y,Z1,{nodetype:"component",target:"spread-attr",$fragment:null,boundaries:S,path:`${F}.${j}`,update:p,syntax:_,memo:W,batch:!0}))}else{const p=(u)=>{const Z1=c?X.__evaluateFunction__(R,[],u):R?X.__evaluate__(R,u):!0;A?.subInput({[j]:Z1})};if(X.__isReactive__(R,W))X.__extractExpressionDeps__(R,W).forEach((Z1)=>X.__trackDep__(Y,Z1,{nodetype:"component",target:"attr",$fragment:null,boundaries:S,path:`${F}.${j}`,update:p,syntax:_,memo:W,batch:!0}))}}),X.metrics.inc("componentCount"),P}function i(U){const w=U.prop("tagName")?.toLowerCase();if(!w)throw new Error("Invalid macro rendering call");const K=X.__macros.get(w);if(!K)throw new Error("Macro component not found");const C=O("macro"),F=X.__getBoundaries__(C),{attrs:S}=X.__getAttributes__(U),l={};let $={},g={},f=r.default(F.start);if(S.literals&&Object.entries(S.literals).forEach(([N,j])=>$[N]={value:j,type:"arg"}),S.expressions&&Object.entries(S.expressions).forEach(([N,j])=>{if(t.test(N)){const R=X.__evaluate__(N.replace(t,""),W);if(typeof R!=="object")throw new Error(`Invalid spread operator ${N}`);for(let _ in R)if(g[_]=R[_],K.argv.includes(_))$[_]={value:R[_],type:"arg"};l[N]=j}else{const R=j?X.__evaluate__(j,W):!0;if(g[N]=R,K.argv.includes(N))$[N]={value:R,type:"arg"},l[N]=j}K.argv.forEach((R)=>{if($[R]!==void 0)return;$[R]={value:!1,type:"arg"}})}),K.argv.includes("__"))$.__={value:g,type:"arg"};const V={$node:K.$node,meshPath:null,fragmentPath:C,fragmentBoundaries:F,argv:K.argv,scope:W,xmlns:q,useAttributes:!0},P=X.__meshwire__(V,l),A=P.renderer.mesh($);return f=f.add(A),l&&Object.entries(l).forEach(([N,j])=>{let R=!1;if(new RegExp(`^${I1}`).test(N))R=!0,N=N.replace(I1,"");if(t.test(N)){if(!X.__isReactive__(N,W))return;const _=X.__extractExpressionDeps__(N,W),c=(p)=>{const u={},Z1=X.__evaluate__(N.replace(t,""),p);if(typeof Z1!=="object")throw new Error(`Invalid spread operator ${N}`);const D1=[];for(let Q1 in Z1)u[Q1]={value:Z1[Q1],type:"arg"},(!p[Q1]||!S1(Z1[Q1],p[Q1].value))&&D1.push(Q1);return D1.length&&P.renderer.update(D1,u),{memo:{...p,...u}}};_.forEach((p)=>X.__trackDep__(Y,p,{nodetype:"macro",target:"spread-attr",$fragment:null,boundaries:F,path:`${C}.${N}`,update:c,syntax:R,memo:{...W,...$},batch:!0}))}else if(X.__isReactive__(j,W)){const _=X.__extractExpressionDeps__(j,W),c=(p)=>{const u=p[N]={value:j?X.__evaluate__(j,p):!0,type:"arg"};return P.renderer.update([N],{[N]:u}),{memo:p}};_.forEach((p)=>X.__trackDep__(Y,p,{nodetype:"macro",target:"attr",$fragment:null,boundaries:F,path:`${C}.${N}`,update:c,syntax:R,memo:{...W,...$},batch:!0}))}}),f=f.add(F.end),X.metrics.inc("elementCount"),f}function y(U){if(!U.length||!U.prop("tagName"))return U;const w=U.is("svg")||q,K=w?r.default(document.createElementNS("http://www.w3.org/2000/svg",U.prop("tagName").toLowerCase())):r.default(`<${U.prop("tagName").toLowerCase()}/>`),C=U.contents(),F=O("element");C.length&&K.append(X.__withPath__(F,()=>X.render(F+".n",C,W,Y,w).$log));const{attrs:S,events:l}=X.__getAttributes__(U);S.literals&&Object.entries(S.literals).forEach(([g,f])=>{if(g===P1)return;const V=U.is(`[${P1}]`)&&["title","placeholder"].includes(g);K.attr(g,V?X.lips.i18n.translate(f).text:f);const P=(A)=>{K.attr(g,V?X.lips.i18n.translate(f).text:f),V&&X.__trackTranslationDep__({nodetype:"element",target:"attr",path:F,$fragment:K,update:P,memo:A})};V&&X.__trackTranslationDep__({nodetype:"element",target:"attr",path:F,$fragment:K,update:P,memo:W})});const $=(g,f=!1)=>{g&&Object.entries(g).forEach(([V,P])=>{switch(V){case"@html":{const A=(N)=>{K.html(X.__evaluate__(P,N))};if(A(W),f&&X.__isReactive__(P,W))X.__extractExpressionDeps__(P,W).forEach((j)=>X.__trackDep__(Y,j,{nodetype:"element",target:"meta-attr",$fragment:K,path:`${F}.${V}`,update:A,memo:W,batch:!0}))}break;case"@text":{const A=U.is(`[${P1}]`),N=(j)=>{K.text(X.__evaluate__(P,j,A)),A&&X.__trackTranslationDep__({nodetype:"element",target:"meta-attr",path:F,$fragment:K,update:N,memo:j})};if(N(W),f&&X.__isReactive__(P,W))X.__extractExpressionDeps__(P,W).forEach((R)=>X.__trackDep__(Y,R,{nodetype:"element",target:"meta-attr",$fragment:K,path:`${F}.${V}`,update:N,memo:W,batch:!0}));A&&X.__trackTranslationDep__({nodetype:"element",target:"meta-attr",path:F,$fragment:K,update:N,memo:W})}break;case"@format":{const[A,N]=P.split(",").map((R)=>R.trim());if(!A)throw new Error("Invalid @format reference");if(!N)throw new Error("Invalid @format parameters");const j=(R)=>{const _=X.__evaluate__(`!${N.trim()}`,R);if(typeof _!=="object")throw new Error("Invalid @format parameters");const c=X.lips.i18n.format(A,_);c!==void 0&&K.text(c),X.__trackTranslationDep__({nodetype:"element",target:"meta-attr",path:F,$fragment:K,update:j,memo:R})};j(W),X.__extractExpressionDeps__(N,W).forEach((R)=>X.__trackDep__(Y,R,{nodetype:"element",target:"meta-attr",$fragment:K,path:`${F}.${V}`,update:j,memo:W,batch:!0}))}break;case"style":{const A=(N)=>{const j=X.__evaluate__(P,N);if(typeof j==="object"){let R="";Object.entries(j).forEach(([_,c])=>R+=`${_}:${c};`),R.length&&K.attr("style",R)}else K.attr("style",j)};if(A(W),f&&X.__isReactive__(P,W))X.__extractExpressionDeps__(P,W).forEach((j)=>X.__trackDep__(Y,j,{nodetype:"element",target:"attr",$fragment:K,path:`${F}.${V}`,update:A,memo:W,batch:!0}))}break;default:{const A=U.is(`[${P1}]`)&&["title","placeholder"].includes(V),N=(j)=>{const R=P?X.__evaluate__(P,j,A):P!==void 0?P:!0;if(R===void 0||R===!1)K.removeAttr(V);else K.attr(V,R),A&&X.__trackTranslationDep__({nodetype:"element",target:"attr",path:F,$fragment:K,update:N,memo:j})};if(N(W),f&&X.__isReactive__(P,W))X.__extractExpressionDeps__(P,W).forEach((R)=>X.__trackDep__(Y,R,{nodetype:"element",target:"attr",$fragment:K,path:`${F}.${V}`,update:N,memo:W,batch:!0}));A&&X.__trackTranslationDep__({nodetype:"element",target:"attr",path:F,$fragment:K,update:N,memo:W})}}})};return S.expressions&&Object.keys(S.expressions).forEach((g)=>{if(!t.test(g))return;const f=(V)=>{const P={},A=X.__evaluate__(g.replace(t,""),V);if(typeof A!=="object")throw new Error(`Invalid spread operator ${g}`);for(let N in A)P[N]=A[N];$(P)};if(delete S.expressions[g],f(W),g&&X.__isReactive__(g,W))X.__extractExpressionDeps__(g,W).forEach((P)=>X.__trackDep__(Y,P,{nodetype:"element",target:"spread-attr",$fragment:K,path:`${F}.${g}`,update:f,memo:W,batch:!0}))}),$(S.expressions,!0),l&&Object.entries(l).forEach(([g,f])=>{G.push({_event:g,$fragment:K,instruction:f,scope:W})}),X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),K}function v(U){const w=U.text(),K=O("element"),C=U.parent().is(`[${P1}]`),F=r.default(document.createTextNode(X.__interpolate__(w,W,C))),S=(l)=>{const $=X.__interpolate__(w,l,C);if(!F[0])return;F[0].textContent=$,C&&X.__trackTranslationDep__({nodetype:"text",target:"value",path:K,$fragment:F,update:S,memo:l||W})};if(w&&X.__isReactive__(w,W)){const l=X.__extractTextDeps__(w,W);l.forEach(($)=>X.__trackDep__(Y,$,{nodetype:"text",target:"value",path:K,$fragment:F,update:S,memo:W,batch:l.length>1}))}return C&&X.__trackTranslationDep__({nodetype:"text",target:"value",path:K,$fragment:F,update:S,memo:W}),X.metrics.inc("elementCount"),X.metrics.inc("domInsertsCount"),F}function b(U){if(U.get(0)?.nodeType===Node.COMMENT_NODE)return U;if(U.get(0)?.nodeType===Node.TEXT_NODE)return v(U);if(U.is("let"))return o(U);else if(U.is("const"))return a(U);else if(U.is("lips")&&U.attr(":dtag"))return x(U);else if(U.is("log"))return m(U);else if(X.__macros.has(U.prop("tagName")?.toLowerCase()))return i(U);else if(U.is("if, for, switch, async")||X.lips.has(U.prop("tagName")?.toLowerCase()))return s(U);else if(U.is("else-if, else"))return;return y(U)}try{this.__renderDepth++,Q=Q||r.default(this.__template__),Q.each(function(){const U=b(r.default(this));if(U)D=D.add(U)}),G.forEach(({$fragment:U,_event:w,instruction:K,scope:C})=>{this.__attachEvent__(U,w,K,C)}),X.metrics.inc("renderCount")}catch(U){console.error("Rendering Failed --",U),X.metrics.trackError(U)}finally{if(this.__renderDepth--,this.metrics.endRender(),this.metrics.trackMemory(),this.__renderDepth===0)this.__path="",this.__pathCounter=0}return{$log:D,dependencies:Y,events:G}}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.__macros.clear(),this.__i18nDeps.clear(),this.__previous=null,this.state=null,this.input=null,this.context=null,this.$)this.$.each((J,Q)=>{r.default(Q).off()}),this.$=null;typeof this.onDestroy==="function"&&this.onDestroy.bind(this)(),this.emit("component:destroy")}__meshwire__(J,Q){const W=this,{$node:z,meshPath:q,fragmentPath:Y,fragmentBoundaries:G,argv:X,scope:D,xmlns:O,declaration:I,useAttributes:T}=J;let k,x=[];const m=[],o=(i,y,v)=>{const b=`${Y}.${q||"r"}${v!==void 0?`[${v}]`:""}`,{$log:U,dependencies:w,events:K}=W.__withPath__(b,()=>W.render(b,i,{...D,...y},void 0,O));if(m.push(b),w?.forEach((C,F)=>{if(!W.FGUD?.has(F))W.FGUD.set(F,new Map);C.forEach((S,l)=>{S.partial?.length?S.partial.push(b):S.partial=[b],W.FGUD.get(F)?.set(l,S)})}),W.metrics.inc("partialCount"),v!==void 0){const C=W.__getBoundaries__(b);x[v]={argvalues:y,boundaries:C};let F=r.default(C.start);return F=F.add(U),F=F.add(C.end),F}return U},a=(i,y,v)=>{W.metrics.startRender();const b=v!==void 0?m.filter((U)=>U.endsWith(`r[${v}]`)):m;if(i.forEach((U)=>{const w=W.FGUD.get(U);if(!w)return;w.forEach((K)=>{const C=b.find((F)=>{return K.partial?.find((S)=>F==S||W.__hasSamePathParent__(S,F))});if(!K.partial||!C)return;if(G?.start&&!document.contains(G.start)){console.warn(`${q} -- partial boundaries missing in the DOM`),w.delete(K.path);return}if(K.memo?.[U]&&y?.[U]&&S1(K.memo[U],y[U]))return;if(K.memo={...D,...K.memo,...y},K.batch)W.UQS.queue({dep:U,dependent:K});else{const F=K.update(K.memo,"mesh-partial-updator");if(F)typeof F.memo==="object"&&w.set(K.path,{...K,memo:F.memo}),typeof F.cleanup==="function"&&F.cleanup()}W.metrics.inc("dependencyUpdateCount")}),!w.size&&W.FGUD.delete(U)}),v!==void 0&&x[v])x[v].argvalues=y;W.metrics.inc("partialUpdateCount"),W.metrics.endRender()},n=(i)=>{if(!x[i])return;const y=x[i].boundaries;if(x.splice(i,1),!document.contains(y.start)||!document.contains(y.end)){console.warn(`Partial mesh item<${i}> boundaries missing`);return}const v=[];let b=y.start.nextSibling;while(b&&b!==y.end)v.push(b),b=b.nextSibling;r.default(v).remove(),y.start.remove(),y.end.remove()},s={renderer:{path:q,argv:X,mesh(i,y=!1){if(k=z.contents(),!k?.length)return null;if(I?.iterator){const v=i?.["#"].value;if(!Array.isArray(i?.["#"].value))throw new Error("Invalid iterator argvalues");if(!v.length)return null;let b=r.default();return v.forEach((U,w)=>{if(!k?.length)return null;b=b.add(o(k,U,w))}),b}else return o(k,i)},update(i,y,v){if(!m.length)return;if(v=v||G,I?.iterator){const b=y?.["#"].value;if(!Array.isArray(b))return;if(Array.isArray(x)){if(x.length===b.length){for(let w=0;w<b.length;w++)!S1(x[w].argvalues,b[w])&&a(Object.keys(b[w]),b[w],w);return}const U=Math.min(x.length,b.length);for(let w=0;w<U;w++)a(Object.keys(b[w]),b[w],w);if(b.length>x.length){if(!k?.length)return;for(let w=x.length;w<b.length;w++){const K=o(k,b[w],w);r.default(v.end).before(K)}}else if(b.length<x.length)for(let w=x.length-1;w>=b.length;w--)n(w)}}else a(i,y)}}};if(T&&q){const{attrs:i}=W.__getAttributes__(z);i.literals&&Object.entries(i.literals).forEach(([y,v])=>s[y]=v),i.expressions&&Object.entries(i.expressions).forEach(([y,v])=>{if(t.test(y)){const b=W.__evaluate__(y.replace(t,""),D);if(typeof b!=="object")throw new Error(`Invalid spread operator ${y}`);for(let U in b)s[U]=b[U];Q[`${I?.syntax?I1:""}${q}.${y}`]=v}else s[y]=v?W.__evaluate__(v,D):!0,Q[`${I?.syntax?I1:""}${q}.${y}`]=v})}return s}__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={},z={literals:{},functions:{},expressions:{}};let q=[];return Q&&Object.entries(Q).forEach(([Y,G])=>{if(Y==":dtag")return;if(Y.startsWith(":")||Y.startsWith(U1)||Y.startsWith($1)||t.test(Y)||a1.test(Y))if(a1.test(Y)){const[X,D]=Y.match(a1)||[];q=D.split(",")}else if(Y.startsWith($1))W[Y.replace($1,"")]=G;else if(Y.startsWith(U1))z.functions[Y.replace(U1,"")]=G;else{if(Y.startsWith(":"))Y=Y.slice(1,Y.length);z.expressions[Y]=G||""}else z.literals[Y]=G}),{argv:q,events:W,attrs:z}}__withPath__(J,Q){const W=this.__path;this.__path=J;const z=Q();return this.__path=W,z}__getPathParent__(J){const Q=J.split("/");if(Q.length>1)Q.pop();return Q.join("/")}__hasSamePathParent__(J,Q){return J.startsWith(Q)}__evaluate__(J,Q,W){try{J=J.trim();const z=(q)=>{const Y=this.state.toJSON();if(Q){const G={};for(let O in Q)G[O]=Q[O].value;const X=`with( scope ){ return ${q}; }`;return new Function("self","input","state","static","context","scope",X)(this,this.input,Y,this.static,this.context,G||{})}else{const G=`return ${q}`;return new Function("self","input","state","static","context",G)(this,this.input,Y,this.static,this.context)}};if(/{\s*([^{}]+)\s*}/.test(J)){if(J.startsWith("!{")&&J.endsWith("}"))return z(J.slice(1));return J.replace($0,(q,Y)=>z(Y))}return z(J)}catch(z){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[z,...q]=J.split(/\s*,\s*/),Y;if(z=this.__evaluate__(z,W),typeof z==="function")Y=z;else{if(typeof this[z]!=="function")throw new Error(`Undefined <${z}> handler method`);Y=this[z].bind(this)}if(typeof Y!=="function")throw new Error(`Expected <${z}> to be a function or handler method`);let G=q.map((X)=>this.__evaluate__(X,W));if(Q.length)G=[...G,...Q];return Y(...G)}}__interpolate__(J,Q,W){if(J=J.replace($0,(z,q)=>this.__evaluate__(q,Q)),W)J=this.lips.i18n.translate(J).text;return J}__attachEvent__(J,Q,W,z){J.on(Q,(...q)=>this.__evaluateFunction__(W,q,z)),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((q)=>{const Y=q.replace(/[{}]/g,"").trim();this.__extractExpressionDeps__(Y,Q).forEach((X)=>W.add(X))}),Array.from(W)}__extractExpressionDeps__(J,Q){const W=/\b(state|input|context)(?:\.[a-zA-Z_]\w*)+(?=\[|\.|$|\s|;|,|\))/g,z=/\b(self)(?:\.[a-zA-Z_]\w*)+(?=\()/g;let q=[...Array.from(J.matchAll(W)),...Array.from(J.matchAll(z))];if(Q&&Object.keys(Q).length){const Y=new RegExp(`\\b(${Object.keys(Q).join("|")})`,"g");q=[...q,...Array.from(J.matchAll(Y))]}return[...new Set(q.map((Y)=>Y[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){this.__i18nDeps.set(J.path,J),this.metrics.inc("i18nTrackCount")}__valueDep__(J,Q){return Q.reduce((W,z)=>W?.[z],J)}__shouldUpdate__(J,Q,W,z){if(J==="self")return!0;const q=this.__valueDep__(z[J],Q),Y=this.__valueDep__(W[J],Q);return!S1(q,Y)}__updateDepNodes__(J,Q){if(!this.FGUD?.size)return;this.metrics.inc("componentUpdateCount"),this.metrics.startRender(),this.FGUD.forEach((W,z)=>{const[q,...Y]=z.split(".");if(!this.__shouldUpdate__(q,Y,J,Q))return;W.forEach((G)=>{const{path:X,batch:D,$fragment:O,boundaries:I,update:T,memo:k,syntax:x}=G;try{if(!x&&(I?.start&&!document.contains(I.start))||O!==null&&!O.closest("body").length){W.delete(X);return}if(D)this.UQS.queue({dep:z,dependent:G});else{const m=T(k,"main-updator");if(m)typeof m.memo==="object"&&W.set(X,{...G,memo:m.memo}),typeof m.cleanup==="function"&&m.cleanup()}this.metrics.inc("dependencyUpdateCount")}catch(m){console.error("failed to update dependency nodes --",m);return}}),!W.size&&this.FGUD?.delete(z)}),this.metrics.endRender()}__updateVarDepNodes__(J,Q,W){if(!this.FGUD?.size)return;this.metrics.inc("partialUpdateCount"),this.metrics.startRender(),this.FGUD.get(J)?.forEach((q,Y)=>{if(!q.haslet||!this.__hasSamePathParent__(Y,this.__getPathParent__(Q)))return;if(q.memo={...q.memo,...W},q.batch)this.UQS.queue({dep:J,dependent:q});else{const G=q.update(q.memo,"var-partial-updator");typeof G?.cleanup==="function"&&G.cleanup()}}),this.metrics.endRender()}__updateI18nDepNodes__(){if(!this.__i18nDeps?.size)return;this.metrics.inc("i18nUpdateCount"),this.metrics.startRender(),this.__i18nDeps?.forEach((J,Q)=>{if(!J.$fragment.closest("body").length){this.__i18nDeps.delete(Q);return}J.update(J.memo,"i18n-partial-updator")}),this.metrics.endRender()}appendTo(J){return(typeof J=="string"?r.default(J):J).append(this.node),this.metrics.inc("domOperations"),this}prependTo(J){return typeof J=="string"?r.default(J):J.prepend(this.node),this.metrics.inc("domOperations"),this}replaceWith(J){return(typeof J=="string"?r.default(J):J).replaceWith(this.node),this.metrics.inc("domOperations"),this}}var b0={};h1(b0,{state:()=>{{return j8}},handler:()=>{{return I8}},default:()=>{{return F8}},declaration:()=>{{return D8}}});var D8={name:"if",syntax:!0,tags:{"else-if":{type:"nexted",many:!0,optional:!0},else:{type:"nexted",optional:!0}}},j8={renderer:null},I8={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}}},F8="<{state.renderer}/>";var _0={};h1(_0,{state:()=>{{return V8}},handler:()=>{{return N8}},default:()=>{{return S8}},declaration:()=>{{return L8}},_static:()=>{{return C8}}});var L8={name:"for",syntax:!0,iterator:!0},V8={argvlist:null},C8={lastIn:null,processingBatch:!1},N8={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 z=Q<W,q=Math.abs(W-Q)+1;if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===q){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=z?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=z?X+1:X-1;return}}const Y=[];for(let G=Q;z?G<=W:G>=W;z?G++:G--){const X={},[D]=this.input.renderer.argv;if(D)X[D]={value:G,type:"arg"};Y.push(X)}this.state.argvlist=Y}else if(Array.isArray(J)){if(this.state.argvlist&&this.static.lastIn&&this.input.in===this.static.lastIn)return;if(!J.length){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute array value will not update");this.state.argvlist=[];return}if(this.static.lastIn=J,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===J.length){const[Y,G]=this.input.renderer.argv;for(let X=0;X<J.length;X++){const D=this.state.argvlist[X];if(Y)D[Y].value=J[X]}return}const z=[];let q=0;for(let Y of J){const G={},[X,D]=this.input.renderer.argv;if(X)G[X]={value:Y,type:"arg"};if(D)G[D]={value:q,type:"arg"};z.push(G),q++}this.state.argvlist=z}else if(J instanceof Map){if(this.state.argvlist&&this.static.lastIn&&this.input.in===this.static.lastIn)return;if(!J.size){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute map value will not update");this.state.argvlist=[];return}if(this.static.lastIn=J,this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===J.size){const[Y,G,X]=this.input.renderer.argv;let D=0;for(let[O,I]of J){const T=this.state.argvlist[D];if(Y)T[Y].value=O;if(G)T[G].value=I;D++}return}const z=[];let q=0;for(let[Y,G]of J){const X={},[D,O,I]=this.input.renderer.argv;if(D)X[D]={value:Y,type:"arg"};if(O)X[O]={value:G,type:"arg"};if(I)X[I]={value:q,type:"arg"};z.push(X),q++}this.state.argvlist=z}else if(typeof J=="object"){if(this.state.argvlist&&this.static.lastIn&&this.input.in===this.static.lastIn)return;if(!Object.keys(J).length){if(!this.static.lastIn)console.warn("For loop with empty initial rendering <in> attribute object value will not update");this.state.argvlist=[];return}this.static.lastIn=J;const z=Object.keys(J);if(this.state.argvlist&&Array.isArray(this.state.argvlist)&&this.state.argvlist.length===z.length){const[G,X,D]=this.input.renderer.argv;for(let O=0;O<z.length;O++){const I=z[O],T=this.state.argvlist[O];if(G)T[G].value=I;if(X)T[X].value=J[I]}return}const q=[];let Y=0;for(let G in J){const X={},[D,O,I]=this.input.renderer.argv;if(D)X[D]={value:G,type:"arg"};if(O)X[O]={value:J[G],type:"arg"};if(I)X[I]={value:Y,type:"arg"};q.push(X),Y++}this.state.argvlist=q}}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:z}of J)if(W>=0&&W<this.state.argvlist.length)this.state.argvlist[W][Q].value=z}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 z=this.state.argvlist[W];if(z[J])z[J].value=typeof Q==="function"?Q(z[J].value,W):Q}}finally{this.static.processingBatch=!1}}},S8="<{input.renderer} #=state.argvlist/>";var x0={};h1(x0,{state:()=>{{return E8}},handler:()=>{{return $8}},default:()=>{{return R8}},declaration:()=>{{return P8}}});var P8={name:"async",syntax:!0,tags:{then:{type:"child"},catch:{type:"child",optional:!0},loading:{type:"child",optional:!0}}},E8={renderer:null,props:{}},$8={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"}}})}},R8="<{state.renderer} #=state.props/>";var g0={};h1(g0,{state:()=>{{return A8}},handler:()=>{{return b8}},default:()=>{{return _8}},declaration:()=>{{return T8}}});var T8={name:"switch",syntax:!0,tags:{case:{type:"child",many:!0},default:{type:"child"}}},A8={renderer:null},b8={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}},_8="<{state.renderer}/>";var k0={};h1(k0,{state:()=>{{return x8}},handler:()=>{{return f8}},default:()=>{{return y8}},context:()=>{{return k8}},_static:()=>{{return g8}}});var h8=function(J){const Q={};return J.split("&").map((z)=>{const[q,Y]=z.split("=");Q[q]=Y}),Q},x8={page:null,params:{},query:{}},g8={global:!1,routes:[],defaultPath:null,currentPath:null,currentRoute:null},k8=["navigate"],f8={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 z=J.match(/:[^\/]*(\/|$)/gi)||[],q=J.replaceAll("/","\\/").replaceAll(/:[^\/]*(\/|$)/gi,"([^\\/]+)(?:\\/|$)");return{path:J,template:Q,default:W,pathVars:z,pathRegex:new RegExp(`${q}\$`,"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 z=W[1]?h8(W[1]):{};let q=null;if(this.static.currentRoute)q={path:this.static.currentRoute.path,params:this.state.params},this.emit("before",{fromState:q,toState:{path:J,query:z}});const Y=this.match(J);if(!Y){this.static.currentRoute=null,this.state.params={},this.state.query={},this.emit("not-found",J);return}const{route:G,params:X}=Y;this.emit("after",{fromState:q,toState:{path:G.path,params:X,query:z}}),this.static.currentPath=J,this.static.currentRoute=G,this.state.params=X,this.state.query=z,this.state.page=G.template},match(J){const Q={};let W=!1;for(let z of this.static.routes){const{pathVars:q,pathRegex:Y}=z,G=J.match(Y);if(G!==null&&G.index===0){for(let X=0;X+1<G.length&&X<q.length;X++)Q[q[X].replaceAll(/[\/:]/g,"")]=G[X+1];W=z;break}}return W?{route:W,params:Q}:!1}},y8="<{state.page} params=state.params query=state.query/>";class R5{debug=!1;stylesheets=[];config={};store={};__root;i18n=new p1;watcher;IUC;__setLang;__getLang;__setContext;__getContext;constructor(J){if(this.config=J,this.config?.debug)this.debug=this.config.debug;this.watcher=new l1,this.IUC=new s1;const[Q,W]=R1(this.i18n.lang),[z,q]=R1(J?.context||{});this.__setLang=W,this.__getLang=Q,this.__setContext=q,this.__getContext=z,this.register("if",b0),this.register("for",_0),this.register("async",x0),this.register("switch",g0),this.register("router",k0)}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:z,...q}=Q,Y={debug:this.debug,prepath:"0",lips:this},G=new m1(J,z||"",{...q,input:W},Y);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(J,Q){if(this.__root=this.render("__ROOT__",J),this.__root.appendTo(Q),this.config?.stylesheets)this.stylesheets=this.config.stylesheets.map((W)=>new k1("root",{sheet:W,meta:!0}));return this.__root}setLanguage(J){this.i18n.lang=J,this.__setLang(J)}getLanguage(){return this.__getLang()}setContext(J,Q){const W=this.__getContext();if(typeof J==="string"){const z={...W,[J]:Q};H1(W,z)&&this.__setContext(z)}else if(!Array.isArray(J)){const z={...W,...J};H1(W,z)&&this.__setContext(z)}else throw new Error("Invalid context data")}getContext(){return this.__getContext()}useContext(J,Q){if(!J.length)return;v1(()=>{const W=this.__getContext();if(!W)return;const z=Object.fromEntries(J.map((q)=>[q,W[q]]));z&&typeof Q==="function"&&Object.keys(z).length&&Q(z)})}useTranslator(J,Q){v1(()=>{const W=this.__getLang();if(!W)return;(J==="*"||Array.isArray(J)&&J.includes(W))&&typeof Q==="function"&&Q(W)})}dispose(){this.watcher?.dispose(),this.__root?.destroy(),this.stylesheets.forEach((J)=>J.clear())}}export{R5 as default};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=C3A4926C5B74F4B864756e2164756e21
|