@fluixi/core 1.0.0-alpha.55 → 1.0.0-alpha.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1 @@
1
- "use strict";var Fluixi=(()=>{var Wt=Object.defineProperty;var Xi=Object.getOwnPropertyDescriptor;var Gi=Object.getOwnPropertyNames;var Yi=Object.prototype.hasOwnProperty;var C=(e,t)=>()=>(e&&(t=e(e=0)),t);var Vt=(e,t)=>{for(var r in t)Wt(e,r,{get:t[r],enumerable:!0})},Zi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Gi(t))!Yi.call(e,o)&&o!==r&&Wt(e,o,{get:()=>t[o],enumerable:!(n=Xi(t,o))||n.enumerable});return e};var Qi=e=>Zi(Wt({},"__esModule",{value:!0}),e);function Kt(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}function os(e){if(m.untracked)return e();m.untracked=!0;try{return e()}finally{m.untracked=!1}}function et(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function q(e){let t=Symbol("context");return{id:t,defaultValue:e,Provider:r=>{let n=m.owner,o=et(n);(o.contexts=new Map).set(t,r.value),n&&(n.owned??=[]).push(o),m.owner=o;try{return r.children}finally{m.owner=n}}}}function U(e){let t=m.owner;for(;t;){if(t.contexts&&t.contexts.has(e.id))return t.contexts.get(e.id);t=t.parent}return e.defaultValue}function _n(e,t){let r=e;for(;r;){if(r.contexts&&r.contexts.has(t.id))return r.contexts.get(t.id);r=r.parent}return t.defaultValue}function is(e,t,r){let n=et(m.owner);(n.contexts=new Map).set(e.id,t),m.owner&&(m.owner.owned??=[]).push(n);let o=m.owner;m.owner=n;try{return r()}finally{m.owner=o}}function ss(e){m.onSuspend=e}function as(e){return m.onSuspend?(m.onSuspend(e,m.owner),!0):!1}function ls(e){m.onError=e}function F(){return m.owner}function Cn(e){let t=m.owner;return m.owner=e,t}function W(e,t){let r=m.owner;m.owner=e;try{return t()}finally{m.owner=r}}function w(e){m.owner&&(m.owner.cleanups??=[]).push(e)}function Qe(e){if(e.owned){for(let t=e.owned.length-1;t>=0;t--)Qe(e.owned[t]);e.owned=null}if(e.cleanups){for(let t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}}function M(e){let t=et(m.owner);m.owner&&(m.owner.owned??=[]).push(t);let r=m.owner;m.owner=t;try{return e(()=>Qe(t))}finally{m.owner=r}}function us(e){m.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function cs(e){e.queued||(e.queued=!0,m.queue.push(e),!m.scheduled&&m.batchDepth===0&&(m.scheduled=!0,m.hostSchedule(Yt)))}function Yt(){if(m.scheduled=!1,m.flushing)return;m.flushing=!0;let e=0;try{for(;m.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let t=m.queue;m.queue=[];for(let r of t)r.queued=!1,r.disposed||r.run()}}finally{m.flushing=!1}}function fs(){m.batchDepth===0&&Yt()}function ps(e){m.batchDepth++;try{return e()}finally{--m.batchDepth===0&&Yt()}}function Zt(e){let t=new ds(e);return()=>t.dispose()}function hs(e){return!!e&&typeof e.then=="function"}function A(e,t){let r=new rs(e,{equals:t?.equals}),n=(()=>r.get()),o=(i=>{let s=typeof i=="function"?i(r.peek()):i;return r.set(s),fs(),s});return Object.defineProperty(n,Tn,{value:!0,enumerable:!0}),Object.defineProperty(n,ms,{value:{get value(){return r.peek()},get version(){return r.version}},enumerable:!1}),[n,o]}function g(e,t,r){let n=t,o=F(),i=new $n(()=>W(o,()=>{try{return n=e(n)}catch(a){if(hs(a))return as(a),n;throw a}}),{equals:r?.equals}),s=(()=>i.get());return Object.defineProperty(s,Tn,{value:!0,enumerable:!0}),Object.defineProperty(s,ys,{value:!0,enumerable:!0}),s}function S(e,t){let r=t;return Zt(()=>{r=e(r)})}function kn(e,t){let r=t;Zt(()=>{r=e(r)})}function L(e,t){let r=t;return Zt(()=>{r=e(r)})}function j(e){return ps(e)}function _(e){return os(e)}function En(e,t,r){let n=[];return w(()=>{for(let o of n)o.dispose();n=[]}),g(()=>{let o=e()||[];return _(()=>{if(o.length===0){for(let l of n)l.dispose();return n=[],r?.fallback?r.fallback():[]}let i=new Map;for(let l of n)i.has(l.item)||i.set(l.item,l);let s=[],a=new Set;for(let l=0;l<o.length;l++){let u=o[l],c=i.get(u);if(c&&!a.has(c))c.setIndex(l),s.push(c),a.add(c);else{let f,p,h;M(y=>{h=y;let[b,$]=A(l);p=$,f=t(u,b)});let d={item:u,rendered:f,dispose:h,setIndex:p};s.push(d),a.add(d)}}for(let l of n)a.has(l)||l.dispose();return n=s,s.map(l=>l.rendered)})})}function On(e,t,r,n){let o=[],i=[];return w(()=>{for(let s of i)s.dispose();o=[],i=[]}),g(()=>{let s=e()||[];return _(()=>{if(s.length===0){for(let f of i)f.dispose();return o=[],i=[],n?.fallback?n.fallback():[]}let a=new Map;for(let f=0;f<o.length;f++)a.set(o[f],i[f]);let l=[],u=[],c=new Set;for(let f=0;f<s.length;f++){let p=t(s[f]),h=a.get(p);if(h&&!c.has(p))h.setIndex(f),l.push(h);else{let d,y,b;M($=>{b=$;let[P,_e]=A(f);y=_e;let Xe=g(he=>(e()||[])[P()]??he,s[f]);d=r(Xe,P)}),l.push({rendered:d,dispose:b,setIndex:y})}u.push(p),c.add(p)}for(let[f,p]of a)c.has(f)||p.dispose();return o=u,i=l,l.map(f=>f.rendered)})})}function Pn(e,t,r){let n=[];return w(()=>{for(let o of n)o.dispose();n=[]}),g(()=>{let o=e()||[];return _(()=>{if(o.length===0){for(let l of n)l.dispose();return n=[],r?.fallback?r.fallback():[]}let i=n.length,s=o.length;for(let l=i;l<s;l++){let u,c,f,p=o[l];M(h=>{f=h;let[d,y]=A(p);c=y,u=t(d,l)}),n.push({rendered:u,setItem:c,dispose:f})}for(let l=s;l<i;l++)n[l].dispose();s<i&&(n=n.slice(0,s));let a=Math.min(i,s);for(let l=0;l<a;l++)n[l].setItem(o[l]);return n.map(l=>l.rendered)})})}function k(e){return typeof e=="function"&&e[gs]===!0}function vs(e){wn&&wn(e)}function jn(e){Jt=e}function bs(e){return Jt?Jt(e):void 0}function Rn(e){Xt=e}function As(){return Xt?Xt():void 0}function ws(e,t){xn&&xn(e,t)}function Nn(e,t=(r,n)=>r===n){let r=new Map;return S(()=>{let n=e();for(let[o,i]of r){let[s,a]=i,l=t(o,n);s()!==l&&a(l)}}),n=>{let o=r.get(n);if(!o){let[i,s]=A(!1);o=[i,s],r.set(n,o);let a=e();s(t(n,a))}return o[0]()}}function Mn(e,t){let[r,n]=A(e(),t);return S(()=>{let o=e();t?.timeoutMs?setTimeout(()=>n(()=>o),t.timeoutMs):typeof requestIdleCallback=="function"?requestIdleCallback(()=>n(()=>o)):Promise.resolve().then(()=>n(()=>o))}),r}function Ln(e,t){let r,n=(...o)=>{r!==void 0&&clearTimeout(r),r=setTimeout(()=>{if(r=void 0,o.length>0){let i=o[o.length-1];typeof i=="object"&&i&&!i.tagName&&i.target&&i.target.tagName&&(i=i.target),i&&typeof i=="object"&&i.tagName&&(i.tagName.toLowerCase()==="input"||i.tagName.toLowerCase()==="textarea")&&i.focus()}e(...o)},t)};return w(()=>{r!==void 0&&clearTimeout(r)}),n}function Gt(e){if(typeof e=="function"&&!e.length){let t=e();return k(t)?t:Gt(t)}if(Array.isArray(e)){let t=[];for(let r=0;r<e.length;r++){let n=Gt(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n)}return t}return e}function Te(e){let t=g(e);return g(()=>Gt(t()))}function xs(e){return!!e&&typeof e.then=="function"}function G(e,t,r={}){let n,o;typeof t=="function"?(n=typeof e=="function"?e:()=>e,o=t):(n=()=>!0,o=e,t&&typeof t=="object"&&(r=t));let i=As(),s=i!==void 0?bs(i):void 0,a=s!==void 0,[l,u]=A(s!==void 0?s.value:r.initialValue,{equals:!1}),[c,f]=A(void 0,{equals:!1}),[p,h]=A(s!==void 0||r.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[d,y]=A(void 0,{equals:!1}),[b,$]=A(void 0,{equals:!1}),P=Bt,_e=!1;S(()=>{let N=n();if(b(),N===!1||N===null||N===void 0){P=Bt,j(()=>{h("unresolved"),y(void 0),f(void 0)});return}let Ge=_e;if(_e=!1,P!==Bt&&N===P&&!Ge)return;if(P=N,a){a=!1;return}let Ye=!1;w(()=>Ye=!0);let gn=_(p),Ji=_(l),vn=gn==="ready"||gn==="refreshing";j(()=>{h(vn?"refreshing":"pending"),f(void 0)});try{let ee=o(N,{value:Ji,refetching:vn});xs(ee)?(y(ee),vs(ee),ee.then(Ze=>{Ye||(i!==void 0&&ws(i,Ze),j(()=>{u(()=>Ze),h("ready"),y(void 0)}))},Ze=>{Ye||j(()=>{f(Ze),h("errored"),y(void 0)})})):j(()=>{u(()=>ee),h("ready"),y(void 0)})}catch(ee){if(Ye)return;j(()=>{f(ee),h("errored"),y(void 0)})}});let Xe=()=>{let N=p();return N==="pending"||N==="refreshing"},he=(()=>{let N=c();if(N)throw N;if(Xe()){let Ge=d();if(Ge)throw Ge}return l()});return Object.defineProperties(he,{state:{get:p},loading:{get:Xe},error:{get:c},latest:{get:l}}),Object.defineProperty(he,Symbol.for("resource"),{value:!0,enumerable:!0}),Object.defineProperty(he,Symbol.for("signal"),{value:!0,enumerable:!0}),[he,{mutate:u,refetch:()=>{_e=!0,$(void 0)}}]}function In(){let[e,t]=A(0),r=0;return{increment:()=>t(r+=1),decrement:()=>t(r-=1),inFallback:()=>e()>0}}function Qt(e,t){return is(Dn,e,t)}var es,ts,m,bn,An,Ce,Sn,rs,$n,ns,ds,Tn,ys,ms,gs,wn,Jt,Xt,xn,Bt,Dn,Ss,er,x=C(()=>{"use strict";es="__fluixi_signal_next_state__",ts=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},m=globalThis[es]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:ts,onSuspend:null,onError:null},bn=0,An=1,Ce=2,Sn=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(m.untracked)return;let e=m.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}},rs=class extends Sn{constructor(e,t){super(),this._value=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){return this.track(),this._value}set(e){if(!this._equals(this._value,e)){if(this._value=e,this.version++,this.observers)for(let t of[...this.observers])t.markDirty(Ce);Kt(this)}}peek(){return this._value}},$n=class extends Sn{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=Ce,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(m.consumer===this)throw new Error("Signal.Computed cannot read itself");if(this.track(),this.updateIfNecessary(),this._threw)throw this._error;return this._value}updateIfNecessary(){if(this.state===An&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===Ce)break}(this.state===Ce||!this._initialized)&&this.recompute(),this.state=bn}recompute(){if(this.sources){for(let s of this.sources)s.observers?.delete(this);this.sources.clear()}let e=m.consumer,t=m.untracked;m.consumer=this,m.untracked=!1;let r,n=!1,o;try{r=this._fn()}catch(s){n=!0,o=s,r=this._value}finally{m.consumer=e,m.untracked=t}let i=!this._initialized||this._threw!==n||(n?o!==this._error:!this._equals(this._value,r));if(this._initialized=!0,this._threw=n,this._error=o,this._value=r,i){if(this.version++,this.observers)for(let s of[...this.observers])s.markDirty(Ce);Kt(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===bn;if(this.state=e,t){if(this.observers)for(let r of[...this.observers])r.markDirty(An);Kt(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};ns=class{constructor(e){this._watched=new Set,this._pending=new Set,this._notifyFn=e}watch(...e){for(let t of e)this._watched.add(t),(t.watchers??=new Set).add(this)}unwatch(...e){for(let t of e)this._watched.delete(t),t.watchers?.delete(this),this._pending.delete(t)}getPending(){let e=[...this._pending];return this._pending.clear(),e}_notify(e){if(!this._watched.has(e)||this._pending.has(e))return;let t=this._pending.size===0;this._pending.add(e),t&&this._notifyFn()}};ds=class{constructor(e){this.queued=!1,this.disposed=!1,this.owner=et(m.owner),m.owner&&(m.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new $n(()=>{Qe(this.owner),W(this.owner,()=>{let t=e();typeof t=="function"&&(this.owner.cleanups??=[]).push(t)})}),this.watcher=new ns(()=>cs(this)),this.run(),this.watcher.watch(this.computed)}run(){if(!this.disposed){this.watcher.getPending();try{this.computed.get()}catch(e){if(e&&typeof e.then=="function"&&m.onSuspend){m.onSuspend(e,this.owner);return}if(m.onError&&m.onError(e,this.owner))return;throw e}}}dispose(){this.disposed||(this.disposed=!0,this.watcher.unwatch(this.computed),Qe(this.owner))}};us(()=>{});Tn=Symbol.for("signal"),ys=Symbol.for("memo"),ms=Symbol.for("signal-node");gs=Symbol.for("signal");wn=null;Jt=null;Xt=null;xn=null;Bt=Symbol();Dn=q();ss((e,t)=>{let r=_n(t,Dn);r&&(r.increment(),e.finally(()=>r.decrement()))});Ss=q();ls((e,t)=>{let r=_n(t,Ss);return r?(r.setError(e),!0):!1});er=Symbol.for("fluixi-proxy")});function tt(e,t,r={}){let{preserveStructure:n,multiple:o,throwOnError:i=!1,defaultValue:s,maxDepth:a=20}=r;if(!e||typeof e!="object")return s;if(!t)return e;if(Array.isArray(t))if(n){let c={};for(let f of t){let p=tt(e,f,{...r,preserveStructure:!1});p!==void 0&&_s(c,f,p)}return c}else return t.map(c=>tt(e,c,{...r,preserveStructure:!1}));let l=tr(t,{...r,throwOnError:i});if(l.length===0)return e;if(typeof n>"u"||n===!1){let c=Cs(e,t);return o===!1&&Array.isArray(c)?c[0]:c===void 0&&s!==void 0?s:c}let u=H(e,l,0,a);return u===void 0&&s!==void 0?s:u}function Cs(e,t,r={}){let{createMissing:n=!1,add:o=!1,debug:i=!1}=r,s=tr(t),a=e,l=!1,u="",c=t;if(typeof a=="object"&&!Array.isArray(a)&&c.length>0&&a[c])return a=a[c],a;for(let f=0;f<s.length;f++){let p=s[f],h=s.length>1?f===s.length-1:!1;if(a===null&&!n)return;let d=s[f+1];switch(p.type){case"property":if(a&&typeof a=="object")if(Array.isArray(a)){if(typeof p.value=="number"){let y=p.value;if(n&&y>=a.length)for(let b=a.length;b<=y;b++)a.push(void 0);if(n&&(a[y]===null||a[y]===void 0)&&(!h||l)&&(d?a[y]=d.type==="index"||d.type==="slice"||d.type==="union"||d.type==="wildcard"?[]:{}:a[y]=null,l=!1),a=a[y],d){l=!0;continue}}else o?a.push({[String(p.value)]:null}):a=a.map(y=>y[String(p.value)]);if(d)continue;return Hn(a)}else{if(a[u]&&u.split(".").length>=2){a=a[u];continue}if(n&&(a[String(p.value)]===null||a[String(p.value)]===void 0)&&(!h||l)&&(d?a[String(p.value)]=d.type==="index"||d.type==="slice"||d.type==="union"||d.type==="wildcard"?[]:{}:a[String(p.value)]=null,l=!1,a=a[String(p.value)],d)){l=!0;continue}if(a?(!a[String(p.value)]&&n&&(a[String(p.value)]=null),a=a[String(p.value)]):a={[String(p.value)]:null},d)continue}else if(n)a={},a[String(p.value)]=d.type==="index"||d.type==="slice"||d.type==="union"||d.type==="wildcard"||r.type==="array"?[]:{},a=a[String(p.value)];else return;break;case"index":case"wildcard":if(Array.isArray(a)){if(p.type==="index"){let y=p.value;if(y<0){a=a[a.length-Math.abs(y)];continue}if(n&&(y>=a.length||a[y]==null||a[y]==null)&&!h){for(let b=a.length;b<=y;b++)a.push(void 0);d&&(a[y]=d.type==="index"||d.type==="slice"||d.type==="union"||d.type==="wildcard"?[]:{})}a=a[y]}else if(!h)continue}else if(n){let y=s[f+1];a=[];let b=p.value;for(let $=0;$<=b;$++)a.push(void 0);a[b]=y.type==="index"||y.type==="slice"||y.type==="union"||y.type==="wildcard"||r.type==="array"?[]:{},a=a[b]}else{if(p.type==="index"&&typeof a=="object"&&a&&a[String(p.value)]!==void 0){a=a[String(p.value)];continue}if(typeof a=="object"){a=Object.values(a);continue}return}break;default:return}}return Hn(a)}function Hn(e){return Array.isArray(e)?e.filter(t=>typeof t<"u"):e}var rt,H,tr,$s,_s,rr=C(()=>{"use strict";rt=e=>e==null||Array.isArray(e)||typeof e=="function"||e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof Error?!1:typeof e=="object",H=(e,t,r,n)=>{if(r>n)return;if(t.length===0)return e;let o=t[0],i=t.slice(1);if(o.type==="descendant"){let s=H(e,i,r+1,n);if(s!==void 0)return s;if(e&&typeof e=="object")if(Array.isArray(e)){let a=[];for(let l=0;l<e.length;l++){let u=H(e[l],t,r+1,n);u!==void 0&&(a[l]=u)}return a.length>0?a:void 0}else{let a={};for(let l in e)if(e.hasOwnProperty(l)){let u=H(e[l],t,r+1,n);u!==void 0&&(a[l]=u)}return Object.keys(a).length>0?a:void 0}return}switch(o.type){case"property":if(rt(e)&&o.value&&String(o.value)in e){let s=e[String(o.value)],a=H(s,i,r+1,n);if(a!==void 0)return{[String(o.value)]:a}}break;case"index":if(Array.isArray(e)){let s=o.value;if(s>=0&&s<e.length){let a=H(e[s],i,r+1,n);if(a!==void 0){let l=new Array(e.length).filter(u=>u!==void 0);return l[s]=a,l}}}else if(e&&typeof e=="object"){let s=String(o.value);if(s in e){let a=H(e[s],i,r+1,n);if(a!==void 0)return{[s]:a}}}break;case"wildcard":if(e&&typeof e=="object")if(Array.isArray(e)){let s=[],a=!1;for(let l=0;l<e.length;l++){let u=H(e[l],i,r+1,n);u!==void 0&&(s[l]=u,a=!0)}return a?s:void 0}else{let s={},a=!1;for(let l in e)if(e.hasOwnProperty(l)){let u=H(e[l],i,r+1,n);u!==void 0&&(s[l]=u,a=!0)}return a?s:void 0}break;case"slice":if(Array.isArray(e)){let[s,a]=o.value,l=Math.max(0,s),u=Math.min(e.length,a===1/0?e.length:a),c=[],f=!1;for(let p=l;p<u;p++){let h=H(e[p],i,r+1,n);h!==void 0&&(c[p]=h,f=!0)}return f?c:void 0}break;case"union":if(Array.isArray(e)){let s=o.value,a=[],l=!1;for(let u of s)if(u>=0&&u<e.length){let c=H(e[u],i,r+1,n);c!==void 0&&(a[u]=c,l=!0)}return l?a:void 0}break;case"filter":if(Array.isArray(e)){let s=o.value,a=[],l=!1;for(let u=0;u<e.length;u++)if(s(e[u])){let c=H(e[u],i,r+1,n);c!==void 0&&(a[u]=c,l=!0)}return l?a:void 0}break}},tr=(e,t={})=>{let{type:r="auto",throwOnError:n=!1}=t;if(!e||typeof e!="string")return[];let o=[],i="",s=!1,a=!1,l="",u="",c=0,f=r==="auto"?(h=>h.includes("..")?"descendant":h.includes("[?(")?"filter":h.includes("[:")||h.includes("[0:")?"slice":h.includes("[,")||h.includes("[0,1]")?"union":h.includes("[*]")||h.includes(".*.")?"wildcard":h.includes("[]")?"array-wildcard":h.includes("[")&&h.includes("]")?"bracket":"dot")(e):r,p=h=>{let d=h.trim();if(d==="*"||d==="")return{type:"wildcard",value:d===""?"[]":"*",raw:d===""?"[]":h};if(d==="[]")return{type:"wildcard",value:"[]",raw:h};if(/^-?\d+$/.test(d))return{type:"index",value:parseInt(d,10),raw:h};if(d.includes(":")){let y=d.split(":").map(P=>P.trim()),b=y[0]===""?0:parseInt(y[0],10),$=y[1]===""?1/0:parseInt(y[1],10);if(isNaN(b)||isNaN($)){if(n)throw new Error(`Invalid slice notation: ${h}`);return{type:"wildcard",value:"*",raw:h}}return{type:"slice",value:[b,$],raw:h}}if(d.includes(",")){let y=d.split(",").map(b=>{let $=parseInt(b.trim(),10);return isNaN($)?-1:$}).filter(b=>b>=0);if(y.length===0){if(n)throw new Error(`Invalid union notation: ${h}`);return{type:"wildcard",value:"*",raw:h}}return{type:"union",value:y,raw:h}}if(d.startsWith("?(")&&d.endsWith(")")){let y=d.slice(2,-1);try{return{type:"filter",value:$s(y),raw:h}}catch(b){if(n)throw b;return{type:"wildcard",value:"*",raw:h}}}return d.startsWith('"')&&d.endsWith('"')||d.startsWith("'")&&d.endsWith("'")?{type:"property",value:d.slice(1,-1),raw:h}:{type:"property",value:d,raw:h}};for(let h=0;h<e.length;h++){let d=e[h],y=e[h+1];if((d==='"'||d==="'")&&!a){a=!0,l=d;continue}else if(d===l&&a){a=!1,l="",d==='"'||d==="'"||(s?u+=d:i+=d);continue}if(a){s?u+=d:i+=d;continue}if(d==="["&&!s){i&&(o.push({type:"property",value:i,raw:i}),i=""),s=!0,u="";continue}if(d==="]"&&s&&!a){s=!1;let $=p(u);o.push($);continue}let b=o.length>0?o[o.length-1]:null;if(d==="."&&!s&&!a){if(y==="."){let $=e.split("..")[0];o.push({type:"property",value:$,raw:$}),o.push({type:"descendant",value:"..",raw:".."}),h++}else i&&(i==="*"?o.push({type:"wildcard",value:i,raw:i}):o.push({type:"property",value:i,raw:i}),i="");continue}if(s)u+=d;else if(b&&b.type!=="descendant")i+=d;else{let $=e.split(b?.raw)[1];$!==void 0?i=$:i+=d}}return i&&o.push({type:"property",value:i,raw:i}),o.map(h=>{if(h.type==="property"&&typeof h.value=="string"&&/^-?\d+$/.test(h.value)){let d=parseInt(h.value,10);if(!isNaN(d))return{...h,type:"index",value:d}}return h})},$s=e=>{let t=e.replace(/@\.([a-zA-Z_$][\w$]*)/g,(r,n)=>`item.${n}`).replace(/@/g,"item");try{return new Function("item",`return ${t}`)}catch{throw new Error(`Invalid filter expression: ${e}`)}},_s=(e,t,r)=>{let n=tr(t),o=e;for(let i=0;i<n.length;i++){let s=n[i],a=i===n.length-1;switch(s.type){case"property":if(a)o[String(s.value)]=r;else{if(!o[String(s.value)]){let u=n[i+1];o[String(s.value)]=u.type==="index"||u.type==="slice"||u.type==="union"||u.type==="wildcard"?[]:{}}o=o[String(s.value)]}break;case"index":Array.isArray(o)||(o=[]);let l=s.value;if(a){if(l>=o.length)for(let u=o.length;u<=l;u++)o.push(void 0);o[l]=r}else{if(!o[l]){let u=n[i+1];o[l]=u.type==="index"||u.type==="slice"||u.type==="union"||u.type==="wildcard"?[]:{}}o=o[l]}break;case"wildcard":if(Array.isArray(o))if(a)for(let u=0;u<o.length;u++)o[u]=r;else{let u=n[i+1];for(let c=0;c<o.length;c++)o[c]||(o[c]=u.type==="index"||u.type==="slice"||u.type==="union"||u.type==="wildcard"?[]:{});o.length>0&&(o=o[0])}break}}}});function Ws(e){return e.localName.includes("-")}function oo(e,t,r,n=!1){if(r==null){e.removeAttribute(t);return}if(Ws(e)){e[t]=r;return}E(e,t,r,n)}function fo(e,...t){e.classList.add(...t)}function po(e,...t){e.classList.remove(...t)}function ho(e,...t){t.forEach(r=>e.classList.toggle(r))}function E(e,t,r,n=!1){if(r==null||r===!1){e.removeAttribute(t);return}if(r===!0){e.setAttribute(t,"");return}if(typeof r=="object"){e.setAttribute(t,JSON.stringify(r));return}e.setAttribute(t,String(r))}function yo(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function pt(e){return e instanceof Node}function mo(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function dt(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function go(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function Vs(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function Bs(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function Ks(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function Js(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function Xs(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Gs(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function K(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Ys(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function vo(e){return Vs(e)?{type:"router",value:e}:Ks(e)?{type:"route",value:e}:Bs(e)?{type:"routes",value:e}:Js(e)?{type:"outlet",value:e}:K(e)?{type:"component",value:e}:Ys(e)?{type:"suspense",value:e}:Xs(e)?{type:"provider",value:e}:Gs(e)?{type:"context",value:e}:{type:"none",value:e}}function bo(){if(!so)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return so}function mr(e){return e!=null&&e[ht]===!0?!0:typeof Node<"u"&&e instanceof Node}function Zs(e){return e!=null&&e[ht]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Qs(e){return e!=null&&e[ht]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}function ea(e){Ao=e}function wo(){return Ao}function ao(e,t){return v.active&&t.parentNode===e}function xo(e){let t=v.parents.lastIndexOf(e);t!==-1&&(v.parents.length=t),v.cursor=e.nextSibling}function So(e){if(!v.active)return e();let t=v.cursor,r=v.parents;v.active=!1,v.parents=[];try{return e()}finally{v.active=!0,v.cursor=t,v.parents=r}}function $o(e){if(!v.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&xo(t)}function re(e){if(!yr)for(let t of e)ut.has(t)||gr.has(t)||(ut.add(t),document.addEventListener(t,ra))}function ra(e){let t=`$$${e.type}`,r=e.composedPath&&e.composedPath()[0]||e.target;for(;r;){let n=r[t];if(n&&!r.disabled&&(n(e),e.cancelBubble))return;r=r.host&&r.host!==r&&r.host instanceof Element?r.host:r.parentNode}}function na(e,t,r){if(e[`$$${t}`]=r,gr.has(t)){let n=`__fx_${t}`;if(!e[n]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[n]=o}return}ut.has(t)||re([t])}function lo(e,t){delete e[`$$${t}`];let r=`__fx_${t}`,n=e[r];n&&(e.removeEventListener(t,n),delete e[r])}function Y(e){if(yr)return bo().createText(e);if(v.active){let t=wo()?.hydrateText(e);if(t)return t}return document.createTextNode(e)}function me(e,t=!1){if(yr)return bo().createElement(e,t);if(v.active){let r=wo()?.hydrateElement(e);if(r)return r}return t?document.createElementNS(co,e):document.createElement(e)}function ia(e,t,r,n,o){let i=n,s=new Map;return L(()=>{let a;if(K(e)&&!k(e)){if(!s.has(e)){B++;try{let l=e();s.set(e,l)}finally{B--}}for(a=s.get(e);typeof a=="function"&&k(a);)a=a()}else for(a=e();typeof a=="function"&&k(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(K(a)){if(!s.has(a)){let u=a;B++;try{let c=u();s.set(u,c)}finally{B--}}a=s.get(a)}else if(k(a))a=a();else if(a=a(),typeof a!="function"||!k(a)&&!K(a))break}B++;try{i=Ee(t,a,r,i,s),o(i)}finally{B--}})}function R(e,t,r,n){if(B>oa)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;r!==void 0&&!r&&(r=Y(""),e.appendChild(r));let o=n??null;if(typeof t!="function"){B++;try{o=Ee(e,t,r,null)}finally{B--}return()=>o}let i=ia(t,e,r,o,s=>{o=s});return()=>(i?.(),o)}function Ee(e,t,r,n,o){if(t==null||typeof t=="boolean")return te(e,n,r);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return te(e,n,r);if(lt(t)){let s=Y("");return Array.isArray(n)?n.length>0?(e.replaceChild(s,n[0]),te(e,n.slice(1),r)):D(e,s,r):n?e.replaceChild(s,n):D(e,s,r),t.then(a=>{s.parentNode===e&&Ee(e,a,s.nextSibling,s)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),s}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(n)){if(n.length===0){let a=Y(t);return D(e,a,r),a}if(n.length===1&&n[0].nodeType===3)return n[0].data=t,n;n=te(e,n,r)}if(n&&Qs(n))return n.data=t,n;let s=Y(t);return n&&n.parentNode===e?e.replaceChild(s,n):ao(e,s)||D(e,s,r),s}if(mr(t))return ao(e,t)?(xo(t),t):Array.isArray(n)?(n.length===0?D(e,t,r):n[0].parentNode===e?(e.replaceChild(t,n[0]),te(e,n.slice(1),r)):D(e,t,r),t):(n?n!==t&&(n.parentNode===e?e.replaceChild(t,n):D(e,t,r)):D(e,t,r),t);if(Array.isArray(t)){let s=[],a=Array.isArray(n)?n:n?[n]:[],l=[];V(t,s,e,r,!0,o,l);let u=sa(e,a,s,r);for(let c of l){let f=R(e,c.sig,c.marker);w(()=>{te(e,f()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return u}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("_$litType$"in s||"_$litDirective$"in s)return Ee(e,ko(t),r,n);if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return Ee(e,l,r,n)}}}return te(e,n,r)}function V(e,t,r,n,o=!0,i,s){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!lt(l)&&!k(l)&&!K(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let u;for(K(l)&&!k(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),u=i.get(l)):u=l();typeof u=="function"&&!lt(u)&&!k(u)&&!K(u);)i||(i=new Map),i.has(u)||i.set(u,u()),u=i.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if(k(u)){if(s){let f=Y("");t.push(f),s.push({marker:f,sig:u});continue}let c=u();for(;typeof c=="function"&&k(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?V(c,t,r,n,o,i):V([c],t,r,n,o,i);continue}continue}Array.isArray(u)?V(u,t,r,n,o,i,s):V([u],t,r,n,o,i,s);continue}if(lt(l)){let u=Y("");t.push(u),l.then(c=>{if(u.parentNode){let f=[];if(V([c],f,u.parentNode,void 0,!1,i),f.length>0){u.parentNode.replaceChild(f[0],u);for(let p=1;p<f.length;p++)u.parentNode?.insertBefore(f[p],f[p-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(l)){V(l,t,r,n,o,i,s);continue}if(mr(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&("_$litType$"in l||"_$litDirective$"in l)){let u=ko(l);for(let c of u)t.push(c);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let u=l;if(typeof u.type=="function"){let c=u.type(u.props||{});Array.isArray(c)?V(c,t,r,n,!1,i):V([c],t,r,n,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let u=String(l);if(u.trim()===""&&u!==" ")continue;t.push(Y(u));continue}t.push(Y(String(l)))}}}}function sa(e,t,r,n){for(let f=0;f<r.length;f++)r[f].parentNode!==null&&r[f].parentNode!==e&&(r=r.slice(),r[f]=r[f].cloneNode(!0));let o=r.length,i=t.length,s=o,a=0,l=0,u=i>0?t[i-1].nextSibling??void 0:n,c=null;for(;a<i||l<s;){if(t[a]===r[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===r[s-1];)i--,s--;if(i===a){let f=s<o?l?r[l-1].nextSibling??void 0:r[s-l]:u;for(;l<s;)D(e,r[l++],f)}else if(s===l)for(;a<i;)(!c||!c.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===r[s-1]&&r[l]===t[i-1]){let f=t[--i].nextSibling;D(e,r[l++],t[a++].nextSibling),D(e,r[--s],f),t[i]=t[a-1]}else{if(!c){c=new Map;let p=l;for(;p<s;)c.set(r[p],p++)}let f=c.get(t[a]);if(f!=null)if(l<f&&f<s){let p=a,h=1;for(;++p<i&&p<s&&!(!c.has(t[p])||c.get(t[p])!==f+h);)h++;if(h>f-l){let d=t[a];for(;l<f;)D(e,r[l++],d)}else t[a].parentNode===e?e.replaceChild(r[l++],t[a++]):(D(e,r[l++],u),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return r}function te(e,t,r){if(t)if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n].parentNode===e&&e.removeChild(t[n]);else t.parentNode===e&&e.removeChild(t);return null}function D(e,t,r){v.active&&t.parentNode===e||(r&&r.parentNode===e?e.insertBefore(t,r):e.appendChild(t))}function Oe(e,t,r){r==null?delete e[t]:e[t]=r}function aa(e,t,r,n=!1){return typeof r!="function"?(E(e,t,r,n),()=>{}):L(()=>{let o=typeof r=="function"?r():r;E(e,t,o,n)})}function la(e,t,r){return typeof r!="function"?(Oe(e,t,r),()=>{}):L(()=>{let n=typeof r=="function"?r():r;Oe(e,t,n)})}function ct(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){S(()=>{ct(e,t())});return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let r=Object.keys(t).filter(n=>{let o=t[n];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",r);return}e.setAttribute("class",String(t))}function ft(e,t,r){if(!(!t||typeof t!="object"))for(let n in t){let o=t[n],i=n.split(/\s+/).filter(Boolean);if(typeof o=="function"&&r)r.push(L(()=>{let s=!!o();for(let a of i)e.classList.toggle(a,s)}));else{let s=!!(typeof o=="function"?o():o);for(let a of i)e.classList.toggle(a,s)}}}function fr(e,t){let r=t;for(;typeof r=="function";)r=r();if(r==null){e.removeAttribute("style");return}if(typeof r=="string"){e.style.cssText=r;return}if(typeof r=="object")for(let n in r){let o=r[n];o==null?e.style[n]="":e.style[n]=o}}function _o(e){let{element:t,props:r,prevProps:n=ta,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!Zs(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!r)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===co,a=[];for(let l in r){if(i&&l==="children")continue;let u=r[l],c=n[l];if(u!==c){if(l==="ref"){vr(u,t);continue}if(l==="class"||l==="className"){typeof u=="function"?a.push(L(()=>ct(t,u()))):ct(t,u);continue}if(l==="classList"){typeof u=="function"?a.push(L(()=>ft(t,u()))):ft(t,u,a);continue}if(l==="style"){typeof u=="function"?a.push(L(()=>fr(t,u()))):fr(t,u);continue}if(l.startsWith("on")){let f=l.slice(2).toLowerCase();c&&lo(t,f),u&&na(t,f,u);continue}io.has(l)||!s&&l in t?a.push(la(t,l,u)):a.push(aa(t,l,u,s))}}for(let l in n)if(!(l in r))if(l.startsWith("on")){let u=l.slice(2).toLowerCase();lo(t,u)}else io.has(l)?Oe(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function Co(e,t,r=!1){for(let n in t){let o=t[n];if(n==="ref"){vr(o,e);continue}if(n!=="children"){if(n.startsWith("on")&&n.length>2){let i=n.slice(2).toLowerCase();if(typeof o=="function")if(gr.has(i)){e[`$$${i}`]=o;let s=`__fx_${i}`;if(!e[s]){let a=l=>{e[`$$${i}`]?.(l)};e.addEventListener(i,a),e[s]=a}}else e[`$$${i}`]=o,ut.has(i)||re([i]);continue}if(n==="class"||n==="className"){ct(e,o);continue}if(n==="classList"){typeof o=="function"?L(()=>ft(e,o())):ft(e,o);continue}if(n==="style"){fr(e,o);continue}if(n==="innerHTML"){if(typeof o=="function"){let i=S(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});w(()=>i())}else e.innerHTML=o;continue}if(n==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=S(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});w(()=>{i()})}else e.value=o??"";continue}if(n==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=S(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});w(()=>{i()})}else e.checked=o??"";continue}if(n==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=S(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});w(()=>{s()})}else queueMicrotask(()=>{e.value=o??""});continue}if(typeof o=="function"){let i=S(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();oo(e,n,s,r)});w(()=>{i()})}else oo(e,n,o,r)}}}function vr(e,t){if(e){if(mr(e)){let r=t,n=e;if(!r)return;typeof r=="function"?r(n):typeof r=="object"&&"current"in r&&(r.current=n);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function To(e){pr=e}function ko(e){let t=[];if(!pr)return console.warn("Lit render not registered. Call registerLitRender first."),t;try{let r=document.createElement("div");for(pr(e,r);r.firstChild;)t.push(r.firstChild),r.removeChild(r.firstChild)}catch(r){console.warn("Could not render Lit template:",r)}return t}function Eo(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function lt(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function br(e,t,r){if(!t)throw new Error("Container element is required");let n,o,i=[];return M(s=>{j(()=>{v.active||(t.textContent=""),R(t,e)}),o=s}),()=>{o?.(),n?.(),i.forEach(s=>s()),t.textContent=""}}function Oo(e){dr.fn=e}function ne(e,t){return dr.fn?dr.fn(e,t):(()=>e(t))}function Ar(){let e=globalThis.__FX_DATA__;if(e)return e;if(cr!==void 0)return cr;let t=null;if(typeof document<"u"){let r=document.getElementById(ca)?.textContent;if(r)try{t=JSON.parse(r)}catch{t=null}}return cr=t}function wr(){for(;;){for(;v.cursor&&v.cursor.nodeType===3&&v.cursor.data==="";)v.cursor=v.cursor.nextSibling;if(v.cursor!=null||!v.parents.length)return;v.cursor=v.parents.pop().nextSibling}}function Sr(e,t){let r=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${r}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function pa(e){wr();let t=v.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(fa.has(e.toLowerCase())?v.cursor=t.nextSibling:(v.parents.push(t),v.cursor=t.firstChild),t):(xr&&t&&Sr(`<${e}>`,t),null)}function da(e){if(e==="")return null;wr();let t=v.cursor;return t&&t.nodeType===3?(v.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(xr&&t&&Sr(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function ha(e){wr();let t=v.cursor;return t&&t.nodeType===8&&t.data===e?(v.cursor=t.nextSibling,t):(xr&&t&&Sr(`marker <!--${e.slice(0,24)}-->`,t),null)}function ya(){uo||(uo=!0,ea({hydrateElement:pa,hydrateText:da,hydrateMarker:ha}))}function yt(e,t,r){ya(),v.active=!0,v.cursor=t.firstChild,v.parents=[];let n=Ar(),o=r?.resourceNamespace,i=0;Rn(()=>o?`${o}:r${i++}`:`r${i++}`),jn(n?s=>s in n?{value:n[s]}:void 0:null);try{return br(e,t)}finally{v.active=!1,v.cursor=null,v.parents=[]}}function ma(e){return typeof e=="function"?e:(()=>e)}function mt(e){return()=>{let t=e();return typeof t=="function"?t():t}}function ga(e){return e!=null&&e!==!1}function va(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Po(e){let t=mt(()=>e.when),r=g(t,void 0),n=g(r,void 0);return g(()=>{if(n()){let o=e.children;return typeof o=="function"&&!va(o)?typeof r=="function"?_(()=>_(r)?o(r()):e.fallback):o(r):o}return e.fallback},void 0,{name:"show"})}function jo(e){let t=mt(()=>e.each),r=()=>e.fallback??null,n=(o,i)=>{let s=e.children,a=Array.isArray(s)?s.map(l=>typeof l=="function"?l(o,i):l):typeof s=="function"?s(o,i):s;return $o(a),a};return e.by?On(t,e.by,(o,i)=>n(o,i),{fallback:r}):En(t,(o,i)=>n(o,i),{fallback:r})}function Ro(e){let t=mt(()=>e.each);return Pn(t,(r,n)=>{let o=e.children(r,n);return $o(o),o},{fallback:()=>e.fallback??null})}function No(e){return{[hr]:!0,when:mt(()=>e.when),children:e.children}}function Mo(e){let t=Array.isArray(e.children)?e.children:[e.children];return g(()=>{for(let r of t){let n=r,o=0;for(;typeof n=="function"&&!n[hr]&&o++<10;)n=n();if(!n||typeof n!="object"||n[hr]!==!0)continue;let i=n.when();if(ga(i))return typeof n.children=="function"?n.children(i):n.children}return e.fallback??null})}function Lo(e){let t=ma(e.component),{component:r,...n}=e;return g(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:n}:o(n)})}function Do(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,r,n;return M(o=>{r=o,n=document.createElement("div"),n.style.display="contents",t().appendChild(n),R(n,e.children)&&vr(e.ref,n)}),w(()=>{r(),n.remove()}),null}function Io(e){let[t,r]=A(null),n=()=>r(null);return g(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,n):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(i){return r(i),typeof e.fallback=="function"?e.fallback(i,n):e.fallback}})}function Ho(e){return g(()=>{let t=typeof e=="function"?e():e,r=[];for(let[n,o]of Object.entries(t))n&&(typeof o=="function"?o():o)&&r.push(n);return r.join(" ")})}function ba(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function qo(e){return g(()=>{let t=typeof e=="function"?e():e,r=[];for(let[n,o]of Object.entries(t)){if(!n)continue;let i=typeof o=="function"?o():o;i!=null&&r.push(`${ba(n)}: ${i}`)}return r.join("; ")})}var co,io,Vl,yr,ht,so,v,Ao,ta,ut,gr,B,oa,pr,ua,dr,ca,cr,fa,xr,uo,hr,Aa,I=C(()=>{"use strict";x();x();x();x();x();x();x();x();x();x();x();x();co="http://www.w3.org/2000/svg";io=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);Vl=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;yr=typeof document>"u",ht=Symbol.for("fluixi.server-node"),so=null;v={active:!1,cursor:null,parents:[]},Ao=null;ta={},ut=new Set,gr=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);B=0,oa=200;pr=null;ua="__fx_dom_create_component__",dr=globalThis[ua]??={fn:null};ca="__FX_DATA__";fa=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),xr=typeof process<"u"&&process.env&&!1;uo=!1;hr=Symbol("match");Aa=ht});function _r(){return wa}function Uo(){let e=F();if(!e)return null;if(!e[$r]){let t={mounts:[],effects:[],scheduled:!1};e[$r]=t}return e[$r]}function Fo(e){if(e.scheduled)return;e.scheduled=!0;let t=F();queueMicrotask(()=>{W(t,()=>{for(let r of e.mounts)try{let n=r();typeof n=="function"&&w(n)}catch(n){console.error("Error in onMount callback:",n)}for(let r of e.effects){let n;S(()=>{n&&n(),n=r()}),w(()=>{n&&n()})}e.mounts=[],e.effects=[]})})}function Z(e){Oo(je)}function je(e,t){return gt(e,t)}function gt(e,t){let r=typeof e=="function"?_(()=>e(t)):e;if(r!=null&&(typeof r=="function"||typeof r=="object")&&!k(r)){try{r.$name=e.name}catch{}return dt(r)}return r}function vt(e,t=!0){let r=Uo();if(r){if(!t){r.scheduled||e();return}r.mounts.push(e),Fo(r)}else{if(!t){e();return}S(()=>{let n=_(e);typeof n=="function"&&w(n)})}}function bt(e){w(e)}function Re(e){let t=Uo();if(t)t.effects.push(e),Fo(t);else{let r;S(()=>{r&&r(),r=e()}),w(()=>{r&&r()})}}function At(e){return g(e)}function wt(e){let t={current:e};return w(()=>{t.current=null}),t}function xt(e,t){let[r,n]=A(t);return[r,i=>{n(e(r(),i))}]}function St(e,t,r,n){Re(()=>{let o=e&&"current"in e?e.current:e;if(o)return o.addEventListener(t,r,n),()=>{o.removeEventListener(t,r,n)}})}function $t(e){return e}function Cr(){return Pe}function Tr(e){Pe&&e()}var wa,Pe,$r,ge=C(()=>{"use strict";I();x();wa={context:null,owner:null};Pe=typeof process<"u"&&!1,$r=Symbol.for("fluixi-lifecycle")});function Me(e,t){let r,n,o;function i(){return n||(n=e().then(a=>r=a.default)),n}t?.preload&&i();let s=(a=>{if(r){let l=r;return _(()=>l(a))}if(!o){let[l]=G(()=>i());if(o=l,l.error)throw l.error}return g(()=>{let l=o();return l?_(()=>l(a)):void 0},void 0,{name:"lazy"})});return s.preload=()=>i().then(()=>{}),s.$lazy=!0,s.loader=e,s}var kr=C(()=>{"use strict";x()});var _t,Le,Er,Wo,ve,Or,Vo,Pr,Ct,jr=C(()=>{"use strict";_t=globalThis,Le=_t.ShadowRoot&&(_t.ShadyCSS===void 0||_t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Er=Symbol(),Wo=new WeakMap,ve=class{constructor(t,r,n){if(this._$cssResult$=!0,n!==Er)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=r}get styleSheet(){let t=this.o,r=this.t;if(Le&&t===void 0){let n=r!==void 0&&r.length===1;n&&(t=Wo.get(r)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&Wo.set(r,t))}return t}toString(){return this.cssText}},Or=e=>new ve(typeof e=="string"?e:e+"",void 0,Er),Vo=(e,...t)=>{let r=e.length===1?e[0]:t.reduce((n,o,i)=>n+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+e[i+1],e[0]);return new ve(r,e,Er)},Pr=(e,t)=>{if(Le)e.adoptedStyleSheets=t.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of t){let n=document.createElement("style"),o=_t.litNonce;o!==void 0&&n.setAttribute("nonce",o),n.textContent=r.cssText,e.appendChild(n)}},Ct=Le?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let r="";for(let n of t.cssRules)r+=n.cssText;return Or(r)})(e):e});var $a,_a,Ca,Ta,ka,Ea,kt,Bo,Oa,Pa,De,Tt,Rr,Ko,z,Et=C(()=>{"use strict";jr();jr();({is:$a,defineProperty:_a,getOwnPropertyDescriptor:Ca,getOwnPropertyNames:Ta,getOwnPropertySymbols:ka,getPrototypeOf:Ea}=Object),kt=globalThis,Bo=kt.trustedTypes,Oa=Bo?Bo.emptyScript:"",Pa=kt.reactiveElementPolyfillSupport,De=(e,t)=>e,Tt={toAttribute(e,t){switch(t){case Boolean:e=e?Oa:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=e!==null;break;case Number:r=e===null?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch{r=null}}return r}},Rr=(e,t)=>!$a(e,t),Ko={attribute:!0,type:String,converter:Tt,reflect:!1,useDefault:!1,hasChanged:Rr};Symbol.metadata??=Symbol("metadata"),kt.litPropertyMetadata??=new WeakMap;z=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,r=Ko){if(r.state&&(r.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((r=Object.create(r)).wrapped=!0),this.elementProperties.set(t,r),!r.noAccessor){let n=Symbol(),o=this.getPropertyDescriptor(t,n,r);o!==void 0&&_a(this.prototype,t,o)}}static getPropertyDescriptor(t,r,n){let{get:o,set:i}=Ca(this.prototype,t)??{get(){return this[r]},set(s){this[r]=s}};return{get:o,set(s){let a=o?.call(this);i?.call(this,s),this.requestUpdate(t,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Ko}static _$Ei(){if(this.hasOwnProperty(De("elementProperties")))return;let t=Ea(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(De("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(De("properties"))){let r=this.properties,n=[...Ta(r),...ka(r)];for(let o of n)this.createProperty(o,r[o])}let t=this[Symbol.metadata];if(t!==null){let r=litPropertyMetadata.get(t);if(r!==void 0)for(let[n,o]of r)this.elementProperties.set(n,o)}this._$Eh=new Map;for(let[r,n]of this.elementProperties){let o=this._$Eu(r,n);o!==void 0&&this._$Eh.set(o,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let r=[];if(Array.isArray(t)){let n=new Set(t.flat(1/0).reverse());for(let o of n)r.unshift(Ct(o))}else t!==void 0&&r.push(Ct(t));return r}static _$Eu(t,r){let n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,r=this.constructor.elementProperties;for(let n of r.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Pr(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,r,n){this._$AK(t,n)}_$ET(t,r){let n=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,n);if(o!==void 0&&n.reflect===!0){let i=(n.converter?.toAttribute!==void 0?n.converter:Tt).toAttribute(r,n.type);this._$Em=t,i==null?this.removeAttribute(o):this.setAttribute(o,i),this._$Em=null}}_$AK(t,r){let n=this.constructor,o=n._$Eh.get(t);if(o!==void 0&&this._$Em!==o){let i=n.getPropertyOptions(o),s=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:Tt;this._$Em=o;let a=s.fromAttribute(r,i.type);this[o]=a??this._$Ej?.get(o)??a,this._$Em=null}}requestUpdate(t,r,n,o=!1,i){if(t!==void 0){let s=this.constructor;if(o===!1&&(i=this[t]),n??=s.getPropertyOptions(t),!((n.hasChanged??Rr)(i,r)||n.useDefault&&n.reflect&&i===this._$Ej?.get(t)&&!this.hasAttribute(s._$Eu(t,n))))return;this.C(t,r,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,r,{useDefault:n,reflect:o,wrapped:i},s){n&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,s??r??this[t]),i!==!0||s!==void 0)||(this._$AL.has(t)||(this.hasUpdated||n||(r=void 0),this._$AL.set(t,r)),o===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[o,i]of this._$Ep)this[o]=i;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[o,i]of n){let{wrapped:s}=i,a=this[o];s!==!0||this._$AL.has(o)||a===void 0||this.C(o,void 0,i,a)}}let t=!1,r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),this._$EO?.forEach(n=>n.hostUpdate?.()),this.update(r)):this._$EM()}catch(n){throw t=!1,this._$EM(),n}t&&this._$AE(r)}willUpdate(t){}_$AE(t){this._$EO?.forEach(r=>r.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(r=>this._$ET(r,this[r])),this._$EM()}updated(t){}firstUpdated(t){}};z.elementStyles=[],z.shadowRootOptions={mode:"open"},z[De("elementProperties")]=new Map,z[De("finalized")]=new Map,Pa?.({ReactiveElement:z}),(kt.reactiveElementVersions??=[]).push("2.1.2")});function ni(e,t){if(!Ir(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Xo!==void 0?Xo.createHTML(t):t}function ae(e,t,r=e,n){if(t===Q)return t;let o=n!==void 0?r._$Co?.[n]:r._$Cl,i=qe(t)?void 0:t._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),i===void 0?o=void 0:(o=new i(e),o._$AT(e,r,n)),n!==void 0?(r._$Co??=[])[n]=o:r._$Cl=o),o!==void 0&&(t=ae(e,o._$AS(e,t.values),o,n)),t}var Mr,Jo,Ot,Xo,Lr,J,Dr,ja,se,He,qe,Ir,ti,Nr,Ie,Go,Yo,oe,Zo,Qo,ri,Hr,Ra,Na,Ma,Q,T,ei,ie,oi,Ue,Pt,be,le,jt,Rt,Nt,Mt,La,Da,qr,Lt=C(()=>{"use strict";Mr=globalThis,Jo=e=>e,Ot=Mr.trustedTypes,Xo=Ot?Ot.createPolicy("lit-html",{createHTML:e=>e}):void 0,Lr="$lit$",J=`lit$${Math.random().toFixed(9).slice(2)}$`,Dr="?"+J,ja=`<${Dr}>`,se=document,He=()=>se.createComment(""),qe=e=>e===null||typeof e!="object"&&typeof e!="function",Ir=Array.isArray,ti=e=>Ir(e)||typeof e?.[Symbol.iterator]=="function",Nr=`[
2
- \f\r]`,Ie=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Go=/-->/g,Yo=/>/g,oe=RegExp(`>|${Nr}(?:([^\\s"'>=/]+)(${Nr}*=${Nr}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Zo=/'/g,Qo=/"/g,ri=/^(?:script|style|textarea|title)$/i,Hr=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),Ra=Hr(1),Na=Hr(2),Ma=Hr(3),Q=Symbol.for("lit-noChange"),T=Symbol.for("lit-nothing"),ei=new WeakMap,ie=se.createTreeWalker(se,129);oi=(e,t)=>{let r=e.length-1,n=[],o,i=t===2?"<svg>":t===3?"<math>":"",s=Ie;for(let a=0;a<r;a++){let l=e[a],u,c,f=-1,p=0;for(;p<l.length&&(s.lastIndex=p,c=s.exec(l),c!==null);)p=s.lastIndex,s===Ie?c[1]==="!--"?s=Go:c[1]!==void 0?s=Yo:c[2]!==void 0?(ri.test(c[2])&&(o=RegExp("</"+c[2],"g")),s=oe):c[3]!==void 0&&(s=oe):s===oe?c[0]===">"?(s=o??Ie,f=-1):c[1]===void 0?f=-2:(f=s.lastIndex-c[2].length,u=c[1],s=c[3]===void 0?oe:c[3]==='"'?Qo:Zo):s===Qo||s===Zo?s=oe:s===Go||s===Yo?s=Ie:(s=oe,o=void 0);let h=s===oe&&e[a+1].startsWith("/>")?" ":"";i+=s===Ie?l+ja:f>=0?(n.push(u),l.slice(0,f)+Lr+l.slice(f)+J+h):l+J+(f===-2?a:h)}return[ni(e,i+(e[r]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),n]},Ue=class e{constructor({strings:t,_$litType$:r},n){let o;this.parts=[];let i=0,s=0,a=t.length-1,l=this.parts,[u,c]=oi(t,r);if(this.el=e.createElement(u,n),ie.currentNode=this.el.content,r===2||r===3){let f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(o=ie.nextNode())!==null&&l.length<a;){if(o.nodeType===1){if(o.hasAttributes())for(let f of o.getAttributeNames())if(f.endsWith(Lr)){let p=c[s++],h=o.getAttribute(f).split(J),d=/([.?@])?(.*)/.exec(p);l.push({type:1,index:i,name:d[2],strings:h,ctor:d[1]==="."?jt:d[1]==="?"?Rt:d[1]==="@"?Nt:le}),o.removeAttribute(f)}else f.startsWith(J)&&(l.push({type:6,index:i}),o.removeAttribute(f));if(ri.test(o.tagName)){let f=o.textContent.split(J),p=f.length-1;if(p>0){o.textContent=Ot?Ot.emptyScript:"";for(let h=0;h<p;h++)o.append(f[h],He()),ie.nextNode(),l.push({type:2,index:++i});o.append(f[p],He())}}}else if(o.nodeType===8)if(o.data===Dr)l.push({type:2,index:i});else{let f=-1;for(;(f=o.data.indexOf(J,f+1))!==-1;)l.push({type:7,index:i}),f+=J.length-1}i++}}static createElement(t,r){let n=se.createElement("template");return n.innerHTML=t,n}};Pt=class{constructor(t,r){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:r},parts:n}=this._$AD,o=(t?.creationScope??se).importNode(r,!0);ie.currentNode=o;let i=ie.nextNode(),s=0,a=0,l=n[0];for(;l!==void 0;){if(s===l.index){let u;l.type===2?u=new be(i,i.nextSibling,this,t):l.type===1?u=new l.ctor(i,l.name,l.strings,this,t):l.type===6&&(u=new Mt(i,this,t)),this._$AV.push(u),l=n[++a]}s!==l?.index&&(i=ie.nextNode(),s++)}return ie.currentNode=se,o}p(t){let r=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(t,n,r),r+=n.strings.length-2):n._$AI(t[r])),r++}},be=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,r,n,o){this.type=2,this._$AH=T,this._$AN=void 0,this._$AA=t,this._$AB=r,this._$AM=n,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,r=this._$AM;return r!==void 0&&t?.nodeType===11&&(t=r.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,r=this){t=ae(this,t,r),qe(t)?t===T||t==null||t===""?(this._$AH!==T&&this._$AR(),this._$AH=T):t!==this._$AH&&t!==Q&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):ti(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==T&&qe(this._$AH)?this._$AA.nextSibling.data=t:this.T(se.createTextNode(t)),this._$AH=t}$(t){let{values:r,_$litType$:n}=t,o=typeof n=="number"?this._$AC(t):(n.el===void 0&&(n.el=Ue.createElement(ni(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===o)this._$AH.p(r);else{let i=new Pt(o,this),s=i.u(this.options);i.p(r),this.T(s),this._$AH=i}}_$AC(t){let r=ei.get(t.strings);return r===void 0&&ei.set(t.strings,r=new Ue(t)),r}k(t){Ir(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,n,o=0;for(let i of t)o===r.length?r.push(n=new e(this.O(He()),this.O(He()),this,this.options)):n=r[o],n._$AI(i),o++;o<r.length&&(this._$AR(n&&n._$AB.nextSibling,o),r.length=o)}_$AR(t=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);t!==this._$AB;){let n=Jo(t).nextSibling;Jo(t).remove(),t=n}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},le=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,r,n,o,i){this.type=1,this._$AH=T,this._$AN=void 0,this.element=t,this.name=r,this._$AM=o,this.options=i,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=T}_$AI(t,r=this,n,o){let i=this.strings,s=!1;if(i===void 0)t=ae(this,t,r,0),s=!qe(t)||t!==this._$AH&&t!==Q,s&&(this._$AH=t);else{let a=t,l,u;for(t=i[0],l=0;l<i.length-1;l++)u=ae(this,a[n+l],r,l),u===Q&&(u=this._$AH[l]),s||=!qe(u)||u!==this._$AH[l],u===T?t=T:t!==T&&(t+=(u??"")+i[l+1]),this._$AH[l]=u}s&&!o&&this.j(t)}j(t){t===T?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},jt=class extends le{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===T?void 0:t}},Rt=class extends le{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==T)}},Nt=class extends le{constructor(t,r,n,o,i){super(t,r,n,o,i),this.type=5}_$AI(t,r=this){if((t=ae(this,t,r,0)??T)===Q)return;let n=this._$AH,o=t===T&&n!==T||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,i=t!==T&&(n===T||o);o&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},Mt=class{constructor(t,r,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){ae(this,t)}},La={M:Lr,P:J,A:Dr,C:1,L:oi,R:Pt,D:ti,V:ae,I:be,H:le,N:Rt,U:Nt,B:jt,F:Mt},Da=Mr.litHtmlPolyfillSupport;Da?.(Ue,be),(Mr.litHtmlVersions??=[]).push("3.3.3");qr=(e,t,r)=>{let n=r?.renderBefore??t,o=n._$litPart$;if(o===void 0){let i=r?.renderBefore??null;n._$litPart$=o=new be(t.insertBefore(He(),i),i,void 0,r??{})}return o._$AI(e),o}});var Ur,ue,Ia,Ha,ii=C(()=>{"use strict";Et();Et();Lt();Lt();Ur=globalThis,ue=class extends z{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=qr(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Q}};ue._$litElement$=!0,ue.finalized=!0,Ur.litElementHydrateSupport?.({LitElement:ue});Ia=Ur.litElementPolyfillSupport;Ia?.({LitElement:ue});Ha={_$AK:(e,t,r)=>{e._$AK(t,r)},_$AL:e=>e._$AL};(Ur.litElementVersions??=[]).push("4.2.2")});var Ru,si=C(()=>{"use strict";Ru=!1});var ai={};Vt(ai,{CSSResult:()=>ve,LitElement:()=>ue,ReactiveElement:()=>z,_$LE:()=>Ha,_$LH:()=>La,adoptStyles:()=>Pr,css:()=>Vo,defaultConverter:()=>Tt,getCompatibleStyle:()=>Ct,html:()=>Ra,isServer:()=>Ru,mathml:()=>Ma,noChange:()=>Q,notEqual:()=>Rr,nothing:()=>T,render:()=>qr,supportsAdoptingStyleSheets:()=>Le,svg:()=>Na,unsafeCSS:()=>Or});var li=C(()=>{"use strict";Et();Lt();ii();si()});function Ua(){di||(di=!0,!(typeof process<"u")&&console.warn("[fluixi] createProvider({ context, value, children }) reads `children` eagerly: the object literal materialises `children` BEFORE the context is stamped, so a routed <Outlet/> that has siblings inside the provider renders detached and its descendants see no context under SSR. Use the lazy form instead:\n createProvider(Context, value, props) // children stays a getter\n // or JSX: <Context.Provider value={…}>{props.children}</Context.Provider>"))}function Dt(e,t,r){let n=!!e?.Provider,o=n?e:e.context,i=n?t:e.value,s=n?!1:e.debug??!1;n||Ua();let a=typeof i=="function"?i():i,l=n?r:e;return o.Provider({value:a,get children(){return l?.children},debug:s})}function hi(e){let t=we(e);return[t,n=>Dt(t,n.value,n)]}function zr(e,t){if(e.length===0)return Te(()=>t);let[r,n]=e[0],o=e.slice(1);return Dt(r,n,{get children(){return zr(o,t)}})}function yi(e){return t=>{let r=xe(e);return t.children(r)}}function mi(e,t){let r=xe(e);return r===e.defaultValue?t():r}function we(e){let t=q(e),r=n=>(n.debug,t.Provider({value:n.value,get children(){return n.children},debug:n.debug}));return typeof Symbol<"u"&&Symbol.for&&(r.$$typeof=Symbol.for("react.provider")),r.$$typeof=Symbol.for("react.provider"),{id:t.id,Provider:mo(r),defaultValue:e}}function xe(e){let t=U(e);return t!==void 0?t:e.defaultValue}var di,Wr=C(()=>{"use strict";I();x();x();ge();Z("index");di=!1});function $i(){return Si}function Kr(e){Si=e}function _i(e,t){It.set(e,t)}function Ci(e){return It.get(e)}function Xa(){It.clear()}function Ti(){if(typeof window>"u")return!1;let e=document.getElementById("__FLUIXI_HYDRATION__");if(!e||e.getAttribute("type")!=="application/json")return!1;try{let t=e.textContent||"{}",r=JSON.parse(t);for(let[n,o]of Object.entries(r))It.set(n,o);return!0}catch(t){return console.error("Failed to deserialize hydration data:",t),!1}}function Jr(){if(typeof window>"u")return;let e=document.getElementById("__FLUIXI_HYDRATION__");e&&e.remove();let t=document.createTreeWalker(document.body,NodeFilter.SHOW_COMMENT,null),r=[],n;for(;n=t.nextNode();){let o=n,i=o.nodeValue||"";(i.startsWith("#")||i.startsWith("/"))&&r.push(o)}r.forEach(o=>o.remove()),Xa()}function ki(){return typeof window>"u"}var Si,It,Xr=C(()=>{"use strict";Si=!1,It=new Map;typeof window<"u"&&window.addEventListener("load",()=>{setTimeout(Jr,100)})});function ul(e,t,r){let n=new Uint8Array(t.length);e:for(let o=0;o<e.length;o++){for(let i=0;i<t.length;i++)if(!n[i]&&fe(e[o],t[i],r)){n[i]=1;continue e}return!1}return!0}var fe,Oi=C(()=>{"use strict";rr();fe=(e,t,r={})=>{if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t)return!1;let n=Array.isArray(e),o=Array.isArray(t);if(n!==o)return!1;if(n&&o)return e.length!==t.length?!1:r.unordered?ul(e,t,r):e.every((y,b)=>fe(y,t[b],r));if(typeof e!="object")return e===t;let i=e instanceof Date,s=t instanceof Date;if(i!==s)return!1;if(i)return e.getTime()===t.getTime();let a=e instanceof RegExp,l=t instanceof RegExp;if(a!==l)return!1;if(a)return e.toString()===t.toString();let u=e instanceof Map,c=t instanceof Map;if(u!==c)return!1;if(u){if(e.size!==t.size)return!1;for(let[y,b]of e)if(!t.has(y)||!fe(b,t.get(y),r))return!1;return!0}let f=e instanceof Set,p=t instanceof Set;if(f!==p)return!1;if(f){if(e.size!==t.size)return!1;let y=[...t],b=new Uint8Array(y.length);e:for(let $ of e){for(let P=0;P<y.length;P++)if(!b[P]&&fe($,y[P],r)){b[P]=1;continue e}return!1}return!0}if(!rt(e)||!rt(t))return!1;let h=Object.keys(e),d=Object.keys(t);if(h.length!==d.length)return!1;for(let y of h)if(!Object.prototype.hasOwnProperty.call(t,y)||!fe(e[y],t[y],r))return!1;return!0}});function cl(e){return e.startsWith("//")?e.replace(/^\/+/,"/"):e}function Se(e,t,r=!1){let n=[];if(e===t)return{params:{},path:t};if(!r&&e==="/"&&t.startsWith("/"))return{params:{},path:"/"};let o=e.replace(/:([a-zA-Z0-9_]+)/g,(l,u)=>(n.push(u),"([^/]+)")).replace(/\*([a-zA-Z0-9_]*)/g,(l,u)=>(u&&n.push(u),"(.*)"));o.startsWith("/")||(o="/"+o),o===""&&(o="/");let i=new RegExp(`^${o}${r?"$":"(?=/|$)"}`),s=t.match(i);if(!s)return null;let a={};return n.forEach((l,u)=>{a[l]=s[u+1]}),{params:a,path:s[0]}}function en(e){let t=e.path.split("/").filter(Boolean);if(t.length===0)return 5;let r=0;for(let n of t)n.startsWith("*")?r+=1:n.startsWith(":")?r+=10:r+=100;return r}function Pi(e){return[...e].sort((t,r)=>en(r)-en(t))}function pe(e,t){let r=t.length>1?t.replace(/\/+$/,"")||"/":t,n=ji(e,r);if(!n)return null;let o=[],i="",s={};for(let a of n.layers){i=cl(fl(i,a.consumed));let l={};for(let[u,c]of Object.entries(a.params))u in s||(l[u]=c),s[u]=c;o.push({route:a.route,component:a.route.component,params:l,pathname:i||"/"})}return{matched:o,params:s,pathname:t}}function ji(e,t){if(!e||e.length===0)return null;let r=Pi(e);for(let n of r){let o=!!n.children&&n.children.length>0,i=Se(n.path,t,!o);if(i){if(o){let s=ji(n.children,t);if(s)return{layers:[{route:n,params:i.params,consumed:i.path},...s.layers]};continue}return{layers:[{route:n,params:i.params,consumed:i.path}]}}}return null}function fl(e,t){if(!e)return t;if(t===e)return e;if(t.startsWith(e))return t;let r=e.replace(/\/$/,""),n=t.replace(/^\//,"");return`${r}/${n}`}var tn=C(()=>{"use strict"});function rn(e){let t=e,r="",n=t.indexOf("#");n!==-1&&(r=t.slice(n),t=t.slice(0,n));let o="",i=t.indexOf("?");return i!==-1&&(o=t.slice(i),t=t.slice(0,i)),{pathname:t||"/",search:o,hash:r}}function We(e="/"){let t=[{path:e,state:null}],r=0,n=new Set,o=()=>n.forEach(i=>i());return{get(){let{path:i,state:s}=t[r];return{...rn(i),state:s}},push(i,s=null){t=t.slice(0,r+1),t.push({path:i,state:s}),r=t.length-1,o()},replace(i,s=null){t[r]={path:i,state:s},o()},subscribe(i){return n.add(i),()=>n.delete(i)}}}function de(){let e=typeof window<"u"?window:void 0,t=new Set,r=()=>t.forEach(n=>n());return e&&e.addEventListener("popstate",r),{get(){if(!e)return{pathname:"/",search:"",hash:"",state:null};let{pathname:n,search:o,hash:i}=e.location;return{pathname:n,search:o,hash:i,state:e.history.state??null}},push(n,o=null){e?.history.pushState(o,"",n),r()},replace(n,o=null){e?.history.replaceState(o,"",n),r()},subscribe(n){return t.add(n),()=>t.delete(n)}}}var nn=C(()=>{"use strict"});function pl(e){let t={};return e&&new URLSearchParams(e.startsWith("?")?e.slice(1):e).forEach((n,o)=>t[o]=n),t}function dl(e,t){if(!t)return e||"/";let r=t.replace(/\/$/,"");return e===r?"/":e.startsWith(r+"/")?e.slice(r.length)||"/":e||"/"}function hl(e,t){return!t||/^https?:\/\//.test(e)?e:`${t.replace(/\/$/,"")}${e.startsWith("/")?e:"/"+e}`}function on(e){let{routes:t,history:r,base:n}=e,o=new Set,i=()=>{let c=r.get();return{pathname:c.pathname,search:c.search,hash:c.hash,state:c.state,query:pl(c.search)}},s=c=>pe(t,dl(c,n)),a=(()=>{let c=i();return{location:c,match:s(c.pathname)}})(),l=()=>{let c=i();a={location:c,match:s(c.pathname)},o.forEach(f=>f(a))},u=r.subscribe(l);return{state(){return a},subscribe(c){return o.add(c),()=>o.delete(c)},navigate(c,f={}){let p=hl(c,n);f.replace?r.replace(p,f.state??null):r.push(p,f.state??null)},match(c){return s(c)},destroy(){u(),o.clear()}}}var Ri=C(()=>{"use strict";tn();nn()});var sn=C(()=>{"use strict";tn();nn();Ri()});function Ni(e,t){return async(...r)=>{let n=t+":"+JSON.stringify(r);if($i()||typeof window<"u"){let i=Ci(n);if(i!==void 0)return i}if(Be.has(n))return Be.get(n);if(Ve.has(n))return Ve.get(n);let o=Promise.resolve(e(...r)).then(i=>(Be.set(n,i),Ve.delete(n),ki()&&_i(n,i),i),i=>{throw Ve.delete(n),i});return Ve.set(n,o),o}}function Mi(e){let t=typeof e=="string"?r=>r.startsWith(e):e;for(let r of Be.keys())t(r)&&(Be.delete(r),ml.add(r));yl(r=>r+1)}function Li(e,t){let[r]=G(t||(()=>!0),e);return r}function Di(e){return an.has(e)||an.set(e,A(void 0)),an.get(e)}function ln(e,t){let r=t||e.name||"action",n=async o=>{let[,i]=Di(r),s=()=>i(void 0),a=()=>n(o);i({input:o,pending:!0,clear:s,retry:a});try{let l=await e(o);return i({input:o,result:l,pending:!1,clear:s,retry:a}),l}catch(l){throw i({input:o,error:l,pending:!1,clear:s,retry:a}),l}};return n.url=r,n.with=o=>ln((...i)=>e(o,...i),t),n}function Ii(e){let[t]=Di(e.url);return t}function Hi(e){return e}var Be,Ve,jf,yl,ml,an,gl,Rf,qi=C(()=>{"use strict";x();Xr();Wr();Be=new Map,Ve=new Map;[jf,yl]=A(0),ml=new Set;an=new Map;gl=we(),Rf=gl.Provider});var Vi={};Vt(Vi,{A:()=>yn,Form:()=>Cl,Link:()=>zt,Outlet:()=>cn,Redirect:()=>fn,Router:()=>un,action:()=>ln,cache:()=>Ni,createAsync:()=>Li,createBrowserHistory:()=>de,createMemoryHistory:()=>We,lazy:()=>Me,matchPath:()=>Se,matchRoutes:()=>pe,preloadRoutes:()=>Tl,revalidate:()=>Mi,runWithOwner:()=>W,select:()=>$l,useAction:()=>Hi,useLevelParams:()=>xl,useLocation:()=>Je,useMatch:()=>dn,useNavigate:()=>Ft,useParam:()=>pn,useParamSelector:()=>Sl,useParams:()=>Ke,useRouteData:()=>_l,useRouter:()=>$e,useSearchParams:()=>hn,useSubmission:()=>Ii});function vl(e,t,r){let n,o=e.route.data;if(typeof o=="function"){let c=!1;w(()=>{c=!0});let f=F(),[p]=G(()=>o({params:r.params,location:r.location},f,()=>c));n=p}let i=()=>zi.Provider({value:n,get children(){return Fi.Provider({value:e.params,get children(){return Ui.Provider({value:{depth:t,...r},get children(){return ne(e.component,{})}})}})}});if(!n)return i();let s=n,a=()=>s.loading,[l,u]=A(_(()=>!a()));return S(()=>u(!a())),g(()=>l()?i():null)}function Wi(e){let t=e.depth+1,[r,n]=A(_(()=>e.matched()[t]?.component));return S(()=>{let o=e.matched()[t]?.component;n(()=>o)}),g(()=>{if(!r())return e.notFound?e.notFound():null;let i=_(()=>e.matched())[t];return vl(i,t,{matched:e.matched,params:e.params,location:e.location})})}function bl(e){return e==null?Al():typeof e=="function"?ne(e,{}):e}function Al(){let e=me("div");E(e,"class","fx-not-found"),E(e,"role","main"),E(e,"style","min-height:60vh;display:grid;place-content:center;gap:.25rem;text-align:center;font-family:system-ui,-apple-system,sans-serif");let t=me("h1");E(t,"style","margin:0;font-size:2.5rem;font-weight:700"),R(t,"404");let r=me("p");return E(r,"style","margin:0;opacity:.7"),R(r,"This page could not be found."),e.appendChild(t),e.appendChild(r),e}function un(e){let t=e.history??de(),r=on({routes:e.routes,base:e.base,history:t}),[n,o]=A(r.state()),i=r.subscribe(o);w(()=>{i(),r.destroy()});let s=g(()=>(n().match?.matched??[]).filter(c=>c.component)),a={router:r,location:g(()=>n().location),params:g(()=>n().match?.params??{})},l={depth:-1,matched:s,params:a.params,location:a.location,notFound:()=>bl(e.notFound)},u;return Ut.Provider({value:a,get children(){return u??=Wi(l)}})}function cn(){let e=U(Ui);return e?Wi(e):null}function fn(e){let t=U(Ut);if(!t||typeof window>"u")return null;let r=!1;return w(()=>r=!0),queueMicrotask(()=>{r||t.router.navigate(e.to,{replace:e.replace!==!1})}),null}function $e(){let e=U(Ut);if(e)return e;if(typeof window>"u")return wl;throw new Error("[router-next] useRouter must be used within <Router>")}function Ke(){let e=$e().params;return g(()=>e(),{},{equals:(t,r)=>JSON.stringify(t)===JSON.stringify(r)})}function xl(){return U(Fi)??{}}function pn(e){let t=Ke();return g(()=>t()[e])}function Sl(e,t){let r=Ke();return g(()=>e(r()),void 0,t?{equals:t}:void 0)}function dn(e){let t=Je();return g(()=>Se(typeof e=="function"?e():e,t.pathname))}function hn(){let e=Je(),t=Ft();return[g(()=>e.query),(o,i)=>{let s=new URLSearchParams(e.search);for(let[l,u]of Object.entries(o))u===null?s.delete(l):s.set(l,u);let a=s.toString();t(e.pathname+(a?`?${a}`:""),i)}]}function $l(e,t){let r=(n,o)=>fe(n,o);return t!==void 0?g(()=>tt(e(),t),void 0,{equals:r}):g(e,void 0,{equals:r})}function Je(){let{location:e}=$e();return new Proxy({},{get:(t,r)=>e()[r],has:(t,r)=>r in e(),ownKeys:()=>Reflect.ownKeys(e()),getOwnPropertyDescriptor:(t,r)=>Object.getOwnPropertyDescriptor(e(),r)})}function Ft(){let{router:e}=$e();return(t,r)=>e.navigate(t,r)}function _l(){return U(zi)??(()=>{})}function zt(e){let t=U(Ut),r=typeof document>"u",n=()=>t?.router.navigate(X(e.href)??"",{replace:X(e.replace)}),o=me("a");if(E(o,"href",X(e.href)??""),e.slot&&E(o,"slot",X(e.slot)),typeof o.addEventListener=="function")o.addEventListener("click",s=>{s.metaKey||s.ctrlKey||s.shiftKey||s.altKey||(s.preventDefault(),n())});else{let s=X(e.className??e.class)??"";s&&E(o,"class",s)}typeof o.addEventListener=="function"&&S(()=>{let s=X(e.href)??"";o.setAttribute("href",s);let a=X(e.className??e.class)??"",l=X(e.activeClass)??"",u=X(e.active)??t?.location().pathname===s;o.className=[a,u?l:""].filter(Boolean).join(" ")});let i=e.children;return i!=null&&R(o,i),o}function Cl(e){let t=e.action,r=e.className??e.class,n=t.url??"",o=me("form");E(o,"method","post"),n&&E(o,"action",n),r&&E(o,"class",r);for(let[s,a]of Object.entries(e))s==="action"||s==="children"||s==="class"||s==="className"||a!=null&&typeof a!="function"&&E(o,s,String(a));typeof o.addEventListener=="function"&&o.addEventListener("submit",s=>{s.preventDefault();let a={};new FormData(o).forEach((l,u)=>{a[u]=l}),Promise.resolve(t(a)).catch(()=>{})});let i=e.children;return i!=null&&R(o,i),o}async function Tl(e,t){let r=pe(e,t);if(!r)return;let n=[];for(let o of r.matched){let i=o.component;i&&typeof i.preload=="function"&&n.push(i.preload())}await Promise.all(n)}var Ut,Ui,Fi,zi,wl,X,yn,mn=C(()=>{"use strict";x();I();x();rr();Oi();sn();sn();qi();kr();x();Ut=q(),Ui=q(),Fi=q(),zi=q();wl={router:{navigate:()=>{}},location:()=>({pathname:"",search:"",hash:"",query:{}}),params:()=>({})};X=e=>typeof e=="function"?e():e;yn=zt});var El={};Vt(El,{$component:()=>gt,A:()=>yn,DEV:()=>Pe,Dynamic:()=>Lo,ErrorBoundary:()=>Io,FRAMEWORK_NAME:()=>xi,For:()=>jo,Fragment:()=>Vr,Index:()=>Ro,Link:()=>zt,Match:()=>No,Outlet:()=>cn,Portal:()=>Do,Redirect:()=>fn,Router:()=>un,Show:()=>Po,Store:()=>at,Suspense:()=>Ne,Switch:()=>Mo,VERSION:()=>wi,addClass:()=>fo,batch:()=>j,classMap:()=>Ho,cleanupDelegation:()=>pi,composeProviders:()=>zr,createBrowserHistory:()=>de,createComponent:()=>je,createComputed:()=>kn,createConsumer:()=>yi,createContext:()=>we,createContextWithProvider:()=>hi,createDebounce:()=>Ln,createDeferred:()=>Mn,createEffect:()=>S,createIsomorphicState:()=>gi,createMemo:()=>g,createMemoryHistory:()=>We,createProvider:()=>Dt,createRenderEffect:()=>L,createResource:()=>G,createRoot:()=>M,createSelector:()=>Nn,createSignal:()=>A,createStore:()=>lr,delegateEvents:()=>re,devOnly:()=>Tr,getFrameworkInfo:()=>Ja,getOwner:()=>F,getSharedConfig:()=>_r,hydrate:()=>yt,initDelegation:()=>fi,insert:()=>R,isDOMNode:()=>pt,isDev:()=>Cr,isLitTemplateResult:()=>yo,isRenderable:()=>ci,jsx:()=>Br,jsxs:()=>Ai,lazy:()=>Me,mount:()=>Bi,onCleanup:()=>w,onMount:()=>vt,onUnmount:()=>bt,portal:()=>ui,read:()=>Wn,reduce:()=>zn,removeClass:()=>po,render:()=>Ae,runWithOwner:()=>W,setAttribute:()=>E,setOwner:()=>Cn,setProperty:()=>Oe,spread:()=>_o,startClient:()=>Ki,styleMap:()=>qo,toggleClass:()=>ho,untrack:()=>_,untrackStore:()=>ur,useCallback:()=>$t,useContext:()=>xe,useEffect:()=>Re,useEventListener:()=>St,useLocation:()=>Je,useMatch:()=>dn,useMemo:()=>At,useNavigate:()=>Ft,useParam:()=>pn,useParams:()=>Ke,useProvide:()=>mi,useReducer:()=>xt,useRef:()=>wt,useRouter:()=>$e,useSearchParams:()=>hn});x();x();var Ts="__fluixi_signal_next_state__",ks=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},O=globalThis[Ts]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:ks,onSuspend:null,onError:null},qn=0,Un=1,nt=2,Es=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(O.untracked)return;let e=O.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}};var Os=class extends Es{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=nt,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(O.consumer===this)throw new Error("Signal.Computed cannot read itself");if(this.track(),this.updateIfNecessary(),this._threw)throw this._error;return this._value}updateIfNecessary(){if(this.state===Un&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===nt)break}(this.state===nt||!this._initialized)&&this.recompute(),this.state=qn}recompute(){if(this.sources){for(let s of this.sources)s.observers?.delete(this);this.sources.clear()}let e=O.consumer,t=O.untracked;O.consumer=this,O.untracked=!1;let r,n=!1,o;try{r=this._fn()}catch(s){n=!0,o=s,r=this._value}finally{O.consumer=e,O.untracked=t}let i=!this._initialized||this._threw!==n||(n?o!==this._error:!this._equals(this._value,r));if(this._initialized=!0,this._threw=n,this._error=o,this._value=r,i){if(this.version++,this.observers)for(let s of[...this.observers])s.markDirty(nt);Fn(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===qn;if(this.state=e,t){if(this.observers)for(let r of[...this.observers])r.markDirty(Un);Fn(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function Fn(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}function Ps(e){return O.onSuspend?(O.onSuspend(e,O.owner),!0):!1}function js(){return O.owner}function Rs(e,t){let r=O.owner;O.owner=e;try{return t()}finally{O.owner=r}}function Ns(e){O.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function Ms(e){return!!e&&typeof e.then=="function"}Ns(()=>{});var Ls=Symbol.for("signal"),Ds=Symbol.for("memo");function Is(e,t,r){let n=t,o=js(),i=new Os(()=>Rs(o,()=>{try{return n=e(n)}catch(a){if(Ms(a))return Ps(a),n;throw a}}),{equals:r?.equals}),s=(()=>i.get());return Object.defineProperty(s,Ls,{value:!0,enumerable:!0}),Object.defineProperty(s,Ds,{value:!0,enumerable:!0}),s}function zn(e,t,r,n){return Is(()=>e().reduce(t,r),void 0,n)}function Wn(e){let t=e;for(;typeof t=="function";)t=t();return t}x();var or=Symbol("store-raw"),Vn=Symbol("store-node"),Bn=Symbol("store-has"),Kn=Symbol("store-self"),Jn=Symbol("store-track");var Xn=new WeakMap,Gn=new WeakMap;function to(e){let[t,r]=A(e),n=t;return n.$=r,n}function it(e){let t=Xn.get(e);return t||Xn.set(e,t={keys:new Map}),t}function Yn(e,t,r){let n=e.keys.get(t);return n||e.keys.set(t,n=to(r)),n}function Zn(e){let t=it(e);(t.all||(t.all=to()))()}function Qn(e,t){e.$(typeof t=="function"?()=>t:t)}function ro(e){if(e==null||typeof e!="object")return!1;if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function ot(e){if(!ro(e))return e;let t=Gn.get(e);if(t)return t;let r=new Proxy(e,Hs);return Gn.set(e,r),r}var Hs={get(e,t,r){if(t===or||t===Vn)return e;if(t===er)return r;if(t===Bn)return s=>s in e;if(t==="__proxy")return!0;if(t===Jn||t===Kn)return Zn(e),r;let n=e[t];if(typeof n=="function"&&!Object.prototype.hasOwnProperty.call(e,t))return n;let o=Object.getOwnPropertyDescriptor(e,t);if(o&&o.get)return o.get.call(r);let i=Yn(it(e),t,n)();return ro(i)?ot(i):i},set(){return!0},deleteProperty(e,t){return t in e&&ke(e,t,void 0),!0},has(e,t){return t===or||t===er||t===Vn||t===Bn||t===Kn||t===Jn?!0:(Yn(it(e),t,e[t])(),t in e)},ownKeys(e){return Zn(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e,t)}};function ke(e,t,r){if(e[t]===r&&(r!==void 0||t in e))return;let n=Array.isArray(e),o=n?e.length:0;r===void 0?delete e[t]:e[t]=r;let i=it(e),s=i.keys.get(t);if(s&&Qn(s,r),n&&e.length!==o){let a=i.keys.get("length");a&&Qn(a,e.length)}i.all&&i.all.$(void 0)}function eo(e,t){return typeof e=="function"?e(t):e}function ir(e,t){for(let r of Object.keys(t)){let n=t[r],o=e[r];n&&typeof n=="object"&&!Array.isArray(n)&&o&&typeof o=="object"&&!Array.isArray(o)?ir(o,n):ke(e,r,n)}}function ar(e){let t=[],r=e.replace(/\[([^\]]*)\]/g,".$1");for(let n of r.split("."))n.length&&t.push(n);return t}function no(e,t,r){let n=t.length-1;for(let i=0;i<n;i++){let s=t[i];if(s==="*"){let l=t.slice(i+1);if(Array.isArray(e))for(let u=0;u<e.length;u++)no(e[u],l,r);return}let a=e[s];(a==null||typeof a!="object")&&(a=/^\d+$/.test(t[i+1])?[]:{},ke(e,s,a)),e=a}let o=t[n];if(o==="*"){if(Array.isArray(e))for(let i=0;i<e.length;i++)ke(e,i,eo(r,e[i]));return}ke(e,o,eo(r,e[o]))}function nr(e,t,r){no(e,ar(t),r)}function qs(e,t){let r=t[0];if(typeof r=="function"&&t.length===1){let n=r(e);n&&n!==e&&ir(e,n);return}if(Array.isArray(r)&&t.length===1){for(let n of r)Array.isArray(n)&&nr(e,n[0],n[1]);return}if(r&&typeof r=="object"&&!Array.isArray(r)&&t.length===1){ir(e,r);return}if(Array.isArray(t[1])&&t.length>=3){nr(e,`${r}.${t[1].join(".")}`,t[2]);return}nr(e,String(r),t[1])}function sr(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(sr);let t={};for(let r of Object.keys(e))t[r]=sr(e[r]);return t}function ye(e,t){let r=e;for(let n of ar(t)){if(r==null)return;r=r[n]}return r}var at=class{constructor(e,t={immutable:!0}){this.options=t,this.root=e,this.set=((...r)=>j(()=>qs(this.root,r)))}get state(){return ot(this.root)}get proxy(){return ot(this.root)}get accessor(){return(()=>ot(this.root))}unwrap(){return this.root}getNode(e){return this.root&&this.root[e]}get(e){if(e==null||e==="")return st(this.state);let t=this.state;for(let r of ar(e)){if(t==null)return;t=t[r]}return st(t)}select(e){return g(()=>e(this.state))}subscribe(e){return S(()=>e(this.state))}watch(e,t){let r;return S(()=>{let n=e(this.state);Object.is(n,r)||(t(n,r),r=n)})}reactive(e){return g(()=>this.state[e])}produce(e){this.set((t=>{let r=sr(t);return e(r),r}))}reconcile(e,t={}){this.set(e)}push(e,...t){let r=ye(this.root,e);this.set(e,r.concat(t))}pop(e){let t=ye(this.root,e).slice(),r=t.pop();return this.set(e,t),r}shift(e){let t=ye(this.root,e).slice(),r=t.shift();return this.set(e,t),r}splice(e,t,r,...n){let o=ye(this.root,e).slice(),i=o.splice(t,r,...n);return this.set(e,o),i}insert(e,t,r){let n=ye(this.root,e).slice();n.splice(t,0,r),this.set(e,n)}removeAt(e,t){let r=ye(this.root,e).slice(),n=r.splice(t,1);return this.set(e,r),n}toObservable(){let[e]=A(this.state);return e.toObservable()}dispose(){}},Us=["get","select","watch","subscribe","produce","reconcile","push","pop","shift","splice","insert","removeAt","unwrap","toObservable"];function Fs(e,t){for(let r of Us)e[r]=t[r].bind(t);e.$=t.reactive.bind(t)}function lr(e,t={immutable:!0}){let r=new at(e,t);return Fs(r.set,r),[r.proxy,r.set]}function zs(e,t={}){return new at(e,{...t,immutable:!1})}function st(e){if(e==null||typeof e!="object")return e;let t=e[or];return t!==void 0?t:e}function ur(e){return _(()=>st(e))}var Fl=Object.freeze({createStore:lr,createMutableStore:zs,batch:j,unwrap:st,untrackStore:ur});x();I();ge();ge();x();I();function zo(e){return!!(e&&typeof e=="object"&&typeof e.then=="function"||e instanceof Promise)}var xa=q();function Ne(e){return ne(Sa,e)}function Sa(e){let t=In(),r=U(xa),n=r?r.register(t.inFallback):void 0;function o(c){return c==null||typeof c=="boolean"?null:typeof c=="function"&&K(c)&&!k(c)?c():c}let i=So(()=>o(e.fallback??null)),s=Qt(t,()=>e.children);Qt(t,()=>{L(()=>{let c=s;if(Array.isArray(c))for(let f of c)typeof f=="function"&&k(f)&&f();else typeof c=="function"&&k(c)&&c()})});let[a,l]=A(void 0),u=zo(s);return u&&(t.increment(),s.then(c=>{l(()=>c),t.decrement()},()=>t.decrement())),g(()=>(n?n.showFallback():t.inFallback())?i:u?a():s)}go(Ne);Object.defineProperty(Ne,"__suspense",{value:!0,enumerable:!0});kr();typeof window<"u"&&Promise.resolve().then(()=>(li(),ai)).then(e=>To(e.render));var Fr=typeof window>"u";function Ae(e,t,r={}){if(Z("render"),re(["click","input","change","submit"]),Fr)throw new Error("render() is for client-side only. Use renderToString() on server.");if(!t)throw new Error("Container element is required");let n;return M(o=>{n=o;let i=typeof e=="function"?e():e;t.textContent="",t.setAttribute("fluixi-js","v1"),R(t,()=>i)}),()=>{n&&(n(),n=void 0)}}function qa(e){return e&&typeof e=="object"&&(e._$litType$!==void 0||e._$litDirective$!==void 0)}function ui(e,t,r={}){let n=document.createElement("div");n.setAttribute("data-portal","true"),t.appendChild(n);let o=Ae(e,n,r);return()=>{o(),t.contains(n)&&t.removeChild(n)}}function ci(e){return!!(e==null||typeof e=="function"||pt(e)||qa(e)||Array.isArray(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean")}function fi(){Fr||re(["click","input","change","submit"])}function pi(){}Wr();x();I();var Fa="__fluixi_iso_states__",za="__iso:";function Wa(){return globalThis[Fa]??=new Map}function Va(e){if(typeof window>"u")return;let t=Ar();return t?t[za+e]:void 0}function gi(e,t){let r=Va(e),n=r!==void 0?r:typeof window<"u"&&t.client?t.client():t.fallback,[o,i]=A(n);return Wa().set(e,{server:t.server,set:i}),{value:o,set:i,key:e}}I();I();I();I();I();x();var Vr=Symbol.for("fluixi.fragment"),vi=typeof window>"u";function bi(e){return e==null||e===!1?null:Array.isArray(e)?e.map(bi).flat():e}function Br(e,t,r){if(e==null)return null;let n=t||{};if(r!==void 0&&(n.key=r),e===Vr)return g(()=>dt(bi(n.children)));if(typeof e=="function"){let{type:o}=vo(e);return e.$$typeof===Symbol.for("react.provider")||o==="provider"?e(n):vi?{type:e,props:n}:g(()=>ne(e,n),void 0,{name:"jsx component"})}return typeof e=="string"&&e.trim().length>0?Ba(e,n):null}var Ai=Br;function Ba(e,t){if(vi)return{type:e,props:t||{}};let r=Eo(e),n=r?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return Ka(n,t,r),n}function Ka(e,t,r){if(Co(e,t,r),t&&t.children!==void 0){let n=Te(()=>t.children);Array.isArray(n)?n.forEach(o=>{R(e,o,typeof o=="function"?null:void 0)}):R(e,n,typeof n=="function"?null:void 0)}}ge();var wi="0.0.1",xi="Fluixi";function Ja(){return{name:xi,version:wi,features:{ssr:!0,hydration:!0,jsx:!0,litHtml:!0,signals:!0,fineGrained:!0,lazy:!0,hooks:!0,devMode:!0}}}Z("index");I();Xr();ge();x();function ce(e){return typeof e=="function"?e():e}function Ga(e){if(typeof e=="string")return e;let t=[];return t.push(e.index===!1?"noindex":"index"),t.push(e.follow===!1?"nofollow":"follow"),e.noarchive&&t.push("noarchive"),e.nosnippet&&t.push("nosnippet"),e.noimageindex&&t.push("noimageindex"),e.maxSnippet!=null&&t.push(`max-snippet:${e.maxSnippet}`),e.maxImagePreview&&t.push(`max-image-preview:${e.maxImagePreview}`),e.maxVideoPreview!=null&&t.push(`max-video-preview:${e.maxVideoPreview}`),t.join(", ")}function Gr(){let e=[],[t,r]=A(0);return{sources:e,version:t,push(n){return e.push(n),r(o=>o+1),()=>{let o=e.indexOf(n);o!==-1&&(e.splice(o,1),r(i=>i+1))}}}}var Ya=null;function Yr(e){Ya=e}function Ht(e){let t=5381;for(let r=0;r<e.length;r++)t=t*33^e.charCodeAt(r);return(t>>>0).toString(36)}function Za(e){return e.charset!=null?"meta:charset":e.property?"meta:property:"+e.property:e.name?"meta:name:"+e.name:e["http-equiv"]?"meta:http-equiv:"+e["http-equiv"]:"meta:"+Ht(JSON.stringify(e))}function Qa(e,t){let r=typeof t=="string"?{url:t}:t;e.push({tag:"meta",key:"meta:property:og:image:"+r.url,attrs:{property:"og:image",content:r.url}}),r.secureUrl&&e.push({tag:"meta",key:"meta:property:og:image:secure:"+r.url,attrs:{property:"og:image:secure_url",content:r.secureUrl}}),r.type&&e.push({tag:"meta",key:"meta:property:og:image:type:"+r.url,attrs:{property:"og:image:type",content:r.type}}),r.width!=null&&e.push({tag:"meta",key:"meta:property:og:image:width:"+r.url,attrs:{property:"og:image:width",content:String(r.width)}}),r.height!=null&&e.push({tag:"meta",key:"meta:property:og:image:height:"+r.url,attrs:{property:"og:image:height",content:String(r.height)}}),r.alt&&e.push({tag:"meta",key:"meta:property:og:image:alt:"+r.url,attrs:{property:"og:image:alt",content:r.alt}})}function el(e,t){let r=(n,o)=>{o!=null&&t.push({tag:"meta",key:"meta:property:og:"+n,attrs:{property:"og:"+n,content:o}})};r("title",e.title),r("description",e.description),r("type",e.type),r("url",e.url),r("site_name",e.siteName),r("locale",e.locale);for(let n of e.localeAlternate??[])t.push({tag:"meta",key:"meta:property:og:locale:alt:"+n,attrs:{property:"og:locale:alternate",content:n}});if(e.image!=null){let n=Array.isArray(e.image)?e.image:[e.image];for(let o of n)Qa(t,o)}if(e.video){let n=typeof e.video=="string"?{url:e.video}:e.video;r("video",n.url),"type"in n&&n.type&&r("video:type",n.type),"width"in n&&n.width!=null&&r("video:width",String(n.width)),"height"in n&&n.height!=null&&r("video:height",String(n.height))}if(e.audio){let n=typeof e.audio=="string"?{url:e.audio}:e.audio;r("audio",n.url),"type"in n&&n.type&&r("audio:type",n.type)}if(e.article){let n=e.article;r("article:published_time",n.publishedTime),r("article:modified_time",n.modifiedTime),r("article:expiration_time",n.expirationTime),r("article:section",n.section);for(let o of[].concat(n.author??[]))t.push({tag:"meta",key:"meta:property:og:article:author:"+o,attrs:{property:"article:author",content:o}});for(let o of[].concat(n.tag??[]))t.push({tag:"meta",key:"meta:property:og:article:tag:"+o,attrs:{property:"article:tag",content:o}})}if(e.book){let n=e.book;r("book:isbn",n.isbn),r("book:release_date",n.releaseDate);for(let o of[].concat(n.author??[]))t.push({tag:"meta",key:"meta:property:og:book:author:"+o,attrs:{property:"book:author",content:o}});for(let o of[].concat(n.tag??[]))t.push({tag:"meta",key:"meta:property:og:book:tag:"+o,attrs:{property:"book:tag",content:o}})}if(e.profile){let n=e.profile;r("profile:first_name",n.firstName),r("profile:last_name",n.lastName),r("profile:username",n.username),r("profile:gender",n.gender)}}function tl(e,t){let r=(n,o)=>{o!=null&&t.push({tag:"meta",key:"meta:name:twitter:"+n,attrs:{name:"twitter:"+n,content:o}})};r("card",e.card),r("site",e.site),r("creator",e.creator),r("title",e.title),r("description",e.description),r("image",e.image),r("image:alt",e.imageAlt),r("player",e.player),e.playerWidth!=null&&r("player:width",String(e.playerWidth)),e.playerHeight!=null&&r("player:height",String(e.playerHeight)),e.app&&(r("app:name:iphone",e.app.name),r("app:id:iphone",e.app.idIphone),r("app:id:ipad",e.app.idIpad),r("app:id:googleplay",e.app.idGooglePlay))}function rl(e,t){let r=(n,o)=>t.push({tag:"link",key:n,attrs:o});if(e.icon!=null){let n=typeof e.icon=="string"?[{url:e.icon}]:e.icon;for(let o of n)r("link:icon:"+o.url,{rel:"icon",href:o.url,...o.type?{type:o.type}:{},...o.sizes?{sizes:o.sizes}:{}})}if(e.apple!=null){let n=typeof e.apple=="string"?[{url:e.apple}]:e.apple;for(let o of n)r("link:apple-touch-icon:"+o.url,{rel:"apple-touch-icon",href:o.url,...o.sizes?{sizes:o.sizes}:{}})}e.mask&&r("link:mask-icon",{rel:"mask-icon",href:e.mask.url,...e.mask.color?{color:e.mask.color}:{}}),e.shortcut&&r("link:shortcut",{rel:"shortcut icon",href:e.shortcut}),e.msTileImage&&t.push({tag:"meta",key:"meta:name:msapplication-TileImage",attrs:{name:"msapplication-TileImage",content:e.msTileImage}}),e.msTileColor&&t.push({tag:"meta",key:"meta:name:msapplication-TileColor",attrs:{name:"msapplication-TileColor",content:e.msTileColor}})}function nl(e,t,r){let n=(f,p)=>t.push({tag:"meta",key:f,attrs:p}),o=ce(e.title);o!==void 0&&(r.title=o),e.titleTemplate!==void 0&&(r.template=e.titleTemplate);let i=ce(e.lang);i!==void 0&&t.push({tag:"htmlAttr",key:"html:lang",name:"lang",value:i}),e.charset!==void 0&&n("meta:charset",{charset:e.charset}),e.viewport!==void 0&&n("meta:name:viewport",{name:"viewport",content:e.viewport});let s=ce(e.description);s!==void 0&&n("meta:name:description",{name:"description",content:s});let a=ce(e.keywords);a!==void 0&&n("meta:name:keywords",{name:"keywords",content:Array.isArray(a)?a.join(", "):a}),e.author!==void 0&&n("meta:name:author",{name:"author",content:e.author}),e.robots!==void 0&&n("meta:name:robots",{name:"robots",content:Ga(e.robots)}),e.generator!==void 0&&n("meta:name:generator",{name:"generator",content:e.generator}),e.applicationName!==void 0&&n("meta:name:application-name",{name:"application-name",content:e.applicationName}),e.referrer!==void 0&&n("meta:name:referrer",{name:"referrer",content:e.referrer}),e.colorScheme!==void 0&&n("meta:name:color-scheme",{name:"color-scheme",content:e.colorScheme});let l=ce(e.themeColor);l!==void 0&&n("meta:name:theme-color",{name:"theme-color",content:l});let u=ce(e.canonical);if(u!==void 0&&t.push({tag:"link",key:"link:rel:canonical",attrs:{rel:"canonical",href:u}}),e.manifest!==void 0&&t.push({tag:"link",key:"link:rel:manifest",attrs:{rel:"manifest",href:e.manifest}}),e.base!==void 0&&t.push({tag:"base",key:"base",attrs:{href:e.base}}),e.verification){let f={google:"google-site-verification",bing:"msvalidate.01",yandex:"yandex-verification",pinterest:"p:domain_verify"};for(let[p,h]of Object.entries(e.verification)){if(h==null)continue;let d=f[p]??p;n("meta:name:"+d,{name:d,content:h})}}for(let f of e.alternates??[])t.push({tag:"link",key:"link:alternate:hreflang:"+f.hreflang,attrs:{rel:"alternate",hreflang:f.hreflang,href:f.href}});for(let f of e.feeds??[])t.push({tag:"link",key:"link:alternate:feed:"+f.href,attrs:{rel:"alternate",type:f.type??"application/rss+xml",href:f.href,...f.title?{title:f.title}:{}}});e.og&&el(e.og,t),e.twitter&&tl(e.twitter,t),e.icons&&rl(e.icons,t);let c=ce(e.jsonLd);if(c!==void 0){let f=Array.isArray(c)?c:[c];for(let p of f){let h=JSON.stringify(p);t.push({tag:"script",key:"script:ldjson:"+Ht(h),attrs:{type:"application/ld+json"},children:h})}}for(let f of e.meta??[]){let p={};for(let[h,d]of Object.entries(f))d!=null&&(p[h==="httpEquiv"?"http-equiv":h]=d);t.push({tag:"meta",key:Za(p),attrs:p})}for(let f of e.link??[]){let p={};for(let[h,d]of Object.entries(f))d!=null&&(p[h]=d);t.push({tag:"link",key:"link:"+(p.rel??"")+":"+(p.href??Ht(JSON.stringify(p))),attrs:p})}for(let f of e.script??[]){let p={},h;for(let[d,y]of Object.entries(f))y!=null&&(d==="children"?h=y:p[d]=y);t.push({tag:"script",key:"script:"+(p.src??Ht((h??"")+JSON.stringify(p))),attrs:p,children:h})}}function ol(e,t){return typeof e=="function"?e(t):e.includes("%s")?e.replace("%s",t):e}function qt(e){let t=[],r={};for(let i of e.sources){let s=typeof i=="function"?i():i;nl(s,t,r)}r.title!==void 0&&t.push({tag:"title",key:"title",children:r.template?ol(r.template,r.title):r.title});let n=new Map,o={};for(let i of t){if(i.tag==="htmlAttr"){o[i.name]=i.value;continue}n.set(i.key,i)}return{tags:[...n.values()],htmlAttrs:o}}var Fe="data-fh",ze="data-fh-key";function Zr(e){for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType===8&&t.data.startsWith("fh:")){t.parentNode?.removeChild(t);return}}x();function Ei(e,t){for(let r of Array.from(e.attributes))r.name===Fe||r.name===ze||r.name in t||e.removeAttribute(r.name);for(let[r,n]of Object.entries(t))e.getAttribute(r)!==n&&e.setAttribute(r,n)}function il(e){let t=document.createElement(e.tag);return Ei(t,e.attrs),t.setAttribute(Fe,""),t.setAttribute(ze,e.key),e.tag==="script"&&e.children!=null&&(t.textContent=e.children),t}function sl(e,t){let r=document.head,n=new Map;for(let s of Array.from(r.querySelectorAll(`[${Fe}]`))){let a=s.getAttribute(ze);s.tagName!=="TITLE"&&a&&n.set(a,s)}let o=null,i=new Set;for(let s of e){if(s.tag==="title"){o=s.children;continue}if(s.tag==="htmlAttr")continue;i.add(s.key);let a=n.get(s.key);a&&a.tagName===s.tag.toUpperCase()?(Ei(a,s.attrs),s.tag==="script"&&(a.textContent??"")!==(s.children??"")&&(a.textContent=s.children??"")):(a&&a.remove(),r.appendChild(il(s)))}for(let[s,a]of n)i.has(s)||a.remove();o!=null&&document.title!==o&&(document.title=o);for(let[s,a]of Object.entries(t))document.documentElement.getAttribute(s)!==a&&document.documentElement.setAttribute(s,a)}function Qr(e){return M(t=>(S(()=>{e.version();let{tags:r,htmlAttrs:n}=qt(e);sl(r,n)}),w(()=>{}),t))}Z("client index");function Bi(e,t){if(!t)throw new Error("Container element not found for mount()");br(()=>e(),t)}async function Ki(e,t={}){let r=typeof t.root=="string"?document.querySelector(t.root):t.root??document.querySelector("#app");if(!r)throw new Error(`[Fluixi] Mount container not found: ${t.root??"#app"}`);let n=!!document.getElementById("__FLUIXI_HYDRATION__")||!!t.routes&&r.firstElementChild!=null,o=t.hydrate??n,i=Gr();if(Yr(i),Zr(r),o){if(t.routes&&t.routes.length){let{preloadRoutes:s}=await Promise.resolve().then(()=>(mn(),Vi));await s(t.routes,window.location.pathname)}Ti(),Kr(!0),yt(()=>e(),r),kl(),setTimeout(()=>{Kr(!1),Jr()},100)}else Ae(()=>e(),r);Qr(i)}function kl(){if(typeof window>"u")return;let e=window;typeof e.__FX_REPLAY_STOP__=="function"&&e.__FX_REPLAY_STOP__();let t=e.__FX_REPLAY__;if(e.__FX_REPLAY__=void 0,e.__FX_REPLAY_STOP__=void 0,!(!Array.isArray(t)||t.length===0))for(let r of t){let n=r&&r.target;if(!n||n.isConnected===!1||typeof n.dispatchEvent!="function")continue;let o=r.type,i=o==="click"?new MouseEvent(o,{bubbles:!0,cancelable:!0}):new Event(o,{bubbles:!0,cancelable:!0});n.dispatchEvent(i)}}mn();return Qi(El);})();
1
+ "use strict";var Fluixi=(()=>{var yt=Object.defineProperty;var zo=Object.getOwnPropertyDescriptor;var Vo=Object.getOwnPropertyNames;var Uo=Object.prototype.hasOwnProperty;var j=(e,t)=>()=>(e&&(t=e(e=0)),t);var Er=(e,t)=>{for(var r in t)yt(e,r,{get:t[r],enumerable:!0})},Bo=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Vo(t))!Uo.call(e,o)&&o!==r&&yt(e,o,{get:()=>t[o],enumerable:!(n=zo(t,o))||n.enumerable});return e};var Ko=e=>Bo(yt({},"__esModule",{value:!0}),e);function mt(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}function Zo(e){if(m.untracked)return e();m.untracked=!0;try{return e()}finally{m.untracked=!1}}function Me(e){return{cleanups:null,owned:null,parent:e,contexts:null}}function q(e){let t=Symbol("context");return{id:t,defaultValue:e,Provider:r=>{let n=m.owner,o=Me(n);(o.contexts=new Map).set(t,r.value),n&&(n.owned??=[]).push(o),m.owner=o;try{return r.children}finally{m.owner=n}}}}function H(e){let t=m.owner;for(;t;){if(t.contexts&&t.contexts.has(e.id))return t.contexts.get(e.id);t=t.parent}return e.defaultValue}function Lr(e,t){let r=e;for(;r;){if(r.contexts&&r.contexts.has(t.id))return r.contexts.get(t.id);r=r.parent}return t.defaultValue}function Qo(e,t,r){let n=Me(m.owner);(n.contexts=new Map).set(e.id,t),m.owner&&(m.owner.owned??=[]).push(n);let o=m.owner;m.owner=n;try{return r()}finally{m.owner=o}}function ei(e){m.onSuspend=e}function ti(e){return m.onSuspend?(m.onSuspend(e,m.owner),!0):!1}function ri(e){m.onError=e}function F(){return m.owner}function Dr(e){let t=m.owner;return m.owner=e,t}function W(e,t){let r=m.owner;m.owner=e;try{return t()}finally{m.owner=r}}function A(e){m.owner&&(m.owner.cleanups??=[]).push(e)}function Ne(e){if(e.owned){for(let t=e.owned.length-1;t>=0;t--)Ne(e.owned[t]);e.owned=null}if(e.cleanups){for(let t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}}function M(e){let t=Me(m.owner);m.owner&&(m.owner.owned??=[]).push(t);let r=m.owner;m.owner=t;try{return e(()=>Ne(t))}finally{m.owner=r}}function ni(e){m.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function oi(e){e.queued||(e.queued=!0,m.queue.push(e),!m.scheduled&&m.batchDepth===0&&(m.scheduled=!0,m.hostSchedule(wt)))}function wt(){if(m.scheduled=!1,m.flushing)return;m.flushing=!0;let e=0;try{for(;m.queue.length;){if(++e>1e5)throw new Error("[fluixi] effect flush did not settle (cycle?)");let t=m.queue;m.queue=[];for(let r of t)r.queued=!1,r.disposed||r.run()}}finally{m.flushing=!1}}function ii(){m.batchDepth===0&&wt()}function si(e){m.batchDepth++;try{return e()}finally{--m.batchDepth===0&&wt()}}function At(e){let t=new ai(e);return()=>t.dispose()}function li(e){return!!e&&typeof e.then=="function"}function w(e,t){let r=new Go(e,{equals:t?.equals}),n=(()=>r.get()),o=(i=>{let a=typeof i=="function"?i(r.peek()):i;return r.set(a),ii(),a});return Object.defineProperty(n,Ir,{value:!0,enumerable:!0}),Object.defineProperty(n,ci,{value:{get value(){return r.peek()},get version(){return r.version}},enumerable:!1}),[n,o]}function g(e,t,r){let n=t,o=F(),i=new Mr(()=>W(o,()=>{try{return n=e(n)}catch(s){if(li(s))return ti(s),n;throw s}}),{equals:r?.equals}),a=(()=>i.get());return Object.defineProperty(a,Ir,{value:!0,enumerable:!0}),Object.defineProperty(a,ui,{value:!0,enumerable:!0}),a}function S(e,t){let r=t;return At(()=>{r=e(r)})}function qr(e,t){let r=t;At(()=>{r=e(r)})}function R(e,t){let r=t;return At(()=>{r=e(r)})}function $(e){return si(e)}function k(e){return Zo(e)}function Hr(e,t,r){let n=[];return A(()=>{for(let o of n)o.dispose();n=[]}),g(()=>{let o=e()||[];return k(()=>{if(o.length===0){for(let l of n)l.dispose();return n=[],r?.fallback?r.fallback():[]}let i=new Map;for(let l of n)i.has(l.item)||i.set(l.item,l);let a=[],s=new Set;for(let l=0;l<o.length;l++){let u=o[l],c=i.get(u);if(c&&!s.has(c))c.setIndex(l),a.push(c),s.add(c);else{let f,p,y;M(h=>{y=h;let[b,T]=w(l);p=T,f=t(u,b)});let d={item:u,rendered:f,dispose:y,setIndex:p};a.push(d),s.add(d)}}for(let l of n)s.has(l)||l.dispose();return n=a,a.map(l=>l.rendered)})})}function Fr(e,t,r,n){let o=[],i=[];return A(()=>{for(let a of i)a.dispose();o=[],i=[]}),g(()=>{let a=e()||[];return k(()=>{if(a.length===0){for(let f of i)f.dispose();return o=[],i=[],n?.fallback?n.fallback():[]}let s=new Map;for(let f=0;f<o.length;f++)s.set(o[f],i[f]);let l=[],u=[],c=new Set;for(let f=0;f<a.length;f++){let p=t(a[f]),y=s.get(p);if(y&&!c.has(p))y.setIndex(f),l.push(y);else{let d,h,b;M(T=>{b=T;let[E,de]=w(f);h=de;let $e=g(oe=>(e()||[])[E()]??oe,a[f]);d=r($e,E)}),l.push({rendered:d,dispose:b,setIndex:h})}u.push(p),c.add(p)}for(let[f,p]of s)c.has(f)||p.dispose();return o=u,i=l,l.map(f=>f.rendered)})})}function Wr(e,t,r){let n=[];return A(()=>{for(let o of n)o.dispose();n=[]}),g(()=>{let o=e()||[];return k(()=>{if(o.length===0){for(let l of n)l.dispose();return n=[],r?.fallback?r.fallback():[]}let i=n.length,a=o.length;for(let l=i;l<a;l++){let u,c,f,p=o[l];M(y=>{f=y;let[d,h]=w(p);c=h,u=t(d,l)}),n.push({rendered:u,setItem:c,dispose:f})}for(let l=a;l<i;l++)n[l].dispose();a<i&&(n=n.slice(0,a));let s=Math.min(i,a);for(let l=0;l<s;l++)n[l].setItem(o[l]);return n.map(l=>l.rendered)})})}function O(e){return typeof e=="function"&&e[fi]===!0}function pi(e){jr&&jr(e)}function zr(e){gt=e}function di(e){return gt?gt(e):void 0}function Vr(e){vt=e}function yi(){return vt?vt():void 0}function hi(e,t){Rr&&Rr(e,t)}function Ur(e,t=(r,n)=>r===n){let r=new Map;return S(()=>{let n=e();for(let[o,i]of r){let[a,s]=i,l=t(o,n);a()!==l&&s(l)}}),n=>{let o=r.get(n);if(!o){let[i,a]=w(!1);o=[i,a],r.set(n,o);let s=e();a(t(n,s))}return o[0]()}}function Br(e,t){let[r,n]=w(e(),t);return S(()=>{let o=e();t?.timeoutMs?setTimeout(()=>n(()=>o),t.timeoutMs):typeof requestIdleCallback=="function"?requestIdleCallback(()=>n(()=>o)):Promise.resolve().then(()=>n(()=>o))}),r}function Kr(e,t){let r,n=(...o)=>{r!==void 0&&clearTimeout(r),r=setTimeout(()=>{if(r=void 0,o.length>0){let i=o[o.length-1];typeof i=="object"&&i&&!i.tagName&&i.target&&i.target.tagName&&(i=i.target),i&&typeof i=="object"&&i.tagName&&(i.tagName.toLowerCase()==="input"||i.tagName.toLowerCase()==="textarea")&&i.focus()}e(...o)},t)};return A(()=>{r!==void 0&&clearTimeout(r)}),n}function bt(e){if(typeof e=="function"&&!e.length){let t=e();return O(t)?t:bt(t)}if(Array.isArray(e)){let t=[];for(let r=0;r<e.length;r++){let n=bt(e[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n)}return t}return e}function he(e){let t=g(e);return g(()=>bt(t()))}function mi(e){return!!e&&typeof e.then=="function"}function K(e,t,r={}){let n,o;typeof t=="function"?(n=typeof e=="function"?e:()=>e,o=t):(n=()=>!0,o=e,t&&typeof t=="object"&&(r=t));let i=yi(),a=i!==void 0?di(i):void 0,s=a!==void 0,[l,u]=w(a!==void 0?a.value:r.initialValue,{equals:!1}),[c,f]=w(void 0,{equals:!1}),[p,y]=w(a!==void 0||r.initialValue!==void 0?"ready":"unresolved",{equals:!1}),[d,h]=w(void 0,{equals:!1}),[b,T]=w(void 0,{equals:!1}),E=ht,de=!1;S(()=>{let N=n();if(b(),N===!1||N===null||N===void 0){E=ht,$(()=>{y("unresolved"),h(void 0),f(void 0)});return}let _e=de;if(de=!1,E!==ht&&N===E&&!_e)return;if(E=N,s){s=!1;return}let je=!1;A(()=>je=!0);let Or=k(p),Wo=k(l),Pr=Or==="ready"||Or==="refreshing";$(()=>{y(Pr?"refreshing":"pending"),f(void 0)});try{let G=o(N,{value:Wo,refetching:Pr});mi(G)?(h(G),pi(G),G.then(Re=>{je||(i!==void 0&&hi(i,Re),$(()=>{u(()=>Re),y("ready"),h(void 0)}))},Re=>{je||$(()=>{f(Re),y("errored"),h(void 0)})})):$(()=>{u(()=>G),y("ready"),h(void 0)})}catch(G){if(je)return;$(()=>{f(G),y("errored"),h(void 0)})}});let $e=()=>{let N=p();return N==="pending"||N==="refreshing"},oe=(()=>{let N=c();if(N)throw N;if($e()){let _e=d();if(_e)throw _e}return l()});return Object.defineProperties(oe,{state:{get:p},loading:{get:$e},error:{get:c},latest:{get:l}}),Object.defineProperty(oe,Symbol.for("resource"),{value:!0,enumerable:!0}),Object.defineProperty(oe,Symbol.for("signal"),{value:!0,enumerable:!0}),[oe,{mutate:u,refetch:()=>{de=!0,T(void 0)}}]}function Xr(){let[e,t]=w(0),r=0;return{increment:()=>t(r+=1),decrement:()=>t(r-=1),inFallback:()=>e()>0}}function xt(e,t){return Qo(Jr,e,t)}var Jo,Xo,m,$r,_r,ye,Nr,Go,Mr,Yo,ai,Ir,ui,ci,fi,jr,gt,vt,Rr,ht,Jr,gi,St,x=j(()=>{"use strict";Jo="__fluixi_signal_next_state__",Xo=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},m=globalThis[Jo]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:Xo,onSuspend:null,onError:null},$r=0,_r=1,ye=2,Nr=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(m.untracked)return;let e=m.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}},Go=class extends Nr{constructor(e,t){super(),this._value=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){return this.track(),this._value}set(e){if(!this._equals(this._value,e)){if(this._value=e,this.version++,this.observers)for(let t of[...this.observers])t.markDirty(ye);mt(this)}}peek(){return this._value}},Mr=class extends Nr{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=ye,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(m.consumer===this)throw new Error("Signal.Computed cannot read itself");if(this.track(),this.updateIfNecessary(),this._threw)throw this._error;return this._value}updateIfNecessary(){if(this.state===_r&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===ye)break}(this.state===ye||!this._initialized)&&this.recompute(),this.state=$r}recompute(){if(this.sources){for(let a of this.sources)a.observers?.delete(this);this.sources.clear()}let e=m.consumer,t=m.untracked;m.consumer=this,m.untracked=!1;let r,n=!1,o;try{r=this._fn()}catch(a){n=!0,o=a,r=this._value}finally{m.consumer=e,m.untracked=t}let i=!this._initialized||this._threw!==n||(n?o!==this._error:!this._equals(this._value,r));if(this._initialized=!0,this._threw=n,this._error=o,this._value=r,i){if(this.version++,this.observers)for(let a of[...this.observers])a.markDirty(ye);mt(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===$r;if(this.state=e,t){if(this.observers)for(let r of[...this.observers])r.markDirty(_r);mt(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};Yo=class{constructor(e){this._watched=new Set,this._pending=new Set,this._notifyFn=e}watch(...e){for(let t of e)this._watched.add(t),(t.watchers??=new Set).add(this)}unwatch(...e){for(let t of e)this._watched.delete(t),t.watchers?.delete(this),this._pending.delete(t)}getPending(){let e=[...this._pending];return this._pending.clear(),e}_notify(e){if(!this._watched.has(e)||this._pending.has(e))return;let t=this._pending.size===0;this._pending.add(e),t&&this._notifyFn()}};ai=class{constructor(e){this.queued=!1,this.disposed=!1,this.owner=Me(m.owner),m.owner&&(m.owner.cleanups??=[]).push(()=>this.dispose()),this.computed=new Mr(()=>{Ne(this.owner),W(this.owner,()=>{let t=e();typeof t=="function"&&(this.owner.cleanups??=[]).push(t)})}),this.watcher=new Yo(()=>oi(this)),this.run(),this.watcher.watch(this.computed)}run(){if(!this.disposed){this.watcher.getPending();try{this.computed.get()}catch(e){if(e&&typeof e.then=="function"&&m.onSuspend){m.onSuspend(e,this.owner);return}if(m.onError&&m.onError(e,this.owner))return;throw e}}}dispose(){this.disposed||(this.disposed=!0,this.watcher.unwatch(this.computed),Ne(this.owner))}};ni(()=>{});Ir=Symbol.for("signal"),ui=Symbol.for("memo"),ci=Symbol.for("signal-node");fi=Symbol.for("signal");jr=null;gt=null;vt=null;Rr=null;ht=Symbol();Jr=q();ei((e,t)=>{let r=Lr(t,Jr);r&&(r.increment(),e.finally(()=>r.decrement()))});gi=q();ri((e,t)=>{let r=Lr(t,gi);return r?(r.setError(e),!0):!1});St=Symbol.for("fluixi-proxy")});function Le(e,t,r={}){let{preserveStructure:n,multiple:o,throwOnError:i=!1,defaultValue:a,maxDepth:s=20}=r;if(!e||typeof e!="object")return a;if(!t)return e;if(Array.isArray(t))if(n){let c={};for(let f of t){let p=Le(e,f,{...r,preserveStructure:!1});p!==void 0&&bi(c,f,p)}return c}else return t.map(c=>Le(e,c,{...r,preserveStructure:!1}));let l=Tt(t,{...r,throwOnError:i});if(l.length===0)return e;if(typeof n>"u"||n===!1){let c=wi(e,t);return o===!1&&Array.isArray(c)?c[0]:c===void 0&&a!==void 0?a:c}let u=I(e,l,0,s);return u===void 0&&a!==void 0?a:u}function wi(e,t,r={}){let{createMissing:n=!1,add:o=!1,debug:i=!1}=r,a=Tt(t),s=e,l=!1,u="",c=t;if(typeof s=="object"&&!Array.isArray(s)&&c.length>0&&s[c])return s=s[c],s;for(let f=0;f<a.length;f++){let p=a[f],y=a.length>1?f===a.length-1:!1;if(s===null&&!n)return;let d=a[f+1];switch(p.type){case"property":if(s&&typeof s=="object")if(Array.isArray(s)){if(typeof p.value=="number"){let h=p.value;if(n&&h>=s.length)for(let b=s.length;b<=h;b++)s.push(void 0);if(n&&(s[h]===null||s[h]===void 0)&&(!y||l)&&(d?s[h]=d.type==="index"||d.type==="slice"||d.type==="union"||d.type==="wildcard"?[]:{}:s[h]=null,l=!1),s=s[h],d){l=!0;continue}}else o?s.push({[String(p.value)]:null}):s=s.map(h=>h[String(p.value)]);if(d)continue;return Gr(s)}else{if(s[u]&&u.split(".").length>=2){s=s[u];continue}if(n&&(s[String(p.value)]===null||s[String(p.value)]===void 0)&&(!y||l)&&(d?s[String(p.value)]=d.type==="index"||d.type==="slice"||d.type==="union"||d.type==="wildcard"?[]:{}:s[String(p.value)]=null,l=!1,s=s[String(p.value)],d)){l=!0;continue}if(s?(!s[String(p.value)]&&n&&(s[String(p.value)]=null),s=s[String(p.value)]):s={[String(p.value)]:null},d)continue}else if(n)s={},s[String(p.value)]=d.type==="index"||d.type==="slice"||d.type==="union"||d.type==="wildcard"||r.type==="array"?[]:{},s=s[String(p.value)];else return;break;case"index":case"wildcard":if(Array.isArray(s)){if(p.type==="index"){let h=p.value;if(h<0){s=s[s.length-Math.abs(h)];continue}if(n&&(h>=s.length||s[h]==null||s[h]==null)&&!y){for(let b=s.length;b<=h;b++)s.push(void 0);d&&(s[h]=d.type==="index"||d.type==="slice"||d.type==="union"||d.type==="wildcard"?[]:{})}s=s[h]}else if(!y)continue}else if(n){let h=a[f+1];s=[];let b=p.value;for(let T=0;T<=b;T++)s.push(void 0);s[b]=h.type==="index"||h.type==="slice"||h.type==="union"||h.type==="wildcard"||r.type==="array"?[]:{},s=s[b]}else{if(p.type==="index"&&typeof s=="object"&&s&&s[String(p.value)]!==void 0){s=s[String(p.value)];continue}if(typeof s=="object"){s=Object.values(s);continue}return}break;default:return}}return Gr(s)}function Gr(e){return Array.isArray(e)?e.filter(t=>typeof t<"u"):e}var De,I,Tt,vi,bi,kt=j(()=>{"use strict";De=e=>e==null||Array.isArray(e)||typeof e=="function"||e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof Error?!1:typeof e=="object",I=(e,t,r,n)=>{if(r>n)return;if(t.length===0)return e;let o=t[0],i=t.slice(1);if(o.type==="descendant"){let a=I(e,i,r+1,n);if(a!==void 0)return a;if(e&&typeof e=="object")if(Array.isArray(e)){let s=[];for(let l=0;l<e.length;l++){let u=I(e[l],t,r+1,n);u!==void 0&&(s[l]=u)}return s.length>0?s:void 0}else{let s={};for(let l in e)if(e.hasOwnProperty(l)){let u=I(e[l],t,r+1,n);u!==void 0&&(s[l]=u)}return Object.keys(s).length>0?s:void 0}return}switch(o.type){case"property":if(De(e)&&o.value&&String(o.value)in e){let a=e[String(o.value)],s=I(a,i,r+1,n);if(s!==void 0)return{[String(o.value)]:s}}break;case"index":if(Array.isArray(e)){let a=o.value;if(a>=0&&a<e.length){let s=I(e[a],i,r+1,n);if(s!==void 0){let l=new Array(e.length).filter(u=>u!==void 0);return l[a]=s,l}}}else if(e&&typeof e=="object"){let a=String(o.value);if(a in e){let s=I(e[a],i,r+1,n);if(s!==void 0)return{[a]:s}}}break;case"wildcard":if(e&&typeof e=="object")if(Array.isArray(e)){let a=[],s=!1;for(let l=0;l<e.length;l++){let u=I(e[l],i,r+1,n);u!==void 0&&(a[l]=u,s=!0)}return s?a:void 0}else{let a={},s=!1;for(let l in e)if(e.hasOwnProperty(l)){let u=I(e[l],i,r+1,n);u!==void 0&&(a[l]=u,s=!0)}return s?a:void 0}break;case"slice":if(Array.isArray(e)){let[a,s]=o.value,l=Math.max(0,a),u=Math.min(e.length,s===1/0?e.length:s),c=[],f=!1;for(let p=l;p<u;p++){let y=I(e[p],i,r+1,n);y!==void 0&&(c[p]=y,f=!0)}return f?c:void 0}break;case"union":if(Array.isArray(e)){let a=o.value,s=[],l=!1;for(let u of a)if(u>=0&&u<e.length){let c=I(e[u],i,r+1,n);c!==void 0&&(s[u]=c,l=!0)}return l?s:void 0}break;case"filter":if(Array.isArray(e)){let a=o.value,s=[],l=!1;for(let u=0;u<e.length;u++)if(a(e[u])){let c=I(e[u],i,r+1,n);c!==void 0&&(s[u]=c,l=!0)}return l?s:void 0}break}},Tt=(e,t={})=>{let{type:r="auto",throwOnError:n=!1}=t;if(!e||typeof e!="string")return[];let o=[],i="",a=!1,s=!1,l="",u="",c=0,f=r==="auto"?(y=>y.includes("..")?"descendant":y.includes("[?(")?"filter":y.includes("[:")||y.includes("[0:")?"slice":y.includes("[,")||y.includes("[0,1]")?"union":y.includes("[*]")||y.includes(".*.")?"wildcard":y.includes("[]")?"array-wildcard":y.includes("[")&&y.includes("]")?"bracket":"dot")(e):r,p=y=>{let d=y.trim();if(d==="*"||d==="")return{type:"wildcard",value:d===""?"[]":"*",raw:d===""?"[]":y};if(d==="[]")return{type:"wildcard",value:"[]",raw:y};if(/^-?\d+$/.test(d))return{type:"index",value:parseInt(d,10),raw:y};if(d.includes(":")){let h=d.split(":").map(E=>E.trim()),b=h[0]===""?0:parseInt(h[0],10),T=h[1]===""?1/0:parseInt(h[1],10);if(isNaN(b)||isNaN(T)){if(n)throw new Error(`Invalid slice notation: ${y}`);return{type:"wildcard",value:"*",raw:y}}return{type:"slice",value:[b,T],raw:y}}if(d.includes(",")){let h=d.split(",").map(b=>{let T=parseInt(b.trim(),10);return isNaN(T)?-1:T}).filter(b=>b>=0);if(h.length===0){if(n)throw new Error(`Invalid union notation: ${y}`);return{type:"wildcard",value:"*",raw:y}}return{type:"union",value:h,raw:y}}if(d.startsWith("?(")&&d.endsWith(")")){let h=d.slice(2,-1);try{return{type:"filter",value:vi(h),raw:y}}catch(b){if(n)throw b;return{type:"wildcard",value:"*",raw:y}}}return d.startsWith('"')&&d.endsWith('"')||d.startsWith("'")&&d.endsWith("'")?{type:"property",value:d.slice(1,-1),raw:y}:{type:"property",value:d,raw:y}};for(let y=0;y<e.length;y++){let d=e[y],h=e[y+1];if((d==='"'||d==="'")&&!s){s=!0,l=d;continue}else if(d===l&&s){s=!1,l="",d==='"'||d==="'"||(a?u+=d:i+=d);continue}if(s){a?u+=d:i+=d;continue}if(d==="["&&!a){i&&(o.push({type:"property",value:i,raw:i}),i=""),a=!0,u="";continue}if(d==="]"&&a&&!s){a=!1;let T=p(u);o.push(T);continue}let b=o.length>0?o[o.length-1]:null;if(d==="."&&!a&&!s){if(h==="."){let T=e.split("..")[0];o.push({type:"property",value:T,raw:T}),o.push({type:"descendant",value:"..",raw:".."}),y++}else i&&(i==="*"?o.push({type:"wildcard",value:i,raw:i}):o.push({type:"property",value:i,raw:i}),i="");continue}if(a)u+=d;else if(b&&b.type!=="descendant")i+=d;else{let T=e.split(b?.raw)[1];T!==void 0?i=T:i+=d}}return i&&o.push({type:"property",value:i,raw:i}),o.map(y=>{if(y.type==="property"&&typeof y.value=="string"&&/^-?\d+$/.test(y.value)){let d=parseInt(y.value,10);if(!isNaN(d))return{...y,type:"index",value:d}}return y})},vi=e=>{let t=e.replace(/@\.([a-zA-Z_$][\w$]*)/g,(r,n)=>`item.${n}`).replace(/@/g,"item");try{return new Function("item",`return ${t}`)}catch{throw new Error(`Invalid filter expression: ${e}`)}},bi=(e,t,r)=>{let n=Tt(t),o=e;for(let i=0;i<n.length;i++){let a=n[i],s=i===n.length-1;switch(a.type){case"property":if(s)o[String(a.value)]=r;else{if(!o[String(a.value)]){let u=n[i+1];o[String(a.value)]=u.type==="index"||u.type==="slice"||u.type==="union"||u.type==="wildcard"?[]:{}}o=o[String(a.value)]}break;case"index":Array.isArray(o)||(o=[]);let l=a.value;if(s){if(l>=o.length)for(let u=o.length;u<=l;u++)o.push(void 0);o[l]=r}else{if(!o[l]){let u=n[i+1];o[l]=u.type==="index"||u.type==="slice"||u.type==="union"||u.type==="wildcard"?[]:{}}o=o[l]}break;case"wildcard":if(Array.isArray(o))if(s)for(let u=0;u<o.length;u++)o[u]=r;else{let u=n[i+1];for(let c=0;c<o.length;c++)o[c]||(o[c]=u.type==="index"||u.type==="slice"||u.type==="union"||u.type==="wildcard"?[]:{});o.length>0&&(o=o[0])}break}}}});function Ii(e){return e.localName.includes("-")}function mn(e,t,r,n=!1){if(r==null){e.removeAttribute(t);return}if(Ii(e)){e[t]=r;return}C(e,t,r,n)}function Sn(e,...t){e.classList.add(...t)}function Tn(e,...t){e.classList.remove(...t)}function kn(e,...t){t.forEach(r=>e.classList.toggle(r))}function C(e,t,r,n=!1){if(r==null||r===!1){e.removeAttribute(t);return}if(r===!0){e.setAttribute(t,"");return}if(typeof r=="object"){e.setAttribute(t,JSON.stringify(r));return}e.setAttribute(t,String(r))}function Cn(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Je(e){return e instanceof Node}function On(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Xe(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Pn(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function qi(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function Hi(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function Fi(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function Wi(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function zi(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Vi(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function U(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Ui(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function En(e){return qi(e)?{type:"router",value:e}:Fi(e)?{type:"route",value:e}:Hi(e)?{type:"routes",value:e}:Wi(e)?{type:"outlet",value:e}:U(e)?{type:"component",value:e}:Ui(e)?{type:"suspense",value:e}:zi(e)?{type:"provider",value:e}:Vi(e)?{type:"context",value:e}:{type:"none",value:e}}function $n(){if(!vn)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return vn}function Ht(e){return e!=null&&e[Ge]===!0?!0:typeof Node<"u"&&e instanceof Node}function Bi(e){return e!=null&&e[Ge]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Ki(e){return e!=null&&e[Ge]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}function Ji(e){_n=e}function jn(){return _n}function bn(e,t){return v.active&&t.parentNode===e}function Rn(e){let t=v.parents.lastIndexOf(e);t!==-1&&(v.parents.length=t),v.cursor=e.nextSibling}function Nn(e){if(!v.active)return e();let t=v.cursor,r=v.parents;v.active=!1,v.parents=[];try{return e()}finally{v.active=!0,v.cursor=t,v.parents=r}}function Mn(e){if(!v.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Rn(t)}function Z(e){if(!qt)for(let t of e)Ve.has(t)||Ft.has(t)||(Ve.add(t),document.addEventListener(t,Gi))}function Gi(e){let t=`$$${e.type}`,r=e.composedPath&&e.composedPath()[0]||e.target;for(;r;){let n=r[t];if(n&&!r.disabled&&(n(e),e.cancelBubble))return;r=r.host&&r.host!==r&&r.host instanceof Element?r.host:r.parentNode}}function Yi(e,t,r){if(e[`$$${t}`]=r,Ft.has(t)){let n=`__fx_${t}`;if(!e[n]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[n]=o}return}Ve.has(t)||Z([t])}function wn(e,t){delete e[`$$${t}`];let r=`__fx_${t}`,n=e[r];n&&(e.removeEventListener(t,n),delete e[r])}function J(e,t=!1){if(qt)return $n().createText(e);if(v.active&&!t){let r=jn()?.hydrateText(e);if(r)return r}return document.createTextNode(e)}function se(e,t=!1){if(qt)return $n().createElement(e,t);if(v.active){let r=jn()?.hydrateElement(e);if(r)return r}return t?document.createElementNS(xn,e):document.createElement(e)}function Qi(e,t,r,n,o){let i=n,a=new Map;return R(()=>{let s;if(U(e)&&!O(e)){if(!a.has(e)){V++;try{let l=e();a.set(e,l)}finally{V--}}for(s=a.get(e);typeof s=="function"&&O(s);)s=s()}else for(s=e();typeof s=="function"&&O(s);)s=s();{let l=0;for(;typeof s=="function"&&l++<50;)if(U(s)){if(!a.has(s)){let u=s;V++;try{let c=u();a.set(u,c)}finally{V--}}s=a.get(s)}else if(O(s))s=s();else if(s=s(),typeof s!="function"||!O(s)&&!U(s))break}V++;try{i=Ue(t,s,r,i,a),o(i)}finally{V--}})}function _(e,t,r,n){if(V>Zi)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;r!==void 0&&!r&&(r=J("",!0),e.appendChild(r));let o=n??null;if(typeof t!="function"){V++;try{o=Ue(e,t,r,null)}finally{V--}return()=>o}let i=Qi(t,e,r,o,a=>{o=a});return()=>(i?.(),o)}function Ue(e,t,r,n,o){if(t==null||typeof t=="boolean")return Y(e,n,r);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return Y(e,n,r);if(ze(t)){let a=J("",!0);return Array.isArray(n)?n.length>0?(e.replaceChild(a,n[0]),Y(e,n.slice(1),r)):L(e,a,r):n?e.replaceChild(a,n):L(e,a,r),t.then(s=>{a.parentNode===e&&Ue(e,s,a.nextSibling,a)}).catch(s=>{console.error("Error resolving promise in insertExpression:",s)}),a}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(n)){if(n.length===0){let s=J(t);return L(e,s,r),s}if(n.length===1&&n[0].nodeType===3)return n[0].data=t,n;n=Y(e,n,r)}if(n&&Ki(n))return n.data=t,n;let a=J(t);return n&&n.parentNode===e?e.replaceChild(a,n):bn(e,a)||L(e,a,r),a}if(Ht(t))return bn(e,t)?(Rn(t),t):Array.isArray(n)?(n.length===0?L(e,t,r):n[0].parentNode===e?(e.replaceChild(t,n[0]),Y(e,n.slice(1),r)):L(e,t,r),t):(n?n!==t&&(n.parentNode===e?e.replaceChild(t,n):L(e,t,r)):L(e,t,r),t);if(Array.isArray(t)){let a=[],s=Array.isArray(n)?n:n?[n]:[],l=[];z(t,a,e,r,!0,o,l);let u=es(e,s,a,r);for(let c of l){let f=_(e,c.sig,c.marker);A(()=>{Y(e,f()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return u}if(i==="object"&&t!==null&&typeof t=="object"){let a=t;if("type"in a&&"props"in a){let s=a;if(typeof s.type=="function"){let l=s.type(s.props||{});return Ue(e,l,r,n)}}}return Y(e,n,r)}function z(e,t,r,n,o=!0,i,a){for(let s=0;s<e.length;s++){let l=e[s];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!ze(l)&&!O(l)&&!U(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let u;for(U(l)&&!O(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),u=i.get(l)):u=l();typeof u=="function"&&!ze(u)&&!O(u)&&!U(u);)i||(i=new Map),i.has(u)||i.set(u,u()),u=i.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if(O(u)){if(a){let f=J("",!0);t.push(f),a.push({marker:f,sig:u});continue}let c=u();for(;typeof c=="function"&&O(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?z(c,t,r,n,o,i):z([c],t,r,n,o,i);continue}continue}Array.isArray(u)?z(u,t,r,n,o,i,a):z([u],t,r,n,o,i,a);continue}if(ze(l)){let u=J("",!0);t.push(u),l.then(c=>{if(u.parentNode){let f=[];if(z([c],f,u.parentNode,void 0,!1,i),f.length>0){u.parentNode.replaceChild(f[0],u);for(let p=1;p<f.length;p++)u.parentNode?.insertBefore(f[p],f[p-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(l)){z(l,t,r,n,o,i,a);continue}if(Ht(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let u=l;if(typeof u.type=="function"){let c=u.type(u.props||{});Array.isArray(c)?z(c,t,r,n,!1,i):z([c],t,r,n,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let u=String(l);if(u.trim()===""&&u!==" ")continue;t.push(J(u));continue}t.push(J(String(l)))}}}}function es(e,t,r,n){for(let f=0;f<r.length;f++)r[f].parentNode!==null&&r[f].parentNode!==e&&(r=r.slice(),r[f]=r[f].cloneNode(!0));let o=r.length,i=t.length,a=o,s=0,l=0,u=i>0?t[i-1].nextSibling??void 0:n,c=null;for(;s<i||l<a;){if(t[s]===r[l]){s++,l++;continue}for(;i>s&&a>l&&t[i-1]===r[a-1];)i--,a--;if(i===s){let f=a<o?l?r[l-1].nextSibling??void 0:r[a-l]:u;for(;l<a;)L(e,r[l++],f)}else if(a===l)for(;s<i;)(!c||!c.has(t[s]))&&t[s].parentNode===e&&e.removeChild(t[s]),s++;else if(t[s]===r[a-1]&&r[l]===t[i-1]){let f=t[--i].nextSibling;L(e,r[l++],t[s++].nextSibling),L(e,r[--a],f),t[i]=t[s-1]}else{if(!c){c=new Map;let p=l;for(;p<a;)c.set(r[p],p++)}let f=c.get(t[s]);if(f!=null)if(l<f&&f<a){let p=s,y=1;for(;++p<i&&p<a&&!(!c.has(t[p])||c.get(t[p])!==f+y);)y++;if(y>f-l){let d=t[s];for(;l<f;)L(e,r[l++],d)}else t[s].parentNode===e?e.replaceChild(r[l++],t[s++]):(L(e,r[l++],u),s++)}else s++;else t[s].parentNode===e&&e.removeChild(t[s]),s++}}return r}function Y(e,t,r){if(t)if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n].parentNode===e&&e.removeChild(t[n]);else t.parentNode===e&&e.removeChild(t);return null}function L(e,t,r){v.active&&t.parentNode===e||(r&&r.parentNode===e?e.insertBefore(t,r):e.appendChild(t))}function ge(e,t,r){r==null?delete e[t]:e[t]=r}function Ln(e,t,r){let n=r,o;return Array.isArray(r)&&(n=r[0],o=r[1]),typeof n!="function"?()=>{}:(e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o))}function Dn(e,t){let r=(n,o)=>{typeof n=="function"&&n(e,o??(()=>{}))};if(typeof t=="function"){r(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){r(t[0],t[1]);return}for(let n of t)Array.isArray(n)?r(n[0],n[1]):r(n)}}function Nt(e,t,r,n=!1){return typeof r!="function"?(C(e,t,r,n),()=>{}):R(()=>{let o=typeof r=="function"?r():r;C(e,t,o,n)})}function Mt(e,t,r){return typeof r!="function"?(ge(e,t,r),()=>{}):R(()=>{let n=typeof r=="function"?r():r;ge(e,t,n)})}function In(e,t,r){return typeof r!="function"?(C(e,t,!!r),()=>{}):R(()=>{let n=r();C(e,t,!!n)})}function Be(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){S(()=>{Be(e,t())});return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let r=Object.keys(t).filter(n=>{let o=t[n];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",r);return}e.setAttribute("class",String(t))}function Ke(e,t,r){if(!(!t||typeof t!="object"))for(let n in t){let o=t[n],i=n.split(/\s+/).filter(Boolean);if(typeof o=="function"&&r)r.push(R(()=>{let a=!!o();for(let s of i)e.classList.toggle(s,a)}));else{let a=!!(typeof o=="function"?o():o);for(let s of i)e.classList.toggle(s,a)}}}function Lt(e,t){let r=t;for(;typeof r=="function";)r=r();if(r==null){e.removeAttribute("style");return}if(typeof r=="string"){e.style.cssText=r;return}if(typeof r=="object")for(let n in r){let o=r[n];o==null?e.style[n]="":e.style[n]=o}}function qn(e){let{element:t,props:r,prevProps:n=Xi,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!Bi(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!r)return console.warn("[spread] Warning: props is undefined!"),()=>{};let a=o||t.namespaceURI===xn,s=[];for(let l in r){if(i&&l==="children")continue;let u=r[l],c=n[l];if(u!==c){if(l==="ref"){Wt(u,t);continue}if(l==="use"){Dn(t,u);continue}if(l.startsWith("on:")){s.push(Ln(t,l.slice(3),u));continue}if(l.startsWith("prop:")){s.push(Mt(t,l.slice(5),u));continue}if(l.startsWith("attr:")){s.push(Nt(t,l.slice(5),u,a));continue}if(l.startsWith("bool:")){s.push(In(t,l.slice(5),u));continue}if(l==="class"||l==="className"){typeof u=="function"?s.push(R(()=>Be(t,u()))):Be(t,u);continue}if(l==="classList"){typeof u=="function"?s.push(R(()=>Ke(t,u()))):Ke(t,u,s);continue}if(l==="style"){typeof u=="function"?s.push(R(()=>Lt(t,u()))):Lt(t,u);continue}if(l.startsWith("on")){let f=l.slice(2).toLowerCase();c&&wn(t,f),u&&Yi(t,f,u);continue}gn.has(l)||!a&&l in t?s.push(Mt(t,l,u)):s.push(Nt(t,l,u,a))}}for(let l in n)if(!(l in r))if(l.startsWith("on")){let u=l.slice(2).toLowerCase();wn(t,u)}else gn.has(l)?ge(t,l,null):t.removeAttribute(l);return()=>{s.forEach(l=>l())}}function Hn(e,t,r=!1){for(let n in t){let o=t[n];if(n==="ref"){Wt(o,e);continue}if(n!=="children"){if(n==="use"){Dn(e,o);continue}if(n.startsWith("on:")){Ln(e,n.slice(3),o);continue}if(n.startsWith("prop:")){Mt(e,n.slice(5),o);continue}if(n.startsWith("attr:")){Nt(e,n.slice(5),o,r);continue}if(n.startsWith("bool:")){In(e,n.slice(5),o);continue}if(n.startsWith("on")&&n.length>2){let i=n.slice(2).toLowerCase();if(typeof o=="function")if(Ft.has(i)){e[`$$${i}`]=o;let a=`__fx_${i}`;if(!e[a]){let s=l=>{e[`$$${i}`]?.(l)};e.addEventListener(i,s),e[a]=s}}else e[`$$${i}`]=o,Ve.has(i)||Z([i]);continue}if(n==="class"||n==="className"){Be(e,o);continue}if(n==="classList"){typeof o=="function"?R(()=>Ke(e,o())):Ke(e,o);continue}if(n==="style"){Lt(e,o);continue}if(n==="innerHTML"){if(typeof o=="function"){let i=S(()=>{let a=o();for(;typeof a=="function";)a=a();e.innerHTML=a});A(()=>i())}else e.innerHTML=o;continue}if(n==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=S(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();document.activeElement!==e&&(e.value=a??"")});A(()=>{i()})}else e.value=o??"";continue}if(n==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=S(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();document.activeElement!==e&&(e.checked=a??"")});A(()=>{i()})}else e.checked=o??"";continue}if(n==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,a=S(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""});A(()=>{a()})}else queueMicrotask(()=>{e.value=o??""});continue}if(typeof o=="function"){let i=S(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();mn(e,n,a,r)});A(()=>{i()})}else mn(e,n,o,r)}}}function Wt(e,t){if(e){if(Ht(e)){let r=t,n=e;if(!r)return;typeof r=="function"?r(n):typeof r=="object"&&"current"in r&&(r.current=n);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function Fn(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function ze(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function zt(e,t,r){if(!t)throw new Error("Container element is required");let n,o,i=[];return M(a=>{$(()=>{v.active||(t.textContent=""),_(t,e)}),o=a}),()=>{o?.(),n?.(),i.forEach(a=>a()),t.textContent=""}}function Wn(e){Dt.fn=e}function Q(e,t){return Dt.fn?Dt.fn(e,t):(()=>e(t))}function Vt(){let e=globalThis.__FX_DATA__;if(e)return e;if(Rt!==void 0)return Rt;let t=null;if(typeof document<"u"){let r=document.getElementById(rs)?.textContent;if(r)try{t=JSON.parse(r)}catch{t=null}}return Rt=t}function Ut(){for(;;){for(;v.cursor&&v.cursor.nodeType===3&&v.cursor.data==="";)v.cursor=v.cursor.nextSibling;if(v.cursor!=null||!v.parents.length)return;v.cursor=v.parents.pop().nextSibling}}function Kt(e,t){let r=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${r}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function os(e){Ut();let t=v.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(ns.has(e.toLowerCase())?v.cursor=t.nextSibling:(v.parents.push(t),v.cursor=t.firstChild),t):(Bt&&t&&Kt(`<${e}>`,t),null)}function is(e){if(e===""){let r=v.cursor;return r&&r.nodeType===3&&r.data!==""?(v.cursor=r.nextSibling,r.data="",r):null}Ut();let t=v.cursor;return t&&t.nodeType===3?(v.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Bt&&t&&Kt(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function ss(e){Ut();let t=v.cursor;return t&&t.nodeType===8&&t.data===e?(v.cursor=t.nextSibling,t):(Bt&&t&&Kt(`marker <!--${e.slice(0,24)}-->`,t),null)}function as(){An||(An=!0,Ji({hydrateElement:os,hydrateText:is,hydrateMarker:ss}))}function Ye(e,t,r){as(),v.active=!0,v.cursor=t.firstChild,v.parents=[];let n=Vt(),o=r?.resourceNamespace,i=0;Vr(()=>o?`${o}:r${i++}`:`r${i++}`),zr(n?a=>a in n?{value:n[a]}:void 0:null);try{return zt(e,t)}finally{v.active=!1,v.cursor=null,v.parents=[]}}function ls(e){return typeof e=="function"?e:(()=>e)}function Ze(e){return()=>{let t=e();return typeof t=="function"?t():t}}function us(e){return e!=null&&e!==!1}function cs(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function zn(e){let t=Ze(()=>e.when),r=g(t,void 0),n=g(r,void 0);return g(()=>{if(n()){let o=e.children;return typeof o=="function"&&!cs(o)?typeof r=="function"?k(()=>k(r)?o(r()):e.fallback):o(r):o}return e.fallback},void 0,{name:"show"})}function Vn(e){let t=Ze(()=>e.each),r=()=>e.fallback??null,n=(o,i)=>{let a=e.children,s=Array.isArray(a)?a.map(l=>typeof l=="function"?l(o,i):l):typeof a=="function"?a(o,i):a;return Mn(s),s};return e.by?Fr(t,e.by,(o,i)=>n(o,i),{fallback:r}):Hr(t,(o,i)=>n(o,i),{fallback:r})}function Un(e){let t=Ze(()=>e.each);return Wr(t,(r,n)=>{let o=e.children(r,n);return Mn(o),o},{fallback:()=>e.fallback??null})}function Bn(e){return{[It]:!0,when:Ze(()=>e.when),children:e.children}}function Kn(e){let t=Array.isArray(e.children)?e.children:[e.children];return g(()=>{for(let r of t){let n=r,o=0;for(;typeof n=="function"&&!n[It]&&o++<10;)n=n();if(!n||typeof n!="object"||n[It]!==!0)continue;let i=n.when();if(us(i))return typeof n.children=="function"?n.children(i):n.children}return e.fallback??null})}function Jn(e){let t=ls(e.component),{component:r,...n}=e;return g(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:n}:o(n)})}function Xn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,r,n;return M(o=>{r=o,n=document.createElement("div"),n.style.display="contents",t().appendChild(n),_(n,e.children)&&Wt(e.ref,n)}),A(()=>{r(),n.remove()}),null}function Gn(e){let[t,r]=w(null),n=()=>r(null);return g(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,n):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(i){return r(i),typeof e.fallback=="function"?e.fallback(i,n):e.fallback}})}function Yn(e){return g(()=>{let t=typeof e=="function"?e():e,r=[];for(let[n,o]of Object.entries(t))n&&(typeof o=="function"?o():o)&&r.push(n);return r.join(" ")})}function fs(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Zn(e){return g(()=>{let t=typeof e=="function"?e():e,r=[];for(let[n,o]of Object.entries(t)){if(!n)continue;let i=typeof o=="function"?o():o;i!=null&&r.push(`${fs(n)}: ${i}`)}return r.join("; ")})}var xn,gn,Aa,qt,Ge,vn,v,_n,Xi,Ve,Ft,V,Zi,ts,Dt,rs,Rt,ns,Bt,An,It,ps,D=j(()=>{"use strict";x();x();x();x();x();x();x();x();x();x();x();x();xn="http://www.w3.org/2000/svg";gn=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);Aa=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;qt=typeof document>"u",Ge=Symbol.for("fluixi.server-node"),vn=null;v={active:!1,cursor:null,parents:[]},_n=null;Xi={},Ve=new Set,Ft=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);V=0,Zi=200;ts="__fx_dom_create_component__",Dt=globalThis[ts]??={fn:null};rs="__FX_DATA__";ns=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Bt=typeof process<"u"&&process.env&&!1;An=!1;It=Symbol("match");ps=Ge});function Xt(){return ds}function Qn(){let e=F();if(!e)return null;if(!e[Jt]){let t={mounts:[],effects:[],scheduled:!1};e[Jt]=t}return e[Jt]}function eo(e){if(e.scheduled)return;e.scheduled=!0;let t=F();queueMicrotask(()=>{W(t,()=>{for(let r of e.mounts)try{let n=r();typeof n=="function"&&A(n)}catch(n){console.error("Error in onMount callback:",n)}for(let r of e.effects){let n;S(()=>{n&&n(),n=r()}),A(()=>{n&&n()})}e.mounts=[],e.effects=[]})})}function X(e){Wn(be)}function be(e,t){return Qe(e,t)}function Qe(e,t){let r=typeof e=="function"?k(()=>e(t)):e;if(r!=null&&(typeof r=="function"||typeof r=="object")&&!O(r)){try{r.$name=e.name}catch{}return Xe(r)}return r}function et(e,t=!0){let r=Qn();if(r){if(!t){r.scheduled||e();return}r.mounts.push(e),eo(r)}else{if(!t){e();return}S(()=>{let n=k(e);typeof n=="function"&&A(n)})}}function tt(e){A(e)}function we(e){let t=Qn();if(t)t.effects.push(e),eo(t);else{let r;S(()=>{r&&r(),r=e()}),A(()=>{r&&r()})}}function rt(e){return g(e)}function nt(e){let t={current:e};return A(()=>{t.current=null}),t}function ot(e,t){let[r,n]=w(t);return[r,i=>{n(e(r(),i))}]}function it(e,t,r,n){we(()=>{let o=e&&"current"in e?e.current:e;if(o)return o.addEventListener(t,r,n),()=>{o.removeEventListener(t,r,n)}})}function st(e){return e}function Gt(){return ve}function Yt(e){ve&&e()}var ds,ve,Jt,ae=j(()=>{"use strict";D();x();ds={context:null,owner:null};ve=typeof process<"u"&&!1,Jt=Symbol.for("fluixi-lifecycle")});function xe(e,t){let r,n,o;function i(){return n||(n=e().then(s=>r=s.default)),n}t?.preload&&i();let a=(s=>{if(r){let l=r;return k(()=>l(s))}if(!o){let[l]=K(()=>i());if(o=l,l.error)throw l.error}return g(()=>{let l=o();return l?k(()=>l(s)):void 0},void 0,{name:"lazy"})});return a.preload=()=>i().then(()=>{}),a.$lazy=!0,a.loader=e,a}var Zt=j(()=>{"use strict";x()});function gs(){so||(so=!0,!(typeof process<"u")&&console.warn("[fluixi] createProvider({ context, value, children }) reads `children` eagerly: the object literal materialises `children` BEFORE the context is stamped, so a routed <Outlet/> that has siblings inside the provider renders detached and its descendants see no context under SSR. Use the lazy form instead:\n createProvider(Context, value, props) // children stays a getter\n // or JSX: <Context.Provider value={…}>{props.children}</Context.Provider>"))}function at(e,t,r){let n=!!e?.Provider,o=n?e:e.context,i=n?t:e.value,a=n?!1:e.debug??!1;n||gs();let s=typeof i=="function"?i():i,l=n?r:e;return o.Provider({value:s,get children(){return l?.children},debug:a})}function ao(e){let t=ue(e);return[t,n=>at(t,n.value,n)]}function er(e,t){if(e.length===0)return he(()=>t);let[r,n]=e[0],o=e.slice(1);return at(r,n,{get children(){return er(o,t)}})}function lo(e){return t=>{let r=ce(e);return t.children(r)}}function uo(e,t){let r=ce(e);return r===e.defaultValue?t():r}function ue(e){let t=q(e),r=n=>(n.debug,t.Provider({value:n.value,get children(){return n.children},debug:n.debug}));return typeof Symbol<"u"&&Symbol.for&&(r.$$typeof=Symbol.for("react.provider")),r.$$typeof=Symbol.for("react.provider"),{id:t.id,Provider:On(r),defaultValue:e}}function ce(e){let t=H(e);return t!==void 0?t:e.defaultValue}var so,tr=j(()=>{"use strict";D();x();x();ae();X("index");so=!1});function vo(){return go}function or(e){go=e}function bo(e,t){lt.set(e,t)}function wo(e){return lt.get(e)}function ks(){lt.clear()}function Ao(){if(typeof window>"u")return!1;let e=document.getElementById("__FLUIXI_HYDRATION__");if(!e||e.getAttribute("type")!=="application/json")return!1;try{let t=e.textContent||"{}",r=JSON.parse(t);for(let[n,o]of Object.entries(r))lt.set(n,o);return!0}catch(t){return console.error("Failed to deserialize hydration data:",t),!1}}function ir(){if(typeof window>"u")return;let e=document.getElementById("__FLUIXI_HYDRATION__");e&&e.remove();let t=document.createTreeWalker(document.body,NodeFilter.SHOW_COMMENT,null),r=[],n;for(;n=t.nextNode();){let o=n,i=o.nodeValue||"";(i.startsWith("#")||i.startsWith("/"))&&r.push(o)}r.forEach(o=>o.remove()),ks()}function xo(){return typeof window>"u"}var go,lt,sr=j(()=>{"use strict";go=!1,lt=new Map;typeof window<"u"&&window.addEventListener("load",()=>{setTimeout(ir,100)})});function qs(e,t,r){let n=new Uint8Array(t.length);e:for(let o=0;o<e.length;o++){for(let i=0;i<t.length;i++)if(!n[i]&&te(e[o],t[i],r)){n[i]=1;continue e}return!1}return!0}var te,To=j(()=>{"use strict";kt();te=(e,t,r={})=>{if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t)return!1;let n=Array.isArray(e),o=Array.isArray(t);if(n!==o)return!1;if(n&&o)return e.length!==t.length?!1:r.unordered?qs(e,t,r):e.every((h,b)=>te(h,t[b],r));if(typeof e!="object")return e===t;let i=e instanceof Date,a=t instanceof Date;if(i!==a)return!1;if(i)return e.getTime()===t.getTime();let s=e instanceof RegExp,l=t instanceof RegExp;if(s!==l)return!1;if(s)return e.toString()===t.toString();let u=e instanceof Map,c=t instanceof Map;if(u!==c)return!1;if(u){if(e.size!==t.size)return!1;for(let[h,b]of e)if(!t.has(h)||!te(b,t.get(h),r))return!1;return!0}let f=e instanceof Set,p=t instanceof Set;if(f!==p)return!1;if(f){if(e.size!==t.size)return!1;let h=[...t],b=new Uint8Array(h.length);e:for(let T of e){for(let E=0;E<h.length;E++)if(!b[E]&&te(T,h[E],r)){b[E]=1;continue e}return!1}return!0}if(!De(e)||!De(t))return!1;let y=Object.keys(e),d=Object.keys(t);if(y.length!==d.length)return!1;for(let h of y)if(!Object.prototype.hasOwnProperty.call(t,h)||!te(e[h],t[h],r))return!1;return!0}});function Hs(e){return e.startsWith("//")?e.replace(/^\/+/,"/"):e}function fe(e,t,r=!1){let n=[];if(e===t)return{params:{},path:t};if(!r&&e==="/"&&t.startsWith("/"))return{params:{},path:"/"};let o=e.replace(/:([a-zA-Z0-9_]+)/g,(l,u)=>(n.push(u),"([^/]+)")).replace(/\*([a-zA-Z0-9_]*)/g,(l,u)=>(u&&n.push(u),"(.*)"));o.startsWith("/")||(o="/"+o),o===""&&(o="/");let i=new RegExp(`^${o}${r?"$":"(?=/|$)"}`),a=t.match(i);if(!a)return null;let s={};return n.forEach((l,u)=>{s[l]=a[u+1]}),{params:s,path:a[0]}}function fr(e){let t=e.path.split("/").filter(Boolean);if(t.length===0)return 5;let r=0;for(let n of t)n.startsWith("*")?r+=1:n.startsWith(":")?r+=10:r+=100;return r}function ko(e){return[...e].sort((t,r)=>fr(r)-fr(t))}function re(e,t){let r=t.length>1?t.replace(/\/+$/,"")||"/":t,n=Co(e,r);if(!n)return null;let o=[],i="",a={};for(let s of n.layers){i=Hs(Fs(i,s.consumed));let l={};for(let[u,c]of Object.entries(s.params))u in a||(l[u]=c),a[u]=c;o.push({route:s.route,component:s.route.component,params:l,pathname:i||"/"})}return{matched:o,params:a,pathname:t}}function Co(e,t){if(!e||e.length===0)return null;let r=ko(e);for(let n of r){let o=!!n.children&&n.children.length>0,i=fe(n.path,t,!o);if(i){if(o){let a=Co(n.children,t);if(a)return{layers:[{route:n,params:i.params,consumed:i.path},...a.layers]};continue}return{layers:[{route:n,params:i.params,consumed:i.path}]}}}return null}function Fs(e,t){if(!e)return t;if(t===e)return e;if(t.startsWith(e))return t;let r=e.replace(/\/$/,""),n=t.replace(/^\//,"");return`${r}/${n}`}var pr=j(()=>{"use strict"});function dr(e){let t=e,r="",n=t.indexOf("#");n!==-1&&(r=t.slice(n),t=t.slice(0,n));let o="",i=t.indexOf("?");return i!==-1&&(o=t.slice(i),t=t.slice(0,i)),{pathname:t||"/",search:o,hash:r}}function ke(e="/"){let t=[{path:e,state:null}],r=0,n=new Set,o=()=>n.forEach(i=>i());return{get(){let{path:i,state:a}=t[r];return{...dr(i),state:a}},push(i,a=null){t=t.slice(0,r+1),t.push({path:i,state:a}),r=t.length-1,o()},replace(i,a=null){t[r]={path:i,state:a},o()},subscribe(i){return n.add(i),()=>n.delete(i)}}}function ne(){let e=typeof window<"u"?window:void 0,t=new Set,r=()=>t.forEach(n=>n());return e&&e.addEventListener("popstate",r),{get(){if(!e)return{pathname:"/",search:"",hash:"",state:null};let{pathname:n,search:o,hash:i}=e.location;return{pathname:n,search:o,hash:i,state:e.history.state??null}},push(n,o=null){e?.history.pushState(o,"",n),r()},replace(n,o=null){e?.history.replaceState(o,"",n),r()},subscribe(n){return t.add(n),()=>t.delete(n)}}}var yr=j(()=>{"use strict"});function Ws(e){let t={};return e&&new URLSearchParams(e.startsWith("?")?e.slice(1):e).forEach((n,o)=>t[o]=n),t}function zs(e,t){if(!t)return e||"/";let r=t.replace(/\/$/,"");return e===r?"/":e.startsWith(r+"/")?e.slice(r.length)||"/":e||"/"}function Vs(e,t){return!t||/^https?:\/\//.test(e)?e:`${t.replace(/\/$/,"")}${e.startsWith("/")?e:"/"+e}`}function hr(e){let{routes:t,history:r,base:n}=e,o=new Set,i=()=>{let c=r.get();return{pathname:c.pathname,search:c.search,hash:c.hash,state:c.state,query:Ws(c.search)}},a=c=>re(t,zs(c,n)),s=(()=>{let c=i();return{location:c,match:a(c.pathname)}})(),l=()=>{let c=i();s={location:c,match:a(c.pathname)},o.forEach(f=>f(s))},u=r.subscribe(l);return{state(){return s},subscribe(c){return o.add(c),()=>o.delete(c)},navigate(c,f={}){let p=Vs(c,n);f.replace?r.replace(p,f.state??null):r.push(p,f.state??null)},match(c){return a(c)},destroy(){u(),o.clear()}}}var Oo=j(()=>{"use strict";pr();yr()});var mr=j(()=>{"use strict";pr();yr();Oo()});function Po(e,t){return async(...r)=>{let n=t+":"+JSON.stringify(r);if(vo()||typeof window<"u"){let i=wo(n);if(i!==void 0)return i}if(Oe.has(n))return Oe.get(n);if(Ce.has(n))return Ce.get(n);let o=Promise.resolve(e(...r)).then(i=>(Oe.set(n,i),Ce.delete(n),xo()&&bo(n,i),i),i=>{throw Ce.delete(n),i});return Ce.set(n,o),o}}function Eo(e){let t=typeof e=="string"?r=>r.startsWith(e):e;for(let r of Oe.keys())t(r)&&(Oe.delete(r),Bs.add(r));Us(r=>r+1)}function $o(e,t){let[r]=K(t||(()=>!0),e);return r}function _o(e){return gr.has(e)||gr.set(e,w(void 0)),gr.get(e)}function vr(e,t){let r=t||e.name||"action",n=async o=>{let[,i]=_o(r),a=()=>i(void 0),s=()=>n(o);i({input:o,pending:!0,clear:a,retry:s});try{let l=await e(o);return i({input:o,result:l,pending:!1,clear:a,retry:s}),l}catch(l){throw i({input:o,error:l,pending:!1,clear:a,retry:s}),l}};return n.url=r,n.with=o=>vr((...i)=>e(o,...i),t),n}function jo(e){let[t]=_o(e.url);return t}function Ro(e){return e}var Oe,Ce,Ju,Us,Bs,gr,Ks,Xu,No=j(()=>{"use strict";x();sr();tr();Oe=new Map,Ce=new Map;[Ju,Us]=w(0),Bs=new Set;gr=new Map;Ks=ue(),Xu=Ks.Provider});var qo={};Er(qo,{A:()=>kr,Form:()=>ra,Link:()=>dt,Outlet:()=>wr,Redirect:()=>Ar,Router:()=>br,action:()=>vr,cache:()=>Po,createAsync:()=>$o,createBrowserHistory:()=>ne,createMemoryHistory:()=>ke,lazy:()=>xe,matchPath:()=>fe,matchRoutes:()=>re,preloadRoutes:()=>na,revalidate:()=>Eo,runWithOwner:()=>W,select:()=>ea,useAction:()=>Ro,useLevelParams:()=>Zs,useLocation:()=>Ee,useMatch:()=>Sr,useNavigate:()=>pt,useParam:()=>xr,useParamSelector:()=>Qs,useParams:()=>Pe,useRouteData:()=>ta,useRouter:()=>pe,useSearchParams:()=>Tr,useSubmission:()=>jo});function Js(e,t,r){let n,o=e.route.data;if(typeof o=="function"){let c=!1;A(()=>{c=!0});let f=F(),[p]=K(()=>o({params:r.params,location:r.location},f,()=>c));n=p}let i=()=>Do.Provider({value:n,get children(){return Lo.Provider({value:e.params,get children(){return Mo.Provider({value:{depth:t,...r},get children(){return Q(e.component,{})}})}})}});if(!n)return i();let a=n,s=()=>a.loading,[l,u]=w(k(()=>!s()));return S(()=>u(!s())),g(()=>l()?i():null)}function Io(e){let t=e.depth+1,[r,n]=w(k(()=>e.matched()[t]?.component));return S(()=>{let o=e.matched()[t]?.component;n(()=>o)}),g(()=>{if(!r())return e.notFound?e.notFound():null;let i=k(()=>e.matched())[t];return Js(i,t,{matched:e.matched,params:e.params,location:e.location})})}function Xs(e){return e==null?Gs():typeof e=="function"?Q(e,{}):e}function Gs(){let e=se("div");C(e,"class","fx-not-found"),C(e,"role","main"),C(e,"style","min-height:60vh;display:grid;place-content:center;gap:.25rem;text-align:center;font-family:system-ui,-apple-system,sans-serif");let t=se("h1");C(t,"style","margin:0;font-size:2.5rem;font-weight:700"),_(t,"404");let r=se("p");return C(r,"style","margin:0;opacity:.7"),_(r,"This page could not be found."),e.appendChild(t),e.appendChild(r),e}function br(e){let t=e.history??ne(),r=hr({routes:e.routes,base:e.base,history:t}),[n,o]=w(r.state()),i=r.subscribe(o);A(()=>{i(),r.destroy()});let a=g(()=>(n().match?.matched??[]).filter(c=>c.component)),s={router:r,location:g(()=>n().location),params:g(()=>n().match?.params??{})},l={depth:-1,matched:a,params:s.params,location:s.location,notFound:()=>Xs(e.notFound)},u;return ft.Provider({value:s,get children(){return u??=Io(l)}})}function wr(){let e=H(Mo);return e?Io(e):null}function Ar(e){let t=H(ft);if(!t||typeof window>"u")return null;let r=!1;return A(()=>r=!0),queueMicrotask(()=>{r||t.router.navigate(e.to,{replace:e.replace!==!1})}),null}function pe(){let e=H(ft);if(e)return e;if(typeof window>"u")return Ys;throw new Error("[router-next] useRouter must be used within <Router>")}function Pe(){let e=pe().params;return g(()=>e(),{},{equals:(t,r)=>JSON.stringify(t)===JSON.stringify(r)})}function Zs(){return H(Lo)??{}}function xr(e){let t=Pe();return g(()=>t()[e])}function Qs(e,t){let r=Pe();return g(()=>e(r()),void 0,t?{equals:t}:void 0)}function Sr(e){let t=Ee();return g(()=>fe(typeof e=="function"?e():e,t.pathname))}function Tr(){let e=Ee(),t=pt();return[g(()=>e.query),(o,i)=>{let a=new URLSearchParams(e.search);for(let[l,u]of Object.entries(o))u===null?a.delete(l):a.set(l,u);let s=a.toString();t(e.pathname+(s?`?${s}`:""),i)}]}function ea(e,t){let r=(n,o)=>te(n,o);return t!==void 0?g(()=>Le(e(),t),void 0,{equals:r}):g(e,void 0,{equals:r})}function Ee(){let{location:e}=pe();return new Proxy({},{get:(t,r)=>e()[r],has:(t,r)=>r in e(),ownKeys:()=>Reflect.ownKeys(e()),getOwnPropertyDescriptor:(t,r)=>Object.getOwnPropertyDescriptor(e(),r)})}function pt(){let{router:e}=pe();return(t,r)=>e.navigate(t,r)}function ta(){return H(Do)??(()=>{})}function dt(e){let t=H(ft),r=typeof document>"u",n=()=>t?.router.navigate(B(e.href)??"",{replace:B(e.replace)}),o=se("a");if(C(o,"href",B(e.href)??""),e.slot&&C(o,"slot",B(e.slot)),typeof o.addEventListener=="function")o.addEventListener("click",a=>{a.metaKey||a.ctrlKey||a.shiftKey||a.altKey||(a.preventDefault(),n())});else{let a=B(e.className??e.class)??"";a&&C(o,"class",a)}typeof o.addEventListener=="function"&&S(()=>{let a=B(e.href)??"";o.setAttribute("href",a);let s=B(e.className??e.class)??"",l=B(e.activeClass)??"",u=B(e.active)??t?.location().pathname===a;o.className=[s,u?l:""].filter(Boolean).join(" ")});let i=e.children;return i!=null&&_(o,i),o}function ra(e){let t=e.action,r=e.className??e.class,n=t.url??"",o=se("form");C(o,"method","post"),n&&C(o,"action",n),r&&C(o,"class",r);for(let[a,s]of Object.entries(e))a==="action"||a==="children"||a==="class"||a==="className"||s!=null&&typeof s!="function"&&C(o,a,String(s));typeof o.addEventListener=="function"&&o.addEventListener("submit",a=>{a.preventDefault();let s={};new FormData(o).forEach((l,u)=>{s[u]=l}),Promise.resolve(t(s)).catch(()=>{})});let i=e.children;return i!=null&&_(o,i),o}async function na(e,t){let r=re(e,t);if(!r)return;let n=[];for(let o of r.matched){let i=o.component;i&&typeof i.preload=="function"&&n.push(i.preload())}await Promise.all(n)}var ft,Mo,Lo,Do,Ys,B,kr,Cr=j(()=>{"use strict";x();D();x();kt();To();mr();mr();No();Zt();x();ft=q(),Mo=q(),Lo=q(),Do=q();Ys={router:{navigate:()=>{}},location:()=>({pathname:"",search:"",hash:"",query:{}}),params:()=>({})};B=e=>typeof e=="function"?e():e;kr=dt});var ia={};Er(ia,{$component:()=>Qe,A:()=>kr,DEV:()=>ve,Dynamic:()=>Jn,ErrorBoundary:()=>Gn,FRAMEWORK_NAME:()=>mo,For:()=>Vn,Fragment:()=>rr,Index:()=>Un,Link:()=>dt,Match:()=>Bn,Outlet:()=>wr,Portal:()=>Xn,Redirect:()=>Ar,Router:()=>br,Show:()=>zn,Store:()=>We,Suspense:()=>Ae,Switch:()=>Kn,VERSION:()=>ho,addClass:()=>Sn,batch:()=>$,classMap:()=>Yn,cleanupDelegation:()=>io,composeProviders:()=>er,createBrowserHistory:()=>ne,createComponent:()=>be,createComputed:()=>qr,createConsumer:()=>lo,createContext:()=>ue,createContextWithProvider:()=>ao,createDebounce:()=>Kr,createDeferred:()=>Br,createEffect:()=>S,createIsomorphicState:()=>co,createMemo:()=>g,createMemoryHistory:()=>ke,createProvider:()=>at,createRenderEffect:()=>R,createResource:()=>K,createRoot:()=>M,createSelector:()=>Ur,createSignal:()=>w,createStore:()=>_t,delegateEvents:()=>Z,devOnly:()=>Yt,getFrameworkInfo:()=>Ts,getOwner:()=>F,getSharedConfig:()=>Xt,hydrate:()=>Ye,initDelegation:()=>oo,insert:()=>_,isDOMNode:()=>Je,isDev:()=>Gt,isLitTemplateResult:()=>Cn,isRenderable:()=>no,jsx:()=>nr,jsxs:()=>yo,lazy:()=>xe,mount:()=>Ho,onCleanup:()=>A,onMount:()=>et,onUnmount:()=>tt,portal:()=>ro,read:()=>tn,reduce:()=>en,removeClass:()=>Tn,render:()=>le,runWithOwner:()=>W,setAttribute:()=>C,setOwner:()=>Dr,setProperty:()=>ge,spread:()=>qn,startClient:()=>Fo,styleMap:()=>Zn,toggleClass:()=>kn,untrack:()=>k,untrackStore:()=>jt,useCallback:()=>st,useContext:()=>ce,useEffect:()=>we,useEventListener:()=>it,useLocation:()=>Ee,useMatch:()=>Sr,useMemo:()=>rt,useNavigate:()=>pt,useParam:()=>xr,useParams:()=>Pe,useProvide:()=>uo,useReducer:()=>ot,useRef:()=>nt,useRouter:()=>pe,useSearchParams:()=>Tr});x();x();var Ai="__fluixi_signal_next_state__",xi=e=>{typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e)},P=globalThis[Ai]??={consumer:null,untracked:!1,owner:null,queue:[],scheduled:!1,flushing:!1,batchDepth:0,hostSchedule:xi,onSuspend:null,onError:null},Yr=0,Zr=1,Ie=2,Si=class{constructor(){this.observers=null,this.watchers=null,this.version=0}updateIfNecessary(){}track(){if(P.untracked)return;let e=P.consumer;e&&((this.observers??=new Set).add(e),(e.sources??=new Set).add(this))}};var Ti=class extends Si{constructor(e,t){super(),this._threw=!1,this._initialized=!1,this.state=Ie,this.sources=null,this._fn=e,this._equals=t?.equals===!1?()=>!1:t?.equals??Object.is}get(){if(P.consumer===this)throw new Error("Signal.Computed cannot read itself");if(this.track(),this.updateIfNecessary(),this._threw)throw this._error;return this._value}updateIfNecessary(){if(this.state===Zr&&this.sources){for(let e of this.sources)if(e.updateIfNecessary(),this.state===Ie)break}(this.state===Ie||!this._initialized)&&this.recompute(),this.state=Yr}recompute(){if(this.sources){for(let a of this.sources)a.observers?.delete(this);this.sources.clear()}let e=P.consumer,t=P.untracked;P.consumer=this,P.untracked=!1;let r,n=!1,o;try{r=this._fn()}catch(a){n=!0,o=a,r=this._value}finally{P.consumer=e,P.untracked=t}let i=!this._initialized||this._threw!==n||(n?o!==this._error:!this._equals(this._value,r));if(this._initialized=!0,this._threw=n,this._error=o,this._value=r,i){if(this.version++,this.observers)for(let a of[...this.observers])a.markDirty(Ie);Qr(this)}}markDirty(e){if(this.state>=e)return;let t=this.state===Yr;if(this.state=e,t){if(this.observers)for(let r of[...this.observers])r.markDirty(Zr);Qr(this)}}peek(){if(this.updateIfNecessary(),this._threw)throw this._error;return this._value}};function Qr(e){if(e.watchers)for(let t of[...e.watchers])t._notify(e)}function ki(e){return P.onSuspend?(P.onSuspend(e,P.owner),!0):!1}function Ci(){return P.owner}function Oi(e,t){let r=P.owner;P.owner=e;try{return t()}finally{P.owner=r}}function Pi(e){P.hostSchedule=e??(t=>{Promise.resolve().then(t)})}function Ei(e){return!!e&&typeof e.then=="function"}Pi(()=>{});var $i=Symbol.for("signal"),_i=Symbol.for("memo");function ji(e,t,r){let n=t,o=Ci(),i=new Ti(()=>Oi(o,()=>{try{return n=e(n)}catch(s){if(Ei(s))return ki(s),n;throw s}}),{equals:r?.equals}),a=(()=>i.get());return Object.defineProperty(a,$i,{value:!0,enumerable:!0}),Object.defineProperty(a,_i,{value:!0,enumerable:!0}),a}function en(e,t,r,n){return ji(()=>e().reduce(t,r),void 0,n)}function tn(e){let t=e;for(;typeof t=="function";)t=t();return t}x();var Ot=Symbol("store-raw"),rn=Symbol("store-node"),nn=Symbol("store-has"),on=Symbol("store-self"),sn=Symbol("store-track");var an=new WeakMap,ln=new WeakMap;function dn(e){let[t,r]=w(e),n=t;return n.$=r,n}function He(e){let t=an.get(e);return t||an.set(e,t={keys:new Map}),t}function un(e,t,r){let n=e.keys.get(t);return n||e.keys.set(t,n=dn(r)),n}function cn(e){let t=He(e);(t.all||(t.all=dn()))()}function fn(e,t){e.$(typeof t=="function"?()=>t:t)}function yn(e){if(e==null||typeof e!="object")return!1;if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function qe(e){if(!yn(e))return e;let t=ln.get(e);if(t)return t;let r=new Proxy(e,Ri);return ln.set(e,r),r}var Ri={get(e,t,r){if(t===Ot||t===rn)return e;if(t===St)return r;if(t===nn)return a=>a in e;if(t==="__proxy")return!0;if(t===sn||t===on)return cn(e),r;let n=e[t];if(typeof n=="function"&&!Object.prototype.hasOwnProperty.call(e,t))return n;let o=Object.getOwnPropertyDescriptor(e,t);if(o&&o.get)return o.get.call(r);let i=un(He(e),t,n)();return yn(i)?qe(i):i},set(){return!0},deleteProperty(e,t){return t in e&&me(e,t,void 0),!0},has(e,t){return t===Ot||t===St||t===rn||t===nn||t===on||t===sn?!0:(un(He(e),t,e[t])(),t in e)},ownKeys(e){return cn(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e,t)}};function me(e,t,r){if(e[t]===r&&(r!==void 0||t in e))return;let n=Array.isArray(e),o=n?e.length:0;r===void 0?delete e[t]:e[t]=r;let i=He(e),a=i.keys.get(t);if(a&&fn(a,r),n&&e.length!==o){let s=i.keys.get("length");s&&fn(s,e.length)}i.all&&i.all.$(void 0)}function pn(e,t){return typeof e=="function"?e(t):e}function Pt(e,t){for(let r of Object.keys(t)){let n=t[r],o=e[r];n&&typeof n=="object"&&!Array.isArray(n)&&o&&typeof o=="object"&&!Array.isArray(o)?Pt(o,n):me(e,r,n)}}function $t(e){let t=[],r=e.replace(/\[([^\]]*)\]/g,".$1");for(let n of r.split("."))n.length&&t.push(n);return t}function hn(e,t,r){let n=t.length-1;for(let i=0;i<n;i++){let a=t[i];if(a==="*"){let l=t.slice(i+1);if(Array.isArray(e))for(let u=0;u<e.length;u++)hn(e[u],l,r);return}let s=e[a];(s==null||typeof s!="object")&&(s=/^\d+$/.test(t[i+1])?[]:{},me(e,a,s)),e=s}let o=t[n];if(o==="*"){if(Array.isArray(e))for(let i=0;i<e.length;i++)me(e,i,pn(r,e[i]));return}me(e,o,pn(r,e[o]))}function Ct(e,t,r){hn(e,$t(t),r)}function Ni(e,t){let r=t[0];if(typeof r=="function"&&t.length===1){let n=r(e);n&&n!==e&&Pt(e,n);return}if(Array.isArray(r)&&t.length===1){for(let n of r)Array.isArray(n)&&Ct(e,n[0],n[1]);return}if(r&&typeof r=="object"&&!Array.isArray(r)&&t.length===1){Pt(e,r);return}if(Array.isArray(t[1])&&t.length>=3){Ct(e,`${r}.${t[1].join(".")}`,t[2]);return}Ct(e,String(r),t[1])}function Et(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(Et);let t={};for(let r of Object.keys(e))t[r]=Et(e[r]);return t}function ie(e,t){let r=e;for(let n of $t(t)){if(r==null)return;r=r[n]}return r}var We=class{constructor(e,t={immutable:!0}){this.options=t,this.root=e,this.set=((...r)=>$(()=>Ni(this.root,r)))}get state(){return qe(this.root)}get proxy(){return qe(this.root)}get accessor(){return(()=>qe(this.root))}unwrap(){return this.root}getNode(e){return this.root&&this.root[e]}get(e){if(e==null||e==="")return Fe(this.state);let t=this.state;for(let r of $t(e)){if(t==null)return;t=t[r]}return Fe(t)}select(e){return g(()=>e(this.state))}subscribe(e){return S(()=>e(this.state))}watch(e,t){let r;return S(()=>{let n=e(this.state);Object.is(n,r)||(t(n,r),r=n)})}reactive(e){return g(()=>this.state[e])}produce(e){this.set((t=>{let r=Et(t);return e(r),r}))}reconcile(e,t={}){this.set(e)}push(e,...t){let r=ie(this.root,e);this.set(e,r.concat(t))}pop(e){let t=ie(this.root,e).slice(),r=t.pop();return this.set(e,t),r}shift(e){let t=ie(this.root,e).slice(),r=t.shift();return this.set(e,t),r}splice(e,t,r,...n){let o=ie(this.root,e).slice(),i=o.splice(t,r,...n);return this.set(e,o),i}insert(e,t,r){let n=ie(this.root,e).slice();n.splice(t,0,r),this.set(e,n)}removeAt(e,t){let r=ie(this.root,e).slice(),n=r.splice(t,1);return this.set(e,r),n}toObservable(){let[e]=w(this.state);return e.toObservable()}dispose(){}},Mi=["get","select","watch","subscribe","produce","reconcile","push","pop","shift","splice","insert","removeAt","unwrap","toObservable"];function Li(e,t){for(let r of Mi)e[r]=t[r].bind(t);e.$=t.reactive.bind(t)}function _t(e,t={immutable:!0}){let r=new We(e,t);return Li(r.set,r),[r.proxy,r.set]}function Di(e,t={}){return new We(e,{...t,immutable:!1})}function Fe(e){if(e==null||typeof e!="object")return e;let t=e[Ot];return t!==void 0?t:e}function jt(e){return k(()=>Fe(e))}var va=Object.freeze({createStore:_t,createMutableStore:Di,batch:$,unwrap:Fe,untrackStore:jt});x();D();ae();ae();x();D();function to(e){return!!(e&&typeof e=="object"&&typeof e.then=="function"||e instanceof Promise)}var ys=q();function Ae(e){return Q(hs,e)}function hs(e){let t=Xr(),r=H(ys),n=r?r.register(t.inFallback):void 0;function o(c){return c==null||typeof c=="boolean"?null:typeof c=="function"&&U(c)&&!O(c)?c():c}let i=Nn(()=>o(e.fallback??null)),a=xt(t,()=>e.children);xt(t,()=>{R(()=>{let c=a;if(Array.isArray(c))for(let f of c)typeof f=="function"&&O(f)&&f();else typeof c=="function"&&O(c)&&c()})});let[s,l]=w(void 0),u=to(a);return u&&(t.increment(),a.then(c=>{l(()=>c),t.decrement()},()=>t.decrement())),g(()=>(n?n.showFallback():t.inFallback())?i:u?s():a)}Pn(Ae);Object.defineProperty(Ae,"__suspense",{value:!0,enumerable:!0});Zt();var Qt=typeof window>"u";function le(e,t,r={}){if(X("render"),Z(["click","input","change","submit"]),Qt)throw new Error("render() is for client-side only. Use renderToString() on server.");if(!t)throw new Error("Container element is required");let n;return M(o=>{n=o;let i=typeof e=="function"?e():e;t.textContent="",t.setAttribute("fluixi-js","v1"),_(t,()=>i)}),()=>{n&&(n(),n=void 0)}}function ms(e){return e&&typeof e=="object"&&(e._$litType$!==void 0||e._$litDirective$!==void 0)}function ro(e,t,r={}){let n=document.createElement("div");n.setAttribute("data-portal","true"),t.appendChild(n);let o=le(e,n,r);return()=>{o(),t.contains(n)&&t.removeChild(n)}}function no(e){return!!(e==null||typeof e=="function"||Je(e)||ms(e)||Array.isArray(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean")}function oo(){Qt||Z(["click","input","change","submit"])}function io(){}tr();x();D();var vs="__fluixi_iso_states__",bs="__iso:";function ws(){return globalThis[vs]??=new Map}function As(e){if(typeof window>"u")return;let t=Vt();return t?t[bs+e]:void 0}function co(e,t){let r=As(e),n=r!==void 0?r:typeof window<"u"&&t.client?t.client():t.fallback,[o,i]=w(n);return ws().set(e,{server:t.server,set:i}),{value:o,set:i,key:e}}D();D();D();D();D();x();var rr=Symbol.for("fluixi.fragment"),fo=typeof window>"u";function po(e){return e==null||e===!1?null:Array.isArray(e)?e.map(po).flat():e}function nr(e,t,r){if(e==null)return null;let n=t||{};if(r!==void 0&&(n.key=r),e===rr)return g(()=>Xe(po(n.children)));if(typeof e=="function"){let{type:o}=En(e);return e.$$typeof===Symbol.for("react.provider")||o==="provider"?e(n):fo?{type:e,props:n}:g(()=>Q(e,n),void 0,{name:"jsx component"})}return typeof e=="string"&&e.trim().length>0?xs(e,n):null}var yo=nr;function xs(e,t){if(fo)return{type:e,props:t||{}};let r=Fn(e),n=r?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return Ss(n,t,r),n}function Ss(e,t,r){if(Hn(e,t,r),t&&t.children!==void 0){let n=he(()=>t.children);Array.isArray(n)?n.forEach(o=>{_(e,o,typeof o=="function"?null:void 0)}):_(e,n,typeof n=="function"?null:void 0)}}ae();var ho="0.0.1",mo="Fluixi";function Ts(){return{name:mo,version:ho,features:{ssr:!0,hydration:!0,jsx:!0,litHtml:!0,signals:!0,fineGrained:!0,lazy:!0,hooks:!0,devMode:!0}}}X("index");D();sr();ae();x();function ee(e){return typeof e=="function"?e():e}function Cs(e){if(typeof e=="string")return e;let t=[];return t.push(e.index===!1?"noindex":"index"),t.push(e.follow===!1?"nofollow":"follow"),e.noarchive&&t.push("noarchive"),e.nosnippet&&t.push("nosnippet"),e.noimageindex&&t.push("noimageindex"),e.maxSnippet!=null&&t.push(`max-snippet:${e.maxSnippet}`),e.maxImagePreview&&t.push(`max-image-preview:${e.maxImagePreview}`),e.maxVideoPreview!=null&&t.push(`max-video-preview:${e.maxVideoPreview}`),t.join(", ")}function ar(){let e=[],[t,r]=w(0);return{sources:e,version:t,push(n){return e.push(n),r(o=>o+1),()=>{let o=e.indexOf(n);o!==-1&&(e.splice(o,1),r(i=>i+1))}}}}var Os=null;function lr(e){Os=e}function ut(e){let t=5381;for(let r=0;r<e.length;r++)t=t*33^e.charCodeAt(r);return(t>>>0).toString(36)}function Ps(e){return e.charset!=null?"meta:charset":e.property?"meta:property:"+e.property:e.name?"meta:name:"+e.name:e["http-equiv"]?"meta:http-equiv:"+e["http-equiv"]:"meta:"+ut(JSON.stringify(e))}function Es(e,t){let r=typeof t=="string"?{url:t}:t;e.push({tag:"meta",key:"meta:property:og:image:"+r.url,attrs:{property:"og:image",content:r.url}}),r.secureUrl&&e.push({tag:"meta",key:"meta:property:og:image:secure:"+r.url,attrs:{property:"og:image:secure_url",content:r.secureUrl}}),r.type&&e.push({tag:"meta",key:"meta:property:og:image:type:"+r.url,attrs:{property:"og:image:type",content:r.type}}),r.width!=null&&e.push({tag:"meta",key:"meta:property:og:image:width:"+r.url,attrs:{property:"og:image:width",content:String(r.width)}}),r.height!=null&&e.push({tag:"meta",key:"meta:property:og:image:height:"+r.url,attrs:{property:"og:image:height",content:String(r.height)}}),r.alt&&e.push({tag:"meta",key:"meta:property:og:image:alt:"+r.url,attrs:{property:"og:image:alt",content:r.alt}})}function $s(e,t){let r=(n,o)=>{o!=null&&t.push({tag:"meta",key:"meta:property:og:"+n,attrs:{property:"og:"+n,content:o}})};r("title",e.title),r("description",e.description),r("type",e.type),r("url",e.url),r("site_name",e.siteName),r("locale",e.locale);for(let n of e.localeAlternate??[])t.push({tag:"meta",key:"meta:property:og:locale:alt:"+n,attrs:{property:"og:locale:alternate",content:n}});if(e.image!=null){let n=Array.isArray(e.image)?e.image:[e.image];for(let o of n)Es(t,o)}if(e.video){let n=typeof e.video=="string"?{url:e.video}:e.video;r("video",n.url),"type"in n&&n.type&&r("video:type",n.type),"width"in n&&n.width!=null&&r("video:width",String(n.width)),"height"in n&&n.height!=null&&r("video:height",String(n.height))}if(e.audio){let n=typeof e.audio=="string"?{url:e.audio}:e.audio;r("audio",n.url),"type"in n&&n.type&&r("audio:type",n.type)}if(e.article){let n=e.article;r("article:published_time",n.publishedTime),r("article:modified_time",n.modifiedTime),r("article:expiration_time",n.expirationTime),r("article:section",n.section);for(let o of[].concat(n.author??[]))t.push({tag:"meta",key:"meta:property:og:article:author:"+o,attrs:{property:"article:author",content:o}});for(let o of[].concat(n.tag??[]))t.push({tag:"meta",key:"meta:property:og:article:tag:"+o,attrs:{property:"article:tag",content:o}})}if(e.book){let n=e.book;r("book:isbn",n.isbn),r("book:release_date",n.releaseDate);for(let o of[].concat(n.author??[]))t.push({tag:"meta",key:"meta:property:og:book:author:"+o,attrs:{property:"book:author",content:o}});for(let o of[].concat(n.tag??[]))t.push({tag:"meta",key:"meta:property:og:book:tag:"+o,attrs:{property:"book:tag",content:o}})}if(e.profile){let n=e.profile;r("profile:first_name",n.firstName),r("profile:last_name",n.lastName),r("profile:username",n.username),r("profile:gender",n.gender)}}function _s(e,t){let r=(n,o)=>{o!=null&&t.push({tag:"meta",key:"meta:name:twitter:"+n,attrs:{name:"twitter:"+n,content:o}})};r("card",e.card),r("site",e.site),r("creator",e.creator),r("title",e.title),r("description",e.description),r("image",e.image),r("image:alt",e.imageAlt),r("player",e.player),e.playerWidth!=null&&r("player:width",String(e.playerWidth)),e.playerHeight!=null&&r("player:height",String(e.playerHeight)),e.app&&(r("app:name:iphone",e.app.name),r("app:id:iphone",e.app.idIphone),r("app:id:ipad",e.app.idIpad),r("app:id:googleplay",e.app.idGooglePlay))}function js(e,t){let r=(n,o)=>t.push({tag:"link",key:n,attrs:o});if(e.icon!=null){let n=typeof e.icon=="string"?[{url:e.icon}]:e.icon;for(let o of n)r("link:icon:"+o.url,{rel:"icon",href:o.url,...o.type?{type:o.type}:{},...o.sizes?{sizes:o.sizes}:{}})}if(e.apple!=null){let n=typeof e.apple=="string"?[{url:e.apple}]:e.apple;for(let o of n)r("link:apple-touch-icon:"+o.url,{rel:"apple-touch-icon",href:o.url,...o.sizes?{sizes:o.sizes}:{}})}e.mask&&r("link:mask-icon",{rel:"mask-icon",href:e.mask.url,...e.mask.color?{color:e.mask.color}:{}}),e.shortcut&&r("link:shortcut",{rel:"shortcut icon",href:e.shortcut}),e.msTileImage&&t.push({tag:"meta",key:"meta:name:msapplication-TileImage",attrs:{name:"msapplication-TileImage",content:e.msTileImage}}),e.msTileColor&&t.push({tag:"meta",key:"meta:name:msapplication-TileColor",attrs:{name:"msapplication-TileColor",content:e.msTileColor}})}function Rs(e,t,r){let n=(f,p)=>t.push({tag:"meta",key:f,attrs:p}),o=ee(e.title);o!==void 0&&(r.title=o),e.titleTemplate!==void 0&&(r.template=e.titleTemplate);let i=ee(e.lang);i!==void 0&&t.push({tag:"htmlAttr",key:"html:lang",name:"lang",value:i}),e.charset!==void 0&&n("meta:charset",{charset:e.charset}),e.viewport!==void 0&&n("meta:name:viewport",{name:"viewport",content:e.viewport});let a=ee(e.description);a!==void 0&&n("meta:name:description",{name:"description",content:a});let s=ee(e.keywords);s!==void 0&&n("meta:name:keywords",{name:"keywords",content:Array.isArray(s)?s.join(", "):s}),e.author!==void 0&&n("meta:name:author",{name:"author",content:e.author}),e.robots!==void 0&&n("meta:name:robots",{name:"robots",content:Cs(e.robots)}),e.generator!==void 0&&n("meta:name:generator",{name:"generator",content:e.generator}),e.applicationName!==void 0&&n("meta:name:application-name",{name:"application-name",content:e.applicationName}),e.referrer!==void 0&&n("meta:name:referrer",{name:"referrer",content:e.referrer}),e.colorScheme!==void 0&&n("meta:name:color-scheme",{name:"color-scheme",content:e.colorScheme});let l=ee(e.themeColor);l!==void 0&&n("meta:name:theme-color",{name:"theme-color",content:l});let u=ee(e.canonical);if(u!==void 0&&t.push({tag:"link",key:"link:rel:canonical",attrs:{rel:"canonical",href:u}}),e.manifest!==void 0&&t.push({tag:"link",key:"link:rel:manifest",attrs:{rel:"manifest",href:e.manifest}}),e.base!==void 0&&t.push({tag:"base",key:"base",attrs:{href:e.base}}),e.verification){let f={google:"google-site-verification",bing:"msvalidate.01",yandex:"yandex-verification",pinterest:"p:domain_verify"};for(let[p,y]of Object.entries(e.verification)){if(y==null)continue;let d=f[p]??p;n("meta:name:"+d,{name:d,content:y})}}for(let f of e.alternates??[])t.push({tag:"link",key:"link:alternate:hreflang:"+f.hreflang,attrs:{rel:"alternate",hreflang:f.hreflang,href:f.href}});for(let f of e.feeds??[])t.push({tag:"link",key:"link:alternate:feed:"+f.href,attrs:{rel:"alternate",type:f.type??"application/rss+xml",href:f.href,...f.title?{title:f.title}:{}}});e.og&&$s(e.og,t),e.twitter&&_s(e.twitter,t),e.icons&&js(e.icons,t);let c=ee(e.jsonLd);if(c!==void 0){let f=Array.isArray(c)?c:[c];for(let p of f){let y=JSON.stringify(p);t.push({tag:"script",key:"script:ldjson:"+ut(y),attrs:{type:"application/ld+json"},children:y})}}for(let f of e.meta??[]){let p={};for(let[y,d]of Object.entries(f))d!=null&&(p[y==="httpEquiv"?"http-equiv":y]=d);t.push({tag:"meta",key:Ps(p),attrs:p})}for(let f of e.link??[]){let p={};for(let[y,d]of Object.entries(f))d!=null&&(p[y]=d);t.push({tag:"link",key:"link:"+(p.rel??"")+":"+(p.href??ut(JSON.stringify(p))),attrs:p})}for(let f of e.script??[]){let p={},y;for(let[d,h]of Object.entries(f))h!=null&&(d==="children"?y=h:p[d]=h);t.push({tag:"script",key:"script:"+(p.src??ut((y??"")+JSON.stringify(p))),attrs:p,children:y})}}function Ns(e,t){return typeof e=="function"?e(t):e.includes("%s")?e.replace("%s",t):e}function ct(e){let t=[],r={};for(let i of e.sources){let a=typeof i=="function"?i():i;Rs(a,t,r)}r.title!==void 0&&t.push({tag:"title",key:"title",children:r.template?Ns(r.template,r.title):r.title});let n=new Map,o={};for(let i of t){if(i.tag==="htmlAttr"){o[i.name]=i.value;continue}n.set(i.key,i)}return{tags:[...n.values()],htmlAttrs:o}}var Se="data-fh",Te="data-fh-key";function ur(e){for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType===8&&t.data.startsWith("fh:")){t.parentNode?.removeChild(t);return}}x();function So(e,t){for(let r of Array.from(e.attributes))r.name===Se||r.name===Te||r.name in t||e.removeAttribute(r.name);for(let[r,n]of Object.entries(t))e.getAttribute(r)!==n&&e.setAttribute(r,n)}function Ms(e){let t=document.createElement(e.tag);return So(t,e.attrs),t.setAttribute(Se,""),t.setAttribute(Te,e.key),e.tag==="script"&&e.children!=null&&(t.textContent=e.children),t}function Ls(e,t){let r=document.head,n=new Map;for(let a of Array.from(r.querySelectorAll(`[${Se}]`))){let s=a.getAttribute(Te);a.tagName!=="TITLE"&&s&&n.set(s,a)}let o=null,i=new Set;for(let a of e){if(a.tag==="title"){o=a.children;continue}if(a.tag==="htmlAttr")continue;i.add(a.key);let s=n.get(a.key);s&&s.tagName===a.tag.toUpperCase()?(So(s,a.attrs),a.tag==="script"&&(s.textContent??"")!==(a.children??"")&&(s.textContent=a.children??"")):(s&&s.remove(),r.appendChild(Ms(a)))}for(let[a,s]of n)i.has(a)||s.remove();o!=null&&document.title!==o&&(document.title=o);for(let[a,s]of Object.entries(t))document.documentElement.getAttribute(a)!==s&&document.documentElement.setAttribute(a,s)}function cr(e){return M(t=>(S(()=>{e.version();let{tags:r,htmlAttrs:n}=ct(e);Ls(r,n)}),A(()=>{}),t))}X("client index");function Ho(e,t){if(!t)throw new Error("Container element not found for mount()");zt(()=>e(),t)}async function Fo(e,t={}){let r=typeof t.root=="string"?document.querySelector(t.root):t.root??document.querySelector("#app");if(!r)throw new Error(`[Fluixi] Mount container not found: ${t.root??"#app"}`);let n=!!document.getElementById("__FLUIXI_HYDRATION__")||!!t.routes&&r.firstElementChild!=null,o=t.hydrate??n,i=ar();if(lr(i),ur(r),o){if(t.routes&&t.routes.length){let{preloadRoutes:a}=await Promise.resolve().then(()=>(Cr(),qo));await a(t.routes,window.location.pathname)}Ao(),or(!0),Ye(()=>e(),r),oa(),setTimeout(()=>{or(!1),ir()},100)}else le(()=>e(),r);cr(i)}function oa(){if(typeof window>"u")return;let e=window;typeof e.__FX_REPLAY_STOP__=="function"&&e.__FX_REPLAY_STOP__();let t=e.__FX_REPLAY__;if(e.__FX_REPLAY__=void 0,e.__FX_REPLAY_STOP__=void 0,!(!Array.isArray(t)||t.length===0))for(let r of t){let n=r&&r.target;if(!n||n.isConnected===!1||typeof n.dispatchEvent!="function")continue;let o=r.type,i=o==="click"?new MouseEvent(o,{bubbles:!0,cancelable:!0}):new Event(o,{bubbles:!0,cancelable:!0});n.dispatchEvent(i)}}Cr();return Ko(ia);})();
@@ -1 +1 @@
1
- "use strict";var Pt=Object.create;var B=Object.defineProperty;var At=Object.getOwnPropertyDescriptor;var Et=Object.getOwnPropertyNames;var Ot=Object.getPrototypeOf,_t=Object.prototype.hasOwnProperty;var O=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ie=(e,t)=>{for(var n in t)B(e,n,{get:t[n],enumerable:!0})},J=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Et(t))!_t.call(e,o)&&o!==n&&B(e,o,{get:()=>t[o],enumerable:!(r=At(t,o))||r.enumerable});return e},He=(e,t,n)=>(J(e,t,"default"),n&&J(n,t,"default")),Lt=(e,t,n)=>(n=e!=null?Pt(Ot(e)):{},J(t||!e||!e.__esModule?B(n,"default",{value:e,enumerable:!0}):n,e)),kt=e=>J(B({},"__esModule",{value:!0}),e);function me(){return Mt}function Ne(){let e=(0,c.getOwner)();if(!e)return null;if(!e[ye]){let t={mounts:[],effects:[],scheduled:!1};e[ye]=t}return e[ye]}function je(e){if(e.scheduled)return;e.scheduled=!0;let t=(0,c.getOwner)();queueMicrotask(()=>{(0,c.runWithOwner)(t,()=>{for(let n of e.mounts)try{let r=n();typeof r=="function"&&(0,c.onCleanup)(r)}catch(r){console.error("Error in onMount callback:",r)}for(let n of e.effects){let r;(0,c.createEffect)(()=>{r&&r(),r=n()}),(0,c.onCleanup)(()=>{r&&r()})}e.mounts=[],e.effects=[]})})}function S(e){(0,Y.registerCreateComponent)(N)}function N(e,t){return q(e,t)}function q(e,t){let n=typeof e=="function"?(0,c.untrack)(()=>e(t)):e;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!(0,c.isSignal)(n)){try{n.$name=e.name}catch{}return(0,Y.asComponent)(n)}return n}function G(e,t=!0){let n=Ne();if(n){if(!t){n.scheduled||e();return}n.mounts.push(e),je(n)}else{if(!t){e();return}(0,c.createEffect)(()=>{let r=(0,c.untrack)(e);typeof r=="function"&&(0,c.onCleanup)(r)})}}function Q(e){(0,c.onCleanup)(e)}function j(e){let t=Ne();if(t)t.effects.push(e),je(t);else{let n;(0,c.createEffect)(()=>{n&&n(),n=e()}),(0,c.onCleanup)(()=>{n&&n()})}}function Z(e){return(0,c.createMemo)(e)}function ee(e){let t={current:e};return(0,c.onCleanup)(()=>{t.current=null}),t}function te(e,t){let[n,r]=(0,c.createSignal)(t);return[n,s=>{r(e(n(),s))}]}function ne(e,t,n,r){j(()=>{let o=e&&"current"in e?e.current:e;if(o)return o.addEventListener(t,n,r),()=>{o.removeEventListener(t,n,r)}})}function re(e){return e}function ge(){return H}function xe(e){H&&e()}var Y,c,Mt,H,ye,_=O(()=>{"use strict";Y=require("@fluixi/dom"),c=require("@fluixi/reactive/signal"),Mt={context:null,owner:null};H=typeof process<"u"&&!1,ye=Symbol.for("fluixi-lifecycle")});function V(e,t){let n,r,o;function s(){return r||(r=e().then(u=>n=u.default)),r}t?.preload&&s();let a=(u=>{if(n){let d=n;return(0,A.untrack)(()=>d(u))}if(!o){let[d]=(0,A.createResource)(()=>s());if(o=d,d.error)throw d.error}return(0,A.createMemo)(()=>{let d=o();return d?(0,A.untrack)(()=>d(u)):void 0},void 0,{name:"lazy"})});return a.preload=()=>s().then(()=>{}),a.$lazy=!0,a.loader=e,a}var A,he=O(()=>{"use strict";A=require("@fluixi/reactive/signal")});function Ht(){Xe||(Xe=!0,!(typeof process<"u")&&console.warn("[fluixi] createProvider({ context, value, children }) reads `children` eagerly: the object literal materialises `children` BEFORE the context is stamped, so a routed <Outlet/> that has siblings inside the provider renders detached and its descendants see no context under SSR. Use the lazy form instead:\n createProvider(Context, value, props) // children stays a getter\n // or JSX: <Context.Provider value={…}>{props.children}</Context.Provider>"))}function se(e,t,n){let r=!!e?.Provider,o=r?e:e.context,s=r?t:e.value,a=r?!1:e.debug??!1;r||Ht();let u=typeof s=="function"?s():s,d=r?n:e;return o.Provider({value:u,get children(){return d?.children},debug:a})}function Ye(e){let t=k(e);return[t,r=>se(t,r.value,r)]}function Te(e,t){if(e.length===0)return(0,Be.readChildren)(()=>t);let[n,r]=e[0],o=e.slice(1);return se(n,r,{get children(){return Te(o,t)}})}function qe(e){return t=>{let n=M(e);return t.children(n)}}function Ge(e,t){let n=M(e);return n===e.defaultValue?t():n}function k(e){let t=(0,oe.createContext)(e),n=r=>(r.debug,t.Provider({value:r.value,get children(){return r.children},debug:r.debug}));return typeof Symbol<"u"&&Symbol.for&&(n.$$typeof=Symbol.for("react.provider")),n.$$typeof=Symbol.for("react.provider"),{id:t.id,Provider:(0,Je.asProvider)(n),defaultValue:e}}function M(e){let t=(0,oe.useContext)(e);return t!==void 0?t:e.defaultValue}var Je,oe,Be,Xe,Ce=O(()=>{"use strict";Je=require("@fluixi/dom"),oe=require("@fluixi/reactive/signal"),Be=require("@fluixi/reactive/signal");_();S("index");Xe=!1});function rt(){return nt}function Se(e){nt=e}function ot(e,t){ue.set(e,t)}function st(e){return ue.get(e)}function $t(){ue.clear()}function at(){if(typeof window>"u")return!1;let e=document.getElementById("__FLUIXI_HYDRATION__");if(!e||e.getAttribute("type")!=="application/json")return!1;try{let t=e.textContent||"{}",n=JSON.parse(t);for(let[r,o]of Object.entries(n))ue.set(r,o);return!0}catch(t){return console.error("Failed to deserialize hydration data:",t),!1}}function Re(){if(typeof window>"u")return;let e=document.getElementById("__FLUIXI_HYDRATION__");e&&e.remove();let t=document.createTreeWalker(document.body,NodeFilter.SHOW_COMMENT,null),n=[],r;for(;r=t.nextNode();){let o=r,s=o.nodeValue||"";(s.startsWith("#")||s.startsWith("/"))&&n.push(o)}n.forEach(o=>o.remove()),$t()}function it(){return typeof window>"u"}var nt,ue,we=O(()=>{"use strict";nt=!1,ue=new Map;typeof window<"u"&&window.addEventListener("load",()=>{setTimeout(Re,100)})});function ct(e,t){return async(...n)=>{let r=t+":"+JSON.stringify(n);if(rt()||typeof window<"u"){let s=st(r);if(s!==void 0)return s}if($.has(r))return $.get(r);if(K.has(r))return K.get(r);let o=Promise.resolve(e(...n)).then(s=>($.set(r,s),K.delete(r),it()&&ot(r,s),s),s=>{throw K.delete(r),s});return K.set(r,o),o}}function ut(e){let t=typeof e=="string"?n=>n.startsWith(e):e;for(let n of $.keys())t(n)&&($.delete(n),Wt.add(n));zt(n=>n+1)}function dt(e,t){let[n]=(0,z.createResource)(t||(()=>!0),e);return n}function ft(e){return Pe.has(e)||Pe.set(e,(0,z.createSignal)(void 0)),Pe.get(e)}function Ae(e,t){let n=t||e.name||"action",r=async o=>{let[,s]=ft(n),a=()=>s(void 0),u=()=>r(o);s({input:o,pending:!0,clear:a,retry:u});try{let d=await e(o);return s({input:o,result:d,pending:!1,clear:a,retry:u}),d}catch(d){throw s({input:o,error:d,pending:!1,clear:a,retry:u}),d}};return r.url=n,r.with=o=>Ae((...s)=>e(o,...s),t),r}function lt(e){let[t]=ft(e.url);return t}function pt(e){return e}var z,$,K,Qn,zt,Wt,Pe,Xt,Zn,yt=O(()=>{"use strict";z=require("@fluixi/reactive/signal");we();Ce();$=new Map,K=new Map;[Qn,zt]=(0,z.createSignal)(0),Wt=new Set;Pe=new Map;Xt=k(),Zn=Xt.Provider});var Ct={};Ie(Ct,{A:()=>De,Form:()=>tn,Link:()=>le,Outlet:()=>Oe,Redirect:()=>_e,Router:()=>Ee,action:()=>Ae,cache:()=>ct,createAsync:()=>dt,createBrowserHistory:()=>v.createBrowserHistory,createMemoryHistory:()=>v.createMemoryHistory,lazy:()=>V,matchPath:()=>v.matchPath,matchRoutes:()=>v.matchRoutes,preloadRoutes:()=>nn,revalidate:()=>ut,runWithOwner:()=>bt.runWithOwner,select:()=>Zt,useAction:()=>pt,useLevelParams:()=>Gt,useLocation:()=>X,useMatch:()=>ke,useNavigate:()=>fe,useParam:()=>Le,useParamSelector:()=>Qt,useParams:()=>W,useRouteData:()=>en,useRouter:()=>F,useSearchParams:()=>Me,useSubmission:()=>lt});function Jt(e,t,n){let r,o=e.route.data;if(typeof o=="function"){let y=!1;(0,i.onCleanup)(()=>{y=!0});let I=(0,i.getOwner)(),[wt]=(0,i.createResource)(()=>o({params:n.params,location:n.location},I,()=>y));r=wt}let s=()=>vt.Provider({value:r,get children(){return ht.Provider({value:e.params,get children(){return xt.Provider({value:{depth:t,...n},get children(){return(0,l.createComponent)(e.component,{})}})}})}});if(!r)return s();let a=r,u=()=>a.loading,[d,x]=(0,i.createSignal)((0,i.untrack)(()=>!u()));return(0,i.createEffect)(()=>x(!u())),(0,i.createMemo)(()=>d()?s():null)}function Tt(e){let t=e.depth+1,[n,r]=(0,i.createSignal)((0,i.untrack)(()=>e.matched()[t]?.component));return(0,i.createEffect)(()=>{let o=e.matched()[t]?.component;r(()=>o)}),(0,i.createMemo)(()=>{if(!n())return e.notFound?e.notFound():null;let s=(0,i.untrack)(()=>e.matched())[t];return Jt(s,t,{matched:e.matched,params:e.params,location:e.location})})}function Bt(e){return e==null?Yt():typeof e=="function"?(0,l.createComponent)(e,{}):e}function Yt(){let e=(0,l.createNativeElement)("div");(0,l.setAttribute)(e,"class","fx-not-found"),(0,l.setAttribute)(e,"role","main"),(0,l.setAttribute)(e,"style","min-height:60vh;display:grid;place-content:center;gap:.25rem;text-align:center;font-family:system-ui,-apple-system,sans-serif");let t=(0,l.createNativeElement)("h1");(0,l.setAttribute)(t,"style","margin:0;font-size:2.5rem;font-weight:700"),(0,l.insert)(t,"404");let n=(0,l.createNativeElement)("p");return(0,l.setAttribute)(n,"style","margin:0;opacity:.7"),(0,l.insert)(n,"This page could not be found."),e.appendChild(t),e.appendChild(n),e}function Ee(e){let t=e.history??(0,w.createBrowserHistory)(),n=(0,w.createRouter)({routes:e.routes,base:e.base,history:t}),[r,o]=(0,i.createSignal)(n.state()),s=n.subscribe(o);(0,i.onCleanup)(()=>{s(),n.destroy()});let a=(0,i.createMemo)(()=>(r().match?.matched??[]).filter(y=>y.component)),u={router:n,location:(0,i.createMemo)(()=>r().location),params:(0,i.createMemo)(()=>r().match?.params??{})},d={depth:-1,matched:a,params:u.params,location:u.location,notFound:()=>Bt(e.notFound)},x;return de.Provider({value:u,get children(){return x??=Tt(d)}})}function Oe(){let e=(0,h.useContext)(xt);return e?Tt(e):null}function _e(e){let t=(0,h.useContext)(de);if(!t||typeof window>"u")return null;let n=!1;return(0,i.onCleanup)(()=>n=!0),queueMicrotask(()=>{n||t.router.navigate(e.to,{replace:e.replace!==!1})}),null}function F(){let e=(0,h.useContext)(de);if(e)return e;if(typeof window>"u")return qt;throw new Error("[router-next] useRouter must be used within <Router>")}function W(){let e=F().params;return(0,i.createMemo)(()=>e(),{},{equals:(t,n)=>JSON.stringify(t)===JSON.stringify(n)})}function Gt(){return(0,h.useContext)(ht)??{}}function Le(e){let t=W();return(0,i.createMemo)(()=>t()[e])}function Qt(e,t){let n=W();return(0,i.createMemo)(()=>e(n()),void 0,t?{equals:t}:void 0)}function ke(e){let t=X();return(0,i.createMemo)(()=>(0,w.matchPath)(typeof e=="function"?e():e,t.pathname))}function Me(){let e=X(),t=fe();return[(0,i.createMemo)(()=>e.query),(o,s)=>{let a=new URLSearchParams(e.search);for(let[d,x]of Object.entries(o))x===null?a.delete(d):a.set(d,x);let u=a.toString();t(e.pathname+(u?`?${u}`:""),s)}]}function Zt(e,t){let n=(r,o)=>(0,gt.deepEqual)(r,o);return t!==void 0?(0,i.createMemo)(()=>(0,mt.get)(e(),t),void 0,{equals:n}):(0,i.createMemo)(e,void 0,{equals:n})}function X(){let{location:e}=F();return new Proxy({},{get:(t,n)=>e()[n],has:(t,n)=>n in e(),ownKeys:()=>Reflect.ownKeys(e()),getOwnPropertyDescriptor:(t,n)=>Object.getOwnPropertyDescriptor(e(),n)})}function fe(){let{router:e}=F();return(t,n)=>e.navigate(t,n)}function en(){return(0,h.useContext)(vt)??(()=>{})}function le(e){let t=(0,h.useContext)(de),n=typeof document>"u",r=()=>t?.router.navigate(b(e.href)??"",{replace:b(e.replace)}),o=(0,l.createNativeElement)("a");if((0,l.setAttribute)(o,"href",b(e.href)??""),e.slot&&(0,l.setAttribute)(o,"slot",b(e.slot)),typeof o.addEventListener=="function")o.addEventListener("click",a=>{a.metaKey||a.ctrlKey||a.shiftKey||a.altKey||(a.preventDefault(),r())});else{let a=b(e.className??e.class)??"";a&&(0,l.setAttribute)(o,"class",a)}typeof o.addEventListener=="function"&&(0,i.createEffect)(()=>{let a=b(e.href)??"";o.setAttribute("href",a);let u=b(e.className??e.class)??"",d=b(e.activeClass)??"",x=b(e.active)??t?.location().pathname===a;o.className=[u,x?d:""].filter(Boolean).join(" ")});let s=e.children;return s!=null&&(0,l.insert)(o,s),o}function tn(e){let t=e.action,n=e.className??e.class,r=t.url??"",o=(0,l.createNativeElement)("form");(0,l.setAttribute)(o,"method","post"),r&&(0,l.setAttribute)(o,"action",r),n&&(0,l.setAttribute)(o,"class",n);for(let[a,u]of Object.entries(e))a==="action"||a==="children"||a==="class"||a==="className"||u!=null&&typeof u!="function"&&(0,l.setAttribute)(o,a,String(u));typeof o.addEventListener=="function"&&o.addEventListener("submit",a=>{a.preventDefault();let u={};new FormData(o).forEach((d,x)=>{u[x]=d}),Promise.resolve(t(u)).catch(()=>{})});let s=e.children;return s!=null&&(0,l.insert)(o,s),o}async function nn(e,t){let n=(0,w.matchRoutes)(e,t);if(!n)return;let r=[];for(let o of n.matched){let s=o.component;s&&typeof s.preload=="function"&&r.push(s.preload())}await Promise.all(r)}var i,l,h,mt,gt,w,v,bt,de,xt,ht,vt,qt,b,De,Fe=O(()=>{"use strict";i=require("@fluixi/reactive/signal"),l=require("@fluixi/dom"),h=require("@fluixi/reactive/signal"),mt=require("@fluixi/utils/object"),gt=require("@fluixi/utils/compare"),w=require("@fluixi/router"),v=require("@fluixi/router");yt();he();bt=require("@fluixi/reactive/signal"),de=(0,h.createContext)(),xt=(0,h.createContext)(),ht=(0,h.createContext)(),vt=(0,h.createContext)();qt={router:{navigate:()=>{}},location:()=>({pathname:"",search:"",hash:"",query:{}}),params:()=>({})};b=e=>typeof e=="function"?e():e;De=le});var sn={};Ie(sn,{$component:()=>q,A:()=>De,DEV:()=>H,Dynamic:()=>g.Dynamic,ErrorBoundary:()=>g.ErrorBoundary,FRAMEWORK_NAME:()=>tt,For:()=>g.For,Fragment:()=>T.Fragment,Index:()=>g.Index,Link:()=>le,Match:()=>g.Match,Outlet:()=>Oe,Portal:()=>g.Portal,Redirect:()=>_e,Router:()=>Ee,Show:()=>g.Show,Store:()=>D.Store,Suspense:()=>U,Switch:()=>g.Switch,VERSION:()=>et,addClass:()=>p.addClass,batch:()=>f.batch,classMap:()=>ce.classMap,cleanupDelegation:()=>We,composeProviders:()=>Te,createBrowserHistory:()=>v.createBrowserHistory,createComponent:()=>N,createComputed:()=>f.createComputed,createConsumer:()=>qe,createContext:()=>k,createContextWithProvider:()=>Ye,createDebounce:()=>ae.createDebounce,createDeferred:()=>f.createDeferred,createEffect:()=>f.createEffect,createIsomorphicState:()=>Ze,createMemo:()=>f.createMemo,createMemoryHistory:()=>v.createMemoryHistory,createProvider:()=>se,createRenderEffect:()=>f.createRenderEffect,createResource:()=>f.createResource,createRoot:()=>f.createRoot,createSelector:()=>ae.createSelector,createSignal:()=>f.createSignal,createStore:()=>D.createStore,delegateEvents:()=>p.delegateEvents,devOnly:()=>xe,getFrameworkInfo:()=>Kt,getOwner:()=>f.getOwner,getSharedConfig:()=>me,hydrate:()=>p.hydrate,initDelegation:()=>ze,insert:()=>p.insert,isDOMNode:()=>p.isDOMNode,isDev:()=>ge,isLitTemplateResult:()=>p.isLitTemplateResult,isRenderable:()=>$e,jsx:()=>T.jsx,jsxs:()=>T.jsxs,lazy:()=>V,mount:()=>St,onCleanup:()=>f.onCleanup,onMount:()=>G,onUnmount:()=>Q,portal:()=>Ke,read:()=>ie.readSignal,reduce:()=>ie.reduceSignal,removeClass:()=>p.removeClass,render:()=>L,runWithOwner:()=>f.runWithOwner,setAttribute:()=>p.setAttribute,setOwner:()=>f.setOwner,setProperty:()=>p.setProperty,spread:()=>p.spread,startClient:()=>Rt,styleMap:()=>ce.styleMap,toggleClass:()=>p.toggleClass,untrack:()=>f.untrack,untrackStore:()=>D.untrackStore,useCallback:()=>re,useContext:()=>M,useEffect:()=>j,useEventListener:()=>ne,useLocation:()=>X,useMatch:()=>ke,useMemo:()=>Z,useNavigate:()=>fe,useParam:()=>Le,useParams:()=>W,useProvide:()=>Ge,useReducer:()=>te,useRef:()=>ee,useRouter:()=>F,useSearchParams:()=>Me});module.exports=kt(sn);var f=require("@fluixi/reactive/signal"),ae=require("@fluixi/reactive/signal"),ie=require("@fluixi/reactive/operators"),D=require("@fluixi/reactive/store");var Ve=require("@fluixi/reactive/signal"),C=require("@fluixi/dom");_();_();var m=require("@fluixi/reactive/signal"),R=require("@fluixi/dom");function Ue(e){return!!(e&&typeof e=="object"&&typeof e.then=="function"||e instanceof Promise)}var Dt=(0,m.createContext)();function U(e){return(0,R.createComponent)(Ft,e)}function Ft(e){let t=(0,m.createSuspenseBoundary)(),n=(0,m.useContext)(Dt),r=n?n.register(t.inFallback):void 0;function o(y){return y==null||typeof y=="boolean"?null:typeof y=="function"&&(0,R.isComponent)(y)&&!(0,m.isSignal)(y)?y():y}let s=(0,R.runWithoutHydration)(()=>o(e.fallback??null)),a=(0,m.provideSuspense)(t,()=>e.children);(0,m.provideSuspense)(t,()=>{(0,m.createRenderEffect)(()=>{let y=a;if(Array.isArray(y))for(let I of y)typeof I=="function"&&(0,m.isSignal)(I)&&I();else typeof y=="function"&&(0,m.isSignal)(y)&&y()})});let[u,d]=(0,m.createSignal)(void 0),x=Ue(a);return x&&(t.increment(),a.then(y=>{d(()=>y),t.decrement()},()=>t.decrement())),(0,m.createMemo)(()=>(r?r.showFallback():t.inFallback())?s:x?u():a)}(0,R.asSuspense)(U);Object.defineProperty(U,"__suspense",{value:!0,enumerable:!0});he();typeof window<"u"&&import("lit").then(e=>(0,C.registerLitRender)(e.render));var ve=typeof window>"u";function L(e,t,n={}){if(S("render"),(0,C.delegateEvents)(["click","input","change","submit"]),ve)throw new Error("render() is for client-side only. Use renderToString() on server.");if(!t)throw new Error("Container element is required");let r;return(0,Ve.createRoot)(o=>{r=o;let s=typeof e=="function"?e():e;t.textContent="",t.setAttribute("fluixi-js","v1"),(0,C.insert)(t,()=>s)}),()=>{r&&(r(),r=void 0)}}function It(e){return e&&typeof e=="object"&&(e._$litType$!==void 0||e._$litDirective$!==void 0)}function Ke(e,t,n={}){let r=document.createElement("div");r.setAttribute("data-portal","true"),t.appendChild(r);let o=L(e,r,n);return()=>{o(),t.contains(r)&&t.removeChild(r)}}function $e(e){return!!(e==null||typeof e=="function"||(0,C.isDOMNode)(e)||It(e)||Array.isArray(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean")}function ze(){ve||(0,C.delegateEvents)(["click","input","change","submit"])}function We(){}Ce();var be=require("@fluixi/reactive/signal"),Qe=require("@fluixi/dom"),Nt="__fluixi_iso_states__",jt="__iso:";function Ut(){return globalThis[Nt]??=new Map}function Vt(e){if(typeof window>"u")return;let t=(0,Qe.getServerData)();return t?t[jt+e]:void 0}function Ze(e,t){let n=Vt(e),r=n!==void 0?n:typeof window<"u"&&t.client?t.client():t.fallback,[o,s]=(0,be.createSignal)(r);return Ut().set(e,{server:t.server,set:s}),{value:o,set:s,key:e}}var ce=require("@fluixi/dom");var g=require("@fluixi/dom");var p=require("@fluixi/dom");var T={};He(T,require("@fluixi/jsx/jsx-runtime"));var E=require("@fluixi/reactive/signal");_();var et="0.0.1",tt="Fluixi";function Kt(){return{name:tt,version:et,features:{ssr:!0,hydration:!0,jsx:!0,litHtml:!0,signals:!0,fineGrained:!0,lazy:!0,hooks:!0,devMode:!0}}}S("index");var pe=require("@fluixi/dom");we();_();var P=require("@fluixi/head"),on=require("@fluixi/dom");S("client index");function St(e,t){if(!t)throw new Error("Container element not found for mount()");(0,pe.render)(()=>e(),t)}async function Rt(e,t={}){let n=typeof t.root=="string"?document.querySelector(t.root):t.root??document.querySelector("#app");if(!n)throw new Error(`[Fluixi] Mount container not found: ${t.root??"#app"}`);let r=!!document.getElementById("__FLUIXI_HYDRATION__")||!!t.routes&&n.firstElementChild!=null,o=t.hydrate??r,s=(0,P.createHead)();if((0,P.setActiveHead)(s),(0,P.stripHeadMarker)(n),o){if(t.routes&&t.routes.length){let{preloadRoutes:a}=await Promise.resolve().then(()=>(Fe(),Ct));await a(t.routes,window.location.pathname)}at(),Se(!0),(0,pe.hydrate)(()=>e(),n),rn(),setTimeout(()=>{Se(!1),Re()},100)}else L(()=>e(),n);(0,P.mountHead)(s)}function rn(){if(typeof window>"u")return;let e=window;typeof e.__FX_REPLAY_STOP__=="function"&&e.__FX_REPLAY_STOP__();let t=e.__FX_REPLAY__;if(e.__FX_REPLAY__=void 0,e.__FX_REPLAY_STOP__=void 0,!(!Array.isArray(t)||t.length===0))for(let n of t){let r=n&&n.target;if(!r||r.isConnected===!1||typeof r.dispatchEvent!="function")continue;let o=n.type,s=o==="click"?new MouseEvent(o,{bubbles:!0,cancelable:!0}):new Event(o,{bubbles:!0,cancelable:!0});r.dispatchEvent(s)}}Fe();
1
+ "use strict";var pe=Object.defineProperty;var Rt=Object.getOwnPropertyDescriptor;var At=Object.getOwnPropertyNames;var Et=Object.prototype.hasOwnProperty;var k=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ie=(e,t)=>{for(var n in t)pe(e,n,{get:t[n],enumerable:!0})},le=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of At(t))!Et.call(e,o)&&o!==n&&pe(e,o,{get:()=>t[o],enumerable:!(r=Rt(t,o))||r.enumerable});return e},He=(e,t,n)=>(le(e,t,"default"),n&&le(n,t,"default"));var kt=e=>le(pe({},"__esModule",{value:!0}),e);function me(){return Ot}function Ne(){let e=(0,c.getOwner)();if(!e)return null;if(!e[ye]){let t={mounts:[],effects:[],scheduled:!1};e[ye]=t}return e[ye]}function je(e){if(e.scheduled)return;e.scheduled=!0;let t=(0,c.getOwner)();queueMicrotask(()=>{(0,c.runWithOwner)(t,()=>{for(let n of e.mounts)try{let r=n();typeof r=="function"&&(0,c.onCleanup)(r)}catch(r){console.error("Error in onMount callback:",r)}for(let n of e.effects){let r;(0,c.createEffect)(()=>{r&&r(),r=n()}),(0,c.onCleanup)(()=>{r&&r()})}e.mounts=[],e.effects=[]})})}function b(e){(0,J.registerCreateComponent)(N)}function N(e,t){return B(e,t)}function B(e,t){let n=typeof e=="function"?(0,c.untrack)(()=>e(t)):e;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!(0,c.isSignal)(n)){try{n.$name=e.name}catch{}return(0,J.asComponent)(n)}return n}function Y(e,t=!0){let n=Ne();if(n){if(!t){n.scheduled||e();return}n.mounts.push(e),je(n)}else{if(!t){e();return}(0,c.createEffect)(()=>{let r=(0,c.untrack)(e);typeof r=="function"&&(0,c.onCleanup)(r)})}}function q(e){(0,c.onCleanup)(e)}function j(e){let t=Ne();if(t)t.effects.push(e),je(t);else{let n;(0,c.createEffect)(()=>{n&&n(),n=e()}),(0,c.onCleanup)(()=>{n&&n()})}}function G(e){return(0,c.createMemo)(e)}function Q(e){let t={current:e};return(0,c.onCleanup)(()=>{t.current=null}),t}function Z(e,t){let[n,r]=(0,c.createSignal)(t);return[n,s=>{r(e(n(),s))}]}function ee(e,t,n,r){j(()=>{let o=e&&"current"in e?e.current:e;if(o)return o.addEventListener(t,n,r),()=>{o.removeEventListener(t,n,r)}})}function te(e){return e}function xe(){return H}function ge(e){H&&e()}var J,c,Ot,H,ye,O=k(()=>{"use strict";J=require("@fluixi/dom"),c=require("@fluixi/reactive/signal"),Ot={context:null,owner:null};H=typeof process<"u"&&!1,ye=Symbol.for("fluixi-lifecycle")});function V(e,t){let n,r,o;function s(){return r||(r=e().then(u=>n=u.default)),r}t?.preload&&s();let a=(u=>{if(n){let d=n;return(0,R.untrack)(()=>d(u))}if(!o){let[d]=(0,R.createResource)(()=>s());if(o=d,d.error)throw d.error}return(0,R.createMemo)(()=>{let d=o();return d?(0,R.untrack)(()=>d(u)):void 0},void 0,{name:"lazy"})});return a.preload=()=>s().then(()=>{}),a.$lazy=!0,a.loader=e,a}var R,he=k(()=>{"use strict";R=require("@fluixi/reactive/signal")});function Ft(){Xe||(Xe=!0,!(typeof process<"u")&&console.warn("[fluixi] createProvider({ context, value, children }) reads `children` eagerly: the object literal materialises `children` BEFORE the context is stamped, so a routed <Outlet/> that has siblings inside the provider renders detached and its descendants see no context under SSR. Use the lazy form instead:\n createProvider(Context, value, props) // children stays a getter\n // or JSX: <Context.Provider value={…}>{props.children}</Context.Provider>"))}function re(e,t,n){let r=!!e?.Provider,o=r?e:e.context,s=r?t:e.value,a=r?!1:e.debug??!1;r||Ft();let u=typeof s=="function"?s():s,d=r?n:e;return o.Provider({value:u,get children(){return d?.children},debug:a})}function Ye(e){let t=L(e);return[t,r=>re(t,r.value,r)]}function ve(e,t){if(e.length===0)return(0,Be.readChildren)(()=>t);let[n,r]=e[0],o=e.slice(1);return re(n,r,{get children(){return ve(o,t)}})}function qe(e){return t=>{let n=M(e);return t.children(n)}}function Ge(e,t){let n=M(e);return n===e.defaultValue?t():n}function L(e){let t=(0,ne.createContext)(e),n=r=>(r.debug,t.Provider({value:r.value,get children(){return r.children},debug:r.debug}));return typeof Symbol<"u"&&Symbol.for&&(n.$$typeof=Symbol.for("react.provider")),n.$$typeof=Symbol.for("react.provider"),{id:t.id,Provider:(0,Je.asProvider)(n),defaultValue:e}}function M(e){let t=(0,ne.useContext)(e);return t!==void 0?t:e.defaultValue}var Je,ne,Be,Xe,Ce=k(()=>{"use strict";Je=require("@fluixi/dom"),ne=require("@fluixi/reactive/signal"),Be=require("@fluixi/reactive/signal");O();b("index");Xe=!1});function rt(){return nt}function Se(e){nt=e}function ot(e,t){ie.set(e,t)}function st(e){return ie.get(e)}function Vt(){ie.clear()}function at(){if(typeof window>"u")return!1;let e=document.getElementById("__FLUIXI_HYDRATION__");if(!e||e.getAttribute("type")!=="application/json")return!1;try{let t=e.textContent||"{}",n=JSON.parse(t);for(let[r,o]of Object.entries(n))ie.set(r,o);return!0}catch(t){return console.error("Failed to deserialize hydration data:",t),!1}}function we(){if(typeof window>"u")return;let e=document.getElementById("__FLUIXI_HYDRATION__");e&&e.remove();let t=document.createTreeWalker(document.body,NodeFilter.SHOW_COMMENT,null),n=[],r;for(;r=t.nextNode();){let o=r,s=o.nodeValue||"";(s.startsWith("#")||s.startsWith("/"))&&n.push(o)}n.forEach(o=>o.remove()),Vt()}function it(){return typeof window>"u"}var nt,ie,Pe=k(()=>{"use strict";nt=!1,ie=new Map;typeof window<"u"&&window.addEventListener("load",()=>{setTimeout(we,100)})});function ct(e,t){return async(...n)=>{let r=t+":"+JSON.stringify(n);if(rt()||typeof window<"u"){let s=st(r);if(s!==void 0)return s}if($.has(r))return $.get(r);if(K.has(r))return K.get(r);let o=Promise.resolve(e(...n)).then(s=>($.set(r,s),K.delete(r),it()&&ot(r,s),s),s=>{throw K.delete(r),s});return K.set(r,o),o}}function ut(e){let t=typeof e=="string"?n=>n.startsWith(e):e;for(let n of $.keys())t(n)&&($.delete(n),$t.add(n));Kt(n=>n+1)}function dt(e,t){let[n]=(0,z.createResource)(t||(()=>!0),e);return n}function ft(e){return Re.has(e)||Re.set(e,(0,z.createSignal)(void 0)),Re.get(e)}function Ae(e,t){let n=t||e.name||"action",r=async o=>{let[,s]=ft(n),a=()=>s(void 0),u=()=>r(o);s({input:o,pending:!0,clear:a,retry:u});try{let d=await e(o);return s({input:o,result:d,pending:!1,clear:a,retry:u}),d}catch(d){throw s({input:o,error:d,pending:!1,clear:a,retry:u}),d}};return r.url=n,r.with=o=>Ae((...s)=>e(o,...s),t),r}function lt(e){let[t]=ft(e.url);return t}function pt(e){return e}var z,$,K,Zn,Kt,$t,Re,zt,er,yt=k(()=>{"use strict";z=require("@fluixi/reactive/signal");Pe();Ce();$=new Map,K=new Map;[Zn,Kt]=(0,z.createSignal)(0),$t=new Set;Re=new Map;zt=L(),er=zt.Provider});var Ct={};Ie(Ct,{A:()=>De,Form:()=>Zt,Link:()=>de,Outlet:()=>ke,Redirect:()=>Oe,Router:()=>Ee,action:()=>Ae,cache:()=>ct,createAsync:()=>dt,createBrowserHistory:()=>T.createBrowserHistory,createMemoryHistory:()=>T.createMemoryHistory,lazy:()=>V,matchPath:()=>T.matchPath,matchRoutes:()=>T.matchRoutes,preloadRoutes:()=>en,revalidate:()=>ut,runWithOwner:()=>bt.runWithOwner,select:()=>Gt,useAction:()=>pt,useLevelParams:()=>Yt,useLocation:()=>X,useMatch:()=>Le,useNavigate:()=>ue,useParam:()=>_e,useParamSelector:()=>qt,useParams:()=>W,useRouteData:()=>Qt,useRouter:()=>F,useSearchParams:()=>Me,useSubmission:()=>lt});function Wt(e,t,n){let r,o=e.route.data;if(typeof o=="function"){let y=!1;(0,i.onCleanup)(()=>{y=!0});let I=(0,i.getOwner)(),[Pt]=(0,i.createResource)(()=>o({params:n.params,location:n.location},I,()=>y));r=Pt}let s=()=>Tt.Provider({value:r,get children(){return ht.Provider({value:e.params,get children(){return gt.Provider({value:{depth:t,...n},get children(){return(0,l.createComponent)(e.component,{})}})}})}});if(!r)return s();let a=r,u=()=>a.loading,[d,g]=(0,i.createSignal)((0,i.untrack)(()=>!u()));return(0,i.createEffect)(()=>g(!u())),(0,i.createMemo)(()=>d()?s():null)}function vt(e){let t=e.depth+1,[n,r]=(0,i.createSignal)((0,i.untrack)(()=>e.matched()[t]?.component));return(0,i.createEffect)(()=>{let o=e.matched()[t]?.component;r(()=>o)}),(0,i.createMemo)(()=>{if(!n())return e.notFound?e.notFound():null;let s=(0,i.untrack)(()=>e.matched())[t];return Wt(s,t,{matched:e.matched,params:e.params,location:e.location})})}function Xt(e){return e==null?Jt():typeof e=="function"?(0,l.createComponent)(e,{}):e}function Jt(){let e=(0,l.createNativeElement)("div");(0,l.setAttribute)(e,"class","fx-not-found"),(0,l.setAttribute)(e,"role","main"),(0,l.setAttribute)(e,"style","min-height:60vh;display:grid;place-content:center;gap:.25rem;text-align:center;font-family:system-ui,-apple-system,sans-serif");let t=(0,l.createNativeElement)("h1");(0,l.setAttribute)(t,"style","margin:0;font-size:2.5rem;font-weight:700"),(0,l.insert)(t,"404");let n=(0,l.createNativeElement)("p");return(0,l.setAttribute)(n,"style","margin:0;opacity:.7"),(0,l.insert)(n,"This page could not be found."),e.appendChild(t),e.appendChild(n),e}function Ee(e){let t=e.history??(0,w.createBrowserHistory)(),n=(0,w.createRouter)({routes:e.routes,base:e.base,history:t}),[r,o]=(0,i.createSignal)(n.state()),s=n.subscribe(o);(0,i.onCleanup)(()=>{s(),n.destroy()});let a=(0,i.createMemo)(()=>(r().match?.matched??[]).filter(y=>y.component)),u={router:n,location:(0,i.createMemo)(()=>r().location),params:(0,i.createMemo)(()=>r().match?.params??{})},d={depth:-1,matched:a,params:u.params,location:u.location,notFound:()=>Xt(e.notFound)},g;return ce.Provider({value:u,get children(){return g??=vt(d)}})}function ke(){let e=(0,h.useContext)(gt);return e?vt(e):null}function Oe(e){let t=(0,h.useContext)(ce);if(!t||typeof window>"u")return null;let n=!1;return(0,i.onCleanup)(()=>n=!0),queueMicrotask(()=>{n||t.router.navigate(e.to,{replace:e.replace!==!1})}),null}function F(){let e=(0,h.useContext)(ce);if(e)return e;if(typeof window>"u")return Bt;throw new Error("[router-next] useRouter must be used within <Router>")}function W(){let e=F().params;return(0,i.createMemo)(()=>e(),{},{equals:(t,n)=>JSON.stringify(t)===JSON.stringify(n)})}function Yt(){return(0,h.useContext)(ht)??{}}function _e(e){let t=W();return(0,i.createMemo)(()=>t()[e])}function qt(e,t){let n=W();return(0,i.createMemo)(()=>e(n()),void 0,t?{equals:t}:void 0)}function Le(e){let t=X();return(0,i.createMemo)(()=>(0,w.matchPath)(typeof e=="function"?e():e,t.pathname))}function Me(){let e=X(),t=ue();return[(0,i.createMemo)(()=>e.query),(o,s)=>{let a=new URLSearchParams(e.search);for(let[d,g]of Object.entries(o))g===null?a.delete(d):a.set(d,g);let u=a.toString();t(e.pathname+(u?`?${u}`:""),s)}]}function Gt(e,t){let n=(r,o)=>(0,xt.deepEqual)(r,o);return t!==void 0?(0,i.createMemo)(()=>(0,mt.get)(e(),t),void 0,{equals:n}):(0,i.createMemo)(e,void 0,{equals:n})}function X(){let{location:e}=F();return new Proxy({},{get:(t,n)=>e()[n],has:(t,n)=>n in e(),ownKeys:()=>Reflect.ownKeys(e()),getOwnPropertyDescriptor:(t,n)=>Object.getOwnPropertyDescriptor(e(),n)})}function ue(){let{router:e}=F();return(t,n)=>e.navigate(t,n)}function Qt(){return(0,h.useContext)(Tt)??(()=>{})}function de(e){let t=(0,h.useContext)(ce),n=typeof document>"u",r=()=>t?.router.navigate(C(e.href)??"",{replace:C(e.replace)}),o=(0,l.createNativeElement)("a");if((0,l.setAttribute)(o,"href",C(e.href)??""),e.slot&&(0,l.setAttribute)(o,"slot",C(e.slot)),typeof o.addEventListener=="function")o.addEventListener("click",a=>{a.metaKey||a.ctrlKey||a.shiftKey||a.altKey||(a.preventDefault(),r())});else{let a=C(e.className??e.class)??"";a&&(0,l.setAttribute)(o,"class",a)}typeof o.addEventListener=="function"&&(0,i.createEffect)(()=>{let a=C(e.href)??"";o.setAttribute("href",a);let u=C(e.className??e.class)??"",d=C(e.activeClass)??"",g=C(e.active)??t?.location().pathname===a;o.className=[u,g?d:""].filter(Boolean).join(" ")});let s=e.children;return s!=null&&(0,l.insert)(o,s),o}function Zt(e){let t=e.action,n=e.className??e.class,r=t.url??"",o=(0,l.createNativeElement)("form");(0,l.setAttribute)(o,"method","post"),r&&(0,l.setAttribute)(o,"action",r),n&&(0,l.setAttribute)(o,"class",n);for(let[a,u]of Object.entries(e))a==="action"||a==="children"||a==="class"||a==="className"||u!=null&&typeof u!="function"&&(0,l.setAttribute)(o,a,String(u));typeof o.addEventListener=="function"&&o.addEventListener("submit",a=>{a.preventDefault();let u={};new FormData(o).forEach((d,g)=>{u[g]=d}),Promise.resolve(t(u)).catch(()=>{})});let s=e.children;return s!=null&&(0,l.insert)(o,s),o}async function en(e,t){let n=(0,w.matchRoutes)(e,t);if(!n)return;let r=[];for(let o of n.matched){let s=o.component;s&&typeof s.preload=="function"&&r.push(s.preload())}await Promise.all(r)}var i,l,h,mt,xt,w,T,bt,ce,gt,ht,Tt,Bt,C,De,Fe=k(()=>{"use strict";i=require("@fluixi/reactive/signal"),l=require("@fluixi/dom"),h=require("@fluixi/reactive/signal"),mt=require("@fluixi/utils/object"),xt=require("@fluixi/utils/compare"),w=require("@fluixi/router"),T=require("@fluixi/router");yt();he();bt=require("@fluixi/reactive/signal"),ce=(0,h.createContext)(),gt=(0,h.createContext)(),ht=(0,h.createContext)(),Tt=(0,h.createContext)();Bt={router:{navigate:()=>{}},location:()=>({pathname:"",search:"",hash:"",query:{}}),params:()=>({})};C=e=>typeof e=="function"?e():e;De=de});var rn={};Ie(rn,{$component:()=>B,A:()=>De,DEV:()=>H,Dynamic:()=>x.Dynamic,ErrorBoundary:()=>x.ErrorBoundary,FRAMEWORK_NAME:()=>tt,For:()=>x.For,Fragment:()=>v.Fragment,Index:()=>x.Index,Link:()=>de,Match:()=>x.Match,Outlet:()=>ke,Portal:()=>x.Portal,Redirect:()=>Oe,Router:()=>Ee,Show:()=>x.Show,Store:()=>D.Store,Suspense:()=>U,Switch:()=>x.Switch,VERSION:()=>et,addClass:()=>p.addClass,batch:()=>f.batch,classMap:()=>ae.classMap,cleanupDelegation:()=>We,composeProviders:()=>ve,createBrowserHistory:()=>T.createBrowserHistory,createComponent:()=>N,createComputed:()=>f.createComputed,createConsumer:()=>qe,createContext:()=>L,createContextWithProvider:()=>Ye,createDebounce:()=>oe.createDebounce,createDeferred:()=>f.createDeferred,createEffect:()=>f.createEffect,createIsomorphicState:()=>Ze,createMemo:()=>f.createMemo,createMemoryHistory:()=>T.createMemoryHistory,createProvider:()=>re,createRenderEffect:()=>f.createRenderEffect,createResource:()=>f.createResource,createRoot:()=>f.createRoot,createSelector:()=>oe.createSelector,createSignal:()=>f.createSignal,createStore:()=>D.createStore,delegateEvents:()=>p.delegateEvents,devOnly:()=>ge,getFrameworkInfo:()=>Ut,getOwner:()=>f.getOwner,getSharedConfig:()=>me,hydrate:()=>p.hydrate,initDelegation:()=>ze,insert:()=>p.insert,isDOMNode:()=>p.isDOMNode,isDev:()=>xe,isLitTemplateResult:()=>p.isLitTemplateResult,isRenderable:()=>$e,jsx:()=>v.jsx,jsxs:()=>v.jsxs,lazy:()=>V,mount:()=>St,onCleanup:()=>f.onCleanup,onMount:()=>Y,onUnmount:()=>q,portal:()=>Ke,read:()=>se.readSignal,reduce:()=>se.reduceSignal,removeClass:()=>p.removeClass,render:()=>_,runWithOwner:()=>f.runWithOwner,setAttribute:()=>p.setAttribute,setOwner:()=>f.setOwner,setProperty:()=>p.setProperty,spread:()=>p.spread,startClient:()=>wt,styleMap:()=>ae.styleMap,toggleClass:()=>p.toggleClass,untrack:()=>f.untrack,untrackStore:()=>D.untrackStore,useCallback:()=>te,useContext:()=>M,useEffect:()=>j,useEventListener:()=>ee,useLocation:()=>X,useMatch:()=>Le,useMemo:()=>G,useNavigate:()=>ue,useParam:()=>_e,useParams:()=>W,useProvide:()=>Ge,useReducer:()=>Z,useRef:()=>Q,useRouter:()=>F,useSearchParams:()=>Me});module.exports=kt(rn);var f=require("@fluixi/reactive/signal"),oe=require("@fluixi/reactive/signal"),se=require("@fluixi/reactive/operators"),D=require("@fluixi/reactive/store");var Ve=require("@fluixi/reactive/signal"),A=require("@fluixi/dom");O();O();var m=require("@fluixi/reactive/signal"),S=require("@fluixi/dom");function Ue(e){return!!(e&&typeof e=="object"&&typeof e.then=="function"||e instanceof Promise)}var _t=(0,m.createContext)();function U(e){return(0,S.createComponent)(Lt,e)}function Lt(e){let t=(0,m.createSuspenseBoundary)(),n=(0,m.useContext)(_t),r=n?n.register(t.inFallback):void 0;function o(y){return y==null||typeof y=="boolean"?null:typeof y=="function"&&(0,S.isComponent)(y)&&!(0,m.isSignal)(y)?y():y}let s=(0,S.runWithoutHydration)(()=>o(e.fallback??null)),a=(0,m.provideSuspense)(t,()=>e.children);(0,m.provideSuspense)(t,()=>{(0,m.createRenderEffect)(()=>{let y=a;if(Array.isArray(y))for(let I of y)typeof I=="function"&&(0,m.isSignal)(I)&&I();else typeof y=="function"&&(0,m.isSignal)(y)&&y()})});let[u,d]=(0,m.createSignal)(void 0),g=Ue(a);return g&&(t.increment(),a.then(y=>{d(()=>y),t.decrement()},()=>t.decrement())),(0,m.createMemo)(()=>(r?r.showFallback():t.inFallback())?s:g?u():a)}(0,S.asSuspense)(U);Object.defineProperty(U,"__suspense",{value:!0,enumerable:!0});he();var Mt=require("@fluixi/reactive/signal");var Te=typeof window>"u";function _(e,t,n={}){if(b("render"),(0,A.delegateEvents)(["click","input","change","submit"]),Te)throw new Error("render() is for client-side only. Use renderToString() on server.");if(!t)throw new Error("Container element is required");let r;return(0,Ve.createRoot)(o=>{r=o;let s=typeof e=="function"?e():e;t.textContent="",t.setAttribute("fluixi-js","v1"),(0,A.insert)(t,()=>s)}),()=>{r&&(r(),r=void 0)}}function Dt(e){return e&&typeof e=="object"&&(e._$litType$!==void 0||e._$litDirective$!==void 0)}function Ke(e,t,n={}){let r=document.createElement("div");r.setAttribute("data-portal","true"),t.appendChild(r);let o=_(e,r,n);return()=>{o(),t.contains(r)&&t.removeChild(r)}}function $e(e){return!!(e==null||typeof e=="function"||(0,A.isDOMNode)(e)||Dt(e)||Array.isArray(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean")}function ze(){Te||(0,A.delegateEvents)(["click","input","change","submit"])}function We(){}Ce();var be=require("@fluixi/reactive/signal"),Qe=require("@fluixi/dom"),It="__fluixi_iso_states__",Ht="__iso:";function Nt(){return globalThis[It]??=new Map}function jt(e){if(typeof window>"u")return;let t=(0,Qe.getServerData)();return t?t[Ht+e]:void 0}function Ze(e,t){let n=jt(e),r=n!==void 0?n:typeof window<"u"&&t.client?t.client():t.fallback,[o,s]=(0,be.createSignal)(r);return Nt().set(e,{server:t.server,set:s}),{value:o,set:s,key:e}}var ae=require("@fluixi/dom");var x=require("@fluixi/dom");var p=require("@fluixi/dom");var v={};He(v,require("@fluixi/jsx/jsx-runtime"));var E=require("@fluixi/reactive/signal");O();var et="0.0.1",tt="Fluixi";function Ut(){return{name:tt,version:et,features:{ssr:!0,hydration:!0,jsx:!0,litHtml:!0,signals:!0,fineGrained:!0,lazy:!0,hooks:!0,devMode:!0}}}b("index");var fe=require("@fluixi/dom");Pe();O();var P=require("@fluixi/head"),nn=require("@fluixi/dom");b("client index");function St(e,t){if(!t)throw new Error("Container element not found for mount()");(0,fe.render)(()=>e(),t)}async function wt(e,t={}){let n=typeof t.root=="string"?document.querySelector(t.root):t.root??document.querySelector("#app");if(!n)throw new Error(`[Fluixi] Mount container not found: ${t.root??"#app"}`);let r=!!document.getElementById("__FLUIXI_HYDRATION__")||!!t.routes&&n.firstElementChild!=null,o=t.hydrate??r,s=(0,P.createHead)();if((0,P.setActiveHead)(s),(0,P.stripHeadMarker)(n),o){if(t.routes&&t.routes.length){let{preloadRoutes:a}=await Promise.resolve().then(()=>(Fe(),Ct));await a(t.routes,window.location.pathname)}at(),Se(!0),(0,fe.hydrate)(()=>e(),n),tn(),setTimeout(()=>{Se(!1),we()},100)}else _(()=>e(),n);(0,P.mountHead)(s)}function tn(){if(typeof window>"u")return;let e=window;typeof e.__FX_REPLAY_STOP__=="function"&&e.__FX_REPLAY_STOP__();let t=e.__FX_REPLAY__;if(e.__FX_REPLAY__=void 0,e.__FX_REPLAY_STOP__=void 0,!(!Array.isArray(t)||t.length===0))for(let n of t){let r=n&&n.target;if(!r||r.isConnected===!1||typeof r.dispatchEvent!="function")continue;let o=n.type,s=o==="click"?new MouseEvent(o,{bubbles:!0,cancelable:!0}):new Event(o,{bubbles:!0,cancelable:!0});r.dispatchEvent(s)}}Fe();