UNPKG

alpinejs

Version:

The rugged, minimal JavaScript framework

6 lines (3 loc) 46.6 kB
(()=>{var ie=!1,oe=!1,Y=[],se=-1,ae=!1;function We(t){Bn(t)}function Ge(){ae=!0}function Je(){ae=!1,Xe()}function Bn(t){Y.includes(t)||Y.push(t),Xe()}function Ye(t){let e=Y.indexOf(t);e!==-1&&e>se&&Y.splice(e,1)}function Xe(){if(!oe&&!ie){if(ae)return;ie=!0,queueMicrotask(zn)}}function zn(){ie=!1,oe=!0;for(let t=0;t<Y.length;t++)Y[t](),se=t;Y.length=0,se=-1,oe=!1}var M,D,z,le,ce=!0;function Ze(t){ce=!1,t(),ce=!0}function Qe(t){M=t.reactive,z=t.release,D=e=>t.effect(e,{scheduler:r=>{ce?We(r):r()}}),le=t.raw}function ue(t){D=t}function tr(t){let e=()=>{};return[n=>{let i=D(n);return t._x_effects||(t._x_effects=new Set,t._x_runEffects=()=>{t._x_effects.forEach(o=>o())}),t._x_effects.add(i),e=()=>{i!==void 0&&(t._x_effects.delete(i),z(i))},i},()=>{e()}]}function Ot(t,e){let r=!0,n,i=D(()=>{let o=t();if(JSON.stringify(o),!r&&(typeof o=="object"||o!==n)){let s=n;queueMicrotask(()=>{e(o,s)})}n=o,r=!1});return()=>z(i)}async function er(t){Ge();try{await t(),await Promise.resolve()}finally{Je()}}var rr=[],nr=[],ir=[];function or(t){ir.push(t)}function it(t,e){typeof e=="function"?(t._x_cleanups||(t._x_cleanups=[]),t._x_cleanups.push(e)):(e=t,nr.push(e))}function Tt(t){rr.push(t)}function Rt(t,e,r){t._x_attributeCleanups||(t._x_attributeCleanups={}),t._x_attributeCleanups[e]||(t._x_attributeCleanups[e]=[]),t._x_attributeCleanups[e].push(r)}function fe(t,e){t._x_attributeCleanups&&Object.entries(t._x_attributeCleanups).forEach(([r,n])=>{(e===void 0||e.includes(r))&&(n.forEach(i=>i()),delete t._x_attributeCleanups[r])})}function sr(t){for(t._x_effects?.forEach(Ye);t._x_cleanups?.length;)t._x_cleanups.pop()()}var de=new MutationObserver(_e),pe=!1;function mt(){de.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),pe=!0}function me(){Hn(),de.disconnect(),pe=!1}var pt=[];function Hn(){let t=de.takeRecords();pt.push(()=>t.length>0&&_e(t));let e=pt.length;queueMicrotask(()=>{if(pt.length===e)for(;pt.length>0;)pt.shift()()})}function h(t){if(!pe)return t();me();let e=t();return mt(),e}var he=!1,Ct=[];function ar(){he=!0}function cr(){he=!1,_e(Ct),Ct=[]}function _e(t){if(he){Ct=Ct.concat(t);return}let e=[],r=new Set,n=new Map,i=new Map;for(let o=0;o<t.length;o++)if(!t[o].target._x_ignoreMutationObserver&&(t[o].type==="childList"&&(t[o].removedNodes.forEach(s=>{s.nodeType===1&&s._x_marker&&r.add(s)}),t[o].addedNodes.forEach(s=>{if(s.nodeType===1){if(r.has(s)){r.delete(s);return}s._x_marker||e.push(s)}})),t[o].type==="attributes")){let s=t[o].target,a=t[o].attributeName,c=t[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)=>{fe(s,o)}),n.forEach((o,s)=>{rr.forEach(a=>a(s,o))});for(let o of r)e.some(s=>s.contains(o))||nr.forEach(s=>s(o));for(let o of e)o.isConnected&&ir.forEach(s=>s(o));e=null,r=null,n=null,i=null}function Mt(t){return I(H(t))}function P(t,e,r){return t._x_dataStack=[e,...H(r||t)],()=>{t._x_dataStack=t._x_dataStack.filter(n=>n!==e)}}function H(t){return t._x_dataStack?t._x_dataStack:typeof ShadowRoot=="function"&&t instanceof ShadowRoot?H(t.host):t.parentNode?H(t.parentNode):[]}function I(t){return new Proxy({objects:t},Kn)}var Kn={ownKeys({objects:t}){return Array.from(new Set(t.flatMap(e=>Object.keys(e))))},has({objects:t},e){return e==Symbol.unscopables?!1:t.some(r=>Object.prototype.hasOwnProperty.call(r,e)||Reflect.has(r,e))},get({objects:t},e,r){return e=="toJSON"?Vn:Reflect.get(t.find(n=>Reflect.has(n,e))||{},e,r)},set({objects:t},e,r,n){let i=t.find(s=>Object.prototype.hasOwnProperty.call(s,e))||t[t.length-1],o=Object.getOwnPropertyDescriptor(i,e);return o?.set&&o?.get?o.set.call(n,r)||!0:Reflect.set(i,e,r)}};function Vn(){return Reflect.ownKeys(this).reduce((e,r)=>(e[r]=Reflect.get(this,r),e),{})}function ot(t){let e=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||typeof s=="object"&&s!==null&&s.__v_skip)return;let c=i===""?o:`${i}.${o}`;typeof s=="object"&&s!==null&&s._x_interceptor?n[o]=s.initialize(t,c,o):e(s)&&s!==n&&!(s instanceof Element)&&r(s,c)})};return r(t)}function Nt(t,e=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,o){return t(this.initialValue,()=>Un(n,i),s=>ge(n,i,s),i,o)}};return e(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 Un(t,e){return e.split(".").reduce((r,n)=>r[n],t)}function ge(t,e,r){if(typeof e=="string"&&(e=e.split(".")),e.length===1)t[e[0]]=r;else{if(e.length===0)throw error;return t[e[0]]||(t[e[0]]={}),ge(t[e[0]],e.slice(1),r)}}var lr={};function y(t,e){lr[t]=e}function U(t,e){let r=qn(e);return Object.entries(lr).forEach(([n,i])=>{Object.defineProperty(t,`$${n}`,{get(){return i(e,r)},enumerable:!1})}),t}function qn(t){let[e,r]=xe(t),n={interceptor:Nt,...e};return it(t,r),n}function ur(t,e,r,...n){try{return r(...n)}catch(i){st(i,t,e)}}function st(...t){return fr(...t)}var fr=Wn;function dr(t){fr=t}function Wn(t,e,r=void 0){t=Object.assign(t??{message:"No error message given."},{el:e,expression:r}),console.warn(`Alpine Expression Error: ${t.message} ${r?'Expression: "'+r+`" `:""}`,e),setTimeout(()=>{throw t},0)}var at=!0;function kt(t){let e=at;at=!1;let r=t();return at=e,r}function N(t,e,r={}){let n;return x(t,e)(i=>n=i,r),n}function x(...t){return pr(...t)}var pr=be;function mr(t){pr=t}var hr;function _r(t){hr=t}function be(t,e){let r={};U(r,t);let n=[r,...H(t)],i=typeof e=="function"?Gn(n,e):Yn(n,e,t);return ur.bind(null,t,e,i)}function Gn(t,e){return(r=()=>{},{scope:n={},params:i=[],context:o}={})=>{if(!at){ht(r,e,I([n,...t]),i);return}let s=e.apply(I([n,...t]),i);ht(r,s)}}var ye={};function Jn(t,e){if(ye[t])return ye[t];let r=Object.getPrototypeOf(async function(){}).constructor,n=/^[\n\s]*if.*\(.*\)/.test(t.trim())||/^(let|const)\s/.test(t.trim())?`(async()=>{ ${t} })()`:t,o=(()=>{try{let s=new r(["__self","scope"],`with (scope) { __self.result = ${n} }; __self.finished = true; return __self.result;`);return Object.defineProperty(s,"name",{value:`[Alpine] ${t}`}),s}catch(s){return st(s,e,t),Promise.resolve()}})();return ye[t]=o,o}function Yn(t,e,r){let n=Jn(e,r);return(i=()=>{},{scope:o={},params:s=[],context:a}={})=>{n.result=void 0,n.finished=!1;let c=I([o,...t]);if(typeof n=="function"){let l=n.call(a,n,c).catch(u=>st(u,r,e));n.finished?(ht(i,n.result,c,s,r),n.result=void 0):l.then(u=>{ht(i,u,c,s,r)}).catch(u=>st(u,r,e)).finally(()=>n.result=void 0)}}}function ht(t,e,r,n,i){if(at&&typeof e=="function"){let o=e.apply(r,n);o instanceof Promise?o.then(s=>ht(t,s,r,n)).catch(s=>st(s,i,e)):t(o)}else typeof e=="object"&&e instanceof Promise?e.then(o=>t(o)):t(e)}function gr(...t){return hr(...t)}function xr(t,e,r={}){let n={};U(n,t);let i=[n,...H(t)],o=I([r.scope??{},...i]),s=r.params??[];if(e.includes("await")){let a=Object.getPrototypeOf(async function(){}).constructor,c=/^[\n\s]*if.*\(.*\)/.test(e.trim())||/^(let|const)\s/.test(e.trim())?`(async()=>{ ${e} })()`:e;return new a(["scope"],`with (scope) { let __result = ${c}; return __result }`).call(r.context,o)}else{let a=/^[\n\s]*if.*\(.*\)/.test(e.trim())||/^(let|const)\s/.test(e.trim())?`(()=>{ ${e} })()`:e,l=new Function(["scope"],`with (scope) { let __result = ${a}; return __result }`).call(r.context,o);return typeof l=="function"&&at?l.apply(o,s):l}}var ve="x-";function T(t=""){return ve+t}function yr(t){ve=t}var Dt={};function d(t,e){return Dt[t]=e,{before(r){if(!Dt[r]){console.warn(String.raw`Cannot find directive \`${r}\`. \`${t}\` will use the default order of execution`);return}let n=X.indexOf(r);X.splice(n>=0?n:X.indexOf("DEFAULT"),0,t)}}}function br(t){return Object.keys(Dt).includes(t)}function gt(t,e,r){if(e=Array.from(e),t._x_virtualDirectives){let o=Object.entries(t._x_virtualDirectives).map(([a,c])=>({name:a,value:c})),s=Se(o);o=o.map(a=>s.find(c=>c.name===a.name)?{name:`x-bind:${a.name}`,value:`"${a.value}"`}:a),e=e.concat(o)}let n={};return e.map(vr((o,s)=>n[o]=s)).filter(Ar).map(Zn(n,r)).sort(Qn).map(o=>Xn(t,o))}function Se(t){return Array.from(t).map(vr()).filter(e=>!Ar(e))}var we=!1,_t=new Map,wr=Symbol();function Er(t){we=!0;let e=Symbol();wr=e,_t.set(e,[]);let r=()=>{for(;_t.get(e).length;)_t.get(e).shift()();_t.delete(e)},n=()=>{we=!1,r()};t(r),n()}function xe(t){let e=[],r=a=>e.push(a),[n,i]=tr(t);return e.push(i),[{Alpine:K,effect:n,cleanup:r,evaluateLater:x.bind(x,t),evaluate:N.bind(N,t)},()=>e.forEach(a=>a())]}function Xn(t,e){let r=()=>{},n=Dt[e.type]||r,[i,o]=xe(t);Rt(t,e.original,o);let s=()=>{t._x_ignore||t._x_ignoreSelf||(n.inline&&n.inline(t,e,i),n=n.bind(n,t,e,i),we?_t.get(wr).push(n):n())};return s.runCleanups=o,s}var Pt=(t,e)=>({name:r,value:n})=>(r.startsWith(t)&&(r=r.replace(t,e)),{name:r,value:n}),It=t=>t;function vr(t=()=>{}){return({name:e,value:r})=>{let{name:n,value:i}=Sr.reduce((o,s)=>s(o),{name:e,value:r});return n!==e&&t(n,e),{name:n,value:i}}}var Sr=[];function ct(t){Sr.push(t)}function Ar({name:t}){return Or().test(t)}var Or=()=>new RegExp(`^${ve}([^:^.]+)\\b`);function Zn(t,e){return({name:r,value:n})=>{r===n&&(n="");let i=r.match(Or()),o=r.match(/:([a-zA-Z0-9\-_:]+)/),s=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],a=e||t[r]||r;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:s.map(c=>c.replace(".","")),expression:n,original:a}}}var Ee="DEFAULT",X=["ignore","ref","data","id","anchor","bind","init","for","model","modelable","transition","show","if",Ee,"teleport"];function Qn(t,e){let r=X.indexOf(t.type)===-1?Ee:t.type,n=X.indexOf(e.type)===-1?Ee:e.type;return X.indexOf(r)-X.indexOf(n)}function Z(t,e,r={}){t.dispatchEvent(new CustomEvent(e,{detail:r,bubbles:!0,composed:!0,cancelable:!0}))}function $(t,e){if(typeof ShadowRoot=="function"&&t instanceof ShadowRoot){Array.from(t.children).forEach(i=>$(i,e));return}let r=!1;if(e(t,()=>r=!0),r)return;let n=t.firstElementChild;for(;n;)$(n,e,!1),n=n.nextElementSibling}function w(t,...e){console.warn(`Alpine Warning: ${t}`,...e)}var Cr=!1;function Tr(){Cr&&w("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),Cr=!0,document.body||w("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"),mt(),or(e=>S(e,$)),it(e=>j(e)),Tt((e,r)=>{gt(e,r).forEach(n=>n())});let t=e=>!Q(e.parentElement,!0);Array.from(document.querySelectorAll(Nr().join(","))).filter(t).forEach(e=>{S(e)}),Z(document,"alpine:initialized"),setTimeout(()=>{ei()})}var Ae=[],Rr=[];function Mr(){return Ae.map(t=>t())}function Nr(){return Ae.concat(Rr).map(t=>t())}function $t(t){Ae.push(t)}function Lt(t){Rr.push(t)}function Q(t,e=!1){return L(t,r=>{if((e?Nr():Mr()).some(i=>r.matches(i)))return!0})}function L(t,e){if(t){if(e(t))return t;if(t._x_teleportBack&&(t=t._x_teleportBack),t.parentNode instanceof ShadowRoot)return L(t.parentNode.host,e);if(t.parentElement)return L(t.parentElement,e)}}function kr(t){return Mr().some(e=>t.matches(e))}var Dr=[];function Pr(t){Dr.push(t)}var ti=1;function S(t,e=$,r=()=>{}){L(t,n=>n._x_ignore)||Er(()=>{e(t,(n,i)=>{n._x_marker||(r(n,i),Dr.forEach(o=>o(n,i)),gt(n,n.attributes).forEach(o=>o()),n._x_ignore||(n._x_marker=ti++),n._x_ignore&&i())})})}function j(t,e=$){e(t,r=>{sr(r),fe(r),delete r._x_marker})}function ei(){[["ui","dialog",["[x-dialog], [x-popover]"]],["anchor","anchor",["[x-anchor]"]],["sort","sort",["[x-sort]"]]].forEach(([e,r,n])=>{br(r)||n.some(i=>{if(document.querySelector(i))return w(`found "${i}", but missing ${e} plugin`),!0})})}var Oe=[],Ce=!1;function lt(t=()=>{}){return queueMicrotask(()=>{Ce||setTimeout(()=>{jt()})}),new Promise(e=>{Oe.push(()=>{t(),e()})})}function jt(){for(Ce=!1;Oe.length;)Oe.shift()()}function Ir(){Ce=!0}function xt(t,e){return Array.isArray(e)?$r(t,e.join(" ")):typeof e=="object"&&e!==null?ri(t,e):typeof e=="function"?xt(t,e()):$r(t,e)}function $r(t,e){let r=o=>o.split(" ").filter(Boolean),n=o=>o.split(" ").filter(s=>!t.classList.contains(s)).filter(Boolean),i=o=>(t.classList.add(...o),()=>{t.classList.remove(...o)});return e=e===!0?e="":e||"",i(n(e))}function ri(t,e){let r=a=>a.split(" ").filter(Boolean),n=Object.entries(e).flatMap(([a,c])=>c?r(a):!1).filter(Boolean),i=Object.entries(e).flatMap(([a,c])=>c?!1:r(a)).filter(Boolean),o=[],s=[];return i.forEach(a=>{t.classList.contains(a)&&(t.classList.remove(a),s.push(a))}),n.forEach(a=>{t.classList.contains(a)||(t.classList.add(a),o.push(a))}),()=>{s.forEach(a=>t.classList.add(a)),o.forEach(a=>t.classList.remove(a))}}function tt(t,e){return typeof e=="object"&&e!==null?ni(t,e):ii(t,e)}function ni(t,e){let r={};return Object.entries(e).forEach(([n,i])=>{r[n]=t.style[n],n.startsWith("--")||(n=oi(n)),t.style.setProperty(n,i)}),setTimeout(()=>{t.style.length===0&&t.removeAttribute("style")}),()=>{tt(t,r)}}function ii(t,e){let r=t.getAttribute("style",e);return t.setAttribute("style",e),()=>{t.setAttribute("style",r||"")}}function oi(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function yt(t,e=()=>{}){let r=!1;return function(){r?e.apply(this,arguments):(r=!0,t.apply(this,arguments))}}d("transition",(t,{value:e,modifiers:r,expression:n},{evaluate:i})=>{typeof n=="function"&&(n=i(n)),n!==!1&&(!n||typeof n=="boolean"?ai(t,r,e):si(t,n,e))});function si(t,e,r){Lr(t,xt,""),{enter:i=>{t._x_transition.enter.during=i},"enter-start":i=>{t._x_transition.enter.start=i},"enter-end":i=>{t._x_transition.enter.end=i},leave:i=>{t._x_transition.leave.during=i},"leave-start":i=>{t._x_transition.leave.start=i},"leave-end":i=>{t._x_transition.leave.end=i}}[r](e)}function ai(t,e,r){Lr(t,tt);let n=!e.includes("in")&&!e.includes("out")&&!r,i=n||e.includes("in")||["enter"].includes(r),o=n||e.includes("out")||["leave"].includes(r);e.includes("in")&&!n&&(e=e.filter((m,b)=>b<e.indexOf("out"))),e.includes("out")&&!n&&(e=e.filter((m,b)=>b>e.indexOf("out")));let s=!e.includes("opacity")&&!e.includes("scale"),a=s||e.includes("opacity"),c=s||e.includes("scale"),l=a?0:1,u=c?bt(e,"scale",95)/100:1,p=bt(e,"delay",0)/1e3,v=bt(e,"origin","center"),O="opacity, transform",R=bt(e,"duration",150)/1e3,_=bt(e,"duration",75)/1e3,f="cubic-bezier(0.4, 0.0, 0.2, 1)";i&&(t._x_transition.enter.during={transformOrigin:v,transitionDelay:`${p}s`,transitionProperty:O,transitionDuration:`${R}s`,transitionTimingFunction:f},t._x_transition.enter.start={opacity:l,transform:`scale(${u})`},t._x_transition.enter.end={opacity:1,transform:"scale(1)"}),o&&(t._x_transition.leave.during={transformOrigin:v,transitionDelay:`${p}s`,transitionProperty:O,transitionDuration:`${_}s`,transitionTimingFunction:f},t._x_transition.leave.start={opacity:1,transform:"scale(1)"},t._x_transition.leave.end={opacity:l,transform:`scale(${u})`})}function Lr(t,e,r={}){t._x_transition||(t._x_transition={enter:{during:r,start:r,end:r},leave:{during:r,start:r,end:r},in(n=()=>{},i=()=>{}){Ft(t,e,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,i)},out(n=()=>{},i=()=>{}){Ft(t,e,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,i)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(t,e,r,n){let i=document.visibilityState==="visible"?requestAnimationFrame:setTimeout,o=()=>i(r);if(e){t._x_transition&&(t._x_transition.enter||t._x_transition.leave)?t._x_transition.enter&&(Object.entries(t._x_transition.enter.during).length||Object.entries(t._x_transition.enter.start).length||Object.entries(t._x_transition.enter.end).length)?t._x_transition.in(r):o():t._x_transition?t._x_transition.in(r):o();return}t._x_hidePromise=t._x_transition?new Promise((s,a)=>{t._x_transition.out(()=>{},()=>s(n)),t._x_transitioning&&t._x_transitioning.beforeCancel(()=>a({isFromCancelledTransition:!0}))}):Promise.resolve(n),queueMicrotask(()=>{let s=jr(t);s?(s._x_hideChildren||(s._x_hideChildren=[]),s._x_hideChildren.push(t)):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(t).catch(c=>{if(!c.isFromCancelledTransition)throw c})})})};function jr(t){let e=t.parentNode;if(e)return e._x_hidePromise?e:jr(e)}function Ft(t,e,{during:r,start:n,end:i}={},o=()=>{},s=()=>{}){if(t._x_transitioning&&t._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;ci(t,{start(){a=e(t,n)},during(){c=e(t,r)},before:o,end(){a(),l=e(t,i)},after:s,cleanup(){c(),l()}})}function ci(t,e){let r,n,i,o=yt(()=>{h(()=>{r=!0,n||e.before(),i||(e.end(),jt()),e.after(),t.isConnected&&e.cleanup(),delete t._x_transitioning})});t._x_transitioning={beforeCancels:[],beforeCancel(s){this.beforeCancels.push(s)},cancel:yt(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();o()}),finish:o},h(()=>{e.start(),e.during()}),Ir(),requestAnimationFrame(()=>{if(r)return;let s=Number(getComputedStyle(t).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,a=Number(getComputedStyle(t).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;s===0&&(s=Number(getComputedStyle(t).animationDuration.replace("s",""))*1e3),h(()=>{e.before()}),n=!0,requestAnimationFrame(()=>{r||(h(()=>{e.end()}),jt(),setTimeout(t._x_transitioning.finish,s+a),i=!0)})})}function bt(t,e,r){if(t.indexOf(e)===-1)return r;let n=t[t.indexOf(e)+1];if(!n||e==="scale"&&isNaN(n))return r;if(e==="duration"||e==="delay"){let i=n.match(/([0-9]+)ms/);if(i)return i[1]}return e==="origin"&&["top","right","left","center","bottom"].includes(t[t.indexOf(e)+2])?[n,t[t.indexOf(e)+2]].join(" "):n}var F=!1;function A(t,e=()=>{}){return(...r)=>F?e(...r):t(...r)}function Fr(t){return(...e)=>F&&t(...e)}var Br=[];function q(t){Br.push(t)}function zr(t,e){Br.forEach(r=>r(t,e)),F=!0,Kr(()=>{S(e,(r,n)=>{n(r,()=>{})})}),F=!1}var Bt=!1;function Hr(t,e){e._x_dataStack||(e._x_dataStack=t._x_dataStack),F=!0,Bt=!0,Kr(()=>{li(e)}),F=!1,Bt=!1}function li(t){let e=!1;S(t,(n,i)=>{$(n,(o,s)=>{if(e&&kr(o))return s();e=!0,i(o,s)})})}function Kr(t){let e=D;ue((r,n)=>{let i=e(r);return z(i),()=>{}}),t(),ue(e)}function wt(t,e,r,n=[]){switch(t._x_bindings||(t._x_bindings=M({})),t._x_bindings[e]=r,e=n.includes("camel")?gi(e):e,e){case"value":ui(t,r);break;case"style":di(t,r);break;case"class":fi(t,r);break;case"selected":case"checked":pi(t,e,r);break;default:Ur(t,e,r);break}}function ui(t,e){if(Te(t))t.attributes.value===void 0&&(t.value=e),window.fromModel&&(typeof e=="boolean"?t.checked=Et(t.value)===e:t.checked=Vr(t.value,e));else if(zt(t))Number.isInteger(e)?t.value=e:!Array.isArray(e)&&typeof e!="boolean"&&![null,void 0].includes(e)?t.value=String(e):Array.isArray(e)?t.checked=e.some(r=>Vr(r,t.value)):t.checked=!!e;else if(t.tagName==="SELECT")_i(t,e);else{if(t.value===e)return;t.value=e===void 0?"":e}}function fi(t,e){t._x_undoAddedClasses&&t._x_undoAddedClasses(),t._x_undoAddedClasses=xt(t,e)}function di(t,e){t._x_undoAddedStyles&&t._x_undoAddedStyles(),t._x_undoAddedStyles=tt(t,e)}function pi(t,e,r){Ur(t,e,r),hi(t,e,r)}function Ur(t,e,r){[null,void 0,!1].includes(r)&&yi(e)?t.removeAttribute(e):(qr(e)&&(r=e),mi(t,e,r))}function mi(t,e,r){t.getAttribute(e)!=r&&t.setAttribute(e,r)}function hi(t,e,r){t[e]!==r&&(t[e]=r)}function _i(t,e){let r=[].concat(e).map(n=>n+"");Array.from(t.options).forEach(n=>{n.selected=r.includes(n.value)})}function gi(t){return t.toLowerCase().replace(/-(\w)/g,(e,r)=>r.toUpperCase())}function Vr(t,e){return t==e}function Et(t){return[1,"1","true","on","yes",!0].includes(t)?!0:[0,"0","false","off","no",!1].includes(t)?!1:t?Boolean(t):null}var xi=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","shadowrootclonable","shadowrootdelegatesfocus","shadowrootserializable"]);function qr(t){return xi.has(t)}function yi(t){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(t)}function Wr(t,e,r){return t._x_bindings&&t._x_bindings[e]!==void 0?t._x_bindings[e]:Jr(t,e,r)}function Gr(t,e,r,n=!0){if(t._x_bindings&&t._x_bindings[e]!==void 0)return t._x_bindings[e];if(t._x_inlineBindings&&t._x_inlineBindings[e]!==void 0){let i=t._x_inlineBindings[e];return i.extract=n,kt(()=>N(t,i.expression))}return Jr(t,e,r)}function Jr(t,e,r){let n=t.getAttribute(e);return n===null?typeof r=="function"?r():r:n===""?!0:qr(e)?!![e,"true"].includes(n):n}function zt(t){return t.type==="checkbox"||t.localName==="ui-checkbox"||t.localName==="ui-switch"}function Te(t){return t.type==="radio"||t.localName==="ui-radio"}function Ht(t,e){let r;return function(){let n=this,i=arguments,o=function(){r=null,t.apply(n,i)};clearTimeout(r),r=setTimeout(o,e)}}function Kt(t,e){let r;return function(){let n=this,i=arguments;r||(t.apply(n,i),r=!0,setTimeout(()=>r=!1,e))}}function Vt({get:t,set:e},{get:r,set:n}){let i=!0,o,s,a=D(()=>{let c=t(),l=r();if(i)n(Re(c)),i=!1;else{let u=JSON.stringify(c),p=JSON.stringify(l);u!==o?n(Re(c)):u!==p&&e(Re(l))}o=JSON.stringify(t()),s=JSON.stringify(r())});return()=>{z(a)}}function Re(t){return typeof t=="object"?JSON.parse(JSON.stringify(t)):t}function Yr(t){(Array.isArray(t)?t:[t]).forEach(r=>r(K))}var et={},Xr=!1;function Zr(t,e){if(Xr||(et=M(et),Xr=!0),e===void 0)return et[t];et[t]=e,ot(et[t]),typeof e=="object"&&e!==null&&e.hasOwnProperty("init")&&typeof e.init=="function"&&et[t].init()}function Qr(){return et}var tn={};function en(t,e){let r=typeof e!="function"?()=>e:e;return t instanceof Element?Me(t,r()):(tn[t]=r,()=>{})}function rn(t){return Object.entries(tn).forEach(([e,r])=>{Object.defineProperty(t,e,{get(){return(...n)=>r(...n)}})}),t}function Me(t,e,r){let n=[];for(;n.length;)n.pop()();let i=Object.entries(e).map(([s,a])=>({name:s,value:a})),o=Se(i);return i=i.map(s=>o.find(a=>a.name===s.name)?{name:`x-bind:${s.name}`,value:`"${s.value}"`}:s),gt(t,i,r).map(s=>{n.push(s.runCleanups),s()}),()=>{for(;n.length;)n.pop()()}}var nn={};function on(t,e){nn[t]=e}function sn(t,e){return Object.entries(nn).forEach(([r,n])=>{Object.defineProperty(t,r,{get(){return(...i)=>n.bind(e)(...i)},enumerable:!1})}),t}var bi={get reactive(){return M},get release(){return z},get effect(){return D},get raw(){return le},get transaction(){return er},version:"3.15.8",flushAndStopDeferringMutations:cr,dontAutoEvaluateFunctions:kt,disableEffectScheduling:Ze,startObservingMutations:mt,stopObservingMutations:me,setReactivityEngine:Qe,onAttributeRemoved:Rt,onAttributesAdded:Tt,closestDataStack:H,skipDuringClone:A,onlyDuringClone:Fr,addRootSelector:$t,addInitSelector:Lt,setErrorHandler:dr,interceptClone:q,addScopeToNode:P,deferMutations:ar,mapAttributes:ct,evaluateLater:x,interceptInit:Pr,initInterceptors:ot,injectMagics:U,setEvaluator:mr,setRawEvaluator:_r,mergeProxies:I,extractProp:Gr,findClosest:L,onElRemoved:it,closestRoot:Q,destroyTree:j,interceptor:Nt,transition:Ft,setStyles:tt,mutateDom:h,directive:d,entangle:Vt,throttle:Kt,debounce:Ht,evaluate:N,evaluateRaw:gr,initTree:S,nextTick:lt,prefixed:T,prefix:yr,plugin:Yr,magic:y,store:Zr,start:Tr,clone:Hr,cloneNode:zr,bound:Wr,$data:Mt,watch:Ot,walk:$,data:on,bind:en},K=bi;function Ne(t,e){let r=Object.create(null),n=t.split(",");for(let i=0;i<n.length;i++)r[n[i]]=!0;return e?i=>!!r[i.toLowerCase()]:i=>!!r[i]}var wi="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly";var Gs=Ne(wi+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var an=Object.freeze({}),Js=Object.freeze([]);var Ei=Object.prototype.hasOwnProperty,vt=(t,e)=>Ei.call(t,e),W=Array.isArray,ut=t=>cn(t)==="[object Map]";var vi=t=>typeof t=="string",Ut=t=>typeof t=="symbol",St=t=>t!==null&&typeof t=="object";var Si=Object.prototype.toString,cn=t=>Si.call(t),ke=t=>cn(t).slice(8,-1);var qt=t=>vi(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t;var Wt=t=>{let e=Object.create(null);return r=>e[r]||(e[r]=t(r))},Ai=/-(\w)/g,Ys=Wt(t=>t.replace(Ai,(e,r)=>r?r.toUpperCase():"")),Oi=/\B([A-Z])/g,Xs=Wt(t=>t.replace(Oi,"-$1").toLowerCase()),De=Wt(t=>t.charAt(0).toUpperCase()+t.slice(1)),Zs=Wt(t=>t?`on${De(t)}`:""),Pe=(t,e)=>t!==e&&(t===t||e===e);var Ie=new WeakMap,At=[],B,rt=Symbol("iterate"),$e=Symbol("Map key iterate");function Ci(t){return t&&t._isEffect===!0}function mn(t,e=an){Ci(t)&&(t=t.raw);let r=Ri(t,e);return e.lazy||r(),r}function hn(t){t.active&&(_n(t),t.options.onStop&&t.options.onStop(),t.active=!1)}var Ti=0;function Ri(t,e){let r=function(){if(!r.active)return t();if(!At.includes(r)){_n(r);try{return Ni(),At.push(r),B=r,t()}finally{At.pop(),gn(),B=At[At.length-1]}}};return r.id=Ti++,r.allowRecurse=!!e.allowRecurse,r._isEffect=!0,r.active=!0,r.raw=t,r.deps=[],r.options=e,r}function _n(t){let{deps:e}=t;if(e.length){for(let r=0;r<e.length;r++)e[r].delete(t);e.length=0}}var ft=!0,je=[];function Mi(){je.push(ft),ft=!1}function Ni(){je.push(ft),ft=!0}function gn(){let t=je.pop();ft=t===void 0?!0:t}function k(t,e,r){if(!ft||B===void 0)return;let n=Ie.get(t);n||Ie.set(t,n=new Map);let i=n.get(r);i||n.set(r,i=new Set),i.has(B)||(i.add(B),B.deps.push(i),B.options.onTrack&&B.options.onTrack({effect:B,target:t,type:e,key:r}))}function J(t,e,r,n,i,o){let s=Ie.get(t);if(!s)return;let a=new Set,c=u=>{u&&u.forEach(p=>{(p!==B||p.allowRecurse)&&a.add(p)})};if(e==="clear")s.forEach(c);else if(r==="length"&&W(t))s.forEach((u,p)=>{(p==="length"||p>=n)&&c(u)});else switch(r!==void 0&&c(s.get(r)),e){case"add":W(t)?qt(r)&&c(s.get("length")):(c(s.get(rt)),ut(t)&&c(s.get($e)));break;case"delete":W(t)||(c(s.get(rt)),ut(t)&&c(s.get($e)));break;case"set":ut(t)&&c(s.get(rt));break}let l=u=>{u.options.onTrigger&&u.options.onTrigger({effect:u,target:t,key:r,type:e,newValue:n,oldValue:i,oldTarget:o}),u.options.scheduler?u.options.scheduler(u):u()};a.forEach(l)}var ki=Ne("__proto__,__v_isRef,__isVue"),xn=new Set(Object.getOwnPropertyNames(Symbol).map(t=>Symbol[t]).filter(Ut)),Di=yn();var Pi=yn(!0);var ln=Ii();function Ii(){let t={};return["includes","indexOf","lastIndexOf"].forEach(e=>{t[e]=function(...r){let n=g(this);for(let o=0,s=this.length;o<s;o++)k(n,"get",o+"");let i=n[e](...r);return i===-1||i===!1?n[e](...r.map(g)):i}}),["push","pop","shift","unshift","splice"].forEach(e=>{t[e]=function(...r){Mi();let n=g(this)[e].apply(this,r);return gn(),n}}),t}function yn(t=!1,e=!1){return function(n,i,o){if(i==="__v_isReactive")return!t;if(i==="__v_isReadonly")return t;if(i==="__v_raw"&&o===(t?e?Xi:vn:e?Yi:En).get(n))return n;let s=W(n);if(!t&&s&&vt(ln,i))return Reflect.get(ln,i,o);let a=Reflect.get(n,i,o);return(Ut(i)?xn.has(i):ki(i))||(t||k(n,"get",i),e)?a:Le(a)?!s||!qt(i)?a.value:a:St(a)?t?Sn(a):te(a):a}}var $i=Li();function Li(t=!1){return function(r,n,i,o){let s=r[n];if(!t&&(i=g(i),s=g(s),!W(r)&&Le(s)&&!Le(i)))return s.value=i,!0;let a=W(r)&&qt(n)?Number(n)<r.length:vt(r,n),c=Reflect.set(r,n,i,o);return r===g(o)&&(a?Pe(i,s)&&J(r,"set",n,i,s):J(r,"add",n,i)),c}}function ji(t,e){let r=vt(t,e),n=t[e],i=Reflect.deleteProperty(t,e);return i&&r&&J(t,"delete",e,void 0,n),i}function Fi(t,e){let r=Reflect.has(t,e);return(!Ut(e)||!xn.has(e))&&k(t,"has",e),r}function Bi(t){return k(t,"iterate",W(t)?"length":rt),Reflect.ownKeys(t)}var zi={get:Di,set:$i,deleteProperty:ji,has:Fi,ownKeys:Bi},Hi={get:Pi,set(t,e){return console.warn(`Set operation on key "${String(e)}" failed: target is readonly.`,t),!0},deleteProperty(t,e){return console.warn(`Delete operation on key "${String(e)}" failed: target is readonly.`,t),!0}};var Fe=t=>St(t)?te(t):t,Be=t=>St(t)?Sn(t):t,ze=t=>t,Qt=t=>Reflect.getPrototypeOf(t);function Gt(t,e,r=!1,n=!1){t=t.__v_raw;let i=g(t),o=g(e);e!==o&&!r&&k(i,"get",e),!r&&k(i,"get",o);let{has:s}=Qt(i),a=n?ze:r?Be:Fe;if(s.call(i,e))return a(t.get(e));if(s.call(i,o))return a(t.get(o));t!==i&&t.get(e)}function Jt(t,e=!1){let r=this.__v_raw,n=g(r),i=g(t);return t!==i&&!e&&k(n,"has",t),!e&&k(n,"has",i),t===i?r.has(t):r.has(t)||r.has(i)}function Yt(t,e=!1){return t=t.__v_raw,!e&&k(g(t),"iterate",rt),Reflect.get(t,"size",t)}function un(t){t=g(t);let e=g(this);return Qt(e).has.call(e,t)||(e.add(t),J(e,"add",t,t)),this}function fn(t,e){e=g(e);let r=g(this),{has:n,get:i}=Qt(r),o=n.call(r,t);o?wn(r,n,t):(t=g(t),o=n.call(r,t));let s=i.call(r,t);return r.set(t,e),o?Pe(e,s)&&J(r,"set",t,e,s):J(r,"add",t,e),this}function dn(t){let e=g(this),{has:r,get:n}=Qt(e),i=r.call(e,t);i?wn(e,r,t):(t=g(t),i=r.call(e,t));let o=n?n.call(e,t):void 0,s=e.delete(t);return i&&J(e,"delete",t,void 0,o),s}function pn(){let t=g(this),e=t.size!==0,r=ut(t)?new Map(t):new Set(t),n=t.clear();return e&&J(t,"clear",void 0,void 0,r),n}function Xt(t,e){return function(n,i){let o=this,s=o.__v_raw,a=g(s),c=e?ze:t?Be:Fe;return!t&&k(a,"iterate",rt),s.forEach((l,u)=>n.call(i,c(l),c(u),o))}}function Zt(t,e,r){return function(...n){let i=this.__v_raw,o=g(i),s=ut(o),a=t==="entries"||t===Symbol.iterator&&s,c=t==="keys"&&s,l=i[t](...n),u=r?ze:e?Be:Fe;return!e&&k(o,"iterate",c?$e:rt),{next(){let{value:p,done:v}=l.next();return v?{value:p,done:v}:{value:a?[u(p[0]),u(p[1])]:u(p),done:v}},[Symbol.iterator](){return this}}}}function G(t){return function(...e){{let r=e[0]?`on key "${e[0]}" `:"";console.warn(`${De(t)} operation ${r}failed: target is readonly.`,g(this))}return t==="delete"?!1:this}}function Ki(){let t={get(o){return Gt(this,o)},get size(){return Yt(this)},has:Jt,add:un,set:fn,delete:dn,clear:pn,forEach:Xt(!1,!1)},e={get(o){return Gt(this,o,!1,!0)},get size(){return Yt(this)},has:Jt,add:un,set:fn,delete:dn,clear:pn,forEach:Xt(!1,!0)},r={get(o){return Gt(this,o,!0)},get size(){return Yt(this,!0)},has(o){return Jt.call(this,o,!0)},add:G("add"),set:G("set"),delete:G("delete"),clear:G("clear"),forEach:Xt(!0,!1)},n={get(o){return Gt(this,o,!0,!0)},get size(){return Yt(this,!0)},has(o){return Jt.call(this,o,!0)},add:G("add"),set:G("set"),delete:G("delete"),clear:G("clear"),forEach:Xt(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(o=>{t[o]=Zt(o,!1,!1),r[o]=Zt(o,!0,!1),e[o]=Zt(o,!1,!0),n[o]=Zt(o,!0,!0)}),[t,r,e,n]}var[Vi,Ui,qi,Wi]=Ki();function bn(t,e){let r=e?t?Wi:qi:t?Ui:Vi;return(n,i,o)=>i==="__v_isReactive"?!t:i==="__v_isReadonly"?t:i==="__v_raw"?n:Reflect.get(vt(r,i)&&i in n?r:n,i,o)}var Gi={get:bn(!1,!1)};var Ji={get:bn(!0,!1)};function wn(t,e,r){let n=g(r);if(n!==r&&e.call(t,n)){let i=ke(t);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 En=new WeakMap,Yi=new WeakMap,vn=new WeakMap,Xi=new WeakMap;function Zi(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Qi(t){return t.__v_skip||!Object.isExtensible(t)?0:Zi(ke(t))}function te(t){return t&&t.__v_isReadonly?t:An(t,!1,zi,Gi,En)}function Sn(t){return An(t,!0,Hi,Ji,vn)}function An(t,e,r,n,i){if(!St(t))return console.warn(`value cannot be made reactive: ${String(t)}`),t;if(t.__v_raw&&!(e&&t.__v_isReactive))return t;let o=i.get(t);if(o)return o;let s=Qi(t);if(s===0)return t;let a=new Proxy(t,s===2?n:r);return i.set(t,a),a}function g(t){return t&&g(t.__v_raw)||t}function Le(t){return Boolean(t&&t.__v_isRef===!0)}y("nextTick",()=>lt);y("dispatch",t=>Z.bind(Z,t));y("watch",(t,{evaluateLater:e,cleanup:r})=>(n,i)=>{let o=e(n),a=Ot(()=>{let c;return o(l=>c=l),c},i);r(a)});y("store",Qr);y("data",t=>Mt(t));y("root",t=>Q(t));y("refs",t=>(t._x_refs_proxy||(t._x_refs_proxy=I(to(t))),t._x_refs_proxy));function to(t){let e=[];return L(t,r=>{r._x_refs&&e.push(r._x_refs)}),e}var He={};function Ke(t){return He[t]||(He[t]=0),++He[t]}function On(t,e){return L(t,r=>{if(r._x_ids&&r._x_ids[e])return!0})}function Cn(t,e){t._x_ids||(t._x_ids={}),t._x_ids[e]||(t._x_ids[e]=Ke(e))}y("id",(t,{cleanup:e})=>(r,n=null)=>{let i=`${r}${n?`-${n}`:""}`;return eo(t,i,e,()=>{let o=On(t,r),s=o?o._x_ids[r]:Ke(r);return n?`${r}-${s}-${n}`:`${r}-${s}`})});q((t,e)=>{t._x_id&&(e._x_id=t._x_id)});function eo(t,e,r,n){if(t._x_id||(t._x_id={}),t._x_id[e])return t._x_id[e];let i=n();return t._x_id[e]=i,r(()=>{delete t._x_id[e]}),i}y("el",t=>t);Tn("Focus","focus","focus");Tn("Persist","persist","persist");function Tn(t,e,r){y(e,n=>w(`You can't use [$${e}] without first installing the "${t}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}d("modelable",(t,{expression:e},{effect:r,evaluateLater:n,cleanup:i})=>{let o=n(e),s=()=>{let u;return o(p=>u=p),u},a=n(`${e} = __placeholder`),c=u=>a(()=>{},{scope:{__placeholder:u}}),l=s();c(l),queueMicrotask(()=>{if(!t._x_model)return;t._x_removeModelListeners.default();let u=t._x_model.get,p=t._x_model.set,v=Vt({get(){return u()},set(O){p(O)}},{get(){return s()},set(O){c(O)}});i(v)})});d("teleport",(t,{modifiers:e,expression:r},{cleanup:n})=>{t.tagName.toLowerCase()!=="template"&&w("x-teleport can only be used on a <template> tag",t);let i=Rn(r),o=t.content.cloneNode(!0).firstElementChild;t._x_teleport=o,o._x_teleportBack=t,t.setAttribute("data-teleport-template",!0),o.setAttribute("data-teleport-target",!0),t._x_forwardEvents&&t._x_forwardEvents.forEach(a=>{o.addEventListener(a,c=>{c.stopPropagation(),t.dispatchEvent(new c.constructor(c.type,c))})}),P(o,{},t);let s=(a,c,l)=>{l.includes("prepend")?c.parentNode.insertBefore(a,c):l.includes("append")?c.parentNode.insertBefore(a,c.nextSibling):c.appendChild(a)};h(()=>{s(o,i,e),A(()=>{S(o)})()}),t._x_teleportPutBack=()=>{let a=Rn(r);h(()=>{s(t._x_teleport,a,e)})},n(()=>h(()=>{o.remove(),j(o)}))});var ro=document.createElement("div");function Rn(t){let e=A(()=>document.querySelector(t),()=>ro)();return e||w(`Cannot find x-teleport element for selector: "${t}"`),e}var Mn=()=>{};Mn.inline=(t,{modifiers:e},{cleanup:r})=>{e.includes("self")?t._x_ignoreSelf=!0:t._x_ignore=!0,r(()=>{e.includes("self")?delete t._x_ignoreSelf:delete t._x_ignore})};d("ignore",Mn);d("effect",A((t,{expression:e},{effect:r})=>{r(x(t,e))}));function V(t,e,r,n){let i=t,o=c=>n(c),s={},a=(c,l)=>u=>l(c,u);if(r.includes("dot")&&(e=no(e)),r.includes("camel")&&(e=io(e)),r.includes("passive")&&(s.passive=!0),r.includes("capture")&&(s.capture=!0),r.includes("window")&&(i=window),r.includes("document")&&(i=document),r.includes("debounce")){let c=r[r.indexOf("debounce")+1]||"invalid-wait",l=ee(c.split("ms")[0])?Number(c.split("ms")[0]):250;o=Ht(o,l)}if(r.includes("throttle")){let c=r[r.indexOf("throttle")+1]||"invalid-wait",l=ee(c.split("ms")[0])?Number(c.split("ms")[0]):250;o=Kt(o,l)}return 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("once")&&(o=a(o,(c,l)=>{c(l),i.removeEventListener(e,o,s)})),(r.includes("away")||r.includes("outside"))&&(i=document,o=a(o,(c,l)=>{t.contains(l.target)||l.target.isConnected!==!1&&(t.offsetWidth<1&&t.offsetHeight<1||t._x_isShown!==!1&&c(l))})),r.includes("self")&&(o=a(o,(c,l)=>{l.target===t&&c(l)})),e==="submit"&&(o=a(o,(c,l)=>{l.target._x_pendingModelUpdates&&l.target._x_pendingModelUpdates.forEach(u=>u()),c(l)})),(so(e)||kn(e))&&(o=a(o,(c,l)=>{ao(l,r)||c(l)})),i.addEventListener(e,o,s),()=>{i.removeEventListener(e,o,s)}}function no(t){return t.replace(/-/g,".")}function io(t){return t.toLowerCase().replace(/-(\w)/g,(e,r)=>r.toUpperCase())}function ee(t){return!Array.isArray(t)&&!isNaN(t)}function oo(t){return[" ","_"].includes(t)?t:t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function so(t){return["keydown","keyup"].includes(t)}function kn(t){return["contextmenu","click","mouse"].some(e=>t.includes(e))}function ao(t,e){let r=e.filter(o=>!["window","document","prevent","stop","once","capture","self","away","outside","passive","preserve-scroll","blur","change","lazy"].includes(o));if(r.includes("debounce")){let o=r.indexOf("debounce");r.splice(o,ee((r[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.includes("throttle")){let o=r.indexOf("throttle");r.splice(o,ee((r[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.length===0||r.length===1&&Nn(t.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"),t[`${s}Key`])).length===i.length&&(kn(t.type)||Nn(t.key).includes(r[0])))}function Nn(t){if(!t)return[];t=oo(t);let e={ctrl:"control",slash:"/",space:" ",spacebar:" ",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",comma:",",equal:"=",minus:"-",underscore:"_"};return e[t]=t,Object.keys(e).map(r=>{if(e[r]===t)return r}).filter(r=>r)}d("model",(t,{modifiers:e,expression:r},{effect:n,cleanup:i})=>{let o=t;e.includes("parent")&&(o=t.parentNode);let s=x(o,r),a;typeof r=="string"?a=x(o,`${r} = __placeholder`):typeof r=="function"&&typeof r()=="string"?a=x(o,`${r()} = __placeholder`):a=()=>{};let c=()=>{let _;return s(f=>_=f),Dn(_)?_.get():_},l=_=>{let f;s(m=>f=m),Dn(f)?f.set(_):a(()=>{},{scope:{__placeholder:_}})};typeof r=="string"&&t.type==="radio"&&h(()=>{t.hasAttribute("name")||t.setAttribute("name",r)});let u=e.includes("change")||e.includes("lazy"),p=e.includes("blur"),v=e.includes("enter"),O=u||p||v,R;if(F)R=()=>{};else if(O){let _=[],f=m=>l(re(t,e,m,c()));if(u&&_.push(V(t,"change",e,f)),p&&(_.push(V(t,"blur",e,f)),t.form)){let m=()=>f({target:t});t.form._x_pendingModelUpdates||(t.form._x_pendingModelUpdates=[]),t.form._x_pendingModelUpdates.push(m),i(()=>t.form._x_pendingModelUpdates.splice(t.form._x_pendingModelUpdates.indexOf(m),1))}v&&_.push(V(t,"keydown",e,m=>{m.key==="Enter"&&f(m)})),R=()=>_.forEach(m=>m())}else{let _=t.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(t.type)?"change":"input";R=V(t,_,e,f=>{l(re(t,e,f,c()))})}if(e.includes("fill")&&([void 0,null,""].includes(c())||zt(t)&&Array.isArray(c())||t.tagName.toLowerCase()==="select"&&t.multiple)&&l(re(t,e,{target:t},c())),t._x_removeModelListeners||(t._x_removeModelListeners={}),t._x_removeModelListeners.default=R,i(()=>t._x_removeModelListeners.default()),t.form){let _=V(t.form,"reset",[],f=>{lt(()=>t._x_model&&t._x_model.set(re(t,e,{target:t},c())))});i(()=>_())}t._x_model={get(){return c()},set(_){l(_)}},t._x_forceModelUpdate=_=>{_===void 0&&typeof r=="string"&&r.match(/\./)&&(_=""),window.fromModel=!0,h(()=>wt(t,"value",_)),delete window.fromModel},n(()=>{let _=c();e.includes("unintrusive")&&document.activeElement.isSameNode(t)||t._x_forceModelUpdate(_)})});function re(t,e,r,n){return h(()=>{if(r instanceof CustomEvent&&r.detail!==void 0)return r.detail!==null&&r.detail!==void 0?r.detail:r.target.value;if(zt(t))if(Array.isArray(n)){let i=null;return e.includes("number")?i=Ve(r.target.value):e.includes("boolean")?i=Et(r.target.value):i=r.target.value,r.target.checked?n.includes(i)?n:n.concat([i]):n.filter(o=>!co(o,i))}else return r.target.checked;else{if(t.tagName.toLowerCase()==="select"&&t.multiple)return e.includes("number")?Array.from(r.target.selectedOptions).map(i=>{let o=i.value||i.text;return Ve(o)}):e.includes("boolean")?Array.from(r.target.selectedOptions).map(i=>{let o=i.value||i.text;return Et(o)}):Array.from(r.target.selectedOptions).map(i=>i.value||i.text);{let i;return Te(t)?r.target.checked?i=r.target.value:i=n:i=r.target.value,e.includes("number")?Ve(i):e.includes("boolean")?Et(i):e.includes("trim")?i.trim():i}}})}function Ve(t){let e=t?parseFloat(t):null;return lo(e)?e:t}function co(t,e){return t==e}function lo(t){return!Array.isArray(t)&&!isNaN(t)}function Dn(t){return t!==null&&typeof t=="object"&&typeof t.get=="function"&&typeof t.set=="function"}d("cloak",t=>queueMicrotask(()=>h(()=>t.removeAttribute(T("cloak")))));Lt(()=>`[${T("init")}]`);d("init",A((t,{expression:e},{evaluate:r})=>typeof e=="string"?!!e.trim()&&r(e,{},!1):r(e,{},!1)));d("text",(t,{expression:e},{effect:r,evaluateLater:n})=>{let i=n(e);r(()=>{i(o=>{h(()=>{t.textContent=o})})})});d("html",(t,{expression:e},{effect:r,evaluateLater:n})=>{let i=n(e);r(()=>{i(o=>{h(()=>{t.innerHTML=o,t._x_ignoreSelf=!0,S(t),delete t._x_ignoreSelf})})})});ct(Pt(":",It(T("bind:"))));var Pn=(t,{value:e,modifiers:r,expression:n,original:i},{effect:o,cleanup:s})=>{if(!e){let c={};rn(c),x(t,n)(u=>{Me(t,u,i)},{scope:c});return}if(e==="key")return uo(t,n);if(t._x_inlineBindings&&t._x_inlineBindings[e]&&t._x_inlineBindings[e].extract)return;let a=x(t,n);o(()=>a(c=>{c===void 0&&typeof n=="string"&&n.match(/\./)&&(c=""),h(()=>wt(t,e,c,r))})),s(()=>{t._x_undoAddedClasses&&t._x_undoAddedClasses(),t._x_undoAddedStyles&&t._x_undoAddedStyles()})};Pn.inline=(t,{value:e,modifiers:r,expression:n})=>{e&&(t._x_inlineBindings||(t._x_inlineBindings={}),t._x_inlineBindings[e]={expression:n,extract:!1})};d("bind",Pn);function uo(t,e){t._x_keyExpression=e}$t(()=>`[${T("data")}]`);d("data",(t,{expression:e},{cleanup:r})=>{if(fo(t))return;e=e===""?"{}":e;let n={};U(n,t);let i={};sn(i,n);let o=N(t,e,{scope:i});(o===void 0||o===!0)&&(o={}),U(o,t);let s=M(o);ot(s);let a=P(t,s);s.init&&N(t,s.init),r(()=>{s.destroy&&N(t,s.destroy),a()})});q((t,e)=>{t._x_dataStack&&(e._x_dataStack=t._x_dataStack,e.setAttribute("data-has-alpine-state",!0))});function fo(t){return F?Bt?!0:t.hasAttribute("data-has-alpine-state"):!1}d("show",(t,{modifiers:e,expression:r},{effect:n})=>{let i=x(t,r);t._x_doHide||(t._x_doHide=()=>{h(()=>{t.style.setProperty("display","none",e.includes("important")?"important":void 0)})}),t._x_doShow||(t._x_doShow=()=>{h(()=>{t.style.length===1&&t.style.display==="none"?t.removeAttribute("style"):t.style.removeProperty("display")})});let o=()=>{t._x_doHide(),t._x_isShown=!1},s=()=>{t._x_doShow(),t._x_isShown=!0},a=()=>setTimeout(s),c=yt(p=>p?s():o(),p=>{typeof t._x_toggleAndCascadeWithTransitions=="function"?t._x_toggleAndCascadeWithTransitions(t,p,s,o):p?a():o()}),l,u=!0;n(()=>i(p=>{!u&&p===l||(e.includes("immediate")&&(p?a():o()),c(p),l=p,u=!1)}))});d("for",(t,{expression:e},{effect:r,cleanup:n})=>{let i=mo(e),o=x(t,i.items),s=x(t,t._x_keyExpression||"index");t._x_prevKeys=[],t._x_lookup={},r(()=>po(t,i,o,s)),n(()=>{Object.values(t._x_lookup).forEach(a=>h(()=>{j(a),a.remove()})),delete t._x_prevKeys,delete t._x_lookup})});function po(t,e,r,n){let i=s=>typeof s=="object"&&!Array.isArray(s),o=t;r(s=>{ho(s)&&s>=0&&(s=Array.from(Array(s).keys(),f=>f+1)),s===void 0&&(s=[]);let a=t._x_lookup,c=t._x_prevKeys,l=[],u=[];if(i(s))s=Object.entries(s).map(([f,m])=>{let b=In(e,m,f,s);n(E=>{u.includes(E)&&w("Duplicate key on x-for",t),u.push(E)},{scope:{index:f,...b}}),l.push(b)});else for(let f=0;f<s.length;f++){let m=In(e,s[f],f,s);n(b=>{u.includes(b)&&w("Duplicate key on x-for",t),u.push(b)},{scope:{index:f,...m}}),l.push(m)}let p=[],v=[],O=[],R=[];for(let f=0;f<c.length;f++){let m=c[f];u.indexOf(m)===-1&&O.push(m)}c=c.filter(f=>!O.includes(f));let _="template";for(let f=0;f<u.length;f++){let m=u[f],b=c.indexOf(m);if(b===-1)c.splice(f,0,m),p.push([_,f]);else if(b!==f){let E=c.splice(f,1)[0],C=c.splice(b-1,1)[0];c.splice(f,0,C),c.splice(b,0,E),v.push([E,C])}else R.push(m);_=m}for(let f=0;f<O.length;f++){let m=O[f];m in a&&(h(()=>{j(a[m]),a[m].remove()}),delete a[m])}for(let f=0;f<v.length;f++){let[m,b]=v[f],E=a[m],C=a[b],nt=document.createElement("div");h(()=>{C||w('x-for ":key" is undefined or invalid',o,b,a),C.after(nt),E.after(C),C._x_currentIfEl&&C.after(C._x_currentIfEl),nt.before(E),E._x_currentIfEl&&E.after(E._x_currentIfEl),nt.remove()}),C._x_refreshXForScope(l[u.indexOf(b)])}for(let f=0;f<p.length;f++){let[m,b]=p[f],E=m==="template"?o:a[m];E._x_currentIfEl&&(E=E._x_currentIfEl);let C=l[b],nt=u[b],dt=document.importNode(o.content,!0).firstElementChild,qe=M(C);P(dt,qe,o),dt._x_refreshXForScope=Ln=>{Object.entries(Ln).forEach(([jn,Fn])=>{qe[jn]=Fn})},h(()=>{E.after(dt),A(()=>S(dt))()}),typeof nt=="object"&&w("x-for key cannot be an object, it must be a string or an integer",o),a[nt]=dt}for(let f=0;f<R.length;f++)a[R[f]]._x_refreshXForScope(l[u.indexOf(R[f])]);o._x_prevKeys=u})}function mo(t){let e=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,r=/^\s*\(|\)\s*$/g,n=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,i=t.match(n);if(!i)return;let o={};o.items=i[2].trim();let s=i[1].replace(r,"").trim(),a=s.match(e);return a?(o.item=s.replace(e,"").trim(),o.index=a[1].trim(),a[2]&&(o.collection=a[2].trim())):o.item=s,o}function In(t,e,r,n){let i={};return/^\[.*\]$/.test(t.item)&&Array.isArray(e)?t.item.replace("[","").replace("]","").split(",").map(s=>s.trim()).forEach((s,a)=>{i[s]=e[a]}):/^\{.*\}$/.test(t.item)&&!Array.isArray(e)&&typeof e=="object"?t.item.replace("{","").replace("}","").split(",").map(s=>s.trim()).forEach(s=>{i[s]=e[s]}):i[t.item]=e,t.index&&(i[t.index]=r),t.collection&&(i[t.collection]=n),i}function ho(t){return!Array.isArray(t)&&!isNaN(t)}function $n(){}$n.inline=(t,{expression:e},{cleanup:r})=>{let n=Q(t);n._x_refs||(n._x_refs={}),n._x_refs[e]=t,r(()=>delete n._x_refs[e])};d("ref",$n);d("if",(t,{expression:e},{effect:r,cleanup:n})=>{t.tagName.toLowerCase()!=="template"&&w("x-if can only be used on a <template> tag",t);let i=x(t,e),o=()=>{if(t._x_currentIfEl)return t._x_currentIfEl;let a=t.content.cloneNode(!0).firstElementChild;return P(a,{},t),h(()=>{t.after(a),A(()=>S(a))()}),t._x_currentIfEl=a,t._x_undoIf=()=>{h(()=>{j(a),a.remove()}),delete t._x_currentIfEl},a},s=()=>{t._x_undoIf&&(t._x_undoIf(),delete t._x_undoIf)};r(()=>i(a=>{a?o():s()})),n(()=>t._x_undoIf&&t._x_undoIf())});d("id",(t,{expression:e},{evaluate:r})=>{r(e).forEach(i=>Cn(t,i))});q((t,e)=>{t._x_ids&&(e._x_ids=t._x_ids)});ct(Pt("@",It(T("on:"))));d("on",A((t,{value:e,modifiers:r,expression:n},{cleanup:i})=>{let o=n?x(t,n):()=>{};t.tagName.toLowerCase()==="template"&&(t._x_forwardEvents||(t._x_forwardEvents=[]),t._x_forwardEvents.includes(e)||t._x_forwardEvents.push(e));let s=V(t,e,r,a=>{o(()=>{},{scope:{$event:a},params:[a]})});i(()=>s())}));ne("Collapse","collapse","collapse");ne("Intersect","intersect","intersect");ne("Focus","trap","focus");ne("Mask","mask","mask");function ne(t,e,r){d(e,n=>w(`You can't use [x-${e}] without first installing the "${t}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}K.setEvaluator(be);K.setRawEvaluator(xr);K.setReactivityEngine({reactive:te,effect:mn,release:hn,raw:g});var Ue=K;window.Alpine=Ue;queueMicrotask(()=>{Ue.start()});})();