6 lines
37 KiB
JavaScript
6 lines
37 KiB
JavaScript
|
(()=>{var He=!1,qe=!1,K=[];function Mt(e){en(e)}function en(e){K.includes(e)||K.push(e),tn()}function he(e){let t=K.indexOf(e);t!==-1&&K.splice(t,1)}function tn(){!qe&&!He&&(He=!0,queueMicrotask(rn))}function rn(){He=!1,qe=!0;for(let e=0;e<K.length;e++)K[e]();K.length=0,qe=!1}var O,I,Y,Ue,We=!0;function Nt(e){We=!1,e(),We=!0}function kt(e){O=e.reactive,Y=e.release,I=t=>e.effect(t,{scheduler:r=>{We?Mt(r):r()}}),Ue=e.raw}function Ge(e){I=e}function It(e){let t=()=>{};return[n=>{let i=I(n);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))}},()=>{t()}]}var Pt=[],Dt=[],$t=[];function Lt(e){$t.push(e)}function jt(e){Dt.push(e)}function Ft(e){Pt.push(e)}function Kt(e,t,r){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(r)}function Ye(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 Ze=new MutationObserver(Je),Qe=!1;function Xe(){Ze.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),Qe=!0}function on(){nn(),Ze.disconnect(),Qe=!1}var te=[],et=!1;function nn(){te=te.concat(Ze.takeRecords()),te.length&&!et&&(et=!0,queueMicrotask(()=>{sn(),et=!1}))}function sn(){Je(te),te.length=0}function m(e){if(!Qe)return e();on();let t=e();return Xe(),t}var tt=!1,_e=[];function zt(){tt=!0}function Bt(){tt=!1,Je(_e),_e=[]}function Je(e){if(tt){_e=_e.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)=>{Ye(s,o)}),n.forEach((o,s)=>{Pt.forEach(a=>a(s,o))});for(let o of r)t.includes(o)||Dt.forEach(s=>s(o));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,$t.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 ge(e){return D(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 rt(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 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 xe(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 ye(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,o){return e(this.initialValue,()=>an(n,i),s=>nt(n,i,s),i,o)}};return t(r),n=>{if(typeof n=="object"&&n!==null&&n._x_interceptor){let i
|
||
|
|
||
|
${r?'Expression: "'+r+`"
|
||
|
|
||
|
`:""}`,t),setTimeout(()=>{throw e},0)}function w(e,t,r={}){let n;return h(e,t)(i=>n=i,r),n}function h(...e){return qt(...e)}var qt=it;function Ut(e){qt=e}function it(e,t){let r={};re(r,e);let n=[r,...P(e)];if(typeof t=="function")return cn(n,t);let i=ln(n,t,e);return Ht.bind(null,e,t,i)}function cn(e,t){return(r=()=>{},{scope:n={},params:i=[]}={})=>{let o=t.apply(D([n,...e]),i);be(r,o)}}var ot={};function un(e,t){if(ot[e])return ot[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 ot[e]=o,o}function ln(e,t,r){let n=un(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?(be(i,n.result,a,s,r),n.result=void 0):c.then(l=>{be(i,l,a,s,r)}).catch(l=>J(l,r,t)).finally(()=>n.result=void 0)}}}function be(e,t,r,n,i){if(typeof t=="function"){let o=t.apply(r,n);o instanceof Promise?o.then(s=>be(e,s,r,n)).catch(s=>J(s,i,t)):e(o)}else e(t)}var st="x-";function E(e=""){return st+e}function Wt(e){st=e}var Gt={};function p(e,t){Gt[e]=t}function ne(e,t,r){let n={};return Array.from(t).map(Yt((o,s)=>n[o]=s)).filter(Jt).map(dn(n,r)).sort(pn).map(o=>fn(e,o))}function Zt(e){return Array.from(e).map(Yt()).filter(t=>!Jt(t))}var at=!1,ie=new Map,Qt=Symbol();function Xt(e){at=!0;let t=Symbol();Qt=t,ie.set(t,[]);let r=()=>{for(;ie.get(t).length;)ie.get(t).shift()();ie.delete(t)},n=()=>{at=!1,r()};e(r),n()}function fn(e,t){let r=()=>{},n=Gt[t.type]||r,i=[],o=d=>i.push(d),[s,a]=It(e);i.push(a);let c={Alpine:R,effect:s,cleanup:o,evaluateLater:h.bind(h,e),evaluate:w.bind(w,e)},l=()=>i.forEach(d=>d());Kt(e,t.original,l);let u=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,c),n=n.bind(n,e,t,c),at?ie.get(Qt).push(n):n())};return u.runCleanups=l,u}var ve=(e,t)=>({name:r,value:n})=>(r.startsWith(e)&&(r=r.replace(e,t)),{name:r,value:n}),we=e=>e;function Yt(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=er.reduce((o,s)=>s(o),{name:t,value:r});return n!==t&&e(n,t),{name:n,value:i}}}var er=[];function Z(e){er.push(e)}function Jt({name:e}){return tr().test(e)}var tr=()=>new RegExp(`^${st}([^:^.]+)\\b`);function dn(e,t){return({name:r,value:n})=>{let i=r.match(tr()),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 ct="DEFAULT",Ee=["ignore","ref","data","id","bind","init","for","model","modelable","transition","show","if",ct,"teleport","element"];function pn(e,t){let r=Ee.indexOf(e.type)===-1?ct:e.type,n=Ee.indexOf(t.type)===-1?ct:t.type;return Ee.indexOf(r)-Ee.indexOf(n)}function z(e,t,r={}){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0}))}var lt=[],ut=!1;function Ae(e){lt.push(e),queueMicrotask(()=>{ut||setTimeout(()=>{Se()})})}function Se(){for(ut=!1;lt.length;)lt.shift()()}function rr(){ut=!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 B(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}function ir(){document.body||B("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"),Xe(),Lt(t=>S(t,M)),jt(t=>mn(t)),Ft((t,r)=>{ne(t,r).forEach(n=>n())});let e=t=>!V(t.parentElement,!0);Array.from(document.querySelectorAll(nr())).filter(e).forEach(t=>{S(t)}),z(document,"alpine:initialized")}var ft=[],or=[];function sr(){return ft.map(e=>e())}function nr(){return ft.concat(or).map(e=>e())}function Oe(e){ft.push(e)}function Te(e){or.push(e)}function V(e,t=!1){return
|