@lmjs/cli 2.1.16 → 2.1.17
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,4 +1,4 @@
|
|
|
1
|
-
(function(global){function toArray(x2){if(x2==null)return[];if(typeof NodeList!=="undefined"&&x2 instanceof NodeList)return Array.prototype.slice.call(x2);if(typeof HTMLCollection!=="undefined"&&x2 instanceof HTMLCollection)return Array.prototype.slice.call(x2);if(Array.isArray(x2))return x2;if(x2 instanceof $2)return Array.prototype.slice.call(x2);return[x2]}function $2(selector2,context){if(!(this instanceof $2))return new $2(selector2,context);var els=[];var sel=void 0;if(!selector2){els=[]}else if(typeof selector2==="string"){var trimmed=selector2.trim();if(trimmed[0]==="<"){var tpl=document.createElement("template");tpl.innerHTML=trimmed;els=toArray(tpl.content.childNodes).filter(function(n2){return n2.nodeType===1})}else{sel=selector2;var root=context?context instanceof $2?context[0]:context:document;var atParts=selector2.split(",").map(function(s){return s.trim()});var isAllAtAttrs=atParts.length>0&&atParts.every(function(p){return/^\[\\@[\w-]+\]$/.test(p)});if(isAllAtAttrs){var names=atParts.map(function(p){return"@"+/^\[\\@([\w-]+)\]$/.exec(p)[1]});var all=root?toArray(root.querySelectorAll("*")):[];els=all.filter(function(el2){return names.some(function(n2){return el2.getAttribute(n2)!=null})})}else{els=root?toArray(root.querySelectorAll(selector2)):[]}}}else{els=toArray(selector2)}for(var i2=0;i2<els.length;i2++)this[i2]=els[i2];this.length=els.length;this.selector=sel;return this}$2.fn=$2.prototype;$2.fn.jquery="lumenjs-shim";$2.fn.extend=function(methods){for(var k in methods)if(Object.prototype.hasOwnProperty.call(methods,k))$2.fn[k]=methods[k];return $2};$2.extend=function(target){for(var i2=1;i2<arguments.length;i2++){var src=arguments[i2];for(var k in src)if(Object.prototype.hasOwnProperty.call(src,k))target[k]=src[k]}return target};$2.Event=function(type2,props2){var e2=typeof type2==="string"?new Event(type2,{bubbles:true,cancelable:true}):type2;if(props2)for(var k in props2)e2[k]=props2[k];return e2};$2.proxy=function(fn2,context){return fn2.bind(context)};$2.trim=function(s){return(s==null?"":String(s)).trim()};$2.inArray=function(val2,arr){return Array.prototype.indexOf.call(arr,val2)};$2.each=function(arr,fn2){if(Array.isArray(arr)||arr instanceof $2){for(var i2=0;i2<arr.length;i2++)if(fn2.call(arr[i2],i2,arr[i2])===false)break}else{for(var k in arr)if(fn2.call(arr[k],k,arr[k])===false)break}return arr};$2.map=function(arr,fn2){var out=[];var src=Array.isArray(arr)||arr instanceof $2?arr:Object.keys(arr||{}).map(function(k){return arr[k]});for(var i2=0;i2<src.length;i2++){var r2=fn2(src[i2],i2);if(r2===null||r2===void 0)continue;if(Array.isArray(r2))out.push.apply(out,r2);else out.push(r2)}return out};var _ajaxActive=0;$2.ajax=function(opts){opts=opts||{};var method=(opts.method||opts.type||"GET").toUpperCase();var init2={method,headers:opts.headers||{}};if(opts.data!=null&&method!=="GET"){init2.body=typeof opts.data==="string"?opts.data:JSON.stringify(opts.data)}if(_ajaxActive===0)$2(document).trigger("ajaxStart");_ajaxActive++;$2(document).trigger("ajaxSend");return fetch(opts.url,init2).then(function(res){var ct=res.headers.get("content-type")||"";return ct.indexOf("json")>-1?res.json():res.text()}).then(function(data2){opts.success&&opts.success(data2);$2(document).trigger("ajaxSuccess");return data2}).catch(function(err){opts.error&&opts.error(err);$2(document).trigger("ajaxError");throw err}).finally(function(){_ajaxActive--;$2(document).trigger("ajaxComplete");if(_ajaxActive===0)$2(document).trigger("ajaxStop")})};$2.fn.each=function(fn2){for(var i2=0;i2<this.length;i2++)if(fn2.call(this[i2],i2,this[i2])===false)break;return this};$2.fn.get=function(i2){return i2===void 0?toArray(this):this[i2]};$2.fn.not=function(exclude){var excludeArr=exclude instanceof $2?toArray(exclude):Array.isArray(exclude)?exclude:[exclude];var out=[];this.each(function(){if(excludeArr.indexOf(this)===-1)out.push(this)});return $2(out)};$2.fn.attr=function(name,value){if(value===void 0)return this[0]?this[0].getAttribute(name):void 0;return this.each(function(){this.setAttribute(name,value)})};$2.fn.prop=function(name,value){if(value===void 0)return this[0]?this[0][name]:void 0;return this.each(function(){this[name]=value})};$2.fn.removeAttr=function(name){return this.each(function(){this.removeAttribute(name)})};$2.fn.hasAttr=function(name){return!!(this[0]&&this[0].getAttribute(name)!=null)};$2.fn.data=function(key,value){if(value===void 0){if(!this[0])return void 0;if(key===void 0)return Object.assign({},this[0].dataset);var v=this[0].dataset[key];try{return JSON.parse(v)}catch(e2){return v}}return this.each(function(){this.dataset[key]=typeof value==="string"?value:JSON.stringify(value)})};$2.fn.val=function(value){if(value===void 0)return this[0]?this[0].value:void 0;return this.each(function(){this.value=value})};$2.fn.html=function(value){if(value===void 0)return this[0]?this[0].innerHTML:void 0;if(typeof value!=="string"){var nodes2=_normalizeAppendable([value]);return this.each(function(){this.innerHTML="";var self2=this;nodes2.forEach(function(n2){self2.appendChild(n2)})})}return this.each(function(){this.innerHTML=value})};$2.fn.text=function(value){if(value===void 0)return this[0]?this[0].textContent:"";return this.each(function(){this.textContent=value})};$2.fn.css=function(name,value){if(typeof name==="object"){return this.each(function(){var el2=this;for(var k in name)el2.style[k]=name[k]})}if(value===void 0)return this[0]?getComputedStyle(this[0])[name]:void 0;return this.each(function(){this.style[name]=value})};$2.fn.addClass=function(cls){var list=cls.split(/\s+/).filter(Boolean);return this.each(function(){this.classList.add.apply(this.classList,list)})};$2.fn.removeClass=function(cls){var list=cls.split(/\s+/).filter(Boolean);return this.each(function(){this.classList.remove.apply(this.classList,list)})};$2.fn.hasClass=function(cls){return!!(this[0]&&this[0].classList.contains(cls))};$2.fn.toggleClass=function(cls,force){var list=cls.split(/\s+/).filter(Boolean);return this.each(function(){var el2=this;list.forEach(function(c){el2.classList.toggle(c,force)})})};$2.fn.remove=function(){return this.each(function(){this.parentNode&&this.parentNode.removeChild(this)})};function _normalizeAppendable(args){var out=[];function add(item){if(item==null)return;if(Array.isArray(item)){item.forEach(add);return}if(item instanceof $2){for(var i22=0;i22<item.length;i22++)add(item[i22]);return}if(typeof item==="string"){var tpl=document.createElement("template");tpl.innerHTML=item;while(tpl.content.firstChild)out.push(tpl.content.removeChild(tpl.content.firstChild));return}if(item instanceof Node){out.push(item);return}}for(var i2=0;i2<args.length;i2++)add(args[i2]);return out}$2.fn.append=function(){if(arguments.length===1&&typeof arguments[0]==="string"){var html=arguments[0];return this.each(function(){this.insertAdjacentHTML("beforeend",html)})}var nodes2=_normalizeAppendable(arguments);return this.each(function(){var self2=this;nodes2.forEach(function(n2){self2.appendChild(n2)})})};$2.fn.prepend=function(){if(arguments.length===1&&typeof arguments[0]==="string"){var html=arguments[0];return this.each(function(){this.insertAdjacentHTML("afterbegin",html)})}var nodes2=_normalizeAppendable(arguments);return this.each(function(){var self2=this;var ref=self2.firstChild;nodes2.forEach(function(n2){self2.insertBefore(n2,ref)})})};$2.fn.after=function(content){return this.each(function(){if(typeof content==="string")this.insertAdjacentHTML("afterend",content);else this.parentNode.insertBefore(content instanceof $2?content[0]:content,this.nextSibling)})};$2.fn.appendTo=function(target){$2(target).append(this);return this};$2.fn.width=function(){return this[0]?this[0].offsetWidth:0};$2.fn.height=function(){return this[0]?this[0].offsetHeight:0};$2.fn.innerHeight=function(){return this[0]?this[0].clientHeight:0};$2.fn.innerWidth=function(){return this[0]?this[0].clientWidth:0};$2.fn.scrollLeft=function(value){if(!this[0])return value===void 0?0:this;if(value===void 0)return this[0]===window?window.scrollX:this[0].scrollLeft;return this.each(function(){if(this===window)window.scrollTo(value,window.scrollY);else this.scrollLeft=value})};$2.fn.scrollTop=function(value){if(!this[0])return value===void 0?0:this;if(value===void 0)return this[0]===window?window.scrollY:this[0].scrollTop;return this.each(function(){if(this===window)window.scrollTo(window.scrollX,value);else this.scrollTop=value})};$2.fn.outerWidth=function(includeMargin){if(!this[0])return 0;var w=this[0].offsetWidth;if(includeMargin){var s=getComputedStyle(this[0]);w+=parseFloat(s.marginLeft||0)+parseFloat(s.marginRight||0)}return w};$2.fn.outerHeight=function(includeMargin){if(!this[0])return 0;var h=this[0].offsetHeight;if(includeMargin){var s=getComputedStyle(this[0]);h+=parseFloat(s.marginTop||0)+parseFloat(s.marginBottom||0)}return h};$2.fn.offset=function(){if(!this[0])return null;var rect=this[0].getBoundingClientRect();var docEl=document.documentElement;return{top:rect.top+(window.pageYOffset||docEl.scrollTop)-(docEl.clientTop||0),left:rect.left+(window.pageXOffset||docEl.scrollLeft)-(docEl.clientLeft||0)}};$2.fn.parent=function(){return $2(this[0]?this[0].parentElement:null)};$2.fn.next=function(){return $2(this[0]?this[0].nextElementSibling:null)};$2.fn.closest=function(sel){return $2(this[0]?this[0].closest(sel):null)};$2.fn.find=function(sel){var out=[];this.each(function(){var found=this.querySelectorAll(sel);for(var i2=0;i2<found.length;i2++)if(out.indexOf(found[i2])===-1)out.push(found[i2])});return $2(out)};var JQUERY_PSEUDOS={":checkbox":function(el2){return el2.tagName==="INPUT"&&el2.type==="checkbox"},":radio":function(el2){return el2.tagName==="INPUT"&&el2.type==="radio"},":checked":function(el2){return!!el2.checked}};$2.fn.is=function(sel){if(!this[0])return false;if(JQUERY_PSEUDOS[sel])return JQUERY_PSEUDOS[sel](this[0]);try{return this[0].matches(sel)}catch(e2){return false}};$2.fn.ready=function(fn2){if(document.readyState!=="loading")fn2($2);else document.addEventListener("DOMContentLoaded",function(){fn2($2)});return this};["ajaxStart","ajaxStop","ajaxSend","ajaxSuccess","ajaxError","ajaxComplete"].forEach(function(name){$2.fn[name]=function(fn2){return this.on(name,fn2)}});var EVENT_NAME_MAP={touch:"touchstart",focus:"focusin",blur:"focusout"};var _eventBuses=typeof WeakMap!=="undefined"?new WeakMap:null;function _isNode(x2){return x2===window||x2===document||typeof Node!=="undefined"&&x2 instanceof Node}function _isRealEventTarget(x2){return x2!=null&&typeof x2.addEventListener==="function"&&typeof x2.dispatchEvent==="function"}function _eventTargetFor(x2){if(_isNode(x2)||_isRealEventTarget(x2))return x2;if(!_eventBuses.has(x2))_eventBuses.set(x2,new EventTarget);return _eventBuses.get(x2)}var AT_ATTR_SELECTOR=/^\[\\@([\w-]+)\]$/;$2.fn.on=function(events,selector2,handler){if(typeof selector2==="function"){handler=selector2;selector2=null}var evts=events.split(/\s+/).filter(Boolean);var atMatch=selector2&&AT_ATTR_SELECTOR.exec(selector2);var atAttr=atMatch?"@"+atMatch[1]:null;return this.each(function(){var node=this;var bus=_eventTargetFor(node);evts.forEach(function(evt){var real=EVENT_NAME_MAP[evt]||evt;bus.addEventListener(real,function(e2){if(atAttr){var el2=e2.target;var match=null;while(el2&&el2.nodeType===1){if(el2.getAttribute(atAttr)!=null){match=el2;break}el2=el2.parentElement}if(match&&node.contains(match))handler.call(match,e2)}else if(selector2&&_isNode(node)){var match2=e2.target.closest(selector2);if(match2&&node.contains(match2))handler.call(match2,e2)}else{handler.call(node,e2)}})})})};$2.fn.click=function(handler){return handler?this.on("click",handler):this.trigger("click")};$2.fn.keydown=function(handler){return handler?this.on("keydown",handler):this.trigger("keydown")};$2.fn.trigger=function(type2,data2){return this.each(function(){var bus=_eventTargetFor(this);var ev2;if(type2 instanceof Event){ev2=type2}else if(type2&&typeof type2==="object"&&typeof type2.type==="string"){ev2=new Event(type2.type,{bubbles:_isNode(this)});for(var k in type2){if(k!=="type"&&Object.prototype.hasOwnProperty.call(type2,k)){try{ev2[k]=type2[k]}catch(e2){}}}}else{ev2=new Event(type2,{bubbles:_isNode(this)})}if(data2!==void 0)ev2.detail=data2;bus.dispatchEvent(ev2)})};$2.fn.unbind=function(){return this};["click","dblclick","keyup","keydown","keypress","focus","blur","change","submit","focusin","focusout","mouseenter","mouseleave","mouseover","mouseout","mousedown","mouseup","mousemove","resize","scroll","load","select"].forEach(function(name){$2.fn[name]=function(handler){return handler?this.on(name,handler):this.trigger(name)}});$2.fn.hover=function(enter,leave){this.on("mouseenter",enter);this.on("mouseleave",leave||enter);return this};var _animTimers=new WeakMap;function _animGetScroll(el2,prop){if(el2===window)return prop==="scrollLeft"?window.pageXOffset:window.pageYOffset;return el2[prop]}function _animSetScroll(el2,prop,val2){if(el2===window){if(prop==="scrollLeft")window.scrollTo(val2,window.pageYOffset);else window.scrollTo(window.pageXOffset,val2)}else{el2[prop]=val2}}var _cssNumberProps={opacity:1,zIndex:1,zoom:1,fontWeight:1,lineHeight:1,columnCount:1,flexGrow:1,flexShrink:1,order:1,widows:1,orphans:1};function _animSetStyle(el2,prop,val2){el2.style[prop]=_cssNumberProps[prop]?val2:val2+"px"}$2.fn.animate=function(props2,options){var opts=typeof options==="number"?{duration:options}:options||{};var duration=opts.duration==null?400:opts.duration;this.each(function(){var el2=this;var isWindowScroll=el2===document.documentElement||el2===document.body;var target=isWindowScroll?window:el2;var start={};var isScrollProp={};for(var prop in props2){if(!Object.prototype.hasOwnProperty.call(props2,prop))continue;isScrollProp[prop]=prop==="scrollTop"||prop==="scrollLeft";if(isScrollProp[prop]){start[prop]=_animGetScroll(isWindowScroll?window:el2,prop)}else{start[prop]=parseFloat(getComputedStyle(el2)[prop])||0}}var existing=_animTimers.get(el2);if(existing)cancelAnimationFrame(existing);if(duration===0){for(var p in props2){var v=parseFloat(props2[p]);if(isScrollProp[p])_animSetScroll(isWindowScroll?window:el2,p,v);else _animSetStyle(el2,p,v)}if(opts.complete)opts.complete.call(el2);return}var startTime=null;function step(ts){if(startTime===null)startTime=ts;var elapsed=ts-startTime;var t2=Math.min(1,elapsed/duration);for(var p2 in props2){if(!Object.prototype.hasOwnProperty.call(props2,p2))continue;var end=parseFloat(props2[p2]);var val2=start[p2]+(end-start[p2])*t2;if(isScrollProp[p2])_animSetScroll(isWindowScroll?window:el2,p2,val2);else _animSetStyle(el2,p2,val2)}if(t2<1){_animTimers.set(el2,requestAnimationFrame(step))}else{_animTimers.delete(el2);if(opts.complete)opts.complete.call(el2)}}_animTimers.set(el2,requestAnimationFrame(step))});return this};$2.fn.stop=function(){this.each(function(){var id2=_animTimers.get(this);if(id2){cancelAnimationFrame(id2);_animTimers.delete(this)}});return this};$2.fn.serializeArray=function(){var result=[];this.each(function(){if(this.tagName!=="FORM")return;var elements=this.elements?Array.prototype.slice.call(this.elements):[];elements.forEach(function(field){if(!field.name||field.disabled)return;var tag=field.tagName.toLowerCase();var type2=(field.type||tag).toLowerCase();if(type2==="submit"||type2==="button"||type2==="reset"||type2==="fieldset")return;if((type2==="checkbox"||type2==="radio")&&!field.checked)return;if(type2==="file"){var files=field.files?Array.prototype.map.call(field.files,function(f){return f.name}):[];result.push({name:field.name,value:files,type:type2});return}if(tag==="select"&&field.multiple){Array.prototype.forEach.call(field.selectedOptions||[],function(opt){result.push({name:field.name,value:opt.value,type:type2})});return}result.push({name:field.name,value:field.value,type:type2})})});return result};$2.fn.ajaxForm=function(options){options=options||{};return this.each(function(){var formEl=this;var $form=$2(formEl);formEl.addEventListener("submit",function(ev2){ev2.preventDefault();var formData=$form.serializeArray();if(typeof options.beforeSubmit==="function"){options.beforeSubmit(formData,$form,options)}})})};global.$=$2;global.jQuery=$2})(typeof window!=="undefined"?window:globalThis);!(function(t2){"use strict";var e2=null,r2=null,n2=null,i2=null,l=null,o=window,s="WebWorker",a=null,u=null,f=null,p=null,g=null,c=null,h=null;function _(t3){return function(e3){var r3=this._callbackStack[t3];return"function"==typeof e3&&r3.push(e3),this}}for(h in null!==(e2=(i2=i2||o)[l=l||s]||null)&&(r2=e2),c=Array.prototype.slice,n2=window.Worker,e2=function(){this._constructor.apply(this,arguments)},e2.prototype._$=null,e2.prototype._callbackStack=null,e2.prototype._lastError=null,e2.prototype._log=null,e2.prototype._nativeWorker=null,e2.prototype._state=null,e2.prototype._workerBlobUrl=null,e2.prototype._workerScript=null,e2.prototype._workerUrl=null,e2.prototype._constructor=function(e3){var r3=null,n3=null,i3=null;if(Object.defineProperty(this,"_$",{configurable:false,enumerable:true,value:t2(this),writable:false}),null===(e3=e3||null)&&this.throwError(g.INVALID_ARGUMENTS,null,true),"string"==typeof e3){let l2="";e3=t2.trim(e3);try{window.hasOwnProperty(e3)&&"string"==typeof window[e3]?(l2=window[e3],this._workerScript=l2):r3=t2(e3)}catch(t3){}null!==r3&&r3.length>0?(n3=r3.text(),this._workerScript=n3):""==l2&&(i3=e3)}this._workerUrl=i3,this._callbackStack={error:[],loading:[],loaded:[],starting:[],started:[],terminating:[],terminated:[]},this._assignEventHandlers(),this._state=a.INITIALIZED,this.trigger(f.INITIALIZED)},e2.prototype._initLog=function(){return this._log=[],this._log},e2.prototype.getUrl=function(){return this._workerUrl},e2.prototype.getBlobUrl=function(){return this._workerBlobUrl},e2.prototype.getLog=function(){return this._log||this._initLog()},e2.prototype.getNativeWorker=function(){return this._nativeWorker},e2.prototype.getState=function(){return this._state},e2.prototype.isLoading=function(){return this.getState()===a.LOADING},e2.prototype.isLoaded=function(){return this.getState()>=a.LOADED&&!this.isTerminated()},e2.prototype.isStarting=function(){return this.getState()===a.STARTING},e2.prototype.isStarted=function(){return this.getState()>=a.STARTED&&!this.isTerminated()},e2.prototype.isTerminating=function(){return this.getState()===a.TERMINATING},e2.prototype.isTerminated=function(){return this.getState()===a.TERMINATED},e2.prototype.load=function(){var r3,n3,i3=this;return i3.isLoading()||i3.isLoaded()||(i3.trigger(f.WORKER_LOADING),r3=i3.getUrl()||null,n3=function(){var t3,r4=null;r4=i3._workerScript,r4=e2._workerScriptWrapper.replace(/\{\{main-function\}\}/g,r4),t3=new window.Blob([r4],{type:"text/javascript"}),i3._workerBlobUrl=window.URL.createObjectURL(t3),i3._createWorker()},null===r3?n3():t2.ajax({async:true,url:r3,dataType:"text",crossDomain:true,success:function(t3){i3._workerScript=t3,n3()},error:function(){i3.throwError(g.WORKER_DID_NOT_LOAD,arguments)}})),i3},e2.prototype.log=function(t3){return(this._log||this._initLog()).push(t3),this},e2.prototype._createWorker=function(){return this._nativeWorker=new n2(this.getBlobUrl()),this._attachMessageParser(),this},e2.prototype._assignEventHandlers=function(){function t3(t4){return function(){var e3,r3,n3=this._callbackStack[t4];(e3=t4.toUpperCase())in a&&(this._state=a[e3]);for(;r3=n3.pop();)r3.apply(this,arguments)}}return this.on(f.ERROR,t3("error")),this.on(f.WORKER_LOADING,t3("loading")),this.on(f.WORKER_LOADED,t3("loaded")),this.on(f.WORKER_STARTING,t3("starting")),this.on(f.WORKER_STARTED,t3("started")),this.on(f.WORKER_TERMINATING,t3("terminating")),this.on(f.WORKER_TERMINATED,t3("terminated")),this},e2.prototype.error=_("error"),e2.prototype.loading=_("loading"),e2.prototype.loaded=_("loaded"),e2.prototype.starting=_("starting"),e2.prototype.started=_("started"),e2.prototype.terminating=_("terminating"),e2.prototype.terminated=_("terminated"),e2.prototype.start=function(){var t3;return this.isStarting()||this.isStarted()?this:(t3=c.call(arguments),this.isLoaded()?(this.trigger(f.WORKER_STARTING),this.sendMessage(u.START,t3),this):(this.on(f.WORKER_LOADED,(function(){this.start.apply(this,t3)})),this.load(),this))},e2.prototype.sendMessage=function(t3,e3){var r3=null,n3=null;return e3=e3||null,null===(t3=t3||null)||((n3={__isWebWorkerMsg:true}).action=t3,n3.args=e3,(r3=this.getNativeWorker())&&r3.postMessage(n3)),this},e2.prototype._attachMessageParser=function(){var e3=null;return(e3=t2(this.getNativeWorker())).on("message",t2.proxy((function(t3){var e4=(t3.originalEvent||t3).data,r3=null,n3=null;"object"==typeof e4&&"__isWebWorkerMsg"in e4&&e4.__isWebWorkerMsg&&(r3=e4.action,n3=e4.args,this[r3].apply(this,n3))}),this)),e3.on("error",t2.proxy(this.throwError,this)),this},e2.prototype.terminate=function(){return(this.getNativeWorker()||null)&&(this.trigger(f.WORKER_TERMINATING),this.sendMessage(u.TERMINATE,c.call(arguments))),this},e2.prototype.terminateNow=function(){var t3=null;return this.isTerminating()||this.trigger(f.WORKER_TERMINATING),(t3=this.getNativeWorker()||null)&&(t3.terminate(),this._nativeWorker=null,this.trigger(f.WORKER_TERMINATED)),this},e2.prototype.on=function(){var t3=this._$;return t3.on.apply(t3,arguments),this},e2.prototype.one=function(){var t3=this._$;return t3.one.apply(t3,arguments),this},e2.prototype.off=function(){var t3=this._$;return t3.off.apply(t3,arguments),this._assignEventHandlers(),this},e2.prototype.trigger=function(e3){var r3=false,n3=null,i3=null;return"object"==typeof e3&&(n3=e3.type||null),"string"==typeof e3&&(n3=e3||null,r3=true),null===n3?this:n3 in p?(r3&&(e3=new t2.Event(n3)),e3.worker=this,i3=[e3],arguments.length>1&&(i3=i3.concat(c.call(arguments,1))),this._triggerSelf.apply(this,i3),this):(r3&&(e3={type:n3,data:arguments[1]?arguments[1]:{}}),i3=[e3],this.sendMessage(u.TRIGGER_SELF,i3),this)},e2.prototype.triggerSelf=function(e3){var r3=null,n3=null;return null===(e3=e3||null)||("string"==typeof e3&&(r3=e3,e3=new t2.Event(r3)),e3.originalEvent=e3.originalEvent||e3,e3.worker=this,n3=[e3],arguments.length>1&&(n3=n3.concat(c.call(arguments,1))),this._triggerSelf.apply(this,n3)),this},e2.prototype._triggerSelf=function(){var t3=null;return(t3=this._$).trigger.apply(t3,arguments),this},e2.prototype.throwError=function(t3,r3,n3){var i3=null;if("object"==typeof(t3=t3||g.UNKNOWN)&&(i3=(t3=t3.originalEvent||t3).data||null),i3=void 0===r3?i3:r3,n3=n3||false,this._lastError=t3,e2._lastError=t3,"_triggerError"in this&&this._triggerError(t3,r3,n3),n3)throw new window.Error(t3);return this},e2.prototype._triggerError=function(e3,r3,n3){var i3=null;return(i3=new t2.Event(f.ERROR)).message=this.getLastError(),i3.errorData=r3,i3.throwsException=!!n3,this.trigger(i3),this},e2.prototype.getLastError=function(){return this._lastError},e2._lastError=null,a={INITIALIZED:0,LOADING:1,LOADED:2,STARTING:3,STARTED:4,TERMINATING:5,TERMINATED:6},e2.State=a,u={LOG:"log",START:"start",TERMINATE:"terminate",TERMINATE_NOW:"terminateNow",TRIGGER:"trigger",TRIGGER_SELF:"triggerSelf"},e2.Action=u,f={INITIALIZED:"initialized",ERROR:"error",WORKER_LOADING:"worker-loading",WORKER_LOADED:"worker-loaded",WORKER_STARTING:"worker-starting",WORKER_STARTED:"worker-started",WORKER_TERMINATING:"worker-terminating",WORKER_TERMINATED:"worker-terminated"},e2.Event=f,p={},e2.EventMap=p,f)f[h]="webworker:"+f[h],p[f[h]]=h;g={UNKNOWN:"An unknown error occured.",INVALID_ARGUMENTS:"Invalid arguments were supplied to this method.",WORKER_DID_NOT_LOAD:"Unable to load worker."},e2.Error=g,e2._workerScriptWrapper='var e=null,t=null,n=null,r={};e={{state-data}};t={{action-data}};n={{event-data}};self._callbackStack=null;self._listeners=r;self._isTerminating=false;self._state=null;self.State=e;self.Action=t;self.Event=n;self._assignEventHandlers=function(){function t(t){return function(){var n=self._callbackStack[t],r,i;r=t.toUpperCase();if(r in e){self._state=e[r]}while(i=n.pop()){i.apply(self,arguments)}}}self.on(n.WORKER_TERMINATING,t("terminating"));return self};self.getState=function(){return this._state};self.isInitialized=function(){var e=self.getState();return e!==null&&e>=0};self.isTerminating=function(){return self.getState()===e.TERMINATING};self._main=function(){var startArgs=arguments;{{main-function}};return self};self._init=function(){self._callbackStack={terminating:[]};self._assignEventHandlers();self._state=e.INITIALIZED;self.trigger(n.WORKER_LOADED);return self};self.start=function(){if(!self.isInitialized()){return self}self.triggerSelf(n.WORKER_STARTING);self._main.apply(self,arguments);self.triggerSelf(n.WORKER_STARTED);self.trigger(n.WORKER_STARTED);return self};self.log=function(e){self.sendMessage(t.LOG,[e]);return self};self.on=function(e,t){e+="";t=t||null;if(typeof t!=="function"){return self}if(!(e in r)){r[e]=[]}r[e].push(t);return self};self.one=function(e,t){var n=null;n=function(){t.apply(this,arguments);self.off(e,n);return};self.on(e,n);return};self.off=function(e,t){var n=null;e=e||null;t=t||null;if(e===null&&t===null){for(n in r){delete r[n]}self._assignEventHandlers();return self}self._removeListenerFromEventType(e,t);return self};self._removeListenerFromEventType=function(e,t){var n=r[e],i=0;t=t||null;if(t===null){r[e]=[];return self}for(;i<n.length;i++){if(n[i]===t){n.splice(i,1);i--}}return self};self.terminating=function(e){var t=self._callbackStack.terminating;if(typeof e==="function"){t.push(e)}return self};self.trigger=function(e,n){var r=null;e=e||null;if(e===null){return self}if(typeof e==="string"){r=e||null;e={type:r}}else if(typeof e==="object"){r=e.type||null;n=e.data}if(r===null){return self}e.data=n;self.sendMessage(t.TRIGGER_SELF,[e]);return self};self.triggerSelf=function(e,t){var n=null,i=null,s=null,o=null,u=0;e=e||null;if(e===null){return this}if(typeof e==="string"){n=e||null;e={type:e}}else if(typeof e==="object"){n=e.type||null;t=e.data}if(n===null){return this}e.data=t;i=r[n]||null;if(i===null){return this}s=i.length;for(u=0;u<s;u++){o=i[u];o.apply(this,[e]);if(s!==i.length){u--;s=i.length}}return this};self.sendMessage=function(e,t){var n=null;e=e||null;t=t||[];if(e===null){return self}n={__isWebWorkerMsg:true};n.action=e;n.args=t;self.postMessage(n);return self};self.terminate=function(e){e=!!e;if(!self.isTerminating()){self._setTerminatingStatus();self.triggerSelf(n.WORKER_TERMINATING);self.trigger(n.WORKER_TERMINATING)}self.sendMessage(t.TERMINATE_NOW,[]);if(e){self._nativeClose()}return self};self.terminateNow=function(){return self.terminate(true)};self._setTerminatingStatus=function(){self._state=e.TERMINATING;return self};self._nativeClose=self.close;self.close=self.terminate;self.addEventListener("message",function(e){var t=e.originalEvent||e,n=t.data,r=null,i=null;if(typeof n==="object"&&"__isWebWorkerMsg"in n&&n.__isWebWorkerMsg){r=n.action;i=n.args;self[r].apply(self,i)}},false);self._init()',e2._workerScriptWrapper=e2._workerScriptWrapper.replace(/\{\{state-data\}\}/g,JSON.stringify(a)).replace(/\{\{action-data\}\}/g,JSON.stringify(u)).replace(/\{\{event-data\}\}/g,JSON.stringify(f)),e2.getLastError=e2.prototype.getLastError,e2.noConflict=function(t3,n3){return t3=t3||null,n3=n3||null,o[s]===e2&&(delete o[s],r2&&(o[s]=r2)),t3&&n3&&(t3[n3]=e2),e2},i2[l]=e2})(jQuery);!(function(n2){"use strict";function d(n3,t3){var r3=(65535&n3)+(65535&t3);return(n3>>16)+(t3>>16)+(r3>>16)<<16|65535&r3}function f(n3,t3,r3,e3,o2,u2){return d((u2=d(d(t3,n3),d(e3,u2)))<<o2|u2>>>32-o2,r3)}function l(n3,t3,r3,e3,o2,u2,c2){return f(t3&r3|~t3&e3,n3,t3,o2,u2,c2)}function g(n3,t3,r3,e3,o2,u2,c2){return f(t3&e3|r3&~e3,n3,t3,o2,u2,c2)}function v(n3,t3,r3,e3,o2,u2,c2){return f(t3^r3^e3,n3,t3,o2,u2,c2)}function m(n3,t3,r3,e3,o2,u2,c2){return f(r3^(t3|~e3),n3,t3,o2,u2,c2)}function c(n3,t3){var r3,e3,o2,u2;n3[t3>>5]|=128<<t3%32,n3[14+(t3+64>>>9<<4)]=t3;for(var c2=1732584193,f2=-271733879,i3=-1732584194,a2=271733878,h=0;h<n3.length;h+=16)c2=l(r3=c2,e3=f2,o2=i3,u2=a2,n3[h],7,-680876936),a2=l(a2,c2,f2,i3,n3[h+1],12,-389564586),i3=l(i3,a2,c2,f2,n3[h+2],17,606105819),f2=l(f2,i3,a2,c2,n3[h+3],22,-1044525330),c2=l(c2,f2,i3,a2,n3[h+4],7,-176418897),a2=l(a2,c2,f2,i3,n3[h+5],12,1200080426),i3=l(i3,a2,c2,f2,n3[h+6],17,-1473231341),f2=l(f2,i3,a2,c2,n3[h+7],22,-45705983),c2=l(c2,f2,i3,a2,n3[h+8],7,1770035416),a2=l(a2,c2,f2,i3,n3[h+9],12,-1958414417),i3=l(i3,a2,c2,f2,n3[h+10],17,-42063),f2=l(f2,i3,a2,c2,n3[h+11],22,-1990404162),c2=l(c2,f2,i3,a2,n3[h+12],7,1804603682),a2=l(a2,c2,f2,i3,n3[h+13],12,-40341101),i3=l(i3,a2,c2,f2,n3[h+14],17,-1502002290),c2=g(c2,f2=l(f2,i3,a2,c2,n3[h+15],22,1236535329),i3,a2,n3[h+1],5,-165796510),a2=g(a2,c2,f2,i3,n3[h+6],9,-1069501632),i3=g(i3,a2,c2,f2,n3[h+11],14,643717713),f2=g(f2,i3,a2,c2,n3[h],20,-373897302),c2=g(c2,f2,i3,a2,n3[h+5],5,-701558691),a2=g(a2,c2,f2,i3,n3[h+10],9,38016083),i3=g(i3,a2,c2,f2,n3[h+15],14,-660478335),f2=g(f2,i3,a2,c2,n3[h+4],20,-405537848),c2=g(c2,f2,i3,a2,n3[h+9],5,568446438),a2=g(a2,c2,f2,i3,n3[h+14],9,-1019803690),i3=g(i3,a2,c2,f2,n3[h+3],14,-187363961),f2=g(f2,i3,a2,c2,n3[h+8],20,1163531501),c2=g(c2,f2,i3,a2,n3[h+13],5,-1444681467),a2=g(a2,c2,f2,i3,n3[h+2],9,-51403784),i3=g(i3,a2,c2,f2,n3[h+7],14,1735328473),c2=v(c2,f2=g(f2,i3,a2,c2,n3[h+12],20,-1926607734),i3,a2,n3[h+5],4,-378558),a2=v(a2,c2,f2,i3,n3[h+8],11,-2022574463),i3=v(i3,a2,c2,f2,n3[h+11],16,1839030562),f2=v(f2,i3,a2,c2,n3[h+14],23,-35309556),c2=v(c2,f2,i3,a2,n3[h+1],4,-1530992060),a2=v(a2,c2,f2,i3,n3[h+4],11,1272893353),i3=v(i3,a2,c2,f2,n3[h+7],16,-155497632),f2=v(f2,i3,a2,c2,n3[h+10],23,-1094730640),c2=v(c2,f2,i3,a2,n3[h+13],4,681279174),a2=v(a2,c2,f2,i3,n3[h],11,-358537222),i3=v(i3,a2,c2,f2,n3[h+3],16,-722521979),f2=v(f2,i3,a2,c2,n3[h+6],23,76029189),c2=v(c2,f2,i3,a2,n3[h+9],4,-640364487),a2=v(a2,c2,f2,i3,n3[h+12],11,-421815835),i3=v(i3,a2,c2,f2,n3[h+15],16,530742520),c2=m(c2,f2=v(f2,i3,a2,c2,n3[h+2],23,-995338651),i3,a2,n3[h],6,-198630844),a2=m(a2,c2,f2,i3,n3[h+7],10,1126891415),i3=m(i3,a2,c2,f2,n3[h+14],15,-1416354905),f2=m(f2,i3,a2,c2,n3[h+5],21,-57434055),c2=m(c2,f2,i3,a2,n3[h+12],6,1700485571),a2=m(a2,c2,f2,i3,n3[h+3],10,-1894986606),i3=m(i3,a2,c2,f2,n3[h+10],15,-1051523),f2=m(f2,i3,a2,c2,n3[h+1],21,-2054922799),c2=m(c2,f2,i3,a2,n3[h+8],6,1873313359),a2=m(a2,c2,f2,i3,n3[h+15],10,-30611744),i3=m(i3,a2,c2,f2,n3[h+6],15,-1560198380),f2=m(f2,i3,a2,c2,n3[h+13],21,1309151649),c2=m(c2,f2,i3,a2,n3[h+4],6,-145523070),a2=m(a2,c2,f2,i3,n3[h+11],10,-1120210379),i3=m(i3,a2,c2,f2,n3[h+2],15,718787259),f2=m(f2,i3,a2,c2,n3[h+9],21,-343485551),c2=d(c2,r3),f2=d(f2,e3),i3=d(i3,o2),a2=d(a2,u2);return[c2,f2,i3,a2]}function i2(n3){for(var t3="",r3=32*n3.length,e3=0;e3<r3;e3+=8)t3+=String.fromCharCode(n3[e3>>5]>>>e3%32&255);return t3}function a(n3){var t3=[];for(t3[(n3.length>>2)-1]=void 0,e3=0;e3<t3.length;e3+=1)t3[e3]=0;for(var r3=8*n3.length,e3=0;e3<r3;e3+=8)t3[e3>>5]|=(255&n3.charCodeAt(e3/8))<<e3%32;return t3}function e2(n3){for(var t3,r3="0123456789abcdef",e3="",o2=0;o2<n3.length;o2+=1)t3=n3.charCodeAt(o2),e3+=r3.charAt(t3>>>4&15)+r3.charAt(15&t3);return e3}function r2(n3){return unescape(encodeURIComponent(n3))}function o(n3){return i2(c(a(n3=r2(n3)),8*n3.length))}function u(n3,t3){return(function(n4,t4){var r3,e3=a(n4),o2=[],u2=[];for(o2[15]=u2[15]=void 0,16<e3.length&&(e3=c(e3,8*n4.length)),r3=0;r3<16;r3+=1)o2[r3]=909522486^e3[r3],u2[r3]=1549556828^e3[r3];return t4=c(o2.concat(a(t4)),512+8*t4.length),i2(c(u2.concat(t4),640))})(r2(n3),r2(t3))}function t2(n3,t3,r3){return t3?r3?u(t3,n3):e2(u(t3,n3)):r3?o(n3):e2(o(n3))}"function"==typeof define&&define.amd?define(function(){return t2}):"object"==typeof module&&module.exports?module.exports=t2:n2.md5=t2})(this);var _cssw=`let _w=self;var commentre=/\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;function parseMe(t,e){e=e||{};var i=1,n=1;function s(t){var e=t.match(/\\n/g);e&&(i+=e.length);var s=t.lastIndexOf("\\n");n=~s?t.length-s:n+t.length}function r(){var t={line:i,column:n};return function(e){return e.position=new o(t),f(),e}}function o(t){this.start=t,this.end={line:i,column:n},this.source=e.source}o.prototype.content=t;var a=[];function p(s){var r=new Error(e.source+":"+i+":"+n+": "+s);if(r.reason=s,r.filename=e.source,r.line=i,r.column=n,r.source=t,!e.silent)throw r;a.push(r)}function m(){return h(/^{\\s*/)}function u(){return h(/^}/)}function c(){var e,i=[];for(f(),l(i);t.length&&"}"!=t.charAt(0)&&(e=A()||b());)!1!==e&&(i.push(e),l(i));return i}function h(e){var i=e.exec(t);if(i){var n=i[0];return s(n),t=t.slice(n.length),i}}function f(){h(/^\\s*/)}function l(t){var e;for(t=t||[];e=d();)!1!==e&&t.push(e);return t}function d(){var e=r();if("/"==t.charAt(0)&&"*"==t.charAt(1)){for(var i=2;""!=t.charAt(i)&&("*"!=t.charAt(i)||"/"!=t.charAt(i+1));)++i;if(i+=2,""===t.charAt(i-1))return p("End of comment missing");var o=t.slice(2,i-2);return n+=2,s(o),t=t.slice(i),n+=2,e({type:"comment",comment:o})}}function y(){var t=h(/^([^{]+)/);if(t)return trim(t[0]).replace(/\\/\\*([^*]|[\\r\\n]|(\\*+([^*/]|[\\r\\n])))*\\*\\/+/g,"").replace(/"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'/g,(function(t){return t.replace(/,/g,"\u200C")})).split(/\\s*(?![^(]*\\)),\\s*/).map((function(t){return t.replace(/\\u200C/g,",")}))}function v(){var t=r(),e=h(/^(\\*?[-#\\/\\*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/);if(e){if(e=trim(e[0]),!h(/^:\\s*/))return p("property missing ':'");var i=h(/^((?:'(?:\\\\'|.)*?'|"(?:\\\\"|.)*?"|\\([^\\)]*?\\)|[^};])+)/),n=t({type:"declaration",property:e.replace(commentre,""),value:i?trim(i[0]).replace(commentre,""):""});return h(/^[;\\s]*/),n}}function g(){var t,e=[];if(!m())return p("missing '{'");for(l(e);t=v();)!1!==t&&(e.push(t),l(e));return u()?e:p("missing '}'")}function I(){for(var t,e=[],i=r();t=h(/^((\\d+\\.\\d+|\\.\\d+|\\d+)%?|[a-z]+)\\s*/);)e.push(t[1]),h(/^,\\s*/);if(e.length)return i({type:"keyframe",values:e,declarations:g()})}var C,V=j("import"),k=j("charset"),w=j("namespace");function j(t){var e=new RegExp("^@"+t+"\\\\s*([^;]+);");return function(){var i=r(),n=h(e);if(n){var s={type:t};return s[t]=n[1].trim(),i(s)}}}function A(){if("@"==t[0])return function(){var t=r();if(e=h(/^@([-\\w]+)?keyframes\\s*/)){var e,i=e[1];if(!(e=h(/^([-\\w]+)\\s*/)))return p("@keyframes missing name");var n,s=e[1];if(!m())return p("@keyframes missing '{'");for(var o=l();n=I();)o.push(n),o=o.concat(l());return u()?t({type:"keyframes",name:s,vendor:i,keyframes:o}):p("@keyframes missing '}'")}}()||function(){var t=r(),e=h(/^@media *([^{]+)/);if(e){var i=trim(e[1]);if(!m())return p("@media missing '{'");var n=l().concat(c());return u()?t({type:"media",media:i,rules:n}):p("@media missing '}'")}}()||function(){var t=r(),e=h(/^@custom-media\\s+(--[^\\s]+)\\s*([^{;]+);/);if(e)return t({type:"custom-media",name:trim(e[1]),media:trim(e[2])})}()||function(){var t=r(),e=h(/^@supports *([^{]+)/);if(e){var i=trim(e[1]);if(!m())return p("@supports missing '{'");var n=l().concat(c());return u()?t({type:"supports",supports:i,rules:n}):p("@supports missing '}'")}}()||V()||k()||w()||function(){var t=r(),e=h(/^@([-\\w]+)?document *([^{]+)/);if(e){var i=trim(e[1]),n=trim(e[2]);if(!m())return p("@document missing '{'");var s=l().concat(c());return u()?t({type:"document",document:n,vendor:i,rules:s}):p("@document missing '}'")}}()||function(){var t=r();if(h(/^@page */)){var e=y()||[];if(!m())return p("@page missing '{'");for(var i,n=l();i=v();)n.push(i),n=n.concat(l());return u()?t({type:"page",selectors:e,declarations:n}):p("@page missing '}'")}}()||function(){var t=r();if(h(/^@host\\s*/)){if(!m())return p("@host missing '{'");var e=l().concat(c());return u()?t({type:"host",rules:e}):p("@host missing '}'")}}()||function(){var t=r();if(h(/^@font-face\\s*/)){if(!m())return p("@font-face missing '{'");for(var e,i=l();e=v();)i.push(e),i=i.concat(l());return u()?t({type:"font-face",declarations:i}):p("@font-face missing '}'")}}()}function b(){var t=r(),e=y();return e?(l(),t({type:"rule",selectors:e,declarations:g()})):p("selector missing")}return addParent((C=c(),{type:"stylesheet",stylesheet:{source:e.source,rules:C,parsingErrors:a}}))}function trim(t){return t?t.replace(/^\\s+|\\s+$/g,""):""}function addParent(t,e){var i=t&&"string"==typeof t.type,n=i?t:e;for(var s in t){var r=t[s];Array.isArray(r)?r.forEach((function(t){addParent(t,n)})):r&&"object"==typeof r&&addParent(r,n)}return i&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:e||null}),t}class Compress{options={};indentation=null;constructor(t){this.options=t??{},this.indentation=t?.indent??null}}Compress.prototype.emit=function(t){return t},Compress.prototype.visit=function(t){return this[t.type](t)},Compress.prototype.mapVisit=function(t,e){var i="";e=e||"";for(var n=0,s=t.length;n<s;n++)i+=this.visit(t[n]),e&&n<s-1&&(i+=this.emit(e));return i},Compress.prototype.compile=function(t){return t.stylesheet.rules.map(this.visit,this).join("")},Compress.prototype.comment=function(t){return this.emit("",t.position)},Compress.prototype.import=function(t){return this.emit("@import "+t.import+";",t.position)},Compress.prototype.media=function(t){return this.emit("@media "+t.media,t.position)+this.emit("{")+this.mapVisit(t.rules)+this.emit("}")},Compress.prototype.document=function(t){var e="@"+(t.vendor||"")+"document "+t.document;return this.emit(e,t.position)+this.emit("{")+this.mapVisit(t.rules)+this.emit("}")},Compress.prototype.charset=function(t){return this.emit("@charset "+t.charset+";",t.position)},Compress.prototype.namespace=function(t){return this.emit("@namespace "+t.namespace+";",t.position)},Compress.prototype.supports=function(t){return this.emit("@supports "+t.supports,t.position)+this.emit("{")+this.mapVisit(t.rules)+this.emit("}")},Compress.prototype.keyframes=function(t){return this.emit("@"+(t.vendor||"")+"keyframes "+t.name,t.position)+this.emit("{")+this.mapVisit(t.keyframes)+this.emit("}")},Compress.prototype.keyframe=function(t){var e=t.declarations;return this.emit(t.values.join(","),t.position)+this.emit("{")+this.mapVisit(e)+this.emit("}")},Compress.prototype.page=function(t){var e=t.selectors.length?t.selectors.join(", "):"";return this.emit("@page "+e,t.position)+this.emit("{")+this.mapVisit(t.declarations)+this.emit("}")},Compress.prototype["font-face"]=function(t){return this.emit("@font-face",t.position)+this.emit("{")+this.mapVisit(t.declarations)+this.emit("}")},Compress.prototype.host=function(t){return this.emit("@host",t.position)+this.emit("{")+this.mapVisit(t.rules)+this.emit("}")},Compress.prototype["custom-media"]=function(t){return this.emit("@custom-media "+t.name+" "+t.media+";",t.position)},Compress.prototype.rule=function(t){var e=t.declarations;return e.length?this.emit(t.selectors.join(","),t.position)+this.emit("{")+this.mapVisit(e)+this.emit("}"):""},Compress.prototype.declaration=function(t){return this.emit(t.property+":"+t.value,t.position)+this.emit(";")};class Identity{options={};indentation=null;constructor(t){this.options=t??{},this.indentation=t?.indent??null}}function stringifyMe(t,e){var i=(e=e||{}).compress?new Compress(e):new Identity(e);if(e.sourcemap){require("./source-map-support")(i);var n=i.compile(t);return i.applySourceMaps(),{code:n,map:"generator"===e.sourcemap?i.map:i.map.toJSON()}}return n=i.compile(t)}Identity.prototype.emit=function(t){return t},Identity.prototype.visit=function(t){return this[t.type](t)},Identity.prototype.mapVisit=function(t,e){var i="";e=e||"";for(var n=0,s=t.length;n<s;n++)i+=this.visit(t[n]),e&&n<s-1&&(i+=this.emit(e));return i},Identity.prototype.compile=function(t){return this.stylesheet(t)},Identity.prototype.stylesheet=function(t){return this.mapVisit(t.stylesheet.rules,"\\n\\n")},Identity.prototype.comment=function(t){return this.emit(this.indent()+"/*"+t.comment+"*/",t.position)},Identity.prototype.import=function(t){return this.emit("@import "+t.import+";",t.position)},Identity.prototype.media=function(t){return this.emit("@media "+t.media,t.position)+this.emit(" {\\n"+this.indent(1))+this.mapVisit(t.rules,"\\n\\n")+this.emit(this.indent(-1)+"\\n}")},Identity.prototype.document=function(t){var e="@"+(t.vendor||"")+"document "+t.document;return this.emit(e,t.position)+this.emit(" {\\n"+this.indent(1))+this.mapVisit(t.rules,"\\n\\n")+this.emit(this.indent(-1)+"\\n}")},Identity.prototype.charset=function(t){return this.emit("@charset "+t.charset+";",t.position)},Identity.prototype.namespace=function(t){return this.emit("@namespace "+t.namespace+";",t.position)},Identity.prototype.supports=function(t){return this.emit("@supports "+t.supports,t.position)+this.emit(" {\\n"+this.indent(1))+this.mapVisit(t.rules,"\\n\\n")+this.emit(this.indent(-1)+"\\n}")},Identity.prototype.keyframes=function(t){return this.emit("@"+(t.vendor||"")+"keyframes "+t.name,t.position)+this.emit(" {\\n"+this.indent(1))+this.mapVisit(t.keyframes,"\\n")+this.emit(this.indent(-1)+"}")},Identity.prototype.keyframe=function(t){var e=t.declarations;return this.emit(this.indent())+this.emit(t.values.join(", "),t.position)+this.emit(" {\\n"+this.indent(1))+this.mapVisit(e,"\\n")+this.emit(this.indent(-1)+"\\n"+this.indent()+"}\\n")},Identity.prototype.page=function(t){var e=t.selectors.length?t.selectors.join(", ")+" ":"";return this.emit("@page "+e,t.position)+this.emit("{\\n")+this.emit(this.indent(1))+this.mapVisit(t.declarations,"\\n")+this.emit(this.indent(-1))+this.emit("\\n}")},Identity.prototype["font-face"]=function(t){return this.emit("@font-face ",t.position)+this.emit("{\\n")+this.emit(this.indent(1))+this.mapVisit(t.declarations,"\\n")+this.emit(this.indent(-1))+this.emit("\\n}")},Identity.prototype.host=function(t){return this.emit("@host",t.position)+this.emit(" {\\n"+this.indent(1))+this.mapVisit(t.rules,"\\n\\n")+this.emit(this.indent(-1)+"\\n}")},Identity.prototype["custom-media"]=function(t){return this.emit("@custom-media "+t.name+" "+t.media+";",t.position)},Identity.prototype.rule=function(t){var e=this.indent(),i=t.declarations;return i.length?this.emit(t.selectors.map((function(t){return e+t})).join(",\\n"),t.position)+this.emit(" {\\n")+this.emit(this.indent(1))+this.mapVisit(i,"\\n")+this.emit(this.indent(-1))+this.emit("\\n"+this.indent()+"}"):""},Identity.prototype.declaration=function(t){return this.emit(this.indent())+this.emit(t.property+": "+t.value,t.position)+this.emit(";")},Identity.prototype.indent=function(t){return this.level=this.level||1,null!=t?(this.level+=t,""):Array(this.level).join(this.indentation||" ")},function(){"use strict";_w.on("css-ready",(function(t){var e=t.data.csses,i=t.data.key,n=t.data.pre;for(let t=0;t<e.length;t++){var s=parseMe(e[t],{silent:!0});for(let t=0;t<s?.stylesheet?.rules?.length;t++)for(let e=0;e<s?.stylesheet?.rules[t].selectors.length;e++)"*"==s?.stylesheet?.rules[t].selectors[e]?s.stylesheet.rules[t].selectors[e]=n+", "+n+" "+s?.stylesheet?.rules[t].selectors[e]:s.stylesheet.rules[t].selectors[e]=n+" "+s?.stylesheet?.rules[t].selectors[e];var r=stringifyMe(s,{compress:!0});e[t]=r}_w.trigger("css-ready",{csses:e,key:i})}))}(); `;var _upw=`let _w=self;var files=[];function defer(){var e,t,s=new Promise(((s,r)=>{e=s,t=r}));return s.resolve=e,s.reject=t,s.success=e,s.failed=t,s}class _Live{_chnls={};_users={};_iter=0;reconnectAttempts=0;timeoutInterval=4e3;cbs={};_cbs={};lstnrs={};_ws;srvr=void 0;constructor(e,t){return this.srvr=e,this.init(t),this}on(e,t){return this.lstnrs.hasOwnProperty(e)||(this.lstnrs[e]=[]),this.lstnrs[e].push(t),"open"==e&&1==this._ws?.readyState&&this.trigger("open",this._ws),this}off(e){return"connect"==e||this.lstnrs.hasOwnProperty(e)&&delete this.lstnrs[e],this}createUser(e){return new _User(e,this)}subscribe(e,t){return this.on(e,t)}unsubscribe(e,t){return this.off(e,t)}trigger(e,t){if(this.lstnrs.hasOwnProperty(e))for(let s=0;s<this.lstnrs[e].length;s++)this.lstnrs[e][s](t);return this}emit(e,t,s){try{this._iter++,s&&(this.cbs["cb_"+this._iter]=s),this.ready()?this._ws.send(JSON.stringify({e:e,payload:t,_iter:this._iter})):this._send(JSON.stringify({e:e,payload:t,_iter:this._iter}))}catch(e){_debugMode&&cl(e)}return this}_emit(e,t,s){this._iter++;let r=defer();return this._cbs["cb_"+this._iter]=r,s?this.ready()?(this._ws.binaryType="arraybuffer",this._ws.send(this._binData({e:e,payloadBin:t,_iter:this._iter})),this._ws.binaryType="blob"):this._send(this._binData({e:e,payloadBin:t,_iter:this._iter})):this.ready()?this._ws.send(JSON.stringify({e:e,payload:t,_iter:this._iter})):this._send(JSON.stringify({e:e,payload:t,_iter:this._iter})),r}_send(e){let t=this;setTimeout((function(){t.ready()?t._ws.send(e):t._send(e)}),500)}ready(){return void 0!==this._ws&&this._ws.readyState==WebSocket.OPEN}connecting(){return void 0!==this._ws&&this._ws.readyState==WebSocket.CONNECTING}init(e){var t=this;if(t.ready())e&&"STARTED"==e.status&&upload(e);else if(t.connecting())setTimeout((function(){t.ready()?e&&"STARTED"==e.status&&upload(e):t.init(e)}),500);else{this._ws=new WebSocket(this.srvr?this.srvr:"wss://www.beaapis.com/");var s=this._ws,r=setTimeout((function(){1!=s.readyState&&s.close()}),this.timeoutInterval);this._ws.onopen=function(s){e&&"STARTED"==e.status&&upload(e),clearTimeout(r),t.trigger("connect",s),t.trigger("open",s)},this._ws.onclose=function(s){clearTimeout(r),t._ws=void 0,t._iter=0,t.cbs={},setTimeout((function(){t.reconnectAttempts++,t.init(e)}),1e3)},this._ws.onmessage=function(e){try{let s=JSON.parse(e.data);if(s.hasOwnProperty("for")){let e=s.type??"room",r=s.ev??"message";const i=new CustomEvent(r,{detail:s.payload});i.data=s.payload;let n=s.payload;n.hasOwnProperty("user")&&("user"==e?t._users[s.for].trigger(r,i):t._chnls[n.user.id][s.for].trigger(r,i))}else if(s.hasOwnProperty("e")){let e=s.e,r=s._iter;const i=new CustomEvent(e,{detail:s.payload});i.data=s.payload,"rooms"!=e&&t.trigger(e,i),t.cbs["cb_"+r]&&t.cbs["cb_"+r](i),t._cbs["cb_"+r].resolve(i)}}catch(e){}},this._ws.onerror=function(e){t._ws&&t._ws.close()}}}_binData(e){var t=e.payloadBin,s=t.chunk;delete t.chunk;const r=JSON.stringify({payload:t,e:e.e,_iter:e._iter}),i=new TextEncoder,n=i.encode("!"),a=i.encode(r),o=i.encode("_B_:_E_:_A_"),u=s;let l=new Uint8Array(n.byteLength+a.byteLength+o.byteLength+u.byteLength);return l.set(new Uint8Array(n),0),l.set(new Uint8Array(a),n.byteLength),l.set(new Uint8Array(o),n.byteLength+a.byteLength),l.set(new Uint8Array(u),n.byteLength+a.byteLength+o.byteLength),l}}var LIVE=new _Live("wss://www.beaapis.com/");function openSocket(e){LIVE.init(e)}function readFileAsync(e){return new Promise(((t,s)=>{let r=new FileReader;r.onload=e=>{let s=new ArrayBuffer;s=e.target.result,t(s)},r.onerror=s,r.readAsArrayBuffer(e)}))}var _queue={};function fid(){return"file_"+Date.now().toString(36)+Math.floor(Math.pow(10,12)+9*Math.random()*Math.pow(10,12)).toString(36)}const wait=e=>new Promise(((t,s)=>{setTimeout(t,e)}));async function upload(e){if(e&&"STARTED"!=e.status)return;const t=Math.ceil(256000);for(var s=0;s<Object.keys(e.files).length;s++){let l=Object.keys(e.files)[s],d=Object.values(e.files)[s];if(e&&"STOPPED"==e.status)return;if("DONE"==d.status)continue;let c=e.blobs[l],h=e.data[l],f=c.size;var r=0,i=t,n=Math.ceil(f/t),a={cmd:1,name:c.name,id:l,chunks:n};await LIVE._emit("upload",a);let p=1;for(h.part>1&&(p=h.part?h.part:1,i=(r=(p-1)*t)+t);r<f;){if(e&&"STOPPED"==e.status)return;if(!e.files.hasOwnProperty(l))return;if("mozSlice"in c)var o=c.mozSlice(r,i);else if("slice"in c)o=c.slice(r,i);else o=c.webkitSlice(r,i);var u=await readFileAsync(o);a={cmd:2,name:c.name,part:p,chunks:n,id:l,chunk:u};h.chunks=n,h.part=p+1,d.status="UPLOADING",d.loaded=d.loaded+o.size,d.percent=Math.ceil(100*p/n),d.loaded>d.size&&(d.loaded=d.size),d.percent>100&&(d.percent=100);let s=await LIVE._emit("upload",a,!0);s?.data?.url&&(d.url=s?.data?.url),_w.trigger("upload-progress",{upid:d.upid,files:e.files}),i=(r=i)+t,p++}d.status="DONE",_w.trigger("file-uploaded",{upid:d.upid,files:e.files,file:d})}e.status="DONE",_w.trigger("upload-complete",{upid:e.upid,files:e.files})}function process(e){var t=e.upid,s=e.files;_queue.hasOwnProperty(t)||(_queue[t]={status:"QUEUED",upid:t,files:{},blobs:{},data:{}});for(var r=_queue[t],i=[],n={},a={},o=0;o<s.length;o++)i.push(s[o]);for(;i.length>0;){var u=i.shift(),l=fid();n[l]={id:l,upid:t,name:u.name,type:u.type,size:u.size,loaded:0,percent:0,status:"QUEUED",lastModifiedDate:u.lastModifiedDate?u.lastModifiedDate.toLocaleDateString():"n/a"},a[l]={id:l,upid:t,chunks:1,part:1},r.files={...r.files,...n},r.data={...r.data,...a},r.blobs[l]=u,_w.trigger("queue-changed",{upid:t,files:r.files})}_w.trigger("files-added",{upid:t,files:r.files,newfiles:n})}!function(){"use strict";_w.on("handle-files",(function(e){process(e.data)})),_w.on("start-upload",(function(e){var t=e.data.upid,s=_queue[t];s?"STARTED"!=s.status?(s.status="STARTED",LIVE.ready()?upload(s):openSocket(s)):_w.trigger("message","Already Started!"):_w.trigger("queue-empty",{upid:t})})),_w.on("stop-upload",(function(e){var t=e.data.upid,s=_queue[t];s?(s.status="STOPPED",_w.trigger("upload-stop",{upid:t,files:s})):_w.trigger("queue-empty",{upid:t})})),_w.on("remove-file",(function(e){var t=e.data.upid,s=_queue[t],r=e.data.id;if(s.files?.hasOwnProperty(r)){var i=s.files[r];delete s.files[r],_w.trigger("file-removed",{upid:t,files:s.files,removedfile:i}),_w.trigger("queue-changed",{upid:t,files:s.files}),0==Object.keys(s.files).length&&(delete _queue[t],_w.trigger("queue-empty",{upid:t}))}}))}(); `;(function(a,b){if("function"==typeof define&&define.amd)define(["exports"],b);else if("undefined"!=typeof exports)b(exports);else{var c={exports:{}};b(c.exports),a.astring=c.exports}})("undefined"==typeof globalThis?"undefined"==typeof self?this:self:globalThis,function(a){"use strict";var b=String.prototype;function c(a2,b2){if(!(a2 instanceof b2))throw new TypeError("Cannot call a class as a function")}function d(a2,b2){for(var c2,d2=0;d2<b2.length;d2++)c2=b2[d2],c2.enumerable=c2.enumerable||false,c2.configurable=true,"value"in c2&&(c2.writable=true),Object.defineProperty(a2,c2.key,c2)}function e2(a2,b2,c2){return b2&&d(a2.prototype,b2),c2&&d(a2,c2),a2}function f(a2,b2){var c2=a2.generator;if(a2.write("("),null!=b2&&0<b2.length){c2[b2[0].type](b2[0],a2);for(var d2,e3=b2.length,f2=1;f2<e3;f2++)d2=b2[f2],a2.write(", "),c2[d2.type](d2,a2)}a2.write(")")}function g(a2,b2,c2,d2){var e3=a2.expressionsPrecedence[b2.type];if(e3===17)return true;var f2=a2.expressionsPrecedence[c2.type];return e3===f2?(13===e3||14===e3)&&("**"===b2.operator&&"**"===c2.operator?!d2:!(13!==e3||13!==f2||"??"!==b2.operator&&"??"!==c2.operator)||(d2?o[b2.operator]<=o[c2.operator]:o[b2.operator]<o[c2.operator])):!d2&&15===e3&&14===f2&&"**"===c2.operator||e3<f2}function h(a2,b2,c2,d2){var e3=a2.generator;g(a2,b2,c2,d2)?(a2.write("("),e3[b2.type](b2,a2),a2.write(")")):e3[b2.type](b2,a2)}function j(a2,b2,c2,d2){var e3=b2.split("\n"),f2=e3.length-1;if(a2.write(e3[0].trim()),0<f2){a2.write(d2);for(var g2=1;g2<f2;g2++)a2.write(c2+e3[g2].trim()+d2);a2.write(c2+e3[f2].trim())}}function k(a2,b2,c2,d2){for(var e3,f2=b2.length,g2=0;g2<f2;g2++)e3=b2[g2],a2.write(c2),"L"===e3.type[0]?a2.write("// "+e3.value.trim()+"\n",e3):(a2.write("/*"),j(a2,e3.value,c2,d2),a2.write("*/"+d2))}function l(a2){for(var d2=a2;null!=d2;){var b2=d2,c2=b2.type;if("C"===c2[0]&&"a"===c2[1])return true;if("M"===c2[0]&&"e"===c2[1]&&"m"===c2[2])d2=d2.object;else return false}}function m(a2,b2){var c2=a2.generator,d2=b2.declarations;a2.write(b2.kind+" ");var e3=d2.length;if(0<e3){c2.VariableDeclarator(d2[0],a2);for(var f2=1;f2<e3;f2++)a2.write(", "),c2.VariableDeclarator(d2[f2],a2)}}Object.defineProperty(a,"__esModule",{value:true}),a.generate=function(a2,b2){var c2=new z(b2);return c2.generator[a2.type](a2,c2),c2.output},a.baseGenerator=a.GENERATOR=a.EXPRESSIONS_PRECEDENCE=a.NEEDS_PARENTHESES=void 0;var n2=JSON.stringify;if(!b.repeat)throw new Error("String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation");if(!b.endsWith)throw new Error("String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation");var o={"||":2,"??":3,"&&":4,"|":5,"^":6,"&":7,"==":8,"!=":8,"===":8,"!==":8,"<":9,">":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},p=17;a.NEEDS_PARENTHESES=p;var q={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,PrivateIdentifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,ChainExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:p,ClassExpression:p,FunctionExpression:p,ObjectExpression:p,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};a.EXPRESSIONS_PRECEDENCE=q;var r2,s,t2,u,v,w,x2={Program:function Program(a2,b2){var c2=b2.indent.repeat(b2.indentLevel),d2=b2.lineEnd,e3=b2.writeComments;e3&&null!=a2.comments&&k(b2,a2.comments,c2,d2);for(var f2,g2=a2.body,h2=g2.length,j2=0;j2<h2;j2++)f2=g2[j2],e3&&null!=f2.comments&&k(b2,f2.comments,c2,d2),b2.write(c2),this[f2.type](f2,b2),b2.write(d2);e3&&null!=a2.trailingComments&&k(b2,a2.trailingComments,c2,d2)},BlockStatement:w=function(a2,b2){var c2=b2.indent.repeat(b2.indentLevel++),d2=b2.lineEnd,e3=b2.writeComments,f2=c2+b2.indent;b2.write("{");var g2=a2.body;if(null!=g2&&0<g2.length){b2.write(d2),e3&&null!=a2.comments&&k(b2,a2.comments,f2,d2);for(var h2,j2=g2.length,l2=0;l2<j2;l2++)h2=g2[l2],e3&&null!=h2.comments&&k(b2,h2.comments,f2,d2),b2.write(f2),this[h2.type](h2,b2),b2.write(d2);b2.write(c2)}else e3&&null!=a2.comments&&(b2.write(d2),k(b2,a2.comments,f2,d2),b2.write(c2));e3&&null!=a2.trailingComments&&k(b2,a2.trailingComments,f2,d2),b2.write("}"),b2.indentLevel--},ClassBody:w,StaticBlock:function StaticBlock(a2,b2){b2.write("static "),this.BlockStatement(a2,b2)},EmptyStatement:function EmptyStatement(a2,b2){b2.write(";")},ExpressionStatement:function ExpressionStatement(a2,b2){var c2=b2.expressionsPrecedence[a2.expression.type];c2===p||3===c2&&"O"===a2.expression.left.type[0]?(b2.write("("),this[a2.expression.type](a2.expression,b2),b2.write(")")):this[a2.expression.type](a2.expression,b2),b2.write(";")},IfStatement:function IfStatement(a2,b2){b2.write("if ("),this[a2.test.type](a2.test,b2),b2.write(") "),this[a2.consequent.type](a2.consequent,b2),null!=a2.alternate&&(b2.write(" else "),this[a2.alternate.type](a2.alternate,b2))},LabeledStatement:function LabeledStatement(a2,b2){this[a2.label.type](a2.label,b2),b2.write(": "),this[a2.body.type](a2.body,b2)},BreakStatement:function BreakStatement(a2,b2){b2.write("break"),null!=a2.label&&(b2.write(" "),this[a2.label.type](a2.label,b2)),b2.write(";")},ContinueStatement:function ContinueStatement(a2,b2){b2.write("continue"),null!=a2.label&&(b2.write(" "),this[a2.label.type](a2.label,b2)),b2.write(";")},WithStatement:function WithStatement(a2,b2){b2.write("with ("),this[a2.object.type](a2.object,b2),b2.write(") "),this[a2.body.type](a2.body,b2)},SwitchStatement:function SwitchStatement(a2,b2){var c2=b2.indent.repeat(b2.indentLevel++),d2=b2.lineEnd,e3=b2.writeComments;b2.indentLevel++;var f2=c2+b2.indent,g2=f2+b2.indent;b2.write("switch ("),this[a2.discriminant.type](a2.discriminant,b2),b2.write(") {"+d2);for(var h2,j2=a2.cases,l2=j2.length,m2=0;m2<l2;m2++){h2=j2[m2],e3&&null!=h2.comments&&k(b2,h2.comments,f2,d2),h2.test?(b2.write(f2+"case "),this[h2.test.type](h2.test,b2),b2.write(":"+d2)):b2.write(f2+"default:"+d2);for(var n3,o2=h2.consequent,p2=o2.length,q2=0;q2<p2;q2++)n3=o2[q2],e3&&null!=n3.comments&&k(b2,n3.comments,g2,d2),b2.write(g2),this[n3.type](n3,b2),b2.write(d2)}b2.indentLevel-=2,b2.write(c2+"}")},ReturnStatement:function ReturnStatement(a2,b2){b2.write("return"),a2.argument&&(b2.write(" "),this[a2.argument.type](a2.argument,b2)),b2.write(";")},ThrowStatement:function ThrowStatement(a2,b2){b2.write("throw "),this[a2.argument.type](a2.argument,b2),b2.write(";")},TryStatement:function TryStatement(a2,b2){if(b2.write("try "),this[a2.block.type](a2.block,b2),a2.handler){var c2=a2.handler;null==c2.param?b2.write(" catch "):(b2.write(" catch ("),this[c2.param.type](c2.param,b2),b2.write(") ")),this[c2.body.type](c2.body,b2)}a2.finalizer&&(b2.write(" finally "),this[a2.finalizer.type](a2.finalizer,b2))},WhileStatement:function WhileStatement(a2,b2){b2.write("while ("),this[a2.test.type](a2.test,b2),b2.write(") "),this[a2.body.type](a2.body,b2)},DoWhileStatement:function DoWhileStatement(a2,b2){b2.write("do "),this[a2.body.type](a2.body,b2),b2.write(" while ("),this[a2.test.type](a2.test,b2),b2.write(");")},ForStatement:function ForStatement(a2,b2){if(b2.write("for ("),null!=a2.init){var c2=a2.init;"V"===c2.type[0]?m(b2,c2):this[c2.type](c2,b2)}b2.write("; "),a2.test&&this[a2.test.type](a2.test,b2),b2.write("; "),a2.update&&this[a2.update.type](a2.update,b2),b2.write(") "),this[a2.body.type](a2.body,b2)},ForInStatement:r2=function(a2,b2){b2.write("for ".concat(a2["await"]?"await ":"","("));var c2=a2.left;"V"===c2.type[0]?m(b2,c2):this[c2.type](c2,b2),b2.write("I"===a2.type[3]?" in ":" of "),this[a2.right.type](a2.right,b2),b2.write(") "),this[a2.body.type](a2.body,b2)},ForOfStatement:r2,DebuggerStatement:function DebuggerStatement(a2,b2){b2.write("debugger;",a2)},FunctionDeclaration:s=function(a2,b2){b2.write((a2.async?"async ":"")+(a2.generator?"function* ":"function ")+(a2.id?a2.id.name:""),a2),f(b2,a2.params),b2.write(" "),this[a2.body.type](a2.body,b2)},FunctionExpression:s,VariableDeclaration:function VariableDeclaration(a2,b2){m(b2,a2),b2.write(";")},VariableDeclarator:function VariableDeclarator(a2,b2){this[a2.id.type](a2.id,b2),null!=a2.init&&(b2.write(" = "),this[a2.init.type](a2.init,b2))},ClassDeclaration:function ClassDeclaration(a2,b2){if(b2.write("class "+(a2.id?"".concat(a2.id.name," "):""),a2),a2.superClass){b2.write("extends ");var c2=a2.superClass,d2=c2.type,e3=b2.expressionsPrecedence[d2];("C"!==d2[0]||"l"!==d2[1]||"E"!==d2[5])&&(e3===p||e3<b2.expressionsPrecedence.ClassExpression)?(b2.write("("),this[a2.superClass.type](c2,b2),b2.write(")")):this[c2.type](c2,b2),b2.write(" ")}this.ClassBody(a2.body,b2)},ImportDeclaration:function ImportDeclaration(a2,b2){b2.write("import ");var c2=a2.specifiers,d2=a2.attributes,e3=c2.length,f2=0;if(0<e3){for(;f2<e3;){0<f2&&b2.write(", ");var g2=c2[f2],h2=g2.type[6];if("D"===h2)b2.write(g2.local.name,g2),f2++;else if("N"===h2)b2.write("* as "+g2.local.name,g2),f2++;else break}if(f2<e3){for(b2.write("{");;){var j2=c2[f2],k2=j2.imported.name;if(b2.write(k2,j2),k2!==j2.local.name&&b2.write(" as "+j2.local.name),++f2<e3)b2.write(", ");else break}b2.write("}")}b2.write(" from ")}if(this.Literal(a2.source,b2),d2&&0<d2.length){b2.write(" with { ");for(var l2=0;l2<d2.length;l2++)this.ImportAttribute(d2[l2],b2),l2<d2.length-1&&b2.write(", ");b2.write(" }")}b2.write(";")},ImportAttribute:function ImportAttribute(a2,b2){this.Identifier(a2.key,b2),b2.write(": "),this.Literal(a2.value,b2)},ImportExpression:function ImportExpression(a2,b2){b2.write("import("),this[a2.source.type](a2.source,b2),b2.write(")")},ExportDefaultDeclaration:function ExportDefaultDeclaration(a2,b2){b2.write("export default "),this[a2.declaration.type](a2.declaration,b2),null!=b2.expressionsPrecedence[a2.declaration.type]&&"F"!==a2.declaration.type[0]&&b2.write(";")},ExportNamedDeclaration:function ExportNamedDeclaration(a2,b2){if(b2.write("export "),a2.declaration)this[a2.declaration.type](a2.declaration,b2);else{b2.write("{");var c2=a2.specifiers,d2=c2.length;if(0<d2)for(var g2=0;;){var e3=c2[g2],f2=e3.local.name;if(b2.write(f2,e3),f2!==e3.exported.name&&b2.write(" as "+e3.exported.name),++g2<d2)b2.write(", ");else break}if(b2.write("}"),a2.source&&(b2.write(" from "),this.Literal(a2.source,b2)),a2.attributes&&0<a2.attributes.length){b2.write(" with { ");for(var h2=0;h2<a2.attributes.length;h2++)this.ImportAttribute(a2.attributes[h2],b2),h2<a2.attributes.length-1&&b2.write(", ");b2.write(" }")}b2.write(";")}},ExportAllDeclaration:function ExportAllDeclaration(a2,b2){if(null==a2.exported?b2.write("export * from "):b2.write("export * as "+a2.exported.name+" from "),this.Literal(a2.source,b2),a2.attributes&&0<a2.attributes.length){b2.write(" with { ");for(var c2=0;c2<a2.attributes.length;c2++)this.ImportAttribute(a2.attributes[c2],b2),c2<a2.attributes.length-1&&b2.write(", ");b2.write(" }")}b2.write(";")},MethodDefinition:function MethodDefinition(a2,b2){a2["static"]&&b2.write("static ");var c2=a2.kind[0];("g"===c2||"s"===c2)&&b2.write(a2.kind+" "),a2.value.async&&b2.write("async "),a2.value.generator&&b2.write("*"),a2.computed?(b2.write("["),this[a2.key.type](a2.key,b2),b2.write("]")):this[a2.key.type](a2.key,b2),f(b2,a2.value.params),b2.write(" "),this[a2.value.body.type](a2.value.body,b2)},ClassExpression:function ClassExpression(a2,b2){this.ClassDeclaration(a2,b2)},ArrowFunctionExpression:function ArrowFunctionExpression(a2,b2){b2.write(a2.async?"async ":"",a2);var c2=a2.params;null!=c2&&(1===c2.length&&"I"===c2[0].type[0]?b2.write(c2[0].name,c2[0]):f(b2,a2.params)),b2.write(" => "),"O"===a2.body.type[0]?(b2.write("("),this.ObjectExpression(a2.body,b2),b2.write(")")):this[a2.body.type](a2.body,b2)},ThisExpression:function ThisExpression(a2,b2){b2.write("this",a2)},Super:function Super(a2,b2){b2.write("super",a2)},RestElement:t2=function(a2,b2){b2.write("..."),this[a2.argument.type](a2.argument,b2)},SpreadElement:t2,YieldExpression:function YieldExpression(a2,b2){b2.write(a2.delegate?"yield*":"yield"),a2.argument&&(b2.write(" "),this[a2.argument.type](a2.argument,b2))},AwaitExpression:function AwaitExpression(a2,b2){b2.write("await ",a2),h(b2,a2.argument,a2)},TemplateLiteral:function TemplateLiteral(a2,b2){var c2=a2.quasis,d2=a2.expressions;b2.write("`");for(var e3=d2.length,f2=0;f2<e3;f2++){var g2=d2[f2],h2=c2[f2];b2.write(h2.value.raw,h2),b2.write("${"),this[g2.type](g2,b2),b2.write("}")}var j2=c2[c2.length-1];b2.write(j2.value.raw,j2),b2.write("`")},TemplateElement:function TemplateElement(a2,b2){b2.write(a2.value.raw,a2)},TaggedTemplateExpression:function TaggedTemplateExpression(a2,b2){h(b2,a2.tag,a2),this[a2.quasi.type](a2.quasi,b2)},ArrayExpression:v=function(a2,b2){if(b2.write("["),0<a2.elements.length)for(var c2,d2=a2.elements,e3=d2.length,f2=0;;)if(c2=d2[f2],null!=c2&&this[c2.type](c2,b2),++f2<e3)b2.write(", ");else{null==c2&&b2.write(", ");break}b2.write("]")},ArrayPattern:v,ObjectExpression:function ObjectExpression(a2,b2){var c2=b2.indent.repeat(b2.indentLevel++),d2=b2.lineEnd,e3=b2.writeComments,f2=c2+b2.indent;if(b2.write("{"),0<a2.properties.length){b2.write(d2),e3&&null!=a2.comments&&k(b2,a2.comments,f2,d2);for(var g2,h2=a2.properties,j2=h2.length,l2=0;;)if(g2=h2[l2],e3&&null!=g2.comments&&k(b2,g2.comments,f2,d2),b2.write(f2),this[g2.type](g2,b2),++l2<j2)b2.write(","+d2);else break;b2.write(d2),e3&&null!=a2.trailingComments&&k(b2,a2.trailingComments,f2,d2),b2.write(c2+"}")}else e3?null==a2.comments?null==a2.trailingComments?b2.write("}"):(b2.write(d2),k(b2,a2.trailingComments,f2,d2),b2.write(c2+"}")):(b2.write(d2),k(b2,a2.comments,f2,d2),null!=a2.trailingComments&&k(b2,a2.trailingComments,f2,d2),b2.write(c2+"}")):b2.write("}");b2.indentLevel--},Property:function Property(a2,b2){a2.method||"i"!==a2.kind[0]?this.MethodDefinition(a2,b2):(!a2.shorthand&&(a2.computed?(b2.write("["),this[a2.key.type](a2.key,b2),b2.write("]")):this[a2.key.type](a2.key,b2),b2.write(": ")),this[a2.value.type](a2.value,b2))},PropertyDefinition:function PropertyDefinition(a2,b2){return a2["static"]&&b2.write("static "),a2.computed&&b2.write("["),this[a2.key.type](a2.key,b2),a2.computed&&b2.write("]"),null==a2.value?void("F"!==a2.key.type[0]&&b2.write(";")):void(b2.write(" = "),this[a2.value.type](a2.value,b2),b2.write(";"))},ObjectPattern:function ObjectPattern(a2,b2){if(b2.write("{"),0<a2.properties.length)for(var c2=a2.properties,d2=c2.length,e3=0;;)if(this[c2[e3].type](c2[e3],b2),++e3<d2)b2.write(", ");else break;b2.write("}")},SequenceExpression:function SequenceExpression(a2,b2){f(b2,a2.expressions)},UnaryExpression:function UnaryExpression(a2,b2){if(a2.prefix){var c2=a2.operator,d2=a2.argument,e3=a2.argument.type;b2.write(c2);var f2=g(b2,d2,a2);!f2&&(1<c2.length||"U"===e3[0]&&("n"===e3[1]||"p"===e3[1])&&d2.prefix&&d2.operator[0]===c2&&("+"===c2||"-"===c2))&&b2.write(" "),f2?(b2.write(1<c2.length?" (":"("),this[e3](d2,b2),b2.write(")")):this[e3](d2,b2)}else this[a2.argument.type](a2.argument,b2),b2.write(a2.operator)},UpdateExpression:function UpdateExpression(a2,b2){a2.prefix?(b2.write(a2.operator),this[a2.argument.type](a2.argument,b2)):(this[a2.argument.type](a2.argument,b2),b2.write(a2.operator))},AssignmentExpression:function AssignmentExpression(a2,b2){this[a2.left.type](a2.left,b2),b2.write(" "+a2.operator+" "),this[a2.right.type](a2.right,b2)},AssignmentPattern:function AssignmentPattern(a2,b2){this[a2.left.type](a2.left,b2),b2.write(" = "),this[a2.right.type](a2.right,b2)},BinaryExpression:u=function(a2,b2){var c2="in"===a2.operator;c2&&b2.write("("),h(b2,a2.left,a2,false),b2.write(" "+a2.operator+" "),h(b2,a2.right,a2,true),c2&&b2.write(")")},LogicalExpression:u,ConditionalExpression:function ConditionalExpression(a2,b2){var c2=a2.test,d2=b2.expressionsPrecedence[c2.type];d2===p||d2<=b2.expressionsPrecedence.ConditionalExpression?(b2.write("("),this[c2.type](c2,b2),b2.write(")")):this[c2.type](c2,b2),b2.write(" ? "),this[a2.consequent.type](a2.consequent,b2),b2.write(" : "),this[a2.alternate.type](a2.alternate,b2)},NewExpression:function NewExpression(a2,b2){b2.write("new ");var c2=b2.expressionsPrecedence[a2.callee.type];c2===p||c2<b2.expressionsPrecedence.CallExpression||l(a2.callee)?(b2.write("("),this[a2.callee.type](a2.callee,b2),b2.write(")")):this[a2.callee.type](a2.callee,b2),f(b2,a2.arguments)},CallExpression:function CallExpression(a2,b2){var c2=b2.expressionsPrecedence[a2.callee.type];c2===p||c2<b2.expressionsPrecedence.CallExpression?(b2.write("("),this[a2.callee.type](a2.callee,b2),b2.write(")")):this[a2.callee.type](a2.callee,b2),a2.optional&&b2.write("?."),f(b2,a2.arguments)},ChainExpression:function ChainExpression(a2,b2){this[a2.expression.type](a2.expression,b2)},MemberExpression:function MemberExpression(a2,b2){var c2=b2.expressionsPrecedence[a2.object.type];c2===p||c2<b2.expressionsPrecedence.MemberExpression?(b2.write("("),this[a2.object.type](a2.object,b2),b2.write(")")):this[a2.object.type](a2.object,b2),a2.computed?(a2.optional&&b2.write("?."),b2.write("["),this[a2.property.type](a2.property,b2),b2.write("]")):(a2.optional?b2.write("?."):b2.write("."),this[a2.property.type](a2.property,b2))},MetaProperty:function MetaProperty(a2,b2){b2.write(a2.meta.name+"."+a2.property.name,a2)},Identifier:function Identifier(a2,b2){b2.write(a2.name,a2)},PrivateIdentifier:function PrivateIdentifier(a2,b2){b2.write("#".concat(a2.name),a2)},Literal:function Literal(a2,b2){null==a2.raw?null==a2.regex?null==a2.bigint?b2.write(n2(a2.value),a2):b2.write(a2.bigint+"n",a2):this.RegExpLiteral(a2,b2):b2.write(a2.raw,a2)},RegExpLiteral:function RegExpLiteral(a2,b2){var c2=a2.regex;b2.write("/".concat(c2.pattern,"/").concat(c2.flags),a2)}};a.GENERATOR=x2;var y={};a.baseGenerator=x2;var z=(function(){function a2(b2){c(this,a2);var d2=null==b2?y:b2;this.output="",null==d2.output?this.output="":(this.output=d2.output,this.write=this.writeToStream),this.generator=null==d2.generator?x2:d2.generator,this.expressionsPrecedence=null==d2.expressionsPrecedence?q:d2.expressionsPrecedence,this.indent=null==d2.indent?" ":d2.indent,this.lineEnd=null==d2.lineEnd?"\n":d2.lineEnd,this.indentLevel=null==d2.startingIndentLevel?0:d2.startingIndentLevel,this.writeComments=!!d2.comments&&d2.comments,null!=d2.sourceMap&&(this.write=null==d2.output?this.writeAndMap:this.writeToStreamAndMap,this.sourceMap=d2.sourceMap,this.line=1,this.column=0,this.lineEndSize=this.lineEnd.split("\n").length-1,this.mapping={original:null,generated:this,name:void 0,source:d2.sourceMap.file||d2.sourceMap._file})}return e2(a2,[{key:"write",value:function write(a3){this.output+=a3}},{key:"writeToStream",value:function writeToStream(a3){this.output.write(a3)}},{key:"writeAndMap",value:function writeAndMap(a3,b2){this.output+=a3,this.map(a3,b2)}},{key:"writeToStreamAndMap",value:function writeToStreamAndMap(a3,b2){this.output.write(a3),this.map(a3,b2)}},{key:"map",value:function map(a3,b2){if(null!=b2){var c2=b2.type;if("L"===c2[0]&&"n"===c2[2])return this.column=0,void this.line++;if(null!=b2.loc){var d2=this.mapping;d2.original=b2.loc.start,d2.name=b2.name,this.sourceMap.addMapping(d2)}if("T"===c2[0]&&"E"===c2[8]||"L"===c2[0]&&"i"===c2[1]&&"string"==typeof b2.value){for(var e3=a3.length,f2=this.column,g2=this.line,h2=0;h2<e3;h2++)"\n"===a3[h2]?(f2=0,g2++):f2++;return this.column=f2,void(this.line=g2)}}var j2=a3.length,k2=this.lineEnd;0<j2&&(0<this.lineEndSize&&(1===k2.length?a3[j2-1]===k2:a3.endsWith(k2))?(this.line+=this.lineEndSize,this.column=0):this.column+=j2)}},{key:"toString",value:function toString(){return this.output}}]),a2})()});class WalkerBase{constructor(){this.should_skip=false;this.should_remove=false;this.replacement=null;this.context={skip:()=>this.should_skip=true,remove:()=>this.should_remove=true,replace:node=>this.replacement=node}}replace(parent2,prop,index2,node){if(parent2&&prop){if(index2!=null){parent2[prop][index2]=node}else{parent2[prop]=node}}}remove(parent2,prop,index2){if(parent2&&prop){if(index2!==null&&index2!==void 0){parent2[prop].splice(index2,1)}else{delete parent2[prop]}}}}class SyncWalker extends WalkerBase{constructor(enter,leave){super();this.should_skip=false;this.should_remove=false;this.replacement=null;this.context={skip:()=>this.should_skip=true,remove:()=>this.should_remove=true,replace:node=>this.replacement=node};this.enter=enter;this.leave=leave}visit(node,parent2,prop,index2){if(node){if(this.enter){const _should_skip=this.should_skip;const _should_remove=this.should_remove;const _replacement=this.replacement;this.should_skip=false;this.should_remove=false;this.replacement=null;this.enter.call(this.context,node,parent2,prop,index2);if(this.replacement){if(Array.isArray(this.replacement)){var expressions=[];for(let rp=0;rp<this.replacement.length;rp++){expressions.push(this.replacement[rp])}if(this.replacement.length>1){node={"type":"VariableDeclaration","start":node.start,"kind":"let","declarations":expressions,"level":node.level,"scope":node.scope}}else{node={"type":"ExpressionStatement","expression":{"type":"SequenceExpression","expressions":expressions,"level":node.level,"scope":node.scope},"level":node.level,"scope":node.scope}}this.replace(parent2,prop,index2,node)}else{node=this.replacement;this.replace(parent2,prop,index2,node)}}if(this.should_remove){this.remove(parent2,prop,index2)}const skipped=this.should_skip;const removed=this.should_remove;this.should_skip=_should_skip;this.should_remove=_should_remove;this.replacement=_replacement;if(skipped)return node;if(removed)return null}let key;for(key in node){const value=node[key];if(value&&typeof value==="object"){if(Array.isArray(value)){const nodes2=value;for(let i2=0;i2<nodes2.length;i2+=1){const item=nodes2[i2];if(isNode(item)){if(!this.visit(item,node,key,i2)){i2--}}}}else if(isNode(value)){this.visit(value,node,key,null)}}}if(this.leave){const _replacement=this.replacement;const _should_remove=this.should_remove;this.replacement=null;this.should_remove=false;this.leave.call(this.context,node,parent2,prop,index2);if(this.replacement){if(Array.isArray(this.replacement)){for(let rp=0;rp<this.replacement.length;rp++){node=this.replacement[rp];this.replace(parent2,prop,index2,node)}}else{node=this.replacement;this.replace(parent2,prop,index2,node)}}if(this.should_remove){this.remove(parent2,prop,index2)}const removed=this.should_remove;this.replacement=_replacement;this.should_remove=_should_remove;if(removed)return null}}return node}}function isNode(value){return value!==null&&typeof value==="object"&&"type"in value&&typeof value.type==="string"}function walk(ast,{enter,leave}){const instance=new SyncWalker(enter,leave);return instance.visit(ast,null)}function getProgramBody(node){if(node.type=="Program"){return node.body}return node}function parseNode(node){}function checkNodeL1(node,varz,vazzz){try{if(node&&typeof node==="object"){if(Array.isArray(node)){for(let i2=0;i2<node.length;i2++){const nd=node[i2];if(isNode(nd)){if(nd.type==="VariableDeclaration"){let declarators=nd.declarations;for(let x2=0;x2<declarators.length;x2++){let dec=declarators[x2].id;if(vazzz.includes(dec.name)){varz.push({name:dec.name,node:dec});dec.marked=true}}}else if(nd.type=="Identifier"){}parseNode(nd)}}}else if(isNode(node)){}}}catch(e2){}}function getL1Vs(AST,view,vazzz){var level=0,block=[{start:0}];var varz=view?.varz??[];let nodes2=getProgramBody(AST);checkNodeL1(nodes2,varz,vazzz);return{"varz":varz,"AST":AST}}function getWatcher(AST,view,vazzz,targetKey="View"){AST=JSON.parse(JSON.stringify(AST));let Vars=getL1Vs(AST,view,vazzz);AST=Vars["AST"];let varz=Vars["varz"];validateBeforeRewrite(AST,view);AST=changeReactiveVarsOccurences(AST,vazzz,targetKey);AST=transformTopLevelDeclarations(AST,vazzz,targetKey);return{"code":astring.generate(AST),"varz":varz}}function validateBeforeRewrite(AST,view){try{new Function(astring.generate(AST))}catch(e2){if(typeof reportLumenError==="function"){reportLumenError({stage:"validate",view:view?.name,error:e2,hint:"This is a real JavaScript error in your <script> block (for example, a variable declared twice with let/const) \u2014 fix it in the .view file; it will not surface again once rewritten."})}}}function buildTargetRootExpr(targetKey){const segments=Array.isArray(targetKey)?targetKey:[targetKey];let expr2={type:"Identifier",name:"_vt"};for(const seg of segments){if(typeof seg==="number"){expr2={type:"MemberExpression",object:expr2,property:{type:"Literal",value:seg,raw:String(seg)},computed:true}}else{expr2={type:"MemberExpression",object:expr2,property:{type:"Identifier",name:seg},computed:false}}}return expr2}function changeReactiveVarsOccurences(AST,reactiveVariables,targetKey="View"){const reactive=new Set(reactiveVariables||[]);const scopeStack=[];const bindingIdNodes=new WeakSet;const pushScope=isFunction=>scopeStack.push({isFunction:!!isFunction,names:new Set});const popScope=()=>scopeStack.pop();const currentScope=()=>scopeStack[scopeStack.length-1];function declare(name,kind){if(!name)return;if(kind==="var"||kind==="function"){for(let i2=scopeStack.length-1;i2>=0;i2--){if(scopeStack[i2].isFunction||i2===0){scopeStack[i2].names.add(name);return}}}else{currentScope().names.add(name)}}function rootHas(name){return scopeStack.length>0&&scopeStack[0].names.has(name)}function isShadowedFromRoot(name){for(let i2=scopeStack.length-1;i2>=1;i2--){if(scopeStack[i2].names.has(name))return true}return false}function visitPattern(node,onId){if(!node)return;switch(node.type){case"Identifier":onId(node);break;case"RestElement":visitPattern(node.argument,onId);break;case"AssignmentPattern":visitPattern(node.left,onId);break;case"ArrayPattern":for(const el2 of node.elements)if(el2)visitPattern(el2,onId);break;case"ObjectPattern":for(const p of node.properties){if(p.type==="Property")visitPattern(p.value,onId);else if(p.type==="RestElement")visitPattern(p.argument,onId)}break;default:break}}function markPatternBindings(pattern,kind="var"){if(!pattern)return;visitPattern(pattern,idNode=>{bindingIdNodes.add(idNode);declare(idNode.name,kind)})}function predeclareProgram(programNode){if(!programNode||!Array.isArray(programNode.body))return;for(const stmt of programNode.body){if(stmt.type==="VariableDeclaration"){for(const d of stmt.declarations){visitPattern(d.id,id2=>{bindingIdNodes.add(id2);declare(id2.name,stmt.kind)})}}else if(stmt.type==="FunctionDeclaration"&&stmt.id){bindingIdNodes.add(stmt.id);declare(stmt.id.name,"function")}else if(stmt.type==="ClassDeclaration"&&stmt.id){bindingIdNodes.add(stmt.id);declare(stmt.id.name,"let")}else if(stmt.type==="ImportDeclaration"){for(const spec of stmt.specifiers||[]){if(spec.local){bindingIdNodes.add(spec.local);declare(spec.local.name,"const")}}}}}function predeclareBlockLexicals(blockNode){if(!blockNode||!Array.isArray(blockNode.body))return;for(const stmt of blockNode.body){if(stmt.type==="VariableDeclaration"&&stmt.kind!=="var"){for(const d of stmt.declarations){visitPattern(d.id,id2=>{bindingIdNodes.add(id2);currentScope().names.add(id2.name)})}}else if(stmt.type==="FunctionDeclaration"&&stmt.id){bindingIdNodes.add(stmt.id);currentScope().names.add(stmt.id.name)}else if(stmt.type==="ClassDeclaration"&&stmt.id){bindingIdNodes.add(stmt.id);currentScope().names.add(stmt.id.name)}}}function predeclareForHeader(node){const header=node.type==="ForStatement"?node.init:node.left;if(header&&header.type==="VariableDeclaration"&&header.kind!=="var"){for(const d of header.declarations){visitPattern(d.id,id2=>{bindingIdNodes.add(id2);currentScope().names.add(id2.name)})}}}function shouldSkipIdentifier(node,parent2,prop){if(!parent2)return false;if(parent2.type==="LabeledStatement"&&prop==="label"||(parent2.type==="BreakStatement"||parent2.type==="ContinueStatement")&&prop==="label")return true;if(parent2.type==="MemberExpression"){if(prop==="property"&&parent2.computed===false)return true}if(parent2.type==="Property"){if(prop==="key"&&parent2.computed===false)return true}if((parent2.type==="MethodDefinition"||parent2.type==="ClassProperty"||parent2.type==="PropertyDefinition")&&prop==="key"&&parent2.computed===false)return true;if(parent2.type==="ImportSpecifier"||parent2.type==="ImportDefaultSpecifier"||parent2.type==="ImportNamespaceSpecifier"||parent2.type==="ExportSpecifier")return true;return false}function walk2(node,parent2,prop,index2){if(!node||typeof node!=="object")return;switch(node.type){case"Program":pushScope(true);predeclareProgram(node);break;case"BlockStatement":case"StaticBlock":pushScope(false);predeclareBlockLexicals(node);break;case"FunctionDeclaration":if(node.id){bindingIdNodes.add(node.id);declare(node.id.name,"function")}pushScope(true);for(const p of node.params)markPatternBindings(p,"param");break;case"FunctionExpression":pushScope(true);if(node.id){bindingIdNodes.add(node.id);declare(node.id.name,"let")}for(const p of node.params)markPatternBindings(p,"param");break;case"ArrowFunctionExpression":pushScope(true);for(const p of node.params)markPatternBindings(p,"param");break;case"CatchClause":pushScope(false);if(node.param)markPatternBindings(node.param,"let");break;case"ForStatement":case"ForInStatement":case"ForOfStatement":pushScope(false);predeclareForHeader(node);break;case"VariableDeclaration":for(const decl of node.declarations){markPatternBindings(decl.id,node.kind||"var")}break;case"ClassDeclaration":if(node.id){bindingIdNodes.add(node.id);declare(node.id.name,"let")}break;case"ImportDeclaration":for(const spec of node.specifiers||[]){if(spec.local){bindingIdNodes.add(spec.local);declare(spec.local.name,"const")}}break}for(const key in node){if(key==="parent")continue;const child=node[key];if(Array.isArray(child)){for(let i2=0;i2<child.length;i2++){if(child[i2]&&typeof child[i2]==="object"){walk2(child[i2],node,key,i2)}}}else if(child&&typeof child==="object"){walk2(child,node,key,null)}}if(node.type==="Identifier"){const name=node.name;if(!reactive.has(name)||bindingIdNodes.has(node)){}else if(!rootHas(name)){}else if(isShadowedFromRoot(name)){}else if(shouldSkipIdentifier(node,parent2,prop)){}else{if(parent2&&parent2.type==="Property"&&parent2.shorthand&&prop==="value"){parent2.shorthand=false}const replacement={type:"MemberExpression",object:{type:"MemberExpression",object:buildTargetRootExpr(targetKey),property:{type:"Identifier",name:"vars"},computed:false},property:{type:"Literal",value:name,raw:JSON.stringify(name)},computed:true};if(parent2){if(index2!==null&&Array.isArray(parent2[prop])){parent2[prop][index2]=replacement}else{parent2[prop]=replacement}}else{Object.keys(node).forEach(k=>delete node[k]);Object.assign(node,replacement)}}}switch(node.type){case"Program":case"BlockStatement":case"StaticBlock":case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"CatchClause":case"ForStatement":case"ForInStatement":case"ForOfStatement":popScope();break;default:break}}walk2(AST,null,null,null);return AST}function _reactiveAssignStatement(name,init2,targetKey="View"){return{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",computed:true,object:{type:"MemberExpression",computed:false,object:buildTargetRootExpr(targetKey),property:{type:"Identifier",name:"vars"}},property:{type:"Literal",value:name}},right:init2||{type:"Identifier",name:"undefined"}}}}function _fnRegisterStatement(name,targetKey){return{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",computed:true,object:{type:"MemberExpression",computed:false,object:buildTargetRootExpr(targetKey),property:{type:"Identifier",name:"fns"}},property:{type:"Literal",value:name}},right:{type:"Identifier",name}}}}function transformTopLevelDeclarations(AST,reactiveVariables,targetKey="View"){const reactive=new Set(reactiveVariables||[]);const newBody=[];for(const stmt of AST.body){if(stmt.type==="FunctionDeclaration"&&stmt.id){newBody.push(stmt);newBody.push(_fnRegisterStatement(stmt.id.name,targetKey));continue}if(stmt.type!=="VariableDeclaration"){newBody.push(stmt);continue}const reactiveDecls=stmt.declarations.filter(d=>reactive.has(d.id.name));const nonReactiveDecls=stmt.declarations.filter(d=>!reactive.has(d.id.name));if(reactiveDecls.length===0){newBody.push(stmt);continue}for(const decl of reactiveDecls){newBody.push(_reactiveAssignStatement(decl.id.name,decl.init,targetKey))}if(nonReactiveDecls.length>0){newBody.push({type:"VariableDeclaration",kind:stmt.kind,declarations:nonReactiveDecls})}}AST.body=newBody;return AST}if(typeof module!=="undefined"&&module.exports){module.exports={getWatcher,changeReactiveVarsOccurences,transformTopLevelDeclarations,validateBeforeRewrite}}var cl=console.log;class _v{static name;static type;static vars;static fns;static rvs;static _pv;static mx;static views;static hst;static settings;constructor(obj){this.name=obj.name??"home";this.type=obj.type??"main";this.hst=obj.hst??[];this.views=obj.views??[];this.vars=obj.vars??{};this.fns=obj.fns??{};this.rvs=obj.rvs??{};this._pv=obj._pv??null;this.mx=obj.mx??[];this.settings=obj.settings??{layout:"default",requireAuth:false}}}const consoleLogOriginal=console.log;console.log=function(){for(let i2=0;i2<arguments.length;i2++){const arg=arguments[i2];if(arg&&arg.hasOwnProperty("__isProxy")||arg?.target){arguments[i2]=arguments[i2].target}}consoleLogOriginal.apply(console,arguments)};var _lumenDevMode=true;var _lumenErrorLog=[];var _mountedSubviewEngines=[];var EXPECTED_HST_FORMAT_VERSION=1;var _entityDecodeEl;function decodeHtmlEntities(str){if(!str||str.indexOf("&")===-1)return str;if(!_entityDecodeEl)_entityDecodeEl=document.createElement("textarea");_entityDecodeEl.innerHTML=str;return _entityDecodeEl.value}function _translateLumenError(message){if(!message)return message;return message.replace(/_vt\.View\.vars\[["'`]([^"'`\]]+)["'`]\]/g,"$1")}function reportLumenError(info){info=info||{};var rawMessage=info.message||info.error&&info.error.message||"Unknown error";var entry={time:new Date().toISOString(),stage:info.stage||"runtime",view:info.view||(typeof _vt!=="undefined"&&_vt.View?_vt.View.name:void 0),expr:info.expr,message:_translateLumenError(rawMessage),hint:info.hint};_lumenErrorLog.push(entry);if(_lumenDevMode){console.error("[LumenJS] "+entry.stage+' error in "'+(entry.view||"unknown")+'"'+(entry.expr?" \u2014 "+entry.expr:"")+": "+entry.message+(entry.hint?"\n "+entry.hint:""))}return entry}function _x(_x2){var currPath=[];function _dispatchVarsUpdate(key){let varsIdx=currPath.indexOf("vars");if(varsIdx===-1)return;let varName2=varsIdx<currPath.length-1?currPath[varsIdx+1]:key;let rootPath=currPath.slice(0,varsIdx);try{if(typeof watch!=="undefined"&&watch&&Object.prototype.hasOwnProperty.call(watch,varName2)&&typeof watch[varName2]==="function"){watch[varName2]()}}catch(e2){cl(e2)}if(rootPath[0]==="Global"){try{if(typeof window!=="undefined")window[varName2]=_x2.Global.vars[varName2]}catch(e2){}if(_vt.View._re)_vt.View._re.update(varName2);for(const regionName in _vt.Widgets){if(_vt.Widgets[regionName]&&_vt.Widgets[regionName]._re){_vt.Widgets[regionName]._re.update(varName2)}}for(let msi=_mountedSubviewEngines.length-1;msi>=0;msi--){let sve=_mountedSubviewEngines[msi];let sveNode=sve._RealDOM&&sve._RealDOM[0];if(sveNode&&!sveNode.isConnected){_mountedSubviewEngines.splice(msi,1);continue}sve.update(varName2)}return}let owner=_x2;for(let i2=0;i2<rootPath.length&&owner;i2++){owner=owner[rootPath[i2]]}if(owner&&owner._re)owner._re.update(varName2)}const handler={get(target,key){if(key=="__isProxy")return true;if(target===_x2)currPath=[];currPath.push(key);if(typeof target[key]==="object"&&target[key]!==null&&key!="_re"){return new Proxy(target[key],handler)}else{return target[key]??(key=="target"?target:void 0)??void 0}},set(target,key,value){target[key]=value;try{_dispatchVarsUpdate(key)}catch(e2){cl(e2)}currPath=[];return true},deleteProperty(target,key){if(!(key in target)){return false}delete target[key];try{_dispatchVarsUpdate(key)}catch(e2){cl(e2)}return true},ownKeys(target){return Reflect.ownKeys(target)},has(target,key){return key in target},defineProperty(target,key,descriptor){if(descriptor&&"value"in descriptor){target[key]=descriptor.value}return target},getOwnPropertyDescriptor(target,key){const value=target[key];return key in target?{value,enumerable:true,configurable:true}:void 0}};var x2=new Proxy(_x2,handler);return x2}let _vt=_x({"View":new _v({}),"Global":{"vars":{},"fns":{}},"Widgets":{}});function touch(name){if(_vt.Global.vars.hasOwnProperty(name)){_vt.Global.vars[name]=_vt.Global.vars[name]}}var _deepReactiveCache=typeof WeakMap!=="undefined"?new WeakMap:null;function _deepReactive(obj,onChange){if(obj===null||typeof obj!=="object")return obj;if(_deepReactiveCache&&_deepReactiveCache.has(obj))return _deepReactiveCache.get(obj);var proxy=new Proxy(obj,{get(target,key){var v=target[key];if(v!==null&&typeof v==="object"&&typeof key!=="symbol"){return _deepReactive(v,onChange)}return v},set(target,key,value){target[key]=value;onChange();return true},deleteProperty(target,key){if(key in target)delete target[key];onChange();return true}});if(_deepReactiveCache)_deepReactiveCache.set(obj,proxy);return proxy}function _lookupInWidgets(name){for(const wname in _vt.Widgets){if(_vt.Widgets[wname].vars.hasOwnProperty(name))return _vt.Widgets[wname].vars[name]}return void 0}function _resolveScopePathTarget(scopePath){let target=_vt;for(let i2=0;i2<scopePath.length;i2++)target=target[scopePath[i2]];return target}function _evalEventScopedExpr(ownerRe,expr){if(!ownerRe||!ownerRe.view)return eval(expr);let ownVars=ownerRe.view.vars||{};let widgetsVars=_mergedWidgetsVars();let scopeProxy=new Proxy({},{has(target,key){if(typeof key==="symbol")return false;return ownVars.hasOwnProperty(key)||widgetsVars.hasOwnProperty(key)||_vt.Global.vars.hasOwnProperty(key)},get(target,key){if(ownVars.hasOwnProperty(key))return ownVars[key];if(widgetsVars.hasOwnProperty(key))return widgetsVars[key];return _vt.Global.vars[key]},set(target,key,value){try{if(ownVars.hasOwnProperty(key)&&ownerRe.view.scopePath){_resolveScopePathTarget(ownerRe.view.scopePath).vars[key]=value}else if(widgetsVars.hasOwnProperty(key)){for(const wname in _vt.Widgets){if(_vt.Widgets[wname].vars.hasOwnProperty(key)){_vt.Widgets[wname].vars[key]=value;break}}}else{_vt.Global.vars[key]=value}}catch(e2){cl(e2)}return true}});function _runWithScope(expr){with(scopeProxy){return eval(expr)}}return _runWithScope(expr)}function _mergedWidgetsVars(){let out={};let names=Object.keys(_vt.Widgets).reverse();for(const wname of names){out={...out,..._vt.Widgets[wname].vars}}return out}class _lm{_RealDOM=[];_effects={};_cc={};_jj={};_ready=false;view=void 0;sbscrbs=[];reactiveVariables=[];vrs={};_CXR=[];_LXR=[];constructor(view){this.view=view;this.view._re=this;this.reactiveVariables=view?.rvs??{};this.init();if(this.view.type=="main")_vt.View=this.view;if(this.view._pv){this.view._pv.subscribe(this.view)}return this}init(){var par2=this;this.view.hst.forEach(function(doc2){par2.walk(doc2,null)})}subscribe(view){this.sbscrbs.push(view)}scopedEval(context,expr2,kk){let ctx=this.concatVarsAtLevel(context,this);if(kk){if(!ctx.hasOwnProperty(kk))return void 0;delete ctx[kk]}try{const evaluator=Function.apply(null,[...Object.keys(ctx),"expr","return eval(expr)"]);return evaluator.apply(null,[...Object.values(ctx),expr2])}catch(e2){if(e2 instanceof TypeError&&!kk){let hadUndefined=false;let strippedCtx={};for(const k2 in ctx){if(ctx[k2]===void 0||ctx[k2]===null){hadUndefined=true;continue}strippedCtx[k2]=ctx[k2]}if(hadUndefined){try{const evaluator2=Function.apply(null,[...Object.keys(strippedCtx),"expr","return eval(expr)"]);return evaluator2.apply(null,[...Object.values(strippedCtx),expr2])}catch(e22){reportLumenError({stage:"expression",expr:expr2,error:e22});return void 0}}}reportLumenError({stage:"expression",expr:expr2,error:e2});return void 0}}getVals(effect){let val2="";if(effect.type=="text"){if(!effect.isSplit){for(let i2=0;i2<effect.splits.length;i2++){let split=effect.splits[i2];if(split.type=="mustache"){val2+=this.getVal(split.content)}else{val2+=split.content}}}else{val2=this.getVal(effect.content)}}else if(effect.type=="attr"||effect.type=="event"){for(let i2=0;i2<effect.splits.length;i2++){let split=effect.splits[i2];if(split.type=="mustache"){val2+=this.getVal(split.content)}else{val2+=split.content}}}return val2}renderAll(){if(this._ready)return;this._ready=true;for(const rv in this._effects){if(Object.prototype.hasOwnProperty.call(this._effects,rv)){const effects=this._effects[rv];for(let ei=0;ei<effects.length;ei++){const effect=effects[ei];if(!effect.nd)continue;try{if(effect.type=="text"){effect.nd.textContent=this.render(effect)}else if(effect.type=="attr"){if(effect.name=="value"){effect.nd.value=this.render(effect)}else{effect.nd.setAttribute(effect.name,this.render(effect));if(effect.name=="view"){effect.nd.subPath=this.render(effect);renderView(this.render(effect),true,{})}}}else if(effect.type=="event"){effect.nd.events[effect.name]=this.render(effect)}}catch(e2){cl("Eeeeee",e2)}}}}this.updateCXRs();this.updateLXRs();this.updateVXRs();if(typeof appSettings!=="undefined"&&appSettings&&typeof appSettings.tick==="function"){try{appSettings.tick()}catch(e2){cl(e2)}}}chainConnected(cx){for(let i2=cx.chain.length-1;i2>=0;i2--){const cxs=cx.chain[i2];if(cxs.ref.isPreConnected){return true}}return false}async updateVXRs(k){let subsNames=[];for(let i2=0;i2<this.view.views.length;i2++){const _view=this.view.views[i2];if(!subsNames.includes(_view.subPath))subsNames.push(_view.subPath)}for(let i2=0;i2<subsNames.length;i2++){const n2=subsNames[i2];renderView(n2,true,{},"views",this.view.views,this.view.scopePath||["View"])}}async updateCXRs(k){for(let i2=0;i2<this._CXR.length;i2++){const cx=this._CXR[i2];if(cx.name=="if"){let isTrue=this.evalExp(cx.content,this.reactiveVariables);if(isTrue){await this.showSectionCX(cx,k)}else{await this.hideSectionCX(cx)}}else if(cx.name=="else-if"){if(!this.chainConnected(cx)){let isTrue=this.evalExp(cx.content,this.reactiveVariables);if(isTrue){await this.showSectionCX(cx,k)}else{await this.hideSectionCX(cx)}}else{await this.hideSectionCX(cx)}}else if(cx.name=="else"){if(!this.chainConnected(cx)){await this.showSectionCX(cx,k)}else{await this.hideSectionCX(cx)}}}}async showSectionCX(cx,k){let wasConnected=cx.ref.node.isConnected;cx.ref.isPreConnected=true;await renderSection(cx.ref,cx.doc,this,k);if(!wasConnected)await fireRenderHook(cx,"after-render",cx.ref.node,{visible:true})}async hideSectionCX(cx){if(cx.ref.node.isConnected)await fireRenderHook(cx,"before-render",cx.ref.node,{visible:false});cx.ref.isPreConnected=false;cx.ref.node.replaceWith(cx.ref)}render(effect){let x2="";try{if(effect.type=="text"||effect.type=="attr"||effect.type=="event"){x2=this.getVals(effect)}}catch(e2){cl(e2)}return x2}update(k){if(!this._ready)return;if(this._effects.hasOwnProperty(k)){const effects=this._effects[k];for(let ei=0;ei<effects.length;ei++){const effect=effects[ei];if(!effect.nd)continue;try{if(effect.type=="text"){effect.nd.textContent=this.render(effect)}else if(effect.type=="attr"){if(effect.name=="value"){effect.nd.value=this.render(effect)}else{effect.nd.setAttribute(effect.name,this.render(effect));if(effect.name=="view"){effect.nd.subPath=this.render(effect);renderView(this.render(effect),true,{})}}}else if(effect.type=="event"){effect.nd.events[effect.name]=this.render(effect)}}catch(e2){cl("Eeeeee",e2)}}}this.updateCXRs(k);this.updateLXRs(k);for(let sbscsi=0;sbscsi<this.sbscrbs.length;sbscsi++){const sbscr=this.sbscrbs[sbscsi];sbscr._re.update(k)}if(typeof appSettings!=="undefined"&&appSettings&&typeof appSettings.tick==="function"){try{appSettings.tick()}catch(e2){cl(e2)}}}async updateLXRs(k){for(let i2=0;i2<this._LXR.length;i2++){var cx=this._LXR[i2];var forX=cx.forX;if(k&&k!=forX["js"])continue;if(cx._updating)continue;cx._updating=true;try{var val2=this.getVal(forX["js"],"");var tempVal=[];if(this.typeStr(val2)=="number"){for(let i22=0;i22<val2;i22++){tempVal.push(i22)}val2=tempVal}let vals=[];let isObj=false;if(this.typeStr(val2)=="object"){isObj=true;for(const oKey in val2){if(Object.hasOwnProperty.call(val2,oKey)){const item=val2[oKey];let objj={key:oKey,value:item};vals.push(objj)}}}else vals=clone(val2);if(this.typeStr(vals)=="array"&&vals.length>0){let forIf=cx.cond;let limit=vals.length;let offset=0;if(cx.limit)limit=(isNaN(cx.limit)?cx.limit:limit)>vals.length?vals.length:cx.limit*1;if(cx.offset)offset=(isNaN(cx.offset)?cx.offset:offset)<0?0:cx.offset*1;let marray=[];if(forIf){marray=vals.slice(offset*1,vals.length)}else{marray=vals.slice(offset*1,limit*1+offset*1)}let myLimit=0;let arrayToRender=[];let arrayToRenderVXs=[];for(var index2=0;index2<marray.length;index2++){if(myLimit==limit*1)break;try{let vx={};vx["index"]=myLimit;if(forX["dx"]!="")vx[forX["dx"]]=myLimit;if(isObj){if(forX["as"]["v"]!=""){if(forX["as"]["k"])vx[forX["as"]["k"]]=marray[index2]["key"];if(forX["as"]["v"])vx[forX["as"]["v"]]=marray[index2]["value"]}else{if(forX["as"]["k"])vx[forX["as"]["k"]]=marray[index2]}vx["key"]=marray[index2]["key"];vx["value"]=marray[index2]["value"]}else{if(forX["as"]["k"])vx[forX["as"]["k"]]=marray[index2];else if(marray[index2]&&typeof marray[index2]==="object"){for(const k2 in marray[index2]){if(Object.prototype.hasOwnProperty.call(marray[index2],k2)){vx[k2]=marray[index2][k2]}}}}if(forIf){let _prevVrs=this.vrs;this.vrs=vx;let isTrue;try{isTrue=this.evalExp(forIf,[])}finally{this.vrs=_prevVrs}if(!isTrue)continue}let miIndexx=offset*1+index2*1;arrayToRender.push(marray[index2]);arrayToRenderVXs.push(vx);myLimit++}catch(e2){cl(e2)}}let oldATR=cx.atr;cx.atr=clone(arrayToRender);const actions=this.compareArrays(oldATR,arrayToRender);if(actions.length)await fireRenderHook(cx,"before-render",cx.ref.parentElement,{items:arrayToRender,actions});let addActions=[];let otherActions=[];for(let ai=0;ai<actions.length;ai++){(actions[ai].action=="add"?addActions:otherActions).push(actions[ai])}if(addActions.length){let createdSections=await Promise.all(addActions.map(actn=>{let vx=arrayToRenderVXs[actn.index];return this.createSection(cx,vx,isObj,forX)}));for(let ci=0;ci<createdSections.length;ci++){let cln=createdSections[ci];cx.ref.before(cln);cln.replaceWith(cln.node)}}for(let ai=0;ai<otherActions.length;ai++){const actn=otherActions[ai];if(actn.action=="remove"){var keyed=cx.key+"_"+actn.index;let tx2=cx.ref?.nodes[keyed];if(tx2){tx2.remove();tx2.node.remove();delete cx.tx?.nodes[keyed]}}else{var keyed=cx.key+"_"+actn.index;let tx2=cx.ref?.nodes[keyed];let vx=arrayToRenderVXs[actn.index];if(tx2){tx2._re.vrs=vx;if(tx2.isObj){if(tx2.forX.as["k"]!="")tx2._re.update(tx2.forX.as["k"]);else tx2._re.update(tx2.forX.js);if(tx2.forX.as["v"]!="")tx2._re.update(tx2.forX.as["v"]);for(let actnsi=0;actnsi<actn.updates.length;actnsi++){const actnu=actn.updates[actnsi];tx2._re.update(actnu.property)}}else{if(tx2.forX.as["k"]!="")tx2._re.update(tx2.forX.as["k"]);else tx2._re.update(tx2.forX.js)}}}}if(actions.length)await fireRenderHook(cx,"after-render",cx.ref.parentElement,{items:arrayToRender,actions})}else{cx.nodes=[]}}finally{cx._updating=false}}}compareLogic(array1,array2){if(array1.length===array2.length){return 1}else{if(array1.length>array2.length){return 2}else{return 3}}}compareArrays(array1,array2){const actions=[];const maxLength=Math.max(array1.length,array2.length);for(let i2=0;i2<maxLength;i2++){const element1=array1[i2];const element2=array2[i2];if(element2===void 0){actions.push({action:"remove",index:i2})}else if(element1===void 0){actions.push({action:"add",index:i2,element:element2})}else if(!this.deepCompare(element1,element2)){actions.push({action:"update",index:i2,updates:this.getUpdates(element1,element2)})}}return actions}findDeletedIndexes(array1,array2){const deletedIndexes=[];let par2=this;array1.forEach((item,index2)=>{const foundIndex=array2.findIndex(el2=>par2.deepCompare(el2,item));if(foundIndex===-1){deletedIndexes.push(index2)}});return deletedIndexes}findAddedIndexes(array1,array2){const addedIndexes=[];let par2=this;array2.forEach((item,index2)=>{const foundIndex=array1.findIndex(el2=>par2.deepCompare(el2,item));if(foundIndex===-1){addedIndexes.push(index2)}});return addedIndexes}deepCompare(obj1,obj2){return JSON.stringify(obj1)===JSON.stringify(obj2)}getUpdates(oldObj,newObj){const updates=[];for(const key in newObj){if(newObj.hasOwnProperty(key)&&newObj[key]!==oldObj[key]){updates.push({property:key,value:newObj[key]})}}return updates}getVal(mo,indexName){let vars2={};try{for(let i2=0;i2<this.reactiveVariables.length;i2++){let __name=this.reactiveVariables[i2];if(_vt.View.vars.hasOwnProperty(__name)){vars2[__name]=_vt.View.vars[__name]}else{let _wv=_lookupInWidgets(__name);let _gv=_wv!==void 0?_wv:_vt.Global.vars[__name];if(_gv!==void 0)vars2[__name]=_gv}}for(const ky in this.vrs){if(Object.prototype.hasOwnProperty.call(this.vrs,ky)){vars2[ky]=this.vrs[ky]}}if(this.view&&this.view.vars){for(const ky in this.view.vars){if(Object.prototype.hasOwnProperty.call(this.view.vars,ky)){vars2[ky]=this.view.vars[ky]}}}}catch(e2){cl(e2)}mo=mo.trim();if(mo.slice(0,2)=="{{"){mo=mo.slice(2,-2)}let value="";let _mo=mo;if(mo.indexOf("`")>-1){var matchesVal=_mo.match(/\.`[\s\S]*?`/g);if(matchesVal)for(var y=0;y<matchesVal.length;y++){_mo=_mo.split(matchesVal[y]).join("."+this.getVal(matchesVal[y].substr(1).slice(1,-1),indexName))}var matchesVal=_mo.match(/`[\s\S]*?`/g);if(matchesVal)for(var y=0;y<matchesVal.length;y++){_mo=_mo.split(matchesVal[y]).join("'"+this.getVal(matchesVal[y].slice(1,-1),indexName)+"'")}return this.getVal(_mo,indexName)}if(mo.indexOf(";")>-1){let zxx=mo.split(";");mo=$.trim(zxx[0])}if(mo.indexOf(" as ")>-1){mo=mo.split(" as ");return this.getVal(mo[0],indexName)}if(indexName){indexName=indexName.toString();if(mo.indexOf(indexName)>-1&&mo!=indexName&&vars2.hasOwnProperty(indexName)&&mo!="index"){mo=mo.split(indexName).join(vars2[indexName]);return this.getVal(mo,indexName)}}var Ondex=mo.match(/\bindex\b/g);if(Ondex&&mo!="index"&&vars2.hasOwnProperty("index")){_mo=mo.replace(/\bindex\b/g,vars2["index"]);return this.getVal(_mo,indexName)}value=this.lookup(mo,vars2);return value??""}concatVarsAtLevel(levelVars,parent2){if(!parent2.view._pv){var concatenatedVars={...levelVars};if(parent2.view.vars){concatenatedVars={..._vt.Global.vars,..._mergedWidgetsVars(),...parent2.view.vars,...concatenatedVars}}return concatenatedVars}var concatenatedVars={...levelVars};if(parent2.view.vars){concatenatedVars={...parent2.view.vars,...concatenatedVars}}return this.concatVarsAtLevel(concatenatedVars,parent2.view._pv)}lookup(name,vaz2){let vars2=this.concatVarsAtLevel(vaz2,this);try{var value;var names,index2,lookupHit=false;if(this.hasProperty(vars2,name)){value=vars2[name]}else if(name.indexOf(".")>-1&&name.indexOf("[")==-1){var value=this.scopedEval(vars2,name);if(!(value||value==0)){value=vars2;names=name.split(".");index2=0;while(value!=null&&index2<names.length){if(index2===names.length-1)lookupHit=this.hasProperty(value,names[index2]);value=value[names[index2++]]}}}else{var value=this.scopedEval(vars2,name);if(!(value||value==0)){if(name.indexOf(".")==-1&&name.indexOf("[")>-1){let _name=name;var matchesVal=_name.match(/\[[\s\S]*?\]/g);for(var y=0;y<matchesVal.length;y++){if(matchesVal[y].indexOf("'")==-1&&matchesVal[y].indexOf('"')==-1)_name=_name.split(matchesVal[y]).join("['"+matchesVal[y].slice(1,-1)+"']")}var value=this.scopedEval(vars2,_name)}}}if(this.isFunction(value))value=value.call(value)}catch(e2){reportLumenError({stage:"lookup",expr:name,error:e2});return""}return value}objectToString=Object.prototype.toString;isArray=Array.isArray||function isArrayPolyfill(object){return objectToString.call(object)==="[object Array]"};isFunction(object){return typeof object==="function"}typeStr(obj){return this.isArray(obj)?"array":typeof obj}hasProperty(obj,propName){return obj!=null&&typeof obj==="object"&&propName in obj}createEl(tag,attrs2,children,events,doc2){const _el2=document.createElement(tag);Object.defineProperty(_el2,"_ownerRe",{value:this,enumerable:false,configurable:true,writable:true});_el2.isSub=false;if(attrs2.hasOwnProperty("view")){_el2.isSub=true;_el2.subPath=attrs2["view"];_el2.vars={};_el2.views=[];_el2.fns={};if(doc2&&doc2.evs&&doc2.evs.hasOwnProperty("@init")){let _initAttr=doc2.evs["@init"];if(_initAttr){let _initResult=evalEvAttr(_initAttr,{cType:"init"},$(_el2),"init",this.vrs);if(_initResult&&typeof _initResult==="object"&&typeof _initResult.then!=="function"){Object.assign(_el2.vars,_initResult)}}}this.view.views.push(_el2)}_el2.events={};for(const prop in attrs2){if(prop=="view"||prop==":data"||prop==":if"||prop==":else-if"||prop==":else"||prop==":for"||prop==":for-limit"||prop==":for-offset"||prop==":for-if")continue;try{let val2=doc2&&doc2.ax.hasOwnProperty(prop)?"":attrs2[prop];if(prop=="value"){_el2.value=val2}else _el2.setAttribute(prop,val2)}catch(e2){cl(e2)}}for(const prop in events){try{_el2.events[prop]=events[prop]}catch(e2){cl(e2)}}if(children.length)_el2.append(...children);if(events&&events["@after-render"]&&!(attrs2&&(attrs2.hasOwnProperty(":for")||attrs2.hasOwnProperty(":if")||attrs2.hasOwnProperty(":else-if")||attrs2.hasOwnProperty(":else")))){fireRenderHook({doc:doc2},"after-render",_el2,{})}autoInitPlugins(_el2,attrs2);return _el2}evalExp(expr2,vars2){let rvars={};try{for(let i2=0;i2<vars2.length;i2++){let __name=vars2[i2];if(_vt.View.vars.hasOwnProperty(__name)){rvars[__name]=_vt.View.vars[__name]}else{let _wv=_lookupInWidgets(__name);rvars[__name]=_wv!==void 0?_wv:_vt.Global.vars[__name]}}for(const ky in this.vrs){if(Object.prototype.hasOwnProperty.call(this.vrs,ky)){rvars[ky]=this.vrs[ky]}}if(this.view&&this.view.vars){for(const ky in this.view.vars){if(Object.prototype.hasOwnProperty.call(this.view.vars,ky)){rvars[ky]=this.view.vars[ky]}}}}catch(e2){cl(e2)}try{var value=this.scopedEval(rvars,expr2);if(value&&value!=0)return true}catch(e2){reportLumenError({stage:"condition",expr:expr2,error:e2});return false}return false}splitTextWithMustaches(text,mustaches){mustaches.sort((a,b)=>a.start-b.start);const elements=[];let currentIndex=0;for(const mustache of mustaches){if(currentIndex<mustache.start){elements.push({type:"static",content:text.substring(currentIndex,mustache.start)})}elements.push({type:"mustache",jst:mustache.jst,rvs:mustache.rvs,content:text.substring(mustache.start,mustache.end)});currentIndex=mustache.end}if(currentIndex<text.length){elements.push({type:"static",content:text.substring(currentIndex)})}return elements}walk(doc,parent){var par=this;var tx,el;switch(doc.type){case"text":if(doc.mss.length){let splitIt=true;if(doc.tag=="textarea"){splitIt=false}if(splitIt){let splits=this.splitTextWithMustaches(doc.content,doc.mss);for(let si=0;si<splits.length;si++){const split=splits[si];if(split.type=="static"){let txnd=document.createTextNode(decodeHtmlEntities(split.content));if(!parent)par._RealDOM.push(txnd);(tx??(tx=[])).push(txnd)}else{let txnd=document.createTextNode("");for(let ri=0;ri<split.rvs.length;ri++){const element=split.rvs[ri];(this._effects[element]??(this._effects[element]=[])).push({"type":"text","content":split.content,"jst":split.jst,"rvs":split.rvs,"isSplit":true,"nd":txnd,"tag":doc.tag})}if(!parent)par._RealDOM.push(txnd);(tx??(tx=[])).push(txnd)}}return tx}else{tx=document.createTextNode("");for(let mui=0;mui<doc.mss.length;mui++){const mus=doc.mss[mui];for(let ri=0;ri<mus.rvs.length;ri++){const element=mus.rvs[ri];(this._effects[element]??(this._effects[element]=[])).push({"type":"text","content":doc.content,"splits":this.splitTextWithMustaches(doc.content,doc.mss),"jst":mus.jst,"rvs":mus.rvs,"isSplit":false,"nd":tx,"tag":doc.tag})}}if(!parent)par._RealDOM.push(tx);return tx}}else{tx=document.createTextNode(decodeHtmlEntities(doc.content));if(!parent)par._RealDOM.push(tx);return tx}break;case"sections":case"section":var _dd=md5(new Date().getTime()/1e3+"::"+Math.random());tx=document.createTextNode("");var typeN=null;if(doc.attrs.hasOwnProperty(":else"))typeN="else";else if(doc.attrs.hasOwnProperty(":else-if"))typeN="else-if";else if(doc.attrs.hasOwnProperty(":if"))typeN="if";else typeN="for";if(doc.type=="section"){var chain=[];if(typeN=="else-if"||typeN=="else"){try{let lastInChain=this._CXR.at(-1);if(lastInChain){_dd=lastInChain.key;chain.push(...lastInChain.chain,lastInChain)}}catch(e2){}}el=par.createEl(doc.name,doc.attrs,[],doc.evs,doc);tx.node=el;this._CXR.push({"type":"section","name":typeN,"content":doc.cond,"doc":doc,"key":_dd,"chain":chain,"ref":tx});this.setEffects(doc,el)}else if(doc.type=="sections"){tx.key=_dd;tx.node=null;tx.nodes={};let docRaw=doc;this._LXR.push({"type":"sections","name":typeN,"cond":doc.attrs.hasOwnProperty(":for-if")?doc.attrs[":for-if"]:null,"limit":doc.attrs.hasOwnProperty(":for-limit")?doc.attrs[":for-limit"]:0,"offset":doc.attrs.hasOwnProperty(":for-offset")?doc.attrs[":for-offset"]:0,"content":doc.content,"forX":doc.forX,"doc":docRaw,"key":_dd,"atr":[],"ref":tx})}if(!parent)par._RealDOM.push(tx);return tx;break;case"tag":var _dd=md5(new Date().getTime()/1e3+"::"+Math.random());if(doc.name.toLowerCase()=="settings"){if(par.view.type=="main"){var defaultSettings={layout:"default",requireAuth:false};try{let settingsC=doc.children[0].content;let settings={};eval("settings = "+settingsC+";");if(settings){if(settings.layout==null)settings.layout="default";if(settings.requireAuth==null)settings.requireAuth=false;par.view.settings=settings}else{par.view.settings=defaultSettings}}catch(e2){setError(e2,"Error in your settings tag inside the '"+par.view.name.toLowerCase()+"' main view!");par.view.settings=defaultSettings}}}else if(doc.name.toLowerCase()=="script"||doc.name.toLowerCase()=="js"){let child=doc.children[0];let js=child.content;let jst=child.jst;let isScoped=false;if(doc.attrs.hasOwnProperty("scoped")){delete doc.attrs["scoped"];isScoped=true}el=par.createEl("script",doc.attrs,[],doc.evs,doc);el._sc=isScoped;el._dd=_dd;el._jst=jst;(par._jj[_dd]??(par._jj[_dd]=[])).push({"nd":el})}else if(doc.name.toLowerCase()=="style"){let css=doc.children[0].content;let isScoped=false;el=par.createEl("style",{},[],doc.evs,doc);if(doc.attrs.hasOwnProperty("scoped")){if(!parent){if(par.view._dd)_dd=par.view._dd;else{par.view._dd=_dd;if(par.view.type=="main")$("[body]")[0].setAttribute("vuid",_dd)}}else{if(parent._dd)_dd=parent._dd;else{parent._dd=_dd;parent.setAttribute("vuid",_dd)}}delete doc.attrs["scoped"];isScoped=true;el._sc=isScoped;el._dd=_dd;el._css=css;(par._cc[_dd]??(par._cc[_dd]=[])).push({"nd":el,"_css":css})}else{el._sc=isScoped;el._dd=_dd;el.textContent=css}for(const prop in doc.attrs){try{_el.setAttribute(prop,doc.attrs[prop])}catch(e2){cl(e2)}}}else if(doc.name.toLowerCase()=="icon"){let child=par.createEl("span",{"class":"iconify","data-icon":doc?.icon??"mdi:home"},[],{},null);el=par.createEl("span",doc.attrs,[child],doc.evs,doc)}else if(doc.name.toLowerCase()=="slot"){let slotName=doc.attrs&&doc.attrs.name;if(slotName){let tempWrapper=document.createElement("div");let childs=[];for(let i2=0;i2<doc.children.length;i2++){const dc=doc.children[i2];let chils=par.walk(dc,tempWrapper);if(chils){if(Array.isArray(chils)){if(chils.length)childs=[...childs,...chils]}else{childs.push(chils)}}}(par.view._slots??(par.view._slots={}))[slotName]=childs}}else if(doc.attrs&&doc.attrs.hasOwnProperty("tpl")&&!doc.attrs.hasOwnProperty(":for")){reportLumenError({stage:"tpl",error:new Error('tpl="'+doc.attrs["tpl"]+'" must be used together with :for on the same element \u2014 templates only render inside a repeated/list context.')})}else{el=par.createEl(doc.name,doc.attrs,[],doc.evs,doc);if(!doc.isV&&!el.isSub){let childs=[];for(let i2=0;i2<doc.children.length;i2++){const dc=doc.children[i2];let chils=par.walk(dc,el);if(chils){if(Array.isArray(chils)){if(chils.length)childs=[...childs,...chils]}else{childs.push(chils)}}}childs.length?el.append(...childs):null}}this.setEffects(doc,el);if(el){if(!parent)par._RealDOM.push(el)}return el;break;case"comment":break;default:break}}setEffects(doc2,el2){let rvs=[];if(Object.keys(doc2.ax).length){for(const attrName in doc2.ax){if(Object.hasOwnProperty.call(doc2.ax,attrName)){const attrMustaches=doc2.ax[attrName];for(let i2=0;i2<attrMustaches.length;i2++){const mus=attrMustaches[i2];for(let ri=0;ri<mus.rvs.length;ri++){const element=mus.rvs[ri];rvs.push(element);(this._effects[element]??(this._effects[element]=[])).push({"type":"attr","name":attrName,"content":doc2.attrs[attrName],"splits":this.splitTextWithMustaches(doc2.attrs[attrName],doc2.ax[attrName]),"jst":mus.jst,"rvs":mus.rvs,"nd":el2})}}}}}if(Object.keys(doc2.ex).length){for(const ky in doc2.ex){if(Object.hasOwnProperty.call(doc2.ex,ky)){const mss=doc2.ex[ky];for(let i2=0;i2<mss.length;i2++){const mus=mss[i2];for(let ri=0;ri<mus.rvs.length;ri++){const element=mus.rvs[ri];rvs.push(element);(this._effects[element]??(this._effects[element]=[])).push({"type":"event","name":ky,"content":doc2.evs[ky],"splits":this.splitTextWithMustaches(doc2.evs[ky],doc2.ex[ky]),"jst":mus.jst,"rvs":mus.rvs,"nd":el2})}}}}}return rvs.filter((value,index2,self2)=>{return self2.indexOf(value)===index2})}async createSection(cx,vx,isObj,forX){var keyed=cx.key+"_"+vx.index;var tx2=document.createTextNode("");var typeN2=null;if(cx.doc.attrs.hasOwnProperty(":else"))typeN2="else";else if(cx.doc.attrs.hasOwnProperty(":else-if"))typeN2="else-if";else if(cx.doc.attrs.hasOwnProperty(":if"))typeN2="if";else typeN2="for";let el2=this.createEl(cx.doc.name,cx.doc.attrs,[],cx.doc.evs,cx.doc);tx2.node=el2;tx2.key=cx.key;tx2.keyed=keyed;tx2.isObj=isObj;tx2.forX=forX;tx2.vx=vx;let scsc2=await renderSection(tx2,cx.doc,this,cx.key);scsc2._re=scsc2;cx.ref.nodes[keyed]=tx2;return tx2}attrString(attrs2){var buff=[];for(var key in attrs2){buff.push(key+'="'+attrs2[key]+'"')}if(!buff.length)return"";return" "+buff.join(" ")}_stringify(buff,doc2){var par2=this;switch(doc2.type){case"text":return buff+doc2.content;case"tag":buff+="<"+doc2.name+(doc2.attrs?par2.attrString(doc2.attrs):"")+(doc2.isV?"/>":">");if(doc2.isV)return buff;for(let i2=0;i2<doc2.children.length;i2++){const dc=doc2.children[i2];buff=buff+par2._stringify("",dc)}return buff+"</"+doc2.name+">";case"comment":return buff;default:return""}}stringify(doc2){var par2=this;return doc2.reduce(function(token,rootEl){return token+par2._stringify("",rootEl)},"")}}async function renderHST(hst,n2,type2="main",tx2,_pv=null,scopePath=["View"],ownVars2,ownFns,ownViews){var reactiveVariables=hst.reactiveVars;hst=hst.hst;let _re=new _lm(new _v({"name":n2,"type":type2,"hst":hst,"vars":ownVars2??tx2?.vx,"fns":ownFns,"views":ownViews,"rvs":reactiveVariables,"_pv":_pv}));_re.view.scopePath=scopePath;if(Object.keys(_re._cc).length){for(const ky in _re._cc){if(Object.hasOwnProperty.call(_re._cc,ky)){const csses=_re._cc[ky];for(let inde=0;inde<csses.length;inde++){let prom=new defer;const css=csses[inde];_csswrk.trigger("css-ready",{"csses":[css._css],"pre":"[vuid='"+ky+"']","key":ky});_vuid[ky]=prom;let _csses=await prom;css.nd.textContent=_csses[0]}}}}if(Object.keys(_re._jj).length){for(const ky in _re._jj){if(Object.hasOwnProperty.call(_re._jj,ky)){const jses=_re._jj[ky];for(let inde=0;inde<jses.length;inde++){const nd=jses[inde].nd;let code=getWatcher(nd._jst,_re.view,reactiveVariables,scopePath).code;code=`try { `+code+` } catch (e) { reportLumenError({ stage: 'script', error: e }); }`;code=code+`
|
|
1
|
+
(function(global){function toArray(x2){if(x2==null)return[];if(typeof NodeList!=="undefined"&&x2 instanceof NodeList)return Array.prototype.slice.call(x2);if(typeof HTMLCollection!=="undefined"&&x2 instanceof HTMLCollection)return Array.prototype.slice.call(x2);if(Array.isArray(x2))return x2;if(x2 instanceof $2)return Array.prototype.slice.call(x2);return[x2]}function $2(selector2,context){if(!(this instanceof $2))return new $2(selector2,context);var els=[];var sel=void 0;if(!selector2){els=[]}else if(typeof selector2==="string"){var trimmed=selector2.trim();if(trimmed[0]==="<"){var tpl=document.createElement("template");tpl.innerHTML=trimmed;els=toArray(tpl.content.childNodes).filter(function(n2){return n2.nodeType===1})}else{sel=selector2;var root=context?context instanceof $2?context[0]:context:document;var atParts=selector2.split(",").map(function(s){return s.trim()});var isAllAtAttrs=atParts.length>0&&atParts.every(function(p){return/^\[\\@[\w-]+\]$/.test(p)});if(isAllAtAttrs){var names=atParts.map(function(p){return"@"+/^\[\\@([\w-]+)\]$/.exec(p)[1]});var all=root?toArray(root.querySelectorAll("*")):[];els=all.filter(function(el2){return names.some(function(n2){return el2.getAttribute(n2)!=null})})}else{els=root?toArray(root.querySelectorAll(selector2)):[]}}}else{els=toArray(selector2)}for(var i2=0;i2<els.length;i2++)this[i2]=els[i2];this.length=els.length;this.selector=sel;return this}$2.fn=$2.prototype;$2.fn.jquery="lumenjs-shim";$2.fn.extend=function(methods){for(var k in methods)if(Object.prototype.hasOwnProperty.call(methods,k))$2.fn[k]=methods[k];return $2};$2.extend=function(target){for(var i2=1;i2<arguments.length;i2++){var src=arguments[i2];for(var k in src)if(Object.prototype.hasOwnProperty.call(src,k))target[k]=src[k]}return target};$2.Event=function(type2,props2){var e2=typeof type2==="string"?new Event(type2,{bubbles:true,cancelable:true}):type2;if(props2)for(var k in props2)e2[k]=props2[k];return e2};$2.proxy=function(fn2,context){return fn2.bind(context)};$2.trim=function(s){return(s==null?"":String(s)).trim()};$2.inArray=function(val2,arr){return Array.prototype.indexOf.call(arr,val2)};function isArrayLike(obj){if(Array.isArray(obj)||obj instanceof $2)return true;var length=obj&&typeof obj==="object"&&obj.length;return typeof length==="number"&&(length===0||length-1 in obj)}$2.each=function(arr,fn2){if(isArrayLike(arr)){for(var i2=0;i2<arr.length;i2++)if(fn2.call(arr[i2],i2,arr[i2])===false)break}else{for(var k in arr)if(fn2.call(arr[k],k,arr[k])===false)break}return arr};$2.map=function(arr,fn2){var out=[];var src=Array.isArray(arr)||arr instanceof $2?arr:Object.keys(arr||{}).map(function(k){return arr[k]});for(var i2=0;i2<src.length;i2++){var r2=fn2(src[i2],i2);if(r2===null||r2===void 0)continue;if(Array.isArray(r2))out.push.apply(out,r2);else out.push(r2)}return out};var _ajaxActive=0;$2.ajax=function(opts){opts=opts||{};var method=(opts.method||opts.type||"GET").toUpperCase();var init2={method,headers:opts.headers||{}};if(opts.data!=null&&method!=="GET"){init2.body=typeof opts.data==="string"?opts.data:JSON.stringify(opts.data)}if(_ajaxActive===0)$2(document).trigger("ajaxStart");_ajaxActive++;$2(document).trigger("ajaxSend");return fetch(opts.url,init2).then(function(res){var ct=res.headers.get("content-type")||"";return ct.indexOf("json")>-1?res.json():res.text()}).then(function(data2){opts.success&&opts.success(data2);$2(document).trigger("ajaxSuccess");return data2}).catch(function(err){opts.error&&opts.error(err);$2(document).trigger("ajaxError");throw err}).finally(function(){_ajaxActive--;$2(document).trigger("ajaxComplete");if(_ajaxActive===0)$2(document).trigger("ajaxStop")})};$2.fn.each=function(fn2){for(var i2=0;i2<this.length;i2++)if(fn2.call(this[i2],i2,this[i2])===false)break;return this};$2.fn.get=function(i2){return i2===void 0?toArray(this):this[i2]};$2.fn.not=function(exclude){var excludeArr=exclude instanceof $2?toArray(exclude):Array.isArray(exclude)?exclude:[exclude];var out=[];this.each(function(){if(excludeArr.indexOf(this)===-1)out.push(this)});return $2(out)};$2.fn.attr=function(name,value){if(value===void 0)return this[0]?this[0].getAttribute(name):void 0;return this.each(function(){this.setAttribute(name,value)})};$2.fn.prop=function(name,value){if(value===void 0)return this[0]?this[0][name]:void 0;return this.each(function(){this[name]=value})};$2.fn.removeAttr=function(name){return this.each(function(){this.removeAttribute(name)})};$2.fn.hasAttr=function(name){return!!(this[0]&&this[0].getAttribute(name)!=null)};$2.fn.data=function(key,value){if(value===void 0){if(!this[0])return void 0;if(key===void 0)return Object.assign({},this[0].dataset);var v=this[0].dataset[key];try{return JSON.parse(v)}catch(e2){return v}}return this.each(function(){this.dataset[key]=typeof value==="string"?value:JSON.stringify(value)})};$2.fn.val=function(value){if(value===void 0)return this[0]?this[0].value:void 0;return this.each(function(){this.value=value})};$2.fn.html=function(value){if(value===void 0)return this[0]?this[0].innerHTML:void 0;if(typeof value!=="string"){var nodes2=_normalizeAppendable([value]);return this.each(function(){this.innerHTML="";var self2=this;nodes2.forEach(function(n2){self2.appendChild(n2)})})}return this.each(function(){this.innerHTML=value})};$2.fn.text=function(value){if(value===void 0)return this[0]?this[0].textContent:"";return this.each(function(){this.textContent=value})};$2.fn.css=function(name,value){if(typeof name==="object"){return this.each(function(){var el2=this;for(var k in name)el2.style[k]=name[k]})}if(value===void 0)return this[0]?getComputedStyle(this[0])[name]:void 0;return this.each(function(){this.style[name]=value})};$2.fn.addClass=function(cls){var list=cls.split(/\s+/).filter(Boolean);return this.each(function(){this.classList.add.apply(this.classList,list)})};$2.fn.removeClass=function(cls){var list=cls.split(/\s+/).filter(Boolean);return this.each(function(){this.classList.remove.apply(this.classList,list)})};$2.fn.hasClass=function(cls){return!!(this[0]&&this[0].classList.contains(cls))};$2.fn.toggleClass=function(cls,force){var list=cls.split(/\s+/).filter(Boolean);return this.each(function(){var el2=this;list.forEach(function(c){el2.classList.toggle(c,force)})})};$2.fn.remove=function(){return this.each(function(){this.parentNode&&this.parentNode.removeChild(this)})};function _normalizeAppendable(args){var out=[];function add(item){if(item==null)return;if(Array.isArray(item)){item.forEach(add);return}if(item instanceof $2){for(var i22=0;i22<item.length;i22++)add(item[i22]);return}if(typeof item==="string"){var tpl=document.createElement("template");tpl.innerHTML=item;while(tpl.content.firstChild)out.push(tpl.content.removeChild(tpl.content.firstChild));return}if(item instanceof Node){out.push(item);return}}for(var i2=0;i2<args.length;i2++)add(args[i2]);return out}$2.fn.append=function(){if(arguments.length===1&&typeof arguments[0]==="string"){var html=arguments[0];return this.each(function(){this.insertAdjacentHTML("beforeend",html)})}var nodes2=_normalizeAppendable(arguments);return this.each(function(){var self2=this;nodes2.forEach(function(n2){self2.appendChild(n2)})})};$2.fn.prepend=function(){if(arguments.length===1&&typeof arguments[0]==="string"){var html=arguments[0];return this.each(function(){this.insertAdjacentHTML("afterbegin",html)})}var nodes2=_normalizeAppendable(arguments);return this.each(function(){var self2=this;var ref=self2.firstChild;nodes2.forEach(function(n2){self2.insertBefore(n2,ref)})})};$2.fn.after=function(content){return this.each(function(){if(typeof content==="string")this.insertAdjacentHTML("afterend",content);else this.parentNode.insertBefore(content instanceof $2?content[0]:content,this.nextSibling)})};$2.fn.appendTo=function(target){$2(target).append(this);return this};$2.fn.width=function(){return this[0]?this[0].offsetWidth:0};$2.fn.height=function(){return this[0]?this[0].offsetHeight:0};$2.fn.innerHeight=function(){return this[0]?this[0].clientHeight:0};$2.fn.innerWidth=function(){return this[0]?this[0].clientWidth:0};$2.fn.scrollLeft=function(value){if(!this[0])return value===void 0?0:this;if(value===void 0)return this[0]===window?window.scrollX:this[0].scrollLeft;return this.each(function(){if(this===window)window.scrollTo(value,window.scrollY);else this.scrollLeft=value})};$2.fn.scrollTop=function(value){if(!this[0])return value===void 0?0:this;if(value===void 0)return this[0]===window?window.scrollY:this[0].scrollTop;return this.each(function(){if(this===window)window.scrollTo(window.scrollX,value);else this.scrollTop=value})};$2.fn.outerWidth=function(includeMargin){if(!this[0])return 0;var w=this[0].offsetWidth;if(includeMargin){var s=getComputedStyle(this[0]);w+=parseFloat(s.marginLeft||0)+parseFloat(s.marginRight||0)}return w};$2.fn.outerHeight=function(includeMargin){if(!this[0])return 0;var h=this[0].offsetHeight;if(includeMargin){var s=getComputedStyle(this[0]);h+=parseFloat(s.marginTop||0)+parseFloat(s.marginBottom||0)}return h};$2.fn.offset=function(){if(!this[0])return null;var rect=this[0].getBoundingClientRect();var docEl=document.documentElement;return{top:rect.top+(window.pageYOffset||docEl.scrollTop)-(docEl.clientTop||0),left:rect.left+(window.pageXOffset||docEl.scrollLeft)-(docEl.clientLeft||0)}};$2.fn.parent=function(){return $2(this[0]?this[0].parentElement:null)};$2.fn.next=function(){return $2(this[0]?this[0].nextElementSibling:null)};$2.fn.closest=function(sel){return $2(this[0]?this[0].closest(sel):null)};$2.fn.find=function(sel){var out=[];this.each(function(){var found=this.querySelectorAll(sel);for(var i2=0;i2<found.length;i2++)if(out.indexOf(found[i2])===-1)out.push(found[i2])});return $2(out)};var JQUERY_PSEUDOS={":checkbox":function(el2){return el2.tagName==="INPUT"&&el2.type==="checkbox"},":radio":function(el2){return el2.tagName==="INPUT"&&el2.type==="radio"},":checked":function(el2){return!!el2.checked}};$2.fn.is=function(sel){if(!this[0])return false;if(JQUERY_PSEUDOS[sel])return JQUERY_PSEUDOS[sel](this[0]);try{return this[0].matches(sel)}catch(e2){return false}};$2.fn.ready=function(fn2){if(document.readyState!=="loading")fn2($2);else document.addEventListener("DOMContentLoaded",function(){fn2($2)});return this};["ajaxStart","ajaxStop","ajaxSend","ajaxSuccess","ajaxError","ajaxComplete"].forEach(function(name){$2.fn[name]=function(fn2){return this.on(name,fn2)}});var EVENT_NAME_MAP={touch:"touchstart",focus:"focusin",blur:"focusout"};var _eventBuses=typeof WeakMap!=="undefined"?new WeakMap:null;function _isNode(x2){return x2===window||x2===document||typeof Node!=="undefined"&&x2 instanceof Node}function _isRealEventTarget(x2){return x2!=null&&typeof x2.addEventListener==="function"&&typeof x2.dispatchEvent==="function"}function _eventTargetFor(x2){if(_isNode(x2)||_isRealEventTarget(x2))return x2;if(!_eventBuses.has(x2))_eventBuses.set(x2,new EventTarget);return _eventBuses.get(x2)}var AT_ATTR_SELECTOR=/^\[\\@([\w-]+)\]$/;$2.fn.on=function(events,selector2,handler){if(typeof selector2==="function"){handler=selector2;selector2=null}var evts=events.split(/\s+/).filter(Boolean);var atMatch=selector2&&AT_ATTR_SELECTOR.exec(selector2);var atAttr=atMatch?"@"+atMatch[1]:null;return this.each(function(){var node=this;var bus=_eventTargetFor(node);evts.forEach(function(evt){var real=EVENT_NAME_MAP[evt]||evt;bus.addEventListener(real,function(e2){if(atAttr){var el2=e2.target;var match=null;while(el2&&el2.nodeType===1){if(el2.getAttribute(atAttr)!=null){match=el2;break}el2=el2.parentElement}if(match&&node.contains(match))handler.call(match,e2)}else if(selector2&&_isNode(node)){var match2=e2.target.closest(selector2);if(match2&&node.contains(match2))handler.call(match2,e2)}else{handler.call(node,e2)}})})})};$2.fn.click=function(handler){return handler?this.on("click",handler):this.trigger("click")};$2.fn.keydown=function(handler){return handler?this.on("keydown",handler):this.trigger("keydown")};$2.fn.trigger=function(type2,data2){return this.each(function(){var bus=_eventTargetFor(this);var ev2;if(type2 instanceof Event){ev2=type2}else if(type2&&typeof type2==="object"&&typeof type2.type==="string"){ev2=new Event(type2.type,{bubbles:_isNode(this)});for(var k in type2){if(k!=="type"&&Object.prototype.hasOwnProperty.call(type2,k)){try{ev2[k]=type2[k]}catch(e2){}}}}else{ev2=new Event(type2,{bubbles:_isNode(this)})}if(data2!==void 0)ev2.detail=data2;bus.dispatchEvent(ev2)})};$2.fn.unbind=function(){return this};["click","dblclick","keyup","keydown","keypress","focus","blur","change","submit","focusin","focusout","mouseenter","mouseleave","mouseover","mouseout","mousedown","mouseup","mousemove","resize","scroll","load","select"].forEach(function(name){$2.fn[name]=function(handler){return handler?this.on(name,handler):this.trigger(name)}});$2.fn.hover=function(enter,leave){this.on("mouseenter",enter);this.on("mouseleave",leave||enter);return this};var _animTimers=new WeakMap;function _animGetScroll(el2,prop){if(el2===window)return prop==="scrollLeft"?window.pageXOffset:window.pageYOffset;return el2[prop]}function _animSetScroll(el2,prop,val2){if(el2===window){if(prop==="scrollLeft")window.scrollTo(val2,window.pageYOffset);else window.scrollTo(window.pageXOffset,val2)}else{el2[prop]=val2}}var _cssNumberProps={opacity:1,zIndex:1,zoom:1,fontWeight:1,lineHeight:1,columnCount:1,flexGrow:1,flexShrink:1,order:1,widows:1,orphans:1};function _animSetStyle(el2,prop,val2){el2.style[prop]=_cssNumberProps[prop]?val2:val2+"px"}$2.fn.animate=function(props2,options){var opts=typeof options==="number"?{duration:options}:options||{};var duration=opts.duration==null?400:opts.duration;this.each(function(){var el2=this;var isWindowScroll=el2===document.documentElement||el2===document.body;var target=isWindowScroll?window:el2;var start={};var isScrollProp={};for(var prop in props2){if(!Object.prototype.hasOwnProperty.call(props2,prop))continue;isScrollProp[prop]=prop==="scrollTop"||prop==="scrollLeft";if(isScrollProp[prop]){start[prop]=_animGetScroll(isWindowScroll?window:el2,prop)}else{start[prop]=parseFloat(getComputedStyle(el2)[prop])||0}}var existing=_animTimers.get(el2);if(existing)cancelAnimationFrame(existing);if(duration===0){for(var p in props2){var v=parseFloat(props2[p]);if(isScrollProp[p])_animSetScroll(isWindowScroll?window:el2,p,v);else _animSetStyle(el2,p,v)}if(opts.complete)opts.complete.call(el2);return}var startTime=null;function step(ts){if(startTime===null)startTime=ts;var elapsed=ts-startTime;var t2=Math.min(1,elapsed/duration);for(var p2 in props2){if(!Object.prototype.hasOwnProperty.call(props2,p2))continue;var end=parseFloat(props2[p2]);var val2=start[p2]+(end-start[p2])*t2;if(isScrollProp[p2])_animSetScroll(isWindowScroll?window:el2,p2,val2);else _animSetStyle(el2,p2,val2)}if(t2<1){_animTimers.set(el2,requestAnimationFrame(step))}else{_animTimers.delete(el2);if(opts.complete)opts.complete.call(el2)}}_animTimers.set(el2,requestAnimationFrame(step))});return this};$2.fn.stop=function(){this.each(function(){var id2=_animTimers.get(this);if(id2){cancelAnimationFrame(id2);_animTimers.delete(this)}});return this};var _queues=new WeakMap;function _getQueue(el2,name){var byName=_queues.get(el2);if(!byName){byName={};_queues.set(el2,byName)}if(!byName[name])byName[name]={items:[],running:false};return byName[name]}function _dequeue(el2,name){var q=_getQueue(el2,name);if(q.running)return;var next=q.items.shift();if(!next)return;q.running=true;next.call(el2,function(){q.running=false;_dequeue(el2,name)})}$2.fn.queue=function(name,fn2){if(typeof name==="function"){fn2=name;name="fx"}name=name||"fx";if(fn2===void 0)return _getQueue(this[0],name).items;return this.each(function(){_getQueue(this,name).items.push(fn2);_dequeue(this,name)})};$2.fn.dequeue=function(name){return this.each(function(){_dequeue(this,name||"fx")})};$2.fn.delay=function(ms,name){name=name||"fx";return this.each(function(){_getQueue(this,name).items.push(function(next){setTimeout(next,ms)});_dequeue(this,name)})};$2.fn.serializeArray=function(){var result=[];this.each(function(){if(this.tagName!=="FORM")return;var elements=this.elements?Array.prototype.slice.call(this.elements):[];elements.forEach(function(field){if(!field.name||field.disabled)return;var tag=field.tagName.toLowerCase();var type2=(field.type||tag).toLowerCase();if(type2==="submit"||type2==="button"||type2==="reset"||type2==="fieldset")return;if((type2==="checkbox"||type2==="radio")&&!field.checked)return;if(type2==="file"){var files=field.files?Array.prototype.map.call(field.files,function(f){return f.name}):[];result.push({name:field.name,value:files,type:type2});return}if(tag==="select"&&field.multiple){Array.prototype.forEach.call(field.selectedOptions||[],function(opt){result.push({name:field.name,value:opt.value,type:type2})});return}result.push({name:field.name,value:field.value,type:type2})})});return result};$2.fn.ajaxForm=function(options){options=options||{};return this.each(function(){var formEl=this;var $form=$2(formEl);formEl.addEventListener("submit",function(ev2){ev2.preventDefault();var formData=$form.serializeArray();if(typeof options.beforeSubmit==="function"){options.beforeSubmit(formData,$form,options)}})})};global.$=$2;global.jQuery=$2})(typeof window!=="undefined"?window:globalThis);!(function(t2){"use strict";var e2=null,r2=null,n2=null,i2=null,l=null,o=window,s="WebWorker",a=null,u=null,f=null,p=null,g=null,c=null,h=null;function _(t3){return function(e3){var r3=this._callbackStack[t3];return"function"==typeof e3&&r3.push(e3),this}}for(h in null!==(e2=(i2=i2||o)[l=l||s]||null)&&(r2=e2),c=Array.prototype.slice,n2=window.Worker,e2=function(){this._constructor.apply(this,arguments)},e2.prototype._$=null,e2.prototype._callbackStack=null,e2.prototype._lastError=null,e2.prototype._log=null,e2.prototype._nativeWorker=null,e2.prototype._state=null,e2.prototype._workerBlobUrl=null,e2.prototype._workerScript=null,e2.prototype._workerUrl=null,e2.prototype._constructor=function(e3){var r3=null,n3=null,i3=null;if(Object.defineProperty(this,"_$",{configurable:false,enumerable:true,value:t2(this),writable:false}),null===(e3=e3||null)&&this.throwError(g.INVALID_ARGUMENTS,null,true),"string"==typeof e3){let l2="";e3=t2.trim(e3);try{window.hasOwnProperty(e3)&&"string"==typeof window[e3]?(l2=window[e3],this._workerScript=l2):r3=t2(e3)}catch(t3){}null!==r3&&r3.length>0?(n3=r3.text(),this._workerScript=n3):""==l2&&(i3=e3)}this._workerUrl=i3,this._callbackStack={error:[],loading:[],loaded:[],starting:[],started:[],terminating:[],terminated:[]},this._assignEventHandlers(),this._state=a.INITIALIZED,this.trigger(f.INITIALIZED)},e2.prototype._initLog=function(){return this._log=[],this._log},e2.prototype.getUrl=function(){return this._workerUrl},e2.prototype.getBlobUrl=function(){return this._workerBlobUrl},e2.prototype.getLog=function(){return this._log||this._initLog()},e2.prototype.getNativeWorker=function(){return this._nativeWorker},e2.prototype.getState=function(){return this._state},e2.prototype.isLoading=function(){return this.getState()===a.LOADING},e2.prototype.isLoaded=function(){return this.getState()>=a.LOADED&&!this.isTerminated()},e2.prototype.isStarting=function(){return this.getState()===a.STARTING},e2.prototype.isStarted=function(){return this.getState()>=a.STARTED&&!this.isTerminated()},e2.prototype.isTerminating=function(){return this.getState()===a.TERMINATING},e2.prototype.isTerminated=function(){return this.getState()===a.TERMINATED},e2.prototype.load=function(){var r3,n3,i3=this;return i3.isLoading()||i3.isLoaded()||(i3.trigger(f.WORKER_LOADING),r3=i3.getUrl()||null,n3=function(){var t3,r4=null;r4=i3._workerScript,r4=e2._workerScriptWrapper.replace(/\{\{main-function\}\}/g,r4),t3=new window.Blob([r4],{type:"text/javascript"}),i3._workerBlobUrl=window.URL.createObjectURL(t3),i3._createWorker()},null===r3?n3():t2.ajax({async:true,url:r3,dataType:"text",crossDomain:true,success:function(t3){i3._workerScript=t3,n3()},error:function(){i3.throwError(g.WORKER_DID_NOT_LOAD,arguments)}})),i3},e2.prototype.log=function(t3){return(this._log||this._initLog()).push(t3),this},e2.prototype._createWorker=function(){return this._nativeWorker=new n2(this.getBlobUrl()),this._attachMessageParser(),this},e2.prototype._assignEventHandlers=function(){function t3(t4){return function(){var e3,r3,n3=this._callbackStack[t4];(e3=t4.toUpperCase())in a&&(this._state=a[e3]);for(;r3=n3.pop();)r3.apply(this,arguments)}}return this.on(f.ERROR,t3("error")),this.on(f.WORKER_LOADING,t3("loading")),this.on(f.WORKER_LOADED,t3("loaded")),this.on(f.WORKER_STARTING,t3("starting")),this.on(f.WORKER_STARTED,t3("started")),this.on(f.WORKER_TERMINATING,t3("terminating")),this.on(f.WORKER_TERMINATED,t3("terminated")),this},e2.prototype.error=_("error"),e2.prototype.loading=_("loading"),e2.prototype.loaded=_("loaded"),e2.prototype.starting=_("starting"),e2.prototype.started=_("started"),e2.prototype.terminating=_("terminating"),e2.prototype.terminated=_("terminated"),e2.prototype.start=function(){var t3;return this.isStarting()||this.isStarted()?this:(t3=c.call(arguments),this.isLoaded()?(this.trigger(f.WORKER_STARTING),this.sendMessage(u.START,t3),this):(this.on(f.WORKER_LOADED,(function(){this.start.apply(this,t3)})),this.load(),this))},e2.prototype.sendMessage=function(t3,e3){var r3=null,n3=null;return e3=e3||null,null===(t3=t3||null)||((n3={__isWebWorkerMsg:true}).action=t3,n3.args=e3,(r3=this.getNativeWorker())&&r3.postMessage(n3)),this},e2.prototype._attachMessageParser=function(){var e3=null;return(e3=t2(this.getNativeWorker())).on("message",t2.proxy((function(t3){var e4=(t3.originalEvent||t3).data,r3=null,n3=null;"object"==typeof e4&&"__isWebWorkerMsg"in e4&&e4.__isWebWorkerMsg&&(r3=e4.action,n3=e4.args,this[r3].apply(this,n3))}),this)),e3.on("error",t2.proxy(this.throwError,this)),this},e2.prototype.terminate=function(){return(this.getNativeWorker()||null)&&(this.trigger(f.WORKER_TERMINATING),this.sendMessage(u.TERMINATE,c.call(arguments))),this},e2.prototype.terminateNow=function(){var t3=null;return this.isTerminating()||this.trigger(f.WORKER_TERMINATING),(t3=this.getNativeWorker()||null)&&(t3.terminate(),this._nativeWorker=null,this.trigger(f.WORKER_TERMINATED)),this},e2.prototype.on=function(){var t3=this._$;return t3.on.apply(t3,arguments),this},e2.prototype.one=function(){var t3=this._$;return t3.one.apply(t3,arguments),this},e2.prototype.off=function(){var t3=this._$;return t3.off.apply(t3,arguments),this._assignEventHandlers(),this},e2.prototype.trigger=function(e3){var r3=false,n3=null,i3=null;return"object"==typeof e3&&(n3=e3.type||null),"string"==typeof e3&&(n3=e3||null,r3=true),null===n3?this:n3 in p?(r3&&(e3=new t2.Event(n3)),e3.worker=this,i3=[e3],arguments.length>1&&(i3=i3.concat(c.call(arguments,1))),this._triggerSelf.apply(this,i3),this):(r3&&(e3={type:n3,data:arguments[1]?arguments[1]:{}}),i3=[e3],this.sendMessage(u.TRIGGER_SELF,i3),this)},e2.prototype.triggerSelf=function(e3){var r3=null,n3=null;return null===(e3=e3||null)||("string"==typeof e3&&(r3=e3,e3=new t2.Event(r3)),e3.originalEvent=e3.originalEvent||e3,e3.worker=this,n3=[e3],arguments.length>1&&(n3=n3.concat(c.call(arguments,1))),this._triggerSelf.apply(this,n3)),this},e2.prototype._triggerSelf=function(){var t3=null;return(t3=this._$).trigger.apply(t3,arguments),this},e2.prototype.throwError=function(t3,r3,n3){var i3=null;if("object"==typeof(t3=t3||g.UNKNOWN)&&(i3=(t3=t3.originalEvent||t3).data||null),i3=void 0===r3?i3:r3,n3=n3||false,this._lastError=t3,e2._lastError=t3,"_triggerError"in this&&this._triggerError(t3,r3,n3),n3)throw new window.Error(t3);return this},e2.prototype._triggerError=function(e3,r3,n3){var i3=null;return(i3=new t2.Event(f.ERROR)).message=this.getLastError(),i3.errorData=r3,i3.throwsException=!!n3,this.trigger(i3),this},e2.prototype.getLastError=function(){return this._lastError},e2._lastError=null,a={INITIALIZED:0,LOADING:1,LOADED:2,STARTING:3,STARTED:4,TERMINATING:5,TERMINATED:6},e2.State=a,u={LOG:"log",START:"start",TERMINATE:"terminate",TERMINATE_NOW:"terminateNow",TRIGGER:"trigger",TRIGGER_SELF:"triggerSelf"},e2.Action=u,f={INITIALIZED:"initialized",ERROR:"error",WORKER_LOADING:"worker-loading",WORKER_LOADED:"worker-loaded",WORKER_STARTING:"worker-starting",WORKER_STARTED:"worker-started",WORKER_TERMINATING:"worker-terminating",WORKER_TERMINATED:"worker-terminated"},e2.Event=f,p={},e2.EventMap=p,f)f[h]="webworker:"+f[h],p[f[h]]=h;g={UNKNOWN:"An unknown error occured.",INVALID_ARGUMENTS:"Invalid arguments were supplied to this method.",WORKER_DID_NOT_LOAD:"Unable to load worker."},e2.Error=g,e2._workerScriptWrapper='var e=null,t=null,n=null,r={};e={{state-data}};t={{action-data}};n={{event-data}};self._callbackStack=null;self._listeners=r;self._isTerminating=false;self._state=null;self.State=e;self.Action=t;self.Event=n;self._assignEventHandlers=function(){function t(t){return function(){var n=self._callbackStack[t],r,i;r=t.toUpperCase();if(r in e){self._state=e[r]}while(i=n.pop()){i.apply(self,arguments)}}}self.on(n.WORKER_TERMINATING,t("terminating"));return self};self.getState=function(){return this._state};self.isInitialized=function(){var e=self.getState();return e!==null&&e>=0};self.isTerminating=function(){return self.getState()===e.TERMINATING};self._main=function(){var startArgs=arguments;{{main-function}};return self};self._init=function(){self._callbackStack={terminating:[]};self._assignEventHandlers();self._state=e.INITIALIZED;self.trigger(n.WORKER_LOADED);return self};self.start=function(){if(!self.isInitialized()){return self}self.triggerSelf(n.WORKER_STARTING);self._main.apply(self,arguments);self.triggerSelf(n.WORKER_STARTED);self.trigger(n.WORKER_STARTED);return self};self.log=function(e){self.sendMessage(t.LOG,[e]);return self};self.on=function(e,t){e+="";t=t||null;if(typeof t!=="function"){return self}if(!(e in r)){r[e]=[]}r[e].push(t);return self};self.one=function(e,t){var n=null;n=function(){t.apply(this,arguments);self.off(e,n);return};self.on(e,n);return};self.off=function(e,t){var n=null;e=e||null;t=t||null;if(e===null&&t===null){for(n in r){delete r[n]}self._assignEventHandlers();return self}self._removeListenerFromEventType(e,t);return self};self._removeListenerFromEventType=function(e,t){var n=r[e],i=0;t=t||null;if(t===null){r[e]=[];return self}for(;i<n.length;i++){if(n[i]===t){n.splice(i,1);i--}}return self};self.terminating=function(e){var t=self._callbackStack.terminating;if(typeof e==="function"){t.push(e)}return self};self.trigger=function(e,n){var r=null;e=e||null;if(e===null){return self}if(typeof e==="string"){r=e||null;e={type:r}}else if(typeof e==="object"){r=e.type||null;n=e.data}if(r===null){return self}e.data=n;self.sendMessage(t.TRIGGER_SELF,[e]);return self};self.triggerSelf=function(e,t){var n=null,i=null,s=null,o=null,u=0;e=e||null;if(e===null){return this}if(typeof e==="string"){n=e||null;e={type:e}}else if(typeof e==="object"){n=e.type||null;t=e.data}if(n===null){return this}e.data=t;i=r[n]||null;if(i===null){return this}s=i.length;for(u=0;u<s;u++){o=i[u];o.apply(this,[e]);if(s!==i.length){u--;s=i.length}}return this};self.sendMessage=function(e,t){var n=null;e=e||null;t=t||[];if(e===null){return self}n={__isWebWorkerMsg:true};n.action=e;n.args=t;self.postMessage(n);return self};self.terminate=function(e){e=!!e;if(!self.isTerminating()){self._setTerminatingStatus();self.triggerSelf(n.WORKER_TERMINATING);self.trigger(n.WORKER_TERMINATING)}self.sendMessage(t.TERMINATE_NOW,[]);if(e){self._nativeClose()}return self};self.terminateNow=function(){return self.terminate(true)};self._setTerminatingStatus=function(){self._state=e.TERMINATING;return self};self._nativeClose=self.close;self.close=self.terminate;self.addEventListener("message",function(e){var t=e.originalEvent||e,n=t.data,r=null,i=null;if(typeof n==="object"&&"__isWebWorkerMsg"in n&&n.__isWebWorkerMsg){r=n.action;i=n.args;self[r].apply(self,i)}},false);self._init()',e2._workerScriptWrapper=e2._workerScriptWrapper.replace(/\{\{state-data\}\}/g,JSON.stringify(a)).replace(/\{\{action-data\}\}/g,JSON.stringify(u)).replace(/\{\{event-data\}\}/g,JSON.stringify(f)),e2.getLastError=e2.prototype.getLastError,e2.noConflict=function(t3,n3){return t3=t3||null,n3=n3||null,o[s]===e2&&(delete o[s],r2&&(o[s]=r2)),t3&&n3&&(t3[n3]=e2),e2},i2[l]=e2})(jQuery);!(function(n2){"use strict";function d(n3,t3){var r3=(65535&n3)+(65535&t3);return(n3>>16)+(t3>>16)+(r3>>16)<<16|65535&r3}function f(n3,t3,r3,e3,o2,u2){return d((u2=d(d(t3,n3),d(e3,u2)))<<o2|u2>>>32-o2,r3)}function l(n3,t3,r3,e3,o2,u2,c2){return f(t3&r3|~t3&e3,n3,t3,o2,u2,c2)}function g(n3,t3,r3,e3,o2,u2,c2){return f(t3&e3|r3&~e3,n3,t3,o2,u2,c2)}function v(n3,t3,r3,e3,o2,u2,c2){return f(t3^r3^e3,n3,t3,o2,u2,c2)}function m(n3,t3,r3,e3,o2,u2,c2){return f(r3^(t3|~e3),n3,t3,o2,u2,c2)}function c(n3,t3){var r3,e3,o2,u2;n3[t3>>5]|=128<<t3%32,n3[14+(t3+64>>>9<<4)]=t3;for(var c2=1732584193,f2=-271733879,i3=-1732584194,a2=271733878,h=0;h<n3.length;h+=16)c2=l(r3=c2,e3=f2,o2=i3,u2=a2,n3[h],7,-680876936),a2=l(a2,c2,f2,i3,n3[h+1],12,-389564586),i3=l(i3,a2,c2,f2,n3[h+2],17,606105819),f2=l(f2,i3,a2,c2,n3[h+3],22,-1044525330),c2=l(c2,f2,i3,a2,n3[h+4],7,-176418897),a2=l(a2,c2,f2,i3,n3[h+5],12,1200080426),i3=l(i3,a2,c2,f2,n3[h+6],17,-1473231341),f2=l(f2,i3,a2,c2,n3[h+7],22,-45705983),c2=l(c2,f2,i3,a2,n3[h+8],7,1770035416),a2=l(a2,c2,f2,i3,n3[h+9],12,-1958414417),i3=l(i3,a2,c2,f2,n3[h+10],17,-42063),f2=l(f2,i3,a2,c2,n3[h+11],22,-1990404162),c2=l(c2,f2,i3,a2,n3[h+12],7,1804603682),a2=l(a2,c2,f2,i3,n3[h+13],12,-40341101),i3=l(i3,a2,c2,f2,n3[h+14],17,-1502002290),c2=g(c2,f2=l(f2,i3,a2,c2,n3[h+15],22,1236535329),i3,a2,n3[h+1],5,-165796510),a2=g(a2,c2,f2,i3,n3[h+6],9,-1069501632),i3=g(i3,a2,c2,f2,n3[h+11],14,643717713),f2=g(f2,i3,a2,c2,n3[h],20,-373897302),c2=g(c2,f2,i3,a2,n3[h+5],5,-701558691),a2=g(a2,c2,f2,i3,n3[h+10],9,38016083),i3=g(i3,a2,c2,f2,n3[h+15],14,-660478335),f2=g(f2,i3,a2,c2,n3[h+4],20,-405537848),c2=g(c2,f2,i3,a2,n3[h+9],5,568446438),a2=g(a2,c2,f2,i3,n3[h+14],9,-1019803690),i3=g(i3,a2,c2,f2,n3[h+3],14,-187363961),f2=g(f2,i3,a2,c2,n3[h+8],20,1163531501),c2=g(c2,f2,i3,a2,n3[h+13],5,-1444681467),a2=g(a2,c2,f2,i3,n3[h+2],9,-51403784),i3=g(i3,a2,c2,f2,n3[h+7],14,1735328473),c2=v(c2,f2=g(f2,i3,a2,c2,n3[h+12],20,-1926607734),i3,a2,n3[h+5],4,-378558),a2=v(a2,c2,f2,i3,n3[h+8],11,-2022574463),i3=v(i3,a2,c2,f2,n3[h+11],16,1839030562),f2=v(f2,i3,a2,c2,n3[h+14],23,-35309556),c2=v(c2,f2,i3,a2,n3[h+1],4,-1530992060),a2=v(a2,c2,f2,i3,n3[h+4],11,1272893353),i3=v(i3,a2,c2,f2,n3[h+7],16,-155497632),f2=v(f2,i3,a2,c2,n3[h+10],23,-1094730640),c2=v(c2,f2,i3,a2,n3[h+13],4,681279174),a2=v(a2,c2,f2,i3,n3[h],11,-358537222),i3=v(i3,a2,c2,f2,n3[h+3],16,-722521979),f2=v(f2,i3,a2,c2,n3[h+6],23,76029189),c2=v(c2,f2,i3,a2,n3[h+9],4,-640364487),a2=v(a2,c2,f2,i3,n3[h+12],11,-421815835),i3=v(i3,a2,c2,f2,n3[h+15],16,530742520),c2=m(c2,f2=v(f2,i3,a2,c2,n3[h+2],23,-995338651),i3,a2,n3[h],6,-198630844),a2=m(a2,c2,f2,i3,n3[h+7],10,1126891415),i3=m(i3,a2,c2,f2,n3[h+14],15,-1416354905),f2=m(f2,i3,a2,c2,n3[h+5],21,-57434055),c2=m(c2,f2,i3,a2,n3[h+12],6,1700485571),a2=m(a2,c2,f2,i3,n3[h+3],10,-1894986606),i3=m(i3,a2,c2,f2,n3[h+10],15,-1051523),f2=m(f2,i3,a2,c2,n3[h+1],21,-2054922799),c2=m(c2,f2,i3,a2,n3[h+8],6,1873313359),a2=m(a2,c2,f2,i3,n3[h+15],10,-30611744),i3=m(i3,a2,c2,f2,n3[h+6],15,-1560198380),f2=m(f2,i3,a2,c2,n3[h+13],21,1309151649),c2=m(c2,f2,i3,a2,n3[h+4],6,-145523070),a2=m(a2,c2,f2,i3,n3[h+11],10,-1120210379),i3=m(i3,a2,c2,f2,n3[h+2],15,718787259),f2=m(f2,i3,a2,c2,n3[h+9],21,-343485551),c2=d(c2,r3),f2=d(f2,e3),i3=d(i3,o2),a2=d(a2,u2);return[c2,f2,i3,a2]}function i2(n3){for(var t3="",r3=32*n3.length,e3=0;e3<r3;e3+=8)t3+=String.fromCharCode(n3[e3>>5]>>>e3%32&255);return t3}function a(n3){var t3=[];for(t3[(n3.length>>2)-1]=void 0,e3=0;e3<t3.length;e3+=1)t3[e3]=0;for(var r3=8*n3.length,e3=0;e3<r3;e3+=8)t3[e3>>5]|=(255&n3.charCodeAt(e3/8))<<e3%32;return t3}function e2(n3){for(var t3,r3="0123456789abcdef",e3="",o2=0;o2<n3.length;o2+=1)t3=n3.charCodeAt(o2),e3+=r3.charAt(t3>>>4&15)+r3.charAt(15&t3);return e3}function r2(n3){return unescape(encodeURIComponent(n3))}function o(n3){return i2(c(a(n3=r2(n3)),8*n3.length))}function u(n3,t3){return(function(n4,t4){var r3,e3=a(n4),o2=[],u2=[];for(o2[15]=u2[15]=void 0,16<e3.length&&(e3=c(e3,8*n4.length)),r3=0;r3<16;r3+=1)o2[r3]=909522486^e3[r3],u2[r3]=1549556828^e3[r3];return t4=c(o2.concat(a(t4)),512+8*t4.length),i2(c(u2.concat(t4),640))})(r2(n3),r2(t3))}function t2(n3,t3,r3){return t3?r3?u(t3,n3):e2(u(t3,n3)):r3?o(n3):e2(o(n3))}"function"==typeof define&&define.amd?define(function(){return t2}):"object"==typeof module&&module.exports?module.exports=t2:n2.md5=t2})(this);var _cssw=`let _w=self;var commentre=/\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;function parseMe(t,e){e=e||{};var i=1,n=1;function s(t){var e=t.match(/\\n/g);e&&(i+=e.length);var s=t.lastIndexOf("\\n");n=~s?t.length-s:n+t.length}function r(){var t={line:i,column:n};return function(e){return e.position=new o(t),f(),e}}function o(t){this.start=t,this.end={line:i,column:n},this.source=e.source}o.prototype.content=t;var a=[];function p(s){var r=new Error(e.source+":"+i+":"+n+": "+s);if(r.reason=s,r.filename=e.source,r.line=i,r.column=n,r.source=t,!e.silent)throw r;a.push(r)}function m(){return h(/^{\\s*/)}function u(){return h(/^}/)}function c(){var e,i=[];for(f(),l(i);t.length&&"}"!=t.charAt(0)&&(e=A()||b());)!1!==e&&(i.push(e),l(i));return i}function h(e){var i=e.exec(t);if(i){var n=i[0];return s(n),t=t.slice(n.length),i}}function f(){h(/^\\s*/)}function l(t){var e;for(t=t||[];e=d();)!1!==e&&t.push(e);return t}function d(){var e=r();if("/"==t.charAt(0)&&"*"==t.charAt(1)){for(var i=2;""!=t.charAt(i)&&("*"!=t.charAt(i)||"/"!=t.charAt(i+1));)++i;if(i+=2,""===t.charAt(i-1))return p("End of comment missing");var o=t.slice(2,i-2);return n+=2,s(o),t=t.slice(i),n+=2,e({type:"comment",comment:o})}}function y(){var t=h(/^([^{]+)/);if(t)return trim(t[0]).replace(/\\/\\*([^*]|[\\r\\n]|(\\*+([^*/]|[\\r\\n])))*\\*\\/+/g,"").replace(/"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'/g,(function(t){return t.replace(/,/g,"\u200C")})).split(/\\s*(?![^(]*\\)),\\s*/).map((function(t){return t.replace(/\\u200C/g,",")}))}function v(){var t=r(),e=h(/^(\\*?[-#\\/\\*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/);if(e){if(e=trim(e[0]),!h(/^:\\s*/))return p("property missing ':'");var i=h(/^((?:'(?:\\\\'|.)*?'|"(?:\\\\"|.)*?"|\\([^\\)]*?\\)|[^};])+)/),n=t({type:"declaration",property:e.replace(commentre,""),value:i?trim(i[0]).replace(commentre,""):""});return h(/^[;\\s]*/),n}}function g(){var t,e=[];if(!m())return p("missing '{'");for(l(e);t=v();)!1!==t&&(e.push(t),l(e));return u()?e:p("missing '}'")}function I(){for(var t,e=[],i=r();t=h(/^((\\d+\\.\\d+|\\.\\d+|\\d+)%?|[a-z]+)\\s*/);)e.push(t[1]),h(/^,\\s*/);if(e.length)return i({type:"keyframe",values:e,declarations:g()})}var C,V=j("import"),k=j("charset"),w=j("namespace");function j(t){var e=new RegExp("^@"+t+"\\\\s*([^;]+);");return function(){var i=r(),n=h(e);if(n){var s={type:t};return s[t]=n[1].trim(),i(s)}}}function A(){if("@"==t[0])return function(){var t=r();if(e=h(/^@([-\\w]+)?keyframes\\s*/)){var e,i=e[1];if(!(e=h(/^([-\\w]+)\\s*/)))return p("@keyframes missing name");var n,s=e[1];if(!m())return p("@keyframes missing '{'");for(var o=l();n=I();)o.push(n),o=o.concat(l());return u()?t({type:"keyframes",name:s,vendor:i,keyframes:o}):p("@keyframes missing '}'")}}()||function(){var t=r(),e=h(/^@media *([^{]+)/);if(e){var i=trim(e[1]);if(!m())return p("@media missing '{'");var n=l().concat(c());return u()?t({type:"media",media:i,rules:n}):p("@media missing '}'")}}()||function(){var t=r(),e=h(/^@custom-media\\s+(--[^\\s]+)\\s*([^{;]+);/);if(e)return t({type:"custom-media",name:trim(e[1]),media:trim(e[2])})}()||function(){var t=r(),e=h(/^@supports *([^{]+)/);if(e){var i=trim(e[1]);if(!m())return p("@supports missing '{'");var n=l().concat(c());return u()?t({type:"supports",supports:i,rules:n}):p("@supports missing '}'")}}()||V()||k()||w()||function(){var t=r(),e=h(/^@([-\\w]+)?document *([^{]+)/);if(e){var i=trim(e[1]),n=trim(e[2]);if(!m())return p("@document missing '{'");var s=l().concat(c());return u()?t({type:"document",document:n,vendor:i,rules:s}):p("@document missing '}'")}}()||function(){var t=r();if(h(/^@page */)){var e=y()||[];if(!m())return p("@page missing '{'");for(var i,n=l();i=v();)n.push(i),n=n.concat(l());return u()?t({type:"page",selectors:e,declarations:n}):p("@page missing '}'")}}()||function(){var t=r();if(h(/^@host\\s*/)){if(!m())return p("@host missing '{'");var e=l().concat(c());return u()?t({type:"host",rules:e}):p("@host missing '}'")}}()||function(){var t=r();if(h(/^@font-face\\s*/)){if(!m())return p("@font-face missing '{'");for(var e,i=l();e=v();)i.push(e),i=i.concat(l());return u()?t({type:"font-face",declarations:i}):p("@font-face missing '}'")}}()}function b(){var t=r(),e=y();return e?(l(),t({type:"rule",selectors:e,declarations:g()})):p("selector missing")}return addParent((C=c(),{type:"stylesheet",stylesheet:{source:e.source,rules:C,parsingErrors:a}}))}function trim(t){return t?t.replace(/^\\s+|\\s+$/g,""):""}function addParent(t,e){var i=t&&"string"==typeof t.type,n=i?t:e;for(var s in t){var r=t[s];Array.isArray(r)?r.forEach((function(t){addParent(t,n)})):r&&"object"==typeof r&&addParent(r,n)}return i&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:e||null}),t}class Compress{options={};indentation=null;constructor(t){this.options=t??{},this.indentation=t?.indent??null}}Compress.prototype.emit=function(t){return t},Compress.prototype.visit=function(t){return this[t.type](t)},Compress.prototype.mapVisit=function(t,e){var i="";e=e||"";for(var n=0,s=t.length;n<s;n++)i+=this.visit(t[n]),e&&n<s-1&&(i+=this.emit(e));return i},Compress.prototype.compile=function(t){return t.stylesheet.rules.map(this.visit,this).join("")},Compress.prototype.comment=function(t){return this.emit("",t.position)},Compress.prototype.import=function(t){return this.emit("@import "+t.import+";",t.position)},Compress.prototype.media=function(t){return this.emit("@media "+t.media,t.position)+this.emit("{")+this.mapVisit(t.rules)+this.emit("}")},Compress.prototype.document=function(t){var e="@"+(t.vendor||"")+"document "+t.document;return this.emit(e,t.position)+this.emit("{")+this.mapVisit(t.rules)+this.emit("}")},Compress.prototype.charset=function(t){return this.emit("@charset "+t.charset+";",t.position)},Compress.prototype.namespace=function(t){return this.emit("@namespace "+t.namespace+";",t.position)},Compress.prototype.supports=function(t){return this.emit("@supports "+t.supports,t.position)+this.emit("{")+this.mapVisit(t.rules)+this.emit("}")},Compress.prototype.keyframes=function(t){return this.emit("@"+(t.vendor||"")+"keyframes "+t.name,t.position)+this.emit("{")+this.mapVisit(t.keyframes)+this.emit("}")},Compress.prototype.keyframe=function(t){var e=t.declarations;return this.emit(t.values.join(","),t.position)+this.emit("{")+this.mapVisit(e)+this.emit("}")},Compress.prototype.page=function(t){var e=t.selectors.length?t.selectors.join(", "):"";return this.emit("@page "+e,t.position)+this.emit("{")+this.mapVisit(t.declarations)+this.emit("}")},Compress.prototype["font-face"]=function(t){return this.emit("@font-face",t.position)+this.emit("{")+this.mapVisit(t.declarations)+this.emit("}")},Compress.prototype.host=function(t){return this.emit("@host",t.position)+this.emit("{")+this.mapVisit(t.rules)+this.emit("}")},Compress.prototype["custom-media"]=function(t){return this.emit("@custom-media "+t.name+" "+t.media+";",t.position)},Compress.prototype.rule=function(t){var e=t.declarations;return e.length?this.emit(t.selectors.join(","),t.position)+this.emit("{")+this.mapVisit(e)+this.emit("}"):""},Compress.prototype.declaration=function(t){return this.emit(t.property+":"+t.value,t.position)+this.emit(";")};class Identity{options={};indentation=null;constructor(t){this.options=t??{},this.indentation=t?.indent??null}}function stringifyMe(t,e){var i=(e=e||{}).compress?new Compress(e):new Identity(e);if(e.sourcemap){require("./source-map-support")(i);var n=i.compile(t);return i.applySourceMaps(),{code:n,map:"generator"===e.sourcemap?i.map:i.map.toJSON()}}return n=i.compile(t)}Identity.prototype.emit=function(t){return t},Identity.prototype.visit=function(t){return this[t.type](t)},Identity.prototype.mapVisit=function(t,e){var i="";e=e||"";for(var n=0,s=t.length;n<s;n++)i+=this.visit(t[n]),e&&n<s-1&&(i+=this.emit(e));return i},Identity.prototype.compile=function(t){return this.stylesheet(t)},Identity.prototype.stylesheet=function(t){return this.mapVisit(t.stylesheet.rules,"\\n\\n")},Identity.prototype.comment=function(t){return this.emit(this.indent()+"/*"+t.comment+"*/",t.position)},Identity.prototype.import=function(t){return this.emit("@import "+t.import+";",t.position)},Identity.prototype.media=function(t){return this.emit("@media "+t.media,t.position)+this.emit(" {\\n"+this.indent(1))+this.mapVisit(t.rules,"\\n\\n")+this.emit(this.indent(-1)+"\\n}")},Identity.prototype.document=function(t){var e="@"+(t.vendor||"")+"document "+t.document;return this.emit(e,t.position)+this.emit(" {\\n"+this.indent(1))+this.mapVisit(t.rules,"\\n\\n")+this.emit(this.indent(-1)+"\\n}")},Identity.prototype.charset=function(t){return this.emit("@charset "+t.charset+";",t.position)},Identity.prototype.namespace=function(t){return this.emit("@namespace "+t.namespace+";",t.position)},Identity.prototype.supports=function(t){return this.emit("@supports "+t.supports,t.position)+this.emit(" {\\n"+this.indent(1))+this.mapVisit(t.rules,"\\n\\n")+this.emit(this.indent(-1)+"\\n}")},Identity.prototype.keyframes=function(t){return this.emit("@"+(t.vendor||"")+"keyframes "+t.name,t.position)+this.emit(" {\\n"+this.indent(1))+this.mapVisit(t.keyframes,"\\n")+this.emit(this.indent(-1)+"}")},Identity.prototype.keyframe=function(t){var e=t.declarations;return this.emit(this.indent())+this.emit(t.values.join(", "),t.position)+this.emit(" {\\n"+this.indent(1))+this.mapVisit(e,"\\n")+this.emit(this.indent(-1)+"\\n"+this.indent()+"}\\n")},Identity.prototype.page=function(t){var e=t.selectors.length?t.selectors.join(", ")+" ":"";return this.emit("@page "+e,t.position)+this.emit("{\\n")+this.emit(this.indent(1))+this.mapVisit(t.declarations,"\\n")+this.emit(this.indent(-1))+this.emit("\\n}")},Identity.prototype["font-face"]=function(t){return this.emit("@font-face ",t.position)+this.emit("{\\n")+this.emit(this.indent(1))+this.mapVisit(t.declarations,"\\n")+this.emit(this.indent(-1))+this.emit("\\n}")},Identity.prototype.host=function(t){return this.emit("@host",t.position)+this.emit(" {\\n"+this.indent(1))+this.mapVisit(t.rules,"\\n\\n")+this.emit(this.indent(-1)+"\\n}")},Identity.prototype["custom-media"]=function(t){return this.emit("@custom-media "+t.name+" "+t.media+";",t.position)},Identity.prototype.rule=function(t){var e=this.indent(),i=t.declarations;return i.length?this.emit(t.selectors.map((function(t){return e+t})).join(",\\n"),t.position)+this.emit(" {\\n")+this.emit(this.indent(1))+this.mapVisit(i,"\\n")+this.emit(this.indent(-1))+this.emit("\\n"+this.indent()+"}"):""},Identity.prototype.declaration=function(t){return this.emit(this.indent())+this.emit(t.property+": "+t.value,t.position)+this.emit(";")},Identity.prototype.indent=function(t){return this.level=this.level||1,null!=t?(this.level+=t,""):Array(this.level).join(this.indentation||" ")},function(){"use strict";_w.on("css-ready",(function(t){var e=t.data.csses,i=t.data.key,n=t.data.pre;for(let t=0;t<e.length;t++){var s=parseMe(e[t],{silent:!0});for(let t=0;t<s?.stylesheet?.rules?.length;t++)for(let e=0;e<s?.stylesheet?.rules[t].selectors.length;e++)"*"==s?.stylesheet?.rules[t].selectors[e]?s.stylesheet.rules[t].selectors[e]=n+", "+n+" "+s?.stylesheet?.rules[t].selectors[e]:s.stylesheet.rules[t].selectors[e]=n+" "+s?.stylesheet?.rules[t].selectors[e];var r=stringifyMe(s,{compress:!0});e[t]=r}_w.trigger("css-ready",{csses:e,key:i})}))}(); `;var _upw=`let _w=self;var files=[];function defer(){var e,t,s=new Promise(((s,r)=>{e=s,t=r}));return s.resolve=e,s.reject=t,s.success=e,s.failed=t,s}class _Live{_chnls={};_users={};_iter=0;reconnectAttempts=0;timeoutInterval=4e3;cbs={};_cbs={};lstnrs={};_ws;srvr=void 0;constructor(e,t){return this.srvr=e,this.init(t),this}on(e,t){return this.lstnrs.hasOwnProperty(e)||(this.lstnrs[e]=[]),this.lstnrs[e].push(t),"open"==e&&1==this._ws?.readyState&&this.trigger("open",this._ws),this}off(e){return"connect"==e||this.lstnrs.hasOwnProperty(e)&&delete this.lstnrs[e],this}createUser(e){return new _User(e,this)}subscribe(e,t){return this.on(e,t)}unsubscribe(e,t){return this.off(e,t)}trigger(e,t){if(this.lstnrs.hasOwnProperty(e))for(let s=0;s<this.lstnrs[e].length;s++)this.lstnrs[e][s](t);return this}emit(e,t,s){try{this._iter++,s&&(this.cbs["cb_"+this._iter]=s),this.ready()?this._ws.send(JSON.stringify({e:e,payload:t,_iter:this._iter})):this._send(JSON.stringify({e:e,payload:t,_iter:this._iter}))}catch(e){_debugMode&&cl(e)}return this}_emit(e,t,s){this._iter++;let r=defer();return this._cbs["cb_"+this._iter]=r,s?this.ready()?(this._ws.binaryType="arraybuffer",this._ws.send(this._binData({e:e,payloadBin:t,_iter:this._iter})),this._ws.binaryType="blob"):this._send(this._binData({e:e,payloadBin:t,_iter:this._iter})):this.ready()?this._ws.send(JSON.stringify({e:e,payload:t,_iter:this._iter})):this._send(JSON.stringify({e:e,payload:t,_iter:this._iter})),r}_send(e){let t=this;setTimeout((function(){t.ready()?t._ws.send(e):t._send(e)}),500)}ready(){return void 0!==this._ws&&this._ws.readyState==WebSocket.OPEN}connecting(){return void 0!==this._ws&&this._ws.readyState==WebSocket.CONNECTING}init(e){var t=this;if(t.ready())e&&"STARTED"==e.status&&upload(e);else if(t.connecting())setTimeout((function(){t.ready()?e&&"STARTED"==e.status&&upload(e):t.init(e)}),500);else{this._ws=new WebSocket(this.srvr?this.srvr:"wss://www.beaapis.com/");var s=this._ws,r=setTimeout((function(){1!=s.readyState&&s.close()}),this.timeoutInterval);this._ws.onopen=function(s){e&&"STARTED"==e.status&&upload(e),clearTimeout(r),t.trigger("connect",s),t.trigger("open",s)},this._ws.onclose=function(s){clearTimeout(r),t._ws=void 0,t._iter=0,t.cbs={},setTimeout((function(){t.reconnectAttempts++,t.init(e)}),1e3)},this._ws.onmessage=function(e){try{let s=JSON.parse(e.data);if(s.hasOwnProperty("for")){let e=s.type??"room",r=s.ev??"message";const i=new CustomEvent(r,{detail:s.payload});i.data=s.payload;let n=s.payload;n.hasOwnProperty("user")&&("user"==e?t._users[s.for].trigger(r,i):t._chnls[n.user.id][s.for].trigger(r,i))}else if(s.hasOwnProperty("e")){let e=s.e,r=s._iter;const i=new CustomEvent(e,{detail:s.payload});i.data=s.payload,"rooms"!=e&&t.trigger(e,i),t.cbs["cb_"+r]&&t.cbs["cb_"+r](i),t._cbs["cb_"+r].resolve(i)}}catch(e){}},this._ws.onerror=function(e){t._ws&&t._ws.close()}}}_binData(e){var t=e.payloadBin,s=t.chunk;delete t.chunk;const r=JSON.stringify({payload:t,e:e.e,_iter:e._iter}),i=new TextEncoder,n=i.encode("!"),a=i.encode(r),o=i.encode("_B_:_E_:_A_"),u=s;let l=new Uint8Array(n.byteLength+a.byteLength+o.byteLength+u.byteLength);return l.set(new Uint8Array(n),0),l.set(new Uint8Array(a),n.byteLength),l.set(new Uint8Array(o),n.byteLength+a.byteLength),l.set(new Uint8Array(u),n.byteLength+a.byteLength+o.byteLength),l}}var LIVE=new _Live("wss://www.beaapis.com/");function openSocket(e){LIVE.init(e)}function readFileAsync(e){return new Promise(((t,s)=>{let r=new FileReader;r.onload=e=>{let s=new ArrayBuffer;s=e.target.result,t(s)},r.onerror=s,r.readAsArrayBuffer(e)}))}var _queue={};function fid(){return"file_"+Date.now().toString(36)+Math.floor(Math.pow(10,12)+9*Math.random()*Math.pow(10,12)).toString(36)}const wait=e=>new Promise(((t,s)=>{setTimeout(t,e)}));async function upload(e){if(e&&"STARTED"!=e.status)return;const t=Math.ceil(256000);for(var s=0;s<Object.keys(e.files).length;s++){let l=Object.keys(e.files)[s],d=Object.values(e.files)[s];if(e&&"STOPPED"==e.status)return;if("DONE"==d.status)continue;let c=e.blobs[l],h=e.data[l],f=c.size;var r=0,i=t,n=Math.ceil(f/t),a={cmd:1,name:c.name,id:l,chunks:n};await LIVE._emit("upload",a);let p=1;for(h.part>1&&(p=h.part?h.part:1,i=(r=(p-1)*t)+t);r<f;){if(e&&"STOPPED"==e.status)return;if(!e.files.hasOwnProperty(l))return;if("mozSlice"in c)var o=c.mozSlice(r,i);else if("slice"in c)o=c.slice(r,i);else o=c.webkitSlice(r,i);var u=await readFileAsync(o);a={cmd:2,name:c.name,part:p,chunks:n,id:l,chunk:u};h.chunks=n,h.part=p+1,d.status="UPLOADING",d.loaded=d.loaded+o.size,d.percent=Math.ceil(100*p/n),d.loaded>d.size&&(d.loaded=d.size),d.percent>100&&(d.percent=100);let s=await LIVE._emit("upload",a,!0);s?.data?.url&&(d.url=s?.data?.url),_w.trigger("upload-progress",{upid:d.upid,files:e.files}),i=(r=i)+t,p++}d.status="DONE",_w.trigger("file-uploaded",{upid:d.upid,files:e.files,file:d})}e.status="DONE",_w.trigger("upload-complete",{upid:e.upid,files:e.files})}function process(e){var t=e.upid,s=e.files;_queue.hasOwnProperty(t)||(_queue[t]={status:"QUEUED",upid:t,files:{},blobs:{},data:{}});for(var r=_queue[t],i=[],n={},a={},o=0;o<s.length;o++)i.push(s[o]);for(;i.length>0;){var u=i.shift(),l=fid();n[l]={id:l,upid:t,name:u.name,type:u.type,size:u.size,loaded:0,percent:0,status:"QUEUED",lastModifiedDate:u.lastModifiedDate?u.lastModifiedDate.toLocaleDateString():"n/a"},a[l]={id:l,upid:t,chunks:1,part:1},r.files={...r.files,...n},r.data={...r.data,...a},r.blobs[l]=u,_w.trigger("queue-changed",{upid:t,files:r.files})}_w.trigger("files-added",{upid:t,files:r.files,newfiles:n})}!function(){"use strict";_w.on("handle-files",(function(e){process(e.data)})),_w.on("start-upload",(function(e){var t=e.data.upid,s=_queue[t];s?"STARTED"!=s.status?(s.status="STARTED",LIVE.ready()?upload(s):openSocket(s)):_w.trigger("message","Already Started!"):_w.trigger("queue-empty",{upid:t})})),_w.on("stop-upload",(function(e){var t=e.data.upid,s=_queue[t];s?(s.status="STOPPED",_w.trigger("upload-stop",{upid:t,files:s})):_w.trigger("queue-empty",{upid:t})})),_w.on("remove-file",(function(e){var t=e.data.upid,s=_queue[t],r=e.data.id;if(s.files?.hasOwnProperty(r)){var i=s.files[r];delete s.files[r],_w.trigger("file-removed",{upid:t,files:s.files,removedfile:i}),_w.trigger("queue-changed",{upid:t,files:s.files}),0==Object.keys(s.files).length&&(delete _queue[t],_w.trigger("queue-empty",{upid:t}))}}))}(); `;(function(a,b){if("function"==typeof define&&define.amd)define(["exports"],b);else if("undefined"!=typeof exports)b(exports);else{var c={exports:{}};b(c.exports),a.astring=c.exports}})("undefined"==typeof globalThis?"undefined"==typeof self?this:self:globalThis,function(a){"use strict";var b=String.prototype;function c(a2,b2){if(!(a2 instanceof b2))throw new TypeError("Cannot call a class as a function")}function d(a2,b2){for(var c2,d2=0;d2<b2.length;d2++)c2=b2[d2],c2.enumerable=c2.enumerable||false,c2.configurable=true,"value"in c2&&(c2.writable=true),Object.defineProperty(a2,c2.key,c2)}function e2(a2,b2,c2){return b2&&d(a2.prototype,b2),c2&&d(a2,c2),a2}function f(a2,b2){var c2=a2.generator;if(a2.write("("),null!=b2&&0<b2.length){c2[b2[0].type](b2[0],a2);for(var d2,e3=b2.length,f2=1;f2<e3;f2++)d2=b2[f2],a2.write(", "),c2[d2.type](d2,a2)}a2.write(")")}function g(a2,b2,c2,d2){var e3=a2.expressionsPrecedence[b2.type];if(e3===17)return true;var f2=a2.expressionsPrecedence[c2.type];return e3===f2?(13===e3||14===e3)&&("**"===b2.operator&&"**"===c2.operator?!d2:!(13!==e3||13!==f2||"??"!==b2.operator&&"??"!==c2.operator)||(d2?o[b2.operator]<=o[c2.operator]:o[b2.operator]<o[c2.operator])):!d2&&15===e3&&14===f2&&"**"===c2.operator||e3<f2}function h(a2,b2,c2,d2){var e3=a2.generator;g(a2,b2,c2,d2)?(a2.write("("),e3[b2.type](b2,a2),a2.write(")")):e3[b2.type](b2,a2)}function j(a2,b2,c2,d2){var e3=b2.split("\n"),f2=e3.length-1;if(a2.write(e3[0].trim()),0<f2){a2.write(d2);for(var g2=1;g2<f2;g2++)a2.write(c2+e3[g2].trim()+d2);a2.write(c2+e3[f2].trim())}}function k(a2,b2,c2,d2){for(var e3,f2=b2.length,g2=0;g2<f2;g2++)e3=b2[g2],a2.write(c2),"L"===e3.type[0]?a2.write("// "+e3.value.trim()+"\n",e3):(a2.write("/*"),j(a2,e3.value,c2,d2),a2.write("*/"+d2))}function l(a2){for(var d2=a2;null!=d2;){var b2=d2,c2=b2.type;if("C"===c2[0]&&"a"===c2[1])return true;if("M"===c2[0]&&"e"===c2[1]&&"m"===c2[2])d2=d2.object;else return false}}function m(a2,b2){var c2=a2.generator,d2=b2.declarations;a2.write(b2.kind+" ");var e3=d2.length;if(0<e3){c2.VariableDeclarator(d2[0],a2);for(var f2=1;f2<e3;f2++)a2.write(", "),c2.VariableDeclarator(d2[f2],a2)}}Object.defineProperty(a,"__esModule",{value:true}),a.generate=function(a2,b2){var c2=new z(b2);return c2.generator[a2.type](a2,c2),c2.output},a.baseGenerator=a.GENERATOR=a.EXPRESSIONS_PRECEDENCE=a.NEEDS_PARENTHESES=void 0;var n2=JSON.stringify;if(!b.repeat)throw new Error("String.prototype.repeat is undefined, see https://github.com/davidbonnet/astring#installation");if(!b.endsWith)throw new Error("String.prototype.endsWith is undefined, see https://github.com/davidbonnet/astring#installation");var o={"||":2,"??":3,"&&":4,"|":5,"^":6,"&":7,"==":8,"!=":8,"===":8,"!==":8,"<":9,">":9,"<=":9,">=":9,in:9,instanceof:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"%":12,"/":12,"**":13},p=17;a.NEEDS_PARENTHESES=p;var q={ArrayExpression:20,TaggedTemplateExpression:20,ThisExpression:20,Identifier:20,PrivateIdentifier:20,Literal:18,TemplateLiteral:20,Super:20,SequenceExpression:20,MemberExpression:19,ChainExpression:19,CallExpression:19,NewExpression:19,ArrowFunctionExpression:p,ClassExpression:p,FunctionExpression:p,ObjectExpression:p,UpdateExpression:16,UnaryExpression:15,AwaitExpression:15,BinaryExpression:14,LogicalExpression:13,ConditionalExpression:4,AssignmentExpression:3,YieldExpression:2,RestElement:1};a.EXPRESSIONS_PRECEDENCE=q;var r2,s,t2,u,v,w,x2={Program:function Program(a2,b2){var c2=b2.indent.repeat(b2.indentLevel),d2=b2.lineEnd,e3=b2.writeComments;e3&&null!=a2.comments&&k(b2,a2.comments,c2,d2);for(var f2,g2=a2.body,h2=g2.length,j2=0;j2<h2;j2++)f2=g2[j2],e3&&null!=f2.comments&&k(b2,f2.comments,c2,d2),b2.write(c2),this[f2.type](f2,b2),b2.write(d2);e3&&null!=a2.trailingComments&&k(b2,a2.trailingComments,c2,d2)},BlockStatement:w=function(a2,b2){var c2=b2.indent.repeat(b2.indentLevel++),d2=b2.lineEnd,e3=b2.writeComments,f2=c2+b2.indent;b2.write("{");var g2=a2.body;if(null!=g2&&0<g2.length){b2.write(d2),e3&&null!=a2.comments&&k(b2,a2.comments,f2,d2);for(var h2,j2=g2.length,l2=0;l2<j2;l2++)h2=g2[l2],e3&&null!=h2.comments&&k(b2,h2.comments,f2,d2),b2.write(f2),this[h2.type](h2,b2),b2.write(d2);b2.write(c2)}else e3&&null!=a2.comments&&(b2.write(d2),k(b2,a2.comments,f2,d2),b2.write(c2));e3&&null!=a2.trailingComments&&k(b2,a2.trailingComments,f2,d2),b2.write("}"),b2.indentLevel--},ClassBody:w,StaticBlock:function StaticBlock(a2,b2){b2.write("static "),this.BlockStatement(a2,b2)},EmptyStatement:function EmptyStatement(a2,b2){b2.write(";")},ExpressionStatement:function ExpressionStatement(a2,b2){var c2=b2.expressionsPrecedence[a2.expression.type];c2===p||3===c2&&"O"===a2.expression.left.type[0]?(b2.write("("),this[a2.expression.type](a2.expression,b2),b2.write(")")):this[a2.expression.type](a2.expression,b2),b2.write(";")},IfStatement:function IfStatement(a2,b2){b2.write("if ("),this[a2.test.type](a2.test,b2),b2.write(") "),this[a2.consequent.type](a2.consequent,b2),null!=a2.alternate&&(b2.write(" else "),this[a2.alternate.type](a2.alternate,b2))},LabeledStatement:function LabeledStatement(a2,b2){this[a2.label.type](a2.label,b2),b2.write(": "),this[a2.body.type](a2.body,b2)},BreakStatement:function BreakStatement(a2,b2){b2.write("break"),null!=a2.label&&(b2.write(" "),this[a2.label.type](a2.label,b2)),b2.write(";")},ContinueStatement:function ContinueStatement(a2,b2){b2.write("continue"),null!=a2.label&&(b2.write(" "),this[a2.label.type](a2.label,b2)),b2.write(";")},WithStatement:function WithStatement(a2,b2){b2.write("with ("),this[a2.object.type](a2.object,b2),b2.write(") "),this[a2.body.type](a2.body,b2)},SwitchStatement:function SwitchStatement(a2,b2){var c2=b2.indent.repeat(b2.indentLevel++),d2=b2.lineEnd,e3=b2.writeComments;b2.indentLevel++;var f2=c2+b2.indent,g2=f2+b2.indent;b2.write("switch ("),this[a2.discriminant.type](a2.discriminant,b2),b2.write(") {"+d2);for(var h2,j2=a2.cases,l2=j2.length,m2=0;m2<l2;m2++){h2=j2[m2],e3&&null!=h2.comments&&k(b2,h2.comments,f2,d2),h2.test?(b2.write(f2+"case "),this[h2.test.type](h2.test,b2),b2.write(":"+d2)):b2.write(f2+"default:"+d2);for(var n3,o2=h2.consequent,p2=o2.length,q2=0;q2<p2;q2++)n3=o2[q2],e3&&null!=n3.comments&&k(b2,n3.comments,g2,d2),b2.write(g2),this[n3.type](n3,b2),b2.write(d2)}b2.indentLevel-=2,b2.write(c2+"}")},ReturnStatement:function ReturnStatement(a2,b2){b2.write("return"),a2.argument&&(b2.write(" "),this[a2.argument.type](a2.argument,b2)),b2.write(";")},ThrowStatement:function ThrowStatement(a2,b2){b2.write("throw "),this[a2.argument.type](a2.argument,b2),b2.write(";")},TryStatement:function TryStatement(a2,b2){if(b2.write("try "),this[a2.block.type](a2.block,b2),a2.handler){var c2=a2.handler;null==c2.param?b2.write(" catch "):(b2.write(" catch ("),this[c2.param.type](c2.param,b2),b2.write(") ")),this[c2.body.type](c2.body,b2)}a2.finalizer&&(b2.write(" finally "),this[a2.finalizer.type](a2.finalizer,b2))},WhileStatement:function WhileStatement(a2,b2){b2.write("while ("),this[a2.test.type](a2.test,b2),b2.write(") "),this[a2.body.type](a2.body,b2)},DoWhileStatement:function DoWhileStatement(a2,b2){b2.write("do "),this[a2.body.type](a2.body,b2),b2.write(" while ("),this[a2.test.type](a2.test,b2),b2.write(");")},ForStatement:function ForStatement(a2,b2){if(b2.write("for ("),null!=a2.init){var c2=a2.init;"V"===c2.type[0]?m(b2,c2):this[c2.type](c2,b2)}b2.write("; "),a2.test&&this[a2.test.type](a2.test,b2),b2.write("; "),a2.update&&this[a2.update.type](a2.update,b2),b2.write(") "),this[a2.body.type](a2.body,b2)},ForInStatement:r2=function(a2,b2){b2.write("for ".concat(a2["await"]?"await ":"","("));var c2=a2.left;"V"===c2.type[0]?m(b2,c2):this[c2.type](c2,b2),b2.write("I"===a2.type[3]?" in ":" of "),this[a2.right.type](a2.right,b2),b2.write(") "),this[a2.body.type](a2.body,b2)},ForOfStatement:r2,DebuggerStatement:function DebuggerStatement(a2,b2){b2.write("debugger;",a2)},FunctionDeclaration:s=function(a2,b2){b2.write((a2.async?"async ":"")+(a2.generator?"function* ":"function ")+(a2.id?a2.id.name:""),a2),f(b2,a2.params),b2.write(" "),this[a2.body.type](a2.body,b2)},FunctionExpression:s,VariableDeclaration:function VariableDeclaration(a2,b2){m(b2,a2),b2.write(";")},VariableDeclarator:function VariableDeclarator(a2,b2){this[a2.id.type](a2.id,b2),null!=a2.init&&(b2.write(" = "),this[a2.init.type](a2.init,b2))},ClassDeclaration:function ClassDeclaration(a2,b2){if(b2.write("class "+(a2.id?"".concat(a2.id.name," "):""),a2),a2.superClass){b2.write("extends ");var c2=a2.superClass,d2=c2.type,e3=b2.expressionsPrecedence[d2];("C"!==d2[0]||"l"!==d2[1]||"E"!==d2[5])&&(e3===p||e3<b2.expressionsPrecedence.ClassExpression)?(b2.write("("),this[a2.superClass.type](c2,b2),b2.write(")")):this[c2.type](c2,b2),b2.write(" ")}this.ClassBody(a2.body,b2)},ImportDeclaration:function ImportDeclaration(a2,b2){b2.write("import ");var c2=a2.specifiers,d2=a2.attributes,e3=c2.length,f2=0;if(0<e3){for(;f2<e3;){0<f2&&b2.write(", ");var g2=c2[f2],h2=g2.type[6];if("D"===h2)b2.write(g2.local.name,g2),f2++;else if("N"===h2)b2.write("* as "+g2.local.name,g2),f2++;else break}if(f2<e3){for(b2.write("{");;){var j2=c2[f2],k2=j2.imported.name;if(b2.write(k2,j2),k2!==j2.local.name&&b2.write(" as "+j2.local.name),++f2<e3)b2.write(", ");else break}b2.write("}")}b2.write(" from ")}if(this.Literal(a2.source,b2),d2&&0<d2.length){b2.write(" with { ");for(var l2=0;l2<d2.length;l2++)this.ImportAttribute(d2[l2],b2),l2<d2.length-1&&b2.write(", ");b2.write(" }")}b2.write(";")},ImportAttribute:function ImportAttribute(a2,b2){this.Identifier(a2.key,b2),b2.write(": "),this.Literal(a2.value,b2)},ImportExpression:function ImportExpression(a2,b2){b2.write("import("),this[a2.source.type](a2.source,b2),b2.write(")")},ExportDefaultDeclaration:function ExportDefaultDeclaration(a2,b2){b2.write("export default "),this[a2.declaration.type](a2.declaration,b2),null!=b2.expressionsPrecedence[a2.declaration.type]&&"F"!==a2.declaration.type[0]&&b2.write(";")},ExportNamedDeclaration:function ExportNamedDeclaration(a2,b2){if(b2.write("export "),a2.declaration)this[a2.declaration.type](a2.declaration,b2);else{b2.write("{");var c2=a2.specifiers,d2=c2.length;if(0<d2)for(var g2=0;;){var e3=c2[g2],f2=e3.local.name;if(b2.write(f2,e3),f2!==e3.exported.name&&b2.write(" as "+e3.exported.name),++g2<d2)b2.write(", ");else break}if(b2.write("}"),a2.source&&(b2.write(" from "),this.Literal(a2.source,b2)),a2.attributes&&0<a2.attributes.length){b2.write(" with { ");for(var h2=0;h2<a2.attributes.length;h2++)this.ImportAttribute(a2.attributes[h2],b2),h2<a2.attributes.length-1&&b2.write(", ");b2.write(" }")}b2.write(";")}},ExportAllDeclaration:function ExportAllDeclaration(a2,b2){if(null==a2.exported?b2.write("export * from "):b2.write("export * as "+a2.exported.name+" from "),this.Literal(a2.source,b2),a2.attributes&&0<a2.attributes.length){b2.write(" with { ");for(var c2=0;c2<a2.attributes.length;c2++)this.ImportAttribute(a2.attributes[c2],b2),c2<a2.attributes.length-1&&b2.write(", ");b2.write(" }")}b2.write(";")},MethodDefinition:function MethodDefinition(a2,b2){a2["static"]&&b2.write("static ");var c2=a2.kind[0];("g"===c2||"s"===c2)&&b2.write(a2.kind+" "),a2.value.async&&b2.write("async "),a2.value.generator&&b2.write("*"),a2.computed?(b2.write("["),this[a2.key.type](a2.key,b2),b2.write("]")):this[a2.key.type](a2.key,b2),f(b2,a2.value.params),b2.write(" "),this[a2.value.body.type](a2.value.body,b2)},ClassExpression:function ClassExpression(a2,b2){this.ClassDeclaration(a2,b2)},ArrowFunctionExpression:function ArrowFunctionExpression(a2,b2){b2.write(a2.async?"async ":"",a2);var c2=a2.params;null!=c2&&(1===c2.length&&"I"===c2[0].type[0]?b2.write(c2[0].name,c2[0]):f(b2,a2.params)),b2.write(" => "),"O"===a2.body.type[0]?(b2.write("("),this.ObjectExpression(a2.body,b2),b2.write(")")):this[a2.body.type](a2.body,b2)},ThisExpression:function ThisExpression(a2,b2){b2.write("this",a2)},Super:function Super(a2,b2){b2.write("super",a2)},RestElement:t2=function(a2,b2){b2.write("..."),this[a2.argument.type](a2.argument,b2)},SpreadElement:t2,YieldExpression:function YieldExpression(a2,b2){b2.write(a2.delegate?"yield*":"yield"),a2.argument&&(b2.write(" "),this[a2.argument.type](a2.argument,b2))},AwaitExpression:function AwaitExpression(a2,b2){b2.write("await ",a2),h(b2,a2.argument,a2)},TemplateLiteral:function TemplateLiteral(a2,b2){var c2=a2.quasis,d2=a2.expressions;b2.write("`");for(var e3=d2.length,f2=0;f2<e3;f2++){var g2=d2[f2],h2=c2[f2];b2.write(h2.value.raw,h2),b2.write("${"),this[g2.type](g2,b2),b2.write("}")}var j2=c2[c2.length-1];b2.write(j2.value.raw,j2),b2.write("`")},TemplateElement:function TemplateElement(a2,b2){b2.write(a2.value.raw,a2)},TaggedTemplateExpression:function TaggedTemplateExpression(a2,b2){h(b2,a2.tag,a2),this[a2.quasi.type](a2.quasi,b2)},ArrayExpression:v=function(a2,b2){if(b2.write("["),0<a2.elements.length)for(var c2,d2=a2.elements,e3=d2.length,f2=0;;)if(c2=d2[f2],null!=c2&&this[c2.type](c2,b2),++f2<e3)b2.write(", ");else{null==c2&&b2.write(", ");break}b2.write("]")},ArrayPattern:v,ObjectExpression:function ObjectExpression(a2,b2){var c2=b2.indent.repeat(b2.indentLevel++),d2=b2.lineEnd,e3=b2.writeComments,f2=c2+b2.indent;if(b2.write("{"),0<a2.properties.length){b2.write(d2),e3&&null!=a2.comments&&k(b2,a2.comments,f2,d2);for(var g2,h2=a2.properties,j2=h2.length,l2=0;;)if(g2=h2[l2],e3&&null!=g2.comments&&k(b2,g2.comments,f2,d2),b2.write(f2),this[g2.type](g2,b2),++l2<j2)b2.write(","+d2);else break;b2.write(d2),e3&&null!=a2.trailingComments&&k(b2,a2.trailingComments,f2,d2),b2.write(c2+"}")}else e3?null==a2.comments?null==a2.trailingComments?b2.write("}"):(b2.write(d2),k(b2,a2.trailingComments,f2,d2),b2.write(c2+"}")):(b2.write(d2),k(b2,a2.comments,f2,d2),null!=a2.trailingComments&&k(b2,a2.trailingComments,f2,d2),b2.write(c2+"}")):b2.write("}");b2.indentLevel--},Property:function Property(a2,b2){a2.method||"i"!==a2.kind[0]?this.MethodDefinition(a2,b2):(!a2.shorthand&&(a2.computed?(b2.write("["),this[a2.key.type](a2.key,b2),b2.write("]")):this[a2.key.type](a2.key,b2),b2.write(": ")),this[a2.value.type](a2.value,b2))},PropertyDefinition:function PropertyDefinition(a2,b2){return a2["static"]&&b2.write("static "),a2.computed&&b2.write("["),this[a2.key.type](a2.key,b2),a2.computed&&b2.write("]"),null==a2.value?void("F"!==a2.key.type[0]&&b2.write(";")):void(b2.write(" = "),this[a2.value.type](a2.value,b2),b2.write(";"))},ObjectPattern:function ObjectPattern(a2,b2){if(b2.write("{"),0<a2.properties.length)for(var c2=a2.properties,d2=c2.length,e3=0;;)if(this[c2[e3].type](c2[e3],b2),++e3<d2)b2.write(", ");else break;b2.write("}")},SequenceExpression:function SequenceExpression(a2,b2){f(b2,a2.expressions)},UnaryExpression:function UnaryExpression(a2,b2){if(a2.prefix){var c2=a2.operator,d2=a2.argument,e3=a2.argument.type;b2.write(c2);var f2=g(b2,d2,a2);!f2&&(1<c2.length||"U"===e3[0]&&("n"===e3[1]||"p"===e3[1])&&d2.prefix&&d2.operator[0]===c2&&("+"===c2||"-"===c2))&&b2.write(" "),f2?(b2.write(1<c2.length?" (":"("),this[e3](d2,b2),b2.write(")")):this[e3](d2,b2)}else this[a2.argument.type](a2.argument,b2),b2.write(a2.operator)},UpdateExpression:function UpdateExpression(a2,b2){a2.prefix?(b2.write(a2.operator),this[a2.argument.type](a2.argument,b2)):(this[a2.argument.type](a2.argument,b2),b2.write(a2.operator))},AssignmentExpression:function AssignmentExpression(a2,b2){this[a2.left.type](a2.left,b2),b2.write(" "+a2.operator+" "),this[a2.right.type](a2.right,b2)},AssignmentPattern:function AssignmentPattern(a2,b2){this[a2.left.type](a2.left,b2),b2.write(" = "),this[a2.right.type](a2.right,b2)},BinaryExpression:u=function(a2,b2){var c2="in"===a2.operator;c2&&b2.write("("),h(b2,a2.left,a2,false),b2.write(" "+a2.operator+" "),h(b2,a2.right,a2,true),c2&&b2.write(")")},LogicalExpression:u,ConditionalExpression:function ConditionalExpression(a2,b2){var c2=a2.test,d2=b2.expressionsPrecedence[c2.type];d2===p||d2<=b2.expressionsPrecedence.ConditionalExpression?(b2.write("("),this[c2.type](c2,b2),b2.write(")")):this[c2.type](c2,b2),b2.write(" ? "),this[a2.consequent.type](a2.consequent,b2),b2.write(" : "),this[a2.alternate.type](a2.alternate,b2)},NewExpression:function NewExpression(a2,b2){b2.write("new ");var c2=b2.expressionsPrecedence[a2.callee.type];c2===p||c2<b2.expressionsPrecedence.CallExpression||l(a2.callee)?(b2.write("("),this[a2.callee.type](a2.callee,b2),b2.write(")")):this[a2.callee.type](a2.callee,b2),f(b2,a2.arguments)},CallExpression:function CallExpression(a2,b2){var c2=b2.expressionsPrecedence[a2.callee.type];c2===p||c2<b2.expressionsPrecedence.CallExpression?(b2.write("("),this[a2.callee.type](a2.callee,b2),b2.write(")")):this[a2.callee.type](a2.callee,b2),a2.optional&&b2.write("?."),f(b2,a2.arguments)},ChainExpression:function ChainExpression(a2,b2){this[a2.expression.type](a2.expression,b2)},MemberExpression:function MemberExpression(a2,b2){var c2=b2.expressionsPrecedence[a2.object.type];c2===p||c2<b2.expressionsPrecedence.MemberExpression?(b2.write("("),this[a2.object.type](a2.object,b2),b2.write(")")):this[a2.object.type](a2.object,b2),a2.computed?(a2.optional&&b2.write("?."),b2.write("["),this[a2.property.type](a2.property,b2),b2.write("]")):(a2.optional?b2.write("?."):b2.write("."),this[a2.property.type](a2.property,b2))},MetaProperty:function MetaProperty(a2,b2){b2.write(a2.meta.name+"."+a2.property.name,a2)},Identifier:function Identifier(a2,b2){b2.write(a2.name,a2)},PrivateIdentifier:function PrivateIdentifier(a2,b2){b2.write("#".concat(a2.name),a2)},Literal:function Literal(a2,b2){null==a2.raw?null==a2.regex?null==a2.bigint?b2.write(n2(a2.value),a2):b2.write(a2.bigint+"n",a2):this.RegExpLiteral(a2,b2):b2.write(a2.raw,a2)},RegExpLiteral:function RegExpLiteral(a2,b2){var c2=a2.regex;b2.write("/".concat(c2.pattern,"/").concat(c2.flags),a2)}};a.GENERATOR=x2;var y={};a.baseGenerator=x2;var z=(function(){function a2(b2){c(this,a2);var d2=null==b2?y:b2;this.output="",null==d2.output?this.output="":(this.output=d2.output,this.write=this.writeToStream),this.generator=null==d2.generator?x2:d2.generator,this.expressionsPrecedence=null==d2.expressionsPrecedence?q:d2.expressionsPrecedence,this.indent=null==d2.indent?" ":d2.indent,this.lineEnd=null==d2.lineEnd?"\n":d2.lineEnd,this.indentLevel=null==d2.startingIndentLevel?0:d2.startingIndentLevel,this.writeComments=!!d2.comments&&d2.comments,null!=d2.sourceMap&&(this.write=null==d2.output?this.writeAndMap:this.writeToStreamAndMap,this.sourceMap=d2.sourceMap,this.line=1,this.column=0,this.lineEndSize=this.lineEnd.split("\n").length-1,this.mapping={original:null,generated:this,name:void 0,source:d2.sourceMap.file||d2.sourceMap._file})}return e2(a2,[{key:"write",value:function write(a3){this.output+=a3}},{key:"writeToStream",value:function writeToStream(a3){this.output.write(a3)}},{key:"writeAndMap",value:function writeAndMap(a3,b2){this.output+=a3,this.map(a3,b2)}},{key:"writeToStreamAndMap",value:function writeToStreamAndMap(a3,b2){this.output.write(a3),this.map(a3,b2)}},{key:"map",value:function map(a3,b2){if(null!=b2){var c2=b2.type;if("L"===c2[0]&&"n"===c2[2])return this.column=0,void this.line++;if(null!=b2.loc){var d2=this.mapping;d2.original=b2.loc.start,d2.name=b2.name,this.sourceMap.addMapping(d2)}if("T"===c2[0]&&"E"===c2[8]||"L"===c2[0]&&"i"===c2[1]&&"string"==typeof b2.value){for(var e3=a3.length,f2=this.column,g2=this.line,h2=0;h2<e3;h2++)"\n"===a3[h2]?(f2=0,g2++):f2++;return this.column=f2,void(this.line=g2)}}var j2=a3.length,k2=this.lineEnd;0<j2&&(0<this.lineEndSize&&(1===k2.length?a3[j2-1]===k2:a3.endsWith(k2))?(this.line+=this.lineEndSize,this.column=0):this.column+=j2)}},{key:"toString",value:function toString(){return this.output}}]),a2})()});class WalkerBase{constructor(){this.should_skip=false;this.should_remove=false;this.replacement=null;this.context={skip:()=>this.should_skip=true,remove:()=>this.should_remove=true,replace:node=>this.replacement=node}}replace(parent2,prop,index2,node){if(parent2&&prop){if(index2!=null){parent2[prop][index2]=node}else{parent2[prop]=node}}}remove(parent2,prop,index2){if(parent2&&prop){if(index2!==null&&index2!==void 0){parent2[prop].splice(index2,1)}else{delete parent2[prop]}}}}class SyncWalker extends WalkerBase{constructor(enter,leave){super();this.should_skip=false;this.should_remove=false;this.replacement=null;this.context={skip:()=>this.should_skip=true,remove:()=>this.should_remove=true,replace:node=>this.replacement=node};this.enter=enter;this.leave=leave}visit(node,parent2,prop,index2){if(node){if(this.enter){const _should_skip=this.should_skip;const _should_remove=this.should_remove;const _replacement=this.replacement;this.should_skip=false;this.should_remove=false;this.replacement=null;this.enter.call(this.context,node,parent2,prop,index2);if(this.replacement){if(Array.isArray(this.replacement)){var expressions=[];for(let rp=0;rp<this.replacement.length;rp++){expressions.push(this.replacement[rp])}if(this.replacement.length>1){node={"type":"VariableDeclaration","start":node.start,"kind":"let","declarations":expressions,"level":node.level,"scope":node.scope}}else{node={"type":"ExpressionStatement","expression":{"type":"SequenceExpression","expressions":expressions,"level":node.level,"scope":node.scope},"level":node.level,"scope":node.scope}}this.replace(parent2,prop,index2,node)}else{node=this.replacement;this.replace(parent2,prop,index2,node)}}if(this.should_remove){this.remove(parent2,prop,index2)}const skipped=this.should_skip;const removed=this.should_remove;this.should_skip=_should_skip;this.should_remove=_should_remove;this.replacement=_replacement;if(skipped)return node;if(removed)return null}let key;for(key in node){const value=node[key];if(value&&typeof value==="object"){if(Array.isArray(value)){const nodes2=value;for(let i2=0;i2<nodes2.length;i2+=1){const item=nodes2[i2];if(isNode(item)){if(!this.visit(item,node,key,i2)){i2--}}}}else if(isNode(value)){this.visit(value,node,key,null)}}}if(this.leave){const _replacement=this.replacement;const _should_remove=this.should_remove;this.replacement=null;this.should_remove=false;this.leave.call(this.context,node,parent2,prop,index2);if(this.replacement){if(Array.isArray(this.replacement)){for(let rp=0;rp<this.replacement.length;rp++){node=this.replacement[rp];this.replace(parent2,prop,index2,node)}}else{node=this.replacement;this.replace(parent2,prop,index2,node)}}if(this.should_remove){this.remove(parent2,prop,index2)}const removed=this.should_remove;this.replacement=_replacement;this.should_remove=_should_remove;if(removed)return null}}return node}}function isNode(value){return value!==null&&typeof value==="object"&&"type"in value&&typeof value.type==="string"}function walk(ast,{enter,leave}){const instance=new SyncWalker(enter,leave);return instance.visit(ast,null)}function getProgramBody(node){if(node.type=="Program"){return node.body}return node}function parseNode(node){}function checkNodeL1(node,varz,vazzz){try{if(node&&typeof node==="object"){if(Array.isArray(node)){for(let i2=0;i2<node.length;i2++){const nd=node[i2];if(isNode(nd)){if(nd.type==="VariableDeclaration"){let declarators=nd.declarations;for(let x2=0;x2<declarators.length;x2++){let dec=declarators[x2].id;if(vazzz.includes(dec.name)){varz.push({name:dec.name,node:dec});dec.marked=true}}}else if(nd.type=="Identifier"){}parseNode(nd)}}}else if(isNode(node)){}}}catch(e2){}}function getL1Vs(AST,view,vazzz){var level=0,block=[{start:0}];var varz=view?.varz??[];let nodes2=getProgramBody(AST);checkNodeL1(nodes2,varz,vazzz);return{"varz":varz,"AST":AST}}function getWatcher(AST,view,vazzz,targetKey="View"){AST=JSON.parse(JSON.stringify(AST));let Vars=getL1Vs(AST,view,vazzz);AST=Vars["AST"];let varz=Vars["varz"];validateBeforeRewrite(AST,view);AST=changeReactiveVarsOccurences(AST,vazzz,targetKey);AST=transformTopLevelDeclarations(AST,vazzz,targetKey);return{"code":astring.generate(AST),"varz":varz}}function validateBeforeRewrite(AST,view){try{new Function(astring.generate(AST))}catch(e2){if(typeof reportLumenError==="function"){reportLumenError({stage:"validate",view:view?.name,error:e2,hint:"This is a real JavaScript error in your <script> block (for example, a variable declared twice with let/const) \u2014 fix it in the .view file; it will not surface again once rewritten."})}}}function buildTargetRootExpr(targetKey){const segments=Array.isArray(targetKey)?targetKey:[targetKey];let expr2={type:"Identifier",name:"_vt"};for(const seg of segments){if(typeof seg==="number"){expr2={type:"MemberExpression",object:expr2,property:{type:"Literal",value:seg,raw:String(seg)},computed:true}}else{expr2={type:"MemberExpression",object:expr2,property:{type:"Identifier",name:seg},computed:false}}}return expr2}function changeReactiveVarsOccurences(AST,reactiveVariables,targetKey="View"){const reactive=new Set(reactiveVariables||[]);const scopeStack=[];const bindingIdNodes=new WeakSet;const pushScope=isFunction=>scopeStack.push({isFunction:!!isFunction,names:new Set});const popScope=()=>scopeStack.pop();const currentScope=()=>scopeStack[scopeStack.length-1];function declare(name,kind){if(!name)return;if(kind==="var"||kind==="function"){for(let i2=scopeStack.length-1;i2>=0;i2--){if(scopeStack[i2].isFunction||i2===0){scopeStack[i2].names.add(name);return}}}else{currentScope().names.add(name)}}function rootHas(name){return scopeStack.length>0&&scopeStack[0].names.has(name)}function isShadowedFromRoot(name){for(let i2=scopeStack.length-1;i2>=1;i2--){if(scopeStack[i2].names.has(name))return true}return false}function visitPattern(node,onId){if(!node)return;switch(node.type){case"Identifier":onId(node);break;case"RestElement":visitPattern(node.argument,onId);break;case"AssignmentPattern":visitPattern(node.left,onId);break;case"ArrayPattern":for(const el2 of node.elements)if(el2)visitPattern(el2,onId);break;case"ObjectPattern":for(const p of node.properties){if(p.type==="Property")visitPattern(p.value,onId);else if(p.type==="RestElement")visitPattern(p.argument,onId)}break;default:break}}function markPatternBindings(pattern,kind="var"){if(!pattern)return;visitPattern(pattern,idNode=>{bindingIdNodes.add(idNode);declare(idNode.name,kind)})}function predeclareProgram(programNode){if(!programNode||!Array.isArray(programNode.body))return;for(const stmt of programNode.body){if(stmt.type==="VariableDeclaration"){for(const d of stmt.declarations){visitPattern(d.id,id2=>{bindingIdNodes.add(id2);declare(id2.name,stmt.kind)})}}else if(stmt.type==="FunctionDeclaration"&&stmt.id){bindingIdNodes.add(stmt.id);declare(stmt.id.name,"function")}else if(stmt.type==="ClassDeclaration"&&stmt.id){bindingIdNodes.add(stmt.id);declare(stmt.id.name,"let")}else if(stmt.type==="ImportDeclaration"){for(const spec of stmt.specifiers||[]){if(spec.local){bindingIdNodes.add(spec.local);declare(spec.local.name,"const")}}}}}function predeclareBlockLexicals(blockNode){if(!blockNode||!Array.isArray(blockNode.body))return;for(const stmt of blockNode.body){if(stmt.type==="VariableDeclaration"&&stmt.kind!=="var"){for(const d of stmt.declarations){visitPattern(d.id,id2=>{bindingIdNodes.add(id2);currentScope().names.add(id2.name)})}}else if(stmt.type==="FunctionDeclaration"&&stmt.id){bindingIdNodes.add(stmt.id);currentScope().names.add(stmt.id.name)}else if(stmt.type==="ClassDeclaration"&&stmt.id){bindingIdNodes.add(stmt.id);currentScope().names.add(stmt.id.name)}}}function predeclareForHeader(node){const header=node.type==="ForStatement"?node.init:node.left;if(header&&header.type==="VariableDeclaration"&&header.kind!=="var"){for(const d of header.declarations){visitPattern(d.id,id2=>{bindingIdNodes.add(id2);currentScope().names.add(id2.name)})}}}function shouldSkipIdentifier(node,parent2,prop){if(!parent2)return false;if(parent2.type==="LabeledStatement"&&prop==="label"||(parent2.type==="BreakStatement"||parent2.type==="ContinueStatement")&&prop==="label")return true;if(parent2.type==="MemberExpression"){if(prop==="property"&&parent2.computed===false)return true}if(parent2.type==="Property"){if(prop==="key"&&parent2.computed===false)return true}if((parent2.type==="MethodDefinition"||parent2.type==="ClassProperty"||parent2.type==="PropertyDefinition")&&prop==="key"&&parent2.computed===false)return true;if(parent2.type==="ImportSpecifier"||parent2.type==="ImportDefaultSpecifier"||parent2.type==="ImportNamespaceSpecifier"||parent2.type==="ExportSpecifier")return true;return false}function walk2(node,parent2,prop,index2){if(!node||typeof node!=="object")return;switch(node.type){case"Program":pushScope(true);predeclareProgram(node);break;case"BlockStatement":case"StaticBlock":pushScope(false);predeclareBlockLexicals(node);break;case"FunctionDeclaration":if(node.id){bindingIdNodes.add(node.id);declare(node.id.name,"function")}pushScope(true);for(const p of node.params)markPatternBindings(p,"param");break;case"FunctionExpression":pushScope(true);if(node.id){bindingIdNodes.add(node.id);declare(node.id.name,"let")}for(const p of node.params)markPatternBindings(p,"param");break;case"ArrowFunctionExpression":pushScope(true);for(const p of node.params)markPatternBindings(p,"param");break;case"CatchClause":pushScope(false);if(node.param)markPatternBindings(node.param,"let");break;case"ForStatement":case"ForInStatement":case"ForOfStatement":pushScope(false);predeclareForHeader(node);break;case"VariableDeclaration":for(const decl of node.declarations){markPatternBindings(decl.id,node.kind||"var")}break;case"ClassDeclaration":if(node.id){bindingIdNodes.add(node.id);declare(node.id.name,"let")}break;case"ImportDeclaration":for(const spec of node.specifiers||[]){if(spec.local){bindingIdNodes.add(spec.local);declare(spec.local.name,"const")}}break}for(const key in node){if(key==="parent")continue;const child=node[key];if(Array.isArray(child)){for(let i2=0;i2<child.length;i2++){if(child[i2]&&typeof child[i2]==="object"){walk2(child[i2],node,key,i2)}}}else if(child&&typeof child==="object"){walk2(child,node,key,null)}}if(node.type==="Identifier"){const name=node.name;if(!reactive.has(name)||bindingIdNodes.has(node)){}else if(!rootHas(name)){}else if(isShadowedFromRoot(name)){}else if(shouldSkipIdentifier(node,parent2,prop)){}else{if(parent2&&parent2.type==="Property"&&parent2.shorthand&&prop==="value"){parent2.shorthand=false}const replacement={type:"MemberExpression",object:{type:"MemberExpression",object:buildTargetRootExpr(targetKey),property:{type:"Identifier",name:"vars"},computed:false},property:{type:"Literal",value:name,raw:JSON.stringify(name)},computed:true};if(parent2){if(index2!==null&&Array.isArray(parent2[prop])){parent2[prop][index2]=replacement}else{parent2[prop]=replacement}}else{Object.keys(node).forEach(k=>delete node[k]);Object.assign(node,replacement)}}}switch(node.type){case"Program":case"BlockStatement":case"StaticBlock":case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"CatchClause":case"ForStatement":case"ForInStatement":case"ForOfStatement":popScope();break;default:break}}walk2(AST,null,null,null);return AST}function _reactiveAssignStatement(name,init2,targetKey="View"){return{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",computed:true,object:{type:"MemberExpression",computed:false,object:buildTargetRootExpr(targetKey),property:{type:"Identifier",name:"vars"}},property:{type:"Literal",value:name}},right:init2||{type:"Identifier",name:"undefined"}}}}function _fnRegisterStatement(name,targetKey){return{type:"ExpressionStatement",expression:{type:"AssignmentExpression",operator:"=",left:{type:"MemberExpression",computed:true,object:{type:"MemberExpression",computed:false,object:buildTargetRootExpr(targetKey),property:{type:"Identifier",name:"fns"}},property:{type:"Literal",value:name}},right:{type:"Identifier",name}}}}function transformTopLevelDeclarations(AST,reactiveVariables,targetKey="View"){const reactive=new Set(reactiveVariables||[]);const newBody=[];for(const stmt of AST.body){if(stmt.type==="FunctionDeclaration"&&stmt.id){newBody.push(stmt);newBody.push(_fnRegisterStatement(stmt.id.name,targetKey));continue}if(stmt.type!=="VariableDeclaration"){newBody.push(stmt);continue}const reactiveDecls=stmt.declarations.filter(d=>reactive.has(d.id.name));const nonReactiveDecls=stmt.declarations.filter(d=>!reactive.has(d.id.name));if(reactiveDecls.length===0){newBody.push(stmt);continue}for(const decl of reactiveDecls){newBody.push(_reactiveAssignStatement(decl.id.name,decl.init,targetKey))}if(nonReactiveDecls.length>0){newBody.push({type:"VariableDeclaration",kind:stmt.kind,declarations:nonReactiveDecls})}}AST.body=newBody;return AST}if(typeof module!=="undefined"&&module.exports){module.exports={getWatcher,changeReactiveVarsOccurences,transformTopLevelDeclarations,validateBeforeRewrite}}var cl=console.log;class _v{static name;static type;static vars;static fns;static rvs;static _pv;static mx;static views;static hst;static settings;constructor(obj){this.name=obj.name??"home";this.type=obj.type??"main";this.hst=obj.hst??[];this.views=obj.views??[];this.vars=obj.vars??{};this.fns=obj.fns??{};this.rvs=obj.rvs??{};this._pv=obj._pv??null;this.mx=obj.mx??[];this.settings=obj.settings??{layout:"default",requireAuth:false}}}const consoleLogOriginal=console.log;console.log=function(){for(let i2=0;i2<arguments.length;i2++){const arg=arguments[i2];if(arg&&arg.hasOwnProperty("__isProxy")||arg?.target){arguments[i2]=arguments[i2].target}}consoleLogOriginal.apply(console,arguments)};var _lumenDevMode=true;var _lumenErrorLog=[];var _mountedSubviewEngines=[];var EXPECTED_HST_FORMAT_VERSION=1;var _entityDecodeEl;function decodeHtmlEntities(str){if(!str||str.indexOf("&")===-1)return str;if(!_entityDecodeEl)_entityDecodeEl=document.createElement("textarea");_entityDecodeEl.innerHTML=str;return _entityDecodeEl.value}function _translateLumenError(message){if(!message)return message;return message.replace(/_vt\.View\.vars\[["'`]([^"'`\]]+)["'`]\]/g,"$1")}function reportLumenError(info){info=info||{};var rawMessage=info.message||info.error&&info.error.message||"Unknown error";var entry={time:new Date().toISOString(),stage:info.stage||"runtime",view:info.view||(typeof _vt!=="undefined"&&_vt.View?_vt.View.name:void 0),expr:info.expr,message:_translateLumenError(rawMessage),hint:info.hint};_lumenErrorLog.push(entry);if(_lumenDevMode){console.error("[LumenJS] "+entry.stage+' error in "'+(entry.view||"unknown")+'"'+(entry.expr?" \u2014 "+entry.expr:"")+": "+entry.message+(entry.hint?"\n "+entry.hint:""))}return entry}function _x(_x2){var currPath=[];function _dispatchVarsUpdate(key){let varsIdx=currPath.indexOf("vars");if(varsIdx===-1)return;let varName2=varsIdx<currPath.length-1?currPath[varsIdx+1]:key;let rootPath=currPath.slice(0,varsIdx);try{if(typeof watch!=="undefined"&&watch&&Object.prototype.hasOwnProperty.call(watch,varName2)&&typeof watch[varName2]==="function"){watch[varName2]()}}catch(e2){cl(e2)}if(rootPath[0]==="Global"){try{if(typeof window!=="undefined")window[varName2]=_x2.Global.vars[varName2]}catch(e2){}if(_vt.View._re)_vt.View._re.update(varName2);for(const regionName in _vt.Widgets){if(_vt.Widgets[regionName]&&_vt.Widgets[regionName]._re){_vt.Widgets[regionName]._re.update(varName2)}}for(let msi=_mountedSubviewEngines.length-1;msi>=0;msi--){let sve=_mountedSubviewEngines[msi];let sveNode=sve._RealDOM&&sve._RealDOM[0];if(sveNode&&!sveNode.isConnected){_mountedSubviewEngines.splice(msi,1);continue}sve.update(varName2)}return}let owner=_x2;for(let i2=0;i2<rootPath.length&&owner;i2++){owner=owner[rootPath[i2]]}if(owner&&owner._re)owner._re.update(varName2)}const handler={get(target,key){if(key=="__isProxy")return true;if(target===_x2)currPath=[];currPath.push(key);if(typeof target[key]==="object"&&target[key]!==null&&key!="_re"){return new Proxy(target[key],handler)}else{return target[key]??(key=="target"?target:void 0)??void 0}},set(target,key,value){target[key]=value;try{_dispatchVarsUpdate(key)}catch(e2){cl(e2)}currPath=[];return true},deleteProperty(target,key){if(!(key in target)){return false}delete target[key];try{_dispatchVarsUpdate(key)}catch(e2){cl(e2)}return true},ownKeys(target){return Reflect.ownKeys(target)},has(target,key){return key in target},defineProperty(target,key,descriptor){if(descriptor&&"value"in descriptor){target[key]=descriptor.value}return target},getOwnPropertyDescriptor(target,key){const value=target[key];return key in target?{value,enumerable:true,configurable:true}:void 0}};var x2=new Proxy(_x2,handler);return x2}let _vt=_x({"View":new _v({}),"Global":{"vars":{},"fns":{}},"Widgets":{}});function touch(name){if(_vt.Global.vars.hasOwnProperty(name)){_vt.Global.vars[name]=_vt.Global.vars[name]}}var _deepReactiveCache=typeof WeakMap!=="undefined"?new WeakMap:null;function _deepReactive(obj,onChange){if(obj===null||typeof obj!=="object")return obj;if(_deepReactiveCache&&_deepReactiveCache.has(obj))return _deepReactiveCache.get(obj);var proxy=new Proxy(obj,{get(target,key){var v=target[key];if(v!==null&&typeof v==="object"&&typeof key!=="symbol"){return _deepReactive(v,onChange)}return v},set(target,key,value){target[key]=value;onChange();return true},deleteProperty(target,key){if(key in target)delete target[key];onChange();return true}});if(_deepReactiveCache)_deepReactiveCache.set(obj,proxy);return proxy}function _lookupInWidgets(name){for(const wname in _vt.Widgets){if(_vt.Widgets[wname].vars.hasOwnProperty(name))return _vt.Widgets[wname].vars[name]}return void 0}function _resolveScopePathTarget(scopePath){let target=_vt;for(let i2=0;i2<scopePath.length;i2++)target=target[scopePath[i2]];return target}function _evalEventScopedExpr(ownerRe,expr){if(!ownerRe||!ownerRe.view)return eval(expr);let ownVars=ownerRe.view.vars||{};let widgetsVars=_mergedWidgetsVars();let scopeProxy=new Proxy({},{has(target,key){if(typeof key==="symbol")return false;return ownVars.hasOwnProperty(key)||widgetsVars.hasOwnProperty(key)||_vt.Global.vars.hasOwnProperty(key)},get(target,key){if(ownVars.hasOwnProperty(key))return ownVars[key];if(widgetsVars.hasOwnProperty(key))return widgetsVars[key];return _vt.Global.vars[key]},set(target,key,value){try{if(ownVars.hasOwnProperty(key)&&ownerRe.view.scopePath){_resolveScopePathTarget(ownerRe.view.scopePath).vars[key]=value}else if(widgetsVars.hasOwnProperty(key)){for(const wname in _vt.Widgets){if(_vt.Widgets[wname].vars.hasOwnProperty(key)){_vt.Widgets[wname].vars[key]=value;break}}}else{_vt.Global.vars[key]=value}}catch(e2){cl(e2)}return true}});function _runWithScope(expr){with(scopeProxy){return eval(expr)}}return _runWithScope(expr)}function _mergedWidgetsVars(){let out={};let names=Object.keys(_vt.Widgets).reverse();for(const wname of names){out={...out,..._vt.Widgets[wname].vars}}return out}class _lm{_RealDOM=[];_effects={};_cc={};_jj={};_ready=false;view=void 0;sbscrbs=[];reactiveVariables=[];vrs={};_CXR=[];_LXR=[];constructor(view){this.view=view;this.view._re=this;this.reactiveVariables=view?.rvs??{};this.init();if(this.view.type=="main")_vt.View=this.view;if(this.view._pv){this.view._pv.subscribe(this.view)}return this}init(){var par2=this;this.view.hst.forEach(function(doc2){par2.walk(doc2,null)})}subscribe(view){this.sbscrbs.push(view)}scopedEval(context,expr2,kk){let ctx=this.concatVarsAtLevel(context,this);if(kk){if(!ctx.hasOwnProperty(kk))return void 0;delete ctx[kk]}try{const evaluator=Function.apply(null,[...Object.keys(ctx),"expr","return eval(expr)"]);return evaluator.apply(null,[...Object.values(ctx),expr2])}catch(e2){if(e2 instanceof TypeError&&!kk){let hadUndefined=false;let strippedCtx={};for(const k2 in ctx){if(ctx[k2]===void 0||ctx[k2]===null){hadUndefined=true;continue}strippedCtx[k2]=ctx[k2]}if(hadUndefined){try{const evaluator2=Function.apply(null,[...Object.keys(strippedCtx),"expr","return eval(expr)"]);return evaluator2.apply(null,[...Object.values(strippedCtx),expr2])}catch(e22){reportLumenError({stage:"expression",expr:expr2,error:e22});return void 0}}}reportLumenError({stage:"expression",expr:expr2,error:e2});return void 0}}getVals(effect){let val2="";if(effect.type=="text"){if(!effect.isSplit){for(let i2=0;i2<effect.splits.length;i2++){let split=effect.splits[i2];if(split.type=="mustache"){val2+=this.getVal(split.content)}else{val2+=split.content}}}else{val2=this.getVal(effect.content)}}else if(effect.type=="attr"||effect.type=="event"){for(let i2=0;i2<effect.splits.length;i2++){let split=effect.splits[i2];if(split.type=="mustache"){val2+=this.getVal(split.content)}else{val2+=split.content}}}return val2}renderAll(){if(this._ready)return;this._ready=true;for(const rv in this._effects){if(Object.prototype.hasOwnProperty.call(this._effects,rv)){const effects=this._effects[rv];for(let ei=0;ei<effects.length;ei++){const effect=effects[ei];if(!effect.nd)continue;try{if(effect.type=="text"){effect.nd.textContent=this.render(effect)}else if(effect.type=="attr"){if(effect.name=="value"){effect.nd.value=this.render(effect)}else{effect.nd.setAttribute(effect.name,this.render(effect));if(effect.name=="view"){effect.nd.subPath=this.render(effect);renderView(this.render(effect),true,{})}}}else if(effect.type=="event"){effect.nd.events[effect.name]=this.render(effect)}}catch(e2){cl("Eeeeee",e2)}}}}this.updateCXRs();this.updateLXRs();this.updateVXRs();if(typeof appSettings!=="undefined"&&appSettings&&typeof appSettings.tick==="function"){try{appSettings.tick()}catch(e2){cl(e2)}}}chainConnected(cx){for(let i2=cx.chain.length-1;i2>=0;i2--){const cxs=cx.chain[i2];if(cxs.ref.isPreConnected){return true}}return false}async updateVXRs(k){let subsNames=[];for(let i2=0;i2<this.view.views.length;i2++){const _view=this.view.views[i2];if(!subsNames.includes(_view.subPath))subsNames.push(_view.subPath)}for(let i2=0;i2<subsNames.length;i2++){const n2=subsNames[i2];renderView(n2,true,{},"views",this.view.views,this.view.scopePath||["View"])}}async updateCXRs(k){for(let i2=0;i2<this._CXR.length;i2++){const cx=this._CXR[i2];if(cx.name=="if"){let isTrue=this.evalExp(cx.content,this.reactiveVariables);if(isTrue){await this.showSectionCX(cx,k)}else{await this.hideSectionCX(cx)}}else if(cx.name=="else-if"){if(!this.chainConnected(cx)){let isTrue=this.evalExp(cx.content,this.reactiveVariables);if(isTrue){await this.showSectionCX(cx,k)}else{await this.hideSectionCX(cx)}}else{await this.hideSectionCX(cx)}}else if(cx.name=="else"){if(!this.chainConnected(cx)){await this.showSectionCX(cx,k)}else{await this.hideSectionCX(cx)}}}}async showSectionCX(cx,k){let wasConnected=cx.ref.node.isConnected;cx.ref.isPreConnected=true;await renderSection(cx.ref,cx.doc,this,k);if(!wasConnected)await fireRenderHook(cx,"after-render",cx.ref.node,{visible:true})}async hideSectionCX(cx){if(cx.ref.node.isConnected)await fireRenderHook(cx,"before-render",cx.ref.node,{visible:false});cx.ref.isPreConnected=false;cx.ref.node.replaceWith(cx.ref)}render(effect){let x2="";try{if(effect.type=="text"||effect.type=="attr"||effect.type=="event"){x2=this.getVals(effect)}}catch(e2){cl(e2)}return x2}update(k){if(!this._ready)return;if(this._effects.hasOwnProperty(k)){const effects=this._effects[k];for(let ei=0;ei<effects.length;ei++){const effect=effects[ei];if(!effect.nd)continue;try{if(effect.type=="text"){effect.nd.textContent=this.render(effect)}else if(effect.type=="attr"){if(effect.name=="value"){effect.nd.value=this.render(effect)}else{effect.nd.setAttribute(effect.name,this.render(effect));if(effect.name=="view"){effect.nd.subPath=this.render(effect);renderView(this.render(effect),true,{})}}}else if(effect.type=="event"){effect.nd.events[effect.name]=this.render(effect)}}catch(e2){cl("Eeeeee",e2)}}}this.updateCXRs(k);this.updateLXRs(k);for(let sbscsi=0;sbscsi<this.sbscrbs.length;sbscsi++){const sbscr=this.sbscrbs[sbscsi];sbscr._re.update(k)}if(typeof appSettings!=="undefined"&&appSettings&&typeof appSettings.tick==="function"){try{appSettings.tick()}catch(e2){cl(e2)}}}async updateLXRs(k){for(let i2=0;i2<this._LXR.length;i2++){var cx=this._LXR[i2];var forX=cx.forX;if(k&&k!=forX["js"])continue;if(cx._updating)continue;cx._updating=true;try{var val2=this.getVal(forX["js"],"");var tempVal=[];if(this.typeStr(val2)=="number"){for(let i22=0;i22<val2;i22++){tempVal.push(i22)}val2=tempVal}let vals=[];let isObj=false;if(this.typeStr(val2)=="object"){isObj=true;for(const oKey in val2){if(Object.hasOwnProperty.call(val2,oKey)){const item=val2[oKey];let objj={key:oKey,value:item};vals.push(objj)}}}else vals=clone(val2);if(this.typeStr(vals)=="array"&&vals.length>0){let forIf=cx.cond;let limit=vals.length;let offset=0;if(cx.limit)limit=(isNaN(cx.limit)?cx.limit:limit)>vals.length?vals.length:cx.limit*1;if(cx.offset)offset=(isNaN(cx.offset)?cx.offset:offset)<0?0:cx.offset*1;let marray=[];if(forIf){marray=vals.slice(offset*1,vals.length)}else{marray=vals.slice(offset*1,limit*1+offset*1)}let myLimit=0;let arrayToRender=[];let arrayToRenderVXs=[];for(var index2=0;index2<marray.length;index2++){if(myLimit==limit*1)break;try{let vx={};vx["index"]=myLimit;if(forX["dx"]!="")vx[forX["dx"]]=myLimit;if(isObj){if(forX["as"]["v"]!=""){if(forX["as"]["k"])vx[forX["as"]["k"]]=marray[index2]["key"];if(forX["as"]["v"])vx[forX["as"]["v"]]=marray[index2]["value"]}else{if(forX["as"]["k"])vx[forX["as"]["k"]]=marray[index2]}vx["key"]=marray[index2]["key"];vx["value"]=marray[index2]["value"]}else{if(forX["as"]["k"])vx[forX["as"]["k"]]=marray[index2];else if(marray[index2]&&typeof marray[index2]==="object"){for(const k2 in marray[index2]){if(Object.prototype.hasOwnProperty.call(marray[index2],k2)){vx[k2]=marray[index2][k2]}}}}if(forIf){let _prevVrs=this.vrs;this.vrs=vx;let isTrue;try{isTrue=this.evalExp(forIf,[])}finally{this.vrs=_prevVrs}if(!isTrue)continue}let miIndexx=offset*1+index2*1;arrayToRender.push(marray[index2]);arrayToRenderVXs.push(vx);myLimit++}catch(e2){cl(e2)}}let oldATR=cx.atr;cx.atr=clone(arrayToRender);const actions=this.compareArrays(oldATR,arrayToRender);if(actions.length)await fireRenderHook(cx,"before-render",cx.ref.parentElement,{items:arrayToRender,actions});let addActions=[];let otherActions=[];for(let ai=0;ai<actions.length;ai++){(actions[ai].action=="add"?addActions:otherActions).push(actions[ai])}if(addActions.length){let createdSections=await Promise.all(addActions.map(actn=>{let vx=arrayToRenderVXs[actn.index];return this.createSection(cx,vx,isObj,forX)}));for(let ci=0;ci<createdSections.length;ci++){let cln=createdSections[ci];cx.ref.before(cln);cln.replaceWith(cln.node)}}for(let ai=0;ai<otherActions.length;ai++){const actn=otherActions[ai];if(actn.action=="remove"){var keyed=cx.key+"_"+actn.index;let tx2=cx.ref?.nodes[keyed];if(tx2){tx2.remove();tx2.node.remove();delete cx.tx?.nodes[keyed]}}else{var keyed=cx.key+"_"+actn.index;let tx2=cx.ref?.nodes[keyed];let vx=arrayToRenderVXs[actn.index];if(tx2){tx2._re.vrs=vx;if(tx2.isObj){if(tx2.forX.as["k"]!="")tx2._re.update(tx2.forX.as["k"]);else tx2._re.update(tx2.forX.js);if(tx2.forX.as["v"]!="")tx2._re.update(tx2.forX.as["v"]);for(let actnsi=0;actnsi<actn.updates.length;actnsi++){const actnu=actn.updates[actnsi];tx2._re.update(actnu.property)}}else{if(tx2.forX.as["k"]!="")tx2._re.update(tx2.forX.as["k"]);else tx2._re.update(tx2.forX.js)}}}}if(actions.length)await fireRenderHook(cx,"after-render",cx.ref.parentElement,{items:arrayToRender,actions})}else{cx.nodes=[]}}finally{cx._updating=false}}}compareLogic(array1,array2){if(array1.length===array2.length){return 1}else{if(array1.length>array2.length){return 2}else{return 3}}}compareArrays(array1,array2){const actions=[];const maxLength=Math.max(array1.length,array2.length);for(let i2=0;i2<maxLength;i2++){const element1=array1[i2];const element2=array2[i2];if(element2===void 0){actions.push({action:"remove",index:i2})}else if(element1===void 0){actions.push({action:"add",index:i2,element:element2})}else if(!this.deepCompare(element1,element2)){actions.push({action:"update",index:i2,updates:this.getUpdates(element1,element2)})}}return actions}findDeletedIndexes(array1,array2){const deletedIndexes=[];let par2=this;array1.forEach((item,index2)=>{const foundIndex=array2.findIndex(el2=>par2.deepCompare(el2,item));if(foundIndex===-1){deletedIndexes.push(index2)}});return deletedIndexes}findAddedIndexes(array1,array2){const addedIndexes=[];let par2=this;array2.forEach((item,index2)=>{const foundIndex=array1.findIndex(el2=>par2.deepCompare(el2,item));if(foundIndex===-1){addedIndexes.push(index2)}});return addedIndexes}deepCompare(obj1,obj2){return JSON.stringify(obj1)===JSON.stringify(obj2)}getUpdates(oldObj,newObj){const updates=[];for(const key in newObj){if(newObj.hasOwnProperty(key)&&newObj[key]!==oldObj[key]){updates.push({property:key,value:newObj[key]})}}return updates}getVal(mo,indexName){let vars2={};try{for(let i2=0;i2<this.reactiveVariables.length;i2++){let __name=this.reactiveVariables[i2];if(_vt.View.vars.hasOwnProperty(__name)){vars2[__name]=_vt.View.vars[__name]}else{let _wv=_lookupInWidgets(__name);let _gv=_wv!==void 0?_wv:_vt.Global.vars[__name];if(_gv!==void 0)vars2[__name]=_gv}}for(const ky in this.vrs){if(Object.prototype.hasOwnProperty.call(this.vrs,ky)){vars2[ky]=this.vrs[ky]}}if(this.view&&this.view.vars){for(const ky in this.view.vars){if(Object.prototype.hasOwnProperty.call(this.view.vars,ky)){vars2[ky]=this.view.vars[ky]}}}}catch(e2){cl(e2)}mo=mo.trim();if(mo.slice(0,2)=="{{"){mo=mo.slice(2,-2)}let value="";let _mo=mo;if(mo.indexOf("`")>-1){var matchesVal=_mo.match(/\.`[\s\S]*?`/g);if(matchesVal)for(var y=0;y<matchesVal.length;y++){_mo=_mo.split(matchesVal[y]).join("."+this.getVal(matchesVal[y].substr(1).slice(1,-1),indexName))}var matchesVal=_mo.match(/`[\s\S]*?`/g);if(matchesVal)for(var y=0;y<matchesVal.length;y++){_mo=_mo.split(matchesVal[y]).join("'"+this.getVal(matchesVal[y].slice(1,-1),indexName)+"'")}return this.getVal(_mo,indexName)}if(mo.indexOf(";")>-1){let zxx=mo.split(";");mo=$.trim(zxx[0])}if(mo.indexOf(" as ")>-1){mo=mo.split(" as ");return this.getVal(mo[0],indexName)}if(indexName){indexName=indexName.toString();if(mo.indexOf(indexName)>-1&&mo!=indexName&&vars2.hasOwnProperty(indexName)&&mo!="index"){mo=mo.split(indexName).join(vars2[indexName]);return this.getVal(mo,indexName)}}var Ondex=mo.match(/\bindex\b/g);if(Ondex&&mo!="index"&&vars2.hasOwnProperty("index")){_mo=mo.replace(/\bindex\b/g,vars2["index"]);return this.getVal(_mo,indexName)}value=this.lookup(mo,vars2);return value??""}concatVarsAtLevel(levelVars,parent2){if(!parent2.view._pv){var concatenatedVars={...levelVars};if(parent2.view.vars){concatenatedVars={..._vt.Global.vars,..._mergedWidgetsVars(),...parent2.view.vars,...concatenatedVars}}return concatenatedVars}var concatenatedVars={...levelVars};if(parent2.view.vars){concatenatedVars={...parent2.view.vars,...concatenatedVars}}return this.concatVarsAtLevel(concatenatedVars,parent2.view._pv)}lookup(name,vaz2){let vars2=this.concatVarsAtLevel(vaz2,this);try{var value;var names,index2,lookupHit=false;if(this.hasProperty(vars2,name)){value=vars2[name]}else if(name.indexOf(".")>-1&&name.indexOf("[")==-1){var value=this.scopedEval(vars2,name);if(!(value||value==0)){value=vars2;names=name.split(".");index2=0;while(value!=null&&index2<names.length){if(index2===names.length-1)lookupHit=this.hasProperty(value,names[index2]);value=value[names[index2++]]}}}else{var value=this.scopedEval(vars2,name);if(!(value||value==0)){if(name.indexOf(".")==-1&&name.indexOf("[")>-1){let _name=name;var matchesVal=_name.match(/\[[\s\S]*?\]/g);for(var y=0;y<matchesVal.length;y++){if(matchesVal[y].indexOf("'")==-1&&matchesVal[y].indexOf('"')==-1)_name=_name.split(matchesVal[y]).join("['"+matchesVal[y].slice(1,-1)+"']")}var value=this.scopedEval(vars2,_name)}}}if(this.isFunction(value))value=value.call(value)}catch(e2){reportLumenError({stage:"lookup",expr:name,error:e2});return""}return value}objectToString=Object.prototype.toString;isArray=Array.isArray||function isArrayPolyfill(object){return objectToString.call(object)==="[object Array]"};isFunction(object){return typeof object==="function"}typeStr(obj){return this.isArray(obj)?"array":typeof obj}hasProperty(obj,propName){return obj!=null&&typeof obj==="object"&&propName in obj}createEl(tag,attrs2,children,events,doc2){const _el2=document.createElement(tag);Object.defineProperty(_el2,"_ownerRe",{value:this,enumerable:false,configurable:true,writable:true});_el2.isSub=false;if(attrs2.hasOwnProperty("view")){_el2.isSub=true;_el2.subPath=attrs2["view"];_el2.vars={};_el2.views=[];_el2.fns={};if(doc2&&doc2.evs&&doc2.evs.hasOwnProperty("@init")){let _initAttr=doc2.evs["@init"];if(_initAttr){let _initResult=evalEvAttr(_initAttr,{cType:"init"},$(_el2),"init",this.vrs);if(_initResult&&typeof _initResult==="object"&&typeof _initResult.then!=="function"){Object.assign(_el2.vars,_initResult)}}}this.view.views.push(_el2)}_el2.events={};for(const prop in attrs2){if(prop=="view"||prop==":data"||prop==":if"||prop==":else-if"||prop==":else"||prop==":for"||prop==":for-limit"||prop==":for-offset"||prop==":for-if")continue;try{let val2=doc2&&doc2.ax.hasOwnProperty(prop)?"":attrs2[prop];if(prop=="value"){_el2.value=val2}else _el2.setAttribute(prop,val2)}catch(e2){cl(e2)}}for(const prop in events){try{_el2.events[prop]=events[prop]}catch(e2){cl(e2)}}if(children.length)_el2.append(...children);if(events&&events["@after-render"]&&!(attrs2&&(attrs2.hasOwnProperty(":for")||attrs2.hasOwnProperty(":if")||attrs2.hasOwnProperty(":else-if")||attrs2.hasOwnProperty(":else")))){fireRenderHook({doc:doc2},"after-render",_el2,{})}autoInitPlugins(_el2,attrs2);return _el2}evalExp(expr2,vars2){let rvars={};try{for(let i2=0;i2<vars2.length;i2++){let __name=vars2[i2];if(_vt.View.vars.hasOwnProperty(__name)){rvars[__name]=_vt.View.vars[__name]}else{let _wv=_lookupInWidgets(__name);rvars[__name]=_wv!==void 0?_wv:_vt.Global.vars[__name]}}for(const ky in this.vrs){if(Object.prototype.hasOwnProperty.call(this.vrs,ky)){rvars[ky]=this.vrs[ky]}}if(this.view&&this.view.vars){for(const ky in this.view.vars){if(Object.prototype.hasOwnProperty.call(this.view.vars,ky)){rvars[ky]=this.view.vars[ky]}}}}catch(e2){cl(e2)}try{var value=this.scopedEval(rvars,expr2);if(value&&value!=0)return true}catch(e2){reportLumenError({stage:"condition",expr:expr2,error:e2});return false}return false}splitTextWithMustaches(text,mustaches){mustaches.sort((a,b)=>a.start-b.start);const elements=[];let currentIndex=0;for(const mustache of mustaches){if(currentIndex<mustache.start){elements.push({type:"static",content:text.substring(currentIndex,mustache.start)})}elements.push({type:"mustache",jst:mustache.jst,rvs:mustache.rvs,content:text.substring(mustache.start,mustache.end)});currentIndex=mustache.end}if(currentIndex<text.length){elements.push({type:"static",content:text.substring(currentIndex)})}return elements}walk(doc,parent){var par=this;var tx,el;switch(doc.type){case"text":if(doc.mss.length){let splitIt=true;if(doc.tag=="textarea"){splitIt=false}if(splitIt){let splits=this.splitTextWithMustaches(doc.content,doc.mss);for(let si=0;si<splits.length;si++){const split=splits[si];if(split.type=="static"){let txnd=document.createTextNode(decodeHtmlEntities(split.content));if(!parent)par._RealDOM.push(txnd);(tx??(tx=[])).push(txnd)}else{let txnd=document.createTextNode("");for(let ri=0;ri<split.rvs.length;ri++){const element=split.rvs[ri];(this._effects[element]??(this._effects[element]=[])).push({"type":"text","content":split.content,"jst":split.jst,"rvs":split.rvs,"isSplit":true,"nd":txnd,"tag":doc.tag})}if(!parent)par._RealDOM.push(txnd);(tx??(tx=[])).push(txnd)}}return tx}else{tx=document.createTextNode("");for(let mui=0;mui<doc.mss.length;mui++){const mus=doc.mss[mui];for(let ri=0;ri<mus.rvs.length;ri++){const element=mus.rvs[ri];(this._effects[element]??(this._effects[element]=[])).push({"type":"text","content":doc.content,"splits":this.splitTextWithMustaches(doc.content,doc.mss),"jst":mus.jst,"rvs":mus.rvs,"isSplit":false,"nd":tx,"tag":doc.tag})}}if(!parent)par._RealDOM.push(tx);return tx}}else{tx=document.createTextNode(decodeHtmlEntities(doc.content));if(!parent)par._RealDOM.push(tx);return tx}break;case"sections":case"section":var _dd=md5(new Date().getTime()/1e3+"::"+Math.random());tx=document.createTextNode("");var typeN=null;if(doc.attrs.hasOwnProperty(":else"))typeN="else";else if(doc.attrs.hasOwnProperty(":else-if"))typeN="else-if";else if(doc.attrs.hasOwnProperty(":if"))typeN="if";else typeN="for";if(doc.type=="section"){var chain=[];if(typeN=="else-if"||typeN=="else"){try{let lastInChain=this._CXR.at(-1);if(lastInChain){_dd=lastInChain.key;chain.push(...lastInChain.chain,lastInChain)}}catch(e2){}}el=par.createEl(doc.name,doc.attrs,[],doc.evs,doc);tx.node=el;this._CXR.push({"type":"section","name":typeN,"content":doc.cond,"doc":doc,"key":_dd,"chain":chain,"ref":tx});this.setEffects(doc,el)}else if(doc.type=="sections"){tx.key=_dd;tx.node=null;tx.nodes={};let docRaw=doc;this._LXR.push({"type":"sections","name":typeN,"cond":doc.attrs.hasOwnProperty(":for-if")?doc.attrs[":for-if"]:null,"limit":doc.attrs.hasOwnProperty(":for-limit")?doc.attrs[":for-limit"]:0,"offset":doc.attrs.hasOwnProperty(":for-offset")?doc.attrs[":for-offset"]:0,"content":doc.content,"forX":doc.forX,"doc":docRaw,"key":_dd,"atr":[],"ref":tx})}if(!parent)par._RealDOM.push(tx);return tx;break;case"tag":var _dd=md5(new Date().getTime()/1e3+"::"+Math.random());if(doc.name.toLowerCase()=="settings"){if(par.view.type=="main"){var defaultSettings={layout:"default",requireAuth:false};try{let settingsC=doc.children[0].content;let settings={};eval("settings = "+settingsC+";");if(settings){if(settings.layout==null)settings.layout="default";if(settings.requireAuth==null)settings.requireAuth=false;par.view.settings=settings}else{par.view.settings=defaultSettings}}catch(e2){setError(e2,"Error in your settings tag inside the '"+par.view.name.toLowerCase()+"' main view!");par.view.settings=defaultSettings}}}else if(doc.name.toLowerCase()=="script"||doc.name.toLowerCase()=="js"){let child=doc.children[0];let js=child.content;let jst=child.jst;let isScoped=false;if(doc.attrs.hasOwnProperty("scoped")){delete doc.attrs["scoped"];isScoped=true}el=par.createEl("script",doc.attrs,[],doc.evs,doc);el._sc=isScoped;el._dd=_dd;el._jst=jst;(par._jj[_dd]??(par._jj[_dd]=[])).push({"nd":el})}else if(doc.name.toLowerCase()=="style"){let css=doc.children[0].content;let isScoped=false;el=par.createEl("style",{},[],doc.evs,doc);if(doc.attrs.hasOwnProperty("scoped")){if(!parent){if(par.view._dd)_dd=par.view._dd;else{par.view._dd=_dd;if(par.view.type=="main")$("[body]")[0].setAttribute("vuid",_dd)}}else{if(parent._dd)_dd=parent._dd;else{parent._dd=_dd;parent.setAttribute("vuid",_dd)}}delete doc.attrs["scoped"];isScoped=true;el._sc=isScoped;el._dd=_dd;el._css=css;(par._cc[_dd]??(par._cc[_dd]=[])).push({"nd":el,"_css":css})}else{el._sc=isScoped;el._dd=_dd;el.textContent=css}for(const prop in doc.attrs){try{_el.setAttribute(prop,doc.attrs[prop])}catch(e2){cl(e2)}}}else if(doc.name.toLowerCase()=="icon"){let child=par.createEl("span",{"class":"iconify","data-icon":doc?.icon??"mdi:home"},[],{},null);el=par.createEl("span",doc.attrs,[child],doc.evs,doc)}else if(doc.name.toLowerCase()=="slot"){let slotName=doc.attrs&&doc.attrs.name;if(slotName){let tempWrapper=document.createElement("div");let childs=[];for(let i2=0;i2<doc.children.length;i2++){const dc=doc.children[i2];let chils=par.walk(dc,tempWrapper);if(chils){if(Array.isArray(chils)){if(chils.length)childs=[...childs,...chils]}else{childs.push(chils)}}}(par.view._slots??(par.view._slots={}))[slotName]=childs}}else if(doc.attrs&&doc.attrs.hasOwnProperty("tpl")&&!doc.attrs.hasOwnProperty(":for")){reportLumenError({stage:"tpl",error:new Error('tpl="'+doc.attrs["tpl"]+'" must be used together with :for on the same element \u2014 templates only render inside a repeated/list context.')})}else{el=par.createEl(doc.name,doc.attrs,[],doc.evs,doc);if(!doc.isV&&!el.isSub){let childs=[];for(let i2=0;i2<doc.children.length;i2++){const dc=doc.children[i2];let chils=par.walk(dc,el);if(chils){if(Array.isArray(chils)){if(chils.length)childs=[...childs,...chils]}else{childs.push(chils)}}}childs.length?el.append(...childs):null}}this.setEffects(doc,el);if(el){if(!parent)par._RealDOM.push(el)}return el;break;case"comment":break;default:break}}setEffects(doc2,el2){let rvs=[];if(Object.keys(doc2.ax).length){for(const attrName in doc2.ax){if(Object.hasOwnProperty.call(doc2.ax,attrName)){const attrMustaches=doc2.ax[attrName];for(let i2=0;i2<attrMustaches.length;i2++){const mus=attrMustaches[i2];for(let ri=0;ri<mus.rvs.length;ri++){const element=mus.rvs[ri];rvs.push(element);(this._effects[element]??(this._effects[element]=[])).push({"type":"attr","name":attrName,"content":doc2.attrs[attrName],"splits":this.splitTextWithMustaches(doc2.attrs[attrName],doc2.ax[attrName]),"jst":mus.jst,"rvs":mus.rvs,"nd":el2})}}}}}if(Object.keys(doc2.ex).length){for(const ky in doc2.ex){if(Object.hasOwnProperty.call(doc2.ex,ky)){const mss=doc2.ex[ky];for(let i2=0;i2<mss.length;i2++){const mus=mss[i2];for(let ri=0;ri<mus.rvs.length;ri++){const element=mus.rvs[ri];rvs.push(element);(this._effects[element]??(this._effects[element]=[])).push({"type":"event","name":ky,"content":doc2.evs[ky],"splits":this.splitTextWithMustaches(doc2.evs[ky],doc2.ex[ky]),"jst":mus.jst,"rvs":mus.rvs,"nd":el2})}}}}}return rvs.filter((value,index2,self2)=>{return self2.indexOf(value)===index2})}async createSection(cx,vx,isObj,forX){var keyed=cx.key+"_"+vx.index;var tx2=document.createTextNode("");var typeN2=null;if(cx.doc.attrs.hasOwnProperty(":else"))typeN2="else";else if(cx.doc.attrs.hasOwnProperty(":else-if"))typeN2="else-if";else if(cx.doc.attrs.hasOwnProperty(":if"))typeN2="if";else typeN2="for";let el2=this.createEl(cx.doc.name,cx.doc.attrs,[],cx.doc.evs,cx.doc);tx2.node=el2;tx2.key=cx.key;tx2.keyed=keyed;tx2.isObj=isObj;tx2.forX=forX;tx2.vx=vx;let scsc2=await renderSection(tx2,cx.doc,this,cx.key);scsc2._re=scsc2;cx.ref.nodes[keyed]=tx2;return tx2}attrString(attrs2){var buff=[];for(var key in attrs2){buff.push(key+'="'+attrs2[key]+'"')}if(!buff.length)return"";return" "+buff.join(" ")}_stringify(buff,doc2){var par2=this;switch(doc2.type){case"text":return buff+doc2.content;case"tag":buff+="<"+doc2.name+(doc2.attrs?par2.attrString(doc2.attrs):"")+(doc2.isV?"/>":">");if(doc2.isV)return buff;for(let i2=0;i2<doc2.children.length;i2++){const dc=doc2.children[i2];buff=buff+par2._stringify("",dc)}return buff+"</"+doc2.name+">";case"comment":return buff;default:return""}}stringify(doc2){var par2=this;return doc2.reduce(function(token,rootEl){return token+par2._stringify("",rootEl)},"")}}async function renderHST(hst,n2,type2="main",tx2,_pv=null,scopePath=["View"],ownVars2,ownFns,ownViews){var reactiveVariables=hst.reactiveVars;hst=hst.hst;let _re=new _lm(new _v({"name":n2,"type":type2,"hst":hst,"vars":ownVars2??tx2?.vx,"fns":ownFns,"views":ownViews,"rvs":reactiveVariables,"_pv":_pv}));_re.view.scopePath=scopePath;if(Object.keys(_re._cc).length){for(const ky in _re._cc){if(Object.hasOwnProperty.call(_re._cc,ky)){const csses=_re._cc[ky];for(let inde=0;inde<csses.length;inde++){let prom=new defer;const css=csses[inde];_csswrk.trigger("css-ready",{"csses":[css._css],"pre":"[vuid='"+ky+"']","key":ky});_vuid[ky]=prom;let _csses=await prom;css.nd.textContent=_csses[0]}}}}if(Object.keys(_re._jj).length){for(const ky in _re._jj){if(Object.hasOwnProperty.call(_re._jj,ky)){const jses=_re._jj[ky];for(let inde=0;inde<jses.length;inde++){const nd=jses[inde].nd;let code=getWatcher(nd._jst,_re.view,reactiveVariables,scopePath).code;code=`try { `+code+` } catch (e) { reportLumenError({ stage: 'script', error: e }); }`;code=code+`
|
|
2
2
|
//# sourceURL=`+(_re.view?.name||"view")+`.view.generated.js`;nd.textContent=code}}}}return _re}async function fireRenderHook(cx,n2,containerEl,extra){if(!containerEl)return;let attrKey="@"+n2;if(!cx.doc||!cx.doc.evs||!cx.doc.evs.hasOwnProperty(attrKey))return;let attrVal=cx.doc.evs[attrKey];if(!attrVal)return;let ev2=Object.assign({cType:n2},extra||{});let result=evalEvAttr(attrVal,ev2,$(containerEl),n2);if(result&&typeof result.then==="function"){try{return await result}catch(e2){return void 0}}return result}function autoInitPlugins(el2,attrs2){if(!attrs2)return;try{if(attrs2.hasOwnProperty("sl")&&typeof $.fn.select2==="function"){initSl($(el2))}if(attrs2.hasOwnProperty("color")&&typeof $.fn.colorpicker==="function"){$(el2).removeAttr("color").colorpicker({format:"rgba"})}if(typeof $.fn.datetimepicker==="function"){if(attrs2.hasOwnProperty("time"))dtp($(el2),"time");if(attrs2.hasOwnProperty("date"))dtp($(el2),"date");if(attrs2.hasOwnProperty("datetime"))dtp($(el2),"datetime")}}catch(e2){cl(e2)}}function initSl(t2){if(t2.hasClass("select2-hidden-accessible"))return;try{var plchldr=t2.attr("placeholder")?t2.attr("placeholder"):"";var dir=$("body").hasClass("rtl")?"rtl":"ltr";var nr=t2.attr("sl-nrmsg")?t2.attr("sl-nrmsg"):"No results found";var minResultsForSearch=t2.attr("sl-mins")?t2.attr("sl-mins"):10;var allowNewTags=t2.attr("sl-ntgs")?true:false;var dropdownParent=t2.attr("sl-prt")?t2.attr("sl-prt"):"body";if(dropdownParent=="self")dropdownParent=t2.parent();else dropdownParent=$(dropdownParent);var query=t2.attr("sl-query")?t2.attr("sl-query"):null;var uniquer=Date.now();if(typeof window[query]==="function"){t2.select2.amd.define("adapt_"+uniquer,["select2/data/array","select2/utils"],function(ArrayAdapter,Utils){function CustomDataAdapter($element,options){CustomDataAdapter.__super__.constructor.call(this,$element,options)}Utils.Extend(CustomDataAdapter,ArrayAdapter);CustomDataAdapter.prototype.query=function(params,callback){clearTimeout(_dbcrs[uniquer]);let _t=t2;_dbcrs[uniquer]=setTimeout(function(){window[query](params,callback,_t)},!_dbcrs.hasOwnProperty(uniquer)?0:_dbcrsTime)};return CustomDataAdapter});t2.select2({dropdownParent,minimumResultsForSearch:minResultsForSearch,placeholder:plchldr,dir,tags:allowNewTags,allowClear:true,language:{noResults:function(){return nr}},...t2.select2.amd.require("adapt_"+uniquer)?{ajax:{},dataAdapter:t2.select2.amd.require("adapt_"+uniquer)}:{}})}else{t2.select2({dropdownParent,minimumResultsForSearch:minResultsForSearch,placeholder:plchldr,dir,tags:allowNewTags,allowClear:true,language:{noResults:function(){return nr}}})}if(t2.attr("sl-nosrch"))t2.on("select2:opening select2:closing",function(event){$(this).parent().find(".select2-search__field").prop("disabled",true)});if(t2.attr("sl-class")){t2.on("select2:opening",function(event){dropdownParent.addClass(t2.attr("sl-class"))});t2.on("select2:closing",function(event){dropdownParent.removeClass(t2.attr("sl-class"))})}if(t2.attr("sl-id")||t2.attr("sl-text")){let text=t2.attr("sl-text");let id2=t2.attr("sl-id");if(!text)text=id2;if(!id2)id2=text;let newOption=new Option(text,id2,true,true);t2.append(newOption).trigger("select")}else{t2.select2("val","")}if(t2.attr("sl-value"))t2.val(t2.attr("sl-value")).trigger("change")}catch(e2){cl(e2)}}var _dbcrs={};var _dbcrsTime=250;function dtp(el2,t2){el2.removeAttr(t2);let opts={format:t2=="date"?"yyyy-mm-dd":t2=="time"?"hh:ii":"yyyy-mm-dd hh:ii",weekStart:el2.attr("date-week-start")??1,startView:t2=="time"?1:el2.attr("startview")?el2.attr("startview"):2,minView:el2.attr("minview")?el2.attr("minview"):t2=="time"?0:t2=="datetime"?0:2,maxView:el2.attr("maxview")?el2.attr("maxview"):t2=="time"?1:4,todayBtn:t2=="time"?0:el2.attr("date-today")=="false"?0:1,todayHighlight:t2=="time"?0:el2.attr("date-today")=="false"?0:1,language:el2.attr("date-lang")??"en",minuteStep:el2.attr("date-minute-step")??5,pickerPosition:el2.attr("date-position")??"top-right",autoclose:1,showMeridian:false};if(el2.attr("date-start"))opts["startDate"]=el2.attr("date-start");if(el2.attr("date-end"))opts["endDate"]=el2.attr("date-end");if(el2.attr("date-value"))opts["date"]=el2.attr("date-value");el2.datetimepicker(opts);if(t2=="time"){el2.on("show",function(ev2){$(".table-condensed > thead, .table-condensed > thead > tr > th, .table-condensed > thead > tr > th > i").attr("style","visibility: hidden; font-size:0px !important; overflow: hidden; height: 0px;")}).on("hide",function(ev2){$(".table-condensed > thead, .table-condensed > thead > tr > th, .table-condensed > thead > tr > th > i").attr("style","visibility: visible;")})}if(el2.attr("date-link-start")){el2.on("change",function(e2){let dp1=el2.data("datetimepicker");let dp2=$(el2.attr("date-link-start")).data("datetimepicker");dp2.setStartDate(dp1.getFormattedDate());if(dp2.getFormattedDate()<dp1.getFormattedDate()||dp2.getFormattedDate()=="")$(el2.attr("date-link-start")).val(dp1.getFormattedDate())})}else if(el2.attr("date-link-end")){el2.on("change",function(e2){let dp1=$(el2.attr("date-link-end")).data("datetimepicker");let dp2=el2.data("datetimepicker");dp1.setEndDate(dp2.getFormattedDate())});opts["useCurrent"]=false}}async function renderSection(tx2,doc2,par2,k,sectionsData){if(tx2.node.isConnected){if(k){tx2._re.update(k)}return tx2._re}var hst=doc2.children;if(doc2.attrs&&doc2.attrs.hasOwnProperty("tpl")){let _payload=typeof _vcD!=="undefined"&&_vcD||(typeof _vcData!=="undefined"?_vcData:void 0);let _tplName=doc2.attrs["tpl"];let _tplKey=btoa("src/tpls/"+_tplName+".tpl");let _tplEntry=_payload&&_payload.tpls&&_payload.tpls[_tplKey];if(_tplEntry){hst=_tplEntry.hst}else{reportLumenError({stage:"tpl",error:new Error('tpl="'+_tplName+'" \u2014 no such file at src/tpls/'+_tplName+".tpl")})}}let _re=await renderHST({hst,mxes:[]},tx2.key,"section",tx2,par2,par2?.view?.scopePath||["View"],void 0,void 0,par2?.view?.views);tx2._re=_re;if(tx2.node){tx2.replaceWith(tx2.node);tx2.node.innerHTML="";tx2.node.append(..._re._RealDOM);_re.setEffects(doc2,tx2.node);_re.renderAll("section")}return _re}async function renderView(n2,isSub,d,type2="views",viewsArr,scopeBase=["View"]){let filePath="src/views/"+n2+".view";if(type2=="layouts")filePath="src/layouts/"+n2+".layout";let fileKey=btoa(filePath);if(!isSub){View.props=d??{};var _queryParams2=window.location.href.split("?");var nn2=_queryParams2.shift();View.params=paraToObj(_queryParams2)??{}}n2=prepareNode(n2);var _queryParams2=n2.split("?");n2=_queryParams2.shift();let _payload=_vcD||(typeof _vcData!=="undefined"?_vcData:void 0);if(_payload&&!_payload.__hstVersionChecked){_payload.__hstVersionChecked=true;if(_payload.hstFormatVersion!==void 0&&_payload.hstFormatVersion!==EXPECTED_HST_FORMAT_VERSION){reportLumenError({stage:"hst-version-mismatch",error:new Error("This project was compiled for HST format v"+_payload.hstFormatVersion+", but this LumenJS runtime expects v"+EXPECTED_HST_FORMAT_VERSION+". @lmjs/cli and @lmjs/core are out of sync \u2014 reinstall/upgrade both together.")});return}}if(_payload&&_payload[type2].hasOwnProperty(fileKey)&&_csswrk.isStarted()){if(isSub)cl("Rendering",n2,fileKey);var hst=_payload[type2][fileKey];if(isSub){let searchArr=viewsArr||_vt.View.views;let els=[];for(let i2=0;i2<searchArr.length;i2++){let _el2=searchArr[i2];if(_el2.__isProxy)_el2=_el2.target;if(_el2.subPath==n2)els.push({el:_el2,viewsIndex:i2})}if(els.length){for(let i2=0;i2<els.length;i2++){const{el:el2,viewsIndex}=els[i2];el2.vars=el2.vars||{};el2.views=el2.views||[];el2.fns=el2.fns||{};let _re=await renderHST(hst,n2,"sub",void 0,null,scopeBase.concat(["views",viewsIndex]),el2.vars,el2.fns,el2.views);el2._re=_re;_mountedSubviewEngines.push(_re);el2.innerHTML="";el2.append(..._re._RealDOM);_re.renderAll();if(typeof globalWatch==="function"){try{globalWatch()}catch(e2){cl(e2)}}}}}else{if(type2=="layouts"){let appSelector=appSettings.App??"[app]";var appContainer=$(appSelector);if(appContainer.length){let _rel=await renderHST(hst,n2,"layout");appContainer.data("layout",n2).html(_rel._RealDOM);_rel.renderAll();goToNode()}}else{let _re=await renderHST(hst,n2,"main");let layout=_re.view.settings.layout;let filePathL="src/layouts/"+layout+".layout";let fileKeyL=btoa(filePathL);let hstL=_payload["layouts"][fileKeyL];let appSelector=appSettings.App??"[app]";var appContainer=$(appSelector);let layoutJustSwapped=false;if(appContainer.length){let currentLayout=$(appSelector).data("layout");if(currentLayout!=layout){let _rel=await renderHST(hstL,layout,"layout");appContainer.data("layout",layout).html(_rel._RealDOM);_rel.renderAll();layoutJustSwapped=true}else{}}else{$("body").prepend("<div "+appSelector+"></div>");let _rel=await renderHST(hstL,layout,"layout");appContainer=$(appSelector);appContainer.data("layout",layout).html(_rel._RealDOM);_rel.renderAll();layoutJustSwapped=true}let declaredRegions=hstL&&hstL.regions||[];for(const regionName of declaredRegions){let settingsKey="has"+regionName[0].toUpperCase()+regionName.slice(1);let want=_re.view.settings.hasOwnProperty(settingsKey)?_re.view.settings[settingsKey]:true;let resolvedFile=want===false?null:want===true?regionName:want;let w=_vt.Widgets[regionName]||(_vt.Widgets[regionName]={vars:{},fns:{},views:[],_re:null,_resolvedFile:void 0});if(resolvedFile!==w._resolvedFile){if(resolvedFile===null){$("["+regionName+"]").html("");w._re=null;w._resolvedFile=resolvedFile}else{let wFilePath="src/views/widgets/"+resolvedFile+".view";let wHst=_payload["views"][btoa(wFilePath)];if(wHst){let _rew=await renderHST(wHst,resolvedFile,"widget",void 0,null,["Widgets",regionName],w.vars,w.fns,w.views);w._re=_rew;$("["+regionName+"]").html(_rew._RealDOM);_rew.renderAll();w._resolvedFile=resolvedFile}}}else if(layoutJustSwapped&&w._re){$("["+regionName+"]").html(w._re._RealDOM)}}$("[body]").html(_re._RealDOM);if(_re.view._slots){for(const slotName in _re.view._slots){if(Object.prototype.hasOwnProperty.call(_re.view._slots,slotName)){$('[slot="'+slotName+'"]').html(_re.view._slots[slotName])}}}_re.renderAll();if(typeof globalWatch==="function"){try{globalWatch()}catch(e2){cl(e2)}}}}}else{setTimeout(()=>{renderView(n2,isSub,d)},10)}}!(function(a,b){"function"==typeof define&&define.amd?define([],b):"undefined"!=typeof module&&module.exports?module.exports=b():a.ReconnectingWebSocket=b()})(this,function(){function a(b,c,d){function l(a2,b2){var c2=document.createEvent("CustomEvent");return c2.initCustomEvent(a2,false,false,b2),c2}var e2={debug:false,automaticOpen:true,reconnectInterval:1e3,maxReconnectInterval:3e4,reconnectDecay:1,timeoutInterval:3e3};d||(d={});for(var f in e2)this[f]="undefined"!=typeof d[f]?d[f]:e2[f];this.url=b,this.reconnectAttempts=0,this.readyState=WebSocket.CONNECTING,this.protocol=null;var h,g=this,i2=false,j=false,k=document.createElement("div");k.addEventListener("open",function(a2){g.onopen(a2)}),k.addEventListener("close",function(a2){g.onclose(a2)}),k.addEventListener("connecting",function(a2){g.onconnecting(a2)}),k.addEventListener("message",function(a2){g.onmessage(a2)}),k.addEventListener("error",function(a2){g.onerror(a2)}),this.addEventListener=k.addEventListener.bind(k),this.removeEventListener=k.removeEventListener.bind(k),this.dispatchEvent=k.dispatchEvent.bind(k),this.open=function(b2){try{h=new WebSocket(g.url,c||[]),b2||k.dispatchEvent(l("connecting")),(g.debug||a.debugAll)&&console.debug("ReconnectingWebSocket","attempt-connect",g.url);var d2=h,e22=setTimeout(function(){(g.debug||a.debugAll)&&console.debug("ReconnectingWebSocket","connection-timeout",g.url),j=true,j=false;if(d2.readyState==1)d2.close()},g.timeoutInterval);h.onopen=function(){clearTimeout(e22),(g.debug||a.debugAll)&&console.debug("ReconnectingWebSocket","onopen",g.url),g.protocol=h.protocol,g.readyState=WebSocket.OPEN,g.reconnectAttempts=0;var d3=l("open");d3.isReconnect=b2,b2=false,k.dispatchEvent(d3)},h.onclose=function(c2){if(clearTimeout(e3),h=null,i2)g.readyState=WebSocket.CLOSED,k.dispatchEvent(l("close"));else{g.readyState=WebSocket.CONNECTING;var d3=l("connecting");d3.code=c2.code,d3.reason=c2.reason,d3.wasClean=c2.wasClean,k.dispatchEvent(d3),b2||j||((g.debug||a.debugAll)&&console.debug("ReconnectingWebSocket","onclose",g.url),k.dispatchEvent(l("close")));var e3=g.reconnectInterval*Math.pow(g.reconnectDecay,g.reconnectAttempts);setTimeout(function(){g.reconnectAttempts++,g.open(true)},e3>g.maxReconnectInterval?g.maxReconnectInterval:e3)}},h.onmessage=function(b3){(g.debug||a.debugAll)&&console.debug("ReconnectingWebSocket","onmessage",g.url,b3.data);var c2=l("message");c2.data=b3.data,k.dispatchEvent(c2)},h.onerror=function(b3){(g.debug||a.debugAll)&&console.debug("ReconnectingWebSocket","onerror",g.url,b3),k.dispatchEvent(l("error"))}}catch(error){console.error("WebSocket connection error:",error)}},1==this.automaticOpen&&this.open(false),this.send=function(b2){if(h)return(g.debug||a.debugAll)&&console.debug("ReconnectingWebSocket","send",g.url,b2),h.send(b2);throw"INVALID_STATE_ERR : Pausing to reconnect websocket"},this.close=function(a2,b2){"undefined"==typeof a2&&(a2=1e3),i2=true,h&&h.close(a2,b2)},this.refresh=function(){h&&h.readyState==1&&h.close()}}return a.prototype.onopen=function(){},a.prototype.onclose=function(){},a.prototype.onconnecting=function(){},a.prototype.onmessage=function(){},a.prototype.onerror=function(){},a.debugAll=false,a.CONNECTING=WebSocket.CONNECTING,a.OPEN=WebSocket.OPEN,a.CLOSING=WebSocket.CLOSING,a.CLOSED=WebSocket.CLOSED,a});let _isTipped=false;var _debugMode=false;var _initialized=null;var _dbcrs={};var _dbcrsTime=200;var _tickTime=20;var _scW=0;var cl=console.log;if(!_vcData)var _vcData=void 0;if(!_beaTn)var _beaTn=void 0;var beas;var appSettings;var execEl="";var currentlyValidTags=new Array;var _upwrk=new WebWorker("_upw");var _csswrk=new WebWorker("_cssw");_csswrk.start();var _ups=[];(function(e2,t2){typeof module!="undefined"&&module.exports?module.exports=t2():typeof define=="function"&&define.amd?define(t2):this[e2]=t2()})("bea",function(){function p(e22,t3){for(var n3=0,i3=e22.length;n3<i3;++n3)if(!t3(e22[n3]))return r2;return 1}function d(e22,t3){p(e22,function(e3){return t3(e3),1})}function v(e22,t3,n3){function g(e3){return e3.call?e3():u[e3]}function y(){if(!--h2){u[o2]=1,s2&&s2();for(var e3 in f)p(e3.split("|"),g)&&!d(f[e3],g)&&(f[e3]=[])}}e22=e22[i2]?e22:[e22];var r3=t3&&t3.call,s2=r3?t3:n3,o2=r3?e22.join(""):t3,h2=e22.length;return setTimeout(function(){d(e22,function t4(e3,n4){if(e3===null)return y();/*!n &&
|
|
3
3
|
!/^https?:\/\//.test(e) &&
|
|
4
4
|
c &&
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmjs/cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.17",
|
|
4
4
|
"description": "Command line interface for LumenJS — scaffold, develop, and build LumenJS applications. LumenJS is a tiny, fast reactive JavaScript framework for building web applications and interfaces with standard HTML, CSS, and JavaScript.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"lm": "./dist/bin/commands.js",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"ora": "^6.1.2",
|
|
52
52
|
"semver": "^7.3.7",
|
|
53
53
|
"ws": "^8.8.1",
|
|
54
|
-
"@lmjs/core": "2.1.
|
|
54
|
+
"@lmjs/core": "2.1.16"
|
|
55
55
|
},
|
|
56
56
|
"engines": {
|
|
57
57
|
"node": ">=18.0.0"
|