@base-framework/base 3.0.15 → 3.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base.js +1 -1
- package/dist/base.js.map +3 -3
- package/package.json +1 -1
package/dist/base.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var we=Object.defineProperty;var Se=(s,t,e)=>t in s?we(s,t,{enumerable:true,configurable:true,writable:true,value:e}):s[t]=e;var B=(s,t,e)=>{Se(s,typeof t!=="symbol"?t+"":t,e);return e};var O=class{static toArray(t){return Array.prototype.slice.call(t)}static inArray(t,e,r){if(!t||typeof t!=="object"){return-1}return t.indexOf(e,r)}};var u=class{static getType(t){const e=typeof t;if(e!=="object"){return e}return this.isArray(t)?"array":e}static isUndefined(t){return typeof t==="undefined"}static isObject(t){return t&&typeof t==="object"&&this.isArray(t)===false}static isFunction(t){return typeof t==="function"}static isString(t){return typeof t==="string"}static isArray(t){return Array.isArray(t)}};var m={create(s){return Object.create(s)},extendObject(s,t){if(typeof s==="undefined"||typeof t==="undefined"){return false}for(var e in s){if(this.hasOwnProp(s,e)&&typeof t[e]==="undefined"){t[e]=s[e]}}return t},clone(s){if(!s){return{}}return JSON.parse(JSON.stringify(s))},getClassObject(s){return typeof s==="function"?s.prototype:s},extendClass(s,t){const e=this.getClassObject(s),r=this.getClassObject(t);if(typeof e!=="object"||typeof r!=="object"){return false}const n=Object.create(e);for(var i in r){n[i]=r[i]}return n},hasOwnProp(s,t){return Object.prototype.hasOwnProperty.call(s,t)},isPlainObject(s){return Object.prototype.toString.call(s)==="[object Object]"},isEmpty(s){if(u.isObject(s)===false){return true}for(var t in s){if(this.hasOwnProp(s,t)){return false}}return true}};var $={types:{},add(s,t){this.types[s]=t},get(s){return this.types[s]||false},remove(s){delete this.types[s]}};var Z=class{constructor(){this.types=new Map}add(t,e){if(!this.types.has(t)){this.types.set(t,[])}this.types.get(t).push(e)}get(t){return this.types.get(t)||false}removeByCallBack(t,e){if(typeof t==="function"){t(e)}}removeType(t){if(!this.types.has(t)){return}const e=this.types.get(t);if(!e.length){return}let r,n=$.get(t);for(var i=0,o=e.length;i<o;i++){r=e[i];if(!r){continue}e[i]=null;this.removeByCallBack(n,r)}this.types.delete(t)}remove(t){if(t){this.removeType(t);return}this.types.forEach((e,r)=>{if(!r){return}this.removeType(r)});this.types.clear()}};var f=class{static addType(t,e){$.add(t,e)}static removeType(t){$.remove(t)}static getTrackingId(t){return t.trackingId||(t.trackingId=`dt${this.trackingCount++}`)}static add(t,e,r){const n=this.getTrackingId(t),i=this.find(n);i.add(e,r)}static get(t,e){const r=t.trackingId;const n=this.trackers.get(r);if(!n){return false}return e?n.get(e):n}static find(t){if(!this.trackers.has(t)){this.trackers.set(t,new Z)}return this.trackers.get(t)}static isEmpty(t){if(!t||typeof t!=="object"){return true}return t.size===0}static remove(t,e){const r=t.trackingId;if(!r||!this.trackers.has(r)){return true}const n=this.trackers.get(r);if(e){n.remove(e);if(this.isEmpty(n.types)){this.trackers.delete(r)}}else{n.remove();this.trackers.delete(r)}}};B(f,"trackers",new Map);B(f,"trackingCount",0);var wt=s=>{let t=0;for(let e of Object.entries(s)){t++;if(typeof s[e]==="object"){t+=wt(s[e])}}return t};var Rt=(s,t)=>{let e=false;if(typeof s!=="object"||typeof t!=="object"){return e}for(let[r,n]of Object.entries(s)){if(!m.hasOwnProp(t,r)){break}const i=t[r];if(typeof n!==typeof i){break}if(typeof n==="object"){e=Rt(n,i);if(e!==true){break}}else{if(n===i){e=true}else{break}}}return e};var De=(s,t)=>{const e=wt(s),r=wt(t);if(e!==r){return false}return Rt(s,t)};var Nt=(s,t)=>{const e=typeof s,r=typeof t;if(e!==r){return false}if(e==="object"){return De(s,t)}return s===t};var l={getEvents(s){if(u.isObject(s)===false){return false}return f.get(s,"events")},create(s,t,e,r=false,n=false,i=null){n=n===true;return{event:s,obj:t,fn:e,capture:r,swapped:n,originalFn:i}},on(s,t,e,r){if(Array.isArray(s)){let o;for(var n=0,i=s.length;n<i;n++){o=s[n];this.add(o,t,e,r)}}else{this.add(s,t,e,r)}return this},off(s,t,e,r){if(Array.isArray(s)){var n;for(var i=0,o=s.length;i<o;i++){n=s[i];this.remove(n,t,e,r)}}else{this.remove(s,t,e,r)}return this},add(s,t,e,r=false,n=false,i=null){if(u.isObject(t)===false){return this}const o=this.create(s,t,e,r,n,i);f.add(t,"events",o);t.addEventListener(s,e,r);return this},remove(s,t,e,r=false){const n=this.getEvent(s,t,e,r);if(n===false){return this}if(typeof n==="object"){this.removeEvent(n)}return this},removeEvent(s){if(typeof s==="object"){const t=s.obj;t.removeEventListener(s.event,s.fn,s.capture)}return this},getEvent(s,t,e,r){if(typeof t!=="object"){return false}const n=this.getEvents(t);if(!n||n.length<1){return false}const i=this.create(s,t,e,r);return this.search(i,n)},search(s,t){let e,r=this.isSwappable(s.event);for(var n=0,i=t.length;n<i;n++){e=t[n];if(e.event!==s.event||e.obj!==s.obj){continue}if(e.fn===s.fn||r===true&&e.originalFn===s.fn){return e}}return false},removeEvents(s){if(u.isObject(s)===false){return this}f.remove(s,"events");return this},swap:["DOMMouseScroll","wheel","mousewheel","mousemove","popstate"],addSwapped(s){this.swap.push(s)},isSwappable(s){return this.swap.includes(s)}};f.addType("events",s=>{l.removeEvent(s)});var _t={events:l,addListener(s,t,e,r){this.events.add(s,t,e,r);return this},on(s,t,e,r){const n=this.events;if(Array.isArray(s)){s.forEach(i=>{n.add(i,t,e,r)})}else{n.add(s,t,e,r)}return this},off(s,t,e,r){const n=this.events;if(Array.isArray(s)){s.forEach(i=>{n.remove(i,t,e,r)})}else{n.remove(s,t,e,r)}return this},removeListener(s,t,e,r){this.events.remove(s,t,e,r);return this},_createEvent(s,t,e,r){let n;if(t==="HTMLEvents"){n=new Event(s)}else if(t==="MouseEvents"){n=new MouseEvent(s,e)}else{n=new CustomEvent(s,r)}return n},createEvent(s,t,e,r){if(u.isObject(t)===false){return false}let n={pointerX:0,pointerY:0,button:0,view:window,detail:1,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:false,altKey:false,shiftKey:false,metaKey:false,bubbles:true,cancelable:true,relatedTarget:null};if(u.isObject(e)){n=Object.assign(n,e)}const i=this._getEventType(s);return this._createEvent(s,i,n,r)},_getEventType(s){const t={"HTMLEvents":/^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/,"MouseEvents":/^(?:click|dblclick|mouse(?:down|up|over|move|out))$/};let e="CustomEvent";for(const[r,n]of Object.entries(t)){if(s.match(n)){e=r;break}}return e},trigger(s,t,e){if(u.isObject(t)===false){return this}const r=typeof s==="string"?this.createEvent(s,t,null,e):s;t.dispatchEvent(r);return this},mouseWheelEventType:null,getWheelEventType(){const s=()=>{let t="wheel";if("onmousewheel"in self){t="mousewheel"}else if("DOMMouseScroll"in self){t="DOMMouseScroll"}return t};return this.mouseWheelEventType||(this.mouseWheelEventType=s())},onMouseWheel(s,t,e,r){if(typeof t==="undefined"){t=window}const n=o=>{const a=Math.max(-1,Math.min(1,-o.deltaY||o.wheelDelta||-o.detail));if(typeof s==="function"){s(a,o)}if(e===true){o.preventDefault()}};const i=this.getWheelEventType();this.events.add(i,t,n,r,true,s);return this},offMouseWheel(s,t,e){if(typeof t==="undefined"){t=window}const r=this.getWheelEventType();this.off(r,t,s,e);return this},preventDefault(s){if(typeof s.preventDefault==="function"){s.preventDefault()}else{s.returnValue=false}return this},stopPropagation(s){if(typeof s.stopPropagation==="function"){s.stopPropagation()}else{s.cancelBubble=true}return this}};var K=class{constructor(){this.version="3.0.10";this.errors=[];this.dataTracker=f}augment(t){if(!u.isObject(t)){return this}Object.entries(t).forEach(([e,r])=>{this.constructor.prototype[e]=r});return this}override(t,e,r,n){return(t[e]=r).apply(t,O.toArray(n))}getLastError(){const t=this.errors;return t.length?t.pop():false}addError(t){this.errors.push(t)}getProperty(t,e,r){if(u.isObject(t)===false){return""}const n=t[e];if(typeof n!=="undefined"){return n}return typeof r!=="undefined"?r:""}createCallBack(t,e,r=[],n=false){if(typeof e!=="function"){return false}return(...i)=>{if(n===true){r=r.concat(i)}return e.apply(t,r)}}bind(t,e){return e.bind(t)}};K.prototype.extend=function(){return K.prototype}();var S=new K;S.augment({...m,..._t,...u,equals:Nt});var x=class{static parseQueryString(t,e){if(typeof t!=="string"){t=window.location.search}const r={},n=/([^?=&]+)(=([^&]*))?/g;t.replace(n,function(i,o,a,c){r[o]=e!==false?decodeURIComponent(c):c});return r}static camelCase(t){if(typeof t!=="string"){return false}const e=/(-|\s|_)+\w{1}/g;return t.replace(e,r=>{return r[1].toUpperCase()})}static uncamelCase(t,e="-"){if(typeof t!=="string"){return false}const r=/([A-Z]{1,})/g;return t.replace(r,n=>{return e+n.toLowerCase()}).toLowerCase()}};var It={url:"",responseType:"json",method:"POST",fixedParams:"",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},beforeSend:[],async:true,crossDomain:false,withCredentials:false,completed:null,failed:null,aborted:null,progress:null};S.augment({xhrSettings:It,addFixedParams(s){this.xhrSettings.fixedParams=s},beforeSend(s){this.xhrSettings.beforeSend.push(s)},ajaxSettings(s){if(typeof s==="object"){this.xhrSettings=m.extendClass(S.xhrSettings,s)}},resetAjaxSettings(){this.xhrSettings=It}});var tt=(...s)=>{const t=new St(s);return t.xhr};var St=class{constructor(t){this.settings=null;this.xhr=null;this.setup(t)}setup(t){this.getXhrSettings(t);const e=this.xhr=this.createXHR();if(e===false){return false}const{method:r,url:n,async:i}=this.settings;e.open(r,n,i);this.setupHeaders();this.addXhrEvents();this.beforeSend();e.send(this.getParams())}beforeSend(){const t=S.xhrSettings.beforeSend;if(t.length<1){return}const e=this.xhr;const r=this.settings;for(var n=0,i=t.length;n<i;n++){var o=t[n];if(o){o(e,r)}}}objectToString(t){const e=[];for(var r in t){if(Object.prototype.hasOwnProperty.call(t,r)){e.push(r+"="+encodeURIComponent(t[r]))}}return e.join("&")}setupParams(t,e){const r=typeof t;if(!e){if(t instanceof FormData===false&&r==="object"){t=this.objectToString(t)}return t}const n=typeof e;if(r==="string"){if(n!=="string"){e=this.objectToString(e)}const o=t===""?"?":"&";t+=o+e;return t}if(n==="string"){e=x.parseQueryString(e,false)}if(t instanceof FormData){for(var i in e){if(Object.prototype.hasOwnProperty.call(e,i)){t.append(i,e[i])}}}else if(r==="object"){t=m.clone(t);t=Object.assign(e,t);t=this.objectToString(t)}return t}getParams(){const t=this.settings;const e=t.fixedParams;let r=t.params;if(r){r=this.setupParams(r,e)}else if(e){r=this.setupParams(e)}return r}getXhrSettings(t){let e=this.settings=Object.create(S.xhrSettings);if(t.length>=2&&typeof t[0]!=="object"){for(var r=0,n=t.length;r<n;r++){var i=t[r];switch(r){case 0:e.url=i;break;case 1:e.params=i;break;case 2:e.completed=i;e.failed=i;break;case 3:e.responseType=i||"json";break;case 4:e.method=i?i.toUpperCase():"POST";break;case 5:e.async=typeof i!=="undefined"?i:true;break}}}else{e=this.settings=m.extendClass(this.settings,t[0]);if(typeof e.completed==="function"){if(typeof e.failed!=="function"){e.failed=e.completed}if(typeof e.aborted!=="function"){e.aborted=e.failed}}}}createXHR(){const t=this.settings,e=new XMLHttpRequest;e.responseType=t.responseType;if(t.withCredentials===true){e.withCredentials=true}return e}setupHeaders(){const t=this.settings;if(!t&&typeof t.headers!=="object"){return}let e=t.headers;for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r)){this.xhr.setRequestHeader(r,e[r])}}}update(t,e){const r=this.xhr;const n=()=>{l.removeEvents(r.upload);l.removeEvents(r)};const i=this.settings;if(!i){return false}const o=e||t.type;switch(o){case"load":if(typeof i.completed==="function"){let a=this.getResponseData();i.completed(a,this.xhr)}n();break;case"error":if(typeof i.failed==="function"){i.failed(false,this.xhr)}n();break;case"progress":if(typeof i.progress==="function"){i.progress(t)}break;case"abort":if(typeof i.aborted==="function"){i.aborted(false,this.xhr)}n();break}}getResponseData(){const t=this.xhr;const e=t.responseType;if(!e||e==="text"){return t.responseText}return t.response}addXhrEvents(){const t=this.settings;if(!t){return}const e=this.xhr,r=this.update.bind(this);l.on(["load","error","abort"],e,r);l.on("progress",e.upload,r)}};var d=class{static getById(t){if(typeof t!=="string"){return false}const e=document.getElementById(t);return e||false}static getByName(t){if(typeof t!=="string"){return false}const e=document.getElementsByName(t);return e?O.toArray(e):false}static getBySelector(t,e){if(typeof t!=="string"){return false}e=e||false;if(e===true){const n=document.querySelector(t);return n||false}const r=document.querySelectorAll(t);if(!r){return false}return r.length===1?r[0]:O.toArray(r)}static html(t,e){if(u.isObject(t)===false){return false}if(u.isUndefined(e)===false){t.innerHTML=e;return this}return t.innerHTML}static setCss(t,e,r){if(u.isObject(t)===false||u.isUndefined(e)){return this}e=x.uncamelCase(e);t.style[e]=r;return this}static getCss(t,e){if(!t||typeof e==="undefined"){return false}e=x.uncamelCase(e);let r=t.style[e];if(r!==""){return r}let n=null,i=t.currentStyle;if(i&&(n=i[e])){r=n}else{const o=window.getComputedStyle(t,null);if(o){r=o[e]}}return r}static css(t,e,r){if(typeof r!=="undefined"){this.setCss(t,e,r);return this}return this.getCss(t,e)}static removeAttr(t,e){if(u.isObject(t)){t.removeAttribute(e)}return this}static setAttr(t,e,r){t.setAttribute(e,r)}static getAttr(t,e){return t.getAttribute(e)}static attr(t,e,r){if(u.isObject(t)===false){return false}if(typeof r!=="undefined"){this.setAttr(t,e,r);return this}return this.getAttr(t,e)}static _checkDataPrefix(t){if(typeof t!=="string"){return t}t=x.uncamelCase(t);if(t.substring(0,5)!=="data-"){t="data-"+t}return t}static removeDataPrefix(t){if(typeof t==="string"&&t.substring(0,5)==="data-"){t=t.substring(5)}return t}static setData(t,e,r){e=this.removeDataPrefix(e);e=x.camelCase(e);t.dataset[e]=r}static getData(t,e){e=x.camelCase(this.removeDataPrefix(e));return t.dataset[e]}static data(t,e,r){if(u.isObject(t)===false){return false}if(typeof r!=="undefined"){this.setData(t,e,r);return this}return this.getData(t,e)}static find(t,e){if(!t||typeof e!=="string"){return false}return t.querySelectorAll(e)}static show(t){if(u.isObject(t)===false){return this}const e=this.data(t,"style-display"),r=typeof e==="string"?e:"";this.css(t,"display",r);return this}static hide(t){if(u.isObject(t)===false){return this}const e=this.css(t,"display");if(e!=="none"&&e){this.data(t,"style-display",e)}this.css(t,"display","none");return this}static toggle(t){if(u.isObject(t)===false){return this}const e=this.css(t,"display");if(e!=="none"){this.hide(t)}else{this.show(t)}return this}static getSize(t){if(u.isObject(t)===false){return false}return{width:this.getWidth(t),height:this.getHeight(t)}}static getWidth(t){return u.isObject(t)?t.offsetWidth:false}static getHeight(t){return u.isObject(t)?t.offsetHeight:false}static getScrollPosition(t){let e=0,r=0;switch(typeof t){case"undefined":t=document.documentElement;e=t.scrollLeft;r=t.scrollTop;break;case"object":e=t.scrollLeft;r=t.scrollTop;break}if(u.isObject(t)===false){return false}return{left:e-(t.clientLeft||0),top:r-(t.clientTop||0)}}static getScrollTop(t){const e=this.getScrollPosition(t);return e.top}static getScrollLeft(t){const e=this.getScrollPosition(t);return e.left}static getWindowSize(){const t=window,e=document,r=e.documentElement,n=e.getElementsByTagName("body")[0],i=t.innerWidth||r.clientWidth||n.clientWidth,o=t.innerHeight||r.clientHeight||n.clientHeight;return{width:i,height:o}}static getDocumentSize(){const t=document,e=t.body,r=t.documentElement,n=Math.max(e.scrollHeight,e.offsetHeight,r.clientHeight,r.scrollHeight,r.offsetHeight),i=Math.max(e.scrollWidth,e.offsetWidth,r.clientWidth,r.scrollWidth,r.offsetWidth);return{width:i,height:n}}static getDocumentHeight(){return this.getDocumentSize().height}static position(t,e=1){const r={x:0,y:0};if(u.isObject(t)===false){return r}let n=0;while(t&&(e===0||n<e)){n++;r.x+=t.offsetLeft+t.clientLeft;r.y+=t.offsetTop+t.clientTop;t=t.offsetParent}return r}static addClass(t,e){if(u.isObject(t)===false||e===""){return this}if(typeof e==="string"){const i=e.split(" ");for(var r=0,n=i.length;r<n;r++){t.classList.add(e)}}return this}static removeClass(t,e){if(u.isObject(t)===false||e===""){return this}if(typeof e==="undefined"){t.className=""}else{t.classList.remove(e)}return this}static hasClass(t,e){if(u.isObject(t)===false||e===""){return false}return t.classList.contains(e)}static toggleClass(t,e){if(u.isObject(t)===false){return this}t.classList.toggle(e);return this}};var et=class{constructor(){this.connections=new Map}add(t,e,r){const n=this.find(t);n.set(e,r);return r}get(t,e){const r=this.connections.get(t);if(r){return r.get(e)||false}return false}find(t){const e=this.connections.get(t);if(e){return e}const r=new Map;this.connections.set(t,r);return r}remove(t,e){const r=this.connections.get(t);if(!r){return}let n;if(e){n=r.get(e);if(n){n.unsubscribe();r.delete(e)}if(r.size===0){this.connections.delete(t)}}else{for(let i of r){n=r.get(i);if(n){n.unsubscribe()}}this.connections.delete(t)}}};var I=class{constructor(){this.msg=null;this.token=null}setToken(t){this.token=t}};var rt=class extends I{constructor(t){super();this.data=t}subscribe(t,e){this.msg=t;this.token=this.data.on(t,e)}unsubscribe(){this.data.off(this.msg,this.token)}};var U=class{unsubscribe(){}};var st=class extends U{constructor(){super();this.source=null}addSource(t){return this.source=new rt(t)}unsubscribe(){this.source.unsubscribe();this.source=null}};var W=class extends I{constructor(t){super();this.pubSub=t}subscribe(t){this.msg=t;const e=this.callBack.bind(this);this.token=this.pubSub.on(t,e)}unsubscribe(){this.pubSub.off(this.msg,this.token)}callBack(){}};var nt=class extends W{constructor(t,e,r){super(r);this.data=t;this.prop=e}set(t){this.data.set(this.prop,t)}get(){return this.data.get(this.prop)}callBack(t,e){if(this.data!==e){this.data.set(this.prop,t,e)}}};var Ae=(s,t,e)=>{d.setAttr(s,t,e)};var Ce=(s,t,e)=>{s.checked=s.value==e};var Te=(s,t,e)=>{e=e==1;Ut(s,t,e)};var Ut=(s,t,e)=>{s[t]=e};var Ee=(s,t)=>{return d.getAttr(s,t)};var Oe=(s,t)=>{return s[t]};var it=class extends W{constructor(t,e,r,n){super(n);this.element=t;this.attr=this.getAttrBind(e);this.addSetMethod(t,this.attr);this.filter=typeof r==="string"?this.setupFilter(r):r}addSetMethod(t,e){if(e.substring(4,1)==="-"){this.setValue=Ae;this.getValue=Ee;return this}this.getValue=Oe;const r=t.type;if(r){switch(r){case"checkbox":this.setValue=Te;return;case"radio":this.setValue=Ce;return}}this.setValue=Ut;return this}getAttrBind(t){if(t){return t}let e="textContent";const r=this.element;if(!r||typeof r!=="object"){return e}const n=r.tagName.toLowerCase();if(n==="input"||n==="textarea"||n==="select"){const i=r.type;if(!i){e="value";return e}switch(i){case"checkbox":e="checked";break;case"file":e="files";break;default:e="value"}}return e}setupFilter(t){const e=/(\[\[[^\]]+\]\])/;return r=>{return t.replace(e,r)}}set(t){const e=this.element;if(!e||typeof e!=="object"){return this}if(this.filter){t=this.filter(t)}this.setValue(e,this.attr,t);return this}get(){const t=this.element;if(!t||typeof t!=="object"){return""}return this.getValue(t,this.attr)}callBack(t,e){if(e!==this.element){this.set(t)}return this}};var ot=class extends U{constructor(t){super();this.element=null;this.data=null;this.pubSub=t}addElement(t,e,r){return this.element=new it(t,e,r,this.pubSub)}addData(t,e){return this.data=new nt(t,e,this.pubSub)}unsubscribeSource(t){if(t){t.unsubscribe()}return this}unsubscribe(){this.unsubscribeSource(this.element);this.unsubscribeSource(this.data);this.element=null;this.data=null;return this}};var Wt=-1;var L=class{constructor(){this.callBacks=new Map;this.lastToken=-1}get(t){if(!this.callBacks.has(t)){this.callBacks.set(t,[])}return this.callBacks.get(t)}reset(){this.callBacks.clear();this.lastToken=-1;Wt=-1}on(t,e){const r=++Wt;this.get(t).push({token:r,callBack:e});return r}off(t,e){const r=this.callBacks.get(t);if(!r){return}const n=r.findIndex(i=>i.token===e);if(n!==-1){r.splice(n,1)}}remove(t){this.callBacks.delete(t)}publish(t,...e){const r=this.callBacks.get(t);if(!r){return}for(const{callBack:n}of r){if(!n){continue}n.apply(this,e)}}};var Dt=class{constructor(){this.version="1.0.1";this.attr="bindId";this.blockedKeys=[20,37,38,39,40];this.connections=new et;this.pubSub=new L;this.idCount=0;this.setup()}setup(){this.setupEvents()}bind(t,e,r,n){let i=r,o=null;if(r.indexOf(":")!==-1){const p=r.split(":");if(p.length>1){i=p[1];o=p[0]}}const a=this.setupConnection(t,e,i,o,n);const c=a.element;let h=e.get(i);if(typeof h!=="undefined"){c.set(h)}else{h=c.get();if(h!==""){a.data.set(h)}}return this}setupConnection(t,e,r,n,i){const o=this.getBindId(t),a=new ot(this.pubSub),c=a.addData(e,r);c.subscribe(o);const h=e.getDataId();const p=`${h}:${r}`;const v=a.addElement(t,n,i);v.subscribe(p);this.addConnection(o,"bind",a);return a}addConnection(t,e,r){this.connections.add(t,e,r);return this}setBindId(t){const e="db-"+this.idCount++;if(t.dataset){t.dataset[this.attr]=e}t[this.attr]=e;return e}getBindId(t){return t[this.attr]||this.setBindId(t)}unbind(t){const e=t[this.attr];if(e){this.connections.remove(e)}return this}watch(t,e,r,n){if(u.isObject(t)===false){return this}const i=new st;const o=i.addSource(e);o.subscribe(r,n);const a=this.getBindId(t),c=e.getDataId()+":"+r;this.addConnection(a,c,i);const h=e.get(r);if(typeof h!=="undefined"){n(h)}return this}unwatch(t,e,r){if(u.isObject(t)===false){return this}const n=t[this.attr];if(n){const i=e.getDataId()+":"+r;this.connections.remove(n,i)}return this}publish(t,e,r){this.pubSub.publish(t,e,r);return this}isDataBound(t){if(!t){return false}const e=t[this.attr];return e?e:false}isBlocked(t){if(t.type!=="keyup"){return false}return this.blockedKeys.indexOf(t.keyCode)!==-1}bindHandler(t){if(this.isBlocked(t)){return true}const e=t.target||t.srcElement,r=this.isDataBound(e);if(r){const n=this.connections.get(r,"bind");if(n){const i=n.element.get();this.pubSub.publish(r,i,e)}}t.stopPropagation()}setupEvents(){this.changeHandler=this.bindHandler.bind(this);this.addEvents()}addEvents(){l.on(["change","paste","input"],document,this.changeHandler,false)}removeEvents(){l.off(["change","paste","input"],document,this.changeHandler,false)}};var y=new Dt;var jt=/(\[\[(.*?(?:\[\d+\])?)\]\])/g;var P={isWatching(s){if(Array.isArray(s)){return typeof s[0]==="string"&&this.hasParams(s[0])}return this.hasParams(s)},hasParams(s){return u.isString(s)&&s.includes("[[")},_getWatcherProps(s){let t=/\[\[(.*?)(\[\d+\])?\]\]/g;const e=s.match(t);if(e===null){return null}t=/(\[\[|\]\])/g;return e.map(r=>r.replace(t,""))},updateAttr(s,t,e){switch(t){case"text":case"textContent":s.textContent=e;break;case"innerHTML":s.innerHTML=e;break;default:if(t.substring(4,1)==="-"){d.setAttr(s,t,e);break}s[t]=e;break}},_getWatcherCallBack(s,t,e,r,n){return()=>{let i=0,o=e.replace(jt,function(){const a=n?t[i]:t;i++;const c=a.get(arguments[2]);return typeof c!=="undefined"?c:""});this.updateAttr(s,r,o)}},getParentData(s){if(s.data){return s.data}if(s.context&&s.context.data){return s.context.data}if(s.state){return s.state}return null},getValue(s,t){if(typeof s==="string"){s={value:s}}const e=s.value;if(Array.isArray(e)===false){return[e,this.getParentData(t)]}if(e.length<2){e.push(this.getParentData(t))}return e},getPropValues(s,t,e){const r=[];for(var n=0,i=t.length;n<i;n++){var o=e?s[n]:s;var a=o.get(t[n]);a=typeof a!=="undefined"?a:"";r.push(a)}return r},getCallBack(s,t,e,r,n){let i,o=s.callBack;if(typeof o==="function"){const a=r.match(jt);const c=a&&a.length>1;i=(h,p)=>{h=c!==true?h:this.getPropValues(e,a,n);o(h,t,p)}}else{const a=s.attr||"textContent";i=this._getWatcherCallBack(t,e,r,a,n)}return i},addDataWatcher(s,t,e){const r=this.getValue(t,e),n=r[1];if(!n){return}const i=r[0],o=Array.isArray(n);const a=this.getCallBack(t,s,n,i,o),c=this._getWatcherProps(i);for(var h=0,p=c.length;h<p;h++){var v=o?n[h]:n;this.addWatcher(s,v,c[h],a)}},setup(s,t,e){if(!t){return}if(Array.isArray(t)){const r=[t[0],t[1]];const n=t[2];if(typeof n==="function"){t={value:r,callBack:n}}else{t={attr:n,value:[t[0],t[1]]}}}this.addDataWatcher(s,t,e)},addWatcher(s,t,e,r){y.watch(s,t,e,r)}};var Pe=s=>{if(typeof s!=="string"){return s}return Ft(s)};var Ft=s=>{return[{tag:"text",textContent:s}]};var Me=s=>{if(!s){return{props:{},children:[]}}const t=s[0];if(typeof t==="string"){return{props:{},children:Ft(t)}}if(Array.isArray(t)){if(P.isWatching(t)===false){return{props:{},children:t}}return{props:{watch:t},children:[]}}return{props:t||{},children:Pe(s[1])}};var Be=s=>{return(...t)=>{const{props:e,children:r}=Me(t);return s(e,r)}};var at=s=>{const t={};if(!u.isObject(s)){return t}const e=m.clone(s);Object.keys(e).forEach(r=>{const n=e[r];if(typeof n!=="function"){t[r]=n}});return t};function Vt(s,t){const e=isNaN(Number(t))?t:`[${t}]`;return s===""?e:`${s}.${e}`}function Jt(s,t="",e=""){return{get(r,n,i){if(u.isFunction(r[n])){return r[n].bind(r)}if(t===""&&n in r){return r[n]}const o=r[e]||r;const a=o[n];if(!u.isObject(a)||m.isPlainObject(a)===false){return a}const c=Vt(t,n);return new Proxy(a,Jt(s,c,e))},set(r,n,i,o){if(t===""&&n in r){r[n]=i;return true}const a=r[e]||r;const c=Vt(t,n);s.set(c,i);a[n]=i;return true}}}var zt=(s,t="stage")=>new Proxy(s,Jt(s,"",t));var Le=0;var H=class{constructor(t){this.dirty=false;this.links={};this._init();this.setup();this.dataTypeId="bd";this.eventSub=new L;const e=at(t);this.set(e);return zt(this)}setup(){this.stage={}}_init(){const t=++Le;this._dataNumber=t;this._id="dt-"+t;this._dataId=this._id+":"}getDataId(){return this._id}remove(){}on(t,e){const r=t+":change";const n=this.eventSub.on(r,e);return n}off(t,e){const r=t+":change";this.eventSub.off(r,e)}_setAttr(t,e,r=this){const n=this.stage[t];if(e===n){return false}this.stage[t]=e;this._publish(t,e,r,n)}set(...t){if(typeof t[0]!=="object"){this._setAttr(...t);return this}const[e,r,n]=t;Object.entries(e).forEach(([i,o])=>{if(typeof o==="function"){return}this._setAttr(i,o,r,n)});return this}getModelData(){return this.stage}_deleteAttr(t,e){delete t[e]}toggle(t){if(typeof t==="undefined"){return}this.set(t,!this.get(t));return this}increment(t){if(typeof t==="undefined"){return}let e=this.get(t);this.set(t,++e);return this}decrement(t){if(typeof t==="undefined"){return}let e=this.get(t);this.set(t,--e);return this}concat(t,e){if(typeof t==="undefined"){return}let r=this.get(t);this.set(t,r+e);return this}ifNull(t,e){if(this.get(t)===null){this.set(t,e)}return this}setKey(t){this.key=t;return this}resume(t){const e=this.key;if(!e){return this}let r;const n=localStorage.getItem(e);if(n===null){if(t){r=t}}else{r=JSON.parse(n)}if(!r){return this}this.set(r);return this}store(){const t=this.key;if(!t){return false}const e=this.get();if(!e){return false}const r=JSON.stringify(e);localStorage.setItem(t,r);return true}delete(t){if(typeof t!=="undefined"){this._deleteAttr(this.stage,t);return}this.setup()}_getAttr(t,e){return t[e]}get(t){if(typeof t!=="undefined"){return this._getAttr(this.stage,t)}return this.getModelData()}link(t,e,r){if(arguments.length===1&&t.isData===true){e=t.get()}if(typeof e!=="object"){return this.remoteLink(t,e,r)}const n=[];Object.entries(e).forEach(([i])=>{n.push(this.remoteLink(t,i))});return n}remoteLink(t,e,r){const n=r||e;const i=t.get(e);if(typeof i!=="undefined"&&this.get(e)!==i){this.set(e,i)}const o=t.on(e,(c,h)=>{if(h===this){return false}this.set(n,c,t)});this.addLink(o,t);const a=this.on(n,(c,h)=>{if(h===t){return false}t.set(e,c,this)});t.addLink(a,this);return o}addLink(t,e){this.links[t]=e}unlink(t){if(t){this.removeLink(t);return}const e=this.links;if(e.length<1){return}e.forEach(r=>{this.removeLink(r,false)});this.links=[]}removeLink(t,e){const r=this.links[t];if(r){r.off(t)}if(e===false){return}delete this.links[t]}};H.prototype.isData=true;var A={deepDataPattern:/(\w+)|(?:\[(\d)\))/g,hasDeepData(s){return s.indexOf(".")!==-1||s.indexOf("[")!==-1},getSegments(s){const t=this.deepDataPattern;return s.match(t)}};var C=class extends H{setup(){this.attributes={};this.stage={}}_updateAttr(t,e,r){if(!A.hasDeepData(e)){t[e]=r;return}let n,i=A.getSegments(e),o=i.length,a=o-1;for(var c=0;c<o;c++){n=i[c];if(c===a){t[n]=r;break}if(t[n]===void 0){t[n]=isNaN(n)?{}:[]}t=t[n]}}_setAttr(t,e,r,n){if(typeof e!=="object"&&e===this.get(t)){return}if(!r&&n!==true){this._updateAttr(this.attributes,t,e)}else{if(this.dirty===false){this.dirty=true}}this._updateAttr(this.stage,t,e);r=r||this;this._publish(t,e,r)}linkAttr(t,e){const r=t.get(e);if(!r){return}for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){this.link(t,e+"."+n,n)}}}scope(t,e){const r=this.get(t);if(!r){return false}e=e||this.constructor;const n=new e(r);n.linkAttr(this,t);return n}splice(t,e){this.delete(t+"["+e+"]");this.refresh(t);return this}push(t,e){let r=this.get(t);if(Array.isArray(r)===false){r=[]}r.push(e);this.set(t,r);return this}unshift(t,e){let r=this.get(t);if(Array.isArray(r)===false){r=[]}r.unshift(e);this.set(t,r);return this}shift(t){let e=this.get(t);if(Array.isArray(e)===false){return null}const r=e.shift();this.set(t,e);return r}pop(t){let e=this.get(t);if(Array.isArray(e)===false){return null}const r=e.pop();this.set(t,e);return r}refresh(t){this.set(t,this.get(t));return this}_publish(t,e,r){this.publish(t,e,r)}publishDeep(t,e,r){if(!A.hasDeepData(t)){this.publish(t,e,r);return}let n,i=A.getSegments(t),o=i.length,a=o-1;let c="",h=this.stage;for(var p=0;p<o;p++){n=i[p];h=h[n];if(p>0){if(isNaN(n)){c+="."+n}}else{c=n}var v;if(p===a){v=e}else{var E=i[p+1];if(isNaN(E)===false){c+="["+E+"]";continue}var q={};q[E]=h[E];v=q}this.publish(c,v,r)}}publish(t,e,r){t=t||"";this._publishAttr(t,e,r);if(!e||typeof e!=="object"){return}let n,i;if(Array.isArray(e)){const c=e.length;for(var o=0;o<c;o++){i=e[o];n=t+"["+o+"]";this._checkPublish(n,i,r)}}else{for(var a in e){if(!Object.prototype.hasOwnProperty.call(e,a)){continue}i=e[a];n=t+"."+a;this._checkPublish(n,i,r)}}}_checkPublish(t,e,r){if(!e||typeof e!=="object"){this._publishAttr(t,e,r)}else{this.publish(t,e,r)}}_publishAttr(t,e,r){y.publish(this._dataId+t,e,r);const n=t+":change";this.eventSub.publish(n,e,r)}mergeStage(){this.attributes=m.clone(this.stage);this.dirty=false}getModelData(){this.mergeStage();return this.attributes}revert(){this.set(this.attributes);this.dirty=false}_deleteAttr(t,e){if(!A.hasDeepData(e)){delete t[e]}const r=A.getSegments(e),n=r.length,i=n-1;for(var o=0;o<n;o++){var a=r[o];var c=t[a];if(c===void 0){break}if(o===i){if(Array.isArray(t)){t.splice(a,1);break}delete t[a];break}t=c}}_getAttr(t,e){if(!A.hasDeepData(e)){return t[e]}const r=A.getSegments(e),n=r.length,i=n-1;for(var o=0;o<n;o++){var a=r[o];var c=t[a];if(c===void 0){break}t=c;if(o===i){return t}}return void 0}};var He={"\n":"\\n","\r":"\\n"," ":"\\t"};var Re=(s,t)=>{if(typeof s!=="string"){s=String(s)}const e=t?/[\n\r\t]/g:/\t/g;return s.replace(e,r=>He[r])};var Yt=(s,t)=>{if(typeof s!=="string"){return s}s=Re(s,t);s=encodeURIComponent(s);const e=/%22/g;return s.replace(e,'"')};var At=(s,t)=>{const e=typeof s;if(e==="undefined"){return s}if(e!=="object"){s=Yt(s);return s}Object.entries(s).forEach(([r,n])=>{if(n===null){return}s[r]=typeof n==="string"?At(n,t):Yt(n,t)});return s};function qt(s){return typeof s!=="undefined"&&s.length>0?JSON.parse(s):false}function Ct(s){return typeof s!=="undefined"?JSON.stringify(s):false}var X=class{static prepareJsonUrl(t,e=false){const r=typeof t==="object"?m.clone(t):t,n=At(r,e);return Ct(n)}static xmlParse(t){if(typeof t==="undefined"){return false}const e=new DOMParser;return e.parseFromString(t,"text/xml")}};B(X,"json",{encode:Ct,decode:qt});var ct=class{constructor(t){this.model=t;this.objectType=this.objectType||"item";this.url="";this.validateCallBack=null;this.init()}init(){const t=this.model;if(t&&t.url){this.url=t.url}}isValid(){const t=this.validate();if(t!==false){const e=this.validateCallBack;if(typeof e==="function"){e(t)}}return t}validate(){return true}getDefaultParams(){return""}setupParams(t){const e=this.getDefaultParams();t=this.addParams(t,e);return t}objectToString(t){const e=[];for(var r in t){if(Object.prototype.hasOwnProperty.call(t,r)){e.push(r+"="+t[r])}}return e.join("&")}addParams(t,e){t=t||{};if(typeof t==="string"){t=x.parseQueryString(t,false)}if(!e){return!this._isFormData(t)?this.objectToString(t):t}if(typeof e==="string"){e=x.parseQueryString(e,false)}if(this._isFormData(t)){for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r)){t.append(r,e[r])}}}else{t=Object.assign(t,e);t=this.objectToString(t)}return t}get(t,e){const r=this.model.get("id"),n="op=get&id="+r;const i=this.model;return this._get("",n,t,e,o=>{if(o){const a=this.getObject(o);if(a){i.set(a)}}})}getObject(t){const e=t[this.objectType]||t;return e||false}setupObjectData(){const t=this.model.get();return this.objectType+"="+X.prepareJsonUrl(t)}setup(t,e){if(!this.isValid()){return false}let r="op=setup&"+this.setupObjectData();return this._put("",r,t,e)}add(t,e){if(!this.isValid()){return false}let r="op=add&"+this.setupObjectData();return this._post("",r,t,e)}update(t,e){if(!this.isValid()){return false}let r="op=update&"+this.setupObjectData();return this._patch("",r,t,e)}delete(t,e){const r=this.model.get("id"),n="op=delete&id="+r;return this._delete("",n,t,e)}all(t,e,r,n,i){i=i||"";r=!isNaN(r)?r:0;n=!isNaN(n)?n:50;let o="op=all&option="+i+"&start="+r+"&stop="+n;return this._get("",o,t,e)}getUrl(t){let e=this.url;if(!t){return e}if(t[0]==="?"){return e+t}return e+="/"+t}setupRequest(t,e,r,n,i){const o={url:this.getUrl(t),method:e,params:r,completed:(c,h)=>{if(typeof i==="function"){i(c)}this.getResponse(c,n,h)}};const a=this._isFormData(r);if(a){o.headers={}}return tt(o)}_isFormData(t){return t instanceof FormData}request(t,e,r,n){return this._request("","POST",t,e,r,n)}_get(t,e,r,n,i){e=this.setupParams(e);e=this.addParams(e,r);t=t||"";if(e){t+="?"+e}return this.setupRequest(t,"GET","",n,i)}_post(t,e,r,n,i){return this._request(t,"POST",e,r,n,i)}_put(t,e,r,n,i){return this._request(t,"PUT",e,r,n,i)}_patch(t,e,r,n,i){return this._request(t,"PATCH",e,r,n,i)}_delete(t,e,r,n,i){return this._request(t,"DELETE",e,r,n,i)}_request(t,e,r,n,i,o){r=this.setupParams(r);r=this.addParams(r,n);return this.setupRequest(t,e,r,i,o)}getResponse(t,e,r){if(typeof e==="function"){e(t,r)}}static extend(t){if(!t){return false}const e=this;class r extends e{constructor(i){super(i)}}Object.assign(r.prototype,t);return r}};var Ne=s=>{const t={};if(!u.isObject(s)||!s.defaults){return t}const{defaults:e}=s;Object.keys(e).forEach(r=>{const n=e[r];if(typeof n!=="function"){t[r]=n}});delete s.defaults;return t};var _e=s=>{if(!s||typeof s.xhr!=="object"){return{}}const t={...s.xhr};delete s.xhr;return t};var Ie=0;var j=class extends C{xhr=null;constructor(t){const e=super(t);this.initialize();return e}initialize(){}static extend(t={}){const e=this,r=_e(t),n=this.prototype.service.extend(r);const i=Ne(t);class o extends e{constructor(c){const h={...i,...at(c)};super(h);this.xhr=new n(this)}dataTypeId=`bm${Ie++}`}Object.assign(o.prototype,t);o.prototype.service=n;return o}};j.prototype.service=ct;var T=class extends H{_publish(t,e,r,n){const i=t+":change";this.eventSub.publish(i,e,r);r=r||this;y.publish(this._dataId+t,e,r)}};var ht=class extends T{constructor(t){super();this.id=t}addAction(t,e){if(typeof e!=="undefined"){this.set(t,e)}}getState(t){return this.get(t)}removeAction(t,e){if(e){this.off(t,e);return}const r=this.stage;if(typeof r[t]!=="undefined"){delete r[t]}}};var k=class{static restore(t,e){this.targets.set(t,e)}static getTarget(t){if(!this.targets.has(t)){this.targets.set(t,new ht(t))}return this.targets.get(t)}static getActionState(t,e){const r=this.getTarget(t);return r.get(e)}static add(t,e,r){const n=this.getTarget(t);if(e){n.addAction(e,r)}return n}static addAction(t,e,r){return this.add(t,e,r)}static removeAction(t,e,r){this.off(t,e,r)}static on(t,e,r){const n=this.getTarget(t);if(e){return n.on(e,r)}return false}static off(t,e,r){this.remove(t,e,r)}static remove(t,e,r){const n=this.targets,i=n.get(t);if(!i){return}if(e){i.off(e,r);return}this.targets.delete(t)}static set(t,e,r){const n=this.getTarget(t);n.set(e,r)}};B(k,"targets",new Map);var ut=class{constructor(){this.events=[]}addEvents(t){const e=t.length;if(e<1){return false}t.forEach(r=>{this.on(...r)})}on(t,e,r,n){l.on(t,e,r,n);this.events.push({event:t,obj:e,callBack:r,capture:n})}off(t,e,r,n){l.off(t,e,r,n);let i,o=this.events;for(var a=0,c=o.length;a<c;a++){i=o[a];if(i.event===t&&i.obj===e){o.splice(a,1);break}}}set(){this.events.forEach(t=>{l.on(t.event,t.obj,t.callBack,t.capture)})}unset(){this.events.forEach(t=>{l.off(t.event,t.obj,t.callBack,t.capture)})}reset(){this.unset();this.events=[]}};var ft=class{constructor(t,e){this.remoteStates=[];const r=this.convertStates(e);this.addStatesToTarget(t,r)}addStates(t,e){const r=this.convertStates(e);this.addStatesToTarget(t,r)}createState(t,e,r,n){return{action:t,state:e,callBack:r,targetId:n,token:null}}convertStates(t){const e=[];for(var r in t){if(!Object.prototype.hasOwnProperty.call(t,r)){continue}if(r==="remotes"){this.setupRemoteStates(t[r],e);continue}var n=null,i=null,o=t[r];if(o&&typeof o==="object"){i=o.callBack;n=o.id||o.targetId;o=o.state}e.push(this.createState(r,o,i,n))}return e}setupRemoteStates(t,e){let r;for(var n=0,i=t.length;n<i;n++){r=t[n];if(!r){continue}for(var o in r){if(!Object.prototype.hasOwnProperty.call(r,o)||o==="id"){continue}var a=null,c=r[o],h=c!==null?c:void 0;if(h&&typeof h==="object"){a=h.callBack;h=h.state}e.push(this.createState(o,h,a,r.id))}}}removeRemoteStates(){const t=this.remoteStates;if(t){this.removeActions(t)}}removeActions(t){if(t.length<1){return}for(var e=0,r=t.length;e<r;e++){var n=t[e];k.remove(n.targetId,n.action,n.token)}}restore(t){k.restore();const e=this.remoteStates;if(!e){return}for(var r=0,n=e.length;r<n;r++){var i=e[r];i.token=this.bindRemoteState(t,i.action,i.targetId)}}bindRemoteState(t,e,r){const n=k.getTarget(r);return t.link(n,e)}addStatesToTarget(t,e){const r=this.remoteStates;for(var n=0,i=e.length;n<i;n++){var o=e[n],a=this.addAction(t,o);if(o.targetId){o.token=a;r.push(o)}}if(r.length<1){this.remoteStates=null}}addAction(t,e){let r,n=e.action;const i=e.targetId;if(i){r=this.bindRemoteState(t,n,i)}if(typeof e.state!=="undefined"){t.addAction(n,e.state)}const o=e.callBack;if(typeof o==="function"){t.on(n,o)}return r}};var Ue={class:"className",text:"textContent",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",celpadding:"cellPadding",useMap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"};var G=s=>{return Ue[s]||s};var Tt=s=>{if(typeof s==="string"&&s.substring(0,2)==="on"){return s.substring(2)}return s};var b=class{static create(t,e,r,n){const i=document.createElement(t);this.addAttributes(i,e);if(n===true){this.prepend(r,i)}else{this.append(r,i)}return i}static addAttributes(t,e){if(!e||typeof e!=="object"){return false}const r=e.type;if(typeof r!=="undefined"){d.setAttr(t,"type",r)}for(const[n,i]of Object.entries(e)){if(n==="innerHTML"){t.innerHTML=i}else if(n.indexOf("-")!==-1){d.setAttr(t,n,i)}else{this.addAttr(t,n,i)}}}static addHtml(t,e){if(typeof e==="undefined"||e===""){return this}const r=/(?:<[a-z][\s\S]*>)/i;if(r.test(e)){t.innerHTML=e}else{t.textContent=e}return this}static addAttr(t,e,r){if(r===""||!e){return}const n=typeof r;if(n==="function"){e=Tt(e);l.add(e,t,r)}else{const i=G(e);t[i]=r}}static createDocFragment(){return document.createDocumentFragment()}static createText(t,e){const r=document.createTextNode(t);if(e){this.append(e,r)}return r}static createComment(t,e){const r=document.createComment(t);if(e){this.append(e,r)}return r}static setupSelectOptions(t,e,r){if(!u.isObject(t)){return false}if(!u.isArray(e)){return false}e.forEach(n=>{const i=new Option(n.label,n.value);t.options.add(i);if(r!==null&&i.value==r){i.selected=true}})}static removeElementData(t){const e=t.childNodes;if(e){const o=e.length-1;for(var r=o;r>=0;r--){var n=e[r];if(!n){continue}this.removeElementData(n)}}f.remove(t);const i=t.bindId;if(i){y.unbind(t)}}static removeElement(t){let e;if(!t||!(e=t.parentNode)){return this}this.removeElementData(t);e.removeChild(t);return this}static removeChild(t){this.removeElement(t);return this}static removeAll(t){if(!u.isObject(t)){return this}const e=t.childNodes;for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r)){this.removeElementData(e[r])}}t.innerHTML="";return this}static changeParent(t,e){e.appendChild(t);return this}static append(t,e){t.appendChild(e);return this}static prepend(t,e,r){const n=r||t.firstChild;t.insertBefore(e,n);return this}static clone(t,e=false){if(!u.isObject(t)){return false}return t.cloneNode(e)}};var We=s=>{if(typeof s!=="string"){return s}return $t(s)};var $t=s=>{return[{tag:"text",textContent:s}]};var Kt=s=>{if(!s){return{props:{},children:[]}}const t=s[0];if(typeof t==="string"){return{props:{},children:$t(t)}}if(Array.isArray(t)){return{props:{},children:t}}return{props:t||{},children:We(s[1])}};f.addType("components",s=>{if(!s){return}const t=s.component;if(t&&t.rendered===true){t.prepareDestroy()}});var je=0;var R=class{constructor(...t){this.isUnit=true;this.init();const{props:e,children:r}=Kt(t);this.setupProps(e);this.children??=r;this.onCreated();this.rendered=false;this.container=null}init(){this.id="cp-"+je++}setupProps(t){if(!t||typeof t!=="object"){return}for(var e in t){if(Object.prototype.hasOwnProperty.call(t,e)){this[e]=t[e]}}}getParentContext(){if(!this.parent){return null}return this.parent.getContext()}setupContext(){const t=this.getParentContext();const e=this.setContext(t);if(e){this.context=e;return}this.context=t;this.setupAddingContext()}setupAddingContext(){const t=this.context;const e=this.addContext(t);if(!e){return}const r=e[0];if(!r){return}this.addingContext=true;this.contextBranchName=r;this.addContextBranch(r,e[1])}addContextBranch(t,e){this.context=this.context||{};this.context[t]=e}setContext(t){return null}addContext(t){return null}removeContext(){if(!this.addingContext){return}this.removeContextBranch(this.contextBranchName)}removeContextBranch(t){if(!t){return}delete this.context[t]}getContext(){return this.context}onCreated(){}render(){return{}}_cacheRoot(t){if(!t){return t}if(!t.id){t.id=this.getId()}t.cache="panel";return t}_createLayout(){if(this.persist){return this._layout||(this._layout=this.render())}return this.render()}prepareLayout(){const t=this._createLayout();return this._cacheRoot(t)}afterBuild(){f.add(this.panel,"components",{component:this});this.rendered=true;this.afterLayout()}afterLayout(){this.afterSetup()}if(t,e){return!t?null:e||t}map(t,e){const r=[];if(!t||t.length<1){return r}for(var n=0,i=t.length;n<i;n++){const o=e(t[n],n);r.push(o)}return r}removeAll(t){return b.removeAll(t)}getId(t){let e=this.id;if(typeof t==="string"){e+="-"+t}return e}initialize(){this.setupContext();this.beforeSetup()}beforeSetup(){}afterSetup(){}setup(t){this.container=t;this.initialize()}remove(){this.prepareDestroy();this.removeContext();const t=this.panel||this.id;b.removeElement(t)}prepareDestroy(){this.rendered=false;this.beforeDestroy()}beforeDestroy(){}destroy(){this.remove()}};var M=class extends R{constructor(...t){super(...t);this.isComponent=true;this.stateTargetId=null}initialize(){this.setupContext();this.addStates();this.beforeSetup()}afterLayout(){this.addEvents();this.afterSetup()}setupStateTarget(t){const e=t||this.stateTargetId||this.id;this.state=k.getTarget(e)}setupStates(){return{}}addStates(){const t=this.state;if(t){this.stateHelper.restore(t);return}const e=this.setupStates();if(m.isEmpty(e)){return}this.setupStateTarget();this.stateHelper=new ft(this.state,e)}removeStates(){const t=this.state;if(!t){return false}this.stateHelper.removeRemoteStates();k.remove()}setupEventHelper(){if(!this.events){this.events=new ut}}setupEvents(){return[]}addEvents(){const t=this.setupEvents();if(t.length<1){return false}this.setupEventHelper();this.events.addEvents(t)}removeEvents(){const t=this.events;if(t){t.reset()}}prepareDestroy(){this.rendered=false;this.beforeDestroy();this.removeEvents();this.removeStates();this.removeContext();if(this.data&&this.persist===false){this.data.unlink()}}};var Fe={created:"onCreated",state:"setupStates",events:"setupEevents",before:"beforeSetup",render:"render",after:"afterSetup",destroy:"beforeDestroy"};var Ve=s=>{const t=typeof s;return t==="function"?s:function(){return s}};var Je=s=>{const t={};if(!s){return t}for(var e in s){if(!Object.prototype.hasOwnProperty.call(s,e)){continue}const r=s[e];const n=Fe[e];if(n){t[n]=Ve(r);continue}t[e]=r}return t};var ze=s=>{class t extends M{}Object.assign(t.prototype,s);return t};var Xt=s=>{class t extends R{}Object.assign(t.prototype,s);return t};var N=function(s){if(!s){return null}let t;switch(typeof s){case"object":if(s.render){t=Je(s);return ze(t)}t={render(){return s}};return Xt(t);case"function":t={render:s};return Xt(t)}};var Ye={monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],getDayName(s=new Date().getDay(),t=false){const e=this.dayNames;if(s>e.length){return false}const r=e[s];return t?r.substring(0,3):r},convertJsMonth(s){return this.padNumber(s+1)},convertDate(s,t){s=s?s.replace(/\s/,"T"):"";const e=new Date(s),r=t===true?" "+e.getFullYear():"";return this.getDayName(e.getDay())+", "+this.getMonthName(e.getMonth(),true)+" "+this.padNumber(e.getDate())+r},padNumber(s){return s<=9?"0"+s:String(s)},createDate(s){if(!s){return new Date}if(typeof s==="string"&&s.indexOf("-")>-1){s=s.replace(/\s/,"T");s=s.indexOf(":")>-1?s:s+"T00:00:00"}return new Date(s)},format(s,t){const e=this.createDate(t);switch(s){case"sql":t=e.getFullYear()+"-"+this.convertJsMonth(e.getMonth())+"-"+this.padNumber(e.getDate());break;default:t=this.convertJsMonth(e.getMonth())+"/"+this.padNumber(e.getDate())+"/"+e.getFullYear();break}return t},formatTime(s,t){const e=this.createDate(s);if(t===24){return this.padNumber(e.getHours())+":"+this.padNumber(e.getMinutes())+":"+this.padNumber(e.getSeconds())}let r=e.getHours(),n="AM";if(r>=12){n="PM"}if(r>12){r=r-12}return r+":"+this.padNumber(e.getMinutes())+" "+n},leapYear(s){return s%400===0||s%100!==0&&s%4===0},getMonthName(s=new Date().getMonth(),t=false){const e=this.monthNames;if(s>e.length){return false}const r=e[s];if(!r){return false}return t?r.substring(0,3):r},getMonthLength(s,t){const e=new Date;s=typeof s!=="undefined"?s:e.getMonth();t=typeof t!=="undefined"?t:e.getFullYear();const r=this.getMonthsLength(t);return r[s]},getMonthsLength(s=new Date().getFullYear()){const t=this.leapYear(s);const e=t===true?[31,29,31,30,31,30,31,31,30,31,30,31]:[31,28,31,30,31,30,31,31,30,31,30,31];return e},getDiffFromNow(s,t){s=s.replace(/\s/,"T");s=new Date(s);const e=new Date;if(t===true){e.setHours(0,0,0,0)}let r=e.getTime()-s.getTime();return r},getAge(s){const t=this.getDiffFromNow(s);let e="",r="";switch(true){case t<864e5:e="1 day";break;case t<6048e5:r=this.toDays(t);e=r+" days";break;case t<12096e5:e="1 week";break;case t<2592e6:r=this.toDays(t);var n=Math.floor(r/7);e=n+" weeks";break;case t<5184e6:e="1 month";break;case t<31104e6:var i=this.toMonths(t);e=i+" months";break;default:var o=this.toYears(t);e=o}return e},getTimeFrame(s){const t=this.getDiffFromNow(s);return this.convertToEstimate(t)},convertToEstimate(s){let t="";let e,r,n,i,o,a,c;if(s<=0){switch(true){case s<-63072e6:n=this.toYears(Math.abs(s));t="in "+n+" years";break;case s<-31536e6:t="in a year";break;case s<-5184e6:i=this.toMonths(Math.abs(s));t="in "+i+" months";break;case s<-2592e6:t="in a month";break;case s<-12096e5:e=this.toDays(Math.abs(s)),r=Math.floor(e/7);t="in "+r+" weeks";break;case s<-6048e5:t="in a week";break;case s<-1728e5:e=this.toDays(Math.abs(s));t="in "+e+" days";break;case s<-864e5:t="tomorrow";break;case s<-72e5:o=this.toHours(Math.abs(s));t="in "+o+" hours";break;case s<=-36e5:t="in an hour";break;case s<-12e4:a=this.toMinutes(Math.abs(s));t="in "+a+" minutes";break;case s<-6e4:t="in a minute";break;case s<-2e3:c=this.toSeconds(Math.abs(s));t="in "+c+" seconds";break;case s<-1:t="in 1 second";break;default:t="now"}}else{switch(true){case s<1e3:t="1 second ago";break;case s<6e4:c=this.toSeconds(s);t=c+" seconds ago";break;case s<12e4:t="1 minute ago";break;case s<36e5:a=this.toMinutes(s);t=a+" minutes ago";break;case s<72e5:t="1 hour ago";break;case s<864e5:o=this.toHours(s);t=o+" hours ago";break;case s<1728e5:t="yesterday";break;case s<6048e5:e=this.toDays(s);t=e+" days ago";break;case s<12096e5:t="a week ago";break;case s<2592e6:e=this.toDays(s),r=Math.floor(e/7);t=r+" weeks ago";break;case s<5184e6:t="a month ago";break;case s<31536e6:i=this.toMonths(s);t=i+" months ago";break;case s<63072e6:t="a year ago";break;default:n=this.toYears(s);t=n+" years ago"}}return t},toYears(s){if(typeof s!=="number"){return false}return Math.floor(s/(1e3*60*60*24*365.26))},toMonths(s){if(typeof s==="number"){return Math.floor(s/(1e3*60*60*24*30))}return false},toDays(s){if(typeof s!=="number"){return false}return Math.floor(s/(60*60*1e3*24)*1)},toHours(s){if(typeof s!=="number"){return false}return Math.floor(s%(60*60*1e3*24)/(60*60*1e3)*1)},toMinutes(s){if(typeof s!=="number"){return false}return Math.floor(s%(60*60*1e3*24)%(60*60*1e3)/(60*1e3)*1)},toSeconds(s){if(typeof s!=="number"){return false}return Math.floor(s%(60*60*1e3*24)%(60*60*1e3)%(60*1e3)/1e3*1)},getDifference(s,t){const e=new Date(s),r=new Date(t),n=r.getTime()-e.getTime();return{years:this.toYears(n),days:this.toDays(n),hours:this.toHours(n),minutes:this.toMinutes(n),seconds:this.toSeconds(n)}}};var Gt=(s,t)=>{return{name:s,callBack:t}};var F={keys:[],items:{},add(s,t){this.keys.push(s);this.items[s]=Gt(s,t);return this},get(s){return this.items[s]||null},all(){return this.keys}};var Et=(s,t)=>{return{attr:s,directive:t}};var V=(s,t)=>{return{key:s,value:t}};var Qt=(s,t,e,r)=>{return{tag:s,attr:t,directives:e,children:r}};var J=class{static getTag(t){return t.tag||"div"}static setupChildren(t){if(t.nest){t.children=t.nest;delete t.nest}}static setElementContent(t,e,r,n){if(t==="text"){n.push({tag:"text",textContent:e});return true}if(t==="html"||t==="innerHTML"){r.push(V("innerHTML",e));return true}return false}static setTextAsWatcher(t,e,r){r={attr:G(e),value:r};t.push(Et(V(e,r),F.get("watch")))}static setButtonType(t,e,r){if(t==="button"){const n=e.type||"button";r.push(V("type",n))}}static parse(t,e){const r=[],n=[],i=this.getTag(t);this.setButtonType(i,t,r);this.setupChildren(t);let o=[];var a,c;for(var h in t){if(!m.hasOwnProp(t,h)||h==="tag"){continue}a=t[h];if(a===void 0||a===null){continue}if((c=F.get(h))!==null){n.push(Et(V(h,a),c));continue}const p=typeof a;if(p==="object"){if(h==="children"){o=o.concat(a);continue}if(P.isWatching(a)){this.setTextAsWatcher(n,h,a);continue}o.push(a);continue}if(p==="function"){const v=a;a=function(E){v.call(this,E,e)}}if(P.isWatching(a)){this.setTextAsWatcher(n,h,a);continue}if(this.setElementContent(h,a,r,o)){continue}r.push(V(h,a))}return Qt(i,r,n,o)}};var w=class extends b{static create(t,e,r,n){const i=document.createElement(t);this.addAttributes(i,e,n);r.appendChild(i);return i}static addAttributes(t,e,r){if(!e||e.length<1){return}e.forEach(n=>{const{key:i,value:o}=n;if(i==="innerHTML"){t.innerHTML=o;return}if(i.substr(4,1)==="-"){d.setAttr(t,i,o);return}this.addAttr(t,i,o,r)})}static addAttr(t,e,r,n){if(r===""||!e){return false}const i=typeof r;if(i==="function"){e=Tt(e);l.add(e,t,function(o){r.call(this,o,n)})}else{const o=G(e);t[o]=r}}static addContent(t,e){if(!e){return}if(e.textContent!==null){t.textContent=e.textContent}else if(e.innerHTML){t.innerHTML=e.innerHTML}}static append(t,e){t.appendChild(e)}};var z=class{createNode(t,e,r){}};var lt=class extends z{createNode(t,e,r){const n=t.tag;if(n==="text"){const i=t.attr[0];const o=i?i.value:"";return w.createText(o,e)}else if(n==="comment"){const i=t.attr[0];const o=i?i.value:"";return w.createComment(o,e)}return w.create(n,t.attr,e,r)}};var pt=class extends z{createNode(t,e,r){const n=t.tag;if(n==="text"){const i=t.attr[0];const o=i?i.value:""}else if(n==="comment"){const i=t.attr[0];const o=i?i.value:""}}};var dt=class{static browserIsSupported(){return window}static setup(){if(this.browserIsSupported()){return new lt}return new pt}};var qe=dt.setup();var g=class{static render(t,e,r){if(!t){return null}if(typeof t==="object"&&t.isUnit===true){this.createComponent(t,e,r);return t}const n=N(t);const i=new n;this.createComponent(i,e,r);return i}static build(t,e,r){const n=w.createDocFragment();const i=Array.isArray(t)?t:[t];i.forEach(o=>this.buildElement(o,n,r));if(e&&typeof e==="object"){e.appendChild(n)}return n}static rebuild(t,e,r){w.removeAll(e);return this.build(t,e,r)}static buildElement(t,e,r){if(!t){return}if(t.isUnit===true){this.createComponent(t,e,r);return}this.createElement(t,e,r)}static createElement(t,e,r){const n=J.parse(t,r),i=this.createNode(n,e,r);this.cache(i,t.cache,r);n.children.forEach(a=>{if(a!==null){this.buildElement(a,i,r)}});const o=n.directives;if(o&&o.length){this.setDirectives(i,o,r)}}static setDirectives(t,e,r){e.forEach(n=>{this.handleDirective(t,n,r)})}static handleDirective(t,e,r){e.directive.callBack(t,e.attr.value,r)}static cache(t,e,r){if(r&&e){r[e]=t}}static createComponent(t,e,r){const n=t;n.parent=r;if(r&&r.persist===true&&n.persist!==false){n.persist=true}if(n.cache&&r){r[n.cache]=n}n.setup(e);const i=n.prepareLayout();this.build(i,n.container,n);n.afterBuild();if(t.component&&typeof t.onCreated==="function"){t.onCreated(n)}}static createNode(t,e,r){return qe.createNode(t,e,r)}};S.augment({buildLayout(s,t,e){g.build(s,t,e)}});var Pt=[];var $e=s=>Pt.indexOf(s)!==-1;var Ke=s=>({tag:"script",src:s.src,async:false,load(t){Pt.push(s.src);const e=s.load;if(e){e()}}});var Xe=s=>({tag:"link",rel:"stylesheet",type:"text/css",href:s.src,load(t){Pt.push(s.src);const e=s.load;if(e){e()}}});var Ot=class{constructor(t){this.percent=0;this.loaded=0;this.total=0;this.callBack=t||null}add(t){this.total++;let e;const r=this.update.bind(this);if(t.indexOf(".css")!==-1){e=Xe({load:r,src:t})}else{e=Ke({load:r,src:t})}g.build(e,document.head)}addFiles(t){if(!t){return}t.forEach(e=>{if(!$e(e)){this.add(e)}})}update(){const t=this.updateProgress();if(t<100){return}const e=this.callBack;if(e){e()}}updateProgress(){++this.loaded;return this.percent=Math.floor(this.loaded/this.total*100)}};var Ge=(s,t)=>{import(s).then(e=>{if(t){t(e)}})};var Qe=s=>{if(!s){return false}return typeof s?.prototype?.constructor==="function"};var Ze=(s,t,e)=>{const r=g.build(s,null,e);const n=r.firstChild;t.after(r);return n};var tr=s=>({tag:"comment",textContent:"import placeholder",onCreated:s.onCreated});var er=N({render(){return tr({onCreated:s=>{const t=this.src;if(!t){return}if(this.depends){const e=new Ot(()=>{this.loadAndRender(s)});e.addFiles(this.depends);return}this.loadAndRender(s)}})},getLayout(s){let t=s.default;if(!t){return null}const e=this.callBack;if(e){t=e(t)}else{if(Qe(t)){t=new t;t.route=this.route;if(this.persist){t.persist=true}}else{t=t()}}return this.layout=t},loadAndRender(s){Ge(this.src,t=>{this.loaded=true;const e=this.layout||this.getLayout(t);this.layoutRoot=Ze(e,s,this.parent)})},shouldUpdate(s){if(this.updateLayout===true){return true}return this.updateLayout=s&&s.isUnit&&typeof s.update==="function"},updateModuleLayout(s){const t=this.layout;if(this.shouldUpdate(t)){t.update(s)}},update(s){if(this.loaded===true){this.updateModuleLayout(s)}},beforeDestroy(){if(!this.layoutRoot){return}b.removeElement(this.layoutRoot)}});var Mt=s=>{return new er(s)};var Q=(s,t,e,r)=>{let n,i,o;if(Array.isArray(e[0])){e.forEach(a=>{if(!a){return}Q(s,t,a,r)});return}if(e.length<3){[n,i]=e}else{[t,n,i]=e}if(!t||!n){return false}switch(typeof i){case"object":o=a=>{nr(s,i,a)};break;case"function":o=a=>{rr(s,i,n,a,r)};break}y.watch(s,t,n,o)};var rr=(s,t,e,r,n)=>{let i=t(r,s,n);switch(typeof i){case"object":if(n&&i&&i.isUnit===true&&n.persist===true&&n.state){let o=e+":"+r,a=n.state,c=a.get(o);if(typeof c!=="undefined"){i=c}a.set(o,i)}sr(i,s,n);break;case"string":b.addHtml(s,i);break}};var sr=(s,t,e)=>{g.rebuild(s,t,e)};var nr=(s,t,e)=>{for(const[r,n]of Object.entries(t)){if(!r){continue}if(n===e){d.addClass(s,r)}else{d.removeClass(s,r)}}};var _=s=>{if(s.data){return s.data}if(s.context&&s.context.data){return s.context.data}return null};var mt=(s,t,e)=>{const r=_(e);Q(s,r,t,e)};var Zt=(s,t,e)=>{if(!t){return}if(t){d.setAttr(s,"role",t)}};var ir=s=>{return(t,e)=>{const r=e?"true":"false";d.setAttr(t,s,r)}};var te=(s,t,e)=>{if(!t){return}const r=t.role;if(r){d.setAttr(s,"role",r);t.role=null}Object.entries(t).forEach(([n,i])=>{if(i===null){return}const o=`aria-${n}`;if(Array.isArray(i)){i.push(ir(o));mt(s,i,e)}else{d.setAttr(s,o,i)}})};f.addType("context",s=>{if(!s){return false}s.parent.removeContextBranch(s.branch)});var Bt=s=>{return!s?null:s.getContext()};var ee=(s,t,e)=>{if(typeof t!=="function"){return}const r=Bt(e);const n=t(r);if(!n){return}const i=J.parse(n,e);w.addAttributes(s,i.attr,e);g.setDirectives(s,i.directives,e)};var re=(s,t,e)=>{if(typeof t!=="function"){return}const r=Bt(e);t(r)};var se=(s,t,e)=>{if(typeof t!=="function"||!e){return}const r=Bt(e);const n=t(r);if(!n){return}e.addContextBranch(n[0],n[1])};var ne=(s,t,e)=>{};var ie=(s,t,e)=>{if(!t||!e){return false}t(e,s)};var oe=(s,t,e)=>{if(!t||!e){return false}t(e.data,s)};var ae=(s,t,e)=>{if(!t||!e){return false}t(e.state,s)};var ce=(s,t,e)=>{if(!t||!e){return false}if(e.stateHelper){const r=e.state;const n=t(r);e.stateHelper.addStates(n)}};var he=(s,t,e)=>{let r,n,i;if(typeof t==="string"){r=_(e);n=t}else if(Array.isArray(t)){if(typeof t[0]!=="object"){const o=_(e);t.unshift(o)}[r,n,i]=t}y.bind(s,r,n,i)};var ue=(s,t,e)=>{let r,n,i,o;if(t.length<3){const c=_(e);if(!c){return}r=c;n=t[0];i=t[1];o=t[2]}else{r=t[0];n=t[1];i=t[2];o=t[3]}const a=o!==false;y.watch(s,r,n,c=>{b.removeAll(s);if(!c||c.length<1){return}const h=[];c.forEach((p,v)=>{const E=a?r.scope(n+"["+v+"]"):null;const q=p(c[v],v,E);if(q===null){return}h.push(q)});return g.build(h,s,e)})};var fe=(s,t,e)=>{const r=t[0];if(!r||r.length<1){return}const n=t[1];const i=[];r.forEach((o,a)=>{if(!o){return}const c=n(o,a);if(c===null){return}i.push(c)});return g.build(i,s,e)};var le=(s,t,e)=>{t(s)};f.addType("destroyed",s=>{if(!s){return false}s.callBack(s.ele)});var pe=(s,t,e)=>{or(s,t)};var or=(s,t)=>{f.add(s,"destroyed",{ele:s,callBack:t})};var de=(s,t,e)=>{Q(s,e.state,t,e)};var me=(s,t,e)=>{if(!t){return false}if(Array.isArray(t)&&typeof t[0]!=="string"){for(var r=0,n=t.length;r<n;r++){P.setup(s,t[r],e)}}else{P.setup(s,t,e)}};var ar=0;var Y=class{constructor(t){this.router=t;this.locationId="base-app-router-"+ar++;this.callBack=this.check.bind(this)}setup(){this.addEvent();return this}};var gt=class extends Y{addEvent(){l.on("popstate",window,this.callBack);return this}removeEvent(){l.off("popstate",window,this.callBack);return this}check(t){const e=t.state;if(!e||e.location!==this.locationId){return false}t.preventDefault();t.stopPropagation();this.router.checkActiveRoutes(e.uri)}createState(t,e={}){return{location:this.locationId,...e,uri:t}}addState(t,e,r=false){const n=window.history,i=n.state;if(i&&i.uri===t){return this}const o=this.createState(t,e);const a=r===false?"pushState":"replaceState";n[a](o,null,t);return this}};var yt=class extends Y{addEvent(){l.on("hashchange",window,this.callBack);return this}removeEvent(){l.off("hashchange",window,this.callBack);return this}check(t){this.router.checkActiveRoutes(t.newURL)}addState(t,e,r){window.location.hash=t;return this}};var bt=class{static browserIsSupported(){return"history"in window&&"pushState"in window.history}static setup(t){if(this.browserIsSupported()){return new gt(t).setup()}return new yt(t).setup()}};var xt=class{constructor(t,e){this.route=t;this.template=e.component;this.component=null;this.hasTemplate=false;this.setup=false;this.container=e.container;this.persist=e.persist;this.parent=e.parent;this.setupTemplate()}focus(t){if(this.setup===false){this.create()}this.update(t)}setupTemplate(){let t=this.template;if(typeof t==="string"){t=this.template=window[t];if(!t){return}}const e=typeof t;if(e==="function"){this.initializeComponent()}else if(e==="object"){this.initializeTemplateObject()}this.hasTemplate=true}initializeComponent(){this.component=new this.template({route:this.route,persist:this.persist,parent:this.parent})}initializeTemplateObject(){if(!this.template.isUnit){this.template=N(this.template)}const t=this.template;this.persist=t.persist!==false;Object.assign(t,{route:this.route,persist:this.persist,parent:this.parent});this.component=t}create(){if(!this.hasTemplate){return false}this.setup=true;let t=this.component;if(!this.persist||!t){t=this.component=this.template}g.render(t,this.container,this.parent)}remove(){if(this.setup!==true){return false}this.setup=false;const t=this.component;if(!t){return false}if(typeof t.destroy==="function"){t.destroy()}if(this.persist===false){this.component=null}}update(t){const e=this.component;if(!e){return false}if(typeof e.update==="function"){e.update(t)}}};var ge=s=>{if(!s.length){return null}const t={};s.forEach(e=>{t[e]=null});return t};var ye=s=>{const t=[];if(!s){return t}const e=/[*?]/g;s=s.replace(e,"");const r=/:(.[^./?&($]+)\?*/g,n=s.match(r);if(n===null){return t}n.forEach(i=>{if(i){i=i.replace(":","");t.push(i)}});return t};var cr=s=>s.replace(/\//g,"/");var hr=s=>{return s.replace(/(\/):[^/(]*?\?/g,t=>t.replace(/\//g,"(?:$|/)"))};var ur=s=>{s=s.replace(/(\?\/+\*?)/g,"?/*");return s.replace(/(:[^/?&($]+)/g,t=>t.indexOf(".")<0?"([^/|?]+)":"([^/|?]+.*)")};var fr=s=>s.replace(/(\*)/g,".*");var lr=(s,t)=>s+=t[t.length-1]==="*"?"":"$";var be=s=>{if(!s){return""}let t=cr(s);t=hr(t);t=ur(t);t=fr(t);t=lr(t,s);return t};var pr=0;var vt=class extends T{uriQuery=null;controller=null;paramKeys=null;titleCallBack=null;path=null;referralPath=null;params=null;callBack=null;title=null;constructor(t,e){const r=t.baseUri;const n=ye(r);const i=ge(n);const o=super(i);this.uri=r;this.paramKeys=n;this.titleCallBack=e;this.setupRoute(t);this.set("active",false);return o}setupRoute(t){this.id=t.id||"bs-rte-"+pr++;this.path=null;this.referralPath=null;let e=be(this.uri);this.uriQuery=new RegExp("^"+e);this.params=null;this.setupComponentHelper(t);this.callBack=t.callBack;this.title=t.title}setTitle(t){this.titleCallBack(this,t)}deactivate(){this.set("active",false);const t=this.controller;if(t){t.remove()}}getLayout(t){if(t.component){return t.component}let e=t.import;if(!e){return null}if(typeof e==="string"){e={src:e}}return Mt(e)}setupComponentHelper(t){const e=this.getLayout(t);if(!e){return}const{container:r,persist:n=false,parent:i}=t;const o={component:e,container:r,persist:n,parent:i};this.controller=new xt(this,o)}resume(t){const e=this.controller;if(e){e.container=t}}setPath(t,e){this.path=t;this.referralPath=e}select(){this.set("active",true);const t=this.stage,e=this.callBack;if(typeof e==="function"){e(t)}const r=this.controller;if(r){r.focus(t)}const n=this.path;if(!n){return}const i=n.split("#")[1];if(!i){return}this.scrollToId(i)}scrollToId(t){if(!t){return}const e=document.getElementById(t);if(!e){return}e.scrollIntoView(true)}match(t){let e=false;const r=t.match(this.uriQuery);if(r===null){this.resetParams();return e}if(!Array.isArray(r)){return e}r.shift();e=r;this.setParams(r);return e}resetParams(){this.stage={}}setParams(t){if(!Array.isArray(t)){return}const e=this.paramKeys;if(!e){return}const r={};e.forEach((n,i)=>{if(typeof n!=="undefined"){r[n]=t[i]}});this.set(r)}getParams(){return this.stage}};var dr=s=>{const t=/\w\S*/;return s.replace(t,e=>{return e.charAt(0).toUpperCase()+e.substring(1).toLowerCase()})};var mr=(s,t)=>{if(s.indexOf(":")===-1){return s}const e=t.stage;for(const[r,n]of Object.entries(e)){const i=new RegExp(":"+r,"gi");s=s.replace(i,n)}return s};var xe=(s,t,e)=>{if(!t){return t}if(typeof t==="function"){t=t(s.stage)}t=mr(t,s);t=dr(t);if(e!==""){t+=" - "+e}return t};var ve={removeSlashes(s){if(typeof s!=="string"){return""}if(s.substring(0,1)==="/"){s=s.substring(1)}if(s.substring(-1)==="/"){s=s.substring(0,s.length-1)}return s}};var kt=class extends M{beforeSetup(){this.selectedClass=this.activeClass||"active"}render(){const t=this.href,e=this.text,r=this.setupWatchers(t,e);return{tag:"a",class:this.class||this.className||null,onState:["selected",{[this.selectedClass]:true}],href:this.getString(t),text:this.getString(e),nest:this.nest||this.children,watch:r}}getString(t){const e=typeof t;return e!=="object"&&e!=="undefined"?t:null}setupWatchers(t,e){const r=this.exact!==false,n=D.data;const i=[];if(t&&typeof t==="object"){i.push({attr:"href",value:t})}if(e&&typeof e==="object"){i.push({attr:"text",value:e})}i.push({value:["[[path]]",n],callBack:(o,a)=>{const c=a.pathname+a.hash;const h=r?o===c:new RegExp("^"+a.pathname+"($|#|/|\\.).*").test(o);this.update(h)}});return i}setupStates(){return{selected:false}}update(t){this.state.set("selected",t)}};f.addType("routes",s=>{if(!s){return false}const t=s.route;if(t){D.removeRoute(t)}});f.addType("switch",s=>{if(!s){return false}const t=s.id;D.removeSwitch(t)});var Lt=class{constructor(){this.version="1.0.2";this.baseURI="/";this.title="";this.lastPath=null;this.path=null;this.history=null;this.callBackLink=null;this.location=window.location;this.routes=[];this.switches={};this.switchCount=0;this.data=new C({path:""})}setupHistory(){this.history=bt.setup(this)}createRoute(t){const e=t.uri||"*";t.baseUri=this.createURI(e);return new vt(t,this.updateTitle.bind(this))}add(t){if(typeof t!=="object"){const r=arguments;t={uri:r[0],component:r[1],callBack:r[2],title:r[3],id:r[4],container:r[5]}}const e=this.createRoute(t);this.addRoute(e);return e}addRoute(t){this.routes.push(t);this.checkRoute(t,this.getPath())}resume(t,e){t.resume(e);this.addRoute(t)}getBasePath(){if(!this.basePath){let t=this.baseURI||"";if(t[t.length-1]!=="/"){t+="/"}this.basePath=t}return this.basePath}createURI(t){const e=this.getBasePath();return e+ve.removeSlashes(t)}getRoute(t){const e=this.routes,r=e.length;if(r>0){for(var n=0;n<r;n++){var i=e[n];if(i.uri===t){return i}}}return false}getRouteById(t){const e=this.routes,r=e.length;if(r>0){for(var n=0;n<r;n++){var i=e[n];if(i.id===t){return i}}}return false}removeRoute(t){const e=this.routes,r=e.indexOf(t);if(r>-1){e.splice(r,1)}}addSwitch(t){const e=this.switchCount++;const r=this.getSwitchGroup(e);t.forEach(n=>{const i=this.createRoute(n);r.push(i)});this.checkGroup(r,this.getPath());return e}resumeSwitch(t,e){const r=this.switchCount++;const n=this.getSwitchGroup(r);t.forEach(i=>{const o=i.component.route;o.resume(e);n.push(o)});this.checkGroup(n,this.getPath());return r}getSwitchGroup(t){return this.switches[t]=[]}removeSwitch(t){const e=this.switches;if(e[t]){delete e[t]}}remove(t){t=this.createURI(t);const e=this.getRoute(t);if(e!==false){this.removeRoute(e)}return this}setup(t,e){this.baseURI=t||"/";this.updateBaseTag(this.baseURI);this.title=typeof e!=="undefined"?e:"";this.setupHistory();this.data.path=this.getPath();this.callBackLink=this.checkLink.bind(this);l.on("click",document,this.callBackLink);const r=this.getEndPoint();this.navigate(r,null,true);return this}updateBaseTag(t){const e=document.getElementsByTagName("base");if(e.length){e[0].href=t}}getParentLink(t){let e=t.parentNode;while(e!==null){if(e.nodeName.toLowerCase()==="a"){return e}e=e.parentNode}return false}checkLink(t){if(t.ctrlKey===true){return true}let e=t.target||t.srcElement;if(e.nodeName.toLowerCase()!=="a"){e=this.getParentLink(e);if(e===false){return true}}if(e.target==="_blank"||d.data(e,"cancel-route")){return true}const r=e.getAttribute("href");if(typeof r!=="undefined"){const n=this.baseURI,i=n!=="/"?r.replace(n,""):r;this.navigate(i);t.preventDefault();t.stopPropagation();return false}}reset(){this.routes=[];this.switches=[];this.switchCount=0;return this}activate(){this.checkActiveRoutes();return this}navigate(t,e,r){t=this.createURI(t);this.history.addState(t,e,r);this.activate();return this}updatePath(){const t=this.getPath();this.data.path=t}updateTitle(t){if(!t||!t.title){return this}const e=t.title;document.title=xe(t,e,this.title)}checkActiveRoutes(t){this.lastPath=this.path;t=t||this.getPath();this.path=t;const e=this.routes,r=e.length;let n;for(var i=0;i<r;i++){n=e[i];if(typeof n==="undefined"){continue}this.checkRoute(n,t)}this.checkSwitches(t);this.updatePath()}checkSwitches(t){const e=this.switches;for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r)){continue}var n=e[r];this.checkGroup(n,t)}}checkGroup(t,e){let r=false,n,i,o,a,c=false;for(var h=0,p=t.length;h<p;h++){n=t[h];if(typeof n==="undefined"){continue}if(h===0){i=n}if(!o&&n.get("active")){o=n}if(r!==false){if(c){n.deactivate()}continue}r=n.match(e);if(r!==false){a=n;if(n.controller){this.select(n);c=true}}}if(a===void 0){this.select(i);if(o&&i!==o){o.deactivate()}return}if(o){if(c&&a!==o){o.deactivate()}}else if(i&&c===false){this.select(i)}}checkRoute(t,e){const r=this.check(t,e);if(r!==false){this.select(t)}else{t.deactivate()}return r}check(t,e){if(!t){return false}e=e||this.getPath();return t.match(e)!==false}select(t){if(!t){return}t.setPath(this.path,this.lastPath);t.select();this.updateTitle(t)}getEndPoint(){const t=this.getPath();return t.replace(this.baseURI,"")||"/"}destroy(){l.off("click",document,this.callBackLink)}getPath(){let t=this.location,e=this.path=t.pathname;if(this.history.type==="hash"){return t.hash.replace("#","")}return e+t.search+t.hash}};var D=new Lt;var Ht=(s,t,e)=>{if(!t){return false}if(Array.isArray(t)){t.forEach(r=>{Ht(s,r,e)})}else{gr(s,t,e)}};var gr=(s,t,e)=>{t.container=s;t.parent=e;let r=D.add(t);yr(s,r)};var yr=(s,t)=>{f.add(s,"routes",{route:t})};var ke=(s,t,e)=>{let r=t[0];t.forEach(i=>{i.container=s;i.parent=e});const n=D.addSwitch(t);br(s,n)};var br=(s,t)=>{f.add(s,"switch",{id:t})};F.add("cache",ne).add("onCreated",le).add("onDestroyed",pe).add("bind",he).add("onSet",mt).add("onState",de).add("watch",me).add("useParent",ie).add("useData",oe).add("useState",ae).add("addState",ce).add("map",fe).add("for",ue).add("useContext",re).add("addContext",se).add("context",ee).add("role",Zt).add("aria",te).add("route",Ht).add("switch",ke);S.augment({Ajax:tt,Html:b,dataBinder:y,Data:C,SimpleData:T,Model:j,State:k,Builder:g,router:D,Component:M});export{tt as Ajax,O as Arrays,Be as Atom,g as Builder,M as Component,C as Data,f as DataTracker,Ye as DateTime,F as Directives,d as Dom,b as Html,Mt as Import,N as Jot,j as Model,kt as NavLink,m as Objects,T as SimpleData,k as State,x as Strings,u as Types,R as Unit,S as base,y as dataBinder,D as router};
|
|
1
|
+
var we=Object.defineProperty;var Se=(s,t,e)=>t in s?we(s,t,{enumerable:true,configurable:true,writable:true,value:e}):s[t]=e;var B=(s,t,e)=>{Se(s,typeof t!=="symbol"?t+"":t,e);return e};var O=class{static toArray(t){return Array.prototype.slice.call(t)}static inArray(t,e,r){if(!t||typeof t!=="object"){return-1}return t.indexOf(e,r)}};var u=class{static getType(t){const e=typeof t;if(e!=="object"){return e}return this.isArray(t)?"array":e}static isUndefined(t){return typeof t==="undefined"}static isObject(t){return t&&typeof t==="object"&&this.isArray(t)===false}static isFunction(t){return typeof t==="function"}static isString(t){return typeof t==="string"}static isArray(t){return Array.isArray(t)}};var m={create(s){return Object.create(s)},extendObject(s,t){if(typeof s==="undefined"||typeof t==="undefined"){return false}for(var e in s){if(this.hasOwnProp(s,e)&&typeof t[e]==="undefined"){t[e]=s[e]}}return t},clone(s){if(!s){return{}}return JSON.parse(JSON.stringify(s))},getClassObject(s){return typeof s==="function"?s.prototype:s},extendClass(s,t){const e=this.getClassObject(s),r=this.getClassObject(t);if(typeof e!=="object"||typeof r!=="object"){return false}const n=Object.create(e);for(var i in r){n[i]=r[i]}return n},hasOwnProp(s,t){return Object.prototype.hasOwnProperty.call(s,t)},isPlainObject(s){return Object.prototype.toString.call(s)==="[object Object]"},isEmpty(s){if(u.isObject(s)===false){return true}for(var t in s){if(this.hasOwnProp(s,t)){return false}}return true}};var $={types:{},add(s,t){this.types[s]=t},get(s){return this.types[s]||false},remove(s){delete this.types[s]}};var Z=class{constructor(){this.types=new Map}add(t,e){if(!this.types.has(t)){this.types.set(t,[])}this.types.get(t).push(e)}get(t){return this.types.get(t)||false}removeByCallBack(t,e){if(typeof t==="function"){t(e)}}removeType(t){if(!this.types.has(t)){return}const e=this.types.get(t);if(!e.length){return}let r,n=$.get(t);for(var i=0,o=e.length;i<o;i++){r=e[i];if(!r){continue}e[i]=null;this.removeByCallBack(n,r)}this.types.delete(t)}remove(t){if(t){this.removeType(t);return}this.types.forEach((e,r)=>{if(!r){return}this.removeType(r)});this.types.clear()}};var f=class{static addType(t,e){$.add(t,e)}static removeType(t){$.remove(t)}static getTrackingId(t){return t.trackingId||(t.trackingId=`dt${this.trackingCount++}`)}static add(t,e,r){const n=this.getTrackingId(t),i=this.find(n);i.add(e,r)}static get(t,e){const r=t.trackingId;const n=this.trackers.get(r);if(!n){return false}return e?n.get(e):n}static find(t){if(!this.trackers.has(t)){this.trackers.set(t,new Z)}return this.trackers.get(t)}static isEmpty(t){if(!t||typeof t!=="object"){return true}return t.size===0}static remove(t,e){const r=t.trackingId;if(!r||!this.trackers.has(r)){return true}const n=this.trackers.get(r);if(e){n.remove(e);if(this.isEmpty(n.types)){this.trackers.delete(r)}}else{n.remove();this.trackers.delete(r)}}};B(f,"trackers",new Map);B(f,"trackingCount",0);var wt=s=>{let t=0;for(let e of Object.entries(s)){t++;if(typeof s[e]==="object"){t+=wt(s[e])}}return t};var Rt=(s,t)=>{let e=false;if(typeof s!=="object"||typeof t!=="object"){return e}for(let[r,n]of Object.entries(s)){if(!m.hasOwnProp(t,r)){break}const i=t[r];if(typeof n!==typeof i){break}if(typeof n==="object"){e=Rt(n,i);if(e!==true){break}}else{if(n===i){e=true}else{break}}}return e};var De=(s,t)=>{const e=wt(s),r=wt(t);if(e!==r){return false}return Rt(s,t)};var Nt=(s,t)=>{const e=typeof s,r=typeof t;if(e!==r){return false}if(e==="object"){return De(s,t)}return s===t};var l={getEvents(s){if(u.isObject(s)===false){return false}return f.get(s,"events")},create(s,t,e,r=false,n=false,i=null){n=n===true;return{event:s,obj:t,fn:e,capture:r,swapped:n,originalFn:i}},on(s,t,e,r){if(Array.isArray(s)){let o;for(var n=0,i=s.length;n<i;n++){o=s[n];this.add(o,t,e,r)}}else{this.add(s,t,e,r)}return this},off(s,t,e,r){if(Array.isArray(s)){var n;for(var i=0,o=s.length;i<o;i++){n=s[i];this.remove(n,t,e,r)}}else{this.remove(s,t,e,r)}return this},add(s,t,e,r=false,n=false,i=null){if(u.isObject(t)===false){return this}const o=this.create(s,t,e,r,n,i);f.add(t,"events",o);t.addEventListener(s,e,r);return this},remove(s,t,e,r=false){const n=this.getEvent(s,t,e,r);if(n===false){return this}if(typeof n==="object"){this.removeEvent(n)}return this},removeEvent(s){if(typeof s==="object"){const t=s.obj;t.removeEventListener(s.event,s.fn,s.capture)}return this},getEvent(s,t,e,r){if(typeof t!=="object"){return false}const n=this.getEvents(t);if(!n||n.length<1){return false}const i=this.create(s,t,e,r);return this.search(i,n)},search(s,t){let e,r=this.isSwappable(s.event);for(var n=0,i=t.length;n<i;n++){e=t[n];if(e.event!==s.event||e.obj!==s.obj){continue}if(e.fn===s.fn||r===true&&e.originalFn===s.fn){return e}}return false},removeEvents(s){if(u.isObject(s)===false){return this}f.remove(s,"events");return this},swap:["DOMMouseScroll","wheel","mousewheel","mousemove","popstate"],addSwapped(s){this.swap.push(s)},isSwappable(s){return this.swap.includes(s)}};f.addType("events",s=>{l.removeEvent(s)});var _t={events:l,addListener(s,t,e,r){this.events.add(s,t,e,r);return this},on(s,t,e,r){const n=this.events;if(Array.isArray(s)){s.forEach(i=>{n.add(i,t,e,r)})}else{n.add(s,t,e,r)}return this},off(s,t,e,r){const n=this.events;if(Array.isArray(s)){s.forEach(i=>{n.remove(i,t,e,r)})}else{n.remove(s,t,e,r)}return this},removeListener(s,t,e,r){this.events.remove(s,t,e,r);return this},_createEvent(s,t,e,r){let n;if(t==="HTMLEvents"){n=new Event(s)}else if(t==="MouseEvents"){n=new MouseEvent(s,e)}else{n=new CustomEvent(s,r)}return n},createEvent(s,t,e,r){if(u.isObject(t)===false){return false}let n={pointerX:0,pointerY:0,button:0,view:window,detail:1,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:false,altKey:false,shiftKey:false,metaKey:false,bubbles:true,cancelable:true,relatedTarget:null};if(u.isObject(e)){n=Object.assign(n,e)}const i=this._getEventType(s);return this._createEvent(s,i,n,r)},_getEventType(s){const t={"HTMLEvents":/^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/,"MouseEvents":/^(?:click|dblclick|mouse(?:down|up|over|move|out))$/};let e="CustomEvent";for(const[r,n]of Object.entries(t)){if(s.match(n)){e=r;break}}return e},trigger(s,t,e){if(u.isObject(t)===false){return this}const r=typeof s==="string"?this.createEvent(s,t,null,e):s;t.dispatchEvent(r);return this},mouseWheelEventType:null,getWheelEventType(){const s=()=>{let t="wheel";if("onmousewheel"in self){t="mousewheel"}else if("DOMMouseScroll"in self){t="DOMMouseScroll"}return t};return this.mouseWheelEventType||(this.mouseWheelEventType=s())},onMouseWheel(s,t,e,r){if(typeof t==="undefined"){t=window}const n=o=>{const a=Math.max(-1,Math.min(1,-o.deltaY||o.wheelDelta||-o.detail));if(typeof s==="function"){s(a,o)}if(e===true){o.preventDefault()}};const i=this.getWheelEventType();this.events.add(i,t,n,r,true,s);return this},offMouseWheel(s,t,e){if(typeof t==="undefined"){t=window}const r=this.getWheelEventType();this.off(r,t,s,e);return this},preventDefault(s){if(typeof s.preventDefault==="function"){s.preventDefault()}else{s.returnValue=false}return this},stopPropagation(s){if(typeof s.stopPropagation==="function"){s.stopPropagation()}else{s.cancelBubble=true}return this}};var K=class{constructor(){this.version="3.0.10";this.errors=[];this.dataTracker=f}augment(t){if(!u.isObject(t)){return this}Object.entries(t).forEach(([e,r])=>{this.constructor.prototype[e]=r});return this}override(t,e,r,n){return(t[e]=r).apply(t,O.toArray(n))}getLastError(){const t=this.errors;return t.length?t.pop():false}addError(t){this.errors.push(t)}getProperty(t,e,r){if(u.isObject(t)===false){return""}const n=t[e];if(typeof n!=="undefined"){return n}return typeof r!=="undefined"?r:""}createCallBack(t,e,r=[],n=false){if(typeof e!=="function"){return false}return(...i)=>{if(n===true){r=r.concat(i)}return e.apply(t,r)}}bind(t,e){return e.bind(t)}};K.prototype.extend=function(){return K.prototype}();var S=new K;S.augment({...m,..._t,...u,equals:Nt});var x=class{static parseQueryString(t,e){if(typeof t!=="string"){t=window.location.search}const r={},n=/([^?=&]+)(=([^&]*))?/g;t.replace(n,function(i,o,a,c){r[o]=e!==false?decodeURIComponent(c):c});return r}static camelCase(t){if(typeof t!=="string"){return false}const e=/(-|\s|_)+\w{1}/g;return t.replace(e,r=>{return r[1].toUpperCase()})}static uncamelCase(t,e="-"){if(typeof t!=="string"){return false}const r=/([A-Z]{1,})/g;return t.replace(r,n=>{return e+n.toLowerCase()}).toLowerCase()}};var It={url:"",responseType:"json",method:"POST",fixedParams:"",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},beforeSend:[],async:true,crossDomain:false,withCredentials:false,completed:null,failed:null,aborted:null,progress:null};S.augment({xhrSettings:It,addFixedParams(s){this.xhrSettings.fixedParams=s},beforeSend(s){this.xhrSettings.beforeSend.push(s)},ajaxSettings(s){if(typeof s==="object"){this.xhrSettings=m.extendClass(S.xhrSettings,s)}},resetAjaxSettings(){this.xhrSettings=It}});var tt=(...s)=>{const t=new St(s);return t.xhr};var St=class{constructor(t){this.settings=null;this.xhr=null;this.setup(t)}setup(t){this.getXhrSettings(t);const e=this.xhr=this.createXHR();if(e===false){return false}const{method:r,url:n,async:i}=this.settings;e.open(r,n,i);this.setupHeaders();this.addXhrEvents();this.beforeSend();e.send(this.getParams())}beforeSend(){const t=S.xhrSettings.beforeSend;if(t.length<1){return}const e=this.xhr;const r=this.settings;for(var n=0,i=t.length;n<i;n++){var o=t[n];if(o){o(e,r)}}}objectToString(t){const e=[];for(var r in t){if(Object.prototype.hasOwnProperty.call(t,r)){e.push(r+"="+encodeURIComponent(t[r]))}}return e.join("&")}setupParams(t,e){const r=typeof t;if(!e){if(t instanceof FormData===false&&r==="object"){t=this.objectToString(t)}return t}const n=typeof e;if(r==="string"){if(n!=="string"){e=this.objectToString(e)}const o=t===""?"?":"&";t+=o+e;return t}if(n==="string"){e=x.parseQueryString(e,false)}if(t instanceof FormData){for(var i in e){if(Object.prototype.hasOwnProperty.call(e,i)){t.append(i,e[i])}}}else if(r==="object"){t=m.clone(t);t=Object.assign(e,t);t=this.objectToString(t)}return t}getParams(){const t=this.settings;const e=t.fixedParams;let r=t.params;if(r){r=this.setupParams(r,e)}else if(e){r=this.setupParams(e)}return r}getXhrSettings(t){let e=this.settings=Object.create(S.xhrSettings);if(t.length>=2&&typeof t[0]!=="object"){for(var r=0,n=t.length;r<n;r++){var i=t[r];switch(r){case 0:e.url=i;break;case 1:e.params=i;break;case 2:e.completed=i;e.failed=i;break;case 3:e.responseType=i||"json";break;case 4:e.method=i?i.toUpperCase():"POST";break;case 5:e.async=typeof i!=="undefined"?i:true;break}}}else{e=this.settings=m.extendClass(this.settings,t[0]);if(typeof e.completed==="function"){if(typeof e.failed!=="function"){e.failed=e.completed}if(typeof e.aborted!=="function"){e.aborted=e.failed}}}}createXHR(){const t=this.settings,e=new XMLHttpRequest;e.responseType=t.responseType;if(t.withCredentials===true){e.withCredentials=true}return e}setupHeaders(){const t=this.settings;if(!t&&typeof t.headers!=="object"){return}let e=t.headers;for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r)){this.xhr.setRequestHeader(r,e[r])}}}update(t,e){const r=this.xhr;const n=()=>{l.removeEvents(r.upload);l.removeEvents(r)};const i=this.settings;if(!i){return false}const o=e||t.type;switch(o){case"load":if(typeof i.completed==="function"){let a=this.getResponseData();i.completed(a,this.xhr)}n();break;case"error":if(typeof i.failed==="function"){i.failed(false,this.xhr)}n();break;case"progress":if(typeof i.progress==="function"){i.progress(t)}break;case"abort":if(typeof i.aborted==="function"){i.aborted(false,this.xhr)}n();break}}getResponseData(){const t=this.xhr;const e=t.responseType;if(!e||e==="text"){return t.responseText}return t.response}addXhrEvents(){const t=this.settings;if(!t){return}const e=this.xhr,r=this.update.bind(this);l.on(["load","error","abort"],e,r);l.on("progress",e.upload,r)}};var d=class{static getById(t){if(typeof t!=="string"){return false}const e=document.getElementById(t);return e||false}static getByName(t){if(typeof t!=="string"){return false}const e=document.getElementsByName(t);return e?O.toArray(e):false}static getBySelector(t,e){if(typeof t!=="string"){return false}e=e||false;if(e===true){const n=document.querySelector(t);return n||false}const r=document.querySelectorAll(t);if(!r){return false}return r.length===1?r[0]:O.toArray(r)}static html(t,e){if(u.isObject(t)===false){return false}if(u.isUndefined(e)===false){t.innerHTML=e;return this}return t.innerHTML}static setCss(t,e,r){if(u.isObject(t)===false||u.isUndefined(e)){return this}e=x.uncamelCase(e);t.style[e]=r;return this}static getCss(t,e){if(!t||typeof e==="undefined"){return false}e=x.uncamelCase(e);let r=t.style[e];if(r!==""){return r}let n=null,i=t.currentStyle;if(i&&(n=i[e])){r=n}else{const o=window.getComputedStyle(t,null);if(o){r=o[e]}}return r}static css(t,e,r){if(typeof r!=="undefined"){this.setCss(t,e,r);return this}return this.getCss(t,e)}static removeAttr(t,e){if(u.isObject(t)){t.removeAttribute(e)}return this}static setAttr(t,e,r){t.setAttribute(e,r)}static getAttr(t,e){return t.getAttribute(e)}static attr(t,e,r){if(u.isObject(t)===false){return false}if(typeof r!=="undefined"){this.setAttr(t,e,r);return this}return this.getAttr(t,e)}static _checkDataPrefix(t){if(typeof t!=="string"){return t}t=x.uncamelCase(t);if(t.substring(0,5)!=="data-"){t="data-"+t}return t}static removeDataPrefix(t){if(typeof t==="string"&&t.substring(0,5)==="data-"){t=t.substring(5)}return t}static setData(t,e,r){e=this.removeDataPrefix(e);e=x.camelCase(e);t.dataset[e]=r}static getData(t,e){e=x.camelCase(this.removeDataPrefix(e));return t.dataset[e]}static data(t,e,r){if(u.isObject(t)===false){return false}if(typeof r!=="undefined"){this.setData(t,e,r);return this}return this.getData(t,e)}static find(t,e){if(!t||typeof e!=="string"){return false}return t.querySelectorAll(e)}static show(t){if(u.isObject(t)===false){return this}const e=this.data(t,"style-display"),r=typeof e==="string"?e:"";this.css(t,"display",r);return this}static hide(t){if(u.isObject(t)===false){return this}const e=this.css(t,"display");if(e!=="none"&&e){this.data(t,"style-display",e)}this.css(t,"display","none");return this}static toggle(t){if(u.isObject(t)===false){return this}const e=this.css(t,"display");if(e!=="none"){this.hide(t)}else{this.show(t)}return this}static getSize(t){if(u.isObject(t)===false){return false}return{width:this.getWidth(t),height:this.getHeight(t)}}static getWidth(t){return u.isObject(t)?t.offsetWidth:false}static getHeight(t){return u.isObject(t)?t.offsetHeight:false}static getScrollPosition(t){let e=0,r=0;switch(typeof t){case"undefined":t=document.documentElement;e=t.scrollLeft;r=t.scrollTop;break;case"object":e=t.scrollLeft;r=t.scrollTop;break}if(u.isObject(t)===false){return false}return{left:e-(t.clientLeft||0),top:r-(t.clientTop||0)}}static getScrollTop(t){const e=this.getScrollPosition(t);return e.top}static getScrollLeft(t){const e=this.getScrollPosition(t);return e.left}static getWindowSize(){const t=window,e=document,r=e.documentElement,n=e.getElementsByTagName("body")[0],i=t.innerWidth||r.clientWidth||n.clientWidth,o=t.innerHeight||r.clientHeight||n.clientHeight;return{width:i,height:o}}static getDocumentSize(){const t=document,e=t.body,r=t.documentElement,n=Math.max(e.scrollHeight,e.offsetHeight,r.clientHeight,r.scrollHeight,r.offsetHeight),i=Math.max(e.scrollWidth,e.offsetWidth,r.clientWidth,r.scrollWidth,r.offsetWidth);return{width:i,height:n}}static getDocumentHeight(){return this.getDocumentSize().height}static position(t,e=1){const r={x:0,y:0};if(u.isObject(t)===false){return r}let n=0;while(t&&(e===0||n<e)){n++;r.x+=t.offsetLeft+t.clientLeft;r.y+=t.offsetTop+t.clientTop;t=t.offsetParent}return r}static addClass(t,e){if(u.isObject(t)===false||e===""){return this}if(typeof e==="string"){const i=e.split(" ");for(var r=0,n=i.length;r<n;r++){t.classList.add(e)}}return this}static removeClass(t,e){if(u.isObject(t)===false||e===""){return this}if(typeof e==="undefined"){t.className=""}else{t.classList.remove(e)}return this}static hasClass(t,e){if(u.isObject(t)===false||e===""){return false}return t.classList.contains(e)}static toggleClass(t,e){if(u.isObject(t)===false){return this}t.classList.toggle(e);return this}};var et=class{constructor(){this.connections=new Map}add(t,e,r){const n=this.find(t);n.set(e,r);return r}get(t,e){const r=this.connections.get(t);if(r){return r.get(e)||false}return false}find(t){const e=this.connections.get(t);if(e){return e}const r=new Map;this.connections.set(t,r);return r}remove(t,e){const r=this.connections.get(t);if(!r){return}let n;if(e){n=r.get(e);if(n){n.unsubscribe();r.delete(e)}if(r.size===0){this.connections.delete(t)}}else{for(let i of r){n=r.get(i);if(n){n.unsubscribe()}}this.connections.delete(t)}}};var I=class{constructor(){this.msg=null;this.token=null}setToken(t){this.token=t}};var rt=class extends I{constructor(t){super();this.data=t}subscribe(t,e){this.msg=t;this.token=this.data.on(t,e)}unsubscribe(){this.data.off(this.msg,this.token)}};var U=class{unsubscribe(){}};var st=class extends U{constructor(){super();this.source=null}addSource(t){return this.source=new rt(t)}unsubscribe(){this.source.unsubscribe();this.source=null}};var W=class extends I{constructor(t){super();this.pubSub=t}subscribe(t){this.msg=t;const e=this.callBack.bind(this);this.token=this.pubSub.on(t,e)}unsubscribe(){this.pubSub.off(this.msg,this.token)}callBack(){}};var nt=class extends W{constructor(t,e,r){super(r);this.data=t;this.prop=e}set(t){this.data.set(this.prop,t)}get(){return this.data.get(this.prop)}callBack(t,e){if(this.data!==e){this.data.set(this.prop,t,e)}}};var Ae=(s,t,e)=>{d.setAttr(s,t,e)};var Ce=(s,t,e)=>{s.checked=s.value==e};var Te=(s,t,e)=>{e=e==1;Ut(s,t,e)};var Ut=(s,t,e)=>{s[t]=e};var Ee=(s,t)=>{return d.getAttr(s,t)};var Oe=(s,t)=>{return s[t]};var it=class extends W{constructor(t,e,r,n){super(n);this.element=t;this.attr=this.getAttrBind(e);this.addSetMethod(t,this.attr);this.filter=typeof r==="string"?this.setupFilter(r):r}addSetMethod(t,e){if(e.substring(4,1)==="-"){this.setValue=Ae;this.getValue=Ee;return this}this.getValue=Oe;const r=t.type;if(r){switch(r){case"checkbox":this.setValue=Te;return;case"radio":this.setValue=Ce;return}}this.setValue=Ut;return this}getAttrBind(t){if(t){return t}let e="textContent";const r=this.element;if(!r||typeof r!=="object"){return e}const n=r.tagName.toLowerCase();if(n==="input"||n==="textarea"||n==="select"){const i=r.type;if(!i){e="value";return e}switch(i){case"checkbox":e="checked";break;case"file":e="files";break;default:e="value"}}return e}setupFilter(t){const e=/(\[\[[^\]]+\]\])/;return r=>{return t.replace(e,r)}}set(t){const e=this.element;if(!e||typeof e!=="object"){return this}if(this.filter){t=this.filter(t)}this.setValue(e,this.attr,t);return this}get(){const t=this.element;if(!t||typeof t!=="object"){return""}return this.getValue(t,this.attr)}callBack(t,e){if(e!==this.element){this.set(t)}return this}};var ot=class extends U{constructor(t){super();this.element=null;this.data=null;this.pubSub=t}addElement(t,e,r){return this.element=new it(t,e,r,this.pubSub)}addData(t,e){return this.data=new nt(t,e,this.pubSub)}unsubscribeSource(t){if(t){t.unsubscribe()}return this}unsubscribe(){this.unsubscribeSource(this.element);this.unsubscribeSource(this.data);this.element=null;this.data=null;return this}};var Wt=-1;var L=class{constructor(){this.callBacks=new Map;this.lastToken=-1}get(t){if(!this.callBacks.has(t)){this.callBacks.set(t,[])}return this.callBacks.get(t)}reset(){this.callBacks.clear();this.lastToken=-1;Wt=-1}on(t,e){const r=++Wt;this.get(t).push({token:r,callBack:e});return r}off(t,e){const r=this.callBacks.get(t);if(!r){return}const n=r.findIndex(i=>i.token===e);if(n!==-1){r.splice(n,1)}}remove(t){this.callBacks.delete(t)}publish(t,...e){const r=this.callBacks.get(t);if(!r){return}for(const{callBack:n}of r){if(!n){continue}n.apply(this,e)}}};var Dt=class{constructor(){this.version="1.0.1";this.attr="bindId";this.blockedKeys=[20,37,38,39,40];this.connections=new et;this.pubSub=new L;this.idCount=0;this.setup()}setup(){this.setupEvents()}bind(t,e,r,n){let i=r,o=null;if(r.indexOf(":")!==-1){const p=r.split(":");if(p.length>1){i=p[1];o=p[0]}}const a=this.setupConnection(t,e,i,o,n);const c=a.element;let h=e.get(i);if(typeof h!=="undefined"){c.set(h)}else{h=c.get();if(h!==""){a.data.set(h)}}return this}setupConnection(t,e,r,n,i){const o=this.getBindId(t),a=new ot(this.pubSub),c=a.addData(e,r);c.subscribe(o);const h=e.getDataId();const p=`${h}:${r}`;const v=a.addElement(t,n,i);v.subscribe(p);this.addConnection(o,"bind",a);return a}addConnection(t,e,r){this.connections.add(t,e,r);return this}setBindId(t){const e="db-"+this.idCount++;if(t.dataset){t.dataset[this.attr]=e}t[this.attr]=e;return e}getBindId(t){return t[this.attr]||this.setBindId(t)}unbind(t){const e=t[this.attr];if(e){this.connections.remove(e)}return this}watch(t,e,r,n){if(u.isObject(t)===false){return this}const i=new st;const o=i.addSource(e);o.subscribe(r,n);const a=this.getBindId(t),c=e.getDataId()+":"+r;this.addConnection(a,c,i);const h=e.get(r);if(typeof h!=="undefined"){n(h)}return this}unwatch(t,e,r){if(u.isObject(t)===false){return this}const n=t[this.attr];if(n){const i=e.getDataId()+":"+r;this.connections.remove(n,i)}return this}publish(t,e,r){this.pubSub.publish(t,e,r);return this}isDataBound(t){if(!t){return false}const e=t[this.attr];return e?e:false}isBlocked(t){if(t.type!=="keyup"){return false}return this.blockedKeys.indexOf(t.keyCode)!==-1}bindHandler(t){if(this.isBlocked(t)){return true}const e=t.target||t.srcElement,r=this.isDataBound(e);if(r){const n=this.connections.get(r,"bind");if(n){const i=n.element.get();this.pubSub.publish(r,i,e)}}t.stopPropagation()}setupEvents(){this.changeHandler=this.bindHandler.bind(this);this.addEvents()}addEvents(){l.on(["change","paste","input"],document,this.changeHandler,false)}removeEvents(){l.off(["change","paste","input"],document,this.changeHandler,false)}};var y=new Dt;var jt=/(\[\[(.*?(?:\[\d+\])?)\]\])/g;var P={isWatching(s){if(Array.isArray(s)){return typeof s[0]==="string"&&this.hasParams(s[0])}return this.hasParams(s)},hasParams(s){return u.isString(s)&&s.includes("[[")},_getWatcherProps(s){let t=/\[\[(.*?)(\[\d+\])?\]\]/g;const e=s.match(t);if(e===null){return null}t=/(\[\[|\]\])/g;return e.map(r=>r.replace(t,""))},updateAttr(s,t,e){switch(t){case"text":case"textContent":s.textContent=e;break;case"innerHTML":s.innerHTML=e;break;default:if(t.substring(4,1)==="-"){d.setAttr(s,t,e);break}s[t]=e;break}},_getWatcherCallBack(s,t,e,r,n){return()=>{let i=0,o=e.replace(jt,function(){const a=n?t[i]:t;i++;const c=a.get(arguments[2]);return typeof c!=="undefined"?c:""});this.updateAttr(s,r,o)}},getParentData(s){if(s.data){return s.data}if(s.context&&s.context.data){return s.context.data}if(s.state){return s.state}return null},getValue(s,t){if(typeof s==="string"){s={value:s}}const e=s.value;if(Array.isArray(e)===false){return[e,this.getParentData(t)]}if(e.length<2){e.push(this.getParentData(t))}return e},getPropValues(s,t,e){const r=[];for(var n=0,i=t.length;n<i;n++){var o=e?s[n]:s;var a=o.get(t[n]);a=typeof a!=="undefined"?a:"";r.push(a)}return r},getCallBack(s,t,e,r,n){let i,o=s.callBack;if(typeof o==="function"){const a=r.match(jt);const c=a&&a.length>1;i=(h,p)=>{h=c!==true?h:this.getPropValues(e,a,n);o(h,t,p)}}else{const a=s.attr||"textContent";i=this._getWatcherCallBack(t,e,r,a,n)}return i},addDataWatcher(s,t,e){const r=this.getValue(t,e),n=r[1];if(!n){return}const i=r[0],o=Array.isArray(n);const a=this.getCallBack(t,s,n,i,o),c=this._getWatcherProps(i);for(var h=0,p=c.length;h<p;h++){var v=o?n[h]:n;this.addWatcher(s,v,c[h],a)}},setup(s,t,e){if(!t){return}if(Array.isArray(t)){const r=[t[0],t[1]];const n=t[2];if(typeof n==="function"){t={value:r,callBack:n}}else{t={attr:n,value:[t[0],t[1]]}}}this.addDataWatcher(s,t,e)},addWatcher(s,t,e,r){y.watch(s,t,e,r)}};var Pe=s=>{if(typeof s!=="string"){return s}return Ft(s)};var Ft=s=>{return[{tag:"text",textContent:s}]};var Me=s=>{if(!s){return{props:{},children:[]}}const t=s[0];if(typeof t==="string"){return{props:{},children:Ft(t)}}if(Array.isArray(t)){if(P.isWatching(t)===false){return{props:{},children:t}}return{props:{watch:t},children:[]}}return{props:t||{},children:Pe(s[1])}};var Be=s=>{return(...t)=>{const{props:e,children:r}=Me(t);return s(e,r)}};var at=s=>{const t={};if(!u.isObject(s)){return t}const e=m.clone(s);Object.keys(e).forEach(r=>{const n=e[r];if(typeof n!=="function"){t[r]=n}});return t};function Vt(s,t){const e=isNaN(Number(t))?t:`[${t}]`;return s===""?e:`${s}.${e}`}function Jt(s,t="",e=""){return{get(r,n,i){if(t===""&&n in r){return r[n]}const o=r[e]||r;const a=o[n];if(typeof a==="function"){return a.bind(o)}if(!u.isObject(a)||m.isPlainObject(a)===false){return a}const c=Vt(t,n);return new Proxy(a,Jt(s,c,e))},set(r,n,i,o){if(t===""&&n in r){r[n]=i;return true}const a=r[e]||r;const c=Vt(t,n);s.set(c,i);a[n]=i;return true}}}var zt=(s,t="stage")=>new Proxy(s,Jt(s,"",t));var Le=0;var H=class{constructor(t){this.dirty=false;this.links={};this._init();this.setup();this.dataTypeId="bd";this.eventSub=new L;const e=at(t);this.set(e);return zt(this)}setup(){this.stage={}}_init(){const t=++Le;this._dataNumber=t;this._id="dt-"+t;this._dataId=this._id+":"}getDataId(){return this._id}remove(){}on(t,e){const r=t+":change";const n=this.eventSub.on(r,e);return n}off(t,e){const r=t+":change";this.eventSub.off(r,e)}_setAttr(t,e,r=this){const n=this.stage[t];if(e===n){return false}this.stage[t]=e;this._publish(t,e,r,n)}set(...t){if(typeof t[0]!=="object"){this._setAttr(...t);return this}const[e,r,n]=t;Object.entries(e).forEach(([i,o])=>{if(typeof o==="function"){return}this._setAttr(i,o,r,n)});return this}getModelData(){return this.stage}_deleteAttr(t,e){delete t[e]}toggle(t){if(typeof t==="undefined"){return}this.set(t,!this.get(t));return this}increment(t){if(typeof t==="undefined"){return}let e=this.get(t);this.set(t,++e);return this}decrement(t){if(typeof t==="undefined"){return}let e=this.get(t);this.set(t,--e);return this}concat(t,e){if(typeof t==="undefined"){return}let r=this.get(t);this.set(t,r+e);return this}ifNull(t,e){if(this.get(t)===null){this.set(t,e)}return this}setKey(t){this.key=t;return this}resume(t){const e=this.key;if(!e){return this}let r;const n=localStorage.getItem(e);if(n===null){if(t){r=t}}else{r=JSON.parse(n)}if(!r){return this}this.set(r);return this}store(){const t=this.key;if(!t){return false}const e=this.get();if(!e){return false}const r=JSON.stringify(e);localStorage.setItem(t,r);return true}delete(t){if(typeof t!=="undefined"){this._deleteAttr(this.stage,t);return}this.setup()}_getAttr(t,e){return t[e]}get(t){if(typeof t!=="undefined"){return this._getAttr(this.stage,t)}return this.getModelData()}link(t,e,r){if(arguments.length===1&&t.isData===true){e=t.get()}if(typeof e!=="object"){return this.remoteLink(t,e,r)}const n=[];Object.entries(e).forEach(([i])=>{n.push(this.remoteLink(t,i))});return n}remoteLink(t,e,r){const n=r||e;const i=t.get(e);if(typeof i!=="undefined"&&this.get(e)!==i){this.set(e,i)}const o=t.on(e,(c,h)=>{if(h===this){return false}this.set(n,c,t)});this.addLink(o,t);const a=this.on(n,(c,h)=>{if(h===t){return false}t.set(e,c,this)});t.addLink(a,this);return o}addLink(t,e){this.links[t]=e}unlink(t){if(t){this.removeLink(t);return}const e=this.links;if(e.length<1){return}e.forEach(r=>{this.removeLink(r,false)});this.links=[]}removeLink(t,e){const r=this.links[t];if(r){r.off(t)}if(e===false){return}delete this.links[t]}};H.prototype.isData=true;var A={deepDataPattern:/(\w+)|(?:\[(\d)\))/g,hasDeepData(s){return s.indexOf(".")!==-1||s.indexOf("[")!==-1},getSegments(s){const t=this.deepDataPattern;return s.match(t)}};var C=class extends H{setup(){this.attributes={};this.stage={}}_updateAttr(t,e,r){if(!A.hasDeepData(e)){t[e]=r;return}let n,i=A.getSegments(e),o=i.length,a=o-1;for(var c=0;c<o;c++){n=i[c];if(c===a){t[n]=r;break}if(t[n]===void 0){t[n]=isNaN(n)?{}:[]}t=t[n]}}_setAttr(t,e,r,n){if(typeof e!=="object"&&e===this.get(t)){return}if(!r&&n!==true){this._updateAttr(this.attributes,t,e)}else{if(this.dirty===false){this.dirty=true}}this._updateAttr(this.stage,t,e);r=r||this;this._publish(t,e,r)}linkAttr(t,e){const r=t.get(e);if(!r){return}for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){this.link(t,e+"."+n,n)}}}scope(t,e){const r=this.get(t);if(!r){return false}e=e||this.constructor;const n=new e(r);n.linkAttr(this,t);return n}splice(t,e){this.delete(t+"["+e+"]");this.refresh(t);return this}push(t,e){let r=this.get(t);if(Array.isArray(r)===false){r=[]}r.push(e);this.set(t,r);return this}unshift(t,e){let r=this.get(t);if(Array.isArray(r)===false){r=[]}r.unshift(e);this.set(t,r);return this}shift(t){let e=this.get(t);if(Array.isArray(e)===false){return null}const r=e.shift();this.set(t,e);return r}pop(t){let e=this.get(t);if(Array.isArray(e)===false){return null}const r=e.pop();this.set(t,e);return r}refresh(t){this.set(t,this.get(t));return this}_publish(t,e,r){this.publish(t,e,r)}publishDeep(t,e,r){if(!A.hasDeepData(t)){this.publish(t,e,r);return}let n,i=A.getSegments(t),o=i.length,a=o-1;let c="",h=this.stage;for(var p=0;p<o;p++){n=i[p];h=h[n];if(p>0){if(isNaN(n)){c+="."+n}}else{c=n}var v;if(p===a){v=e}else{var E=i[p+1];if(isNaN(E)===false){c+="["+E+"]";continue}var q={};q[E]=h[E];v=q}this.publish(c,v,r)}}publish(t,e,r){t=t||"";this._publishAttr(t,e,r);if(!e||typeof e!=="object"){return}let n,i;if(Array.isArray(e)){const c=e.length;for(var o=0;o<c;o++){i=e[o];n=t+"["+o+"]";this._checkPublish(n,i,r)}}else{for(var a in e){if(!Object.prototype.hasOwnProperty.call(e,a)){continue}i=e[a];n=t+"."+a;this._checkPublish(n,i,r)}}}_checkPublish(t,e,r){if(!e||typeof e!=="object"){this._publishAttr(t,e,r)}else{this.publish(t,e,r)}}_publishAttr(t,e,r){y.publish(this._dataId+t,e,r);const n=t+":change";this.eventSub.publish(n,e,r)}mergeStage(){this.attributes=m.clone(this.stage);this.dirty=false}getModelData(){this.mergeStage();return this.attributes}revert(){this.set(this.attributes);this.dirty=false}_deleteAttr(t,e){if(!A.hasDeepData(e)){delete t[e]}const r=A.getSegments(e),n=r.length,i=n-1;for(var o=0;o<n;o++){var a=r[o];var c=t[a];if(c===void 0){break}if(o===i){if(Array.isArray(t)){t.splice(a,1);break}delete t[a];break}t=c}}_getAttr(t,e){if(!A.hasDeepData(e)){return t[e]}const r=A.getSegments(e),n=r.length,i=n-1;for(var o=0;o<n;o++){var a=r[o];var c=t[a];if(c===void 0){break}t=c;if(o===i){return t}}return void 0}};var He={"\n":"\\n","\r":"\\n"," ":"\\t"};var Re=(s,t)=>{if(typeof s!=="string"){s=String(s)}const e=t?/[\n\r\t]/g:/\t/g;return s.replace(e,r=>He[r])};var Yt=(s,t)=>{if(typeof s!=="string"){return s}s=Re(s,t);s=encodeURIComponent(s);const e=/%22/g;return s.replace(e,'"')};var At=(s,t)=>{const e=typeof s;if(e==="undefined"){return s}if(e!=="object"){s=Yt(s);return s}Object.entries(s).forEach(([r,n])=>{if(n===null){return}s[r]=typeof n==="string"?At(n,t):Yt(n,t)});return s};function qt(s){return typeof s!=="undefined"&&s.length>0?JSON.parse(s):false}function Ct(s){return typeof s!=="undefined"?JSON.stringify(s):false}var X=class{static prepareJsonUrl(t,e=false){const r=typeof t==="object"?m.clone(t):t,n=At(r,e);return Ct(n)}static xmlParse(t){if(typeof t==="undefined"){return false}const e=new DOMParser;return e.parseFromString(t,"text/xml")}};B(X,"json",{encode:Ct,decode:qt});var ct=class{constructor(t){this.model=t;this.objectType=this.objectType||"item";this.url="";this.validateCallBack=null;this.init()}init(){const t=this.model;if(t&&t.url){this.url=t.url}}isValid(){const t=this.validate();if(t!==false){const e=this.validateCallBack;if(typeof e==="function"){e(t)}}return t}validate(){return true}getDefaultParams(){return""}setupParams(t){const e=this.getDefaultParams();t=this.addParams(t,e);return t}objectToString(t){const e=[];for(var r in t){if(Object.prototype.hasOwnProperty.call(t,r)){e.push(r+"="+t[r])}}return e.join("&")}addParams(t,e){t=t||{};if(typeof t==="string"){t=x.parseQueryString(t,false)}if(!e){return!this._isFormData(t)?this.objectToString(t):t}if(typeof e==="string"){e=x.parseQueryString(e,false)}if(this._isFormData(t)){for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r)){t.append(r,e[r])}}}else{t=Object.assign(t,e);t=this.objectToString(t)}return t}get(t,e){const r=this.model.get("id"),n="op=get&id="+r;const i=this.model;return this._get("",n,t,e,o=>{if(o){const a=this.getObject(o);if(a){i.set(a)}}})}getObject(t){const e=t[this.objectType]||t;return e||false}setupObjectData(){const t=this.model.get();return this.objectType+"="+X.prepareJsonUrl(t)}setup(t,e){if(!this.isValid()){return false}let r="op=setup&"+this.setupObjectData();return this._put("",r,t,e)}add(t,e){if(!this.isValid()){return false}let r="op=add&"+this.setupObjectData();return this._post("",r,t,e)}update(t,e){if(!this.isValid()){return false}let r="op=update&"+this.setupObjectData();return this._patch("",r,t,e)}delete(t,e){const r=this.model.get("id"),n="op=delete&id="+r;return this._delete("",n,t,e)}all(t,e,r,n,i){i=i||"";r=!isNaN(r)?r:0;n=!isNaN(n)?n:50;let o="op=all&option="+i+"&start="+r+"&stop="+n;return this._get("",o,t,e)}getUrl(t){let e=this.url;if(!t){return e}if(t[0]==="?"){return e+t}return e+="/"+t}setupRequest(t,e,r,n,i){const o={url:this.getUrl(t),method:e,params:r,completed:(c,h)=>{if(typeof i==="function"){i(c)}this.getResponse(c,n,h)}};const a=this._isFormData(r);if(a){o.headers={}}return tt(o)}_isFormData(t){return t instanceof FormData}request(t,e,r,n){return this._request("","POST",t,e,r,n)}_get(t,e,r,n,i){e=this.setupParams(e);e=this.addParams(e,r);t=t||"";if(e){t+="?"+e}return this.setupRequest(t,"GET","",n,i)}_post(t,e,r,n,i){return this._request(t,"POST",e,r,n,i)}_put(t,e,r,n,i){return this._request(t,"PUT",e,r,n,i)}_patch(t,e,r,n,i){return this._request(t,"PATCH",e,r,n,i)}_delete(t,e,r,n,i){return this._request(t,"DELETE",e,r,n,i)}_request(t,e,r,n,i,o){r=this.setupParams(r);r=this.addParams(r,n);return this.setupRequest(t,e,r,i,o)}getResponse(t,e,r){if(typeof e==="function"){e(t,r)}}static extend(t){if(!t){return false}const e=this;class r extends e{constructor(i){super(i)}}Object.assign(r.prototype,t);return r}};var Ne=s=>{const t={};if(!u.isObject(s)||!s.defaults){return t}const{defaults:e}=s;Object.keys(e).forEach(r=>{const n=e[r];if(typeof n!=="function"){t[r]=n}});delete s.defaults;return t};var _e=s=>{if(!s||typeof s.xhr!=="object"){return{}}const t={...s.xhr};delete s.xhr;return t};var Ie=0;var j=class extends C{xhr=null;constructor(t){const e=super(t);this.initialize();return e}initialize(){}static extend(t={}){const e=this,r=_e(t),n=this.prototype.service.extend(r);const i=Ne(t);class o extends e{constructor(c){const h={...i,...at(c)};super(h);this.xhr=new n(this)}dataTypeId=`bm${Ie++}`}Object.assign(o.prototype,t);o.prototype.service=n;return o}};j.prototype.service=ct;var T=class extends H{_publish(t,e,r,n){const i=t+":change";this.eventSub.publish(i,e,r);r=r||this;y.publish(this._dataId+t,e,r)}};var ht=class extends T{constructor(t){super();this.id=t}addAction(t,e){if(typeof e!=="undefined"){this.set(t,e)}}getState(t){return this.get(t)}removeAction(t,e){if(e){this.off(t,e);return}const r=this.stage;if(typeof r[t]!=="undefined"){delete r[t]}}};var k=class{static restore(t,e){this.targets.set(t,e)}static getTarget(t){if(!this.targets.has(t)){this.targets.set(t,new ht(t))}return this.targets.get(t)}static getActionState(t,e){const r=this.getTarget(t);return r.get(e)}static add(t,e,r){const n=this.getTarget(t);if(e){n.addAction(e,r)}return n}static addAction(t,e,r){return this.add(t,e,r)}static removeAction(t,e,r){this.off(t,e,r)}static on(t,e,r){const n=this.getTarget(t);if(e){return n.on(e,r)}return false}static off(t,e,r){this.remove(t,e,r)}static remove(t,e,r){const n=this.targets,i=n.get(t);if(!i){return}if(e){i.off(e,r);return}this.targets.delete(t)}static set(t,e,r){const n=this.getTarget(t);n.set(e,r)}};B(k,"targets",new Map);var ut=class{constructor(){this.events=[]}addEvents(t){const e=t.length;if(e<1){return false}t.forEach(r=>{this.on(...r)})}on(t,e,r,n){l.on(t,e,r,n);this.events.push({event:t,obj:e,callBack:r,capture:n})}off(t,e,r,n){l.off(t,e,r,n);let i,o=this.events;for(var a=0,c=o.length;a<c;a++){i=o[a];if(i.event===t&&i.obj===e){o.splice(a,1);break}}}set(){this.events.forEach(t=>{l.on(t.event,t.obj,t.callBack,t.capture)})}unset(){this.events.forEach(t=>{l.off(t.event,t.obj,t.callBack,t.capture)})}reset(){this.unset();this.events=[]}};var ft=class{constructor(t,e){this.remoteStates=[];const r=this.convertStates(e);this.addStatesToTarget(t,r)}addStates(t,e){const r=this.convertStates(e);this.addStatesToTarget(t,r)}createState(t,e,r,n){return{action:t,state:e,callBack:r,targetId:n,token:null}}convertStates(t){const e=[];for(var r in t){if(!Object.prototype.hasOwnProperty.call(t,r)){continue}if(r==="remotes"){this.setupRemoteStates(t[r],e);continue}var n=null,i=null,o=t[r];if(o&&typeof o==="object"){i=o.callBack;n=o.id||o.targetId;o=o.state}e.push(this.createState(r,o,i,n))}return e}setupRemoteStates(t,e){let r;for(var n=0,i=t.length;n<i;n++){r=t[n];if(!r){continue}for(var o in r){if(!Object.prototype.hasOwnProperty.call(r,o)||o==="id"){continue}var a=null,c=r[o],h=c!==null?c:void 0;if(h&&typeof h==="object"){a=h.callBack;h=h.state}e.push(this.createState(o,h,a,r.id))}}}removeRemoteStates(){const t=this.remoteStates;if(t){this.removeActions(t)}}removeActions(t){if(t.length<1){return}for(var e=0,r=t.length;e<r;e++){var n=t[e];k.remove(n.targetId,n.action,n.token)}}restore(t){k.restore();const e=this.remoteStates;if(!e){return}for(var r=0,n=e.length;r<n;r++){var i=e[r];i.token=this.bindRemoteState(t,i.action,i.targetId)}}bindRemoteState(t,e,r){const n=k.getTarget(r);return t.link(n,e)}addStatesToTarget(t,e){const r=this.remoteStates;for(var n=0,i=e.length;n<i;n++){var o=e[n],a=this.addAction(t,o);if(o.targetId){o.token=a;r.push(o)}}if(r.length<1){this.remoteStates=null}}addAction(t,e){let r,n=e.action;const i=e.targetId;if(i){r=this.bindRemoteState(t,n,i)}if(typeof e.state!=="undefined"){t.addAction(n,e.state)}const o=e.callBack;if(typeof o==="function"){t.on(n,o)}return r}};var Ue={class:"className",text:"textContent",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",celpadding:"cellPadding",useMap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"};var G=s=>{return Ue[s]||s};var Tt=s=>{if(typeof s==="string"&&s.substring(0,2)==="on"){return s.substring(2)}return s};var b=class{static create(t,e,r,n){const i=document.createElement(t);this.addAttributes(i,e);if(n===true){this.prepend(r,i)}else{this.append(r,i)}return i}static addAttributes(t,e){if(!e||typeof e!=="object"){return false}const r=e.type;if(typeof r!=="undefined"){d.setAttr(t,"type",r)}for(const[n,i]of Object.entries(e)){if(n==="innerHTML"){t.innerHTML=i}else if(n.indexOf("-")!==-1){d.setAttr(t,n,i)}else{this.addAttr(t,n,i)}}}static addHtml(t,e){if(typeof e==="undefined"||e===""){return this}const r=/(?:<[a-z][\s\S]*>)/i;if(r.test(e)){t.innerHTML=e}else{t.textContent=e}return this}static addAttr(t,e,r){if(r===""||!e){return}const n=typeof r;if(n==="function"){e=Tt(e);l.add(e,t,r)}else{const i=G(e);t[i]=r}}static createDocFragment(){return document.createDocumentFragment()}static createText(t,e){const r=document.createTextNode(t);if(e){this.append(e,r)}return r}static createComment(t,e){const r=document.createComment(t);if(e){this.append(e,r)}return r}static setupSelectOptions(t,e,r){if(!u.isObject(t)){return false}if(!u.isArray(e)){return false}e.forEach(n=>{const i=new Option(n.label,n.value);t.options.add(i);if(r!==null&&i.value==r){i.selected=true}})}static removeElementData(t){const e=t.childNodes;if(e){const o=e.length-1;for(var r=o;r>=0;r--){var n=e[r];if(!n){continue}this.removeElementData(n)}}f.remove(t);const i=t.bindId;if(i){y.unbind(t)}}static removeElement(t){let e;if(!t||!(e=t.parentNode)){return this}this.removeElementData(t);e.removeChild(t);return this}static removeChild(t){this.removeElement(t);return this}static removeAll(t){if(!u.isObject(t)){return this}const e=t.childNodes;for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r)){this.removeElementData(e[r])}}t.innerHTML="";return this}static changeParent(t,e){e.appendChild(t);return this}static append(t,e){t.appendChild(e);return this}static prepend(t,e,r){const n=r||t.firstChild;t.insertBefore(e,n);return this}static clone(t,e=false){if(!u.isObject(t)){return false}return t.cloneNode(e)}};var We=s=>{if(typeof s!=="string"){return s}return $t(s)};var $t=s=>{return[{tag:"text",textContent:s}]};var Kt=s=>{if(!s){return{props:{},children:[]}}const t=s[0];if(typeof t==="string"){return{props:{},children:$t(t)}}if(Array.isArray(t)){return{props:{},children:t}}return{props:t||{},children:We(s[1])}};f.addType("components",s=>{if(!s){return}const t=s.component;if(t&&t.rendered===true){t.prepareDestroy()}});var je=0;var R=class{constructor(...t){this.isUnit=true;this.init();const{props:e,children:r}=Kt(t);this.setupProps(e);this.children??=r;this.onCreated();this.rendered=false;this.container=null}init(){this.id="cp-"+je++}setupProps(t){if(!t||typeof t!=="object"){return}for(var e in t){if(Object.prototype.hasOwnProperty.call(t,e)){this[e]=t[e]}}}getParentContext(){if(!this.parent){return null}return this.parent.getContext()}setupContext(){const t=this.getParentContext();const e=this.setContext(t);if(e){this.context=e;return}this.context=t;this.setupAddingContext()}setupAddingContext(){const t=this.context;const e=this.addContext(t);if(!e){return}const r=e[0];if(!r){return}this.addingContext=true;this.contextBranchName=r;this.addContextBranch(r,e[1])}addContextBranch(t,e){this.context=this.context||{};this.context[t]=e}setContext(t){return null}addContext(t){return null}removeContext(){if(!this.addingContext){return}this.removeContextBranch(this.contextBranchName)}removeContextBranch(t){if(!t){return}delete this.context[t]}getContext(){return this.context}onCreated(){}render(){return{}}_cacheRoot(t){if(!t){return t}if(!t.id){t.id=this.getId()}t.cache="panel";return t}_createLayout(){if(this.persist){return this._layout||(this._layout=this.render())}return this.render()}prepareLayout(){const t=this._createLayout();return this._cacheRoot(t)}afterBuild(){f.add(this.panel,"components",{component:this});this.rendered=true;this.afterLayout()}afterLayout(){this.afterSetup()}if(t,e){return!t?null:e||t}map(t,e){const r=[];if(!t||t.length<1){return r}for(var n=0,i=t.length;n<i;n++){const o=e(t[n],n);r.push(o)}return r}removeAll(t){return b.removeAll(t)}getId(t){let e=this.id;if(typeof t==="string"){e+="-"+t}return e}initialize(){this.setupContext();this.beforeSetup()}beforeSetup(){}afterSetup(){}setup(t){this.container=t;this.initialize()}remove(){this.prepareDestroy();this.removeContext();const t=this.panel||this.id;b.removeElement(t)}prepareDestroy(){this.rendered=false;this.beforeDestroy()}beforeDestroy(){}destroy(){this.remove()}};var M=class extends R{constructor(...t){super(...t);this.isComponent=true;this.stateTargetId=null}initialize(){this.setupContext();this.addStates();this.beforeSetup()}afterLayout(){this.addEvents();this.afterSetup()}setupStateTarget(t){const e=t||this.stateTargetId||this.id;this.state=k.getTarget(e)}setupStates(){return{}}addStates(){const t=this.state;if(t){this.stateHelper.restore(t);return}const e=this.setupStates();if(m.isEmpty(e)){return}this.setupStateTarget();this.stateHelper=new ft(this.state,e)}removeStates(){const t=this.state;if(!t){return false}this.stateHelper.removeRemoteStates();k.remove()}setupEventHelper(){if(!this.events){this.events=new ut}}setupEvents(){return[]}addEvents(){const t=this.setupEvents();if(t.length<1){return false}this.setupEventHelper();this.events.addEvents(t)}removeEvents(){const t=this.events;if(t){t.reset()}}prepareDestroy(){this.rendered=false;this.beforeDestroy();this.removeEvents();this.removeStates();this.removeContext();if(this.data&&this.persist===false){this.data.unlink()}}};var Fe={created:"onCreated",state:"setupStates",events:"setupEevents",before:"beforeSetup",render:"render",after:"afterSetup",destroy:"beforeDestroy"};var Ve=s=>{const t=typeof s;return t==="function"?s:function(){return s}};var Je=s=>{const t={};if(!s){return t}for(var e in s){if(!Object.prototype.hasOwnProperty.call(s,e)){continue}const r=s[e];const n=Fe[e];if(n){t[n]=Ve(r);continue}t[e]=r}return t};var ze=s=>{class t extends M{}Object.assign(t.prototype,s);return t};var Xt=s=>{class t extends R{}Object.assign(t.prototype,s);return t};var N=function(s){if(!s){return null}let t;switch(typeof s){case"object":if(s.render){t=Je(s);return ze(t)}t={render(){return s}};return Xt(t);case"function":t={render:s};return Xt(t)}};var Ye={monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],getDayName(s=new Date().getDay(),t=false){const e=this.dayNames;if(s>e.length){return false}const r=e[s];return t?r.substring(0,3):r},convertJsMonth(s){return this.padNumber(s+1)},convertDate(s,t){s=s?s.replace(/\s/,"T"):"";const e=new Date(s),r=t===true?" "+e.getFullYear():"";return this.getDayName(e.getDay())+", "+this.getMonthName(e.getMonth(),true)+" "+this.padNumber(e.getDate())+r},padNumber(s){return s<=9?"0"+s:String(s)},createDate(s){if(!s){return new Date}if(typeof s==="string"&&s.indexOf("-")>-1){s=s.replace(/\s/,"T");s=s.indexOf(":")>-1?s:s+"T00:00:00"}return new Date(s)},format(s,t){const e=this.createDate(t);switch(s){case"sql":t=e.getFullYear()+"-"+this.convertJsMonth(e.getMonth())+"-"+this.padNumber(e.getDate());break;default:t=this.convertJsMonth(e.getMonth())+"/"+this.padNumber(e.getDate())+"/"+e.getFullYear();break}return t},formatTime(s,t){const e=this.createDate(s);if(t===24){return this.padNumber(e.getHours())+":"+this.padNumber(e.getMinutes())+":"+this.padNumber(e.getSeconds())}let r=e.getHours(),n="AM";if(r>=12){n="PM"}if(r>12){r=r-12}return r+":"+this.padNumber(e.getMinutes())+" "+n},leapYear(s){return s%400===0||s%100!==0&&s%4===0},getMonthName(s=new Date().getMonth(),t=false){const e=this.monthNames;if(s>e.length){return false}const r=e[s];if(!r){return false}return t?r.substring(0,3):r},getMonthLength(s,t){const e=new Date;s=typeof s!=="undefined"?s:e.getMonth();t=typeof t!=="undefined"?t:e.getFullYear();const r=this.getMonthsLength(t);return r[s]},getMonthsLength(s=new Date().getFullYear()){const t=this.leapYear(s);const e=t===true?[31,29,31,30,31,30,31,31,30,31,30,31]:[31,28,31,30,31,30,31,31,30,31,30,31];return e},getDiffFromNow(s,t){s=s.replace(/\s/,"T");s=new Date(s);const e=new Date;if(t===true){e.setHours(0,0,0,0)}let r=e.getTime()-s.getTime();return r},getAge(s){const t=this.getDiffFromNow(s);let e="",r="";switch(true){case t<864e5:e="1 day";break;case t<6048e5:r=this.toDays(t);e=r+" days";break;case t<12096e5:e="1 week";break;case t<2592e6:r=this.toDays(t);var n=Math.floor(r/7);e=n+" weeks";break;case t<5184e6:e="1 month";break;case t<31104e6:var i=this.toMonths(t);e=i+" months";break;default:var o=this.toYears(t);e=o}return e},getTimeFrame(s){const t=this.getDiffFromNow(s);return this.convertToEstimate(t)},convertToEstimate(s){let t="";let e,r,n,i,o,a,c;if(s<=0){switch(true){case s<-63072e6:n=this.toYears(Math.abs(s));t="in "+n+" years";break;case s<-31536e6:t="in a year";break;case s<-5184e6:i=this.toMonths(Math.abs(s));t="in "+i+" months";break;case s<-2592e6:t="in a month";break;case s<-12096e5:e=this.toDays(Math.abs(s)),r=Math.floor(e/7);t="in "+r+" weeks";break;case s<-6048e5:t="in a week";break;case s<-1728e5:e=this.toDays(Math.abs(s));t="in "+e+" days";break;case s<-864e5:t="tomorrow";break;case s<-72e5:o=this.toHours(Math.abs(s));t="in "+o+" hours";break;case s<=-36e5:t="in an hour";break;case s<-12e4:a=this.toMinutes(Math.abs(s));t="in "+a+" minutes";break;case s<-6e4:t="in a minute";break;case s<-2e3:c=this.toSeconds(Math.abs(s));t="in "+c+" seconds";break;case s<-1:t="in 1 second";break;default:t="now"}}else{switch(true){case s<1e3:t="1 second ago";break;case s<6e4:c=this.toSeconds(s);t=c+" seconds ago";break;case s<12e4:t="1 minute ago";break;case s<36e5:a=this.toMinutes(s);t=a+" minutes ago";break;case s<72e5:t="1 hour ago";break;case s<864e5:o=this.toHours(s);t=o+" hours ago";break;case s<1728e5:t="yesterday";break;case s<6048e5:e=this.toDays(s);t=e+" days ago";break;case s<12096e5:t="a week ago";break;case s<2592e6:e=this.toDays(s),r=Math.floor(e/7);t=r+" weeks ago";break;case s<5184e6:t="a month ago";break;case s<31536e6:i=this.toMonths(s);t=i+" months ago";break;case s<63072e6:t="a year ago";break;default:n=this.toYears(s);t=n+" years ago"}}return t},toYears(s){if(typeof s!=="number"){return false}return Math.floor(s/(1e3*60*60*24*365.26))},toMonths(s){if(typeof s==="number"){return Math.floor(s/(1e3*60*60*24*30))}return false},toDays(s){if(typeof s!=="number"){return false}return Math.floor(s/(60*60*1e3*24)*1)},toHours(s){if(typeof s!=="number"){return false}return Math.floor(s%(60*60*1e3*24)/(60*60*1e3)*1)},toMinutes(s){if(typeof s!=="number"){return false}return Math.floor(s%(60*60*1e3*24)%(60*60*1e3)/(60*1e3)*1)},toSeconds(s){if(typeof s!=="number"){return false}return Math.floor(s%(60*60*1e3*24)%(60*60*1e3)%(60*1e3)/1e3*1)},getDifference(s,t){const e=new Date(s),r=new Date(t),n=r.getTime()-e.getTime();return{years:this.toYears(n),days:this.toDays(n),hours:this.toHours(n),minutes:this.toMinutes(n),seconds:this.toSeconds(n)}}};var Gt=(s,t)=>{return{name:s,callBack:t}};var F={keys:[],items:{},add(s,t){this.keys.push(s);this.items[s]=Gt(s,t);return this},get(s){return this.items[s]||null},all(){return this.keys}};var Et=(s,t)=>{return{attr:s,directive:t}};var V=(s,t)=>{return{key:s,value:t}};var Qt=(s,t,e,r)=>{return{tag:s,attr:t,directives:e,children:r}};var J=class{static getTag(t){return t.tag||"div"}static setupChildren(t){if(t.nest){t.children=t.nest;delete t.nest}}static setElementContent(t,e,r,n){if(t==="text"){n.push({tag:"text",textContent:e});return true}if(t==="html"||t==="innerHTML"){r.push(V("innerHTML",e));return true}return false}static setTextAsWatcher(t,e,r){r={attr:G(e),value:r};t.push(Et(V(e,r),F.get("watch")))}static setButtonType(t,e,r){if(t==="button"){const n=e.type||"button";r.push(V("type",n))}}static parse(t,e){const r=[],n=[],i=this.getTag(t);this.setButtonType(i,t,r);this.setupChildren(t);let o=[];var a,c;for(var h in t){if(!m.hasOwnProp(t,h)||h==="tag"){continue}a=t[h];if(a===void 0||a===null){continue}if((c=F.get(h))!==null){n.push(Et(V(h,a),c));continue}const p=typeof a;if(p==="object"){if(h==="children"){o=o.concat(a);continue}if(P.isWatching(a)){this.setTextAsWatcher(n,h,a);continue}o.push(a);continue}if(p==="function"){const v=a;a=function(E){v.call(this,E,e)}}if(P.isWatching(a)){this.setTextAsWatcher(n,h,a);continue}if(this.setElementContent(h,a,r,o)){continue}r.push(V(h,a))}return Qt(i,r,n,o)}};var w=class extends b{static create(t,e,r,n){const i=document.createElement(t);this.addAttributes(i,e,n);r.appendChild(i);return i}static addAttributes(t,e,r){if(!e||e.length<1){return}e.forEach(n=>{const{key:i,value:o}=n;if(i==="innerHTML"){t.innerHTML=o;return}if(i.substr(4,1)==="-"){d.setAttr(t,i,o);return}this.addAttr(t,i,o,r)})}static addAttr(t,e,r,n){if(r===""||!e){return false}const i=typeof r;if(i==="function"){e=Tt(e);l.add(e,t,function(o){r.call(this,o,n)})}else{const o=G(e);t[o]=r}}static addContent(t,e){if(!e){return}if(e.textContent!==null){t.textContent=e.textContent}else if(e.innerHTML){t.innerHTML=e.innerHTML}}static append(t,e){t.appendChild(e)}};var z=class{createNode(t,e,r){}};var lt=class extends z{createNode(t,e,r){const n=t.tag;if(n==="text"){const i=t.attr[0];const o=i?i.value:"";return w.createText(o,e)}else if(n==="comment"){const i=t.attr[0];const o=i?i.value:"";return w.createComment(o,e)}return w.create(n,t.attr,e,r)}};var pt=class extends z{createNode(t,e,r){const n=t.tag;if(n==="text"){const i=t.attr[0];const o=i?i.value:""}else if(n==="comment"){const i=t.attr[0];const o=i?i.value:""}}};var dt=class{static browserIsSupported(){return window}static setup(){if(this.browserIsSupported()){return new lt}return new pt}};var qe=dt.setup();var g=class{static render(t,e,r){if(!t){return null}if(typeof t==="object"&&t.isUnit===true){this.createComponent(t,e,r);return t}const n=N(t);const i=new n;this.createComponent(i,e,r);return i}static build(t,e,r){const n=w.createDocFragment();const i=Array.isArray(t)?t:[t];i.forEach(o=>this.buildElement(o,n,r));if(e&&typeof e==="object"){e.appendChild(n)}return n}static rebuild(t,e,r){w.removeAll(e);return this.build(t,e,r)}static buildElement(t,e,r){if(!t){return}if(t.isUnit===true){this.createComponent(t,e,r);return}this.createElement(t,e,r)}static createElement(t,e,r){const n=J.parse(t,r),i=this.createNode(n,e,r);this.cache(i,t.cache,r);n.children.forEach(a=>{if(a!==null){this.buildElement(a,i,r)}});const o=n.directives;if(o&&o.length){this.setDirectives(i,o,r)}}static setDirectives(t,e,r){e.forEach(n=>{this.handleDirective(t,n,r)})}static handleDirective(t,e,r){e.directive.callBack(t,e.attr.value,r)}static cache(t,e,r){if(r&&e){r[e]=t}}static createComponent(t,e,r){const n=t;n.parent=r;if(r&&r.persist===true&&n.persist!==false){n.persist=true}if(n.cache&&r){r[n.cache]=n}n.setup(e);const i=n.prepareLayout();this.build(i,n.container,n);n.afterBuild();if(t.component&&typeof t.onCreated==="function"){t.onCreated(n)}}static createNode(t,e,r){return qe.createNode(t,e,r)}};S.augment({buildLayout(s,t,e){g.build(s,t,e)}});var Pt=[];var $e=s=>Pt.indexOf(s)!==-1;var Ke=s=>({tag:"script",src:s.src,async:false,load(t){Pt.push(s.src);const e=s.load;if(e){e()}}});var Xe=s=>({tag:"link",rel:"stylesheet",type:"text/css",href:s.src,load(t){Pt.push(s.src);const e=s.load;if(e){e()}}});var Ot=class{constructor(t){this.percent=0;this.loaded=0;this.total=0;this.callBack=t||null}add(t){this.total++;let e;const r=this.update.bind(this);if(t.indexOf(".css")!==-1){e=Xe({load:r,src:t})}else{e=Ke({load:r,src:t})}g.build(e,document.head)}addFiles(t){if(!t){return}t.forEach(e=>{if(!$e(e)){this.add(e)}})}update(){const t=this.updateProgress();if(t<100){return}const e=this.callBack;if(e){e()}}updateProgress(){++this.loaded;return this.percent=Math.floor(this.loaded/this.total*100)}};var Ge=(s,t)=>{import(s).then(e=>{if(t){t(e)}})};var Qe=s=>{if(!s){return false}return typeof s?.prototype?.constructor==="function"};var Ze=(s,t,e)=>{const r=g.build(s,null,e);const n=r.firstChild;t.after(r);return n};var tr=s=>({tag:"comment",textContent:"import placeholder",onCreated:s.onCreated});var er=N({render(){return tr({onCreated:s=>{const t=this.src;if(!t){return}if(this.depends){const e=new Ot(()=>{this.loadAndRender(s)});e.addFiles(this.depends);return}this.loadAndRender(s)}})},getLayout(s){let t=s.default;if(!t){return null}const e=this.callBack;if(e){t=e(t)}else{if(Qe(t)){t=new t;t.route=this.route;if(this.persist){t.persist=true}}else{t=t()}}return this.layout=t},loadAndRender(s){Ge(this.src,t=>{this.loaded=true;const e=this.layout||this.getLayout(t);this.layoutRoot=Ze(e,s,this.parent)})},shouldUpdate(s){if(this.updateLayout===true){return true}return this.updateLayout=s&&s.isUnit&&typeof s.update==="function"},updateModuleLayout(s){const t=this.layout;if(this.shouldUpdate(t)){t.update(s)}},update(s){if(this.loaded===true){this.updateModuleLayout(s)}},beforeDestroy(){if(!this.layoutRoot){return}b.removeElement(this.layoutRoot)}});var Mt=s=>{return new er(s)};var Q=(s,t,e,r)=>{let n,i,o;if(Array.isArray(e[0])){e.forEach(a=>{if(!a){return}Q(s,t,a,r)});return}if(e.length<3){[n,i]=e}else{[t,n,i]=e}if(!t||!n){return false}switch(typeof i){case"object":o=a=>{nr(s,i,a)};break;case"function":o=a=>{rr(s,i,n,a,r)};break}y.watch(s,t,n,o)};var rr=(s,t,e,r,n)=>{let i=t(r,s,n);switch(typeof i){case"object":if(n&&i&&i.isUnit===true&&n.persist===true&&n.state){let o=e+":"+r,a=n.state,c=a.get(o);if(typeof c!=="undefined"){i=c}a.set(o,i)}sr(i,s,n);break;case"string":b.addHtml(s,i);break}};var sr=(s,t,e)=>{g.rebuild(s,t,e)};var nr=(s,t,e)=>{for(const[r,n]of Object.entries(t)){if(!r){continue}if(n===e){d.addClass(s,r)}else{d.removeClass(s,r)}}};var _=s=>{if(s.data){return s.data}if(s.context&&s.context.data){return s.context.data}return null};var mt=(s,t,e)=>{const r=_(e);Q(s,r,t,e)};var Zt=(s,t,e)=>{if(!t){return}if(t){d.setAttr(s,"role",t)}};var ir=s=>{return(t,e)=>{const r=e?"true":"false";d.setAttr(t,s,r)}};var te=(s,t,e)=>{if(!t){return}const r=t.role;if(r){d.setAttr(s,"role",r);t.role=null}Object.entries(t).forEach(([n,i])=>{if(i===null){return}const o=`aria-${n}`;if(Array.isArray(i)){i.push(ir(o));mt(s,i,e)}else{d.setAttr(s,o,i)}})};f.addType("context",s=>{if(!s){return false}s.parent.removeContextBranch(s.branch)});var Bt=s=>{return!s?null:s.getContext()};var ee=(s,t,e)=>{if(typeof t!=="function"){return}const r=Bt(e);const n=t(r);if(!n){return}const i=J.parse(n,e);w.addAttributes(s,i.attr,e);g.setDirectives(s,i.directives,e)};var re=(s,t,e)=>{if(typeof t!=="function"){return}const r=Bt(e);t(r)};var se=(s,t,e)=>{if(typeof t!=="function"||!e){return}const r=Bt(e);const n=t(r);if(!n){return}e.addContextBranch(n[0],n[1])};var ne=(s,t,e)=>{};var ie=(s,t,e)=>{if(!t||!e){return false}t(e,s)};var oe=(s,t,e)=>{if(!t||!e){return false}t(e.data,s)};var ae=(s,t,e)=>{if(!t||!e){return false}t(e.state,s)};var ce=(s,t,e)=>{if(!t||!e){return false}if(e.stateHelper){const r=e.state;const n=t(r);e.stateHelper.addStates(n)}};var he=(s,t,e)=>{let r,n,i;if(typeof t==="string"){r=_(e);n=t}else if(Array.isArray(t)){if(typeof t[0]!=="object"){const o=_(e);t.unshift(o)}[r,n,i]=t}y.bind(s,r,n,i)};var ue=(s,t,e)=>{let r,n,i,o;if(t.length<3){const c=_(e);if(!c){return}r=c;n=t[0];i=t[1];o=t[2]}else{r=t[0];n=t[1];i=t[2];o=t[3]}const a=o!==false;y.watch(s,r,n,c=>{b.removeAll(s);if(!c||c.length<1){return}const h=[];c.forEach((p,v)=>{const E=a?r.scope(n+"["+v+"]"):null;const q=p(c[v],v,E);if(q===null){return}h.push(q)});return g.build(h,s,e)})};var fe=(s,t,e)=>{const r=t[0];if(!r||r.length<1){return}const n=t[1];const i=[];r.forEach((o,a)=>{if(!o){return}const c=n(o,a);if(c===null){return}i.push(c)});return g.build(i,s,e)};var le=(s,t,e)=>{t(s)};f.addType("destroyed",s=>{if(!s){return false}s.callBack(s.ele)});var pe=(s,t,e)=>{or(s,t)};var or=(s,t)=>{f.add(s,"destroyed",{ele:s,callBack:t})};var de=(s,t,e)=>{Q(s,e.state,t,e)};var me=(s,t,e)=>{if(!t){return false}if(Array.isArray(t)&&typeof t[0]!=="string"){for(var r=0,n=t.length;r<n;r++){P.setup(s,t[r],e)}}else{P.setup(s,t,e)}};var ar=0;var Y=class{constructor(t){this.router=t;this.locationId="base-app-router-"+ar++;this.callBack=this.check.bind(this)}setup(){this.addEvent();return this}};var gt=class extends Y{addEvent(){l.on("popstate",window,this.callBack);return this}removeEvent(){l.off("popstate",window,this.callBack);return this}check(t){const e=t.state;if(!e||e.location!==this.locationId){return false}t.preventDefault();t.stopPropagation();this.router.checkActiveRoutes(e.uri)}createState(t,e={}){return{location:this.locationId,...e,uri:t}}addState(t,e,r=false){const n=window.history,i=n.state;if(i&&i.uri===t){return this}const o=this.createState(t,e);const a=r===false?"pushState":"replaceState";n[a](o,null,t);return this}};var yt=class extends Y{addEvent(){l.on("hashchange",window,this.callBack);return this}removeEvent(){l.off("hashchange",window,this.callBack);return this}check(t){this.router.checkActiveRoutes(t.newURL)}addState(t,e,r){window.location.hash=t;return this}};var bt=class{static browserIsSupported(){return"history"in window&&"pushState"in window.history}static setup(t){if(this.browserIsSupported()){return new gt(t).setup()}return new yt(t).setup()}};var xt=class{constructor(t,e){this.route=t;this.template=e.component;this.component=null;this.hasTemplate=false;this.setup=false;this.container=e.container;this.persist=e.persist;this.parent=e.parent;this.setupTemplate()}focus(t){if(this.setup===false){this.create()}this.update(t)}setupTemplate(){let t=this.template;if(typeof t==="string"){t=this.template=window[t];if(!t){return}}const e=typeof t;if(e==="function"){this.initializeComponent()}else if(e==="object"){this.initializeTemplateObject()}this.hasTemplate=true}initializeComponent(){this.component=new this.template({route:this.route,persist:this.persist,parent:this.parent})}initializeTemplateObject(){if(!this.template.isUnit){this.template=N(this.template)}const t=this.template;this.persist=t.persist!==false;Object.assign(t,{route:this.route,persist:this.persist,parent:this.parent});this.component=t}create(){if(!this.hasTemplate){return false}this.setup=true;let t=this.component;if(!this.persist||!t){t=this.component=this.template}g.render(t,this.container,this.parent)}remove(){if(this.setup!==true){return false}this.setup=false;const t=this.component;if(!t){return false}if(typeof t.destroy==="function"){t.destroy()}if(this.persist===false){this.component=null}}update(t){const e=this.component;if(!e){return false}if(typeof e.update==="function"){e.update(t)}}};var ge=s=>{if(!s.length){return null}const t={};s.forEach(e=>{t[e]=null});return t};var ye=s=>{const t=[];if(!s){return t}const e=/[*?]/g;s=s.replace(e,"");const r=/:(.[^./?&($]+)\?*/g,n=s.match(r);if(n===null){return t}n.forEach(i=>{if(i){i=i.replace(":","");t.push(i)}});return t};var cr=s=>s.replace(/\//g,"/");var hr=s=>{return s.replace(/(\/):[^/(]*?\?/g,t=>t.replace(/\//g,"(?:$|/)"))};var ur=s=>{s=s.replace(/(\?\/+\*?)/g,"?/*");return s.replace(/(:[^/?&($]+)/g,t=>t.indexOf(".")<0?"([^/|?]+)":"([^/|?]+.*)")};var fr=s=>s.replace(/(\*)/g,".*");var lr=(s,t)=>s+=t[t.length-1]==="*"?"":"$";var be=s=>{if(!s){return""}let t=cr(s);t=hr(t);t=ur(t);t=fr(t);t=lr(t,s);return t};var pr=0;var vt=class extends T{uriQuery=null;controller=null;paramKeys=null;titleCallBack=null;path=null;referralPath=null;params=null;callBack=null;title=null;constructor(t,e){const r=t.baseUri;const n=ye(r);const i=ge(n);const o=super(i);this.uri=r;this.paramKeys=n;this.titleCallBack=e;this.setupRoute(t);this.set("active",false);return o}setupRoute(t){this.id=t.id||"bs-rte-"+pr++;this.path=null;this.referralPath=null;let e=be(this.uri);this.uriQuery=new RegExp("^"+e);this.params=null;this.setupComponentHelper(t);this.callBack=t.callBack;this.title=t.title}setTitle(t){this.titleCallBack(this,t)}deactivate(){this.set("active",false);const t=this.controller;if(t){t.remove()}}getLayout(t){if(t.component){return t.component}let e=t.import;if(!e){return null}if(typeof e==="string"){e={src:e}}return Mt(e)}setupComponentHelper(t){const e=this.getLayout(t);if(!e){return}const{container:r,persist:n=false,parent:i}=t;const o={component:e,container:r,persist:n,parent:i};this.controller=new xt(this,o)}resume(t){const e=this.controller;if(e){e.container=t}}setPath(t,e){this.path=t;this.referralPath=e}select(){this.set("active",true);const t=this.stage,e=this.callBack;if(typeof e==="function"){e(t)}const r=this.controller;if(r){r.focus(t)}const n=this.path;if(!n){return}const i=n.split("#")[1];if(!i){return}this.scrollToId(i)}scrollToId(t){if(!t){return}const e=document.getElementById(t);if(!e){return}e.scrollIntoView(true)}match(t){let e=false;const r=t.match(this.uriQuery);if(r===null){this.resetParams();return e}if(!Array.isArray(r)){return e}r.shift();e=r;this.setParams(r);return e}resetParams(){this.stage={}}setParams(t){if(!Array.isArray(t)){return}const e=this.paramKeys;if(!e){return}const r={};e.forEach((n,i)=>{if(typeof n!=="undefined"){r[n]=t[i]}});this.set(r)}getParams(){return this.stage}};var dr=s=>{const t=/\w\S*/;return s.replace(t,e=>{return e.charAt(0).toUpperCase()+e.substring(1).toLowerCase()})};var mr=(s,t)=>{if(s.indexOf(":")===-1){return s}const e=t.stage;for(const[r,n]of Object.entries(e)){const i=new RegExp(":"+r,"gi");s=s.replace(i,n)}return s};var xe=(s,t,e)=>{if(!t){return t}if(typeof t==="function"){t=t(s.stage)}t=mr(t,s);t=dr(t);if(e!==""){t+=" - "+e}return t};var ve={removeSlashes(s){if(typeof s!=="string"){return""}if(s.substring(0,1)==="/"){s=s.substring(1)}if(s.substring(-1)==="/"){s=s.substring(0,s.length-1)}return s}};var kt=class extends M{beforeSetup(){this.selectedClass=this.activeClass||"active"}render(){const t=this.href,e=this.text,r=this.setupWatchers(t,e);return{tag:"a",class:this.class||this.className||null,onState:["selected",{[this.selectedClass]:true}],href:this.getString(t),text:this.getString(e),nest:this.nest||this.children,watch:r}}getString(t){const e=typeof t;return e!=="object"&&e!=="undefined"?t:null}setupWatchers(t,e){const r=this.exact!==false,n=D.data;const i=[];if(t&&typeof t==="object"){i.push({attr:"href",value:t})}if(e&&typeof e==="object"){i.push({attr:"text",value:e})}i.push({value:["[[path]]",n],callBack:(o,a)=>{const c=a.pathname+a.hash;const h=r?o===c:new RegExp("^"+a.pathname+"($|#|/|\\.).*").test(o);this.update(h)}});return i}setupStates(){return{selected:false}}update(t){this.state.set("selected",t)}};f.addType("routes",s=>{if(!s){return false}const t=s.route;if(t){D.removeRoute(t)}});f.addType("switch",s=>{if(!s){return false}const t=s.id;D.removeSwitch(t)});var Lt=class{constructor(){this.version="1.0.2";this.baseURI="/";this.title="";this.lastPath=null;this.path=null;this.history=null;this.callBackLink=null;this.location=window.location;this.routes=[];this.switches={};this.switchCount=0;this.data=new C({path:""})}setupHistory(){this.history=bt.setup(this)}createRoute(t){const e=t.uri||"*";t.baseUri=this.createURI(e);return new vt(t,this.updateTitle.bind(this))}add(t){if(typeof t!=="object"){const r=arguments;t={uri:r[0],component:r[1],callBack:r[2],title:r[3],id:r[4],container:r[5]}}const e=this.createRoute(t);this.addRoute(e);return e}addRoute(t){this.routes.push(t);this.checkRoute(t,this.getPath())}resume(t,e){t.resume(e);this.addRoute(t)}getBasePath(){if(!this.basePath){let t=this.baseURI||"";if(t[t.length-1]!=="/"){t+="/"}this.basePath=t}return this.basePath}createURI(t){const e=this.getBasePath();return e+ve.removeSlashes(t)}getRoute(t){const e=this.routes,r=e.length;if(r>0){for(var n=0;n<r;n++){var i=e[n];if(i.uri===t){return i}}}return false}getRouteById(t){const e=this.routes,r=e.length;if(r>0){for(var n=0;n<r;n++){var i=e[n];if(i.id===t){return i}}}return false}removeRoute(t){const e=this.routes,r=e.indexOf(t);if(r>-1){e.splice(r,1)}}addSwitch(t){const e=this.switchCount++;const r=this.getSwitchGroup(e);t.forEach(n=>{const i=this.createRoute(n);r.push(i)});this.checkGroup(r,this.getPath());return e}resumeSwitch(t,e){const r=this.switchCount++;const n=this.getSwitchGroup(r);t.forEach(i=>{const o=i.component.route;o.resume(e);n.push(o)});this.checkGroup(n,this.getPath());return r}getSwitchGroup(t){return this.switches[t]=[]}removeSwitch(t){const e=this.switches;if(e[t]){delete e[t]}}remove(t){t=this.createURI(t);const e=this.getRoute(t);if(e!==false){this.removeRoute(e)}return this}setup(t,e){this.baseURI=t||"/";this.updateBaseTag(this.baseURI);this.title=typeof e!=="undefined"?e:"";this.setupHistory();this.data.path=this.getPath();this.callBackLink=this.checkLink.bind(this);l.on("click",document,this.callBackLink);const r=this.getEndPoint();this.navigate(r,null,true);return this}updateBaseTag(t){const e=document.getElementsByTagName("base");if(e.length){e[0].href=t}}getParentLink(t){let e=t.parentNode;while(e!==null){if(e.nodeName.toLowerCase()==="a"){return e}e=e.parentNode}return false}checkLink(t){if(t.ctrlKey===true){return true}let e=t.target||t.srcElement;if(e.nodeName.toLowerCase()!=="a"){e=this.getParentLink(e);if(e===false){return true}}if(e.target==="_blank"||d.data(e,"cancel-route")){return true}const r=e.getAttribute("href");if(typeof r!=="undefined"){const n=this.baseURI,i=n!=="/"?r.replace(n,""):r;this.navigate(i);t.preventDefault();t.stopPropagation();return false}}reset(){this.routes=[];this.switches=[];this.switchCount=0;return this}activate(){this.checkActiveRoutes();return this}navigate(t,e,r){t=this.createURI(t);this.history.addState(t,e,r);this.activate();return this}updatePath(){const t=this.getPath();this.data.path=t}updateTitle(t){if(!t||!t.title){return this}const e=t.title;document.title=xe(t,e,this.title)}checkActiveRoutes(t){this.lastPath=this.path;t=t||this.getPath();this.path=t;const e=this.routes,r=e.length;let n;for(var i=0;i<r;i++){n=e[i];if(typeof n==="undefined"){continue}this.checkRoute(n,t)}this.checkSwitches(t);this.updatePath()}checkSwitches(t){const e=this.switches;for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r)){continue}var n=e[r];this.checkGroup(n,t)}}checkGroup(t,e){let r=false,n,i,o,a,c=false;for(var h=0,p=t.length;h<p;h++){n=t[h];if(typeof n==="undefined"){continue}if(h===0){i=n}if(!o&&n.get("active")){o=n}if(r!==false){if(c){n.deactivate()}continue}r=n.match(e);if(r!==false){a=n;if(n.controller){this.select(n);c=true}}}if(a===void 0){this.select(i);if(o&&i!==o){o.deactivate()}return}if(o){if(c&&a!==o){o.deactivate()}}else if(i&&c===false){this.select(i)}}checkRoute(t,e){const r=this.check(t,e);if(r!==false){this.select(t)}else{t.deactivate()}return r}check(t,e){if(!t){return false}e=e||this.getPath();return t.match(e)!==false}select(t){if(!t){return}t.setPath(this.path,this.lastPath);t.select();this.updateTitle(t)}getEndPoint(){const t=this.getPath();return t.replace(this.baseURI,"")||"/"}destroy(){l.off("click",document,this.callBackLink)}getPath(){let t=this.location,e=this.path=t.pathname;if(this.history.type==="hash"){return t.hash.replace("#","")}return e+t.search+t.hash}};var D=new Lt;var Ht=(s,t,e)=>{if(!t){return false}if(Array.isArray(t)){t.forEach(r=>{Ht(s,r,e)})}else{gr(s,t,e)}};var gr=(s,t,e)=>{t.container=s;t.parent=e;let r=D.add(t);yr(s,r)};var yr=(s,t)=>{f.add(s,"routes",{route:t})};var ke=(s,t,e)=>{let r=t[0];t.forEach(i=>{i.container=s;i.parent=e});const n=D.addSwitch(t);br(s,n)};var br=(s,t)=>{f.add(s,"switch",{id:t})};F.add("cache",ne).add("onCreated",le).add("onDestroyed",pe).add("bind",he).add("onSet",mt).add("onState",de).add("watch",me).add("useParent",ie).add("useData",oe).add("useState",ae).add("addState",ce).add("map",fe).add("for",ue).add("useContext",re).add("addContext",se).add("context",ee).add("role",Zt).add("aria",te).add("route",Ht).add("switch",ke);S.augment({Ajax:tt,Html:b,dataBinder:y,Data:C,SimpleData:T,Model:j,State:k,Builder:g,router:D,Component:M});export{tt as Ajax,O as Arrays,Be as Atom,g as Builder,M as Component,C as Data,f as DataTracker,Ye as DateTime,F as Directives,d as Dom,b as Html,Mt as Import,N as Jot,j as Model,kt as NavLink,m as Objects,T as SimpleData,k as State,x as Strings,u as Types,R as Unit,S as base,y as dataBinder,D as router};
|
|
2
2
|
//# sourceMappingURL=base.js.map
|