@aegis-framework/artemis 0.3.24 → 0.3.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,36 +1,2 @@
1
- parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"vI89":[function(require,module,exports) {
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Debug=exports.DebugLevel=void 0;const e={NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4,ALL:5};exports.DebugLevel=e;class t{static level(e){return"number"==typeof e&&(this._level=e),this._level}static log(...t){this.level()>=e.DEBUG&&console.log(...t)}static debug(...t){this.level()>=e.DEBUG&&console.debug(...t)}static info(...t){this.level()>=e.INFO&&console.info(...t)}static error(...t){this.level()>=e.ERROR&&console.error(...t)}static warning(...t){this.level()>=e.WARNING&&console.warn(...t)}static table(...t){this.level()>=e.DEBUG&&console.table(...t)}static group(...t){this.level()>=e.DEBUG&&console.group(...t)}static groupCollapsed(...t){this.level()>=e.DEBUG&&console.groupCollapsed(...t)}static groupEnd(...t){this.level()>=e.DEBUG&&console.groupEnd(...t)}static time(...t){this.level()>=e.DEBUG&&console.time(...t)}static timeLog(...t){this.level()>=e.DEBUG&&console.timeLog(...t)}static timeEnd(...t){this.level()>=e.DEBUG&&console.timeEnd(...t)}static trace(...t){this.level()>=e.DEBUG&&console.trace(...t)}}exports.Debug=t,t._level=e.NONE;
3
- },{}],"W6YR":[function(require,module,exports) {
4
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.$_=e,exports.$_ready=o,exports.DOM=void 0;class t{constructor(e){if(null===e)return this.collection=[],void(this.length=0);if("string"==typeof e)this.collection=document.querySelectorAll(e),this.length=this.collection.length,this._selector=e;else if(e instanceof NodeList)this.collection=e,this.length=e.length,this._selector=e;else if(e instanceof t)this.collection=e.collection,this.length=this.collection.length,this._selector=e._selector;else if(e instanceof HTMLElement)this.collection=[e],this.length=this.collection.length,this._selector=e;else{if("object"!=typeof e)return;e.length>=1?this.collection=e:this.collection=[e],this.length=this.collection.length,this._selector=e}}hide(){for(const t of this.collection)t.style.display="none"}show(t="block"){for(const e of this.collection)e.style.display=t}addClass(t){for(const e of this.collection)e.classList.add(t)}removeClass(t=null){if(null!==t)for(const e of this.collection)e.classList.remove(t);else for(const e of this.collection)for(;e.classList.length>0;)e.classList.remove(e.classList.item(0))}toggleClass(t){t=t.split(" ");for(const e of this.collection)for(let o=0;o<t.length;o++)e.classList.toggle(t[o])}hasClass(t){for(const e of this.collection)if(!e.classList.contains(t))return!1;return!0}value(t){if(void 0!==t)for(const e of this.collection)e.value=t;else if(this.length>0)return this.collection[0].value}focus(){this.length>0&&this.collection[0].focus()}click(t){for(const e of this.collection)e.addEventListener("click",t,!1)}keyup(t){for(const e of this.collection)e.addEventListener("keyup",t,!1)}keydown(t){for(const e of this.collection)e.addEventListener("keydown",t,!1)}submit(t){for(const e of this.collection)e.addEventListener("submit",t,!1)}change(t){for(const e of this.collection)e.addEventListener("change",t,!1)}scroll(t){for(const e of this.collection)e.addEventListener("scroll",t,!1)}on(t,o,i){t=t.split(" ");for(const n of this.collection)for(let l=0;l<t.length;l++)"function"==typeof o?n.addEventListener(t[l],o,!1):"string"==typeof o&&"function"==typeof i&&n.addEventListener(t[l],t=>{if(!t.target)return;const n=e(t.target).closestParent(o,this._selector);n.exists()&&i.call(n.get(0),t)},!1)}filter(e){return this.length>0?new t(this.collection[0].querySelector(e)):new t(null)}exists(){return this.length>0}data(t,e){if(void 0!==e)for(const o of this.collection)o.dataset[t]=e;else if(this.length>0)return this.collection[0].dataset[t]}removeData(t){for(const e of this.collection)delete e.dataset[t]}text(t){if(void 0!==t)for(const e of this.collection)e.textContent=t;else if(this.length>0)return this.collection[0].textContent}html(t){if(void 0!==t)for(const e of this.collection)e.innerHTML=t;else if(this.length>0)return this.collection[0].innerHTML}append(t){if(this.length>0)if("string"==typeof t){const e=document.createElement("div");e.innerHTML="string"==typeof t?t.trim():t,this.collection[0].appendChild(e.firstChild)}else this.collection[0].appendChild(t)}prepend(t){if(this.length>0)if("string"==typeof t){const e=document.createElement("div");e.innerHTML="string"==typeof t?t.trim():t,this.collection[0].childNodes.length>0?this.collection[0].insertBefore(e.firstChild,this.collection[0].childNodes[0]):this.collection[0].appendChild(e.firstChild)}else this.collection[0].childNodes.length>0?this.collection[0].insertBefore(t,this.collection[0].childNodes[0]):this.collection[0].appendChild(t)}each(t){for(const e of this.collection)t(e)}get(t){return this.collection[t]}first(){return this.length>0?new t(this.collection[0]):new t(null)}last(){return this.length>0?new t(this.collection[this.collection.length-1]):new t(null)}isVisible(){for(const t of this.collection)if("none"!=t.display&&t.offsetWidth>0&&t.offsetHeight>0)return!0;return!1}parent(){return this.length>0?new t(this.collection[0].parentElement):new t(null)}find(e){return this.length>0?new t(this.collection[0].querySelectorAll(e)):new t(null)}offset(){if(this.length>0){const t=this.collection[0].getBoundingClientRect();return{top:t.top+document.body.scrollTop,left:t.left+document.body.scrollLeft}}}closest(t){let e=null,o=this;for(;o.exists()&&null===e;){if(!0===o.matches(t))return o;const i=o.find(t);i&&i.length>0&&(e=i),o=o.parent()}return null!==e?e:o}closestParent(e,o){let i=this;for(;i.exists();){if(!0===i.matches(e))return i;if("string"==typeof o&&i.matches(o))break;i=i.parent()}return new t(null)}attribute(t,e){if(void 0!==e)for(const o of this.collection)o.setAttribute(t,e);else if(this.length>0)return this.collection[0].getAttribute(t)}hasAttribute(t){for(const e of this.collection)if(!e.hasAttribute(t))return!1;return!0}after(t){for(const e of this.collection)e.insertAdjacentHTML("afterend",t)}before(t){for(const e of this.collection)e.insertAdjacentHTML("beforebegin",t)}style(t,e){for(let o=0;o<this.collection.length;o++)if("string"==typeof t&&"undefined"!==e)this.collection[o].style[t]=e;else{if("string"==typeof t&&"undefined"===e)return this.collection[o].style[t];if("object"==typeof t)for(const e in t)this.collection[o].style[e]=t[e]}}animate(t,e){for(let o=0;o<this.collection.length;o++)for(const i in t){const n=(new Date).getTime(),l=this.collection;let s,c;void 0!==this.collection[o].style[i]?(c=this.collection[o].style[i],s=setInterval(()=>{const r=Math.min(1,((new Date).getTime()-n)/e);l[o].style[i]=c+r*(t[i]-c),1==r&&clearInterval(s)},25),this.collection[o].style[i]=c):void 0!==this.collection[o][i]&&(c=this.collection[o][i],s=setInterval(()=>{const r=Math.min(1,((new Date).getTime()-n)/e);l[o][i]=c+r*(t[i]-c),1==r&&clearInterval(s)},25),this.collection[o][i]=c)}}fadeIn(t=400,e){if(this.length>0){const o=this.collection[0];o.style.opacity=0;let i=+new Date;const n=()=>{o.style.opacity=+o.style.opacity+(new Date-i)/t,i=+new Date,+o.style.opacity<1?window.requestAnimationFrame&&requestAnimationFrame(n)||setTimeout(n,16):"function"==typeof e&&e()};n()}}fadeOut(t=400,e){if(this.length>0){let o=+new Date;const i=this.collection[0],n=()=>{i.style.opacity=+i.style.opacity-(new Date-o)/t,o=+new Date,+i.style.opacity>0?window.requestAnimationFrame&&requestAnimationFrame(n)||setTimeout(n,16):"function"==typeof e&&e()};n()}}matches(t){const e=Element.prototype,o=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector||function(){return-1!==[].indexOf.call(document.querySelectorAll(t),this)};return this.length>0&&o.call(this.collection[0],t)}remove(){for(const t of this.collection)t.parentNode.removeChild(t)}replaceWith(t){let e=t;if("string"==typeof t){const o=document.createElement("div");o.innerHTML=t,e=o.firstChild}for(const o of this.collection)o.parentElement.replaceChild(e,o)}reset(){for(const t of this.collection)t.reset()}property(t,e){if(void 0!==e)for(const o of this.collection)o[t]=e;else if(this.length>0)return this.collection[0][t]}}function e(e){return void 0!==e?new t(e):t}function o(t){window.addEventListener("load",t)}exports.DOM=t;
5
- },{}],"Z6Um":[function(require,module,exports) {
6
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Request=void 0;class e{static serialize(e){return Object.keys(e).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&")}static get(t,s={},o={}){const n=e.serialize(s);return""!==n&&(t=`${t}?${n}`),fetch(t,o)}static post(t,s,o={}){let n;if(void 0!==o.headers){const t=o.headers["Content-Type"];if(void 0!==t)if("multipart/form-data"==t){n=new FormData;for(const e in s)n.append(e,s[e])}else n="application/json"==t?JSON.stringify(s):e.serialize(s)}else n=e.serialize(s);const r=Object.assign({},{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n},o);return void 0!==r.headers&&"multipart/form-data"===r.headers["Content-Type"]&&delete r.headers["Content-Type"],fetch(t,r)}static put(t,s,o={}){return e.post(t,s,Object.assign({},{method:"PUT"},o))}static delete(t,s,o={}){return e.get(t,s,Object.assign({},{method:"DELETE"},o))}static json(t,s={},o={}){return e.get(t,s,o).then(e=>e.json())}static blob(t,s={},o={}){return e.get(t,s,o).then(e=>e.blob())}}exports.Request=e;
7
- },{}],"vs9F":[function(require,module,exports) {
8
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.FileSystem=void 0;var e=require("./Request");class t{static readRemote(r,s="base64",a={}){return e.Request.blob(r,{},a).then(e=>t.read(e,s))}static read(e,t="text"){return new Promise((r,s)=>{const a=new FileReader;a.onload=(e=>{r(e,e.target.result)}),a.onerror=(e=>{s(e)}),"base64"===t?a.readAsDataURL(e):"buffer"===t?a.readAsArrayBuffer(e):a.readAsText(e,"UTF-8")})}static create(e,t,r="text/plain"){return Promise.resolve(new File([t],e,{type:r}))}static extension(e){return e.split(".").pop()}static isImage(e){return["jpg","jpeg","png","gif","svg","webp","bmp"].indexOf(t.extension(e).toLowerCase())>-1}}exports.FileSystem=t;
9
- },{"./Request":"Z6Um"}],"A0Mx":[function(require,module,exports) {
10
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Form=void 0;var e=require("./DOM");class a{static fill(a,t){for(const s in t){const r=(0,e.$_)(`form[data-form='${a}'] [name='${s}']`).get(0);if(void 0!==r)switch(r.type){case"file":case"file[]":break;default:r.value=t[s]}}}static values(a){const t={};return(0,e.$_)(`form[data-form='${a}'] [name]`).each(e=>{let a;switch(e.type){case"file[]":a=e.files;break;case"file":a=e.files[0];break;default:a=e.value}null!=a&&(t[e.name]=a)}),t}}exports.Form=a;
11
- },{"./DOM":"W6YR"}],"g5IB":[function(require,module,exports) {
12
-
13
- var t,e,n=module.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}function u(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(n){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(n){e=o}}();var c,s=[],l=!1,a=-1;function f(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}function h(){if(!l){var t=i(f);l=!0;for(var e=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}function m(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new m(t,e)),1!==s.length||l||i(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0};
14
- },{}],"GRRb":[function(require,module,exports) {
15
- var process = require("process");
16
- var e=require("process");Object.defineProperty(exports,"__esModule",{value:!0}),exports.Platform=void 0;class t{static retina(){return window.devicePixelRatio>=2}static portrait(){return 0===window.orientation||180===window.orientation}static landscape(){return 90===window.orientation||-90===window.orientation}static orientation(){return t.portrait()?"portrait":"landscape"}static electron(){return"undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||(!(void 0===e||"object"!=typeof e.versions||!e.versions.electron)||"object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>-1)}static cordova(){return!!window.cordova}static desktop(e="Any"){let t=!1;switch(e){case"Windows":t=navigator.platform.includes("Win");break;case"macOS":t=navigator.platform.includes("Mac");break;case"Linux":t=navigator.platform.includes("Linux");break;case"FreeBSD":t=navigator.platform.includes("FreeBSD");break;case"webOS":t=navigator.platform.includes("WebTV");break;case"Any":default:t=navigator.platform.includes("Win")||navigator.platform.includes("Mac")||navigator.platform.includes("Linux")||navigator.platform.includes("FreeBSD")||navigator.platform.includes("WebTV")}return t}static mobile(e="Any"){let t=!1;switch(e){case"Android":t=/Android/i.test(navigator.userAgent);break;case"iOS":t=/iPhone|iPad|iPod/i.test(navigator.userAgent);break;case"Opera":t=/Opera Mini/i.test(navigator.userAgent);break;case"Windows":t=/Windows Phone|IEMobile|WPDesktop/i.test(navigator.userAgent);break;case"BlackBerry":t=/BlackBerry|BB10/i.test(navigator.userAgent);break;case"Any":default:t=/Android|iPhone|iPad|iPod|Windows Phone|IEMobile|WPDesktop|BlackBerry|BB10/i.test(navigator.userAgent)}return t}static serviceWorkers(){return"undefined"!=typeof navigator&&"serviceWorker"in navigator&&location.protocol.indexOf("http")>-1}}exports.Platform=t;
17
- },{"process":"g5IB"}],"JqUE":[function(require,module,exports) {
18
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Preload=void 0;var e=require("./Request");class r{static image(e){return new Promise((r,t)=>{const o=new Image;o.onload=(()=>{r(o)}),o.onerror=(e=>{t(e)}),o.src=e})}static file(r){return e.Request.blob(r)}}exports.Preload=r;
19
- },{"./Request":"Z6Um"}],"zbmM":[function(require,module,exports) {
20
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LocalStorage=void 0;class e{constructor({name:e="",version:t="",store:s=""}){this.name=e,this.version=t,this.store=s,this.upgrades={},""===this.version?this.numericVersion=0:this.numericVersion=parseInt(t.replace(/\./g,"")),this.id=""!==e&&""!==t&&""!==s?`${this.name}::${this.store}::${this.version}_`:""!==e&&""!==t?`${this.name}::${this.version}_`:""!==e?`${this.name}::_`:""}open(){return"object"!=typeof this.storage||this.storage instanceof Promise?this.storage instanceof Promise?this.storage:(this.storage=new Promise(e=>{let t=[];if(""!==this.version){let e="";""!==this.name&&""!==this.version&&""!==this.store?e=`${this.name}::${this.store}::`:""!==this.name&&""!==this.version&&(e=`${this.name}::`);const s=Object.keys(window.localStorage).filter(t=>0===t.indexOf(e)).map(t=>t.replace(e,"").split("_")[0]).filter(e=>-1===e.indexOf("::")).sort();if(s.length>0){const e=s[0],i=parseInt(e.replace(/\./g,""));if(i<this.numericVersion){const s=Object.keys(this.upgrades).sort(),r=s.findIndex(e=>{const[t]=e.split("::");return parseInt(t)===i});r>-1&&(t=s.slice(r).filter(e=>{const[t,s]=e.split("::");return parseInt(t)<this.numericVersion&&parseInt(s)<=this.numericVersion}));let o=`${this.name}::${e}_`;""!==this.name&&""!==this.version&&""!==this.store?o=`${this.name}::${this.store}::${e}_`:""!==this.name&&""!==this.version&&(o=`${this.name}::${e}_`);const n=Object.keys(window.localStorage).filter(e=>0===e.indexOf(o)).map(e=>e.replace(o,""));for(const e of n){const t=window.localStorage.getItem(`${o}${e}`);window.localStorage.setItem(this.id+e,t),window.localStorage.removeItem(`${o}${e}`)}}}}e({upgrades:t})}).then(({upgrades:e})=>(this.storage=window.localStorage,new Promise(t=>{this._upgrade(e,()=>t(this))}))),this.storage):Promise.resolve(this)}set(e,t){return this.open().then(()=>("object"==typeof t?this.storage.setItem(this.id+e,JSON.stringify(t)):this.storage.setItem(this.id+e,t),Promise.resolve({key:e,value:t})))}update(e,t){return this.get(e).then(s=>("object"==typeof s?("object"==typeof t&&(t=Object.assign({},s,t)),this.storage.setItem(this.id+e,JSON.stringify(t))):this.storage.setItem(this.id+e,t),Promise.resolve({key:e,value:t}))).catch(()=>this.set(e,t))}get(e){return this.open().then(()=>new Promise((t,s)=>{let i=null;i=this.storage.getItem(this.id+e);try{const e=JSON.parse(i);e&&"object"==typeof e&&(i=e)}catch(r){}null!=i?t(i):s()}))}getAll(){return this.keys().then(e=>{const t={},s=[];for(const i of e)s.push(this.get(i).then(e=>{t[i]=e}));return Promise.all(s).then(()=>t)})}contains(e){return this.keys().then(t=>{if(!t.includes(e))return Promise.reject();Promise.resolve()})}upgrade(e,t,s){return this.upgrades[`${parseInt(e.replace(/\./g,""))}::${parseInt(t.replace(/\./g,""))}`]=s,Promise.resolve()}_upgrade(e,t){e.length>0?this.upgrades[e[0]].call(this,this).then(()=>{this._upgrade(e.slice(1),t)}).catch(e=>console.error(e)):t()}rename(e){return this.name!==e?this.keys().then(t=>{const s=this.id;this.name=e,""!==this.name&&""!==this.version&&""!==this.store?this.id=`${this.name}::${this.store}::${this.version}_`:""!==this.name&&""!==this.version?this.id=`${this.name}::${this.version}_`:""!==this.name?this.id=`${this.name}::_`:this.id="";const i=[];for(const e of t)i.push(this.set(e,this.storage.getItem(`${s}${e}`)).then(()=>{this.storage.removeItem(`${s}${e}`)}));return Promise.all(i)}):Promise.reject()}key(e,t=!1){return this.open().then(()=>!0===t?Promise.resolve(this.storage.key(e)):Promise.resolve(this.storage.key(e).replace(this.id,"")))}keys(e=!1){return this.open().then(()=>Promise.resolve(Object.keys(this.storage).filter(e=>0===e.indexOf(this.id)).map(t=>!0===e?t:t.replace(this.id,""))))}remove(e){return this.get(e).then(t=>(this.storage.removeItem(this.id+e),Promise.resolve(t)))}clear(){return this.keys().then(e=>{for(const t of e)this.remove(t);return Promise.resolve()})}}exports.LocalStorage=e;
21
- },{}],"gTWm":[function(require,module,exports) {
22
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SessionStorage=void 0;var e=require("./LocalStorage");class o extends e.LocalStorage{constructor({name:e="",version:o="",store:s=""}){super({name:e,version:o,store:s})}open(){return void 0===this.storage&&(this.storage=window.sessionStorage),Promise.resolve(this)}}exports.SessionStorage=o;
23
- },{"./LocalStorage":"zbmM"}],"Yi2Q":[function(require,module,exports) {
24
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.IndexedDB=void 0;class e{constructor({name:e="",version:t="",store:s="",props:r={},index:n={}}){this.name=e,this.version=t,this.store=s,this.props=r,this.index=n,this.upgrades={},""===this.version?this.numericVersion=0:this.numericVersion=parseInt(t.replace(/\./g,""))}open(){return""===this.name?(console.error("No name has been defined for IndexedDB space."),Promise.reject()):""===this.store?(console.error("No store has been defined for IndexedDB space."),Promise.reject()):this.storage instanceof IDBDatabase?Promise.resolve(this):this.storage instanceof Promise?this.storage:(this.storage=new Promise((e,t)=>{let s=[];const r=window.indexedDB.open(this.name,this.numericVersion);r.onerror=(e=>{t(e)}),r.onsuccess=(t=>{e({storage:t.target.result,upgrades:s})}),r.onupgradeneeded=(t=>{if(t.oldVersion<1){const e=t.target.result.createObjectStore(this.store,this.props);for(const t of Object.keys(this.index))e.createIndex(this.index[t].name,this.index[t].field,this.index[t].props)}else{const e=Object.keys(this.upgrades).sort(),r=e.findIndex(e=>{const[s]=e.split("::");return parseInt(s)===t.oldVersion});r>-1&&(s=e.slice(r).filter(e=>{const[t,s]=e.split("::");return parseInt(t)<this.numericVersion&&parseInt(s)<=this.numericVersion}))}t.target.transaction.addEventListener("success",()=>{e({storage:t.target.result,upgrades:s})})})}).then(({storage:e,upgrades:t})=>(this.storage=e,new Promise(s=>{this._upgrade(t,()=>s(e),event)}))),this.storage)}set(e=null,t){return this.open().then(()=>new Promise((s,r)=>{const n=this.storage.transaction(this.store,"readwrite").objectStore(this.store);let i;(i=null!==e?n.put(Object.assign({},{id:e},t)):n.add(t)).addEventListener("success",e=>{s({key:e.target.result,value:t})}),i.addEventListener("error",e=>{r(e)})}))}update(e,t){return this.get(e).then(s=>void 0===s?this.set(e,t):new Promise((e,r)=>{const n=this.storage.transaction(this.store,"readwrite").objectStore(this.store).put(Object.assign({},s,t));n.addEventListener("success",s=>{e({key:s.target.result,value:t})}),n.addEventListener("error",e=>{r(e)})}))}get(e){return this.open().then(()=>new Promise((t,s)=>{const r=this.storage.transaction(this.store).objectStore(this.store).get(e);r.addEventListener("success",e=>{t(e.target.result)}),r.addEventListener("error",e=>{s(e)})}))}getAll(){return this.open().then(()=>new Promise((e,t)=>{const s=this.storage.transaction(this.store).objectStore(this.store).getAll();s.addEventListener("success",t=>{e(t.target.result)}),s.addEventListener("error",e=>{t(e)})}))}contains(e){return this.get(e).then(t=>{if(!t.includes(e))return Promise.reject();Promise.resolve()})}upgrade(e,t,s){return this.upgrades[`${parseInt(e.replace(/\./g,""))}::${parseInt(t.replace(/\./g,""))}`]=s,Promise.resolve()}_upgrade(e,t,s){e.length>0?this.upgrades[e[0]].call(this,this,s).then(()=>{this._upgrade(e.slice(1),t,s)}).catch(e=>console.error(e)):t()}rename(){return Promise.reject()}key(){return Promise.reject()}keys(){return this.open().then(()=>new Promise((e,t)=>{const s=this.storage.transaction(this.store,"readwrite").objectStore(this.store).getAllKeys();s.addEventListener("success",t=>{e(t.target.result)},!1),s.addEventListener("error",e=>{t(e)},!1)}))}remove(e){return this.get(e).then(t=>new Promise((s,r)=>{const n=this.storage.transaction(this.store,"readwrite").objectStore(this.store).delete(e);n.addEventListener("success",()=>{s(t)},!1),n.addEventListener("error",e=>{r(e)},!1)}))}clear(){return this.open().then(()=>new Promise((e,t)=>{const s=this.storage.transaction(this.store,"readwrite").objectStore(this.store).clear();s.addEventListener("success",()=>{e()},!1),s.addEventListener("error",e=>{t(e)},!1)}))}}exports.IndexedDB=e;
25
- },{}],"ivV6":[function(require,module,exports) {
26
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.RemoteStorage=void 0;var e=require("./../Request");class t{constructor({name:e="",version:t="",store:s="",endpoint:r="",props:o={}}){this.name=e,this.version=t,this.store=s,this.endpoint=`${r}${s}/`,this.props=o}open(){return void 0===this.storage&&(this.storage=e.Request),Promise.resolve(this)}set(e,t){return this.open().then(()=>this.storage.post(this.endpoint+e,t,this.props).then(t=>Promise.resolve({key:e,response:t.json()})))}update(e,t){return this.get(e).then(s=>this.storage.put(this.endpoint+e,Object.assign({},s,t),this.props).then(t=>Promise.resolve({key:e,response:t.json()})))}get(e){return this.open().then(()=>this.storage.json(this.endpoint+e,{},this.props))}getAll(){return this.open().then(()=>this.storage.json(this.endpoint,{},this.props))}contains(e){return this.keys().then(t=>{if(!t.includes(e))return Promise.reject();Promise.resolve()})}upgrade(){return Promise.reject()}rename(){return Promise.reject()}key(){return Promise.reject()}keys(){return this.open().then(()=>this.storage.json(this.endpoint,{keys:!0},this.props))}remove(e){return this.open().then(()=>this.storage.delete(this.endpoint+e,{},this.props).then(t=>Promise.resolve(e,t.json())))}clear(){return this.open().then(()=>this.storage.delete(this.endpoint,{},this.props))}}exports.RemoteStorage=t;
27
- },{"./../Request":"Z6Um"}],"y07N":[function(require,module,exports) {
28
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Space=exports.SpaceAdapter=void 0;var t=require("./SpaceAdapter/LocalStorage"),e=require("./SpaceAdapter/SessionStorage"),r=require("./SpaceAdapter/IndexedDB"),a=require("./SpaceAdapter/RemoteStorage");const s={LocalStorage:t.LocalStorage,SessionStorage:e.SessionStorage,IndexedDB:r.IndexedDB,RemoteStorage:a.RemoteStorage};exports.SpaceAdapter=s;class o{constructor(t=s.LocalStorage,e={}){this._configuration=Object.assign({},{name:"",version:"",store:""},e),this.adapter=new t(this._configuration),this.callbacks={create:[],update:[],delete:[]},this.transformations={}}configuration(t=null){if(null===t)return this._configuration;this._configuration=Object.assign({},this._configuration,t),this.adapter.configuration(t)}open(){return this.adapter.open().then(()=>Promise.resolve(this))}set(t,e){for(const r of Object.keys(this.transformations))"function"==typeof this.transformations[r].set&&(e=this.transformations[r].set.call(null,t,e));return this.adapter.set(t,e).then(({key:t,value:e})=>{for(const r of this.callbacks.create)r.call(null,t,e);return Promise.resolve({key:t,value:e})})}update(t,e){for(const r of Object.keys(this.transformations))"function"==typeof this.transformations[r].set&&(e=this.transformations[r].set.call(null,t,e));return this.adapter.update(t,e).then(({key:t,value:e})=>{for(const r of this.callbacks.update)r.call(null,t,e);return Promise.resolve({key:t,value:e})})}get(t){return this.adapter.get(t).then(e=>{for(const r of Object.keys(this.transformations))"function"==typeof this.transformations[r].get&&(e=this.transformations[r].get.call(null,t,e));return e})}getAll(){return this.adapter.getAll().then(t=>{for(const e of Object.keys(t))for(const r of Object.keys(this.transformations))"function"==typeof this.transformations[r].get&&(t[e]=this.transformations[r].get.call(null,e,t[e]));return t})}each(t){return this.getAll().then(e=>{const r=[];for(const a of Object.keys(e))r.push(t.call(this,a,e[a]));return Promise.all(r)})}contains(t){return this.adapter.contains(t)}upgrade(t,e,r){return this.adapter.upgrade(t,e,r).then(()=>Promise.resolve(this))}rename(t){return this.adapter.rename(t)}onCreate(t){this.callbacks.create.push(t)}onUpdate(t){this.callbacks.update.push(t)}onDelete(t){this.callbacks.delete.push(t)}addTransformation({id:t,get:e,set:r}){this.transformations[t]={id:t,get:e,set:r}}removeTransformation(t){delete this.transformations[t]}key(t,e=!1){return this.adapter.key(t,e)}keys(t=!1){return this.adapter.keys(t)}remove(t){return this.adapter.remove(t).then(e=>{for(const r of this.callbacks.delete)r.call(null,t,e)})}clear(){return this.adapter.clear()}}exports.Space=o;
29
- },{"./SpaceAdapter/LocalStorage":"zbmM","./SpaceAdapter/SessionStorage":"gTWm","./SpaceAdapter/IndexedDB":"Yi2Q","./SpaceAdapter/RemoteStorage":"ivV6"}],"lT4E":[function(require,module,exports) {
30
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Text=void 0;class e{static capitalize(e){return e.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase())}static suffix(e,t){let n="",r=t.indexOf(e);return-1!==r&&(r+=e.length,n=t.substr(r,t.length-r)),n}static selection(){return window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type?document.selection.createRange().text:void 0}static prefix(e,t){let n="";const r=t.indexOf(e);return-1!=r&&(n=t.substr(0,r)),n}static friendly(e){const t=[/[áàâãªä]/,/[ÁÀÂÃÄ]/,/[ÍÌÎÏ]/,/[íìîï]/,/[éèêë]/,/[ÉÈÊË]/,/[óòôõºö]/,/[ÓÒÔÕÖ]/,/[úùûü]/,/[ÚÙÛÜ]/,/ç/,/Ç/,/ñ/,/Ñ/,/_/,/[’‘‹›<>']/,/[“”«»„"]/,/[(){}[\]]/,/[?¿!¡#$%&^*´`~/°|]/,/[,.:;]/,/ /],n=["a","A","I","i","e","E","o","O","u","U","c","C","n","N","-","","","","","","-"];for(const r in t)e=e.replace(new RegExp(t[r],"g"),n[r]);return e}}exports.Text=e;
31
- },{}],"yzgE":[function(require,module,exports) {
32
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Util=void 0;class t{static callAsync(t,e,...r){try{const s=t.apply(e,r);return s instanceof Promise?s:Promise.resolve(s)}catch(o){return Promise.reject(o)}}static uuid(){if(window.crypto)return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16));{const t=()=>Math.floor(65536*(1+Math.random())).toString(16).substring(1);return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}}}exports.Util=t;
33
- },{}],"Focm":[function(require,module,exports) {
34
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./src/Debug");Object.keys(e).forEach(function(r){"default"!==r&&"__esModule"!==r&&Object.defineProperty(exports,r,{enumerable:!0,get:function(){return e[r]}})});var r=require("./src/DOM");Object.keys(r).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return r[e]}})});var t=require("./src/FileSystem");Object.keys(t).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})});var u=require("./src/Form");Object.keys(u).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return u[e]}})});var n=require("./src/Platform");Object.keys(n).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return n[e]}})});var o=require("./src/Preload");Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return o[e]}})});var c=require("./src/Request");Object.keys(c).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return c[e]}})});var f=require("./src/Space");Object.keys(f).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return f[e]}})});var s=require("./src/Text");Object.keys(s).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return s[e]}})});var a=require("./src/Util");Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return a[e]}})});
35
- },{"./src/Debug":"vI89","./src/DOM":"W6YR","./src/FileSystem":"vs9F","./src/Form":"A0Mx","./src/Platform":"GRRb","./src/Preload":"JqUE","./src/Request":"Z6Um","./src/Space":"y07N","./src/Text":"lT4E","./src/Util":"yzgE"}]},{},["Focm"], "Artemis")
36
- //# sourceMappingURL=artemis.min.js.map
1
+ !function(){function e(e,t){return Object.keys(t).forEach((function(n){"default"===n||"__esModule"===n||e.hasOwnProperty(n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})),e}function t(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}var n={},r={};function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}function c(e,t){return!t||"object"!=((n=t)&&n.constructor===Symbol?"symbol":typeof n)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t;var n}function f(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||f(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function h(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||f(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}t(r,"DebugLevel",(function(){return y})),t(r,"Debug",(function(){return d}));var y={NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4,ALL:5},d=function(){"use strict";function e(){o(this,e)}return a(e,null,[{key:"level",value:function(e){return"number"==typeof e&&(this._level=e),this._level}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).log.apply(r,h(t))}},{key:"debug",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).debug.apply(r,h(t))}},{key:"info",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.INFO&&(r=console).info.apply(r,h(t))}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.ERROR&&(r=console).error.apply(r,h(t))}},{key:"warning",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.WARNING&&(r=console).warn.apply(r,h(t))}},{key:"table",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).table.apply(r,h(t))}},{key:"group",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).group.apply(r,h(t))}},{key:"groupCollapsed",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).groupCollapsed.apply(r,h(t))}},{key:"groupEnd",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).groupEnd.apply(r,h(t))}},{key:"time",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).time.apply(r,h(t))}},{key:"timeLog",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).timeLog.apply(r,h(t))}},{key:"timeEnd",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).timeEnd.apply(r,h(t))}},{key:"trace",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).trace.apply(r,h(t))}}]),e}();d._level=y.NONE;var p={};t(p,"DOM",(function(){return g})),t(p,"$_",(function(){return m})),t(p,"$_ready",(function(){return k}));var g=function(){"use strict";function e(t){if(o(this,e),null===t)return this.collection=[],void(this.length=0);if("string"==typeof t)this.collection=document.querySelectorAll(t),this.length=this.collection.length,this._selector=t;else if(t instanceof NodeList)this.collection=t,this.length=t.length,this._selector=t;else if(t instanceof e)this.collection=t.collection,this.length=this.collection.length,this._selector=t._selector;else if(t instanceof HTMLElement)this.collection=[t],this.length=this.collection.length,this._selector=t;else{if("object"!=typeof t)return;t.length>=1?this.collection=t:this.collection=[t],this.length=this.collection.length,this._selector=t}}return a(e,[{key:"hide",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,o=this.collection[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){r.value.style.display="none"}}catch(e){t=!0,n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}return this}},{key:"show",value:function(e){var t=void 0===e?"block":e,n=!0,r=!1,o=void 0;try{for(var i,a=this.collection[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){i.value.style.display=t}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return this}},{key:"addClass",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.classList.add(e)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"removeClass",value:function(e){var t=void 0===e?null:e,n=!0,r=!1,o=void 0;if(null!==t)try{for(var i,a=this.collection[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){i.value.classList.remove(t)}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}else{var l=!0,u=!1,s=void 0;try{for(var c,f=this.collection[Symbol.iterator]();!(l=(c=f.next()).done);l=!0)for(var v=c.value;v.classList.length>0;)v.classList.remove(v.classList.item(0))}catch(e){u=!0,s=e}finally{try{l||null==f.return||f.return()}finally{if(u)throw s}}}return this}},{key:"toggleClass",value:function(e){e=e.split(" ");var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0)for(var a=o.value,l=0;l<e.length;l++)a.classList.toggle(e[l])}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"hasClass",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){if(!o.value.classList.contains(e))return!1}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return!0}},{key:"value",value:function(e){if(void 0!==e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.value=e}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}if(this.length>0)return this.collection[0].value}},{key:"focus",value:function(){return this.length>0&&this.collection[0].focus(),this}},{key:"click",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.addEventListener("click",e,!1)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"keyup",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.addEventListener("keyup",e,!1)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"keydown",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.addEventListener("keydown",e,!1)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"submit",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.addEventListener("submit",e,!1)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"change",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.addEventListener("change",e,!1)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"scroll",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.addEventListener("scroll",e,!1)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"on",value:function(e,t,n){e=e.split(" ");var r=!0,o=!1,i=void 0;try{for(var a,l=this,u=function(r,o){for(var i=o.value,a=0;a<e.length;a++){var u=l;"function"==typeof t?i.addEventListener(e[a],t,!1):"string"==typeof t&&"function"==typeof n&&i.addEventListener(e[a],(function(e){if(e.target){var r=m(e.target).closestParent(t,u._selector);r.exists()&&n.call(r.get(0),e)}}),!1)}},s=this.collection[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)u(0,a)}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return this}},{key:"filter",value:function(t){return this.length>0?new e(this.collection[0].querySelector(t)):new e(null)}},{key:"exists",value:function(){return this.length>0}},{key:"data",value:function(e,t){if(void 0!==t){var n=!0,r=!1,o=void 0;try{for(var i,a=this.collection[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){i.value.dataset[e]=t}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return this}if(this.length>0)return this.collection[0].dataset[e]}},{key:"removeData",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){delete o.value.dataset[e]}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"text",value:function(e){if(void 0!==e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.textContent=e}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}if(this.length>0)return this.collection[0].textContent}},{key:"html",value:function(e){if(void 0!==e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.innerHTML=e}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}if(this.length>0)return this.collection[0].innerHTML}},{key:"append",value:function(e){if(this.length>0)if("string"==typeof e){var t=document.createElement("div");t.innerHTML="string"==typeof e?e.trim():e,this.collection[0].appendChild(t.firstChild)}else this.collection[0].appendChild(e);return this}},{key:"prepend",value:function(e){if(this.length>0)if("string"==typeof e){var t=document.createElement("div");t.innerHTML="string"==typeof e?e.trim():e,this.collection[0].childNodes.length>0?this.collection[0].insertBefore(t.firstChild,this.collection[0].childNodes[0]):this.collection[0].appendChild(t.firstChild)}else this.collection[0].childNodes.length>0?this.collection[0].insertBefore(e,this.collection[0].childNodes[0]):this.collection[0].appendChild(e);return this}},{key:"each",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){e(o.value)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"get",value:function(e){return this.collection[e]}},{key:"first",value:function(){return this.length>0?new e(this.collection[0]):new e(null)}},{key:"last",value:function(){return this.length>0?new e(this.collection[this.collection.length-1]):new e(null)}},{key:"isVisible",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,o=this.collection[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){var i=r.value;if("none"!=i.display&&i.offsetWidth>0&&i.offsetHeight>0)return!0}}catch(e){t=!0,n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}return!1}},{key:"parent",value:function(){return this.length>0?new e(this.collection[0].parentElement):new e(null)}},{key:"find",value:function(t){return this.length>0?new e(this.collection[0].querySelectorAll(t)):new e(null)}},{key:"offset",value:function(){if(this.length>0){var e=this.collection[0].getBoundingClientRect();return{top:e.top+document.body.scrollTop,left:e.left+document.body.scrollLeft}}}},{key:"closest",value:function(e){for(var t=null,n=this;n.exists()&&null===t;){if(!0===n.matches(e))return n;var r=n.find(e);r&&r.length>0&&(t=r),n=n.parent()}return null!==t?t:n}},{key:"closestParent",value:function(t,n){for(var r=this;r.exists();){if(!0===r.matches(t))return r;if("string"==typeof n&&r.matches(n))break;r=r.parent()}return new e(null)}},{key:"attribute",value:function(e,t){if(void 0!==t){var n=!0,r=!1,o=void 0;try{for(var i,a=this.collection[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){i.value.setAttribute(e,t)}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return this}if(this.length>0)return this.collection[0].getAttribute(e)}},{key:"hasAttribute",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){if(!o.value.hasAttribute(e))return!1}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return!0}},{key:"after",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.insertAdjacentHTML("afterend",e)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"before",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.insertAdjacentHTML("beforebegin",e)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"style",value:function(e,t){for(var n=0;n<this.collection.length;n++)if("string"==typeof e&&void 0!==t)this.collection[n].style[e]=t;else{if("string"==typeof e&&void 0===t)return this.collection[n].style[e];if("object"==typeof e)for(var r in e)this.collection[n].style[r]=e[r]}return this}},{key:"animate",value:function(e,t){for(var n=this,r=function(r){var i=(new Date).getTime(),a=n.collection,l=void 0,u=void 0;void 0!==n.collection[o].style[r]?(u=n.collection[o].style[r],l=setInterval((function(){var n=Math.min(1,((new Date).getTime()-i)/t);a[o].style[r]=u+n*(e[r]-u),1==n&&clearInterval(l)}),25),n.collection[o].style[r]=u):void 0!==n.collection[o][r]&&(u=n.collection[o][r],l=setInterval((function(){var n=Math.min(1,((new Date).getTime()-i)/t);a[o][r]=u+n*(e[r]-u),1==n&&clearInterval(l)}),25),n.collection[o][r]=u)},o=0;o<this.collection.length;o++)for(var i in e)r(i);return this}},{key:"fadeIn",value:function(e,t){var n=void 0===e?400:e;if(this.length>0){var r=this.collection[0];r.style.opacity=0;var o=+new Date,i=function(){r.style.opacity=+r.style.opacity+(new Date-o)/n,o=+new Date,+r.style.opacity<1?window.requestAnimationFrame&&requestAnimationFrame(i)||setTimeout(i,16):"function"==typeof t&&t()};i()}return this}},{key:"fadeOut",value:function(e,t){var n=void 0===e?400:e;if(this.length>0){var r=+new Date,o=this.collection[0],i=function(){o.style.opacity=+o.style.opacity-(new Date-r)/n,r=+new Date,+o.style.opacity>0?window.requestAnimationFrame&&requestAnimationFrame(i)||setTimeout(i,16):"function"==typeof t&&t()};i()}return this}},{key:"matches",value:function(e){var t=Element.prototype,n=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||function(){return-1!==[].indexOf.call(document.querySelectorAll(e),this)};return this.length>0&&n.call(this.collection[0],e)}},{key:"remove",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,o=this.collection[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){var i=r.value;i.parentNode.removeChild(i)}}catch(e){t=!0,n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}return this}},{key:"replaceWith",value:function(e){var t=e;if("string"==typeof e){var n=document.createElement("div");n.innerHTML=e,t=n.firstChild}var r=!0,o=!1,i=void 0;try{for(var a,l=this.collection[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){var u=a.value;u.parentElement.replaceChild(t,u)}}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return this}},{key:"reset",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,o=this.collection[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){r.value.reset()}}catch(e){t=!0,n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}return this}},{key:"property",value:function(e,t){if(void 0!==t){var n=!0,r=!1,o=void 0;try{for(var i,a=this.collection[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){i.value[e]=t}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return this}if(this.length>0)return this.collection[0][e]}}]),e}();function m(e){return void 0!==e?new g(e):g}function k(e){window.addEventListener("load",e)}var w={};t(w,"FileSystem",(function(){return x}));var b={};t(b,"Request",(function(){return S}));var S=function(){"use strict";function e(){o(this,e)}return a(e,null,[{key:"serialize",value:function(e){return Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")}},{key:"get",value:function(t,n,r){var o=void 0===n?{}:n,i=void 0===r?{}:r,a=e.serialize(o);return""!==a&&(t="".concat(t,"?").concat(a)),fetch(t,i)}},{key:"post",value:function(t,n,r){var o,i=void 0===r?{}:r;if(void 0!==i.headers){var a=i.headers["Content-Type"];if(void 0!==a)if("multipart/form-data"==a)for(var l in o=new FormData,n)o.append(l,n[l]);else o="application/json"==a?JSON.stringify(n):e.serialize(n)}else o=e.serialize(n);var u=Object.assign({},{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:o},i);return void 0!==u.headers&&"multipart/form-data"===u.headers["Content-Type"]&&delete u.headers["Content-Type"],fetch(t,u)}},{key:"put",value:function(t,n,r){var o=void 0===r?{}:r;return e.post(t,n,Object.assign({},{method:"PUT"},o))}},{key:"delete",value:function(t,n,r){var o=void 0===r?{}:r;return e.get(t,n,Object.assign({},{method:"DELETE"},o))}},{key:"json",value:function(t,n,r){var o=void 0===n?{}:n,i=void 0===r?{}:r;return e.get(t,o,i).then((function(e){return e.json()}))}},{key:"blob",value:function(t,n,r){var o=void 0===n?{}:n,i=void 0===r?{}:r;return e.get(t,o,i).then((function(e){return e.blob()}))}}]),e}(),x=function(){"use strict";function e(){o(this,e)}return a(e,null,[{key:"readRemote",value:function(t,n,r){var o=void 0===n?"base64":n,i=void 0===r?{}:r;return S.blob(t,{},i).then((function(t){return e.read(t,o)}))}},{key:"read",value:function(e,t){var n=void 0===t?"text":t;return new Promise((function(t,r){var o=new FileReader;o.onload=function(e){t(e,e.target.result)},o.onerror=function(e){r(e)},"base64"===n?o.readAsDataURL(e):"buffer"===n?o.readAsArrayBuffer(e):o.readAsText(e,"UTF-8")}))}},{key:"create",value:function(e,t,n){var r=void 0===n?"text/plain":n;return Promise.resolve(new File([t],e,{type:r}))}},{key:"extension",value:function(e){return e.split(".").pop()}},{key:"isImage",value:function(t){return["jpg","jpeg","png","gif","svg","webp","bmp"].indexOf(e.extension(t).toLowerCase())>-1}}]),e}(),P={};t(P,"Form",(function(){return j}));var j=function(){"use strict";function e(){o(this,e)}return a(e,null,[{key:"fill",value:function(e,t){for(var n in t){var r=m("form[data-form='".concat(e,"'] [name='").concat(n,"']")).get(0);if(void 0!==r)switch(r.type){case"file":case"file[]":break;default:r.value=t[n]}}}},{key:"values",value:function(e){var t={};return m("form[data-form='".concat(e,"'] [name]")).each((function(e){var n;switch(e.type){case"file[]":n=e.files;break;case"file":n=e.files[0];break;default:n=e.value}null!=n&&(t[e.name]=n)})),t}}]),e}(),A={};t(A,"Platform",(function(){return F}));var E,O,L,I=E={};function T(){throw new Error("setTimeout has not been defined")}function _(){throw new Error("clearTimeout has not been defined")}function D(e){if(O===setTimeout)return setTimeout(e,0);if((O===T||!O)&&setTimeout)return O=setTimeout,setTimeout(e,0);try{return O(e,0)}catch(t){try{return O.call(null,e,0)}catch(t){return O.call(this,e,0)}}}!function(){try{O="function"==typeof setTimeout?setTimeout:T}catch(e){O=T}try{L="function"==typeof clearTimeout?clearTimeout:_}catch(e){L=_}}();var B,C=[],N=!1,M=-1;function R(){N&&B&&(N=!1,B.length?C=B.concat(C):M=-1,C.length&&U())}function U(){if(!N){var e=D(R);N=!0;for(var t=C.length;t;){for(B=C,C=[];++M<t;)B&&B[M].run();M=-1,t=C.length}B=null,N=!1,function(e){if(L===clearTimeout)return clearTimeout(e);if((L===_||!L)&&clearTimeout)return L=clearTimeout,clearTimeout(e);try{L(e)}catch(t){try{return L.call(null,e)}catch(t){return L.call(this,e)}}}(e)}}function V(e,t){this.fun=e,this.array=t}function W(){}I.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];C.push(new V(e,t)),1!==C.length||N||D(U)},V.prototype.run=function(){this.fun.apply(null,this.array)},I.title="browser",I.browser=!0,I.env={},I.argv=[],I.version="",I.versions={},I.on=W,I.addListener=W,I.once=W,I.off=W,I.removeListener=W,I.removeAllListeners=W,I.emit=W,I.prependListener=W,I.prependOnceListener=W,I.listeners=function(e){return[]},I.binding=function(e){throw new Error("process.binding is not supported")},I.cwd=function(){return"/"},I.chdir=function(e){throw new Error("process.chdir is not supported")},I.umask=function(){return 0};var F=function(){"use strict";function e(){o(this,e)}return a(e,null,[{key:"retina",value:function(){return window.devicePixelRatio>=2}},{key:"portrait",value:function(){return 0===window.orientation||180===window.orientation}},{key:"landscape",value:function(){return 90===window.orientation||-90===window.orientation}},{key:"orientation",value:function(){return e.portrait()?"portrait":"landscape"}},{key:"electron",value:function(){return"undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||(!(void 0===E||"object"!=typeof E.versions||!E.versions.electron)||"object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>-1)}},{key:"cordova",value:function(){return!!window.cordova}},{key:"desktop",value:function(e){var t=!1;switch(void 0===e?"Any":e){case"Windows":t=navigator.platform.includes("Win");break;case"macOS":t=navigator.platform.includes("Mac");break;case"Linux":t=navigator.platform.includes("Linux");break;case"FreeBSD":t=navigator.platform.includes("FreeBSD");break;case"webOS":t=navigator.platform.includes("WebTV");break;default:t=navigator.platform.includes("Win")||navigator.platform.includes("Mac")||navigator.platform.includes("Linux")||navigator.platform.includes("FreeBSD")||navigator.platform.includes("WebTV")}return t}},{key:"mobile",value:function(e){var t=!1;switch(void 0===e?"Any":e){case"Android":t=/Android/i.test(navigator.userAgent);break;case"iOS":t=/iPhone|iPad|iPod/i.test(navigator.userAgent);break;case"Opera":t=/Opera Mini/i.test(navigator.userAgent);break;case"Windows":t=/Windows Phone|IEMobile|WPDesktop/i.test(navigator.userAgent);break;case"BlackBerry":t=/BlackBerry|BB10/i.test(navigator.userAgent);break;default:t=/Android|iPhone|iPad|iPod|Windows Phone|IEMobile|WPDesktop|BlackBerry|BB10/i.test(navigator.userAgent)}return t}},{key:"serviceWorkers",value:function(){return"undefined"!=typeof navigator&&"serviceWorker"in navigator&&location.protocol.indexOf("http")>-1}}]),e}(),G={};t(G,"Preload",(function(){return q}));var q=function(){"use strict";function e(){o(this,e)}return a(e,null,[{key:"image",value:function(e){return new Promise((function(t,n){var r=new Image;r.onload=function(){t(r)},r.onerror=function(e){n(e)},r.src=e}))}},{key:"file",value:function(e){return S.blob(e)}}]),e}(),H={};t(H,"SpaceAdapter",(function(){return J})),t(H,"Space",(function(){return $}));var z=function(){"use strict";function e(t){var n=t.name,r=void 0===n?"":n,i=t.version,a=void 0===i?"":i,l=t.store,u=void 0===l?"":l;o(this,e),this.name=r,this.version=a,this.store=u,this.upgrades={},""===this.version?this.numericVersion=0:this.numericVersion=parseInt(a.replace(/\./g,"")),this.id=""!==r&&""!==a&&""!==u?"".concat(this.name,"::").concat(this.store,"::").concat(this.version,"_"):""!==r&&""!==a?"".concat(this.name,"::").concat(this.version,"_"):""!==r?"".concat(this.name,"::_"):""}return a(e,[{key:"open",value:function(){if("object"!=typeof this.storage||this.storage instanceof Promise){if(this.storage instanceof Promise)return this.storage;var e=this,t=this;return this.storage=new Promise((function(t){var n=[];if(""!==e.version){var r="";""!==e.name&&""!==e.version&&""!==e.store?r="".concat(e.name,"::").concat(e.store,"::"):""!==e.name&&""!==e.version&&(r="".concat(e.name,"::"));var o=Object.keys(window.localStorage).filter((function(e){return 0===e.indexOf(r)})).map((function(e){return e.replace(r,"").split("_")[0]})).filter((function(e){return-1===e.indexOf("::")})).sort();if(o.length>0){var i=o[0],a=parseInt(i.replace(/\./g,""));if(a<e.numericVersion){var l=e,u=Object.keys(e.upgrades).sort(),s=u.findIndex((function(e){var t=v(e.split("::"))[0];return parseInt(t)===a}));s>-1&&(n=u.slice(s).filter((function(e){var t=v(e.split("::")),n=t[0],r=t[1];return parseInt(n)<l.numericVersion&&parseInt(r)<=l.numericVersion})));var c="".concat(e.name,"::").concat(i,"_");""!==e.name&&""!==e.version&&""!==e.store?c="".concat(e.name,"::").concat(e.store,"::").concat(i,"_"):""!==e.name&&""!==e.version&&(c="".concat(e.name,"::").concat(i,"_"));var f=Object.keys(window.localStorage).filter((function(e){return 0===e.indexOf(c)})).map((function(e){return e.replace(c,"")})),h=!0,y=!1,d=void 0;try{for(var p,g=f[Symbol.iterator]();!(h=(p=g.next()).done);h=!0){var m=p.value,k=window.localStorage.getItem("".concat(c).concat(m));window.localStorage.setItem(e.id+m,k),window.localStorage.removeItem("".concat(c).concat(m))}}catch(e){y=!0,d=e}finally{try{h||null==g.return||g.return()}finally{if(y)throw d}}}}}t({upgrades:n})})).then((function(e){var n=e.upgrades,r=t;return t.storage=window.localStorage,new Promise((function(e){var t=r;r._upgrade(n,(function(){return e(t)}))}))})),this.storage}return Promise.resolve(this)}},{key:"set",value:function(e,t){var n=this;return this.open().then((function(){return"object"==typeof t?n.storage.setItem(n.id+e,JSON.stringify(t)):n.storage.setItem(n.id+e,t),Promise.resolve({key:e,value:t})}))}},{key:"update",value:function(e,t){var n=this,r=this;return this.get(e).then((function(r){return"object"==typeof r?("object"==typeof t&&(t=Object.assign({},r,t)),n.storage.setItem(n.id+e,JSON.stringify(t))):n.storage.setItem(n.id+e,t),Promise.resolve({key:e,value:t})})).catch((function(){return r.set(e,t)}))}},{key:"get",value:function(e){var t=this;return this.open().then((function(){var n=t;return new Promise((function(t,r){var o=null;o=n.storage.getItem(n.id+e);try{var i=JSON.parse(o);i&&"object"==typeof i&&(o=i)}catch(e){}null!=o?t(o):r()}))}))}},{key:"getAll",value:function(){var e=this;return this.keys().then((function(t){var n={},r=[],o=!0,i=!1,a=void 0;try{for(var l,u=function(t,o){var i=o.value;r.push(e.get(i).then((function(e){n[i]=e})))},s=t[Symbol.iterator]();!(o=(l=s.next()).done);o=!0)u(0,l)}catch(e){i=!0,a=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}return Promise.all(r).then((function(){return n}))}))}},{key:"contains",value:function(e){return this.keys().then((function(t){if(!t.includes(e))return Promise.reject();Promise.resolve()}))}},{key:"upgrade",value:function(e,t,n){return this.upgrades["".concat(parseInt(e.replace(/\./g,"")),"::").concat(parseInt(t.replace(/\./g,"")))]=n,Promise.resolve()}},{key:"_upgrade",value:function(e,t){var n=this;e.length>0?this.upgrades[e[0]].call(this,this).then((function(){n._upgrade(e.slice(1),t)})).catch((function(e){return console.error(e)})):t()}},{key:"rename",value:function(e){var t=this;return this.name!==e?this.keys().then((function(n){var r=t,o=t.id;t.name=e,""!==t.name&&""!==t.version&&""!==t.store?t.id="".concat(t.name,"::").concat(t.store,"::").concat(t.version,"_"):""!==t.name&&""!==t.version?t.id="".concat(t.name,"::").concat(t.version,"_"):""!==t.name?t.id="".concat(t.name,"::_"):t.id="";var i=[],a=!0,l=!1,u=void 0;try{for(var s,c=function(e,n){var a=n.value;i.push(t.set(a,t.storage.getItem("".concat(o).concat(a))).then((function(){r.storage.removeItem("".concat(o).concat(a))})))},f=n[Symbol.iterator]();!(a=(s=f.next()).done);a=!0)c(0,s)}catch(e){l=!0,u=e}finally{try{a||null==f.return||f.return()}finally{if(l)throw u}}return Promise.all(i)})):Promise.reject()}},{key:"key",value:function(e,t){var n=void 0!==t&&t,r=this;return this.open().then((function(){return!0===n?Promise.resolve(r.storage.key(e)):Promise.resolve(r.storage.key(e).replace(r.id,""))}))}},{key:"keys",value:function(e){var t=void 0!==e&&e,n=this;return this.open().then((function(){var e=n,r=n;return Promise.resolve(Object.keys(n.storage).filter((function(t){return 0===t.indexOf(e.id)})).map((function(e){return!0===t?e:e.replace(r.id,"")})))}))}},{key:"remove",value:function(e){var t=this;return this.get(e).then((function(n){return t.storage.removeItem(t.id+e),Promise.resolve(n)}))}},{key:"clear",value:function(){var e=this;return this.keys().then((function(t){var n=!0,r=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var l=i.value;e.remove(l)}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return Promise.resolve()}))}}]),e}(),J={LocalStorage:z,SessionStorage:function(e){"use strict";function t(e){var n,r=e.name,i=void 0===r?"":r,a=e.version,u=void 0===a?"":a,s=e.store,f=void 0===s?"":s;return o(this,t),c(this,(n=t,l(n)).call(this,{name:i,version:u,store:f}))}return s(t,e),a(t,[{key:"open",value:function(){return void 0===this.storage&&(this.storage=window.sessionStorage),Promise.resolve(this)}}]),t}(z),IndexedDB:function(){"use strict";function e(t){var n=t.name,r=void 0===n?"":n,i=t.version,a=void 0===i?"":i,l=t.store,u=void 0===l?"":l,s=t.props,c=void 0===s?{}:s,f=t.index,v=void 0===f?{}:f;o(this,e),this.name=r,this.version=a,this.store=u,this.props=c||{},this.index=v,this.keyPath=c.keyPath||"id",this.upgrades={},""===this.version?this.numericVersion=0:this.numericVersion=parseInt(a.replace(/\./g,""))}return a(e,[{key:"open",value:function(){if(""===this.name)return console.error("No name has been defined for IndexedDB space."),Promise.reject();if(""===this.store)return console.error("No store has been defined for IndexedDB space."),Promise.reject();if(this.storage instanceof IDBDatabase)return Promise.resolve(this);if(this.storage instanceof Promise)return this.storage;var e=this,t=this;return this.storage=new Promise((function(t,n){var r=e,o=[],i=window.indexedDB.open(e.name,e.numericVersion);i.onerror=function(e){n(e)},i.onsuccess=function(e){t({storage:e.target.result,upgrades:o})},i.onupgradeneeded=function(e){if(e.oldVersion<1){var n=e.target.result.createObjectStore(r.store,r.props),i=!0,a=!1,l=void 0;try{for(var u,s=Object.keys(r.index)[Symbol.iterator]();!(i=(u=s.next()).done);i=!0){var c=u.value;n.createIndex(r.index[c].name,r.index[c].field,r.index[c].props)}}catch(e){a=!0,l=e}finally{try{i||null==s.return||s.return()}finally{if(a)throw l}}}else{var f=r,h=Object.keys(r.upgrades).sort(),y=h.findIndex((function(t){var n=v(t.split("::"))[0];return parseInt(n)===e.oldVersion}));y>-1&&(o=h.slice(y).filter((function(e){var t=v(e.split("::")),n=t[0],r=t[1];return parseInt(n)<f.numericVersion&&parseInt(r)<=f.numericVersion})))}e.target.transaction.addEventListener("success",(function(){t({storage:e.target.result,upgrades:o})}))}})).then((function(e){var n=e.storage,r=e.upgrades,o=t;return t.storage=n,new Promise((function(e){o._upgrade(r,(function(){return e(n)}),event)}))})),this.storage}},{key:"set",value:function(e,t){var n=void 0===e?null:e,r=this;return this.open().then((function(){var e=r;return new Promise((function(r,o){var i,a=e.storage.transaction(e.store,"readwrite").objectStore(e.store);if(null!==n){var l={};l[e.keyPath]=n,i=a.put(Object.assign({},l,t))}else i=a.add(t);i.addEventListener("success",(function(e){r({key:e.target.result,value:t})})),i.addEventListener("error",(function(e){o(e)}))}))}))}},{key:"update",value:function(e,t){var n=this;return this.get(e).then((function(r){var o=n;return void 0===r?n.set(e,t):new Promise((function(e,n){var i=o.storage.transaction(o.store,"readwrite").objectStore(o.store).put(Object.assign({},r,t));i.addEventListener("success",(function(n){e({key:n.target.result,value:t})})),i.addEventListener("error",(function(e){n(e)}))}))}))}},{key:"get",value:function(e){var t=this;return this.open().then((function(){var n=t;return new Promise((function(t,r){var o=n.storage.transaction(n.store).objectStore(n.store).get(e);o.addEventListener("success",(function(e){var n=e.target.result;null!=n?t(n):r()})),o.addEventListener("error",(function(e){r(e)}))}))}))}},{key:"getAll",value:function(){var e=this;return this.open().then((function(){var t=e;return new Promise((function(e,n){var r=t,o=t.storage.transaction(t.store).objectStore(t.store).getAll();o.addEventListener("success",(function(t){var n=r,o={};t.target.result.forEach((function(e){var t=e[n.keyPath];delete e[n.keyPath],o[t]=e})),e(o)})),o.addEventListener("error",(function(e){n(e)}))}))}))}},{key:"contains",value:function(e){return this.get(e).then((function(t){if(!t.includes(e))return Promise.reject();Promise.resolve()}))}},{key:"upgrade",value:function(e,t,n){return this.upgrades["".concat(parseInt(e.replace(/\./g,"")),"::").concat(parseInt(t.replace(/\./g,"")))]=n,Promise.resolve()}},{key:"_upgrade",value:function(e,t,n){var r=this;e.length>0?this.upgrades[e[0]].call(this,this,n).then((function(){r._upgrade(e.slice(1),t,n)})).catch((function(e){return console.error(e)})):t()}},{key:"rename",value:function(){return Promise.reject()}},{key:"key",value:function(){return Promise.reject()}},{key:"keys",value:function(){var e=this;return this.open().then((function(){var t=e;return new Promise((function(e,n){var r=t.storage.transaction(t.store,"readwrite").objectStore(t.store).getAllKeys();r.addEventListener("success",(function(t){e(t.target.result)}),!1),r.addEventListener("error",(function(e){n(e)}),!1)}))}))}},{key:"remove",value:function(e){var t=this;return this.get(e).then((function(n){var r=t;return new Promise((function(t,o){var i=r.storage.transaction(r.store,"readwrite").objectStore(r.store).delete(e);i.addEventListener("success",(function(){t(n)}),!1),i.addEventListener("error",(function(e){o(e)}),!1)}))}))}},{key:"clear",value:function(){var e=this;return this.open().then((function(){var t=e;return new Promise((function(e,n){var r=t.storage.transaction(t.store,"readwrite").objectStore(t.store).clear();r.addEventListener("success",(function(){e()}),!1),r.addEventListener("error",(function(e){n(e)}),!1)}))}))}}]),e}(),RemoteStorage:function(){"use strict";function e(t){var n=t.name,r=void 0===n?"":n,i=t.version,a=void 0===i?"":i,l=t.store,u=void 0===l?"":l,s=t.endpoint,c=void 0===s?"":s,f=t.props,v=void 0===f?{}:f;o(this,e),this.name=r,this.version=a,this.store=u,this.endpoint="".concat(c).concat(u,"/"),this.props=v}return a(e,[{key:"open",value:function(){return void 0===this.storage&&(this.storage=S),Promise.resolve(this)}},{key:"set",value:function(e,t){var n=this;return this.open().then((function(){return n.storage.post(n.endpoint+e,t,n.props).then((function(t){return Promise.resolve({key:e,response:t.json()})}))}))}},{key:"update",value:function(e,t){var n=this;return this.get(e).then((function(r){return n.storage.put(n.endpoint+e,Object.assign({},r,t),n.props).then((function(t){return Promise.resolve({key:e,response:t.json()})}))}))}},{key:"get",value:function(e){var t=this;return this.open().then((function(){return t.storage.json(t.endpoint+e,{},t.props)}))}},{key:"getAll",value:function(){var e=this;return this.open().then((function(){return e.storage.json(e.endpoint,{},e.props)}))}},{key:"contains",value:function(e){return this.keys().then((function(t){if(!t.includes(e))return Promise.reject();Promise.resolve()}))}},{key:"upgrade",value:function(){return Promise.reject()}},{key:"rename",value:function(){return Promise.reject()}},{key:"key",value:function(){return Promise.reject()}},{key:"keys",value:function(){var e=this;return this.open().then((function(){return e.storage.json(e.endpoint,{keys:!0},e.props)}))}},{key:"remove",value:function(e){var t=this;return this.open().then((function(){return t.storage.delete(t.endpoint+e,{},t.props).then((function(t){return Promise.resolve(e,t.json())}))}))}},{key:"clear",value:function(){var e=this;return this.open().then((function(){return e.storage.delete(e.endpoint,{},e.props)}))}}]),e}()},$=function(){"use strict";function e(t,n){var r=void 0===t?J.LocalStorage:t,i=void 0===n?{}:n;o(this,e),this._configuration=Object.assign({},{name:"",version:"",store:""},i),this.adapter=new r(this._configuration),this.callbacks={create:[],update:[],delete:[]},this.transformations={}}return a(e,[{key:"configuration",value:function(e){var t=void 0===e?null:e;if(null===t)return this._configuration;this._configuration=Object.assign({},this._configuration,t),this.adapter.configuration(t)}},{key:"open",value:function(){var e=this;return this.adapter.open().then((function(){return Promise.resolve(e)}))}},{key:"set",value:function(e,t){var n=this,r=!0,o=!1,i=void 0;try{for(var a,l=Object.keys(this.transformations)[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){var u=a.value;"function"==typeof this.transformations[u].set&&(t=this.transformations[u].set.call(null,e,t))}}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return this.adapter.set(e,t).then((function(e){var t=e.key,r=e.value,o=!0,i=!1,a=void 0;try{for(var l,u=n.callbacks.create[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){l.value.call(null,t,r)}}catch(e){i=!0,a=e}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}return Promise.resolve({key:t,value:r})}))}},{key:"update",value:function(e,t){var n=this,r=!0,o=!1,i=void 0;try{for(var a,l=Object.keys(this.transformations)[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){var u=a.value;"function"==typeof this.transformations[u].set&&(t=this.transformations[u].set.call(null,e,t))}}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return this.adapter.update(e,t).then((function(e){var t=e.key,r=e.value,o=!0,i=!1,a=void 0;try{for(var l,u=n.callbacks.update[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){l.value.call(null,t,r)}}catch(e){i=!0,a=e}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}return Promise.resolve({key:t,value:r})}))}},{key:"get",value:function(e){var t=this;return this.adapter.get(e).then((function(n){var r=!0,o=!1,i=void 0;try{for(var a,l=Object.keys(t.transformations)[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){var u=a.value;"function"==typeof t.transformations[u].get&&(n=t.transformations[u].get.call(null,e,n))}}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}))}},{key:"getAll",value:function(){var e=this;return this.adapter.getAll().then((function(t){var n=!0,r=!1,o=void 0;try{for(var i,a=Object.keys(t)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var l=i.value,u=!0,s=!1,c=void 0;try{for(var f,v=Object.keys(e.transformations)[Symbol.iterator]();!(u=(f=v.next()).done);u=!0){var h=f.value;"function"==typeof e.transformations[h].get&&(t[l]=e.transformations[h].get.call(null,l,t[l]))}}catch(e){s=!0,c=e}finally{try{u||null==v.return||v.return()}finally{if(s)throw c}}}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return t}))}},{key:"each",value:function(e){var t=this;return this.getAll().then((function(n){var r=[],o=!0,i=!1,a=void 0;try{for(var l,u=Object.keys(n)[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){var s=l.value;r.push(e.call(t,s,n[s]))}}catch(e){i=!0,a=e}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}return Promise.all(r)}))}},{key:"contains",value:function(e){return this.adapter.contains(e)}},{key:"upgrade",value:function(e,t,n){var r=this;return this.adapter.upgrade(e,t,n).then((function(){return Promise.resolve(r)}))}},{key:"rename",value:function(e){return this.adapter.rename(e)}},{key:"onCreate",value:function(e){this.callbacks.create.push(e)}},{key:"onUpdate",value:function(e){this.callbacks.update.push(e)}},{key:"onDelete",value:function(e){this.callbacks.delete.push(e)}},{key:"addTransformation",value:function(e){var t=e.id,n=e.get,r=e.set;this.transformations[t]={id:t,get:n,set:r}}},{key:"removeTransformation",value:function(e){delete this.transformations[e]}},{key:"key",value:function(e,t){var n=void 0!==t&&t;return this.adapter.key(e,n)}},{key:"keys",value:function(e){var t=void 0!==e&&e;return this.adapter.keys(t)}},{key:"remove",value:function(e){var t=this;return this.adapter.remove(e).then((function(n){var r=!0,o=!1,i=void 0;try{for(var a,l=t.callbacks.delete[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){a.value.call(null,e,n)}}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}}))}},{key:"clear",value:function(){return this.adapter.clear()}}]),e}(),K={};t(K,"Text",(function(){return Q}));var Q=function(){"use strict";function e(){o(this,e)}return a(e,null,[{key:"capitalize",value:function(e){return e.replace(/\w\S*/g,(function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}))}},{key:"suffix",value:function(e,t){var n="",r=t.indexOf(e);return-1!==r&&(r+=e.length,n=t.substr(r,t.length-r)),n}},{key:"selection",value:function(){return window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type?document.selection.createRange().text:void 0}},{key:"prefix",value:function(e,t){var n="",r=t.indexOf(e);return-1!=r&&(n=t.substr(0,r)),n}},{key:"friendly",value:function(e){var t=[/[áàâãªä]/,/[ÁÀÂÃÄ]/,/[ÍÌÎÏ]/,/[íìîï]/,/[éèêë]/,/[ÉÈÊË]/,/[óòôõºö]/,/[ÓÒÔÕÖ]/,/[úùûü]/,/[ÚÙÛÜ]/,/ç/,/Ç/,/ñ/,/Ñ/,/_/,/[’‘‹›<>']/,/[“”«»„"]/,/[(){}[\]]/,/[?¿!¡#$%&^*´`~/°|]/,/[,.:;]/,/ /],n=["a","A","I","i","e","E","o","O","u","U","c","C","n","N","-","","","","","","-"];for(var r in t)e=e.replace(new RegExp(t[r],"g"),n[r]);return e}}]),e}(),X={};t(X,"Util",(function(){return Y}));var Y=function(){"use strict";function e(){o(this,e)}return a(e,null,[{key:"callAsync",value:function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];try{var i=e.apply(t,r);return i instanceof Promise?i:Promise.resolve(i)}catch(e){return Promise.reject(e)}}},{key:"uuid",value:function(){if(window.crypto)return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(function(e){return(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)}));var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}}]),e}();e(n,r),e(n,p),e(n,w),e(n,P),e(n,A),e(n,G),e(n,b),e(n,H),e(n,K),e(n,X),"object"==typeof window&&(window.Artemis=n)}();
2
+ //# sourceMappingURL=artemis.min.js.map