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