Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo-mod-jslibs-dist.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-07-21 10:57:00 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-07-21 11:08:24 +0300
commit9446184f84a8a678b6712bd3f49bdb282d1e14e7 (patch)
tree897cdf9da6b322d70dfe6774f52047e1b631e1bc
parent99f542f0c2fb665466c4e1ec3d11713d086d31cf (diff)
Update to Alpine 3.10.3HEADalpinejs/v3.21000.20300main
-rw-r--r--alpinejs/packages/alpinejs/dist/cdn.js95
-rw-r--r--alpinejs/packages/alpinejs/dist/cdn.min.js4
-rw-r--r--alpinejs/packages/alpinejs/dist/module.cjs.js95
-rw-r--r--alpinejs/packages/alpinejs/dist/module.esm.js95
-rw-r--r--alpinejs/packages/alpinejs/package.json2
-rw-r--r--alpinejs/packages/alpinejs/src/binds.js45
-rw-r--r--alpinejs/packages/alpinejs/src/directives.js25
-rw-r--r--alpinejs/packages/alpinejs/src/directives/x-bind.js49
-rw-r--r--alpinejs/packages/alpinejs/src/directives/x-show.js4
-rw-r--r--alpinejs/packages/alpinejs/src/directives/x-transition.js5
-rw-r--r--alpinejs/packages/alpinejs/src/utils/bind.js12
-rw-r--r--alpinejs/packages/collapse/package.json2
-rw-r--r--alpinejs/packages/csp/dist/cdn.js95
-rw-r--r--alpinejs/packages/csp/dist/cdn.min.js4
-rw-r--r--alpinejs/packages/csp/dist/module.cjs.js95
-rw-r--r--alpinejs/packages/csp/dist/module.esm.js95
-rw-r--r--alpinejs/packages/docs/package.json2
-rw-r--r--alpinejs/packages/docs/src/en/directives/on.md4
-rw-r--r--alpinejs/packages/docs/src/en/directives/show.md17
-rw-r--r--alpinejs/packages/docs/src/en/essentials/installation.md2
-rw-r--r--alpinejs/packages/docs/src/en/magics/store.md2
-rw-r--r--alpinejs/packages/docs/src/en/plugins/focus.md20
-rw-r--r--alpinejs/packages/docs/src/en/plugins/mask.md2
-rw-r--r--alpinejs/packages/docs/src/en/plugins/morph.md22
-rw-r--r--alpinejs/packages/docs/src/en/ui.md6
-rw-r--r--alpinejs/packages/focus/dist/cdn.js3
-rw-r--r--alpinejs/packages/focus/dist/cdn.min.js2
-rw-r--r--alpinejs/packages/focus/dist/module.cjs.js13
-rw-r--r--alpinejs/packages/focus/dist/module.esm.js3
-rw-r--r--alpinejs/packages/focus/package.json2
-rw-r--r--alpinejs/packages/focus/src/index.js3
-rw-r--r--alpinejs/packages/intersect/package.json2
-rw-r--r--alpinejs/packages/mask/dist/cdn.js6
-rw-r--r--alpinejs/packages/mask/dist/cdn.min.js2
-rw-r--r--alpinejs/packages/mask/dist/module.cjs.js6
-rw-r--r--alpinejs/packages/mask/dist/module.esm.js6
-rw-r--r--alpinejs/packages/mask/package.json2
-rw-r--r--alpinejs/packages/mask/src/index.js7
-rw-r--r--alpinejs/packages/morph/dist/cdn.js4
-rw-r--r--alpinejs/packages/morph/dist/cdn.min.js4
-rw-r--r--alpinejs/packages/morph/dist/module.cjs.js4
-rw-r--r--alpinejs/packages/morph/dist/module.esm.js4
-rw-r--r--alpinejs/packages/morph/package.json2
-rw-r--r--alpinejs/packages/morph/src/dom.js4
-rw-r--r--alpinejs/packages/persist/package.json2
-rw-r--r--alpinejs/packages/portal/builds/cdn.js5
-rw-r--r--alpinejs/packages/portal/builds/module.js3
-rw-r--r--alpinejs/packages/portal/src/index.js62
-rw-r--r--alpinejs/packages/ui/builds/cdn.js5
-rw-r--r--alpinejs/packages/ui/builds/module.js3
-rw-r--r--alpinejs/packages/ui/dist/cdn.js132
-rw-r--r--alpinejs/packages/ui/dist/cdn.min.js1
-rw-r--r--alpinejs/packages/ui/dist/module.cjs.js141
-rw-r--r--alpinejs/packages/ui/dist/module.esm.js131
-rw-r--r--alpinejs/packages/ui/package.json (renamed from alpinejs/packages/portal/package.json)6
-rw-r--r--alpinejs/packages/ui/src/combobox.js550
-rw-r--r--alpinejs/packages/ui/src/dialog.js92
-rw-r--r--alpinejs/packages/ui/src/index.js5
-rw-r--r--alpinejs/packages/ui/src/popover.js191
-rw-r--r--alpinejs/packages/ui/src/tabs.js136
60 files changed, 1935 insertions, 408 deletions
diff --git a/alpinejs/packages/alpinejs/dist/cdn.js b/alpinejs/packages/alpinejs/dist/cdn.js
index aeca34f..8efaead 100644
--- a/alpinejs/packages/alpinejs/dist/cdn.js
+++ b/alpinejs/packages/alpinejs/dist/cdn.js
@@ -531,8 +531,23 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
directiveHandlers[name] = callback;
}
function directives(el, attributes, originalAttributeOverride) {
+ attributes = Array.from(attributes);
+ if (el._x_virtualDirectives) {
+ let vAttributes = Object.entries(el._x_virtualDirectives).map(([name, value]) => ({name, value}));
+ let staticAttributes = attributesOnly(vAttributes);
+ vAttributes = vAttributes.map((attribute) => {
+ if (staticAttributes.find((attr) => attr.name === attribute.name)) {
+ return {
+ name: `x-bind:${attribute.name}`,
+ value: `"${attribute.value}"`
+ };
+ }
+ return attribute;
+ });
+ attributes = attributes.concat(vAttributes);
+ }
let transformedAttributeMap = {};
- let directives2 = Array.from(attributes).map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority);
+ let directives2 = attributes.map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority);
return directives2.map((directive2) => {
return getDirectiveHandler(el, directive2);
});
@@ -647,8 +662,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
"show",
"if",
DEFAULT,
- "teleport",
- "element"
+ "teleport"
];
function byPriority(a, b) {
let typeA = directiveOrder.indexOf(a.type) === -1 ? DEFAULT : a.type;
@@ -993,9 +1007,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
};
}
window.Element.prototype._x_toggleAndCascadeWithTransitions = function(el, value, show, hide) {
- let clickAwayCompatibleShow = () => {
- document.visibilityState === "visible" ? requestAnimationFrame(show) : setTimeout(show);
- };
+ const nextTick2 = document.visibilityState === "visible" ? requestAnimationFrame : setTimeout;
+ let clickAwayCompatibleShow = () => nextTick2(show);
if (value) {
if (el._x_transition && (el._x_transition.enter || el._x_transition.leave)) {
el._x_transition.enter && (Object.entries(el._x_transition.enter.during).length || Object.entries(el._x_transition.enter.start).length || Object.entries(el._x_transition.enter.end).length) ? el._x_transition.in(show) : clickAwayCompatibleShow();
@@ -1016,7 +1029,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
closest._x_hideChildren = [];
closest._x_hideChildren.push(el);
} else {
- queueMicrotask(() => {
+ nextTick2(() => {
let hideAfterChildren = (el2) => {
let carry = Promise.all([
el2._x_hidePromise,
@@ -1380,8 +1393,13 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
// packages/alpinejs/src/binds.js
var binds = {};
- function bind2(name, object) {
- binds[name] = typeof object !== "function" ? () => object : object;
+ function bind2(name, bindings) {
+ let getBindings = typeof bindings !== "function" ? () => bindings : bindings;
+ if (name instanceof Element) {
+ applyBindingsObject(name, getBindings());
+ } else {
+ binds[name] = getBindings;
+ }
}
function injectBindingProviders(obj) {
Object.entries(binds).forEach(([name, callback]) => {
@@ -1395,6 +1413,26 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
});
return obj;
}
+ function applyBindingsObject(el, obj, original) {
+ let cleanupRunners = [];
+ while (cleanupRunners.length)
+ cleanupRunners.pop()();
+ let attributes = Object.entries(obj).map(([name, value]) => ({name, value}));
+ let staticAttributes = attributesOnly(attributes);
+ attributes = attributes.map((attribute) => {
+ if (staticAttributes.find((attr) => attr.name === attribute.name)) {
+ return {
+ name: `x-bind:${attribute.name}`,
+ value: `"${attribute.value}"`
+ };
+ }
+ return attribute;
+ });
+ directives(el, attributes, original).map((handle) => {
+ cleanupRunners.push(handle.runCleanups);
+ handle();
+ });
+ }
// packages/alpinejs/src/datas.js
var datas = {};
@@ -1429,7 +1467,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
get raw() {
return raw;
},
- version: "3.10.2",
+ version: "3.10.3",
flushAndStopDeferringMutations,
dontAutoEvaluateFunctions,
disableEffectScheduling,
@@ -2580,7 +2618,13 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
mapAttributes(startingWith(":", into(prefix("bind:"))));
directive("bind", (el, {value, modifiers, expression, original}, {effect: effect3}) => {
if (!value) {
- return applyBindingsObject(el, expression, original, effect3);
+ let bindingProviders = {};
+ injectBindingProviders(bindingProviders);
+ let getBindings = evaluateLater(el, expression);
+ getBindings((bindings) => {
+ applyBindingsObject(el, bindings, original);
+ }, {scope: bindingProviders});
+ return;
}
if (value === "key")
return storeKeyForXFor(el, expression);
@@ -2591,31 +2635,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
mutateDom(() => bind(el, value, result, modifiers));
}));
});
- function applyBindingsObject(el, expression, original, effect3) {
- let bindingProviders = {};
- injectBindingProviders(bindingProviders);
- let getBindings = evaluateLater(el, expression);
- let cleanupRunners = [];
- while (cleanupRunners.length)
- cleanupRunners.pop()();
- getBindings((bindings) => {
- let attributes = Object.entries(bindings).map(([name, value]) => ({name, value}));
- let staticAttributes = attributesOnly(attributes);
- attributes = attributes.map((attribute) => {
- if (staticAttributes.find((attr) => attr.name === attribute.name)) {
- return {
- name: `x-bind:${attribute.name}`,
- value: `"${attribute.value}"`
- };
- }
- return attribute;
- });
- directives(el, attributes, original).map((handle) => {
- cleanupRunners.push(handle.runCleanups);
- handle();
- });
- }, {scope: bindingProviders});
- }
function storeKeyForXFor(el, expression) {
el._x_keyExpression = expression;
}
@@ -2650,7 +2669,9 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
let evaluate2 = evaluateLater(el, expression);
if (!el._x_doHide)
el._x_doHide = () => {
- mutateDom(() => el.style.display = "none");
+ mutateDom(() => {
+ el.style.setProperty("display", "none", modifiers.includes("important") ? "important" : void 0);
+ });
};
if (!el._x_doShow)
el._x_doShow = () => {
diff --git a/alpinejs/packages/alpinejs/dist/cdn.min.js b/alpinejs/packages/alpinejs/dist/cdn.min.js
index 01f9fcd..6c152b5 100644
--- a/alpinejs/packages/alpinejs/dist/cdn.min.js
+++ b/alpinejs/packages/alpinejs/dist/cdn.min.js
@@ -1,5 +1,5 @@
-(()=>{var Ge=!1,Ye=!1,K=[];function Lt(e){cn(e)}function cn(e){K.includes(e)||K.push(e),ln()}function he(e){let t=K.indexOf(e);t!==-1&&K.splice(t,1)}function ln(){!Ye&&!Ge&&(Ge=!0,queueMicrotask(un))}function un(){Ge=!1,Ye=!0;for(let e=0;e<K.length;e++)K[e]();K.length=0,Ye=!1}var A,B,Y,Je,Ze=!0;function Ft(e){Ze=!1,e(),Ze=!0}function jt(e){A=e.reactive,Y=e.release,B=t=>e.effect(t,{scheduler:r=>{Ze?Lt(r):r()}}),Je=e.raw}function Qe(e){B=e}function Kt(e){let t=()=>{};return[n=>{let i=B(n);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(o=>o())}),e._x_effects.add(i),t=()=>{i!==void 0&&(e._x_effects.delete(i),Y(i))},i},()=>{t()}]}var Bt=[],zt=[],Vt=[];function Ht(e){Vt.push(e)}function _e(e,t){typeof t=="function"?(e._x_cleanups||(e._x_cleanups=[]),e._x_cleanups.push(t)):(t=e,zt.push(t))}function qt(e){Bt.push(e)}function ge(e,t,r){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(r)}function Xe(e,t){!e._x_attributeCleanups||Object.entries(e._x_attributeCleanups).forEach(([r,n])=>{(t===void 0||t.includes(r))&&(n.forEach(i=>i()),delete e._x_attributeCleanups[r])})}var tt=new MutationObserver(et),rt=!1;function nt(){tt.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),rt=!0}function it(){fn(),tt.disconnect(),rt=!1}var te=[],ot=!1;function fn(){te=te.concat(tt.takeRecords()),te.length&&!ot&&(ot=!0,queueMicrotask(()=>{dn(),ot=!1}))}function dn(){et(te),te.length=0}function m(e){if(!rt)return e();it();let t=e();return nt(),t}var st=!1,xe=[];function Ut(){st=!0}function Wt(){st=!1,et(xe),xe=[]}function et(e){if(st){xe=xe.concat(e);return}let t=[],r=[],n=new Map,i=new Map;for(let o=0;o<e.length;o++)if(!e[o].target._x_ignoreMutationObserver&&(e[o].type==="childList"&&(e[o].addedNodes.forEach(s=>s.nodeType===1&&t.push(s)),e[o].removedNodes.forEach(s=>s.nodeType===1&&r.push(s))),e[o].type==="attributes")){let s=e[o].target,a=e[o].attributeName,c=e[o].oldValue,l=()=>{n.has(s)||n.set(s,[]),n.get(s).push({name:a,value:s.getAttribute(a)})},u=()=>{i.has(s)||i.set(s,[]),i.get(s).push(a)};s.hasAttribute(a)&&c===null?l():s.hasAttribute(a)?(u(),l()):u()}i.forEach((o,s)=>{Xe(s,o)}),n.forEach((o,s)=>{Bt.forEach(a=>a(s,o))});for(let o of r)if(!t.includes(o)&&(zt.forEach(s=>s(o)),o._x_cleanups))for(;o._x_cleanups.length;)o._x_cleanups.pop()();t.forEach(o=>{o._x_ignoreSelf=!0,o._x_ignore=!0});for(let o of t)r.includes(o)||!o.isConnected||(delete o._x_ignoreSelf,delete o._x_ignore,Vt.forEach(s=>s(o)),o._x_ignore=!0,o._x_ignoreSelf=!0);t.forEach(o=>{delete o._x_ignoreSelf,delete o._x_ignore}),t=null,r=null,n=null,i=null}function ye(e){return I(P(e))}function C(e,t,r){return e._x_dataStack=[t,...P(r||e)],()=>{e._x_dataStack=e._x_dataStack.filter(n=>n!==t)}}function at(e,t){let r=e._x_dataStack[0];Object.entries(t).forEach(([n,i])=>{r[n]=i})}function P(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?P(e.host):e.parentNode?P(e.parentNode):[]}function I(e){let t=new Proxy({},{ownKeys:()=>Array.from(new Set(e.flatMap(r=>Object.keys(r)))),has:(r,n)=>e.some(i=>i.hasOwnProperty(n)),get:(r,n)=>(e.find(i=>{if(i.hasOwnProperty(n)){let o=Object.getOwnPropertyDescriptor(i,n);if(o.get&&o.get._x_alreadyBound||o.set&&o.set._x_alreadyBound)return!0;if((o.get||o.set)&&o.enumerable){let s=o.get,a=o.set,c=o;s=s&&s.bind(t),a=a&&a.bind(t),s&&(s._x_alreadyBound=!0),a&&(a._x_alreadyBound=!0),Object.defineProperty(i,n,{...c,get:s,set:a})}return!0}return!1})||{})[n],set:(r,n,i)=>{let o=e.find(s=>s.hasOwnProperty(n));return o?o[n]=i:e[e.length-1][n]=i,!0}});return t}function be(e){let t=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,r=(n,i="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([o,{value:s,enumerable:a}])=>{if(a===!1||s===void 0)return;let c=i===""?o:`${i}.${o}`;typeof s=="object"&&s!==null&&s._x_interceptor?n[o]=s.initialize(e,c,o):t(s)&&s!==n&&!(s instanceof Element)&&r(s,c)})};return r(e)}function ve(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,o){return e(this.initialValue,()=>pn(n,i),s=>ct(n,i,s),i,o)}};return t(r),n=>{if(typeof n=="object"&&n!==null&&n._x_interceptor){let i=r.initialize.bind(r);r.initialize=(o,s,a)=>{let c=n.initialize(o,s,a);return r.initialValue=c,i(o,s,a)}}else r.initialValue=n;return r}}function pn(e,t){return t.split(".").reduce((r,n)=>r[n],e)}function ct(e,t,r){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=r;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),ct(e[t[0]],t.slice(1),r)}}var Gt={};function x(e,t){Gt[e]=t}function re(e,t){return Object.entries(Gt).forEach(([r,n])=>{Object.defineProperty(e,`$${r}`,{get(){let[i,o]=lt(t);return i={interceptor:ve,...i},_e(t,o),n(t,i)},enumerable:!1})}),{obj:e,cleanup:()=>{t=null}}}function Yt(e,t,r,...n){try{return r(...n)}catch(i){J(i,e,t)}}function J(e,t,r=void 0){Object.assign(e,{el:t,expression:r}),console.warn(`Alpine Expression Error: ${e.message}
+(()=>{var Ge=!1,Ye=!1,B=[];function Ft(e){ln(e)}function ln(e){B.includes(e)||B.push(e),un()}function he(e){let t=B.indexOf(e);t!==-1&&B.splice(t,1)}function un(){!Ye&&!Ge&&(Ge=!0,queueMicrotask(fn))}function fn(){Ge=!1,Ye=!0;for(let e=0;e<B.length;e++)B[e]();B.length=0,Ye=!1}var A,K,Y,Je,Ze=!0;function Bt(e){Ze=!1,e(),Ze=!0}function Kt(e){A=e.reactive,Y=e.release,K=t=>e.effect(t,{scheduler:r=>{Ze?Ft(r):r()}}),Je=e.raw}function Qe(e){K=e}function zt(e){let t=()=>{};return[n=>{let i=K(n);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(o=>o())}),e._x_effects.add(i),t=()=>{i!==void 0&&(e._x_effects.delete(i),Y(i))},i},()=>{t()}]}var Vt=[],Ht=[],qt=[];function Ut(e){qt.push(e)}function _e(e,t){typeof t=="function"?(e._x_cleanups||(e._x_cleanups=[]),e._x_cleanups.push(t)):(t=e,Ht.push(t))}function Wt(e){Vt.push(e)}function ge(e,t,r){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(r)}function Xe(e,t){!e._x_attributeCleanups||Object.entries(e._x_attributeCleanups).forEach(([r,n])=>{(t===void 0||t.includes(r))&&(n.forEach(i=>i()),delete e._x_attributeCleanups[r])})}var tt=new MutationObserver(et),rt=!1;function nt(){tt.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),rt=!0}function it(){dn(),tt.disconnect(),rt=!1}var te=[],ot=!1;function dn(){te=te.concat(tt.takeRecords()),te.length&&!ot&&(ot=!0,queueMicrotask(()=>{pn(),ot=!1}))}function pn(){et(te),te.length=0}function m(e){if(!rt)return e();it();let t=e();return nt(),t}var st=!1,xe=[];function Gt(){st=!0}function Yt(){st=!1,et(xe),xe=[]}function et(e){if(st){xe=xe.concat(e);return}let t=[],r=[],n=new Map,i=new Map;for(let o=0;o<e.length;o++)if(!e[o].target._x_ignoreMutationObserver&&(e[o].type==="childList"&&(e[o].addedNodes.forEach(s=>s.nodeType===1&&t.push(s)),e[o].removedNodes.forEach(s=>s.nodeType===1&&r.push(s))),e[o].type==="attributes")){let s=e[o].target,a=e[o].attributeName,c=e[o].oldValue,l=()=>{n.has(s)||n.set(s,[]),n.get(s).push({name:a,value:s.getAttribute(a)})},u=()=>{i.has(s)||i.set(s,[]),i.get(s).push(a)};s.hasAttribute(a)&&c===null?l():s.hasAttribute(a)?(u(),l()):u()}i.forEach((o,s)=>{Xe(s,o)}),n.forEach((o,s)=>{Vt.forEach(a=>a(s,o))});for(let o of r)if(!t.includes(o)&&(Ht.forEach(s=>s(o)),o._x_cleanups))for(;o._x_cleanups.length;)o._x_cleanups.pop()();t.forEach(o=>{o._x_ignoreSelf=!0,o._x_ignore=!0});for(let o of t)r.includes(o)||!o.isConnected||(delete o._x_ignoreSelf,delete o._x_ignore,qt.forEach(s=>s(o)),o._x_ignore=!0,o._x_ignoreSelf=!0);t.forEach(o=>{delete o._x_ignoreSelf,delete o._x_ignore}),t=null,r=null,n=null,i=null}function ye(e){return D(k(e))}function C(e,t,r){return e._x_dataStack=[t,...k(r||e)],()=>{e._x_dataStack=e._x_dataStack.filter(n=>n!==t)}}function at(e,t){let r=e._x_dataStack[0];Object.entries(t).forEach(([n,i])=>{r[n]=i})}function k(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?k(e.host):e.parentNode?k(e.parentNode):[]}function D(e){let t=new Proxy({},{ownKeys:()=>Array.from(new Set(e.flatMap(r=>Object.keys(r)))),has:(r,n)=>e.some(i=>i.hasOwnProperty(n)),get:(r,n)=>(e.find(i=>{if(i.hasOwnProperty(n)){let o=Object.getOwnPropertyDescriptor(i,n);if(o.get&&o.get._x_alreadyBound||o.set&&o.set._x_alreadyBound)return!0;if((o.get||o.set)&&o.enumerable){let s=o.get,a=o.set,c=o;s=s&&s.bind(t),a=a&&a.bind(t),s&&(s._x_alreadyBound=!0),a&&(a._x_alreadyBound=!0),Object.defineProperty(i,n,{...c,get:s,set:a})}return!0}return!1})||{})[n],set:(r,n,i)=>{let o=e.find(s=>s.hasOwnProperty(n));return o?o[n]=i:e[e.length-1][n]=i,!0}});return t}function be(e){let t=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,r=(n,i="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([o,{value:s,enumerable:a}])=>{if(a===!1||s===void 0)return;let c=i===""?o:`${i}.${o}`;typeof s=="object"&&s!==null&&s._x_interceptor?n[o]=s.initialize(e,c,o):t(s)&&s!==n&&!(s instanceof Element)&&r(s,c)})};return r(e)}function ve(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,o){return e(this.initialValue,()=>mn(n,i),s=>ct(n,i,s),i,o)}};return t(r),n=>{if(typeof n=="object"&&n!==null&&n._x_interceptor){let i=r.initialize.bind(r);r.initialize=(o,s,a)=>{let c=n.initialize(o,s,a);return r.initialValue=c,i(o,s,a)}}else r.initialValue=n;return r}}function mn(e,t){return t.split(".").reduce((r,n)=>r[n],e)}function ct(e,t,r){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=r;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),ct(e[t[0]],t.slice(1),r)}}var Jt={};function x(e,t){Jt[e]=t}function re(e,t){return Object.entries(Jt).forEach(([r,n])=>{Object.defineProperty(e,`$${r}`,{get(){let[i,o]=lt(t);return i={interceptor:ve,...i},_e(t,o),n(t,i)},enumerable:!1})}),{obj:e,cleanup:()=>{t=null}}}function Zt(e,t,r,...n){try{return r(...n)}catch(i){J(i,e,t)}}function J(e,t,r=void 0){Object.assign(e,{el:t,expression:r}),console.warn(`Alpine Expression Error: ${e.message}
${r?'Expression: "'+r+`"
-`:""}`,t),setTimeout(()=>{throw e},0)}var we=!0;function Jt(e){let t=we;we=!1,e(),we=t}function k(e,t,r={}){let n;return g(e,t)(i=>n=i,r),n}function g(...e){return Zt(...e)}var Zt=ut;function Qt(e){Zt=e}function ut(e,t){let r={},n=re(r,e).cleanup;ge(e,"evaluator",n);let i=[r,...P(e)];if(typeof t=="function")return mn(i,t);let o=hn(i,t,e);return Yt.bind(null,e,t,o)}function mn(e,t){return(r=()=>{},{scope:n={},params:i=[]}={})=>{let o=t.apply(I([n,...e]),i);Ee(r,o)}}var ft={};function _n(e,t){if(ft[e])return ft[e];let r=Object.getPrototypeOf(async function(){}).constructor,n=/^[\n\s]*if.*\(.*\)/.test(e)||/^(let|const)\s/.test(e)?`(() => { ${e} })()`:e,o=(()=>{try{return new r(["__self","scope"],`with (scope) { __self.result = ${n} }; __self.finished = true; return __self.result;`)}catch(s){return J(s,t,e),Promise.resolve()}})();return ft[e]=o,o}function hn(e,t,r){let n=_n(t,r);return(i=()=>{},{scope:o={},params:s=[]}={})=>{n.result=void 0,n.finished=!1;let a=I([o,...e]);if(typeof n=="function"){let c=n(n,a).catch(l=>J(l,r,t));n.finished?(Ee(i,n.result,a,s,r),n.result=void 0):c.then(l=>{Ee(i,l,a,s,r)}).catch(l=>J(l,r,t)).finally(()=>n.result=void 0)}}}function Ee(e,t,r,n,i){if(we&&typeof t=="function"){let o=t.apply(r,n);o instanceof Promise?o.then(s=>Ee(e,s,r,n)).catch(s=>J(s,i,t)):e(o)}else e(t)}var dt="x-";function E(e=""){return dt+e}function Xt(e){dt=e}var er={};function d(e,t){er[e]=t}function ne(e,t,r){let n={};return Array.from(t).map(tr((o,s)=>n[o]=s)).filter(rr).map(xn(n,r)).sort(yn).map(o=>gn(e,o))}function nr(e){return Array.from(e).map(tr()).filter(t=>!rr(t))}var pt=!1,ie=new Map,ir=Symbol();function or(e){pt=!0;let t=Symbol();ir=t,ie.set(t,[]);let r=()=>{for(;ie.get(t).length;)ie.get(t).shift()();ie.delete(t)},n=()=>{pt=!1,r()};e(r),n()}function lt(e){let t=[],r=a=>t.push(a),[n,i]=Kt(e);return t.push(i),[{Alpine:D,effect:n,cleanup:r,evaluateLater:g.bind(g,e),evaluate:k.bind(k,e)},()=>t.forEach(a=>a())]}function gn(e,t){let r=()=>{},n=er[t.type]||r,[i,o]=lt(e);ge(e,t.original,o);let s=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,i),n=n.bind(n,e,t,i),pt?ie.get(ir).push(n):n())};return s.runCleanups=o,s}var Se=(e,t)=>({name:r,value:n})=>(r.startsWith(e)&&(r=r.replace(e,t)),{name:r,value:n}),Ae=e=>e;function tr(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=sr.reduce((o,s)=>s(o),{name:t,value:r});return n!==t&&e(n,t),{name:n,value:i}}}var sr=[];function Z(e){sr.push(e)}function rr({name:e}){return ar().test(e)}var ar=()=>new RegExp(`^${dt}([^:^.]+)\\b`);function xn(e,t){return({name:r,value:n})=>{let i=r.match(ar()),o=r.match(/:([a-zA-Z0-9\-:]+)/),s=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],a=t||e[r]||r;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:s.map(c=>c.replace(".","")),expression:n,original:a}}}var mt="DEFAULT",Oe=["ignore","ref","data","id","bind","init","for","mask","model","modelable","transition","show","if",mt,"teleport","element"];function yn(e,t){let r=Oe.indexOf(e.type)===-1?mt:e.type,n=Oe.indexOf(t.type)===-1?mt:t.type;return Oe.indexOf(r)-Oe.indexOf(n)}function z(e,t,r={}){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0}))}var ht=[],_t=!1;function Ce(e=()=>{}){return queueMicrotask(()=>{_t||setTimeout(()=>{Te()})}),new Promise(t=>{ht.push(()=>{e(),t()})})}function Te(){for(_t=!1;ht.length;)ht.shift()()}function cr(){_t=!0}function R(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(i=>R(i,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;for(;n;)R(n,t,!1),n=n.nextElementSibling}function O(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}function ur(){document.body||O("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),z(document,"alpine:init"),z(document,"alpine:initializing"),nt(),Ht(t=>w(t,R)),_e(t=>gt(t)),qt((t,r)=>{ne(t,r).forEach(n=>n())});let e=t=>!V(t.parentElement,!0);Array.from(document.querySelectorAll(lr())).filter(e).forEach(t=>{w(t)}),z(document,"alpine:initialized")}var xt=[],fr=[];function dr(){return xt.map(e=>e())}function lr(){return xt.concat(fr).map(e=>e())}function Re(e){xt.push(e)}function Me(e){fr.push(e)}function V(e,t=!1){return Q(e,r=>{if((t?lr():dr()).some(i=>r.matches(i)))return!0})}function Q(e,t){if(!!e){if(t(e))return e;if(e._x_teleportBack&&(e=e._x_teleportBack),!!e.parentElement)return Q(e.parentElement,t)}}function pr(e){return dr().some(t=>e.matches(t))}function w(e,t=R){or(()=>{t(e,(r,n)=>{ne(r,r.attributes).forEach(i=>i()),r._x_ignore&&n()})})}function gt(e){R(e,t=>Xe(t))}function oe(e,t){return Array.isArray(t)?mr(e,t.join(" ")):typeof t=="object"&&t!==null?bn(e,t):typeof t=="function"?oe(e,t()):mr(e,t)}function mr(e,t){let r=o=>o.split(" ").filter(Boolean),n=o=>o.split(" ").filter(s=>!e.classList.contains(s)).filter(Boolean),i=o=>(e.classList.add(...o),()=>{e.classList.remove(...o)});return t=t===!0?t="":t||"",i(n(t))}function bn(e,t){let r=a=>a.split(" ").filter(Boolean),n=Object.entries(t).flatMap(([a,c])=>c?r(a):!1).filter(Boolean),i=Object.entries(t).flatMap(([a,c])=>c?!1:r(a)).filter(Boolean),o=[],s=[];return i.forEach(a=>{e.classList.contains(a)&&(e.classList.remove(a),s.push(a))}),n.forEach(a=>{e.classList.contains(a)||(e.classList.add(a),o.push(a))}),()=>{s.forEach(a=>e.classList.add(a)),o.forEach(a=>e.classList.remove(a))}}function H(e,t){return typeof t=="object"&&t!==null?vn(e,t):wn(e,t)}function vn(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{r[n]=e.style[n],n.startsWith("--")||(n=En(n)),e.style.setProperty(n,i)}),setTimeout(()=>{e.style.length===0&&e.removeAttribute("style")}),()=>{H(e,r)}}function wn(e,t){let r=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",r||"")}}function En(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function se(e,t=()=>{}){let r=!1;return function(){r?t.apply(this,arguments):(r=!0,e.apply(this,arguments))}}d("transition",(e,{value:t,modifiers:r,expression:n},{evaluate:i})=>{typeof n=="function"&&(n=i(n)),n?Sn(e,n,t):An(e,r,t)});function Sn(e,t,r){hr(e,oe,""),{enter:i=>{e._x_transition.enter.during=i},"enter-start":i=>{e._x_transition.enter.start=i},"enter-end":i=>{e._x_transition.enter.end=i},leave:i=>{e._x_transition.leave.during=i},"leave-start":i=>{e._x_transition.leave.start=i},"leave-end":i=>{e._x_transition.leave.end=i}}[r](t)}function An(e,t,r){hr(e,H);let n=!t.includes("in")&&!t.includes("out")&&!r,i=n||t.includes("in")||["enter"].includes(r),o=n||t.includes("out")||["leave"].includes(r);t.includes("in")&&!n&&(t=t.filter((h,b)=>b<t.indexOf("out"))),t.includes("out")&&!n&&(t=t.filter((h,b)=>b>t.indexOf("out")));let s=!t.includes("opacity")&&!t.includes("scale"),a=s||t.includes("opacity"),c=s||t.includes("scale"),l=a?0:1,u=c?ae(t,"scale",95)/100:1,p=ae(t,"delay",0),y=ae(t,"origin","center"),N="opacity, transform",W=ae(t,"duration",150)/1e3,pe=ae(t,"duration",75)/1e3,f="cubic-bezier(0.4, 0.0, 0.2, 1)";i&&(e._x_transition.enter.during={transformOrigin:y,transitionDelay:p,transitionProperty:N,transitionDuration:`${W}s`,transitionTimingFunction:f},e._x_transition.enter.start={opacity:l,transform:`scale(${u})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"}),o&&(e._x_transition.leave.during={transformOrigin:y,transitionDelay:p,transitionProperty:N,transitionDuration:`${pe}s`,transitionTimingFunction:f},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:l,transform:`scale(${u})`})}function hr(e,t,r={}){e._x_transition||(e._x_transition={enter:{during:r,start:r,end:r},leave:{during:r,start:r,end:r},in(n=()=>{},i=()=>{}){Ne(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,i)},out(n=()=>{},i=()=>{}){Ne(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,i)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,r,n){let i=()=>{document.visibilityState==="visible"?requestAnimationFrame(r):setTimeout(r)};if(t){e._x_transition&&(e._x_transition.enter||e._x_transition.leave)?e._x_transition.enter&&(Object.entries(e._x_transition.enter.during).length||Object.entries(e._x_transition.enter.start).length||Object.entries(e._x_transition.enter.end).length)?e._x_transition.in(r):i():e._x_transition?e._x_transition.in(r):i();return}e._x_hidePromise=e._x_transition?new Promise((o,s)=>{e._x_transition.out(()=>{},()=>o(n)),e._x_transitioning.beforeCancel(()=>s({isFromCancelledTransition:!0}))}):Promise.resolve(n),queueMicrotask(()=>{let o=_r(e);o?(o._x_hideChildren||(o._x_hideChildren=[]),o._x_hideChildren.push(e)):queueMicrotask(()=>{let s=a=>{let c=Promise.all([a._x_hidePromise,...(a._x_hideChildren||[]).map(s)]).then(([l])=>l());return delete a._x_hidePromise,delete a._x_hideChildren,c};s(e).catch(a=>{if(!a.isFromCancelledTransition)throw a})})})};function _r(e){let t=e.parentNode;if(!!t)return t._x_hidePromise?t:_r(t)}function Ne(e,t,{during:r,start:n,end:i}={},o=()=>{},s=()=>{}){if(e._x_transitioning&&e._x_transitioning.cancel(),Object.keys(r).length===0&&Object.keys(n).length===0&&Object.keys(i).length===0){o(),s();return}let a,c,l;On(e,{start(){a=t(e,n)},during(){c=t(e,r)},before:o,end(){a(),l=t(e,i)},after:s,cleanup(){c(),l()}})}function On(e,t){let r,n,i,o=se(()=>{m(()=>{r=!0,n||t.before(),i||(t.end(),Te()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(s){this.beforeCancels.push(s)},cancel:se(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();o()}),finish:o},m(()=>{t.start(),t.during()}),cr(),requestAnimationFrame(()=>{if(r)return;let s=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,a=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;s===0&&(s=Number(getComputedStyle(e).animationDuration.replace("s",""))*1e3),m(()=>{t.before()}),n=!0,requestAnimationFrame(()=>{r||(m(()=>{t.end()}),Te(),setTimeout(e._x_transitioning.finish,s+a),i=!0)})})}function ae(e,t,r){if(e.indexOf(t)===-1)return r;let n=e[e.indexOf(t)+1];if(!n||t==="scale"&&isNaN(n))return r;if(t==="duration"){let i=n.match(/([0-9]+)ms/);if(i)return i[1]}return t==="origin"&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[n,e[e.indexOf(t)+2]].join(" "):n}var yt=!1;function $(e,t=()=>{}){return(...r)=>yt?t(...r):e(...r)}function gr(e,t){t._x_dataStack||(t._x_dataStack=e._x_dataStack),yt=!0,Cn(()=>{Tn(t)}),yt=!1}function Tn(e){let t=!1;w(e,(n,i)=>{R(n,(o,s)=>{if(t&&pr(o))return s();t=!0,i(o,s)})})}function Cn(e){let t=B;Qe((r,n)=>{let i=t(r);return Y(i),()=>{}}),e(),Qe(t)}function ce(e,t,r,n=[]){switch(e._x_bindings||(e._x_bindings=A({})),e._x_bindings[t]=r,t=n.includes("camel")?Pn(t):t,t){case"value":Rn(e,r);break;case"style":Nn(e,r);break;case"class":Mn(e,r);break;default:kn(e,t,r);break}}function Rn(e,t){if(e.type==="radio")e.attributes.value===void 0&&(e.value=t),window.fromModel&&(e.checked=xr(e.value,t));else if(e.type==="checkbox")Number.isInteger(t)?e.value=t:!Number.isInteger(t)&&!Array.isArray(t)&&typeof t!="boolean"&&![null,void 0].includes(t)?e.value=String(t):Array.isArray(t)?e.checked=t.some(r=>xr(r,e.value)):e.checked=!!t;else if(e.tagName==="SELECT")In(e,t);else{if(e.value===t)return;e.value=t}}function Mn(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedClasses=oe(e,t)}function Nn(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles(),e._x_undoAddedStyles=H(e,t)}function kn(e,t,r){[null,void 0,!1].includes(r)&&$n(t)?e.removeAttribute(t):(yr(t)&&(r=t),Dn(e,t,r))}function Dn(e,t,r){e.getAttribute(t)!=r&&e.setAttribute(t,r)}function In(e,t){let r=[].concat(t).map(n=>n+"");Array.from(e.options).forEach(n=>{n.selected=r.includes(n.value)})}function Pn(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function xr(e,t){return e==t}function yr(e){return["disabled","checked","required","readonly","hidden","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"].includes(e)}function $n(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}function br(e,t,r){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];let n=e.getAttribute(t);return n===null?typeof r=="function"?r():r:yr(t)?!![t,"true"].includes(n):n===""?!0:n}function ke(e,t){var r;return function(){var n=this,i=arguments,o=function(){r=null,e.apply(n,i)};clearTimeout(r),r=setTimeout(o,t)}}function Pe(e,t){let r;return function(){let n=this,i=arguments;r||(e.apply(n,i),r=!0,setTimeout(()=>r=!1,t))}}function vr(e){e(D)}var q={},wr=!1;function Er(e,t){if(wr||(q=A(q),wr=!0),t===void 0)return q[e];q[e]=t,typeof t=="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init=="function"&&q[e].init(),be(q[e])}function Sr(){return q}var Ar={};function Or(e,t){Ar[e]=typeof t!="function"?()=>t:t}function Tr(e){return Object.entries(Ar).forEach(([t,r])=>{Object.defineProperty(e,t,{get(){return(...n)=>r(...n)}})}),e}var Cr={};function Rr(e,t){Cr[e]=t}function Mr(e,t){return Object.entries(Cr).forEach(([r,n])=>{Object.defineProperty(e,r,{get(){return(...i)=>n.bind(t)(...i)},enumerable:!1})}),e}var Ln={get reactive(){return A},get release(){return Y},get effect(){return B},get raw(){return Je},version:"3.10.2",flushAndStopDeferringMutations:Wt,dontAutoEvaluateFunctions:Jt,disableEffectScheduling:Ft,stopObservingMutations:it,destroyTree:gt,setReactivityEngine:jt,closestDataStack:P,skipDuringClone:$,addRootSelector:Re,addInitSelector:Me,addScopeToNode:C,deferMutations:Ut,mapAttributes:Z,evaluateLater:g,setEvaluator:Qt,mergeProxies:I,findClosest:Q,closestRoot:V,interceptor:ve,transition:Ne,setStyles:H,mutateDom:m,directive:d,throttle:Pe,debounce:ke,evaluate:k,initTree:w,nextTick:Ce,prefixed:E,prefix:Xt,plugin:vr,magic:x,store:Er,start:ur,clone:gr,bound:br,$data:ye,data:Rr,bind:Or},D=Ln;function bt(e,t){let r=Object.create(null),n=e.split(",");for(let i=0;i<n.length;i++)r[n[i]]=!0;return t?i=>!!r[i.toLowerCase()]:i=>!!r[i]}var ns={[1]:"TEXT",[2]:"CLASS",[4]:"STYLE",[8]:"PROPS",[16]:"FULL_PROPS",[32]:"HYDRATE_EVENTS",[64]:"STABLE_FRAGMENT",[128]:"KEYED_FRAGMENT",[256]:"UNKEYED_FRAGMENT",[512]:"NEED_PATCH",[1024]:"DYNAMIC_SLOTS",[2048]:"DEV_ROOT_FRAGMENT",[-1]:"HOISTED",[-2]:"BAIL"},is={[1]:"STABLE",[2]:"DYNAMIC",[3]:"FORWARDED"};var Fn="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var os=bt(Fn+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var Nr=Object.freeze({}),ss=Object.freeze([]);var vt=Object.assign;var jn=Object.prototype.hasOwnProperty,le=(e,t)=>jn.call(e,t),L=Array.isArray,X=e=>kr(e)==="[object Map]";var Kn=e=>typeof e=="string",Ie=e=>typeof e=="symbol",ue=e=>e!==null&&typeof e=="object";var Bn=Object.prototype.toString,kr=e=>Bn.call(e),wt=e=>kr(e).slice(8,-1);var De=e=>Kn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e;var $e=e=>{let t=Object.create(null);return r=>t[r]||(t[r]=e(r))},zn=/-(\w)/g,as=$e(e=>e.replace(zn,(t,r)=>r?r.toUpperCase():"")),Vn=/\B([A-Z])/g,cs=$e(e=>e.replace(Vn,"-$1").toLowerCase()),Et=$e(e=>e.charAt(0).toUpperCase()+e.slice(1)),ls=$e(e=>e?`on${Et(e)}`:""),St=(e,t)=>e!==t&&(e===e||t===t);var At=new WeakMap,fe=[],M,U=Symbol("iterate"),Ot=Symbol("Map key iterate");function Hn(e){return e&&e._isEffect===!0}function Pr(e,t=Nr){Hn(e)&&(e=e.raw);let r=qn(e,t);return t.lazy||r(),r}function Dr(e){e.active&&(Ir(e),e.options.onStop&&e.options.onStop(),e.active=!1)}var Un=0;function qn(e,t){let r=function(){if(!r.active)return e();if(!fe.includes(r)){Ir(r);try{return Wn(),fe.push(r),M=r,e()}finally{fe.pop(),$r(),M=fe[fe.length-1]}}};return r.id=Un++,r.allowRecurse=!!t.allowRecurse,r._isEffect=!0,r.active=!0,r.raw=e,r.deps=[],r.options=t,r}function Ir(e){let{deps:t}=e;if(t.length){for(let r=0;r<t.length;r++)t[r].delete(e);t.length=0}}var ee=!0,Tt=[];function Gn(){Tt.push(ee),ee=!1}function Wn(){Tt.push(ee),ee=!0}function $r(){let e=Tt.pop();ee=e===void 0?!0:e}function T(e,t,r){if(!ee||M===void 0)return;let n=At.get(e);n||At.set(e,n=new Map);let i=n.get(r);i||n.set(r,i=new Set),i.has(M)||(i.add(M),M.deps.push(i),M.options.onTrack&&M.options.onTrack({effect:M,target:e,type:t,key:r}))}function F(e,t,r,n,i,o){let s=At.get(e);if(!s)return;let a=new Set,c=u=>{u&&u.forEach(p=>{(p!==M||p.allowRecurse)&&a.add(p)})};if(t==="clear")s.forEach(c);else if(r==="length"&&L(e))s.forEach((u,p)=>{(p==="length"||p>=n)&&c(u)});else switch(r!==void 0&&c(s.get(r)),t){case"add":L(e)?De(r)&&c(s.get("length")):(c(s.get(U)),X(e)&&c(s.get(Ot)));break;case"delete":L(e)||(c(s.get(U)),X(e)&&c(s.get(Ot)));break;case"set":X(e)&&c(s.get(U));break}let l=u=>{u.options.onTrigger&&u.options.onTrigger({effect:u,target:e,key:r,type:t,newValue:n,oldValue:i,oldTarget:o}),u.options.scheduler?u.options.scheduler(u):u()};a.forEach(l)}var Yn=bt("__proto__,__v_isRef,__isVue"),Lr=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(Ie)),Jn=Le(),Zn=Le(!1,!0),Qn=Le(!0),Xn=Le(!0,!0),Fe={};["includes","indexOf","lastIndexOf"].forEach(e=>{let t=Array.prototype[e];Fe[e]=function(...r){let n=_(this);for(let o=0,s=this.length;o<s;o++)T(n,"get",o+"");let i=t.apply(n,r);return i===-1||i===!1?t.apply(n,r.map(_)):i}});["push","pop","shift","unshift","splice"].forEach(e=>{let t=Array.prototype[e];Fe[e]=function(...r){Gn();let n=t.apply(this,r);return $r(),n}});function Le(e=!1,t=!1){return function(n,i,o){if(i==="__v_isReactive")return!e;if(i==="__v_isReadonly")return e;if(i==="__v_raw"&&o===(e?t?ti:jr:t?ei:Fr).get(n))return n;let s=L(n);if(!e&&s&&le(Fe,i))return Reflect.get(Fe,i,o);let a=Reflect.get(n,i,o);return(Ie(i)?Lr.has(i):Yn(i))||(e||T(n,"get",i),t)?a:Ct(a)?!s||!De(i)?a.value:a:ue(a)?e?Kr(a):je(a):a}}var ri=Br(),ni=Br(!0);function Br(e=!1){return function(r,n,i,o){let s=r[n];if(!e&&(i=_(i),s=_(s),!L(r)&&Ct(s)&&!Ct(i)))return s.value=i,!0;let a=L(r)&&De(n)?Number(n)<r.length:le(r,n),c=Reflect.set(r,n,i,o);return r===_(o)&&(a?St(i,s)&&F(r,"set",n,i,s):F(r,"add",n,i)),c}}function ii(e,t){let r=le(e,t),n=e[t],i=Reflect.deleteProperty(e,t);return i&&r&&F(e,"delete",t,void 0,n),i}function oi(e,t){let r=Reflect.has(e,t);return(!Ie(t)||!Lr.has(t))&&T(e,"has",t),r}function si(e){return T(e,"iterate",L(e)?"length":U),Reflect.ownKeys(e)}var zr={get:Jn,set:ri,deleteProperty:ii,has:oi,ownKeys:si},Vr={get:Qn,set(e,t){return console.warn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0},deleteProperty(e,t){return console.warn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},hs=vt({},zr,{get:Zn,set:ni}),_s=vt({},Vr,{get:Xn}),Rt=e=>ue(e)?je(e):e,Mt=e=>ue(e)?Kr(e):e,Nt=e=>e,Ke=e=>Reflect.getPrototypeOf(e);function Be(e,t,r=!1,n=!1){e=e.__v_raw;let i=_(e),o=_(t);t!==o&&!r&&T(i,"get",t),!r&&T(i,"get",o);let{has:s}=Ke(i),a=n?Nt:r?Mt:Rt;if(s.call(i,t))return a(e.get(t));if(s.call(i,o))return a(e.get(o));e!==i&&e.get(t)}function ze(e,t=!1){let r=this.__v_raw,n=_(r),i=_(e);return e!==i&&!t&&T(n,"has",e),!t&&T(n,"has",i),e===i?r.has(e):r.has(e)||r.has(i)}function Ve(e,t=!1){return e=e.__v_raw,!t&&T(_(e),"iterate",U),Reflect.get(e,"size",e)}function Hr(e){e=_(e);let t=_(this);return Ke(t).has.call(t,e)||(t.add(e),F(t,"add",e,e)),this}function Ur(e,t){t=_(t);let r=_(this),{has:n,get:i}=Ke(r),o=n.call(r,e);o?qr(r,n,e):(e=_(e),o=n.call(r,e));let s=i.call(r,e);return r.set(e,t),o?St(t,s)&&F(r,"set",e,t,s):F(r,"add",e,t),this}function Wr(e){let t=_(this),{has:r,get:n}=Ke(t),i=r.call(t,e);i?qr(t,r,e):(e=_(e),i=r.call(t,e));let o=n?n.call(t,e):void 0,s=t.delete(e);return i&&F(t,"delete",e,void 0,o),s}function Gr(){let e=_(this),t=e.size!==0,r=X(e)?new Map(e):new Set(e),n=e.clear();return t&&F(e,"clear",void 0,void 0,r),n}function He(e,t){return function(n,i){let o=this,s=o.__v_raw,a=_(s),c=t?Nt:e?Mt:Rt;return!e&&T(a,"iterate",U),s.forEach((l,u)=>n.call(i,c(l),c(u),o))}}function qe(e,t,r){return function(...n){let i=this.__v_raw,o=_(i),s=X(o),a=e==="entries"||e===Symbol.iterator&&s,c=e==="keys"&&s,l=i[e](...n),u=r?Nt:t?Mt:Rt;return!t&&T(o,"iterate",c?Ot:U),{next(){let{value:p,done:y}=l.next();return y?{value:p,done:y}:{value:a?[u(p[0]),u(p[1])]:u(p),done:y}},[Symbol.iterator](){return this}}}}function j(e){return function(...t){{let r=t[0]?`on key "${t[0]}" `:"";console.warn(`${Et(e)} operation ${r}failed: target is readonly.`,_(this))}return e==="delete"?!1:this}}var Yr={get(e){return Be(this,e)},get size(){return Ve(this)},has:ze,add:Hr,set:Ur,delete:Wr,clear:Gr,forEach:He(!1,!1)},Jr={get(e){return Be(this,e,!1,!0)},get size(){return Ve(this)},has:ze,add:Hr,set:Ur,delete:Wr,clear:Gr,forEach:He(!1,!0)},Zr={get(e){return Be(this,e,!0)},get size(){return Ve(this,!0)},has(e){return ze.call(this,e,!0)},add:j("add"),set:j("set"),delete:j("delete"),clear:j("clear"),forEach:He(!0,!1)},Qr={get(e){return Be(this,e,!0,!0)},get size(){return Ve(this,!0)},has(e){return ze.call(this,e,!0)},add:j("add"),set:j("set"),delete:j("delete"),clear:j("clear"),forEach:He(!0,!0)},ai=["keys","values","entries",Symbol.iterator];ai.forEach(e=>{Yr[e]=qe(e,!1,!1),Zr[e]=qe(e,!0,!1),Jr[e]=qe(e,!1,!0),Qr[e]=qe(e,!0,!0)});function Ue(e,t){let r=t?e?Qr:Jr:e?Zr:Yr;return(n,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?n:Reflect.get(le(r,i)&&i in n?r:n,i,o)}var ci={get:Ue(!1,!1)},gs={get:Ue(!1,!0)},li={get:Ue(!0,!1)},xs={get:Ue(!0,!0)};function qr(e,t,r){let n=_(r);if(n!==r&&t.call(e,n)){let i=wt(e);console.warn(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var Fr=new WeakMap,ei=new WeakMap,jr=new WeakMap,ti=new WeakMap;function ui(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function fi(e){return e.__v_skip||!Object.isExtensible(e)?0:ui(wt(e))}function je(e){return e&&e.__v_isReadonly?e:Xr(e,!1,zr,ci,Fr)}function Kr(e){return Xr(e,!0,Vr,li,jr)}function Xr(e,t,r,n,i){if(!ue(e))return console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;let o=i.get(e);if(o)return o;let s=fi(e);if(s===0)return e;let a=new Proxy(e,s===2?n:r);return i.set(e,a),a}function _(e){return e&&_(e.__v_raw)||e}function Ct(e){return Boolean(e&&e.__v_isRef===!0)}x("nextTick",()=>Ce);x("dispatch",e=>z.bind(z,e));x("watch",(e,{evaluateLater:t,effect:r})=>(n,i)=>{let o=t(n),s=!0,a,c=r(()=>o(l=>{JSON.stringify(l),s?a=l:queueMicrotask(()=>{i(l,a),a=l}),s=!1}));e._x_effects.delete(c)});x("store",Sr);x("data",e=>ye(e));x("root",e=>V(e));x("refs",e=>(e._x_refs_proxy||(e._x_refs_proxy=I(di(e))),e._x_refs_proxy));function di(e){let t=[],r=e;for(;r;)r._x_refs&&t.push(r._x_refs),r=r.parentNode;return t}var kt={};function Pt(e){return kt[e]||(kt[e]=0),++kt[e]}function en(e,t){return Q(e,r=>{if(r._x_ids&&r._x_ids[t])return!0})}function tn(e,t){e._x_ids||(e._x_ids={}),e._x_ids[t]||(e._x_ids[t]=Pt(t))}x("id",e=>(t,r=null)=>{let n=en(e,t),i=n?n._x_ids[t]:Pt(t);return r?`${t}-${i}-${r}`:`${t}-${i}`});x("el",e=>e);rn("Focus","focus","focus");rn("Persist","persist","persist");function rn(e,t,r){x(t,n=>O(`You can't use [$${directiveName}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}d("modelable",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t),o=()=>{let l;return i(u=>l=u),l},s=n(`${t} = __placeholder`),a=l=>s(()=>{},{scope:{__placeholder:l}}),c=o();a(c),queueMicrotask(()=>{if(!e._x_model)return;e._x_removeModelListeners.default();let l=e._x_model.get,u=e._x_model.set;r(()=>a(l())),r(()=>u(o()))})});d("teleport",(e,{expression:t},{cleanup:r})=>{e.tagName.toLowerCase()!=="template"&&O("x-teleport can only be used on a <template> tag",e);let n=document.querySelector(t);n||O(`Cannot find x-teleport element for selector: "${t}"`);let i=e.content.cloneNode(!0).firstElementChild;e._x_teleport=i,i._x_teleportBack=e,e._x_forwardEvents&&e._x_forwardEvents.forEach(o=>{i.addEventListener(o,s=>{s.stopPropagation(),e.dispatchEvent(new s.constructor(s.type,s))})}),C(i,{},e),m(()=>{n.appendChild(i),w(i),i._x_ignore=!0}),r(()=>i.remove())});var nn=()=>{};nn.inline=(e,{modifiers:t},{cleanup:r})=>{t.includes("self")?e._x_ignoreSelf=!0:e._x_ignore=!0,r(()=>{t.includes("self")?delete e._x_ignoreSelf:delete e._x_ignore})};d("ignore",nn);d("effect",(e,{expression:t},{effect:r})=>r(g(e,t)));function de(e,t,r,n){let i=e,o=c=>n(c),s={},a=(c,l)=>u=>l(c,u);if(r.includes("dot")&&(t=pi(t)),r.includes("camel")&&(t=mi(t)),r.includes("passive")&&(s.passive=!0),r.includes("capture")&&(s.capture=!0),r.includes("window")&&(i=window),r.includes("document")&&(i=document),r.includes("prevent")&&(o=a(o,(c,l)=>{l.preventDefault(),c(l)})),r.includes("stop")&&(o=a(o,(c,l)=>{l.stopPropagation(),c(l)})),r.includes("self")&&(o=a(o,(c,l)=>{l.target===e&&c(l)})),(r.includes("away")||r.includes("outside"))&&(i=document,o=a(o,(c,l)=>{e.contains(l.target)||l.target.isConnected!==!1&&(e.offsetWidth<1&&e.offsetHeight<1||e._x_isShown!==!1&&c(l))})),r.includes("once")&&(o=a(o,(c,l)=>{c(l),i.removeEventListener(t,o,s)})),o=a(o,(c,l)=>{hi(t)&&_i(l,r)||c(l)}),r.includes("debounce")){let c=r[r.indexOf("debounce")+1]||"invalid-wait",l=It(c.split("ms")[0])?Number(c.split("ms")[0]):250;o=ke(o,l)}if(r.includes("throttle")){let c=r[r.indexOf("throttle")+1]||"invalid-wait",l=It(c.split("ms")[0])?Number(c.split("ms")[0]):250;o=Pe(o,l)}return i.addEventListener(t,o,s),()=>{i.removeEventListener(t,o,s)}}function pi(e){return e.replace(/-/g,".")}function mi(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function It(e){return!Array.isArray(e)&&!isNaN(e)}function gi(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function hi(e){return["keydown","keyup"].includes(e)}function _i(e,t){let r=t.filter(o=>!["window","document","prevent","stop","once"].includes(o));if(r.includes("debounce")){let o=r.indexOf("debounce");r.splice(o,It((r[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.length===0||r.length===1&&on(e.key).includes(r[0]))return!1;let i=["ctrl","shift","alt","meta","cmd","super"].filter(o=>r.includes(o));return r=r.filter(o=>!i.includes(o)),!(i.length>0&&i.filter(s=>((s==="cmd"||s==="super")&&(s="meta"),e[`${s}Key`])).length===i.length&&on(e.key).includes(r[0]))}function on(e){if(!e)return[];e=gi(e);let t={ctrl:"control",slash:"/",space:"-",spacebar:"-",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",equal:"="};return t[e]=e,Object.keys(t).map(r=>{if(t[r]===e)return r}).filter(r=>r)}d("model",(e,{modifiers:t,expression:r},{effect:n,cleanup:i})=>{let o=g(e,r),s=`${r} = rightSideOfExpression($event, ${r})`,a=g(e,s);var c=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)||t.includes("lazy")?"change":"input";let l=xi(e,t,r),u=de(e,c,t,y=>{a(()=>{},{scope:{$event:y,rightSideOfExpression:l}})});e._x_removeModelListeners||(e._x_removeModelListeners={}),e._x_removeModelListeners.default=u,i(()=>e._x_removeModelListeners.default());let p=g(e,`${r} = __placeholder`);e._x_model={get(){let y;return o(N=>y=N),y},set(y){p(()=>{},{scope:{__placeholder:y}})}},e._x_forceModelUpdate=()=>{o(y=>{y===void 0&&r.match(/\./)&&(y=""),window.fromModel=!0,m(()=>ce(e,"value",y)),delete window.fromModel})},n(()=>{t.includes("unintrusive")&&document.activeElement.isSameNode(e)||e._x_forceModelUpdate()})});function xi(e,t,r){return e.type==="radio"&&m(()=>{e.hasAttribute("name")||e.setAttribute("name",r)}),(n,i)=>m(()=>{if(n instanceof CustomEvent&&n.detail!==void 0)return n.detail||n.target.value;if(e.type==="checkbox")if(Array.isArray(i)){let o=t.includes("number")?Dt(n.target.value):n.target.value;return n.target.checked?i.concat([o]):i.filter(s=>!yi(s,o))}else return n.target.checked;else{if(e.tagName.toLowerCase()==="select"&&e.multiple)return t.includes("number")?Array.from(n.target.selectedOptions).map(o=>{let s=o.value||o.text;return Dt(s)}):Array.from(n.target.selectedOptions).map(o=>o.value||o.text);{let o=n.target.value;return t.includes("number")?Dt(o):t.includes("trim")?o.trim():o}}})}function Dt(e){let t=e?parseFloat(e):null;return bi(t)?t:e}function yi(e,t){return e==t}function bi(e){return!Array.isArray(e)&&!isNaN(e)}d("cloak",e=>queueMicrotask(()=>m(()=>e.removeAttribute(E("cloak")))));Me(()=>`[${E("init")}]`);d("init",$((e,{expression:t},{evaluate:r})=>typeof t=="string"?!!t.trim()&&r(t,{},!1):r(t,{},!1)));d("text",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i(o=>{m(()=>{e.textContent=o})})})});d("html",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i(o=>{m(()=>{e.innerHTML=o,e._x_ignoreSelf=!0,w(e),delete e._x_ignoreSelf})})})});Z(Se(":",Ae(E("bind:"))));d("bind",(e,{value:t,modifiers:r,expression:n,original:i},{effect:o})=>{if(!t)return vi(e,n,i,o);if(t==="key")return wi(e,n);let s=g(e,n);o(()=>s(a=>{a===void 0&&n.match(/\./)&&(a=""),m(()=>ce(e,t,a,r))}))});function vi(e,t,r,n){let i={};Tr(i);let o=g(e,t),s=[];for(;s.length;)s.pop()();o(a=>{let c=Object.entries(a).map(([u,p])=>({name:u,value:p})),l=nr(c);c=c.map(u=>l.find(p=>p.name===u.name)?{name:`x-bind:${u.name}`,value:`"${u.value}"`}:u),ne(e,c,r).map(u=>{s.push(u.runCleanups),u()})},{scope:i})}function wi(e,t){e._x_keyExpression=t}Re(()=>`[${E("data")}]`);d("data",$((e,{expression:t},{cleanup:r})=>{t=t===""?"{}":t;let n={},i=re(n,e).cleanup,o={};Mr(o,n);let s=k(e,t,{scope:o});s===void 0&&(s={});let a=re(s,e).cleanup,c=A(s);be(c);let l=C(e,c);c.init&&k(e,c.init),r(()=>{l(),i(),a(),c.destroy&&k(e,c.destroy),l()})}));d("show",(e,{modifiers:t,expression:r},{effect:n})=>{let i=g(e,r);e._x_doHide||(e._x_doHide=()=>{m(()=>e.style.display="none")}),e._x_doShow||(e._x_doShow=()=>{m(()=>{e.style.length===1&&e.style.display==="none"?e.removeAttribute("style"):e.style.removeProperty("display")})});let o=()=>{e._x_doHide(),e._x_isShown=!1},s=()=>{e._x_doShow(),e._x_isShown=!0},a=()=>setTimeout(s),c=se(p=>p?s():o(),p=>{typeof e._x_toggleAndCascadeWithTransitions=="function"?e._x_toggleAndCascadeWithTransitions(e,p,s,o):p?a():o()}),l,u=!0;n(()=>i(p=>{!u&&p===l||(t.includes("immediate")&&(p?a():o()),c(p),l=p,u=!1)}))});d("for",(e,{expression:t},{effect:r,cleanup:n})=>{let i=Si(t),o=g(e,i.items),s=g(e,e._x_keyExpression||"index");e._x_prevKeys=[],e._x_lookup={},r(()=>Ei(e,i,o,s)),n(()=>{Object.values(e._x_lookup).forEach(a=>a.remove()),delete e._x_prevKeys,delete e._x_lookup})});function Ei(e,t,r,n){let i=s=>typeof s=="object"&&!Array.isArray(s),o=e;r(s=>{Ai(s)&&s>=0&&(s=Array.from(Array(s).keys(),f=>f+1)),s===void 0&&(s=[]);let a=e._x_lookup,c=e._x_prevKeys,l=[],u=[];if(i(s))s=Object.entries(s).map(([f,h])=>{let b=sn(t,h,f,s);n(v=>u.push(v),{scope:{index:f,...b}}),l.push(b)});else for(let f=0;f<s.length;f++){let h=sn(t,s[f],f,s);n(b=>u.push(b),{scope:{index:f,...h}}),l.push(h)}let p=[],y=[],N=[],W=[];for(let f=0;f<c.length;f++){let h=c[f];u.indexOf(h)===-1&&N.push(h)}c=c.filter(f=>!N.includes(f));let pe="template";for(let f=0;f<u.length;f++){let h=u[f],b=c.indexOf(h);if(b===-1)c.splice(f,0,h),p.push([pe,f]);else if(b!==f){let v=c.splice(f,1)[0],S=c.splice(b-1,1)[0];c.splice(f,0,S),c.splice(b,0,v),y.push([v,S])}else W.push(h);pe=h}for(let f=0;f<N.length;f++){let h=N[f];a[h]._x_effects&&a[h]._x_effects.forEach(he),a[h].remove(),a[h]=null,delete a[h]}for(let f=0;f<y.length;f++){let[h,b]=y[f],v=a[h],S=a[b],G=document.createElement("div");m(()=>{S.after(G),v.after(S),S._x_currentIfEl&&S.after(S._x_currentIfEl),G.before(v),v._x_currentIfEl&&v.after(v._x_currentIfEl),G.remove()}),at(S,l[u.indexOf(b)])}for(let f=0;f<p.length;f++){let[h,b]=p[f],v=h==="template"?o:a[h];v._x_currentIfEl&&(v=v._x_currentIfEl);let S=l[b],G=u[b],me=document.importNode(o.content,!0).firstElementChild;C(me,A(S),o),m(()=>{v.after(me),w(me)}),typeof G=="object"&&O("x-for key cannot be an object, it must be a string or an integer",o),a[G]=me}for(let f=0;f<W.length;f++)at(a[W[f]],l[u.indexOf(W[f])]);o._x_prevKeys=u})}function Si(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,r=/^\s*\(|\)\s*$/g,n=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,i=e.match(n);if(!i)return;let o={};o.items=i[2].trim();let s=i[1].replace(r,"").trim(),a=s.match(t);return a?(o.item=s.replace(t,"").trim(),o.index=a[1].trim(),a[2]&&(o.collection=a[2].trim())):o.item=s,o}function sn(e,t,r,n){let i={};return/^\[.*\]$/.test(e.item)&&Array.isArray(t)?e.item.replace("[","").replace("]","").split(",").map(s=>s.trim()).forEach((s,a)=>{i[s]=t[a]}):/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t=="object"?e.item.replace("{","").replace("}","").split(",").map(s=>s.trim()).forEach(s=>{i[s]=t[s]}):i[e.item]=t,e.index&&(i[e.index]=r),e.collection&&(i[e.collection]=n),i}function Ai(e){return!Array.isArray(e)&&!isNaN(e)}function an(){}an.inline=(e,{expression:t},{cleanup:r})=>{let n=V(e);n._x_refs||(n._x_refs={}),n._x_refs[t]=e,r(()=>delete n._x_refs[t])};d("ref",an);d("if",(e,{expression:t},{effect:r,cleanup:n})=>{let i=g(e,t),o=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let a=e.content.cloneNode(!0).firstElementChild;return C(a,{},e),m(()=>{e.after(a),w(a)}),e._x_currentIfEl=a,e._x_undoIf=()=>{R(a,c=>{c._x_effects&&c._x_effects.forEach(he)}),a.remove(),delete e._x_currentIfEl},a},s=()=>{!e._x_undoIf||(e._x_undoIf(),delete e._x_undoIf)};r(()=>i(a=>{a?o():s()})),n(()=>e._x_undoIf&&e._x_undoIf())});d("id",(e,{expression:t},{evaluate:r})=>{r(t).forEach(i=>tn(e,i))});Z(Se("@",Ae(E("on:"))));d("on",$((e,{value:t,modifiers:r,expression:n},{cleanup:i})=>{let o=n?g(e,n):()=>{};e.tagName.toLowerCase()==="template"&&(e._x_forwardEvents||(e._x_forwardEvents=[]),e._x_forwardEvents.includes(t)||e._x_forwardEvents.push(t));let s=de(e,t,r,a=>{o(()=>{},{scope:{$event:a},params:[a]})});i(()=>s())}));We("Collapse","collapse","collapse");We("Intersect","intersect","intersect");We("Focus","trap","focus");We("Mask","mask","mask");function We(e,t,r){d(t,n=>O(`You can't use [x-${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}D.setEvaluator(ut);D.setReactivityEngine({reactive:je,effect:Pr,release:Dr,raw:_});var $t=D;window.Alpine=$t;queueMicrotask(()=>{$t.start()});})();
+`:""}`,t),setTimeout(()=>{throw e},0)}var we=!0;function Qt(e){let t=we;we=!1,e(),we=t}function P(e,t,r={}){let n;return g(e,t)(i=>n=i,r),n}function g(...e){return Xt(...e)}var Xt=ut;function er(e){Xt=e}function ut(e,t){let r={},n=re(r,e).cleanup;ge(e,"evaluator",n);let i=[r,...k(e)];if(typeof t=="function")return hn(i,t);let o=_n(i,t,e);return Zt.bind(null,e,t,o)}function hn(e,t){return(r=()=>{},{scope:n={},params:i=[]}={})=>{let o=t.apply(D([n,...e]),i);Ee(r,o)}}var ft={};function gn(e,t){if(ft[e])return ft[e];let r=Object.getPrototypeOf(async function(){}).constructor,n=/^[\n\s]*if.*\(.*\)/.test(e)||/^(let|const)\s/.test(e)?`(() => { ${e} })()`:e,o=(()=>{try{return new r(["__self","scope"],`with (scope) { __self.result = ${n} }; __self.finished = true; return __self.result;`)}catch(s){return J(s,t,e),Promise.resolve()}})();return ft[e]=o,o}function _n(e,t,r){let n=gn(t,r);return(i=()=>{},{scope:o={},params:s=[]}={})=>{n.result=void 0,n.finished=!1;let a=D([o,...e]);if(typeof n=="function"){let c=n(n,a).catch(l=>J(l,r,t));n.finished?(Ee(i,n.result,a,s,r),n.result=void 0):c.then(l=>{Ee(i,l,a,s,r)}).catch(l=>J(l,r,t)).finally(()=>n.result=void 0)}}}function Ee(e,t,r,n,i){if(we&&typeof t=="function"){let o=t.apply(r,n);o instanceof Promise?o.then(s=>Ee(e,s,r,n)).catch(s=>J(s,i,t)):e(o)}else e(t)}var dt="x-";function E(e=""){return dt+e}function tr(e){dt=e}var rr={};function d(e,t){rr[e]=t}function ne(e,t,r){if(t=Array.from(t),e._x_virtualDirectives){let o=Object.entries(e._x_virtualDirectives).map(([a,c])=>({name:a,value:c})),s=pt(o);o=o.map(a=>s.find(c=>c.name===a.name)?{name:`x-bind:${a.name}`,value:`"${a.value}"`}:a),t=t.concat(o)}let n={};return t.map(nr((o,s)=>n[o]=s)).filter(ir).map(yn(n,r)).sort(bn).map(o=>xn(e,o))}function pt(e){return Array.from(e).map(nr()).filter(t=>!ir(t))}var mt=!1,ie=new Map,or=Symbol();function sr(e){mt=!0;let t=Symbol();or=t,ie.set(t,[]);let r=()=>{for(;ie.get(t).length;)ie.get(t).shift()();ie.delete(t)},n=()=>{mt=!1,r()};e(r),n()}function lt(e){let t=[],r=a=>t.push(a),[n,i]=zt(e);return t.push(i),[{Alpine:I,effect:n,cleanup:r,evaluateLater:g.bind(g,e),evaluate:P.bind(P,e)},()=>t.forEach(a=>a())]}function xn(e,t){let r=()=>{},n=rr[t.type]||r,[i,o]=lt(e);ge(e,t.original,o);let s=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,i),n=n.bind(n,e,t,i),mt?ie.get(or).push(n):n())};return s.runCleanups=o,s}var Se=(e,t)=>({name:r,value:n})=>(r.startsWith(e)&&(r=r.replace(e,t)),{name:r,value:n}),Ae=e=>e;function nr(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=ar.reduce((o,s)=>s(o),{name:t,value:r});return n!==t&&e(n,t),{name:n,value:i}}}var ar=[];function Z(e){ar.push(e)}function ir({name:e}){return cr().test(e)}var cr=()=>new RegExp(`^${dt}([^:^.]+)\\b`);function yn(e,t){return({name:r,value:n})=>{let i=r.match(cr()),o=r.match(/:([a-zA-Z0-9\-:]+)/),s=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],a=t||e[r]||r;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:s.map(c=>c.replace(".","")),expression:n,original:a}}}var ht="DEFAULT",Oe=["ignore","ref","data","id","bind","init","for","mask","model","modelable","transition","show","if",ht,"teleport"];function bn(e,t){let r=Oe.indexOf(e.type)===-1?ht:e.type,n=Oe.indexOf(t.type)===-1?ht:t.type;return Oe.indexOf(r)-Oe.indexOf(n)}function z(e,t,r={}){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0}))}var _t=[],gt=!1;function Ce(e=()=>{}){return queueMicrotask(()=>{gt||setTimeout(()=>{Te()})}),new Promise(t=>{_t.push(()=>{e(),t()})})}function Te(){for(gt=!1;_t.length;)_t.shift()()}function lr(){gt=!0}function R(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(i=>R(i,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;for(;n;)R(n,t,!1),n=n.nextElementSibling}function O(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}function fr(){document.body||O("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),z(document,"alpine:init"),z(document,"alpine:initializing"),nt(),Ut(t=>w(t,R)),_e(t=>xt(t)),Wt((t,r)=>{ne(t,r).forEach(n=>n())});let e=t=>!V(t.parentElement,!0);Array.from(document.querySelectorAll(ur())).filter(e).forEach(t=>{w(t)}),z(document,"alpine:initialized")}var yt=[],dr=[];function pr(){return yt.map(e=>e())}function ur(){return yt.concat(dr).map(e=>e())}function Re(e){yt.push(e)}function Me(e){dr.push(e)}function V(e,t=!1){return Q(e,r=>{if((t?ur():pr()).some(i=>r.matches(i)))return!0})}function Q(e,t){if(!!e){if(t(e))return e;if(e._x_teleportBack&&(e=e._x_teleportBack),!!e.parentElement)return Q(e.parentElement,t)}}function mr(e){return pr().some(t=>e.matches(t))}function w(e,t=R){sr(()=>{t(e,(r,n)=>{ne(r,r.attributes).forEach(i=>i()),r._x_ignore&&n()})})}function xt(e){R(e,t=>Xe(t))}function oe(e,t){return Array.isArray(t)?hr(e,t.join(" ")):typeof t=="object"&&t!==null?vn(e,t):typeof t=="function"?oe(e,t()):hr(e,t)}function hr(e,t){let r=o=>o.split(" ").filter(Boolean),n=o=>o.split(" ").filter(s=>!e.classList.contains(s)).filter(Boolean),i=o=>(e.classList.add(...o),()=>{e.classList.remove(...o)});return t=t===!0?t="":t||"",i(n(t))}function vn(e,t){let r=a=>a.split(" ").filter(Boolean),n=Object.entries(t).flatMap(([a,c])=>c?r(a):!1).filter(Boolean),i=Object.entries(t).flatMap(([a,c])=>c?!1:r(a)).filter(Boolean),o=[],s=[];return i.forEach(a=>{e.classList.contains(a)&&(e.classList.remove(a),s.push(a))}),n.forEach(a=>{e.classList.contains(a)||(e.classList.add(a),o.push(a))}),()=>{s.forEach(a=>e.classList.add(a)),o.forEach(a=>e.classList.remove(a))}}function H(e,t){return typeof t=="object"&&t!==null?wn(e,t):En(e,t)}function wn(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{r[n]=e.style[n],n.startsWith("--")||(n=Sn(n)),e.style.setProperty(n,i)}),setTimeout(()=>{e.style.length===0&&e.removeAttribute("style")}),()=>{H(e,r)}}function En(e,t){let r=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",r||"")}}function Sn(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function se(e,t=()=>{}){let r=!1;return function(){r?t.apply(this,arguments):(r=!0,e.apply(this,arguments))}}d("transition",(e,{value:t,modifiers:r,expression:n},{evaluate:i})=>{typeof n=="function"&&(n=i(n)),n?An(e,n,t):On(e,r,t)});function An(e,t,r){_r(e,oe,""),{enter:i=>{e._x_transition.enter.during=i},"enter-start":i=>{e._x_transition.enter.start=i},"enter-end":i=>{e._x_transition.enter.end=i},leave:i=>{e._x_transition.leave.during=i},"leave-start":i=>{e._x_transition.leave.start=i},"leave-end":i=>{e._x_transition.leave.end=i}}[r](t)}function On(e,t,r){_r(e,H);let n=!t.includes("in")&&!t.includes("out")&&!r,i=n||t.includes("in")||["enter"].includes(r),o=n||t.includes("out")||["leave"].includes(r);t.includes("in")&&!n&&(t=t.filter((h,b)=>b<t.indexOf("out"))),t.includes("out")&&!n&&(t=t.filter((h,b)=>b>t.indexOf("out")));let s=!t.includes("opacity")&&!t.includes("scale"),a=s||t.includes("opacity"),c=s||t.includes("scale"),l=a?0:1,u=c?ae(t,"scale",95)/100:1,p=ae(t,"delay",0),y=ae(t,"origin","center"),N="opacity, transform",W=ae(t,"duration",150)/1e3,pe=ae(t,"duration",75)/1e3,f="cubic-bezier(0.4, 0.0, 0.2, 1)";i&&(e._x_transition.enter.during={transformOrigin:y,transitionDelay:p,transitionProperty:N,transitionDuration:`${W}s`,transitionTimingFunction:f},e._x_transition.enter.start={opacity:l,transform:`scale(${u})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"}),o&&(e._x_transition.leave.during={transformOrigin:y,transitionDelay:p,transitionProperty:N,transitionDuration:`${pe}s`,transitionTimingFunction:f},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:l,transform:`scale(${u})`})}function _r(e,t,r={}){e._x_transition||(e._x_transition={enter:{during:r,start:r,end:r},leave:{during:r,start:r,end:r},in(n=()=>{},i=()=>{}){Ne(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,i)},out(n=()=>{},i=()=>{}){Ne(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,i)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,r,n){let i=document.visibilityState==="visible"?requestAnimationFrame:setTimeout,o=()=>i(r);if(t){e._x_transition&&(e._x_transition.enter||e._x_transition.leave)?e._x_transition.enter&&(Object.entries(e._x_transition.enter.during).length||Object.entries(e._x_transition.enter.start).length||Object.entries(e._x_transition.enter.end).length)?e._x_transition.in(r):o():e._x_transition?e._x_transition.in(r):o();return}e._x_hidePromise=e._x_transition?new Promise((s,a)=>{e._x_transition.out(()=>{},()=>s(n)),e._x_transitioning.beforeCancel(()=>a({isFromCancelledTransition:!0}))}):Promise.resolve(n),queueMicrotask(()=>{let s=gr(e);s?(s._x_hideChildren||(s._x_hideChildren=[]),s._x_hideChildren.push(e)):i(()=>{let a=c=>{let l=Promise.all([c._x_hidePromise,...(c._x_hideChildren||[]).map(a)]).then(([u])=>u());return delete c._x_hidePromise,delete c._x_hideChildren,l};a(e).catch(c=>{if(!c.isFromCancelledTransition)throw c})})})};function gr(e){let t=e.parentNode;if(!!t)return t._x_hidePromise?t:gr(t)}function Ne(e,t,{during:r,start:n,end:i}={},o=()=>{},s=()=>{}){if(e._x_transitioning&&e._x_transitioning.cancel(),Object.keys(r).length===0&&Object.keys(n).length===0&&Object.keys(i).length===0){o(),s();return}let a,c,l;Tn(e,{start(){a=t(e,n)},during(){c=t(e,r)},before:o,end(){a(),l=t(e,i)},after:s,cleanup(){c(),l()}})}function Tn(e,t){let r,n,i,o=se(()=>{m(()=>{r=!0,n||t.before(),i||(t.end(),Te()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(s){this.beforeCancels.push(s)},cancel:se(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();o()}),finish:o},m(()=>{t.start(),t.during()}),lr(),requestAnimationFrame(()=>{if(r)return;let s=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,a=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;s===0&&(s=Number(getComputedStyle(e).animationDuration.replace("s",""))*1e3),m(()=>{t.before()}),n=!0,requestAnimationFrame(()=>{r||(m(()=>{t.end()}),Te(),setTimeout(e._x_transitioning.finish,s+a),i=!0)})})}function ae(e,t,r){if(e.indexOf(t)===-1)return r;let n=e[e.indexOf(t)+1];if(!n||t==="scale"&&isNaN(n))return r;if(t==="duration"){let i=n.match(/([0-9]+)ms/);if(i)return i[1]}return t==="origin"&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[n,e[e.indexOf(t)+2]].join(" "):n}var bt=!1;function $(e,t=()=>{}){return(...r)=>bt?t(...r):e(...r)}function xr(e,t){t._x_dataStack||(t._x_dataStack=e._x_dataStack),bt=!0,Rn(()=>{Cn(t)}),bt=!1}function Cn(e){let t=!1;w(e,(n,i)=>{R(n,(o,s)=>{if(t&&mr(o))return s();t=!0,i(o,s)})})}function Rn(e){let t=K;Qe((r,n)=>{let i=t(r);return Y(i),()=>{}}),e(),Qe(t)}function ce(e,t,r,n=[]){switch(e._x_bindings||(e._x_bindings=A({})),e._x_bindings[t]=r,t=n.includes("camel")?Dn(t):t,t){case"value":Mn(e,r);break;case"style":Pn(e,r);break;case"class":Nn(e,r);break;default:kn(e,t,r);break}}function Mn(e,t){if(e.type==="radio")e.attributes.value===void 0&&(e.value=t),window.fromModel&&(e.checked=yr(e.value,t));else if(e.type==="checkbox")Number.isInteger(t)?e.value=t:!Number.isInteger(t)&&!Array.isArray(t)&&typeof t!="boolean"&&![null,void 0].includes(t)?e.value=String(t):Array.isArray(t)?e.checked=t.some(r=>yr(r,e.value)):e.checked=!!t;else if(e.tagName==="SELECT")In(e,t);else{if(e.value===t)return;e.value=t}}function Nn(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedClasses=oe(e,t)}function Pn(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles(),e._x_undoAddedStyles=H(e,t)}function kn(e,t,r){[null,void 0,!1].includes(r)&&Ln(t)?e.removeAttribute(t):(br(t)&&(r=t),$n(e,t,r))}function $n(e,t,r){e.getAttribute(t)!=r&&e.setAttribute(t,r)}function In(e,t){let r=[].concat(t).map(n=>n+"");Array.from(e.options).forEach(n=>{n.selected=r.includes(n.value)})}function Dn(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function yr(e,t){return e==t}function br(e){return["disabled","checked","required","readonly","hidden","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"].includes(e)}function Ln(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}function vr(e,t,r){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];let n=e.getAttribute(t);return n===null?typeof r=="function"?r():r:br(t)?!![t,"true"].includes(n):n===""?!0:n}function Pe(e,t){var r;return function(){var n=this,i=arguments,o=function(){r=null,e.apply(n,i)};clearTimeout(r),r=setTimeout(o,t)}}function ke(e,t){let r;return function(){let n=this,i=arguments;r||(e.apply(n,i),r=!0,setTimeout(()=>r=!1,t))}}function wr(e){e(I)}var q={},Er=!1;function Sr(e,t){if(Er||(q=A(q),Er=!0),t===void 0)return q[e];q[e]=t,typeof t=="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init=="function"&&q[e].init(),be(q[e])}function Ar(){return q}var Or={};function Tr(e,t){let r=typeof t!="function"?()=>t:t;e instanceof Element?vt(e,r()):Or[e]=r}function Cr(e){return Object.entries(Or).forEach(([t,r])=>{Object.defineProperty(e,t,{get(){return(...n)=>r(...n)}})}),e}function vt(e,t,r){let n=[];for(;n.length;)n.pop()();let i=Object.entries(t).map(([s,a])=>({name:s,value:a})),o=pt(i);i=i.map(s=>o.find(a=>a.name===s.name)?{name:`x-bind:${s.name}`,value:`"${s.value}"`}:s),ne(e,i,r).map(s=>{n.push(s.runCleanups),s()})}var Rr={};function Mr(e,t){Rr[e]=t}function Nr(e,t){return Object.entries(Rr).forEach(([r,n])=>{Object.defineProperty(e,r,{get(){return(...i)=>n.bind(t)(...i)},enumerable:!1})}),e}var jn={get reactive(){return A},get release(){return Y},get effect(){return K},get raw(){return Je},version:"3.10.3",flushAndStopDeferringMutations:Yt,dontAutoEvaluateFunctions:Qt,disableEffectScheduling:Bt,stopObservingMutations:it,destroyTree:xt,setReactivityEngine:Kt,closestDataStack:k,skipDuringClone:$,addRootSelector:Re,addInitSelector:Me,addScopeToNode:C,deferMutations:Gt,mapAttributes:Z,evaluateLater:g,setEvaluator:er,mergeProxies:D,findClosest:Q,closestRoot:V,interceptor:ve,transition:Ne,setStyles:H,mutateDom:m,directive:d,throttle:ke,debounce:Pe,evaluate:P,initTree:w,nextTick:Ce,prefixed:E,prefix:tr,plugin:wr,magic:x,store:Sr,start:fr,clone:xr,bound:vr,$data:ye,data:Mr,bind:Tr},I=jn;function wt(e,t){let r=Object.create(null),n=e.split(",");for(let i=0;i<n.length;i++)r[n[i]]=!0;return t?i=>!!r[i.toLowerCase()]:i=>!!r[i]}var is={[1]:"TEXT",[2]:"CLASS",[4]:"STYLE",[8]:"PROPS",[16]:"FULL_PROPS",[32]:"HYDRATE_EVENTS",[64]:"STABLE_FRAGMENT",[128]:"KEYED_FRAGMENT",[256]:"UNKEYED_FRAGMENT",[512]:"NEED_PATCH",[1024]:"DYNAMIC_SLOTS",[2048]:"DEV_ROOT_FRAGMENT",[-1]:"HOISTED",[-2]:"BAIL"},os={[1]:"STABLE",[2]:"DYNAMIC",[3]:"FORWARDED"};var Fn="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var ss=wt(Fn+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var Pr=Object.freeze({}),as=Object.freeze([]);var Et=Object.assign;var Bn=Object.prototype.hasOwnProperty,le=(e,t)=>Bn.call(e,t),L=Array.isArray,X=e=>kr(e)==="[object Map]";var Kn=e=>typeof e=="string",De=e=>typeof e=="symbol",ue=e=>e!==null&&typeof e=="object";var zn=Object.prototype.toString,kr=e=>zn.call(e),St=e=>kr(e).slice(8,-1);var Ie=e=>Kn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e;var $e=e=>{let t=Object.create(null);return r=>t[r]||(t[r]=e(r))},Vn=/-(\w)/g,cs=$e(e=>e.replace(Vn,(t,r)=>r?r.toUpperCase():"")),Hn=/\B([A-Z])/g,ls=$e(e=>e.replace(Hn,"-$1").toLowerCase()),At=$e(e=>e.charAt(0).toUpperCase()+e.slice(1)),us=$e(e=>e?`on${At(e)}`:""),Ot=(e,t)=>e!==t&&(e===e||t===t);var Tt=new WeakMap,fe=[],M,U=Symbol("iterate"),Ct=Symbol("Map key iterate");function qn(e){return e&&e._isEffect===!0}function Dr(e,t=Pr){qn(e)&&(e=e.raw);let r=Un(e,t);return t.lazy||r(),r}function $r(e){e.active&&(Ir(e),e.options.onStop&&e.options.onStop(),e.active=!1)}var Wn=0;function Un(e,t){let r=function(){if(!r.active)return e();if(!fe.includes(r)){Ir(r);try{return Gn(),fe.push(r),M=r,e()}finally{fe.pop(),Lr(),M=fe[fe.length-1]}}};return r.id=Wn++,r.allowRecurse=!!t.allowRecurse,r._isEffect=!0,r.active=!0,r.raw=e,r.deps=[],r.options=t,r}function Ir(e){let{deps:t}=e;if(t.length){for(let r=0;r<t.length;r++)t[r].delete(e);t.length=0}}var ee=!0,Rt=[];function Yn(){Rt.push(ee),ee=!1}function Gn(){Rt.push(ee),ee=!0}function Lr(){let e=Rt.pop();ee=e===void 0?!0:e}function T(e,t,r){if(!ee||M===void 0)return;let n=Tt.get(e);n||Tt.set(e,n=new Map);let i=n.get(r);i||n.set(r,i=new Set),i.has(M)||(i.add(M),M.deps.push(i),M.options.onTrack&&M.options.onTrack({effect:M,target:e,type:t,key:r}))}function j(e,t,r,n,i,o){let s=Tt.get(e);if(!s)return;let a=new Set,c=u=>{u&&u.forEach(p=>{(p!==M||p.allowRecurse)&&a.add(p)})};if(t==="clear")s.forEach(c);else if(r==="length"&&L(e))s.forEach((u,p)=>{(p==="length"||p>=n)&&c(u)});else switch(r!==void 0&&c(s.get(r)),t){case"add":L(e)?Ie(r)&&c(s.get("length")):(c(s.get(U)),X(e)&&c(s.get(Ct)));break;case"delete":L(e)||(c(s.get(U)),X(e)&&c(s.get(Ct)));break;case"set":X(e)&&c(s.get(U));break}let l=u=>{u.options.onTrigger&&u.options.onTrigger({effect:u,target:e,key:r,type:t,newValue:n,oldValue:i,oldTarget:o}),u.options.scheduler?u.options.scheduler(u):u()};a.forEach(l)}var Jn=wt("__proto__,__v_isRef,__isVue"),jr=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(De)),Zn=Le(),Qn=Le(!1,!0),Xn=Le(!0),ei=Le(!0,!0),je={};["includes","indexOf","lastIndexOf"].forEach(e=>{let t=Array.prototype[e];je[e]=function(...r){let n=_(this);for(let o=0,s=this.length;o<s;o++)T(n,"get",o+"");let i=t.apply(n,r);return i===-1||i===!1?t.apply(n,r.map(_)):i}});["push","pop","shift","unshift","splice"].forEach(e=>{let t=Array.prototype[e];je[e]=function(...r){Yn();let n=t.apply(this,r);return Lr(),n}});function Le(e=!1,t=!1){return function(n,i,o){if(i==="__v_isReactive")return!e;if(i==="__v_isReadonly")return e;if(i==="__v_raw"&&o===(e?t?ri:Br:t?ti:Fr).get(n))return n;let s=L(n);if(!e&&s&&le(je,i))return Reflect.get(je,i,o);let a=Reflect.get(n,i,o);return(De(i)?jr.has(i):Jn(i))||(e||T(n,"get",i),t)?a:Mt(a)?!s||!Ie(i)?a.value:a:ue(a)?e?Kr(a):Fe(a):a}}var ni=zr(),ii=zr(!0);function zr(e=!1){return function(r,n,i,o){let s=r[n];if(!e&&(i=_(i),s=_(s),!L(r)&&Mt(s)&&!Mt(i)))return s.value=i,!0;let a=L(r)&&Ie(n)?Number(n)<r.length:le(r,n),c=Reflect.set(r,n,i,o);return r===_(o)&&(a?Ot(i,s)&&j(r,"set",n,i,s):j(r,"add",n,i)),c}}function oi(e,t){let r=le(e,t),n=e[t],i=Reflect.deleteProperty(e,t);return i&&r&&j(e,"delete",t,void 0,n),i}function si(e,t){let r=Reflect.has(e,t);return(!De(t)||!jr.has(t))&&T(e,"has",t),r}function ai(e){return T(e,"iterate",L(e)?"length":U),Reflect.ownKeys(e)}var Vr={get:Zn,set:ni,deleteProperty:oi,has:si,ownKeys:ai},Hr={get:Xn,set(e,t){return console.warn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0},deleteProperty(e,t){return console.warn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},_s=Et({},Vr,{get:Qn,set:ii}),gs=Et({},Hr,{get:ei}),Nt=e=>ue(e)?Fe(e):e,Pt=e=>ue(e)?Kr(e):e,kt=e=>e,Be=e=>Reflect.getPrototypeOf(e);function Ke(e,t,r=!1,n=!1){e=e.__v_raw;let i=_(e),o=_(t);t!==o&&!r&&T(i,"get",t),!r&&T(i,"get",o);let{has:s}=Be(i),a=n?kt:r?Pt:Nt;if(s.call(i,t))return a(e.get(t));if(s.call(i,o))return a(e.get(o));e!==i&&e.get(t)}function ze(e,t=!1){let r=this.__v_raw,n=_(r),i=_(e);return e!==i&&!t&&T(n,"has",e),!t&&T(n,"has",i),e===i?r.has(e):r.has(e)||r.has(i)}function Ve(e,t=!1){return e=e.__v_raw,!t&&T(_(e),"iterate",U),Reflect.get(e,"size",e)}function qr(e){e=_(e);let t=_(this);return Be(t).has.call(t,e)||(t.add(e),j(t,"add",e,e)),this}function Wr(e,t){t=_(t);let r=_(this),{has:n,get:i}=Be(r),o=n.call(r,e);o?Ur(r,n,e):(e=_(e),o=n.call(r,e));let s=i.call(r,e);return r.set(e,t),o?Ot(t,s)&&j(r,"set",e,t,s):j(r,"add",e,t),this}function Gr(e){let t=_(this),{has:r,get:n}=Be(t),i=r.call(t,e);i?Ur(t,r,e):(e=_(e),i=r.call(t,e));let o=n?n.call(t,e):void 0,s=t.delete(e);return i&&j(t,"delete",e,void 0,o),s}function Yr(){let e=_(this),t=e.size!==0,r=X(e)?new Map(e):new Set(e),n=e.clear();return t&&j(e,"clear",void 0,void 0,r),n}function He(e,t){return function(n,i){let o=this,s=o.__v_raw,a=_(s),c=t?kt:e?Pt:Nt;return!e&&T(a,"iterate",U),s.forEach((l,u)=>n.call(i,c(l),c(u),o))}}function qe(e,t,r){return function(...n){let i=this.__v_raw,o=_(i),s=X(o),a=e==="entries"||e===Symbol.iterator&&s,c=e==="keys"&&s,l=i[e](...n),u=r?kt:t?Pt:Nt;return!t&&T(o,"iterate",c?Ct:U),{next(){let{value:p,done:y}=l.next();return y?{value:p,done:y}:{value:a?[u(p[0]),u(p[1])]:u(p),done:y}},[Symbol.iterator](){return this}}}}function F(e){return function(...t){{let r=t[0]?`on key "${t[0]}" `:"";console.warn(`${At(e)} operation ${r}failed: target is readonly.`,_(this))}return e==="delete"?!1:this}}var Jr={get(e){return Ke(this,e)},get size(){return Ve(this)},has:ze,add:qr,set:Wr,delete:Gr,clear:Yr,forEach:He(!1,!1)},Zr={get(e){return Ke(this,e,!1,!0)},get size(){return Ve(this)},has:ze,add:qr,set:Wr,delete:Gr,clear:Yr,forEach:He(!1,!0)},Qr={get(e){return Ke(this,e,!0)},get size(){return Ve(this,!0)},has(e){return ze.call(this,e,!0)},add:F("add"),set:F("set"),delete:F("delete"),clear:F("clear"),forEach:He(!0,!1)},Xr={get(e){return Ke(this,e,!0,!0)},get size(){return Ve(this,!0)},has(e){return ze.call(this,e,!0)},add:F("add"),set:F("set"),delete:F("delete"),clear:F("clear"),forEach:He(!0,!0)},ci=["keys","values","entries",Symbol.iterator];ci.forEach(e=>{Jr[e]=qe(e,!1,!1),Qr[e]=qe(e,!0,!1),Zr[e]=qe(e,!1,!0),Xr[e]=qe(e,!0,!0)});function Ue(e,t){let r=t?e?Xr:Zr:e?Qr:Jr;return(n,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?n:Reflect.get(le(r,i)&&i in n?r:n,i,o)}var li={get:Ue(!1,!1)},xs={get:Ue(!1,!0)},ui={get:Ue(!0,!1)},ys={get:Ue(!0,!0)};function Ur(e,t,r){let n=_(r);if(n!==r&&t.call(e,n)){let i=St(e);console.warn(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var Fr=new WeakMap,ti=new WeakMap,Br=new WeakMap,ri=new WeakMap;function fi(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function di(e){return e.__v_skip||!Object.isExtensible(e)?0:fi(St(e))}function Fe(e){return e&&e.__v_isReadonly?e:en(e,!1,Vr,li,Fr)}function Kr(e){return en(e,!0,Hr,ui,Br)}function en(e,t,r,n,i){if(!ue(e))return console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;let o=i.get(e);if(o)return o;let s=di(e);if(s===0)return e;let a=new Proxy(e,s===2?n:r);return i.set(e,a),a}function _(e){return e&&_(e.__v_raw)||e}function Mt(e){return Boolean(e&&e.__v_isRef===!0)}x("nextTick",()=>Ce);x("dispatch",e=>z.bind(z,e));x("watch",(e,{evaluateLater:t,effect:r})=>(n,i)=>{let o=t(n),s=!0,a,c=r(()=>o(l=>{JSON.stringify(l),s?a=l:queueMicrotask(()=>{i(l,a),a=l}),s=!1}));e._x_effects.delete(c)});x("store",Ar);x("data",e=>ye(e));x("root",e=>V(e));x("refs",e=>(e._x_refs_proxy||(e._x_refs_proxy=D(pi(e))),e._x_refs_proxy));function pi(e){let t=[],r=e;for(;r;)r._x_refs&&t.push(r._x_refs),r=r.parentNode;return t}var Dt={};function It(e){return Dt[e]||(Dt[e]=0),++Dt[e]}function tn(e,t){return Q(e,r=>{if(r._x_ids&&r._x_ids[t])return!0})}function rn(e,t){e._x_ids||(e._x_ids={}),e._x_ids[t]||(e._x_ids[t]=It(t))}x("id",e=>(t,r=null)=>{let n=tn(e,t),i=n?n._x_ids[t]:It(t);return r?`${t}-${i}-${r}`:`${t}-${i}`});x("el",e=>e);nn("Focus","focus","focus");nn("Persist","persist","persist");function nn(e,t,r){x(t,n=>O(`You can't use [$${directiveName}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}d("modelable",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t),o=()=>{let l;return i(u=>l=u),l},s=n(`${t} = __placeholder`),a=l=>s(()=>{},{scope:{__placeholder:l}}),c=o();a(c),queueMicrotask(()=>{if(!e._x_model)return;e._x_removeModelListeners.default();let l=e._x_model.get,u=e._x_model.set;r(()=>a(l())),r(()=>u(o()))})});d("teleport",(e,{expression:t},{cleanup:r})=>{e.tagName.toLowerCase()!=="template"&&O("x-teleport can only be used on a <template> tag",e);let n=document.querySelector(t);n||O(`Cannot find x-teleport element for selector: "${t}"`);let i=e.content.cloneNode(!0).firstElementChild;e._x_teleport=i,i._x_teleportBack=e,e._x_forwardEvents&&e._x_forwardEvents.forEach(o=>{i.addEventListener(o,s=>{s.stopPropagation(),e.dispatchEvent(new s.constructor(s.type,s))})}),C(i,{},e),m(()=>{n.appendChild(i),w(i),i._x_ignore=!0}),r(()=>i.remove())});var on=()=>{};on.inline=(e,{modifiers:t},{cleanup:r})=>{t.includes("self")?e._x_ignoreSelf=!0:e._x_ignore=!0,r(()=>{t.includes("self")?delete e._x_ignoreSelf:delete e._x_ignore})};d("ignore",on);d("effect",(e,{expression:t},{effect:r})=>r(g(e,t)));function de(e,t,r,n){let i=e,o=c=>n(c),s={},a=(c,l)=>u=>l(c,u);if(r.includes("dot")&&(t=mi(t)),r.includes("camel")&&(t=hi(t)),r.includes("passive")&&(s.passive=!0),r.includes("capture")&&(s.capture=!0),r.includes("window")&&(i=window),r.includes("document")&&(i=document),r.includes("prevent")&&(o=a(o,(c,l)=>{l.preventDefault(),c(l)})),r.includes("stop")&&(o=a(o,(c,l)=>{l.stopPropagation(),c(l)})),r.includes("self")&&(o=a(o,(c,l)=>{l.target===e&&c(l)})),(r.includes("away")||r.includes("outside"))&&(i=document,o=a(o,(c,l)=>{e.contains(l.target)||l.target.isConnected!==!1&&(e.offsetWidth<1&&e.offsetHeight<1||e._x_isShown!==!1&&c(l))})),r.includes("once")&&(o=a(o,(c,l)=>{c(l),i.removeEventListener(t,o,s)})),o=a(o,(c,l)=>{_i(t)&&gi(l,r)||c(l)}),r.includes("debounce")){let c=r[r.indexOf("debounce")+1]||"invalid-wait",l=$t(c.split("ms")[0])?Number(c.split("ms")[0]):250;o=Pe(o,l)}if(r.includes("throttle")){let c=r[r.indexOf("throttle")+1]||"invalid-wait",l=$t(c.split("ms")[0])?Number(c.split("ms")[0]):250;o=ke(o,l)}return i.addEventListener(t,o,s),()=>{i.removeEventListener(t,o,s)}}function mi(e){return e.replace(/-/g,".")}function hi(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function $t(e){return!Array.isArray(e)&&!isNaN(e)}function xi(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function _i(e){return["keydown","keyup"].includes(e)}function gi(e,t){let r=t.filter(o=>!["window","document","prevent","stop","once"].includes(o));if(r.includes("debounce")){let o=r.indexOf("debounce");r.splice(o,$t((r[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.length===0||r.length===1&&sn(e.key).includes(r[0]))return!1;let i=["ctrl","shift","alt","meta","cmd","super"].filter(o=>r.includes(o));return r=r.filter(o=>!i.includes(o)),!(i.length>0&&i.filter(s=>((s==="cmd"||s==="super")&&(s="meta"),e[`${s}Key`])).length===i.length&&sn(e.key).includes(r[0]))}function sn(e){if(!e)return[];e=xi(e);let t={ctrl:"control",slash:"/",space:"-",spacebar:"-",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",equal:"="};return t[e]=e,Object.keys(t).map(r=>{if(t[r]===e)return r}).filter(r=>r)}d("model",(e,{modifiers:t,expression:r},{effect:n,cleanup:i})=>{let o=g(e,r),s=`${r} = rightSideOfExpression($event, ${r})`,a=g(e,s);var c=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)||t.includes("lazy")?"change":"input";let l=yi(e,t,r),u=de(e,c,t,y=>{a(()=>{},{scope:{$event:y,rightSideOfExpression:l}})});e._x_removeModelListeners||(e._x_removeModelListeners={}),e._x_removeModelListeners.default=u,i(()=>e._x_removeModelListeners.default());let p=g(e,`${r} = __placeholder`);e._x_model={get(){let y;return o(N=>y=N),y},set(y){p(()=>{},{scope:{__placeholder:y}})}},e._x_forceModelUpdate=()=>{o(y=>{y===void 0&&r.match(/\./)&&(y=""),window.fromModel=!0,m(()=>ce(e,"value",y)),delete window.fromModel})},n(()=>{t.includes("unintrusive")&&document.activeElement.isSameNode(e)||e._x_forceModelUpdate()})});function yi(e,t,r){return e.type==="radio"&&m(()=>{e.hasAttribute("name")||e.setAttribute("name",r)}),(n,i)=>m(()=>{if(n instanceof CustomEvent&&n.detail!==void 0)return n.detail||n.target.value;if(e.type==="checkbox")if(Array.isArray(i)){let o=t.includes("number")?Lt(n.target.value):n.target.value;return n.target.checked?i.concat([o]):i.filter(s=>!bi(s,o))}else return n.target.checked;else{if(e.tagName.toLowerCase()==="select"&&e.multiple)return t.includes("number")?Array.from(n.target.selectedOptions).map(o=>{let s=o.value||o.text;return Lt(s)}):Array.from(n.target.selectedOptions).map(o=>o.value||o.text);{let o=n.target.value;return t.includes("number")?Lt(o):t.includes("trim")?o.trim():o}}})}function Lt(e){let t=e?parseFloat(e):null;return vi(t)?t:e}function bi(e,t){return e==t}function vi(e){return!Array.isArray(e)&&!isNaN(e)}d("cloak",e=>queueMicrotask(()=>m(()=>e.removeAttribute(E("cloak")))));Me(()=>`[${E("init")}]`);d("init",$((e,{expression:t},{evaluate:r})=>typeof t=="string"?!!t.trim()&&r(t,{},!1):r(t,{},!1)));d("text",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i(o=>{m(()=>{e.textContent=o})})})});d("html",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i(o=>{m(()=>{e.innerHTML=o,e._x_ignoreSelf=!0,w(e),delete e._x_ignoreSelf})})})});Z(Se(":",Ae(E("bind:"))));d("bind",(e,{value:t,modifiers:r,expression:n,original:i},{effect:o})=>{if(!t){let a={};Cr(a),g(e,n)(l=>{vt(e,l,i)},{scope:a});return}if(t==="key")return wi(e,n);let s=g(e,n);o(()=>s(a=>{a===void 0&&n.match(/\./)&&(a=""),m(()=>ce(e,t,a,r))}))});function wi(e,t){e._x_keyExpression=t}Re(()=>`[${E("data")}]`);d("data",$((e,{expression:t},{cleanup:r})=>{t=t===""?"{}":t;let n={},i=re(n,e).cleanup,o={};Nr(o,n);let s=P(e,t,{scope:o});s===void 0&&(s={});let a=re(s,e).cleanup,c=A(s);be(c);let l=C(e,c);c.init&&P(e,c.init),r(()=>{l(),i(),a(),c.destroy&&P(e,c.destroy),l()})}));d("show",(e,{modifiers:t,expression:r},{effect:n})=>{let i=g(e,r);e._x_doHide||(e._x_doHide=()=>{m(()=>{e.style.setProperty("display","none",t.includes("important")?"important":void 0)})}),e._x_doShow||(e._x_doShow=()=>{m(()=>{e.style.length===1&&e.style.display==="none"?e.removeAttribute("style"):e.style.removeProperty("display")})});let o=()=>{e._x_doHide(),e._x_isShown=!1},s=()=>{e._x_doShow(),e._x_isShown=!0},a=()=>setTimeout(s),c=se(p=>p?s():o(),p=>{typeof e._x_toggleAndCascadeWithTransitions=="function"?e._x_toggleAndCascadeWithTransitions(e,p,s,o):p?a():o()}),l,u=!0;n(()=>i(p=>{!u&&p===l||(t.includes("immediate")&&(p?a():o()),c(p),l=p,u=!1)}))});d("for",(e,{expression:t},{effect:r,cleanup:n})=>{let i=Si(t),o=g(e,i.items),s=g(e,e._x_keyExpression||"index");e._x_prevKeys=[],e._x_lookup={},r(()=>Ei(e,i,o,s)),n(()=>{Object.values(e._x_lookup).forEach(a=>a.remove()),delete e._x_prevKeys,delete e._x_lookup})});function Ei(e,t,r,n){let i=s=>typeof s=="object"&&!Array.isArray(s),o=e;r(s=>{Ai(s)&&s>=0&&(s=Array.from(Array(s).keys(),f=>f+1)),s===void 0&&(s=[]);let a=e._x_lookup,c=e._x_prevKeys,l=[],u=[];if(i(s))s=Object.entries(s).map(([f,h])=>{let b=an(t,h,f,s);n(v=>u.push(v),{scope:{index:f,...b}}),l.push(b)});else for(let f=0;f<s.length;f++){let h=an(t,s[f],f,s);n(b=>u.push(b),{scope:{index:f,...h}}),l.push(h)}let p=[],y=[],N=[],W=[];for(let f=0;f<c.length;f++){let h=c[f];u.indexOf(h)===-1&&N.push(h)}c=c.filter(f=>!N.includes(f));let pe="template";for(let f=0;f<u.length;f++){let h=u[f],b=c.indexOf(h);if(b===-1)c.splice(f,0,h),p.push([pe,f]);else if(b!==f){let v=c.splice(f,1)[0],S=c.splice(b-1,1)[0];c.splice(f,0,S),c.splice(b,0,v),y.push([v,S])}else W.push(h);pe=h}for(let f=0;f<N.length;f++){let h=N[f];a[h]._x_effects&&a[h]._x_effects.forEach(he),a[h].remove(),a[h]=null,delete a[h]}for(let f=0;f<y.length;f++){let[h,b]=y[f],v=a[h],S=a[b],G=document.createElement("div");m(()=>{S.after(G),v.after(S),S._x_currentIfEl&&S.after(S._x_currentIfEl),G.before(v),v._x_currentIfEl&&v.after(v._x_currentIfEl),G.remove()}),at(S,l[u.indexOf(b)])}for(let f=0;f<p.length;f++){let[h,b]=p[f],v=h==="template"?o:a[h];v._x_currentIfEl&&(v=v._x_currentIfEl);let S=l[b],G=u[b],me=document.importNode(o.content,!0).firstElementChild;C(me,A(S),o),m(()=>{v.after(me),w(me)}),typeof G=="object"&&O("x-for key cannot be an object, it must be a string or an integer",o),a[G]=me}for(let f=0;f<W.length;f++)at(a[W[f]],l[u.indexOf(W[f])]);o._x_prevKeys=u})}function Si(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,r=/^\s*\(|\)\s*$/g,n=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,i=e.match(n);if(!i)return;let o={};o.items=i[2].trim();let s=i[1].replace(r,"").trim(),a=s.match(t);return a?(o.item=s.replace(t,"").trim(),o.index=a[1].trim(),a[2]&&(o.collection=a[2].trim())):o.item=s,o}function an(e,t,r,n){let i={};return/^\[.*\]$/.test(e.item)&&Array.isArray(t)?e.item.replace("[","").replace("]","").split(",").map(s=>s.trim()).forEach((s,a)=>{i[s]=t[a]}):/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t=="object"?e.item.replace("{","").replace("}","").split(",").map(s=>s.trim()).forEach(s=>{i[s]=t[s]}):i[e.item]=t,e.index&&(i[e.index]=r),e.collection&&(i[e.collection]=n),i}function Ai(e){return!Array.isArray(e)&&!isNaN(e)}function cn(){}cn.inline=(e,{expression:t},{cleanup:r})=>{let n=V(e);n._x_refs||(n._x_refs={}),n._x_refs[t]=e,r(()=>delete n._x_refs[t])};d("ref",cn);d("if",(e,{expression:t},{effect:r,cleanup:n})=>{let i=g(e,t),o=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let a=e.content.cloneNode(!0).firstElementChild;return C(a,{},e),m(()=>{e.after(a),w(a)}),e._x_currentIfEl=a,e._x_undoIf=()=>{R(a,c=>{c._x_effects&&c._x_effects.forEach(he)}),a.remove(),delete e._x_currentIfEl},a},s=()=>{!e._x_undoIf||(e._x_undoIf(),delete e._x_undoIf)};r(()=>i(a=>{a?o():s()})),n(()=>e._x_undoIf&&e._x_undoIf())});d("id",(e,{expression:t},{evaluate:r})=>{r(t).forEach(i=>rn(e,i))});Z(Se("@",Ae(E("on:"))));d("on",$((e,{value:t,modifiers:r,expression:n},{cleanup:i})=>{let o=n?g(e,n):()=>{};e.tagName.toLowerCase()==="template"&&(e._x_forwardEvents||(e._x_forwardEvents=[]),e._x_forwardEvents.includes(t)||e._x_forwardEvents.push(t));let s=de(e,t,r,a=>{o(()=>{},{scope:{$event:a},params:[a]})});i(()=>s())}));We("Collapse","collapse","collapse");We("Intersect","intersect","intersect");We("Focus","trap","focus");We("Mask","mask","mask");function We(e,t,r){d(t,n=>O(`You can't use [x-${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}I.setEvaluator(ut);I.setReactivityEngine({reactive:Fe,effect:Dr,release:$r,raw:_});var jt=I;window.Alpine=jt;queueMicrotask(()=>{jt.start()});})();
diff --git a/alpinejs/packages/alpinejs/dist/module.cjs.js b/alpinejs/packages/alpinejs/dist/module.cjs.js
index 7813685..c6acc07 100644
--- a/alpinejs/packages/alpinejs/dist/module.cjs.js
+++ b/alpinejs/packages/alpinejs/dist/module.cjs.js
@@ -1796,8 +1796,23 @@ function directive(name, callback) {
directiveHandlers[name] = callback;
}
function directives(el, attributes, originalAttributeOverride) {
+ attributes = Array.from(attributes);
+ if (el._x_virtualDirectives) {
+ let vAttributes = Object.entries(el._x_virtualDirectives).map(([name, value]) => ({name, value}));
+ let staticAttributes = attributesOnly(vAttributes);
+ vAttributes = vAttributes.map((attribute) => {
+ if (staticAttributes.find((attr) => attr.name === attribute.name)) {
+ return {
+ name: `x-bind:${attribute.name}`,
+ value: `"${attribute.value}"`
+ };
+ }
+ return attribute;
+ });
+ attributes = attributes.concat(vAttributes);
+ }
let transformedAttributeMap = {};
- let directives2 = Array.from(attributes).map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority);
+ let directives2 = attributes.map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority);
return directives2.map((directive2) => {
return getDirectiveHandler(el, directive2);
});
@@ -1912,8 +1927,7 @@ var directiveOrder = [
"show",
"if",
DEFAULT,
- "teleport",
- "element"
+ "teleport"
];
function byPriority(a, b) {
let typeA = directiveOrder.indexOf(a.type) === -1 ? DEFAULT : a.type;
@@ -2258,9 +2272,8 @@ function registerTransitionObject(el, setFunction, defaultValue = {}) {
};
}
window.Element.prototype._x_toggleAndCascadeWithTransitions = function(el, value, show, hide) {
- let clickAwayCompatibleShow = () => {
- document.visibilityState === "visible" ? requestAnimationFrame(show) : setTimeout(show);
- };
+ const nextTick2 = document.visibilityState === "visible" ? requestAnimationFrame : setTimeout;
+ let clickAwayCompatibleShow = () => nextTick2(show);
if (value) {
if (el._x_transition && (el._x_transition.enter || el._x_transition.leave)) {
el._x_transition.enter && (Object.entries(el._x_transition.enter.during).length || Object.entries(el._x_transition.enter.start).length || Object.entries(el._x_transition.enter.end).length) ? el._x_transition.in(show) : clickAwayCompatibleShow();
@@ -2281,7 +2294,7 @@ window.Element.prototype._x_toggleAndCascadeWithTransitions = function(el, value
closest._x_hideChildren = [];
closest._x_hideChildren.push(el);
} else {
- queueMicrotask(() => {
+ nextTick2(() => {
let hideAfterChildren = (el2) => {
let carry = Promise.all([
el2._x_hidePromise,
@@ -2645,8 +2658,13 @@ function getStores() {
// packages/alpinejs/src/binds.js
var binds = {};
-function bind2(name, object) {
- binds[name] = typeof object !== "function" ? () => object : object;
+function bind2(name, bindings) {
+ let getBindings = typeof bindings !== "function" ? () => bindings : bindings;
+ if (name instanceof Element) {
+ applyBindingsObject(name, getBindings());
+ } else {
+ binds[name] = getBindings;
+ }
}
function injectBindingProviders(obj) {
Object.entries(binds).forEach(([name, callback]) => {
@@ -2660,6 +2678,26 @@ function injectBindingProviders(obj) {
});
return obj;
}
+function applyBindingsObject(el, obj, original) {
+ let cleanupRunners = [];
+ while (cleanupRunners.length)
+ cleanupRunners.pop()();
+ let attributes = Object.entries(obj).map(([name, value]) => ({name, value}));
+ let staticAttributes = attributesOnly(attributes);
+ attributes = attributes.map((attribute) => {
+ if (staticAttributes.find((attr) => attr.name === attribute.name)) {
+ return {
+ name: `x-bind:${attribute.name}`,
+ value: `"${attribute.value}"`
+ };
+ }
+ return attribute;
+ });
+ directives(el, attributes, original).map((handle) => {
+ cleanupRunners.push(handle.runCleanups);
+ handle();
+ });
+}
// packages/alpinejs/src/datas.js
var datas = {};
@@ -2694,7 +2732,7 @@ var Alpine = {
get raw() {
return raw;
},
- version: "3.10.2",
+ version: "3.10.3",
flushAndStopDeferringMutations,
dontAutoEvaluateFunctions,
disableEffectScheduling,
@@ -3169,7 +3207,13 @@ directive("html", (el, {expression}, {effect: effect3, evaluateLater: evaluateLa
mapAttributes(startingWith(":", into(prefix("bind:"))));
directive("bind", (el, {value, modifiers, expression, original}, {effect: effect3}) => {
if (!value) {
- return applyBindingsObject(el, expression, original, effect3);
+ let bindingProviders = {};
+ injectBindingProviders(bindingProviders);
+ let getBindings = evaluateLater(el, expression);
+ getBindings((bindings) => {
+ applyBindingsObject(el, bindings, original);
+ }, {scope: bindingProviders});
+ return;
}
if (value === "key")
return storeKeyForXFor(el, expression);
@@ -3180,31 +3224,6 @@ directive("bind", (el, {value, modifiers, expression, original}, {effect: effect
mutateDom(() => bind(el, value, result, modifiers));
}));
});
-function applyBindingsObject(el, expression, original, effect3) {
- let bindingProviders = {};
- injectBindingProviders(bindingProviders);
- let getBindings = evaluateLater(el, expression);
- let cleanupRunners = [];
- while (cleanupRunners.length)
- cleanupRunners.pop()();
- getBindings((bindings) => {
- let attributes = Object.entries(bindings).map(([name, value]) => ({name, value}));
- let staticAttributes = attributesOnly(attributes);
- attributes = attributes.map((attribute) => {
- if (staticAttributes.find((attr) => attr.name === attribute.name)) {
- return {
- name: `x-bind:${attribute.name}`,
- value: `"${attribute.value}"`
- };
- }
- return attribute;
- });
- directives(el, attributes, original).map((handle) => {
- cleanupRunners.push(handle.runCleanups);
- handle();
- });
- }, {scope: bindingProviders});
-}
function storeKeyForXFor(el, expression) {
el._x_keyExpression = expression;
}
@@ -3239,7 +3258,9 @@ directive("show", (el, {modifiers, expression}, {effect: effect3}) => {
let evaluate2 = evaluateLater(el, expression);
if (!el._x_doHide)
el._x_doHide = () => {
- mutateDom(() => el.style.display = "none");
+ mutateDom(() => {
+ el.style.setProperty("display", "none", modifiers.includes("important") ? "important" : void 0);
+ });
};
if (!el._x_doShow)
el._x_doShow = () => {
diff --git a/alpinejs/packages/alpinejs/dist/module.esm.js b/alpinejs/packages/alpinejs/dist/module.esm.js
index 5e8eed0..53071cd 100644
--- a/alpinejs/packages/alpinejs/dist/module.esm.js
+++ b/alpinejs/packages/alpinejs/dist/module.esm.js
@@ -530,8 +530,23 @@ function directive(name, callback) {
directiveHandlers[name] = callback;
}
function directives(el, attributes, originalAttributeOverride) {
+ attributes = Array.from(attributes);
+ if (el._x_virtualDirectives) {
+ let vAttributes = Object.entries(el._x_virtualDirectives).map(([name, value]) => ({name, value}));
+ let staticAttributes = attributesOnly(vAttributes);
+ vAttributes = vAttributes.map((attribute) => {
+ if (staticAttributes.find((attr) => attr.name === attribute.name)) {
+ return {
+ name: `x-bind:${attribute.name}`,
+ value: `"${attribute.value}"`
+ };
+ }
+ return attribute;
+ });
+ attributes = attributes.concat(vAttributes);
+ }
let transformedAttributeMap = {};
- let directives2 = Array.from(attributes).map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority);
+ let directives2 = attributes.map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority);
return directives2.map((directive2) => {
return getDirectiveHandler(el, directive2);
});
@@ -646,8 +661,7 @@ var directiveOrder = [
"show",
"if",
DEFAULT,
- "teleport",
- "element"
+ "teleport"
];
function byPriority(a, b) {
let typeA = directiveOrder.indexOf(a.type) === -1 ? DEFAULT : a.type;
@@ -992,9 +1006,8 @@ function registerTransitionObject(el, setFunction, defaultValue = {}) {
};
}
window.Element.prototype._x_toggleAndCascadeWithTransitions = function(el, value, show, hide) {
- let clickAwayCompatibleShow = () => {
- document.visibilityState === "visible" ? requestAnimationFrame(show) : setTimeout(show);
- };
+ const nextTick2 = document.visibilityState === "visible" ? requestAnimationFrame : setTimeout;
+ let clickAwayCompatibleShow = () => nextTick2(show);
if (value) {
if (el._x_transition && (el._x_transition.enter || el._x_transition.leave)) {
el._x_transition.enter && (Object.entries(el._x_transition.enter.during).length || Object.entries(el._x_transition.enter.start).length || Object.entries(el._x_transition.enter.end).length) ? el._x_transition.in(show) : clickAwayCompatibleShow();
@@ -1015,7 +1028,7 @@ window.Element.prototype._x_toggleAndCascadeWithTransitions = function(el, value
closest._x_hideChildren = [];
closest._x_hideChildren.push(el);
} else {
- queueMicrotask(() => {
+ nextTick2(() => {
let hideAfterChildren = (el2) => {
let carry = Promise.all([
el2._x_hidePromise,
@@ -1379,8 +1392,13 @@ function getStores() {
// packages/alpinejs/src/binds.js
var binds = {};
-function bind2(name, object) {
- binds[name] = typeof object !== "function" ? () => object : object;
+function bind2(name, bindings) {
+ let getBindings = typeof bindings !== "function" ? () => bindings : bindings;
+ if (name instanceof Element) {
+ applyBindingsObject(name, getBindings());
+ } else {
+ binds[name] = getBindings;
+ }
}
function injectBindingProviders(obj) {
Object.entries(binds).forEach(([name, callback]) => {
@@ -1394,6 +1412,26 @@ function injectBindingProviders(obj) {
});
return obj;
}
+function applyBindingsObject(el, obj, original) {
+ let cleanupRunners = [];
+ while (cleanupRunners.length)
+ cleanupRunners.pop()();
+ let attributes = Object.entries(obj).map(([name, value]) => ({name, value}));
+ let staticAttributes = attributesOnly(attributes);
+ attributes = attributes.map((attribute) => {
+ if (staticAttributes.find((attr) => attr.name === attribute.name)) {
+ return {
+ name: `x-bind:${attribute.name}`,
+ value: `"${attribute.value}"`
+ };
+ }
+ return attribute;
+ });
+ directives(el, attributes, original).map((handle) => {
+ cleanupRunners.push(handle.runCleanups);
+ handle();
+ });
+}
// packages/alpinejs/src/datas.js
var datas = {};
@@ -1428,7 +1466,7 @@ var Alpine = {
get raw() {
return raw;
},
- version: "3.10.2",
+ version: "3.10.3",
flushAndStopDeferringMutations,
dontAutoEvaluateFunctions,
disableEffectScheduling,
@@ -2579,7 +2617,13 @@ directive("html", (el, {expression}, {effect: effect3, evaluateLater: evaluateLa
mapAttributes(startingWith(":", into(prefix("bind:"))));
directive("bind", (el, {value, modifiers, expression, original}, {effect: effect3}) => {
if (!value) {
- return applyBindingsObject(el, expression, original, effect3);
+ let bindingProviders = {};
+ injectBindingProviders(bindingProviders);
+ let getBindings = evaluateLater(el, expression);
+ getBindings((bindings) => {
+ applyBindingsObject(el, bindings, original);
+ }, {scope: bindingProviders});
+ return;
}
if (value === "key")
return storeKeyForXFor(el, expression);
@@ -2590,31 +2634,6 @@ directive("bind", (el, {value, modifiers, expression, original}, {effect: effect
mutateDom(() => bind(el, value, result, modifiers));
}));
});
-function applyBindingsObject(el, expression, original, effect3) {
- let bindingProviders = {};
- injectBindingProviders(bindingProviders);
- let getBindings = evaluateLater(el, expression);
- let cleanupRunners = [];
- while (cleanupRunners.length)
- cleanupRunners.pop()();
- getBindings((bindings) => {
- let attributes = Object.entries(bindings).map(([name, value]) => ({name, value}));
- let staticAttributes = attributesOnly(attributes);
- attributes = attributes.map((attribute) => {
- if (staticAttributes.find((attr) => attr.name === attribute.name)) {
- return {
- name: `x-bind:${attribute.name}`,
- value: `"${attribute.value}"`
- };
- }
- return attribute;
- });
- directives(el, attributes, original).map((handle) => {
- cleanupRunners.push(handle.runCleanups);
- handle();
- });
- }, {scope: bindingProviders});
-}
function storeKeyForXFor(el, expression) {
el._x_keyExpression = expression;
}
@@ -2649,7 +2668,9 @@ directive("show", (el, {modifiers, expression}, {effect: effect3}) => {
let evaluate2 = evaluateLater(el, expression);
if (!el._x_doHide)
el._x_doHide = () => {
- mutateDom(() => el.style.display = "none");
+ mutateDom(() => {
+ el.style.setProperty("display", "none", modifiers.includes("important") ? "important" : void 0);
+ });
};
if (!el._x_doShow)
el._x_doShow = () => {
diff --git a/alpinejs/packages/alpinejs/package.json b/alpinejs/packages/alpinejs/package.json
index 24b6a3f..047e532 100644
--- a/alpinejs/packages/alpinejs/package.json
+++ b/alpinejs/packages/alpinejs/package.json
@@ -1,6 +1,6 @@
{
"name": "alpinejs",
- "version": "3.10.2",
+ "version": "3.10.3",
"description": "The rugged, minimal JavaScript framework",
"author": "Caleb Porzio",
"license": "MIT",
diff --git a/alpinejs/packages/alpinejs/src/binds.js b/alpinejs/packages/alpinejs/src/binds.js
index b842650..a6b96f7 100644
--- a/alpinejs/packages/alpinejs/src/binds.js
+++ b/alpinejs/packages/alpinejs/src/binds.js
@@ -1,8 +1,15 @@
+import { attributesOnly, directives } from "./directives"
let binds = {}
-export function bind(name, object) {
- binds[name] = typeof object !== 'function' ? () => object : object
+export function bind(name, bindings) {
+ let getBindings = typeof bindings !== 'function' ? () => bindings : bindings
+
+ if (name instanceof Element) {
+ applyBindingsObject(name, getBindings())
+ } else {
+ binds[name] = getBindings
+ }
}
export function injectBindingProviders(obj) {
@@ -18,3 +25,37 @@ export function injectBindingProviders(obj) {
return obj
}
+
+export function addVirtualBindings(el, bindings) {
+ let getBindings = typeof bindings !== 'function' ? () => bindings : bindings
+
+ el._x_virtualDirectives = getBindings()
+}
+
+export function applyBindingsObject(el, obj, original) {
+ let cleanupRunners = []
+
+ while (cleanupRunners.length) cleanupRunners.pop()()
+
+ let attributes = Object.entries(obj).map(([name, value]) => ({ name, value }))
+
+ let staticAttributes = attributesOnly(attributes)
+
+ // Handle binding normal HTML attributes (non-Alpine directives).
+ attributes = attributes.map(attribute => {
+ if (staticAttributes.find(attr => attr.name === attribute.name)) {
+ return {
+ name: `x-bind:${attribute.name}`,
+ value: `"${attribute.value}"`,
+ }
+ }
+
+ return attribute
+ })
+
+ directives(el, attributes, original).map(handle => {
+ cleanupRunners.push(handle.runCleanups)
+
+ handle()
+ })
+}
diff --git a/alpinejs/packages/alpinejs/src/directives.js b/alpinejs/packages/alpinejs/src/directives.js
index 4a1b9cf..73356fe 100644
--- a/alpinejs/packages/alpinejs/src/directives.js
+++ b/alpinejs/packages/alpinejs/src/directives.js
@@ -20,9 +20,31 @@ export function directive(name, callback) {
}
export function directives(el, attributes, originalAttributeOverride) {
+ attributes = Array.from(attributes)
+
+ if (el._x_virtualDirectives) {
+ let vAttributes = Object.entries(el._x_virtualDirectives).map(([name, value]) => ({ name, value }))
+
+ let staticAttributes = attributesOnly(vAttributes)
+
+ // Handle binding normal HTML attributes (non-Alpine directives).
+ vAttributes = vAttributes.map(attribute => {
+ if (staticAttributes.find(attr => attr.name === attribute.name)) {
+ return {
+ name: `x-bind:${attribute.name}`,
+ value: `"${attribute.value}"`,
+ }
+ }
+
+ return attribute
+ })
+
+ attributes = attributes.concat(vAttributes)
+ }
+
let transformedAttributeMap = {}
- let directives = Array.from(attributes)
+ let directives = attributes
.map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName))
.filter(outNonAlpineAttributes)
.map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride))
@@ -178,7 +200,6 @@ let directiveOrder = [
'if',
DEFAULT,
'teleport',
- 'element',
]
function byPriority(a, b) {
diff --git a/alpinejs/packages/alpinejs/src/directives/x-bind.js b/alpinejs/packages/alpinejs/src/directives/x-bind.js
index 39622dc..c01bb38 100644
--- a/alpinejs/packages/alpinejs/src/directives/x-bind.js
+++ b/alpinejs/packages/alpinejs/src/directives/x-bind.js
@@ -1,14 +1,23 @@
-import { attributesOnly, directive, directives, into, mapAttributes, prefix, startingWith } from '../directives'
+import { directive, into, mapAttributes, prefix, startingWith } from '../directives'
import { evaluateLater } from '../evaluator'
import { mutateDom } from '../mutation'
import bind from '../utils/bind'
-import { injectBindingProviders } from '../binds'
+import { applyBindingsObject, injectBindingProviders } from '../binds'
mapAttributes(startingWith(':', into(prefix('bind:'))))
directive('bind', (el, { value, modifiers, expression, original }, { effect }) => {
if (! value) {
- return applyBindingsObject(el, expression, original, effect)
+ let bindingProviders = {}
+ injectBindingProviders(bindingProviders)
+
+ let getBindings = evaluateLater(el, expression)
+
+ getBindings(bindings => {
+ applyBindingsObject(el, bindings, original)
+ }, { scope: bindingProviders } )
+
+ return
}
if (value === 'key') return storeKeyForXFor(el, expression)
@@ -23,40 +32,6 @@ directive('bind', (el, { value, modifiers, expression, original }, { effect }) =
}))
})
-function applyBindingsObject(el, expression, original, effect) {
- let bindingProviders = {}
- injectBindingProviders(bindingProviders)
-
- let getBindings = evaluateLater(el, expression)
-
- let cleanupRunners = []
-
- while (cleanupRunners.length) cleanupRunners.pop()()
-
- getBindings(bindings => {
- let attributes = Object.entries(bindings).map(([name, value]) => ({ name, value }))
-
- let staticAttributes = attributesOnly(attributes)
-
- // Handle binding normal HTML attributes (non-Alpine directives).
- attributes = attributes.map(attribute => {
- if (staticAttributes.find(attr => attr.name === attribute.name)) {
- return {
- name: `x-bind:${attribute.name}`,
- value: `"${attribute.value}"`,
- }
- }
-
- return attribute
- })
-
- directives(el, attributes, original).map(handle => {
- cleanupRunners.push(handle.runCleanups)
-
- handle()
- })
- }, { scope: bindingProviders } )
-}
function storeKeyForXFor(el, expression) {
el._x_keyExpression = expression
diff --git a/alpinejs/packages/alpinejs/src/directives/x-show.js b/alpinejs/packages/alpinejs/src/directives/x-show.js
index 3a1369a..6d764e2 100644
--- a/alpinejs/packages/alpinejs/src/directives/x-show.js
+++ b/alpinejs/packages/alpinejs/src/directives/x-show.js
@@ -9,7 +9,9 @@ directive('show', (el, { modifiers, expression }, { effect }) => {
// We're going to set this function on the element directly so that
// other plugins like "Collapse" can overwrite them with their own logic.
if (! el._x_doHide) el._x_doHide = () => {
- mutateDom(() => el.style.display = 'none')
+ mutateDom(() => {
+ el.style.setProperty('display', 'none', modifiers.includes('important') ? 'important' : undefined)
+ })
}
if (! el._x_doShow) el._x_doShow = () => {
diff --git a/alpinejs/packages/alpinejs/src/directives/x-transition.js b/alpinejs/packages/alpinejs/src/directives/x-transition.js
index 47749ad..f81933e 100644
--- a/alpinejs/packages/alpinejs/src/directives/x-transition.js
+++ b/alpinejs/packages/alpinejs/src/directives/x-transition.js
@@ -131,7 +131,8 @@ window.Element.prototype._x_toggleAndCascadeWithTransitions = function (el, valu
// it keeps running in background. setTimeout has a lower priority in the
// event loop so it would skip nested transitions but when the tab is
// hidden, it's not relevant.
- let clickAwayCompatibleShow = () => {document.visibilityState === 'visible' ? requestAnimationFrame(show) : setTimeout(show)}
+ const nextTick = document.visibilityState === 'visible' ? requestAnimationFrame : setTimeout;
+ let clickAwayCompatibleShow = () => nextTick(show);
if (value) {
if (el._x_transition && (el._x_transition.enter || el._x_transition.leave)) {
@@ -167,7 +168,7 @@ window.Element.prototype._x_toggleAndCascadeWithTransitions = function (el, valu
closest._x_hideChildren.push(el)
} else {
- queueMicrotask(() => {
+ nextTick(() => {
let hideAfterChildren = el => {
let carry = Promise.all([
el._x_hidePromise,
diff --git a/alpinejs/packages/alpinejs/src/utils/bind.js b/alpinejs/packages/alpinejs/src/utils/bind.js
index fc89b20..2c3b2a9 100644
--- a/alpinejs/packages/alpinejs/src/utils/bind.js
+++ b/alpinejs/packages/alpinejs/src/utils/bind.js
@@ -7,7 +7,7 @@ export default function bind(el, name, value, modifiers = []) {
if (! el._x_bindings) el._x_bindings = reactive({})
el._x_bindings[name] = value
-
+
name = modifiers.includes('camel') ? camelCase(name) : name
switch (name) {
@@ -129,21 +129,21 @@ function attributeShouldntBePreservedIfFalsy(name) {
}
export function getBinding(el, name, fallback) {
- // First let's get it out of Alpine bound data.
+ // First let's get it out of Alpine bound data.
if (el._x_bindings && el._x_bindings[name] !== undefined) return el._x_bindings[name]
- // If not, we'll return the literal attribute.
+ // If not, we'll return the literal attribute.
let attr = el.getAttribute(name)
// Nothing bound:
if (attr === null) return typeof fallback === 'function' ? fallback() : fallback
-
+
if (isBooleanAttr(name)) {
return !! [name, 'true'].includes(attr)
}
- // The case of a custom attribute with no value. Ex: <div manual>
+ // The case of a custom attribute with no value. Ex: <div manual>
if (attr === '') return true
-
+
return attr
}
diff --git a/alpinejs/packages/collapse/package.json b/alpinejs/packages/collapse/package.json
index e78804f..707e270 100644
--- a/alpinejs/packages/collapse/package.json
+++ b/alpinejs/packages/collapse/package.json
@@ -1,6 +1,6 @@
{
"name": "@alpinejs/collapse",
- "version": "3.10.2",
+ "version": "3.10.3",
"description": "Collapse and expand elements with robust animations",
"author": "Caleb Porzio",
"license": "MIT",
diff --git a/alpinejs/packages/csp/dist/cdn.js b/alpinejs/packages/csp/dist/cdn.js
index 8599847..2cba335 100644
--- a/alpinejs/packages/csp/dist/cdn.js
+++ b/alpinejs/packages/csp/dist/cdn.js
@@ -531,8 +531,23 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
directiveHandlers[name] = callback;
}
function directives(el, attributes, originalAttributeOverride) {
+ attributes = Array.from(attributes);
+ if (el._x_virtualDirectives) {
+ let vAttributes = Object.entries(el._x_virtualDirectives).map(([name, value]) => ({name, value}));
+ let staticAttributes = attributesOnly(vAttributes);
+ vAttributes = vAttributes.map((attribute) => {
+ if (staticAttributes.find((attr) => attr.name === attribute.name)) {
+ return {
+ name: `x-bind:${attribute.name}`,
+ value: `"${attribute.value}"`
+ };
+ }
+ return attribute;
+ });
+ attributes = attributes.concat(vAttributes);
+ }
let transformedAttributeMap = {};
- let directives2 = Array.from(attributes).map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority);
+ let directives2 = attributes.map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority);
return directives2.map((directive2) => {
return getDirectiveHandler(el, directive2);
});
@@ -647,8 +662,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
"show",
"if",
DEFAULT,
- "teleport",
- "element"
+ "teleport"
];
function byPriority(a, b) {
let typeA = directiveOrder.indexOf(a.type) === -1 ? DEFAULT : a.type;
@@ -993,9 +1007,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
};
}
window.Element.prototype._x_toggleAndCascadeWithTransitions = function(el, value, show, hide) {
- let clickAwayCompatibleShow = () => {
- document.visibilityState === "visible" ? requestAnimationFrame(show) : setTimeout(show);
- };
+ const nextTick2 = document.visibilityState === "visible" ? requestAnimationFrame : setTimeout;
+ let clickAwayCompatibleShow = () => nextTick2(show);
if (value) {
if (el._x_transition && (el._x_transition.enter || el._x_transition.leave)) {
el._x_transition.enter && (Object.entries(el._x_transition.enter.during).length || Object.entries(el._x_transition.enter.start).length || Object.entries(el._x_transition.enter.end).length) ? el._x_transition.in(show) : clickAwayCompatibleShow();
@@ -1016,7 +1029,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
closest._x_hideChildren = [];
closest._x_hideChildren.push(el);
} else {
- queueMicrotask(() => {
+ nextTick2(() => {
let hideAfterChildren = (el2) => {
let carry = Promise.all([
el2._x_hidePromise,
@@ -1380,8 +1393,13 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
// packages/alpinejs/src/binds.js
var binds = {};
- function bind2(name, object) {
- binds[name] = typeof object !== "function" ? () => object : object;
+ function bind2(name, bindings) {
+ let getBindings = typeof bindings !== "function" ? () => bindings : bindings;
+ if (name instanceof Element) {
+ applyBindingsObject(name, getBindings());
+ } else {
+ binds[name] = getBindings;
+ }
}
function injectBindingProviders(obj) {
Object.entries(binds).forEach(([name, callback]) => {
@@ -1395,6 +1413,26 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
});
return obj;
}
+ function applyBindingsObject(el, obj, original) {
+ let cleanupRunners = [];
+ while (cleanupRunners.length)
+ cleanupRunners.pop()();
+ let attributes = Object.entries(obj).map(([name, value]) => ({name, value}));
+ let staticAttributes = attributesOnly(attributes);
+ attributes = attributes.map((attribute) => {
+ if (staticAttributes.find((attr) => attr.name === attribute.name)) {
+ return {
+ name: `x-bind:${attribute.name}`,
+ value: `"${attribute.value}"`
+ };
+ }
+ return attribute;
+ });
+ directives(el, attributes, original).map((handle) => {
+ cleanupRunners.push(handle.runCleanups);
+ handle();
+ });
+ }
// packages/alpinejs/src/datas.js
var datas = {};
@@ -1429,7 +1467,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
get raw() {
return raw;
},
- version: "3.10.2",
+ version: "3.10.3",
flushAndStopDeferringMutations,
dontAutoEvaluateFunctions,
disableEffectScheduling,
@@ -2580,7 +2618,13 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
mapAttributes(startingWith(":", into(prefix("bind:"))));
directive("bind", (el, {value, modifiers, expression, original}, {effect: effect3}) => {
if (!value) {
- return applyBindingsObject(el, expression, original, effect3);
+ let bindingProviders = {};
+ injectBindingProviders(bindingProviders);
+ let getBindings = evaluateLater(el, expression);
+ getBindings((bindings) => {
+ applyBindingsObject(el, bindings, original);
+ }, {scope: bindingProviders});
+ return;
}
if (value === "key")
return storeKeyForXFor(el, expression);
@@ -2591,31 +2635,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
mutateDom(() => bind(el, value, result, modifiers));
}));
});
- function applyBindingsObject(el, expression, original, effect3) {
- let bindingProviders = {};
- injectBindingProviders(bindingProviders);
- let getBindings = evaluateLater(el, expression);
- let cleanupRunners = [];
- while (cleanupRunners.length)
- cleanupRunners.pop()();
- getBindings((bindings) => {
- let attributes = Object.entries(bindings).map(([name, value]) => ({name, value}));
- let staticAttributes = attributesOnly(attributes);
- attributes = attributes.map((attribute) => {
- if (staticAttributes.find((attr) => attr.name === attribute.name)) {
- return {
- name: `x-bind:${attribute.name}`,
- value: `"${attribute.value}"`
- };
- }
- return attribute;
- });
- directives(el, attributes, original).map((handle) => {
- cleanupRunners.push(handle.runCleanups);
- handle();
- });
- }, {scope: bindingProviders});
- }
function storeKeyForXFor(el, expression) {
el._x_keyExpression = expression;
}
@@ -2650,7 +2669,9 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
let evaluate2 = evaluateLater(el, expression);
if (!el._x_doHide)
el._x_doHide = () => {
- mutateDom(() => el.style.display = "none");
+ mutateDom(() => {
+ el.style.setProperty("display", "none", modifiers.includes("important") ? "important" : void 0);
+ });
};
if (!el._x_doShow)
el._x_doShow = () => {
diff --git a/alpinejs/packages/csp/dist/cdn.min.js b/alpinejs/packages/csp/dist/cdn.min.js
index 0aa6f4b..7f58476 100644
--- a/alpinejs/packages/csp/dist/cdn.min.js
+++ b/alpinejs/packages/csp/dist/cdn.min.js
@@ -1,5 +1,5 @@
-(()=>{var Ye=!1,Je=!1,K=[];function jt(e){cn(e)}function cn(e){K.includes(e)||K.push(e),ln()}function _e(e){let t=K.indexOf(e);t!==-1&&K.splice(t,1)}function ln(){!Je&&!Ye&&(Ye=!0,queueMicrotask(un))}function un(){Ye=!1,Je=!0;for(let e=0;e<K.length;e++)K[e]();K.length=0,Je=!1}var A,B,J,Ze,Qe=!0;function Ft(e){Qe=!1,e(),Qe=!0}function Kt(e){A=e.reactive,J=e.release,B=t=>e.effect(t,{scheduler:r=>{Qe?jt(r):r()}}),Ze=e.raw}function Xe(e){B=e}function Bt(e){let t=()=>{};return[n=>{let i=B(n);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(o=>o())}),e._x_effects.add(i),t=()=>{i!==void 0&&(e._x_effects.delete(i),J(i))},i},()=>{t()}]}var zt=[],Vt=[],Ht=[];function qt(e){Ht.push(e)}function ge(e,t){typeof t=="function"?(e._x_cleanups||(e._x_cleanups=[]),e._x_cleanups.push(t)):(t=e,Vt.push(t))}function Ut(e){zt.push(e)}function xe(e,t,r){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(r)}function et(e,t){!e._x_attributeCleanups||Object.entries(e._x_attributeCleanups).forEach(([r,n])=>{(t===void 0||t.includes(r))&&(n.forEach(i=>i()),delete e._x_attributeCleanups[r])})}var rt=new MutationObserver(tt),nt=!1;function it(){rt.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),nt=!0}function ot(){fn(),rt.disconnect(),nt=!1}var ne=[],st=!1;function fn(){ne=ne.concat(rt.takeRecords()),ne.length&&!st&&(st=!0,queueMicrotask(()=>{dn(),st=!1}))}function dn(){tt(ne),ne.length=0}function m(e){if(!nt)return e();ot();let t=e();return it(),t}var at=!1,ye=[];function Wt(){at=!0}function Gt(){at=!1,tt(ye),ye=[]}function tt(e){if(at){ye=ye.concat(e);return}let t=[],r=[],n=new Map,i=new Map;for(let o=0;o<e.length;o++)if(!e[o].target._x_ignoreMutationObserver&&(e[o].type==="childList"&&(e[o].addedNodes.forEach(s=>s.nodeType===1&&t.push(s)),e[o].removedNodes.forEach(s=>s.nodeType===1&&r.push(s))),e[o].type==="attributes")){let s=e[o].target,a=e[o].attributeName,c=e[o].oldValue,l=()=>{n.has(s)||n.set(s,[]),n.get(s).push({name:a,value:s.getAttribute(a)})},u=()=>{i.has(s)||i.set(s,[]),i.get(s).push(a)};s.hasAttribute(a)&&c===null?l():s.hasAttribute(a)?(u(),l()):u()}i.forEach((o,s)=>{et(s,o)}),n.forEach((o,s)=>{zt.forEach(a=>a(s,o))});for(let o of r)if(!t.includes(o)&&(Vt.forEach(s=>s(o)),o._x_cleanups))for(;o._x_cleanups.length;)o._x_cleanups.pop()();t.forEach(o=>{o._x_ignoreSelf=!0,o._x_ignore=!0});for(let o of t)r.includes(o)||!o.isConnected||(delete o._x_ignoreSelf,delete o._x_ignore,Ht.forEach(s=>s(o)),o._x_ignore=!0,o._x_ignoreSelf=!0);t.forEach(o=>{delete o._x_ignoreSelf,delete o._x_ignore}),t=null,r=null,n=null,i=null}function be(e){return M(C(e))}function R(e,t,r){return e._x_dataStack=[t,...C(r||e)],()=>{e._x_dataStack=e._x_dataStack.filter(n=>n!==t)}}function ct(e,t){let r=e._x_dataStack[0];Object.entries(t).forEach(([n,i])=>{r[n]=i})}function C(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?C(e.host):e.parentNode?C(e.parentNode):[]}function M(e){let t=new Proxy({},{ownKeys:()=>Array.from(new Set(e.flatMap(r=>Object.keys(r)))),has:(r,n)=>e.some(i=>i.hasOwnProperty(n)),get:(r,n)=>(e.find(i=>{if(i.hasOwnProperty(n)){let o=Object.getOwnPropertyDescriptor(i,n);if(o.get&&o.get._x_alreadyBound||o.set&&o.set._x_alreadyBound)return!0;if((o.get||o.set)&&o.enumerable){let s=o.get,a=o.set,c=o;s=s&&s.bind(t),a=a&&a.bind(t),s&&(s._x_alreadyBound=!0),a&&(a._x_alreadyBound=!0),Object.defineProperty(i,n,{...c,get:s,set:a})}return!0}return!1})||{})[n],set:(r,n,i)=>{let o=e.find(s=>s.hasOwnProperty(n));return o?o[n]=i:e[e.length-1][n]=i,!0}});return t}function ve(e){let t=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,r=(n,i="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([o,{value:s,enumerable:a}])=>{if(a===!1||s===void 0)return;let c=i===""?o:`${i}.${o}`;typeof s=="object"&&s!==null&&s._x_interceptor?n[o]=s.initialize(e,c,o):t(s)&&s!==n&&!(s instanceof Element)&&r(s,c)})};return r(e)}function we(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,o){return e(this.initialValue,()=>pn(n,i),s=>lt(n,i,s),i,o)}};return t(r),n=>{if(typeof n=="object"&&n!==null&&n._x_interceptor){let i=r.initialize.bind(r);r.initialize=(o,s,a)=>{let c=n.initialize(o,s,a);return r.initialValue=c,i(o,s,a)}}else r.initialValue=n;return r}}function pn(e,t){return t.split(".").reduce((r,n)=>r[n],e)}function lt(e,t,r){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=r;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),lt(e[t[0]],t.slice(1),r)}}var Yt={};function x(e,t){Yt[e]=t}function z(e,t){return Object.entries(Yt).forEach(([r,n])=>{Object.defineProperty(e,`$${r}`,{get(){let[i,o]=ut(t);return i={interceptor:we,...i},ge(t,o),n(t,i)},enumerable:!1})}),{obj:e,cleanup:()=>{t=null}}}function Ee(e,t,r,...n){try{return r(...n)}catch(i){Z(i,e,t)}}function Z(e,t,r=void 0){Object.assign(e,{el:t,expression:r}),console.warn(`Alpine Expression Error: ${e.message}
+(()=>{var Ye=!1,Je=!1,B=[];function Bt(e){ln(e)}function ln(e){B.includes(e)||B.push(e),un()}function _e(e){let t=B.indexOf(e);t!==-1&&B.splice(t,1)}function un(){!Je&&!Ye&&(Ye=!0,queueMicrotask(fn))}function fn(){Ye=!1,Je=!0;for(let e=0;e<B.length;e++)B[e]();B.length=0,Je=!1}var A,K,J,Ze,Qe=!0;function Kt(e){Qe=!1,e(),Qe=!0}function zt(e){A=e.reactive,J=e.release,K=t=>e.effect(t,{scheduler:r=>{Qe?Bt(r):r()}}),Ze=e.raw}function Xe(e){K=e}function Vt(e){let t=()=>{};return[n=>{let i=K(n);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(o=>o())}),e._x_effects.add(i),t=()=>{i!==void 0&&(e._x_effects.delete(i),J(i))},i},()=>{t()}]}var Ht=[],qt=[],Ut=[];function Wt(e){Ut.push(e)}function ge(e,t){typeof t=="function"?(e._x_cleanups||(e._x_cleanups=[]),e._x_cleanups.push(t)):(t=e,qt.push(t))}function Gt(e){Ht.push(e)}function xe(e,t,r){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(r)}function et(e,t){!e._x_attributeCleanups||Object.entries(e._x_attributeCleanups).forEach(([r,n])=>{(t===void 0||t.includes(r))&&(n.forEach(i=>i()),delete e._x_attributeCleanups[r])})}var rt=new MutationObserver(tt),nt=!1;function it(){rt.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),nt=!0}function ot(){dn(),rt.disconnect(),nt=!1}var ne=[],st=!1;function dn(){ne=ne.concat(rt.takeRecords()),ne.length&&!st&&(st=!0,queueMicrotask(()=>{pn(),st=!1}))}function pn(){tt(ne),ne.length=0}function m(e){if(!nt)return e();ot();let t=e();return it(),t}var at=!1,ye=[];function Yt(){at=!0}function Jt(){at=!1,tt(ye),ye=[]}function tt(e){if(at){ye=ye.concat(e);return}let t=[],r=[],n=new Map,i=new Map;for(let o=0;o<e.length;o++)if(!e[o].target._x_ignoreMutationObserver&&(e[o].type==="childList"&&(e[o].addedNodes.forEach(s=>s.nodeType===1&&t.push(s)),e[o].removedNodes.forEach(s=>s.nodeType===1&&r.push(s))),e[o].type==="attributes")){let s=e[o].target,a=e[o].attributeName,c=e[o].oldValue,l=()=>{n.has(s)||n.set(s,[]),n.get(s).push({name:a,value:s.getAttribute(a)})},u=()=>{i.has(s)||i.set(s,[]),i.get(s).push(a)};s.hasAttribute(a)&&c===null?l():s.hasAttribute(a)?(u(),l()):u()}i.forEach((o,s)=>{et(s,o)}),n.forEach((o,s)=>{Ht.forEach(a=>a(s,o))});for(let o of r)if(!t.includes(o)&&(qt.forEach(s=>s(o)),o._x_cleanups))for(;o._x_cleanups.length;)o._x_cleanups.pop()();t.forEach(o=>{o._x_ignoreSelf=!0,o._x_ignore=!0});for(let o of t)r.includes(o)||!o.isConnected||(delete o._x_ignoreSelf,delete o._x_ignore,Ut.forEach(s=>s(o)),o._x_ignore=!0,o._x_ignoreSelf=!0);t.forEach(o=>{delete o._x_ignoreSelf,delete o._x_ignore}),t=null,r=null,n=null,i=null}function be(e){return M(C(e))}function R(e,t,r){return e._x_dataStack=[t,...C(r||e)],()=>{e._x_dataStack=e._x_dataStack.filter(n=>n!==t)}}function ct(e,t){let r=e._x_dataStack[0];Object.entries(t).forEach(([n,i])=>{r[n]=i})}function C(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?C(e.host):e.parentNode?C(e.parentNode):[]}function M(e){let t=new Proxy({},{ownKeys:()=>Array.from(new Set(e.flatMap(r=>Object.keys(r)))),has:(r,n)=>e.some(i=>i.hasOwnProperty(n)),get:(r,n)=>(e.find(i=>{if(i.hasOwnProperty(n)){let o=Object.getOwnPropertyDescriptor(i,n);if(o.get&&o.get._x_alreadyBound||o.set&&o.set._x_alreadyBound)return!0;if((o.get||o.set)&&o.enumerable){let s=o.get,a=o.set,c=o;s=s&&s.bind(t),a=a&&a.bind(t),s&&(s._x_alreadyBound=!0),a&&(a._x_alreadyBound=!0),Object.defineProperty(i,n,{...c,get:s,set:a})}return!0}return!1})||{})[n],set:(r,n,i)=>{let o=e.find(s=>s.hasOwnProperty(n));return o?o[n]=i:e[e.length-1][n]=i,!0}});return t}function ve(e){let t=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,r=(n,i="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([o,{value:s,enumerable:a}])=>{if(a===!1||s===void 0)return;let c=i===""?o:`${i}.${o}`;typeof s=="object"&&s!==null&&s._x_interceptor?n[o]=s.initialize(e,c,o):t(s)&&s!==n&&!(s instanceof Element)&&r(s,c)})};return r(e)}function we(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,o){return e(this.initialValue,()=>mn(n,i),s=>lt(n,i,s),i,o)}};return t(r),n=>{if(typeof n=="object"&&n!==null&&n._x_interceptor){let i=r.initialize.bind(r);r.initialize=(o,s,a)=>{let c=n.initialize(o,s,a);return r.initialValue=c,i(o,s,a)}}else r.initialValue=n;return r}}function mn(e,t){return t.split(".").reduce((r,n)=>r[n],e)}function lt(e,t,r){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=r;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),lt(e[t[0]],t.slice(1),r)}}var Zt={};function x(e,t){Zt[e]=t}function z(e,t){return Object.entries(Zt).forEach(([r,n])=>{Object.defineProperty(e,`$${r}`,{get(){let[i,o]=ut(t);return i={interceptor:we,...i},ge(t,o),n(t,i)},enumerable:!1})}),{obj:e,cleanup:()=>{t=null}}}function Ee(e,t,r,...n){try{return r(...n)}catch(i){Z(i,e,t)}}function Z(e,t,r=void 0){Object.assign(e,{el:t,expression:r}),console.warn(`Alpine Expression Error: ${e.message}
${r?'Expression: "'+r+`"
-`:""}`,t),setTimeout(()=>{throw e},0)}var Se=!0;function Jt(e){let t=Se;Se=!1,e(),Se=t}function I(e,t,r={}){let n;return g(e,t)(i=>n=i,r),n}function g(...e){return Zt(...e)}var Zt=mn;function Qt(e){Zt=e}function mn(e,t){let r={},n=z(r,e).cleanup;xe(e,"evaluator",n);let i=[r,...C(e)];if(typeof t=="function")return ft(i,t);let o=hn(i,t,e);return Ee.bind(null,e,t,o)}function ft(e,t){return(r=()=>{},{scope:n={},params:i=[]}={})=>{let o=t.apply(M([n,...e]),i);Q(r,o)}}var dt={};function _n(e,t){if(dt[e])return dt[e];let r=Object.getPrototypeOf(async function(){}).constructor,n=/^[\n\s]*if.*\(.*\)/.test(e)||/^(let|const)\s/.test(e)?`(() => { ${e} })()`:e,o=(()=>{try{return new r(["__self","scope"],`with (scope) { __self.result = ${n} }; __self.finished = true; return __self.result;`)}catch(s){return Z(s,t,e),Promise.resolve()}})();return dt[e]=o,o}function hn(e,t,r){let n=_n(t,r);return(i=()=>{},{scope:o={},params:s=[]}={})=>{n.result=void 0,n.finished=!1;let a=M([o,...e]);if(typeof n=="function"){let c=n(n,a).catch(l=>Z(l,r,t));n.finished?(Q(i,n.result,a,s,r),n.result=void 0):c.then(l=>{Q(i,l,a,s,r)}).catch(l=>Z(l,r,t)).finally(()=>n.result=void 0)}}}function Q(e,t,r,n,i){if(Se&&typeof t=="function"){let o=t.apply(r,n);o instanceof Promise?o.then(s=>Q(e,s,r,n)).catch(s=>Z(s,i,t)):e(o)}else e(t)}var pt="x-";function E(e=""){return pt+e}function Xt(e){pt=e}var er={};function d(e,t){er[e]=t}function ie(e,t,r){let n={};return Array.from(t).map(tr((o,s)=>n[o]=s)).filter(rr).map(xn(n,r)).sort(yn).map(o=>gn(e,o))}function nr(e){return Array.from(e).map(tr()).filter(t=>!rr(t))}var mt=!1,oe=new Map,ir=Symbol();function or(e){mt=!0;let t=Symbol();ir=t,oe.set(t,[]);let r=()=>{for(;oe.get(t).length;)oe.get(t).shift()();oe.delete(t)},n=()=>{mt=!1,r()};e(r),n()}function ut(e){let t=[],r=a=>t.push(a),[n,i]=Bt(e);return t.push(i),[{Alpine:D,effect:n,cleanup:r,evaluateLater:g.bind(g,e),evaluate:I.bind(I,e)},()=>t.forEach(a=>a())]}function gn(e,t){let r=()=>{},n=er[t.type]||r,[i,o]=ut(e);xe(e,t.original,o);let s=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,i),n=n.bind(n,e,t,i),mt?oe.get(ir).push(n):n())};return s.runCleanups=o,s}var Ae=(e,t)=>({name:r,value:n})=>(r.startsWith(e)&&(r=r.replace(e,t)),{name:r,value:n}),Oe=e=>e;function tr(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=sr.reduce((o,s)=>s(o),{name:t,value:r});return n!==t&&e(n,t),{name:n,value:i}}}var sr=[];function X(e){sr.push(e)}function rr({name:e}){return ar().test(e)}var ar=()=>new RegExp(`^${pt}([^:^.]+)\\b`);function xn(e,t){return({name:r,value:n})=>{let i=r.match(ar()),o=r.match(/:([a-zA-Z0-9\-:]+)/),s=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],a=t||e[r]||r;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:s.map(c=>c.replace(".","")),expression:n,original:a}}}var ht="DEFAULT",Te=["ignore","ref","data","id","bind","init","for","mask","model","modelable","transition","show","if",ht,"teleport","element"];function yn(e,t){let r=Te.indexOf(e.type)===-1?ht:e.type,n=Te.indexOf(t.type)===-1?ht:t.type;return Te.indexOf(r)-Te.indexOf(n)}function V(e,t,r={}){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0}))}var _t=[],gt=!1;function Me(e=()=>{}){return queueMicrotask(()=>{gt||setTimeout(()=>{Ce()})}),new Promise(t=>{_t.push(()=>{e(),t()})})}function Ce(){for(gt=!1;_t.length;)_t.shift()()}function cr(){gt=!0}function N(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(i=>N(i,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;for(;n;)N(n,t,!1),n=n.nextElementSibling}function O(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}function ur(){document.body||O("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),V(document,"alpine:init"),V(document,"alpine:initializing"),it(),qt(t=>w(t,N)),ge(t=>xt(t)),Ut((t,r)=>{ie(t,r).forEach(n=>n())});let e=t=>!H(t.parentElement,!0);Array.from(document.querySelectorAll(lr())).filter(e).forEach(t=>{w(t)}),V(document,"alpine:initialized")}var yt=[],fr=[];function dr(){return yt.map(e=>e())}function lr(){return yt.concat(fr).map(e=>e())}function Re(e){yt.push(e)}function Ne(e){fr.push(e)}function H(e,t=!1){return ee(e,r=>{if((t?lr():dr()).some(i=>r.matches(i)))return!0})}function ee(e,t){if(!!e){if(t(e))return e;if(e._x_teleportBack&&(e=e._x_teleportBack),!!e.parentElement)return ee(e.parentElement,t)}}function pr(e){return dr().some(t=>e.matches(t))}function w(e,t=N){or(()=>{t(e,(r,n)=>{ie(r,r.attributes).forEach(i=>i()),r._x_ignore&&n()})})}function xt(e){N(e,t=>et(t))}function se(e,t){return Array.isArray(t)?mr(e,t.join(" ")):typeof t=="object"&&t!==null?bn(e,t):typeof t=="function"?se(e,t()):mr(e,t)}function mr(e,t){let r=o=>o.split(" ").filter(Boolean),n=o=>o.split(" ").filter(s=>!e.classList.contains(s)).filter(Boolean),i=o=>(e.classList.add(...o),()=>{e.classList.remove(...o)});return t=t===!0?t="":t||"",i(n(t))}function bn(e,t){let r=a=>a.split(" ").filter(Boolean),n=Object.entries(t).flatMap(([a,c])=>c?r(a):!1).filter(Boolean),i=Object.entries(t).flatMap(([a,c])=>c?!1:r(a)).filter(Boolean),o=[],s=[];return i.forEach(a=>{e.classList.contains(a)&&(e.classList.remove(a),s.push(a))}),n.forEach(a=>{e.classList.contains(a)||(e.classList.add(a),o.push(a))}),()=>{s.forEach(a=>e.classList.add(a)),o.forEach(a=>e.classList.remove(a))}}function q(e,t){return typeof t=="object"&&t!==null?vn(e,t):wn(e,t)}function vn(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{r[n]=e.style[n],n.startsWith("--")||(n=En(n)),e.style.setProperty(n,i)}),setTimeout(()=>{e.style.length===0&&e.removeAttribute("style")}),()=>{q(e,r)}}function wn(e,t){let r=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",r||"")}}function En(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ae(e,t=()=>{}){let r=!1;return function(){r?t.apply(this,arguments):(r=!0,e.apply(this,arguments))}}d("transition",(e,{value:t,modifiers:r,expression:n},{evaluate:i})=>{typeof n=="function"&&(n=i(n)),n?Sn(e,n,t):An(e,r,t)});function Sn(e,t,r){hr(e,se,""),{enter:i=>{e._x_transition.enter.during=i},"enter-start":i=>{e._x_transition.enter.start=i},"enter-end":i=>{e._x_transition.enter.end=i},leave:i=>{e._x_transition.leave.during=i},"leave-start":i=>{e._x_transition.leave.start=i},"leave-end":i=>{e._x_transition.leave.end=i}}[r](t)}function An(e,t,r){hr(e,q);let n=!t.includes("in")&&!t.includes("out")&&!r,i=n||t.includes("in")||["enter"].includes(r),o=n||t.includes("out")||["leave"].includes(r);t.includes("in")&&!n&&(t=t.filter((h,b)=>b<t.indexOf("out"))),t.includes("out")&&!n&&(t=t.filter((h,b)=>b>t.indexOf("out")));let s=!t.includes("opacity")&&!t.includes("scale"),a=s||t.includes("opacity"),c=s||t.includes("scale"),l=a?0:1,u=c?ce(t,"scale",95)/100:1,p=ce(t,"delay",0),y=ce(t,"origin","center"),P="opacity, transform",G=ce(t,"duration",150)/1e3,me=ce(t,"duration",75)/1e3,f="cubic-bezier(0.4, 0.0, 0.2, 1)";i&&(e._x_transition.enter.during={transformOrigin:y,transitionDelay:p,transitionProperty:P,transitionDuration:`${G}s`,transitionTimingFunction:f},e._x_transition.enter.start={opacity:l,transform:`scale(${u})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"}),o&&(e._x_transition.leave.during={transformOrigin:y,transitionDelay:p,transitionProperty:P,transitionDuration:`${me}s`,transitionTimingFunction:f},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:l,transform:`scale(${u})`})}function hr(e,t,r={}){e._x_transition||(e._x_transition={enter:{during:r,start:r,end:r},leave:{during:r,start:r,end:r},in(n=()=>{},i=()=>{}){ke(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,i)},out(n=()=>{},i=()=>{}){ke(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,i)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,r,n){let i=()=>{document.visibilityState==="visible"?requestAnimationFrame(r):setTimeout(r)};if(t){e._x_transition&&(e._x_transition.enter||e._x_transition.leave)?e._x_transition.enter&&(Object.entries(e._x_transition.enter.during).length||Object.entries(e._x_transition.enter.start).length||Object.entries(e._x_transition.enter.end).length)?e._x_transition.in(r):i():e._x_transition?e._x_transition.in(r):i();return}e._x_hidePromise=e._x_transition?new Promise((o,s)=>{e._x_transition.out(()=>{},()=>o(n)),e._x_transitioning.beforeCancel(()=>s({isFromCancelledTransition:!0}))}):Promise.resolve(n),queueMicrotask(()=>{let o=_r(e);o?(o._x_hideChildren||(o._x_hideChildren=[]),o._x_hideChildren.push(e)):queueMicrotask(()=>{let s=a=>{let c=Promise.all([a._x_hidePromise,...(a._x_hideChildren||[]).map(s)]).then(([l])=>l());return delete a._x_hidePromise,delete a._x_hideChildren,c};s(e).catch(a=>{if(!a.isFromCancelledTransition)throw a})})})};function _r(e){let t=e.parentNode;if(!!t)return t._x_hidePromise?t:_r(t)}function ke(e,t,{during:r,start:n,end:i}={},o=()=>{},s=()=>{}){if(e._x_transitioning&&e._x_transitioning.cancel(),Object.keys(r).length===0&&Object.keys(n).length===0&&Object.keys(i).length===0){o(),s();return}let a,c,l;On(e,{start(){a=t(e,n)},during(){c=t(e,r)},before:o,end(){a(),l=t(e,i)},after:s,cleanup(){c(),l()}})}function On(e,t){let r,n,i,o=ae(()=>{m(()=>{r=!0,n||t.before(),i||(t.end(),Ce()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(s){this.beforeCancels.push(s)},cancel:ae(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();o()}),finish:o},m(()=>{t.start(),t.during()}),cr(),requestAnimationFrame(()=>{if(r)return;let s=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,a=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;s===0&&(s=Number(getComputedStyle(e).animationDuration.replace("s",""))*1e3),m(()=>{t.before()}),n=!0,requestAnimationFrame(()=>{r||(m(()=>{t.end()}),Ce(),setTimeout(e._x_transitioning.finish,s+a),i=!0)})})}function ce(e,t,r){if(e.indexOf(t)===-1)return r;let n=e[e.indexOf(t)+1];if(!n||t==="scale"&&isNaN(n))return r;if(t==="duration"){let i=n.match(/([0-9]+)ms/);if(i)return i[1]}return t==="origin"&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[n,e[e.indexOf(t)+2]].join(" "):n}var bt=!1;function $(e,t=()=>{}){return(...r)=>bt?t(...r):e(...r)}function gr(e,t){t._x_dataStack||(t._x_dataStack=e._x_dataStack),bt=!0,Cn(()=>{Tn(t)}),bt=!1}function Tn(e){let t=!1;w(e,(n,i)=>{N(n,(o,s)=>{if(t&&pr(o))return s();t=!0,i(o,s)})})}function Cn(e){let t=B;Xe((r,n)=>{let i=t(r);return J(i),()=>{}}),e(),Xe(t)}function le(e,t,r,n=[]){switch(e._x_bindings||(e._x_bindings=A({})),e._x_bindings[t]=r,t=n.includes("camel")?Pn(t):t,t){case"value":Mn(e,r);break;case"style":Nn(e,r);break;case"class":Rn(e,r);break;default:kn(e,t,r);break}}function Mn(e,t){if(e.type==="radio")e.attributes.value===void 0&&(e.value=t),window.fromModel&&(e.checked=xr(e.value,t));else if(e.type==="checkbox")Number.isInteger(t)?e.value=t:!Number.isInteger(t)&&!Array.isArray(t)&&typeof t!="boolean"&&![null,void 0].includes(t)?e.value=String(t):Array.isArray(t)?e.checked=t.some(r=>xr(r,e.value)):e.checked=!!t;else if(e.tagName==="SELECT")In(e,t);else{if(e.value===t)return;e.value=t}}function Rn(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedClasses=se(e,t)}function Nn(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles(),e._x_undoAddedStyles=q(e,t)}function kn(e,t,r){[null,void 0,!1].includes(r)&&$n(t)?e.removeAttribute(t):(yr(t)&&(r=t),Dn(e,t,r))}function Dn(e,t,r){e.getAttribute(t)!=r&&e.setAttribute(t,r)}function In(e,t){let r=[].concat(t).map(n=>n+"");Array.from(e.options).forEach(n=>{n.selected=r.includes(n.value)})}function Pn(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function xr(e,t){return e==t}function yr(e){return["disabled","checked","required","readonly","hidden","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"].includes(e)}function $n(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}function br(e,t,r){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];let n=e.getAttribute(t);return n===null?typeof r=="function"?r():r:yr(t)?!![t,"true"].includes(n):n===""?!0:n}function Pe(e,t){var r;return function(){var n=this,i=arguments,o=function(){r=null,e.apply(n,i)};clearTimeout(r),r=setTimeout(o,t)}}function Ie(e,t){let r;return function(){let n=this,i=arguments;r||(e.apply(n,i),r=!0,setTimeout(()=>r=!1,t))}}function vr(e){e(D)}var U={},wr=!1;function Er(e,t){if(wr||(U=A(U),wr=!0),t===void 0)return U[e];U[e]=t,typeof t=="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init=="function"&&U[e].init(),ve(U[e])}function Sr(){return U}var Ar={};function Or(e,t){Ar[e]=typeof t!="function"?()=>t:t}function Tr(e){return Object.entries(Ar).forEach(([t,r])=>{Object.defineProperty(e,t,{get(){return(...n)=>r(...n)}})}),e}var Cr={};function Mr(e,t){Cr[e]=t}function Rr(e,t){return Object.entries(Cr).forEach(([r,n])=>{Object.defineProperty(e,r,{get(){return(...i)=>n.bind(t)(...i)},enumerable:!1})}),e}var Ln={get reactive(){return A},get release(){return J},get effect(){return B},get raw(){return Ze},version:"3.10.2",flushAndStopDeferringMutations:Gt,dontAutoEvaluateFunctions:Jt,disableEffectScheduling:Ft,stopObservingMutations:ot,destroyTree:xt,setReactivityEngine:Kt,closestDataStack:C,skipDuringClone:$,addRootSelector:Re,addInitSelector:Ne,addScopeToNode:R,deferMutations:Wt,mapAttributes:X,evaluateLater:g,setEvaluator:Qt,mergeProxies:M,findClosest:ee,closestRoot:H,interceptor:we,transition:ke,setStyles:q,mutateDom:m,directive:d,throttle:Ie,debounce:Pe,evaluate:I,initTree:w,nextTick:Me,prefixed:E,prefix:Xt,plugin:vr,magic:x,store:Er,start:ur,clone:gr,bound:br,$data:be,data:Mr,bind:Or},D=Ln;function vt(e,t){let r=Object.create(null),n=e.split(",");for(let i=0;i<n.length;i++)r[n[i]]=!0;return t?i=>!!r[i.toLowerCase()]:i=>!!r[i]}var is={[1]:"TEXT",[2]:"CLASS",[4]:"STYLE",[8]:"PROPS",[16]:"FULL_PROPS",[32]:"HYDRATE_EVENTS",[64]:"STABLE_FRAGMENT",[128]:"KEYED_FRAGMENT",[256]:"UNKEYED_FRAGMENT",[512]:"NEED_PATCH",[1024]:"DYNAMIC_SLOTS",[2048]:"DEV_ROOT_FRAGMENT",[-1]:"HOISTED",[-2]:"BAIL"},os={[1]:"STABLE",[2]:"DYNAMIC",[3]:"FORWARDED"};var jn="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var ss=vt(jn+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var Nr=Object.freeze({}),as=Object.freeze([]);var wt=Object.assign;var Fn=Object.prototype.hasOwnProperty,ue=(e,t)=>Fn.call(e,t),L=Array.isArray,te=e=>kr(e)==="[object Map]";var Kn=e=>typeof e=="string",De=e=>typeof e=="symbol",fe=e=>e!==null&&typeof e=="object";var Bn=Object.prototype.toString,kr=e=>Bn.call(e),Et=e=>kr(e).slice(8,-1);var $e=e=>Kn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e;var Le=e=>{let t=Object.create(null);return r=>t[r]||(t[r]=e(r))},zn=/-(\w)/g,cs=Le(e=>e.replace(zn,(t,r)=>r?r.toUpperCase():"")),Vn=/\B([A-Z])/g,ls=Le(e=>e.replace(Vn,"-$1").toLowerCase()),St=Le(e=>e.charAt(0).toUpperCase()+e.slice(1)),us=Le(e=>e?`on${St(e)}`:""),At=(e,t)=>e!==t&&(e===e||t===t);var Ot=new WeakMap,de=[],k,W=Symbol("iterate"),Tt=Symbol("Map key iterate");function Hn(e){return e&&e._isEffect===!0}function Pr(e,t=Nr){Hn(e)&&(e=e.raw);let r=qn(e,t);return t.lazy||r(),r}function Dr(e){e.active&&(Ir(e),e.options.onStop&&e.options.onStop(),e.active=!1)}var Un=0;function qn(e,t){let r=function(){if(!r.active)return e();if(!de.includes(r)){Ir(r);try{return Wn(),de.push(r),k=r,e()}finally{de.pop(),$r(),k=de[de.length-1]}}};return r.id=Un++,r.allowRecurse=!!t.allowRecurse,r._isEffect=!0,r.active=!0,r.raw=e,r.deps=[],r.options=t,r}function Ir(e){let{deps:t}=e;if(t.length){for(let r=0;r<t.length;r++)t[r].delete(e);t.length=0}}var re=!0,Ct=[];function Gn(){Ct.push(re),re=!1}function Wn(){Ct.push(re),re=!0}function $r(){let e=Ct.pop();re=e===void 0?!0:e}function T(e,t,r){if(!re||k===void 0)return;let n=Ot.get(e);n||Ot.set(e,n=new Map);let i=n.get(r);i||n.set(r,i=new Set),i.has(k)||(i.add(k),k.deps.push(i),k.options.onTrack&&k.options.onTrack({effect:k,target:e,type:t,key:r}))}function j(e,t,r,n,i,o){let s=Ot.get(e);if(!s)return;let a=new Set,c=u=>{u&&u.forEach(p=>{(p!==k||p.allowRecurse)&&a.add(p)})};if(t==="clear")s.forEach(c);else if(r==="length"&&L(e))s.forEach((u,p)=>{(p==="length"||p>=n)&&c(u)});else switch(r!==void 0&&c(s.get(r)),t){case"add":L(e)?$e(r)&&c(s.get("length")):(c(s.get(W)),te(e)&&c(s.get(Tt)));break;case"delete":L(e)||(c(s.get(W)),te(e)&&c(s.get(Tt)));break;case"set":te(e)&&c(s.get(W));break}let l=u=>{u.options.onTrigger&&u.options.onTrigger({effect:u,target:e,key:r,type:t,newValue:n,oldValue:i,oldTarget:o}),u.options.scheduler?u.options.scheduler(u):u()};a.forEach(l)}var Yn=vt("__proto__,__v_isRef,__isVue"),Lr=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(De)),Jn=je(),Zn=je(!1,!0),Qn=je(!0),Xn=je(!0,!0),Fe={};["includes","indexOf","lastIndexOf"].forEach(e=>{let t=Array.prototype[e];Fe[e]=function(...r){let n=_(this);for(let o=0,s=this.length;o<s;o++)T(n,"get",o+"");let i=t.apply(n,r);return i===-1||i===!1?t.apply(n,r.map(_)):i}});["push","pop","shift","unshift","splice"].forEach(e=>{let t=Array.prototype[e];Fe[e]=function(...r){Gn();let n=t.apply(this,r);return $r(),n}});function je(e=!1,t=!1){return function(n,i,o){if(i==="__v_isReactive")return!e;if(i==="__v_isReadonly")return e;if(i==="__v_raw"&&o===(e?t?ti:Fr:t?ei:jr).get(n))return n;let s=L(n);if(!e&&s&&ue(Fe,i))return Reflect.get(Fe,i,o);let a=Reflect.get(n,i,o);return(De(i)?Lr.has(i):Yn(i))||(e||T(n,"get",i),t)?a:Mt(a)?!s||!$e(i)?a.value:a:fe(a)?e?Kr(a):Ke(a):a}}var ri=Br(),ni=Br(!0);function Br(e=!1){return function(r,n,i,o){let s=r[n];if(!e&&(i=_(i),s=_(s),!L(r)&&Mt(s)&&!Mt(i)))return s.value=i,!0;let a=L(r)&&$e(n)?Number(n)<r.length:ue(r,n),c=Reflect.set(r,n,i,o);return r===_(o)&&(a?At(i,s)&&j(r,"set",n,i,s):j(r,"add",n,i)),c}}function ii(e,t){let r=ue(e,t),n=e[t],i=Reflect.deleteProperty(e,t);return i&&r&&j(e,"delete",t,void 0,n),i}function oi(e,t){let r=Reflect.has(e,t);return(!De(t)||!Lr.has(t))&&T(e,"has",t),r}function si(e){return T(e,"iterate",L(e)?"length":W),Reflect.ownKeys(e)}var zr={get:Jn,set:ri,deleteProperty:ii,has:oi,ownKeys:si},Vr={get:Qn,set(e,t){return console.warn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0},deleteProperty(e,t){return console.warn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},_s=wt({},zr,{get:Zn,set:ni}),gs=wt({},Vr,{get:Xn}),Rt=e=>fe(e)?Ke(e):e,Nt=e=>fe(e)?Kr(e):e,kt=e=>e,Be=e=>Reflect.getPrototypeOf(e);function ze(e,t,r=!1,n=!1){e=e.__v_raw;let i=_(e),o=_(t);t!==o&&!r&&T(i,"get",t),!r&&T(i,"get",o);let{has:s}=Be(i),a=n?kt:r?Nt:Rt;if(s.call(i,t))return a(e.get(t));if(s.call(i,o))return a(e.get(o));e!==i&&e.get(t)}function Ve(e,t=!1){let r=this.__v_raw,n=_(r),i=_(e);return e!==i&&!t&&T(n,"has",e),!t&&T(n,"has",i),e===i?r.has(e):r.has(e)||r.has(i)}function He(e,t=!1){return e=e.__v_raw,!t&&T(_(e),"iterate",W),Reflect.get(e,"size",e)}function Hr(e){e=_(e);let t=_(this);return Be(t).has.call(t,e)||(t.add(e),j(t,"add",e,e)),this}function Ur(e,t){t=_(t);let r=_(this),{has:n,get:i}=Be(r),o=n.call(r,e);o?qr(r,n,e):(e=_(e),o=n.call(r,e));let s=i.call(r,e);return r.set(e,t),o?At(t,s)&&j(r,"set",e,t,s):j(r,"add",e,t),this}function Wr(e){let t=_(this),{has:r,get:n}=Be(t),i=r.call(t,e);i?qr(t,r,e):(e=_(e),i=r.call(t,e));let o=n?n.call(t,e):void 0,s=t.delete(e);return i&&j(t,"delete",e,void 0,o),s}function Gr(){let e=_(this),t=e.size!==0,r=te(e)?new Map(e):new Set(e),n=e.clear();return t&&j(e,"clear",void 0,void 0,r),n}function qe(e,t){return function(n,i){let o=this,s=o.__v_raw,a=_(s),c=t?kt:e?Nt:Rt;return!e&&T(a,"iterate",W),s.forEach((l,u)=>n.call(i,c(l),c(u),o))}}function Ue(e,t,r){return function(...n){let i=this.__v_raw,o=_(i),s=te(o),a=e==="entries"||e===Symbol.iterator&&s,c=e==="keys"&&s,l=i[e](...n),u=r?kt:t?Nt:Rt;return!t&&T(o,"iterate",c?Tt:W),{next(){let{value:p,done:y}=l.next();return y?{value:p,done:y}:{value:a?[u(p[0]),u(p[1])]:u(p),done:y}},[Symbol.iterator](){return this}}}}function F(e){return function(...t){{let r=t[0]?`on key "${t[0]}" `:"";console.warn(`${St(e)} operation ${r}failed: target is readonly.`,_(this))}return e==="delete"?!1:this}}var Yr={get(e){return ze(this,e)},get size(){return He(this)},has:Ve,add:Hr,set:Ur,delete:Wr,clear:Gr,forEach:qe(!1,!1)},Jr={get(e){return ze(this,e,!1,!0)},get size(){return He(this)},has:Ve,add:Hr,set:Ur,delete:Wr,clear:Gr,forEach:qe(!1,!0)},Zr={get(e){return ze(this,e,!0)},get size(){return He(this,!0)},has(e){return Ve.call(this,e,!0)},add:F("add"),set:F("set"),delete:F("delete"),clear:F("clear"),forEach:qe(!0,!1)},Qr={get(e){return ze(this,e,!0,!0)},get size(){return He(this,!0)},has(e){return Ve.call(this,e,!0)},add:F("add"),set:F("set"),delete:F("delete"),clear:F("clear"),forEach:qe(!0,!0)},ai=["keys","values","entries",Symbol.iterator];ai.forEach(e=>{Yr[e]=Ue(e,!1,!1),Zr[e]=Ue(e,!0,!1),Jr[e]=Ue(e,!1,!0),Qr[e]=Ue(e,!0,!0)});function We(e,t){let r=t?e?Qr:Jr:e?Zr:Yr;return(n,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?n:Reflect.get(ue(r,i)&&i in n?r:n,i,o)}var ci={get:We(!1,!1)},xs={get:We(!1,!0)},li={get:We(!0,!1)},ys={get:We(!0,!0)};function qr(e,t,r){let n=_(r);if(n!==r&&t.call(e,n)){let i=Et(e);console.warn(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var jr=new WeakMap,ei=new WeakMap,Fr=new WeakMap,ti=new WeakMap;function ui(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function fi(e){return e.__v_skip||!Object.isExtensible(e)?0:ui(Et(e))}function Ke(e){return e&&e.__v_isReadonly?e:Xr(e,!1,zr,ci,jr)}function Kr(e){return Xr(e,!0,Vr,li,Fr)}function Xr(e,t,r,n,i){if(!fe(e))return console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;let o=i.get(e);if(o)return o;let s=fi(e);if(s===0)return e;let a=new Proxy(e,s===2?n:r);return i.set(e,a),a}function _(e){return e&&_(e.__v_raw)||e}function Mt(e){return Boolean(e&&e.__v_isRef===!0)}x("nextTick",()=>Me);x("dispatch",e=>V.bind(V,e));x("watch",(e,{evaluateLater:t,effect:r})=>(n,i)=>{let o=t(n),s=!0,a,c=r(()=>o(l=>{JSON.stringify(l),s?a=l:queueMicrotask(()=>{i(l,a),a=l}),s=!1}));e._x_effects.delete(c)});x("store",Sr);x("data",e=>be(e));x("root",e=>H(e));x("refs",e=>(e._x_refs_proxy||(e._x_refs_proxy=M(di(e))),e._x_refs_proxy));function di(e){let t=[],r=e;for(;r;)r._x_refs&&t.push(r._x_refs),r=r.parentNode;return t}var Pt={};function It(e){return Pt[e]||(Pt[e]=0),++Pt[e]}function en(e,t){return ee(e,r=>{if(r._x_ids&&r._x_ids[t])return!0})}function tn(e,t){e._x_ids||(e._x_ids={}),e._x_ids[t]||(e._x_ids[t]=It(t))}x("id",e=>(t,r=null)=>{let n=en(e,t),i=n?n._x_ids[t]:It(t);return r?`${t}-${i}-${r}`:`${t}-${i}`});x("el",e=>e);rn("Focus","focus","focus");rn("Persist","persist","persist");function rn(e,t,r){x(t,n=>O(`You can't use [$${directiveName}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}d("modelable",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t),o=()=>{let l;return i(u=>l=u),l},s=n(`${t} = __placeholder`),a=l=>s(()=>{},{scope:{__placeholder:l}}),c=o();a(c),queueMicrotask(()=>{if(!e._x_model)return;e._x_removeModelListeners.default();let l=e._x_model.get,u=e._x_model.set;r(()=>a(l())),r(()=>u(o()))})});d("teleport",(e,{expression:t},{cleanup:r})=>{e.tagName.toLowerCase()!=="template"&&O("x-teleport can only be used on a <template> tag",e);let n=document.querySelector(t);n||O(`Cannot find x-teleport element for selector: "${t}"`);let i=e.content.cloneNode(!0).firstElementChild;e._x_teleport=i,i._x_teleportBack=e,e._x_forwardEvents&&e._x_forwardEvents.forEach(o=>{i.addEventListener(o,s=>{s.stopPropagation(),e.dispatchEvent(new s.constructor(s.type,s))})}),R(i,{},e),m(()=>{n.appendChild(i),w(i),i._x_ignore=!0}),r(()=>i.remove())});var nn=()=>{};nn.inline=(e,{modifiers:t},{cleanup:r})=>{t.includes("self")?e._x_ignoreSelf=!0:e._x_ignore=!0,r(()=>{t.includes("self")?delete e._x_ignoreSelf:delete e._x_ignore})};d("ignore",nn);d("effect",(e,{expression:t},{effect:r})=>r(g(e,t)));function pe(e,t,r,n){let i=e,o=c=>n(c),s={},a=(c,l)=>u=>l(c,u);if(r.includes("dot")&&(t=pi(t)),r.includes("camel")&&(t=mi(t)),r.includes("passive")&&(s.passive=!0),r.includes("capture")&&(s.capture=!0),r.includes("window")&&(i=window),r.includes("document")&&(i=document),r.includes("prevent")&&(o=a(o,(c,l)=>{l.preventDefault(),c(l)})),r.includes("stop")&&(o=a(o,(c,l)=>{l.stopPropagation(),c(l)})),r.includes("self")&&(o=a(o,(c,l)=>{l.target===e&&c(l)})),(r.includes("away")||r.includes("outside"))&&(i=document,o=a(o,(c,l)=>{e.contains(l.target)||l.target.isConnected!==!1&&(e.offsetWidth<1&&e.offsetHeight<1||e._x_isShown!==!1&&c(l))})),r.includes("once")&&(o=a(o,(c,l)=>{c(l),i.removeEventListener(t,o,s)})),o=a(o,(c,l)=>{hi(t)&&_i(l,r)||c(l)}),r.includes("debounce")){let c=r[r.indexOf("debounce")+1]||"invalid-wait",l=Dt(c.split("ms")[0])?Number(c.split("ms")[0]):250;o=Pe(o,l)}if(r.includes("throttle")){let c=r[r.indexOf("throttle")+1]||"invalid-wait",l=Dt(c.split("ms")[0])?Number(c.split("ms")[0]):250;o=Ie(o,l)}return i.addEventListener(t,o,s),()=>{i.removeEventListener(t,o,s)}}function pi(e){return e.replace(/-/g,".")}function mi(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function Dt(e){return!Array.isArray(e)&&!isNaN(e)}function gi(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function hi(e){return["keydown","keyup"].includes(e)}function _i(e,t){let r=t.filter(o=>!["window","document","prevent","stop","once"].includes(o));if(r.includes("debounce")){let o=r.indexOf("debounce");r.splice(o,Dt((r[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.length===0||r.length===1&&on(e.key).includes(r[0]))return!1;let i=["ctrl","shift","alt","meta","cmd","super"].filter(o=>r.includes(o));return r=r.filter(o=>!i.includes(o)),!(i.length>0&&i.filter(s=>((s==="cmd"||s==="super")&&(s="meta"),e[`${s}Key`])).length===i.length&&on(e.key).includes(r[0]))}function on(e){if(!e)return[];e=gi(e);let t={ctrl:"control",slash:"/",space:"-",spacebar:"-",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",equal:"="};return t[e]=e,Object.keys(t).map(r=>{if(t[r]===e)return r}).filter(r=>r)}d("model",(e,{modifiers:t,expression:r},{effect:n,cleanup:i})=>{let o=g(e,r),s=`${r} = rightSideOfExpression($event, ${r})`,a=g(e,s);var c=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)||t.includes("lazy")?"change":"input";let l=xi(e,t,r),u=pe(e,c,t,y=>{a(()=>{},{scope:{$event:y,rightSideOfExpression:l}})});e._x_removeModelListeners||(e._x_removeModelListeners={}),e._x_removeModelListeners.default=u,i(()=>e._x_removeModelListeners.default());let p=g(e,`${r} = __placeholder`);e._x_model={get(){let y;return o(P=>y=P),y},set(y){p(()=>{},{scope:{__placeholder:y}})}},e._x_forceModelUpdate=()=>{o(y=>{y===void 0&&r.match(/\./)&&(y=""),window.fromModel=!0,m(()=>le(e,"value",y)),delete window.fromModel})},n(()=>{t.includes("unintrusive")&&document.activeElement.isSameNode(e)||e._x_forceModelUpdate()})});function xi(e,t,r){return e.type==="radio"&&m(()=>{e.hasAttribute("name")||e.setAttribute("name",r)}),(n,i)=>m(()=>{if(n instanceof CustomEvent&&n.detail!==void 0)return n.detail||n.target.value;if(e.type==="checkbox")if(Array.isArray(i)){let o=t.includes("number")?$t(n.target.value):n.target.value;return n.target.checked?i.concat([o]):i.filter(s=>!yi(s,o))}else return n.target.checked;else{if(e.tagName.toLowerCase()==="select"&&e.multiple)return t.includes("number")?Array.from(n.target.selectedOptions).map(o=>{let s=o.value||o.text;return $t(s)}):Array.from(n.target.selectedOptions).map(o=>o.value||o.text);{let o=n.target.value;return t.includes("number")?$t(o):t.includes("trim")?o.trim():o}}})}function $t(e){let t=e?parseFloat(e):null;return bi(t)?t:e}function yi(e,t){return e==t}function bi(e){return!Array.isArray(e)&&!isNaN(e)}d("cloak",e=>queueMicrotask(()=>m(()=>e.removeAttribute(E("cloak")))));Ne(()=>`[${E("init")}]`);d("init",$((e,{expression:t},{evaluate:r})=>typeof t=="string"?!!t.trim()&&r(t,{},!1):r(t,{},!1)));d("text",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i(o=>{m(()=>{e.textContent=o})})})});d("html",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i(o=>{m(()=>{e.innerHTML=o,e._x_ignoreSelf=!0,w(e),delete e._x_ignoreSelf})})})});X(Ae(":",Oe(E("bind:"))));d("bind",(e,{value:t,modifiers:r,expression:n,original:i},{effect:o})=>{if(!t)return vi(e,n,i,o);if(t==="key")return wi(e,n);let s=g(e,n);o(()=>s(a=>{a===void 0&&n.match(/\./)&&(a=""),m(()=>le(e,t,a,r))}))});function vi(e,t,r,n){let i={};Tr(i);let o=g(e,t),s=[];for(;s.length;)s.pop()();o(a=>{let c=Object.entries(a).map(([u,p])=>({name:u,value:p})),l=nr(c);c=c.map(u=>l.find(p=>p.name===u.name)?{name:`x-bind:${u.name}`,value:`"${u.value}"`}:u),ie(e,c,r).map(u=>{s.push(u.runCleanups),u()})},{scope:i})}function wi(e,t){e._x_keyExpression=t}Re(()=>`[${E("data")}]`);d("data",$((e,{expression:t},{cleanup:r})=>{t=t===""?"{}":t;let n={},i=z(n,e).cleanup,o={};Rr(o,n);let s=I(e,t,{scope:o});s===void 0&&(s={});let a=z(s,e).cleanup,c=A(s);ve(c);let l=R(e,c);c.init&&I(e,c.init),r(()=>{l(),i(),a(),c.destroy&&I(e,c.destroy),l()})}));d("show",(e,{modifiers:t,expression:r},{effect:n})=>{let i=g(e,r);e._x_doHide||(e._x_doHide=()=>{m(()=>e.style.display="none")}),e._x_doShow||(e._x_doShow=()=>{m(()=>{e.style.length===1&&e.style.display==="none"?e.removeAttribute("style"):e.style.removeProperty("display")})});let o=()=>{e._x_doHide(),e._x_isShown=!1},s=()=>{e._x_doShow(),e._x_isShown=!0},a=()=>setTimeout(s),c=ae(p=>p?s():o(),p=>{typeof e._x_toggleAndCascadeWithTransitions=="function"?e._x_toggleAndCascadeWithTransitions(e,p,s,o):p?a():o()}),l,u=!0;n(()=>i(p=>{!u&&p===l||(t.includes("immediate")&&(p?a():o()),c(p),l=p,u=!1)}))});d("for",(e,{expression:t},{effect:r,cleanup:n})=>{let i=Si(t),o=g(e,i.items),s=g(e,e._x_keyExpression||"index");e._x_prevKeys=[],e._x_lookup={},r(()=>Ei(e,i,o,s)),n(()=>{Object.values(e._x_lookup).forEach(a=>a.remove()),delete e._x_prevKeys,delete e._x_lookup})});function Ei(e,t,r,n){let i=s=>typeof s=="object"&&!Array.isArray(s),o=e;r(s=>{Ai(s)&&s>=0&&(s=Array.from(Array(s).keys(),f=>f+1)),s===void 0&&(s=[]);let a=e._x_lookup,c=e._x_prevKeys,l=[],u=[];if(i(s))s=Object.entries(s).map(([f,h])=>{let b=sn(t,h,f,s);n(v=>u.push(v),{scope:{index:f,...b}}),l.push(b)});else for(let f=0;f<s.length;f++){let h=sn(t,s[f],f,s);n(b=>u.push(b),{scope:{index:f,...h}}),l.push(h)}let p=[],y=[],P=[],G=[];for(let f=0;f<c.length;f++){let h=c[f];u.indexOf(h)===-1&&P.push(h)}c=c.filter(f=>!P.includes(f));let me="template";for(let f=0;f<u.length;f++){let h=u[f],b=c.indexOf(h);if(b===-1)c.splice(f,0,h),p.push([me,f]);else if(b!==f){let v=c.splice(f,1)[0],S=c.splice(b-1,1)[0];c.splice(f,0,S),c.splice(b,0,v),y.push([v,S])}else G.push(h);me=h}for(let f=0;f<P.length;f++){let h=P[f];a[h]._x_effects&&a[h]._x_effects.forEach(_e),a[h].remove(),a[h]=null,delete a[h]}for(let f=0;f<y.length;f++){let[h,b]=y[f],v=a[h],S=a[b],Y=document.createElement("div");m(()=>{S.after(Y),v.after(S),S._x_currentIfEl&&S.after(S._x_currentIfEl),Y.before(v),v._x_currentIfEl&&v.after(v._x_currentIfEl),Y.remove()}),ct(S,l[u.indexOf(b)])}for(let f=0;f<p.length;f++){let[h,b]=p[f],v=h==="template"?o:a[h];v._x_currentIfEl&&(v=v._x_currentIfEl);let S=l[b],Y=u[b],he=document.importNode(o.content,!0).firstElementChild;R(he,A(S),o),m(()=>{v.after(he),w(he)}),typeof Y=="object"&&O("x-for key cannot be an object, it must be a string or an integer",o),a[Y]=he}for(let f=0;f<G.length;f++)ct(a[G[f]],l[u.indexOf(G[f])]);o._x_prevKeys=u})}function Si(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,r=/^\s*\(|\)\s*$/g,n=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,i=e.match(n);if(!i)return;let o={};o.items=i[2].trim();let s=i[1].replace(r,"").trim(),a=s.match(t);return a?(o.item=s.replace(t,"").trim(),o.index=a[1].trim(),a[2]&&(o.collection=a[2].trim())):o.item=s,o}function sn(e,t,r,n){let i={};return/^\[.*\]$/.test(e.item)&&Array.isArray(t)?e.item.replace("[","").replace("]","").split(",").map(s=>s.trim()).forEach((s,a)=>{i[s]=t[a]}):/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t=="object"?e.item.replace("{","").replace("}","").split(",").map(s=>s.trim()).forEach(s=>{i[s]=t[s]}):i[e.item]=t,e.index&&(i[e.index]=r),e.collection&&(i[e.collection]=n),i}function Ai(e){return!Array.isArray(e)&&!isNaN(e)}function an(){}an.inline=(e,{expression:t},{cleanup:r})=>{let n=H(e);n._x_refs||(n._x_refs={}),n._x_refs[t]=e,r(()=>delete n._x_refs[t])};d("ref",an);d("if",(e,{expression:t},{effect:r,cleanup:n})=>{let i=g(e,t),o=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let a=e.content.cloneNode(!0).firstElementChild;return R(a,{},e),m(()=>{e.after(a),w(a)}),e._x_currentIfEl=a,e._x_undoIf=()=>{N(a,c=>{c._x_effects&&c._x_effects.forEach(_e)}),a.remove(),delete e._x_currentIfEl},a},s=()=>{!e._x_undoIf||(e._x_undoIf(),delete e._x_undoIf)};r(()=>i(a=>{a?o():s()})),n(()=>e._x_undoIf&&e._x_undoIf())});d("id",(e,{expression:t},{evaluate:r})=>{r(t).forEach(i=>tn(e,i))});X(Ae("@",Oe(E("on:"))));d("on",$((e,{value:t,modifiers:r,expression:n},{cleanup:i})=>{let o=n?g(e,n):()=>{};e.tagName.toLowerCase()==="template"&&(e._x_forwardEvents||(e._x_forwardEvents=[]),e._x_forwardEvents.includes(t)||e._x_forwardEvents.push(t));let s=pe(e,t,r,a=>{o(()=>{},{scope:{$event:a},params:[a]})});i(()=>s())}));Ge("Collapse","collapse","collapse");Ge("Intersect","intersect","intersect");Ge("Focus","trap","focus");Ge("Mask","mask","mask");function Ge(e,t,r){d(t,n=>O(`You can't use [x-${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}D.setEvaluator(Oi);D.setReactivityEngine({reactive:Ke,effect:Pr,release:Dr,raw:_});function Oi(e,t){let r={};z(r,e);let n=[r,...C(e)];if(typeof t=="function")return ft(n,t);let i=(o=()=>{},{scope:s={},params:a=[]}={})=>{let c=M([s,...n]);c[t]!==void 0&&Q(o,c[t],c,a)};return Ee.bind(null,e,t,i)}var Lt=D;window.Alpine=Lt;queueMicrotask(()=>{Lt.start()});})();
+`:""}`,t),setTimeout(()=>{throw e},0)}var Se=!0;function Qt(e){let t=Se;Se=!1,e(),Se=t}function D(e,t,r={}){let n;return g(e,t)(i=>n=i,r),n}function g(...e){return Xt(...e)}var Xt=hn;function er(e){Xt=e}function hn(e,t){let r={},n=z(r,e).cleanup;xe(e,"evaluator",n);let i=[r,...C(e)];if(typeof t=="function")return ft(i,t);let o=_n(i,t,e);return Ee.bind(null,e,t,o)}function ft(e,t){return(r=()=>{},{scope:n={},params:i=[]}={})=>{let o=t.apply(M([n,...e]),i);Q(r,o)}}var dt={};function gn(e,t){if(dt[e])return dt[e];let r=Object.getPrototypeOf(async function(){}).constructor,n=/^[\n\s]*if.*\(.*\)/.test(e)||/^(let|const)\s/.test(e)?`(() => { ${e} })()`:e,o=(()=>{try{return new r(["__self","scope"],`with (scope) { __self.result = ${n} }; __self.finished = true; return __self.result;`)}catch(s){return Z(s,t,e),Promise.resolve()}})();return dt[e]=o,o}function _n(e,t,r){let n=gn(t,r);return(i=()=>{},{scope:o={},params:s=[]}={})=>{n.result=void 0,n.finished=!1;let a=M([o,...e]);if(typeof n=="function"){let c=n(n,a).catch(l=>Z(l,r,t));n.finished?(Q(i,n.result,a,s,r),n.result=void 0):c.then(l=>{Q(i,l,a,s,r)}).catch(l=>Z(l,r,t)).finally(()=>n.result=void 0)}}}function Q(e,t,r,n,i){if(Se&&typeof t=="function"){let o=t.apply(r,n);o instanceof Promise?o.then(s=>Q(e,s,r,n)).catch(s=>Z(s,i,t)):e(o)}else e(t)}var pt="x-";function E(e=""){return pt+e}function tr(e){pt=e}var rr={};function d(e,t){rr[e]=t}function ie(e,t,r){if(t=Array.from(t),e._x_virtualDirectives){let o=Object.entries(e._x_virtualDirectives).map(([a,c])=>({name:a,value:c})),s=mt(o);o=o.map(a=>s.find(c=>c.name===a.name)?{name:`x-bind:${a.name}`,value:`"${a.value}"`}:a),t=t.concat(o)}let n={};return t.map(nr((o,s)=>n[o]=s)).filter(ir).map(yn(n,r)).sort(bn).map(o=>xn(e,o))}function mt(e){return Array.from(e).map(nr()).filter(t=>!ir(t))}var ht=!1,oe=new Map,or=Symbol();function sr(e){ht=!0;let t=Symbol();or=t,oe.set(t,[]);let r=()=>{for(;oe.get(t).length;)oe.get(t).shift()();oe.delete(t)},n=()=>{ht=!1,r()};e(r),n()}function ut(e){let t=[],r=a=>t.push(a),[n,i]=Vt(e);return t.push(i),[{Alpine:I,effect:n,cleanup:r,evaluateLater:g.bind(g,e),evaluate:D.bind(D,e)},()=>t.forEach(a=>a())]}function xn(e,t){let r=()=>{},n=rr[t.type]||r,[i,o]=ut(e);xe(e,t.original,o);let s=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,i),n=n.bind(n,e,t,i),ht?oe.get(or).push(n):n())};return s.runCleanups=o,s}var Ae=(e,t)=>({name:r,value:n})=>(r.startsWith(e)&&(r=r.replace(e,t)),{name:r,value:n}),Oe=e=>e;function nr(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=ar.reduce((o,s)=>s(o),{name:t,value:r});return n!==t&&e(n,t),{name:n,value:i}}}var ar=[];function X(e){ar.push(e)}function ir({name:e}){return cr().test(e)}var cr=()=>new RegExp(`^${pt}([^:^.]+)\\b`);function yn(e,t){return({name:r,value:n})=>{let i=r.match(cr()),o=r.match(/:([a-zA-Z0-9\-:]+)/),s=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],a=t||e[r]||r;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:s.map(c=>c.replace(".","")),expression:n,original:a}}}var _t="DEFAULT",Te=["ignore","ref","data","id","bind","init","for","mask","model","modelable","transition","show","if",_t,"teleport"];function bn(e,t){let r=Te.indexOf(e.type)===-1?_t:e.type,n=Te.indexOf(t.type)===-1?_t:t.type;return Te.indexOf(r)-Te.indexOf(n)}function V(e,t,r={}){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0}))}var gt=[],xt=!1;function Me(e=()=>{}){return queueMicrotask(()=>{xt||setTimeout(()=>{Ce()})}),new Promise(t=>{gt.push(()=>{e(),t()})})}function Ce(){for(xt=!1;gt.length;)gt.shift()()}function lr(){xt=!0}function N(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(i=>N(i,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;for(;n;)N(n,t,!1),n=n.nextElementSibling}function O(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}function fr(){document.body||O("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),V(document,"alpine:init"),V(document,"alpine:initializing"),it(),Wt(t=>w(t,N)),ge(t=>yt(t)),Gt((t,r)=>{ie(t,r).forEach(n=>n())});let e=t=>!H(t.parentElement,!0);Array.from(document.querySelectorAll(ur())).filter(e).forEach(t=>{w(t)}),V(document,"alpine:initialized")}var bt=[],dr=[];function pr(){return bt.map(e=>e())}function ur(){return bt.concat(dr).map(e=>e())}function Re(e){bt.push(e)}function Ne(e){dr.push(e)}function H(e,t=!1){return ee(e,r=>{if((t?ur():pr()).some(i=>r.matches(i)))return!0})}function ee(e,t){if(!!e){if(t(e))return e;if(e._x_teleportBack&&(e=e._x_teleportBack),!!e.parentElement)return ee(e.parentElement,t)}}function mr(e){return pr().some(t=>e.matches(t))}function w(e,t=N){sr(()=>{t(e,(r,n)=>{ie(r,r.attributes).forEach(i=>i()),r._x_ignore&&n()})})}function yt(e){N(e,t=>et(t))}function se(e,t){return Array.isArray(t)?hr(e,t.join(" ")):typeof t=="object"&&t!==null?vn(e,t):typeof t=="function"?se(e,t()):hr(e,t)}function hr(e,t){let r=o=>o.split(" ").filter(Boolean),n=o=>o.split(" ").filter(s=>!e.classList.contains(s)).filter(Boolean),i=o=>(e.classList.add(...o),()=>{e.classList.remove(...o)});return t=t===!0?t="":t||"",i(n(t))}function vn(e,t){let r=a=>a.split(" ").filter(Boolean),n=Object.entries(t).flatMap(([a,c])=>c?r(a):!1).filter(Boolean),i=Object.entries(t).flatMap(([a,c])=>c?!1:r(a)).filter(Boolean),o=[],s=[];return i.forEach(a=>{e.classList.contains(a)&&(e.classList.remove(a),s.push(a))}),n.forEach(a=>{e.classList.contains(a)||(e.classList.add(a),o.push(a))}),()=>{s.forEach(a=>e.classList.add(a)),o.forEach(a=>e.classList.remove(a))}}function q(e,t){return typeof t=="object"&&t!==null?wn(e,t):En(e,t)}function wn(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{r[n]=e.style[n],n.startsWith("--")||(n=Sn(n)),e.style.setProperty(n,i)}),setTimeout(()=>{e.style.length===0&&e.removeAttribute("style")}),()=>{q(e,r)}}function En(e,t){let r=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",r||"")}}function Sn(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ae(e,t=()=>{}){let r=!1;return function(){r?t.apply(this,arguments):(r=!0,e.apply(this,arguments))}}d("transition",(e,{value:t,modifiers:r,expression:n},{evaluate:i})=>{typeof n=="function"&&(n=i(n)),n?An(e,n,t):On(e,r,t)});function An(e,t,r){_r(e,se,""),{enter:i=>{e._x_transition.enter.during=i},"enter-start":i=>{e._x_transition.enter.start=i},"enter-end":i=>{e._x_transition.enter.end=i},leave:i=>{e._x_transition.leave.during=i},"leave-start":i=>{e._x_transition.leave.start=i},"leave-end":i=>{e._x_transition.leave.end=i}}[r](t)}function On(e,t,r){_r(e,q);let n=!t.includes("in")&&!t.includes("out")&&!r,i=n||t.includes("in")||["enter"].includes(r),o=n||t.includes("out")||["leave"].includes(r);t.includes("in")&&!n&&(t=t.filter((h,b)=>b<t.indexOf("out"))),t.includes("out")&&!n&&(t=t.filter((h,b)=>b>t.indexOf("out")));let s=!t.includes("opacity")&&!t.includes("scale"),a=s||t.includes("opacity"),c=s||t.includes("scale"),l=a?0:1,u=c?ce(t,"scale",95)/100:1,p=ce(t,"delay",0),y=ce(t,"origin","center"),P="opacity, transform",G=ce(t,"duration",150)/1e3,me=ce(t,"duration",75)/1e3,f="cubic-bezier(0.4, 0.0, 0.2, 1)";i&&(e._x_transition.enter.during={transformOrigin:y,transitionDelay:p,transitionProperty:P,transitionDuration:`${G}s`,transitionTimingFunction:f},e._x_transition.enter.start={opacity:l,transform:`scale(${u})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"}),o&&(e._x_transition.leave.during={transformOrigin:y,transitionDelay:p,transitionProperty:P,transitionDuration:`${me}s`,transitionTimingFunction:f},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:l,transform:`scale(${u})`})}function _r(e,t,r={}){e._x_transition||(e._x_transition={enter:{during:r,start:r,end:r},leave:{during:r,start:r,end:r},in(n=()=>{},i=()=>{}){ke(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,i)},out(n=()=>{},i=()=>{}){ke(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,i)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,r,n){let i=document.visibilityState==="visible"?requestAnimationFrame:setTimeout,o=()=>i(r);if(t){e._x_transition&&(e._x_transition.enter||e._x_transition.leave)?e._x_transition.enter&&(Object.entries(e._x_transition.enter.during).length||Object.entries(e._x_transition.enter.start).length||Object.entries(e._x_transition.enter.end).length)?e._x_transition.in(r):o():e._x_transition?e._x_transition.in(r):o();return}e._x_hidePromise=e._x_transition?new Promise((s,a)=>{e._x_transition.out(()=>{},()=>s(n)),e._x_transitioning.beforeCancel(()=>a({isFromCancelledTransition:!0}))}):Promise.resolve(n),queueMicrotask(()=>{let s=gr(e);s?(s._x_hideChildren||(s._x_hideChildren=[]),s._x_hideChildren.push(e)):i(()=>{let a=c=>{let l=Promise.all([c._x_hidePromise,...(c._x_hideChildren||[]).map(a)]).then(([u])=>u());return delete c._x_hidePromise,delete c._x_hideChildren,l};a(e).catch(c=>{if(!c.isFromCancelledTransition)throw c})})})};function gr(e){let t=e.parentNode;if(!!t)return t._x_hidePromise?t:gr(t)}function ke(e,t,{during:r,start:n,end:i}={},o=()=>{},s=()=>{}){if(e._x_transitioning&&e._x_transitioning.cancel(),Object.keys(r).length===0&&Object.keys(n).length===0&&Object.keys(i).length===0){o(),s();return}let a,c,l;Tn(e,{start(){a=t(e,n)},during(){c=t(e,r)},before:o,end(){a(),l=t(e,i)},after:s,cleanup(){c(),l()}})}function Tn(e,t){let r,n,i,o=ae(()=>{m(()=>{r=!0,n||t.before(),i||(t.end(),Ce()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(s){this.beforeCancels.push(s)},cancel:ae(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();o()}),finish:o},m(()=>{t.start(),t.during()}),lr(),requestAnimationFrame(()=>{if(r)return;let s=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,a=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;s===0&&(s=Number(getComputedStyle(e).animationDuration.replace("s",""))*1e3),m(()=>{t.before()}),n=!0,requestAnimationFrame(()=>{r||(m(()=>{t.end()}),Ce(),setTimeout(e._x_transitioning.finish,s+a),i=!0)})})}function ce(e,t,r){if(e.indexOf(t)===-1)return r;let n=e[e.indexOf(t)+1];if(!n||t==="scale"&&isNaN(n))return r;if(t==="duration"){let i=n.match(/([0-9]+)ms/);if(i)return i[1]}return t==="origin"&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[n,e[e.indexOf(t)+2]].join(" "):n}var vt=!1;function $(e,t=()=>{}){return(...r)=>vt?t(...r):e(...r)}function xr(e,t){t._x_dataStack||(t._x_dataStack=e._x_dataStack),vt=!0,Mn(()=>{Cn(t)}),vt=!1}function Cn(e){let t=!1;w(e,(n,i)=>{N(n,(o,s)=>{if(t&&mr(o))return s();t=!0,i(o,s)})})}function Mn(e){let t=K;Xe((r,n)=>{let i=t(r);return J(i),()=>{}}),e(),Xe(t)}function le(e,t,r,n=[]){switch(e._x_bindings||(e._x_bindings=A({})),e._x_bindings[t]=r,t=n.includes("camel")?Dn(t):t,t){case"value":Rn(e,r);break;case"style":kn(e,r);break;case"class":Nn(e,r);break;default:Pn(e,t,r);break}}function Rn(e,t){if(e.type==="radio")e.attributes.value===void 0&&(e.value=t),window.fromModel&&(e.checked=yr(e.value,t));else if(e.type==="checkbox")Number.isInteger(t)?e.value=t:!Number.isInteger(t)&&!Array.isArray(t)&&typeof t!="boolean"&&![null,void 0].includes(t)?e.value=String(t):Array.isArray(t)?e.checked=t.some(r=>yr(r,e.value)):e.checked=!!t;else if(e.tagName==="SELECT")In(e,t);else{if(e.value===t)return;e.value=t}}function Nn(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedClasses=se(e,t)}function kn(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles(),e._x_undoAddedStyles=q(e,t)}function Pn(e,t,r){[null,void 0,!1].includes(r)&&jn(t)?e.removeAttribute(t):(br(t)&&(r=t),$n(e,t,r))}function $n(e,t,r){e.getAttribute(t)!=r&&e.setAttribute(t,r)}function In(e,t){let r=[].concat(t).map(n=>n+"");Array.from(e.options).forEach(n=>{n.selected=r.includes(n.value)})}function Dn(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function yr(e,t){return e==t}function br(e){return["disabled","checked","required","readonly","hidden","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"].includes(e)}function jn(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}function vr(e,t,r){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];let n=e.getAttribute(t);return n===null?typeof r=="function"?r():r:br(t)?!![t,"true"].includes(n):n===""?!0:n}function Pe(e,t){var r;return function(){var n=this,i=arguments,o=function(){r=null,e.apply(n,i)};clearTimeout(r),r=setTimeout(o,t)}}function De(e,t){let r;return function(){let n=this,i=arguments;r||(e.apply(n,i),r=!0,setTimeout(()=>r=!1,t))}}function wr(e){e(I)}var U={},Er=!1;function Sr(e,t){if(Er||(U=A(U),Er=!0),t===void 0)return U[e];U[e]=t,typeof t=="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init=="function"&&U[e].init(),ve(U[e])}function Ar(){return U}var Or={};function Tr(e,t){let r=typeof t!="function"?()=>t:t;e instanceof Element?wt(e,r()):Or[e]=r}function Cr(e){return Object.entries(Or).forEach(([t,r])=>{Object.defineProperty(e,t,{get(){return(...n)=>r(...n)}})}),e}function wt(e,t,r){let n=[];for(;n.length;)n.pop()();let i=Object.entries(t).map(([s,a])=>({name:s,value:a})),o=mt(i);i=i.map(s=>o.find(a=>a.name===s.name)?{name:`x-bind:${s.name}`,value:`"${s.value}"`}:s),ie(e,i,r).map(s=>{n.push(s.runCleanups),s()})}var Mr={};function Rr(e,t){Mr[e]=t}function Nr(e,t){return Object.entries(Mr).forEach(([r,n])=>{Object.defineProperty(e,r,{get(){return(...i)=>n.bind(t)(...i)},enumerable:!1})}),e}var Ln={get reactive(){return A},get release(){return J},get effect(){return K},get raw(){return Ze},version:"3.10.3",flushAndStopDeferringMutations:Jt,dontAutoEvaluateFunctions:Qt,disableEffectScheduling:Kt,stopObservingMutations:ot,destroyTree:yt,setReactivityEngine:zt,closestDataStack:C,skipDuringClone:$,addRootSelector:Re,addInitSelector:Ne,addScopeToNode:R,deferMutations:Yt,mapAttributes:X,evaluateLater:g,setEvaluator:er,mergeProxies:M,findClosest:ee,closestRoot:H,interceptor:we,transition:ke,setStyles:q,mutateDom:m,directive:d,throttle:De,debounce:Pe,evaluate:D,initTree:w,nextTick:Me,prefixed:E,prefix:tr,plugin:wr,magic:x,store:Sr,start:fr,clone:xr,bound:vr,$data:be,data:Rr,bind:Tr},I=Ln;function Et(e,t){let r=Object.create(null),n=e.split(",");for(let i=0;i<n.length;i++)r[n[i]]=!0;return t?i=>!!r[i.toLowerCase()]:i=>!!r[i]}var os={[1]:"TEXT",[2]:"CLASS",[4]:"STYLE",[8]:"PROPS",[16]:"FULL_PROPS",[32]:"HYDRATE_EVENTS",[64]:"STABLE_FRAGMENT",[128]:"KEYED_FRAGMENT",[256]:"UNKEYED_FRAGMENT",[512]:"NEED_PATCH",[1024]:"DYNAMIC_SLOTS",[2048]:"DEV_ROOT_FRAGMENT",[-1]:"HOISTED",[-2]:"BAIL"},ss={[1]:"STABLE",[2]:"DYNAMIC",[3]:"FORWARDED"};var Fn="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var as=Et(Fn+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var kr=Object.freeze({}),cs=Object.freeze([]);var St=Object.assign;var Bn=Object.prototype.hasOwnProperty,ue=(e,t)=>Bn.call(e,t),j=Array.isArray,te=e=>Pr(e)==="[object Map]";var Kn=e=>typeof e=="string",Ie=e=>typeof e=="symbol",fe=e=>e!==null&&typeof e=="object";var zn=Object.prototype.toString,Pr=e=>zn.call(e),At=e=>Pr(e).slice(8,-1);var $e=e=>Kn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e;var je=e=>{let t=Object.create(null);return r=>t[r]||(t[r]=e(r))},Vn=/-(\w)/g,ls=je(e=>e.replace(Vn,(t,r)=>r?r.toUpperCase():"")),Hn=/\B([A-Z])/g,us=je(e=>e.replace(Hn,"-$1").toLowerCase()),Ot=je(e=>e.charAt(0).toUpperCase()+e.slice(1)),fs=je(e=>e?`on${Ot(e)}`:""),Tt=(e,t)=>e!==t&&(e===e||t===t);var Ct=new WeakMap,de=[],k,W=Symbol("iterate"),Mt=Symbol("Map key iterate");function qn(e){return e&&e._isEffect===!0}function Dr(e,t=kr){qn(e)&&(e=e.raw);let r=Un(e,t);return t.lazy||r(),r}function $r(e){e.active&&(Ir(e),e.options.onStop&&e.options.onStop(),e.active=!1)}var Wn=0;function Un(e,t){let r=function(){if(!r.active)return e();if(!de.includes(r)){Ir(r);try{return Gn(),de.push(r),k=r,e()}finally{de.pop(),jr(),k=de[de.length-1]}}};return r.id=Wn++,r.allowRecurse=!!t.allowRecurse,r._isEffect=!0,r.active=!0,r.raw=e,r.deps=[],r.options=t,r}function Ir(e){let{deps:t}=e;if(t.length){for(let r=0;r<t.length;r++)t[r].delete(e);t.length=0}}var re=!0,Rt=[];function Yn(){Rt.push(re),re=!1}function Gn(){Rt.push(re),re=!0}function jr(){let e=Rt.pop();re=e===void 0?!0:e}function T(e,t,r){if(!re||k===void 0)return;let n=Ct.get(e);n||Ct.set(e,n=new Map);let i=n.get(r);i||n.set(r,i=new Set),i.has(k)||(i.add(k),k.deps.push(i),k.options.onTrack&&k.options.onTrack({effect:k,target:e,type:t,key:r}))}function L(e,t,r,n,i,o){let s=Ct.get(e);if(!s)return;let a=new Set,c=u=>{u&&u.forEach(p=>{(p!==k||p.allowRecurse)&&a.add(p)})};if(t==="clear")s.forEach(c);else if(r==="length"&&j(e))s.forEach((u,p)=>{(p==="length"||p>=n)&&c(u)});else switch(r!==void 0&&c(s.get(r)),t){case"add":j(e)?$e(r)&&c(s.get("length")):(c(s.get(W)),te(e)&&c(s.get(Mt)));break;case"delete":j(e)||(c(s.get(W)),te(e)&&c(s.get(Mt)));break;case"set":te(e)&&c(s.get(W));break}let l=u=>{u.options.onTrigger&&u.options.onTrigger({effect:u,target:e,key:r,type:t,newValue:n,oldValue:i,oldTarget:o}),u.options.scheduler?u.options.scheduler(u):u()};a.forEach(l)}var Jn=Et("__proto__,__v_isRef,__isVue"),Lr=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(Ie)),Zn=Le(),Qn=Le(!1,!0),Xn=Le(!0),ei=Le(!0,!0),Fe={};["includes","indexOf","lastIndexOf"].forEach(e=>{let t=Array.prototype[e];Fe[e]=function(...r){let n=_(this);for(let o=0,s=this.length;o<s;o++)T(n,"get",o+"");let i=t.apply(n,r);return i===-1||i===!1?t.apply(n,r.map(_)):i}});["push","pop","shift","unshift","splice"].forEach(e=>{let t=Array.prototype[e];Fe[e]=function(...r){Yn();let n=t.apply(this,r);return jr(),n}});function Le(e=!1,t=!1){return function(n,i,o){if(i==="__v_isReactive")return!e;if(i==="__v_isReadonly")return e;if(i==="__v_raw"&&o===(e?t?ri:Br:t?ti:Fr).get(n))return n;let s=j(n);if(!e&&s&&ue(Fe,i))return Reflect.get(Fe,i,o);let a=Reflect.get(n,i,o);return(Ie(i)?Lr.has(i):Jn(i))||(e||T(n,"get",i),t)?a:Nt(a)?!s||!$e(i)?a.value:a:fe(a)?e?Kr(a):Be(a):a}}var ni=zr(),ii=zr(!0);function zr(e=!1){return function(r,n,i,o){let s=r[n];if(!e&&(i=_(i),s=_(s),!j(r)&&Nt(s)&&!Nt(i)))return s.value=i,!0;let a=j(r)&&$e(n)?Number(n)<r.length:ue(r,n),c=Reflect.set(r,n,i,o);return r===_(o)&&(a?Tt(i,s)&&L(r,"set",n,i,s):L(r,"add",n,i)),c}}function oi(e,t){let r=ue(e,t),n=e[t],i=Reflect.deleteProperty(e,t);return i&&r&&L(e,"delete",t,void 0,n),i}function si(e,t){let r=Reflect.has(e,t);return(!Ie(t)||!Lr.has(t))&&T(e,"has",t),r}function ai(e){return T(e,"iterate",j(e)?"length":W),Reflect.ownKeys(e)}var Vr={get:Zn,set:ni,deleteProperty:oi,has:si,ownKeys:ai},Hr={get:Xn,set(e,t){return console.warn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0},deleteProperty(e,t){return console.warn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},gs=St({},Vr,{get:Qn,set:ii}),xs=St({},Hr,{get:ei}),kt=e=>fe(e)?Be(e):e,Pt=e=>fe(e)?Kr(e):e,Dt=e=>e,Ke=e=>Reflect.getPrototypeOf(e);function ze(e,t,r=!1,n=!1){e=e.__v_raw;let i=_(e),o=_(t);t!==o&&!r&&T(i,"get",t),!r&&T(i,"get",o);let{has:s}=Ke(i),a=n?Dt:r?Pt:kt;if(s.call(i,t))return a(e.get(t));if(s.call(i,o))return a(e.get(o));e!==i&&e.get(t)}function Ve(e,t=!1){let r=this.__v_raw,n=_(r),i=_(e);return e!==i&&!t&&T(n,"has",e),!t&&T(n,"has",i),e===i?r.has(e):r.has(e)||r.has(i)}function He(e,t=!1){return e=e.__v_raw,!t&&T(_(e),"iterate",W),Reflect.get(e,"size",e)}function qr(e){e=_(e);let t=_(this);return Ke(t).has.call(t,e)||(t.add(e),L(t,"add",e,e)),this}function Wr(e,t){t=_(t);let r=_(this),{has:n,get:i}=Ke(r),o=n.call(r,e);o?Ur(r,n,e):(e=_(e),o=n.call(r,e));let s=i.call(r,e);return r.set(e,t),o?Tt(t,s)&&L(r,"set",e,t,s):L(r,"add",e,t),this}function Gr(e){let t=_(this),{has:r,get:n}=Ke(t),i=r.call(t,e);i?Ur(t,r,e):(e=_(e),i=r.call(t,e));let o=n?n.call(t,e):void 0,s=t.delete(e);return i&&L(t,"delete",e,void 0,o),s}function Yr(){let e=_(this),t=e.size!==0,r=te(e)?new Map(e):new Set(e),n=e.clear();return t&&L(e,"clear",void 0,void 0,r),n}function qe(e,t){return function(n,i){let o=this,s=o.__v_raw,a=_(s),c=t?Dt:e?Pt:kt;return!e&&T(a,"iterate",W),s.forEach((l,u)=>n.call(i,c(l),c(u),o))}}function Ue(e,t,r){return function(...n){let i=this.__v_raw,o=_(i),s=te(o),a=e==="entries"||e===Symbol.iterator&&s,c=e==="keys"&&s,l=i[e](...n),u=r?Dt:t?Pt:kt;return!t&&T(o,"iterate",c?Mt:W),{next(){let{value:p,done:y}=l.next();return y?{value:p,done:y}:{value:a?[u(p[0]),u(p[1])]:u(p),done:y}},[Symbol.iterator](){return this}}}}function F(e){return function(...t){{let r=t[0]?`on key "${t[0]}" `:"";console.warn(`${Ot(e)} operation ${r}failed: target is readonly.`,_(this))}return e==="delete"?!1:this}}var Jr={get(e){return ze(this,e)},get size(){return He(this)},has:Ve,add:qr,set:Wr,delete:Gr,clear:Yr,forEach:qe(!1,!1)},Zr={get(e){return ze(this,e,!1,!0)},get size(){return He(this)},has:Ve,add:qr,set:Wr,delete:Gr,clear:Yr,forEach:qe(!1,!0)},Qr={get(e){return ze(this,e,!0)},get size(){return He(this,!0)},has(e){return Ve.call(this,e,!0)},add:F("add"),set:F("set"),delete:F("delete"),clear:F("clear"),forEach:qe(!0,!1)},Xr={get(e){return ze(this,e,!0,!0)},get size(){return He(this,!0)},has(e){return Ve.call(this,e,!0)},add:F("add"),set:F("set"),delete:F("delete"),clear:F("clear"),forEach:qe(!0,!0)},ci=["keys","values","entries",Symbol.iterator];ci.forEach(e=>{Jr[e]=Ue(e,!1,!1),Qr[e]=Ue(e,!0,!1),Zr[e]=Ue(e,!1,!0),Xr[e]=Ue(e,!0,!0)});function We(e,t){let r=t?e?Xr:Zr:e?Qr:Jr;return(n,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?n:Reflect.get(ue(r,i)&&i in n?r:n,i,o)}var li={get:We(!1,!1)},ys={get:We(!1,!0)},ui={get:We(!0,!1)},bs={get:We(!0,!0)};function Ur(e,t,r){let n=_(r);if(n!==r&&t.call(e,n)){let i=At(e);console.warn(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var Fr=new WeakMap,ti=new WeakMap,Br=new WeakMap,ri=new WeakMap;function fi(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function di(e){return e.__v_skip||!Object.isExtensible(e)?0:fi(At(e))}function Be(e){return e&&e.__v_isReadonly?e:en(e,!1,Vr,li,Fr)}function Kr(e){return en(e,!0,Hr,ui,Br)}function en(e,t,r,n,i){if(!fe(e))return console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;let o=i.get(e);if(o)return o;let s=di(e);if(s===0)return e;let a=new Proxy(e,s===2?n:r);return i.set(e,a),a}function _(e){return e&&_(e.__v_raw)||e}function Nt(e){return Boolean(e&&e.__v_isRef===!0)}x("nextTick",()=>Me);x("dispatch",e=>V.bind(V,e));x("watch",(e,{evaluateLater:t,effect:r})=>(n,i)=>{let o=t(n),s=!0,a,c=r(()=>o(l=>{JSON.stringify(l),s?a=l:queueMicrotask(()=>{i(l,a),a=l}),s=!1}));e._x_effects.delete(c)});x("store",Ar);x("data",e=>be(e));x("root",e=>H(e));x("refs",e=>(e._x_refs_proxy||(e._x_refs_proxy=M(pi(e))),e._x_refs_proxy));function pi(e){let t=[],r=e;for(;r;)r._x_refs&&t.push(r._x_refs),r=r.parentNode;return t}var It={};function $t(e){return It[e]||(It[e]=0),++It[e]}function tn(e,t){return ee(e,r=>{if(r._x_ids&&r._x_ids[t])return!0})}function rn(e,t){e._x_ids||(e._x_ids={}),e._x_ids[t]||(e._x_ids[t]=$t(t))}x("id",e=>(t,r=null)=>{let n=tn(e,t),i=n?n._x_ids[t]:$t(t);return r?`${t}-${i}-${r}`:`${t}-${i}`});x("el",e=>e);nn("Focus","focus","focus");nn("Persist","persist","persist");function nn(e,t,r){x(t,n=>O(`You can't use [$${directiveName}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}d("modelable",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t),o=()=>{let l;return i(u=>l=u),l},s=n(`${t} = __placeholder`),a=l=>s(()=>{},{scope:{__placeholder:l}}),c=o();a(c),queueMicrotask(()=>{if(!e._x_model)return;e._x_removeModelListeners.default();let l=e._x_model.get,u=e._x_model.set;r(()=>a(l())),r(()=>u(o()))})});d("teleport",(e,{expression:t},{cleanup:r})=>{e.tagName.toLowerCase()!=="template"&&O("x-teleport can only be used on a <template> tag",e);let n=document.querySelector(t);n||O(`Cannot find x-teleport element for selector: "${t}"`);let i=e.content.cloneNode(!0).firstElementChild;e._x_teleport=i,i._x_teleportBack=e,e._x_forwardEvents&&e._x_forwardEvents.forEach(o=>{i.addEventListener(o,s=>{s.stopPropagation(),e.dispatchEvent(new s.constructor(s.type,s))})}),R(i,{},e),m(()=>{n.appendChild(i),w(i),i._x_ignore=!0}),r(()=>i.remove())});var on=()=>{};on.inline=(e,{modifiers:t},{cleanup:r})=>{t.includes("self")?e._x_ignoreSelf=!0:e._x_ignore=!0,r(()=>{t.includes("self")?delete e._x_ignoreSelf:delete e._x_ignore})};d("ignore",on);d("effect",(e,{expression:t},{effect:r})=>r(g(e,t)));function pe(e,t,r,n){let i=e,o=c=>n(c),s={},a=(c,l)=>u=>l(c,u);if(r.includes("dot")&&(t=mi(t)),r.includes("camel")&&(t=hi(t)),r.includes("passive")&&(s.passive=!0),r.includes("capture")&&(s.capture=!0),r.includes("window")&&(i=window),r.includes("document")&&(i=document),r.includes("prevent")&&(o=a(o,(c,l)=>{l.preventDefault(),c(l)})),r.includes("stop")&&(o=a(o,(c,l)=>{l.stopPropagation(),c(l)})),r.includes("self")&&(o=a(o,(c,l)=>{l.target===e&&c(l)})),(r.includes("away")||r.includes("outside"))&&(i=document,o=a(o,(c,l)=>{e.contains(l.target)||l.target.isConnected!==!1&&(e.offsetWidth<1&&e.offsetHeight<1||e._x_isShown!==!1&&c(l))})),r.includes("once")&&(o=a(o,(c,l)=>{c(l),i.removeEventListener(t,o,s)})),o=a(o,(c,l)=>{_i(t)&&gi(l,r)||c(l)}),r.includes("debounce")){let c=r[r.indexOf("debounce")+1]||"invalid-wait",l=jt(c.split("ms")[0])?Number(c.split("ms")[0]):250;o=Pe(o,l)}if(r.includes("throttle")){let c=r[r.indexOf("throttle")+1]||"invalid-wait",l=jt(c.split("ms")[0])?Number(c.split("ms")[0]):250;o=De(o,l)}return i.addEventListener(t,o,s),()=>{i.removeEventListener(t,o,s)}}function mi(e){return e.replace(/-/g,".")}function hi(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function jt(e){return!Array.isArray(e)&&!isNaN(e)}function xi(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function _i(e){return["keydown","keyup"].includes(e)}function gi(e,t){let r=t.filter(o=>!["window","document","prevent","stop","once"].includes(o));if(r.includes("debounce")){let o=r.indexOf("debounce");r.splice(o,jt((r[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.length===0||r.length===1&&sn(e.key).includes(r[0]))return!1;let i=["ctrl","shift","alt","meta","cmd","super"].filter(o=>r.includes(o));return r=r.filter(o=>!i.includes(o)),!(i.length>0&&i.filter(s=>((s==="cmd"||s==="super")&&(s="meta"),e[`${s}Key`])).length===i.length&&sn(e.key).includes(r[0]))}function sn(e){if(!e)return[];e=xi(e);let t={ctrl:"control",slash:"/",space:"-",spacebar:"-",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",equal:"="};return t[e]=e,Object.keys(t).map(r=>{if(t[r]===e)return r}).filter(r=>r)}d("model",(e,{modifiers:t,expression:r},{effect:n,cleanup:i})=>{let o=g(e,r),s=`${r} = rightSideOfExpression($event, ${r})`,a=g(e,s);var c=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)||t.includes("lazy")?"change":"input";let l=yi(e,t,r),u=pe(e,c,t,y=>{a(()=>{},{scope:{$event:y,rightSideOfExpression:l}})});e._x_removeModelListeners||(e._x_removeModelListeners={}),e._x_removeModelListeners.default=u,i(()=>e._x_removeModelListeners.default());let p=g(e,`${r} = __placeholder`);e._x_model={get(){let y;return o(P=>y=P),y},set(y){p(()=>{},{scope:{__placeholder:y}})}},e._x_forceModelUpdate=()=>{o(y=>{y===void 0&&r.match(/\./)&&(y=""),window.fromModel=!0,m(()=>le(e,"value",y)),delete window.fromModel})},n(()=>{t.includes("unintrusive")&&document.activeElement.isSameNode(e)||e._x_forceModelUpdate()})});function yi(e,t,r){return e.type==="radio"&&m(()=>{e.hasAttribute("name")||e.setAttribute("name",r)}),(n,i)=>m(()=>{if(n instanceof CustomEvent&&n.detail!==void 0)return n.detail||n.target.value;if(e.type==="checkbox")if(Array.isArray(i)){let o=t.includes("number")?Lt(n.target.value):n.target.value;return n.target.checked?i.concat([o]):i.filter(s=>!bi(s,o))}else return n.target.checked;else{if(e.tagName.toLowerCase()==="select"&&e.multiple)return t.includes("number")?Array.from(n.target.selectedOptions).map(o=>{let s=o.value||o.text;return Lt(s)}):Array.from(n.target.selectedOptions).map(o=>o.value||o.text);{let o=n.target.value;return t.includes("number")?Lt(o):t.includes("trim")?o.trim():o}}})}function Lt(e){let t=e?parseFloat(e):null;return vi(t)?t:e}function bi(e,t){return e==t}function vi(e){return!Array.isArray(e)&&!isNaN(e)}d("cloak",e=>queueMicrotask(()=>m(()=>e.removeAttribute(E("cloak")))));Ne(()=>`[${E("init")}]`);d("init",$((e,{expression:t},{evaluate:r})=>typeof t=="string"?!!t.trim()&&r(t,{},!1):r(t,{},!1)));d("text",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i(o=>{m(()=>{e.textContent=o})})})});d("html",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i(o=>{m(()=>{e.innerHTML=o,e._x_ignoreSelf=!0,w(e),delete e._x_ignoreSelf})})})});X(Ae(":",Oe(E("bind:"))));d("bind",(e,{value:t,modifiers:r,expression:n,original:i},{effect:o})=>{if(!t){let a={};Cr(a),g(e,n)(l=>{wt(e,l,i)},{scope:a});return}if(t==="key")return wi(e,n);let s=g(e,n);o(()=>s(a=>{a===void 0&&n.match(/\./)&&(a=""),m(()=>le(e,t,a,r))}))});function wi(e,t){e._x_keyExpression=t}Re(()=>`[${E("data")}]`);d("data",$((e,{expression:t},{cleanup:r})=>{t=t===""?"{}":t;let n={},i=z(n,e).cleanup,o={};Nr(o,n);let s=D(e,t,{scope:o});s===void 0&&(s={});let a=z(s,e).cleanup,c=A(s);ve(c);let l=R(e,c);c.init&&D(e,c.init),r(()=>{l(),i(),a(),c.destroy&&D(e,c.destroy),l()})}));d("show",(e,{modifiers:t,expression:r},{effect:n})=>{let i=g(e,r);e._x_doHide||(e._x_doHide=()=>{m(()=>{e.style.setProperty("display","none",t.includes("important")?"important":void 0)})}),e._x_doShow||(e._x_doShow=()=>{m(()=>{e.style.length===1&&e.style.display==="none"?e.removeAttribute("style"):e.style.removeProperty("display")})});let o=()=>{e._x_doHide(),e._x_isShown=!1},s=()=>{e._x_doShow(),e._x_isShown=!0},a=()=>setTimeout(s),c=ae(p=>p?s():o(),p=>{typeof e._x_toggleAndCascadeWithTransitions=="function"?e._x_toggleAndCascadeWithTransitions(e,p,s,o):p?a():o()}),l,u=!0;n(()=>i(p=>{!u&&p===l||(t.includes("immediate")&&(p?a():o()),c(p),l=p,u=!1)}))});d("for",(e,{expression:t},{effect:r,cleanup:n})=>{let i=Si(t),o=g(e,i.items),s=g(e,e._x_keyExpression||"index");e._x_prevKeys=[],e._x_lookup={},r(()=>Ei(e,i,o,s)),n(()=>{Object.values(e._x_lookup).forEach(a=>a.remove()),delete e._x_prevKeys,delete e._x_lookup})});function Ei(e,t,r,n){let i=s=>typeof s=="object"&&!Array.isArray(s),o=e;r(s=>{Ai(s)&&s>=0&&(s=Array.from(Array(s).keys(),f=>f+1)),s===void 0&&(s=[]);let a=e._x_lookup,c=e._x_prevKeys,l=[],u=[];if(i(s))s=Object.entries(s).map(([f,h])=>{let b=an(t,h,f,s);n(v=>u.push(v),{scope:{index:f,...b}}),l.push(b)});else for(let f=0;f<s.length;f++){let h=an(t,s[f],f,s);n(b=>u.push(b),{scope:{index:f,...h}}),l.push(h)}let p=[],y=[],P=[],G=[];for(let f=0;f<c.length;f++){let h=c[f];u.indexOf(h)===-1&&P.push(h)}c=c.filter(f=>!P.includes(f));let me="template";for(let f=0;f<u.length;f++){let h=u[f],b=c.indexOf(h);if(b===-1)c.splice(f,0,h),p.push([me,f]);else if(b!==f){let v=c.splice(f,1)[0],S=c.splice(b-1,1)[0];c.splice(f,0,S),c.splice(b,0,v),y.push([v,S])}else G.push(h);me=h}for(let f=0;f<P.length;f++){let h=P[f];a[h]._x_effects&&a[h]._x_effects.forEach(_e),a[h].remove(),a[h]=null,delete a[h]}for(let f=0;f<y.length;f++){let[h,b]=y[f],v=a[h],S=a[b],Y=document.createElement("div");m(()=>{S.after(Y),v.after(S),S._x_currentIfEl&&S.after(S._x_currentIfEl),Y.before(v),v._x_currentIfEl&&v.after(v._x_currentIfEl),Y.remove()}),ct(S,l[u.indexOf(b)])}for(let f=0;f<p.length;f++){let[h,b]=p[f],v=h==="template"?o:a[h];v._x_currentIfEl&&(v=v._x_currentIfEl);let S=l[b],Y=u[b],he=document.importNode(o.content,!0).firstElementChild;R(he,A(S),o),m(()=>{v.after(he),w(he)}),typeof Y=="object"&&O("x-for key cannot be an object, it must be a string or an integer",o),a[Y]=he}for(let f=0;f<G.length;f++)ct(a[G[f]],l[u.indexOf(G[f])]);o._x_prevKeys=u})}function Si(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,r=/^\s*\(|\)\s*$/g,n=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,i=e.match(n);if(!i)return;let o={};o.items=i[2].trim();let s=i[1].replace(r,"").trim(),a=s.match(t);return a?(o.item=s.replace(t,"").trim(),o.index=a[1].trim(),a[2]&&(o.collection=a[2].trim())):o.item=s,o}function an(e,t,r,n){let i={};return/^\[.*\]$/.test(e.item)&&Array.isArray(t)?e.item.replace("[","").replace("]","").split(",").map(s=>s.trim()).forEach((s,a)=>{i[s]=t[a]}):/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t=="object"?e.item.replace("{","").replace("}","").split(",").map(s=>s.trim()).forEach(s=>{i[s]=t[s]}):i[e.item]=t,e.index&&(i[e.index]=r),e.collection&&(i[e.collection]=n),i}function Ai(e){return!Array.isArray(e)&&!isNaN(e)}function cn(){}cn.inline=(e,{expression:t},{cleanup:r})=>{let n=H(e);n._x_refs||(n._x_refs={}),n._x_refs[t]=e,r(()=>delete n._x_refs[t])};d("ref",cn);d("if",(e,{expression:t},{effect:r,cleanup:n})=>{let i=g(e,t),o=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let a=e.content.cloneNode(!0).firstElementChild;return R(a,{},e),m(()=>{e.after(a),w(a)}),e._x_currentIfEl=a,e._x_undoIf=()=>{N(a,c=>{c._x_effects&&c._x_effects.forEach(_e)}),a.remove(),delete e._x_currentIfEl},a},s=()=>{!e._x_undoIf||(e._x_undoIf(),delete e._x_undoIf)};r(()=>i(a=>{a?o():s()})),n(()=>e._x_undoIf&&e._x_undoIf())});d("id",(e,{expression:t},{evaluate:r})=>{r(t).forEach(i=>rn(e,i))});X(Ae("@",Oe(E("on:"))));d("on",$((e,{value:t,modifiers:r,expression:n},{cleanup:i})=>{let o=n?g(e,n):()=>{};e.tagName.toLowerCase()==="template"&&(e._x_forwardEvents||(e._x_forwardEvents=[]),e._x_forwardEvents.includes(t)||e._x_forwardEvents.push(t));let s=pe(e,t,r,a=>{o(()=>{},{scope:{$event:a},params:[a]})});i(()=>s())}));Ge("Collapse","collapse","collapse");Ge("Intersect","intersect","intersect");Ge("Focus","trap","focus");Ge("Mask","mask","mask");function Ge(e,t,r){d(t,n=>O(`You can't use [x-${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}I.setEvaluator(Oi);I.setReactivityEngine({reactive:Be,effect:Dr,release:$r,raw:_});function Oi(e,t){let r={};z(r,e);let n=[r,...C(e)];if(typeof t=="function")return ft(n,t);let i=(o=()=>{},{scope:s={},params:a=[]}={})=>{let c=M([s,...n]);c[t]!==void 0&&Q(o,c[t],c,a)};return Ee.bind(null,e,t,i)}var Ft=I;window.Alpine=Ft;queueMicrotask(()=>{Ft.start()});})();
diff --git a/alpinejs/packages/csp/dist/module.cjs.js b/alpinejs/packages/csp/dist/module.cjs.js
index 3fba32e..f633490 100644
--- a/alpinejs/packages/csp/dist/module.cjs.js
+++ b/alpinejs/packages/csp/dist/module.cjs.js
@@ -1796,8 +1796,23 @@ function directive(name, callback) {
directiveHandlers[name] = callback;
}
function directives(el, attributes, originalAttributeOverride) {
+ attributes = Array.from(attributes);
+ if (el._x_virtualDirectives) {
+ let vAttributes = Object.entries(el._x_virtualDirectives).map(([name, value]) => ({name, value}));
+ let staticAttributes = attributesOnly(vAttributes);
+ vAttributes = vAttributes.map((attribute) => {
+ if (staticAttributes.find((attr) => attr.name === attribute.name)) {
+ return {
+ name: `x-bind:${attribute.name}`,
+ value: `"${attribute.value}"`
+ };
+ }
+ return attribute;
+ });
+ attributes = attributes.concat(vAttributes);
+ }
let transformedAttributeMap = {};
- let directives2 = Array.from(attributes).map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority);
+ let directives2 = attributes.map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority);
return directives2.map((directive2) => {
return getDirectiveHandler(el, directive2);
});
@@ -1912,8 +1927,7 @@ var directiveOrder = [
"show",
"if",
DEFAULT,
- "teleport",
- "element"
+ "teleport"
];
function byPriority(a, b) {
let typeA = directiveOrder.indexOf(a.type) === -1 ? DEFAULT : a.type;
@@ -2258,9 +2272,8 @@ function registerTransitionObject(el, setFunction, defaultValue = {}) {
};
}
window.Element.prototype._x_toggleAndCascadeWithTransitions = function(el, value, show, hide) {
- let clickAwayCompatibleShow = () => {
- document.visibilityState === "visible" ? requestAnimationFrame(show) : setTimeout(show);
- };
+ const nextTick2 = document.visibilityState === "visible" ? requestAnimationFrame : setTimeout;
+ let clickAwayCompatibleShow = () => nextTick2(show);
if (value) {
if (el._x_transition && (el._x_transition.enter || el._x_transition.leave)) {
el._x_transition.enter && (Object.entries(el._x_transition.enter.during).length || Object.entries(el._x_transition.enter.start).length || Object.entries(el._x_transition.enter.end).length) ? el._x_transition.in(show) : clickAwayCompatibleShow();
@@ -2281,7 +2294,7 @@ window.Element.prototype._x_toggleAndCascadeWithTransitions = function(el, value
closest._x_hideChildren = [];
closest._x_hideChildren.push(el);
} else {
- queueMicrotask(() => {
+ nextTick2(() => {
let hideAfterChildren = (el2) => {
let carry = Promise.all([
el2._x_hidePromise,
@@ -2645,8 +2658,13 @@ function getStores() {
// packages/alpinejs/src/binds.js
var binds = {};
-function bind2(name, object) {
- binds[name] = typeof object !== "function" ? () => object : object;
+function bind2(name, bindings) {
+ let getBindings = typeof bindings !== "function" ? () => bindings : bindings;
+ if (name instanceof Element) {
+ applyBindingsObject(name, getBindings());
+ } else {
+ binds[name] = getBindings;
+ }
}
function injectBindingProviders(obj) {
Object.entries(binds).forEach(([name, callback]) => {
@@ -2660,6 +2678,26 @@ function injectBindingProviders(obj) {
});
return obj;
}
+function applyBindingsObject(el, obj, original) {
+ let cleanupRunners = [];
+ while (cleanupRunners.length)
+ cleanupRunners.pop()();
+ let attributes = Object.entries(obj).map(([name, value]) => ({name, value}));
+ let staticAttributes = attributesOnly(attributes);
+ attributes = attributes.map((attribute) => {
+ if (staticAttributes.find((attr) => attr.name === attribute.name)) {
+ return {
+ name: `x-bind:${attribute.name}`,
+ value: `"${attribute.value}"`
+ };
+ }
+ return attribute;
+ });
+ directives(el, attributes, original).map((handle) => {
+ cleanupRunners.push(handle.runCleanups);
+ handle();
+ });
+}
// packages/alpinejs/src/datas.js
var datas = {};
@@ -2694,7 +2732,7 @@ var Alpine = {
get raw() {
return raw;
},
- version: "3.10.2",
+ version: "3.10.3",
flushAndStopDeferringMutations,
dontAutoEvaluateFunctions,
disableEffectScheduling,
@@ -3169,7 +3207,13 @@ directive("html", (el, {expression}, {effect: effect3, evaluateLater: evaluateLa
mapAttributes(startingWith(":", into(prefix("bind:"))));
directive("bind", (el, {value, modifiers, expression, original}, {effect: effect3}) => {
if (!value) {
- return applyBindingsObject(el, expression, original, effect3);
+ let bindingProviders = {};
+ injectBindingProviders(bindingProviders);
+ let getBindings = evaluateLater(el, expression);
+ getBindings((bindings) => {
+ applyBindingsObject(el, bindings, original);
+ }, {scope: bindingProviders});
+ return;
}
if (value === "key")
return storeKeyForXFor(el, expression);
@@ -3180,31 +3224,6 @@ directive("bind", (el, {value, modifiers, expression, original}, {effect: effect
mutateDom(() => bind(el, value, result, modifiers));
}));
});
-function applyBindingsObject(el, expression, original, effect3) {
- let bindingProviders = {};
- injectBindingProviders(bindingProviders);
- let getBindings = evaluateLater(el, expression);
- let cleanupRunners = [];
- while (cleanupRunners.length)
- cleanupRunners.pop()();
- getBindings((bindings) => {
- let attributes = Object.entries(bindings).map(([name, value]) => ({name, value}));
- let staticAttributes = attributesOnly(attributes);
- attributes = attributes.map((attribute) => {
- if (staticAttributes.find((attr) => attr.name === attribute.name)) {
- return {
- name: `x-bind:${attribute.name}`,
- value: `"${attribute.value}"`
- };
- }
- return attribute;
- });
- directives(el, attributes, original).map((handle) => {
- cleanupRunners.push(handle.runCleanups);
- handle();
- });
- }, {scope: bindingProviders});
-}
function storeKeyForXFor(el, expression) {
el._x_keyExpression = expression;
}
@@ -3239,7 +3258,9 @@ directive("show", (el, {modifiers, expression}, {effect: effect3}) => {
let evaluate2 = evaluateLater(el, expression);
if (!el._x_doHide)
el._x_doHide = () => {
- mutateDom(() => el.style.display = "none");
+ mutateDom(() => {
+ el.style.setProperty("display", "none", modifiers.includes("important") ? "important" : void 0);
+ });
};
if (!el._x_doShow)
el._x_doShow = () => {
diff --git a/alpinejs/packages/csp/dist/module.esm.js b/alpinejs/packages/csp/dist/module.esm.js
index 40eaee2..607b18f 100644
--- a/alpinejs/packages/csp/dist/module.esm.js
+++ b/alpinejs/packages/csp/dist/module.esm.js
@@ -530,8 +530,23 @@ function directive(name, callback) {
directiveHandlers[name] = callback;
}
function directives(el, attributes, originalAttributeOverride) {
+ attributes = Array.from(attributes);
+ if (el._x_virtualDirectives) {
+ let vAttributes = Object.entries(el._x_virtualDirectives).map(([name, value]) => ({name, value}));
+ let staticAttributes = attributesOnly(vAttributes);
+ vAttributes = vAttributes.map((attribute) => {
+ if (staticAttributes.find((attr) => attr.name === attribute.name)) {
+ return {
+ name: `x-bind:${attribute.name}`,
+ value: `"${attribute.value}"`
+ };
+ }
+ return attribute;
+ });
+ attributes = attributes.concat(vAttributes);
+ }
let transformedAttributeMap = {};
- let directives2 = Array.from(attributes).map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority);
+ let directives2 = attributes.map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority);
return directives2.map((directive2) => {
return getDirectiveHandler(el, directive2);
});
@@ -646,8 +661,7 @@ var directiveOrder = [
"show",
"if",
DEFAULT,
- "teleport",
- "element"
+ "teleport"
];
function byPriority(a, b) {
let typeA = directiveOrder.indexOf(a.type) === -1 ? DEFAULT : a.type;
@@ -992,9 +1006,8 @@ function registerTransitionObject(el, setFunction, defaultValue = {}) {
};
}
window.Element.prototype._x_toggleAndCascadeWithTransitions = function(el, value, show, hide) {
- let clickAwayCompatibleShow = () => {
- document.visibilityState === "visible" ? requestAnimationFrame(show) : setTimeout(show);
- };
+ const nextTick2 = document.visibilityState === "visible" ? requestAnimationFrame : setTimeout;
+ let clickAwayCompatibleShow = () => nextTick2(show);
if (value) {
if (el._x_transition && (el._x_transition.enter || el._x_transition.leave)) {
el._x_transition.enter && (Object.entries(el._x_transition.enter.during).length || Object.entries(el._x_transition.enter.start).length || Object.entries(el._x_transition.enter.end).length) ? el._x_transition.in(show) : clickAwayCompatibleShow();
@@ -1015,7 +1028,7 @@ window.Element.prototype._x_toggleAndCascadeWithTransitions = function(el, value
closest._x_hideChildren = [];
closest._x_hideChildren.push(el);
} else {
- queueMicrotask(() => {
+ nextTick2(() => {
let hideAfterChildren = (el2) => {
let carry = Promise.all([
el2._x_hidePromise,
@@ -1379,8 +1392,13 @@ function getStores() {
// packages/alpinejs/src/binds.js
var binds = {};
-function bind2(name, object) {
- binds[name] = typeof object !== "function" ? () => object : object;
+function bind2(name, bindings) {
+ let getBindings = typeof bindings !== "function" ? () => bindings : bindings;
+ if (name instanceof Element) {
+ applyBindingsObject(name, getBindings());
+ } else {
+ binds[name] = getBindings;
+ }
}
function injectBindingProviders(obj) {
Object.entries(binds).forEach(([name, callback]) => {
@@ -1394,6 +1412,26 @@ function injectBindingProviders(obj) {
});
return obj;
}
+function applyBindingsObject(el, obj, original) {
+ let cleanupRunners = [];
+ while (cleanupRunners.length)
+ cleanupRunners.pop()();
+ let attributes = Object.entries(obj).map(([name, value]) => ({name, value}));
+ let staticAttributes = attributesOnly(attributes);
+ attributes = attributes.map((attribute) => {
+ if (staticAttributes.find((attr) => attr.name === attribute.name)) {
+ return {
+ name: `x-bind:${attribute.name}`,
+ value: `"${attribute.value}"`
+ };
+ }
+ return attribute;
+ });
+ directives(el, attributes, original).map((handle) => {
+ cleanupRunners.push(handle.runCleanups);
+ handle();
+ });
+}
// packages/alpinejs/src/datas.js
var datas = {};
@@ -1428,7 +1466,7 @@ var Alpine = {
get raw() {
return raw;
},
- version: "3.10.2",
+ version: "3.10.3",
flushAndStopDeferringMutations,
dontAutoEvaluateFunctions,
disableEffectScheduling,
@@ -2579,7 +2617,13 @@ directive("html", (el, {expression}, {effect: effect3, evaluateLater: evaluateLa
mapAttributes(startingWith(":", into(prefix("bind:"))));
directive("bind", (el, {value, modifiers, expression, original}, {effect: effect3}) => {
if (!value) {
- return applyBindingsObject(el, expression, original, effect3);
+ let bindingProviders = {};
+ injectBindingProviders(bindingProviders);
+ let getBindings = evaluateLater(el, expression);
+ getBindings((bindings) => {
+ applyBindingsObject(el, bindings, original);
+ }, {scope: bindingProviders});
+ return;
}
if (value === "key")
return storeKeyForXFor(el, expression);
@@ -2590,31 +2634,6 @@ directive("bind", (el, {value, modifiers, expression, original}, {effect: effect
mutateDom(() => bind(el, value, result, modifiers));
}));
});
-function applyBindingsObject(el, expression, original, effect3) {
- let bindingProviders = {};
- injectBindingProviders(bindingProviders);
- let getBindings = evaluateLater(el, expression);
- let cleanupRunners = [];
- while (cleanupRunners.length)
- cleanupRunners.pop()();
- getBindings((bindings) => {
- let attributes = Object.entries(bindings).map(([name, value]) => ({name, value}));
- let staticAttributes = attributesOnly(attributes);
- attributes = attributes.map((attribute) => {
- if (staticAttributes.find((attr) => attr.name === attribute.name)) {
- return {
- name: `x-bind:${attribute.name}`,
- value: `"${attribute.value}"`
- };
- }
- return attribute;
- });
- directives(el, attributes, original).map((handle) => {
- cleanupRunners.push(handle.runCleanups);
- handle();
- });
- }, {scope: bindingProviders});
-}
function storeKeyForXFor(el, expression) {
el._x_keyExpression = expression;
}
@@ -2649,7 +2668,9 @@ directive("show", (el, {modifiers, expression}, {effect: effect3}) => {
let evaluate2 = evaluateLater(el, expression);
if (!el._x_doHide)
el._x_doHide = () => {
- mutateDom(() => el.style.display = "none");
+ mutateDom(() => {
+ el.style.setProperty("display", "none", modifiers.includes("important") ? "important" : void 0);
+ });
};
if (!el._x_doShow)
el._x_doShow = () => {
diff --git a/alpinejs/packages/docs/package.json b/alpinejs/packages/docs/package.json
index 61fbce5..94ea6df 100644
--- a/alpinejs/packages/docs/package.json
+++ b/alpinejs/packages/docs/package.json
@@ -1,6 +1,6 @@
{
"name": "@alpinejs/docs",
- "version": "3.10.2-revision.1",
+ "version": "3.10.3-revision.1",
"description": "The documentation for Alpine",
"author": "Caleb Porzio",
"license": "MIT"
diff --git a/alpinejs/packages/docs/src/en/directives/on.md b/alpinejs/packages/docs/src/en/directives/on.md
index 3745a56..7a65ca6 100644
--- a/alpinejs/packages/docs/src/en/directives/on.md
+++ b/alpinejs/packages/docs/src/en/directives/on.md
@@ -13,7 +13,7 @@ Here's an example of simple button that shows an alert when clicked.
<button x-on:click="alert('Hello World!')">Say Hi</button>
```
-> `x-on` can only listen for events with lower case names, as HTML attributes are case-insensitive. Writing `x-on:CLICK` will listen for an event named `click`. If you need to listen for a custom event with a camelCase name, you can use the [`.camel` helper](#camel) to work around this limitation. Alternatively, you can use [`x-bind`](/directives/bind.md#bind-directives) to attach an `x-on` directive to an element in javascript code (where case will be preserved).
+> `x-on` can only listen for events with lower case names, as HTML attributes are case-insensitive. Writing `x-on:CLICK` will listen for an event named `click`. If you need to listen for a custom event with a camelCase name, you can use the [`.camel` helper](#camel) to work around this limitation. Alternatively, you can use [`x-bind`](/directives/bind#bind-directives) to attach an `x-on` directive to an element in javascript code (where case will be preserved).
<a name="shorthand-syntax"></a>
## Shorthand syntax
@@ -81,7 +81,7 @@ For easy reference, here is a list of common keys you may want to listen for.
| `.space` | Space |
| `.ctrl` | Ctrl |
| `.cmd` | Cmd |
-| `.meta` | Cmd on Mac, Ctrl on Windows |
+| `.meta` | Cmd on Mac, Windows key on Windows |
| `.alt` | Alt |
| `.up` `.down` `.left` `.right` | Up/Down/Left/Right arrows |
| `.escape` | Escape |
diff --git a/alpinejs/packages/docs/src/en/directives/show.md b/alpinejs/packages/docs/src/en/directives/show.md
index 988a16f..cd28fcf 100644
--- a/alpinejs/packages/docs/src/en/directives/show.md
+++ b/alpinejs/packages/docs/src/en/directives/show.md
@@ -37,3 +37,20 @@ If you want to apply smooth transitions to the `x-show` behavior, you can use it
</div>
</div>
```
+
+<a name="using-the-important-modifier"></a>
+## Using the important modifier
+
+Sometimes you need to apply a little more force to actually hide an element. In cases where a CSS selector applies the `display` property with the `!important` flag, it will take precedence over the inline style set by Alpine.
+
+In these cases you may use the `.important` modifier to set the inline style to `display: none !important`.
+
+```alpine
+<div x-data="{ open: false }">
+ <button x-on:click="open = ! open">Toggle Dropdown</button>
+
+ <div x-show.important="open">
+ Dropdown Contents...
+ </div>
+</div>
+```
diff --git a/alpinejs/packages/docs/src/en/essentials/installation.md b/alpinejs/packages/docs/src/en/essentials/installation.md
index bee805d..91a0f99 100644
--- a/alpinejs/packages/docs/src/en/essentials/installation.md
+++ b/alpinejs/packages/docs/src/en/essentials/installation.md
@@ -33,7 +33,7 @@ This is by far the simplest way to get started with Alpine. Include the followin
Notice the `@3.x.x` in the provided CDN link. This will pull the latest version of Alpine version 3. For stability in production, it's recommended that you hardcode the latest version in the CDN link.
```alpine
-<script defer src="https://unpkg.com/alpinejs@3.10.2/dist/cdn.min.js"></script>
+<script defer src="https://unpkg.com/alpinejs@3.10.3/dist/cdn.min.js"></script>
```
That's it! Alpine is now available for use inside your page.
diff --git a/alpinejs/packages/docs/src/en/magics/store.md b/alpinejs/packages/docs/src/en/magics/store.md
index 6610d29..946756e 100644
--- a/alpinejs/packages/docs/src/en/magics/store.md
+++ b/alpinejs/packages/docs/src/en/magics/store.md
@@ -6,7 +6,7 @@ title: store
# $store
-You can use `$store` to conveniently access global Alpine stores registered using [`Alpine.store(...)`](/magics/store). For example:
+You can use `$store` to conveniently access global Alpine stores registered using [`Alpine.store(...)`](/globals/alpine-store). For example:
```alpine
<button x-data @click="$store.darkMode.toggle()">Toggle Dark Mode</button>
diff --git a/alpinejs/packages/docs/src/en/plugins/focus.md b/alpinejs/packages/docs/src/en/plugins/focus.md
index 00ad767..6946889 100644
--- a/alpinejs/packages/docs/src/en/plugins/focus.md
+++ b/alpinejs/packages/docs/src/en/plugins/focus.md
@@ -280,7 +280,7 @@ For example:
<!-- START_VERBATIM -->
<div class="demo">
<div
- x-data="{ open: false }"
+ x-data="{ open: false }"
x-trap.noreturn="open"
@click.outside="open = false"
@keyup.escape.prevent.stop="open = false"
@@ -345,9 +345,9 @@ Let's walk through a few examples of these utilities in use. The example below a
@keydown.right="$focus.next()"
@keydown.left="$focus.previous()"
>
- <button class="focus:outline-none focus:ring-2 focus:ring-aqua-400">First</button>
- <button class="focus:outline-none focus:ring-2 focus:ring-aqua-400">Second</button>
- <button class="focus:outline-none focus:ring-2 focus:ring-aqua-400">Third</button>
+ <button class="focus:outline-none focus:ring-2 focus:ring-cyan-400">First</button>
+ <button class="focus:outline-none focus:ring-2 focus:ring-cyan-400">Second</button>
+ <button class="focus:outline-none focus:ring-2 focus:ring-cyan-400">Third</button>
</div>
(Click a button, then use the arrow keys to move left and right)
</div>
@@ -373,9 +373,9 @@ Notice how if the last button is focused, pressing "right arrow" won't do anythi
@keydown.right="$focus.wrap().next()"
@keydown.left="$focus.wrap().previous()"
>
- <button class="focus:outline-none focus:ring-2 focus:ring-aqua-400">First</button>
- <button class="focus:outline-none focus:ring-2 focus:ring-aqua-400">Second</button>
- <button class="focus:outline-none focus:ring-2 focus:ring-aqua-400">Third</button>
+ <button class="focus:outline-none focus:ring-2 focus:ring-cyan-400">First</button>
+ <button class="focus:outline-none focus:ring-2 focus:ring-cyan-400">Second</button>
+ <button class="focus:outline-none focus:ring-2 focus:ring-cyan-400">Third</button>
</div>
(Click a button, then use the arrow keys to move left and right)
</div>
@@ -410,9 +410,9 @@ Now, let's add two buttons, one to focus the first element in the button group,
@keydown.right="$focus.wrap().next()"
@keydown.left="$focus.wrap().previous()"
>
- <button class="focus:outline-none focus:ring-2 focus:ring-aqua-400">First</button>
- <button class="focus:outline-none focus:ring-2 focus:ring-aqua-400">Second</button>
- <button class="focus:outline-none focus:ring-2 focus:ring-aqua-400">Third</button>
+ <button class="focus:outline-none focus:ring-2 focus:ring-cyan-400">First</button>
+ <button class="focus:outline-none focus:ring-2 focus:ring-cyan-400">Second</button>
+ <button class="focus:outline-none focus:ring-2 focus:ring-cyan-400">Third</button>
</div>
</div>
<!-- END_VERBATIM -->
diff --git a/alpinejs/packages/docs/src/en/plugins/mask.md b/alpinejs/packages/docs/src/en/plugins/mask.md
index 60badfd..4c5d713 100644
--- a/alpinejs/packages/docs/src/en/plugins/mask.md
+++ b/alpinejs/packages/docs/src/en/plugins/mask.md
@@ -54,7 +54,7 @@ Alpine.plugin(mask)
</div>
</div>
-<button :aria-expanded="expanded" @click="expanded = ! expanded" class="text-aqua-600 font-medium underline">
+<button :aria-expanded="expanded" @click="expanded = ! expanded" class="text-cyan-600 font-medium underline">
<span x-text="expanded ? 'Hide' : 'Show more'">Show</span> <span x-text="expanded ? '↑' : '↓'">↓</span>
</button>
</div>
diff --git a/alpinejs/packages/docs/src/en/plugins/morph.md b/alpinejs/packages/docs/src/en/plugins/morph.md
index 3098ca8..2ff0232 100644
--- a/alpinejs/packages/docs/src/en/plugins/morph.md
+++ b/alpinejs/packages/docs/src/en/plugins/morph.md
@@ -21,10 +21,10 @@ The best way to understand its purpose is with the following interactive visuali
<div class="flex w-full justify-between" style="padding-bottom: 1rem">
<div class="w-1/2 px-4">
- <button @click="slide = (slide === 1) ? 13 : slide - 1" class="w-full bg-aqua-400 rounded-full text-center py-3 font-bold text-white">Previous</button>
+ <button @click="slide = (slide === 1) ? 13 : slide - 1" class="w-full bg-cyan-400 rounded-full text-center py-3 font-bold text-white">Previous</button>
</div>
<div class="w-1/2 px-4">
- <button @click="slide = (slide % 13) + 1" class="w-full bg-aqua-400 rounded-full text-center py-3 font-bold text-white">Next</button>
+ <button @click="slide = (slide % 13) + 1" class="w-full bg-cyan-400 rounded-full text-center py-3 font-bold text-white">Next</button>
</div>
</div>
</div>
@@ -82,8 +82,8 @@ Here's an example of using `Alpine.morph()` to update an Alpine component with n
```alpine
<div x-data="{ message: 'Change me, then press the button!' }">
- <input type="text" x-model="message">
- <span x-text="message"></span>
+ <input type="text" x-model="message">
+ <span x-text="message"></span>
</div>
<button>Run Morph</button>
@@ -95,9 +95,9 @@ Here's an example of using `Alpine.morph()` to update an Alpine component with n
Alpine.morph(el, `
<div x-data="{ message: 'Change me, then press the button!' }">
<h2>See how new elements have been added</h2>
-
- <input type="text" x-model="message">
- <span x-text="message"></span>
+
+ <input type="text" x-model="message">
+ <span x-text="message"></span>
<h2>but the state of this component hasn't changed? Magical.</h2>
</div>
@@ -110,9 +110,9 @@ Here's an example of using `Alpine.morph()` to update an Alpine component with n
<div class="demo">
<div x-data="{ message: 'Change me, then press the button!' }" id="morph-demo-1" class="space-y-2">
<input type="text" x-model="message" class="w-full">
- <span x-text="message"></span>
+ <span x-text="message"></span>
</div>
-
+
<button id="morph-button-1" class="mt-4">Run Morph</button>
</div>
@@ -123,8 +123,8 @@ Here's an example of using `Alpine.morph()` to update an Alpine component with n
Alpine.morph(el, `
<div x-data="{ message: 'Change me, then press the button!' }" id="morph-demo-1" class="space-y-2">
<h4>See how new elements have been added</h4>
- <input type="text" x-model="message" class="w-full">
- <span x-text="message"></span>
+ <input type="text" x-model="message" class="w-full">
+ <span x-text="message"></span>
<h4>but the state of this component hasn't changed? Magical.</h4>
</div>
`)
diff --git a/alpinejs/packages/docs/src/en/ui.md b/alpinejs/packages/docs/src/en/ui.md
new file mode 100644
index 0000000..14a4b16
--- /dev/null
+++ b/alpinejs/packages/docs/src/en/ui.md
@@ -0,0 +1,6 @@
+---
+order: 5
+title: UI
+font-type: mono
+type: sub-directory
+---
diff --git a/alpinejs/packages/focus/dist/cdn.js b/alpinejs/packages/focus/dist/cdn.js
index 4f5b2ff..af5dd15 100644
--- a/alpinejs/packages/focus/dist/cdn.js
+++ b/alpinejs/packages/focus/dist/cdn.js
@@ -741,7 +741,8 @@
let trap = createFocusTrap(el, {
escapeDeactivates: false,
allowOutsideClick: true,
- fallbackFocus: () => el
+ fallbackFocus: () => el,
+ initialFocus: el.querySelector("[autofocus]")
});
let undoInert = () => {
};
diff --git a/alpinejs/packages/focus/dist/cdn.min.js b/alpinejs/packages/focus/dist/cdn.min.js
index 781dfb8..ba2af16 100644
--- a/alpinejs/packages/focus/dist/cdn.min.js
+++ b/alpinejs/packages/focus/dist/cdn.min.js
@@ -1,4 +1,4 @@
-(()=>{var j=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],_=j.join(","),A=typeof Element=="undefined"?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,G=function(e,t,n){var u=Array.prototype.slice.apply(e.querySelectorAll(_));return t&&A.call(e,_)&&u.unshift(e),u=u.filter(n),u},Z=function(e){return e.contentEditable==="true"},M=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?Z(e)||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t},$=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},C=function(e){return e.tagName==="INPUT"},ee=function(e){return C(e)&&e.type==="hidden"},te=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(n){return n.tagName==="SUMMARY"});return t},re=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},ae=function(e){if(!e.name)return!0;var t=e.form||e.ownerDocument,n=function(l){return t.querySelectorAll('input[type="radio"][name="'+l+'"]')},u;if(typeof window!="undefined"&&typeof window.CSS!="undefined"&&typeof window.CSS.escape=="function")u=n(window.CSS.escape(e.name));else try{u=n(e.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var r=re(u,e.form);return!r||r===e},ne=function(e){return C(e)&&e.type==="radio"},ie=function(e){return ne(e)&&!ae(e)},ue=function(e,t){if(getComputedStyle(e).visibility==="hidden")return!0;var n=A.call(e,"details>summary:first-of-type"),u=n?e.parentElement:e;if(A.call(u,"details:not([open]) *"))return!0;if(!t||t==="full")for(;e;){if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}else if(t==="non-zero-area"){var r=e.getBoundingClientRect(),s=r.width,l=r.height;return s===0&&l===0}return!1},oe=function(e){if(C(e)||e.tagName==="SELECT"||e.tagName==="TEXTAREA"||e.tagName==="BUTTON")for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var n=0;n<t.children.length;n++){var u=t.children.item(n);if(u.tagName==="LEGEND")return!u.contains(e)}return!0}t=t.parentElement}return!1},O=function(e,t){return!(t.disabled||ee(t)||ue(t,e.displayCheck)||te(t)||oe(t))},se=function(e,t){return!(!O(e,t)||ie(t)||M(t)<0)},W=function(e,t){t=t||{};var n=[],u=[],r=G(e,t.includeContainer,se.bind(null,t));r.forEach(function(l,h){var b=M(l);b===0?n.push(l):u.push({documentOrder:h,tabIndex:b,node:l})});var s=u.sort($).map(function(l){return l.node}).concat(n);return s},q=function(e,t){t=t||{};var n=G(e,t.includeContainer,O.bind(null,t));return n};var ce=j.concat("iframe").join(","),k=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return A.call(e,ce)===!1?!1:O(t,e)};function B(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(u){return Object.getOwnPropertyDescriptor(i,u).enumerable})),t.push.apply(t,n)}return t}function fe(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?B(Object(t),!0).forEach(function(n){le(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):B(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function le(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var H=function(){var i=[];return{activateTrap:function(t){if(i.length>0){var n=i[i.length-1];n!==t&&n.pause()}var u=i.indexOf(t);u===-1||i.splice(u,1),i.push(t)},deactivateTrap:function(t){var n=i.indexOf(t);n!==-1&&i.splice(n,1),i.length>0&&i[i.length-1].unpause()}}}(),de=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},be=function(e){return e.key==="Escape"||e.key==="Esc"||e.keyCode===27},ve=function(e){return e.key==="Tab"||e.keyCode===9},U=function(e){return setTimeout(e,0)},L=function(e,t){var n=-1;return e.every(function(u,r){return t(u)?(n=r,!1):!0}),n},D=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),u=1;u<t;u++)n[u-1]=arguments[u];return typeof e=="function"?e.apply(void 0,n):e},K=function(e,t){var n=document,u=fe({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},t),r={containers:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},s,l=function(a,o,c){return a&&a[o]!==void 0?a[o]:u[c||o]},h=function(a){return r.containers.some(function(o){return o.contains(a)})},b=function(a){var o=u[a];if(!o)return null;var c=o;if(typeof o=="string"&&(c=n.querySelector(o),!c))throw new Error("`".concat(a,"` refers to no known node"));if(typeof o=="function"&&(c=o(),!c))throw new Error("`".concat(a,"` did not return a node"));return c},v=function(){var a;if(l({},"initialFocus")===!1)return!1;if(b("initialFocus")!==null)a=b("initialFocus");else if(h(n.activeElement))a=n.activeElement;else{var o=r.tabbableGroups[0],c=o&&o.firstTabbableNode;a=c||b("fallbackFocus")}if(!a)throw new Error("Your focus-trap needs to have at least one focusable element");return a},m=function(){if(r.tabbableGroups=r.containers.map(function(a){var o=W(a);if(o.length>0)return{container:a,firstTabbableNode:o[0],lastTabbableNode:o[o.length-1]}}).filter(function(a){return!!a}),r.tabbableGroups.length<=0&&!b("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},p=function f(a){if(a!==!1&&a!==n.activeElement){if(!a||!a.focus){f(v());return}a.focus({preventScroll:!!u.preventScroll}),r.mostRecentlyFocusedNode=a,de(a)&&a.select()}},E=function(a){var o=b("setReturnFocus");return o||a},y=function(a){if(!h(a.target)){if(D(u.clickOutsideDeactivates,a)){s.deactivate({returnFocus:u.returnFocusOnDeactivate&&!k(a.target)});return}D(u.allowOutsideClick,a)||a.preventDefault()}},w=function(a){var o=h(a.target);o||a.target instanceof Document?o&&(r.mostRecentlyFocusedNode=a.target):(a.stopImmediatePropagation(),p(r.mostRecentlyFocusedNode||v()))},Q=function(a){m();var o=null;if(r.tabbableGroups.length>0){var c=L(r.tabbableGroups,function(N){var S=N.container;return S.contains(a.target)});if(c<0)a.shiftKey?o=r.tabbableGroups[r.tabbableGroups.length-1].lastTabbableNode:o=r.tabbableGroups[0].firstTabbableNode;else if(a.shiftKey){var d=L(r.tabbableGroups,function(N){var S=N.firstTabbableNode;return a.target===S});if(d<0&&r.tabbableGroups[c].container===a.target&&(d=c),d>=0){var g=d===0?r.tabbableGroups.length-1:d-1,F=r.tabbableGroups[g];o=F.lastTabbableNode}}else{var T=L(r.tabbableGroups,function(N){var S=N.lastTabbableNode;return a.target===S});if(T<0&&r.tabbableGroups[c].container===a.target&&(T=c),T>=0){var X=T===r.tabbableGroups.length-1?0:T+1,J=r.tabbableGroups[X];o=J.firstTabbableNode}}}else o=b("fallbackFocus");o&&(a.preventDefault(),p(o))},R=function(a){if(be(a)&&D(u.escapeDeactivates)!==!1){a.preventDefault(),s.deactivate();return}if(ve(a)){Q(a);return}},x=function(a){D(u.clickOutsideDeactivates,a)||h(a.target)||D(u.allowOutsideClick,a)||(a.preventDefault(),a.stopImmediatePropagation())},I=function(){if(!!r.active)return H.activateTrap(s),r.delayInitialFocusTimer=u.delayInitialFocus?U(function(){p(v())}):p(v()),n.addEventListener("focusin",w,!0),n.addEventListener("mousedown",y,{capture:!0,passive:!1}),n.addEventListener("touchstart",y,{capture:!0,passive:!1}),n.addEventListener("click",x,{capture:!0,passive:!1}),n.addEventListener("keydown",R,{capture:!0,passive:!1}),s},P=function(){if(!!r.active)return n.removeEventListener("focusin",w,!0),n.removeEventListener("mousedown",y,!0),n.removeEventListener("touchstart",y,!0),n.removeEventListener("click",x,!0),n.removeEventListener("keydown",R,!0),s};return s={activate:function(a){if(r.active)return this;var o=l(a,"onActivate"),c=l(a,"onPostActivate"),d=l(a,"checkCanFocusTrap");d||m(),r.active=!0,r.paused=!1,r.nodeFocusedBeforeActivation=n.activeElement,o&&o();var g=function(){d&&m(),I(),c&&c()};return d?(d(r.containers.concat()).then(g,g),this):(g(),this)},deactivate:function(a){if(!r.active)return this;clearTimeout(r.delayInitialFocusTimer),r.delayInitialFocusTimer=void 0,P(),r.active=!1,r.paused=!1,H.deactivateTrap(s);var o=l(a,"onDeactivate"),c=l(a,"onPostDeactivate"),d=l(a,"checkCanReturnFocus");o&&o();var g=l(a,"returnFocus","returnFocusOnDeactivate"),F=function(){U(function(){g&&p(E(r.nodeFocusedBeforeActivation)),c&&c()})};return g&&d?(d(E(r.nodeFocusedBeforeActivation)).then(F,F),this):(F(),this)},pause:function(){return r.paused||!r.active?this:(r.paused=!0,P(),this)},unpause:function(){return!r.paused||!r.active?this:(r.paused=!1,m(),I(),this)},updateContainerElements:function(a){var o=[].concat(a).filter(Boolean);return r.containers=o.map(function(c){return typeof c=="string"?n.querySelector(c):c}),r.active&&m(),this}},s.updateContainerElements(e),s};function Y(i){let e,t;window.addEventListener("focusin",()=>{e=t,t=document.activeElement}),i.magic("focus",n=>{let u=n;return{__noscroll:!1,__wrapAround:!1,within(r){return u=r,this},withoutScrolling(){return this.__noscroll=!0,this},noscroll(){return this.__noscroll=!0,this},withWrapAround(){return this.__wrapAround=!0,this},wrap(){return this.withWrapAround()},focusable(r){return k(r)},previouslyFocused(){return e},lastFocused(){return e},focused(){return t},focusables(){return Array.isArray(u)?u:q(u,{displayCheck:"none"})},all(){return this.focusables()},isFirst(r){let s=this.all();return s[0]&&s[0].isSameNode(r)},isLast(r){let s=this.all();return s.length&&s.slice(-1)[0].isSameNode(r)},getFirst(){return this.all()[0]},getLast(){return this.all().slice(-1)[0]},getNext(){let r=this.all(),s=document.activeElement;if(r.indexOf(s)!==-1)return this.__wrapAround&&r.indexOf(s)===r.length-1?r[0]:r[r.indexOf(s)+1]},getPrevious(){let r=this.all(),s=document.activeElement;if(r.indexOf(s)!==-1)return this.__wrapAround&&r.indexOf(s)===0?r.slice(-1)[0]:r[r.indexOf(s)-1]},first(){this.focus(this.getFirst())},last(){this.focus(this.getLast())},next(){this.focus(this.getNext())},previous(){this.focus(this.getPrevious())},prev(){return this.previous()},focus(r){!r||setTimeout(()=>{r.hasAttribute("tabindex")||r.setAttribute("tabindex","0"),r.focus({preventScroll:this._noscroll})})}}}),i.directive("trap",i.skipDuringClone((n,{expression:u,modifiers:r},{effect:s,evaluateLater:l,cleanup:h})=>{let b=l(u),v=!1,m=K(n,{escapeDeactivates:!1,allowOutsideClick:!0,fallbackFocus:()=>n}),p=()=>{},E=()=>{},y=()=>{p(),p=()=>{},E(),E=()=>{},m.deactivate({returnFocus:!r.includes("noreturn")})};s(()=>b(w=>{v!==w&&(w&&!v&&setTimeout(()=>{r.includes("inert")&&(p=V(n)),r.includes("noscroll")&&(E=pe()),m.activate()}),!w&&v&&y(),v=!!w)})),h(y)},(n,{expression:u,modifiers:r},{evaluate:s})=>{r.includes("inert")&&s(u)&&V(n)}))}function V(i){let e=[];return z(i,t=>{let n=t.hasAttribute("aria-hidden");t.setAttribute("aria-hidden","true"),e.push(()=>n||t.removeAttribute("aria-hidden"))}),()=>{for(;e.length;)e.pop()()}}function z(i,e){i.isSameNode(document.body)||!i.parentNode||Array.from(i.parentNode.children).forEach(t=>{t.isSameNode(i)||e(t),z(i.parentNode,e)})}function pe(){let i=document.documentElement.style.overflow,e=document.documentElement.style.paddingRight,t=window.innerWidth-document.documentElement.clientWidth;return document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=`${t}px`,()=>{document.documentElement.style.overflow=i,document.documentElement.style.paddingRight=e}}document.addEventListener("alpine:init",()=>{window.Alpine.plugin(Y)});})();
+(()=>{var j=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],_=j.join(","),A=typeof Element=="undefined"?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,G=function(e,t,a){var u=Array.prototype.slice.apply(e.querySelectorAll(_));return t&&A.call(e,_)&&u.unshift(e),u=u.filter(a),u},Z=function(e){return e.contentEditable==="true"},M=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?Z(e)||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t},$=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},C=function(e){return e.tagName==="INPUT"},ee=function(e){return C(e)&&e.type==="hidden"},te=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(a){return a.tagName==="SUMMARY"});return t},re=function(e,t){for(var a=0;a<e.length;a++)if(e[a].checked&&e[a].form===t)return e[a]},ae=function(e){if(!e.name)return!0;var t=e.form||e.ownerDocument,a=function(l){return t.querySelectorAll('input[type="radio"][name="'+l+'"]')},u;if(typeof window!="undefined"&&typeof window.CSS!="undefined"&&typeof window.CSS.escape=="function")u=a(window.CSS.escape(e.name));else try{u=a(e.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var r=re(u,e.form);return!r||r===e},ne=function(e){return C(e)&&e.type==="radio"},ie=function(e){return ne(e)&&!ae(e)},ue=function(e,t){if(getComputedStyle(e).visibility==="hidden")return!0;var a=A.call(e,"details>summary:first-of-type"),u=a?e.parentElement:e;if(A.call(u,"details:not([open]) *"))return!0;if(!t||t==="full")for(;e;){if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}else if(t==="non-zero-area"){var r=e.getBoundingClientRect(),s=r.width,l=r.height;return s===0&&l===0}return!1},oe=function(e){if(C(e)||e.tagName==="SELECT"||e.tagName==="TEXTAREA"||e.tagName==="BUTTON")for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var a=0;a<t.children.length;a++){var u=t.children.item(a);if(u.tagName==="LEGEND")return!u.contains(e)}return!0}t=t.parentElement}return!1},O=function(e,t){return!(t.disabled||ee(t)||ue(t,e.displayCheck)||te(t)||oe(t))},se=function(e,t){return!(!O(e,t)||ie(t)||M(t)<0)},q=function(e,t){t=t||{};var a=[],u=[],r=G(e,t.includeContainer,se.bind(null,t));r.forEach(function(l,h){var b=M(l);b===0?a.push(l):u.push({documentOrder:h,tabIndex:b,node:l})});var s=u.sort($).map(function(l){return l.node}).concat(a);return s},W=function(e,t){t=t||{};var a=G(e,t.includeContainer,O.bind(null,t));return a};var ce=j.concat("iframe").join(","),k=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return A.call(e,ce)===!1?!1:O(t,e)};function B(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(i);e&&(a=a.filter(function(u){return Object.getOwnPropertyDescriptor(i,u).enumerable})),t.push.apply(t,a)}return t}function fe(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?B(Object(t),!0).forEach(function(a){le(i,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):B(Object(t)).forEach(function(a){Object.defineProperty(i,a,Object.getOwnPropertyDescriptor(t,a))})}return i}function le(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var H=function(){var i=[];return{activateTrap:function(t){if(i.length>0){var a=i[i.length-1];a!==t&&a.pause()}var u=i.indexOf(t);u===-1||i.splice(u,1),i.push(t)},deactivateTrap:function(t){var a=i.indexOf(t);a!==-1&&i.splice(a,1),i.length>0&&i[i.length-1].unpause()}}}(),de=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},be=function(e){return e.key==="Escape"||e.key==="Esc"||e.keyCode===27},ve=function(e){return e.key==="Tab"||e.keyCode===9},U=function(e){return setTimeout(e,0)},L=function(e,t){var a=-1;return e.every(function(u,r){return t(u)?(a=r,!1):!0}),a},D=function(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),u=1;u<t;u++)a[u-1]=arguments[u];return typeof e=="function"?e.apply(void 0,a):e},K=function(e,t){var a=document,u=fe({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},t),r={containers:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},s,l=function(n,o,c){return n&&n[o]!==void 0?n[o]:u[c||o]},h=function(n){return r.containers.some(function(o){return o.contains(n)})},b=function(n){var o=u[n];if(!o)return null;var c=o;if(typeof o=="string"&&(c=a.querySelector(o),!c))throw new Error("`".concat(n,"` refers to no known node"));if(typeof o=="function"&&(c=o(),!c))throw new Error("`".concat(n,"` did not return a node"));return c},v=function(){var n;if(l({},"initialFocus")===!1)return!1;if(b("initialFocus")!==null)n=b("initialFocus");else if(h(a.activeElement))n=a.activeElement;else{var o=r.tabbableGroups[0],c=o&&o.firstTabbableNode;n=c||b("fallbackFocus")}if(!n)throw new Error("Your focus-trap needs to have at least one focusable element");return n},m=function(){if(r.tabbableGroups=r.containers.map(function(n){var o=q(n);if(o.length>0)return{container:n,firstTabbableNode:o[0],lastTabbableNode:o[o.length-1]}}).filter(function(n){return!!n}),r.tabbableGroups.length<=0&&!b("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},p=function f(n){if(n!==!1&&n!==a.activeElement){if(!n||!n.focus){f(v());return}n.focus({preventScroll:!!u.preventScroll}),r.mostRecentlyFocusedNode=n,de(n)&&n.select()}},E=function(n){var o=b("setReturnFocus");return o||n},y=function(n){if(!h(n.target)){if(D(u.clickOutsideDeactivates,n)){s.deactivate({returnFocus:u.returnFocusOnDeactivate&&!k(n.target)});return}D(u.allowOutsideClick,n)||n.preventDefault()}},w=function(n){var o=h(n.target);o||n.target instanceof Document?o&&(r.mostRecentlyFocusedNode=n.target):(n.stopImmediatePropagation(),p(r.mostRecentlyFocusedNode||v()))},Q=function(n){m();var o=null;if(r.tabbableGroups.length>0){var c=L(r.tabbableGroups,function(S){var N=S.container;return N.contains(n.target)});if(c<0)n.shiftKey?o=r.tabbableGroups[r.tabbableGroups.length-1].lastTabbableNode:o=r.tabbableGroups[0].firstTabbableNode;else if(n.shiftKey){var d=L(r.tabbableGroups,function(S){var N=S.firstTabbableNode;return n.target===N});if(d<0&&r.tabbableGroups[c].container===n.target&&(d=c),d>=0){var g=d===0?r.tabbableGroups.length-1:d-1,F=r.tabbableGroups[g];o=F.lastTabbableNode}}else{var T=L(r.tabbableGroups,function(S){var N=S.lastTabbableNode;return n.target===N});if(T<0&&r.tabbableGroups[c].container===n.target&&(T=c),T>=0){var X=T===r.tabbableGroups.length-1?0:T+1,J=r.tabbableGroups[X];o=J.firstTabbableNode}}}else o=b("fallbackFocus");o&&(n.preventDefault(),p(o))},R=function(n){if(be(n)&&D(u.escapeDeactivates)!==!1){n.preventDefault(),s.deactivate();return}if(ve(n)){Q(n);return}},x=function(n){D(u.clickOutsideDeactivates,n)||h(n.target)||D(u.allowOutsideClick,n)||(n.preventDefault(),n.stopImmediatePropagation())},I=function(){if(!!r.active)return H.activateTrap(s),r.delayInitialFocusTimer=u.delayInitialFocus?U(function(){p(v())}):p(v()),a.addEventListener("focusin",w,!0),a.addEventListener("mousedown",y,{capture:!0,passive:!1}),a.addEventListener("touchstart",y,{capture:!0,passive:!1}),a.addEventListener("click",x,{capture:!0,passive:!1}),a.addEventListener("keydown",R,{capture:!0,passive:!1}),s},P=function(){if(!!r.active)return a.removeEventListener("focusin",w,!0),a.removeEventListener("mousedown",y,!0),a.removeEventListener("touchstart",y,!0),a.removeEventListener("click",x,!0),a.removeEventListener("keydown",R,!0),s};return s={activate:function(n){if(r.active)return this;var o=l(n,"onActivate"),c=l(n,"onPostActivate"),d=l(n,"checkCanFocusTrap");d||m(),r.active=!0,r.paused=!1,r.nodeFocusedBeforeActivation=a.activeElement,o&&o();var g=function(){d&&m(),I(),c&&c()};return d?(d(r.containers.concat()).then(g,g),this):(g(),this)},deactivate:function(n){if(!r.active)return this;clearTimeout(r.delayInitialFocusTimer),r.delayInitialFocusTimer=void 0,P(),r.active=!1,r.paused=!1,H.deactivateTrap(s);var o=l(n,"onDeactivate"),c=l(n,"onPostDeactivate"),d=l(n,"checkCanReturnFocus");o&&o();var g=l(n,"returnFocus","returnFocusOnDeactivate"),F=function(){U(function(){g&&p(E(r.nodeFocusedBeforeActivation)),c&&c()})};return g&&d?(d(E(r.nodeFocusedBeforeActivation)).then(F,F),this):(F(),this)},pause:function(){return r.paused||!r.active?this:(r.paused=!0,P(),this)},unpause:function(){return!r.paused||!r.active?this:(r.paused=!1,m(),I(),this)},updateContainerElements:function(n){var o=[].concat(n).filter(Boolean);return r.containers=o.map(function(c){return typeof c=="string"?a.querySelector(c):c}),r.active&&m(),this}},s.updateContainerElements(e),s};function Y(i){let e,t;window.addEventListener("focusin",()=>{e=t,t=document.activeElement}),i.magic("focus",a=>{let u=a;return{__noscroll:!1,__wrapAround:!1,within(r){return u=r,this},withoutScrolling(){return this.__noscroll=!0,this},noscroll(){return this.__noscroll=!0,this},withWrapAround(){return this.__wrapAround=!0,this},wrap(){return this.withWrapAround()},focusable(r){return k(r)},previouslyFocused(){return e},lastFocused(){return e},focused(){return t},focusables(){return Array.isArray(u)?u:W(u,{displayCheck:"none"})},all(){return this.focusables()},isFirst(r){let s=this.all();return s[0]&&s[0].isSameNode(r)},isLast(r){let s=this.all();return s.length&&s.slice(-1)[0].isSameNode(r)},getFirst(){return this.all()[0]},getLast(){return this.all().slice(-1)[0]},getNext(){let r=this.all(),s=document.activeElement;if(r.indexOf(s)!==-1)return this.__wrapAround&&r.indexOf(s)===r.length-1?r[0]:r[r.indexOf(s)+1]},getPrevious(){let r=this.all(),s=document.activeElement;if(r.indexOf(s)!==-1)return this.__wrapAround&&r.indexOf(s)===0?r.slice(-1)[0]:r[r.indexOf(s)-1]},first(){this.focus(this.getFirst())},last(){this.focus(this.getLast())},next(){this.focus(this.getNext())},previous(){this.focus(this.getPrevious())},prev(){return this.previous()},focus(r){!r||setTimeout(()=>{r.hasAttribute("tabindex")||r.setAttribute("tabindex","0"),r.focus({preventScroll:this._noscroll})})}}}),i.directive("trap",i.skipDuringClone((a,{expression:u,modifiers:r},{effect:s,evaluateLater:l,cleanup:h})=>{let b=l(u),v=!1,m=K(a,{escapeDeactivates:!1,allowOutsideClick:!0,fallbackFocus:()=>a,initialFocus:a.querySelector("[autofocus]")}),p=()=>{},E=()=>{},y=()=>{p(),p=()=>{},E(),E=()=>{},m.deactivate({returnFocus:!r.includes("noreturn")})};s(()=>b(w=>{v!==w&&(w&&!v&&setTimeout(()=>{r.includes("inert")&&(p=V(a)),r.includes("noscroll")&&(E=pe()),m.activate()}),!w&&v&&y(),v=!!w)})),h(y)},(a,{expression:u,modifiers:r},{evaluate:s})=>{r.includes("inert")&&s(u)&&V(a)}))}function V(i){let e=[];return z(i,t=>{let a=t.hasAttribute("aria-hidden");t.setAttribute("aria-hidden","true"),e.push(()=>a||t.removeAttribute("aria-hidden"))}),()=>{for(;e.length;)e.pop()()}}function z(i,e){i.isSameNode(document.body)||!i.parentNode||Array.from(i.parentNode.children).forEach(t=>{t.isSameNode(i)||e(t),z(i.parentNode,e)})}function pe(){let i=document.documentElement.style.overflow,e=document.documentElement.style.paddingRight,t=window.innerWidth-document.documentElement.clientWidth;return document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=`${t}px`,()=>{document.documentElement.style.overflow=i,document.documentElement.style.paddingRight=e}}document.addEventListener("alpine:init",()=>{window.Alpine.plugin(Y)});})();
/*!
* focus-trap 6.6.1
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
diff --git a/alpinejs/packages/focus/dist/module.cjs.js b/alpinejs/packages/focus/dist/module.cjs.js
index 83df455..ec3a3eb 100644
--- a/alpinejs/packages/focus/dist/module.cjs.js
+++ b/alpinejs/packages/focus/dist/module.cjs.js
@@ -169,7 +169,7 @@ var require_dist = __commonJS((exports2) => {
}
return true;
};
- var tabbable2 = function tabbable3(el, options) {
+ var tabbable = function tabbable2(el, options) {
options = options || {};
var regularTabbables = [];
var orderedTabbables = [];
@@ -220,7 +220,7 @@ var require_dist = __commonJS((exports2) => {
exports2.focusable = focusable2;
exports2.isFocusable = isFocusable2;
exports2.isTabbable = isTabbable;
- exports2.tabbable = tabbable2;
+ exports2.tabbable = tabbable;
});
// node_modules/focus-trap/dist/focus-trap.js
@@ -231,7 +231,7 @@ var require_focus_trap = __commonJS((exports2) => {
*/
"use strict";
Object.defineProperty(exports2, "__esModule", {value: true});
- var tabbable2 = require_dist();
+ var tabbable = require_dist();
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
@@ -399,7 +399,7 @@ var require_focus_trap = __commonJS((exports2) => {
};
var updateTabbableNodes = function updateTabbableNodes2() {
state.tabbableGroups = state.containers.map(function(container) {
- var tabbableNodes = tabbable2.tabbable(container);
+ var tabbableNodes = tabbable.tabbable(container);
if (tabbableNodes.length > 0) {
return {
container,
@@ -444,7 +444,7 @@ var require_focus_trap = __commonJS((exports2) => {
}
if (valueOrHandler(config.clickOutsideDeactivates, e)) {
trap.deactivate({
- returnFocus: config.returnFocusOnDeactivate && !tabbable2.isFocusable(e.target)
+ returnFocus: config.returnFocusOnDeactivate && !tabbable.isFocusable(e.target)
});
return;
}
@@ -802,7 +802,8 @@ function src_default(Alpine) {
let trap = (0, import_focus_trap.createFocusTrap)(el, {
escapeDeactivates: false,
allowOutsideClick: true,
- fallbackFocus: () => el
+ fallbackFocus: () => el,
+ initialFocus: el.querySelector("[autofocus]")
});
let undoInert = () => {
};
diff --git a/alpinejs/packages/focus/dist/module.esm.js b/alpinejs/packages/focus/dist/module.esm.js
index 703348d..7a59b91 100644
--- a/alpinejs/packages/focus/dist/module.esm.js
+++ b/alpinejs/packages/focus/dist/module.esm.js
@@ -740,7 +740,8 @@ function src_default(Alpine) {
let trap = createFocusTrap(el, {
escapeDeactivates: false,
allowOutsideClick: true,
- fallbackFocus: () => el
+ fallbackFocus: () => el,
+ initialFocus: el.querySelector("[autofocus]")
});
let undoInert = () => {
};
diff --git a/alpinejs/packages/focus/package.json b/alpinejs/packages/focus/package.json
index 048f617..476b983 100644
--- a/alpinejs/packages/focus/package.json
+++ b/alpinejs/packages/focus/package.json
@@ -1,6 +1,6 @@
{
"name": "@alpinejs/focus",
- "version": "3.10.2",
+ "version": "3.10.3",
"description": "Manage focus within a page",
"author": "Caleb Porzio",
"license": "MIT",
diff --git a/alpinejs/packages/focus/src/index.js b/alpinejs/packages/focus/src/index.js
index 240c1b9..01c8c07 100644
--- a/alpinejs/packages/focus/src/index.js
+++ b/alpinejs/packages/focus/src/index.js
@@ -1,5 +1,5 @@
import { createFocusTrap } from 'focus-trap'
-import { focusable, tabbable, isFocusable } from 'tabbable'
+import { focusable, isFocusable } from 'tabbable'
export default function (Alpine) {
let lastFocused
@@ -106,6 +106,7 @@ export default function (Alpine) {
escapeDeactivates: false,
allowOutsideClick: true,
fallbackFocus: () => el,
+ initialFocus: el.querySelector('[autofocus]')
})
let undoInert = () => {}
diff --git a/alpinejs/packages/intersect/package.json b/alpinejs/packages/intersect/package.json
index 3f13925..6e5aa3c 100644
--- a/alpinejs/packages/intersect/package.json
+++ b/alpinejs/packages/intersect/package.json
@@ -1,6 +1,6 @@
{
"name": "@alpinejs/intersect",
- "version": "3.10.2",
+ "version": "3.10.3",
"description": "Trigger JavaScript when an element enters the viewport",
"author": "Caleb Porzio",
"license": "MIT",
diff --git a/alpinejs/packages/mask/dist/cdn.js b/alpinejs/packages/mask/dist/cdn.js
index 5994a27..65785cf 100644
--- a/alpinejs/packages/mask/dist/cdn.js
+++ b/alpinejs/packages/mask/dist/cdn.js
@@ -29,6 +29,8 @@
function processInputValue(el2, shouldRestoreCursor = true) {
let input = el2.value;
let template = templateFn(input);
+ if (!template || template === "false")
+ return false;
if (lastInputValue.length - el2.value.length === 1) {
return lastInputValue = el2.value;
}
@@ -128,8 +130,8 @@
}
return output;
};
- let nothousands = input.replaceAll(thousands, "");
- let template = Array.from({length: nothousands.split(delimeter)[0].length}).fill("9").join("");
+ let strippedInput = input.replaceAll(new RegExp(`[^0-9\\${delimeter}]`, "g"), "");
+ let template = Array.from({length: strippedInput.split(delimeter)[0].length}).fill("9").join("");
template = addThousands(template, thousands);
if (input.includes(delimeter))
template += `${delimeter}99`;
diff --git a/alpinejs/packages/mask/dist/cdn.min.js b/alpinejs/packages/mask/dist/cdn.min.js
index 8d8541a..e9f052c 100644
--- a/alpinejs/packages/mask/dist/cdn.min.js
+++ b/alpinejs/packages/mask/dist/cdn.min.js
@@ -1 +1 @@
-(()=>{function b(i){i.directive("mask",(e,{value:t,expression:u},{effect:s,evaluateLater:f})=>{let n=()=>u,o="";if(["function","dynamic"].includes(t)){let r=f(u);s(()=>{n=a=>{let c;return i.dontAutoEvaluateFunctions(()=>{r(d=>{c=typeof d=="function"?d(a):d},{scope:{$input:a,$money:I.bind({el:e})}})}),c},l(e)})}else l(e);e.addEventListener("input",()=>l(e)),e.addEventListener("blur",()=>l(e,!1));function l(r,a=!0){let c=r.value,d=n(c);if(o.length-r.value.length==1)return o=r.value;let h=()=>{o=r.value=p(c,d)};a?k(r,d,()=>{h()}):h()}function p(r,a){if(r==="")return"";let c=g(a,r);return v(a,c)}})}function k(i,e,t){let u=i.selectionStart,s=i.value;t();let f=s.slice(0,u),n=v(e,g(e,f)).length;i.setSelectionRange(n,n)}function g(i,e){let t=e,u="",s={"9":/[0-9]/,a:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},f="";for(let n=0;n<i.length;n++){if(["9","a","*"].includes(i[n])){f+=i[n];continue}for(let o=0;o<t.length;o++)if(t[o]===i[n]){t=t.slice(0,o)+t.slice(o+1);break}}for(let n=0;n<f.length;n++){let o=!1;for(let l=0;l<t.length;l++)if(s[f[n]].test(t[l])){u+=t[l],t=t.slice(0,l)+t.slice(l+1),o=!0;break}if(!o)break}return u}function v(i,e){let t=Array.from(e),u="";for(let s=0;s<i.length;s++){if(!["9","a","*"].includes(i[s])){u+=i[s];continue}if(t.length===0)break;u+=t.shift()}return u}function I(i,e=".",t){t=e===","&&t===void 0?".":",";let u=(n,o)=>{let l="",p=0;for(let r=n.length-1;r>=0;r--)n[r]!==o&&(p===3?(l=n[r]+o+l,p=0):l=n[r]+l,p++);return l},s=i.replaceAll(t,""),f=Array.from({length:s.split(e)[0].length}).fill("9").join("");return f=u(f,t),i.includes(e)&&(f+=`${e}99`),queueMicrotask(()=>{this.el.value.endsWith(e)||this.el.value[this.el.selectionStart-1]===e&&this.el.setSelectionRange(this.el.selectionStart-1,this.el.selectionStart-1)}),f}document.addEventListener("alpine:init",()=>{window.Alpine.plugin(b)});})();
+(()=>{function b(i){i.directive("mask",(t,{value:e,expression:o},{effect:s,evaluateLater:f})=>{let n=()=>o,u="";if(["function","dynamic"].includes(e)){let r=f(o);s(()=>{n=c=>{let p;return i.dontAutoEvaluateFunctions(()=>{r(a=>{p=typeof a=="function"?a(c):a},{scope:{$input:c,$money:k.bind({el:t})}})}),p},l(t)})}else l(t);t.addEventListener("input",()=>l(t)),t.addEventListener("blur",()=>l(t,!1));function l(r,c=!0){let p=r.value,a=n(p);if(!a||a==="false")return!1;if(u.length-r.value.length==1)return u=r.value;let g=()=>{u=r.value=d(p,a)};c?I(r,a,()=>{g()}):g()}function d(r,c){if(r==="")return"";let p=h(c,r);return v(c,p)}})}function I(i,t,e){let o=i.selectionStart,s=i.value;e();let f=s.slice(0,o),n=v(t,h(t,f)).length;i.setSelectionRange(n,n)}function h(i,t){let e=t,o="",s={"9":/[0-9]/,a:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},f="";for(let n=0;n<i.length;n++){if(["9","a","*"].includes(i[n])){f+=i[n];continue}for(let u=0;u<e.length;u++)if(e[u]===i[n]){e=e.slice(0,u)+e.slice(u+1);break}}for(let n=0;n<f.length;n++){let u=!1;for(let l=0;l<e.length;l++)if(s[f[n]].test(e[l])){o+=e[l],e=e.slice(0,l)+e.slice(l+1),u=!0;break}if(!u)break}return o}function v(i,t){let e=Array.from(t),o="";for(let s=0;s<i.length;s++){if(!["9","a","*"].includes(i[s])){o+=i[s];continue}if(e.length===0)break;o+=e.shift()}return o}function k(i,t=".",e){e=t===","&&e===void 0?".":",";let o=(n,u)=>{let l="",d=0;for(let r=n.length-1;r>=0;r--)n[r]!==u&&(d===3?(l=n[r]+u+l,d=0):l=n[r]+l,d++);return l},s=i.replaceAll(new RegExp(`[^0-9\\${t}]`,"g"),""),f=Array.from({length:s.split(t)[0].length}).fill("9").join("");return f=o(f,e),i.includes(t)&&(f+=`${t}99`),queueMicrotask(()=>{this.el.value.endsWith(t)||this.el.value[this.el.selectionStart-1]===t&&this.el.setSelectionRange(this.el.selectionStart-1,this.el.selectionStart-1)}),f}document.addEventListener("alpine:init",()=>{window.Alpine.plugin(b)});})();
diff --git a/alpinejs/packages/mask/dist/module.cjs.js b/alpinejs/packages/mask/dist/module.cjs.js
index 9b67020..c8e14f4 100644
--- a/alpinejs/packages/mask/dist/module.cjs.js
+++ b/alpinejs/packages/mask/dist/module.cjs.js
@@ -42,6 +42,8 @@ function src_default(Alpine) {
function processInputValue(el2, shouldRestoreCursor = true) {
let input = el2.value;
let template = templateFn(input);
+ if (!template || template === "false")
+ return false;
if (lastInputValue.length - el2.value.length === 1) {
return lastInputValue = el2.value;
}
@@ -141,8 +143,8 @@ function formatMoney(input, delimeter = ".", thousands) {
}
return output;
};
- let nothousands = input.replaceAll(thousands, "");
- let template = Array.from({length: nothousands.split(delimeter)[0].length}).fill("9").join("");
+ let strippedInput = input.replaceAll(new RegExp(`[^0-9\\${delimeter}]`, "g"), "");
+ let template = Array.from({length: strippedInput.split(delimeter)[0].length}).fill("9").join("");
template = addThousands(template, thousands);
if (input.includes(delimeter))
template += `${delimeter}99`;
diff --git a/alpinejs/packages/mask/dist/module.esm.js b/alpinejs/packages/mask/dist/module.esm.js
index 95e2274..f7fc100 100644
--- a/alpinejs/packages/mask/dist/module.esm.js
+++ b/alpinejs/packages/mask/dist/module.esm.js
@@ -28,6 +28,8 @@ function src_default(Alpine) {
function processInputValue(el2, shouldRestoreCursor = true) {
let input = el2.value;
let template = templateFn(input);
+ if (!template || template === "false")
+ return false;
if (lastInputValue.length - el2.value.length === 1) {
return lastInputValue = el2.value;
}
@@ -127,8 +129,8 @@ function formatMoney(input, delimeter = ".", thousands) {
}
return output;
};
- let nothousands = input.replaceAll(thousands, "");
- let template = Array.from({length: nothousands.split(delimeter)[0].length}).fill("9").join("");
+ let strippedInput = input.replaceAll(new RegExp(`[^0-9\\${delimeter}]`, "g"), "");
+ let template = Array.from({length: strippedInput.split(delimeter)[0].length}).fill("9").join("");
template = addThousands(template, thousands);
if (input.includes(delimeter))
template += `${delimeter}99`;
diff --git a/alpinejs/packages/mask/package.json b/alpinejs/packages/mask/package.json
index 9da2bbb..9a1b7f9 100644
--- a/alpinejs/packages/mask/package.json
+++ b/alpinejs/packages/mask/package.json
@@ -1,6 +1,6 @@
{
"name": "@alpinejs/mask",
- "version": "3.10.2",
+ "version": "3.10.3",
"description": "An Alpine plugin for input masking",
"author": "Caleb Porzio",
"license": "MIT",
diff --git a/alpinejs/packages/mask/src/index.js b/alpinejs/packages/mask/src/index.js
index ec8c5e5..b73a258 100644
--- a/alpinejs/packages/mask/src/index.js
+++ b/alpinejs/packages/mask/src/index.js
@@ -48,6 +48,9 @@ export default function (Alpine) {
let template = templateFn(input)
+ // If a template value is `falsy`, then don't process the input value
+ if(!template || template === 'false') return false
+
// If they hit backspace, don't process input.
if (lastInputValue.length - el.value.length === 1) {
return lastInputValue = el.value
@@ -183,8 +186,8 @@ function formatMoney(input, delimeter = '.', thousands) {
return output
}
- let nothousands = input.replaceAll(thousands, '')
- let template = Array.from({ length: nothousands.split(delimeter)[0].length }).fill('9').join('')
+ let strippedInput = input.replaceAll(new RegExp(`[^0-9\\${delimeter}]`, 'g'), '')
+ let template = Array.from({ length: strippedInput.split(delimeter)[0].length }).fill('9').join('')
template = addThousands(template, thousands)
diff --git a/alpinejs/packages/morph/dist/cdn.js b/alpinejs/packages/morph/dist/cdn.js
index 868db84..3971815 100644
--- a/alpinejs/packages/morph/dist/cdn.js
+++ b/alpinejs/packages/morph/dist/cdn.js
@@ -55,7 +55,9 @@
return new DomManager(el);
}
function createElement(html) {
- return document.createRange().createContextualFragment(html).firstElementChild;
+ const template = document.createElement("template");
+ template.innerHTML = html;
+ return template.content.firstElementChild;
}
function textOrComment(el) {
return el.nodeType === 3 || el.nodeType === 8;
diff --git a/alpinejs/packages/morph/dist/cdn.min.js b/alpinejs/packages/morph/dist/cdn.min.js
index 82a0ac9..54a4944 100644
--- a/alpinejs/packages/morph/dist/cdn.min.js
+++ b/alpinejs/packages/morph/dist/cdn.min.js
@@ -1,2 +1,2 @@
-(()=>{var D=class{el=void 0;constructor(r){this.el=r}traversals={first:"firstElementChild",next:"nextElementSibling",parent:"parentElement"};nodes(){return this.traversals={first:"firstChild",next:"nextSibling",parent:"parentNode"},this}first(){return this.teleportTo(this.el[this.traversals.first])}next(){return this.teleportTo(this.teleportBack(this.el[this.traversals.next]))}before(r){return this.el[this.traversals.parent].insertBefore(r,this.el),r}replace(r){return this.el[this.traversals.parent].replaceChild(r,this.el),r}append(r){return this.el.appendChild(r),r}teleportTo(r){return r&&(r._x_teleport?r._x_teleport:r)}teleportBack(r){return r&&(r._x_teleportBack?r._x_teleportBack:r)}};function o(a){return new D(a)}function R(a){return document.createRange().createContextualFragment(a).firstElementChild}function j(a){return a.nodeType===3||a.nodeType===8}var H=()=>{},L=()=>{};async function _(a,r,v){let A,w,E,K,O,b,N,S,g,k,B;function d(e){if(!!B)return L((e||"").replace(`
-`,"\\n"),A,w),new Promise(t=>H=()=>t())}function q(e={}){let t=c=>c.getAttribute("key"),n=()=>{};O=e.updating||n,b=e.updated||n,N=e.removing||n,S=e.removed||n,g=e.adding||n,k=e.added||n,E=e.key||t,K=e.lookahead||!1,B=e.debug||!1}async function M(e,t){if(z(e,t)){let c=G(e,t);return await d("Swap elements"),c}let n=!1;if(!y(O,e,t,()=>n=!0)){if(window.Alpine&&W(e,t,()=>n=!0),j(t)){await P(e,t),b(e,t);return}n||await I(e,t),b(e,t),await J(e,t)}}function z(e,t){return e.nodeType!=t.nodeType||e.nodeName!=t.nodeName||x(e)!=x(t)}function G(e,t){if(y(N,e))return;let n=t.cloneNode(!0);y(g,n)||(o(e).replace(n),S(e),k(n))}async function P(e,t){let n=t.nodeValue;e.nodeValue!==n&&(e.nodeValue=n,await d("Change text node to: "+n))}async function I(e,t){if(e._x_isShown&&!t._x_isShown||!e._x_isShown&&t._x_isShown)return;let n=Array.from(e.attributes),c=Array.from(t.attributes);for(let h=n.length-1;h>=0;h--){let p=n[h].name;t.hasAttribute(p)||(e.removeAttribute(p),await d("Remove attribute"))}for(let h=c.length-1;h>=0;h--){let p=c[h].name,l=c[h].value;e.getAttribute(p)!==l&&(e.setAttribute(p,l),await d(`Set [${p}] attribute to: "${l}"`))}}async function J(e,t){let n=e.childNodes,c=t.childNodes,h=V(c),p=V(n),l=o(t).nodes().first(),i=o(e).nodes().first(),m={};for(;l;){let u=x(l),f=x(i);if(!i)if(u&&m[u]){let s=m[u];o(e).append(s),i=s,await d("Add element (from key)")}else{let s=Q(l,e)||{};await d("Add element: "+(s.outerHTML||s.nodeValue)),l=o(l).nodes().next();continue}if(K){let s=o(l).next(),F=!1;for(;!F&&s;)i.isEqualNode(s)&&(F=!0,i=T(l,i),f=x(i),await d("Move element (lookahead)")),s=o(s).next()}if(u!==f){if(!u&&f){m[f]=i,i=T(l,i),m[f].remove(),i=o(i).nodes().next(),l=o(l).nodes().next(),await d('No "to" key');continue}if(u&&!f&&p[u]&&(i=o(i).replace(p[u]),await d('No "from" key')),u&&f){m[f]=i;let s=p[u];if(s)i=o(i).replace(s),await d('Move "from" key');else{m[f]=i,i=T(l,i),m[f].remove(),i=o(i).next(),l=o(l).next(),await d("Swap elements with keys");continue}}}let U=i&&o(i).nodes().next();await M(i,l),l=l&&o(l).nodes().next(),i=U}let C=[];for(;i;)y(N,i)||C.push(i),i=o(i).nodes().next();for(;C.length;){let u=C.shift();u.remove(),await d("remove el"),S(u)}}function x(e){return e&&e.nodeType===1&&E(e)}function V(e){let t={};return e.forEach(n=>{let c=x(n);c&&(t[c]=n)}),t}function Q(e,t){if(!y(g,e)){let n=e.cloneNode(!0);return o(t).append(n),k(n),n}return null}function T(e,t){if(!y(g,e)){let n=e.cloneNode(!0);return o(t).before(n),k(n),n}return t}return q(v),A=a,w=R(r),window.Alpine&&window.Alpine.closestDataStack&&!a._x_dataStack&&(w._x_dataStack=window.Alpine.closestDataStack(a),w._x_dataStack&&window.Alpine.clone(a,w)),await d(),await M(a,w),A=void 0,w=void 0,a}_.step=()=>H();_.log=a=>{L=a};function y(a,...r){let v=!1;return a(...r,()=>v=!0),v}function W(a,r,v){a.nodeType===1&&a._x_dataStack&&window.Alpine.clone(a,r)}function $(a){a.morph=_}document.addEventListener("alpine:init",()=>{window.Alpine.plugin($)});})();
+(()=>{var F=class{el=void 0;constructor(i){this.el=i}traversals={first:"firstElementChild",next:"nextElementSibling",parent:"parentElement"};nodes(){return this.traversals={first:"firstChild",next:"nextSibling",parent:"parentNode"},this}first(){return this.teleportTo(this.el[this.traversals.first])}next(){return this.teleportTo(this.teleportBack(this.el[this.traversals.next]))}before(i){return this.el[this.traversals.parent].insertBefore(i,this.el),i}replace(i){return this.el[this.traversals.parent].replaceChild(i,this.el),i}append(i){return this.el.appendChild(i),i}teleportTo(i){return i&&(i._x_teleport?i._x_teleport:i)}teleportBack(i){return i&&(i._x_teleportBack?i._x_teleportBack:i)}};function o(a){return new F(a)}function H(a){let i=document.createElement("template");return i.innerHTML=a,i.content.firstElementChild}function L(a){return a.nodeType===3||a.nodeType===8}var j=()=>{},R=()=>{};async function g(a,i,v){let A,m,C,K,O,b,N,S,k,_,B;function d(e){if(!!B)return R((e||"").replace(`
+`,"\\n"),A,m),new Promise(t=>j=()=>t())}function q(e={}){let t=p=>p.getAttribute("key"),n=()=>{};O=e.updating||n,b=e.updated||n,N=e.removing||n,S=e.removed||n,k=e.adding||n,_=e.added||n,C=e.key||t,K=e.lookahead||!1,B=e.debug||!1}async function M(e,t){if(z(e,t)){let p=G(e,t);return await d("Swap elements"),p}let n=!1;if(!y(O,e,t,()=>n=!0)){if(window.Alpine&&W(e,t,()=>n=!0),L(t)){await P(e,t),b(e,t);return}n||await I(e,t),b(e,t),await J(e,t)}}function z(e,t){return e.nodeType!=t.nodeType||e.nodeName!=t.nodeName||x(e)!=x(t)}function G(e,t){if(y(N,e))return;let n=t.cloneNode(!0);y(k,n)||(o(e).replace(n),S(e),_(n))}async function P(e,t){let n=t.nodeValue;e.nodeValue!==n&&(e.nodeValue=n,await d("Change text node to: "+n))}async function I(e,t){if(e._x_isShown&&!t._x_isShown||!e._x_isShown&&t._x_isShown)return;let n=Array.from(e.attributes),p=Array.from(t.attributes);for(let h=n.length-1;h>=0;h--){let c=n[h].name;t.hasAttribute(c)||(e.removeAttribute(c),await d("Remove attribute"))}for(let h=p.length-1;h>=0;h--){let c=p[h].name,l=p[h].value;e.getAttribute(c)!==l&&(e.setAttribute(c,l),await d(`Set [${c}] attribute to: "${l}"`))}}async function J(e,t){let n=e.childNodes,p=t.childNodes,h=V(p),c=V(n),l=o(t).nodes().first(),r=o(e).nodes().first(),w={};for(;l;){let u=x(l),f=x(r);if(!r)if(u&&w[u]){let s=w[u];o(e).append(s),r=s,await d("Add element (from key)")}else{let s=Q(l,e)||{};await d("Add element: "+(s.outerHTML||s.nodeValue)),l=o(l).nodes().next();continue}if(K){let s=o(l).next(),D=!1;for(;!D&&s;)r.isEqualNode(s)&&(D=!0,r=T(l,r),f=x(r),await d("Move element (lookahead)")),s=o(s).next()}if(u!==f){if(!u&&f){w[f]=r,r=T(l,r),w[f].remove(),r=o(r).nodes().next(),l=o(l).nodes().next(),await d('No "to" key');continue}if(u&&!f&&c[u]&&(r=o(r).replace(c[u]),await d('No "from" key')),u&&f){w[f]=r;let s=c[u];if(s)r=o(r).replace(s),await d('Move "from" key');else{w[f]=r,r=T(l,r),w[f].remove(),r=o(r).next(),l=o(l).next(),await d("Swap elements with keys");continue}}}let U=r&&o(r).nodes().next();await M(r,l),l=l&&o(l).nodes().next(),r=U}let E=[];for(;r;)y(N,r)||E.push(r),r=o(r).nodes().next();for(;E.length;){let u=E.shift();u.remove(),await d("remove el"),S(u)}}function x(e){return e&&e.nodeType===1&&C(e)}function V(e){let t={};return e.forEach(n=>{let p=x(n);p&&(t[p]=n)}),t}function Q(e,t){if(!y(k,e)){let n=e.cloneNode(!0);return o(t).append(n),_(n),n}return null}function T(e,t){if(!y(k,e)){let n=e.cloneNode(!0);return o(t).before(n),_(n),n}return t}return q(v),A=a,m=H(i),window.Alpine&&window.Alpine.closestDataStack&&!a._x_dataStack&&(m._x_dataStack=window.Alpine.closestDataStack(a),m._x_dataStack&&window.Alpine.clone(a,m)),await d(),await M(a,m),A=void 0,m=void 0,a}g.step=()=>j();g.log=a=>{R=a};function y(a,...i){let v=!1;return a(...i,()=>v=!0),v}function W(a,i,v){a.nodeType===1&&a._x_dataStack&&window.Alpine.clone(a,i)}function $(a){a.morph=g}document.addEventListener("alpine:init",()=>{window.Alpine.plugin($)});})();
diff --git a/alpinejs/packages/morph/dist/module.cjs.js b/alpinejs/packages/morph/dist/module.cjs.js
index 5bf0fcf..98dc391 100644
--- a/alpinejs/packages/morph/dist/module.cjs.js
+++ b/alpinejs/packages/morph/dist/module.cjs.js
@@ -75,7 +75,9 @@ function dom(el) {
return new DomManager(el);
}
function createElement(html) {
- return document.createRange().createContextualFragment(html).firstElementChild;
+ const template = document.createElement("template");
+ template.innerHTML = html;
+ return template.content.firstElementChild;
}
function textOrComment(el) {
return el.nodeType === 3 || el.nodeType === 8;
diff --git a/alpinejs/packages/morph/dist/module.esm.js b/alpinejs/packages/morph/dist/module.esm.js
index cd6dac5..dfbdfcb 100644
--- a/alpinejs/packages/morph/dist/module.esm.js
+++ b/alpinejs/packages/morph/dist/module.esm.js
@@ -54,7 +54,9 @@ function dom(el) {
return new DomManager(el);
}
function createElement(html) {
- return document.createRange().createContextualFragment(html).firstElementChild;
+ const template = document.createElement("template");
+ template.innerHTML = html;
+ return template.content.firstElementChild;
}
function textOrComment(el) {
return el.nodeType === 3 || el.nodeType === 8;
diff --git a/alpinejs/packages/morph/package.json b/alpinejs/packages/morph/package.json
index 2370fe8..ed63cd9 100644
--- a/alpinejs/packages/morph/package.json
+++ b/alpinejs/packages/morph/package.json
@@ -1,6 +1,6 @@
{
"name": "@alpinejs/morph",
- "version": "3.10.2",
+ "version": "3.10.3",
"description": "Diff and patch a block of HTML on a page with an HTML template",
"author": "Caleb Porzio",
"license": "MIT",
diff --git a/alpinejs/packages/morph/src/dom.js b/alpinejs/packages/morph/src/dom.js
index 1e74fe7..0511dcc 100644
--- a/alpinejs/packages/morph/src/dom.js
+++ b/alpinejs/packages/morph/src/dom.js
@@ -57,7 +57,9 @@ export function dom(el) {
}
export function createElement(html) {
- return document.createRange().createContextualFragment(html).firstElementChild
+ const template = document.createElement('template')
+ template.innerHTML = html
+ return template.content.firstElementChild
}
export function textOrComment(el) {
diff --git a/alpinejs/packages/persist/package.json b/alpinejs/packages/persist/package.json
index 72894b7..0ce3264 100644
--- a/alpinejs/packages/persist/package.json
+++ b/alpinejs/packages/persist/package.json
@@ -1,6 +1,6 @@
{
"name": "@alpinejs/persist",
- "version": "3.10.2",
+ "version": "3.10.3",
"description": "Persist Alpine data across page loads",
"author": "Caleb Porzio",
"license": "MIT",
diff --git a/alpinejs/packages/portal/builds/cdn.js b/alpinejs/packages/portal/builds/cdn.js
deleted file mode 100644
index e3529e7..0000000
--- a/alpinejs/packages/portal/builds/cdn.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import portal from '../src/index.js'
-
-document.addEventListener('alpine:init', () => {
- window.Alpine.plugin(portal)
-})
diff --git a/alpinejs/packages/portal/builds/module.js b/alpinejs/packages/portal/builds/module.js
deleted file mode 100644
index bc39614..0000000
--- a/alpinejs/packages/portal/builds/module.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import portal from './../src/index.js'
-
-export default portal
diff --git a/alpinejs/packages/portal/src/index.js b/alpinejs/packages/portal/src/index.js
deleted file mode 100644
index fd45bad..0000000
--- a/alpinejs/packages/portal/src/index.js
+++ /dev/null
@@ -1,62 +0,0 @@
-export default function (Alpine) {
- let portals = new MapSet
-
- Alpine.directive('portal', (el, { expression }, { effect, cleanup }) => {
- let clone = el.content.cloneNode(true).firstElementChild
- // Add reference to element on <template x-portal, and visa versa.
- el._x_portal = clone
- clone._x_portal_back = el
-
- let init = (target) => {
- // Forward event listeners:
- if (el._x_forwardEvents) {
- el._x_forwardEvents.forEach(eventName => {
- clone.addEventListener(eventName, e => {
- e.stopPropagation()
-
- el.dispatchEvent(new e.constructor(e.type, e))
- })
- })
- }
-
- Alpine.addScopeToNode(clone, {}, el)
-
- Alpine.mutateDom(() => {
- target.before(clone)
-
- Alpine.initTree(clone)
- })
-
- cleanup(() => {
- clone.remove()
-
- portals.delete(expression, init)
- })
- }
-
- portals.add(expression, init)
- })
-
- Alpine.addInitSelector(() => `[${Alpine.prefixed('portal-target')}]`)
- Alpine.directive('portal-target', (el, { expression }) => {
- portals.each(expression, initPortal => initPortal(el))
- })
-}
-
-class MapSet {
- map = new Map
-
- get(name) {
- if (! this.map.has(name)) this.map.set(name, new Set)
-
- return this.map.get(name)
- }
-
- add(name, value) { this.get(name).add(value) }
-
- each(name, callback) { this.map.get(name).forEach(callback) }
-
- delete(name, value) {
- this.map.get(name).delete(value)
- }
-}
diff --git a/alpinejs/packages/ui/builds/cdn.js b/alpinejs/packages/ui/builds/cdn.js
new file mode 100644
index 0000000..855256e
--- /dev/null
+++ b/alpinejs/packages/ui/builds/cdn.js
@@ -0,0 +1,5 @@
+import ui from '../src/index.js'
+
+document.addEventListener('alpine:init', () => {
+ window.Alpine.plugin(ui)
+})
diff --git a/alpinejs/packages/ui/builds/module.js b/alpinejs/packages/ui/builds/module.js
new file mode 100644
index 0000000..cd55f95
--- /dev/null
+++ b/alpinejs/packages/ui/builds/module.js
@@ -0,0 +1,3 @@
+import ui from '../src/index.js'
+
+export default ui
diff --git a/alpinejs/packages/ui/dist/cdn.js b/alpinejs/packages/ui/dist/cdn.js
new file mode 100644
index 0000000..856f363
--- /dev/null
+++ b/alpinejs/packages/ui/dist/cdn.js
@@ -0,0 +1,132 @@
+(() => {
+ // packages/ui/src/dialog.js
+ function dialog_default(Alpine) {
+ Alpine.directive("dialog", (el, directive) => {
+ if (directive.value === "overlay")
+ handleOverlay(el, Alpine);
+ else if (directive.value === "panel")
+ handlePanel(el, Alpine);
+ else if (directive.value === "title")
+ handleTitle(el, Alpine);
+ else if (directive.value === "description")
+ handleDescription(el, Alpine);
+ else
+ handleRoot(el, Alpine);
+ });
+ Alpine.magic("dialog", (el) => {
+ let $data = Alpine.$data(el);
+ return {
+ get open() {
+ return $data.__isOpen;
+ },
+ close() {
+ $data.__close();
+ }
+ };
+ });
+ }
+ function handleRoot(el, Alpine) {
+ Alpine.bind(el, {
+ "x-data"() {
+ return {
+ init() {
+ Alpine.bound(el, "open") !== void 0 && Alpine.effect(() => {
+ this.__isOpenState = Alpine.bound(el, "open");
+ });
+ if (Alpine.bound(el, "initial-focus") !== void 0)
+ this.$watch("__isOpenState", () => {
+ if (!this.__isOpenState)
+ return;
+ setTimeout(() => {
+ Alpine.bound(el, "initial-focus").focus();
+ }, 0);
+ });
+ },
+ __isOpenState: false,
+ __close() {
+ if (Alpine.bound(el, "open"))
+ this.$dispatch("close");
+ else
+ this.__isOpenState = false;
+ },
+ get __isOpen() {
+ return Alpine.bound(el, "static", this.__isOpenState);
+ }
+ };
+ },
+ "x-modelable": "__isOpenState",
+ "x-id"() {
+ return ["alpine-dialog-title", "alpine-dialog-description"];
+ },
+ "x-show"() {
+ return this.__isOpen;
+ },
+ "x-trap.inert.noscroll"() {
+ return this.__isOpen;
+ },
+ "@keydown.escape"() {
+ this.__close();
+ },
+ ":aria-labelledby"() {
+ return this.$id("alpine-dialog-title");
+ },
+ ":aria-describedby"() {
+ return this.$id("alpine-dialog-description");
+ },
+ role: "dialog",
+ "aria-modal": "true"
+ });
+ }
+ function handleOverlay(el, Alpine) {
+ Alpine.bind(el, {
+ "x-init"() {
+ if (this.$data.__isOpen === void 0)
+ console.warn('"x-dialog:overlay" is missing a parent element with "x-dialog".');
+ },
+ "x-show"() {
+ return this.__isOpen;
+ },
+ "@click.prevent.stop"() {
+ this.$data.__close();
+ }
+ });
+ }
+ function handlePanel(el, Alpine) {
+ Alpine.bind(el, {
+ "@click.outside"() {
+ this.$data.__close();
+ },
+ "x-show"() {
+ return this.$data.__isOpen;
+ }
+ });
+ }
+ function handleTitle(el, Alpine) {
+ Alpine.bind(el, {
+ "x-init"() {
+ if (this.$data.__isOpen === void 0)
+ console.warn('"x-dialog:title" is missing a parent element with "x-dialog".');
+ },
+ ":id"() {
+ return this.$id("alpine-dialog-title");
+ }
+ });
+ }
+ function handleDescription(el, Alpine) {
+ Alpine.bind(el, {
+ ":id"() {
+ return this.$id("alpine-dialog-description");
+ }
+ });
+ }
+
+ // packages/ui/src/index.js
+ function src_default(Alpine) {
+ dialog_default(Alpine);
+ }
+
+ // packages/ui/builds/cdn.js
+ document.addEventListener("alpine:init", () => {
+ window.Alpine.plugin(src_default);
+ });
+})();
diff --git a/alpinejs/packages/ui/dist/cdn.min.js b/alpinejs/packages/ui/dist/cdn.min.js
new file mode 100644
index 0000000..3b3f4c4
--- /dev/null
+++ b/alpinejs/packages/ui/dist/cdn.min.js
@@ -0,0 +1 @@
+(()=>{function n(i){i.directive("dialog",(t,e)=>{e.value==="overlay"?o(t,i):e.value==="panel"?d(t,i):e.value==="title"?r(t,i):e.value==="description"?l(t,i):s(t,i)}),i.magic("dialog",t=>{let e=i.$data(t);return{get open(){return e.__isOpen},close(){e.__close()}}})}function s(i,t){t.bind(i,{"x-data"(){return{init(){t.bound(i,"open")!==void 0&&t.effect(()=>{this.__isOpenState=t.bound(i,"open")}),t.bound(i,"initial-focus")!==void 0&&this.$watch("__isOpenState",()=>{!this.__isOpenState||setTimeout(()=>{t.bound(i,"initial-focus").focus()},0)})},__isOpenState:!1,__close(){t.bound(i,"open")?this.$dispatch("close"):this.__isOpenState=!1},get __isOpen(){return t.bound(i,"static",this.__isOpenState)}}},"x-modelable":"__isOpenState","x-id"(){return["alpine-dialog-title","alpine-dialog-description"]},"x-show"(){return this.__isOpen},"x-trap.inert.noscroll"(){return this.__isOpen},"@keydown.escape"(){this.__close()},":aria-labelledby"(){return this.$id("alpine-dialog-title")},":aria-describedby"(){return this.$id("alpine-dialog-description")},role:"dialog","aria-modal":"true"})}function o(i,t){t.bind(i,{"x-init"(){this.$data.__isOpen===void 0&&console.warn('"x-dialog:overlay" is missing a parent element with "x-dialog".')},"x-show"(){return this.__isOpen},"@click.prevent.stop"(){this.$data.__close()}})}function d(i,t){t.bind(i,{"@click.outside"(){this.$data.__close()},"x-show"(){return this.$data.__isOpen}})}function r(i,t){t.bind(i,{"x-init"(){this.$data.__isOpen===void 0&&console.warn('"x-dialog:title" is missing a parent element with "x-dialog".')},":id"(){return this.$id("alpine-dialog-title")}})}function l(i,t){t.bind(i,{":id"(){return this.$id("alpine-dialog-description")}})}function a(i){n(i)}document.addEventListener("alpine:init",()=>{window.Alpine.plugin(a)});})();
diff --git a/alpinejs/packages/ui/dist/module.cjs.js b/alpinejs/packages/ui/dist/module.cjs.js
new file mode 100644
index 0000000..d46c1f7
--- /dev/null
+++ b/alpinejs/packages/ui/dist/module.cjs.js
@@ -0,0 +1,141 @@
+var __defProp = Object.defineProperty;
+var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, {get: all[name], enumerable: true});
+};
+
+// packages/ui/builds/module.js
+__markAsModule(exports);
+__export(exports, {
+ default: () => module_default
+});
+
+// packages/ui/src/dialog.js
+function dialog_default(Alpine) {
+ Alpine.directive("dialog", (el, directive) => {
+ if (directive.value === "overlay")
+ handleOverlay(el, Alpine);
+ else if (directive.value === "panel")
+ handlePanel(el, Alpine);
+ else if (directive.value === "title")
+ handleTitle(el, Alpine);
+ else if (directive.value === "description")
+ handleDescription(el, Alpine);
+ else
+ handleRoot(el, Alpine);
+ });
+ Alpine.magic("dialog", (el) => {
+ let $data = Alpine.$data(el);
+ return {
+ get open() {
+ return $data.__isOpen;
+ },
+ close() {
+ $data.__close();
+ }
+ };
+ });
+}
+function handleRoot(el, Alpine) {
+ Alpine.bind(el, {
+ "x-data"() {
+ return {
+ init() {
+ Alpine.bound(el, "open") !== void 0 && Alpine.effect(() => {
+ this.__isOpenState = Alpine.bound(el, "open");
+ });
+ if (Alpine.bound(el, "initial-focus") !== void 0)
+ this.$watch("__isOpenState", () => {
+ if (!this.__isOpenState)
+ return;
+ setTimeout(() => {
+ Alpine.bound(el, "initial-focus").focus();
+ }, 0);
+ });
+ },
+ __isOpenState: false,
+ __close() {
+ if (Alpine.bound(el, "open"))
+ this.$dispatch("close");
+ else
+ this.__isOpenState = false;
+ },
+ get __isOpen() {
+ return Alpine.bound(el, "static", this.__isOpenState);
+ }
+ };
+ },
+ "x-modelable": "__isOpenState",
+ "x-id"() {
+ return ["alpine-dialog-title", "alpine-dialog-description"];
+ },
+ "x-show"() {
+ return this.__isOpen;
+ },
+ "x-trap.inert.noscroll"() {
+ return this.__isOpen;
+ },
+ "@keydown.escape"() {
+ this.__close();
+ },
+ ":aria-labelledby"() {
+ return this.$id("alpine-dialog-title");
+ },
+ ":aria-describedby"() {
+ return this.$id("alpine-dialog-description");
+ },
+ role: "dialog",
+ "aria-modal": "true"
+ });
+}
+function handleOverlay(el, Alpine) {
+ Alpine.bind(el, {
+ "x-init"() {
+ if (this.$data.__isOpen === void 0)
+ console.warn('"x-dialog:overlay" is missing a parent element with "x-dialog".');
+ },
+ "x-show"() {
+ return this.__isOpen;
+ },
+ "@click.prevent.stop"() {
+ this.$data.__close();
+ }
+ });
+}
+function handlePanel(el, Alpine) {
+ Alpine.bind(el, {
+ "@click.outside"() {
+ this.$data.__close();
+ },
+ "x-show"() {
+ return this.$data.__isOpen;
+ }
+ });
+}
+function handleTitle(el, Alpine) {
+ Alpine.bind(el, {
+ "x-init"() {
+ if (this.$data.__isOpen === void 0)
+ console.warn('"x-dialog:title" is missing a parent element with "x-dialog".');
+ },
+ ":id"() {
+ return this.$id("alpine-dialog-title");
+ }
+ });
+}
+function handleDescription(el, Alpine) {
+ Alpine.bind(el, {
+ ":id"() {
+ return this.$id("alpine-dialog-description");
+ }
+ });
+}
+
+// packages/ui/src/index.js
+function src_default(Alpine) {
+ dialog_default(Alpine);
+}
+
+// packages/ui/builds/module.js
+var module_default = src_default;
diff --git a/alpinejs/packages/ui/dist/module.esm.js b/alpinejs/packages/ui/dist/module.esm.js
new file mode 100644
index 0000000..f554135
--- /dev/null
+++ b/alpinejs/packages/ui/dist/module.esm.js
@@ -0,0 +1,131 @@
+// packages/ui/src/dialog.js
+function dialog_default(Alpine) {
+ Alpine.directive("dialog", (el, directive) => {
+ if (directive.value === "overlay")
+ handleOverlay(el, Alpine);
+ else if (directive.value === "panel")
+ handlePanel(el, Alpine);
+ else if (directive.value === "title")
+ handleTitle(el, Alpine);
+ else if (directive.value === "description")
+ handleDescription(el, Alpine);
+ else
+ handleRoot(el, Alpine);
+ });
+ Alpine.magic("dialog", (el) => {
+ let $data = Alpine.$data(el);
+ return {
+ get open() {
+ return $data.__isOpen;
+ },
+ close() {
+ $data.__close();
+ }
+ };
+ });
+}
+function handleRoot(el, Alpine) {
+ Alpine.bind(el, {
+ "x-data"() {
+ return {
+ init() {
+ Alpine.bound(el, "open") !== void 0 && Alpine.effect(() => {
+ this.__isOpenState = Alpine.bound(el, "open");
+ });
+ if (Alpine.bound(el, "initial-focus") !== void 0)
+ this.$watch("__isOpenState", () => {
+ if (!this.__isOpenState)
+ return;
+ setTimeout(() => {
+ Alpine.bound(el, "initial-focus").focus();
+ }, 0);
+ });
+ },
+ __isOpenState: false,
+ __close() {
+ if (Alpine.bound(el, "open"))
+ this.$dispatch("close");
+ else
+ this.__isOpenState = false;
+ },
+ get __isOpen() {
+ return Alpine.bound(el, "static", this.__isOpenState);
+ }
+ };
+ },
+ "x-modelable": "__isOpenState",
+ "x-id"() {
+ return ["alpine-dialog-title", "alpine-dialog-description"];
+ },
+ "x-show"() {
+ return this.__isOpen;
+ },
+ "x-trap.inert.noscroll"() {
+ return this.__isOpen;
+ },
+ "@keydown.escape"() {
+ this.__close();
+ },
+ ":aria-labelledby"() {
+ return this.$id("alpine-dialog-title");
+ },
+ ":aria-describedby"() {
+ return this.$id("alpine-dialog-description");
+ },
+ role: "dialog",
+ "aria-modal": "true"
+ });
+}
+function handleOverlay(el, Alpine) {
+ Alpine.bind(el, {
+ "x-init"() {
+ if (this.$data.__isOpen === void 0)
+ console.warn('"x-dialog:overlay" is missing a parent element with "x-dialog".');
+ },
+ "x-show"() {
+ return this.__isOpen;
+ },
+ "@click.prevent.stop"() {
+ this.$data.__close();
+ }
+ });
+}
+function handlePanel(el, Alpine) {
+ Alpine.bind(el, {
+ "@click.outside"() {
+ this.$data.__close();
+ },
+ "x-show"() {
+ return this.$data.__isOpen;
+ }
+ });
+}
+function handleTitle(el, Alpine) {
+ Alpine.bind(el, {
+ "x-init"() {
+ if (this.$data.__isOpen === void 0)
+ console.warn('"x-dialog:title" is missing a parent element with "x-dialog".');
+ },
+ ":id"() {
+ return this.$id("alpine-dialog-title");
+ }
+ });
+}
+function handleDescription(el, Alpine) {
+ Alpine.bind(el, {
+ ":id"() {
+ return this.$id("alpine-dialog-description");
+ }
+ });
+}
+
+// packages/ui/src/index.js
+function src_default(Alpine) {
+ dialog_default(Alpine);
+}
+
+// packages/ui/builds/module.js
+var module_default = src_default;
+export {
+ module_default as default
+};
diff --git a/alpinejs/packages/portal/package.json b/alpinejs/packages/ui/package.json
index 7e65407..1e0a202 100644
--- a/alpinejs/packages/portal/package.json
+++ b/alpinejs/packages/ui/package.json
@@ -1,7 +1,7 @@
{
- "name": "@alpinejs/portal",
- "version": "3.6.1-beta.0",
- "description": "Send Alpine templates to other parts of the DOM",
+ "name": "@alpinejs/ui",
+ "version": "3.10.2-beta.1",
+ "description": "Headless UI components for Alpine",
"author": "Caleb Porzio",
"license": "MIT",
"main": "dist/module.cjs.js",
diff --git a/alpinejs/packages/ui/src/combobox.js b/alpinejs/packages/ui/src/combobox.js
new file mode 100644
index 0000000..93c6688
--- /dev/null
+++ b/alpinejs/packages/ui/src/combobox.js
@@ -0,0 +1,550 @@
+
+export default function (Alpine) {
+ Alpine.directive('combobox', (el, directive, { evaluate }) => {
+ if (directive.value === 'input') handleInput(el, Alpine)
+ else if (directive.value === 'button') handleButton(el, Alpine)
+ else if (directive.value === 'label') handleLabel(el, Alpine)
+ else if (directive.value === 'options') handleOptions(el, Alpine)
+ else if (directive.value === 'option') handleOption(el, Alpine, directive, evaluate)
+ else handleRoot(el, Alpine)
+ })
+
+ Alpine.magic('comboboxOption', el => {
+ let $data = Alpine.$data(el)
+
+ return $data.$item
+ })
+
+ registerListStuff(Alpine)
+}
+
+function handleRoot(el, Alpine) {
+ Alpine.bind(el, {
+ 'x-id'() { return ['headlessui-combobox-button', 'headlessui-combobox-options', 'headlessui-combobox-label'] },
+ 'x-list': '__value',
+ 'x-modelable': '__value',
+ 'x-data'() {
+ return {
+ init() {
+ this.$nextTick(() => {
+ this.syncInputValue()
+
+ Alpine.effect(() => this.syncInputValue())
+ })
+ },
+ __value: null,
+ __disabled: false,
+ __static: false,
+ __hold: false,
+ __displayValue: i => i,
+ __isOpen: false,
+ __optionsEl: null,
+ __open() {
+ // @todo handle disabling the entire combobox.
+ if (this.__isOpen) return
+ this.__isOpen = true
+
+ this.$list.activateSelectedOrFirst()
+ },
+ __close() {
+ this.syncInputValue()
+
+ if (this.__static) return
+ if (! this.__isOpen) return
+
+ this.__isOpen = false
+ this.$list.active = null
+ },
+ syncInputValue() {
+ if (this.$list.selected) this.$refs.__input.value = this.__displayValue(this.$list.selected)
+ },
+ }
+ },
+ '@mousedown.window'(e) {
+ if (
+ !! ! this.$refs.__input.contains(e.target)
+ && ! this.$refs.__button.contains(e.target)
+ && ! this.$refs.__options.contains(e.target)
+ ) {
+ this.__close()
+ }
+ }
+ })
+}
+
+function handleInput(el, Alpine) {
+ Alpine.bind(el, {
+ 'x-ref': '__input',
+ ':id'() { return this.$id('headlessui-combobox-input') },
+ 'role': 'combobox',
+ 'tabindex': '0',
+ ':aria-controls'() { return this.$data.__optionsEl && this.$data.__optionsEl.id },
+ ':aria-expanded'() { return this.$data.__disabled ? undefined : this.$data.__isOpen },
+ ':aria-activedescendant'() { return this.$data.$list.activeEl ? this.$data.$list.activeEl.id : null },
+ ':aria-labelledby'() { return this.$refs.__label ? this.$refs.__label.id : (this.$refs.__button ? this.$refs.__button.id : null) },
+ 'x-init'() {
+ queueMicrotask(() => {
+ Alpine.effect(() => {
+ this.$data.__disabled = Alpine.bound(this.$el, 'disabled', false)
+ })
+
+ let displayValueFn = Alpine.bound(this.$el, 'display-value')
+ if (displayValueFn) this.$data.__displayValue = displayValueFn
+ })
+ },
+ '@input.stop'() { this.$data.__open(); this.$dispatch('change') },
+ '@change.stop'() {},
+ '@keydown.enter.prevent.stop'() { this.$list.selectActive(); this.$data.__close() },
+ '@keydown'(e) { this.$list.handleKeyboardNavigation(e) },
+ '@keydown.down'(e) { if(! this.$data.__isOpen) this.$data.__open(); },
+ '@keydown.up'(e) { if(! this.$data.__isOpen) this.$data.__open(); },
+ '@keydown.escape.prevent'(e) {
+ if (! this.$data.__static) e.stopPropagation()
+
+ this.$data.__close()
+ },
+ '@keydown.tab'() { if (this.$data.__isOpen) { this.$list.selectActive(); this.$data.__close() }},
+ })
+}
+
+function handleButton(el, Alpine) {
+ Alpine.bind(el, {
+ 'x-ref': '__button',
+ ':id'() { return this.$id('headlessui-combobox-button') },
+ 'aria-haspopup': 'true',
+ ':aria-labelledby'() { return this.$refs.__label ? [this.$refs.__label.id, this.$el.id].join(' ') : null },
+ ':aria-expanded'() { return this.$data.__disabled ? null : this.$data.__isOpen },
+ ':aria-controls'() { return this.$data.__optionsEl ? this.$data.__optionsEl.id : null },
+ ':disabled'() { return this.$data.__disabled },
+ 'tabindex': '-1',
+ 'x-init'() { if (this.$el.tagName.toLowerCase() === 'button' && ! this.$el.hasAttribute('type')) this.$el.type = 'button' },
+ '@click'(e) {
+ if (this.$data.__disabled) return
+ if (this.$data.__isOpen) {
+ this.$data.__close()
+ } else {
+ e.preventDefault()
+ this.$data.__open()
+ }
+
+ this.$nextTick(() => this.$refs.__input.focus({ preventScroll: true }))
+ },
+ '@keydown.down.prevent.stop'() {
+ if (! this.$data.__isOpen) {
+ this.$data.__open()
+ this.$list.activateSelectedOrFirst()
+ }
+
+ this.$nextTick(() => this.$refs.__input.focus({ preventScroll: true }))
+ },
+ '@keydown.up.prevent.stop'() {
+ if (! this.$data.__isOpen) {
+ this.$data.__open()
+ this.$list.activateSelectedOrLast()
+ }
+
+ this.$nextTick(() => this.$refs.__input.focus({ preventScroll: true }))
+ },
+ '@keydown.escape.prevent'(e) {
+ if (! this.$data.__static) e.stopPropagation()
+
+ this.$data.__close()
+ this.$nextTick(() => this.$refs.__input.focus({ preventScroll: true }))
+ },
+ })
+}
+
+function handleLabel(el, Alpine) {
+ Alpine.bind(el, {
+ 'x-ref': '__label',
+ ':id'() { return this.$id('headlessui-combobox-label') },
+ '@click'() { this.$refs.__input.focus({ preventScroll: true }) },
+ })
+}
+
+function handleOptions(el, Alpine) {
+ Alpine.bind(el, {
+ 'x-ref': '__options',
+ 'x-init'() {
+ this.$data.__optionsEl = this.$el
+
+ queueMicrotask(() => {
+ if (Alpine.bound(this.$el, 'static')) {
+ this.$data.__open()
+ this.$data.__static = true;
+ }
+
+ if (Alpine.bound(this.$el, 'hold')) {
+ this.$data.__hold = true;
+ }
+ })
+
+ // Add `role="none"` to all non option elements.
+ this.$nextTick(() => {
+ let walker = document.createTreeWalker(
+ this.$el,
+ NodeFilter.SHOW_ELEMENT,
+ { acceptNode: node => {
+ if (node.getAttribute('role') === 'option') return NodeFilter.FILTER_REJECT
+ if (node.hasAttribute('role')) return NodeFilter.FILTER_SKIP
+ return NodeFilter.FILTER_ACCEPT
+ }},
+ false
+ )
+
+ while (walker.nextNode()) walker.currentNode.setAttribute('role', 'none')
+ })
+ },
+ 'role': 'listbox',
+ ':id'() { return this.$id('headlessui-combobox-options') },
+ ':aria-labelledby'() { return this.$id('headlessui-combobox-button') },
+ ':aria-activedescendant'() { return this.$list.activeEl ? this.$list.activeEl.id : null },
+ 'x-show'() { return this.$data.__isOpen },
+ })
+}
+
+function handleOption(el, Alpine, directive, evaluate) {
+ let value = evaluate(directive.expression)
+
+ Alpine.bind(el, {
+ 'role': 'option',
+ 'x-item'() { return value },
+ ':id'() { return this.$id('headlessui-combobox-option') },
+ ':tabindex'() { return this.$item.disabled ? undefined : '-1' },
+ ':aria-selected'() { return this.$item.selected },
+ ':aria-disabled'() { return this.$item.disabled },
+ '@click'(e) {
+ if (this.$item.disabled) e.preventDefault()
+ this.$item.select()
+ this.$data.__close()
+ this.$nextTick(() => this.$refs.__input.focus({ preventScroll: true }))
+ },
+ '@focus'() {
+ if (this.$item.disabled) return this.$list.deactivate()
+ this.$item.activate()
+ },
+ '@pointermove'() {
+ if (this.$item.disabled || this.$item.active) return
+ this.$item.activate()
+ },
+ '@mousemove'() {
+ if (this.$item.disabled || this.$item.active) return
+ this.$item.activate()
+ },
+ '@pointerleave'() {
+ if (this.$item.disabled || ! this.$item.active || this.$data.__hold) return
+ this.$list.deactivate()
+ },
+ '@mouseleave'() {
+ if (this.$item.disabled || ! this.$item.active || this.$data.__hold) return
+ this.$list.deactivate()
+ },
+ })
+}
+
+function registerListStuff(Alpine) {
+ Alpine.directive('list', (el, { expression, modifiers }, { evaluateLater, effect }) => {
+ let wrap = modifiers.includes('wrap')
+ let getOuterValue = () => null
+ let setOuterValue = () => {}
+
+ if (expression) {
+ let func = evaluateLater(expression)
+ getOuterValue = () => { let result; func(i => result = i); return result; }
+ let evaluateOuterSet = evaluateLater(`${expression} = __placeholder`)
+ setOuterValue = val => evaluateOuterSet(() => {}, { scope: { '__placeholder': val }})
+ }
+
+ let listEl = el
+
+ el._x_listState = {
+ wrap,
+ reactive: Alpine.reactive({
+ active: null,
+ selected: null,
+ }),
+ get active() { return this.reactive.active },
+ get selected() { return this.reactive.selected },
+ get activeEl() {
+ this.reactive.active
+
+ let item = this.items.find(i => i.value === this.reactive.active)
+
+ return item && item.el
+ },
+ get selectedEl() {
+ let item = this.items.find(i => i.value === this.reactive.selected)
+
+ return item && item.el
+ },
+ set active(value) { this.setActive(value) },
+ set selected(value) { this.setSelected(value) },
+ setSelected(value) {
+ let item = this.items.find(i => i.value === value)
+
+ if (item && item.disabled) return
+
+ this.reactive.selected = value; setOuterValue(value)
+ },
+ setActive(value) {
+ let item = this.items.find(i => i.value === value)
+
+ if (item && item.disabled) return
+
+ this.reactive.active = value
+ },
+ deactivate() {
+ this.reactive.active = null
+ },
+ selectActive() {
+ this.selected = this.active
+ },
+ activateSelectedOrFirst() {
+ if (this.selected) this.active = this.selected
+ else this.first()?.activate()
+ },
+ activateSelectedOrLast() {
+ if (this.selected) this.active = this.selected
+ else this.last()?.activate()
+ },
+ items: [],
+ get filteredEls() { return this.items.filter(i => ! i.disabled).map(i => i.el) },
+ addItem(el, value, disabled = false) {
+ this.items.push({ el, value, disabled })
+ this.reorderList()
+ },
+ disableItem(el) {
+ this.items.find(i => i.el === el).disabled = true
+ },
+ removeItem(el) {
+ this.items = this.items.filter(i => i.el !== el)
+ this.reorderList()
+ },
+ reorderList() {
+ this.items = this.items.slice().sort((a, z) => {
+ if (a === null || z === null) return 0
+
+ let position = a.el.compareDocumentPosition(z.el)
+
+ if (position & Node.DOCUMENT_POSITION_FOLLOWING) return -1
+ if (position & Node.DOCUMENT_POSITION_PRECEDING) return 1
+ return 0
+ })
+ },
+ handleKeyboardNavigation(e) {
+ let item
+
+ switch (e.key) {
+ case 'Tab':
+ case 'Backspace':
+ case 'Delete':
+ case 'Meta':
+ break;
+
+ break;
+ case ['ArrowDown', 'ArrowRight'][0]: // @todo handle orientation switching.
+ e.preventDefault(); e.stopPropagation()
+ item = this.active ? this.next() : this.first()
+ break;
+
+ case ['ArrowUp', 'ArrowLeft'][0]:
+ e.preventDefault(); e.stopPropagation()
+ item = this.active ? this.prev() : this.last()
+ break;
+ case 'Home':
+ case 'PageUp':
+ e.preventDefault(); e.stopPropagation()
+ item = this.first()
+ break;
+
+ case 'End':
+ case 'PageDown':
+ e.preventDefault(); e.stopPropagation()
+ item = this.last()
+ break;
+
+ default:
+ if (e.key.length === 1) {
+ // item = this.search(e.key)
+ }
+ break;
+ }
+
+ item && item.activate(({ el }) => {
+ setTimeout(() => el.scrollIntoView({ block: 'nearest' }))
+ })
+ },
+ // Todo: the debounce doesn't work.
+ searchQuery: '',
+ clearSearch: Alpine.debounce(function () { this.searchQuery = '' }, 350),
+ search(key) {
+ this.searchQuery += key
+
+ let el = this.filteredEls.find(el => {
+ return el.textContent.trim().toLowerCase().startsWith(this.searchQuery)
+ })
+
+ let obj = el ? generateItemObject(listEl, el) : null
+
+ this.clearSearch()
+
+ return obj
+ },
+ first() {
+ let el = this.filteredEls[0]
+
+ return el && generateItemObject(listEl, el)
+ },
+ last() {
+ let el = this.filteredEls[this.filteredEls.length-1]
+
+ return el && generateItemObject(listEl, el)
+ },
+ next() {
+ let current = this.activeEl || this.filteredEls[0]
+ let index = this.filteredEls.indexOf(current)
+
+ let el = this.wrap
+ ? this.filteredEls[index + 1] || this.filteredEls[0]
+ : this.filteredEls[index + 1] || this.filteredEls[index]
+
+ return el && generateItemObject(listEl, el)
+ },
+ prev() {
+ let current = this.activeEl || this.filteredEls[0]
+ let index = this.filteredEls.indexOf(current)
+
+ let el = this.wrap
+ ? (index - 1 < 0 ? this.filteredEls[this.filteredEls.length-1] : this.filteredEls[index - 1])
+ : (index - 1 < 0 ? this.filteredEls[0] : this.filteredEls[index - 1])
+
+ return el && generateItemObject(listEl, el)
+ },
+ }
+
+ effect(() => {
+ el._x_listState.setSelected(getOuterValue())
+ })
+ })
+
+ Alpine.magic('list', (el) => {
+ let listEl = Alpine.findClosest(el, el => el._x_listState)
+
+ return listEl._x_listState
+ })
+
+ Alpine.directive('item', (el, { expression }, { effect, evaluate, cleanup }) => {
+ let value
+ el._x_listItem = true
+
+ if (expression) value = evaluate(expression)
+
+ let listEl = Alpine.findClosest(el, el => el._x_listState)
+
+ console.log(value)
+ listEl._x_listState.addItem(el, value)
+
+ queueMicrotask(() => {
+ Alpine.bound(el, 'disabled') && listEl._x_listState.disableItem(el)
+ })
+
+ cleanup(() => {
+ listEl._x_listState.removeItem(el)
+ delete el._x_listItem
+ })
+ })
+
+ Alpine.magic('item', el => {
+ let listEl = Alpine.findClosest(el, el => el._x_listState)
+ let itemEl = Alpine.findClosest(el, el => el._x_listItem)
+
+ if (! listEl) throw 'Cant find x-list element'
+ if (! itemEl) throw 'Cant find x-item element'
+
+ return generateItemObject(listEl, itemEl)
+ })
+
+ function generateItemObject(listEl, el) {
+ let state = listEl._x_listState
+ let item = listEl._x_listState.items.find(i => i.el === el)
+
+ return {
+ activate(callback = () => {}) {
+ state.setActive(item.value)
+
+ callback(item)
+ },
+ deactivate() {
+ if (Alpine.raw(state.active) === Alpine.raw(item.value)) state.setActive(null)
+ },
+ select(callback = () => {}) {
+ state.setSelected(item.value)
+
+ callback(item)
+ },
+ isFirst() {
+ return state.items.findIndex(i => i.el.isSameNode(el)) === 0
+ },
+ get active() {
+ if (state.reactive.active) return state.reactive.active === item.value
+
+ return null
+ },
+ get selected() {
+ if (state.reactive.selected) return state.reactive.selected === item.value
+
+ return null
+ },
+ get disabled() {
+ return item.disabled
+ },
+ get el() { return item.el },
+ get value() { return item.value },
+ }
+ }
+}
+
+/* <div x-data="{
+ query: '',
+ selected: null,
+ people: [
+ { id: 1, name: 'Kevin' },
+ { id: 2, name: 'Caleb' },
+ ],
+ get filteredPeople() {
+ return this.people.filter(i => {
+ return i.name.toLowerCase().includes(this.query.toLowerCase())
+ })
+ }
+}">
+<p x-text="query"></p>
+<div class="fixed top-16 w-72">
+ <div x-combobox x-model="selected">
+ <div class="relative mt-1">
+ <div class="relative w-full cursor-default overflow-hidden rounded-lg bg-white text-left shadow-md focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75 focus-visible:ring-offset-2 focus-visible:ring-offset-teal-300 sm:text-sm">
+ <input x-combobox:input class="w-full border-none py-2 pl-3 pr-10 text-sm leading-5 text-gray-900 focus:ring-0" :display-value="() => (person) => person.name" @change="query = $event.target.value" />
+ <button x-combobox:button class="absolute inset-y-0 right-0 flex items-center pr-2">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="h-5 w-5 text-gray-400"><path fill-rule="evenodd" d="M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>
+ </button>
+ </div>
+ <ul x-combobox:options class="absolute mt-1 max-h-60 w-full overflow-auto rounded-md bg-white py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm">
+ <div x-show="filteredPeople.length === 0 && query !== ''" class="relative cursor-default select-none py-2 px-4 text-gray-700">
+ Nothing found.
+ </div>
+
+ <template x-for="person in filteredPeople" :key="person.id">
+ <li x-combobox:option :value="person" class="relative cursor-default select-none py-2 pl-10 pr-4" :class="{ 'bg-teal-600 text-white': $comboboxOption.active, 'text-gray-900': !$comboboxOption.active, }">
+ <span x-text="person.name" class="block truncate" :class="{ 'font-medium': $comboboxOption.selected, 'font-normal': ! $comboboxOption.selected }"></span>
+
+ <template x-if="$comboboxOption.selected">
+ <span class="absolute inset-y-0 left-0 flex items-center pl-3" :class="{ 'text-white': $comboboxOption.active, 'text-teal-600': !$comboboxOption.active }">
+ <CheckIcon class="h-5 w-5" aria-hidden="true" />
+ </span>
+ </template>
+ </li>
+ </template>
+ </ul>
+ </div>
+ </div>
+ </div>
+</div> */
diff --git a/alpinejs/packages/ui/src/dialog.js b/alpinejs/packages/ui/src/dialog.js
new file mode 100644
index 0000000..6bb7a35
--- /dev/null
+++ b/alpinejs/packages/ui/src/dialog.js
@@ -0,0 +1,92 @@
+
+export default function (Alpine) {
+ Alpine.directive('dialog', (el, directive) => {
+ if (directive.value === 'overlay') handleOverlay(el, Alpine)
+ else if (directive.value === 'panel') handlePanel(el, Alpine)
+ else if (directive.value === 'title') handleTitle(el, Alpine)
+ else if (directive.value === 'description') handleDescription(el, Alpine)
+ else handleRoot(el, Alpine)
+ })
+
+ Alpine.magic('dialog', el => {
+ let $data = Alpine.$data(el)
+
+ return {
+ get open() {
+ return $data.__isOpen
+ },
+ close() {
+ $data.__close()
+ }
+ }
+ })
+}
+
+function handleRoot(el, Alpine) {
+ Alpine.bind(el, {
+ 'x-data'() {
+ return {
+ init() {
+ // If the user chose to use :open and @close instead of x-model.
+ (Alpine.bound(el, 'open') !== undefined) && Alpine.effect(() => {
+ this.__isOpenState = Alpine.bound(el, 'open')
+ })
+
+ if (Alpine.bound(el, 'initial-focus') !== undefined) this.$watch('__isOpenState', () => {
+ if (! this.__isOpenState) return
+
+ setTimeout(() => {
+ Alpine.bound(el, 'initial-focus').focus()
+ }, 0);
+ })
+ },
+ __isOpenState: false,
+ __close() {
+ if (Alpine.bound(el, 'open')) this.$dispatch('close')
+ else this.__isOpenState = false
+ },
+ get __isOpen() {
+ return Alpine.bound(el, 'static', this.__isOpenState)
+ },
+ }
+ },
+ 'x-modelable': '__isOpenState',
+ 'x-id'() { return ['alpine-dialog-title', 'alpine-dialog-description'] },
+ 'x-show'() { return this.__isOpen },
+ 'x-trap.inert.noscroll'() { return this.__isOpen },
+ '@keydown.escape'() { this.__close() },
+ ':aria-labelledby'() { return this.$id('alpine-dialog-title') },
+ ':aria-describedby'() { return this.$id('alpine-dialog-description') },
+ 'role': 'dialog',
+ 'aria-modal': 'true',
+ })
+}
+
+function handleOverlay(el, Alpine) {
+ Alpine.bind(el, {
+ 'x-init'() { if (this.$data.__isOpen === undefined) console.warn('"x-dialog:overlay" is missing a parent element with "x-dialog".') },
+ 'x-show'() { return this.__isOpen },
+ '@click.prevent.stop'() { this.$data.__close() },
+ })
+}
+
+function handlePanel(el, Alpine) {
+ Alpine.bind(el, {
+ '@click.outside'() { this.$data.__close() },
+ 'x-show'() { return this.$data.__isOpen },
+ })
+}
+
+function handleTitle(el, Alpine) {
+ Alpine.bind(el, {
+ 'x-init'() { if (this.$data.__isOpen === undefined) console.warn('"x-dialog:title" is missing a parent element with "x-dialog".') },
+ ':id'() { return this.$id('alpine-dialog-title') },
+ })
+}
+
+function handleDescription(el, Alpine) {
+ Alpine.bind(el, {
+ ':id'() { return this.$id('alpine-dialog-description') },
+ })
+}
+
diff --git a/alpinejs/packages/ui/src/index.js b/alpinejs/packages/ui/src/index.js
new file mode 100644
index 0000000..036d5c4
--- /dev/null
+++ b/alpinejs/packages/ui/src/index.js
@@ -0,0 +1,5 @@
+import dialog from './dialog'
+
+export default function (Alpine) {
+ dialog(Alpine)
+}
diff --git a/alpinejs/packages/ui/src/popover.js b/alpinejs/packages/ui/src/popover.js
new file mode 100644
index 0000000..889efea
--- /dev/null
+++ b/alpinejs/packages/ui/src/popover.js
@@ -0,0 +1,191 @@
+
+export default function (Alpine) {
+ Alpine.directive('popover', (el, directive) => {
+ if (! directive.value) handleRoot(el, Alpine)
+ else if (directive.value === 'overlay') handleOverlay(el, Alpine)
+ else if (directive.value === 'button') handleButton(el, Alpine)
+ else if (directive.value === 'panel') handlePanel(el, Alpine)
+ else if (directive.value === 'group') handleGroup(el, Alpine)
+ })
+
+ Alpine.magic('popover', el => {
+ let $data = Alpine.$data(el)
+
+ return {
+ get open() {
+ return $data.__isOpen
+ }
+ }
+ })
+}
+
+function handleRoot(el, Alpine) {
+ Alpine.bind(el, {
+ 'x-id'() { return ['alpine-popover-button', 'alpine-popover-panel'] },
+ 'x-data'() {
+ return {
+ init() {
+ if (this.$data.__groupEl) {
+ this.$data.__groupEl.addEventListener('__close-others', ({ detail }) => {
+ if (detail.el.isSameNode(this.$el)) return
+
+ this.__close(false)
+ })
+ }
+ },
+ __buttonEl: undefined,
+ __panelEl: undefined,
+ __isOpen: false,
+ __open() {
+ this.__isOpen = true
+
+ this.$dispatch('__close-others', { el: this.$el })
+ },
+ __toggle() {
+ this.__isOpen ? this.__close() : this.__open()
+ },
+ __close(el) {
+ this.__isOpen = false
+
+ if (el === false) return
+
+ el = el || this.$data.__buttonEl
+
+ if (document.activeElement.isSameNode(el)) return
+
+ setTimeout(() => el.focus())
+ },
+ __contains(outer, inner) {
+ return !! Alpine.findClosest(inner, el => el.isSameNode(outer))
+ }
+ }
+ },
+ '@keydown.escape.stop.prevent'() {
+ this.__close()
+ },
+ '@focusin.window'() {
+ if (this.$data.__groupEl) {
+ if (! this.$data.__contains(this.$data.__groupEl, document.activeElement)) {
+ this.$data.__close(false)
+ }
+
+ return
+ }
+
+ if (! this.$data.__contains(this.$el, document.activeElement)) {
+ this.$data.__close(false)
+ }
+ },
+ })
+}
+
+function handleButton(el, Alpine) {
+ Alpine.bind(el, {
+ 'x-ref': 'button',
+ ':id'() { return this.$id('alpine-popover-button') },
+ ':aria-expanded'() { return this.$data.__isOpen },
+ ':aria-controls'() { return this.$data.__isOpen && this.$id('alpine-popover-panel') },
+ 'x-init'() {
+ if (this.$el.tagName.toLowerCase() === 'button' && !this.$el.hasAttribute('type')) this.$el.type = 'button'
+
+ this.$data.__buttonEl = this.$el
+ },
+ '@click'() { this.$data.__toggle() },
+ '@keydown.tab'(e) {
+ if (! e.shiftKey && this.$data.__isOpen) {
+ let firstFocusableEl = this.$focus.within(this.$data.__panelEl).getFirst()
+
+ if (firstFocusableEl) {
+ e.preventDefault()
+ e.stopPropagation()
+
+ this.$focus.focus(firstFocusableEl)
+ }
+ }
+ },
+ '@keyup.tab'(e) {
+ if (this.$data.__isOpen) {
+ // Check if the last focused element was "after" this one
+ let lastEl = this.$focus.previouslyFocused()
+
+ if (! lastEl) return
+
+ if (
+ // Make sure the last focused wasn't part of this popover.
+ (! this.$data.__buttonEl.contains(lastEl) && ! this.$data.__panelEl.contains(lastEl))
+ // Also make sure it appeared "after" this button in the DOM.
+ && (lastEl && (this.$el.compareDocumentPosition(lastEl) & Node.DOCUMENT_POSITION_FOLLOWING))
+ ) {
+ e.preventDefault()
+ e.stopPropagation()
+
+ this.$focus.within(this.$data.__panelEl).last()
+ }
+ }
+ },
+ '@keydown.space.stop.prevent'() { this.$data.__toggle() },
+ '@keydown.enter.stop.prevent'() { this.$data.__toggle() },
+ // This is to stop Firefox from firing a "click".
+ '@keyup.space.stop.prevent'() { },
+ })
+}
+
+function handlePanel(el, Alpine) {
+ Alpine.bind(el, {
+ 'x-init'() { this.$data.__panelEl = this.$el },
+ 'x-effect'() {
+ this.$data.__isOpen && Alpine.bound(el, 'focus') && this.$focus.first()
+ },
+ 'x-ref': 'panel',
+ ':id'() { return this.$id('alpine-popover-panel') },
+ 'x-show'() { return this.$data.__isOpen },
+ '@mousedown.window'($event) {
+ if (! this.$data.__isOpen) return
+ if (this.$data.__contains(this.$data.__buttonEl, $event.target)) return
+ if (this.$data.__contains(this.$el, $event.target)) return
+
+ if (! this.$focus.focusable($event.target)) {
+ this.$data.__close()
+ }
+ },
+ '@keydown.tab'(e) {
+ if (e.shiftKey && this.$focus.isFirst(e.target)) {
+ e.preventDefault()
+ e.stopPropagation()
+ Alpine.bound(el, 'focus') ? this.$data.__close() : this.$data.__buttonEl.focus()
+ } else if (! e.shiftKey && this.$focus.isLast(e.target)) {
+ e.preventDefault()
+ e.stopPropagation()
+
+ // Get the next panel button:
+ let els = this.$focus.within(document).all()
+ let buttonIdx = els.indexOf(this.$data.__buttonEl)
+
+ let nextEls = els
+ .splice(buttonIdx + 1) // Elements after button
+ .filter(el => ! this.$el.contains(el)) // Ignore items in panel
+
+ nextEls[0].focus()
+
+ Alpine.bound(el, 'focus') && this.$data.__close(false)
+ }
+ },
+ })
+}
+
+function handleGroup(el, Alpine) {
+ Alpine.bind(el, {
+ 'x-ref': 'container',
+ 'x-data'() {
+ return {
+ __groupEl: this.$el,
+ }
+ },
+ })
+}
+
+function handleOverlay(el, Alpine) {
+ Alpine.bind(el, {
+ 'x-show'() { return this.$data.__isOpen }
+ })
+}
diff --git a/alpinejs/packages/ui/src/tabs.js b/alpinejs/packages/ui/src/tabs.js
new file mode 100644
index 0000000..8da630e
--- /dev/null
+++ b/alpinejs/packages/ui/src/tabs.js
@@ -0,0 +1,136 @@
+
+export default function (Alpine) {
+ Alpine.directive('tabs', (el, directive) => {
+ if (! directive.value) handleRoot(el, Alpine)
+ else if (directive.value === 'list') handleList(el, Alpine)
+ else if (directive.value === 'tab') handleTab(el, Alpine)
+ else if (directive.value === 'panels') handlePanels(el, Alpine)
+ else if (directive.value === 'panel') handlePanel(el, Alpine)
+ })
+
+ Alpine.magic('tab', el => {
+ let $data = Alpine.$data(el)
+
+ return {
+ get selected() {
+ return $data.__selectedIndex === $data.__tabs.indexOf($data.__tabEl)
+ }
+ }
+ })
+
+ Alpine.magic('tabPanel', el => {
+ let $data = Alpine.$data(el)
+
+ return {
+ get selected() {
+ return $data.__selectedIndex === $data.__panels.indexOf($data.__panelEl)
+ }
+ }
+ })
+}
+
+function handleRoot(el, Alpine) {
+ Alpine.bind(el, {
+ 'x-data'() {
+ return {
+ init() {
+ queueMicrotask(() => {
+ let defaultIndex = this.__selectedIndex || Number(Alpine.bound(this.$el, 'default-index', 0))
+ let tabs = this.__activeTabs()
+ let clamp = (number, min, max) => Math.min(Math.max(number, min), max)
+
+ this.__selectedIndex = clamp(defaultIndex, 0, tabs.length -1)
+
+ Alpine.effect(() => {
+ this.__manualActivation = Alpine.bound(this.$el, 'manual', false)
+ })
+ })
+ },
+ __tabs: [],
+ __panels: [],
+ __selectedIndex: null,
+ __tabGroupEl: undefined,
+ __manualActivation: false,
+ __addTab(el) { this.__tabs.push(el) },
+ __addPanel(el) { this.__panels.push(el) },
+ __selectTab(el) {
+ this.__selectedIndex = this.__tabs.indexOf(el)
+ },
+ __activeTabs() {
+ return this.__tabs.filter(i => !i.__disabled)
+ },
+ }
+ }
+ })
+}
+
+function handleList(el, Alpine) {
+ Alpine.bind(el, {
+ 'x-init'() { this.$data.__tabGroupEl = this.$el }
+ })
+}
+
+function handleTab(el, Alpine) {
+ let options = {}
+ Alpine.bind(el, {
+ 'x-init'() { if (this.$el.tagName.toLowerCase() === 'button' && !this.$el.hasAttribute('type')) this.$el.type = 'button' },
+ 'x-data'() { return {
+ init() {
+ this.__tabEl = this.$el
+ this.$data.__addTab(this.$el)
+ this.$el.__disabled = options.disabled
+ },
+ __tabEl: undefined,
+ }},
+ '@click'() {
+ if (this.$el.__disabled) return
+
+ this.$data.__selectTab(this.$el)
+
+ this.$el.focus()
+ },
+ '@keydown.enter.prevent.stop'() { this.__selectTab(this.$el) },
+ '@keydown.space.prevent.stop'() { this.__selectTab(this.$el) },
+ '@keydown.home.prevent.stop'() { this.$focus.within(this.$data.__activeTabs()).first() },
+ '@keydown.page-up.prevent.stop'() { this.$focus.within(this.$data.__activeTabs()).first() },
+ '@keydown.end.prevent.stop'() { this.$focus.within(this.$data.__activeTabs()).last() },
+ '@keydown.page-down.prevent.stop'() { this.$focus.within(this.$data.__activeTabs()).last() },
+ '@keydown.down.prevent.stop'() { this.$focus.within(this.$data.__activeTabs()).withWrapAround().next() },
+ '@keydown.right.prevent.stop'() { this.$focus.within(this.$data.__activeTabs()).withWrapAround().next() },
+ '@keydown.up.prevent.stop'() { this.$focus.within(this.$data.__activeTabs()).withWrapAround().prev() },
+ '@keydown.left.prevent.stop'() { this.$focus.within(this.$data.__activeTabs()).withWrapAround().prev() },
+ ':tabindex'() { return this.$tab.selected ? 0 : -1 },
+ '@focus'() {
+ if (this.$data.__manualActivation) {
+ this.$el.focus()
+ } else {
+ if (this.$el.__disabled) return
+
+ this.$data.__selectTab(this.$el)
+
+ this.$el.focus()
+ }
+ },
+ })
+}
+
+function handlePanels(el, Alpine) {
+ Alpine.bind(el, {
+ //
+ })
+}
+
+function handlePanel(el, Alpine) {
+ Alpine.bind(el, {
+ ':tabindex'() { return this.$tabPanel.selected ? 0 : -1 },
+ 'x-data'() { return {
+ init() {
+ this.__panelEl = this.$el
+ this.$data.__addPanel(this.$el)
+ },
+ __panelEl: undefined,
+ }},
+ 'x-show'() { return this.$tabPanel.selected },
+ })
+}
+