6 lines
41 KiB
JavaScript
6 lines
41 KiB
JavaScript
|
(()=>{var Te=!1,Re=!1,N=[],Pe=-1;function Kr(e){Br(e)}function Br(e){N.includes(e)||N.push(e),Hr()}function bt(e){let t=N.indexOf(e);t!==-1&&t>Pe&&N.splice(t,1)}function Hr(){!Re&&!Te&&(Te=!0,queueMicrotask(zr))}function zr(){Te=!1,Re=!0;for(let e=0;e<N.length;e++)N[e](),Pe=e;N.length=0,Pe=-1,Re=!1}var H,z,Q,wt,Ie=!0;function kr(e){Ie=!1,e(),Ie=!0}function qr(e){H=e.reactive,Q=e.release,z=t=>e.effect(t,{scheduler:r=>{Ie?Kr(r):r()}}),wt=e.raw}function pt(e){z=e}function Wr(e){let t=()=>{};return[n=>{let i=z(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),Q(i))},i},()=>{t()}]}var Et=[],At=[],St=[];function Ur(e){St.push(e)}function Ot(e,t){typeof t=="function"?(e._x_cleanups||(e._x_cleanups=[]),e._x_cleanups.push(t)):(t=e,At.push(t))}function Vr(e){Et.push(e)}function Yr(e,t,r){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(r)}function Ct(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 Ue=new MutationObserver(Je),Ve=!1;function Ye(){Ue.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),Ve=!0}function Mt(){Gr(),Ue.disconnect(),Ve=!1}var Y=[],Se=!1;function Gr(){Y=Y.concat(Ue.takeRecords()),Y.length&&!Se&&(Se=!0,queueMicrotask(()=>{Jr(),Se=!1}))}function Jr(){Je(Y),Y.length=0}function x(e){if(!Ve)return e();Mt();let t=e();return Ye(),t}var Ge=!1,se=[];function Xr(){Ge=!0}function Zr(){Ge=!1,Je(se),se=[]}function Je(e){if(Ge){se=se.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(a=>a.nodeType===1&&t.push(a)),e[o].removedNodes.forEach(a=>a.nodeType===1&&r.push(a))),e[o].type==="attributes")){let a=e[o].target,s=e[o].attributeName,l=e[o].oldValue,u=()=>{n.has(a)||n.set(a,[]),n.get(a).push({name:s,value:a.getAttribute(s)})},c=()=>{i.has(a)||i.set(a,[]),i.get(a).push(s)};a.hasAttribute(s)&&l===null?u():a.hasAttribute(s)?(c(),u()):c()}i.forEach((o,a)=>{Ct(a,o)}),n.forEach((o,a)=>{Et.forEach(s=>s(a,o))});for(let o of r)if(!t.includes(o)&&(At.forEach(a=>a(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,St.forEach(a=>a(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 Tt(e){return te(K(e))}function ee(e,t,r){return e._x_dataStack=[t,...K(r||e)],()=>{e._x_dataStack=e._x_dataStack.filter(n=>n!==t)}}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 te(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 a=o.get,s=o.set,l=o;a=a&&a.bind(t),s=s&&s.bind(t),a&&(a._x_alreadyBound=!0),s&&(s._x_alreadyBound=!0),Object.defineProperty(i,n,{...l,get:a,set:s})}return!0}return!1})||{})[n],set:(r,n,i)=>{let o=e.find(a=>a.hasOwnProperty(n));return o?o[n]=i:e[e.length-1][n]=i,!0}});return t}function Rt(e){let t=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,r=(n,i="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([o,{value:a,enumerable:s}])=>{if(s===!1||a===void 0)return;let l=i===""?o:`${i}.${o}`;typeof a=="object"&&a!==null&&a._x_interceptor?n[o]=a.initialize(e,l,o):t(a)&&a!==n&&!(a instanceof Element)&&r(a,l)})};return r(e)}function Pt(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,o){return e(this.initialValue,()=>Qr(
|
||
|
|
||
|
${r?'Expression: "'+r+`"
|
||
|
|
||
|
`:""}`,t),setTimeout(()=>{throw e},0)}var ae=!0;function tn(e){let t=ae;ae=!1,e(),ae=t}function D(e,t,r={}){let n;return b(e,t)(i=>n=i,r),n}function b(...e){return $t(...e)}var $t=Nt;function rn(e){$t=e}function Nt(e,t){let r={};Ne(r,e);let n=[r,...K(e)],i=typeof t=="function"?nn(n,t):an(n,t,e);return en.bind(null,e,t,i)}function nn(e,t){return(r=()=>{},{scope:n={},params:i=[]}={})=>{let o=t.apply(te([n,...e]),i);le(r,o)}}var Oe={};function on(e,t){if(Oe[e])return Oe[e];let r=Object.getPrototypeOf(async function(){}).constructor,n=/^[\n\s]*if.*\(.*\)/.test(e)||/^(let|const)\s/.test(e)?`(async()=>{ ${e} })()`:e,o=(()=>{try{return new r(["__self","scope"],`with (scope) { __self.result = ${n} }; __self.finished = true; return __self.result;`)}catch(a){return X(a,t,e),Promise.resolve()}})();return Oe[e]=o,o}function an(e,t,r){let n=on(t,r);return(i=()=>{},{scope:o={},params:a=[]}={})=>{n.result=void 0,n.finished=!1;let s=te([o,...e]);if(typeof n=="function"){let l=n(n,s).catch(u=>X(u,r,t));n.finished?(le(i,n.result,s,a,r),n.result=void 0):l.then(u=>{le(i,u,s,a,r)}).catch(u=>X(u,r,t)).finally(()=>n.result=void 0)}}}function le(e,t,r,n,i){if(ae&&typeof t=="function"){let o=t.apply(r,n);o instanceof Promise?o.then(a=>le(e,a,r,n)).catch(a=>X(a,i,t)):e(o)}else typeof t=="object"&&t instanceof Promise?t.then(o=>e(o)):e(t)}var Xe="x-";function k(e=""){return Xe+e}function sn(e){Xe=e}var Le={};function g(e,t){return Le[e]=t,{before(r){if(!Le[r]){console.warn("Cannot find directive `${directive}`. `${name}` will use the default order of execution");return}let n=$.indexOf(r);$.splice(n>=0?n:$.indexOf("DEFAULT"),0,e)}}}function Ze(e,t,r){if(t=Array.from(t),e._x_virtualDirectives){let o=Object.entries(e._x_virtualDirectives).map(([s,l])=>({name:s,value:l})),a=Lt(o);o=o.map(s=>a.find(l=>l.name===s.name)?{name:`x-bind:${s.name}`,value:`"${s.value}"`}:s),t=t.concat(o)}let n={};return t.map(Bt((o,a)=>n[o]=a)).filter(zt).map(cn(n,r)).sort(fn).map(o=>un(e,o))}function Lt(e){return Array.from(e).map(Bt()).filter(t=>!zt(t))}var Fe=!1,V=new Map,Ft=Symbol();function ln(e){Fe=!0;let t=Symbol();Ft=t,V.set(t,[]);let r=()=>{for(;V.get(t).length;)V.get(t).shift()();V.delete(t)},n=()=>{Fe=!1,r()};e(r),n()}function jt(e){let t=[],r=s=>t.push(s),[n,i]=Wr(e);return t.push(i),[{Alpine:ne,effect:n,cleanup:r,evaluateLater:b.bind(b,e),evaluate:D.bind(D,e)},()=>t.forEach(s=>s())]}function un(e,t){let r=()=>{},n=Le[t.type]||r,[i,o]=jt(e);Yr(e,t.original,o);let a=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,i),n=n.bind(n,e,t,i),Fe?V.get(Ft).push(n):n())};return a.runCleanups=o,a}var Dt=(e,t)=>({name:r,value:n})=>(r.startsWith(e)&&(r=r.replace(e,t)),{name:r,value:n}),Kt=e=>e;function Bt(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=Ht.reduce((o,a)=>a(o),{name:t,value:r});return n!==t&&e(n,t),{name:n,value:i}}}var Ht=[];function Qe(e){Ht.push(e)}function zt({name:e}){return kt().test(e)}var kt=()=>new RegExp(`^${Xe}([^:^.]+)\\b`);function cn(e,t){return({name:r,value:n})=>{let i=r.match(kt()),o=r.match(/:([a-zA-Z0-9\-:]+)/),a=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],s=t||e[r]||r;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:a.map(l=>l.replace(".","")),expression:n,original:s}}}var je="DEFAULT",$=["ignore","ref","data","id","bind","init","for","model","modelable","transition","show","if",je,"teleport"];function fn(e,t){let r=$.indexOf(e.type)===-1?je:e.type,n=$.indexOf(t.type)===-1?je:t.type;return $.indexOf(r)-$.indexOf(n)}function G(e,t,r={}){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0}))}function M(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(i=>M(i,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;for(;n;)M(n,t,!1),n=n.nextElementSibling}function T(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}var _t=!1;function dn(){_t&&T("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),_t=!0,document.body||T("Unable to initialize. Trying to load Alpine before `<body>` is avail
|