From 6c25c634fbc5fba183d7577bc348c1a8b47705ae Mon Sep 17 00:00:00 2001 From: Daniel Puckowski Date: Sun, 11 Feb 2024 10:50:02 -0500 Subject: [PATCH] Bug fix renderElementWithoutClass for functions * Bug fix renderElementWithoutClass when in manual change detection mode and trying to bind a function. * Bump version to 21.0.1. --- dist_sling/sling.es5.js | 5 ++--- dist_sling/sling.min.es5.js | 2 +- dist_sling/sling.min.js | 2 +- dist_sling/sling.min.nomodule.js | 2 +- dist_sling/sling.slim.min.js | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src/sling/core/sling.js | 6 +++--- src/sling/core/sling.slim.js | 2 +- 9 files changed, 13 insertions(+), 14 deletions(-) diff --git a/dist_sling/sling.es5.js b/dist_sling/sling.es5.js index 474e501..6a9c855 100644 --- a/dist_sling/sling.es5.js +++ b/dist_sling/sling.es5.js @@ -129,8 +129,7 @@ function renderElementWithoutClass(t, e, n) { _n4 = _Object$entries2$_i[1]; r.setAttributeNS(_n4.namespace, _e4, _n4.value); } - } - r.setAttribute(_t7, l); + } else r.setAttribute(_t7, l); } var _iterator3 = _createForOfIteratorHelper(n), _step3; @@ -634,7 +633,7 @@ var l = function l(_ref3) { }), t; }; function version() { - return "21.0.0"; + return "21.0.1"; } var x = function x(t, e) { return t.split(e).length - 1; diff --git a/dist_sling/sling.min.es5.js b/dist_sling/sling.min.es5.js index 492587a..8f9f1b6 100644 --- a/dist_sling/sling.min.es5.js +++ b/dist_sling/sling.min.es5.js @@ -1 +1 @@ -"use strict";function t(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=o(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,s=function(){};return{s:s,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e){return l(t)||a(t,e)||o(t,e)||r()}function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=4){s._structureForMap.has(_[0])||s._structureForMap.set(_[0],at(null,f[_[2]]));var A=s._structureForMap.get(_[0]);h=lt.bind(f,A,f[_[1]],f[_[3]])()}}else if("slfornamed"===y){var O=b.split(":");if(O.length>=4){for(var I=void 0,D=void 0,S=void 0,C=void 0,x=0,M=Object.keys(f);x",null!==h&&h.forEach((function(t){d+=r(t,i)}));var U,T=t(c);try{for(T.s();!(U=T.n()).done;){var F=U.value;F.view?(F.slOnInit&&(F.slOnInit(),i.push(F)),F=F.view.bind(F)(),d+=r(F,i)):d+="string"==typeof F?F:r(F,i)}}catch(t){T.e(t)}finally{T.f()}return d+=""},d=function(t,e){var n,r=[];for(r.push(t);r.length>0;)if((n=r.shift()).attrs&&(n.attrs.slfor||n.attrs.slfornamed)&&(n.model=e),n.children)for(var s=n.children.length-1;s>=0;--s)r.push(n.children[s])},h=function(t){var e,n,r=[];for(r.push(t);r.length>0;)if(3!==(e=r.shift()).nodeType&&(e.hasAttribute("slfor")?(n=(n=e.getAttribute("slfor")).split(":")).length>0&&s._structureForMap.delete(n[0]):e.hasAttribute("slfornamed")&&((n=(n=e.getAttribute("slfornamed")).split(":")).length>0&&s._structureForMap.delete(n[0])),e.children))for(var o=e.children.length-1;o>=0;--o)r.push(e.children[o])};function p(r,o,i){var a,l;a=o&&o.slns?document.createElementNS(o.slns,r.toLowerCase()):document.createElement(r);for(var u=0,c=Object.keys(o);u1&&void 0!==arguments[1]&&arguments[1];o=a&&a.slns?document.createElementNS(a.slns,i.toLowerCase()):document.createElement(i);for(var c=0,f=Object.entries(a);c2&&void 0!==arguments[2]&&arguments[2];Object.getPrototypeOf(t).slDirty=!0;var r=t,o=O(t,!0,!0,!0);t=o.view,o.afterInit&&s._afterInitArr.push(o.afterInit);var i=g(t);if(o.scopedCss){var a=k(o.model,o.model.slStyle());C(i,a),i.slScopedCss=!0}o.onInit&&(i.slOnInit=!0),A(i,o.destroyIndex,o.onDestroy,o.slUnboundOnDestroy),I(i),e.appendChild(i),y(i,r),n&&F(i,t,o.model)},A=function(t,e,n,r){t.slOnDestroy=!0,t.slOnDestroyIndex=e,t.slOnDestroyFn=n,t.slAfterInit=!0,t.slOnInit=!0,t.slUnboundOnDestroy=r},O=function(e,n,r){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;if(r&&e.slOnInit&&(e.slOnInit(),i&&(i.slOnInit=!0)),i&&i.slKeyList){var a,l=t(i.slKeyList);try{for(l.s();!(a=l.n()).done;){var u=a.value;void 0===e[u]?e[u]=i.slNamespace[u]:i.slNamespace[u]=e[u]}}catch(t){l.e(t)}finally{l.f()}}var c=null;if(n&&e.slOnDestroy){var f=s._destroyFuncMap.get(s._router.mountRoute);f||(f=[]),f.push(e.slOnDestroy.bind(e)),s._destroyFuncMap.set(s._router.mountRoute,f),c=f.length-1}var h=e.view.bind(e)();return d(h,e),{view:h,afterInit:e.slAfterInit?e.slAfterInit.bind(e):null,onDestroy:n&&!o||!e.slOnDestroy?null:e.slOnDestroy.bind(e),onInit:!r&&e.slOnInit?e.slOnInit:null,destroyIndex:c,model:e,scopedCss:e.slStyle?e.slStyle.bind(e):null,slUnboundOnDestroy:e.slOnDestroy,slUnboundAfterInit:e.slAfterInit,slUnboundOnInit:e.slOnInit}},I=function(t){if(t&&null!==t.slOnDestroyIndex&&void 0!==t.slOnDestroyIndex&&!t.slOnDestroyRoute){var e=s._destroyNodeMap.get(s._router.mountRoute);e||(e=[]),e.find((function(e){return e.slOnDestroyIndex===t.slOnDestroyIndex}))||e.push(t),s._destroyNodeMap.set(s._router.mountRoute,e),t.slOnDestroyRoute=s._router.mountRoute}},D=function(t){if(t&&t.slOnDestroy){var e=s._destroyFuncMap.get(s._router.mountRoute);e||(e=[]),e.splice(t.slOnDestroyIndex,1),s._destroyFuncMap.set(s._router.mountRoute,e);var n=s._destroyNodeMap.get(s._router.mountRoute);n||(n=[]),n.forEach((function(e){e.slOnDestroyIndex>t.slOnDestroyIndex&&e.slOnDestroyIndex--})),n=n.filter((function(e){return e.slOnDestroyIndex!==t.slOnDestroyIndex})),s._destroyNodeMap.set(s._router.mountRoute,n)}},S=function e(n){if(n&&n.children&&n.children.length>0){var r,s=t(n.children);try{for(s.s();!(r=s.n()).done;){e(r.value)}}catch(t){s.e(t)}finally{s.f()}n.slOnDestroyFn&&(n.slOnDestroyFn(),n.slOnDestroyFn=void 0,n.slUnboundOnDestroy=void 0)}else n.slOnDestroyFn&&(n.slOnDestroyFn(),n.slOnDestroyFn=void 0,n.slUnboundOnDestroy=void 0)},C=function e(n,r){if(n.setAttribute(r,""),n.children&&n.children.length>0){var s,o=t(n.children);try{for(o.s();!(s=o.n()).done;){e(s.value,r)}}catch(t){o.e(t)}finally{o.f()}}},x=function(t,e,n){t.slOnDestroy=!0;var r=s._destroyFuncMap.get(s._router.mountRoute);r||(r=[]),r.push(e),s._destroyFuncMap.set(s._router.mountRoute,r),t.slOnDestroyIndex=r.length-1,t.slOnDestroyFn=e,t.slUnboundOnDestroy=n,I(t)},M=function(r,o,i){var a,l=[],u=t(o);try{for(u.s();!(a=u.n()).done;){var c=a.value,f=i[c.name];f?f.length===c.nodeValue.length&&f===c.nodeValue&&delete i[c.name]:c.name.startsWith("slcss-")||l.push(c.nodeName)}}catch(t){u.e(t)}finally{u.f()}l.forEach((function(t){r.removeAttribute(t)})),void 0!==i.slref&&(r.slref=r);for(var d=i.slpreventdefault,h=!1,p=function(){var t=n(g[v],2),o=t[0],a=t[1];if("function"===e(a)){if(void 0!==d){var l=o;l.startsWith("on")&&(l=l.substring(2,l.length));var u=r[o];u&&(Array.isArray(u)?u:[u]).forEach((function(t){r.removeEventListener(l,t)})),r.addEventListener(l,(function(t){t.preventDefault()})),h=!0}r[o]=a,s._changeDetector.changeDetectionStrategy!==s.CHANGE_STRATEGY_AUTOMATIC||a.name.startsWith("bound slDetached")||a.name.startsWith("slDetached")||ct(o,r)}else if("slnsfor"===o)for(var c=JSON.parse(i.slnsfor),f=0,p=Object.entries(c);f=0;--a){var l=null,u=null;if(r[a]&&(n[a].slUnboundOnDestroy!==r[a].slOnDestroy&&(void 0!==n[a].slUnboundOnDestroy&&void 0!==n[a].slOnDestroyFn&&n[a].slOnDestroyFn(),D(n[a]),n[a].slOnDestroyFn=void 0,n[a].slOnDestroy=!1),r[a].view)){var c=O(r[a],!1,!1,!1,n[a]);r[a]=c.view;var f=Object.getPrototypeOf(c.model);!0!==f.slDirty&&(c.onInit&&n[a].slOnInit&&(n[a].slOnInit=!1),c.afterInit&&n[a].slAfterInit&&(n[a].slAfterInit=!1),c.scopedCss&&n[a].slScopedCss&&(n[a].slScopedCss=!1),c.onDestroy&&n[a].slOnDestroy&&(n[a].slOnDestroy=!1),f.slDirty=!0),c.onInit&&!n[a].slOnInit&&n[a].slUnboundOnInit!==c.slUnboundOnInit?(n[a].slUnboundOnInit=c.slUnboundOnInit,c.onInit.bind(c.model)(),r[a].slOnInit=!0):void 0===n[a].slUnboundOnInit||c.onInit?c.onInit&&n[a]&&!n[a].slOnInit?(n[a].slUnboundOnInit===c.slUnboundOnInit&&c.onInit.bind(c.model)(),n[a].slUnboundOnInit=c.slUnboundOnInit,r[a].slOnInit=!0):c.onInit&&n[a].slOnInit&&void 0===n[a].slUnboundOnInit&&(n[a].slUnboundOnInit=c.slUnboundOnInit):n[a].slOnInit=!1,c.afterInit&&!n[a].slAfterInit&&n[a].slUnboundAfterInit!==c.slUnboundAfterInit?(n[a].slAfterInit=!0,n[a].slUnboundAfterInit=c.slUnboundAfterInit,s._afterInitArr.push(c.afterInit)):void 0===n[a].slUnboundAfterInit||c.afterInit?c.afterInit&&n[a]&&!n[a].slAfterInit?(n[a].slAfterInit=!0,n[a].slUnboundAfterInit===c.slUnboundAfterInit&&s._afterInitArr.push(c.afterInit),n[a].slUnboundAfterInit=c.slUnboundAfterInit):c.afterInit&&n[a].slAfterInit&&void 0===n[a].slUnboundAfterInit&&(n[a].slUnboundAfterInit=c.slUnboundAfterInit):n[a].slAfterInit=!1,c.scopedCss&&n[a]&&!n[a].slScopedCss&&(u=k(c.model,c.model.slStyle())),c.onDestroy&&n[a]&&!n[a].slOnDestroy&&x(n[a],c.onDestroy,c.slUnboundOnDestroy),y(n[a],c.model),l=c.model}F(n[a],r[a],l),r[a]&&r[a].slOnInit&&(n[a].slOnInit=!0),u&&(C(n[a],u),n[a].slScopedCss=!0),i++}for(var d=n.length;d>o;)D(n[d-1]),S(n[d-1]),h(n[n.length-1]),w(n[d-1]),d--;var p,v=t(r.slice(o));try{for(v.s();!(p=v.n()).done;){var b=p.value;if("string"==typeof b)e.childNodes[i]?e.childNodes[i].textContent!==b&&(e.childNodes[i].textContent=b):e.append(b);else if("string"==typeof b)e.append(b);else if(b.view)_(b,e,!0);else{var A=g(b);e.appendChild(A),F(A,b)}i++}}catch(t){v.e(t)}finally{v.f()}for(d=n.length;d>r.length;)D(n[d-1]),S(n[d-1]),h(n[d-1]),w(n[d-1]),d--},w=function(t){var e=s._router.count;if(void 0===t.slanimatedestroytarget||""===t.slanimatedestroytarget||t.slAnimateDestroy||void 0===t.attributes.slanimatedestroy||""===t.getAttribute("slanimatedestroy"))if(3===t.nodeType||void 0===t.attributes.slanimatedestroy||""===t.getAttribute("slanimatedestroy")||t.slAnimateDestroy)t.slAnimateDestroy||(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id));else{var n=t.onanimationend,r=t.onanimationstart,o=t.getAttribute("slanimatedestroy");t.onanimationstart=function(e){t.slAnimationName=e.animationName},t.onanimationend=function(o){if(t.slAnimationName&&t.slAnimationName===o.animationName){var i=void 0;return n&&(i=n.apply(this,[].slice.call(arguments))),(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id)),t.slAnimationName=null,t.onanimationend=n,t.onanimationstart=r,t.slAnimateDestroy=!1,i}},t.classList.add(o),t.slAnimateDestroy=!0}else{var i=t.slanimatedestroytarget;if("function"==typeof i){var a=i(t);if(a){var l=a.getAttribute("slanimatedestroy"),u=a.onanimationend,c=a.onanimationstart;a.onanimationstart=function(t){a.slAnimationName=t.animationName},a.onanimationend=function(n){if(a.slAnimationName&&a.slAnimationName===n.animationName){var r=void 0;return u&&(r=u.apply(this,[].slice.call(arguments))),a.classList.remove(l),s._isAnimatingKeyed=null,s._router.currentRoute.animateDestroy?(s._router.currentRoute.animateDestroy=!1,t.setAttribute("style","opacity: 0;"),a.onanimationend=null,a.onanimationstart=null):((s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id)),a.onanimationend=u,a.onanimationstart=c),a.slAnimationName=null,t.slAnimateDestroy=!1,delete t.slanimatedestroytarget,pt(),r}},s._isAnimatingKeyed=a,a.classList.add(l),t.slAnimateDestroy=!0}else(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id))}else(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id))}},R=function t(e){return e&&e!==Object.prototype&&Object.getOwnPropertyNames(e).filter((function(t){return function(t,e){return(Object.getOwnPropertyDescriptor(t,e)||{}).get}(e,t)||function(t,e){return"function"==typeof t[e]}(e,t)})).concat(t(Object.getPrototypeOf(e))||[])},N=function(t){return function(t){return Array.from(new Set(R(t)))}(t).filter((function(t){return"constructor"!==t&&!~t.indexOf("__")}))},U=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(e.slStyle&&!t.slScopedCss){var r=k(e,e.slStyle());C(t,r),t.slScopedCss=!0,t.style.display=n}},T=function(t){for(var e=function(){var e=t[n];if(null!==e.getAttribute("slpreventdefault"))for(var r in e)if(r.startsWith("on")){var s=r.substring(2,r.length),o=e[r];o&&(Array.isArray(o)?o:[o]).forEach((function(t){e.removeEventListener(s,t)})),e.addEventListener(s,(function(t){t.preventDefault()}))}},n=0;n0&&T(Array.from(y)),e}if(r.attrs.slfor){var b=r.attrs.slfor.split(":");if(b.length>=4){if(!s._structureForMap.has(b[0])){var _=at(e,r.model[b[2]]);if(s._structureForMap.set(b[0],_),e.children.length>0){for(var A=Object.create(null),I=0;I=4){for(var j,L,W,H,G=0,P=Object.keys(r.model);G0){for(var $=Object.create(null),J=0;J2&&void 0!==arguments[2]?arguments[2]:0,r="",s=!1,o=!1,i=!1,a=n;aa+e.length&&t.substring(a,a+e.length)===e&&!s&&!o){r+=t.substring(a,a+e.length-1);break}return r},k=function(t,e){var n=function(t){for(var e=0,n=1779033703^t.length;e>>19;return function(){return n=Math.imul(n^n>>>16,2246822507),n=Math.imul(n^n>>>13,3266489909),(n^=n>>>16)>>>0}}(t.constructor.name),r="slcss-"+String(n());if(""===e||s._scopedCssSet.has(r))return r;e=e.replace(/\t+/g," "),s._scopedCssSet.add(r);var o=new RegExp("([^{]+)s*{s*([^}]+)s*}","g"),i=e.match(o),a=/[^\s"]+|"([^"]*)"/gi,l="",u=null;do{null!=(u=a.exec(e))&&(u[1]||(l+=u[0]))}while(null!=u);var c,f,d,h,p,v,g,y,b="",_=0,A=0,O=0,I=0,D=!1,S=!1,C=0,x=!1,M=0,E=new Map;if(l.includes("{")&&l.includes("}")&&l.split("{").length===l.split("}").length)for(var w=0;w0)for(var L=j.trim();L.startsWith("}")&&I>0;)!(0!==_||1!==I||N<=I)&&A-N>=1||I--,N--,A--,L=L.replace("}","").trim();var k="";u=null;do{null!=(u=a.exec(j))&&(u[1]||(k+=u[0]))}while(null!=u);if(b+=j,0===I&&W(k,"}")>0){var P=k.length,Y=k.replace(/^}+/,"");(A-=W(Y,"}"))>=P-Y.length&&(1===A&&1===N||(M+=P-Y.length))}var B=W(k,"{")-W(k,"}"),q=k.replace(/\s/g,"").match(/(@layer|@container|@media|@scope)[^{]*\{/g),K=q?q.length:0;(B-=I>0?0:K)<0&&(B=0),I+=B}}f=c}v=i[w].substring(c)}var X=c+H(i[w],"{",c).length-1;-1===X&&(X=c);for(var $=i[w].substring(c,X);($.split('"').length-1)%2!=0;)X=X+1+H(i[w],"{",X+1).length,$=i[w].substring(c,X);if(""!==$&&!/^\s*$/.test($)){var J=$.split(","),V=void 0;O>0&&$.startsWith(",")&&(J.shift(),J[0]=", "+J[0]);for(var z=0;z0&&V.includes("}");){for(var Q=void 0,Z=void 0,tt="";V.includes("}");)Q=V.indexOf("{"),((Z=V.indexOf("}"))0&&I--,0===I&&(D=!1);if(V.includes(" ")){var et=V.substring(0,V.indexOf(" ")),nt=V.substring(V.indexOf(" "));if(z>0&&(b+=", "),"@nest"===et.trim()&&nt.replace(/^\s+/g,"").includes(" ")){var rt=nt.replace(/^\s+/g,""),st=rt.substring(0,rt.indexOf(" "));et+=" "+st,nt=rt=rt.substring(st.length,rt.length)}if(x=et.trim().startsWith("@"),g=et.trim().endsWith(":")){for(var ot=H(nt,";");H(nt,";",ot.length).trim().endsWith(";");)ot+=H(nt,";",ot.length);var it=nt.substring(ot.length,nt.length);nt=ot;var at=i[w].substring(X);X=i[w].length;for(var lt=it+" ",ut=J.length>1,ct=z+1;ct0&&N>0&&ut&&(A++,M++);var ft="";u=null;do{null!=(u=a.exec(i[w+1]))&&(u[1]||(ft+=u[0]))}while(null!=u);var dt=W(ft,"{");(dt-=W(ft,"}"))<0&&(dt=0),A+=dt,C+=dt}!(!I>0)||D||S&&0!==I||x&&!et.trim().startsWith("@nest")||g?b+=et+nt:b+=et+(0===I?"["+r+"]":"")+nt}else z>0&&(b+=", "),!(!I>0)||D||S&&0!==I||V.trim().startsWith("@")||x||V.trim().endsWith(":")?b+=V:b+=V+(0===I?"["+r+"]":"")}}}if(O>0&&(X=null!==d?i[w].indexOf(d):0),i[w].includes("--")&&N>1){var ht=H(i[w],"--",0).length,pt=i[w].substring(0,ht),vt="";do{null!=(u=a.exec(pt))&&(u[1]||(vt+=u[0]))}while(null!=u);var gt=W(vt,"{")-1;p=N-1,gt>0&&(p-=gt),p>0&&(O+=p)}if(N-O>1&&!h){var yt=i[w].substring(X+1);i[w]=i[w].substring(0,i[w].length-yt.length),i.splice(w+1,0,yt);var mt="";u=null;do{null!=(u=a.exec(yt))&&(u[1]||(mt+=u[0]))}while(null!=u);y=W(mt,"{")-W(mt,"}"),O-=p}var bt=i[w].substring(X),_t=bt.replace("{","").replace(";","");if(bt.includes("{")&&W(bt,"{")>1&&!_t.trim().startsWith("--")){var At=H(bt,"{",0);At=At+" "+H(bt,"{",At.length);var Ot=bt.substring(At.length+1,bt.length);Ot=At.substring(At.lastIndexOf(";")+1,At.length)+" "+Ot,bt=At=At.substring(0,At.lastIndexOf(";")+1),i.splice(w+1,0,Ot),I++,C++}b+=bt;var It="";u=null;do{null!=(u=a.exec(bt))&&(u[1]||(It+=u[0]))}while(null!=u);for(A+=(y=W(It,"{")-W(It,"}"))-p>=0?y-p:y,(y-=O)<0&&(y=0),0===I&&S||(C+=y,(I+=y)>0&&(I-=1-A-W(It,"{")+W(It,"}")>=0?1-A-W(It,"{")+W(It,"}"):0));_>0;)b+="}",_--;0===O&&(b+="\n")}for(I-=C;I>0;)b+="}",I--;for(A-=M;A>0;)b+="}",A--;if(b+="\n",E.size>0){var Dt,St=0;b=(Dt=G(b,St,E,"animation")).finalCss,St=Dt.startIndex,b=(Dt=G(b,St=0,E,"animation-name")).finalCss,St=Dt.startIndex}if(""!==b.trim()){var Ct=document.head||document.getElementsByTagName("head")[0],xt=document.createElement("style");Ct.appendChild(xt),xt.appendChild(document.createTextNode(b))}return r},G=function(e,r,s,o){for(;-1!==(r=e.indexOf(o,r));){var i=e.substring(0,r),a=e.substring(r,e.indexOf(";",r)),l=e.substring(r+a.length,e.length);if(a.includes(":"))if(":"===a.substring(0,a.indexOf(":")+1).replace(o,"").trim()){var u,c=t(s);try{for(c.s();!(u=c.n()).done;){var f=n(u.value,2),d=f[0],h=f[1],p=a.replace(o,"");(p=p.trim()).startsWith(":")&&(p=(p=p.substring(1,p.length)).trim()),new RegExp(d+"(\\s|;|$)").test(p)&&d.length>0?r+=(a=a.replaceAll(d,h)).length:r+=o.length}}catch(t){c.e(t)}finally{c.f()}e=i+a+l}else r+=a.length}return{finalCss:e,startIndex:r}};function P(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=document.getElementById(t).getAttribute("slssrclass"),r=c[n];return!r&&this&&(r=this[n]),$(t,new r,e)}function Y(t){return Promise.all(t.map((function(t){return t.then((function(t){return{result:t,status:"fulfilled",error:null}}),(function(t){return{result:null,error:t,status:"rejected"}}))})))}function B(t){s._state=t}function q(){return s._state}function K(t){return String(t)}function X(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.attrs,r=void 0===n?{}:n,s=e.children,o=void 0===s?[]:s;return{tagName:t=t.toUpperCase(),attrs:r,children:o}}function m(){return 3===arguments.length&&"string"==typeof arguments[0]&&"object"==e(arguments[1])&&Array.isArray(arguments[2])?X(arguments[0],{attrs:arguments[1],children:arguments[2]}):X(arguments[0],arguments[1])}function $(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];s._router.mountRoute=t;var r=document.getElementById(t);if(null!==r)return j(r,e,n);console.error("ID "+t+" does not exist in DOM.")}function J(e){var n,r=[],o=new Set,i=t(s._structureForMap.keys());try{for(i.s();!(n=i.n()).done;){var a=n.value;o.add(a)}}catch(t){i.e(t)}finally{i.f()}e.slOnInit&&(e.slOnInit(),r.push(e));for(var l=e.view.bind(e)(),u=e;l.view;)l.slOnInit&&(l.slOnInit(),r.push(l)),u=l,l=l.view.bind(l)();d(l,u);var c=f(l,r);r.forEach((function(t){t.slOnDestroy&&t.slOnDestroy.bind(t)()}));var h,p=t(s._structureForMap.keys());try{for(p.s();!(h=p.n()).done;){var v=h.value;o.has(v)||s._structureForMap.delete(v)}}catch(t){p.e(t)}finally{p.f()}return c}function V(t,e){var n=t;if(t=document.getElementById(t),s._afterInitArr=[],t){var r=e.view.bind(e)();d(r,e),t=F(t,r,e)}else console.error("ID "+n+" not mounted in DOM; attachDetector likely needs to be called.");var o=t.querySelectorAll("[slref]");void 0!==t.slref&&(o=Array.from(o)).push(t);for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{},i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(s._router.params=o,!s._router.currentRoute||!s._router.currentRoute.onCanDeactivate||s._router.currentRoute.onCanDeactivate(r)){var a,l=null,u=t(s._router.routeList);try{var f=function(){var t=n(a.value,2),e=t[0],o=t[1];if(e.test(r)){if(o.onActivationCheck&&!o.onActivationCheck(r))return{v:(o.onActivationFail&&(l=it(o.onActivationFail.route,o.onActivationFail.params,"boolean"!=typeof o.onActivationFail.attachDetector||o.onActivationFail.attachDetector)),void(r=void 0))};o.onBeforeRoute&&o.onBeforeRoute();var u=document.getElementById(o.root),f=s._destroyNodeMap.get(rt());f&&(f.forEach((function(t){t.slOnDestroyFn&&u.contains(t)&&t.slOnDestroyFn(),t.slOnDestroyFn=void 0,t.slUnboundOnDestroy=void 0})),s._destroyNodeMap.set(rt(),[]),s._destroyFuncMap.set(rt(),[])),s._router.lastHash=r;var d=c.pageYOffset;switch(s._router.strategy){case"#":c.history.pushState(null,document.title,"#/"+r);break;case"?":var p=c.location.href,v=c.location.pathname;p=p.substring(0,p.indexOf(v)),p+="/?/"+r,c.history.pushState(null,document.title,p);break;case"":var g=c.location.href,y=c.location.pathname;g=g.substring(0,g.indexOf(y)),g+="/"+r,c.history.pushState(null,document.title,g)}if(c.scrollTo(0,d),s._router.currentRoute&&void 0!==s._router.currentRoute.animateDestroy&&(s._router.currentRoute.animateDestroy=!0),s._router.currentRoute&&s._router.currentRoute.animateDestroy){var b=s._router.currentRoute.root;b=document.getElementById(b),s._router.currentRoute=o,D(b),S(b),h(b),w(b),Q()}else Q(),s._router.currentRoute=o;return s._router.count++,o.component&&(o.component.slOnDestroy&&s._destroyFuncMap.set(r,[o.component.slOnDestroy.bind(o.component)]),s._router.mountRoute=r,j(u,o.component,i),o.component.slOnDestroy&&(u.slOnDestroyIndex=0,s._destroyFuncMap.get(r).pop(),I(u)),l=o.component),"break"}};for(u.s();!(a=u.n()).done;){var d=f();if("break"===d)break;if("object"===e(d))return d.v}}catch(t){u.e(t)}finally{u.f()}return s._changeDetector.changeDetectionStrategy===s.CHANGE_STRATEGY_AUTOMATIC&&dt(),l}}Q();var at=function(t,e,n){return{parent:t,factory:e,map:Object.create(null)}};function lt(t,e){"function"==typeof e&&(e=e());for(var n=[],r=0;r0&&(T([t.parent]),T(Array.from(u)))}s.CHANGE_STRATEGY_AUTOMATIC=100,s.CHANGE_STRATEGY_MANUAL=200,s.CHANGE_DETECTOR_DETACHED=!1,s.CHANGE_DETECTOR_ATTACHED=!0,s._changeStrategies=[s.CHANGE_STRATEGY_AUTOMATIC,s.CHANGE_STRATEGY_MANUAL],s._changeDetector={lastUpdateDate:new Date,changeDetectionStrategy:s.CHANGE_STRATEGY_AUTOMATIC},Object.seal(s._changeDetector),Object.freeze(s._changeStrategies);var ct=function(t,e){if(e[t]){var n=e[t];e[t]=function(){var t=n.apply(this,[].slice.call(arguments));return dt(),t}}},ft=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t?V(t,s._updateMap.get(t)):s._updateMap.forEach((function(t,e){V(e,t)}))},dt=function(){s._changeDetector.changeDetectionStrategy===s.CHANGE_STRATEGY_AUTOMATIC&&(new Date-s._changeDetector.lastUpdateDate>6?ft():s._debouncedPerformUpdates(),s._changeDetector.lastUpdateDate=new Date)};function ht(t){s._changeStrategies.forEach((function(e){e===t&&(s._changeDetector.changeDetectionStrategy=t)}))}function pt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;ft(t)}function vt(t){return s._updateMap.has(t)}function gt(t){s._updateMap.delete(t)}var yt=Promise.prototype.then;function mt(){Promise.prototype.then=function(t,e){return yt.call(this,(function(e){return dt(),"function"==typeof t&&t instanceof Function?t(e):t}),e)}}function bt(t,e){return function(){e&&e.slpreventdefault&&arguments.length>0&&"function"==typeof arguments[0].preventDefault&&arguments[0].preventDefault();var n=t.apply(this,[].slice.call(arguments));return dt(),n}}s._debouncedPerformUpdates=function(t,e){var n;return function(){for(var e=arguments.length,r=new Array(e),s=0;s=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e){return l(t)||a(t,e)||o(t,e)||r()}function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=4){s._structureForMap.has(_[0])||s._structureForMap.set(_[0],at(null,f[_[2]]));var A=s._structureForMap.get(_[0]);h=lt.bind(f,A,f[_[1]],f[_[3]])()}}else if("slfornamed"===y){var O=b.split(":");if(O.length>=4){for(var I=void 0,D=void 0,S=void 0,C=void 0,x=0,M=Object.keys(f);x",null!==h&&h.forEach((function(t){d+=r(t,i)}));var U,T=t(c);try{for(T.s();!(U=T.n()).done;){var F=U.value;F.view?(F.slOnInit&&(F.slOnInit(),i.push(F)),F=F.view.bind(F)(),d+=r(F,i)):d+="string"==typeof F?F:r(F,i)}}catch(t){T.e(t)}finally{T.f()}return d+=""},d=function(t,e){var n,r=[];for(r.push(t);r.length>0;)if((n=r.shift()).attrs&&(n.attrs.slfor||n.attrs.slfornamed)&&(n.model=e),n.children)for(var s=n.children.length-1;s>=0;--s)r.push(n.children[s])},h=function(t){var e,n,r=[];for(r.push(t);r.length>0;)if(3!==(e=r.shift()).nodeType&&(e.hasAttribute("slfor")?(n=(n=e.getAttribute("slfor")).split(":")).length>0&&s._structureForMap.delete(n[0]):e.hasAttribute("slfornamed")&&((n=(n=e.getAttribute("slfornamed")).split(":")).length>0&&s._structureForMap.delete(n[0])),e.children))for(var o=e.children.length-1;o>=0;--o)r.push(e.children[o])};function p(r,o,i){var a,l;a=o&&o.slns?document.createElementNS(o.slns,r.toLowerCase()):document.createElement(r);for(var u=0,c=Object.keys(o);u1&&void 0!==arguments[1]&&arguments[1];o=a&&a.slns?document.createElementNS(a.slns,i.toLowerCase()):document.createElement(i);for(var c=0,f=Object.entries(a);c2&&void 0!==arguments[2]&&arguments[2];Object.getPrototypeOf(t).slDirty=!0;var r=t,o=O(t,!0,!0,!0);t=o.view,o.afterInit&&s._afterInitArr.push(o.afterInit);var i=g(t);if(o.scopedCss){var a=k(o.model,o.model.slStyle());C(i,a),i.slScopedCss=!0}o.onInit&&(i.slOnInit=!0),A(i,o.destroyIndex,o.onDestroy,o.slUnboundOnDestroy),I(i),e.appendChild(i),y(i,r),n&&F(i,t,o.model)},A=function(t,e,n,r){t.slOnDestroy=!0,t.slOnDestroyIndex=e,t.slOnDestroyFn=n,t.slAfterInit=!0,t.slOnInit=!0,t.slUnboundOnDestroy=r},O=function(e,n,r){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;if(r&&e.slOnInit&&(e.slOnInit(),i&&(i.slOnInit=!0)),i&&i.slKeyList){var a,l=t(i.slKeyList);try{for(l.s();!(a=l.n()).done;){var u=a.value;void 0===e[u]?e[u]=i.slNamespace[u]:i.slNamespace[u]=e[u]}}catch(t){l.e(t)}finally{l.f()}}var c=null;if(n&&e.slOnDestroy){var f=s._destroyFuncMap.get(s._router.mountRoute);f||(f=[]),f.push(e.slOnDestroy.bind(e)),s._destroyFuncMap.set(s._router.mountRoute,f),c=f.length-1}var h=e.view.bind(e)();return d(h,e),{view:h,afterInit:e.slAfterInit?e.slAfterInit.bind(e):null,onDestroy:n&&!o||!e.slOnDestroy?null:e.slOnDestroy.bind(e),onInit:!r&&e.slOnInit?e.slOnInit:null,destroyIndex:c,model:e,scopedCss:e.slStyle?e.slStyle.bind(e):null,slUnboundOnDestroy:e.slOnDestroy,slUnboundAfterInit:e.slAfterInit,slUnboundOnInit:e.slOnInit}},I=function(t){if(t&&null!==t.slOnDestroyIndex&&void 0!==t.slOnDestroyIndex&&!t.slOnDestroyRoute){var e=s._destroyNodeMap.get(s._router.mountRoute);e||(e=[]),e.find((function(e){return e.slOnDestroyIndex===t.slOnDestroyIndex}))||e.push(t),s._destroyNodeMap.set(s._router.mountRoute,e),t.slOnDestroyRoute=s._router.mountRoute}},D=function(t){if(t&&t.slOnDestroy){var e=s._destroyFuncMap.get(s._router.mountRoute);e||(e=[]),e.splice(t.slOnDestroyIndex,1),s._destroyFuncMap.set(s._router.mountRoute,e);var n=s._destroyNodeMap.get(s._router.mountRoute);n||(n=[]),n.forEach((function(e){e.slOnDestroyIndex>t.slOnDestroyIndex&&e.slOnDestroyIndex--})),n=n.filter((function(e){return e.slOnDestroyIndex!==t.slOnDestroyIndex})),s._destroyNodeMap.set(s._router.mountRoute,n)}},S=function e(n){if(n&&n.children&&n.children.length>0){var r,s=t(n.children);try{for(s.s();!(r=s.n()).done;){e(r.value)}}catch(t){s.e(t)}finally{s.f()}n.slOnDestroyFn&&(n.slOnDestroyFn(),n.slOnDestroyFn=void 0,n.slUnboundOnDestroy=void 0)}else n.slOnDestroyFn&&(n.slOnDestroyFn(),n.slOnDestroyFn=void 0,n.slUnboundOnDestroy=void 0)},C=function e(n,r){if(n.setAttribute(r,""),n.children&&n.children.length>0){var s,o=t(n.children);try{for(o.s();!(s=o.n()).done;){e(s.value,r)}}catch(t){o.e(t)}finally{o.f()}}},x=function(t,e,n){t.slOnDestroy=!0;var r=s._destroyFuncMap.get(s._router.mountRoute);r||(r=[]),r.push(e),s._destroyFuncMap.set(s._router.mountRoute,r),t.slOnDestroyIndex=r.length-1,t.slOnDestroyFn=e,t.slUnboundOnDestroy=n,I(t)},M=function(r,o,i){var a,l=[],u=t(o);try{for(u.s();!(a=u.n()).done;){var c=a.value,f=i[c.name];f?f.length===c.nodeValue.length&&f===c.nodeValue&&delete i[c.name]:c.name.startsWith("slcss-")||l.push(c.nodeName)}}catch(t){u.e(t)}finally{u.f()}l.forEach((function(t){r.removeAttribute(t)})),void 0!==i.slref&&(r.slref=r);for(var d=i.slpreventdefault,h=!1,p=function(){var t=n(g[v],2),o=t[0],a=t[1];if("function"===e(a)){if(void 0!==d){var l=o;l.startsWith("on")&&(l=l.substring(2,l.length));var u=r[o];u&&(Array.isArray(u)?u:[u]).forEach((function(t){r.removeEventListener(l,t)})),r.addEventListener(l,(function(t){t.preventDefault()})),h=!0}r[o]=a,s._changeDetector.changeDetectionStrategy!==s.CHANGE_STRATEGY_AUTOMATIC||a.name.startsWith("bound slDetached")||a.name.startsWith("slDetached")||ct(o,r)}else if("slnsfor"===o)for(var c=JSON.parse(i.slnsfor),f=0,p=Object.entries(c);f=0;--a){var l=null,u=null;if(r[a]&&(n[a].slUnboundOnDestroy!==r[a].slOnDestroy&&(void 0!==n[a].slUnboundOnDestroy&&void 0!==n[a].slOnDestroyFn&&n[a].slOnDestroyFn(),D(n[a]),n[a].slOnDestroyFn=void 0,n[a].slOnDestroy=!1),r[a].view)){var c=O(r[a],!1,!1,!1,n[a]);r[a]=c.view;var f=Object.getPrototypeOf(c.model);!0!==f.slDirty&&(c.onInit&&n[a].slOnInit&&(n[a].slOnInit=!1),c.afterInit&&n[a].slAfterInit&&(n[a].slAfterInit=!1),c.scopedCss&&n[a].slScopedCss&&(n[a].slScopedCss=!1),c.onDestroy&&n[a].slOnDestroy&&(n[a].slOnDestroy=!1),f.slDirty=!0),c.onInit&&!n[a].slOnInit&&n[a].slUnboundOnInit!==c.slUnboundOnInit?(n[a].slUnboundOnInit=c.slUnboundOnInit,c.onInit.bind(c.model)(),r[a].slOnInit=!0):void 0===n[a].slUnboundOnInit||c.onInit?c.onInit&&n[a]&&!n[a].slOnInit?(n[a].slUnboundOnInit===c.slUnboundOnInit&&c.onInit.bind(c.model)(),n[a].slUnboundOnInit=c.slUnboundOnInit,r[a].slOnInit=!0):c.onInit&&n[a].slOnInit&&void 0===n[a].slUnboundOnInit&&(n[a].slUnboundOnInit=c.slUnboundOnInit):n[a].slOnInit=!1,c.afterInit&&!n[a].slAfterInit&&n[a].slUnboundAfterInit!==c.slUnboundAfterInit?(n[a].slAfterInit=!0,n[a].slUnboundAfterInit=c.slUnboundAfterInit,s._afterInitArr.push(c.afterInit)):void 0===n[a].slUnboundAfterInit||c.afterInit?c.afterInit&&n[a]&&!n[a].slAfterInit?(n[a].slAfterInit=!0,n[a].slUnboundAfterInit===c.slUnboundAfterInit&&s._afterInitArr.push(c.afterInit),n[a].slUnboundAfterInit=c.slUnboundAfterInit):c.afterInit&&n[a].slAfterInit&&void 0===n[a].slUnboundAfterInit&&(n[a].slUnboundAfterInit=c.slUnboundAfterInit):n[a].slAfterInit=!1,c.scopedCss&&n[a]&&!n[a].slScopedCss&&(u=k(c.model,c.model.slStyle())),c.onDestroy&&n[a]&&!n[a].slOnDestroy&&x(n[a],c.onDestroy,c.slUnboundOnDestroy),y(n[a],c.model),l=c.model}F(n[a],r[a],l),r[a]&&r[a].slOnInit&&(n[a].slOnInit=!0),u&&(C(n[a],u),n[a].slScopedCss=!0),i++}for(var d=n.length;d>o;)D(n[d-1]),S(n[d-1]),h(n[n.length-1]),w(n[d-1]),d--;var p,v=t(r.slice(o));try{for(v.s();!(p=v.n()).done;){var b=p.value;if("string"==typeof b)e.childNodes[i]?e.childNodes[i].textContent!==b&&(e.childNodes[i].textContent=b):e.append(b);else if("string"==typeof b)e.append(b);else if(b.view)_(b,e,!0);else{var A=g(b);e.appendChild(A),F(A,b)}i++}}catch(t){v.e(t)}finally{v.f()}for(d=n.length;d>r.length;)D(n[d-1]),S(n[d-1]),h(n[d-1]),w(n[d-1]),d--},w=function(t){var e=s._router.count;if(void 0===t.slanimatedestroytarget||""===t.slanimatedestroytarget||t.slAnimateDestroy||void 0===t.attributes.slanimatedestroy||""===t.getAttribute("slanimatedestroy"))if(3===t.nodeType||void 0===t.attributes.slanimatedestroy||""===t.getAttribute("slanimatedestroy")||t.slAnimateDestroy)t.slAnimateDestroy||(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id));else{var n=t.onanimationend,r=t.onanimationstart,o=t.getAttribute("slanimatedestroy");t.onanimationstart=function(e){t.slAnimationName=e.animationName},t.onanimationend=function(o){if(t.slAnimationName&&t.slAnimationName===o.animationName){var i=void 0;return n&&(i=n.apply(this,[].slice.call(arguments))),(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id)),t.slAnimationName=null,t.onanimationend=n,t.onanimationstart=r,t.slAnimateDestroy=!1,i}},t.classList.add(o),t.slAnimateDestroy=!0}else{var i=t.slanimatedestroytarget;if("function"==typeof i){var a=i(t);if(a){var l=a.getAttribute("slanimatedestroy"),u=a.onanimationend,c=a.onanimationstart;a.onanimationstart=function(t){a.slAnimationName=t.animationName},a.onanimationend=function(n){if(a.slAnimationName&&a.slAnimationName===n.animationName){var r=void 0;return u&&(r=u.apply(this,[].slice.call(arguments))),a.classList.remove(l),s._isAnimatingKeyed=null,s._router.currentRoute.animateDestroy?(s._router.currentRoute.animateDestroy=!1,t.setAttribute("style","opacity: 0;"),a.onanimationend=null,a.onanimationstart=null):((s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id)),a.onanimationend=u,a.onanimationstart=c),a.slAnimationName=null,t.slAnimateDestroy=!1,delete t.slanimatedestroytarget,pt(),r}},s._isAnimatingKeyed=a,a.classList.add(l),t.slAnimateDestroy=!0}else(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id))}else(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id))}},R=function t(e){return e&&e!==Object.prototype&&Object.getOwnPropertyNames(e).filter((function(t){return function(t,e){return(Object.getOwnPropertyDescriptor(t,e)||{}).get}(e,t)||function(t,e){return"function"==typeof t[e]}(e,t)})).concat(t(Object.getPrototypeOf(e))||[])},N=function(t){return function(t){return Array.from(new Set(R(t)))}(t).filter((function(t){return"constructor"!==t&&!~t.indexOf("__")}))},U=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(e.slStyle&&!t.slScopedCss){var r=k(e,e.slStyle());C(t,r),t.slScopedCss=!0,t.style.display=n}},T=function(t){for(var e=function(){var e=t[n];if(null!==e.getAttribute("slpreventdefault"))for(var r in e)if(r.startsWith("on")){var s=r.substring(2,r.length),o=e[r];o&&(Array.isArray(o)?o:[o]).forEach((function(t){e.removeEventListener(s,t)})),e.addEventListener(s,(function(t){t.preventDefault()}))}},n=0;n0&&T(Array.from(y)),e}if(r.attrs.slfor){var b=r.attrs.slfor.split(":");if(b.length>=4){if(!s._structureForMap.has(b[0])){var _=at(e,r.model[b[2]]);if(s._structureForMap.set(b[0],_),e.children.length>0){for(var A=Object.create(null),I=0;I=4){for(var j,L,W,H,G=0,P=Object.keys(r.model);G0){for(var $=Object.create(null),J=0;J2&&void 0!==arguments[2]?arguments[2]:0,r="",s=!1,o=!1,i=!1,a=n;aa+e.length&&t.substring(a,a+e.length)===e&&!s&&!o){r+=t.substring(a,a+e.length-1);break}return r},k=function(t,e){var n=function(t){for(var e=0,n=1779033703^t.length;e>>19;return function(){return n=Math.imul(n^n>>>16,2246822507),n=Math.imul(n^n>>>13,3266489909),(n^=n>>>16)>>>0}}(t.constructor.name),r="slcss-"+String(n());if(""===e||s._scopedCssSet.has(r))return r;e=e.replace(/\t+/g," "),s._scopedCssSet.add(r);var o=new RegExp("([^{]+)s*{s*([^}]+)s*}","g"),i=e.match(o),a=/[^\s"]+|"([^"]*)"/gi,l="",u=null;do{null!=(u=a.exec(e))&&(u[1]||(l+=u[0]))}while(null!=u);var c,f,d,h,p,v,g,y,b="",_=0,A=0,O=0,I=0,D=!1,S=!1,C=0,x=!1,M=0,E=new Map;if(l.includes("{")&&l.includes("}")&&l.split("{").length===l.split("}").length)for(var w=0;w0)for(var L=j.trim();L.startsWith("}")&&I>0;)!(0!==_||1!==I||N<=I)&&A-N>=1||I--,N--,A--,L=L.replace("}","").trim();var k="";u=null;do{null!=(u=a.exec(j))&&(u[1]||(k+=u[0]))}while(null!=u);if(b+=j,0===I&&W(k,"}")>0){var P=k.length,Y=k.replace(/^}+/,"");(A-=W(Y,"}"))>=P-Y.length&&(1===A&&1===N||(M+=P-Y.length))}var B=W(k,"{")-W(k,"}"),q=k.replace(/\s/g,"").match(/(@layer|@container|@media|@scope)[^{]*\{/g),K=q?q.length:0;(B-=I>0?0:K)<0&&(B=0),I+=B}}f=c}v=i[w].substring(c)}var X=c+H(i[w],"{",c).length-1;-1===X&&(X=c);for(var $=i[w].substring(c,X);($.split('"').length-1)%2!=0;)X=X+1+H(i[w],"{",X+1).length,$=i[w].substring(c,X);if(""!==$&&!/^\s*$/.test($)){var J=$.split(","),V=void 0;O>0&&$.startsWith(",")&&(J.shift(),J[0]=", "+J[0]);for(var z=0;z0&&V.includes("}");){for(var Q=void 0,Z=void 0,tt="";V.includes("}");)Q=V.indexOf("{"),((Z=V.indexOf("}"))0&&I--,0===I&&(D=!1);if(V.includes(" ")){var et=V.substring(0,V.indexOf(" ")),nt=V.substring(V.indexOf(" "));if(z>0&&(b+=", "),"@nest"===et.trim()&&nt.replace(/^\s+/g,"").includes(" ")){var rt=nt.replace(/^\s+/g,""),st=rt.substring(0,rt.indexOf(" "));et+=" "+st,nt=rt=rt.substring(st.length,rt.length)}if(x=et.trim().startsWith("@"),g=et.trim().endsWith(":")){for(var ot=H(nt,";");H(nt,";",ot.length).trim().endsWith(";");)ot+=H(nt,";",ot.length);var it=nt.substring(ot.length,nt.length);nt=ot;var at=i[w].substring(X);X=i[w].length;for(var lt=it+" ",ut=J.length>1,ct=z+1;ct0&&N>0&&ut&&(A++,M++);var ft="";u=null;do{null!=(u=a.exec(i[w+1]))&&(u[1]||(ft+=u[0]))}while(null!=u);var dt=W(ft,"{");(dt-=W(ft,"}"))<0&&(dt=0),A+=dt,C+=dt}!(!I>0)||D||S&&0!==I||x&&!et.trim().startsWith("@nest")||g?b+=et+nt:b+=et+(0===I?"["+r+"]":"")+nt}else z>0&&(b+=", "),!(!I>0)||D||S&&0!==I||V.trim().startsWith("@")||x||V.trim().endsWith(":")?b+=V:b+=V+(0===I?"["+r+"]":"")}}}if(O>0&&(X=null!==d?i[w].indexOf(d):0),i[w].includes("--")&&N>1){var ht=H(i[w],"--",0).length,pt=i[w].substring(0,ht),vt="";do{null!=(u=a.exec(pt))&&(u[1]||(vt+=u[0]))}while(null!=u);var gt=W(vt,"{")-1;p=N-1,gt>0&&(p-=gt),p>0&&(O+=p)}if(N-O>1&&!h){var yt=i[w].substring(X+1);i[w]=i[w].substring(0,i[w].length-yt.length),i.splice(w+1,0,yt);var mt="";u=null;do{null!=(u=a.exec(yt))&&(u[1]||(mt+=u[0]))}while(null!=u);y=W(mt,"{")-W(mt,"}"),O-=p}var bt=i[w].substring(X),_t=bt.replace("{","").replace(";","");if(bt.includes("{")&&W(bt,"{")>1&&!_t.trim().startsWith("--")){var At=H(bt,"{",0);At=At+" "+H(bt,"{",At.length);var Ot=bt.substring(At.length+1,bt.length);Ot=At.substring(At.lastIndexOf(";")+1,At.length)+" "+Ot,bt=At=At.substring(0,At.lastIndexOf(";")+1),i.splice(w+1,0,Ot),I++,C++}b+=bt;var It="";u=null;do{null!=(u=a.exec(bt))&&(u[1]||(It+=u[0]))}while(null!=u);for(A+=(y=W(It,"{")-W(It,"}"))-p>=0?y-p:y,(y-=O)<0&&(y=0),0===I&&S||(C+=y,(I+=y)>0&&(I-=1-A-W(It,"{")+W(It,"}")>=0?1-A-W(It,"{")+W(It,"}"):0));_>0;)b+="}",_--;0===O&&(b+="\n")}for(I-=C;I>0;)b+="}",I--;for(A-=M;A>0;)b+="}",A--;if(b+="\n",E.size>0){var Dt,St=0;b=(Dt=G(b,St,E,"animation")).finalCss,St=Dt.startIndex,b=(Dt=G(b,St=0,E,"animation-name")).finalCss,St=Dt.startIndex}if(""!==b.trim()){var Ct=document.head||document.getElementsByTagName("head")[0],xt=document.createElement("style");Ct.appendChild(xt),xt.appendChild(document.createTextNode(b))}return r},G=function(e,r,s,o){for(;-1!==(r=e.indexOf(o,r));){var i=e.substring(0,r),a=e.substring(r,e.indexOf(";",r)),l=e.substring(r+a.length,e.length);if(a.includes(":"))if(":"===a.substring(0,a.indexOf(":")+1).replace(o,"").trim()){var u,c=t(s);try{for(c.s();!(u=c.n()).done;){var f=n(u.value,2),d=f[0],h=f[1],p=a.replace(o,"");(p=p.trim()).startsWith(":")&&(p=(p=p.substring(1,p.length)).trim()),new RegExp(d+"(\\s|;|$)").test(p)&&d.length>0?r+=(a=a.replaceAll(d,h)).length:r+=o.length}}catch(t){c.e(t)}finally{c.f()}e=i+a+l}else r+=a.length}return{finalCss:e,startIndex:r}};function P(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=document.getElementById(t).getAttribute("slssrclass"),r=c[n];return!r&&this&&(r=this[n]),$(t,new r,e)}function Y(t){return Promise.all(t.map((function(t){return t.then((function(t){return{result:t,status:"fulfilled",error:null}}),(function(t){return{result:null,error:t,status:"rejected"}}))})))}function B(t){s._state=t}function q(){return s._state}function K(t){return String(t)}function X(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.attrs,r=void 0===n?{}:n,s=e.children,o=void 0===s?[]:s;return{tagName:t=t.toUpperCase(),attrs:r,children:o}}function m(){return 3===arguments.length&&"string"==typeof arguments[0]&&"object"==e(arguments[1])&&Array.isArray(arguments[2])?X(arguments[0],{attrs:arguments[1],children:arguments[2]}):X(arguments[0],arguments[1])}function $(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];s._router.mountRoute=t;var r=document.getElementById(t);if(null!==r)return j(r,e,n);console.error("ID "+t+" does not exist in DOM.")}function J(e){var n,r=[],o=new Set,i=t(s._structureForMap.keys());try{for(i.s();!(n=i.n()).done;){var a=n.value;o.add(a)}}catch(t){i.e(t)}finally{i.f()}e.slOnInit&&(e.slOnInit(),r.push(e));for(var l=e.view.bind(e)(),u=e;l.view;)l.slOnInit&&(l.slOnInit(),r.push(l)),u=l,l=l.view.bind(l)();d(l,u);var c=f(l,r);r.forEach((function(t){t.slOnDestroy&&t.slOnDestroy.bind(t)()}));var h,p=t(s._structureForMap.keys());try{for(p.s();!(h=p.n()).done;){var v=h.value;o.has(v)||s._structureForMap.delete(v)}}catch(t){p.e(t)}finally{p.f()}return c}function V(t,e){var n=t;if(t=document.getElementById(t),s._afterInitArr=[],t){var r=e.view.bind(e)();d(r,e),t=F(t,r,e)}else console.error("ID "+n+" not mounted in DOM; attachDetector likely needs to be called.");var o=t.querySelectorAll("[slref]");void 0!==t.slref&&(o=Array.from(o)).push(t);for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{},i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(s._router.params=o,!s._router.currentRoute||!s._router.currentRoute.onCanDeactivate||s._router.currentRoute.onCanDeactivate(r)){var a,l=null,u=t(s._router.routeList);try{var f=function(){var t=n(a.value,2),e=t[0],o=t[1];if(e.test(r)){if(o.onActivationCheck&&!o.onActivationCheck(r))return{v:(o.onActivationFail&&(l=it(o.onActivationFail.route,o.onActivationFail.params,"boolean"!=typeof o.onActivationFail.attachDetector||o.onActivationFail.attachDetector)),void(r=void 0))};o.onBeforeRoute&&o.onBeforeRoute();var u=document.getElementById(o.root),f=s._destroyNodeMap.get(rt());f&&(f.forEach((function(t){t.slOnDestroyFn&&u.contains(t)&&t.slOnDestroyFn(),t.slOnDestroyFn=void 0,t.slUnboundOnDestroy=void 0})),s._destroyNodeMap.set(rt(),[]),s._destroyFuncMap.set(rt(),[])),s._router.lastHash=r;var d=c.pageYOffset;switch(s._router.strategy){case"#":c.history.pushState(null,document.title,"#/"+r);break;case"?":var p=c.location.href,v=c.location.pathname;p=p.substring(0,p.indexOf(v)),p+="/?/"+r,c.history.pushState(null,document.title,p);break;case"":var g=c.location.href,y=c.location.pathname;g=g.substring(0,g.indexOf(y)),g+="/"+r,c.history.pushState(null,document.title,g)}if(c.scrollTo(0,d),s._router.currentRoute&&void 0!==s._router.currentRoute.animateDestroy&&(s._router.currentRoute.animateDestroy=!0),s._router.currentRoute&&s._router.currentRoute.animateDestroy){var b=s._router.currentRoute.root;b=document.getElementById(b),s._router.currentRoute=o,D(b),S(b),h(b),w(b),Q()}else Q(),s._router.currentRoute=o;return s._router.count++,o.component&&(o.component.slOnDestroy&&s._destroyFuncMap.set(r,[o.component.slOnDestroy.bind(o.component)]),s._router.mountRoute=r,j(u,o.component,i),o.component.slOnDestroy&&(u.slOnDestroyIndex=0,s._destroyFuncMap.get(r).pop(),I(u)),l=o.component),"break"}};for(u.s();!(a=u.n()).done;){var d=f();if("break"===d)break;if("object"===e(d))return d.v}}catch(t){u.e(t)}finally{u.f()}return s._changeDetector.changeDetectionStrategy===s.CHANGE_STRATEGY_AUTOMATIC&&dt(),l}}Q();var at=function(t,e,n){return{parent:t,factory:e,map:Object.create(null)}};function lt(t,e){"function"==typeof e&&(e=e());for(var n=[],r=0;r0&&(T([t.parent]),T(Array.from(u)))}s.CHANGE_STRATEGY_AUTOMATIC=100,s.CHANGE_STRATEGY_MANUAL=200,s.CHANGE_DETECTOR_DETACHED=!1,s.CHANGE_DETECTOR_ATTACHED=!0,s._changeStrategies=[s.CHANGE_STRATEGY_AUTOMATIC,s.CHANGE_STRATEGY_MANUAL],s._changeDetector={lastUpdateDate:new Date,changeDetectionStrategy:s.CHANGE_STRATEGY_AUTOMATIC},Object.seal(s._changeDetector),Object.freeze(s._changeStrategies);var ct=function(t,e){if(e[t]){var n=e[t];e[t]=function(){var t=n.apply(this,[].slice.call(arguments));return dt(),t}}},ft=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t?V(t,s._updateMap.get(t)):s._updateMap.forEach((function(t,e){V(e,t)}))},dt=function(){s._changeDetector.changeDetectionStrategy===s.CHANGE_STRATEGY_AUTOMATIC&&(new Date-s._changeDetector.lastUpdateDate>6?ft():s._debouncedPerformUpdates(),s._changeDetector.lastUpdateDate=new Date)};function ht(t){s._changeStrategies.forEach((function(e){e===t&&(s._changeDetector.changeDetectionStrategy=t)}))}function pt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;ft(t)}function vt(t){return s._updateMap.has(t)}function gt(t){s._updateMap.delete(t)}var yt=Promise.prototype.then;function mt(){Promise.prototype.then=function(t,e){return yt.call(this,(function(e){return dt(),"function"==typeof t&&t instanceof Function?t(e):t}),e)}}function bt(t,e){return function(){e&&e.slpreventdefault&&arguments.length>0&&"function"==typeof arguments[0].preventDefault&&arguments[0].preventDefault();var n=t.apply(this,[].slice.call(arguments));return dt(),n}}s._debouncedPerformUpdates=function(t,e){var n;return function(){for(var e=arguments.length,r=new Array(e),s=0;s{},e.setInterval=()=>{},e.location={},e.location.href="",e.fetch=()=>{},e.XMLHttpRequest={},e.XMLHttpRequest.prototype={},e.XMLHttpRequest.prototype.send=()=>{}),e.s=function(){},s._state={},s._destroyFuncMap=new Map,s._updateMap=new Map,s._afterInitArr=[],s._destroyNodeMap=new Map,s._structureForMap=new Map,s._isAnimatingKeyed=null,s._scopedCssSet=new Set;const n=({tagName:t,attrs:e,children:r,model:o},l)=>{let i,a="<"+(t=t.toLowerCase()),u=null;for(let[t,n]of Object.entries(e))if(i=typeof n,a+="function"===i?" "+t+'=""':" "+t+'="'+n+'"',"slfor"===t){const t=n.split(":");if(t.length>=4){s._structureForMap.has(t[0])||s._structureForMap.set(t[0],U(null,o[t[2]]));const e=s._structureForMap.get(t[0]);u=T.bind(o,e,o[t[1]],o[t[3]])()}}else if("slfornamed"===t){const t=n.split(":");if(t.length>=4){let e,n,r,l;for(let s of Object.keys(o))l=o[s],l.slfor===t[2]?e=l:l.slfor===t[1]?r=l:l.slfor===t[3]&&(n=l);for(let s of I(o))l=o[s],l.slfor===t[2]?e=l:l.slfor===t[1]?r=l:l.slfor===t[3]&&(n=l);r=r.bind(o),s._structureForMap.has(t[0])||s._structureForMap.set(t[0],U(null,e));const i=s._structureForMap.get(t[0]);u=T.bind(o,i,r,n)()}}a+=">",null!==u&&u.forEach(t=>{a+=n(t,l)});for(let t of r)t.view?(t.slOnInit&&(t.slOnInit(),l.push(t)),t=t.view.bind(t)(),a+=n(t,l)):a+="string"==typeof t?t:n(t,l);return a+=""},r=(t,e)=>{const n=[];let s;for(n.push(t);n.length>0;)if(s=n.shift(),s.attrs&&(s.attrs.slfor||s.attrs.slfornamed)&&(s.model=e),s.children)for(let t=s.children.length-1;t>=0;--t)n.push(s.children[t])},o=t=>{const e=[];let n,r;for(e.push(t);e.length>0;)if(n=e.shift(),3!==n.nodeType&&(n.hasAttribute("slfor")?(r=n.getAttribute("slfor"),r=r.split(":"),r.length>0&&s._structureForMap.delete(r[0])):n.hasAttribute("slfornamed")&&(r=n.getAttribute("slfornamed"),r=r.split(":"),r.length>0&&s._structureForMap.delete(r[0])),n.children))for(let t=n.children.length-1;t>=0;--t)e.push(n.children[t])};export function renderElementWithoutClass(t,e,n){let r,o,l;r=e&&e.slns?document.createElementNS(e.slns,t.toLowerCase()):document.createElement(t);for(let t of Object.keys(e)){if(l=e[t],o=typeof l,"function"===o)r[t]=l,s._changeDetector.changeDetectionStrategy!==s.CHANGE_STRATEGY_AUTOMATIC||l.name.startsWith("bound slDetached")||l.name.startsWith("slDetached")||L(t,r);else if("slnsfor"===t){const t=JSON.parse(e.slnsfor);for(const[e,n]of Object.entries(t))r.setAttributeNS(n.namespace,e,n.value)}r.setAttribute(t,l)}for(let t of n)r.append(t);return r}export function renderElement({tagName:t,attrs:e,children:n},r=!1){let o,l;o=e&&e.slns?document.createElementNS(e.slns,t.toLowerCase()):document.createElement(t);for(let[t,n]of Object.entries(e))if(l=typeof n,"function"===l)o[t]=n,s._changeDetector.changeDetectionStrategy!==s.CHANGE_STRATEGY_AUTOMATIC||n.name.startsWith("bound slDetached")||n.name.startsWith("slDetached")||L(t,o);else if("slnsfor"===t){const t=JSON.parse(e.slnsfor);for(const[e,n]of Object.entries(t))o.setAttributeNS(n.namespace,e,n.value)}else o.setAttribute(t,n);for(let t of n)"string"==typeof t?o.append(t):t.view?r?a(t,o):u(t,o):o.appendChild(renderElement(t,r));return o}const l=({tagName:t,attrs:e,children:n})=>{let r,o;r=e&&e.slns?document.createElementNS(e.slns,t.toLowerCase()):document.createElement(t);for(let[t,n]of Object.entries(e))if(o=typeof n,"function"===o)r[t]=n,s._changeDetector.changeDetectionStrategy!==s.CHANGE_STRATEGY_AUTOMATIC||n.name.startsWith("bound slDetached")||n.name.startsWith("slDetached")||L(t,r);else if("slnsfor"===t){const t=JSON.parse(e.slnsfor);for(const[e,n]of Object.entries(t))r.setAttributeNS(n.namespace,e,n.value)}else r.setAttribute(t,n);for(let t of n)"string"==typeof t?r.append(t):t.view?u(t,r):r.appendChild(l(t));return r},i=(t,e)=>{t.slKeyList=[],t.slNamespace={};for(const n in e)t.slNamespace[n]=e[n],t.slKeyList.push(n)},a=(t,e)=>{t=d(t,!0,!0,!0).view;const n=l(t);e.appendChild(n)},u=(t,e,n=!1)=>{Object.getPrototypeOf(t).slDirty=!0;const r=t,o=d(t,!0,!0,!0);t=o.view,o.afterInit&&s._afterInitArr.push(o.afterInit);const a=l(t);if(o.scopedCss){const t=M(o.model,o.model.slStyle());g(a,t),a.slScopedCss=!0}o.onInit&&(a.slOnInit=!0),c(a,o.destroyIndex,o.onDestroy,o.slUnboundOnDestroy),f(a),e.appendChild(a),i(a,r),n&&S(a,t,o.model)},c=(t,e,n,s)=>{t.slOnDestroy=!0,t.slOnDestroyIndex=e,t.slOnDestroyFn=n,t.slAfterInit=!0,t.slOnInit=!0,t.slUnboundOnDestroy=s},d=(t,e,n,o=!1,l=null)=>{if(n&&t.slOnInit&&(t.slOnInit(),l&&(l.slOnInit=!0)),l&&l.slKeyList)for(const e of l.slKeyList)void 0===t[e]?t[e]=l.slNamespace[e]:l.slNamespace[e]=t[e];let i=null;if(e&&t.slOnDestroy){let e=s._destroyFuncMap.get(s._router.mountRoute);e||(e=[]),e.push(t.slOnDestroy.bind(t)),s._destroyFuncMap.set(s._router.mountRoute,e),i=e.length-1}const a=t.view.bind(t)();return r(a,t),{view:a,afterInit:t.slAfterInit?t.slAfterInit.bind(t):null,onDestroy:e&&!o||!t.slOnDestroy?null:t.slOnDestroy.bind(t),onInit:!n&&t.slOnInit?t.slOnInit:null,destroyIndex:i,model:t,scopedCss:t.slStyle?t.slStyle.bind(t):null,slUnboundOnDestroy:t.slOnDestroy,slUnboundAfterInit:t.slAfterInit,slUnboundOnInit:t.slOnInit}},f=t=>{if(t&&null!==t.slOnDestroyIndex&&void 0!==t.slOnDestroyIndex&&!t.slOnDestroyRoute){let e=s._destroyNodeMap.get(s._router.mountRoute);e||(e=[]);e.find(e=>e.slOnDestroyIndex===t.slOnDestroyIndex)||e.push(t),s._destroyNodeMap.set(s._router.mountRoute,e),t.slOnDestroyRoute=s._router.mountRoute}},p=t=>{if(t&&t.slOnDestroy){let e=s._destroyFuncMap.get(s._router.mountRoute);e||(e=[]),e.splice(t.slOnDestroyIndex,1),s._destroyFuncMap.set(s._router.mountRoute,e);let n=s._destroyNodeMap.get(s._router.mountRoute);n||(n=[]),n.forEach(e=>{e.slOnDestroyIndex>t.slOnDestroyIndex&&e.slOnDestroyIndex--}),n=n.filter(e=>e.slOnDestroyIndex!==t.slOnDestroyIndex),s._destroyNodeMap.set(s._router.mountRoute,n)}},h=t=>{if(t&&t.children&&t.children.length>0){for(const e of t.children)h(e);t.slOnDestroyFn&&(t.slOnDestroyFn(),t.slOnDestroyFn=void 0,t.slUnboundOnDestroy=void 0)}else t.slOnDestroyFn&&(t.slOnDestroyFn(),t.slOnDestroyFn=void 0,t.slUnboundOnDestroy=void 0)},g=(t,e)=>{if(t.setAttribute(e,""),t.children&&t.children.length>0)for(const n of t.children)g(n,e)},y=(t,e,n)=>{t.slOnDestroy=!0;let r=s._destroyFuncMap.get(s._router.mountRoute);r||(r=[]),r.push(e),s._destroyFuncMap.set(s._router.mountRoute,r),t.slOnDestroyIndex=r.length-1,t.slOnDestroyFn=e,t.slUnboundOnDestroy=n,f(t)},_=(t,e,n)=>{let r;const o=[];for(let t of e){let e=n[t.name];e?e.length===t.nodeValue.length&&e===t.nodeValue&&delete n[t.name]:t.name.startsWith("slcss-")||o.push(t.nodeName)}o.forEach(e=>{t.removeAttribute(e)}),void 0!==n.slref&&(t.slref=t);const l=n.slpreventdefault;let i=!1;for(let[e,o]of Object.entries(n))if(r=typeof o,"function"===r){if(void 0!==l){let n=e;n.startsWith("on")&&(n=n.substring(2,n.length));const s=t[e];if(s){(Array.isArray(s)?s:[s]).forEach(e=>{t.removeEventListener(n,e)})}t.addEventListener(n,(function(t){t.preventDefault()})),i=!0}t[e]=o,s._changeDetector.changeDetectionStrategy!==s.CHANGE_STRATEGY_AUTOMATIC||o.name.startsWith("bound slDetached")||o.name.startsWith("slDetached")||L(e,t)}else if("slnsfor"===e){const e=JSON.parse(n.slnsfor);for(const[n,s]of Object.entries(e))t.setAttributeNS(s.namespace,n,s.value)}else t.setAttribute(e,o);i||(void 0!==l||e.slpreventdefault)&&v([t])},b=(t,e,n)=>{const r=e.length;let a=0;for(let t=e.length-1;t>=0;--t){let r=null,o=null;if(n[t]&&(e[t].slUnboundOnDestroy!==n[t].slOnDestroy&&(void 0!==e[t].slUnboundOnDestroy&&void 0!==e[t].slOnDestroyFn&&e[t].slOnDestroyFn(),p(e[t]),e[t].slOnDestroyFn=void 0,e[t].slOnDestroy=!1),n[t].view)){const l=d(n[t],!1,!1,!1,e[t]);n[t]=l.view;const a=Object.getPrototypeOf(l.model);!0!==a.slDirty&&(l.onInit&&e[t].slOnInit&&(e[t].slOnInit=!1),l.afterInit&&e[t].slAfterInit&&(e[t].slAfterInit=!1),l.scopedCss&&e[t].slScopedCss&&(e[t].slScopedCss=!1),l.onDestroy&&e[t].slOnDestroy&&(e[t].slOnDestroy=!1),a.slDirty=!0),l.onInit&&!e[t].slOnInit&&e[t].slUnboundOnInit!==l.slUnboundOnInit?(e[t].slUnboundOnInit=l.slUnboundOnInit,l.onInit.bind(l.model)(),n[t].slOnInit=!0):void 0===e[t].slUnboundOnInit||l.onInit?l.onInit&&e[t]&&!e[t].slOnInit?(e[t].slUnboundOnInit===l.slUnboundOnInit&&l.onInit.bind(l.model)(),e[t].slUnboundOnInit=l.slUnboundOnInit,n[t].slOnInit=!0):l.onInit&&e[t].slOnInit&&void 0===e[t].slUnboundOnInit&&(e[t].slUnboundOnInit=l.slUnboundOnInit):e[t].slOnInit=!1,l.afterInit&&!e[t].slAfterInit&&e[t].slUnboundAfterInit!==l.slUnboundAfterInit?(e[t].slAfterInit=!0,e[t].slUnboundAfterInit=l.slUnboundAfterInit,s._afterInitArr.push(l.afterInit)):void 0===e[t].slUnboundAfterInit||l.afterInit?l.afterInit&&e[t]&&!e[t].slAfterInit?(e[t].slAfterInit=!0,e[t].slUnboundAfterInit===l.slUnboundAfterInit&&s._afterInitArr.push(l.afterInit),e[t].slUnboundAfterInit=l.slUnboundAfterInit):l.afterInit&&e[t].slAfterInit&&void 0===e[t].slUnboundAfterInit&&(e[t].slUnboundAfterInit=l.slUnboundAfterInit):e[t].slAfterInit=!1,l.scopedCss&&e[t]&&!e[t].slScopedCss&&(o=M(l.model,l.model.slStyle())),l.onDestroy&&e[t]&&!e[t].slOnDestroy&&y(e[t],l.onDestroy,l.slUnboundOnDestroy),i(e[t],l.model),r=l.model}S(e[t],n[t],r),n[t]&&n[t].slOnInit&&(e[t].slOnInit=!0),o&&(g(e[t],o),e[t].slScopedCss=!0),a++}let c=e.length;for(;c>r;)p(e[c-1]),h(e[c-1]),o(e[e.length-1]),O(e[c-1]),c--;for(let e of n.slice(r)){if("string"==typeof e)t.childNodes[a]?t.childNodes[a].textContent!==e&&(t.childNodes[a].textContent=e):t.append(e);else if("string"==typeof e)t.append(e);else if(e.view)u(e,t,!0);else{const n=l(e);t.appendChild(n),S(n,e)}a++}for(c=e.length;c>n.length;)p(e[c-1]),h(e[c-1]),o(e[c-1]),O(e[c-1]),c--},O=t=>{const e=s._router.count;if(void 0===t.slanimatedestroytarget||""===t.slanimatedestroytarget||t.slAnimateDestroy||void 0===t.attributes.slanimatedestroy||""===t.getAttribute("slanimatedestroy"))if(3===t.nodeType||void 0===t.attributes.slanimatedestroy||""===t.getAttribute("slanimatedestroy")||t.slAnimateDestroy)t.slAnimateDestroy||(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id));else{const n=t.onanimationend,r=t.onanimationstart,o=t.getAttribute("slanimatedestroy");t.onanimationstart=function(e){t.slAnimationName=e.animationName},t.onanimationend=function(o){if(!t.slAnimationName||t.slAnimationName!==o.animationName)return;let l=void 0;return n&&(l=n.apply(this,[].slice.call(arguments))),(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id)),t.slAnimationName=null,t.onanimationend=n,t.onanimationstart=r,t.slAnimateDestroy=!1,l},t.classList.add(o),t.slAnimateDestroy=!0}else{const n=t.slanimatedestroytarget;if("function"==typeof n){const r=n(t);if(r){const n=r.getAttribute("slanimatedestroy"),o=r.onanimationend,l=r.onanimationstart;r.onanimationstart=function(t){r.slAnimationName=t.animationName},r.onanimationend=function(i){if(!r.slAnimationName||r.slAnimationName!==i.animationName)return;let a=void 0;return o&&(a=o.apply(this,[].slice.call(arguments))),r.classList.remove(n),s._isAnimatingKeyed=null,s._router.currentRoute.animateDestroy?(s._router.currentRoute.animateDestroy=!1,t.setAttribute("style","opacity: 0;"),r.onanimationend=null,r.onanimationstart=null):((s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id)),r.onanimationend=o,r.onanimationstart=l),r.slAnimationName=null,t.slAnimateDestroy=!1,delete t.slanimatedestroytarget,detectChanges(),a},s._isAnimatingKeyed=r,r.classList.add(n),t.slAnimateDestroy=!0}else(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id))}else(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id))}},A=t=>t&&t!==Object.prototype&&Object.getOwnPropertyNames(t).filter(e=>((t,e)=>(Object.getOwnPropertyDescriptor(t,e)||{}).get)(t,e)||((t,e)=>"function"==typeof t[e])(t,e)).concat(A(Object.getPrototypeOf(t))||[]),I=t=>(t=>Array.from(new Set(A(t))))(t).filter(t=>"constructor"!==t&&!~t.indexOf("__")),D=(t,e,n="")=>{if(e.slStyle&&!t.slScopedCss){const s=M(e,e.slStyle());g(t,s),t.slScopedCss=!0,t.style.display=n}},v=t=>{for(let e=0;e{n.removeEventListener(e,t)})}n.addEventListener(e,(function(t){t.preventDefault()}))}}},S=(t,e,n=null)=>{if(null!==s._isAnimatingKeyed)for(let[e,n]of s._updateMap){const n=document.getElementById(e);if(n.contains(s._isAnimatingKeyed)&&n.contains(t))return t}let r;if(e&&e.slStyle&&(r=t.style.display,t.style.display="none"),e&&e.view){t.slUnboundOnDestroy!==e.slOnDestroy&&(void 0!==t.slUnboundOnDestroy&&void 0!==t.slOnDestroyFn&&t.slOnDestroyFn(),p(t),t.slOnDestroyFn=void 0,t.slOnDestroy=!1);const n=d(e,!1,!1,!1,t);e=n.view;const r=Object.getPrototypeOf(n.model);if(!0!==r.slDirty&&(n.onInit&&t.slOnInit&&(t.slOnInit=!1),n.afterInit&&t.slAfterInit&&(t.slAfterInit=!1),n.scopedCss&&t.slScopedCss&&(t.slScopedCss=!1),n.onDestroy&&t.slOnDestroy&&(t.slOnDestroy=!1),r.slDirty=!0),n.onInit&&t&&!t.slOnInit&&(n.onInit.bind(n.model)(),t.slOnInit=!0),n.afterInit&&t&&!t.slAfterInit&&(t.slAfterInit=!0,s._afterInitArr.push(n.afterInit)),n.scopedCss&&t&&!t.slScopedCss){const e=M(n.model,n.model.slStyle());g(t,e),t.slScopedCss=!0}n.onDestroy&&t&&!t.slOnDestroy&&y(t,n.onDestroy,n.slUnboundOnDestroy)}if(!e)return t&&(p(t),h(t),o(t),O(t)),t;if(t&&(t.tagName||"").toLowerCase()!==((e?e.tagName:void 0)||"").toLowerCase()){if(!e.tagName)return p(t),h(t),t.replaceWith(e),t=e;{let n;n=e.attrs&&e.attrs.slns?document.createElementNS(e.attrs.slns,e.tagName.toLowerCase()):document.createElement(e.tagName),D(n,e,r),t.parentNode.insertBefore(n,t),p(t),h(t),o(t),O(t),n.slUnboundAfterInit=t.slUnboundAfterInit,void 0!==n.slUnboundAfterInit&&(n.slAfterInit=!0),t.slOnInit&&(n.slOnInit=!1),t=n}}if("string"==typeof e)return t.textContent!==e&&(t.textContent=e),t;switch(e.attrs.sldirective){case"useexisting":return D(t,e,r),t;case"onlychildren":return b(t,t.childNodes,e.children),t;case"onlyself":return _(t,t.attributes,e.attrs),D(t,e,r),t;case"trustchildren":{_(t,t.attributes,e.attrs),D(t,e,r);let n="";e.children.forEach(t=>{n+=t}),t.innerHTML!==n&&(t.innerHTML=n);const s=t.querySelectorAll("[slpreventdefault]");return s.length>0&&v(Array.from(s)),t}}if(e.attrs.slfor){const n=e.attrs.slfor.split(":");if(n.length>=4){if(!s._structureForMap.has(n[0])){const r=U(t,e.model[n[2]]);if(s._structureForMap.set(n[0],r),t.children.length>0){let e=Object.create(null);for(let n=0;n=4){let r,o,l,i;for(let t of Object.keys(e.model))i=e.model[t],i.slfor===n[2]?r=i:i.slfor===n[1]?l=i:i.slfor===n[3]&&(o=i);for(let t of I(e.model))i=e.model[t],i.slfor===n[2]?r=i:i.slfor===n[1]?l=i:i.slfor===n[3]&&(o=i);if(l=l.bind(e.model),!s._structureForMap.has(n[0])){const e=U(t,r);if(s._structureForMap.set(n[0],e),t.children.length>0){let n=Object.create(null);for(let e=0;e{s._afterInitArr=[],e.slOnInit&&e.slOnInit();let o=e.view.bind(e)();if(r(o,e),o.view&&(o=o.view.bind(e)(),r(o,e)),!o.attrs||t&&t.id!==o.attrs.id){const e=o.attrs?o.attrs.id:"null";console.error("Mounted component root element changed from "+t.id+" to "+e)}if(t=S(t,o,e),e.slOnInit&&(t.slOnInit=!0,t.slUnboundOnInit=e.slOnInit),e.slStyle&&!t.slScopedCss){const n=M(e,e.slStyle());g(t,n),t.slScopedCss=!0}n&&s._updateMap.set(t.id,e),e.slOnDestroy&&y(t,e.slOnDestroy.bind(e),e.slOnDestroy);let l=t.querySelectorAll("[slref]");void 0!==t.slref&&(l=Array.from(l),l.push(t));for(let t=0;t{t()}),t};export function version(){return"21.0.0"}const x=(t,e)=>t.split(e).length-1,R=(t,e,n=0)=>{let s="",r=!1,o=!1,l=!1;for(let i=n;ii+e.length&&t.substring(i,i+e.length)===e&&!r&&!o){s+=t.substring(i,i+e.length-1);break}return s},M=(t,e)=>{const n=function(t){for(var e=0,n=1779033703^t.length;e>>19;return function(){return n=Math.imul(n^n>>>16,2246822507),n=Math.imul(n^n>>>13,3266489909),(n^=n>>>16)>>>0}}(t.constructor.name),r="slcss-"+String(n());if(""===e||s._scopedCssSet.has(r))return r;e=e.replace(/\t+/g," "),s._scopedCssSet.add(r);const o=new RegExp("([^{]+)s*{s*([^}]+)s*}","g"),l=e.match(o),i=/[^\s"]+|"([^"]*)"/gi;let a="",u=null;do{u=i.exec(e),null!=u&&(u[1]||(a+=u[0]))}while(null!=u);let c,d,f,p,h,g,y,_,b="",O=0,A=0,I=0,D=0,v=!1,S=!1,C=0,M=!1,N=0;const w=new Map;if(a.includes("{")&&a.includes("}")&&a.split("{").length===a.split("}").length)for(let t=0;t0){let t=s.trim();for(;t.startsWith("}")&&D>0;)!(0!==O||1!==D||n<=D)&&A-n>=1||D--,n--,A--,t=t.replace("}","").trim()}let t="";u=null;do{u=i.exec(s),null!=u&&(u[1]||(t+=u[0]))}while(null!=u);if(b+=s,0===D&&x(t,"}")>0){const e=t.length,s=t.replace(/^}+/,"");A-=x(s,"}"),A>=e-s.length&&(1===A&&1===n||(N+=e-s.length))}let e=x(t,"{")-x(t,"}"),r=/(@layer|@container|@media|@scope)[^{]*\{/g,o=t.replace(/\s/g,"").match(r);const l=o?o.length:0;e-=D>0?0:l,e<0&&(e=0),D+=e}}d=c}g=l[t].substring(c)}let s=c+R(l[t],"{",c).length-1;-1===s&&(s=c);let o=l[t].substring(c,s);for(;(o.split('"').length-1)%2!=0;)s=s+1+R(l[t],"{",s+1).length,o=l[t].substring(c,s);if(""!==o&&!/^\s*$/.test(o)){const e=o.split(",");let a;I>0&&o.startsWith(",")&&(e.shift(),e[0]=", "+e[0]);for(let o=0;o0&&a.includes("}");){let t,e,n="";for(;a.includes("}");)t=a.indexOf("{"),e=a.indexOf("}"),(e0&&D--,0===D&&(v=!1);if(a.includes(" ")){let c=a.substring(0,a.indexOf(" ")),d=a.substring(a.indexOf(" "));o>0&&(b+=", ");if("@nest"===c.trim()&&d.replace(/^\s+/g,"").includes(" ")){let t=d.replace(/^\s+/g,""),e=t.substring(0,t.indexOf(" "));t=t.substring(e.length,t.length),c+=" "+e,d=t}if(M=c.trim().startsWith("@"),y=c.trim().endsWith(":"),y){let r=R(d,";");for(;R(d,";",r.length).trim().endsWith(";");)r+=R(d,";",r.length);const a=d.substring(r.length,d.length);d=r;let f=l[t].substring(s);s=l[t].length;let p=a+" ";const h=e.length>1;for(let t=o+1;t0&&n>0&&h&&(A++,N++);let g="";u=null;do{u=i.exec(l[t+1]),null!=u&&(u[1]||(g+=u[0]))}while(null!=u);let y=x(g,"{");y-=x(g,"}"),y<0&&(y=0),A+=y,C+=y}!(!D>0)||v||S&&0!==D||M&&!c.trim().startsWith("@nest")||y?b+=c+d:b+=c+(0===D?"["+r+"]":"")+d}else o>0&&(b+=", "),!(!D>0)||v||S&&0!==D||a.trim().startsWith("@")||M||a.trim().endsWith(":")?b+=a:b+=a+(0===D?"["+r+"]":"")}}}if(I>0&&(s=null!==f?l[t].indexOf(f):0),l[t].includes("--")&&n>1){let e=R(l[t],"--",0).length;const s=l[t].substring(0,e);let r="";do{u=i.exec(s),null!=u&&(u[1]||(r+=u[0]))}while(null!=u);const o=x(r,"{")-1;h=n-1,o>0&&(h-=o),h>0&&(I+=h)}if(n-I>1&&!p){const e=l[t].substring(s+1);l[t]=l[t].substring(0,l[t].length-e.length),l.splice(t+1,0,e);let n="";u=null;do{u=i.exec(e),null!=u&&(u[1]||(n+=u[0]))}while(null!=u);_=x(n,"{")-x(n,"}"),I-=h}let a=l[t].substring(s);const E=a.replace("{","").replace(";","");if(a.includes("{")&&x(a,"{")>1&&!E.trim().startsWith("--")){let e=R(a,"{",0);e=e+" "+R(a,"{",e.length);let n=a.substring(e.length+1,a.length);n=e.substring(e.lastIndexOf(";")+1,e.length)+" "+n,e=e.substring(0,e.lastIndexOf(";")+1),a=e,l.splice(t+1,0,n),D++,C++}b+=a;let U="";u=null;do{u=i.exec(a),null!=u&&(u[1]||(U+=u[0]))}while(null!=u);for(_=x(U,"{")-x(U,"}"),A+=_-h>=0?_-h:_,_-=I,_<0&&(_=0),0===D&&S||(C+=_,D+=_,D>0&&(D-=1-A-x(U,"{")+x(U,"}")>=0?1-A-x(U,"{")+x(U,"}"):0));O>0;)b+="}",O--;0===I&&(b+="\n")}for(D-=C;D>0;)b+="}",D--;for(A-=N;A>0;)b+="}",A--;if(b+="\n",w.size>0){let t,e=0;t=E(b,e,w,"animation"),b=t.finalCss,e=t.startIndex,e=0,t=E(b,e,w,"animation-name"),b=t.finalCss,e=t.startIndex}if(""!==b.trim()){const t=document.head||document.getElementsByTagName("head")[0],e=document.createElement("style");t.appendChild(e),e.appendChild(document.createTextNode(b))}return r},E=(t,e,n,s)=>{for(;-1!==(e=t.indexOf(s,e));){const r=t.substring(0,e);let o=t.substring(e,t.indexOf(";",e));const l=t.substring(e+o.length,t.length);if(o.includes(":")){if(":"===o.substring(0,o.indexOf(":")+1).replace(s,"").trim()){for(const[t,r]of n){let n=o.replace(s,"");n=n.trim(),n.startsWith(":")&&(n=n.substring(1,n.length),n=n.trim());new RegExp(t+"(\\s|;|$)").test(n)&&t.length>0?(o=o.replaceAll(t,r),e+=o.length):e+=s.length}t=r+o+l}else e+=o.length}}return{finalCss:t,startIndex:e}};export function hydrate(t,n=!0){const s=document.getElementById(t).getAttribute("slssrclass");let r=e[s];!r&&this&&(r=this[s]);return mount(t,new r,n)}export function resolveAll(t){return Promise.all(t.map(t=>t.then(t=>({result:t,status:"fulfilled",error:null}),t=>({result:null,error:t,status:"rejected"}))))}export function setState(t){s._state=t}export function getState(){return s._state}export function textNode(t){return String(t)}export function markup(t,{attrs:e={},children:n=[]}={}){return{tagName:t=t.toUpperCase(),attrs:e,children:n}}export function m(){return 3===arguments.length&&"string"==typeof arguments[0]&&"object"==typeof arguments[1]&&Array.isArray(arguments[2])?markup(arguments[0],{attrs:arguments[1],children:arguments[2]}):markup(arguments[0],arguments[1])}export function mount(t,e,n=!0){s._router.mountRoute=t;let r=document.getElementById(t);if(null!==r)return C(r,e,n);console.error("ID "+t+" does not exist in DOM.")}export function renderToString(t){const e=[],o=new Set;for(let t of s._structureForMap.keys())o.add(t);t.slOnInit&&(t.slOnInit(),e.push(t));let l=t.view.bind(t)(),i=t;for(;l.view;)l.slOnInit&&(l.slOnInit(),e.push(l)),i=l,l=l.view.bind(l)();r(l,i);const a=n(l,e);e.forEach(t=>{t.slOnDestroy&&t.slOnDestroy.bind(t)()});for(let t of s._structureForMap.keys())o.has(t)||s._structureForMap.delete(t);return a}export function update(t,e){const n=t;if(t=document.getElementById(t),s._afterInitArr=[],t){let n=e.view.bind(e)();r(n,e),t=S(t,n,e)}else console.error("ID "+n+" not mounted in DOM; attachDetector likely needs to be called.");let o=t.querySelectorAll("[slref]");void 0!==t.slref&&(o=Array.from(o),o.push(t));for(let t=0;t{t()}),e.slStyle&&!t.slScopedCss){const n=M(e,e.slStyle());g(t,n),t.slScopedCss=!0}}let N=e.onpopstate;e.onpopstate=function(t){switch(s._router.strategy){case"#":e.location.hash&&s._router.lastHash!==e.location.hash.substring(2)&&(N&&N(t),route(getRoute()));break;case"?":e.location.search&&s._router.lastHash!==e.location.search.substring(2)&&(N&&N(t),route(getRoute()));break;case"":e.location.pathname&&s._router.lastHash!==e.location.pathname.substring(1)&&(N&&N(t),route(getRoute()))}},s._router={segmentArr:[],routeList:[],params:null,lastHash:!1,currentRoute:null,mountRoute:"",strategy:"#",count:0},Object.seal(s._router);const w=()=>{switch(s._router.strategy){case"#":{let t=e.location.href.split("#/")[1];if(t){let e=t.split("/");e.forEach((t,e)=>{s._router.segmentArr[e]=t}),s._router.segmentArr.splice(e.length,s._router.segmentArr.length)}else s._router.segmentArr.splice(0,s._router.segmentArr.length);break}case"?":{let t=e.location.href.split("?/")[1];if(t){let e=t.split("/");e.forEach((t,e)=>{s._router.segmentArr[e]=t}),s._router.segmentArr.splice(e.length,s._router.segmentArr.length)}else s._router.segmentArr.splice(0,s._router.segmentArr.length);break}case"":{let t=e.location.pathname;if(t){t=t.replace("/","");let e=t.split("/");e.forEach((t,e)=>{s._router.segmentArr[e]=t}),s._router.segmentArr.splice(e.length,s._router.segmentArr.length)}else s._router.segmentArr.splice(0,s._router.segmentArr.length);break}}};export function setRouteStrategy(t){new Set(["#","?",""]).has(t)&&(s._router.strategy=t)}export function getRouteQueryVariables(){const t=e.location.search.substring(2).split("&"),n=[];for(var s=0;s{t.slOnDestroyFn&&n.contains(t)&&t.slOnDestroyFn(),t.slOnDestroyFn=void 0,t.slUnboundOnDestroy=void 0}),s._destroyNodeMap.set(getRoute(),[]),s._destroyFuncMap.set(getRoute(),[])),s._router.lastHash=t;const u=e.pageYOffset;switch(s._router.strategy){case"#":e.history.pushState(null,document.title,"#/"+t);break;case"?":{let n=e.location.href;const s=e.location.pathname;n=n.substring(0,n.indexOf(s)),n+="/?/"+t,e.history.pushState(null,document.title,n);break}case"":{let n=e.location.href;const s=e.location.pathname;n=n.substring(0,n.indexOf(s)),n+="/"+t,e.history.pushState(null,document.title,n);break}}if(e.scrollTo(0,u),s._router.currentRoute&&void 0!==s._router.currentRoute.animateDestroy&&(s._router.currentRoute.animateDestroy=!0),s._router.currentRoute&&s._router.currentRoute.animateDestroy){let t=s._router.currentRoute.root;t=document.getElementById(t),s._router.currentRoute=i,p(t),h(t),o(t),O(t),w()}else w(),s._router.currentRoute=i;s._router.count++,i.component&&(i.component.slOnDestroy&&s._destroyFuncMap.set(t,[i.component.slOnDestroy.bind(i.component)]),s._router.mountRoute=t,C(n,i.component,r),i.component.slOnDestroy&&(n.slOnDestroyIndex=0,s._destroyFuncMap.get(t).pop(),f(n)),l=i.component);break}return s._changeDetector.changeDetectionStrategy===s.CHANGE_STRATEGY_AUTOMATIC&&j(),l}w();const U=(t,e,n)=>({parent:t,factory:e,map:Object.create(null)});function T(t,e){"function"==typeof e&&(e=e());let n=[];for(let s=0;s0&&(v([t.parent]),v(Array.from(c)))}s.CHANGE_STRATEGY_AUTOMATIC=100,s.CHANGE_STRATEGY_MANUAL=200,s.CHANGE_DETECTOR_DETACHED=!1,s.CHANGE_DETECTOR_ATTACHED=!0,s._changeStrategies=[s.CHANGE_STRATEGY_AUTOMATIC,s.CHANGE_STRATEGY_MANUAL],s._changeDetector={lastUpdateDate:new Date,changeDetectionStrategy:s.CHANGE_STRATEGY_AUTOMATIC},Object.seal(s._changeDetector),Object.freeze(s._changeStrategies);const L=(t,e)=>{if(e[t]){let n=e[t];e[t]=function(){let t=n.apply(this,[].slice.call(arguments));return j(),t}}};const W=(t=null)=>{t?update(t,s._updateMap.get(t)):s._updateMap.forEach((t,e)=>{update(e,t)})},j=()=>{if(s._changeDetector.changeDetectionStrategy!==s.CHANGE_STRATEGY_AUTOMATIC)return;new Date-s._changeDetector.lastUpdateDate>6?W():s._debouncedPerformUpdates(),s._changeDetector.lastUpdateDate=new Date};export function setDetectionStrategy(t){s._changeStrategies.forEach(e=>{e===t&&(s._changeDetector.changeDetectionStrategy=t)})}export function detectChanges(t=null){W(t)}export function isDetectorAttached(t){return s._updateMap.has(t)}export function detachDetector(t){s._updateMap.delete(t)}const k=Promise.prototype.then;export function enableDetectOnThen(){Promise.prototype.then=function(t,e){return k.call(this,e=>(j(),"function"==typeof t&&t instanceof Function?t(e):t),e)}}export function wrapWithChangeDetector(t,e){return function(){e&&e.slpreventdefault&&arguments.length>0&&"function"==typeof arguments[0].preventDefault&&arguments[0].preventDefault();let n=t.apply(this,[].slice.call(arguments));return j(),n}}s._debouncedPerformUpdates=function(t,e){let n;return function(...s){const r=this;clearTimeout(n),n=setTimeout(()=>t.apply(r,s),e)}}(W,17);let H=e.XMLHttpRequest.prototype.send,G=new Map;function P(){if(this._onreadystatechange){let t=G.get(this);if(void 0!==t&&t===this._onreadystatechangecount)return void G.delete(this);void 0!==t?G.set(this,t+1):G.set(this,0);let e=this._onreadystatechange.apply(this,arguments);return j(),G.delete(this),e}}e.XMLHttpRequest.prototype.send=function(t){return this.onreadystatechange?(this._onreadystatechange=this.onreadystatechange,void 0===this._onreadystatechangecount?this._onreadystatechangecount=0:this._onreadystatechangecount+=4):this._onreadystatechangecount=0,this.onreadystatechange=P,H.apply(this,arguments)};let Y=e.fetch;e.fetch=function(){let t=Y.apply(this,arguments);return j(),t}; \ No newline at end of file +const t="undefined"!=typeof window;var e=t?window:global;t||(e.setTimeout=()=>{},e.setInterval=()=>{},e.location={},e.location.href="",e.fetch=()=>{},e.XMLHttpRequest={},e.XMLHttpRequest.prototype={},e.XMLHttpRequest.prototype.send=()=>{}),e.s=function(){},s._state={},s._destroyFuncMap=new Map,s._updateMap=new Map,s._afterInitArr=[],s._destroyNodeMap=new Map,s._structureForMap=new Map,s._isAnimatingKeyed=null,s._scopedCssSet=new Set;const n=({tagName:t,attrs:e,children:r,model:o},l)=>{let i,a="<"+(t=t.toLowerCase()),u=null;for(let[t,n]of Object.entries(e))if(i=typeof n,a+="function"===i?" "+t+'=""':" "+t+'="'+n+'"',"slfor"===t){const t=n.split(":");if(t.length>=4){s._structureForMap.has(t[0])||s._structureForMap.set(t[0],U(null,o[t[2]]));const e=s._structureForMap.get(t[0]);u=T.bind(o,e,o[t[1]],o[t[3]])()}}else if("slfornamed"===t){const t=n.split(":");if(t.length>=4){let e,n,r,l;for(let s of Object.keys(o))l=o[s],l.slfor===t[2]?e=l:l.slfor===t[1]?r=l:l.slfor===t[3]&&(n=l);for(let s of I(o))l=o[s],l.slfor===t[2]?e=l:l.slfor===t[1]?r=l:l.slfor===t[3]&&(n=l);r=r.bind(o),s._structureForMap.has(t[0])||s._structureForMap.set(t[0],U(null,e));const i=s._structureForMap.get(t[0]);u=T.bind(o,i,r,n)()}}a+=">",null!==u&&u.forEach(t=>{a+=n(t,l)});for(let t of r)t.view?(t.slOnInit&&(t.slOnInit(),l.push(t)),t=t.view.bind(t)(),a+=n(t,l)):a+="string"==typeof t?t:n(t,l);return a+=""},r=(t,e)=>{const n=[];let s;for(n.push(t);n.length>0;)if(s=n.shift(),s.attrs&&(s.attrs.slfor||s.attrs.slfornamed)&&(s.model=e),s.children)for(let t=s.children.length-1;t>=0;--t)n.push(s.children[t])},o=t=>{const e=[];let n,r;for(e.push(t);e.length>0;)if(n=e.shift(),3!==n.nodeType&&(n.hasAttribute("slfor")?(r=n.getAttribute("slfor"),r=r.split(":"),r.length>0&&s._structureForMap.delete(r[0])):n.hasAttribute("slfornamed")&&(r=n.getAttribute("slfornamed"),r=r.split(":"),r.length>0&&s._structureForMap.delete(r[0])),n.children))for(let t=n.children.length-1;t>=0;--t)e.push(n.children[t])};export function renderElementWithoutClass(t,e,n){let r,o,l;r=e&&e.slns?document.createElementNS(e.slns,t.toLowerCase()):document.createElement(t);for(let t of Object.keys(e))if(l=e[t],o=typeof l,"function"===o)r[t]=l,s._changeDetector.changeDetectionStrategy!==s.CHANGE_STRATEGY_AUTOMATIC||l.name.startsWith("bound slDetached")||l.name.startsWith("slDetached")||L(t,r);else if("slnsfor"===t){const t=JSON.parse(e.slnsfor);for(const[e,n]of Object.entries(t))r.setAttributeNS(n.namespace,e,n.value)}else r.setAttribute(t,l);for(let t of n)r.append(t);return r}export function renderElement({tagName:t,attrs:e,children:n},r=!1){let o,l;o=e&&e.slns?document.createElementNS(e.slns,t.toLowerCase()):document.createElement(t);for(let[t,n]of Object.entries(e))if(l=typeof n,"function"===l)o[t]=n,s._changeDetector.changeDetectionStrategy!==s.CHANGE_STRATEGY_AUTOMATIC||n.name.startsWith("bound slDetached")||n.name.startsWith("slDetached")||L(t,o);else if("slnsfor"===t){const t=JSON.parse(e.slnsfor);for(const[e,n]of Object.entries(t))o.setAttributeNS(n.namespace,e,n.value)}else o.setAttribute(t,n);for(let t of n)"string"==typeof t?o.append(t):t.view?r?a(t,o):u(t,o):o.appendChild(renderElement(t,r));return o}const l=({tagName:t,attrs:e,children:n})=>{let r,o;r=e&&e.slns?document.createElementNS(e.slns,t.toLowerCase()):document.createElement(t);for(let[t,n]of Object.entries(e))if(o=typeof n,"function"===o)r[t]=n,s._changeDetector.changeDetectionStrategy!==s.CHANGE_STRATEGY_AUTOMATIC||n.name.startsWith("bound slDetached")||n.name.startsWith("slDetached")||L(t,r);else if("slnsfor"===t){const t=JSON.parse(e.slnsfor);for(const[e,n]of Object.entries(t))r.setAttributeNS(n.namespace,e,n.value)}else r.setAttribute(t,n);for(let t of n)"string"==typeof t?r.append(t):t.view?u(t,r):r.appendChild(l(t));return r},i=(t,e)=>{t.slKeyList=[],t.slNamespace={};for(const n in e)t.slNamespace[n]=e[n],t.slKeyList.push(n)},a=(t,e)=>{t=d(t,!0,!0,!0).view;const n=l(t);e.appendChild(n)},u=(t,e,n=!1)=>{Object.getPrototypeOf(t).slDirty=!0;const r=t,o=d(t,!0,!0,!0);t=o.view,o.afterInit&&s._afterInitArr.push(o.afterInit);const a=l(t);if(o.scopedCss){const t=M(o.model,o.model.slStyle());g(a,t),a.slScopedCss=!0}o.onInit&&(a.slOnInit=!0),c(a,o.destroyIndex,o.onDestroy,o.slUnboundOnDestroy),f(a),e.appendChild(a),i(a,r),n&&S(a,t,o.model)},c=(t,e,n,s)=>{t.slOnDestroy=!0,t.slOnDestroyIndex=e,t.slOnDestroyFn=n,t.slAfterInit=!0,t.slOnInit=!0,t.slUnboundOnDestroy=s},d=(t,e,n,o=!1,l=null)=>{if(n&&t.slOnInit&&(t.slOnInit(),l&&(l.slOnInit=!0)),l&&l.slKeyList)for(const e of l.slKeyList)void 0===t[e]?t[e]=l.slNamespace[e]:l.slNamespace[e]=t[e];let i=null;if(e&&t.slOnDestroy){let e=s._destroyFuncMap.get(s._router.mountRoute);e||(e=[]),e.push(t.slOnDestroy.bind(t)),s._destroyFuncMap.set(s._router.mountRoute,e),i=e.length-1}const a=t.view.bind(t)();return r(a,t),{view:a,afterInit:t.slAfterInit?t.slAfterInit.bind(t):null,onDestroy:e&&!o||!t.slOnDestroy?null:t.slOnDestroy.bind(t),onInit:!n&&t.slOnInit?t.slOnInit:null,destroyIndex:i,model:t,scopedCss:t.slStyle?t.slStyle.bind(t):null,slUnboundOnDestroy:t.slOnDestroy,slUnboundAfterInit:t.slAfterInit,slUnboundOnInit:t.slOnInit}},f=t=>{if(t&&null!==t.slOnDestroyIndex&&void 0!==t.slOnDestroyIndex&&!t.slOnDestroyRoute){let e=s._destroyNodeMap.get(s._router.mountRoute);e||(e=[]);e.find(e=>e.slOnDestroyIndex===t.slOnDestroyIndex)||e.push(t),s._destroyNodeMap.set(s._router.mountRoute,e),t.slOnDestroyRoute=s._router.mountRoute}},p=t=>{if(t&&t.slOnDestroy){let e=s._destroyFuncMap.get(s._router.mountRoute);e||(e=[]),e.splice(t.slOnDestroyIndex,1),s._destroyFuncMap.set(s._router.mountRoute,e);let n=s._destroyNodeMap.get(s._router.mountRoute);n||(n=[]),n.forEach(e=>{e.slOnDestroyIndex>t.slOnDestroyIndex&&e.slOnDestroyIndex--}),n=n.filter(e=>e.slOnDestroyIndex!==t.slOnDestroyIndex),s._destroyNodeMap.set(s._router.mountRoute,n)}},h=t=>{if(t&&t.children&&t.children.length>0){for(const e of t.children)h(e);t.slOnDestroyFn&&(t.slOnDestroyFn(),t.slOnDestroyFn=void 0,t.slUnboundOnDestroy=void 0)}else t.slOnDestroyFn&&(t.slOnDestroyFn(),t.slOnDestroyFn=void 0,t.slUnboundOnDestroy=void 0)},g=(t,e)=>{if(t.setAttribute(e,""),t.children&&t.children.length>0)for(const n of t.children)g(n,e)},y=(t,e,n)=>{t.slOnDestroy=!0;let r=s._destroyFuncMap.get(s._router.mountRoute);r||(r=[]),r.push(e),s._destroyFuncMap.set(s._router.mountRoute,r),t.slOnDestroyIndex=r.length-1,t.slOnDestroyFn=e,t.slUnboundOnDestroy=n,f(t)},_=(t,e,n)=>{let r;const o=[];for(let t of e){let e=n[t.name];e?e.length===t.nodeValue.length&&e===t.nodeValue&&delete n[t.name]:t.name.startsWith("slcss-")||o.push(t.nodeName)}o.forEach(e=>{t.removeAttribute(e)}),void 0!==n.slref&&(t.slref=t);const l=n.slpreventdefault;let i=!1;for(let[e,o]of Object.entries(n))if(r=typeof o,"function"===r){if(void 0!==l){let n=e;n.startsWith("on")&&(n=n.substring(2,n.length));const s=t[e];if(s){(Array.isArray(s)?s:[s]).forEach(e=>{t.removeEventListener(n,e)})}t.addEventListener(n,(function(t){t.preventDefault()})),i=!0}t[e]=o,s._changeDetector.changeDetectionStrategy!==s.CHANGE_STRATEGY_AUTOMATIC||o.name.startsWith("bound slDetached")||o.name.startsWith("slDetached")||L(e,t)}else if("slnsfor"===e){const e=JSON.parse(n.slnsfor);for(const[n,s]of Object.entries(e))t.setAttributeNS(s.namespace,n,s.value)}else t.setAttribute(e,o);i||(void 0!==l||e.slpreventdefault)&&v([t])},b=(t,e,n)=>{const r=e.length;let a=0;for(let t=e.length-1;t>=0;--t){let r=null,o=null;if(n[t]&&(e[t].slUnboundOnDestroy!==n[t].slOnDestroy&&(void 0!==e[t].slUnboundOnDestroy&&void 0!==e[t].slOnDestroyFn&&e[t].slOnDestroyFn(),p(e[t]),e[t].slOnDestroyFn=void 0,e[t].slOnDestroy=!1),n[t].view)){const l=d(n[t],!1,!1,!1,e[t]);n[t]=l.view;const a=Object.getPrototypeOf(l.model);!0!==a.slDirty&&(l.onInit&&e[t].slOnInit&&(e[t].slOnInit=!1),l.afterInit&&e[t].slAfterInit&&(e[t].slAfterInit=!1),l.scopedCss&&e[t].slScopedCss&&(e[t].slScopedCss=!1),l.onDestroy&&e[t].slOnDestroy&&(e[t].slOnDestroy=!1),a.slDirty=!0),l.onInit&&!e[t].slOnInit&&e[t].slUnboundOnInit!==l.slUnboundOnInit?(e[t].slUnboundOnInit=l.slUnboundOnInit,l.onInit.bind(l.model)(),n[t].slOnInit=!0):void 0===e[t].slUnboundOnInit||l.onInit?l.onInit&&e[t]&&!e[t].slOnInit?(e[t].slUnboundOnInit===l.slUnboundOnInit&&l.onInit.bind(l.model)(),e[t].slUnboundOnInit=l.slUnboundOnInit,n[t].slOnInit=!0):l.onInit&&e[t].slOnInit&&void 0===e[t].slUnboundOnInit&&(e[t].slUnboundOnInit=l.slUnboundOnInit):e[t].slOnInit=!1,l.afterInit&&!e[t].slAfterInit&&e[t].slUnboundAfterInit!==l.slUnboundAfterInit?(e[t].slAfterInit=!0,e[t].slUnboundAfterInit=l.slUnboundAfterInit,s._afterInitArr.push(l.afterInit)):void 0===e[t].slUnboundAfterInit||l.afterInit?l.afterInit&&e[t]&&!e[t].slAfterInit?(e[t].slAfterInit=!0,e[t].slUnboundAfterInit===l.slUnboundAfterInit&&s._afterInitArr.push(l.afterInit),e[t].slUnboundAfterInit=l.slUnboundAfterInit):l.afterInit&&e[t].slAfterInit&&void 0===e[t].slUnboundAfterInit&&(e[t].slUnboundAfterInit=l.slUnboundAfterInit):e[t].slAfterInit=!1,l.scopedCss&&e[t]&&!e[t].slScopedCss&&(o=M(l.model,l.model.slStyle())),l.onDestroy&&e[t]&&!e[t].slOnDestroy&&y(e[t],l.onDestroy,l.slUnboundOnDestroy),i(e[t],l.model),r=l.model}S(e[t],n[t],r),n[t]&&n[t].slOnInit&&(e[t].slOnInit=!0),o&&(g(e[t],o),e[t].slScopedCss=!0),a++}let c=e.length;for(;c>r;)p(e[c-1]),h(e[c-1]),o(e[e.length-1]),O(e[c-1]),c--;for(let e of n.slice(r)){if("string"==typeof e)t.childNodes[a]?t.childNodes[a].textContent!==e&&(t.childNodes[a].textContent=e):t.append(e);else if("string"==typeof e)t.append(e);else if(e.view)u(e,t,!0);else{const n=l(e);t.appendChild(n),S(n,e)}a++}for(c=e.length;c>n.length;)p(e[c-1]),h(e[c-1]),o(e[c-1]),O(e[c-1]),c--},O=t=>{const e=s._router.count;if(void 0===t.slanimatedestroytarget||""===t.slanimatedestroytarget||t.slAnimateDestroy||void 0===t.attributes.slanimatedestroy||""===t.getAttribute("slanimatedestroy"))if(3===t.nodeType||void 0===t.attributes.slanimatedestroy||""===t.getAttribute("slanimatedestroy")||t.slAnimateDestroy)t.slAnimateDestroy||(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id));else{const n=t.onanimationend,r=t.onanimationstart,o=t.getAttribute("slanimatedestroy");t.onanimationstart=function(e){t.slAnimationName=e.animationName},t.onanimationend=function(o){if(!t.slAnimationName||t.slAnimationName!==o.animationName)return;let l=void 0;return n&&(l=n.apply(this,[].slice.call(arguments))),(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id)),t.slAnimationName=null,t.onanimationend=n,t.onanimationstart=r,t.slAnimateDestroy=!1,l},t.classList.add(o),t.slAnimateDestroy=!0}else{const n=t.slanimatedestroytarget;if("function"==typeof n){const r=n(t);if(r){const n=r.getAttribute("slanimatedestroy"),o=r.onanimationend,l=r.onanimationstart;r.onanimationstart=function(t){r.slAnimationName=t.animationName},r.onanimationend=function(i){if(!r.slAnimationName||r.slAnimationName!==i.animationName)return;let a=void 0;return o&&(a=o.apply(this,[].slice.call(arguments))),r.classList.remove(n),s._isAnimatingKeyed=null,s._router.currentRoute.animateDestroy?(s._router.currentRoute.animateDestroy=!1,t.setAttribute("style","opacity: 0;"),r.onanimationend=null,r.onanimationstart=null):((s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id)),r.onanimationend=o,r.onanimationstart=l),r.slAnimationName=null,t.slAnimateDestroy=!1,delete t.slanimatedestroytarget,detectChanges(),a},s._isAnimatingKeyed=r,r.classList.add(n),t.slAnimateDestroy=!0}else(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id))}else(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id))}},A=t=>t&&t!==Object.prototype&&Object.getOwnPropertyNames(t).filter(e=>((t,e)=>(Object.getOwnPropertyDescriptor(t,e)||{}).get)(t,e)||((t,e)=>"function"==typeof t[e])(t,e)).concat(A(Object.getPrototypeOf(t))||[]),I=t=>(t=>Array.from(new Set(A(t))))(t).filter(t=>"constructor"!==t&&!~t.indexOf("__")),D=(t,e,n="")=>{if(e.slStyle&&!t.slScopedCss){const s=M(e,e.slStyle());g(t,s),t.slScopedCss=!0,t.style.display=n}},v=t=>{for(let e=0;e{n.removeEventListener(e,t)})}n.addEventListener(e,(function(t){t.preventDefault()}))}}},S=(t,e,n=null)=>{if(null!==s._isAnimatingKeyed)for(let[e,n]of s._updateMap){const n=document.getElementById(e);if(n.contains(s._isAnimatingKeyed)&&n.contains(t))return t}let r;if(e&&e.slStyle&&(r=t.style.display,t.style.display="none"),e&&e.view){t.slUnboundOnDestroy!==e.slOnDestroy&&(void 0!==t.slUnboundOnDestroy&&void 0!==t.slOnDestroyFn&&t.slOnDestroyFn(),p(t),t.slOnDestroyFn=void 0,t.slOnDestroy=!1);const n=d(e,!1,!1,!1,t);e=n.view;const r=Object.getPrototypeOf(n.model);if(!0!==r.slDirty&&(n.onInit&&t.slOnInit&&(t.slOnInit=!1),n.afterInit&&t.slAfterInit&&(t.slAfterInit=!1),n.scopedCss&&t.slScopedCss&&(t.slScopedCss=!1),n.onDestroy&&t.slOnDestroy&&(t.slOnDestroy=!1),r.slDirty=!0),n.onInit&&t&&!t.slOnInit&&(n.onInit.bind(n.model)(),t.slOnInit=!0),n.afterInit&&t&&!t.slAfterInit&&(t.slAfterInit=!0,s._afterInitArr.push(n.afterInit)),n.scopedCss&&t&&!t.slScopedCss){const e=M(n.model,n.model.slStyle());g(t,e),t.slScopedCss=!0}n.onDestroy&&t&&!t.slOnDestroy&&y(t,n.onDestroy,n.slUnboundOnDestroy)}if(!e)return t&&(p(t),h(t),o(t),O(t)),t;if(t&&(t.tagName||"").toLowerCase()!==((e?e.tagName:void 0)||"").toLowerCase()){if(!e.tagName)return p(t),h(t),t.replaceWith(e),t=e;{let n;n=e.attrs&&e.attrs.slns?document.createElementNS(e.attrs.slns,e.tagName.toLowerCase()):document.createElement(e.tagName),D(n,e,r),t.parentNode.insertBefore(n,t),p(t),h(t),o(t),O(t),n.slUnboundAfterInit=t.slUnboundAfterInit,void 0!==n.slUnboundAfterInit&&(n.slAfterInit=!0),t.slOnInit&&(n.slOnInit=!1),t=n}}if("string"==typeof e)return t.textContent!==e&&(t.textContent=e),t;switch(e.attrs.sldirective){case"useexisting":return D(t,e,r),t;case"onlychildren":return b(t,t.childNodes,e.children),t;case"onlyself":return _(t,t.attributes,e.attrs),D(t,e,r),t;case"trustchildren":{_(t,t.attributes,e.attrs),D(t,e,r);let n="";e.children.forEach(t=>{n+=t}),t.innerHTML!==n&&(t.innerHTML=n);const s=t.querySelectorAll("[slpreventdefault]");return s.length>0&&v(Array.from(s)),t}}if(e.attrs.slfor){const n=e.attrs.slfor.split(":");if(n.length>=4){if(!s._structureForMap.has(n[0])){const r=U(t,e.model[n[2]]);if(s._structureForMap.set(n[0],r),t.children.length>0){let e=Object.create(null);for(let n=0;n=4){let r,o,l,i;for(let t of Object.keys(e.model))i=e.model[t],i.slfor===n[2]?r=i:i.slfor===n[1]?l=i:i.slfor===n[3]&&(o=i);for(let t of I(e.model))i=e.model[t],i.slfor===n[2]?r=i:i.slfor===n[1]?l=i:i.slfor===n[3]&&(o=i);if(l=l.bind(e.model),!s._structureForMap.has(n[0])){const e=U(t,r);if(s._structureForMap.set(n[0],e),t.children.length>0){let n=Object.create(null);for(let e=0;e{s._afterInitArr=[],e.slOnInit&&e.slOnInit();let o=e.view.bind(e)();if(r(o,e),o.view&&(o=o.view.bind(e)(),r(o,e)),!o.attrs||t&&t.id!==o.attrs.id){const e=o.attrs?o.attrs.id:"null";console.error("Mounted component root element changed from "+t.id+" to "+e)}if(t=S(t,o,e),e.slOnInit&&(t.slOnInit=!0,t.slUnboundOnInit=e.slOnInit),e.slStyle&&!t.slScopedCss){const n=M(e,e.slStyle());g(t,n),t.slScopedCss=!0}n&&s._updateMap.set(t.id,e),e.slOnDestroy&&y(t,e.slOnDestroy.bind(e),e.slOnDestroy);let l=t.querySelectorAll("[slref]");void 0!==t.slref&&(l=Array.from(l),l.push(t));for(let t=0;t{t()}),t};export function version(){return"21.0.1"}const x=(t,e)=>t.split(e).length-1,R=(t,e,n=0)=>{let s="",r=!1,o=!1,l=!1;for(let i=n;ii+e.length&&t.substring(i,i+e.length)===e&&!r&&!o){s+=t.substring(i,i+e.length-1);break}return s},M=(t,e)=>{const n=function(t){for(var e=0,n=1779033703^t.length;e>>19;return function(){return n=Math.imul(n^n>>>16,2246822507),n=Math.imul(n^n>>>13,3266489909),(n^=n>>>16)>>>0}}(t.constructor.name),r="slcss-"+String(n());if(""===e||s._scopedCssSet.has(r))return r;e=e.replace(/\t+/g," "),s._scopedCssSet.add(r);const o=new RegExp("([^{]+)s*{s*([^}]+)s*}","g"),l=e.match(o),i=/[^\s"]+|"([^"]*)"/gi;let a="",u=null;do{u=i.exec(e),null!=u&&(u[1]||(a+=u[0]))}while(null!=u);let c,d,f,p,h,g,y,_,b="",O=0,A=0,I=0,D=0,v=!1,S=!1,C=0,M=!1,N=0;const w=new Map;if(a.includes("{")&&a.includes("}")&&a.split("{").length===a.split("}").length)for(let t=0;t0){let t=s.trim();for(;t.startsWith("}")&&D>0;)!(0!==O||1!==D||n<=D)&&A-n>=1||D--,n--,A--,t=t.replace("}","").trim()}let t="";u=null;do{u=i.exec(s),null!=u&&(u[1]||(t+=u[0]))}while(null!=u);if(b+=s,0===D&&x(t,"}")>0){const e=t.length,s=t.replace(/^}+/,"");A-=x(s,"}"),A>=e-s.length&&(1===A&&1===n||(N+=e-s.length))}let e=x(t,"{")-x(t,"}"),r=/(@layer|@container|@media|@scope)[^{]*\{/g,o=t.replace(/\s/g,"").match(r);const l=o?o.length:0;e-=D>0?0:l,e<0&&(e=0),D+=e}}d=c}g=l[t].substring(c)}let s=c+R(l[t],"{",c).length-1;-1===s&&(s=c);let o=l[t].substring(c,s);for(;(o.split('"').length-1)%2!=0;)s=s+1+R(l[t],"{",s+1).length,o=l[t].substring(c,s);if(""!==o&&!/^\s*$/.test(o)){const e=o.split(",");let a;I>0&&o.startsWith(",")&&(e.shift(),e[0]=", "+e[0]);for(let o=0;o0&&a.includes("}");){let t,e,n="";for(;a.includes("}");)t=a.indexOf("{"),e=a.indexOf("}"),(e0&&D--,0===D&&(v=!1);if(a.includes(" ")){let c=a.substring(0,a.indexOf(" ")),d=a.substring(a.indexOf(" "));o>0&&(b+=", ");if("@nest"===c.trim()&&d.replace(/^\s+/g,"").includes(" ")){let t=d.replace(/^\s+/g,""),e=t.substring(0,t.indexOf(" "));t=t.substring(e.length,t.length),c+=" "+e,d=t}if(M=c.trim().startsWith("@"),y=c.trim().endsWith(":"),y){let r=R(d,";");for(;R(d,";",r.length).trim().endsWith(";");)r+=R(d,";",r.length);const a=d.substring(r.length,d.length);d=r;let f=l[t].substring(s);s=l[t].length;let p=a+" ";const h=e.length>1;for(let t=o+1;t0&&n>0&&h&&(A++,N++);let g="";u=null;do{u=i.exec(l[t+1]),null!=u&&(u[1]||(g+=u[0]))}while(null!=u);let y=x(g,"{");y-=x(g,"}"),y<0&&(y=0),A+=y,C+=y}!(!D>0)||v||S&&0!==D||M&&!c.trim().startsWith("@nest")||y?b+=c+d:b+=c+(0===D?"["+r+"]":"")+d}else o>0&&(b+=", "),!(!D>0)||v||S&&0!==D||a.trim().startsWith("@")||M||a.trim().endsWith(":")?b+=a:b+=a+(0===D?"["+r+"]":"")}}}if(I>0&&(s=null!==f?l[t].indexOf(f):0),l[t].includes("--")&&n>1){let e=R(l[t],"--",0).length;const s=l[t].substring(0,e);let r="";do{u=i.exec(s),null!=u&&(u[1]||(r+=u[0]))}while(null!=u);const o=x(r,"{")-1;h=n-1,o>0&&(h-=o),h>0&&(I+=h)}if(n-I>1&&!p){const e=l[t].substring(s+1);l[t]=l[t].substring(0,l[t].length-e.length),l.splice(t+1,0,e);let n="";u=null;do{u=i.exec(e),null!=u&&(u[1]||(n+=u[0]))}while(null!=u);_=x(n,"{")-x(n,"}"),I-=h}let a=l[t].substring(s);const E=a.replace("{","").replace(";","");if(a.includes("{")&&x(a,"{")>1&&!E.trim().startsWith("--")){let e=R(a,"{",0);e=e+" "+R(a,"{",e.length);let n=a.substring(e.length+1,a.length);n=e.substring(e.lastIndexOf(";")+1,e.length)+" "+n,e=e.substring(0,e.lastIndexOf(";")+1),a=e,l.splice(t+1,0,n),D++,C++}b+=a;let U="";u=null;do{u=i.exec(a),null!=u&&(u[1]||(U+=u[0]))}while(null!=u);for(_=x(U,"{")-x(U,"}"),A+=_-h>=0?_-h:_,_-=I,_<0&&(_=0),0===D&&S||(C+=_,D+=_,D>0&&(D-=1-A-x(U,"{")+x(U,"}")>=0?1-A-x(U,"{")+x(U,"}"):0));O>0;)b+="}",O--;0===I&&(b+="\n")}for(D-=C;D>0;)b+="}",D--;for(A-=N;A>0;)b+="}",A--;if(b+="\n",w.size>0){let t,e=0;t=E(b,e,w,"animation"),b=t.finalCss,e=t.startIndex,e=0,t=E(b,e,w,"animation-name"),b=t.finalCss,e=t.startIndex}if(""!==b.trim()){const t=document.head||document.getElementsByTagName("head")[0],e=document.createElement("style");t.appendChild(e),e.appendChild(document.createTextNode(b))}return r},E=(t,e,n,s)=>{for(;-1!==(e=t.indexOf(s,e));){const r=t.substring(0,e);let o=t.substring(e,t.indexOf(";",e));const l=t.substring(e+o.length,t.length);if(o.includes(":")){if(":"===o.substring(0,o.indexOf(":")+1).replace(s,"").trim()){for(const[t,r]of n){let n=o.replace(s,"");n=n.trim(),n.startsWith(":")&&(n=n.substring(1,n.length),n=n.trim());new RegExp(t+"(\\s|;|$)").test(n)&&t.length>0?(o=o.replaceAll(t,r),e+=o.length):e+=s.length}t=r+o+l}else e+=o.length}}return{finalCss:t,startIndex:e}};export function hydrate(t,n=!0){const s=document.getElementById(t).getAttribute("slssrclass");let r=e[s];!r&&this&&(r=this[s]);return mount(t,new r,n)}export function resolveAll(t){return Promise.all(t.map(t=>t.then(t=>({result:t,status:"fulfilled",error:null}),t=>({result:null,error:t,status:"rejected"}))))}export function setState(t){s._state=t}export function getState(){return s._state}export function textNode(t){return String(t)}export function markup(t,{attrs:e={},children:n=[]}={}){return{tagName:t=t.toUpperCase(),attrs:e,children:n}}export function m(){return 3===arguments.length&&"string"==typeof arguments[0]&&"object"==typeof arguments[1]&&Array.isArray(arguments[2])?markup(arguments[0],{attrs:arguments[1],children:arguments[2]}):markup(arguments[0],arguments[1])}export function mount(t,e,n=!0){s._router.mountRoute=t;let r=document.getElementById(t);if(null!==r)return C(r,e,n);console.error("ID "+t+" does not exist in DOM.")}export function renderToString(t){const e=[],o=new Set;for(let t of s._structureForMap.keys())o.add(t);t.slOnInit&&(t.slOnInit(),e.push(t));let l=t.view.bind(t)(),i=t;for(;l.view;)l.slOnInit&&(l.slOnInit(),e.push(l)),i=l,l=l.view.bind(l)();r(l,i);const a=n(l,e);e.forEach(t=>{t.slOnDestroy&&t.slOnDestroy.bind(t)()});for(let t of s._structureForMap.keys())o.has(t)||s._structureForMap.delete(t);return a}export function update(t,e){const n=t;if(t=document.getElementById(t),s._afterInitArr=[],t){let n=e.view.bind(e)();r(n,e),t=S(t,n,e)}else console.error("ID "+n+" not mounted in DOM; attachDetector likely needs to be called.");let o=t.querySelectorAll("[slref]");void 0!==t.slref&&(o=Array.from(o),o.push(t));for(let t=0;t{t()}),e.slStyle&&!t.slScopedCss){const n=M(e,e.slStyle());g(t,n),t.slScopedCss=!0}}let N=e.onpopstate;e.onpopstate=function(t){switch(s._router.strategy){case"#":e.location.hash&&s._router.lastHash!==e.location.hash.substring(2)&&(N&&N(t),route(getRoute()));break;case"?":e.location.search&&s._router.lastHash!==e.location.search.substring(2)&&(N&&N(t),route(getRoute()));break;case"":e.location.pathname&&s._router.lastHash!==e.location.pathname.substring(1)&&(N&&N(t),route(getRoute()))}},s._router={segmentArr:[],routeList:[],params:null,lastHash:!1,currentRoute:null,mountRoute:"",strategy:"#",count:0},Object.seal(s._router);const w=()=>{switch(s._router.strategy){case"#":{let t=e.location.href.split("#/")[1];if(t){let e=t.split("/");e.forEach((t,e)=>{s._router.segmentArr[e]=t}),s._router.segmentArr.splice(e.length,s._router.segmentArr.length)}else s._router.segmentArr.splice(0,s._router.segmentArr.length);break}case"?":{let t=e.location.href.split("?/")[1];if(t){let e=t.split("/");e.forEach((t,e)=>{s._router.segmentArr[e]=t}),s._router.segmentArr.splice(e.length,s._router.segmentArr.length)}else s._router.segmentArr.splice(0,s._router.segmentArr.length);break}case"":{let t=e.location.pathname;if(t){t=t.replace("/","");let e=t.split("/");e.forEach((t,e)=>{s._router.segmentArr[e]=t}),s._router.segmentArr.splice(e.length,s._router.segmentArr.length)}else s._router.segmentArr.splice(0,s._router.segmentArr.length);break}}};export function setRouteStrategy(t){new Set(["#","?",""]).has(t)&&(s._router.strategy=t)}export function getRouteQueryVariables(){const t=e.location.search.substring(2).split("&"),n=[];for(var s=0;s{t.slOnDestroyFn&&n.contains(t)&&t.slOnDestroyFn(),t.slOnDestroyFn=void 0,t.slUnboundOnDestroy=void 0}),s._destroyNodeMap.set(getRoute(),[]),s._destroyFuncMap.set(getRoute(),[])),s._router.lastHash=t;const u=e.pageYOffset;switch(s._router.strategy){case"#":e.history.pushState(null,document.title,"#/"+t);break;case"?":{let n=e.location.href;const s=e.location.pathname;n=n.substring(0,n.indexOf(s)),n+="/?/"+t,e.history.pushState(null,document.title,n);break}case"":{let n=e.location.href;const s=e.location.pathname;n=n.substring(0,n.indexOf(s)),n+="/"+t,e.history.pushState(null,document.title,n);break}}if(e.scrollTo(0,u),s._router.currentRoute&&void 0!==s._router.currentRoute.animateDestroy&&(s._router.currentRoute.animateDestroy=!0),s._router.currentRoute&&s._router.currentRoute.animateDestroy){let t=s._router.currentRoute.root;t=document.getElementById(t),s._router.currentRoute=i,p(t),h(t),o(t),O(t),w()}else w(),s._router.currentRoute=i;s._router.count++,i.component&&(i.component.slOnDestroy&&s._destroyFuncMap.set(t,[i.component.slOnDestroy.bind(i.component)]),s._router.mountRoute=t,C(n,i.component,r),i.component.slOnDestroy&&(n.slOnDestroyIndex=0,s._destroyFuncMap.get(t).pop(),f(n)),l=i.component);break}return s._changeDetector.changeDetectionStrategy===s.CHANGE_STRATEGY_AUTOMATIC&&j(),l}w();const U=(t,e,n)=>({parent:t,factory:e,map:Object.create(null)});function T(t,e){"function"==typeof e&&(e=e());let n=[];for(let s=0;s0&&(v([t.parent]),v(Array.from(c)))}s.CHANGE_STRATEGY_AUTOMATIC=100,s.CHANGE_STRATEGY_MANUAL=200,s.CHANGE_DETECTOR_DETACHED=!1,s.CHANGE_DETECTOR_ATTACHED=!0,s._changeStrategies=[s.CHANGE_STRATEGY_AUTOMATIC,s.CHANGE_STRATEGY_MANUAL],s._changeDetector={lastUpdateDate:new Date,changeDetectionStrategy:s.CHANGE_STRATEGY_AUTOMATIC},Object.seal(s._changeDetector),Object.freeze(s._changeStrategies);const L=(t,e)=>{if(e[t]){let n=e[t];e[t]=function(){let t=n.apply(this,[].slice.call(arguments));return j(),t}}};const W=(t=null)=>{t?update(t,s._updateMap.get(t)):s._updateMap.forEach((t,e)=>{update(e,t)})},j=()=>{if(s._changeDetector.changeDetectionStrategy!==s.CHANGE_STRATEGY_AUTOMATIC)return;new Date-s._changeDetector.lastUpdateDate>6?W():s._debouncedPerformUpdates(),s._changeDetector.lastUpdateDate=new Date};export function setDetectionStrategy(t){s._changeStrategies.forEach(e=>{e===t&&(s._changeDetector.changeDetectionStrategy=t)})}export function detectChanges(t=null){W(t)}export function isDetectorAttached(t){return s._updateMap.has(t)}export function detachDetector(t){s._updateMap.delete(t)}const k=Promise.prototype.then;export function enableDetectOnThen(){Promise.prototype.then=function(t,e){return k.call(this,e=>(j(),"function"==typeof t&&t instanceof Function?t(e):t),e)}}export function wrapWithChangeDetector(t,e){return function(){e&&e.slpreventdefault&&arguments.length>0&&"function"==typeof arguments[0].preventDefault&&arguments[0].preventDefault();let n=t.apply(this,[].slice.call(arguments));return j(),n}}s._debouncedPerformUpdates=function(t,e){let n;return function(...s){const r=this;clearTimeout(n),n=setTimeout(()=>t.apply(r,s),e)}}(W,17);let H=e.XMLHttpRequest.prototype.send,G=new Map;function P(){if(this._onreadystatechange){let t=G.get(this);if(void 0!==t&&t===this._onreadystatechangecount)return void G.delete(this);void 0!==t?G.set(this,t+1):G.set(this,0);let e=this._onreadystatechange.apply(this,arguments);return j(),G.delete(this),e}}e.XMLHttpRequest.prototype.send=function(t){return this.onreadystatechange?(this._onreadystatechange=this.onreadystatechange,void 0===this._onreadystatechangecount?this._onreadystatechangecount=0:this._onreadystatechangecount+=4):this._onreadystatechangecount=0,this.onreadystatechange=P,H.apply(this,arguments)};let Y=e.fetch;e.fetch=function(){let t=Y.apply(this,arguments);return j(),t}; \ No newline at end of file diff --git a/dist_sling/sling.min.nomodule.js b/dist_sling/sling.min.nomodule.js index f6ea1c3..429753c 100644 --- a/dist_sling/sling.min.nomodule.js +++ b/dist_sling/sling.min.nomodule.js @@ -1,5 +1,5 @@ (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e){return l(t)||a(t,e)||o(t,e)||r()}function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=4){s._structureForMap.has(_[0])||s._structureForMap.set(_[0],at(null,f[_[2]]));var A=s._structureForMap.get(_[0]);h=lt.bind(f,A,f[_[1]],f[_[3]])()}}else if("slfornamed"===y){var O=b.split(":");if(O.length>=4){for(var I=void 0,D=void 0,S=void 0,C=void 0,x=0,M=Object.keys(f);x",null!==h&&h.forEach((function(t){d+=r(t,i)}));var U,T=t(c);try{for(T.s();!(U=T.n()).done;){var F=U.value;F.view?(F.slOnInit&&(F.slOnInit(),i.push(F)),F=F.view.bind(F)(),d+=r(F,i)):d+="string"==typeof F?F:r(F,i)}}catch(t){T.e(t)}finally{T.f()}return d+=""},d=function(t,e){var n,r=[];for(r.push(t);r.length>0;)if((n=r.shift()).attrs&&(n.attrs.slfor||n.attrs.slfornamed)&&(n.model=e),n.children)for(var s=n.children.length-1;s>=0;--s)r.push(n.children[s])},h=function(t){var e,n,r=[];for(r.push(t);r.length>0;)if(3!==(e=r.shift()).nodeType&&(e.hasAttribute("slfor")?(n=(n=e.getAttribute("slfor")).split(":")).length>0&&s._structureForMap.delete(n[0]):e.hasAttribute("slfornamed")&&((n=(n=e.getAttribute("slfornamed")).split(":")).length>0&&s._structureForMap.delete(n[0])),e.children))for(var o=e.children.length-1;o>=0;--o)r.push(e.children[o])};function p(r,o,i){var a,l;a=o&&o.slns?document.createElementNS(o.slns,r.toLowerCase()):document.createElement(r);for(var u=0,c=Object.keys(o);u1&&void 0!==arguments[1]&&arguments[1];o=a&&a.slns?document.createElementNS(a.slns,i.toLowerCase()):document.createElement(i);for(var c=0,f=Object.entries(a);c2&&void 0!==arguments[2]&&arguments[2];Object.getPrototypeOf(t).slDirty=!0;var r=t,o=O(t,!0,!0,!0);t=o.view,o.afterInit&&s._afterInitArr.push(o.afterInit);var i=g(t);if(o.scopedCss){var a=k(o.model,o.model.slStyle());C(i,a),i.slScopedCss=!0}o.onInit&&(i.slOnInit=!0),A(i,o.destroyIndex,o.onDestroy,o.slUnboundOnDestroy),I(i),e.appendChild(i),y(i,r),n&&F(i,t,o.model)},A=function(t,e,n,r){t.slOnDestroy=!0,t.slOnDestroyIndex=e,t.slOnDestroyFn=n,t.slAfterInit=!0,t.slOnInit=!0,t.slUnboundOnDestroy=r},O=function(e,n,r){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;if(r&&e.slOnInit&&(e.slOnInit(),i&&(i.slOnInit=!0)),i&&i.slKeyList){var a,l=t(i.slKeyList);try{for(l.s();!(a=l.n()).done;){var u=a.value;void 0===e[u]?e[u]=i.slNamespace[u]:i.slNamespace[u]=e[u]}}catch(t){l.e(t)}finally{l.f()}}var c=null;if(n&&e.slOnDestroy){var f=s._destroyFuncMap.get(s._router.mountRoute);f||(f=[]),f.push(e.slOnDestroy.bind(e)),s._destroyFuncMap.set(s._router.mountRoute,f),c=f.length-1}var h=e.view.bind(e)();return d(h,e),{view:h,afterInit:e.slAfterInit?e.slAfterInit.bind(e):null,onDestroy:n&&!o||!e.slOnDestroy?null:e.slOnDestroy.bind(e),onInit:!r&&e.slOnInit?e.slOnInit:null,destroyIndex:c,model:e,scopedCss:e.slStyle?e.slStyle.bind(e):null,slUnboundOnDestroy:e.slOnDestroy,slUnboundAfterInit:e.slAfterInit,slUnboundOnInit:e.slOnInit}},I=function(t){if(t&&null!==t.slOnDestroyIndex&&void 0!==t.slOnDestroyIndex&&!t.slOnDestroyRoute){var e=s._destroyNodeMap.get(s._router.mountRoute);e||(e=[]),e.find((function(e){return e.slOnDestroyIndex===t.slOnDestroyIndex}))||e.push(t),s._destroyNodeMap.set(s._router.mountRoute,e),t.slOnDestroyRoute=s._router.mountRoute}},D=function(t){if(t&&t.slOnDestroy){var e=s._destroyFuncMap.get(s._router.mountRoute);e||(e=[]),e.splice(t.slOnDestroyIndex,1),s._destroyFuncMap.set(s._router.mountRoute,e);var n=s._destroyNodeMap.get(s._router.mountRoute);n||(n=[]),n.forEach((function(e){e.slOnDestroyIndex>t.slOnDestroyIndex&&e.slOnDestroyIndex--})),n=n.filter((function(e){return e.slOnDestroyIndex!==t.slOnDestroyIndex})),s._destroyNodeMap.set(s._router.mountRoute,n)}},S=function e(n){if(n&&n.children&&n.children.length>0){var r,s=t(n.children);try{for(s.s();!(r=s.n()).done;){e(r.value)}}catch(t){s.e(t)}finally{s.f()}n.slOnDestroyFn&&(n.slOnDestroyFn(),n.slOnDestroyFn=void 0,n.slUnboundOnDestroy=void 0)}else n.slOnDestroyFn&&(n.slOnDestroyFn(),n.slOnDestroyFn=void 0,n.slUnboundOnDestroy=void 0)},C=function e(n,r){if(n.setAttribute(r,""),n.children&&n.children.length>0){var s,o=t(n.children);try{for(o.s();!(s=o.n()).done;){e(s.value,r)}}catch(t){o.e(t)}finally{o.f()}}},x=function(t,e,n){t.slOnDestroy=!0;var r=s._destroyFuncMap.get(s._router.mountRoute);r||(r=[]),r.push(e),s._destroyFuncMap.set(s._router.mountRoute,r),t.slOnDestroyIndex=r.length-1,t.slOnDestroyFn=e,t.slUnboundOnDestroy=n,I(t)},M=function(r,o,i){var a,l=[],u=t(o);try{for(u.s();!(a=u.n()).done;){var c=a.value,f=i[c.name];f?f.length===c.nodeValue.length&&f===c.nodeValue&&delete i[c.name]:c.name.startsWith("slcss-")||l.push(c.nodeName)}}catch(t){u.e(t)}finally{u.f()}l.forEach((function(t){r.removeAttribute(t)})),void 0!==i.slref&&(r.slref=r);for(var d=i.slpreventdefault,h=!1,p=function(){var t=n(g[v],2),o=t[0],a=t[1];if("function"===e(a)){if(void 0!==d){var l=o;l.startsWith("on")&&(l=l.substring(2,l.length));var u=r[o];u&&(Array.isArray(u)?u:[u]).forEach((function(t){r.removeEventListener(l,t)})),r.addEventListener(l,(function(t){t.preventDefault()})),h=!0}r[o]=a,s._changeDetector.changeDetectionStrategy!==s.CHANGE_STRATEGY_AUTOMATIC||a.name.startsWith("bound slDetached")||a.name.startsWith("slDetached")||ct(o,r)}else if("slnsfor"===o)for(var c=JSON.parse(i.slnsfor),f=0,p=Object.entries(c);f=0;--a){var l=null,u=null;if(r[a]&&(n[a].slUnboundOnDestroy!==r[a].slOnDestroy&&(void 0!==n[a].slUnboundOnDestroy&&void 0!==n[a].slOnDestroyFn&&n[a].slOnDestroyFn(),D(n[a]),n[a].slOnDestroyFn=void 0,n[a].slOnDestroy=!1),r[a].view)){var c=O(r[a],!1,!1,!1,n[a]);r[a]=c.view;var f=Object.getPrototypeOf(c.model);!0!==f.slDirty&&(c.onInit&&n[a].slOnInit&&(n[a].slOnInit=!1),c.afterInit&&n[a].slAfterInit&&(n[a].slAfterInit=!1),c.scopedCss&&n[a].slScopedCss&&(n[a].slScopedCss=!1),c.onDestroy&&n[a].slOnDestroy&&(n[a].slOnDestroy=!1),f.slDirty=!0),c.onInit&&!n[a].slOnInit&&n[a].slUnboundOnInit!==c.slUnboundOnInit?(n[a].slUnboundOnInit=c.slUnboundOnInit,c.onInit.bind(c.model)(),r[a].slOnInit=!0):void 0===n[a].slUnboundOnInit||c.onInit?c.onInit&&n[a]&&!n[a].slOnInit?(n[a].slUnboundOnInit===c.slUnboundOnInit&&c.onInit.bind(c.model)(),n[a].slUnboundOnInit=c.slUnboundOnInit,r[a].slOnInit=!0):c.onInit&&n[a].slOnInit&&void 0===n[a].slUnboundOnInit&&(n[a].slUnboundOnInit=c.slUnboundOnInit):n[a].slOnInit=!1,c.afterInit&&!n[a].slAfterInit&&n[a].slUnboundAfterInit!==c.slUnboundAfterInit?(n[a].slAfterInit=!0,n[a].slUnboundAfterInit=c.slUnboundAfterInit,s._afterInitArr.push(c.afterInit)):void 0===n[a].slUnboundAfterInit||c.afterInit?c.afterInit&&n[a]&&!n[a].slAfterInit?(n[a].slAfterInit=!0,n[a].slUnboundAfterInit===c.slUnboundAfterInit&&s._afterInitArr.push(c.afterInit),n[a].slUnboundAfterInit=c.slUnboundAfterInit):c.afterInit&&n[a].slAfterInit&&void 0===n[a].slUnboundAfterInit&&(n[a].slUnboundAfterInit=c.slUnboundAfterInit):n[a].slAfterInit=!1,c.scopedCss&&n[a]&&!n[a].slScopedCss&&(u=k(c.model,c.model.slStyle())),c.onDestroy&&n[a]&&!n[a].slOnDestroy&&x(n[a],c.onDestroy,c.slUnboundOnDestroy),y(n[a],c.model),l=c.model}F(n[a],r[a],l),r[a]&&r[a].slOnInit&&(n[a].slOnInit=!0),u&&(C(n[a],u),n[a].slScopedCss=!0),i++}for(var d=n.length;d>o;)D(n[d-1]),S(n[d-1]),h(n[n.length-1]),w(n[d-1]),d--;var p,v=t(r.slice(o));try{for(v.s();!(p=v.n()).done;){var b=p.value;if("string"==typeof b)e.childNodes[i]?e.childNodes[i].textContent!==b&&(e.childNodes[i].textContent=b):e.append(b);else if("string"==typeof b)e.append(b);else if(b.view)_(b,e,!0);else{var A=g(b);e.appendChild(A),F(A,b)}i++}}catch(t){v.e(t)}finally{v.f()}for(d=n.length;d>r.length;)D(n[d-1]),S(n[d-1]),h(n[d-1]),w(n[d-1]),d--},w=function(t){var e=s._router.count;if(void 0===t.slanimatedestroytarget||""===t.slanimatedestroytarget||t.slAnimateDestroy||void 0===t.attributes.slanimatedestroy||""===t.getAttribute("slanimatedestroy"))if(3===t.nodeType||void 0===t.attributes.slanimatedestroy||""===t.getAttribute("slanimatedestroy")||t.slAnimateDestroy)t.slAnimateDestroy||(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id));else{var n=t.onanimationend,r=t.onanimationstart,o=t.getAttribute("slanimatedestroy");t.onanimationstart=function(e){t.slAnimationName=e.animationName},t.onanimationend=function(o){if(t.slAnimationName&&t.slAnimationName===o.animationName){var i=void 0;return n&&(i=n.apply(this,[].slice.call(arguments))),(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id)),t.slAnimationName=null,t.onanimationend=n,t.onanimationstart=r,t.slAnimateDestroy=!1,i}},t.classList.add(o),t.slAnimateDestroy=!0}else{var i=t.slanimatedestroytarget;if("function"==typeof i){var a=i(t);if(a){var l=a.getAttribute("slanimatedestroy"),u=a.onanimationend,c=a.onanimationstart;a.onanimationstart=function(t){a.slAnimationName=t.animationName},a.onanimationend=function(n){if(a.slAnimationName&&a.slAnimationName===n.animationName){var r=void 0;return u&&(r=u.apply(this,[].slice.call(arguments))),a.classList.remove(l),s._isAnimatingKeyed=null,s._router.currentRoute.animateDestroy?(s._router.currentRoute.animateDestroy=!1,t.setAttribute("style","opacity: 0;"),a.onanimationend=null,a.onanimationstart=null):((s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id)),a.onanimationend=u,a.onanimationstart=c),a.slAnimationName=null,t.slAnimateDestroy=!1,delete t.slanimatedestroytarget,pt(),r}},s._isAnimatingKeyed=a,a.classList.add(l),t.slAnimateDestroy=!0}else(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id))}else(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id))}},R=function t(e){return e&&e!==Object.prototype&&Object.getOwnPropertyNames(e).filter((function(t){return function(t,e){return(Object.getOwnPropertyDescriptor(t,e)||{}).get}(e,t)||function(t,e){return"function"==typeof t[e]}(e,t)})).concat(t(Object.getPrototypeOf(e))||[])},N=function(t){return function(t){return Array.from(new Set(R(t)))}(t).filter((function(t){return"constructor"!==t&&!~t.indexOf("__")}))},U=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(e.slStyle&&!t.slScopedCss){var r=k(e,e.slStyle());C(t,r),t.slScopedCss=!0,t.style.display=n}},T=function(t){for(var e=function(){var e=t[n];if(null!==e.getAttribute("slpreventdefault"))for(var r in e)if(r.startsWith("on")){var s=r.substring(2,r.length),o=e[r];o&&(Array.isArray(o)?o:[o]).forEach((function(t){e.removeEventListener(s,t)})),e.addEventListener(s,(function(t){t.preventDefault()}))}},n=0;n0&&T(Array.from(y)),e}if(r.attrs.slfor){var b=r.attrs.slfor.split(":");if(b.length>=4){if(!s._structureForMap.has(b[0])){var _=at(e,r.model[b[2]]);if(s._structureForMap.set(b[0],_),e.children.length>0){for(var A=Object.create(null),I=0;I=4){for(var j,L,W,H,G=0,P=Object.keys(r.model);G0){for(var $=Object.create(null),J=0;J2&&void 0!==arguments[2]?arguments[2]:0,r="",s=!1,o=!1,i=!1,a=n;aa+e.length&&t.substring(a,a+e.length)===e&&!s&&!o){r+=t.substring(a,a+e.length-1);break}return r},k=function(t,e){var n=function(t){for(var e=0,n=1779033703^t.length;e>>19;return function(){return n=Math.imul(n^n>>>16,2246822507),n=Math.imul(n^n>>>13,3266489909),(n^=n>>>16)>>>0}}(t.constructor.name),r="slcss-"+String(n());if(""===e||s._scopedCssSet.has(r))return r;e=e.replace(/\t+/g," "),s._scopedCssSet.add(r);var o=new RegExp("([^{]+)s*{s*([^}]+)s*}","g"),i=e.match(o),a=/[^\s"]+|"([^"]*)"/gi,l="",u=null;do{null!=(u=a.exec(e))&&(u[1]||(l+=u[0]))}while(null!=u);var c,f,d,h,p,v,g,y,b="",_=0,A=0,O=0,I=0,D=!1,S=!1,C=0,x=!1,M=0,E=new Map;if(l.includes("{")&&l.includes("}")&&l.split("{").length===l.split("}").length)for(var w=0;w0)for(var L=j.trim();L.startsWith("}")&&I>0;)!(0!==_||1!==I||N<=I)&&A-N>=1||I--,N--,A--,L=L.replace("}","").trim();var k="";u=null;do{null!=(u=a.exec(j))&&(u[1]||(k+=u[0]))}while(null!=u);if(b+=j,0===I&&W(k,"}")>0){var P=k.length,Y=k.replace(/^}+/,"");(A-=W(Y,"}"))>=P-Y.length&&(1===A&&1===N||(M+=P-Y.length))}var B=W(k,"{")-W(k,"}"),q=k.replace(/\s/g,"").match(/(@layer|@container|@media|@scope)[^{]*\{/g),K=q?q.length:0;(B-=I>0?0:K)<0&&(B=0),I+=B}}f=c}v=i[w].substring(c)}var X=c+H(i[w],"{",c).length-1;-1===X&&(X=c);for(var $=i[w].substring(c,X);($.split('"').length-1)%2!=0;)X=X+1+H(i[w],"{",X+1).length,$=i[w].substring(c,X);if(""!==$&&!/^\s*$/.test($)){var J=$.split(","),V=void 0;O>0&&$.startsWith(",")&&(J.shift(),J[0]=", "+J[0]);for(var z=0;z0&&V.includes("}");){for(var Q=void 0,Z=void 0,tt="";V.includes("}");)Q=V.indexOf("{"),((Z=V.indexOf("}"))0&&I--,0===I&&(D=!1);if(V.includes(" ")){var et=V.substring(0,V.indexOf(" ")),nt=V.substring(V.indexOf(" "));if(z>0&&(b+=", "),"@nest"===et.trim()&&nt.replace(/^\s+/g,"").includes(" ")){var rt=nt.replace(/^\s+/g,""),st=rt.substring(0,rt.indexOf(" "));et+=" "+st,nt=rt=rt.substring(st.length,rt.length)}if(x=et.trim().startsWith("@"),g=et.trim().endsWith(":")){for(var ot=H(nt,";");H(nt,";",ot.length).trim().endsWith(";");)ot+=H(nt,";",ot.length);var it=nt.substring(ot.length,nt.length);nt=ot;var at=i[w].substring(X);X=i[w].length;for(var lt=it+" ",ut=J.length>1,ct=z+1;ct0&&N>0&&ut&&(A++,M++);var ft="";u=null;do{null!=(u=a.exec(i[w+1]))&&(u[1]||(ft+=u[0]))}while(null!=u);var dt=W(ft,"{");(dt-=W(ft,"}"))<0&&(dt=0),A+=dt,C+=dt}!(!I>0)||D||S&&0!==I||x&&!et.trim().startsWith("@nest")||g?b+=et+nt:b+=et+(0===I?"["+r+"]":"")+nt}else z>0&&(b+=", "),!(!I>0)||D||S&&0!==I||V.trim().startsWith("@")||x||V.trim().endsWith(":")?b+=V:b+=V+(0===I?"["+r+"]":"")}}}if(O>0&&(X=null!==d?i[w].indexOf(d):0),i[w].includes("--")&&N>1){var ht=H(i[w],"--",0).length,pt=i[w].substring(0,ht),vt="";do{null!=(u=a.exec(pt))&&(u[1]||(vt+=u[0]))}while(null!=u);var gt=W(vt,"{")-1;p=N-1,gt>0&&(p-=gt),p>0&&(O+=p)}if(N-O>1&&!h){var yt=i[w].substring(X+1);i[w]=i[w].substring(0,i[w].length-yt.length),i.splice(w+1,0,yt);var mt="";u=null;do{null!=(u=a.exec(yt))&&(u[1]||(mt+=u[0]))}while(null!=u);y=W(mt,"{")-W(mt,"}"),O-=p}var bt=i[w].substring(X),_t=bt.replace("{","").replace(";","");if(bt.includes("{")&&W(bt,"{")>1&&!_t.trim().startsWith("--")){var At=H(bt,"{",0);At=At+" "+H(bt,"{",At.length);var Ot=bt.substring(At.length+1,bt.length);Ot=At.substring(At.lastIndexOf(";")+1,At.length)+" "+Ot,bt=At=At.substring(0,At.lastIndexOf(";")+1),i.splice(w+1,0,Ot),I++,C++}b+=bt;var It="";u=null;do{null!=(u=a.exec(bt))&&(u[1]||(It+=u[0]))}while(null!=u);for(A+=(y=W(It,"{")-W(It,"}"))-p>=0?y-p:y,(y-=O)<0&&(y=0),0===I&&S||(C+=y,(I+=y)>0&&(I-=1-A-W(It,"{")+W(It,"}")>=0?1-A-W(It,"{")+W(It,"}"):0));_>0;)b+="}",_--;0===O&&(b+="\n")}for(I-=C;I>0;)b+="}",I--;for(A-=M;A>0;)b+="}",A--;if(b+="\n",E.size>0){var Dt,St=0;b=(Dt=G(b,St,E,"animation")).finalCss,St=Dt.startIndex,b=(Dt=G(b,St=0,E,"animation-name")).finalCss,St=Dt.startIndex}if(""!==b.trim()){var Ct=document.head||document.getElementsByTagName("head")[0],xt=document.createElement("style");Ct.appendChild(xt),xt.appendChild(document.createTextNode(b))}return r},G=function(e,r,s,o){for(;-1!==(r=e.indexOf(o,r));){var i=e.substring(0,r),a=e.substring(r,e.indexOf(";",r)),l=e.substring(r+a.length,e.length);if(a.includes(":"))if(":"===a.substring(0,a.indexOf(":")+1).replace(o,"").trim()){var u,c=t(s);try{for(c.s();!(u=c.n()).done;){var f=n(u.value,2),d=f[0],h=f[1],p=a.replace(o,"");(p=p.trim()).startsWith(":")&&(p=(p=p.substring(1,p.length)).trim()),new RegExp(d+"(\\s|;|$)").test(p)&&d.length>0?r+=(a=a.replaceAll(d,h)).length:r+=o.length}}catch(t){c.e(t)}finally{c.f()}e=i+a+l}else r+=a.length}return{finalCss:e,startIndex:r}};function P(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=document.getElementById(t).getAttribute("slssrclass"),r=c[n];return!r&&this&&(r=this[n]),$(t,new r,e)}function Y(t){return Promise.all(t.map((function(t){return t.then((function(t){return{result:t,status:"fulfilled",error:null}}),(function(t){return{result:null,error:t,status:"rejected"}}))})))}function B(t){s._state=t}function q(){return s._state}function K(t){return String(t)}function X(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.attrs,r=void 0===n?{}:n,s=e.children,o=void 0===s?[]:s;return{tagName:t=t.toUpperCase(),attrs:r,children:o}}function m(){return 3===arguments.length&&"string"==typeof arguments[0]&&"object"==e(arguments[1])&&Array.isArray(arguments[2])?X(arguments[0],{attrs:arguments[1],children:arguments[2]}):X(arguments[0],arguments[1])}function $(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];s._router.mountRoute=t;var r=document.getElementById(t);if(null!==r)return j(r,e,n);console.error("ID "+t+" does not exist in DOM.")}function J(e){var n,r=[],o=new Set,i=t(s._structureForMap.keys());try{for(i.s();!(n=i.n()).done;){var a=n.value;o.add(a)}}catch(t){i.e(t)}finally{i.f()}e.slOnInit&&(e.slOnInit(),r.push(e));for(var l=e.view.bind(e)(),u=e;l.view;)l.slOnInit&&(l.slOnInit(),r.push(l)),u=l,l=l.view.bind(l)();d(l,u);var c=f(l,r);r.forEach((function(t){t.slOnDestroy&&t.slOnDestroy.bind(t)()}));var h,p=t(s._structureForMap.keys());try{for(p.s();!(h=p.n()).done;){var v=h.value;o.has(v)||s._structureForMap.delete(v)}}catch(t){p.e(t)}finally{p.f()}return c}function V(t,e){var n=t;if(t=document.getElementById(t),s._afterInitArr=[],t){var r=e.view.bind(e)();d(r,e),t=F(t,r,e)}else console.error("ID "+n+" not mounted in DOM; attachDetector likely needs to be called.");var o=t.querySelectorAll("[slref]");void 0!==t.slref&&(o=Array.from(o)).push(t);for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{},i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(s._router.params=o,!s._router.currentRoute||!s._router.currentRoute.onCanDeactivate||s._router.currentRoute.onCanDeactivate(r)){var a,l=null,u=t(s._router.routeList);try{var f=function(){var t=n(a.value,2),e=t[0],o=t[1];if(e.test(r)){if(o.onActivationCheck&&!o.onActivationCheck(r))return{v:(o.onActivationFail&&(l=it(o.onActivationFail.route,o.onActivationFail.params,"boolean"!=typeof o.onActivationFail.attachDetector||o.onActivationFail.attachDetector)),void(r=void 0))};o.onBeforeRoute&&o.onBeforeRoute();var u=document.getElementById(o.root),f=s._destroyNodeMap.get(rt());f&&(f.forEach((function(t){t.slOnDestroyFn&&u.contains(t)&&t.slOnDestroyFn(),t.slOnDestroyFn=void 0,t.slUnboundOnDestroy=void 0})),s._destroyNodeMap.set(rt(),[]),s._destroyFuncMap.set(rt(),[])),s._router.lastHash=r;var d=c.pageYOffset;switch(s._router.strategy){case"#":c.history.pushState(null,document.title,"#/"+r);break;case"?":var p=c.location.href,v=c.location.pathname;p=p.substring(0,p.indexOf(v)),p+="/?/"+r,c.history.pushState(null,document.title,p);break;case"":var g=c.location.href,y=c.location.pathname;g=g.substring(0,g.indexOf(y)),g+="/"+r,c.history.pushState(null,document.title,g)}if(c.scrollTo(0,d),s._router.currentRoute&&void 0!==s._router.currentRoute.animateDestroy&&(s._router.currentRoute.animateDestroy=!0),s._router.currentRoute&&s._router.currentRoute.animateDestroy){var b=s._router.currentRoute.root;b=document.getElementById(b),s._router.currentRoute=o,D(b),S(b),h(b),w(b),Q()}else Q(),s._router.currentRoute=o;return s._router.count++,o.component&&(o.component.slOnDestroy&&s._destroyFuncMap.set(r,[o.component.slOnDestroy.bind(o.component)]),s._router.mountRoute=r,j(u,o.component,i),o.component.slOnDestroy&&(u.slOnDestroyIndex=0,s._destroyFuncMap.get(r).pop(),I(u)),l=o.component),"break"}};for(u.s();!(a=u.n()).done;){var d=f();if("break"===d)break;if("object"===e(d))return d.v}}catch(t){u.e(t)}finally{u.f()}return s._changeDetector.changeDetectionStrategy===s.CHANGE_STRATEGY_AUTOMATIC&&dt(),l}}Q();var at=function(t,e,n){return{parent:t,factory:e,map:Object.create(null)}};function lt(t,e){"function"==typeof e&&(e=e());for(var n=[],r=0;r0&&(T([t.parent]),T(Array.from(u)))}s.CHANGE_STRATEGY_AUTOMATIC=100,s.CHANGE_STRATEGY_MANUAL=200,s.CHANGE_DETECTOR_DETACHED=!1,s.CHANGE_DETECTOR_ATTACHED=!0,s._changeStrategies=[s.CHANGE_STRATEGY_AUTOMATIC,s.CHANGE_STRATEGY_MANUAL],s._changeDetector={lastUpdateDate:new Date,changeDetectionStrategy:s.CHANGE_STRATEGY_AUTOMATIC},Object.seal(s._changeDetector),Object.freeze(s._changeStrategies);var ct=function(t,e){if(e[t]){var n=e[t];e[t]=function(){var t=n.apply(this,[].slice.call(arguments));return dt(),t}}},ft=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t?V(t,s._updateMap.get(t)):s._updateMap.forEach((function(t,e){V(e,t)}))},dt=function(){s._changeDetector.changeDetectionStrategy===s.CHANGE_STRATEGY_AUTOMATIC&&(new Date-s._changeDetector.lastUpdateDate>6?ft():s._debouncedPerformUpdates(),s._changeDetector.lastUpdateDate=new Date)};function ht(t){s._changeStrategies.forEach((function(e){e===t&&(s._changeDetector.changeDetectionStrategy=t)}))}function pt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;ft(t)}function vt(t){return s._updateMap.has(t)}function gt(t){s._updateMap.delete(t)}var yt=Promise.prototype.then;function mt(){Promise.prototype.then=function(t,e){return yt.call(this,(function(e){return dt(),"function"==typeof t&&t instanceof Function?t(e):t}),e)}}function bt(t,e){return function(){e&&e.slpreventdefault&&arguments.length>0&&"function"==typeof arguments[0].preventDefault&&arguments[0].preventDefault();var n=t.apply(this,[].slice.call(arguments));return dt(),n}}s._debouncedPerformUpdates=function(t,e){var n;return function(){for(var e=arguments.length,r=new Array(e),s=0;s=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e){return l(t)||a(t,e)||o(t,e)||r()}function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=4){s._structureForMap.has(_[0])||s._structureForMap.set(_[0],at(null,f[_[2]]));var A=s._structureForMap.get(_[0]);h=lt.bind(f,A,f[_[1]],f[_[3]])()}}else if("slfornamed"===y){var O=b.split(":");if(O.length>=4){for(var I=void 0,D=void 0,S=void 0,C=void 0,x=0,M=Object.keys(f);x",null!==h&&h.forEach((function(t){d+=r(t,i)}));var U,T=t(c);try{for(T.s();!(U=T.n()).done;){var F=U.value;F.view?(F.slOnInit&&(F.slOnInit(),i.push(F)),F=F.view.bind(F)(),d+=r(F,i)):d+="string"==typeof F?F:r(F,i)}}catch(t){T.e(t)}finally{T.f()}return d+=""},d=function(t,e){var n,r=[];for(r.push(t);r.length>0;)if((n=r.shift()).attrs&&(n.attrs.slfor||n.attrs.slfornamed)&&(n.model=e),n.children)for(var s=n.children.length-1;s>=0;--s)r.push(n.children[s])},h=function(t){var e,n,r=[];for(r.push(t);r.length>0;)if(3!==(e=r.shift()).nodeType&&(e.hasAttribute("slfor")?(n=(n=e.getAttribute("slfor")).split(":")).length>0&&s._structureForMap.delete(n[0]):e.hasAttribute("slfornamed")&&((n=(n=e.getAttribute("slfornamed")).split(":")).length>0&&s._structureForMap.delete(n[0])),e.children))for(var o=e.children.length-1;o>=0;--o)r.push(e.children[o])};function p(r,o,i){var a,l;a=o&&o.slns?document.createElementNS(o.slns,r.toLowerCase()):document.createElement(r);for(var u=0,c=Object.keys(o);u1&&void 0!==arguments[1]&&arguments[1];o=a&&a.slns?document.createElementNS(a.slns,i.toLowerCase()):document.createElement(i);for(var c=0,f=Object.entries(a);c2&&void 0!==arguments[2]&&arguments[2];Object.getPrototypeOf(t).slDirty=!0;var r=t,o=O(t,!0,!0,!0);t=o.view,o.afterInit&&s._afterInitArr.push(o.afterInit);var i=g(t);if(o.scopedCss){var a=k(o.model,o.model.slStyle());C(i,a),i.slScopedCss=!0}o.onInit&&(i.slOnInit=!0),A(i,o.destroyIndex,o.onDestroy,o.slUnboundOnDestroy),I(i),e.appendChild(i),y(i,r),n&&F(i,t,o.model)},A=function(t,e,n,r){t.slOnDestroy=!0,t.slOnDestroyIndex=e,t.slOnDestroyFn=n,t.slAfterInit=!0,t.slOnInit=!0,t.slUnboundOnDestroy=r},O=function(e,n,r){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;if(r&&e.slOnInit&&(e.slOnInit(),i&&(i.slOnInit=!0)),i&&i.slKeyList){var a,l=t(i.slKeyList);try{for(l.s();!(a=l.n()).done;){var u=a.value;void 0===e[u]?e[u]=i.slNamespace[u]:i.slNamespace[u]=e[u]}}catch(t){l.e(t)}finally{l.f()}}var c=null;if(n&&e.slOnDestroy){var f=s._destroyFuncMap.get(s._router.mountRoute);f||(f=[]),f.push(e.slOnDestroy.bind(e)),s._destroyFuncMap.set(s._router.mountRoute,f),c=f.length-1}var h=e.view.bind(e)();return d(h,e),{view:h,afterInit:e.slAfterInit?e.slAfterInit.bind(e):null,onDestroy:n&&!o||!e.slOnDestroy?null:e.slOnDestroy.bind(e),onInit:!r&&e.slOnInit?e.slOnInit:null,destroyIndex:c,model:e,scopedCss:e.slStyle?e.slStyle.bind(e):null,slUnboundOnDestroy:e.slOnDestroy,slUnboundAfterInit:e.slAfterInit,slUnboundOnInit:e.slOnInit}},I=function(t){if(t&&null!==t.slOnDestroyIndex&&void 0!==t.slOnDestroyIndex&&!t.slOnDestroyRoute){var e=s._destroyNodeMap.get(s._router.mountRoute);e||(e=[]),e.find((function(e){return e.slOnDestroyIndex===t.slOnDestroyIndex}))||e.push(t),s._destroyNodeMap.set(s._router.mountRoute,e),t.slOnDestroyRoute=s._router.mountRoute}},D=function(t){if(t&&t.slOnDestroy){var e=s._destroyFuncMap.get(s._router.mountRoute);e||(e=[]),e.splice(t.slOnDestroyIndex,1),s._destroyFuncMap.set(s._router.mountRoute,e);var n=s._destroyNodeMap.get(s._router.mountRoute);n||(n=[]),n.forEach((function(e){e.slOnDestroyIndex>t.slOnDestroyIndex&&e.slOnDestroyIndex--})),n=n.filter((function(e){return e.slOnDestroyIndex!==t.slOnDestroyIndex})),s._destroyNodeMap.set(s._router.mountRoute,n)}},S=function e(n){if(n&&n.children&&n.children.length>0){var r,s=t(n.children);try{for(s.s();!(r=s.n()).done;){e(r.value)}}catch(t){s.e(t)}finally{s.f()}n.slOnDestroyFn&&(n.slOnDestroyFn(),n.slOnDestroyFn=void 0,n.slUnboundOnDestroy=void 0)}else n.slOnDestroyFn&&(n.slOnDestroyFn(),n.slOnDestroyFn=void 0,n.slUnboundOnDestroy=void 0)},C=function e(n,r){if(n.setAttribute(r,""),n.children&&n.children.length>0){var s,o=t(n.children);try{for(o.s();!(s=o.n()).done;){e(s.value,r)}}catch(t){o.e(t)}finally{o.f()}}},x=function(t,e,n){t.slOnDestroy=!0;var r=s._destroyFuncMap.get(s._router.mountRoute);r||(r=[]),r.push(e),s._destroyFuncMap.set(s._router.mountRoute,r),t.slOnDestroyIndex=r.length-1,t.slOnDestroyFn=e,t.slUnboundOnDestroy=n,I(t)},M=function(r,o,i){var a,l=[],u=t(o);try{for(u.s();!(a=u.n()).done;){var c=a.value,f=i[c.name];f?f.length===c.nodeValue.length&&f===c.nodeValue&&delete i[c.name]:c.name.startsWith("slcss-")||l.push(c.nodeName)}}catch(t){u.e(t)}finally{u.f()}l.forEach((function(t){r.removeAttribute(t)})),void 0!==i.slref&&(r.slref=r);for(var d=i.slpreventdefault,h=!1,p=function(){var t=n(g[v],2),o=t[0],a=t[1];if("function"===e(a)){if(void 0!==d){var l=o;l.startsWith("on")&&(l=l.substring(2,l.length));var u=r[o];u&&(Array.isArray(u)?u:[u]).forEach((function(t){r.removeEventListener(l,t)})),r.addEventListener(l,(function(t){t.preventDefault()})),h=!0}r[o]=a,s._changeDetector.changeDetectionStrategy!==s.CHANGE_STRATEGY_AUTOMATIC||a.name.startsWith("bound slDetached")||a.name.startsWith("slDetached")||ct(o,r)}else if("slnsfor"===o)for(var c=JSON.parse(i.slnsfor),f=0,p=Object.entries(c);f=0;--a){var l=null,u=null;if(r[a]&&(n[a].slUnboundOnDestroy!==r[a].slOnDestroy&&(void 0!==n[a].slUnboundOnDestroy&&void 0!==n[a].slOnDestroyFn&&n[a].slOnDestroyFn(),D(n[a]),n[a].slOnDestroyFn=void 0,n[a].slOnDestroy=!1),r[a].view)){var c=O(r[a],!1,!1,!1,n[a]);r[a]=c.view;var f=Object.getPrototypeOf(c.model);!0!==f.slDirty&&(c.onInit&&n[a].slOnInit&&(n[a].slOnInit=!1),c.afterInit&&n[a].slAfterInit&&(n[a].slAfterInit=!1),c.scopedCss&&n[a].slScopedCss&&(n[a].slScopedCss=!1),c.onDestroy&&n[a].slOnDestroy&&(n[a].slOnDestroy=!1),f.slDirty=!0),c.onInit&&!n[a].slOnInit&&n[a].slUnboundOnInit!==c.slUnboundOnInit?(n[a].slUnboundOnInit=c.slUnboundOnInit,c.onInit.bind(c.model)(),r[a].slOnInit=!0):void 0===n[a].slUnboundOnInit||c.onInit?c.onInit&&n[a]&&!n[a].slOnInit?(n[a].slUnboundOnInit===c.slUnboundOnInit&&c.onInit.bind(c.model)(),n[a].slUnboundOnInit=c.slUnboundOnInit,r[a].slOnInit=!0):c.onInit&&n[a].slOnInit&&void 0===n[a].slUnboundOnInit&&(n[a].slUnboundOnInit=c.slUnboundOnInit):n[a].slOnInit=!1,c.afterInit&&!n[a].slAfterInit&&n[a].slUnboundAfterInit!==c.slUnboundAfterInit?(n[a].slAfterInit=!0,n[a].slUnboundAfterInit=c.slUnboundAfterInit,s._afterInitArr.push(c.afterInit)):void 0===n[a].slUnboundAfterInit||c.afterInit?c.afterInit&&n[a]&&!n[a].slAfterInit?(n[a].slAfterInit=!0,n[a].slUnboundAfterInit===c.slUnboundAfterInit&&s._afterInitArr.push(c.afterInit),n[a].slUnboundAfterInit=c.slUnboundAfterInit):c.afterInit&&n[a].slAfterInit&&void 0===n[a].slUnboundAfterInit&&(n[a].slUnboundAfterInit=c.slUnboundAfterInit):n[a].slAfterInit=!1,c.scopedCss&&n[a]&&!n[a].slScopedCss&&(u=k(c.model,c.model.slStyle())),c.onDestroy&&n[a]&&!n[a].slOnDestroy&&x(n[a],c.onDestroy,c.slUnboundOnDestroy),y(n[a],c.model),l=c.model}F(n[a],r[a],l),r[a]&&r[a].slOnInit&&(n[a].slOnInit=!0),u&&(C(n[a],u),n[a].slScopedCss=!0),i++}for(var d=n.length;d>o;)D(n[d-1]),S(n[d-1]),h(n[n.length-1]),w(n[d-1]),d--;var p,v=t(r.slice(o));try{for(v.s();!(p=v.n()).done;){var b=p.value;if("string"==typeof b)e.childNodes[i]?e.childNodes[i].textContent!==b&&(e.childNodes[i].textContent=b):e.append(b);else if("string"==typeof b)e.append(b);else if(b.view)_(b,e,!0);else{var A=g(b);e.appendChild(A),F(A,b)}i++}}catch(t){v.e(t)}finally{v.f()}for(d=n.length;d>r.length;)D(n[d-1]),S(n[d-1]),h(n[d-1]),w(n[d-1]),d--},w=function(t){var e=s._router.count;if(void 0===t.slanimatedestroytarget||""===t.slanimatedestroytarget||t.slAnimateDestroy||void 0===t.attributes.slanimatedestroy||""===t.getAttribute("slanimatedestroy"))if(3===t.nodeType||void 0===t.attributes.slanimatedestroy||""===t.getAttribute("slanimatedestroy")||t.slAnimateDestroy)t.slAnimateDestroy||(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id));else{var n=t.onanimationend,r=t.onanimationstart,o=t.getAttribute("slanimatedestroy");t.onanimationstart=function(e){t.slAnimationName=e.animationName},t.onanimationend=function(o){if(t.slAnimationName&&t.slAnimationName===o.animationName){var i=void 0;return n&&(i=n.apply(this,[].slice.call(arguments))),(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id)),t.slAnimationName=null,t.onanimationend=n,t.onanimationstart=r,t.slAnimateDestroy=!1,i}},t.classList.add(o),t.slAnimateDestroy=!0}else{var i=t.slanimatedestroytarget;if("function"==typeof i){var a=i(t);if(a){var l=a.getAttribute("slanimatedestroy"),u=a.onanimationend,c=a.onanimationstart;a.onanimationstart=function(t){a.slAnimationName=t.animationName},a.onanimationend=function(n){if(a.slAnimationName&&a.slAnimationName===n.animationName){var r=void 0;return u&&(r=u.apply(this,[].slice.call(arguments))),a.classList.remove(l),s._isAnimatingKeyed=null,s._router.currentRoute.animateDestroy?(s._router.currentRoute.animateDestroy=!1,t.setAttribute("style","opacity: 0;"),a.onanimationend=null,a.onanimationstart=null):((s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id)),a.onanimationend=u,a.onanimationstart=c),a.slAnimationName=null,t.slAnimateDestroy=!1,delete t.slanimatedestroytarget,pt(),r}},s._isAnimatingKeyed=a,a.classList.add(l),t.slAnimateDestroy=!0}else(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id))}else(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id))}},R=function t(e){return e&&e!==Object.prototype&&Object.getOwnPropertyNames(e).filter((function(t){return function(t,e){return(Object.getOwnPropertyDescriptor(t,e)||{}).get}(e,t)||function(t,e){return"function"==typeof t[e]}(e,t)})).concat(t(Object.getPrototypeOf(e))||[])},N=function(t){return function(t){return Array.from(new Set(R(t)))}(t).filter((function(t){return"constructor"!==t&&!~t.indexOf("__")}))},U=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(e.slStyle&&!t.slScopedCss){var r=k(e,e.slStyle());C(t,r),t.slScopedCss=!0,t.style.display=n}},T=function(t){for(var e=function(){var e=t[n];if(null!==e.getAttribute("slpreventdefault"))for(var r in e)if(r.startsWith("on")){var s=r.substring(2,r.length),o=e[r];o&&(Array.isArray(o)?o:[o]).forEach((function(t){e.removeEventListener(s,t)})),e.addEventListener(s,(function(t){t.preventDefault()}))}},n=0;n0&&T(Array.from(y)),e}if(r.attrs.slfor){var b=r.attrs.slfor.split(":");if(b.length>=4){if(!s._structureForMap.has(b[0])){var _=at(e,r.model[b[2]]);if(s._structureForMap.set(b[0],_),e.children.length>0){for(var A=Object.create(null),I=0;I=4){for(var j,L,W,H,G=0,P=Object.keys(r.model);G0){for(var $=Object.create(null),J=0;J2&&void 0!==arguments[2]?arguments[2]:0,r="",s=!1,o=!1,i=!1,a=n;aa+e.length&&t.substring(a,a+e.length)===e&&!s&&!o){r+=t.substring(a,a+e.length-1);break}return r},k=function(t,e){var n=function(t){for(var e=0,n=1779033703^t.length;e>>19;return function(){return n=Math.imul(n^n>>>16,2246822507),n=Math.imul(n^n>>>13,3266489909),(n^=n>>>16)>>>0}}(t.constructor.name),r="slcss-"+String(n());if(""===e||s._scopedCssSet.has(r))return r;e=e.replace(/\t+/g," "),s._scopedCssSet.add(r);var o=new RegExp("([^{]+)s*{s*([^}]+)s*}","g"),i=e.match(o),a=/[^\s"]+|"([^"]*)"/gi,l="",u=null;do{null!=(u=a.exec(e))&&(u[1]||(l+=u[0]))}while(null!=u);var c,f,d,h,p,v,g,y,b="",_=0,A=0,O=0,I=0,D=!1,S=!1,C=0,x=!1,M=0,E=new Map;if(l.includes("{")&&l.includes("}")&&l.split("{").length===l.split("}").length)for(var w=0;w0)for(var L=j.trim();L.startsWith("}")&&I>0;)!(0!==_||1!==I||N<=I)&&A-N>=1||I--,N--,A--,L=L.replace("}","").trim();var k="";u=null;do{null!=(u=a.exec(j))&&(u[1]||(k+=u[0]))}while(null!=u);if(b+=j,0===I&&W(k,"}")>0){var P=k.length,Y=k.replace(/^}+/,"");(A-=W(Y,"}"))>=P-Y.length&&(1===A&&1===N||(M+=P-Y.length))}var B=W(k,"{")-W(k,"}"),q=k.replace(/\s/g,"").match(/(@layer|@container|@media|@scope)[^{]*\{/g),K=q?q.length:0;(B-=I>0?0:K)<0&&(B=0),I+=B}}f=c}v=i[w].substring(c)}var X=c+H(i[w],"{",c).length-1;-1===X&&(X=c);for(var $=i[w].substring(c,X);($.split('"').length-1)%2!=0;)X=X+1+H(i[w],"{",X+1).length,$=i[w].substring(c,X);if(""!==$&&!/^\s*$/.test($)){var J=$.split(","),V=void 0;O>0&&$.startsWith(",")&&(J.shift(),J[0]=", "+J[0]);for(var z=0;z0&&V.includes("}");){for(var Q=void 0,Z=void 0,tt="";V.includes("}");)Q=V.indexOf("{"),((Z=V.indexOf("}"))0&&I--,0===I&&(D=!1);if(V.includes(" ")){var et=V.substring(0,V.indexOf(" ")),nt=V.substring(V.indexOf(" "));if(z>0&&(b+=", "),"@nest"===et.trim()&&nt.replace(/^\s+/g,"").includes(" ")){var rt=nt.replace(/^\s+/g,""),st=rt.substring(0,rt.indexOf(" "));et+=" "+st,nt=rt=rt.substring(st.length,rt.length)}if(x=et.trim().startsWith("@"),g=et.trim().endsWith(":")){for(var ot=H(nt,";");H(nt,";",ot.length).trim().endsWith(";");)ot+=H(nt,";",ot.length);var it=nt.substring(ot.length,nt.length);nt=ot;var at=i[w].substring(X);X=i[w].length;for(var lt=it+" ",ut=J.length>1,ct=z+1;ct0&&N>0&&ut&&(A++,M++);var ft="";u=null;do{null!=(u=a.exec(i[w+1]))&&(u[1]||(ft+=u[0]))}while(null!=u);var dt=W(ft,"{");(dt-=W(ft,"}"))<0&&(dt=0),A+=dt,C+=dt}!(!I>0)||D||S&&0!==I||x&&!et.trim().startsWith("@nest")||g?b+=et+nt:b+=et+(0===I?"["+r+"]":"")+nt}else z>0&&(b+=", "),!(!I>0)||D||S&&0!==I||V.trim().startsWith("@")||x||V.trim().endsWith(":")?b+=V:b+=V+(0===I?"["+r+"]":"")}}}if(O>0&&(X=null!==d?i[w].indexOf(d):0),i[w].includes("--")&&N>1){var ht=H(i[w],"--",0).length,pt=i[w].substring(0,ht),vt="";do{null!=(u=a.exec(pt))&&(u[1]||(vt+=u[0]))}while(null!=u);var gt=W(vt,"{")-1;p=N-1,gt>0&&(p-=gt),p>0&&(O+=p)}if(N-O>1&&!h){var yt=i[w].substring(X+1);i[w]=i[w].substring(0,i[w].length-yt.length),i.splice(w+1,0,yt);var mt="";u=null;do{null!=(u=a.exec(yt))&&(u[1]||(mt+=u[0]))}while(null!=u);y=W(mt,"{")-W(mt,"}"),O-=p}var bt=i[w].substring(X),_t=bt.replace("{","").replace(";","");if(bt.includes("{")&&W(bt,"{")>1&&!_t.trim().startsWith("--")){var At=H(bt,"{",0);At=At+" "+H(bt,"{",At.length);var Ot=bt.substring(At.length+1,bt.length);Ot=At.substring(At.lastIndexOf(";")+1,At.length)+" "+Ot,bt=At=At.substring(0,At.lastIndexOf(";")+1),i.splice(w+1,0,Ot),I++,C++}b+=bt;var It="";u=null;do{null!=(u=a.exec(bt))&&(u[1]||(It+=u[0]))}while(null!=u);for(A+=(y=W(It,"{")-W(It,"}"))-p>=0?y-p:y,(y-=O)<0&&(y=0),0===I&&S||(C+=y,(I+=y)>0&&(I-=1-A-W(It,"{")+W(It,"}")>=0?1-A-W(It,"{")+W(It,"}"):0));_>0;)b+="}",_--;0===O&&(b+="\n")}for(I-=C;I>0;)b+="}",I--;for(A-=M;A>0;)b+="}",A--;if(b+="\n",E.size>0){var Dt,St=0;b=(Dt=G(b,St,E,"animation")).finalCss,St=Dt.startIndex,b=(Dt=G(b,St=0,E,"animation-name")).finalCss,St=Dt.startIndex}if(""!==b.trim()){var Ct=document.head||document.getElementsByTagName("head")[0],xt=document.createElement("style");Ct.appendChild(xt),xt.appendChild(document.createTextNode(b))}return r},G=function(e,r,s,o){for(;-1!==(r=e.indexOf(o,r));){var i=e.substring(0,r),a=e.substring(r,e.indexOf(";",r)),l=e.substring(r+a.length,e.length);if(a.includes(":"))if(":"===a.substring(0,a.indexOf(":")+1).replace(o,"").trim()){var u,c=t(s);try{for(c.s();!(u=c.n()).done;){var f=n(u.value,2),d=f[0],h=f[1],p=a.replace(o,"");(p=p.trim()).startsWith(":")&&(p=(p=p.substring(1,p.length)).trim()),new RegExp(d+"(\\s|;|$)").test(p)&&d.length>0?r+=(a=a.replaceAll(d,h)).length:r+=o.length}}catch(t){c.e(t)}finally{c.f()}e=i+a+l}else r+=a.length}return{finalCss:e,startIndex:r}};function P(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=document.getElementById(t).getAttribute("slssrclass"),r=c[n];return!r&&this&&(r=this[n]),$(t,new r,e)}function Y(t){return Promise.all(t.map((function(t){return t.then((function(t){return{result:t,status:"fulfilled",error:null}}),(function(t){return{result:null,error:t,status:"rejected"}}))})))}function B(t){s._state=t}function q(){return s._state}function K(t){return String(t)}function X(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.attrs,r=void 0===n?{}:n,s=e.children,o=void 0===s?[]:s;return{tagName:t=t.toUpperCase(),attrs:r,children:o}}function m(){return 3===arguments.length&&"string"==typeof arguments[0]&&"object"==e(arguments[1])&&Array.isArray(arguments[2])?X(arguments[0],{attrs:arguments[1],children:arguments[2]}):X(arguments[0],arguments[1])}function $(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];s._router.mountRoute=t;var r=document.getElementById(t);if(null!==r)return j(r,e,n);console.error("ID "+t+" does not exist in DOM.")}function J(e){var n,r=[],o=new Set,i=t(s._structureForMap.keys());try{for(i.s();!(n=i.n()).done;){var a=n.value;o.add(a)}}catch(t){i.e(t)}finally{i.f()}e.slOnInit&&(e.slOnInit(),r.push(e));for(var l=e.view.bind(e)(),u=e;l.view;)l.slOnInit&&(l.slOnInit(),r.push(l)),u=l,l=l.view.bind(l)();d(l,u);var c=f(l,r);r.forEach((function(t){t.slOnDestroy&&t.slOnDestroy.bind(t)()}));var h,p=t(s._structureForMap.keys());try{for(p.s();!(h=p.n()).done;){var v=h.value;o.has(v)||s._structureForMap.delete(v)}}catch(t){p.e(t)}finally{p.f()}return c}function V(t,e){var n=t;if(t=document.getElementById(t),s._afterInitArr=[],t){var r=e.view.bind(e)();d(r,e),t=F(t,r,e)}else console.error("ID "+n+" not mounted in DOM; attachDetector likely needs to be called.");var o=t.querySelectorAll("[slref]");void 0!==t.slref&&(o=Array.from(o)).push(t);for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:{},i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(s._router.params=o,!s._router.currentRoute||!s._router.currentRoute.onCanDeactivate||s._router.currentRoute.onCanDeactivate(r)){var a,l=null,u=t(s._router.routeList);try{var f=function(){var t=n(a.value,2),e=t[0],o=t[1];if(e.test(r)){if(o.onActivationCheck&&!o.onActivationCheck(r))return{v:(o.onActivationFail&&(l=it(o.onActivationFail.route,o.onActivationFail.params,"boolean"!=typeof o.onActivationFail.attachDetector||o.onActivationFail.attachDetector)),void(r=void 0))};o.onBeforeRoute&&o.onBeforeRoute();var u=document.getElementById(o.root),f=s._destroyNodeMap.get(rt());f&&(f.forEach((function(t){t.slOnDestroyFn&&u.contains(t)&&t.slOnDestroyFn(),t.slOnDestroyFn=void 0,t.slUnboundOnDestroy=void 0})),s._destroyNodeMap.set(rt(),[]),s._destroyFuncMap.set(rt(),[])),s._router.lastHash=r;var d=c.pageYOffset;switch(s._router.strategy){case"#":c.history.pushState(null,document.title,"#/"+r);break;case"?":var p=c.location.href,v=c.location.pathname;p=p.substring(0,p.indexOf(v)),p+="/?/"+r,c.history.pushState(null,document.title,p);break;case"":var g=c.location.href,y=c.location.pathname;g=g.substring(0,g.indexOf(y)),g+="/"+r,c.history.pushState(null,document.title,g)}if(c.scrollTo(0,d),s._router.currentRoute&&void 0!==s._router.currentRoute.animateDestroy&&(s._router.currentRoute.animateDestroy=!0),s._router.currentRoute&&s._router.currentRoute.animateDestroy){var b=s._router.currentRoute.root;b=document.getElementById(b),s._router.currentRoute=o,D(b),S(b),h(b),w(b),Q()}else Q(),s._router.currentRoute=o;return s._router.count++,o.component&&(o.component.slOnDestroy&&s._destroyFuncMap.set(r,[o.component.slOnDestroy.bind(o.component)]),s._router.mountRoute=r,j(u,o.component,i),o.component.slOnDestroy&&(u.slOnDestroyIndex=0,s._destroyFuncMap.get(r).pop(),I(u)),l=o.component),"break"}};for(u.s();!(a=u.n()).done;){var d=f();if("break"===d)break;if("object"===e(d))return d.v}}catch(t){u.e(t)}finally{u.f()}return s._changeDetector.changeDetectionStrategy===s.CHANGE_STRATEGY_AUTOMATIC&&dt(),l}}Q();var at=function(t,e,n){return{parent:t,factory:e,map:Object.create(null)}};function lt(t,e){"function"==typeof e&&(e=e());for(var n=[],r=0;r0&&(T([t.parent]),T(Array.from(u)))}s.CHANGE_STRATEGY_AUTOMATIC=100,s.CHANGE_STRATEGY_MANUAL=200,s.CHANGE_DETECTOR_DETACHED=!1,s.CHANGE_DETECTOR_ATTACHED=!0,s._changeStrategies=[s.CHANGE_STRATEGY_AUTOMATIC,s.CHANGE_STRATEGY_MANUAL],s._changeDetector={lastUpdateDate:new Date,changeDetectionStrategy:s.CHANGE_STRATEGY_AUTOMATIC},Object.seal(s._changeDetector),Object.freeze(s._changeStrategies);var ct=function(t,e){if(e[t]){var n=e[t];e[t]=function(){var t=n.apply(this,[].slice.call(arguments));return dt(),t}}},ft=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t?V(t,s._updateMap.get(t)):s._updateMap.forEach((function(t,e){V(e,t)}))},dt=function(){s._changeDetector.changeDetectionStrategy===s.CHANGE_STRATEGY_AUTOMATIC&&(new Date-s._changeDetector.lastUpdateDate>6?ft():s._debouncedPerformUpdates(),s._changeDetector.lastUpdateDate=new Date)};function ht(t){s._changeStrategies.forEach((function(e){e===t&&(s._changeDetector.changeDetectionStrategy=t)}))}function pt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;ft(t)}function vt(t){return s._updateMap.has(t)}function gt(t){s._updateMap.delete(t)}var yt=Promise.prototype.then;function mt(){Promise.prototype.then=function(t,e){return yt.call(this,(function(e){return dt(),"function"==typeof t&&t instanceof Function?t(e):t}),e)}}function bt(t,e){return function(){e&&e.slpreventdefault&&arguments.length>0&&"function"==typeof arguments[0].preventDefault&&arguments[0].preventDefault();var n=t.apply(this,[].slice.call(arguments));return dt(),n}}s._debouncedPerformUpdates=function(t,e){var n;return function(){for(var e=arguments.length,r=new Array(e),s=0;s{},e.setInterval=()=>{},e.location={},e.location.href="",e.fetch=()=>{},e.XMLHttpRequest={},e.XMLHttpRequest.prototype={},e.XMLHttpRequest.prototype.send=()=>{}),e.s=function(){},s._state={},s._destroyFuncMap=new Map,s._updateMap=new Map,s._afterInitArr=[],s._destroyNodeMap=new Map,s._structureForMap=new Map,s._isAnimatingKeyed=null;const n=(t,e)=>{const n=[];let r;for(n.push(t);n.length>0;)if(r=n.shift(),r.attrs&&(r.attrs.slfor||r.attrs.slfornamed)&&(r.model=e),r.children)for(let t=r.children.length-1;t>=0;--t)n.push(r.children[t])},r=t=>{const e=[];let n,r;for(e.push(t);e.length>0;)if(n=e.shift(),3!==n.nodeType&&(n.hasAttribute("slfor")?(r=n.getAttribute("slfor"),r=r.split(":"),r.length>0&&s._structureForMap.delete(r[0])):n.hasAttribute("slfornamed")&&(r=n.getAttribute("slfornamed"),r=r.split(":"),r.length>0&&s._structureForMap.delete(r[0])),n.children))for(let t=n.children.length-1;t>=0;--t)e.push(n.children[t])};export function renderElementWithoutClass(t,e,n){let r,o,l;r=e&&e.slns?document.createElementNS(e.slns,t.toLowerCase()):document.createElement(t);for(let t of Object.keys(e))if(l=e[t],o=typeof l,"function"===o)r[t]=l,s._changeDetector.changeDetectionStrategy!==s.CHANGE_STRATEGY_AUTOMATIC||l.name.startsWith("bound slDetached")||l.name.startsWith("slDetached")||U(t,r);else if("slnsfor"===t){const t=JSON.parse(e.slnsfor);for(const[e,n]of Object.entries(t))r.setAttributeNS(n.namespace,e,n.value)}else r.setAttribute(t,l);for(let t of n)r.append(t);return r}export function renderElement({tagName:t,attrs:e,children:n},r=!1){let o,l;o=e&&e.slns?document.createElementNS(e.slns,t.toLowerCase()):document.createElement(t);for(let[t,n]of Object.entries(e))if(l=typeof n,"function"===l)o[t]=n,s._changeDetector.changeDetectionStrategy!==s.CHANGE_STRATEGY_AUTOMATIC||n.name.startsWith("bound slDetached")||n.name.startsWith("slDetached")||U(t,o);else if("slnsfor"===t){const t=JSON.parse(e.slnsfor);for(const[e,n]of Object.entries(t))o.setAttributeNS(n.namespace,e,n.value)}else o.setAttribute(t,n);for(let t of n)"string"==typeof t?o.append(t):t.view?r?i(t,o):a(t,o):o.appendChild(renderElement(t,r));return o}const o=({tagName:t,attrs:e,children:n})=>{let r,l;r=e&&e.slns?document.createElementNS(e.slns,t.toLowerCase()):document.createElement(t);for(let[t,n]of Object.entries(e))if(l=typeof n,"function"===l)r[t]=n,s._changeDetector.changeDetectionStrategy!==s.CHANGE_STRATEGY_AUTOMATIC||n.name.startsWith("bound slDetached")||n.name.startsWith("slDetached")||U(t,r);else if("slnsfor"===t){const t=JSON.parse(e.slnsfor);for(const[e,n]of Object.entries(t))r.setAttributeNS(n.namespace,e,n.value)}else r.setAttribute(t,n);for(let t of n)"string"==typeof t?r.append(t):t.view?a(t,r):r.appendChild(o(t));return r},l=(t,e)=>{t.slKeyList=[],t.slNamespace={};for(const n in e)t.slNamespace[n]=e[n],t.slKeyList.push(n)},i=(t,e)=>{t=c(t,!0,!0,!0).view;const n=o(t);e.appendChild(n)},a=(t,e,n=!1)=>{Object.getPrototypeOf(t).slDirty=!0;const r=t,i=c(t,!0,!0,!0);t=i.view,i.afterInit&&s._afterInitArr.push(i.afterInit);const a=o(t);i.onInit&&(a.slOnInit=!0),u(a,i.destroyIndex,i.onDestroy,i.slUnboundOnDestroy),d(a),e.appendChild(a),l(a,r),n&&I(a,t,i.model)},u=(t,e,n,r)=>{t.slOnDestroy=!0,t.slOnDestroyIndex=e,t.slOnDestroyFn=n,t.slAfterInit=!0,t.slOnInit=!0,t.slUnboundOnDestroy=r},c=(t,e,r,o=!1,l=null)=>{if(r&&t.slOnInit&&(t.slOnInit(),l&&(l.slOnInit=!0)),l&&l.slKeyList)for(const e of l.slKeyList)void 0===t[e]?t[e]=l.slNamespace[e]:l.slNamespace[e]=t[e];let i=null;if(e&&t.slOnDestroy){let e=s._destroyFuncMap.get(s._router.mountRoute);e||(e=[]),e.push(t.slOnDestroy.bind(t)),s._destroyFuncMap.set(s._router.mountRoute,e),i=e.length-1}const a=t.view.bind(t)();return n(a,t),{view:a,afterInit:t.slAfterInit?t.slAfterInit.bind(t):null,onDestroy:e&&!o||!t.slOnDestroy?null:t.slOnDestroy.bind(t),onInit:!r&&t.slOnInit?t.slOnInit:null,destroyIndex:i,model:t,slUnboundOnDestroy:t.slOnDestroy,slUnboundAfterInit:t.slAfterInit,slUnboundOnInit:t.slOnInit}},d=t=>{if(t&&null!==t.slOnDestroyIndex&&void 0!==t.slOnDestroyIndex&&!t.slOnDestroyRoute){let e=s._destroyNodeMap.get(s._router.mountRoute);e||(e=[]);e.find(e=>e.slOnDestroyIndex===t.slOnDestroyIndex)||e.push(t),s._destroyNodeMap.set(s._router.mountRoute,e),t.slOnDestroyRoute=s._router.mountRoute}},f=t=>{if(t&&t.slOnDestroy){let e=s._destroyFuncMap.get(s._router.mountRoute);e||(e=[]),e.splice(t.slOnDestroyIndex,1),s._destroyFuncMap.set(s._router.mountRoute,e);let n=s._destroyNodeMap.get(s._router.mountRoute);n||(n=[]),n.forEach(e=>{e.slOnDestroyIndex>t.slOnDestroyIndex&&e.slOnDestroyIndex--}),n=n.filter(e=>e.slOnDestroyIndex!==t.slOnDestroyIndex),s._destroyNodeMap.set(s._router.mountRoute,n)}},p=t=>{if(t&&t.children&&t.children.length>0){for(const e of t.children)p(e);t.slOnDestroyFn&&(t.slOnDestroyFn(),t.slOnDestroyFn=void 0,t.slUnboundOnDestroy=void 0)}else t.slOnDestroyFn&&(t.slOnDestroyFn(),t.slOnDestroyFn=void 0,t.slUnboundOnDestroy=void 0)},h=(t,e,n)=>{t.slOnDestroy=!0;let r=s._destroyFuncMap.get(s._router.mountRoute);r||(r=[]),r.push(e),s._destroyFuncMap.set(s._router.mountRoute,r),t.slOnDestroyIndex=r.length-1,t.slOnDestroyFn=e,t.slUnboundOnDestroy=n,d(t)},y=(t,e,n)=>{let r;const o=[];for(let t of e){let e=n[t.name];e?e.length===t.nodeValue.length&&e===t.nodeValue&&delete n[t.name]:o.push(t.nodeName)}o.forEach(e=>{t.removeAttribute(e)}),void 0!==n.slref&&(t.slref=t);const l=n.slpreventdefault;let i=!1;for(let[e,o]of Object.entries(n))if(r=typeof o,"function"===r){if(void 0!==l){let n=e;n.startsWith("on")&&(n=n.substring(2,n.length));const r=t[e];if(r){(Array.isArray(r)?r:[r]).forEach(e=>{t.removeEventListener(n,e)})}t.addEventListener(n,(function(t){t.preventDefault()})),i=!0}t[e]=o,s._changeDetector.changeDetectionStrategy!==s.CHANGE_STRATEGY_AUTOMATIC||o.name.startsWith("bound slDetached")||o.name.startsWith("slDetached")||U(e,t)}else if("slnsfor"===e){const e=JSON.parse(n.slnsfor);for(const[n,r]of Object.entries(e))t.setAttributeNS(r.namespace,n,r.value)}else t.setAttribute(e,o);i||(void 0!==l||e.slpreventdefault)&&D([t])},g=(t,e,n)=>{const i=e.length;let u=0;for(let t=e.length-1;t>=0;--t){let r=null;if(n[t]&&(e[t].slUnboundOnDestroy!==n[t].slOnDestroy&&(void 0!==e[t].slUnboundOnDestroy&&void 0!==e[t].slOnDestroyFn&&e[t].slOnDestroyFn(),f(e[t]),e[t].slOnDestroyFn=void 0,e[t].slOnDestroy=!1),n[t].view)){const o=c(n[t],!1,!1,!1,e[t]);n[t]=o.view;const i=Object.getPrototypeOf(o.model);!0!==i.slDirty&&(o.onInit&&e[t].slOnInit&&(e[t].slOnInit=!1),o.afterInit&&e[t].slAfterInit&&(e[t].slAfterInit=!1),o.onDestroy&&e[t].slOnDestroy&&(e[t].slOnDestroy=!1),i.slDirty=!0),o.onInit&&!e[t].slOnInit&&e[t].slUnboundOnInit!==o.slUnboundOnInit?(e[t].slUnboundOnInit=o.slUnboundOnInit,o.onInit.bind(o.model)(),n[t].slOnInit=!0):void 0===e[t].slUnboundOnInit||o.onInit?o.onInit&&e[t]&&!e[t].slOnInit?(e[t].slUnboundOnInit===o.slUnboundOnInit&&o.onInit.bind(o.model)(),e[t].slUnboundOnInit=o.slUnboundOnInit,n[t].slOnInit=!0):o.onInit&&e[t].slOnInit&&void 0===e[t].slUnboundOnInit&&(e[t].slUnboundOnInit=o.slUnboundOnInit):e[t].slOnInit=!1,o.afterInit&&!e[t].slAfterInit&&e[t].slUnboundAfterInit!==o.slUnboundAfterInit?(e[t].slAfterInit=!0,e[t].slUnboundAfterInit=o.slUnboundAfterInit,s._afterInitArr.push(o.afterInit)):void 0===e[t].slUnboundAfterInit||o.afterInit?o.afterInit&&e[t]&&!e[t].slAfterInit?(e[t].slAfterInit=!0,e[t].slUnboundAfterInit===o.slUnboundAfterInit&&s._afterInitArr.push(o.afterInit),e[t].slUnboundAfterInit=o.slUnboundAfterInit):o.afterInit&&e[t].slAfterInit&&void 0===e[t].slUnboundAfterInit&&(e[t].slUnboundAfterInit=o.slUnboundAfterInit):e[t].slAfterInit=!1,o.onDestroy&&e[t]&&!e[t].slOnDestroy&&h(e[t],o.onDestroy,o.slUnboundOnDestroy),l(e[t],o.model),r=o.model}I(e[t],n[t],r),n[t]&&n[t].slOnInit&&(e[t].slOnInit=!0),u++}let d=e.length;for(;d>i;)f(e[d-1]),p(e[d-1]),r(e[e.length-1]),_(e[d-1]),d--;for(let e of n.slice(i)){if("string"==typeof e)t.childNodes[u]?t.childNodes[u].textContent!==e&&(t.childNodes[u].textContent=e):t.append(e);else if("string"==typeof e)t.append(e);else if(e.view)a(e,t,!0);else{const n=o(e);t.appendChild(n),I(n,e)}u++}for(d=e.length;d>n.length;)f(e[d-1]),p(e[d-1]),r(e[d-1]),_(e[d-1]),d--},_=t=>{const e=s._router.count;if(void 0===t.slanimatedestroytarget||""===t.slanimatedestroytarget||t.slAnimateDestroy||void 0===t.attributes.slanimatedestroy||""===t.getAttribute("slanimatedestroy"))if(3===t.nodeType||void 0===t.attributes.slanimatedestroy||""===t.getAttribute("slanimatedestroy")||t.slAnimateDestroy)t.slAnimateDestroy||(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id));else{const n=t.onanimationend,r=t.onanimationstart,o=t.getAttribute("slanimatedestroy");t.onanimationstart=function(e){t.slAnimationName=e.animationName},t.onanimationend=function(o){if(!t.slAnimationName||t.slAnimationName!==o.animationName)return;let l=void 0;return n&&(l=n.apply(this,[].slice.call(arguments))),(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id)),t.slAnimationName=null,t.onanimationend=n,t.onanimationstart=r,t.slAnimateDestroy=!1,l},t.classList.add(o),t.slAnimateDestroy=!0}else{const n=t.slanimatedestroytarget;if("function"==typeof n){const r=n(t);if(r){const n=r.getAttribute("slanimatedestroy"),o=r.onanimationend,l=r.onanimationstart;r.onanimationstart=function(t){r.slAnimationName=t.animationName},r.onanimationend=function(i){if(!r.slAnimationName||r.slAnimationName!==i.animationName)return;let a=void 0;return o&&(a=o.apply(this,[].slice.call(arguments))),r.classList.remove(n),s._isAnimatingKeyed=null,s._router.currentRoute.animateDestroy?(s._router.currentRoute.animateDestroy=!1,t.setAttribute("style","opacity: 0;"),r.onanimationend=null,r.onanimationstart=null):((s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id)),r.onanimationend=o,r.onanimationstart=l),r.slAnimationName=null,t.slAnimateDestroy=!1,delete t.slanimatedestroytarget,detectChanges(),a},s._isAnimatingKeyed=r,r.classList.add(n),t.slAnimateDestroy=!0}else(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id))}else(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id))}},A=t=>t&&t!==Object.prototype&&Object.getOwnPropertyNames(t).filter(e=>((t,e)=>(Object.getOwnPropertyDescriptor(t,e)||{}).get)(t,e)||((t,e)=>"function"==typeof t[e])(t,e)).concat(A(Object.getPrototypeOf(t))||[]),O=t=>(t=>Array.from(new Set(A(t))))(t).filter(t=>"constructor"!==t&&!~t.indexOf("__")),D=t=>{for(let e=0;e{n.removeEventListener(e,t)})}n.addEventListener(e,(function(t){t.preventDefault()}))}}},I=(t,e,n=null)=>{if(null!==s._isAnimatingKeyed)for(let[e,n]of s._updateMap){const n=document.getElementById(e);if(n.contains(s._isAnimatingKeyed)&&n.contains(t))return t}if(e&&e.view){t.slUnboundOnDestroy!==e.slOnDestroy&&(void 0!==t.slUnboundOnDestroy&&void 0!==t.slOnDestroyFn&&t.slOnDestroyFn(),f(t),t.slOnDestroyFn=void 0,t.slOnDestroy=!1);const n=c(e,!1,!1,!1,t);e=n.view;const r=Object.getPrototypeOf(n.model);!0!==r.slDirty&&(n.onInit&&t.slOnInit&&(t.slOnInit=!1),n.afterInit&&t.slAfterInit&&(t.slAfterInit=!1),n.onDestroy&&t.slOnDestroy&&(t.slOnDestroy=!1),r.slDirty=!0),n.onInit&&t&&!t.slOnInit&&(n.onInit.bind(n.model)(),t.slOnInit=!0),n.afterInit&&t&&!t.slAfterInit&&(t.slAfterInit=!0,t.slUnboundAfterInit=n.slUnboundAfterInit,s._afterInitArr.push(n.afterInit)),n.onDestroy&&t&&!t.slOnDestroy&&h(t,n.onDestroy,n.slUnboundOnDestroy)}if(!e)return t&&(f(t),p(t),r(t),_(t)),t;if(t&&(t.tagName||"").toLowerCase()!==((e?e.tagName:void 0)||"").toLowerCase()){if(!e.tagName)return f(t),p(t),t.replaceWith(e),t=e;{let n;n=e.attrs&&e.attrs.slns?document.createElementNS(e.attrs.slns,e.tagName.toLowerCase()):document.createElement(e.tagName),t.parentNode.insertBefore(n,t),f(t),p(t),r(t),_(t),n.slUnboundAfterInit=t.slUnboundAfterInit,void 0!==n.slUnboundAfterInit&&(n.slAfterInit=!0),t.slOnInit&&(n.slOnInit=!1),t=n}}if("string"==typeof e)return t.textContent!==e&&(t.textContent=e),t;switch(e.attrs.sldirective){case"useexisting":return t;case"onlychildren":return g(t,t.childNodes,e.children),t;case"onlyself":return y(t,t.attributes,e.attrs),t;case"trustchildren":{y(t,t.attributes,e.attrs);let n="";e.children.forEach(t=>{n+=t}),t.innerHTML!==n&&(t.innerHTML=n);const r=t.querySelectorAll("[slpreventdefault]");return r.length>0&&D(Array.from(r)),t}}if(e.attrs.slfor){const n=e.attrs.slfor.split(":");if(n.length>=4){if(!s._structureForMap.has(n[0])){const r=N(t,e.model[n[2]]);if(s._structureForMap.set(n[0],r),t.children.length>0){let e=Object.create(null);for(let n=0;n=4){let r,o,l,i;for(let t of Object.keys(e.model))i=e.model[t],i.slfor===n[2]?r=i:i.slfor===n[1]?l=i:i.slfor===n[3]&&(o=i);for(let t of O(e.model))i=e.model[t],i.slfor===n[2]?r=i:i.slfor===n[1]?l=i:i.slfor===n[3]&&(o=i);if(l=l.bind(e.model),!s._structureForMap.has(n[0])){const e=N(t,r);if(s._structureForMap.set(n[0],e),t.children.length>0){let n=Object.create(null);for(let e=0;e{s._afterInitArr=[],e.slOnInit&&e.slOnInit();let o=e.view.bind(e)();if(n(o,e),o.view&&(o=o.view.bind(e)(),n(o,e)),!o.attrs||t&&t.id!==o.attrs.id){const e=o.attrs?o.attrs.id:"null";console.error("Mounted component root element changed from "+t.id+" to "+e)}t=I(t,o,e),e.slOnInit&&(t.slOnInit=!0,t.slUnboundOnInit=e.slOnInit),r&&s._updateMap.set(t.id,e),e.slOnDestroy&&h(t,e.slOnDestroy.bind(e),e.slOnDestroy);let l=t.querySelectorAll("[slref]");void 0!==t.slref&&(l=Array.from(l),l.push(t));for(let t=0;t{t()}),t};export function version(){return"21.0.0"}export function resolveAll(t){return Promise.all(t.map(t=>t.then(t=>({result:t,status:"fulfilled",error:null}),t=>({result:null,error:t,status:"rejected"}))))}export function setState(t){s._state=t}export function getState(){return s._state}export function textNode(t){return String(t)}export function markup(t,{attrs:e={},children:n=[]}={}){return{tagName:t=t.toUpperCase(),attrs:e,children:n}}export function m(){return 3===arguments.length&&"string"==typeof arguments[0]&&"object"==typeof arguments[1]&&Array.isArray(arguments[2])?markup(arguments[0],{attrs:arguments[1],children:arguments[2]}):markup(arguments[0],arguments[1])}export function mount(t,e,n=!0){s._router.mountRoute=t;let r=document.getElementById(t);if(null!==r)return b(r,e,n);console.error("ID "+t+" does not exist in DOM.")}export function update(t,e){const r=t;if(t=document.getElementById(t),s._afterInitArr=[],t){let r=e.view.bind(e)();n(r,e),t=I(t,r,e)}else console.error("ID "+r+" not mounted in DOM; attachDetector likely needs to be called.");let o=t.querySelectorAll("[slref]");void 0!==t.slref&&(o=Array.from(o),o.push(t));for(let t=0;t{t()})}let v=e.onpopstate;e.onpopstate=function(t){switch(s._router.strategy){case"#":e.location.hash&&s._router.lastHash!==e.location.hash.substring(2)&&(v&&v(t),route(getRoute()));break;case"?":e.location.search&&s._router.lastHash!==e.location.search.substring(2)&&(v&&v(t),route(getRoute()));break;case"":e.location.pathname&&s._router.lastHash!==e.location.pathname.substring(1)&&(v&&v(t),route(getRoute()))}},s._router={segmentArr:[],routeList:[],params:null,lastHash:!1,currentRoute:null,mountRoute:"",strategy:"#",count:0},Object.seal(s._router);const R=()=>{switch(s._router.strategy){case"#":{let t=e.location.href.split("#/")[1];if(t){let e=t.split("/");e.forEach((t,e)=>{s._router.segmentArr[e]=t}),s._router.segmentArr.splice(e.length,s._router.segmentArr.length)}else s._router.segmentArr.splice(0,s._router.segmentArr.length);break}case"?":{let t=e.location.href.split("?/")[1];if(t){let e=t.split("/");e.forEach((t,e)=>{s._router.segmentArr[e]=t}),s._router.segmentArr.splice(e.length,s._router.segmentArr.length)}else s._router.segmentArr.splice(0,s._router.segmentArr.length);break}case"":{let t=e.location.pathname;if(t){t=t.replace("/","");let e=t.split("/");e.forEach((t,e)=>{s._router.segmentArr[e]=t}),s._router.segmentArr.splice(e.length,s._router.segmentArr.length)}else s._router.segmentArr.splice(0,s._router.segmentArr.length);break}}};export function setRouteStrategy(t){new Set(["#","?",""]).has(t)&&(s._router.strategy=t)}export function getRouteQueryVariables(){const t=e.location.search.substring(2).split("&"),n=[];for(var r=0;r{t.slOnDestroyFn&&n.contains(t)&&t.slOnDestroyFn(),t.slOnDestroyFn=void 0,t.slUnboundOnDestroy=void 0}),s._destroyNodeMap.set(getRoute(),[]),s._destroyFuncMap.set(getRoute(),[])),s._router.lastHash=t;const u=e.pageYOffset;switch(s._router.strategy){case"#":e.history.pushState(null,document.title,"#/"+t);break;case"?":{let n=e.location.href;const r=e.location.pathname;n=n.substring(0,n.indexOf(r)),n+="/?/"+t,e.history.pushState(null,document.title,n);break}case"":{let n=e.location.href;const r=e.location.pathname;n=n.substring(0,n.indexOf(r)),n+="/"+t,e.history.pushState(null,document.title,n);break}}if(e.scrollTo(0,u),s._router.currentRoute&&void 0!==s._router.currentRoute.animateDestroy&&(s._router.currentRoute.animateDestroy=!0),s._router.currentRoute&&s._router.currentRoute.animateDestroy){let t=s._router.currentRoute.root;t=document.getElementById(t),s._router.currentRoute=i,f(t),p(t),r(t),_(t),R()}else R(),s._router.currentRoute=i;s._router.count++,i.component&&(i.component.slOnDestroy&&s._destroyFuncMap.set(t,[i.component.slOnDestroy.bind(i.component)]),s._router.mountRoute=t,b(n,i.component,o),i.component.slOnDestroy&&(n.slOnDestroyIndex=0,s._destroyFuncMap.get(t).pop(),d(n)),l=i.component);break}return s._changeDetector.changeDetectionStrategy===s.CHANGE_STRATEGY_AUTOMATIC&&T(),l}R();const N=(t,e,n)=>({parent:t,factory:e,map:Object.create(null)});function E(t,e,n){"function"==typeof e&&(e=e());const s=Object.create(null),l=t.parent;let i,a,u=l.firstChild;if(e.length){for(let r=0;r0&&(D([t.parent]),D(Array.from(c)))}s.CHANGE_STRATEGY_AUTOMATIC=100,s.CHANGE_STRATEGY_MANUAL=200,s.CHANGE_DETECTOR_DETACHED=!1,s.CHANGE_DETECTOR_ATTACHED=!0,s._changeStrategies=[s.CHANGE_STRATEGY_AUTOMATIC,s.CHANGE_STRATEGY_MANUAL],s._changeDetector={lastUpdateDate:new Date,changeDetectionStrategy:s.CHANGE_STRATEGY_AUTOMATIC},Object.seal(s._changeDetector),Object.freeze(s._changeStrategies);const U=(t,e)=>{if(e[t]){let n=e[t];e[t]=function(){let t=n.apply(this,[].slice.call(arguments));return T(),t}}};const M=(t=null)=>{t?update(t,s._updateMap.get(t)):s._updateMap.forEach((t,e)=>{update(e,t)})},T=()=>{if(s._changeDetector.changeDetectionStrategy!==s.CHANGE_STRATEGY_AUTOMATIC)return;new Date-s._changeDetector.lastUpdateDate>6?M():s._debouncedPerformUpdates(),s._changeDetector.lastUpdateDate=new Date};export function setDetectionStrategy(t){s._changeStrategies.forEach(e=>{e===t&&(s._changeDetector.changeDetectionStrategy=t)})}export function detectChanges(t=null){M(t)}export function isDetectorAttached(t){return s._updateMap.has(t)}export function detachDetector(t){s._updateMap.delete(t)}const x=Promise.prototype.then;export function enableDetectOnThen(){Promise.prototype.then=function(t,e){return x.call(this,e=>(T(),"function"==typeof t&&t instanceof Function?t(e):t),e)}}export function wrapWithChangeDetector(t,e){return function(){e&&e.slpreventdefault&&arguments.length>0&&"function"==typeof arguments[0].preventDefault&&arguments[0].preventDefault();let n=t.apply(this,[].slice.call(arguments));return T(),n}}s._debouncedPerformUpdates=function(t,e){let n;return function(...r){const s=this;clearTimeout(n),n=setTimeout(()=>t.apply(s,r),e)}}(M,17);let C=e.XMLHttpRequest.prototype.send,S=new Map;function w(){if(this._onreadystatechange){let t=S.get(this);if(void 0!==t&&t===this._onreadystatechangecount)return void S.delete(this);void 0!==t?S.set(this,t+1):S.set(this,0);let e=this._onreadystatechange.apply(this,arguments);return T(),S.delete(this),e}}e.XMLHttpRequest.prototype.send=function(t){return this.onreadystatechange?(this._onreadystatechange=this.onreadystatechange,void 0===this._onreadystatechangecount?this._onreadystatechangecount=0:this._onreadystatechangecount+=4):this._onreadystatechangecount=0,this.onreadystatechange=w,C.apply(this,arguments)};let F=e.fetch;e.fetch=function(){let t=F.apply(this,arguments);return T(),t}; \ No newline at end of file +const t="undefined"!=typeof window;var e=t?window:global;t||(e.setTimeout=()=>{},e.setInterval=()=>{},e.location={},e.location.href="",e.fetch=()=>{},e.XMLHttpRequest={},e.XMLHttpRequest.prototype={},e.XMLHttpRequest.prototype.send=()=>{}),e.s=function(){},s._state={},s._destroyFuncMap=new Map,s._updateMap=new Map,s._afterInitArr=[],s._destroyNodeMap=new Map,s._structureForMap=new Map,s._isAnimatingKeyed=null;const n=(t,e)=>{const n=[];let r;for(n.push(t);n.length>0;)if(r=n.shift(),r.attrs&&(r.attrs.slfor||r.attrs.slfornamed)&&(r.model=e),r.children)for(let t=r.children.length-1;t>=0;--t)n.push(r.children[t])},r=t=>{const e=[];let n,r;for(e.push(t);e.length>0;)if(n=e.shift(),3!==n.nodeType&&(n.hasAttribute("slfor")?(r=n.getAttribute("slfor"),r=r.split(":"),r.length>0&&s._structureForMap.delete(r[0])):n.hasAttribute("slfornamed")&&(r=n.getAttribute("slfornamed"),r=r.split(":"),r.length>0&&s._structureForMap.delete(r[0])),n.children))for(let t=n.children.length-1;t>=0;--t)e.push(n.children[t])};export function renderElementWithoutClass(t,e,n){let r,o,l;r=e&&e.slns?document.createElementNS(e.slns,t.toLowerCase()):document.createElement(t);for(let t of Object.keys(e))if(l=e[t],o=typeof l,"function"===o)r[t]=l,s._changeDetector.changeDetectionStrategy!==s.CHANGE_STRATEGY_AUTOMATIC||l.name.startsWith("bound slDetached")||l.name.startsWith("slDetached")||U(t,r);else if("slnsfor"===t){const t=JSON.parse(e.slnsfor);for(const[e,n]of Object.entries(t))r.setAttributeNS(n.namespace,e,n.value)}else r.setAttribute(t,l);for(let t of n)r.append(t);return r}export function renderElement({tagName:t,attrs:e,children:n},r=!1){let o,l;o=e&&e.slns?document.createElementNS(e.slns,t.toLowerCase()):document.createElement(t);for(let[t,n]of Object.entries(e))if(l=typeof n,"function"===l)o[t]=n,s._changeDetector.changeDetectionStrategy!==s.CHANGE_STRATEGY_AUTOMATIC||n.name.startsWith("bound slDetached")||n.name.startsWith("slDetached")||U(t,o);else if("slnsfor"===t){const t=JSON.parse(e.slnsfor);for(const[e,n]of Object.entries(t))o.setAttributeNS(n.namespace,e,n.value)}else o.setAttribute(t,n);for(let t of n)"string"==typeof t?o.append(t):t.view?r?i(t,o):a(t,o):o.appendChild(renderElement(t,r));return o}const o=({tagName:t,attrs:e,children:n})=>{let r,l;r=e&&e.slns?document.createElementNS(e.slns,t.toLowerCase()):document.createElement(t);for(let[t,n]of Object.entries(e))if(l=typeof n,"function"===l)r[t]=n,s._changeDetector.changeDetectionStrategy!==s.CHANGE_STRATEGY_AUTOMATIC||n.name.startsWith("bound slDetached")||n.name.startsWith("slDetached")||U(t,r);else if("slnsfor"===t){const t=JSON.parse(e.slnsfor);for(const[e,n]of Object.entries(t))r.setAttributeNS(n.namespace,e,n.value)}else r.setAttribute(t,n);for(let t of n)"string"==typeof t?r.append(t):t.view?a(t,r):r.appendChild(o(t));return r},l=(t,e)=>{t.slKeyList=[],t.slNamespace={};for(const n in e)t.slNamespace[n]=e[n],t.slKeyList.push(n)},i=(t,e)=>{t=c(t,!0,!0,!0).view;const n=o(t);e.appendChild(n)},a=(t,e,n=!1)=>{Object.getPrototypeOf(t).slDirty=!0;const r=t,i=c(t,!0,!0,!0);t=i.view,i.afterInit&&s._afterInitArr.push(i.afterInit);const a=o(t);i.onInit&&(a.slOnInit=!0),u(a,i.destroyIndex,i.onDestroy,i.slUnboundOnDestroy),d(a),e.appendChild(a),l(a,r),n&&I(a,t,i.model)},u=(t,e,n,r)=>{t.slOnDestroy=!0,t.slOnDestroyIndex=e,t.slOnDestroyFn=n,t.slAfterInit=!0,t.slOnInit=!0,t.slUnboundOnDestroy=r},c=(t,e,r,o=!1,l=null)=>{if(r&&t.slOnInit&&(t.slOnInit(),l&&(l.slOnInit=!0)),l&&l.slKeyList)for(const e of l.slKeyList)void 0===t[e]?t[e]=l.slNamespace[e]:l.slNamespace[e]=t[e];let i=null;if(e&&t.slOnDestroy){let e=s._destroyFuncMap.get(s._router.mountRoute);e||(e=[]),e.push(t.slOnDestroy.bind(t)),s._destroyFuncMap.set(s._router.mountRoute,e),i=e.length-1}const a=t.view.bind(t)();return n(a,t),{view:a,afterInit:t.slAfterInit?t.slAfterInit.bind(t):null,onDestroy:e&&!o||!t.slOnDestroy?null:t.slOnDestroy.bind(t),onInit:!r&&t.slOnInit?t.slOnInit:null,destroyIndex:i,model:t,slUnboundOnDestroy:t.slOnDestroy,slUnboundAfterInit:t.slAfterInit,slUnboundOnInit:t.slOnInit}},d=t=>{if(t&&null!==t.slOnDestroyIndex&&void 0!==t.slOnDestroyIndex&&!t.slOnDestroyRoute){let e=s._destroyNodeMap.get(s._router.mountRoute);e||(e=[]);e.find(e=>e.slOnDestroyIndex===t.slOnDestroyIndex)||e.push(t),s._destroyNodeMap.set(s._router.mountRoute,e),t.slOnDestroyRoute=s._router.mountRoute}},f=t=>{if(t&&t.slOnDestroy){let e=s._destroyFuncMap.get(s._router.mountRoute);e||(e=[]),e.splice(t.slOnDestroyIndex,1),s._destroyFuncMap.set(s._router.mountRoute,e);let n=s._destroyNodeMap.get(s._router.mountRoute);n||(n=[]),n.forEach(e=>{e.slOnDestroyIndex>t.slOnDestroyIndex&&e.slOnDestroyIndex--}),n=n.filter(e=>e.slOnDestroyIndex!==t.slOnDestroyIndex),s._destroyNodeMap.set(s._router.mountRoute,n)}},p=t=>{if(t&&t.children&&t.children.length>0){for(const e of t.children)p(e);t.slOnDestroyFn&&(t.slOnDestroyFn(),t.slOnDestroyFn=void 0,t.slUnboundOnDestroy=void 0)}else t.slOnDestroyFn&&(t.slOnDestroyFn(),t.slOnDestroyFn=void 0,t.slUnboundOnDestroy=void 0)},h=(t,e,n)=>{t.slOnDestroy=!0;let r=s._destroyFuncMap.get(s._router.mountRoute);r||(r=[]),r.push(e),s._destroyFuncMap.set(s._router.mountRoute,r),t.slOnDestroyIndex=r.length-1,t.slOnDestroyFn=e,t.slUnboundOnDestroy=n,d(t)},y=(t,e,n)=>{let r;const o=[];for(let t of e){let e=n[t.name];e?e.length===t.nodeValue.length&&e===t.nodeValue&&delete n[t.name]:o.push(t.nodeName)}o.forEach(e=>{t.removeAttribute(e)}),void 0!==n.slref&&(t.slref=t);const l=n.slpreventdefault;let i=!1;for(let[e,o]of Object.entries(n))if(r=typeof o,"function"===r){if(void 0!==l){let n=e;n.startsWith("on")&&(n=n.substring(2,n.length));const r=t[e];if(r){(Array.isArray(r)?r:[r]).forEach(e=>{t.removeEventListener(n,e)})}t.addEventListener(n,(function(t){t.preventDefault()})),i=!0}t[e]=o,s._changeDetector.changeDetectionStrategy!==s.CHANGE_STRATEGY_AUTOMATIC||o.name.startsWith("bound slDetached")||o.name.startsWith("slDetached")||U(e,t)}else if("slnsfor"===e){const e=JSON.parse(n.slnsfor);for(const[n,r]of Object.entries(e))t.setAttributeNS(r.namespace,n,r.value)}else t.setAttribute(e,o);i||(void 0!==l||e.slpreventdefault)&&D([t])},g=(t,e,n)=>{const i=e.length;let u=0;for(let t=e.length-1;t>=0;--t){let r=null;if(n[t]&&(e[t].slUnboundOnDestroy!==n[t].slOnDestroy&&(void 0!==e[t].slUnboundOnDestroy&&void 0!==e[t].slOnDestroyFn&&e[t].slOnDestroyFn(),f(e[t]),e[t].slOnDestroyFn=void 0,e[t].slOnDestroy=!1),n[t].view)){const o=c(n[t],!1,!1,!1,e[t]);n[t]=o.view;const i=Object.getPrototypeOf(o.model);!0!==i.slDirty&&(o.onInit&&e[t].slOnInit&&(e[t].slOnInit=!1),o.afterInit&&e[t].slAfterInit&&(e[t].slAfterInit=!1),o.onDestroy&&e[t].slOnDestroy&&(e[t].slOnDestroy=!1),i.slDirty=!0),o.onInit&&!e[t].slOnInit&&e[t].slUnboundOnInit!==o.slUnboundOnInit?(e[t].slUnboundOnInit=o.slUnboundOnInit,o.onInit.bind(o.model)(),n[t].slOnInit=!0):void 0===e[t].slUnboundOnInit||o.onInit?o.onInit&&e[t]&&!e[t].slOnInit?(e[t].slUnboundOnInit===o.slUnboundOnInit&&o.onInit.bind(o.model)(),e[t].slUnboundOnInit=o.slUnboundOnInit,n[t].slOnInit=!0):o.onInit&&e[t].slOnInit&&void 0===e[t].slUnboundOnInit&&(e[t].slUnboundOnInit=o.slUnboundOnInit):e[t].slOnInit=!1,o.afterInit&&!e[t].slAfterInit&&e[t].slUnboundAfterInit!==o.slUnboundAfterInit?(e[t].slAfterInit=!0,e[t].slUnboundAfterInit=o.slUnboundAfterInit,s._afterInitArr.push(o.afterInit)):void 0===e[t].slUnboundAfterInit||o.afterInit?o.afterInit&&e[t]&&!e[t].slAfterInit?(e[t].slAfterInit=!0,e[t].slUnboundAfterInit===o.slUnboundAfterInit&&s._afterInitArr.push(o.afterInit),e[t].slUnboundAfterInit=o.slUnboundAfterInit):o.afterInit&&e[t].slAfterInit&&void 0===e[t].slUnboundAfterInit&&(e[t].slUnboundAfterInit=o.slUnboundAfterInit):e[t].slAfterInit=!1,o.onDestroy&&e[t]&&!e[t].slOnDestroy&&h(e[t],o.onDestroy,o.slUnboundOnDestroy),l(e[t],o.model),r=o.model}I(e[t],n[t],r),n[t]&&n[t].slOnInit&&(e[t].slOnInit=!0),u++}let d=e.length;for(;d>i;)f(e[d-1]),p(e[d-1]),r(e[e.length-1]),_(e[d-1]),d--;for(let e of n.slice(i)){if("string"==typeof e)t.childNodes[u]?t.childNodes[u].textContent!==e&&(t.childNodes[u].textContent=e):t.append(e);else if("string"==typeof e)t.append(e);else if(e.view)a(e,t,!0);else{const n=o(e);t.appendChild(n),I(n,e)}u++}for(d=e.length;d>n.length;)f(e[d-1]),p(e[d-1]),r(e[d-1]),_(e[d-1]),d--},_=t=>{const e=s._router.count;if(void 0===t.slanimatedestroytarget||""===t.slanimatedestroytarget||t.slAnimateDestroy||void 0===t.attributes.slanimatedestroy||""===t.getAttribute("slanimatedestroy"))if(3===t.nodeType||void 0===t.attributes.slanimatedestroy||""===t.getAttribute("slanimatedestroy")||t.slAnimateDestroy)t.slAnimateDestroy||(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id));else{const n=t.onanimationend,r=t.onanimationstart,o=t.getAttribute("slanimatedestroy");t.onanimationstart=function(e){t.slAnimationName=e.animationName},t.onanimationend=function(o){if(!t.slAnimationName||t.slAnimationName!==o.animationName)return;let l=void 0;return n&&(l=n.apply(this,[].slice.call(arguments))),(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id)),t.slAnimationName=null,t.onanimationend=n,t.onanimationstart=r,t.slAnimateDestroy=!1,l},t.classList.add(o),t.slAnimateDestroy=!0}else{const n=t.slanimatedestroytarget;if("function"==typeof n){const r=n(t);if(r){const n=r.getAttribute("slanimatedestroy"),o=r.onanimationend,l=r.onanimationstart;r.onanimationstart=function(t){r.slAnimationName=t.animationName},r.onanimationend=function(i){if(!r.slAnimationName||r.slAnimationName!==i.animationName)return;let a=void 0;return o&&(a=o.apply(this,[].slice.call(arguments))),r.classList.remove(n),s._isAnimatingKeyed=null,s._router.currentRoute.animateDestroy?(s._router.currentRoute.animateDestroy=!1,t.setAttribute("style","opacity: 0;"),r.onanimationend=null,r.onanimationstart=null):((s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id)),r.onanimationend=o,r.onanimationstart=l),r.slAnimationName=null,t.slAnimateDestroy=!1,delete t.slanimatedestroytarget,detectChanges(),a},s._isAnimatingKeyed=r,r.classList.add(n),t.slAnimateDestroy=!0}else(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id))}else(s._router.currentRoute&&t.id!==s._router.currentRoute.root||e===s._router.count)&&(t.remove(),s._updateMap.delete(t.id))}},A=t=>t&&t!==Object.prototype&&Object.getOwnPropertyNames(t).filter(e=>((t,e)=>(Object.getOwnPropertyDescriptor(t,e)||{}).get)(t,e)||((t,e)=>"function"==typeof t[e])(t,e)).concat(A(Object.getPrototypeOf(t))||[]),O=t=>(t=>Array.from(new Set(A(t))))(t).filter(t=>"constructor"!==t&&!~t.indexOf("__")),D=t=>{for(let e=0;e{n.removeEventListener(e,t)})}n.addEventListener(e,(function(t){t.preventDefault()}))}}},I=(t,e,n=null)=>{if(null!==s._isAnimatingKeyed)for(let[e,n]of s._updateMap){const n=document.getElementById(e);if(n.contains(s._isAnimatingKeyed)&&n.contains(t))return t}if(e&&e.view){t.slUnboundOnDestroy!==e.slOnDestroy&&(void 0!==t.slUnboundOnDestroy&&void 0!==t.slOnDestroyFn&&t.slOnDestroyFn(),f(t),t.slOnDestroyFn=void 0,t.slOnDestroy=!1);const n=c(e,!1,!1,!1,t);e=n.view;const r=Object.getPrototypeOf(n.model);!0!==r.slDirty&&(n.onInit&&t.slOnInit&&(t.slOnInit=!1),n.afterInit&&t.slAfterInit&&(t.slAfterInit=!1),n.onDestroy&&t.slOnDestroy&&(t.slOnDestroy=!1),r.slDirty=!0),n.onInit&&t&&!t.slOnInit&&(n.onInit.bind(n.model)(),t.slOnInit=!0),n.afterInit&&t&&!t.slAfterInit&&(t.slAfterInit=!0,t.slUnboundAfterInit=n.slUnboundAfterInit,s._afterInitArr.push(n.afterInit)),n.onDestroy&&t&&!t.slOnDestroy&&h(t,n.onDestroy,n.slUnboundOnDestroy)}if(!e)return t&&(f(t),p(t),r(t),_(t)),t;if(t&&(t.tagName||"").toLowerCase()!==((e?e.tagName:void 0)||"").toLowerCase()){if(!e.tagName)return f(t),p(t),t.replaceWith(e),t=e;{let n;n=e.attrs&&e.attrs.slns?document.createElementNS(e.attrs.slns,e.tagName.toLowerCase()):document.createElement(e.tagName),t.parentNode.insertBefore(n,t),f(t),p(t),r(t),_(t),n.slUnboundAfterInit=t.slUnboundAfterInit,void 0!==n.slUnboundAfterInit&&(n.slAfterInit=!0),t.slOnInit&&(n.slOnInit=!1),t=n}}if("string"==typeof e)return t.textContent!==e&&(t.textContent=e),t;switch(e.attrs.sldirective){case"useexisting":return t;case"onlychildren":return g(t,t.childNodes,e.children),t;case"onlyself":return y(t,t.attributes,e.attrs),t;case"trustchildren":{y(t,t.attributes,e.attrs);let n="";e.children.forEach(t=>{n+=t}),t.innerHTML!==n&&(t.innerHTML=n);const r=t.querySelectorAll("[slpreventdefault]");return r.length>0&&D(Array.from(r)),t}}if(e.attrs.slfor){const n=e.attrs.slfor.split(":");if(n.length>=4){if(!s._structureForMap.has(n[0])){const r=N(t,e.model[n[2]]);if(s._structureForMap.set(n[0],r),t.children.length>0){let e=Object.create(null);for(let n=0;n=4){let r,o,l,i;for(let t of Object.keys(e.model))i=e.model[t],i.slfor===n[2]?r=i:i.slfor===n[1]?l=i:i.slfor===n[3]&&(o=i);for(let t of O(e.model))i=e.model[t],i.slfor===n[2]?r=i:i.slfor===n[1]?l=i:i.slfor===n[3]&&(o=i);if(l=l.bind(e.model),!s._structureForMap.has(n[0])){const e=N(t,r);if(s._structureForMap.set(n[0],e),t.children.length>0){let n=Object.create(null);for(let e=0;e{s._afterInitArr=[],e.slOnInit&&e.slOnInit();let o=e.view.bind(e)();if(n(o,e),o.view&&(o=o.view.bind(e)(),n(o,e)),!o.attrs||t&&t.id!==o.attrs.id){const e=o.attrs?o.attrs.id:"null";console.error("Mounted component root element changed from "+t.id+" to "+e)}t=I(t,o,e),e.slOnInit&&(t.slOnInit=!0,t.slUnboundOnInit=e.slOnInit),r&&s._updateMap.set(t.id,e),e.slOnDestroy&&h(t,e.slOnDestroy.bind(e),e.slOnDestroy);let l=t.querySelectorAll("[slref]");void 0!==t.slref&&(l=Array.from(l),l.push(t));for(let t=0;t{t()}),t};export function version(){return"21.0.1"}export function resolveAll(t){return Promise.all(t.map(t=>t.then(t=>({result:t,status:"fulfilled",error:null}),t=>({result:null,error:t,status:"rejected"}))))}export function setState(t){s._state=t}export function getState(){return s._state}export function textNode(t){return String(t)}export function markup(t,{attrs:e={},children:n=[]}={}){return{tagName:t=t.toUpperCase(),attrs:e,children:n}}export function m(){return 3===arguments.length&&"string"==typeof arguments[0]&&"object"==typeof arguments[1]&&Array.isArray(arguments[2])?markup(arguments[0],{attrs:arguments[1],children:arguments[2]}):markup(arguments[0],arguments[1])}export function mount(t,e,n=!0){s._router.mountRoute=t;let r=document.getElementById(t);if(null!==r)return b(r,e,n);console.error("ID "+t+" does not exist in DOM.")}export function update(t,e){const r=t;if(t=document.getElementById(t),s._afterInitArr=[],t){let r=e.view.bind(e)();n(r,e),t=I(t,r,e)}else console.error("ID "+r+" not mounted in DOM; attachDetector likely needs to be called.");let o=t.querySelectorAll("[slref]");void 0!==t.slref&&(o=Array.from(o),o.push(t));for(let t=0;t{t()})}let v=e.onpopstate;e.onpopstate=function(t){switch(s._router.strategy){case"#":e.location.hash&&s._router.lastHash!==e.location.hash.substring(2)&&(v&&v(t),route(getRoute()));break;case"?":e.location.search&&s._router.lastHash!==e.location.search.substring(2)&&(v&&v(t),route(getRoute()));break;case"":e.location.pathname&&s._router.lastHash!==e.location.pathname.substring(1)&&(v&&v(t),route(getRoute()))}},s._router={segmentArr:[],routeList:[],params:null,lastHash:!1,currentRoute:null,mountRoute:"",strategy:"#",count:0},Object.seal(s._router);const R=()=>{switch(s._router.strategy){case"#":{let t=e.location.href.split("#/")[1];if(t){let e=t.split("/");e.forEach((t,e)=>{s._router.segmentArr[e]=t}),s._router.segmentArr.splice(e.length,s._router.segmentArr.length)}else s._router.segmentArr.splice(0,s._router.segmentArr.length);break}case"?":{let t=e.location.href.split("?/")[1];if(t){let e=t.split("/");e.forEach((t,e)=>{s._router.segmentArr[e]=t}),s._router.segmentArr.splice(e.length,s._router.segmentArr.length)}else s._router.segmentArr.splice(0,s._router.segmentArr.length);break}case"":{let t=e.location.pathname;if(t){t=t.replace("/","");let e=t.split("/");e.forEach((t,e)=>{s._router.segmentArr[e]=t}),s._router.segmentArr.splice(e.length,s._router.segmentArr.length)}else s._router.segmentArr.splice(0,s._router.segmentArr.length);break}}};export function setRouteStrategy(t){new Set(["#","?",""]).has(t)&&(s._router.strategy=t)}export function getRouteQueryVariables(){const t=e.location.search.substring(2).split("&"),n=[];for(var r=0;r{t.slOnDestroyFn&&n.contains(t)&&t.slOnDestroyFn(),t.slOnDestroyFn=void 0,t.slUnboundOnDestroy=void 0}),s._destroyNodeMap.set(getRoute(),[]),s._destroyFuncMap.set(getRoute(),[])),s._router.lastHash=t;const u=e.pageYOffset;switch(s._router.strategy){case"#":e.history.pushState(null,document.title,"#/"+t);break;case"?":{let n=e.location.href;const r=e.location.pathname;n=n.substring(0,n.indexOf(r)),n+="/?/"+t,e.history.pushState(null,document.title,n);break}case"":{let n=e.location.href;const r=e.location.pathname;n=n.substring(0,n.indexOf(r)),n+="/"+t,e.history.pushState(null,document.title,n);break}}if(e.scrollTo(0,u),s._router.currentRoute&&void 0!==s._router.currentRoute.animateDestroy&&(s._router.currentRoute.animateDestroy=!0),s._router.currentRoute&&s._router.currentRoute.animateDestroy){let t=s._router.currentRoute.root;t=document.getElementById(t),s._router.currentRoute=i,f(t),p(t),r(t),_(t),R()}else R(),s._router.currentRoute=i;s._router.count++,i.component&&(i.component.slOnDestroy&&s._destroyFuncMap.set(t,[i.component.slOnDestroy.bind(i.component)]),s._router.mountRoute=t,b(n,i.component,o),i.component.slOnDestroy&&(n.slOnDestroyIndex=0,s._destroyFuncMap.get(t).pop(),d(n)),l=i.component);break}return s._changeDetector.changeDetectionStrategy===s.CHANGE_STRATEGY_AUTOMATIC&&T(),l}R();const N=(t,e,n)=>({parent:t,factory:e,map:Object.create(null)});function E(t,e,n){"function"==typeof e&&(e=e());const s=Object.create(null),l=t.parent;let i,a,u=l.firstChild;if(e.length){for(let r=0;r0&&(D([t.parent]),D(Array.from(c)))}s.CHANGE_STRATEGY_AUTOMATIC=100,s.CHANGE_STRATEGY_MANUAL=200,s.CHANGE_DETECTOR_DETACHED=!1,s.CHANGE_DETECTOR_ATTACHED=!0,s._changeStrategies=[s.CHANGE_STRATEGY_AUTOMATIC,s.CHANGE_STRATEGY_MANUAL],s._changeDetector={lastUpdateDate:new Date,changeDetectionStrategy:s.CHANGE_STRATEGY_AUTOMATIC},Object.seal(s._changeDetector),Object.freeze(s._changeStrategies);const U=(t,e)=>{if(e[t]){let n=e[t];e[t]=function(){let t=n.apply(this,[].slice.call(arguments));return T(),t}}};const M=(t=null)=>{t?update(t,s._updateMap.get(t)):s._updateMap.forEach((t,e)=>{update(e,t)})},T=()=>{if(s._changeDetector.changeDetectionStrategy!==s.CHANGE_STRATEGY_AUTOMATIC)return;new Date-s._changeDetector.lastUpdateDate>6?M():s._debouncedPerformUpdates(),s._changeDetector.lastUpdateDate=new Date};export function setDetectionStrategy(t){s._changeStrategies.forEach(e=>{e===t&&(s._changeDetector.changeDetectionStrategy=t)})}export function detectChanges(t=null){M(t)}export function isDetectorAttached(t){return s._updateMap.has(t)}export function detachDetector(t){s._updateMap.delete(t)}const x=Promise.prototype.then;export function enableDetectOnThen(){Promise.prototype.then=function(t,e){return x.call(this,e=>(T(),"function"==typeof t&&t instanceof Function?t(e):t),e)}}export function wrapWithChangeDetector(t,e){return function(){e&&e.slpreventdefault&&arguments.length>0&&"function"==typeof arguments[0].preventDefault&&arguments[0].preventDefault();let n=t.apply(this,[].slice.call(arguments));return T(),n}}s._debouncedPerformUpdates=function(t,e){let n;return function(...r){const s=this;clearTimeout(n),n=setTimeout(()=>t.apply(s,r),e)}}(M,17);let C=e.XMLHttpRequest.prototype.send,S=new Map;function w(){if(this._onreadystatechange){let t=S.get(this);if(void 0!==t&&t===this._onreadystatechangecount)return void S.delete(this);void 0!==t?S.set(this,t+1):S.set(this,0);let e=this._onreadystatechange.apply(this,arguments);return T(),S.delete(this),e}}e.XMLHttpRequest.prototype.send=function(t){return this.onreadystatechange?(this._onreadystatechange=this.onreadystatechange,void 0===this._onreadystatechangecount?this._onreadystatechangecount=0:this._onreadystatechangecount+=4):this._onreadystatechangecount=0,this.onreadystatechange=w,C.apply(this,arguments)};let F=e.fetch;e.fetch=function(){let t=F.apply(this,arguments);return T(),t}; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index bbfd062..89e5c53 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sling.js", - "version": "21.0.0", + "version": "21.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "sling.js", - "version": "21.0.0", + "version": "21.0.1", "license": "ISC", "devDependencies": { "@babel/cli": "^7.2.3", diff --git a/package.json b/package.json index 3bc99e8..cf5bd95 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sling.js", - "version": "21.0.0", + "version": "21.0.1", "description": "Client-side JavaScript framework for building Single Page Applications.", "main": "index.js", "scripts": { diff --git a/src/sling/core/sling.js b/src/sling/core/sling.js index 24669ae..a17d36c 100644 --- a/src/sling/core/sling.js +++ b/src/sling/core/sling.js @@ -203,8 +203,8 @@ export function renderElementWithoutClass(tagName, attrs, children) { value.value ); } - } - el.setAttribute(k, v); + } + else el.setAttribute(k, v); } for (let child of children) { @@ -1184,7 +1184,7 @@ const _mountInternal = (target, component, attachDetector) => { } export function version() { - return '21.0.0'; + return '21.0.1'; } function xmur3(str) { diff --git a/src/sling/core/sling.slim.js b/src/sling/core/sling.slim.js index 274f807..74ef268 100644 --- a/src/sling/core/sling.slim.js +++ b/src/sling/core/sling.slim.js @@ -1116,7 +1116,7 @@ const _mountInternal = (target, component, attachDetector) => { } export function version() { - return '21.0.0'; + return '21.0.1'; } export function resolveAll(promiseArr) {