New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lucia

Package Overview
Dependencies
Maintainers
1
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lucia - npm Package Compare versions

Comparing version 0.4.5 to 0.4.6-0

5

dist/legacy/lucia.cjs.js

@@ -194,3 +194,3 @@ 'use strict';

if (value) {
return typeof value === 'function' ? value() : value;
return typeof value === 'function' ? state[expression]() : value;
} else {

@@ -663,6 +663,5 @@ var emit = function emit(name, options, dispatchGlobal) {

adjustDeps(ast, data.deps, node, 'for');
setElementCustomProp(el, '__l_for_ast', compile(el, state));
}
render(getElementCustomProp(el, '__l_for_ast'), directives, state, node.deps);
render(compile(el, state), directives, state, node.deps);
};

@@ -669,0 +668,0 @@

2

dist/legacy/lucia.cjs.min.js

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=function(){return(t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function e(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function n(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(r(arguments[e]));return t}var i;!function(t){t["@"]="on",t[":"]="bind"}(i||(i={}));var o=function(t){return new RegExp("\\b"+t+"\\b","gim")};function a(t){return(a="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)}var l=function(t){return t.replace(/\s+/gim," ").trim()},u=function(t,e){return t[e]},s=function(t,e,r){return t[e]=r},c=function(t){return n(new Set(t))},f=function(t,e,r){var n="with($state){"+(null==r||r?"return "+t:t)+"}";return function(r,i){try{var o=r[t];if(o)return"function"==typeof o?o():o;return new Function("$state","$el","$emit","$event",n)(r,e,(function(t,r,n){void 0===n&&(n=!0);var i=new CustomEvent(t,r);(n?document:e||document).dispatchEvent(i)}),i)}catch(r){console.warn('Lucia Error: "'+r+'"\n\nExpression: "'+t+'"\nElement:',e)}}},v=function(t){return t.hasAttribute("l-for")},d=function(t,e){var n=r(p(t,e),2),i=n[0],a=n[1],l=Object.keys(i).length>0,u=Object.values(i).some((function(t){var r=t.value;return Object.keys(e).some((function(t){return o(t).test(r)}))}));return l?{el:t,deps:a,directives:i,type:u?1:0}:null},p=function(t,r){var a,l;void 0===r&&(r={});var v={},d=[],p=function(e,a){var l="l-state"===e,p=e.startsWith("l-"),y=Object.keys(i).some((function(t){return e.startsWith(t)}));if(l||!p&&!y)return"continue";var h=[],m=Object.keys(r),b=!0,g=m.filter((function(t){var e=o(t).test(String(a));if("function"==typeof r[t]&&e){var i=m.filter((function(e){return o(e).test(String(r[t]))}));h.push.apply(h,n(i))}return e}));/on|@/gim.test(e)&&(b=!1),e.includes("for")&&void 0===u(t,"__l_for_template")&&(s(t,"__l_for_template",String(t.innerHTML).trim()),b=!1);var _=c(n(g,h));d.push.apply(d,n(_));var x={compute:f(a,t,b),deps:_,value:a},j=p?e.slice("l-".length):i[e[0]]+":"+e.slice(1);v[j]=x};try{for(var y=e(t.attributes),h=y.next();!h.done;h=y.next()){var m=h.value;p(m.name,m.value)}}catch(t){a={error:t}}finally{try{h&&!h.done&&(l=y.return)&&l.call(y)}finally{if(a)throw a.error}}return[v,c(d)]},y=function t(r,i,o){var a,l;void 0===i&&(i=!1),void 0===o&&(o=!1);var u,s=[],c=v(r),f=!!(u=r).parentElement&&u.parentElement.hasAttribute("l-for");if(!i&&(c||f))return s;if(o||i&&c||s.push(r),i||!c&&!f)try{for(var d=e(r.childNodes),p=d.next();!p.done;p=d.next()){var y=p.value;if(y.nodeType===Node.ELEMENT_NODE)if(!i&&v(y))s.push(y);else{if(y.hasAttribute("l-state"))continue;s.push.apply(s,n(t(y,i)))}}}catch(t){a={error:t}}finally{try{p&&!p.done&&(l=d.return)&&l.call(d)}finally{if(a)throw a.error}}return s},h=function(t,r,n){var o,a;if(void 0===r&&(r={}),void 0===n&&(n=!1),!t)throw new Error("Please provide a HTMLElement");var l=[],s=void 0!==u(t,"__l")&&v(t),c=y(t,s,n);try{for(var f=e(c),p=f.next();!p.done;p=f.next()){var h=p.value;if(h.hasAttribute("l-mask")&&h.removeAttribute("l-mask"),new RegExp("(l-|"+Object.keys(i).join("|")+")\\w+","gim").test(h.outerHTML)){var m=d(h,r);m&&l.push(m)}}}catch(t){o={error:t}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}return l},m=function(t,n,i,o){void 0===i&&(i={}),void 0===o&&(o=[]),"string"==typeof o&&(o=[o]);for(var a=Object.keys(n),l=function(l){var u,s,c=t[l];if(-1===c.type)return"continue";var f=0===c.type;if(f&&(c.type=-1),!o.some((function(t){return c.deps.includes(t)}))&&!f)return"continue";var v=function(t,e){var r=t.split(/:|\./)[0];if(!a.includes(r.toUpperCase()))return"continue";var l=o.some((function(t){return e.deps.includes(t)})),u="l-mask"===t,s=0===Object.keys(e.deps).length;if(l||f||s){var v={el:c.el,name:t,data:e,node:c,state:i};_(v,n),(s||u)&&(delete c.directives[t],u&&c.el.removeAttribute("l-mask"))}};try{for(var d=(u=void 0,e(Object.entries(c.directives))),p=d.next();!p.done;p=d.next()){var y=r(p.value,2);v(y[0],y[1])}}catch(t){u={error:t}}finally{try{p&&!p.done&&(s=d.return)&&s.call(d)}finally{if(u)throw u.error}}},u=0;u<t.length;u++)l(u)},b=function(t,r,i,o){var a,l,u=[];try{for(var s=e(t),f=s.next();!f.done;f=s.next()){var v=f.value;u.push.apply(u,n(v.deps))}}catch(t){a={error:t}}finally{try{f&&!f.done&&(l=s.return)&&l.call(s)}finally{if(a)throw a.error}}var d=c(n(r,u));i.deps=d,i.directives[o].deps=d},g={BIND:function(t){var e=t.el,r=t.name,n=t.data,i=t.state;switch(r.split(":")[1]){case"class":var o=n.compute(i);if("string"==typeof o)return e.setAttribute("class",l(e.className+" "+o));if(o instanceof Array)return e.setAttribute("class",l(e.className+" "+o.join(" ")));var u=[];for(var s in o)o[s]&&u.push(s);var c=new RegExp("\\b"+Object.keys(o).join("|")+"\\b","gim"),f=e.className.replace(c,"");if(u.length>0)return e.setAttribute("class",l(f+" "+u.join(" ")));if(l(f).length>0)return e.setAttribute("class",l(f));if(e.hasAttribute("class"))return e.removeAttribute("class");break;case"style":var v=n.compute(i);for(var s in e.removeAttribute("style"),v)e.style[s]=v[s];break;default:var d=n.compute(i);if("object"===a(d)&&null!==d)for(var s in d)d[s]?e.setAttribute(s,d[s]):e.removeAttribute(s);else d?e.setAttribute(r.split(":")[1],d):e.removeAttribute(r.split(":")[1])}},HTML:function(t){var e,r=t.el,n=t.data,i=t.state,o=t.node;o=o;var a=u(r,"__l");r.innerHTML=null!==(e=n.compute(i))&&void 0!==e?e:n.value;var l=h(r,i,!0);a||b(l,n.deps,o,"html"),m(l,g,i,n.deps),s(r,"__l",!0)},MODEL:function(t){var e=t.el,r=t.name,n=t.data,i=t.state,o=e,a=i[n.value],l="checkbox"===o.type?"checked":"value";if(o[l]!==String(a)&&(o[l]=a),!u(o,"__l_model_registered")){var c=r.split(".")[1];o.addEventListener("debounce"===c?"change":"input",(function(){return function(t,e,r,n){"checkbox"===t.type&&(t.value=String(t.checked));var i,o="number"==typeof e&&!isNaN(t.value),a="boolean"==typeof e&&("true"===t.value||"false"===t.value),l=null==e&&("null"===t.value||"undefined"===t.value);return i=o?parseFloat(t.value):a?"true"===t.value:l?"null"===t.value?null:void 0:String(t.value),n[r.value]=i,i}(o,a,n,i)})),s(o,"__l_model_registered",!0)}},ON:function(t){var e=t.el,n=t.name,i=t.data,o=t.state,a={};if(!u(e,"__l_on_registered")){var l=r(n.split(/:|\./gim)),c=l[1],f=l.slice(2),v=["outside","global"].some((function(t){return String(f).includes(t)}))?window:e;a.once=f.includes("once"),a.passive=f.includes("passive"),v.addEventListener(c,(function(t){if(f.includes("prevent")&&t.preventDefault(),f.includes("stop")&&t.stopPropagation(),f.includes("outside")){if(e.contains(t.target))return;if(e.offsetWidth<1&&e.offsetHeight<1)return}i.compute(o,t)}),a),s(e,"__l_on_registered",!0)}},TEXT:function(t){var e,r=t.el,n=t.data,i=t.state;r.textContent=null!==(e=n.compute(i))&&void 0!==e?e:n.value},FOR:function(t){var e=t.el,n=t.data,i=t.state,a=t.node;a=a;var l=u(e,"__l");s(e,"__l",!0);var c=r(n.value.split(/\s+(?:in|of)\s+/gim),2),f=c[0],v=c[1],d=r(null==f?void 0:f.trim().replace(/\(|\)/gim,"").split(","),2),p=d[0],y=d[1],_=i[null==v?void 0:v.trim()],x=h(e,i),j=u(e,"__l_for_template");e.innerHTML.trim()===j&&(e.innerHTML="");var w=(null==_?void 0:_.length)-e.children.length;if(0===(null==_?void 0:_.length))e.innerHTML="";else if(0!==w)for(var O=Math.abs(w);O>0;O--)if(w<0)e.removeChild(e.lastChild);else{var A=j.startsWith("<th")?"thead":j.startsWith("<td")||j.startsWith("<tr")?"tbody":"div",E=document.createElement(A),k=j;p&&(k=k.replace(o("this\\."+p.trim()),v+"["+(_.length-O)+"]")),y&&(k=k.replace(o("this\\."+y.trim()),String(_.length-O))),E.innerHTML=k,e.appendChild(E.firstElementChild)}l||(b(x,n.deps,a,"for"),s(e,"__l_for_ast",h(e,i))),m(u(e,"__l_for_ast"),g,i,a.deps)}},_=function(t,e){e[t.name.split(/:|\./gim)[0].toUpperCase()](t)},x=function(t,e){var r={get:function(t,e){return"object"===a(t[e])&&null!==t[e]?new Proxy(t[e],r):t[e]},set:function(r,n,i){if("function"==typeof t[n])return!1;var o=!isNaN(Number(n))||"length"===n,l=[n];return r instanceof Array&&o?l=Object.keys(t).filter((function(e){return n=t[e],i=r,n instanceof Array&&i instanceof Array&&n.length===i.length&&n.every((function(t,e){return t===i[e]}));var n,i})):Object.keys(t).some((function(t){return void 0===r[t]}))&&(l=Object.keys(t).filter((function(e){return"object"===a(t[e])}))),r[n]=i,e(l),!0}};return Proxy.revocable(Object.seal(t),r)},j=function(){function e(t){void 0===t&&(t={}),this.state=t,this.directives={}}return e.prototype.mount=function(e,r){var n=this;void 0===r&&(r=!0);var i="string"==typeof e?document.querySelector(e):e;return this.ast=h(i,this.state),this.state=t(t({},this.state),{$render:function(t){return void 0===t&&(t=Object.keys(n.state)),n.render(t)}}),this.state=r?x(this.state,this.render.bind(this)).proxy:this.state,this.directives=t(t({},this.directives),g),this.render(),s(i,"__l",this),this.state},e.prototype.directive=function(t,e){this.directives[t.toUpperCase()]=e},e.prototype.render=function(t){void 0===t&&(t=Object.keys(this.state)),m(this.ast,g,this.state,t)},e}(),w=function(t){return new j(t)};exports.compile=h,exports.component=w,exports.computeExpression=f,exports.directives=g,exports.init=function(t){var r,i;void 0===t&&(t=document);var o="l-state",a=n(t.querySelectorAll("[l-state]")).filter((function(t){return void 0===u(t,"__l")}));try{for(var l=e(a),s=l.next();!s.done;s=l.next()){var c=s.value,v=c.getAttribute(o),d=c.getAttribute("l-init"),p=f(""+(v||"{}"),c,!0)({});w(p).mount(c);var y=d?f(""+d,c,!0):void 0;y&&y(p)}}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}},exports.reactive=x,exports.render=m;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=function(){return(t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function e(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function n(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(r(arguments[e]));return t}var i;!function(t){t["@"]="on",t[":"]="bind"}(i||(i={}));var o=function(t){return new RegExp("\\b"+t+"\\b","gim")};function a(t){return(a="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)}var l=function(t){return t.replace(/\s+/gim," ").trim()},u=function(t,e){return t[e]},s=function(t,e,r){return t[e]=r},c=function(t){return n(new Set(t))},f=function(t,e,r){var n="with($state){"+(null==r||r?"return "+t:t)+"}";return function(r,i){try{var o=r[t];if(o)return"function"==typeof o?r[t]():o;return new Function("$state","$el","$emit","$event",n)(r,e,(function(t,r,n){void 0===n&&(n=!0);var i=new CustomEvent(t,r);(n?document:e||document).dispatchEvent(i)}),i)}catch(r){console.warn('Lucia Error: "'+r+'"\n\nExpression: "'+t+'"\nElement:',e)}}},v=function(t){return t.hasAttribute("l-for")},d=function(t,e){var n=r(p(t,e),2),i=n[0],a=n[1],l=Object.keys(i).length>0,u=Object.values(i).some((function(t){var r=t.value;return Object.keys(e).some((function(t){return o(t).test(r)}))}));return l?{el:t,deps:a,directives:i,type:u?1:0}:null},p=function(t,r){var a,l;void 0===r&&(r={});var v={},d=[],p=function(e,a){var l="l-state"===e,p=e.startsWith("l-"),y=Object.keys(i).some((function(t){return e.startsWith(t)}));if(l||!p&&!y)return"continue";var h=[],m=Object.keys(r),b=!0,g=m.filter((function(t){var e=o(t).test(String(a));if("function"==typeof r[t]&&e){var i=m.filter((function(e){return o(e).test(String(r[t]))}));h.push.apply(h,n(i))}return e}));/on|@/gim.test(e)&&(b=!1),e.includes("for")&&void 0===u(t,"__l_for_template")&&(s(t,"__l_for_template",String(t.innerHTML).trim()),b=!1);var _=c(n(g,h));d.push.apply(d,n(_));var x={compute:f(a,t,b),deps:_,value:a},j=p?e.slice("l-".length):i[e[0]]+":"+e.slice(1);v[j]=x};try{for(var y=e(t.attributes),h=y.next();!h.done;h=y.next()){var m=h.value;p(m.name,m.value)}}catch(t){a={error:t}}finally{try{h&&!h.done&&(l=y.return)&&l.call(y)}finally{if(a)throw a.error}}return[v,c(d)]},y=function t(r,i,o){var a,l;void 0===i&&(i=!1),void 0===o&&(o=!1);var u,s=[],c=v(r),f=!!(u=r).parentElement&&u.parentElement.hasAttribute("l-for");if(!i&&(c||f))return s;if(o||i&&c||s.push(r),i||!c&&!f)try{for(var d=e(r.childNodes),p=d.next();!p.done;p=d.next()){var y=p.value;if(y.nodeType===Node.ELEMENT_NODE)if(!i&&v(y))s.push(y);else{if(y.hasAttribute("l-state"))continue;s.push.apply(s,n(t(y,i)))}}}catch(t){a={error:t}}finally{try{p&&!p.done&&(l=d.return)&&l.call(d)}finally{if(a)throw a.error}}return s},h=function(t,r,n){var o,a;if(void 0===r&&(r={}),void 0===n&&(n=!1),!t)throw new Error("Please provide a HTMLElement");var l=[],s=void 0!==u(t,"__l")&&v(t),c=y(t,s,n);try{for(var f=e(c),p=f.next();!p.done;p=f.next()){var h=p.value;if(h.hasAttribute("l-mask")&&h.removeAttribute("l-mask"),new RegExp("(l-|"+Object.keys(i).join("|")+")\\w+","gim").test(h.outerHTML)){var m=d(h,r);m&&l.push(m)}}}catch(t){o={error:t}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}return l},m=function(t,n,i,o){void 0===i&&(i={}),void 0===o&&(o=[]),"string"==typeof o&&(o=[o]);for(var a=Object.keys(n),l=function(l){var u,s,c=t[l];if(-1===c.type)return"continue";var f=0===c.type;if(f&&(c.type=-1),!o.some((function(t){return c.deps.includes(t)}))&&!f)return"continue";var v=function(t,e){var r=t.split(/:|\./)[0];if(!a.includes(r.toUpperCase()))return"continue";var l=o.some((function(t){return e.deps.includes(t)})),u="l-mask"===t,s=0===Object.keys(e.deps).length;if(l||f||s){var v={el:c.el,name:t,data:e,node:c,state:i};_(v,n),(s||u)&&(delete c.directives[t],u&&c.el.removeAttribute("l-mask"))}};try{for(var d=(u=void 0,e(Object.entries(c.directives))),p=d.next();!p.done;p=d.next()){var y=r(p.value,2);v(y[0],y[1])}}catch(t){u={error:t}}finally{try{p&&!p.done&&(s=d.return)&&s.call(d)}finally{if(u)throw u.error}}},u=0;u<t.length;u++)l(u)},b=function(t,r,i,o){var a,l,u=[];try{for(var s=e(t),f=s.next();!f.done;f=s.next()){var v=f.value;u.push.apply(u,n(v.deps))}}catch(t){a={error:t}}finally{try{f&&!f.done&&(l=s.return)&&l.call(s)}finally{if(a)throw a.error}}var d=c(n(r,u));i.deps=d,i.directives[o].deps=d},g={BIND:function(t){var e=t.el,r=t.name,n=t.data,i=t.state;switch(r.split(":")[1]){case"class":var o=n.compute(i);if("string"==typeof o)return e.setAttribute("class",l(e.className+" "+o));if(o instanceof Array)return e.setAttribute("class",l(e.className+" "+o.join(" ")));var u=[];for(var s in o)o[s]&&u.push(s);var c=new RegExp("\\b"+Object.keys(o).join("|")+"\\b","gim"),f=e.className.replace(c,"");if(u.length>0)return e.setAttribute("class",l(f+" "+u.join(" ")));if(l(f).length>0)return e.setAttribute("class",l(f));if(e.hasAttribute("class"))return e.removeAttribute("class");break;case"style":var v=n.compute(i);for(var s in e.removeAttribute("style"),v)e.style[s]=v[s];break;default:var d=n.compute(i);if("object"===a(d)&&null!==d)for(var s in d)d[s]?e.setAttribute(s,d[s]):e.removeAttribute(s);else d?e.setAttribute(r.split(":")[1],d):e.removeAttribute(r.split(":")[1])}},HTML:function(t){var e,r=t.el,n=t.data,i=t.state,o=t.node;o=o;var a=u(r,"__l");r.innerHTML=null!==(e=n.compute(i))&&void 0!==e?e:n.value;var l=h(r,i,!0);a||b(l,n.deps,o,"html"),m(l,g,i,n.deps),s(r,"__l",!0)},MODEL:function(t){var e=t.el,r=t.name,n=t.data,i=t.state,o=e,a=i[n.value],l="checkbox"===o.type?"checked":"value";if(o[l]!==String(a)&&(o[l]=a),!u(o,"__l_model_registered")){var c=r.split(".")[1];o.addEventListener("debounce"===c?"change":"input",(function(){return function(t,e,r,n){"checkbox"===t.type&&(t.value=String(t.checked));var i,o="number"==typeof e&&!isNaN(t.value),a="boolean"==typeof e&&("true"===t.value||"false"===t.value),l=null==e&&("null"===t.value||"undefined"===t.value);return i=o?parseFloat(t.value):a?"true"===t.value:l?"null"===t.value?null:void 0:String(t.value),n[r.value]=i,i}(o,a,n,i)})),s(o,"__l_model_registered",!0)}},ON:function(t){var e=t.el,n=t.name,i=t.data,o=t.state,a={};if(!u(e,"__l_on_registered")){var l=r(n.split(/:|\./gim)),c=l[1],f=l.slice(2),v=["outside","global"].some((function(t){return String(f).includes(t)}))?window:e;a.once=f.includes("once"),a.passive=f.includes("passive"),v.addEventListener(c,(function(t){if(f.includes("prevent")&&t.preventDefault(),f.includes("stop")&&t.stopPropagation(),f.includes("outside")){if(e.contains(t.target))return;if(e.offsetWidth<1&&e.offsetHeight<1)return}i.compute(o,t)}),a),s(e,"__l_on_registered",!0)}},TEXT:function(t){var e,r=t.el,n=t.data,i=t.state;r.textContent=null!==(e=n.compute(i))&&void 0!==e?e:n.value},FOR:function(t){var e=t.el,n=t.data,i=t.state,a=t.node;a=a;var l=u(e,"__l");s(e,"__l",!0);var c=r(n.value.split(/\s+(?:in|of)\s+/gim),2),f=c[0],v=c[1],d=r(null==f?void 0:f.trim().replace(/\(|\)/gim,"").split(","),2),p=d[0],y=d[1],_=i[null==v?void 0:v.trim()],x=h(e,i),j=u(e,"__l_for_template");e.innerHTML.trim()===j&&(e.innerHTML="");var w=(null==_?void 0:_.length)-e.children.length;if(0===(null==_?void 0:_.length))e.innerHTML="";else if(0!==w)for(var O=Math.abs(w);O>0;O--)if(w<0)e.removeChild(e.lastChild);else{var A=j.startsWith("<th")?"thead":j.startsWith("<td")||j.startsWith("<tr")?"tbody":"div",E=document.createElement(A),k=j;p&&(k=k.replace(o("this\\."+p.trim()),v+"["+(_.length-O)+"]")),y&&(k=k.replace(o("this\\."+y.trim()),String(_.length-O))),E.innerHTML=k,e.appendChild(E.firstElementChild)}l||b(x,n.deps,a,"for"),m(h(e,i),g,i,a.deps)}},_=function(t,e){e[t.name.split(/:|\./gim)[0].toUpperCase()](t)},x=function(t,e){var r={get:function(t,e){return"object"===a(t[e])&&null!==t[e]?new Proxy(t[e],r):t[e]},set:function(r,n,i){if("function"==typeof t[n])return!1;var o=!isNaN(Number(n))||"length"===n,l=[n];return r instanceof Array&&o?l=Object.keys(t).filter((function(e){return n=t[e],i=r,n instanceof Array&&i instanceof Array&&n.length===i.length&&n.every((function(t,e){return t===i[e]}));var n,i})):Object.keys(t).some((function(t){return void 0===r[t]}))&&(l=Object.keys(t).filter((function(e){return"object"===a(t[e])}))),r[n]=i,e(l),!0}};return Proxy.revocable(Object.seal(t),r)},j=function(){function e(t){void 0===t&&(t={}),this.state=t,this.directives={}}return e.prototype.mount=function(e,r){var n=this;void 0===r&&(r=!0);var i="string"==typeof e?document.querySelector(e):e;return this.ast=h(i,this.state),this.state=t(t({},this.state),{$render:function(t){return void 0===t&&(t=Object.keys(n.state)),n.render(t)}}),this.state=r?x(this.state,this.render.bind(this)).proxy:this.state,this.directives=t(t({},this.directives),g),this.render(),s(i,"__l",this),this.state},e.prototype.directive=function(t,e){this.directives[t.toUpperCase()]=e},e.prototype.render=function(t){void 0===t&&(t=Object.keys(this.state)),m(this.ast,g,this.state,t)},e}(),w=function(t){return new j(t)};exports.compile=h,exports.component=w,exports.computeExpression=f,exports.directives=g,exports.init=function(t){var r,i;void 0===t&&(t=document);var o="l-state",a=n(t.querySelectorAll("[l-state]")).filter((function(t){return void 0===u(t,"__l")}));try{for(var l=e(a),s=l.next();!s.done;s=l.next()){var c=s.value,v=c.getAttribute(o),d=c.getAttribute("l-init"),p=f(""+(v||"{}"),c,!0)({});w(p).mount(c);var y=d?f(""+d,c,!0):void 0;y&&y(p)}}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}},exports.reactive=x,exports.render=m;

@@ -190,3 +190,3 @@ /*! *****************************************************************************

if (value) {
return typeof value === 'function' ? value() : value;
return typeof value === 'function' ? state[expression]() : value;
} else {

@@ -659,6 +659,5 @@ var emit = function emit(name, options, dispatchGlobal) {

adjustDeps(ast, data.deps, node, 'for');
setElementCustomProp(el, '__l_for_ast', compile(el, state));
}
render(getElementCustomProp(el, '__l_for_ast'), directives, state, node.deps);
render(compile(el, state), directives, state, node.deps);
};

@@ -665,0 +664,0 @@

@@ -1,1 +0,1 @@

var t=function(){return(t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function e(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function n(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(r(arguments[e]));return t}var i;!function(t){t["@"]="on",t[":"]="bind"}(i||(i={}));var o=function(t){return new RegExp("\\b"+t+"\\b","gim")};function a(t){return(a="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)}var l=function(t){return t.replace(/\s+/gim," ").trim()},u=function(t,e){return t[e]},s=function(t,e,r){return t[e]=r},c=function(t){return n(new Set(t))},f=function(t,e,r){var n="with($state){"+(null==r||r?"return "+t:t)+"}";return function(r,i){try{var o=r[t];if(o)return"function"==typeof o?o():o;return new Function("$state","$el","$emit","$event",n)(r,e,(function(t,r,n){void 0===n&&(n=!0);var i=new CustomEvent(t,r);(n?document:e||document).dispatchEvent(i)}),i)}catch(r){console.warn('Lucia Error: "'+r+'"\n\nExpression: "'+t+'"\nElement:',e)}}},v=function(t){return t.hasAttribute("l-for")},d=function(t,e){var n=r(p(t,e),2),i=n[0],a=n[1],l=Object.keys(i).length>0,u=Object.values(i).some((function(t){var r=t.value;return Object.keys(e).some((function(t){return o(t).test(r)}))}));return l?{el:t,deps:a,directives:i,type:u?1:0}:null},p=function(t,r){var a,l;void 0===r&&(r={});var v={},d=[],p=function(e,a){var l="l-state"===e,p=e.startsWith("l-"),y=Object.keys(i).some((function(t){return e.startsWith(t)}));if(l||!p&&!y)return"continue";var h=[],m=Object.keys(r),b=!0,g=m.filter((function(t){var e=o(t).test(String(a));if("function"==typeof r[t]&&e){var i=m.filter((function(e){return o(e).test(String(r[t]))}));h.push.apply(h,n(i))}return e}));/on|@/gim.test(e)&&(b=!1),e.includes("for")&&void 0===u(t,"__l_for_template")&&(s(t,"__l_for_template",String(t.innerHTML).trim()),b=!1);var _=c(n(g,h));d.push.apply(d,n(_));var j={compute:f(a,t,b),deps:_,value:a},w=p?e.slice("l-".length):i[e[0]]+":"+e.slice(1);v[w]=j};try{for(var y=e(t.attributes),h=y.next();!h.done;h=y.next()){var m=h.value;p(m.name,m.value)}}catch(t){a={error:t}}finally{try{h&&!h.done&&(l=y.return)&&l.call(y)}finally{if(a)throw a.error}}return[v,c(d)]},y=function t(r,i,o){var a,l;void 0===i&&(i=!1),void 0===o&&(o=!1);var u,s=[],c=v(r),f=!!(u=r).parentElement&&u.parentElement.hasAttribute("l-for");if(!i&&(c||f))return s;if(o||i&&c||s.push(r),i||!c&&!f)try{for(var d=e(r.childNodes),p=d.next();!p.done;p=d.next()){var y=p.value;if(y.nodeType===Node.ELEMENT_NODE)if(!i&&v(y))s.push(y);else{if(y.hasAttribute("l-state"))continue;s.push.apply(s,n(t(y,i)))}}}catch(t){a={error:t}}finally{try{p&&!p.done&&(l=d.return)&&l.call(d)}finally{if(a)throw a.error}}return s},h=function(t,r,n){var o,a;if(void 0===r&&(r={}),void 0===n&&(n=!1),!t)throw new Error("Please provide a HTMLElement");var l=[],s=void 0!==u(t,"__l")&&v(t),c=y(t,s,n);try{for(var f=e(c),p=f.next();!p.done;p=f.next()){var h=p.value;if(h.hasAttribute("l-mask")&&h.removeAttribute("l-mask"),new RegExp("(l-|"+Object.keys(i).join("|")+")\\w+","gim").test(h.outerHTML)){var m=d(h,r);m&&l.push(m)}}}catch(t){o={error:t}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}return l},m=function(t,n,i,o){void 0===i&&(i={}),void 0===o&&(o=[]),"string"==typeof o&&(o=[o]);for(var a=Object.keys(n),l=function(l){var u,s,c=t[l];if(-1===c.type)return"continue";var f=0===c.type;if(f&&(c.type=-1),!o.some((function(t){return c.deps.includes(t)}))&&!f)return"continue";var v=function(t,e){var r=t.split(/:|\./)[0];if(!a.includes(r.toUpperCase()))return"continue";var l=o.some((function(t){return e.deps.includes(t)})),u="l-mask"===t,s=0===Object.keys(e.deps).length;if(l||f||s){var v={el:c.el,name:t,data:e,node:c,state:i};_(v,n),(s||u)&&(delete c.directives[t],u&&c.el.removeAttribute("l-mask"))}};try{for(var d=(u=void 0,e(Object.entries(c.directives))),p=d.next();!p.done;p=d.next()){var y=r(p.value,2);v(y[0],y[1])}}catch(t){u={error:t}}finally{try{p&&!p.done&&(s=d.return)&&s.call(d)}finally{if(u)throw u.error}}},u=0;u<t.length;u++)l(u)},b=function(t,r,i,o){var a,l,u=[];try{for(var s=e(t),f=s.next();!f.done;f=s.next()){var v=f.value;u.push.apply(u,n(v.deps))}}catch(t){a={error:t}}finally{try{f&&!f.done&&(l=s.return)&&l.call(s)}finally{if(a)throw a.error}}var d=c(n(r,u));i.deps=d,i.directives[o].deps=d},g={BIND:function(t){var e=t.el,r=t.name,n=t.data,i=t.state;switch(r.split(":")[1]){case"class":var o=n.compute(i);if("string"==typeof o)return e.setAttribute("class",l(e.className+" "+o));if(o instanceof Array)return e.setAttribute("class",l(e.className+" "+o.join(" ")));var u=[];for(var s in o)o[s]&&u.push(s);var c=new RegExp("\\b"+Object.keys(o).join("|")+"\\b","gim"),f=e.className.replace(c,"");if(u.length>0)return e.setAttribute("class",l(f+" "+u.join(" ")));if(l(f).length>0)return e.setAttribute("class",l(f));if(e.hasAttribute("class"))return e.removeAttribute("class");break;case"style":var v=n.compute(i);for(var s in e.removeAttribute("style"),v)e.style[s]=v[s];break;default:var d=n.compute(i);if("object"===a(d)&&null!==d)for(var s in d)d[s]?e.setAttribute(s,d[s]):e.removeAttribute(s);else d?e.setAttribute(r.split(":")[1],d):e.removeAttribute(r.split(":")[1])}},HTML:function(t){var e,r=t.el,n=t.data,i=t.state,o=t.node;o=o;var a=u(r,"__l");r.innerHTML=null!==(e=n.compute(i))&&void 0!==e?e:n.value;var l=h(r,i,!0);a||b(l,n.deps,o,"html"),m(l,g,i,n.deps),s(r,"__l",!0)},MODEL:function(t){var e=t.el,r=t.name,n=t.data,i=t.state,o=e,a=i[n.value],l="checkbox"===o.type?"checked":"value";if(o[l]!==String(a)&&(o[l]=a),!u(o,"__l_model_registered")){var c=r.split(".")[1];o.addEventListener("debounce"===c?"change":"input",(function(){return function(t,e,r,n){"checkbox"===t.type&&(t.value=String(t.checked));var i,o="number"==typeof e&&!isNaN(t.value),a="boolean"==typeof e&&("true"===t.value||"false"===t.value),l=null==e&&("null"===t.value||"undefined"===t.value);return i=o?parseFloat(t.value):a?"true"===t.value:l?"null"===t.value?null:void 0:String(t.value),n[r.value]=i,i}(o,a,n,i)})),s(o,"__l_model_registered",!0)}},ON:function(t){var e=t.el,n=t.name,i=t.data,o=t.state,a={};if(!u(e,"__l_on_registered")){var l=r(n.split(/:|\./gim)),c=l[1],f=l.slice(2),v=["outside","global"].some((function(t){return String(f).includes(t)}))?window:e;a.once=f.includes("once"),a.passive=f.includes("passive"),v.addEventListener(c,(function(t){if(f.includes("prevent")&&t.preventDefault(),f.includes("stop")&&t.stopPropagation(),f.includes("outside")){if(e.contains(t.target))return;if(e.offsetWidth<1&&e.offsetHeight<1)return}i.compute(o,t)}),a),s(e,"__l_on_registered",!0)}},TEXT:function(t){var e,r=t.el,n=t.data,i=t.state;r.textContent=null!==(e=n.compute(i))&&void 0!==e?e:n.value},FOR:function(t){var e=t.el,n=t.data,i=t.state,a=t.node;a=a;var l=u(e,"__l");s(e,"__l",!0);var c=r(n.value.split(/\s+(?:in|of)\s+/gim),2),f=c[0],v=c[1],d=r(null==f?void 0:f.trim().replace(/\(|\)/gim,"").split(","),2),p=d[0],y=d[1],_=i[null==v?void 0:v.trim()],j=h(e,i),w=u(e,"__l_for_template");e.innerHTML.trim()===w&&(e.innerHTML="");var x=(null==_?void 0:_.length)-e.children.length;if(0===(null==_?void 0:_.length))e.innerHTML="";else if(0!==x)for(var A=Math.abs(x);A>0;A--)if(x<0)e.removeChild(e.lastChild);else{var O=w.startsWith("<th")?"thead":w.startsWith("<td")||w.startsWith("<tr")?"tbody":"div",k=document.createElement(O),E=w;p&&(E=E.replace(o("this\\."+p.trim()),v+"["+(_.length-A)+"]")),y&&(E=E.replace(o("this\\."+y.trim()),String(_.length-A))),k.innerHTML=E,e.appendChild(k.firstElementChild)}l||(b(j,n.deps,a,"for"),s(e,"__l_for_ast",h(e,i))),m(u(e,"__l_for_ast"),g,i,a.deps)}},_=function(t,e){e[t.name.split(/:|\./gim)[0].toUpperCase()](t)},j=function(t,e){var r={get:function(t,e){return"object"===a(t[e])&&null!==t[e]?new Proxy(t[e],r):t[e]},set:function(r,n,i){if("function"==typeof t[n])return!1;var o=!isNaN(Number(n))||"length"===n,l=[n];return r instanceof Array&&o?l=Object.keys(t).filter((function(e){return n=t[e],i=r,n instanceof Array&&i instanceof Array&&n.length===i.length&&n.every((function(t,e){return t===i[e]}));var n,i})):Object.keys(t).some((function(t){return void 0===r[t]}))&&(l=Object.keys(t).filter((function(e){return"object"===a(t[e])}))),r[n]=i,e(l),!0}};return Proxy.revocable(Object.seal(t),r)},w=function(){function e(t){void 0===t&&(t={}),this.state=t,this.directives={}}return e.prototype.mount=function(e,r){var n=this;void 0===r&&(r=!0);var i="string"==typeof e?document.querySelector(e):e;return this.ast=h(i,this.state),this.state=t(t({},this.state),{$render:function(t){return void 0===t&&(t=Object.keys(n.state)),n.render(t)}}),this.state=r?j(this.state,this.render.bind(this)).proxy:this.state,this.directives=t(t({},this.directives),g),this.render(),s(i,"__l",this),this.state},e.prototype.directive=function(t,e){this.directives[t.toUpperCase()]=e},e.prototype.render=function(t){void 0===t&&(t=Object.keys(this.state)),m(this.ast,g,this.state,t)},e}(),x=function(t){return new w(t)},A=function(t){var r,i;void 0===t&&(t=document);var o="l-state",a=n(t.querySelectorAll("[l-state]")).filter((function(t){return void 0===u(t,"__l")}));try{for(var l=e(a),s=l.next();!s.done;s=l.next()){var c=s.value,v=c.getAttribute(o),d=c.getAttribute("l-init"),p=f(""+(v||"{}"),c,!0)({});x(p).mount(c);var y=d?f(""+d,c,!0):void 0;y&&y(p)}}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}};export{h as compile,x as component,f as computeExpression,g as directives,A as init,j as reactive,m as render};
var t=function(){return(t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function e(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function n(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(r(arguments[e]));return t}var i;!function(t){t["@"]="on",t[":"]="bind"}(i||(i={}));var o=function(t){return new RegExp("\\b"+t+"\\b","gim")};function a(t){return(a="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)}var l=function(t){return t.replace(/\s+/gim," ").trim()},u=function(t,e){return t[e]},s=function(t,e,r){return t[e]=r},c=function(t){return n(new Set(t))},f=function(t,e,r){var n="with($state){"+(null==r||r?"return "+t:t)+"}";return function(r,i){try{var o=r[t];if(o)return"function"==typeof o?r[t]():o;return new Function("$state","$el","$emit","$event",n)(r,e,(function(t,r,n){void 0===n&&(n=!0);var i=new CustomEvent(t,r);(n?document:e||document).dispatchEvent(i)}),i)}catch(r){console.warn('Lucia Error: "'+r+'"\n\nExpression: "'+t+'"\nElement:',e)}}},v=function(t){return t.hasAttribute("l-for")},d=function(t,e){var n=r(p(t,e),2),i=n[0],a=n[1],l=Object.keys(i).length>0,u=Object.values(i).some((function(t){var r=t.value;return Object.keys(e).some((function(t){return o(t).test(r)}))}));return l?{el:t,deps:a,directives:i,type:u?1:0}:null},p=function(t,r){var a,l;void 0===r&&(r={});var v={},d=[],p=function(e,a){var l="l-state"===e,p=e.startsWith("l-"),y=Object.keys(i).some((function(t){return e.startsWith(t)}));if(l||!p&&!y)return"continue";var h=[],m=Object.keys(r),b=!0,g=m.filter((function(t){var e=o(t).test(String(a));if("function"==typeof r[t]&&e){var i=m.filter((function(e){return o(e).test(String(r[t]))}));h.push.apply(h,n(i))}return e}));/on|@/gim.test(e)&&(b=!1),e.includes("for")&&void 0===u(t,"__l_for_template")&&(s(t,"__l_for_template",String(t.innerHTML).trim()),b=!1);var _=c(n(g,h));d.push.apply(d,n(_));var j={compute:f(a,t,b),deps:_,value:a},w=p?e.slice("l-".length):i[e[0]]+":"+e.slice(1);v[w]=j};try{for(var y=e(t.attributes),h=y.next();!h.done;h=y.next()){var m=h.value;p(m.name,m.value)}}catch(t){a={error:t}}finally{try{h&&!h.done&&(l=y.return)&&l.call(y)}finally{if(a)throw a.error}}return[v,c(d)]},y=function t(r,i,o){var a,l;void 0===i&&(i=!1),void 0===o&&(o=!1);var u,s=[],c=v(r),f=!!(u=r).parentElement&&u.parentElement.hasAttribute("l-for");if(!i&&(c||f))return s;if(o||i&&c||s.push(r),i||!c&&!f)try{for(var d=e(r.childNodes),p=d.next();!p.done;p=d.next()){var y=p.value;if(y.nodeType===Node.ELEMENT_NODE)if(!i&&v(y))s.push(y);else{if(y.hasAttribute("l-state"))continue;s.push.apply(s,n(t(y,i)))}}}catch(t){a={error:t}}finally{try{p&&!p.done&&(l=d.return)&&l.call(d)}finally{if(a)throw a.error}}return s},h=function(t,r,n){var o,a;if(void 0===r&&(r={}),void 0===n&&(n=!1),!t)throw new Error("Please provide a HTMLElement");var l=[],s=void 0!==u(t,"__l")&&v(t),c=y(t,s,n);try{for(var f=e(c),p=f.next();!p.done;p=f.next()){var h=p.value;if(h.hasAttribute("l-mask")&&h.removeAttribute("l-mask"),new RegExp("(l-|"+Object.keys(i).join("|")+")\\w+","gim").test(h.outerHTML)){var m=d(h,r);m&&l.push(m)}}}catch(t){o={error:t}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}return l},m=function(t,n,i,o){void 0===i&&(i={}),void 0===o&&(o=[]),"string"==typeof o&&(o=[o]);for(var a=Object.keys(n),l=function(l){var u,s,c=t[l];if(-1===c.type)return"continue";var f=0===c.type;if(f&&(c.type=-1),!o.some((function(t){return c.deps.includes(t)}))&&!f)return"continue";var v=function(t,e){var r=t.split(/:|\./)[0];if(!a.includes(r.toUpperCase()))return"continue";var l=o.some((function(t){return e.deps.includes(t)})),u="l-mask"===t,s=0===Object.keys(e.deps).length;if(l||f||s){var v={el:c.el,name:t,data:e,node:c,state:i};_(v,n),(s||u)&&(delete c.directives[t],u&&c.el.removeAttribute("l-mask"))}};try{for(var d=(u=void 0,e(Object.entries(c.directives))),p=d.next();!p.done;p=d.next()){var y=r(p.value,2);v(y[0],y[1])}}catch(t){u={error:t}}finally{try{p&&!p.done&&(s=d.return)&&s.call(d)}finally{if(u)throw u.error}}},u=0;u<t.length;u++)l(u)},b=function(t,r,i,o){var a,l,u=[];try{for(var s=e(t),f=s.next();!f.done;f=s.next()){var v=f.value;u.push.apply(u,n(v.deps))}}catch(t){a={error:t}}finally{try{f&&!f.done&&(l=s.return)&&l.call(s)}finally{if(a)throw a.error}}var d=c(n(r,u));i.deps=d,i.directives[o].deps=d},g={BIND:function(t){var e=t.el,r=t.name,n=t.data,i=t.state;switch(r.split(":")[1]){case"class":var o=n.compute(i);if("string"==typeof o)return e.setAttribute("class",l(e.className+" "+o));if(o instanceof Array)return e.setAttribute("class",l(e.className+" "+o.join(" ")));var u=[];for(var s in o)o[s]&&u.push(s);var c=new RegExp("\\b"+Object.keys(o).join("|")+"\\b","gim"),f=e.className.replace(c,"");if(u.length>0)return e.setAttribute("class",l(f+" "+u.join(" ")));if(l(f).length>0)return e.setAttribute("class",l(f));if(e.hasAttribute("class"))return e.removeAttribute("class");break;case"style":var v=n.compute(i);for(var s in e.removeAttribute("style"),v)e.style[s]=v[s];break;default:var d=n.compute(i);if("object"===a(d)&&null!==d)for(var s in d)d[s]?e.setAttribute(s,d[s]):e.removeAttribute(s);else d?e.setAttribute(r.split(":")[1],d):e.removeAttribute(r.split(":")[1])}},HTML:function(t){var e,r=t.el,n=t.data,i=t.state,o=t.node;o=o;var a=u(r,"__l");r.innerHTML=null!==(e=n.compute(i))&&void 0!==e?e:n.value;var l=h(r,i,!0);a||b(l,n.deps,o,"html"),m(l,g,i,n.deps),s(r,"__l",!0)},MODEL:function(t){var e=t.el,r=t.name,n=t.data,i=t.state,o=e,a=i[n.value],l="checkbox"===o.type?"checked":"value";if(o[l]!==String(a)&&(o[l]=a),!u(o,"__l_model_registered")){var c=r.split(".")[1];o.addEventListener("debounce"===c?"change":"input",(function(){return function(t,e,r,n){"checkbox"===t.type&&(t.value=String(t.checked));var i,o="number"==typeof e&&!isNaN(t.value),a="boolean"==typeof e&&("true"===t.value||"false"===t.value),l=null==e&&("null"===t.value||"undefined"===t.value);return i=o?parseFloat(t.value):a?"true"===t.value:l?"null"===t.value?null:void 0:String(t.value),n[r.value]=i,i}(o,a,n,i)})),s(o,"__l_model_registered",!0)}},ON:function(t){var e=t.el,n=t.name,i=t.data,o=t.state,a={};if(!u(e,"__l_on_registered")){var l=r(n.split(/:|\./gim)),c=l[1],f=l.slice(2),v=["outside","global"].some((function(t){return String(f).includes(t)}))?window:e;a.once=f.includes("once"),a.passive=f.includes("passive"),v.addEventListener(c,(function(t){if(f.includes("prevent")&&t.preventDefault(),f.includes("stop")&&t.stopPropagation(),f.includes("outside")){if(e.contains(t.target))return;if(e.offsetWidth<1&&e.offsetHeight<1)return}i.compute(o,t)}),a),s(e,"__l_on_registered",!0)}},TEXT:function(t){var e,r=t.el,n=t.data,i=t.state;r.textContent=null!==(e=n.compute(i))&&void 0!==e?e:n.value},FOR:function(t){var e=t.el,n=t.data,i=t.state,a=t.node;a=a;var l=u(e,"__l");s(e,"__l",!0);var c=r(n.value.split(/\s+(?:in|of)\s+/gim),2),f=c[0],v=c[1],d=r(null==f?void 0:f.trim().replace(/\(|\)/gim,"").split(","),2),p=d[0],y=d[1],_=i[null==v?void 0:v.trim()],j=h(e,i),w=u(e,"__l_for_template");e.innerHTML.trim()===w&&(e.innerHTML="");var x=(null==_?void 0:_.length)-e.children.length;if(0===(null==_?void 0:_.length))e.innerHTML="";else if(0!==x)for(var A=Math.abs(x);A>0;A--)if(x<0)e.removeChild(e.lastChild);else{var O=w.startsWith("<th")?"thead":w.startsWith("<td")||w.startsWith("<tr")?"tbody":"div",k=document.createElement(O),E=w;p&&(E=E.replace(o("this\\."+p.trim()),v+"["+(_.length-A)+"]")),y&&(E=E.replace(o("this\\."+y.trim()),String(_.length-A))),k.innerHTML=E,e.appendChild(k.firstElementChild)}l||b(j,n.deps,a,"for"),m(h(e,i),g,i,a.deps)}},_=function(t,e){e[t.name.split(/:|\./gim)[0].toUpperCase()](t)},j=function(t,e){var r={get:function(t,e){return"object"===a(t[e])&&null!==t[e]?new Proxy(t[e],r):t[e]},set:function(r,n,i){if("function"==typeof t[n])return!1;var o=!isNaN(Number(n))||"length"===n,l=[n];return r instanceof Array&&o?l=Object.keys(t).filter((function(e){return n=t[e],i=r,n instanceof Array&&i instanceof Array&&n.length===i.length&&n.every((function(t,e){return t===i[e]}));var n,i})):Object.keys(t).some((function(t){return void 0===r[t]}))&&(l=Object.keys(t).filter((function(e){return"object"===a(t[e])}))),r[n]=i,e(l),!0}};return Proxy.revocable(Object.seal(t),r)},w=function(){function e(t){void 0===t&&(t={}),this.state=t,this.directives={}}return e.prototype.mount=function(e,r){var n=this;void 0===r&&(r=!0);var i="string"==typeof e?document.querySelector(e):e;return this.ast=h(i,this.state),this.state=t(t({},this.state),{$render:function(t){return void 0===t&&(t=Object.keys(n.state)),n.render(t)}}),this.state=r?j(this.state,this.render.bind(this)).proxy:this.state,this.directives=t(t({},this.directives),g),this.render(),s(i,"__l",this),this.state},e.prototype.directive=function(t,e){this.directives[t.toUpperCase()]=e},e.prototype.render=function(t){void 0===t&&(t=Object.keys(this.state)),m(this.ast,g,this.state,t)},e}(),x=function(t){return new w(t)},A=function(t){var r,i;void 0===t&&(t=document);var o="l-state",a=n(t.querySelectorAll("[l-state]")).filter((function(t){return void 0===u(t,"__l")}));try{for(var l=e(a),s=l.next();!s.done;s=l.next()){var c=s.value,v=c.getAttribute(o),d=c.getAttribute("l-init"),p=f(""+(v||"{}"),c,!0)({});x(p).mount(c);var y=d?f(""+d,c,!0):void 0;y&&y(p)}}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}};export{h as compile,x as component,f as computeExpression,g as directives,A as init,j as reactive,m as render};

@@ -231,3 +231,3 @@ var Lucia = (function () {

if (value) {
return typeof value === 'function' ? value() : value;
return typeof value === 'function' ? state[expression]() : value;
} else {

@@ -700,6 +700,5 @@ var emit = function emit(name, options, dispatchGlobal) {

adjustDeps(ast, data.deps, node, 'for');
setElementCustomProp(el, '__l_for_ast', compile(el, state));
}
render(getElementCustomProp(el, '__l_for_ast'), directives, state, node.deps);
render(compile(el, state), directives, state, node.deps);
};

@@ -706,0 +705,0 @@

@@ -1,1 +0,1 @@

var Lucia=function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function e(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{l(n.next(t))}catch(t){o(t)}}function u(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}l((n=n.apply(t,e||[])).next())}))}function r(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}}function n(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function i(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function o(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(i(arguments[e]));return t}var a,u="l-";!function(t){t["@"]="on",t[":"]="bind"}(a||(a={}));var l=function(t){return new RegExp("\\b"+t+"\\b","gim")};function s(t){return(s="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)}var c=function(t){return t.replace(/\s+/gim," ").trim()},f=function(t,e){return t[e]},v=function(t,e,r){return t[e]=r},d=function(t){return o(new Set(t))},p=function(t,e,r){var n="with($state){"+(null==r||r?"return "+t:t)+"}";return function(r,i){try{var o=r[t];if(o)return"function"==typeof o?o():o;return new Function("$state","$el","$emit","$event",n)(r,e,(function(t,r,n){void 0===n&&(n=!0);var i=new CustomEvent(t,r);(n?document:e||document).dispatchEvent(i)}),i)}catch(r){console.warn('Lucia Error: "'+r+'"\n\nExpression: "'+t+'"\nElement:',e)}}},y=function(t){return t.hasAttribute("l-for")},h=function(t,e){var r=i(m(t,e),2),n=r[0],o=r[1],a=Object.keys(n).length>0,u=Object.values(n).some((function(t){var r=t.value;return Object.keys(e).some((function(t){return l(t).test(r)}))}));return a?{el:t,deps:o,directives:n,type:u?1:0}:null},m=function(t,e){var r,i;void 0===e&&(e={});var s={},c=[],y=function(r,n){var i="l-state"===r,y=r.startsWith(u),h=Object.keys(a).some((function(t){return r.startsWith(t)}));if(i||!y&&!h)return"continue";var m=[],b=Object.keys(e),_=!0,g=b.filter((function(t){var r=l(t).test(String(n));if("function"==typeof e[t]&&r){var i=b.filter((function(r){return l(r).test(String(e[t]))}));m.push.apply(m,o(i))}return r}));/on|@/gim.test(r)&&(_=!1),r.includes("for")&&void 0===f(t,"__l_for_template")&&(v(t,"__l_for_template",String(t.innerHTML).trim()),_=!1);var w=d(o(g,m));c.push.apply(c,o(w));var x={compute:p(n,t,_),deps:w,value:n},k=y?r.slice(u.length):a[r[0]]+":"+r.slice(1);s[k]=x};try{for(var h=n(t.attributes),m=h.next();!m.done;m=h.next()){var b=m.value;y(b.name,b.value)}}catch(t){r={error:t}}finally{try{m&&!m.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}return[s,d(c)]},b=function t(e,r,i){var a,u;void 0===r&&(r=!1),void 0===i&&(i=!1);var l,s=[],c=y(e),f=!!(l=e).parentElement&&l.parentElement.hasAttribute("l-for");if(!r&&(c||f))return s;if(i||r&&c||s.push(e),r||!c&&!f)try{for(var v=n(e.childNodes),d=v.next();!d.done;d=v.next()){var p=d.value;if(p.nodeType===Node.ELEMENT_NODE)if(!r&&y(p))s.push(p);else{if(p.hasAttribute("l-state"))continue;s.push.apply(s,o(t(p,r)))}}}catch(t){a={error:t}}finally{try{d&&!d.done&&(u=v.return)&&u.call(v)}finally{if(a)throw a.error}}return s},_=function(t,e,r){var i,o;if(void 0===e&&(e={}),void 0===r&&(r=!1),!t)throw new Error("Please provide a HTMLElement");var u=[],l=void 0!==f(t,"__l")&&y(t),s=b(t,l,r);try{for(var c=n(s),v=c.next();!v.done;v=c.next()){var d=v.value;if(d.hasAttribute("l-mask")&&d.removeAttribute("l-mask"),new RegExp("(l-|"+Object.keys(a).join("|")+")\\w+","gim").test(d.outerHTML)){var p=h(d,e);p&&u.push(p)}}}catch(t){i={error:t}}finally{try{v&&!v.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}return u},g=function(t,e,r,o){void 0===r&&(r={}),void 0===o&&(o=[]),"string"==typeof o&&(o=[o]);for(var a=Object.keys(e),u=function(u){var l,s,c=t[u];if(-1===c.type)return"continue";var f=0===c.type;if(f&&(c.type=-1),!o.some((function(t){return c.deps.includes(t)}))&&!f)return"continue";var v=function(t,n){var i=t.split(/:|\./)[0];if(!a.includes(i.toUpperCase()))return"continue";var u=o.some((function(t){return n.deps.includes(t)})),l="l-mask"===t,s=0===Object.keys(n.deps).length;if(u||f||s){var v={el:c.el,name:t,data:n,node:c,state:r};k(v,e),(s||l)&&(delete c.directives[t],l&&c.el.removeAttribute("l-mask"))}};try{for(var d=(l=void 0,n(Object.entries(c.directives))),p=d.next();!p.done;p=d.next()){var y=i(p.value,2);v(y[0],y[1])}}catch(t){l={error:t}}finally{try{p&&!p.done&&(s=d.return)&&s.call(d)}finally{if(l)throw l.error}}},l=0;l<t.length;l++)u(l)},w=function(t,e,r,i){var a,u,l=[];try{for(var s=n(t),c=s.next();!c.done;c=s.next()){var f=c.value;l.push.apply(l,o(f.deps))}}catch(t){a={error:t}}finally{try{c&&!c.done&&(u=s.return)&&u.call(s)}finally{if(a)throw a.error}}var v=d(o(e,l));r.deps=v,r.directives[i].deps=v},x={BIND:function(t){var e=t.el,r=t.name,n=t.data,i=t.state;switch(r.split(":")[1]){case"class":var o=n.compute(i);if("string"==typeof o)return e.setAttribute("class",c(e.className+" "+o));if(o instanceof Array)return e.setAttribute("class",c(e.className+" "+o.join(" ")));var a=[];for(var u in o)o[u]&&a.push(u);var l=new RegExp("\\b"+Object.keys(o).join("|")+"\\b","gim"),f=e.className.replace(l,"");if(a.length>0)return e.setAttribute("class",c(f+" "+a.join(" ")));if(c(f).length>0)return e.setAttribute("class",c(f));if(e.hasAttribute("class"))return e.removeAttribute("class");break;case"style":var v=n.compute(i);for(var u in e.removeAttribute("style"),v)e.style[u]=v[u];break;default:var d=n.compute(i);if("object"===s(d)&&null!==d)for(var u in d)d[u]?e.setAttribute(u,d[u]):e.removeAttribute(u);else d?e.setAttribute(r.split(":")[1],d):e.removeAttribute(r.split(":")[1])}},HTML:function(t){var e,r=t.el,n=t.data,i=t.state,o=t.node;o=o;var a=f(r,"__l");r.innerHTML=null!==(e=n.compute(i))&&void 0!==e?e:n.value;var u=_(r,i,!0);a||w(u,n.deps,o,"html"),g(u,x,i,n.deps),v(r,"__l",!0)},MODEL:function(t){var e=t.el,r=t.name,n=t.data,i=t.state,o=e,a=i[n.value],u="checkbox"===o.type?"checked":"value";if(o[u]!==String(a)&&(o[u]=a),!f(o,"__l_model_registered")){var l=r.split(".")[1];o.addEventListener("debounce"===l?"change":"input",(function(){return function(t,e,r,n){"checkbox"===t.type&&(t.value=String(t.checked));var i,o="number"==typeof e&&!isNaN(t.value),a="boolean"==typeof e&&("true"===t.value||"false"===t.value),u=null==e&&("null"===t.value||"undefined"===t.value);return i=o?parseFloat(t.value):a?"true"===t.value:u?"null"===t.value?null:void 0:String(t.value),n[r.value]=i,i}(o,a,n,i)})),v(o,"__l_model_registered",!0)}},ON:function(t){var e=t.el,r=t.name,n=t.data,o=t.state,a={};if(!f(e,"__l_on_registered")){var u=i(r.split(/:|\./gim)),l=u[1],s=u.slice(2),c=["outside","global"].some((function(t){return String(s).includes(t)}))?window:e;a.once=s.includes("once"),a.passive=s.includes("passive"),c.addEventListener(l,(function(t){if(s.includes("prevent")&&t.preventDefault(),s.includes("stop")&&t.stopPropagation(),s.includes("outside")){if(e.contains(t.target))return;if(e.offsetWidth<1&&e.offsetHeight<1)return}n.compute(o,t)}),a),v(e,"__l_on_registered",!0)}},TEXT:function(t){var e,r=t.el,n=t.data,i=t.state;r.textContent=null!==(e=n.compute(i))&&void 0!==e?e:n.value},FOR:function(t){var e=t.el,r=t.data,n=t.state,o=t.node;o=o;var a=f(e,"__l");v(e,"__l",!0);var u=i(r.value.split(/\s+(?:in|of)\s+/gim),2),s=u[0],c=u[1],d=i(null==s?void 0:s.trim().replace(/\(|\)/gim,"").split(","),2),p=d[0],y=d[1],h=n[null==c?void 0:c.trim()],m=_(e,n),b=f(e,"__l_for_template");e.innerHTML.trim()===b&&(e.innerHTML="");var k=(null==h?void 0:h.length)-e.children.length;if(0===(null==h?void 0:h.length))e.innerHTML="";else if(0!==k)for(var E=Math.abs(k);E>0;E--)if(k<0)e.removeChild(e.lastChild);else{var j=b.startsWith("<th")?"thead":b.startsWith("<td")||b.startsWith("<tr")?"tbody":"div",O=document.createElement(j),A=b;p&&(A=A.replace(l("this\\."+p.trim()),c+"["+(h.length-E)+"]")),y&&(A=A.replace(l("this\\."+y.trim()),String(h.length-E))),O.innerHTML=A,e.appendChild(O.firstElementChild)}a||(w(m,r.deps,o,"for"),v(e,"__l_for_ast",_(e,n))),g(f(e,"__l_for_ast"),x,n,o.deps)}},k=function(t,e){e[t.name.split(/:|\./gim)[0].toUpperCase()](t)},E=function(t,e){var r={get:function(t,e){return"object"===s(t[e])&&null!==t[e]?new Proxy(t[e],r):t[e]},set:function(r,n,i){if("function"==typeof t[n])return!1;var o=!isNaN(Number(n))||"length"===n,a=[n];return r instanceof Array&&o?a=Object.keys(t).filter((function(e){return n=t[e],i=r,n instanceof Array&&i instanceof Array&&n.length===i.length&&n.every((function(t,e){return t===i[e]}));var n,i})):Object.keys(t).some((function(t){return void 0===r[t]}))&&(a=Object.keys(t).filter((function(e){return"object"===s(t[e])}))),r[n]=i,e(a),!0}};return Proxy.revocable(Object.seal(t),r)},j=function(){function e(t){void 0===t&&(t={}),this.state=t,this.directives={}}return e.prototype.mount=function(e,r){var n=this;void 0===r&&(r=!0);var i="string"==typeof e?document.querySelector(e):e;return this.ast=_(i,this.state),this.state=t(t({},this.state),{$render:function(t){return void 0===t&&(t=Object.keys(n.state)),n.render(t)}}),this.state=r?E(this.state,this.render.bind(this)).proxy:this.state,this.directives=t(t({},this.directives),x),this.render(),v(i,"__l",this),this.state},e.prototype.directive=function(t,e){this.directives[t.toUpperCase()]=e},e.prototype.render=function(t){void 0===t&&(t=Object.keys(this.state)),g(this.ast,x,this.state,t)},e}(),O=function(t){return new j(t)},A=function(t){var e,r;void 0===t&&(t=document);var i="l-state",a=o(t.querySelectorAll("[l-state]")).filter((function(t){return void 0===f(t,"__l")}));try{for(var u=n(a),l=u.next();!l.done;l=u.next()){var s=l.value,c=s.getAttribute(i),v=s.getAttribute("l-init"),d=p(""+(c||"{}"),s,!0)({});O(d).mount(s);var y=v?p(""+v,s,!0):void 0;y&&y(d)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}},S=Object.freeze({__proto__:null,component:O,compile:_,render:g,reactive:E,directives:x,computeExpression:p,init:A}),L=function(){return A()},T=function(){return e(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,new Promise((function(t){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",t):t()}))];case 1:return t.sent(),L(),document.addEventListener("turbolinks:load",L),document.addEventListener("turbo:load",L),[2]}}))}))};return window.__l?window.__l((function(){return T()})):T(),S}();
var Lucia=function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function e(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{l(n.next(t))}catch(t){o(t)}}function u(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}l((n=n.apply(t,e||[])).next())}))}function r(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}}function n(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function i(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function o(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(i(arguments[e]));return t}var a,u="l-";!function(t){t["@"]="on",t[":"]="bind"}(a||(a={}));var l=function(t){return new RegExp("\\b"+t+"\\b","gim")};function s(t){return(s="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)}var c=function(t){return t.replace(/\s+/gim," ").trim()},f=function(t,e){return t[e]},v=function(t,e,r){return t[e]=r},d=function(t){return o(new Set(t))},p=function(t,e,r){var n="with($state){"+(null==r||r?"return "+t:t)+"}";return function(r,i){try{var o=r[t];if(o)return"function"==typeof o?r[t]():o;return new Function("$state","$el","$emit","$event",n)(r,e,(function(t,r,n){void 0===n&&(n=!0);var i=new CustomEvent(t,r);(n?document:e||document).dispatchEvent(i)}),i)}catch(r){console.warn('Lucia Error: "'+r+'"\n\nExpression: "'+t+'"\nElement:',e)}}},y=function(t){return t.hasAttribute("l-for")},h=function(t,e){var r=i(m(t,e),2),n=r[0],o=r[1],a=Object.keys(n).length>0,u=Object.values(n).some((function(t){var r=t.value;return Object.keys(e).some((function(t){return l(t).test(r)}))}));return a?{el:t,deps:o,directives:n,type:u?1:0}:null},m=function(t,e){var r,i;void 0===e&&(e={});var s={},c=[],y=function(r,n){var i="l-state"===r,y=r.startsWith(u),h=Object.keys(a).some((function(t){return r.startsWith(t)}));if(i||!y&&!h)return"continue";var m=[],b=Object.keys(e),g=!0,_=b.filter((function(t){var r=l(t).test(String(n));if("function"==typeof e[t]&&r){var i=b.filter((function(r){return l(r).test(String(e[t]))}));m.push.apply(m,o(i))}return r}));/on|@/gim.test(r)&&(g=!1),r.includes("for")&&void 0===f(t,"__l_for_template")&&(v(t,"__l_for_template",String(t.innerHTML).trim()),g=!1);var w=d(o(_,m));c.push.apply(c,o(w));var x={compute:p(n,t,g),deps:w,value:n},k=y?r.slice(u.length):a[r[0]]+":"+r.slice(1);s[k]=x};try{for(var h=n(t.attributes),m=h.next();!m.done;m=h.next()){var b=m.value;y(b.name,b.value)}}catch(t){r={error:t}}finally{try{m&&!m.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}return[s,d(c)]},b=function t(e,r,i){var a,u;void 0===r&&(r=!1),void 0===i&&(i=!1);var l,s=[],c=y(e),f=!!(l=e).parentElement&&l.parentElement.hasAttribute("l-for");if(!r&&(c||f))return s;if(i||r&&c||s.push(e),r||!c&&!f)try{for(var v=n(e.childNodes),d=v.next();!d.done;d=v.next()){var p=d.value;if(p.nodeType===Node.ELEMENT_NODE)if(!r&&y(p))s.push(p);else{if(p.hasAttribute("l-state"))continue;s.push.apply(s,o(t(p,r)))}}}catch(t){a={error:t}}finally{try{d&&!d.done&&(u=v.return)&&u.call(v)}finally{if(a)throw a.error}}return s},g=function(t,e,r){var i,o;if(void 0===e&&(e={}),void 0===r&&(r=!1),!t)throw new Error("Please provide a HTMLElement");var u=[],l=void 0!==f(t,"__l")&&y(t),s=b(t,l,r);try{for(var c=n(s),v=c.next();!v.done;v=c.next()){var d=v.value;if(d.hasAttribute("l-mask")&&d.removeAttribute("l-mask"),new RegExp("(l-|"+Object.keys(a).join("|")+")\\w+","gim").test(d.outerHTML)){var p=h(d,e);p&&u.push(p)}}}catch(t){i={error:t}}finally{try{v&&!v.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}return u},_=function(t,e,r,o){void 0===r&&(r={}),void 0===o&&(o=[]),"string"==typeof o&&(o=[o]);for(var a=Object.keys(e),u=function(u){var l,s,c=t[u];if(-1===c.type)return"continue";var f=0===c.type;if(f&&(c.type=-1),!o.some((function(t){return c.deps.includes(t)}))&&!f)return"continue";var v=function(t,n){var i=t.split(/:|\./)[0];if(!a.includes(i.toUpperCase()))return"continue";var u=o.some((function(t){return n.deps.includes(t)})),l="l-mask"===t,s=0===Object.keys(n.deps).length;if(u||f||s){var v={el:c.el,name:t,data:n,node:c,state:r};k(v,e),(s||l)&&(delete c.directives[t],l&&c.el.removeAttribute("l-mask"))}};try{for(var d=(l=void 0,n(Object.entries(c.directives))),p=d.next();!p.done;p=d.next()){var y=i(p.value,2);v(y[0],y[1])}}catch(t){l={error:t}}finally{try{p&&!p.done&&(s=d.return)&&s.call(d)}finally{if(l)throw l.error}}},l=0;l<t.length;l++)u(l)},w=function(t,e,r,i){var a,u,l=[];try{for(var s=n(t),c=s.next();!c.done;c=s.next()){var f=c.value;l.push.apply(l,o(f.deps))}}catch(t){a={error:t}}finally{try{c&&!c.done&&(u=s.return)&&u.call(s)}finally{if(a)throw a.error}}var v=d(o(e,l));r.deps=v,r.directives[i].deps=v},x={BIND:function(t){var e=t.el,r=t.name,n=t.data,i=t.state;switch(r.split(":")[1]){case"class":var o=n.compute(i);if("string"==typeof o)return e.setAttribute("class",c(e.className+" "+o));if(o instanceof Array)return e.setAttribute("class",c(e.className+" "+o.join(" ")));var a=[];for(var u in o)o[u]&&a.push(u);var l=new RegExp("\\b"+Object.keys(o).join("|")+"\\b","gim"),f=e.className.replace(l,"");if(a.length>0)return e.setAttribute("class",c(f+" "+a.join(" ")));if(c(f).length>0)return e.setAttribute("class",c(f));if(e.hasAttribute("class"))return e.removeAttribute("class");break;case"style":var v=n.compute(i);for(var u in e.removeAttribute("style"),v)e.style[u]=v[u];break;default:var d=n.compute(i);if("object"===s(d)&&null!==d)for(var u in d)d[u]?e.setAttribute(u,d[u]):e.removeAttribute(u);else d?e.setAttribute(r.split(":")[1],d):e.removeAttribute(r.split(":")[1])}},HTML:function(t){var e,r=t.el,n=t.data,i=t.state,o=t.node;o=o;var a=f(r,"__l");r.innerHTML=null!==(e=n.compute(i))&&void 0!==e?e:n.value;var u=g(r,i,!0);a||w(u,n.deps,o,"html"),_(u,x,i,n.deps),v(r,"__l",!0)},MODEL:function(t){var e=t.el,r=t.name,n=t.data,i=t.state,o=e,a=i[n.value],u="checkbox"===o.type?"checked":"value";if(o[u]!==String(a)&&(o[u]=a),!f(o,"__l_model_registered")){var l=r.split(".")[1];o.addEventListener("debounce"===l?"change":"input",(function(){return function(t,e,r,n){"checkbox"===t.type&&(t.value=String(t.checked));var i,o="number"==typeof e&&!isNaN(t.value),a="boolean"==typeof e&&("true"===t.value||"false"===t.value),u=null==e&&("null"===t.value||"undefined"===t.value);return i=o?parseFloat(t.value):a?"true"===t.value:u?"null"===t.value?null:void 0:String(t.value),n[r.value]=i,i}(o,a,n,i)})),v(o,"__l_model_registered",!0)}},ON:function(t){var e=t.el,r=t.name,n=t.data,o=t.state,a={};if(!f(e,"__l_on_registered")){var u=i(r.split(/:|\./gim)),l=u[1],s=u.slice(2),c=["outside","global"].some((function(t){return String(s).includes(t)}))?window:e;a.once=s.includes("once"),a.passive=s.includes("passive"),c.addEventListener(l,(function(t){if(s.includes("prevent")&&t.preventDefault(),s.includes("stop")&&t.stopPropagation(),s.includes("outside")){if(e.contains(t.target))return;if(e.offsetWidth<1&&e.offsetHeight<1)return}n.compute(o,t)}),a),v(e,"__l_on_registered",!0)}},TEXT:function(t){var e,r=t.el,n=t.data,i=t.state;r.textContent=null!==(e=n.compute(i))&&void 0!==e?e:n.value},FOR:function(t){var e=t.el,r=t.data,n=t.state,o=t.node;o=o;var a=f(e,"__l");v(e,"__l",!0);var u=i(r.value.split(/\s+(?:in|of)\s+/gim),2),s=u[0],c=u[1],d=i(null==s?void 0:s.trim().replace(/\(|\)/gim,"").split(","),2),p=d[0],y=d[1],h=n[null==c?void 0:c.trim()],m=g(e,n),b=f(e,"__l_for_template");e.innerHTML.trim()===b&&(e.innerHTML="");var k=(null==h?void 0:h.length)-e.children.length;if(0===(null==h?void 0:h.length))e.innerHTML="";else if(0!==k)for(var E=Math.abs(k);E>0;E--)if(k<0)e.removeChild(e.lastChild);else{var j=b.startsWith("<th")?"thead":b.startsWith("<td")||b.startsWith("<tr")?"tbody":"div",O=document.createElement(j),A=b;p&&(A=A.replace(l("this\\."+p.trim()),c+"["+(h.length-E)+"]")),y&&(A=A.replace(l("this\\."+y.trim()),String(h.length-E))),O.innerHTML=A,e.appendChild(O.firstElementChild)}a||w(m,r.deps,o,"for"),_(g(e,n),x,n,o.deps)}},k=function(t,e){e[t.name.split(/:|\./gim)[0].toUpperCase()](t)},E=function(t,e){var r={get:function(t,e){return"object"===s(t[e])&&null!==t[e]?new Proxy(t[e],r):t[e]},set:function(r,n,i){if("function"==typeof t[n])return!1;var o=!isNaN(Number(n))||"length"===n,a=[n];return r instanceof Array&&o?a=Object.keys(t).filter((function(e){return n=t[e],i=r,n instanceof Array&&i instanceof Array&&n.length===i.length&&n.every((function(t,e){return t===i[e]}));var n,i})):Object.keys(t).some((function(t){return void 0===r[t]}))&&(a=Object.keys(t).filter((function(e){return"object"===s(t[e])}))),r[n]=i,e(a),!0}};return Proxy.revocable(Object.seal(t),r)},j=function(){function e(t){void 0===t&&(t={}),this.state=t,this.directives={}}return e.prototype.mount=function(e,r){var n=this;void 0===r&&(r=!0);var i="string"==typeof e?document.querySelector(e):e;return this.ast=g(i,this.state),this.state=t(t({},this.state),{$render:function(t){return void 0===t&&(t=Object.keys(n.state)),n.render(t)}}),this.state=r?E(this.state,this.render.bind(this)).proxy:this.state,this.directives=t(t({},this.directives),x),this.render(),v(i,"__l",this),this.state},e.prototype.directive=function(t,e){this.directives[t.toUpperCase()]=e},e.prototype.render=function(t){void 0===t&&(t=Object.keys(this.state)),_(this.ast,x,this.state,t)},e}(),O=function(t){return new j(t)},A=function(t){var e,r;void 0===t&&(t=document);var i="l-state",a=o(t.querySelectorAll("[l-state]")).filter((function(t){return void 0===f(t,"__l")}));try{for(var u=n(a),l=u.next();!l.done;l=u.next()){var s=l.value,c=s.getAttribute(i),v=s.getAttribute("l-init"),d=p(""+(c||"{}"),s,!0)({});O(d).mount(s);var y=v?p(""+v,s,!0):void 0;y&&y(d)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}},S=Object.freeze({__proto__:null,component:O,compile:g,render:_,reactive:E,directives:x,computeExpression:p,init:A}),L=function(){return A()},T=function(){return e(void 0,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,new Promise((function(t){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",t):t()}))];case 1:return t.sent(),L(),document.addEventListener("turbolinks:load",L),document.addEventListener("turbo:load",L),[2]}}))}))};return window.__l?window.__l((function(){return T()})):T(),S}();

@@ -100,3 +100,3 @@ 'use strict';

if (value) {
return typeof value === 'function' ? value() : value;
return typeof value === 'function' ? state[expression]() : value;
}

@@ -394,5 +394,4 @@ else {

adjustDeps(ast, data.deps, node, 'for');
setElementCustomProp(el, '__l_for_ast', compile(el, state));
}
render(getElementCustomProp(el, '__l_for_ast'), directives, state, node.deps);
render(compile(el, state), directives, state, node.deps);
};

@@ -399,0 +398,0 @@

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e;!function(e){e["@"]="on",e[":"]="bind"}(e||(e={}));const t=e=>new RegExp(`\\b${e}\\b`,"gim"),s=e=>e.replace(/\s+/gim," ").trim(),n=(e,t)=>e[t],i=(e,t,s)=>e[t]=s,r=e=>[...new Set(e)],o=(e,t,s)=>{let n=`with($state){${null==s||s?`return ${e}`:e}}`;return(s,i)=>{try{const r=s[e];if(r)return"function"==typeof r?r():r;{const e=(e,s,n=!0)=>{const i=new CustomEvent(e,s);(n?document:t||document).dispatchEvent(i)};return new Function("$state","$el","$emit","$event",n)(s,t,e,i)}}catch(s){console.warn(`Lucia Error: "${s}"\n\nExpression: "${e}"\nElement:`,t)}}},l=e=>e.hasAttribute("l-for"),c=(e,s)=>{const[n,i]=a(e,s),r=Object.keys(n).length>0,o=Object.values(n).some((({value:e})=>Object.keys(s).some((s=>t(s).test(e)))));return r?{el:e,deps:i,directives:n,type:o?1:0}:null},a=(s,l={})=>{const c={},a=[];for(const{name:u,value:d}of s.attributes){const p="l-state"===u,f=u.startsWith("l-"),h=Object.keys(e).some((e=>u.startsWith(e)));if(p||!f&&!h)continue;const m=[],v=Object.keys(l);let b=!0;const _=v.filter((e=>{const s=t(e).test(String(d));if("function"==typeof l[e]&&s){const s=v.filter((s=>t(s).test(String(l[e]))));m.push(...s)}return s}));/on|@/gim.test(u)&&(b=!1),u.includes("for")&&void 0===n(s,"__l_for_template")&&(i(s,"__l_for_template",String(s.innerHTML).trim()),b=!1);const g=r([..._,...m]);a.push(...g);const y={compute:o(d,s,b),deps:g,value:d};c[f?u.slice("l-".length):`${e[u[0]]}:${u.slice(1)}`]=y}return[c,r(a)]},u=(e,t=!1,s=!1)=>{const n=[],i=l(e),r=!!(o=e).parentElement&&o.parentElement.hasAttribute("l-for");var o;if(!t&&(i||r))return n;if(s||t&&i||n.push(e),t||!i&&!r)for(const s of e.childNodes)if(s.nodeType===Node.ELEMENT_NODE)if(!t&&l(s))n.push(s);else{if(s.hasAttribute("l-state"))continue;n.push(...u(s,t))}return n},d=(t,s={},i=!1)=>{if(!t)throw new Error("Please provide a HTMLElement");const r=[],o=void 0!==n(t,"__l")&&l(t),a=u(t,o,i);for(const t of a)if(t.hasAttribute("l-mask")&&t.removeAttribute("l-mask"),new RegExp(`(l-|${Object.keys(e).join("|")})\\w+`,"gim").test(t.outerHTML)){const e=c(t,s);e&&r.push(e)}return r},p=(e,t,s={},n=[])=>{"string"==typeof n&&(n=[n]);const i=Object.keys(t);for(let r=0;r<e.length;r++){const o=e[r];if(-1===o.type)continue;const l=0===o.type;l&&(o.type=-1);if(n.some((e=>o.deps.includes(e)))||l)for(const[e,r]of Object.entries(o.directives)){const c=e.split(/:|\./)[0];if(!i.includes(c.toUpperCase()))continue;const a=n.some((e=>r.deps.includes(e))),u="l-mask"===e,d=0===Object.keys(r.deps).length;if(a||l||d){const n={el:o.el,name:e,data:r,node:o,state:s};m(n,t),(d||u)&&(delete o.directives[e],u&&o.el.removeAttribute("l-mask"))}}}},f=(e,t,s,n)=>{const i=[];for(const t of e)i.push(...t.deps);const o=r([...t,...i]);s.deps=o,s.directives[n].deps=o},h={BIND:({el:e,name:t,data:n,state:i})=>{switch(t.split(":")[1]){case"class":const r=n.compute(i);if("string"==typeof r)return e.setAttribute("class",s(`${e.className} ${r}`));if(r instanceof Array)return e.setAttribute("class",s(`${e.className} ${r.join(" ")}`));{const t=[];for(const e in r)r[e]&&t.push(e);const n=new RegExp(`\\b${Object.keys(r).join("|")}\\b`,"gim"),i=e.className.replace(n,"");if(t.length>0)return e.setAttribute("class",s(`${i} ${t.join(" ")}`));if(s(i).length>0)return e.setAttribute("class",s(i));if(e.hasAttribute("class"))return e.removeAttribute("class")}break;case"style":const o=n.compute(i);e.removeAttribute("style");for(const t in o)e.style[t]=o[t];break;default:const l=n.compute(i);if("object"==typeof l&&null!==l)for(const t in l)l[t]?e.setAttribute(t,l[t]):e.removeAttribute(t);else l?e.setAttribute(t.split(":")[1],l):e.removeAttribute(t.split(":")[1])}},HTML:({el:e,data:t,state:s,node:r})=>{var o;r=r;const l=n(e,"__l");e.innerHTML=null!==(o=t.compute(s))&&void 0!==o?o:t.value;const c=d(e,s,!0);l||f(c,t.deps,r,"html"),p(c,h,s,t.deps),i(e,"__l",!0)},MODEL:({el:e,name:t,data:s,state:r})=>{const o=e,l=r[s.value],c="checkbox"===o.type?"checked":"value";if(o[c]!==String(l)&&(o[c]=l),!n(o,"__l_model_registered")){const e=t.split(".")[1],n=()=>((e,t,s,n)=>{"checkbox"===e.type&&(e.value=String(e.checked));const i="number"==typeof t&&!isNaN(e.value),r="boolean"==typeof t&&("true"===e.value||"false"===e.value),o=null==t&&("null"===e.value||"undefined"===e.value);let l;return l=i?parseFloat(e.value):r?"true"===e.value:o?"null"===e.value?null:void 0:String(e.value),n[s.value]=l,l})(o,l,s,r);o.addEventListener("debounce"===e?"change":"input",n),i(o,"__l_model_registered",!0)}},ON:({el:e,name:t,data:s,state:r})=>{const o={};if(n(e,"__l_on_registered"))return;const[,l,...c]=t.split(/:|\./gim),a=["outside","global"].some((e=>String(c).includes(e)))?window:e;o.once=c.includes("once"),o.passive=c.includes("passive"),a.addEventListener(l,(t=>{if(c.includes("prevent")&&t.preventDefault(),c.includes("stop")&&t.stopPropagation(),c.includes("outside")){if(e.contains(t.target))return;if(e.offsetWidth<1&&e.offsetHeight<1)return}s.compute(r,t)}),o),i(e,"__l_on_registered",!0)},TEXT:({el:e,data:t,state:s})=>{var n;e.textContent=null!==(n=t.compute(s))&&void 0!==n?n:t.value},FOR:({el:e,data:s,state:r,node:o})=>{o=o;const l=n(e,"__l");i(e,"__l",!0);const[c,a]=s.value.split(/\s+(?:in|of)\s+/gim),[u,m]=null==c?void 0:c.trim().replace(/\(|\)/gim,"").split(","),v=r[null==a?void 0:a.trim()],b=d(e,r);let _=n(e,"__l_for_template");e.innerHTML.trim()===_&&(e.innerHTML="");const g=(null==v?void 0:v.length)-e.children.length;if(0===(null==v?void 0:v.length))e.innerHTML="";else if(0!==g)for(let s=Math.abs(g);s>0;s--)if(g<0)e.removeChild(e.lastChild);else{const n=_.startsWith("<th")?"thead":_.startsWith("<td")||_.startsWith("<tr")?"tbody":"div",i=document.createElement(n);let r=_;u&&(r=r.replace(t(`this\\.${u.trim()}`),`${a}[${v.length-s}]`)),m&&(r=r.replace(t(`this\\.${m.trim()}`),String(v.length-s))),i.innerHTML=r,e.appendChild(i.firstElementChild)}l||(f(b,s.deps,o,"for"),i(e,"__l_for_ast",d(e,r))),p(n(e,"__l_for_ast"),h,r,o.deps)}},m=(e,t)=>{t[e.name.split(/:|\./gim)[0].toUpperCase()](e)},v=(e,t)=>{const s={get:(e,t)=>"object"==typeof e[t]&&null!==e[t]?new Proxy(e[t],s):e[t],set(s,n,i){if("function"==typeof e[n])return!1;const r=!isNaN(Number(n))||"length"===n;let o=[n];return s instanceof Array&&r?o=Object.keys(e).filter((t=>{return n=e[t],i=s,n instanceof Array&&i instanceof Array&&n.length===i.length&&n.every(((e,t)=>e===i[t]));var n,i})):Object.keys(e).some((e=>void 0===s[e]))&&(o=Object.keys(e).filter((t=>"object"==typeof e[t]))),s[n]=i,t(o),!0}};return Proxy.revocable(Object.seal(e),s)};class b{constructor(e={}){this.state=e,this.directives={}}mount(e,t=!0){const s="string"==typeof e?document.querySelector(e):e;return this.ast=d(s,this.state),this.state={...this.state,$render:(e=Object.keys(this.state))=>this.render(e)},this.state=t?v(this.state,this.render.bind(this)).proxy:this.state,this.directives={...this.directives,...h},this.render(),i(s,"__l",this),this.state}directive(e,t){this.directives[e.toUpperCase()]=t}render(e=Object.keys(this.state)){p(this.ast,h,this.state,e)}}const _=e=>new b(e);exports.compile=d,exports.component=_,exports.computeExpression=o,exports.directives=h,exports.init=(e=document)=>{const t="l-state",s=[...e.querySelectorAll("[l-state]")].filter((e=>void 0===n(e,"__l")));for(let e of s){const s=e.getAttribute(t),n=e.getAttribute("l-init"),i=o(`${s||"{}"}`,e,!0)({});_(i).mount(e);const r=n?o(`${n}`,e,!0):void 0;r&&r(i)}},exports.reactive=v,exports.render=p;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e;!function(e){e["@"]="on",e[":"]="bind"}(e||(e={}));const t=e=>new RegExp(`\\b${e}\\b`,"gim"),s=e=>e.replace(/\s+/gim," ").trim(),n=(e,t)=>e[t],i=(e,t,s)=>e[t]=s,r=e=>[...new Set(e)],o=(e,t,s)=>{let n=`with($state){${null==s||s?`return ${e}`:e}}`;return(s,i)=>{try{const r=s[e];if(r)return"function"==typeof r?s[e]():r;{const e=(e,s,n=!0)=>{const i=new CustomEvent(e,s);(n?document:t||document).dispatchEvent(i)};return new Function("$state","$el","$emit","$event",n)(s,t,e,i)}}catch(s){console.warn(`Lucia Error: "${s}"\n\nExpression: "${e}"\nElement:`,t)}}},l=e=>e.hasAttribute("l-for"),c=(e,s)=>{const[n,i]=a(e,s),r=Object.keys(n).length>0,o=Object.values(n).some((({value:e})=>Object.keys(s).some((s=>t(s).test(e)))));return r?{el:e,deps:i,directives:n,type:o?1:0}:null},a=(s,l={})=>{const c={},a=[];for(const{name:u,value:d}of s.attributes){const p="l-state"===u,f=u.startsWith("l-"),h=Object.keys(e).some((e=>u.startsWith(e)));if(p||!f&&!h)continue;const m=[],v=Object.keys(l);let b=!0;const g=v.filter((e=>{const s=t(e).test(String(d));if("function"==typeof l[e]&&s){const s=v.filter((s=>t(s).test(String(l[e]))));m.push(...s)}return s}));/on|@/gim.test(u)&&(b=!1),u.includes("for")&&void 0===n(s,"__l_for_template")&&(i(s,"__l_for_template",String(s.innerHTML).trim()),b=!1);const y=r([...g,...m]);a.push(...y);const _={compute:o(d,s,b),deps:y,value:d};c[f?u.slice("l-".length):`${e[u[0]]}:${u.slice(1)}`]=_}return[c,r(a)]},u=(e,t=!1,s=!1)=>{const n=[],i=l(e),r=!!(o=e).parentElement&&o.parentElement.hasAttribute("l-for");var o;if(!t&&(i||r))return n;if(s||t&&i||n.push(e),t||!i&&!r)for(const s of e.childNodes)if(s.nodeType===Node.ELEMENT_NODE)if(!t&&l(s))n.push(s);else{if(s.hasAttribute("l-state"))continue;n.push(...u(s,t))}return n},d=(t,s={},i=!1)=>{if(!t)throw new Error("Please provide a HTMLElement");const r=[],o=void 0!==n(t,"__l")&&l(t),a=u(t,o,i);for(const t of a)if(t.hasAttribute("l-mask")&&t.removeAttribute("l-mask"),new RegExp(`(l-|${Object.keys(e).join("|")})\\w+`,"gim").test(t.outerHTML)){const e=c(t,s);e&&r.push(e)}return r},p=(e,t,s={},n=[])=>{"string"==typeof n&&(n=[n]);const i=Object.keys(t);for(let r=0;r<e.length;r++){const o=e[r];if(-1===o.type)continue;const l=0===o.type;l&&(o.type=-1);if(n.some((e=>o.deps.includes(e)))||l)for(const[e,r]of Object.entries(o.directives)){const c=e.split(/:|\./)[0];if(!i.includes(c.toUpperCase()))continue;const a=n.some((e=>r.deps.includes(e))),u="l-mask"===e,d=0===Object.keys(r.deps).length;if(a||l||d){const n={el:o.el,name:e,data:r,node:o,state:s};m(n,t),(d||u)&&(delete o.directives[e],u&&o.el.removeAttribute("l-mask"))}}}},f=(e,t,s,n)=>{const i=[];for(const t of e)i.push(...t.deps);const o=r([...t,...i]);s.deps=o,s.directives[n].deps=o},h={BIND:({el:e,name:t,data:n,state:i})=>{switch(t.split(":")[1]){case"class":const r=n.compute(i);if("string"==typeof r)return e.setAttribute("class",s(`${e.className} ${r}`));if(r instanceof Array)return e.setAttribute("class",s(`${e.className} ${r.join(" ")}`));{const t=[];for(const e in r)r[e]&&t.push(e);const n=new RegExp(`\\b${Object.keys(r).join("|")}\\b`,"gim"),i=e.className.replace(n,"");if(t.length>0)return e.setAttribute("class",s(`${i} ${t.join(" ")}`));if(s(i).length>0)return e.setAttribute("class",s(i));if(e.hasAttribute("class"))return e.removeAttribute("class")}break;case"style":const o=n.compute(i);e.removeAttribute("style");for(const t in o)e.style[t]=o[t];break;default:const l=n.compute(i);if("object"==typeof l&&null!==l)for(const t in l)l[t]?e.setAttribute(t,l[t]):e.removeAttribute(t);else l?e.setAttribute(t.split(":")[1],l):e.removeAttribute(t.split(":")[1])}},HTML:({el:e,data:t,state:s,node:r})=>{var o;r=r;const l=n(e,"__l");e.innerHTML=null!==(o=t.compute(s))&&void 0!==o?o:t.value;const c=d(e,s,!0);l||f(c,t.deps,r,"html"),p(c,h,s,t.deps),i(e,"__l",!0)},MODEL:({el:e,name:t,data:s,state:r})=>{const o=e,l=r[s.value],c="checkbox"===o.type?"checked":"value";if(o[c]!==String(l)&&(o[c]=l),!n(o,"__l_model_registered")){const e=t.split(".")[1],n=()=>((e,t,s,n)=>{"checkbox"===e.type&&(e.value=String(e.checked));const i="number"==typeof t&&!isNaN(e.value),r="boolean"==typeof t&&("true"===e.value||"false"===e.value),o=null==t&&("null"===e.value||"undefined"===e.value);let l;return l=i?parseFloat(e.value):r?"true"===e.value:o?"null"===e.value?null:void 0:String(e.value),n[s.value]=l,l})(o,l,s,r);o.addEventListener("debounce"===e?"change":"input",n),i(o,"__l_model_registered",!0)}},ON:({el:e,name:t,data:s,state:r})=>{const o={};if(n(e,"__l_on_registered"))return;const[,l,...c]=t.split(/:|\./gim),a=["outside","global"].some((e=>String(c).includes(e)))?window:e;o.once=c.includes("once"),o.passive=c.includes("passive"),a.addEventListener(l,(t=>{if(c.includes("prevent")&&t.preventDefault(),c.includes("stop")&&t.stopPropagation(),c.includes("outside")){if(e.contains(t.target))return;if(e.offsetWidth<1&&e.offsetHeight<1)return}s.compute(r,t)}),o),i(e,"__l_on_registered",!0)},TEXT:({el:e,data:t,state:s})=>{var n;e.textContent=null!==(n=t.compute(s))&&void 0!==n?n:t.value},FOR:({el:e,data:s,state:r,node:o})=>{o=o;const l=n(e,"__l");i(e,"__l",!0);const[c,a]=s.value.split(/\s+(?:in|of)\s+/gim),[u,m]=null==c?void 0:c.trim().replace(/\(|\)/gim,"").split(","),v=r[null==a?void 0:a.trim()],b=d(e,r);let g=n(e,"__l_for_template");e.innerHTML.trim()===g&&(e.innerHTML="");const y=(null==v?void 0:v.length)-e.children.length;if(0===(null==v?void 0:v.length))e.innerHTML="";else if(0!==y)for(let s=Math.abs(y);s>0;s--)if(y<0)e.removeChild(e.lastChild);else{const n=g.startsWith("<th")?"thead":g.startsWith("<td")||g.startsWith("<tr")?"tbody":"div",i=document.createElement(n);let r=g;u&&(r=r.replace(t(`this\\.${u.trim()}`),`${a}[${v.length-s}]`)),m&&(r=r.replace(t(`this\\.${m.trim()}`),String(v.length-s))),i.innerHTML=r,e.appendChild(i.firstElementChild)}l||f(b,s.deps,o,"for"),p(d(e,r),h,r,o.deps)}},m=(e,t)=>{t[e.name.split(/:|\./gim)[0].toUpperCase()](e)},v=(e,t)=>{const s={get:(e,t)=>"object"==typeof e[t]&&null!==e[t]?new Proxy(e[t],s):e[t],set(s,n,i){if("function"==typeof e[n])return!1;const r=!isNaN(Number(n))||"length"===n;let o=[n];return s instanceof Array&&r?o=Object.keys(e).filter((t=>{return n=e[t],i=s,n instanceof Array&&i instanceof Array&&n.length===i.length&&n.every(((e,t)=>e===i[t]));var n,i})):Object.keys(e).some((e=>void 0===s[e]))&&(o=Object.keys(e).filter((t=>"object"==typeof e[t]))),s[n]=i,t(o),!0}};return Proxy.revocable(Object.seal(e),s)};class b{constructor(e={}){this.state=e,this.directives={}}mount(e,t=!0){const s="string"==typeof e?document.querySelector(e):e;return this.ast=d(s,this.state),this.state={...this.state,$render:(e=Object.keys(this.state))=>this.render(e)},this.state=t?v(this.state,this.render.bind(this)).proxy:this.state,this.directives={...this.directives,...h},this.render(),i(s,"__l",this),this.state}directive(e,t){this.directives[e.toUpperCase()]=t}render(e=Object.keys(this.state)){p(this.ast,h,this.state,e)}}const g=e=>new b(e);exports.compile=d,exports.component=g,exports.computeExpression=o,exports.directives=h,exports.init=(e=document)=>{const t="l-state",s=[...e.querySelectorAll("[l-state]")].filter((e=>void 0===n(e,"__l")));for(let e of s){const s=e.getAttribute(t),n=e.getAttribute("l-init"),i=o(`${s||"{}"}`,e,!0)({});g(i).mount(e);const r=n?o(`${n}`,e,!0):void 0;r&&r(i)}},exports.reactive=v,exports.render=p;

@@ -96,3 +96,3 @@ const DIRECTIVE_PREFIX = 'l-';

if (value) {
return typeof value === 'function' ? value() : value;
return typeof value === 'function' ? state[expression]() : value;
}

@@ -390,5 +390,4 @@ else {

adjustDeps(ast, data.deps, node, 'for');
setElementCustomProp(el, '__l_for_ast', compile(el, state));
}
render(getElementCustomProp(el, '__l_for_ast'), directives, state, node.deps);
render(compile(el, state), directives, state, node.deps);
};

@@ -395,0 +394,0 @@

@@ -1,1 +0,1 @@

var t;!function(t){t["@"]="on",t[":"]="bind"}(t||(t={}));const e=t=>new RegExp(`\\b${t}\\b`,"gim"),s=t=>t.replace(/\s+/gim," ").trim(),n=(t,e)=>t[e],i=(t,e,s)=>t[e]=s,r=t=>[...new Set(t)],o=(t,e,s)=>{let n=`with($state){${null==s||s?`return ${t}`:t}}`;return(s,i)=>{try{const r=s[t];if(r)return"function"==typeof r?r():r;{const t=(t,s,n=!0)=>{const i=new CustomEvent(t,s);(n?document:e||document).dispatchEvent(i)};return new Function("$state","$el","$emit","$event",n)(s,e,t,i)}}catch(s){console.warn(`Lucia Error: "${s}"\n\nExpression: "${t}"\nElement:`,e)}}},l=t=>t.hasAttribute("l-for"),c=(t,s)=>{const[n,i]=a(t,s),r=Object.keys(n).length>0,o=Object.values(n).some((({value:t})=>Object.keys(s).some((s=>e(s).test(t)))));return r?{el:t,deps:i,directives:n,type:o?1:0}:null},a=(s,l={})=>{const c={},a=[];for(const{name:u,value:d}of s.attributes){const f="l-state"===u,p=u.startsWith("l-"),h=Object.keys(t).some((t=>u.startsWith(t)));if(f||!p&&!h)continue;const m=[],v=Object.keys(l);let b=!0;const _=v.filter((t=>{const s=e(t).test(String(d));if("function"==typeof l[t]&&s){const s=v.filter((s=>e(s).test(String(l[t]))));m.push(...s)}return s}));/on|@/gim.test(u)&&(b=!1),u.includes("for")&&void 0===n(s,"__l_for_template")&&(i(s,"__l_for_template",String(s.innerHTML).trim()),b=!1);const g=r([..._,...m]);a.push(...g);const y={compute:o(d,s,b),deps:g,value:d};c[p?u.slice("l-".length):`${t[u[0]]}:${u.slice(1)}`]=y}return[c,r(a)]},u=(t,e=!1,s=!1)=>{const n=[],i=l(t),r=!!(o=t).parentElement&&o.parentElement.hasAttribute("l-for");var o;if(!e&&(i||r))return n;if(s||e&&i||n.push(t),e||!i&&!r)for(const s of t.childNodes)if(s.nodeType===Node.ELEMENT_NODE)if(!e&&l(s))n.push(s);else{if(s.hasAttribute("l-state"))continue;n.push(...u(s,e))}return n},d=(e,s={},i=!1)=>{if(!e)throw new Error("Please provide a HTMLElement");const r=[],o=void 0!==n(e,"__l")&&l(e),a=u(e,o,i);for(const e of a)if(e.hasAttribute("l-mask")&&e.removeAttribute("l-mask"),new RegExp(`(l-|${Object.keys(t).join("|")})\\w+`,"gim").test(e.outerHTML)){const t=c(e,s);t&&r.push(t)}return r},f=(t,e,s={},n=[])=>{"string"==typeof n&&(n=[n]);const i=Object.keys(e);for(let r=0;r<t.length;r++){const o=t[r];if(-1===o.type)continue;const l=0===o.type;l&&(o.type=-1);if(n.some((t=>o.deps.includes(t)))||l)for(const[t,r]of Object.entries(o.directives)){const c=t.split(/:|\./)[0];if(!i.includes(c.toUpperCase()))continue;const a=n.some((t=>r.deps.includes(t))),u="l-mask"===t,d=0===Object.keys(r.deps).length;if(a||l||d){const n={el:o.el,name:t,data:r,node:o,state:s};m(n,e),(d||u)&&(delete o.directives[t],u&&o.el.removeAttribute("l-mask"))}}}},p=(t,e,s,n)=>{const i=[];for(const e of t)i.push(...e.deps);const o=r([...e,...i]);s.deps=o,s.directives[n].deps=o},h={BIND:({el:t,name:e,data:n,state:i})=>{switch(e.split(":")[1]){case"class":const r=n.compute(i);if("string"==typeof r)return t.setAttribute("class",s(`${t.className} ${r}`));if(r instanceof Array)return t.setAttribute("class",s(`${t.className} ${r.join(" ")}`));{const e=[];for(const t in r)r[t]&&e.push(t);const n=new RegExp(`\\b${Object.keys(r).join("|")}\\b`,"gim"),i=t.className.replace(n,"");if(e.length>0)return t.setAttribute("class",s(`${i} ${e.join(" ")}`));if(s(i).length>0)return t.setAttribute("class",s(i));if(t.hasAttribute("class"))return t.removeAttribute("class")}break;case"style":const o=n.compute(i);t.removeAttribute("style");for(const e in o)t.style[e]=o[e];break;default:const l=n.compute(i);if("object"==typeof l&&null!==l)for(const e in l)l[e]?t.setAttribute(e,l[e]):t.removeAttribute(e);else l?t.setAttribute(e.split(":")[1],l):t.removeAttribute(e.split(":")[1])}},HTML:({el:t,data:e,state:s,node:r})=>{var o;r=r;const l=n(t,"__l");t.innerHTML=null!==(o=e.compute(s))&&void 0!==o?o:e.value;const c=d(t,s,!0);l||p(c,e.deps,r,"html"),f(c,h,s,e.deps),i(t,"__l",!0)},MODEL:({el:t,name:e,data:s,state:r})=>{const o=t,l=r[s.value],c="checkbox"===o.type?"checked":"value";if(o[c]!==String(l)&&(o[c]=l),!n(o,"__l_model_registered")){const t=e.split(".")[1],n=()=>((t,e,s,n)=>{"checkbox"===t.type&&(t.value=String(t.checked));const i="number"==typeof e&&!isNaN(t.value),r="boolean"==typeof e&&("true"===t.value||"false"===t.value),o=null==e&&("null"===t.value||"undefined"===t.value);let l;return l=i?parseFloat(t.value):r?"true"===t.value:o?"null"===t.value?null:void 0:String(t.value),n[s.value]=l,l})(o,l,s,r);o.addEventListener("debounce"===t?"change":"input",n),i(o,"__l_model_registered",!0)}},ON:({el:t,name:e,data:s,state:r})=>{const o={};if(n(t,"__l_on_registered"))return;const[,l,...c]=e.split(/:|\./gim),a=["outside","global"].some((t=>String(c).includes(t)))?window:t;o.once=c.includes("once"),o.passive=c.includes("passive"),a.addEventListener(l,(e=>{if(c.includes("prevent")&&e.preventDefault(),c.includes("stop")&&e.stopPropagation(),c.includes("outside")){if(t.contains(e.target))return;if(t.offsetWidth<1&&t.offsetHeight<1)return}s.compute(r,e)}),o),i(t,"__l_on_registered",!0)},TEXT:({el:t,data:e,state:s})=>{var n;t.textContent=null!==(n=e.compute(s))&&void 0!==n?n:e.value},FOR:({el:t,data:s,state:r,node:o})=>{o=o;const l=n(t,"__l");i(t,"__l",!0);const[c,a]=s.value.split(/\s+(?:in|of)\s+/gim),[u,m]=null==c?void 0:c.trim().replace(/\(|\)/gim,"").split(","),v=r[null==a?void 0:a.trim()],b=d(t,r);let _=n(t,"__l_for_template");t.innerHTML.trim()===_&&(t.innerHTML="");const g=(null==v?void 0:v.length)-t.children.length;if(0===(null==v?void 0:v.length))t.innerHTML="";else if(0!==g)for(let s=Math.abs(g);s>0;s--)if(g<0)t.removeChild(t.lastChild);else{const n=_.startsWith("<th")?"thead":_.startsWith("<td")||_.startsWith("<tr")?"tbody":"div",i=document.createElement(n);let r=_;u&&(r=r.replace(e(`this\\.${u.trim()}`),`${a}[${v.length-s}]`)),m&&(r=r.replace(e(`this\\.${m.trim()}`),String(v.length-s))),i.innerHTML=r,t.appendChild(i.firstElementChild)}l||(p(b,s.deps,o,"for"),i(t,"__l_for_ast",d(t,r))),f(n(t,"__l_for_ast"),h,r,o.deps)}},m=(t,e)=>{e[t.name.split(/:|\./gim)[0].toUpperCase()](t)},v=(t,e)=>{const s={get:(t,e)=>"object"==typeof t[e]&&null!==t[e]?new Proxy(t[e],s):t[e],set(s,n,i){if("function"==typeof t[n])return!1;const r=!isNaN(Number(n))||"length"===n;let o=[n];return s instanceof Array&&r?o=Object.keys(t).filter((e=>{return n=t[e],i=s,n instanceof Array&&i instanceof Array&&n.length===i.length&&n.every(((t,e)=>t===i[e]));var n,i})):Object.keys(t).some((t=>void 0===s[t]))&&(o=Object.keys(t).filter((e=>"object"==typeof t[e]))),s[n]=i,e(o),!0}};return Proxy.revocable(Object.seal(t),s)};class b{constructor(t={}){this.state=t,this.directives={}}mount(t,e=!0){const s="string"==typeof t?document.querySelector(t):t;return this.ast=d(s,this.state),this.state={...this.state,$render:(t=Object.keys(this.state))=>this.render(t)},this.state=e?v(this.state,this.render.bind(this)).proxy:this.state,this.directives={...this.directives,...h},this.render(),i(s,"__l",this),this.state}directive(t,e){this.directives[t.toUpperCase()]=e}render(t=Object.keys(this.state)){f(this.ast,h,this.state,t)}}const _=t=>new b(t),g=(t=document)=>{const e="l-state",s=[...t.querySelectorAll("[l-state]")].filter((t=>void 0===n(t,"__l")));for(let t of s){const s=t.getAttribute(e),n=t.getAttribute("l-init"),i=o(`${s||"{}"}`,t,!0)({});_(i).mount(t);const r=n?o(`${n}`,t,!0):void 0;r&&r(i)}};export{d as compile,_ as component,o as computeExpression,h as directives,g as init,v as reactive,f as render};
var t;!function(t){t["@"]="on",t[":"]="bind"}(t||(t={}));const e=t=>new RegExp(`\\b${t}\\b`,"gim"),s=t=>t.replace(/\s+/gim," ").trim(),n=(t,e)=>t[e],i=(t,e,s)=>t[e]=s,r=t=>[...new Set(t)],o=(t,e,s)=>{let n=`with($state){${null==s||s?`return ${t}`:t}}`;return(s,i)=>{try{const r=s[t];if(r)return"function"==typeof r?s[t]():r;{const t=(t,s,n=!0)=>{const i=new CustomEvent(t,s);(n?document:e||document).dispatchEvent(i)};return new Function("$state","$el","$emit","$event",n)(s,e,t,i)}}catch(s){console.warn(`Lucia Error: "${s}"\n\nExpression: "${t}"\nElement:`,e)}}},l=t=>t.hasAttribute("l-for"),c=(t,s)=>{const[n,i]=a(t,s),r=Object.keys(n).length>0,o=Object.values(n).some((({value:t})=>Object.keys(s).some((s=>e(s).test(t)))));return r?{el:t,deps:i,directives:n,type:o?1:0}:null},a=(s,l={})=>{const c={},a=[];for(const{name:u,value:d}of s.attributes){const p="l-state"===u,f=u.startsWith("l-"),h=Object.keys(t).some((t=>u.startsWith(t)));if(p||!f&&!h)continue;const m=[],v=Object.keys(l);let b=!0;const g=v.filter((t=>{const s=e(t).test(String(d));if("function"==typeof l[t]&&s){const s=v.filter((s=>e(s).test(String(l[t]))));m.push(...s)}return s}));/on|@/gim.test(u)&&(b=!1),u.includes("for")&&void 0===n(s,"__l_for_template")&&(i(s,"__l_for_template",String(s.innerHTML).trim()),b=!1);const y=r([...g,...m]);a.push(...y);const _={compute:o(d,s,b),deps:y,value:d};c[f?u.slice("l-".length):`${t[u[0]]}:${u.slice(1)}`]=_}return[c,r(a)]},u=(t,e=!1,s=!1)=>{const n=[],i=l(t),r=!!(o=t).parentElement&&o.parentElement.hasAttribute("l-for");var o;if(!e&&(i||r))return n;if(s||e&&i||n.push(t),e||!i&&!r)for(const s of t.childNodes)if(s.nodeType===Node.ELEMENT_NODE)if(!e&&l(s))n.push(s);else{if(s.hasAttribute("l-state"))continue;n.push(...u(s,e))}return n},d=(e,s={},i=!1)=>{if(!e)throw new Error("Please provide a HTMLElement");const r=[],o=void 0!==n(e,"__l")&&l(e),a=u(e,o,i);for(const e of a)if(e.hasAttribute("l-mask")&&e.removeAttribute("l-mask"),new RegExp(`(l-|${Object.keys(t).join("|")})\\w+`,"gim").test(e.outerHTML)){const t=c(e,s);t&&r.push(t)}return r},p=(t,e,s={},n=[])=>{"string"==typeof n&&(n=[n]);const i=Object.keys(e);for(let r=0;r<t.length;r++){const o=t[r];if(-1===o.type)continue;const l=0===o.type;l&&(o.type=-1);if(n.some((t=>o.deps.includes(t)))||l)for(const[t,r]of Object.entries(o.directives)){const c=t.split(/:|\./)[0];if(!i.includes(c.toUpperCase()))continue;const a=n.some((t=>r.deps.includes(t))),u="l-mask"===t,d=0===Object.keys(r.deps).length;if(a||l||d){const n={el:o.el,name:t,data:r,node:o,state:s};m(n,e),(d||u)&&(delete o.directives[t],u&&o.el.removeAttribute("l-mask"))}}}},f=(t,e,s,n)=>{const i=[];for(const e of t)i.push(...e.deps);const o=r([...e,...i]);s.deps=o,s.directives[n].deps=o},h={BIND:({el:t,name:e,data:n,state:i})=>{switch(e.split(":")[1]){case"class":const r=n.compute(i);if("string"==typeof r)return t.setAttribute("class",s(`${t.className} ${r}`));if(r instanceof Array)return t.setAttribute("class",s(`${t.className} ${r.join(" ")}`));{const e=[];for(const t in r)r[t]&&e.push(t);const n=new RegExp(`\\b${Object.keys(r).join("|")}\\b`,"gim"),i=t.className.replace(n,"");if(e.length>0)return t.setAttribute("class",s(`${i} ${e.join(" ")}`));if(s(i).length>0)return t.setAttribute("class",s(i));if(t.hasAttribute("class"))return t.removeAttribute("class")}break;case"style":const o=n.compute(i);t.removeAttribute("style");for(const e in o)t.style[e]=o[e];break;default:const l=n.compute(i);if("object"==typeof l&&null!==l)for(const e in l)l[e]?t.setAttribute(e,l[e]):t.removeAttribute(e);else l?t.setAttribute(e.split(":")[1],l):t.removeAttribute(e.split(":")[1])}},HTML:({el:t,data:e,state:s,node:r})=>{var o;r=r;const l=n(t,"__l");t.innerHTML=null!==(o=e.compute(s))&&void 0!==o?o:e.value;const c=d(t,s,!0);l||f(c,e.deps,r,"html"),p(c,h,s,e.deps),i(t,"__l",!0)},MODEL:({el:t,name:e,data:s,state:r})=>{const o=t,l=r[s.value],c="checkbox"===o.type?"checked":"value";if(o[c]!==String(l)&&(o[c]=l),!n(o,"__l_model_registered")){const t=e.split(".")[1],n=()=>((t,e,s,n)=>{"checkbox"===t.type&&(t.value=String(t.checked));const i="number"==typeof e&&!isNaN(t.value),r="boolean"==typeof e&&("true"===t.value||"false"===t.value),o=null==e&&("null"===t.value||"undefined"===t.value);let l;return l=i?parseFloat(t.value):r?"true"===t.value:o?"null"===t.value?null:void 0:String(t.value),n[s.value]=l,l})(o,l,s,r);o.addEventListener("debounce"===t?"change":"input",n),i(o,"__l_model_registered",!0)}},ON:({el:t,name:e,data:s,state:r})=>{const o={};if(n(t,"__l_on_registered"))return;const[,l,...c]=e.split(/:|\./gim),a=["outside","global"].some((t=>String(c).includes(t)))?window:t;o.once=c.includes("once"),o.passive=c.includes("passive"),a.addEventListener(l,(e=>{if(c.includes("prevent")&&e.preventDefault(),c.includes("stop")&&e.stopPropagation(),c.includes("outside")){if(t.contains(e.target))return;if(t.offsetWidth<1&&t.offsetHeight<1)return}s.compute(r,e)}),o),i(t,"__l_on_registered",!0)},TEXT:({el:t,data:e,state:s})=>{var n;t.textContent=null!==(n=e.compute(s))&&void 0!==n?n:e.value},FOR:({el:t,data:s,state:r,node:o})=>{o=o;const l=n(t,"__l");i(t,"__l",!0);const[c,a]=s.value.split(/\s+(?:in|of)\s+/gim),[u,m]=null==c?void 0:c.trim().replace(/\(|\)/gim,"").split(","),v=r[null==a?void 0:a.trim()],b=d(t,r);let g=n(t,"__l_for_template");t.innerHTML.trim()===g&&(t.innerHTML="");const y=(null==v?void 0:v.length)-t.children.length;if(0===(null==v?void 0:v.length))t.innerHTML="";else if(0!==y)for(let s=Math.abs(y);s>0;s--)if(y<0)t.removeChild(t.lastChild);else{const n=g.startsWith("<th")?"thead":g.startsWith("<td")||g.startsWith("<tr")?"tbody":"div",i=document.createElement(n);let r=g;u&&(r=r.replace(e(`this\\.${u.trim()}`),`${a}[${v.length-s}]`)),m&&(r=r.replace(e(`this\\.${m.trim()}`),String(v.length-s))),i.innerHTML=r,t.appendChild(i.firstElementChild)}l||f(b,s.deps,o,"for"),p(d(t,r),h,r,o.deps)}},m=(t,e)=>{e[t.name.split(/:|\./gim)[0].toUpperCase()](t)},v=(t,e)=>{const s={get:(t,e)=>"object"==typeof t[e]&&null!==t[e]?new Proxy(t[e],s):t[e],set(s,n,i){if("function"==typeof t[n])return!1;const r=!isNaN(Number(n))||"length"===n;let o=[n];return s instanceof Array&&r?o=Object.keys(t).filter((e=>{return n=t[e],i=s,n instanceof Array&&i instanceof Array&&n.length===i.length&&n.every(((t,e)=>t===i[e]));var n,i})):Object.keys(t).some((t=>void 0===s[t]))&&(o=Object.keys(t).filter((e=>"object"==typeof t[e]))),s[n]=i,e(o),!0}};return Proxy.revocable(Object.seal(t),s)};class b{constructor(t={}){this.state=t,this.directives={}}mount(t,e=!0){const s="string"==typeof t?document.querySelector(t):t;return this.ast=d(s,this.state),this.state={...this.state,$render:(t=Object.keys(this.state))=>this.render(t)},this.state=e?v(this.state,this.render.bind(this)).proxy:this.state,this.directives={...this.directives,...h},this.render(),i(s,"__l",this),this.state}directive(t,e){this.directives[t.toUpperCase()]=e}render(t=Object.keys(this.state)){p(this.ast,h,this.state,t)}}const g=t=>new b(t),y=(t=document)=>{const e="l-state",s=[...t.querySelectorAll("[l-state]")].filter((t=>void 0===n(t,"__l")));for(let t of s){const s=t.getAttribute(e),n=t.getAttribute("l-init"),i=o(`${s||"{}"}`,t,!0)({});g(i).mount(t);const r=n?o(`${n}`,t,!0):void 0;r&&r(i)}};export{d as compile,g as component,o as computeExpression,h as directives,y as init,v as reactive,p as render};

@@ -99,3 +99,3 @@ var Lucia = (function () {

if (value) {
return typeof value === 'function' ? value() : value;
return typeof value === 'function' ? state[expression]() : value;
}

@@ -393,5 +393,4 @@ else {

adjustDeps(ast, data.deps, node, 'for');
setElementCustomProp(el, '__l_for_ast', compile(el, state));
}
render(getElementCustomProp(el, '__l_for_ast'), directives, state, node.deps);
render(compile(el, state), directives, state, node.deps);
};

@@ -398,0 +397,0 @@

@@ -1,1 +0,1 @@

var Lucia=function(){"use strict";const t="l-";var e;!function(t){t["@"]="on",t[":"]="bind"}(e||(e={}));const s=t=>new RegExp(`\\b${t}\\b`,"gim"),n=t=>t.replace(/\s+/gim," ").trim(),i=(t,e)=>t[e],r=(t,e,s)=>t[e]=s,o=t=>[...new Set(t)],l=(t,e,s)=>{let n=`with($state){${null==s||s?`return ${t}`:t}}`;return(s,i)=>{try{const r=s[t];if(r)return"function"==typeof r?r():r;{const t=(t,s,n=!0)=>{const i=new CustomEvent(t,s);(n?document:e||document).dispatchEvent(i)};return new Function("$state","$el","$emit","$event",n)(s,e,t,i)}}catch(s){console.warn(`Lucia Error: "${s}"\n\nExpression: "${t}"\nElement:`,e)}}},c=t=>t.hasAttribute("l-for"),a=(t,e)=>{const[n,i]=u(t,e),r=Object.keys(n).length>0,o=Object.values(n).some((({value:t})=>Object.keys(e).some((e=>s(e).test(t)))));return r?{el:t,deps:i,directives:n,type:o?1:0}:null},u=(n,c={})=>{const a={},u=[];for(const{name:d,value:p}of n.attributes){const f="l-state"===d,m=d.startsWith(t),h=Object.keys(e).some((t=>d.startsWith(t)));if(f||!m&&!h)continue;const v=[],b=Object.keys(c);let _=!0;const g=b.filter((t=>{const e=s(t).test(String(p));if("function"==typeof c[t]&&e){const e=b.filter((e=>s(e).test(String(c[t]))));v.push(...e)}return e}));/on|@/gim.test(d)&&(_=!1),d.includes("for")&&void 0===i(n,"__l_for_template")&&(r(n,"__l_for_template",String(n.innerHTML).trim()),_=!1);const y=o([...g,...v]);u.push(...y);const $={compute:l(p,n,_),deps:y,value:p};a[m?d.slice(t.length):`${e[d[0]]}:${d.slice(1)}`]=$}return[a,o(u)]},d=(t,e=!1,s=!1)=>{const n=[],i=c(t),r=!!(o=t).parentElement&&o.parentElement.hasAttribute("l-for");var o;if(!e&&(i||r))return n;if(s||e&&i||n.push(t),e||!i&&!r)for(const s of t.childNodes)if(s.nodeType===Node.ELEMENT_NODE)if(!e&&c(s))n.push(s);else{if(s.hasAttribute("l-state"))continue;n.push(...d(s,e))}return n},p=(t,s={},n=!1)=>{if(!t)throw new Error("Please provide a HTMLElement");const r=[],o=void 0!==i(t,"__l")&&c(t),l=d(t,o,n);for(const t of l)if(t.hasAttribute("l-mask")&&t.removeAttribute("l-mask"),new RegExp(`(l-|${Object.keys(e).join("|")})\\w+`,"gim").test(t.outerHTML)){const e=a(t,s);e&&r.push(e)}return r},f=(t,e,s={},n=[])=>{"string"==typeof n&&(n=[n]);const i=Object.keys(e);for(let r=0;r<t.length;r++){const o=t[r];if(-1===o.type)continue;const l=0===o.type;l&&(o.type=-1);if(n.some((t=>o.deps.includes(t)))||l)for(const[t,r]of Object.entries(o.directives)){const c=t.split(/:|\./)[0];if(!i.includes(c.toUpperCase()))continue;const a=n.some((t=>r.deps.includes(t))),u="l-mask"===t,d=0===Object.keys(r.deps).length;if(a||l||d){const n={el:o.el,name:t,data:r,node:o,state:s};v(n,e),(d||u)&&(delete o.directives[t],u&&o.el.removeAttribute("l-mask"))}}}},m=(t,e,s,n)=>{const i=[];for(const e of t)i.push(...e.deps);const r=o([...e,...i]);s.deps=r,s.directives[n].deps=r},h={BIND:({el:t,name:e,data:s,state:i})=>{switch(e.split(":")[1]){case"class":const r=s.compute(i);if("string"==typeof r)return t.setAttribute("class",n(`${t.className} ${r}`));if(r instanceof Array)return t.setAttribute("class",n(`${t.className} ${r.join(" ")}`));{const e=[];for(const t in r)r[t]&&e.push(t);const s=new RegExp(`\\b${Object.keys(r).join("|")}\\b`,"gim"),i=t.className.replace(s,"");if(e.length>0)return t.setAttribute("class",n(`${i} ${e.join(" ")}`));if(n(i).length>0)return t.setAttribute("class",n(i));if(t.hasAttribute("class"))return t.removeAttribute("class")}break;case"style":const o=s.compute(i);t.removeAttribute("style");for(const e in o)t.style[e]=o[e];break;default:const l=s.compute(i);if("object"==typeof l&&null!==l)for(const e in l)l[e]?t.setAttribute(e,l[e]):t.removeAttribute(e);else l?t.setAttribute(e.split(":")[1],l):t.removeAttribute(e.split(":")[1])}},HTML:({el:t,data:e,state:s,node:n})=>{var o;n=n;const l=i(t,"__l");t.innerHTML=null!==(o=e.compute(s))&&void 0!==o?o:e.value;const c=p(t,s,!0);l||m(c,e.deps,n,"html"),f(c,h,s,e.deps),r(t,"__l",!0)},MODEL:({el:t,name:e,data:s,state:n})=>{const o=t,l=n[s.value],c="checkbox"===o.type?"checked":"value";if(o[c]!==String(l)&&(o[c]=l),!i(o,"__l_model_registered")){const t=e.split(".")[1],i=()=>((t,e,s,n)=>{"checkbox"===t.type&&(t.value=String(t.checked));const i="number"==typeof e&&!isNaN(t.value),r="boolean"==typeof e&&("true"===t.value||"false"===t.value),o=null==e&&("null"===t.value||"undefined"===t.value);let l;return l=i?parseFloat(t.value):r?"true"===t.value:o?"null"===t.value?null:void 0:String(t.value),n[s.value]=l,l})(o,l,s,n);o.addEventListener("debounce"===t?"change":"input",i),r(o,"__l_model_registered",!0)}},ON:({el:t,name:e,data:s,state:n})=>{const o={};if(i(t,"__l_on_registered"))return;const[,l,...c]=e.split(/:|\./gim),a=["outside","global"].some((t=>String(c).includes(t)))?window:t;o.once=c.includes("once"),o.passive=c.includes("passive"),a.addEventListener(l,(e=>{if(c.includes("prevent")&&e.preventDefault(),c.includes("stop")&&e.stopPropagation(),c.includes("outside")){if(t.contains(e.target))return;if(t.offsetWidth<1&&t.offsetHeight<1)return}s.compute(n,e)}),o),r(t,"__l_on_registered",!0)},TEXT:({el:t,data:e,state:s})=>{var n;t.textContent=null!==(n=e.compute(s))&&void 0!==n?n:e.value},FOR:({el:t,data:e,state:n,node:o})=>{o=o;const l=i(t,"__l");r(t,"__l",!0);const[c,a]=e.value.split(/\s+(?:in|of)\s+/gim),[u,d]=null==c?void 0:c.trim().replace(/\(|\)/gim,"").split(","),v=n[null==a?void 0:a.trim()],b=p(t,n);let _=i(t,"__l_for_template");t.innerHTML.trim()===_&&(t.innerHTML="");const g=(null==v?void 0:v.length)-t.children.length;if(0===(null==v?void 0:v.length))t.innerHTML="";else if(0!==g)for(let e=Math.abs(g);e>0;e--)if(g<0)t.removeChild(t.lastChild);else{const n=_.startsWith("<th")?"thead":_.startsWith("<td")||_.startsWith("<tr")?"tbody":"div",i=document.createElement(n);let r=_;u&&(r=r.replace(s(`this\\.${u.trim()}`),`${a}[${v.length-e}]`)),d&&(r=r.replace(s(`this\\.${d.trim()}`),String(v.length-e))),i.innerHTML=r,t.appendChild(i.firstElementChild)}l||(m(b,e.deps,o,"for"),r(t,"__l_for_ast",p(t,n))),f(i(t,"__l_for_ast"),h,n,o.deps)}},v=(t,e)=>{e[t.name.split(/:|\./gim)[0].toUpperCase()](t)},b=(t,e)=>{const s={get:(t,e)=>"object"==typeof t[e]&&null!==t[e]?new Proxy(t[e],s):t[e],set(s,n,i){if("function"==typeof t[n])return!1;const r=!isNaN(Number(n))||"length"===n;let o=[n];return s instanceof Array&&r?o=Object.keys(t).filter((e=>{return n=t[e],i=s,n instanceof Array&&i instanceof Array&&n.length===i.length&&n.every(((t,e)=>t===i[e]));var n,i})):Object.keys(t).some((t=>void 0===s[t]))&&(o=Object.keys(t).filter((e=>"object"==typeof t[e]))),s[n]=i,e(o),!0}};return Proxy.revocable(Object.seal(t),s)};class _{constructor(t={}){this.state=t,this.directives={}}mount(t,e=!0){const s="string"==typeof t?document.querySelector(t):t;return this.ast=p(s,this.state),this.state={...this.state,$render:(t=Object.keys(this.state))=>this.render(t)},this.state=e?b(this.state,this.render.bind(this)).proxy:this.state,this.directives={...this.directives,...h},this.render(),r(s,"__l",this),this.state}directive(t,e){this.directives[t.toUpperCase()]=e}render(t=Object.keys(this.state)){f(this.ast,h,this.state,t)}}const g=t=>new _(t),y=(t=document)=>{const e="l-state",s=[...t.querySelectorAll("[l-state]")].filter((t=>void 0===i(t,"__l")));for(let t of s){const s=t.getAttribute(e),n=t.getAttribute("l-init"),i=l(`${s||"{}"}`,t,!0)({});g(i).mount(t);const r=n?l(`${n}`,t,!0):void 0;r&&r(i)}};var $=Object.freeze({__proto__:null,component:g,compile:p,render:f,reactive:b,directives:h,computeExpression:l,init:y});const E=()=>y(),j=async()=>{await new Promise((t=>{"loading"===document.readyState?document.addEventListener("DOMContentLoaded",t):t()})),E(),document.addEventListener("turbolinks:load",E),document.addEventListener("turbo:load",E)};return window.__l?window.__l((()=>j())):j(),$}();
var Lucia=function(){"use strict";const t="l-";var e;!function(t){t["@"]="on",t[":"]="bind"}(e||(e={}));const s=t=>new RegExp(`\\b${t}\\b`,"gim"),n=t=>t.replace(/\s+/gim," ").trim(),i=(t,e)=>t[e],r=(t,e,s)=>t[e]=s,o=t=>[...new Set(t)],l=(t,e,s)=>{let n=`with($state){${null==s||s?`return ${t}`:t}}`;return(s,i)=>{try{const r=s[t];if(r)return"function"==typeof r?s[t]():r;{const t=(t,s,n=!0)=>{const i=new CustomEvent(t,s);(n?document:e||document).dispatchEvent(i)};return new Function("$state","$el","$emit","$event",n)(s,e,t,i)}}catch(s){console.warn(`Lucia Error: "${s}"\n\nExpression: "${t}"\nElement:`,e)}}},c=t=>t.hasAttribute("l-for"),a=(t,e)=>{const[n,i]=u(t,e),r=Object.keys(n).length>0,o=Object.values(n).some((({value:t})=>Object.keys(e).some((e=>s(e).test(t)))));return r?{el:t,deps:i,directives:n,type:o?1:0}:null},u=(n,c={})=>{const a={},u=[];for(const{name:d,value:p}of n.attributes){const f="l-state"===d,m=d.startsWith(t),h=Object.keys(e).some((t=>d.startsWith(t)));if(f||!m&&!h)continue;const v=[],b=Object.keys(c);let _=!0;const g=b.filter((t=>{const e=s(t).test(String(p));if("function"==typeof c[t]&&e){const e=b.filter((e=>s(e).test(String(c[t]))));v.push(...e)}return e}));/on|@/gim.test(d)&&(_=!1),d.includes("for")&&void 0===i(n,"__l_for_template")&&(r(n,"__l_for_template",String(n.innerHTML).trim()),_=!1);const y=o([...g,...v]);u.push(...y);const $={compute:l(p,n,_),deps:y,value:p};a[m?d.slice(t.length):`${e[d[0]]}:${d.slice(1)}`]=$}return[a,o(u)]},d=(t,e=!1,s=!1)=>{const n=[],i=c(t),r=!!(o=t).parentElement&&o.parentElement.hasAttribute("l-for");var o;if(!e&&(i||r))return n;if(s||e&&i||n.push(t),e||!i&&!r)for(const s of t.childNodes)if(s.nodeType===Node.ELEMENT_NODE)if(!e&&c(s))n.push(s);else{if(s.hasAttribute("l-state"))continue;n.push(...d(s,e))}return n},p=(t,s={},n=!1)=>{if(!t)throw new Error("Please provide a HTMLElement");const r=[],o=void 0!==i(t,"__l")&&c(t),l=d(t,o,n);for(const t of l)if(t.hasAttribute("l-mask")&&t.removeAttribute("l-mask"),new RegExp(`(l-|${Object.keys(e).join("|")})\\w+`,"gim").test(t.outerHTML)){const e=a(t,s);e&&r.push(e)}return r},f=(t,e,s={},n=[])=>{"string"==typeof n&&(n=[n]);const i=Object.keys(e);for(let r=0;r<t.length;r++){const o=t[r];if(-1===o.type)continue;const l=0===o.type;l&&(o.type=-1);if(n.some((t=>o.deps.includes(t)))||l)for(const[t,r]of Object.entries(o.directives)){const c=t.split(/:|\./)[0];if(!i.includes(c.toUpperCase()))continue;const a=n.some((t=>r.deps.includes(t))),u="l-mask"===t,d=0===Object.keys(r.deps).length;if(a||l||d){const n={el:o.el,name:t,data:r,node:o,state:s};v(n,e),(d||u)&&(delete o.directives[t],u&&o.el.removeAttribute("l-mask"))}}}},m=(t,e,s,n)=>{const i=[];for(const e of t)i.push(...e.deps);const r=o([...e,...i]);s.deps=r,s.directives[n].deps=r},h={BIND:({el:t,name:e,data:s,state:i})=>{switch(e.split(":")[1]){case"class":const r=s.compute(i);if("string"==typeof r)return t.setAttribute("class",n(`${t.className} ${r}`));if(r instanceof Array)return t.setAttribute("class",n(`${t.className} ${r.join(" ")}`));{const e=[];for(const t in r)r[t]&&e.push(t);const s=new RegExp(`\\b${Object.keys(r).join("|")}\\b`,"gim"),i=t.className.replace(s,"");if(e.length>0)return t.setAttribute("class",n(`${i} ${e.join(" ")}`));if(n(i).length>0)return t.setAttribute("class",n(i));if(t.hasAttribute("class"))return t.removeAttribute("class")}break;case"style":const o=s.compute(i);t.removeAttribute("style");for(const e in o)t.style[e]=o[e];break;default:const l=s.compute(i);if("object"==typeof l&&null!==l)for(const e in l)l[e]?t.setAttribute(e,l[e]):t.removeAttribute(e);else l?t.setAttribute(e.split(":")[1],l):t.removeAttribute(e.split(":")[1])}},HTML:({el:t,data:e,state:s,node:n})=>{var o;n=n;const l=i(t,"__l");t.innerHTML=null!==(o=e.compute(s))&&void 0!==o?o:e.value;const c=p(t,s,!0);l||m(c,e.deps,n,"html"),f(c,h,s,e.deps),r(t,"__l",!0)},MODEL:({el:t,name:e,data:s,state:n})=>{const o=t,l=n[s.value],c="checkbox"===o.type?"checked":"value";if(o[c]!==String(l)&&(o[c]=l),!i(o,"__l_model_registered")){const t=e.split(".")[1],i=()=>((t,e,s,n)=>{"checkbox"===t.type&&(t.value=String(t.checked));const i="number"==typeof e&&!isNaN(t.value),r="boolean"==typeof e&&("true"===t.value||"false"===t.value),o=null==e&&("null"===t.value||"undefined"===t.value);let l;return l=i?parseFloat(t.value):r?"true"===t.value:o?"null"===t.value?null:void 0:String(t.value),n[s.value]=l,l})(o,l,s,n);o.addEventListener("debounce"===t?"change":"input",i),r(o,"__l_model_registered",!0)}},ON:({el:t,name:e,data:s,state:n})=>{const o={};if(i(t,"__l_on_registered"))return;const[,l,...c]=e.split(/:|\./gim),a=["outside","global"].some((t=>String(c).includes(t)))?window:t;o.once=c.includes("once"),o.passive=c.includes("passive"),a.addEventListener(l,(e=>{if(c.includes("prevent")&&e.preventDefault(),c.includes("stop")&&e.stopPropagation(),c.includes("outside")){if(t.contains(e.target))return;if(t.offsetWidth<1&&t.offsetHeight<1)return}s.compute(n,e)}),o),r(t,"__l_on_registered",!0)},TEXT:({el:t,data:e,state:s})=>{var n;t.textContent=null!==(n=e.compute(s))&&void 0!==n?n:e.value},FOR:({el:t,data:e,state:n,node:o})=>{o=o;const l=i(t,"__l");r(t,"__l",!0);const[c,a]=e.value.split(/\s+(?:in|of)\s+/gim),[u,d]=null==c?void 0:c.trim().replace(/\(|\)/gim,"").split(","),v=n[null==a?void 0:a.trim()],b=p(t,n);let _=i(t,"__l_for_template");t.innerHTML.trim()===_&&(t.innerHTML="");const g=(null==v?void 0:v.length)-t.children.length;if(0===(null==v?void 0:v.length))t.innerHTML="";else if(0!==g)for(let e=Math.abs(g);e>0;e--)if(g<0)t.removeChild(t.lastChild);else{const n=_.startsWith("<th")?"thead":_.startsWith("<td")||_.startsWith("<tr")?"tbody":"div",i=document.createElement(n);let r=_;u&&(r=r.replace(s(`this\\.${u.trim()}`),`${a}[${v.length-e}]`)),d&&(r=r.replace(s(`this\\.${d.trim()}`),String(v.length-e))),i.innerHTML=r,t.appendChild(i.firstElementChild)}l||m(b,e.deps,o,"for"),f(p(t,n),h,n,o.deps)}},v=(t,e)=>{e[t.name.split(/:|\./gim)[0].toUpperCase()](t)},b=(t,e)=>{const s={get:(t,e)=>"object"==typeof t[e]&&null!==t[e]?new Proxy(t[e],s):t[e],set(s,n,i){if("function"==typeof t[n])return!1;const r=!isNaN(Number(n))||"length"===n;let o=[n];return s instanceof Array&&r?o=Object.keys(t).filter((e=>{return n=t[e],i=s,n instanceof Array&&i instanceof Array&&n.length===i.length&&n.every(((t,e)=>t===i[e]));var n,i})):Object.keys(t).some((t=>void 0===s[t]))&&(o=Object.keys(t).filter((e=>"object"==typeof t[e]))),s[n]=i,e(o),!0}};return Proxy.revocable(Object.seal(t),s)};class _{constructor(t={}){this.state=t,this.directives={}}mount(t,e=!0){const s="string"==typeof t?document.querySelector(t):t;return this.ast=p(s,this.state),this.state={...this.state,$render:(t=Object.keys(this.state))=>this.render(t)},this.state=e?b(this.state,this.render.bind(this)).proxy:this.state,this.directives={...this.directives,...h},this.render(),r(s,"__l",this),this.state}directive(t,e){this.directives[t.toUpperCase()]=e}render(t=Object.keys(this.state)){f(this.ast,h,this.state,t)}}const g=t=>new _(t),y=(t=document)=>{const e="l-state",s=[...t.querySelectorAll("[l-state]")].filter((t=>void 0===i(t,"__l")));for(let t of s){const s=t.getAttribute(e),n=t.getAttribute("l-init"),i=l(`${s||"{}"}`,t,!0)({});g(i).mount(t);const r=n?l(`${n}`,t,!0):void 0;r&&r(i)}};var $=Object.freeze({__proto__:null,component:g,compile:p,render:f,reactive:b,directives:h,computeExpression:l,init:y});const E=()=>y(),j=async()=>{await new Promise((t=>{"loading"===document.readyState?document.addEventListener("DOMContentLoaded",t):t()})),E(),document.addEventListener("turbolinks:load",E),document.addEventListener("turbo:load",E)};return window.__l?window.__l((()=>j())):j(),$}();
{
"name": "lucia",
"version": "0.4.5",
"version": "0.4.6-0",
"description": "3kb library for tiny web apps",

@@ -5,0 +5,0 @@ "main": "dist/lucia.cjs.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc