From 697b79cabdaad3789f135880017a159db89bea99 Mon Sep 17 00:00:00 2001 From: Denis <76569844+DenisPower1@users.noreply.github.com> Date: Mon, 25 Oct 2021 15:08:18 -0700 Subject: [PATCH] v1.2.4 --- inter.min.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inter.min.js b/inter.min.js index 740ec82..da24ece 100644 --- a/inter.min.js +++ b/inter.min.js @@ -1,6 +1,6 @@ /** * Inter. - * Version: 1.2.3 + * Version: 1.2.4 * 2021 - by Denis Power. * https://github.com/DenisPower1/inter * A Javascript framework to build interactive frontend applications. @@ -8,4 +8,4 @@ * */ -!function(){function e(e){return"[object Object]"==Object.prototype.toString.call(e)}function t(e){return Array.isArray(e)}function n(e){return"number"==typeof Number(e)}function r(e){return"function"==typeof e}function o(e){return"number"==typeof e||"boolean"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e?typeof e:Object.type(e)}function s(e){return e in this}function a(e){return!(null==e)}function l(e){return 1==e||0==e}function i(e){const t=e.tagName;return"input"==Y.call(t)||"textarea"==Y.call(t)}const c={get status(){return x.app.status}};function u(e){if("production"==c.status)return!1;throw new SyntaxError(e)}function d(e){if("production"!=c.status&&"development"==c.status)throw new TypeError(e)}function h(e){if(document instanceof Document){const t=document.getElementById(e);if(null!=t)return t;u(`\n There is not an element by id "${e}" on the document.\n `)}}function f(e){"production"!=c.status&&console.warn(e)}function p(e){return document instanceof Document?document.createTextNode(e):void 0}function g(e,t){return null!=e&&(ke(e)?e.hasAttribute(t):void 0)}function m(e){return document instanceof Document?document.createElement(e):void 0}function y(e,t,n){return null==e?void 0:e.setAttribute(t,n)}function b(e,t){return null==e?void 0:e.getAttribute(t)}function w(e){return 1==e}Object.destroyAll=(e=>{const t=Object.keys(e);for(let n of t)delete e[n]}),Object.type=(t=>e(t)?"object":Array.isArray(t)?"array":null==t?"null":void 0);const x=globalThis,O=/^\/(:?[\s\S]+)|\/$/;function j(e){return"a"==Y.call(e.nodeName)||"button"==Y.call(e.nodeName)}function E(){var e;if("[object Window]"==(e=this,Object.prototype.toString.apply(e,void 0)))return;const t=this.getElementsByTagName("*");for(let e of t)j(e)&&g(e,"setPath")&&(e.setpath=b(e,"setPath"),e.removeAttribute("setPath"),e.onclick=function(e){e.preventDefault();const t=this.setpath;O.test(t)?G.setPath(t):u("\n A valid pathName must start with /.\n ")}),j(e)&&g(e,"useHash")&&(e.setpath=b(e,"useHash"),e.removeAttribute("useHash"),e.onclick=function(e){e.preventDefault();const t=this.usehash;O.test(t)?G.useHash(t):u("\n A valid pathName must start with /.\n ")})}function T(e,t){return!Object.is(e,t)}const C=Symbol("StrictRed"),N={[C]:Object.create(null),create(e){return this[C][e]=A.create(null)},set(e,t){this[C][e].push(t)},get(e){return this[C][e]},has(e){return e in this[C]},reConstroy(e,t,n){let r=this.get(e);for(let e of r){const{text:r,target:o,refs:a}=e;s.call(a,t)&&(a[t]=n);let l=r,i=Object.getOwnPropertyNames(a);for(let e of i){const t=new RegExp(`{(:?\\s+)*(:?${e})(:?\\s+)*}`,"g");l=l.replace(t,a[e])}o.textContent=l}}};function R(){}R.prototype.create=(e=>null==e?[]:[...e]),R.prototype.shareItens=((e,t)=>{for(let n of e)t.push(n)}),R.prototype.destroy=(e=>{let t=e.length;for(;t--;)e.pop()});var A=new R;const $={handleMemory:A.create(null),refContainer(e){this.handleMemory.push(e)},hasRefContainer(e){let t;return this.handleMemory.some(n=>t=e==n),t}};let I="development";const P={get version(){return"1.2.3"},set status(e){if("production"!=I&&"development"!=e){if("production"!=e)throw new Error(`\n "${e}" is an invalid value for the app.status property.\n `);console.log("The app is now in production, every error will be\n hidden.\n "),I=e}},get status(){return I}};function S(){null!=new.target&&u('\n \n Do not call the "supportInter()" function with the "new" keyword,\n just invoke it like that: supportInter()\n \n ');try{let e=new Map;return e.set("framework","Inter"),e.set("Creator","Denis"),e.clear(),!0}catch(e){return!1}}Object.preventExtensions(P),Object.defineProperty(window,"onload",{set(e){"inputHandler"!=e?window.addEventListener("load",t=>{"development"==P.status&&console.log("You're using Inter in development mode, when you deploy your app turn on production mode."),z(),r(e)&&e(t)}):window.addEventListener("load",z())},get(){}}),window.onload=(()=>{z()});class k{constructor(){}addHTML(t){if(e(t)){const{in:e,elements:n}=t,o=h(e);n.forEach(e=>{const{tag:t,text:n,children:s=[],attrs:a={},events:l={}}=e;if(null==t)return!1;let i=m(t);Object.entries(a).forEach(e=>{const[t,n]=e;y(i,t,n)}),Object.entries(l).forEach(e=>{const[t,n]=e;i[t]=n,o.appendChild(i)}),null!=n&&0==s.length&&(r(n)?null!=n()&&i.appendChild(p(n())):i.appendChild(p(n))),s.length>0&&Fe(i,s),o.appendChild(i)})}else u("\n The argument passed in the method AddHTML must be a plain object.\n ")}}var L=new Proxy({url:function(e){return a(e)||u("The argument in validate.url() method must not be null or undefined."),/^(?:http:\/\/|https:\/\/)+(:?[A-Z]{2,8}\.)*(:?[a-z]+)+\.+(:?[a-z]{2,8})+(:?[\s\S])*$/i.test(e)},email:function(e){return a(e)||u("The argument in validate.email() method must not be null or undefined."),/^(?:[A-Z]+)+(:?[0-9]+)*@+(:?[A-Z]+)\.[A-Z]+$/i.test(e)}},{set:(e,t,n,r)=>"url"==t||"email"==t?(d("\n You must not overwrite built-in methods\n "),!1):Reflect.set(e,t,n,r),deleteProperty:(e,t)=>"url"==t||"email"==t?(d("\n You must not delete built-in methods\n "),!1):Reflect.deleteProperty(e,t)});Object.defineProperties(k.prototype,{toString:{value:()=>"[Object Inter]",toLocaleString:{value:()=>"[Object Inter]"}}});const H=new k,_=new Proxy(H,{set:(...e)=>(u("You can not set any property in Inter object,\n this is a fatal action.\n "),!1),deleteProperty:(...e)=>(u("Fatal error: do not try to delete any property of Inter object"),!1),getPrototypeOf:e=>null,setPrototypeOf:(...e)=>!1}),Y=String.prototype.toLowerCase;const B=new function(){this.query=function(n){if(e(n)){const{in:r,setting:o}=n,{applyTo:a,value:l,query:i}=o;e(o)||u("\n Setting must be an object.\n "),t(r)&&t(a)||u("\n The in=>target and the applyTo=>reciever properties must be array.\n ");let c=r.filter(e=>{s.call(e,i)||console.log(`It's was not found a property called "${i}" in target object, in data.query()`);const t=e[i];if(Y.call(t).includes(Y.call(l)))return e});if(A.destroy(a),""===l)return!1;A.shareItens(c,a)}else u("\nThe argument in data.query() must be an object.\n")}};function D(t){if(void 0!==new.target&&u("\n You must not create an instance for whileLoading() function, call it\n whileLoading(argument(object)). \n "),e(t)){const{elements:e}=t;let n=[...e],o=null;n.forEach(e=>{const{tag:t,text:n,attrs:s={},events:l={},children:i=[],styles:c={}}=e,u=m(t);Object.entries(s).forEach(e=>{const[t,n]=e;y(u,t,n)}),Object.entries(l).forEach(e=>{const[t,n]=e;u[t]=n}),Object.entries(c).forEach(e=>{const[t,n]=e;r(n)?u.style[t]=n():u.style[t]=n}),a(n)&&0==i.length&&(r(n)?u.appendChild(p(n)):u.appendChild(TExt(n))),i.length>0&&Fe(u,i),o=u,document.body.appendChild(u)}),document.onreadystatechange=function(){"complete"==this.readyState&&this.body.removeChild(o)}}else u("\n The value passed as argument in the method \n whileLoading() must be any object.\n \n ")}Object.defineProperty(B,"query",{enumerable:!0,value:B.query}),Object.freeze(B),Object.defineProperty(H,Symbol.hasInstance,{value:function(){return!1},enumerable:!1,configurable:!1,writable:!1});const M={refHandler:Object.create(null),has:function(e){return e in this.refHandler},get:function(e){return this.refHandler[e]},addRef:function(e,t){return this.refHandler[e]=t},freeAll(){return Object.destroyAll(this.refHandler)}};function V(e){return/^\[object HTML+(:?[A-Z]+)+Element\]$/i.test(e)}ne(_,"renderIf",r=>{const o=A.create(null);new Set;if(e(r)){const{in:i,watch:c,conditions:d}=r;function l(){const e=h(i);o.length>0&&(o.forEach((t,n)=>{const{el:r,index:o}=t;e.removeChild(r)}),A.destroy(o)),t(d)||u("\n conditions must be an array.\n "),[...d].forEach((t,r)=>{const{render:l}=t;if(!a(l.call(t))&&s.call(o,String(t.index))){const n=e.children[t.index];e.removeChild(n),delete o[String(t.index)]}if(V(l.call(t))){const r=t.index,s=e.children[r];if(n(r)){let n=e.children[r];if(function(e){return 1==e.children.length}(e)&&!a(t.replace)&&0==r){const t=e.children[0];return e.insertBefore(l()[0],t),o.push({el:e.children[r],index:r}),!1}if(a(s)&&w(t.replace))return e.replaceChild(l()[0],s),o.push({el:e.children[r],index:r}),!1;if(a(n))e.insertBefore(l()[0],n),o.push({el:e.children[r],index:r});else{e.children.length-1+1==r?(e.appendChild(l()[0]),o.push({el:e.children[r],index:r})):u(`Invalid index, it's impossible to render the element at index "${r}"!\n `)}}else u("\n The index in Inter.renderIf() must be a number.\n ")}})}e(c)||u("You must define the watch proprety and it's value must be an object."),be(c,l)}else u("\n \n The argument of Inter.renderIf() method must be a function must be\n an object.\n\n ");l()});const U=new class{constructor(){}typing(t){if(e(t)){const{in:e,setting:o,done:s}=t;var n=h(e);Array.from(o).forEach(e=>{const{text:t,speed:o}=e;let a=[...t][Symbol.iterator](),l=setInterval(()=>{let e=a.next().value;if(void 0!==e)M.has(n)?(n.textContent=`${M.get(n)}${e}`,M.addRef(n,`${M.get(n)}${e}`)):(n.textContent=e,M.addRef(n,e));else if(clearInterval(l),r(s))return s()},Number(o))})}}cleaning(t){if(e(t)){const{in:e,speed:n,done:o}=t,s=h(e),l=[...s.textContent];let i=setInterval(()=>{l.pop(),s.textContent=function(e){let t=[...e];return t.pop(),t.reduce((e,t)=>e.concat(t),"")}(s.textContent),a(l[0])||(clearInterval(i),M.has(s)&&delete M.refHandler[s],r(o)&&o())},Number(n))}else u("\n The value passed as argument in the method cleaning must be an object.\n ")}};var q=new Proxy(U,{deleteProperty:(...e)=>(u("\n You can not delety any property in\n simulate object\n \n "),!1),defineProperty:(...e)=>!1,set:(...e)=>!0,getPrototypeOf:e=>null,setPrototypeOf:(e,t)=>!1});function F(){}F.prototype.useHash=(e=>{O.test(e)||u("\n pathName must starts with /.\n ");const t=window.location.pathname;return a(e)||u("You must define the path of the url."),"/"==e?(window.history.pushState(null,null,`/#${e}`),ee.fire("URLCHANGED"),E.call(document.body),!1):"/"!=e&&"/"==t?(window.history.pushState(null,null,`/#${e}`),ee.fire("URLCHANGED"),E.call(document.body),!1):(window.history.replaceState(null,null,`/#${e}`),ee.fire("URLCHANGED"),void E.call(document.body))}),F.prototype.setPath=(e=>{const t=window.location.pathname;return O.test(e)||u("\n Pathname must starts with /.\n "),a(e)||u("\n setPath's parameter must not be a null or undefined value.\n "),"/"==e?(window.history.pushState(null,null,e),ee.fire("URLCHANGED"),E.call(document.body),!1):"/"!=e&&"/"==t?(window.history.pushState(null,null,e),ee.fire("URLCHANGED"),!1):(window.history.replaceState(null,null,e),ee.fire("URLCHANGED"),void E.call(document.body))});const G=Object.freeze(new F),W={handler:Object.create(null),justRegistered(e){return e in this.handler}};function z(){let e=null;var t=document.getElementsByTagName("*");for(let n=0;n{let t=W.handler[a];for(let n of t){const{target:t,text:o}=n,s=new RegExp(`{(:?\\s+)*(:?${r})(:?\\s+)*}`,"g");if(s.test(o)){let n=o.replace(s,e.target.value);t.textContent=n}}})}else u("\n Really? handleValue must be only setted in value that recieve value.\n ");ee.fire(`handler${e}`)}function Z(){}const J=String.prototype.toUpperCase;Z.prototype.request=function(t){"file:"==window.location.protocol&&d('\n \n You can not use the backend.request() method\n in an "file:" protocol, use a "http:" or "https:" protocol instead.\n\n ');const s={_set(e,t){this[e]=t},okay:null,error:null};e(t)||u(`\n \n The argument of backend.request()\n must be an object and not: ${o(t)}\n\n \n `);const{type:l,path:i,events:c={},headers:h={},body:p,security:g={},timeout:m,withCridentials:y}=t,b={get status(){return x.status},get statusText(){return x.statusText},isObj(){try{return JSON.parse(x.responseText),!0}catch(e){return!1}},get headers(){return x.getAllResponseHeaders()}},v={ontimeout:!0,onabort:!0,onprogress:!0};let x=new XMLHttpRequest;function O(){a(m)&&(n(m)?x.timeout=m:f(`\n \n \n The timeout property value must be a number,\n and you defined ${o(m)} as its value.\n \n `)),w(y)&&(x.withCredentials=!0);const t=J.call(l);oe(g)||!a(g)?x.open(t,i,!0):e(g)&&g.username&&g.password&&x.open(t,i,!0,g.username,g.password),Object.entries(h).forEach(e=>{const[t,n]=e;x.setRequestHeader(t,n)}),Object.entries(c).forEach(e=>{const[t,n]=e;Y.call(t)in v||d(`\n \n "${t}" is an unrecognised backend.request() event.\n `),r(n)&&Y.call(t)in v&&("onprogress"==t?x.onprogress=function(e){const t=Math.round(100*e.loaded/e.total);n(t)}:x[t]=n)}),x.onload=function(){let e=null;try{if(e=JSON.parse(this.responseText),200!==this.status)return r(s.error)&&s.error.call(b,e),!1;r(s.okay)&&s.okay.call(b,e)}catch(t){if(e=this.responseText,200!==this.status)return r(s.error)&&s.error.call(b,e),!1;r(s.okay)&&s.okay.call(b,e)}},x.onerror=function(){r(s.error)&&s.error.call(b,this.statusText)},"GET"==t?x.send(null):a(p)&&x.send(p)}return{okay(e){r(e)?(s._set("okay",e),O()):u("\n The argument of okay response method must be a function.\n ")},error(e){r(e)?(s._set("error",e),O()):u("\n The argument of error response method must be a function.\n ")},response(e,t){arguments.length<2&&u("\n backend.request().response() must have two arguments.\n "),r(e)&&r(t)?(s._set("okay",e),s._set("error",t),O()):u("\n The arguments of backend.request().response() must be functions.\n ")}}};const X=Object.freeze(new Z),K={protectedListener:Object.create(null),ref:Object.create(null),add:function(e,t){return this.ref[e]=t}},Q=new Proxy({},{set(e,t,n,r){t in K.ref&&K.ref[t](n)}});const ee=Object.freeze(new function(){this.fire=((e,t)=>{a(e)||u("\n You must define the event name.\n "),a(t)?Q[e]=t:Q[e]=void 0}),this.listen=((e,t)=>{null==e&&u("The first argument of event.listen() must be defined(the event name)."),r(t)||u("\n The second argument of event.listen() must be a function.\n "),s.call(K.ref,e)||K.add(e,t)}),this.removeListener=(e=>{if(a(e)||u("\n You must define the event's name you want to remove the listener\n "),s.call(K.ref,e)||f("\n Ops, you are trying to delete a listener that does not exist\n "),!s.call(K.protectedListener,e))return delete K.ref[e];u(`\n The listener of "${e}" is protected, you can not remove it.\n `)}),this.protectListener=(e=>{s.call(K.protectedListener,e)?f(`The listener of "${e}" is already protected. `):K.protectedListener[e]=!0}),this.hasListener=(e=>!!s.call(K.ref,e))}),te=new Proxy(Object.create(null),{set:(e,t,n,r)=>t in te?"Inter here":Reflect.set(e,t,n,r)});function ne(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0})}const re={handler:{},add(e,t){return this.handler[e].push(t)},create(e){return!(e in this.handler)&&(this.handler[e]=A.create(null))}};function oe(e){return 0==Object.keys(e).length}function se(){}function ae(e){return e.getElementsByTagName("*").length>0}se.prototype.each=((e,t,n,r)=>{if(ae(e)){const r=e.childNodes;for(let e=0;e{r(i[e])&&(p[e]=i[e].call(i))}),$.hasRefContainer(l)?(Object.destroyAll(re.handler),Object.destroyAll(ce.handle),Object.destroyAll(he.storage),Object.destroyAll(fe.storage),Object.destroyAll(N[d])):$.refContainer(l);const m=h(l).getElementsByTagName("*"),w=0!=m.length;ee.listen(`handler${l}`,()=>{const t=Object.create(null);e(c)&&(Object.entries(c).forEach(e=>{const[n,r]=e;t[n]=r}),Object.entries(c).forEach((e,n)=>{const[r,o]=e;let s=W.handler[l];for(let e of s){const{target:n,text:s,input:a}=e,l=new RegExp(`{(:?\\s+)*(:?${r})(:?\\s+)*}`,"g");if(l.test(s)){const e=s.replace(l,o);n.textContent=e}let i=new Proxy(t,{get:()=>a.value,set(e,t,o,a){const l=new RegExp(`{(:?\\s+)*(:?${r})(:?\\s+)*}`,"g"),i=s.replace(l,o);n.textContent=i}});window[r]=i}}))});const v=h(l).getElementsByTagName("*");var s=Object.keys(p);0==v.length&&(re.create(l),re.add(l,{target:h(l),text:h(l).textContent}));for(let e=0;e{const{text:o,target:s,attrName:i,attrValue:c}=e,u=new RegExp(`{(:?\\s+)*(:?${t})(:?\\s+)*}`,"g");if(a(o)){if(u.test(o)){N.has(l)&&N.reConstroy(l,t,n)}}else if(u.test(c)){const e=c.replace(u,n);e==c||("value"!=i?y(s,i,e):s.value=e)}});else{const o={refName:t,refValue:n,refContainer:l};Reflect.set(e,t,n,r),function(e){const{refName:t,refValue:n,refContainer:r}=e,o=h(r).getElementsByTagName("*"),s=new RegExp(`{(:?\\s+)*(:?${t})(:?\\s+)*}`,"g");for(let e of o)if(Ie(e)){const o=e.childNodes;for(let e of o)if(s.test(e.textContent)){re.add(r,{target:e,text:e.textContent});const o=e.textContent.replace(s,n);N.set(r,{target:e,text:e.textContent,refs:{[t]:n}}),e.textContent=o}}else if(s.test(e.textContent)){re.add(r,{target:e,text:e.textContent});const o=e.textContent.replace(s,n);N.set(r,{target:e,text:e.textContent,refs:{[t]:n}}),e.textContent=o}for(let e of o){const t=e.attributes;for(let o=0;o{const{target:r,text:o,attrName:s,attrValue:i}=e,c=new RegExp(`{(:?\\s+)*(:?${t})(:?\\s+)*}`,"g");a(s)&&c.test(i)&&re.handler[l].splice(n,1),a(o)&&c.test(o)&&re.handler[l].splice(n,1)}))}}),enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(t.reactor,"setRefs",{set(t){e(t)||u(`\n \n The value of [ REFERENCE REACTOR ].setRefs must be an object\n and you defined "${o(t)} as its value."\n\n `);for(let[e,n]of Object.entries(t))this[e]=n},configurable:!1}),0!=d&&a(d)?n=t.reactor:a(f)&&(x[f]=t.reactor)}if(!oe(i)&&a(i)){if(!fe.has(l)){const e=h(l).getElementsByTagName("*"),t=0==m.length;let n=A.create(null),r=A.create(null);if(t){const e=h(l).textContent;Object.getOwnPropertyNames(i).forEach(t=>{new RegExp(`{(:?\\s+)*(:?${t})(:?\\s+)*}`,"g").test(e)&&(n.push({target:h(l),text:e,position:null}),fe.set(l,n))})}else for(let t=0;t{let[t,n]=e;const r=fe.get(l),o=he.get(l);N.create(l);let s=N.get(l);A.shareItens(r,s);for(let e=0;e0&&s.length>0)for(let e=s.length-1;e>-1;e--)me(s[e],o[e])?o[e].parentNode.replaceChild(s[e],o[e]):a(o[e])&&a(s[e])&&ye(o[e],s[e])&&o[e].parentNode.replaceChild(s[e],o[e]);else{if(function(e,t){const n=e.getElementsByTagName("*").length,r=t.getElementsByTagName("*").length;return 0==n&&r>0||n>0&&0==r}(e,r))return t.replaceChild(e,r),!1;ye(e,r)&&t.replaceChild(e,r)}}function me(e,t){return!(e.nodeName==t.nodeName)}function ye(e,t){let n=!1;const r=e.attributes,o=t.attributes;if(T(t.render,!0)||(n=!0),!n)if(r.length!==o.length)n=!0;else for(let t of o){const r=t.name,o=t.value;if(!g(e,r)){n=!0;break}if(g(e,r)){if(b(e,r)!==o){n=!0;break}}}if(!n&&e.textContent&&t.textContent){if(Ie(e)&&Ie(t))return!1;n=e.textContent!==t.textContent}return n}function be(t,n,r){const s=Symbol("reactive");if(s in t)return!1;const a=Object.assign({},t),l=Object.keys(t);for(let o of l)r&&"defineProps"==o&&(t._defineProps=t[o],a._defineProps=t[o],delete t[o],delete a[o],f(`\n "defineProps" is a reserved property in the objects that are the values\n of data array in Inter.for(). So Inter redefined it to "${o="_defineProps"}".\n \n `)),Object.defineProperty(t,[o],{set(e){a[o]=e,n()},get:()=>a[o]}),e(t[o])&&be(t[o],n,!0);r&&(Object.defineProperty(t,"defineProps",{set(r){e(r)||u(`\n \n The value of "defineProps" must be an object, and you defined\n "${o(r)}" as its value.\n\n Must be:\n\n [The object].defineProps={\n\n prop:value\n\n }\n \n\n `);for(let[e,o]of Object.entries(r))e in this||(a[e]=o,Object.defineProperty(t,[e],{set(t){a[e]=t,n()},get:()=>a[e]}),n())}}),Object.defineProperty(t,s,{value:!0,configurable:!1,writable:!1}))}ne(_,"for",n=>{let{in:o,do:s,data:l,react:i}=n,c=null;if(t(l)){!function n(){c=new Proxy(l,{set:(t,n,r,o)=>(t[n]=r,e(r)&&be(r,f,!0),f(),!0)}),Object.defineProperty(c,"otherArray",{set(r){if(t(r)){l=r,f();for(let t of r)e(t)&&be(t,f,!0);n()}else u(`\n "${r}" is not an array.\n `)},get:()=>null,configurable:!0}),Object.defineProperty(c,"concat",{value:n=>{if(t(n)){for(let e of n)c.push(e);return f(),[...l]}return c.push(n),e(n)&&be(n,f,!0),[...l]},configurable:!0}),a(i)&&(window[i]=c)}()}if(t(l)||d("data in Inter.for() must be an array."),r(s)){const t=h(o);for(let t of l)e(t)&&be(t,f,!0);function f(){if(l.lengthl.length;--n)t.removeChild(e[e.length-1])}if(!pe.has(o))return l.forEach((e,n)=>{var r=s.call(c,e,n);V(r)||u(`\n You are not return the template()\n function in do() method(Inter.for), it is happening where the target id is "${o}".\n\n `);for(let e of r)t.appendChild(e)}),pe.set(o),!1;pe.has(o)&&l.forEach((e,n)=>{let r=s.call(c,e,n);if(a(t.children[n]))for(let e of r)ge(e,t,n);if(!a(t.children[n])&&l.length>t.children.length)for(v of r)t.appendChild(v)})}}else d("do in Inter.for() must be a function");f()});const we={store:Object.create(null),set(e,t){this.store[e]=t},hasNotFound(){return"*"in this.store},get(){return this.store["*"]()}};function ve(){return!!window.location.hash}function xe(t){if(e(t)){const{routes:e}=t,n=Object.create(null);Object.entries(e).forEach(e=>{const[t,o]=e;if(O.test(t)||"*"==t||u("\n Route name must start with /.\n "),r(o)||u("\n Route action must be a function.\n "),"*"!=t&&t.includes("*")){let e=t.replaceAll("?","(:?\\?)");e=e.replaceAll("*","(:?[\\s\\S]+)"),n[e]=o}else"*"!==t&&(n[t]=o)}),r(e["*"])&&we.set("*",e["*"]);const o=x.location.search,s=o;if(o&&Object.keys(n).some(e=>{let t=new RegExp,r=e.replace(/\//,"");if(t.compile(r).test(s))return n[e](),!1}),ve()){const e=window.decodeURI(window.location.hash.replace("#",""));let t=!1;Object.keys(n).some(r=>{(new RegExp).compile(r).test(e)&&(n[r](),t=!0)}),t||(we.hasNotFound()?we.get():f('\n You should always create a notfound route with "*" property.\n '))}else{let e=!1;const t=window.location.pathname;Object.keys(n).some(r=>{(new RegExp).compile(r).test(t)&&(e=!0,n[r]())}),e||(we.hasNotFound()?we.get():f('\n You should always create a notfound route with "*" property.\n '))}ee.listen("URLCHANGED",()=>{const e=x.location.search,t=e;if(e&&Object.keys(n).some(e=>{let r=new RegExp,o=e.replace(/\//,"");if(r.compile(o).test(t))return n[e](),!1}),ve()){const e=window.decodeURI(window.location.hash.replace("#",""));let t=!1;Object.keys(n).some(r=>{(new RegExp).compile(r).test(e)&&(n[r](),t=!0)}),t||(we.hasNotFound()?we.get():f('\n You should always create a notfound route with "*" property.\n '))}else{const e=window.location.pathname;let t=!1;if(Object.keys(n).some(r=>{(new RegExp).compile(r).test(e)&&(n[r](),t=!0)}),!t){if(we.hasNotFound())return we.get();f('\n You should always create a notfound route with "*" property.\n ')}}}),window.onpopstate=(()=>{const e=x.location.search,t=e;if(e&&Object.keys(n).some(e=>{let r=new RegExp,o=e.replace(/\//,"");if(r.compile(o).test(t))return n[e](),!1}),ve()){const e=window.decodeURI(window.location.hash.replace("#",""));let t=!1;if(Object.keys(n).some(r=>{(new RegExp).compile(r).test(e)&&(n[r](),t=!0)}),!t){if(we.hasNotFound())return we.get();f('\n You should always create a notfound route with "*" property.\n ')}}else{const e=window.location.pathname;let t=!1;Object.keys(n).some(r=>{(new RegExp).compile(r).test(e)&&(n[r](),t=!0)}),t||(we.hasNotFound()?we.get():f('\n You should always create a notfound route with "*" property.\n '))}})}else u("\nThe argument of ROUTER() must be an object.\n");E.call(document.body)}let Oe=new class{constructor(){}each(e){const{in:t,do:n}=e;let r=A.create(null),o=h(t).getElementsByTagName("*");for(let e of o)i(e)&&r.push(e);for(let e=0;e{const n=this[Ee][t];for(let t of n)e(t.clonedInput)})}else u("\n send's argument must be a function.\n ")}};function Ie(e){return e.children.length>0}function Pe(){this[Symbol("store_Symbol")]=Object.create(null),this[Symbol("protect")]=new Set}Object.freeze($e),Pe.prototype.set=function(e,t){const n=Object.getOwnPropertySymbols(this)[0];if(arguments.length<2&&u("\n storage.set() must have two arguments!\n "),this[Object.getOwnPropertySymbols(this)[1]].has(e)&&u(`\n \n The info named "${e}" is protect\n and you can not overwritten it.\n\n `),!(e in this[n]))return this[n][e]=t;this[n][e]=t,f(`\n there's already an element named "${e}" on the storage, and it's value\n was overwritten.\n `)},Pe.prototype.get=function(e,t){const n=Object.getOwnPropertySymbols(this)[0];if(arguments.length<2&&u("\n storage.get() must have two arguments!\n "),r(t)||u("\n The second argument in storage.get() must be a function.\n "),s.call(this[n],e)){return t(this[n][e])}f("\n You are trying to get an element that is not actually registered in the storage.\n ")},Pe.prototype.has=function(e){const t=Object.getOwnPropertySymbols(this)[0];if(a(e))return s.call(this[t],e);u("\n You must define the element to check its existence in the storage.\n ")},Pe.prototype.delete=function(e){const t=Object.getOwnPropertySymbols(this)[0];if(a(e)||u("You must define the key you want to delete from storage."),s.call(this[t],e)){this[Object.getOwnPropertySymbols(this)[1]].has(e)&&u(`\n \n The info named "${e}" is protect\n and you can not delete it from the storage.\n\n `),delete this[t][key]}else u("\n You're trying to delete a key that is not in the storage.\n ")},Pe.prototype.protect=function(e){if(null==e&&u("\n \n You must define the info name to protect\n in storage.protect(infoName)\n\n "),this.has(e)){this[Object.getOwnPropertySymbols(this)[1]].add(e)}else u(`\n \n The info named ${e} is not on the storage yet,\n so register it first and then protect it.\n \n `)};const Se=Object.freeze(new Pe);function ke(e){return 1==e.nodeType}function Le(){}Le.prototype.previous=((e,t)=>{if(ke(e),r(t)){const n=A.create(null),r=e.parentNode.children;for(child of r){if(e.isSameNode(child)){n.push(child),t([...n]),A.destroy(n);break}n.push(child)}}else;}),Le.prototype.next=((e,t)=>{if(ke(e)||u('\nThe first argument in "interface.next()" must be a valid HTML element.\n'),r(t)){let n=!1;const r=A.create(null),o=e.parentNode.children;for(let t of o)(e.isSameNode(t)||n)&&(r.push(t),n||(n=!0));t([...r]),A.destroy(r)}else u('\nThe second argument in "interface.next()" must be a function.\n')});const He=Object.freeze(new Le);function _e(t,n,o,a){Object.entries(n).reduce((e,n)=>{const[o,s]=n;null==s||o.startsWith("on")?o.startsWith("on")&&r(s)&&(t[o]=function(e){s.call(a,e)}):y(t,o,s)},{}),Object.entries(a).reduce((e,n)=>{const[o]=n;Object.defineProperty(a,o,{set(e){null==e?o.startsWith("on")?t[o]=void 0:t.removeAttribute(o):o.startsWith("on")?(r(e)||u(`\n The value of "${e}" event, must be a function.\n `),t[o]=function(t){e.call(a,t)}):y(t,o,e)},get(){if(!o.startsWith("on"))return b(t,o);u(`\n "${o}" seems to be an event listener, \n and you can not get the value of an event.\n `)}})},{});const l=Object.create(null);Object.defineProperty(l,[o],{value:new Proxy(n,{set(e,n,o,a){if(s.call(e,n)){if(null==o)return n.startsWith("on")?t[n]=void 0:t.removeAttribute(n),!1;if("value"!=n&&!n.startsWith("on"))return y(t,n,o),Reflect.set(e,n,o,a),!1;"value"==n?(t.value=o,Reflect.set(e,n,o,a)):n.startsWith("on")&&(r(o)||u(`\n Oh, the value of "${n}" event, must be a function.\n `),t[n]=function(t){o.call(e,t)})}},get(e,n,r){if(!n.startsWith("on"))return t[n];u(`"${n}" seems to be an event listener, and you can\n not get the value of an event`)}})}),e(x.managers)||(x.managers=Object.create(null)),x.managers[o]=l[o]}function Ye(t){const n=Object.create(null);if(e(t)){const{in:r,data:o,private:s}=t,a=h(r);if(e(o)){!function(e,t){const n=Object.getOwnPropertyNames(t),r=e.getElementsByTagName("*");for(let e of r)if(1==e.attributes.length){const r=e.attributes[0].name;for(let o of n)if(new RegExp(`{...${o}}`).test(r)){const n=Object.assign({},t[o]);e.removeAttribute(r),_e(e,n,o,t[o]);break}}}(a,o);for(let e of Object.entries(x.managers)){const[t,r]=e;w(s)?n[t]=r:x[t]=r}}else u("\ndata in toATTR() must be an object.\n");return delete x.managers,w(s)?n:void 0}u('\n The argument in "toATTR()" function must be an object.\n ')}function Be(e){d("Unfortunetly reativeTemplate was depracated since version 1.2.0")}ee.protectListener("URLCHANGED"),ee.protectListener("handler");const De={call:void 0,load(e){this.call=e},fire(){this.call()}};function Me(e,t){const n=e.children,r=A.create(null),o=A.create(null);if(w(t)){if("file:"==window.location.protocol)u('\n You can not use container rendering with external template in\n a "file:" protocol. Use "http:" or "https:" protocols instead.\n ');else{const t=e.getElementsByTagName("inter-container"),n=t.length;let r=0;De.load(()=>{if(r{const n=e.attributes;/