@hot-updater/console 0.16.5 → 0.16.7-0

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,9 +1,9 @@
1
- var of=Object.defineProperty;var ba=e=>{throw TypeError(e)};var sf=(e,t,n)=>t in e?of(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Re=(e,t,n)=>sf(e,typeof t!="symbol"?t+"":t,n),Io=(e,t,n)=>t.has(e)||ba("Cannot "+n);var E=(e,t,n)=>(Io(e,t,"read from private field"),n?n.call(e):t.get(e)),J=(e,t,n)=>t.has(e)?ba("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),q=(e,t,n,r)=>(Io(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ue=(e,t,n)=>(Io(e,t,"access private method"),n);var Lr=(e,t,n,r)=>({set _(o){q(e,t,o,n)},get _(){return E(e,t,r)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();const ee={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Sa(this.context.count)},getNextContextId(){return Sa(this.context.count++)}};function Sa(e){const t=String(e),n=t.length-1;return ee.context.id+(n?String.fromCharCode(96+n):"")+t}function or(e){ee.context=e}const af=(e,t)=>e===t,it=Symbol("solid-proxy"),Eu=typeof Proxy=="function",fi=Symbol("solid-track"),Zr={equals:af};let Ru=Fu;const st=1,dr=2,Pu={owned:null,cleanups:null,context:null,owner:null},Mo={};var se=null;let G=null,lf=null,ge=null,ke=null,De=null,so=0;function ln(e,t){const n=ge,r=se,o=e.length===0,i=t===void 0?r:t,s=o?Pu:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>Me(()=>zt(s)));se=s,ge=null;try{return He(a,!0)}finally{ge=n,se=r}}function B(e,t){t=t?Object.assign({},Zr,t):Zr;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(G&&G.running&&G.sources.has(n)?o=o(n.tValue):o=o(n.value)),Mu(n,o));return[Iu.bind(n),r]}function Mt(e,t,n){const r=uo(e,t,!0,st);zn(r)}function Ke(e,t,n){const r=uo(e,t,!1,st);zn(r)}function U(e,t,n){Ru=pf;const r=uo(e,t,!1,st),o=un&&me(un);o&&(r.suspense=o),(!n||!n.render)&&(r.user=!0),De?De.push(r):zn(r)}function K(e,t,n){n=n?Object.assign({},Zr,n):Zr;const r=uo(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,zn(r),Iu.bind(r)}function uf(e){return e&&typeof e=="object"&&"then"in e}function cf(e,t,n){let r,o,i;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,o=e,i=t||{}):(r=e,o=t,i={});let s=null,a=Mo,u=null,l=!1,c=!1,d="initialValue"in i,f=typeof r=="function"&&K(r);const h=new Set,[g,p]=(i.storage||B)(i.initialValue),[v,w]=B(void 0),[m,y]=B(void 0,{equals:!1}),[x,C]=B(d?"ready":"unresolved");ee.context&&(u=ee.getNextContextId(),i.ssrLoadFrom==="initial"?a=i.initialValue:ee.load&&ee.has(u)&&(a=ee.load(u)));function O(V,N,z,ie){return s===V&&(s=null,ie!==void 0&&(d=!0),(V===a||N===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(ie,{value:N})),a=Mo,G&&V&&l?(G.promises.delete(V),l=!1,He(()=>{G.running=!0,L(N,z)},!1)):L(N,z)),N}function L(V,N){He(()=>{N===void 0&&p(()=>V),C(N!==void 0?"errored":d?"ready":"unresolved"),w(N);for(const z of h.keys())z.decrement();h.clear()},!1)}function _(){const V=un&&me(un),N=g(),z=v();if(z!==void 0&&!s)throw z;return ge&&!ge.user&&V&&Mt(()=>{m(),s&&(V.resolved&&G&&l?G.promises.add(s):h.has(V)||(V.increment(),h.add(V)))}),N}function T(V=!0){if(V!==!1&&c)return;c=!1;const N=f?f():r;if(l=G&&G.running,N==null||N===!1){O(s,Me(g));return}G&&s&&G.promises.delete(s);const z=a!==Mo?a:Me(()=>o(N,{value:g(),refetching:V}));return uf(z)?(s=z,"value"in z?(z.status==="success"?O(s,z.value,void 0,N):O(s,void 0,gi(z.value),N),z):(c=!0,queueMicrotask(()=>c=!1),He(()=>{C(d?"refreshing":"pending"),y()},!1),z.then(ie=>O(z,ie,void 0,N),ie=>O(z,void 0,gi(ie),N)))):(O(s,z,void 0,N),z)}return Object.defineProperties(_,{state:{get:()=>x()},error:{get:()=>v()},loading:{get(){const V=x();return V==="pending"||V==="refreshing"}},latest:{get(){if(!d)return _();const V=v();if(V&&!s)throw V;return g()}}}),f?Mt(()=>T(!1)):T(!1),[_,{refetch:T,mutate:p}]}function ao(e){return He(e,!1)}function Me(e){if(ge===null)return e();const t=ge;ge=null;try{return e()}finally{ge=t}}function Ce(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let l=0;l<e.length;l++)a[l]=e[l]()}else a=e();if(i)return i=!1,s;const u=Me(()=>t(a,o,s));return o=a,u}}function Bn(e){U(()=>Me(e))}function W(e){return se===null||(se.cleanups===null?se.cleanups=[e]:se.cleanups.push(e)),e}function hi(){return ge}function fr(){return se}function ts(e,t){const n=se,r=ge;se=e,ge=null;try{return He(t,!0)}catch(o){ns(o)}finally{se=n,ge=r}}function df(e){if(G&&G.running)return e(),G.done;const t=ge,n=se;return Promise.resolve().then(()=>{ge=t,se=n;let r;return un&&(r=G||(G={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),r.done||(r.done=new Promise(o=>r.resolve=o)),r.running=!0),He(e,!1),ge=se=null,r?r.done:void 0})}const[mS,xa]=B(!1);function ff(e){De.push.apply(De,e),e.length=0}function we(e,t){const n=Symbol("context");return{id:n,Provider:mf(n),defaultValue:e}}function me(e){let t;return se&&se.context&&(t=se.context[e.id])!==void 0?t:e.defaultValue}function lo(e){const t=K(e),n=K(()=>pi(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let un;function hf(){return un||(un=we())}function Iu(){const e=G&&G.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===st)zn(this);else{const t=ke;ke=null,He(()=>eo(this),!1),ke=t}if(ge){const t=this.observers?this.observers.length:0;ge.sources?(ge.sources.push(this),ge.sourceSlots.push(t)):(ge.sources=[this],ge.sourceSlots=[t]),this.observers?(this.observers.push(ge),this.observerSlots.push(ge.sources.length-1)):(this.observers=[ge],this.observerSlots=[ge.sources.length-1])}return e&&G.sources.has(this)?this.tValue:this.value}function Mu(e,t,n){let r=G&&G.running&&G.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(G){const o=G.running;(o||!n&&G.sources.has(e))&&(G.sources.add(e),e.tValue=t),o||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&He(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=G&&G.running;s&&G.disposed.has(i)||((s?!i.tState:!i.state)&&(i.pure?ke.push(i):De.push(i),i.observers&&Au(i)),s?i.tState=st:i.state=st)}if(ke.length>1e6)throw ke=[],new Error},!1)}return t}function zn(e){if(!e.fn)return;zt(e);const t=so;Ca(e,G&&G.running&&G.sources.has(e)?e.tValue:e.value,t),G&&!G.running&&G.sources.has(e)&&queueMicrotask(()=>{He(()=>{G&&(G.running=!0),ge=se=e,Ca(e,e.tValue,t),ge=se=null},!1)})}function Ca(e,t,n){let r;const o=se,i=ge;ge=se=e;try{r=e.fn(t)}catch(s){return e.pure&&(G&&G.running?(e.tState=st,e.tOwned&&e.tOwned.forEach(zt),e.tOwned=void 0):(e.state=st,e.owned&&e.owned.forEach(zt),e.owned=null)),e.updatedAt=n+1,ns(s)}finally{ge=i,se=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Mu(e,r,!0):G&&G.running&&e.pure?(G.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function uo(e,t,n,r=st,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:se,context:se?se.context:null,pure:n};return G&&G.running&&(i.state=0,i.tState=r),se===null||se!==Pu&&(G&&G.running&&se.pure?se.tOwned?se.tOwned.push(i):se.tOwned=[i]:se.owned?se.owned.push(i):se.owned=[i]),i}function Jr(e){const t=G&&G.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===dr)return eo(e);if(e.suspense&&Me(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<so);){if(t&&G.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let o=e,i=n[r+1];for(;(o=o.owner)&&o!==i;)if(G.disposed.has(o))return}if((t?e.tState:e.state)===st)zn(e);else if((t?e.tState:e.state)===dr){const o=ke;ke=null,He(()=>eo(e,n[0]),!1),ke=o}}}function He(e,t){if(ke)return e();let n=!1;t||(ke=[]),De?n=!0:De=[],so++;try{const r=e();return gf(n),r}catch(r){n||(De=null),ke=null,ns(r)}}function gf(e){if(ke&&(Fu(ke),ke=null),e)return;let t;if(G){if(!G.promises.size&&!G.queue.size){const r=G.sources,o=G.disposed;De.push.apply(De,G.effects),t=G.resolve;for(const i of De)"tState"in i&&(i.state=i.tState),delete i.tState;G=null,He(()=>{for(const i of o)zt(i);for(const i of r){if(i.value=i.tValue,i.owned)for(let s=0,a=i.owned.length;s<a;s++)zt(i.owned[s]);i.tOwned&&(i.owned=i.tOwned),delete i.tValue,delete i.tOwned,i.tState=0}xa(!1)},!1)}else if(G.running){G.running=!1,G.effects.push.apply(G.effects,De),De=null,xa(!0);return}}const n=De;De=null,n.length&&He(()=>Ru(n),!1),t&&t()}function Fu(e){for(let t=0;t<e.length;t++)Jr(e[t])}function pf(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Jr(r)}if(ee.context){if(ee.count){ee.effects||(ee.effects=[]),ee.effects.push(...e.slice(0,n));return}or()}for(ee.effects&&(ee.done||!ee.count)&&(e=[...ee.effects,...e],n+=ee.effects.length,delete ee.effects),t=0;t<n;t++)Jr(e[t])}function eo(e,t){const n=G&&G.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){const o=e.sources[r];if(o.sources){const i=n?o.tState:o.state;i===st?o!==t&&(!o.updatedAt||o.updatedAt<so)&&Jr(o):i===dr&&eo(o,t)}}}function Au(e){const t=G&&G.running;for(let n=0;n<e.observers.length;n+=1){const r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=dr:r.state=dr,r.pure?ke.push(r):De.push(r),r.observers&&Au(r))}}function zt(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){const i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)zt(e.tOwned[t]);delete e.tOwned}if(G&&G.running&&e.pure)$u(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)zt(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}G&&G.running?e.tState=0:e.state=0}function $u(e,t){if(t||(e.tState=0,G.disposed.add(e)),e.owned)for(let n=0;n<e.owned.length;n++)$u(e.owned[n])}function gi(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function ns(e,t=se){throw gi(e)}function pi(e){if(typeof e=="function"&&!e.length)return pi(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=pi(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function mf(e,t){return function(r){let o;return Ke(()=>o=Me(()=>(se.context={...se.context,[e]:r.value},lo(()=>r.children))),void 0),o}}const vf=Symbol("fallback");function Ea(e){for(let t=0;t<e.length;t++)e[t]()}function yf(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return W(()=>Ea(i)),()=>{let u=e()||[],l=u.length,c,d;return u[fi],Me(()=>{let h,g,p,v,w,m,y,x,C;if(l===0)s!==0&&(Ea(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[vf],o[0]=ln(O=>(i[0]=O,n.fallback())),s=1);else if(s===0){for(o=new Array(l),d=0;d<l;d++)r[d]=u[d],o[d]=ln(f);s=l}else{for(p=new Array(l),v=new Array(l),a&&(w=new Array(l)),m=0,y=Math.min(s,l);m<y&&r[m]===u[m];m++);for(y=s-1,x=l-1;y>=m&&x>=m&&r[y]===u[x];y--,x--)p[x]=o[y],v[x]=i[y],a&&(w[x]=a[y]);for(h=new Map,g=new Array(x+1),d=x;d>=m;d--)C=u[d],c=h.get(C),g[d]=c===void 0?-1:c,h.set(C,d);for(c=m;c<=y;c++)C=r[c],d=h.get(C),d!==void 0&&d!==-1?(p[d]=o[c],v[d]=i[c],a&&(w[d]=a[c]),d=g[d],h.set(C,d)):i[c]();for(d=m;d<l;d++)d in p?(o[d]=p[d],i[d]=v[d],a&&(a[d]=w[d],a[d](d))):o[d]=ln(f);o=o.slice(0,s=l),r=u.slice(0)}return o});function f(h){if(i[d]=h,a){const[g,p]=B(d);return a[d]=p,t(u[d],g)}return t(u[d])}}}function b(e,t){return Me(()=>e(t||{}))}function _r(){return!0}const mi={get(e,t,n){return t===it?n:e.get(t)},has(e,t){return t===it?!0:e.has(t)},set:_r,deleteProperty:_r,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:_r,deleteProperty:_r}},ownKeys(e){return e.keys()}};function Fo(e){return(e=typeof e=="function"?e():e)?e:{}}function wf(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function A(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&it in a,e[s]=typeof a=="function"?(t=!0,K(a)):a}if(Eu&&t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const u=Fo(e[a])[s];if(u!==void 0)return u}},has(s){for(let a=e.length-1;a>=0;a--)if(s in Fo(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(Fo(e[a])));return[...new Set(s)]}},mi);const n={},r=Object.create(null);for(let s=e.length-1;s>=0;s--){const a=e[s];if(!a)continue;const u=Object.getOwnPropertyNames(a);for(let l=u.length-1;l>=0;l--){const c=u[l];if(c==="__proto__"||c==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,c);if(!r[c])r[c]=d.get?{enumerable:!0,configurable:!0,get:wf.bind(n[c]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const f=n[c];f&&(d.get?f.push(d.get.bind(a)):d.value!==void 0&&f.push(()=>d.value))}}}const o={},i=Object.keys(r);for(let s=i.length-1;s>=0;s--){const a=i[s],u=r[a];u&&u.get?Object.defineProperty(o,a,u):o[a]=u?u.value:void 0}return o}function k(e,...t){if(Eu&&it in e){const o=new Set(t.length>1?t.flat():t[0]),i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},mi));return i.push(new Proxy({get(s){return o.has(s)?void 0:e[s]},has(s){return o.has(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.has(s))}},mi)),i}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,o),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let a=!1,u=0;for(const l of t)l.includes(o)&&(a=!0,s?r[u][o]=i.value:Object.defineProperty(r[u],o,i)),++u;a||(s?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}let bf=0;function Ee(){return ee.context?ee.getNextContextId():`cl-${bf++}`}const Sf=e=>`Stale read from <${e}>.`;function nt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return K(yf(()=>e.each,e.children,t||void 0))}function Se(e){const t=e.keyed,n=K(()=>e.when,void 0,{equals:(r,o)=>t?r===o:!r==!o});return K(()=>{const r=n();if(r){const o=e.children;return typeof o=="function"&&o.length>0?Me(()=>o(t?r:()=>{if(!Me(n))throw Sf("Show");return e.when})):o}return e.fallback},void 0,void 0)}const xf=we();function Cf(e){let t=0,n,r,o,i,s;const[a,u]=B(!1),l=hf(),c={increment:()=>{++t===1&&u(!0)},decrement:()=>{--t===0&&u(!1)},inFallback:a,effects:[],resolved:!1},d=fr();if(ee.context&&ee.load){const g=ee.getContextId();let p=ee.load(g);if(p&&(typeof p!="object"||p.status!=="success"?o=p:ee.gather(g)),o&&o!=="$$f"){const[v,w]=B(void 0,{equals:!1});i=v,o.then(()=>{if(ee.done)return w();ee.gather(g),or(r),w(),or()},m=>{s=m,w()})}}const f=me(xf);f&&(n=f.register(c.inFallback));let h;return W(()=>h&&h()),b(l.Provider,{value:c,get children(){return K(()=>{if(s)throw s;if(r=ee.context,i)return i(),i=void 0;r&&o==="$$f"&&or();const g=K(()=>e.children);return K(p=>{const v=c.inFallback(),{showContent:w=!0,showFallback:m=!0}=n?n():{};if((!v||o&&o!=="$$f")&&w)return c.resolved=!0,h&&h(),h=r=o=void 0,ff(c.effects),g();if(m)return h?p:ln(y=>(h=y,r&&(or({id:r.id+"F",count:0}),r=void 0),e.fallback),d)})})}})}const Ef=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],Rf=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...Ef]),Pf=new Set(["innerHTML","textContent","innerText","children"]),If=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Mf=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function Ff(e,t){const n=Mf[e];return typeof n=="object"?n[t]?n.$:void 0:n}const Af=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),$f=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),Of={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Tf(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,u=t[o-1].nextSibling,l=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const c=i<r?a?n[a-1].nextSibling:n[i-a]:u;for(;a<i;)e.insertBefore(n[a++],c)}else if(i===a)for(;s<o;)(!l||!l.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const c=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],c),t[o]=n[i]}else{if(!l){l=new Map;let d=a;for(;d<i;)l.set(n[d],d++)}const c=l.get(t[s]);if(c!=null)if(a<c&&c<i){let d=s,f=1,h;for(;++d<o&&d<i&&!((h=l.get(t[d]))==null||h!==c+f);)f++;if(f>c-a){const g=t[s];for(;a<c;)e.insertBefore(n[a++],g)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const Ra="_$DX_DELEGATE";function Df(e,t,n,r={}){let o;return ln(i=>{o=i,t===document?e():fe(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{o(),t.textContent=""}}function he(e,t,n){let r;const o=()=>{const s=document.createElement("template");return s.innerHTML=e,s.content.firstChild},i=()=>(r||(r=o())).cloneNode(!0);return i.cloneNode=i,i}function Ou(e,t=window.document){const n=t[Ra]||(t[Ra]=new Set);for(let r=0,o=e.length;r<o;r++){const i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,Gf))}}function Nn(e,t,n){gn(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Lf(e,t,n,r){gn(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function _f(e,t,n){gn(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function Tu(e,t){gn(e)||(t==null?e.removeAttribute("class"):e.className=t)}function kf(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=i=>o.call(e,n[1],i))}else e.addEventListener(t,n,typeof n!="function"&&n)}function Vf(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,s;for(i=0,s=o.length;i<s;i++){const a=o[i];!a||a==="undefined"||t[a]||(Pa(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],u=!!t[a];!a||a==="undefined"||n[a]===u||!u||(Pa(e,a,!0),n[a]=u)}return n}function Nf(e,t,n){if(!t)return n?Nn(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function at(e,t={},n,r){const o={};return r||Ke(()=>o.children=hr(e,t.children,o.children)),Ke(()=>typeof t.ref=="function"&&Kf(t.ref,e)),Ke(()=>jf(e,t,n,!0,o,!0)),o}function Kf(e,t,n){return Me(()=>e(t,n))}function fe(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return hr(e,t,r,n);Ke(o=>hr(e,t(),o,n),r)}function jf(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=Ia(e,s,null,o[s],n,i,t)}for(const s in t){if(s==="children")continue;const a=t[s];o[s]=Ia(e,s,a,o[s],n,i,t)}}function Bf(e){let t,n;return!gn()||!(t=ee.registry.get(n=Hf()))?e():(ee.completed&&ee.completed.add(t),ee.registry.delete(n),t)}function gn(e){return!!ee.context&&!ee.done&&(!e||e.isConnected)}function zf(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Pa(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function Ia(e,t,n,r,o,i,s){let a,u,l,c,d;if(t==="style")return Nf(e,n,r);if(t==="classList")return Vf(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const f=t.slice(3);r&&e.removeEventListener(f,r,typeof r!="function"&&r),n&&e.addEventListener(f,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const f=t.slice(10);r&&e.removeEventListener(f,r,!0),n&&e.addEventListener(f,n,!0)}else if(t.slice(0,2)==="on"){const f=t.slice(2).toLowerCase(),h=Af.has(f);if(!h&&r){const g=Array.isArray(r)?r[0]:r;e.removeEventListener(f,g)}(h||n)&&(kf(e,f,n,h),h&&Ou([f]))}else if(t.slice(0,5)==="attr:")Nn(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")_f(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(l=Pf.has(t))||!o&&((c=Ff(t,e.tagName))||(u=Rf.has(t)))||(a=e.nodeName.includes("-")||"is"in s)){if(d)t=t.slice(5),u=!0;else if(gn(e))return n;t==="class"||t==="className"?Tu(e,n):a&&!u&&!l?e[zf(t)]=n:e[c||t]=n}else{const f=o&&t.indexOf(":")>-1&&Of[t.split(":")[0]];f?Lf(e,f,t,n):Nn(e,If[t]||t,n)}return n}function Gf(e){if(ee.registry&&ee.events&&ee.events.find(([u,l])=>l===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=u=>Object.defineProperty(e,"target",{configurable:!0,value:u}),s=()=>{const u=t[n];if(u&&!t.disabled){const l=t[`${n}Data`];if(l!==void 0?u.call(t,l,e):u.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),ee.registry&&!ee.done&&(ee.done=_$HY.done=!0),e.composedPath){const u=e.composedPath();i(u[0]);for(let l=0;l<u.length-2&&(t=u[l],!!s());l++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();i(r)}function hr(e,t,n,r,o){const i=gn(e);if(i){!n&&(n=[...e.childNodes]);let u=[];for(let l=0;l<n.length;l++){const c=n[l];c.nodeType===8&&c.data.slice(0,2)==="!$"?c.remove():u.push(c)}n=u}for(;typeof n=="function";)n=n();if(t===n)return n;const s=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(i||s==="number"&&(t=t.toString(),t===n))return n;if(a){let u=n[0];u&&u.nodeType===3?u.data!==t&&(u.data=t):u=document.createTextNode(t),n=vn(e,n,r,u)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||s==="boolean"){if(i)return n;n=vn(e,n,r)}else{if(s==="function")return Ke(()=>{let u=t();for(;typeof u=="function";)u=u();n=hr(e,u,n,r)}),()=>n;if(Array.isArray(t)){const u=[],l=n&&Array.isArray(n);if(vi(u,t,n,o))return Ke(()=>n=hr(e,u,n,r,!0)),()=>n;if(i){if(!u.length)return n;if(r===void 0)return n=[...e.childNodes];let c=u[0];if(c.parentNode!==e)return n;const d=[c];for(;(c=c.nextSibling)!==r;)d.push(c);return n=d}if(u.length===0){if(n=vn(e,n,r),a)return n}else l?n.length===0?Ma(e,u,r):Tf(e,n,u):(n&&vn(e),Ma(e,u));n=u}else if(t.nodeType){if(i&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=vn(e,n,r,t);vn(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function vi(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],u=n&&n[e.length],l;if(!(a==null||a===!0||a===!1))if((l=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=vi(e,a,u)||o;else if(l==="function")if(r){for(;typeof a=="function";)a=a();o=vi(e,Array.isArray(a)?a:[a],Array.isArray(u)?u:[u])||o}else e.push(a),o=!0;else{const c=String(a);u&&u.nodeType===3&&u.data===c?e.push(u):e.push(document.createTextNode(c))}}return o}function Ma(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function vn(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let i=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(o!==a){const u=a.parentNode===e;!i&&!s?u?e.replaceChild(o,a):e.insertBefore(o,n):u&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}function Hf(){return ee.getNextContextId()}const Uf=!1,qf="http://www.w3.org/2000/svg";function Du(e,t=!1){return t?document.createElementNS(qf,e):document.createElement(e)}function rs(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=fr();let i,s=!!ee.context;return U(()=>{s&&(fr().user=s=!1),i||(i=ts(o,()=>K(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[u,l]=B(!1),c=()=>l(!0);ln(d=>fe(a,()=>u()?d():i(),null)),W(c)}else{const u=Du(e.isSVG?"g":"div",e.isSVG),l=t&&u.attachShadow?u.attachShadow({mode:"open"}):u;Object.defineProperty(u,"_$host",{get(){return n.parentNode},configurable:!0}),fe(l,i),a.appendChild(u),e.ref&&e.ref(u),W(()=>a.removeChild(u))}},void 0,{render:!s}),n}function Lu(e){const[t,n]=k(e,["component"]),r=K(()=>t.component);return K(()=>{const o=r();switch(typeof o){case"function":return Me(()=>o(n));case"string":const i=$f.has(o),s=ee.context?Bf():Du(o,i);return at(s,n,i),s}})}const _u=we(),Wf=["title","meta"],Fa=[],Aa=["name","http-equiv","content","charset","media"].concat(["property"]),$a=(e,t)=>{const n=Object.fromEntries(Object.entries(e.props).filter(([r])=>t.includes(r)).sort());return(Object.hasOwn(n,"name")||Object.hasOwn(n,"property"))&&(n.name=n.name||n.property,delete n.property),e.tag+JSON.stringify(n)};function Xf(){if(!ee.context){const n=document.head.querySelectorAll("[data-sm]");Array.prototype.forEach.call(n,r=>r.parentNode.removeChild(r))}const e=new Map;function t(n){if(n.ref)return n.ref;let r=document.querySelector(`[data-sm="${n.id}"]`);return r?(r.tagName.toLowerCase()!==n.tag&&(r.parentNode&&r.parentNode.removeChild(r),r=document.createElement(n.tag)),r.removeAttribute("data-sm")):r=document.createElement(n.tag),r}return{addTag(n){if(Wf.indexOf(n.tag)!==-1){const i=n.tag==="title"?Fa:Aa,s=$a(n,i);e.has(s)||e.set(s,[]);let a=e.get(s),u=a.length;a=[...a,n],e.set(s,a);let l=t(n);n.ref=l,at(l,n.props);let c=null;for(var r=u-1;r>=0;r--)if(a[r]!=null){c=a[r];break}return l.parentNode!=document.head&&document.head.appendChild(l),c&&c.ref&&c.ref.parentNode&&document.head.removeChild(c.ref),u}let o=t(n);return n.ref=o,at(o,n.props),o.parentNode!=document.head&&document.head.appendChild(o),-1},removeTag(n,r){const o=n.tag==="title"?Fa:Aa,i=$a(n,o);if(n.ref){const s=e.get(i);if(s){if(n.ref.parentNode){n.ref.parentNode.removeChild(n.ref);for(let a=r-1;a>=0;a--)s[a]!=null&&document.head.appendChild(s[a].ref)}s[r]=null,e.set(i,s)}else n.ref.parentNode&&n.ref.parentNode.removeChild(n.ref)}}}}const Qf=e=>{const t=Xf();return b(_u.Provider,{value:t,get children(){return e.children}})},Yf=(e,t,n)=>(Zf({tag:e,props:t,setting:n,id:Ee(),get name(){return t.name||t.property}}),null);function Zf(e){const t=me(_u);if(!t)throw new Error("<MetaProvider /> should be in the tree");Ke(()=>{const n=t.addTag(e);W(()=>t.removeTag(e,n))})}const Jf=e=>Yf("title",e,{escape:!0,close:!0});function ku(){let e=new Set;function t(o){return e.add(o),()=>e.delete(o)}let n=!1;function r(o,i){if(n)return!(n=!1);const s={to:o,options:i,defaultPrevented:!1,preventDefault:()=>s.defaultPrevented=!0};for(const a of e)a.listener({...s,from:a.location,retry:u=>{u&&(n=!0),a.navigate(o,{...i,resolve:!1})}});return!s.defaultPrevented}return{subscribe:t,confirm:r}}let yi;function os(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),yi=window.history.state._depth}os();function eh(e){return{...e,_depth:window.history.state&&window.history.state._depth}}function th(e,t){let n=!1;return()=>{const r=yi;os();const o=r==null?null:yi-r;if(n){n=!1;return}o&&t(o)?(n=!0,window.history.go(-o)):e()}}const nh=/^(?:[a-z0-9]+:)?\/\//i,rh=/^\/+|(\/)\/+$/g,Vu="http://sr";function ur(e,t=!1){const n=e.replace(rh,"$1");return n?t||/^[?#]/.test(n)?n:"/"+n:""}function Qr(e,t,n){if(nh.test(t))return;const r=ur(e),o=n&&ur(n);let i="";return!o||t.startsWith("/")?i=r:o.toLowerCase().indexOf(r.toLowerCase())!==0?i=r+o:i=o,(i||"/")+ur(t,!i)}function oh(e,t){if(e==null)throw new Error(t);return e}function ih(e,t){return ur(e).replace(/\/*(\*.*)?$/g,"")+ur(t)}function Nu(e){const t={};return e.searchParams.forEach((n,r)=>{r in t?Array.isArray(t[r])?t[r].push(n):t[r]=[t[r],n]:t[r]=n}),t}function sh(e,t,n){const[r,o]=e.split("/*",2),i=r.split("/").filter(Boolean),s=i.length;return a=>{const u=a.split("/").filter(Boolean),l=u.length-s;if(l<0||l>0&&o===void 0&&!t)return null;const c={path:s?"":"/",params:{}},d=f=>n===void 0?void 0:n[f];for(let f=0;f<s;f++){const h=i[f],g=h[0]===":",p=g?u[f]:u[f].toLowerCase(),v=g?h.slice(1):h.toLowerCase();if(g&&Ao(p,d(v)))c.params[v]=p;else if(g||!Ao(p,v))return null;c.path+=`/${p}`}if(o){const f=l?u.slice(-l).join("/"):"";if(Ao(f,d(o)))c.params[o]=f;else return null}return c}}function Ao(e,t){const n=r=>r===e;return t===void 0?!0:typeof t=="string"?n(t):typeof t=="function"?t(e):Array.isArray(t)?t.some(n):t instanceof RegExp?t.test(e):!1}function ah(e){const[t,n]=e.pattern.split("/*",2),r=t.split("/").filter(Boolean);return r.reduce((o,i)=>o+(i.startsWith(":")?2:3),r.length-(n===void 0?0:1))}function Ku(e){const t=new Map,n=fr();return new Proxy({},{get(r,o){return t.has(o)||ts(n,()=>t.set(o,K(()=>e()[o]))),t.get(o)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(e())}})}function lh(e,t){const n=new URLSearchParams(e);Object.entries(t).forEach(([o,i])=>{i==null||i===""||i instanceof Array&&!i.length?n.delete(o):i instanceof Array?(n.delete(o),i.forEach(s=>{n.append(o,String(s))})):n.set(o,String(i))});const r=n.toString();return r?`?${r}`:""}function ju(e){let t=/(\/?\:[^\/]+)\?/.exec(e);if(!t)return[e];let n=e.slice(0,t.index),r=e.slice(t.index+t[0].length);const o=[n,n+=t[1]];for(;t=/^(\/\:[^\/]+)\?/.exec(r);)o.push(n+=t[1]),r=r.slice(t[0].length);return ju(r).reduce((i,s)=>[...i,...o.map(a=>a+s)],[])}const uh=100,Bu=we(),zu=we(),Gu=()=>oh(me(Bu),"<A> and 'use' router primitives can be only used inside a Route."),ch=()=>Gu().navigatorFactory(),dh=()=>Gu().location,fh=()=>{const e=dh(),t=ch(),n=(r,o)=>{const i=Me(()=>lh(e.search,r)+e.hash);t(i,{scroll:!1,resolve:!1,...o})};return[e.query,n]};function hh(e,t=""){const{component:n,preload:r,load:o,children:i,info:s}=e,a=!i||Array.isArray(i)&&!i.length,u={key:e,component:n,preload:r||o,info:s};return Hu(e.path).reduce((l,c)=>{for(const d of ju(c)){const f=ih(t,d);let h=a?f:f.split("/*",1)[0];h=h.split("/").map(g=>g.startsWith(":")||g.startsWith("*")?g:encodeURIComponent(g)).join("/"),l.push({...u,originalPath:c,pattern:h,matcher:sh(h,!a,e.matchFilters)})}return l},[])}function gh(e,t=0){return{routes:e,score:ah(e[e.length-1])*1e4-t,matcher(n){const r=[];for(let o=e.length-1;o>=0;o--){const i=e[o],s=i.matcher(n);if(!s)return null;r.unshift({...s,route:i})}return r}}}function Hu(e){return Array.isArray(e)?e:[e]}function Uu(e,t="",n=[],r=[]){const o=Hu(e);for(let i=0,s=o.length;i<s;i++){const a=o[i];if(a&&typeof a=="object"){a.hasOwnProperty("path")||(a.path="");const u=hh(a,t);for(const l of u){n.push(l);const c=Array.isArray(a.children)&&a.children.length===0;if(a.children&&!c)Uu(a.children,l.pattern,n,r);else{const d=gh([...n],r.length);r.push(d)}n.pop()}}}return n.length?r:r.sort((i,s)=>s.score-i.score)}function $o(e,t){for(let n=0,r=e.length;n<r;n++){const o=e[n].matcher(t);if(o)return o}return[]}function ph(e,t,n){const r=new URL(Vu),o=K(c=>{const d=e();try{return new URL(d,r)}catch{return console.error(`Invalid path ${d}`),c}},r,{equals:(c,d)=>c.href===d.href}),i=K(()=>o().pathname),s=K(()=>o().search,!0),a=K(()=>o().hash),u=()=>"",l=Ce(s,()=>Nu(o()));return{get pathname(){return i()},get search(){return s()},get hash(){return a()},get state(){return t()},get key(){return u()},query:n?n(l):Ku(l)}}let Zt;function mh(){return Zt}function vh(e,t,n,r={}){const{signal:[o,i],utils:s={}}=e,a=s.parsePath||(P=>P),u=s.renderPath||(P=>P),l=s.beforeLeave||ku(),c=Qr("",r.base||"");if(c===void 0)throw new Error(`${c} is not a valid base path`);c&&!o().value&&i({value:c,replace:!0,scroll:!1});const[d,f]=B(!1);let h;const g=(P,R)=>{R.value===p()&&R.state===w()||(h===void 0&&f(!0),Zt=P,h=R,df(()=>{h===R&&(v(h.value),m(h.state),C[1]([]))}).finally(()=>{h===R&&ao(()=>{Zt=void 0,P==="navigate"&&z(h),f(!1),h=void 0})}))},[p,v]=B(o().value),[w,m]=B(o().state),y=ph(p,w,s.queryWrapper),x=[],C=B([]),O=K(()=>typeof r.transformUrl=="function"?$o(t(),r.transformUrl(y.pathname)):$o(t(),y.pathname)),L=()=>{const P=O(),R={};for(let S=0;S<P.length;S++)Object.assign(R,P[S].params);return R},_=s.paramsWrapper?s.paramsWrapper(L,t):Ku(L),T={pattern:c,path:()=>c,outlet:()=>null,resolvePath(P){return Qr(c,P)}};return Ke(Ce(o,P=>g("native",P),{defer:!0})),{base:T,location:y,params:_,isRouting:d,renderPath:u,parsePath:a,navigatorFactory:N,matches:O,beforeLeave:l,preloadRoute:ie,singleFlight:r.singleFlight===void 0?!0:r.singleFlight,submissions:C};function V(P,R,S){Me(()=>{if(typeof R=="number"){R&&(s.go?s.go(R):console.warn("Router integration does not support relative routing"));return}const I=!R||R[0]==="?",{replace:M,resolve:F,scroll:D,state:j}={replace:!1,resolve:!I,scroll:!0,...S},H=F?P.resolvePath(R):Qr(I&&y.pathname||"",R);if(H===void 0)throw new Error(`Path '${R}' is not a routable path`);if(x.length>=uh)throw new Error("Too many redirects");const X=p();(H!==X||j!==w())&&(Uf||l.confirm(H,S)&&(x.push({value:X,replace:M,scroll:D,state:w()}),g("navigate",{value:H,state:j})))})}function N(P){return P=P||me(zu)||T,(R,S)=>V(P,R,S)}function z(P){const R=x[0];R&&(i({...P,replace:R.replace,scroll:R.scroll}),x.length=0)}function ie(P,R){const S=$o(t(),P.pathname),I=Zt;Zt="preload";for(let M in S){const{route:F,params:D}=S[M];F.component&&F.component.preload&&F.component.preload();const{preload:j}=F;R&&j&&ts(n(),()=>j({params:D,location:{pathname:P.pathname,search:P.search,hash:P.hash,query:Nu(P),state:null,key:""},intent:"preload"}))}Zt=I}}function yh(e,t,n,r){const{base:o,location:i,params:s}=e,{pattern:a,component:u,preload:l}=r().route,c=K(()=>r().path);u&&u.preload&&u.preload();const d=l?l({params:s,location:i,intent:Zt||"initial"}):void 0;return{parent:t,pattern:a,path:c,outlet:()=>u?b(u,{params:s,location:i,data:d,get children(){return n()}}):n(),resolvePath(h){return Qr(o.path(),h,c())}}}const wh=e=>t=>{const{base:n}=t,r=lo(()=>t.children),o=K(()=>Uu(r(),t.base||""));let i;const s=vh(e,o,()=>i,{base:n,singleFlight:t.singleFlight,transformUrl:t.transformUrl});return e.create&&e.create(s),b(Bu.Provider,{value:s,get children(){return b(bh,{routerState:s,get root(){return t.root},get preload(){return t.rootPreload||t.rootLoad},get children(){return[K(()=>(i=fr())&&null),b(Sh,{routerState:s,get branches(){return o()}})]}})}})};function bh(e){const t=e.routerState.location,n=e.routerState.params,r=K(()=>e.preload&&Me(()=>{e.preload({params:n,location:t,intent:mh()||"initial"})}));return b(Se,{get when(){return e.root},keyed:!0,get fallback(){return e.children},children:o=>b(o,{params:n,location:t,get data(){return r()},get children(){return e.children}})})}function Sh(e){const t=[];let n;const r=K(Ce(e.routerState.matches,(o,i,s)=>{let a=i&&o.length===i.length;const u=[];for(let l=0,c=o.length;l<c;l++){const d=i&&i[l],f=o[l];s&&d&&f.route.key===d.route.key?u[l]=s[l]:(a=!1,t[l]&&t[l](),ln(h=>{t[l]=h,u[l]=yh(e.routerState,u[l-1]||e.routerState.base,Oa(()=>r()[l+1]),()=>e.routerState.matches()[l])}))}return t.splice(o.length).forEach(l=>l()),s&&a?s:(n=u[0],u)}));return Oa(()=>r()&&n)()}const Oa=e=>()=>b(Se,{get when(){return e()},keyed:!0,children:t=>b(zu.Provider,{value:t,get children(){return t.outlet()}})}),xh=e=>{const t=lo(()=>e.children);return A(e,{get children(){return t()}})};function Ch([e,t],n,r){return[e,r?o=>t(r(o)):t]}function Eh(e){let t=!1;const n=o=>typeof o=="string"?{value:o}:o,r=Ch(B(n(e.get()),{equals:(o,i)=>o.value===i.value&&o.state===i.state}),void 0,o=>(!t&&e.set(o),ee.registry&&!ee.done&&(ee.done=!0),o));return e.init&&W(e.init((o=e.get())=>{t=!0,r[1](n(o)),t=!1})),wh({signal:r,create:e.create,utils:e.utils})}function Rh(e,t,n){return e.addEventListener(t,n),()=>e.removeEventListener(t,n)}function Ph(e,t){const n=e&&document.getElementById(e);n?n.scrollIntoView():t&&window.scrollTo(0,0)}const Ih=new Map;function Mh(e=!0,t=!1,n="/_server",r){return o=>{const i=o.base.path(),s=o.navigatorFactory(o.base);let a,u;function l(p){return p.namespaceURI==="http://www.w3.org/2000/svg"}function c(p){if(p.defaultPrevented||p.button!==0||p.metaKey||p.altKey||p.ctrlKey||p.shiftKey)return;const v=p.composedPath().find(O=>O instanceof Node&&O.nodeName.toUpperCase()==="A");if(!v||t&&!v.hasAttribute("link"))return;const w=l(v),m=w?v.href.baseVal:v.href;if((w?v.target.baseVal:v.target)||!m&&!v.hasAttribute("state"))return;const x=(v.getAttribute("rel")||"").split(/\s+/);if(v.hasAttribute("download")||x&&x.includes("external"))return;const C=w?new URL(m,document.baseURI):new URL(m);if(!(C.origin!==window.location.origin||i&&C.pathname&&!C.pathname.toLowerCase().startsWith(i.toLowerCase())))return[v,C]}function d(p){const v=c(p);if(!v)return;const[w,m]=v,y=o.parsePath(m.pathname+m.search+m.hash),x=w.getAttribute("state");p.preventDefault(),s(y,{resolve:!1,replace:w.hasAttribute("replace"),scroll:!w.hasAttribute("noscroll"),state:x?JSON.parse(x):void 0})}function f(p){const v=c(p);if(!v)return;const[w,m]=v;r&&(m.pathname=r(m.pathname)),o.preloadRoute(m,w.getAttribute("preload")!=="false")}function h(p){clearTimeout(a);const v=c(p);if(!v)return u=null;const[w,m]=v;u!==w&&(r&&(m.pathname=r(m.pathname)),a=setTimeout(()=>{o.preloadRoute(m,w.getAttribute("preload")!=="false"),u=w},20))}function g(p){if(p.defaultPrevented)return;let v=p.submitter&&p.submitter.hasAttribute("formaction")?p.submitter.getAttribute("formaction"):p.target.getAttribute("action");if(!v)return;if(!v.startsWith("https://action/")){const m=new URL(v,Vu);if(v=o.parsePath(m.pathname+m.search),!v.startsWith(n))return}if(p.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const w=Ih.get(v);if(w){p.preventDefault();const m=new FormData(p.target,p.submitter);w.call({r:o,f:p.target},p.target.enctype==="multipart/form-data"?m:new URLSearchParams(m))}}Ou(["click","submit"]),document.addEventListener("click",d),e&&(document.addEventListener("mousemove",h,{passive:!0}),document.addEventListener("focusin",f,{passive:!0}),document.addEventListener("touchstart",f,{passive:!0})),document.addEventListener("submit",g),W(()=>{document.removeEventListener("click",d),e&&(document.removeEventListener("mousemove",h),document.removeEventListener("focusin",f),document.removeEventListener("touchstart",f)),document.removeEventListener("submit",g)})}}function Fh(e){const t=()=>{const r=window.location.pathname.replace(/^\/+/,"/")+window.location.search,o=window.history.state&&window.history.state._depth&&Object.keys(window.history.state).length===1?void 0:window.history.state;return{value:r+window.location.hash,state:o}},n=ku();return Eh({get:t,set({value:r,replace:o,scroll:i,state:s}){o?window.history.replaceState(eh(s),"",r):window.history.pushState(s,"",r),Ph(decodeURIComponent(window.location.hash.slice(1)),i),os()},init:r=>Rh(window,"popstate",th(r,o=>{if(o&&o<0)return!n.confirm(o);{const i=t();return!n.confirm(i.value,{state:i.state})}})),create:Mh(e.preload,e.explicitLinks,e.actionBase,e.transformUrl),utils:{go:r=>window.history.go(r),beforeLeave:n}})(e)}const wi=Symbol("store-raw"),xn=Symbol("store-node"),Rt=Symbol("store-has"),qu=Symbol("store-self");function Wu(e){let t=e[it];if(!t&&(Object.defineProperty(e,it,{value:t=new Proxy(e,Oh)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=n.length;o<i;o++){const s=n[o];r[s].get&&Object.defineProperty(e,s,{enumerable:r[s].enumerable,get:r[s].get.bind(t)})}}return t}function Gt(e){let t;return e!=null&&typeof e=="object"&&(e[it]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function cn(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[wi])return n;if(!Gt(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let s=0,a=e.length;s<a;s++)o=e[s],(r=cn(o,t))!==o&&(e[s]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const s=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let u=0,l=s.length;u<l;u++)i=s[u],!a[i].get&&(o=e[i],(r=cn(o,t))!==o&&(e[i]=r))}return e}function to(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function gr(e,t,n){if(e[t])return e[t];const[r,o]=B(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function Ah(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===it||t===xn||(delete n.value,delete n.writable,n.get=()=>e[it][t]),n}function Xu(e){hi()&&gr(to(e,xn),qu)()}function $h(e){return Xu(e),Reflect.ownKeys(e)}const Oh={get(e,t,n){if(t===wi)return e;if(t===it)return n;if(t===fi)return Xu(e),n;const r=to(e,xn),o=r[t];let i=o?o():e[t];if(t===xn||t===Rt||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);hi()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=gr(r,t,i)())}return Gt(i)?Wu(i):i},has(e,t){return t===wi||t===it||t===fi||t===xn||t===Rt||t==="__proto__"?!0:(hi()&&gr(to(e,Rt),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:$h,getOwnPropertyDescriptor:Ah};function Qe(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],i=e.length;n===void 0?(delete e[t],e[Rt]&&e[Rt][t]&&o!==void 0&&e[Rt][t].$()):(e[t]=n,e[Rt]&&e[Rt][t]&&o===void 0&&e[Rt][t].$());let s=to(e,xn),a;if((a=gr(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let u=e.length;u<i;u++)(a=s[u])&&a.$();(a=gr(s,"length",i))&&a.$(e.length)}(a=s[qu])&&a.$()}function Qu(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];Qe(e,o,t[o])}}function Th(e,t){if(typeof t=="function"&&(t=t(e)),t=cn(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const o=t[n];e[n]!==o&&Qe(e,n,o)}Qe(e,"length",r)}else Qu(e,t)}function ir(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const s=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let u=0;u<r.length;u++)ir(e,[r[u]].concat(t),n);return}else if(a&&s==="function"){for(let u=0;u<e.length;u++)r(e[u],u)&&ir(e,[u].concat(t),n);return}else if(a&&s==="object"){const{from:u=0,to:l=e.length-1,by:c=1}=r;for(let d=u;d<=l;d+=c)ir(e,[d].concat(t),n);return}else if(t.length>1){ir(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let i=t[0];typeof i=="function"&&(i=i(o,n),i===o)||r===void 0&&i==null||(i=cn(i),r===void 0||Gt(o)&&Gt(i)&&!Array.isArray(i)?Qu(o,i):Qe(e,r,i))}function co(...[e,t]){const n=cn(e||{}),r=Array.isArray(n),o=Wu(n);function i(...s){ao(()=>{r&&s.length===1?Th(n,s[0]):ir(n,s)})}return[o,i]}const bi=Symbol("store-root");function wn(e,t,n,r,o){const i=t[n];if(e===i)return;const s=Array.isArray(e);if(n!==bi&&(!Gt(e)||!Gt(i)||s!==Array.isArray(i)||o&&e[o]!==i[o])){Qe(t,n,e);return}if(s){if(e.length&&i.length&&(!r||o&&e[0]&&e[0][o]!=null)){let l,c,d,f,h,g,p,v;for(d=0,f=Math.min(i.length,e.length);d<f&&(i[d]===e[d]||o&&i[d]&&e[d]&&i[d][o]===e[d][o]);d++)wn(e[d],i,d,r,o);const w=new Array(e.length),m=new Map;for(f=i.length-1,h=e.length-1;f>=d&&h>=d&&(i[f]===e[h]||o&&i[d]&&e[d]&&i[f][o]===e[h][o]);f--,h--)w[h]=i[f];if(d>h||d>f){for(c=d;c<=h;c++)Qe(i,c,e[c]);for(;c<e.length;c++)Qe(i,c,w[c]),wn(e[c],i,c,r,o);i.length>e.length&&Qe(i,"length",e.length);return}for(p=new Array(h+1),c=h;c>=d;c--)g=e[c],v=o&&g?g[o]:g,l=m.get(v),p[c]=l===void 0?-1:l,m.set(v,c);for(l=d;l<=f;l++)g=i[l],v=o&&g?g[o]:g,c=m.get(v),c!==void 0&&c!==-1&&(w[c]=i[l],c=p[c],m.set(v,c));for(c=d;c<e.length;c++)c in w?(Qe(i,c,w[c]),wn(e[c],i,c,r,o)):Qe(i,c,e[c])}else for(let l=0,c=e.length;l<c;l++)wn(e[l],i,l,r,o);i.length>e.length&&Qe(i,"length",e.length);return}const a=Object.keys(e);for(let l=0,c=a.length;l<c;l++)wn(e[a[l]],i,a[l],r,o);const u=Object.keys(i);for(let l=0,c=u.length;l<c;l++)e[u[l]]===void 0&&Qe(i,u[l],void 0)}function Yu(e,t={}){const{merge:n,key:r="id"}=t,o=cn(e);return i=>{if(!Gt(i)||!Gt(o))return o;const s=wn(o,{[bi]:i},bi,n,r);return s===void 0?i:s}}const Dh="/assets/logo-BYNFyja1.png";var Lh=he('<main class="w-full space-y-2.5"><div class="flex flex-row items-center gap-1"><img alt="Hot Updater Console"class="w-12 h-12"><a href=https://github.com/gronxb/hot-updater target=_blank class="text-2xl font-light"rel=noreferrer>Hot Updater Console');function _h({children:e}){return(()=>{var t=Lh(),n=t.firstChild,r=n.firstChild;return Nn(r,"src",Dh),fe(t,e,null),t})()}var Ir=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Kn=typeof window>"u"||"Deno"in globalThis;function Ye(){}function kh(e,t){return typeof e=="function"?e(t):e}function Si(e){return typeof e=="number"&&e>=0&&e!==1/0}function Zu(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Cn(e,t){return typeof e=="function"?e(t):e}function rt(e,t){return typeof e=="function"?e(t):e}function Ta(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==is(s,t.options))return!1}else if(!mr(t.queryKey,s))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function Da(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(pr(t.options.mutationKey)!==pr(i))return!1}else if(!mr(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function is(e,t){return((t==null?void 0:t.queryKeyHashFn)||pr)(e)}function pr(e){return JSON.stringify(e,(t,n)=>Ci(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function mr(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!mr(e[n],t[n])):!1}function Ju(e,t){if(e===t)return e;const n=La(e)&&La(t);if(n||Ci(e)&&Ci(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let u=0;for(let l=0;l<s;l++){const c=n?l:i[l];(!n&&r.includes(c)||n)&&e[c]===void 0&&t[c]===void 0?(a[c]=void 0,u++):(a[c]=Ju(e[c],t[c]),a[c]===e[c]&&e[c]!==void 0&&u++)}return o===s&&u===o?e:a}return t}function xi(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function La(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ci(e){if(!_a(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!_a(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function _a(e){return Object.prototype.toString.call(e)==="[object Object]"}function Vh(e){return new Promise(t=>{setTimeout(t,e)})}function Ei(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Ju(e,t):t}function Nh(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Kh(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ss=Symbol();function ec(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ss?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Jt,Lt,Pn,pu,jh=(pu=class extends Ir{constructor(){super();J(this,Jt);J(this,Lt);J(this,Pn);q(this,Pn,t=>{if(!Kn&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){E(this,Lt)||this.setEventListener(E(this,Pn))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,Lt))==null||t.call(this),q(this,Lt,void 0))}setEventListener(t){var n;q(this,Pn,t),(n=E(this,Lt))==null||n.call(this),q(this,Lt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){E(this,Jt)!==t&&(q(this,Jt,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof E(this,Jt)=="boolean"?E(this,Jt):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Jt=new WeakMap,Lt=new WeakMap,Pn=new WeakMap,pu),as=new jh,In,_t,Mn,mu,Bh=(mu=class extends Ir{constructor(){super();J(this,In,!0);J(this,_t);J(this,Mn);q(this,Mn,t=>{if(!Kn&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){E(this,_t)||this.setEventListener(E(this,Mn))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,_t))==null||t.call(this),q(this,_t,void 0))}setEventListener(t){var n;q(this,Mn,t),(n=E(this,_t))==null||n.call(this),q(this,_t,t(this.setOnline.bind(this)))}setOnline(t){E(this,In)!==t&&(q(this,In,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return E(this,In)}},In=new WeakMap,_t=new WeakMap,Mn=new WeakMap,mu),no=new Bh;function Ri(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function zh(e){return Math.min(1e3*2**e,3e4)}function tc(e){return(e??"online")==="online"?no.isOnline():!0}var nc=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Oo(e){return e instanceof nc}function rc(e){let t=!1,n=0,r=!1,o;const i=Ri(),s=p=>{var v;r||(f(new nc(p)),(v=e.abort)==null||v.call(e))},a=()=>{t=!0},u=()=>{t=!1},l=()=>as.isFocused()&&(e.networkMode==="always"||no.isOnline())&&e.canRun(),c=()=>tc(e.networkMode)&&e.canRun(),d=p=>{var v;r||(r=!0,(v=e.onSuccess)==null||v.call(e,p),o==null||o(),i.resolve(p))},f=p=>{var v;r||(r=!0,(v=e.onError)==null||v.call(e,p),o==null||o(),i.reject(p))},h=()=>new Promise(p=>{var v;o=w=>{(r||l())&&p(w)},(v=e.onPause)==null||v.call(e)}).then(()=>{var p;o=void 0,r||(p=e.onContinue)==null||p.call(e)}),g=()=>{if(r)return;let p;const v=n===0?e.initialPromise:void 0;try{p=v??e.fn()}catch(w){p=Promise.reject(w)}Promise.resolve(p).then(d).catch(w=>{var O;if(r)return;const m=e.retry??(Kn?0:3),y=e.retryDelay??zh,x=typeof y=="function"?y(n,w):y,C=m===!0||typeof m=="number"&&n<m||typeof m=="function"&&m(n,w);if(t||!C){f(w);return}n++,(O=e.onFail)==null||O.call(e,n,w),Vh(x).then(()=>l()?void 0:h()).then(()=>{t?f(w):g()})})};return{promise:i,cancel:s,continue:()=>(o==null||o(),i),cancelRetry:a,continueRetry:u,canStart:c,start:()=>(c()?g():h().then(g),i)}}function Gh(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0);const i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(u=>{n(u)})})})};return{batch:a=>{let u;t++;try{u=a()}finally{t--,t||s()}return u},batchCalls:a=>(...u)=>{i(()=>{a(...u)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var Le=Gh(),en,vu,oc=(vu=class{constructor(){J(this,en)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Si(this.gcTime)&&q(this,en,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Kn?1/0:5*60*1e3))}clearGcTimeout(){E(this,en)&&(clearTimeout(E(this,en)),q(this,en,void 0))}},en=new WeakMap,vu),Fn,An,Xe,tn,Oe,Cr,nn,et,Ct,yu,Hh=(yu=class extends oc{constructor(t){super();J(this,et);J(this,Fn);J(this,An);J(this,Xe);J(this,tn);J(this,Oe);J(this,Cr);J(this,nn);q(this,nn,!1),q(this,Cr,t.defaultOptions),this.setOptions(t.options),this.observers=[],q(this,tn,t.client),q(this,Xe,E(this,tn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,q(this,Fn,Uh(this.options)),this.state=t.state??E(this,Fn),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=E(this,Oe))==null?void 0:t.promise}setOptions(t){this.options={...E(this,Cr),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&E(this,Xe).remove(this)}setData(t,n){const r=Ei(this.state.data,t,this.options);return ue(this,et,Ct).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ue(this,et,Ct).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=E(this,Oe))==null?void 0:r.promise;return(o=E(this,Oe))==null||o.cancel(t),n?n.then(Ye).catch(Ye):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(E(this,Fn))}isActive(){return this.observers.some(t=>rt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ss||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!Zu(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=E(this,Oe))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=E(this,Oe))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),E(this,Xe).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(E(this,Oe)&&(E(this,nn)?E(this,Oe).cancel({revert:!0}):E(this,Oe).cancelRetry()),this.scheduleGc()),E(this,Xe).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ue(this,et,Ct).call(this,{type:"invalidate"})}fetch(t,n){var u,l,c;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(E(this,Oe))return E(this,Oe).continueRetry(),E(this,Oe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(f=>f.options.queryFn);d&&this.setOptions(d.options)}const r=new AbortController,o=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(q(this,nn,!0),r.signal)})},i=()=>{const d=ec(this.options,n),f={client:E(this,tn),queryKey:this.queryKey,meta:this.meta};return o(f),q(this,nn,!1),this.options.persister?this.options.persister(d,f,this):d(f)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:E(this,tn),state:this.state,fetchFn:i};o(s),(u=this.options.behavior)==null||u.onFetch(s,this),q(this,An,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((l=s.fetchOptions)==null?void 0:l.meta))&&ue(this,et,Ct).call(this,{type:"fetch",meta:(c=s.fetchOptions)==null?void 0:c.meta});const a=d=>{var f,h,g,p;Oo(d)&&d.silent||ue(this,et,Ct).call(this,{type:"error",error:d}),Oo(d)||((h=(f=E(this,Xe).config).onError)==null||h.call(f,d,this),(p=(g=E(this,Xe).config).onSettled)==null||p.call(g,this.state.data,d,this)),this.scheduleGc()};return q(this,Oe,rc({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var f,h,g,p;if(d===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(v){a(v);return}(h=(f=E(this,Xe).config).onSuccess)==null||h.call(f,d,this),(p=(g=E(this,Xe).config).onSettled)==null||p.call(g,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,f)=>{ue(this,et,Ct).call(this,{type:"failed",failureCount:d,error:f})},onPause:()=>{ue(this,et,Ct).call(this,{type:"pause"})},onContinue:()=>{ue(this,et,Ct).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),E(this,Oe).start()}},Fn=new WeakMap,An=new WeakMap,Xe=new WeakMap,tn=new WeakMap,Oe=new WeakMap,Cr=new WeakMap,nn=new WeakMap,et=new WeakSet,Ct=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...ic(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return Oo(o)&&o.revert&&E(this,An)?{...E(this,An),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Le.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),E(this,Xe).notify({query:this,type:"updated",action:t})})},yu);function ic(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:tc(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Uh(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ct,wu,qh=(wu=class extends Ir{constructor(t={}){super();J(this,ct);this.config=t,q(this,ct,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??is(o,n);let s=this.get(i);return s||(s=new Hh({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){E(this,ct).has(t.queryHash)||(E(this,ct).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=E(this,ct).get(t.queryHash);n&&(t.destroy(),n===t&&E(this,ct).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Le.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return E(this,ct).get(t)}getAll(){return[...E(this,ct).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Ta(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Ta(t,r)):n}notify(t){Le.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Le.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Le.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ct=new WeakMap,wu),dt,Ve,rn,ft,Dt,bu,Wh=(bu=class extends oc{constructor(t){super();J(this,ft);J(this,dt);J(this,Ve);J(this,rn);this.mutationId=t.mutationId,q(this,Ve,t.mutationCache),q(this,dt,[]),this.state=t.state||Xh(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){E(this,dt).includes(t)||(E(this,dt).push(t),this.clearGcTimeout(),E(this,Ve).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){q(this,dt,E(this,dt).filter(n=>n!==t)),this.scheduleGc(),E(this,Ve).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){E(this,dt).length||(this.state.status==="pending"?this.scheduleGc():E(this,Ve).remove(this))}continue(){var t;return((t=E(this,rn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,u,l,c,d,f,h,g,p,v,w,m,y,x,C,O,L;q(this,rn,rc({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(_,T)=>{ue(this,ft,Dt).call(this,{type:"failed",failureCount:_,error:T})},onPause:()=>{ue(this,ft,Dt).call(this,{type:"pause"})},onContinue:()=>{ue(this,ft,Dt).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>E(this,Ve).canRun(this)}));const n=this.state.status==="pending",r=!E(this,rn).canStart();try{if(!n){ue(this,ft,Dt).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(o=E(this,Ve).config).onMutate)==null?void 0:i.call(o,t,this));const T=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));T!==this.state.context&&ue(this,ft,Dt).call(this,{type:"pending",context:T,variables:t,isPaused:r})}const _=await E(this,rn).start();return await((l=(u=E(this,Ve).config).onSuccess)==null?void 0:l.call(u,_,t,this.state.context,this)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,_,t,this.state.context)),await((h=(f=E(this,Ve).config).onSettled)==null?void 0:h.call(f,_,null,this.state.variables,this.state.context,this)),await((p=(g=this.options).onSettled)==null?void 0:p.call(g,_,null,t,this.state.context)),ue(this,ft,Dt).call(this,{type:"success",data:_}),_}catch(_){try{throw await((w=(v=E(this,Ve).config).onError)==null?void 0:w.call(v,_,t,this.state.context,this)),await((y=(m=this.options).onError)==null?void 0:y.call(m,_,t,this.state.context)),await((C=(x=E(this,Ve).config).onSettled)==null?void 0:C.call(x,void 0,_,this.state.variables,this.state.context,this)),await((L=(O=this.options).onSettled)==null?void 0:L.call(O,void 0,_,t,this.state.context)),_}finally{ue(this,ft,Dt).call(this,{type:"error",error:_})}}finally{E(this,Ve).runNext(this)}}},dt=new WeakMap,Ve=new WeakMap,rn=new WeakMap,ft=new WeakSet,Dt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Le.batch(()=>{E(this,dt).forEach(r=>{r.onMutationUpdate(t)}),E(this,Ve).notify({mutation:this,type:"updated",action:t})})},bu);function Xh(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var It,tt,Er,Su,Qh=(Su=class extends Ir{constructor(t={}){super();J(this,It);J(this,tt);J(this,Er);this.config=t,q(this,It,new Set),q(this,tt,new Map),q(this,Er,0)}build(t,n,r){const o=new Wh({mutationCache:this,mutationId:++Lr(this,Er)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){E(this,It).add(t);const n=kr(t);if(typeof n=="string"){const r=E(this,tt).get(n);r?r.push(t):E(this,tt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(E(this,It).delete(t)){const n=kr(t);if(typeof n=="string"){const r=E(this,tt).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&E(this,tt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=kr(t);if(typeof n=="string"){const r=E(this,tt).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=kr(t);if(typeof n=="string"){const o=(r=E(this,tt).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Le.batch(()=>{E(this,It).forEach(t=>{this.notify({type:"removed",mutation:t})}),E(this,It).clear(),E(this,tt).clear()})}getAll(){return Array.from(E(this,It))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Da(n,r))}findAll(t={}){return this.getAll().filter(n=>Da(t,n))}notify(t){Le.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Le.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ye))))}},It=new WeakMap,tt=new WeakMap,Er=new WeakMap,Su);function kr(e){var t;return(t=e.options.scope)==null?void 0:t.id}function ka(e){return{onFetch:(t,n)=>{var c,d,f,h,g;const r=t.options,o=(f=(d=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,i=((h=t.state.data)==null?void 0:h.pages)||[],s=((g=t.state.data)==null?void 0:g.pageParams)||[];let a={pages:[],pageParams:[]},u=0;const l=async()=>{let p=!1;const v=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},w=ec(t.options,t.fetchOptions),m=async(y,x,C)=>{if(p)return Promise.reject();if(x==null&&y.pages.length)return Promise.resolve(y);const O={client:t.client,queryKey:t.queryKey,pageParam:x,direction:C?"backward":"forward",meta:t.options.meta};v(O);const L=await w(O),{maxPages:_}=t.options,T=C?Kh:Nh;return{pages:T(y.pages,L,_),pageParams:T(y.pageParams,x,_)}};if(o&&i.length){const y=o==="backward",x=y?Yh:Va,C={pages:i,pageParams:s},O=x(r,C);a=await m(C,O,y)}else{const y=e??i.length;do{const x=u===0?s[0]??r.initialPageParam:Va(r,a);if(u>0&&x==null)break;a=await m(a,x),u++}while(u<y)}return a};t.options.persister?t.fetchFn=()=>{var p,v;return(v=(p=t.options).persister)==null?void 0:v.call(p,l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=l}}}function Va(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Yh(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var xe,kt,Vt,$n,On,Nt,Tn,Dn,xu,Zh=(xu=class{constructor(t={}){J(this,xe);J(this,kt);J(this,Vt);J(this,$n);J(this,On);J(this,Nt);J(this,Tn);J(this,Dn);q(this,xe,t.queryCache||new qh),q(this,kt,t.mutationCache||new Qh),q(this,Vt,t.defaultOptions||{}),q(this,$n,new Map),q(this,On,new Map),q(this,Nt,0)}mount(){Lr(this,Nt)._++,E(this,Nt)===1&&(q(this,Tn,as.subscribe(async t=>{t&&(await this.resumePausedMutations(),E(this,xe).onFocus())})),q(this,Dn,no.subscribe(async t=>{t&&(await this.resumePausedMutations(),E(this,xe).onOnline())})))}unmount(){var t,n;Lr(this,Nt)._--,E(this,Nt)===0&&((t=E(this,Tn))==null||t.call(this),q(this,Tn,void 0),(n=E(this,Dn))==null||n.call(this),q(this,Dn,void 0))}isFetching(t){return E(this,xe).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return E(this,kt).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const n=this.defaultQueryOptions({queryKey:t});return(r=E(this,xe).get(n.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const n=this.defaultQueryOptions(t),r=E(this,xe).build(this,n),o=r.state.data;return o===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(Cn(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(o))}getQueriesData(t){return E(this,xe).findAll(t).map(({queryKey:n,state:r})=>{const o=r.data;return[n,o]})}setQueryData(t,n,r){const o=this.defaultQueryOptions({queryKey:t}),i=E(this,xe).get(o.queryHash),s=i==null?void 0:i.state.data,a=kh(n,s);if(a!==void 0)return E(this,xe).build(this,o).setData(a,{...r,manual:!0})}setQueriesData(t,n,r){return Le.batch(()=>E(this,xe).findAll(t).map(({queryKey:o})=>[o,this.setQueryData(o,n,r)]))}getQueryState(t){var r;const n=this.defaultQueryOptions({queryKey:t});return(r=E(this,xe).get(n.queryHash))==null?void 0:r.state}removeQueries(t){const n=E(this,xe);Le.batch(()=>{n.findAll(t).forEach(r=>{n.remove(r)})})}resetQueries(t,n){const r=E(this,xe),o={type:"active",...t};return Le.batch(()=>(r.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(o,n)))}cancelQueries(t,n={}){const r={revert:!0,...n},o=Le.batch(()=>E(this,xe).findAll(t).map(i=>i.cancel(r)));return Promise.all(o).then(Ye).catch(Ye)}invalidateQueries(t,n={}){return Le.batch(()=>{if(E(this,xe).findAll(t).forEach(o=>{o.invalidate()}),(t==null?void 0:t.refetchType)==="none")return Promise.resolve();const r={...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"};return this.refetchQueries(r,n)})}refetchQueries(t,n={}){const r={...n,cancelRefetch:n.cancelRefetch??!0},o=Le.batch(()=>E(this,xe).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,r);return r.throwOnError||(s=s.catch(Ye)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(o).then(Ye)}fetchQuery(t){const n=this.defaultQueryOptions(t);n.retry===void 0&&(n.retry=!1);const r=E(this,xe).build(this,n);return r.isStaleByTime(Cn(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Ye).catch(Ye)}fetchInfiniteQuery(t){return t.behavior=ka(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Ye).catch(Ye)}ensureInfiniteQueryData(t){return t.behavior=ka(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return no.isOnline()?E(this,kt).resumePausedMutations():Promise.resolve()}getQueryCache(){return E(this,xe)}getMutationCache(){return E(this,kt)}getDefaultOptions(){return E(this,Vt)}setDefaultOptions(t){q(this,Vt,t)}setQueryDefaults(t,n){E(this,$n).set(pr(t),{queryKey:t,defaultOptions:n})}getQueryDefaults(t){const n=[...E(this,$n).values()],r={};return n.forEach(o=>{mr(t,o.queryKey)&&Object.assign(r,o.defaultOptions)}),r}setMutationDefaults(t,n){E(this,On).set(pr(t),{mutationKey:t,defaultOptions:n})}getMutationDefaults(t){const n=[...E(this,On).values()];let r={};return n.forEach(o=>{mr(t,o.mutationKey)&&(r={...r,...o.defaultOptions})}),r}defaultQueryOptions(t){if(t._defaulted)return t;const n={...E(this,Vt).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return n.queryHash||(n.queryHash=is(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===ss&&(n.enabled=!1),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...E(this,Vt).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){E(this,xe).clear(),E(this,kt).clear()}},xe=new WeakMap,kt=new WeakMap,Vt=new WeakMap,$n=new WeakMap,On=new WeakMap,Nt=new WeakMap,Tn=new WeakMap,Dn=new WeakMap,xu),je,ce,Rr,Ne,on,Ln,Kt,ht,Pr,_n,kn,sn,an,jt,Vn,pe,sr,Pi,Ii,Mi,Fi,Ai,$i,Oi,sc,Cu,Jh=(Cu=class extends Ir{constructor(t,n){super();J(this,pe);J(this,je);J(this,ce);J(this,Rr);J(this,Ne);J(this,on);J(this,Ln);J(this,Kt);J(this,ht);J(this,Pr);J(this,_n);J(this,kn);J(this,sn);J(this,an);J(this,jt);J(this,Vn,new Set);this.options=n,q(this,je,t),q(this,ht,null),q(this,Kt,Ri()),this.options.experimental_prefetchInRender||E(this,Kt).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(E(this,ce).addObserver(this),Na(E(this,ce),this.options)?ue(this,pe,sr).call(this):this.updateResult(),ue(this,pe,Fi).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ti(E(this,ce),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ti(E(this,ce),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ue(this,pe,Ai).call(this),ue(this,pe,$i).call(this),E(this,ce).removeObserver(this)}setOptions(t,n){const r=this.options,o=E(this,ce);if(this.options=E(this,je).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof rt(this.options.enabled,E(this,ce))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ue(this,pe,Oi).call(this),E(this,ce).setOptions(this.options),r._defaulted&&!xi(this.options,r)&&E(this,je).getQueryCache().notify({type:"observerOptionsUpdated",query:E(this,ce),observer:this});const i=this.hasListeners();i&&Ka(E(this,ce),o,this.options,r)&&ue(this,pe,sr).call(this),this.updateResult(n),i&&(E(this,ce)!==o||rt(this.options.enabled,E(this,ce))!==rt(r.enabled,E(this,ce))||Cn(this.options.staleTime,E(this,ce))!==Cn(r.staleTime,E(this,ce)))&&ue(this,pe,Pi).call(this);const s=ue(this,pe,Ii).call(this);i&&(E(this,ce)!==o||rt(this.options.enabled,E(this,ce))!==rt(r.enabled,E(this,ce))||s!==E(this,jt))&&ue(this,pe,Mi).call(this,s)}getOptimisticResult(t){const n=E(this,je).getQueryCache().build(E(this,je),t),r=this.createResult(n,t);return tg(this,r)&&(q(this,Ne,r),q(this,Ln,this.options),q(this,on,E(this,ce).state)),r}getCurrentResult(){return E(this,Ne)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){E(this,Vn).add(t)}getCurrentQuery(){return E(this,ce)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=E(this,je).defaultQueryOptions(t),r=E(this,je).getQueryCache().build(E(this,je),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ue(this,pe,sr).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),E(this,Ne)))}createResult(t,n){var _;const r=E(this,ce),o=this.options,i=E(this,Ne),s=E(this,on),a=E(this,Ln),l=t!==r?t.state:E(this,Rr),{state:c}=t;let d={...c},f=!1,h;if(n._optimisticResults){const T=this.hasListeners(),V=!T&&Na(t,n),N=T&&Ka(t,r,n,o);(V||N)&&(d={...d,...ic(c.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:g,errorUpdatedAt:p,status:v}=d;if(n.select&&d.data!==void 0)if(i&&d.data===(s==null?void 0:s.data)&&n.select===E(this,Pr))h=E(this,_n);else try{q(this,Pr,n.select),h=n.select(d.data),h=Ei(i==null?void 0:i.data,h,n),q(this,_n,h),q(this,ht,null)}catch(T){q(this,ht,T)}else h=d.data;if(n.placeholderData!==void 0&&h===void 0&&v==="pending"){let T;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))T=i.data;else if(T=typeof n.placeholderData=="function"?n.placeholderData((_=E(this,kn))==null?void 0:_.state.data,E(this,kn)):n.placeholderData,n.select&&T!==void 0)try{T=n.select(T),q(this,ht,null)}catch(V){q(this,ht,V)}T!==void 0&&(v="success",h=Ei(i==null?void 0:i.data,T,n),f=!0)}E(this,ht)&&(g=E(this,ht),h=E(this,_n),p=Date.now(),v="error");const w=d.fetchStatus==="fetching",m=v==="pending",y=v==="error",x=m&&w,C=h!==void 0,L={status:v,fetchStatus:d.fetchStatus,isPending:m,isSuccess:v==="success",isError:y,isInitialLoading:x,isLoading:x,data:h,dataUpdatedAt:d.dataUpdatedAt,error:g,errorUpdatedAt:p,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:w,isRefetching:w&&!m,isLoadingError:y&&!C,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:y&&C,isStale:ls(t,n),refetch:this.refetch,promise:E(this,Kt)};if(this.options.experimental_prefetchInRender){const T=z=>{L.status==="error"?z.reject(L.error):L.data!==void 0&&z.resolve(L.data)},V=()=>{const z=q(this,Kt,L.promise=Ri());T(z)},N=E(this,Kt);switch(N.status){case"pending":t.queryHash===r.queryHash&&T(N);break;case"fulfilled":(L.status==="error"||L.data!==N.value)&&V();break;case"rejected":(L.status!=="error"||L.error!==N.reason)&&V();break}}return L}updateResult(t){const n=E(this,Ne),r=this.createResult(E(this,ce),this.options);if(q(this,on,E(this,ce).state),q(this,Ln,this.options),E(this,on).data!==void 0&&q(this,kn,E(this,ce)),xi(r,n))return;q(this,Ne,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!E(this,Vn).size)return!0;const u=new Set(a??E(this,Vn));return this.options.throwOnError&&u.add("error"),Object.keys(E(this,Ne)).some(l=>{const c=l;return E(this,Ne)[c]!==n[c]&&u.has(c)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),ue(this,pe,sc).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ue(this,pe,Fi).call(this)}},je=new WeakMap,ce=new WeakMap,Rr=new WeakMap,Ne=new WeakMap,on=new WeakMap,Ln=new WeakMap,Kt=new WeakMap,ht=new WeakMap,Pr=new WeakMap,_n=new WeakMap,kn=new WeakMap,sn=new WeakMap,an=new WeakMap,jt=new WeakMap,Vn=new WeakMap,pe=new WeakSet,sr=function(t){ue(this,pe,Oi).call(this);let n=E(this,ce).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ye)),n},Pi=function(){ue(this,pe,Ai).call(this);const t=Cn(this.options.staleTime,E(this,ce));if(Kn||E(this,Ne).isStale||!Si(t))return;const r=Zu(E(this,Ne).dataUpdatedAt,t)+1;q(this,sn,setTimeout(()=>{E(this,Ne).isStale||this.updateResult()},r))},Ii=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(E(this,ce)):this.options.refetchInterval)??!1},Mi=function(t){ue(this,pe,$i).call(this),q(this,jt,t),!(Kn||rt(this.options.enabled,E(this,ce))===!1||!Si(E(this,jt))||E(this,jt)===0)&&q(this,an,setInterval(()=>{(this.options.refetchIntervalInBackground||as.isFocused())&&ue(this,pe,sr).call(this)},E(this,jt)))},Fi=function(){ue(this,pe,Pi).call(this),ue(this,pe,Mi).call(this,ue(this,pe,Ii).call(this))},Ai=function(){E(this,sn)&&(clearTimeout(E(this,sn)),q(this,sn,void 0))},$i=function(){E(this,an)&&(clearInterval(E(this,an)),q(this,an,void 0))},Oi=function(){const t=E(this,je).getQueryCache().build(E(this,je),this.options);if(t===E(this,ce))return;const n=E(this,ce);q(this,ce,t),q(this,Rr,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},sc=function(t){Le.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(E(this,Ne))}),E(this,je).getQueryCache().notify({query:E(this,ce),type:"observerResultsUpdated"})})},Cu);function eg(e,t){return rt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Na(e,t){return eg(e,t)||e.state.data!==void 0&&Ti(e,t,t.refetchOnMount)}function Ti(e,t,n){if(rt(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&ls(e,t)}return!1}function Ka(e,t,n,r){return(e!==t||rt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ls(e,n)}function ls(e,t){return rt(t.enabled,e)!==!1&&e.isStaleByTime(Cn(t.staleTime,e))}function tg(e,t){return!xi(e.getCurrentResult(),t)}function ng(e){return e}function rg(e,t,n){var u;if(typeof t!="object"||t===null)return;const r=e.getMutationCache(),o=e.getQueryCache(),i=((u=e.getDefaultOptions().hydrate)==null?void 0:u.deserializeData)??ng,s=t.mutations||[],a=t.queries||[];s.forEach(({state:l,...c})=>{var d,f;r.build(e,{...(d=e.getDefaultOptions().hydrate)==null?void 0:d.mutations,...(f=n==null?void 0:n.defaultOptions)==null?void 0:f.mutations,...c},l)}),a.forEach(({queryKey:l,state:c,queryHash:d,meta:f,promise:h})=>{var v,w;let g=o.get(d);const p=c.data===void 0?c.data:i(c.data);if(g){if(g.state.dataUpdatedAt<c.dataUpdatedAt){const{fetchStatus:m,...y}=c;g.setState({...y,data:p})}}else g=o.build(e,{...(v=e.getDefaultOptions().hydrate)==null?void 0:v.queries,...(w=n==null?void 0:n.defaultOptions)==null?void 0:w.queries,queryKey:l,queryHash:d,meta:f},{...c,data:p,fetchStatus:"idle"});if(h){const m=Promise.resolve(h).then(i);g.fetch(void 0,{initialPromise:m})}})}var og=class extends Zh{constructor(e={}){super(e)}},ac=we(void 0),lc=e=>{const t=me(ac);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t()},ig=e=>(Ke(t=>(t==null||t(),e.client.mount(),e.client.unmount.bind(e.client))),W(()=>e.client.unmount()),b(ac.Provider,{value:()=>e.client,get children(){return e.children}}));function sg(e,t){return typeof e=="function"?e(...t):!!e}var uc=we(()=>!1),ag=()=>me(uc);uc.Provider;function lg(e,t,n,r){if(n===!1)return t;if(typeof n=="function"){const s=n(e.data,t.data);return{...t,data:s}}let o=t.data;if(e.data===void 0)try{o=structuredClone(o)}catch{}const i=Yu(o,{key:n})(e.data);return{...t,data:i}}var ug=(e,t)=>t;function cg(e,t,n){const r=K(()=>lc()),o=ag(),i=K(()=>{const x=r().defaultQueryOptions(e());return x._optimisticResults=o()?"isRestoring":"optimistic",x.structuralSharing=!1,x}),s=i(),[a,u]=B(new t(r(),i()));let l=a().getOptimisticResult(i());const[c,d]=co(l),f=()=>a().subscribe(C=>{l=C,queueMicrotask(()=>{p&&m()})});function h(x){const C=a().options,O=C.reconcile;d(L=>lg(L,x,O===void 0?!1:O,C.queryHash))}function g(){return[()=>c,x=>{const C=cn(c);if(typeof x=="function"&&(x=x(C)),x!=null&&x.hydrationData){const{hydrationData:O,...L}=x;x=L}h(x)}]}let p=null,v=null;const[w,{refetch:m}]=cf(()=>{const x=a();return new Promise((C,O)=>{if(v=C,!p&&!o()&&(p=f()),x.updateResult(),l.isError&&!l.isFetching&&!o()&&sg(x.options.throwOnError,[l.error,x.getCurrentQuery()]))return h(l),O(l.error);if(!l.isLoading)return v=null,C(ug(x.getCurrentQuery(),l));h(l)})},{storage:g,get deferStream(){return e().deferStream},onHydrated(x,C){if(C.value&&"hydrationData"in C.value&&rg(r(),{queries:[{...C.value.hydrationData}]}),p)return;const O={...s};(s.staleTime||!s.initialData)&&C.value&&(O.refetchOnMount=!1),a().setOptions(O),h(a().getOptimisticResult(O)),p=f()}});Mt(Ce(r,x=>{p&&p();const C=new t(x,i());p=f(),u(C)},{defer:!0})),Mt(Ce(o,x=>{x||m()},{defer:!0})),W(()=>{p&&(p(),p=null),v&&(v(l),v=null)}),Mt(Ce([a,i],([x,C])=>{x.setOptions(C),h(x.getOptimisticResult(C)),m()},{defer:!0}));const y={get(x,C){var O,L;return C==="data"?c.data!==void 0?(O=w.latest)==null?void 0:O.data:(L=w())==null?void 0:L.data:Reflect.get(x,C)}};return new Proxy(c,y)}function fo(e,t){return cg(K(()=>e()),Jh)}function dg(e){return(...t)=>{for(const n of e)n&&n(...t)}}var $=e=>typeof e=="function"&&!e.length?e():e,ja=e=>Array.isArray(e)?e:e?[e]:[];function fg(e,...t){return typeof e=="function"?e(...t):e}var hg=W;function gg(e,t,n,r){return e.addEventListener(t,n,r),hg(e.removeEventListener.bind(e,t,n,r))}function pg(e,t,n,r){const o=()=>{ja($(e)).forEach(i=>{i&&ja($(t)).forEach(s=>gg(i,s,n,r))})};typeof e=="function"?U(o):Ke(o)}var mg=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Ba(e){const t={};let n;for(;n=mg.exec(e);)t[n[1]]=n[2];return t}function vt(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=Ba(e)}else typeof t=="string"&&(t=Ba(t));return{...e,...t}}function ve(...e){return dg(e)}function vg(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function Di(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function yg(e){return typeof e=="number"}function bn(e){return Object.prototype.toString.call(e)==="[object String]"}function us(e){return typeof e=="function"}function yt(e){return t=>`${e()}-${t}`}function _e(e,t){return e?e===t||e.contains(t):!1}function ar(e,t=!1){const{activeElement:n}=Ze(e);if(!(n!=null&&n.nodeName))return null;if(dc(n)&&n.contentDocument)return ar(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=Ze(n).getElementById(r);if(o)return o}}return n}function cc(e){return Ze(e).defaultView||window}function Ze(e){return e?e.ownerDocument||e:document}function dc(e){return e.tagName==="IFRAME"}var cs=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(cs||{});function ds(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)==null?void 0:t.platform)||window.navigator.platform):!1}function ho(){return ds(/^Mac/i)}function wg(){return ds(/^iPhone/i)}function bg(){return ds(/^iPad/i)||ho()&&navigator.maxTouchPoints>1}function Sg(){return wg()||bg()}function xg(){return ho()||Sg()}function oe(e,t){return t&&(us(t)?t(e):t[0](t[1],e)),e==null?void 0:e.defaultPrevented}function be(e){return t=>{for(const n of e)oe(t,n)}}function Cg(e){return ho()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Ie(e){if(e)if(Eg())e.focus({preventScroll:!0});else{const t=Rg(e);e.focus(),Pg(t)}}var Vr=null;function Eg(){if(Vr==null){Vr=!1;try{document.createElement("div").focus({get preventScroll(){return Vr=!0,!0}})}catch{}}return Vr}function Rg(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function Pg(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var fc=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],Ig=[...fc,'[tabindex]:not([tabindex="-1"]):not([disabled])'],fs=`${fc.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,Mg=Ig.join(':not([hidden]):not([tabindex="-1"]),');function hc(e,t){const r=Array.from(e.querySelectorAll(fs)).filter(za);return t&&za(e)&&r.unshift(e),r.forEach((o,i)=>{if(dc(o)&&o.contentDocument){const s=o.contentDocument.body,a=hc(s,!1);r.splice(i,1,...a)}}),r}function za(e){return gc(e)&&!Fg(e)}function gc(e){return e.matches(fs)&&hs(e)}function Fg(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function hs(e,t){return e.nodeName!=="#comment"&&Ag(e)&&$g(e,t)&&(!e.parentElement||hs(e.parentElement,e))}function Ag(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:o}=e.ownerDocument.defaultView,{display:i,visibility:s}=o(e);r=i!=="none"&&s!=="hidden"&&s!=="collapse"}return r}function $g(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function Og(e,t,n){const r=t!=null&&t.tabbable?Mg:fs,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){var s;return(s=t==null?void 0:t.from)!=null&&s.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&hs(i)&&(!(t!=null&&t.accept)||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t!=null&&t.from&&(o.currentNode=t.from),o}function Ga(e){let t=e;for(;t&&!Tg(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function Tg(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Dg(){}function Lg(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=i,a=0,u=s-1;a<s;u=a++){const[l,c]=t[a],[d,f]=t[u],[,h]=t[u===0?s-1:u-1]||[0,0],g=(c-f)*(n-l)-(l-d)*(r-c);if(f<c){if(r>=f&&r<c){if(g===0)return!0;g>0&&(r===f?r>h&&(o=!o):o=!o)}}else if(c<f){if(r>c&&r<=f){if(g===0)return!0;g<0&&(r===f?r<h&&(o=!o):o=!o)}}else if(r===c&&(n>=d&&n<=l||n>=l&&n<=d))return!0}return o}function Z(e,t){return A(e,t)}var Yn=new Map,Ha=new Set;function Ua(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Yn.get(n.target);r||(r=new Set,Yn.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Yn.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Yn.delete(n.target)),Yn.size===0)){for(const o of Ha)o();Ha.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?Ua():document.addEventListener("DOMContentLoaded",Ua));function Li(e,t){const n=qa(e,t,"left"),r=qa(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const u=s+e.offsetWidth,l=a+e.offsetHeight;n<=s?s=n:n+o>u&&(s+=n+o-u),r<=a?a=r:r+i>l&&(a+=r+i-l),e.scrollLeft=s,e.scrollTop=a}function qa(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}function _g(e,t){var n,r;if(document.contains(e)){const o=document.scrollingElement||document.documentElement;if(window.getComputedStyle(o).overflow==="hidden"){let s=Ga(e);for(;e&&s&&e!==o&&s!==o;)Li(s,e),e=s,s=Ga(e)}else{const{left:s,top:a}=e.getBoundingClientRect();(n=e==null?void 0:e.scrollIntoView)==null||n.call(e,{block:"nearest"});const{left:u,top:l}=e.getBoundingClientRect();(Math.abs(s-u)>1||Math.abs(a-l)>1)&&((r=e.scrollIntoView)==null||r.call(e,{block:"nearest"}))}}}var pc={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"},vr="data-kb-top-layer",mc,_i=!1,Ft=[];function yr(e){return Ft.findIndex(t=>t.node===e)}function kg(e){return Ft[yr(e)]}function Vg(e){return Ft[Ft.length-1].node===e}function vc(){return Ft.filter(e=>e.isPointerBlocking)}function Ng(){return[...vc()].slice(-1)[0]}function gs(){return vc().length>0}function yc(e){var n;const t=yr((n=Ng())==null?void 0:n.node);return yr(e)<t}function Kg(e){Ft.push(e)}function jg(e){const t=yr(e);t<0||Ft.splice(t,1)}function Bg(){for(const{node:e}of Ft)e.style.pointerEvents=yc(e)?"none":"auto"}function zg(e){if(gs()&&!_i){const t=Ze(e);mc=document.body.style.pointerEvents,t.body.style.pointerEvents="none",_i=!0}}function Gg(e){if(gs())return;const t=Ze(e);t.body.style.pointerEvents=mc,t.body.style.length===0&&t.body.removeAttribute("style"),_i=!1}var ze={layers:Ft,isTopMostLayer:Vg,hasPointerBlockingLayer:gs,isBelowPointerBlockingLayer:yc,addLayer:Kg,removeLayer:jg,indexOf:yr,find:kg,assignPointerEventToLayers:Bg,disableBodyPointerEvents:zg,restoreBodyPointerEvents:Gg};function go(e,t){const[n,r]=B(Wa(t==null?void 0:t()));return U(()=>{var o;r(((o=e())==null?void 0:o.tagName.toLowerCase())||Wa(t==null?void 0:t()))}),n}function Wa(e){return bn(e)?e:void 0}function ae(e){const[t,n]=k(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return b(Lu,A(n,{get component(){return t.as}}))}var Hg=Object.defineProperty,Xt=(e,t)=>{for(var n in t)Hg(e,n,{get:t[n],enumerable:!0})},Ug={};Xt(Ug,{Button:()=>Xg,Root:()=>wt});var qg=["button","color","file","image","reset","submit"];function Wg(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?qg.indexOf(e.type)!==-1:!1}function wt(e){let t;const n=Z({type:"button"},e),[r,o]=k(n,["ref","type","disabled"]),i=go(()=>t,()=>"button"),s=K(()=>{const l=i();return l==null?!1:Wg({tagName:l,type:r.type})}),a=K(()=>i()==="input"),u=K(()=>i()==="a"&&(t==null?void 0:t.getAttribute("href"))!=null);return b(ae,A({as:"button",ref(l){var c=ve(d=>t=d,r.ref);typeof c=="function"&&c(l)},get type(){return s()||a()?r.type:void 0},get role(){return!s()&&!u()?"button":void 0},get tabIndex(){return!s()&&!u()&&!r.disabled?0:void 0},get disabled(){return s()||a()?r.disabled:void 0},get"aria-disabled"(){return!s()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},o))}var Xg=wt;function Be(e){return t=>(e(t),()=>e(void 0))}var Te=e=>typeof e=="function"?e():e,Qg=e=>{const t=K(()=>{const s=Te(e.element);if(s)return getComputedStyle(s)}),n=()=>{var s;return((s=t())==null?void 0:s.animationName)??"none"},[r,o]=B(Te(e.show)?"present":"hidden");let i="none";return U(s=>{const a=Te(e.show);return Me(()=>{var c;if(s===a)return a;const u=i,l=n();a?o("present"):l==="none"||((c=t())==null?void 0:c.display)==="none"?o("hidden"):o(s===!0&&u!==l?"hiding":"hidden")}),a}),U(()=>{const s=Te(e.element);if(!s)return;const a=l=>{l.target===s&&(i=n())},u=l=>{const d=n().includes(l.animationName);l.target===s&&d&&r()==="hiding"&&o("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",u),s.addEventListener("animationend",u),W(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",u),s.removeEventListener("animationend",u)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},Yg=Qg,wr=Yg,Zg={};Xt(Zg,{CloseButton:()=>ps,Description:()=>ms,List:()=>ys,ProgressFill:()=>Sc,ProgressTrack:()=>xc,Region:()=>bs,Root:()=>Ss,Title:()=>xs,Toast:()=>pp,toaster:()=>Cs});var wc=we();function po(){const e=me(wc);if(e===void 0)throw new Error("[kobalte]: `useToastContext` must be used within a `Toast.Root` component");return e}function ps(e){const t=po(),[n,r]=k(e,["aria-label","onClick"]);return b(wt,A({get"aria-label"(){return n["aria-label"]||t.translations().close},onClick:i=>{oe(i,n.onClick),t.close()}},r))}function ms(e){const t=po(),n=Z({id:t.generateId("description")},e),[r,o]=k(n,["id"]);return U(()=>W(t.registerDescriptionId(r.id))),b(ae,A({as:"div",get id(){return r.id}},o))}var bc=we();function vs(){const e=me(bc);if(e===void 0)throw new Error("[kobalte]: `useToastRegionContext` must be used within a `Toast.Region` component");return e}function ys(e){let t;const n=vs(),[r,o]=k(e,["ref","onFocusIn","onFocusOut","onPointerMove","onPointerLeave"]),i=l=>{oe(l,r.onFocusIn),n.pauseOnInteraction()&&!n.isPaused()&&n.pauseAllTimer()},s=l=>{oe(l,r.onFocusOut),_e(t,l.relatedTarget)||n.resumeAllTimer()},a=l=>{oe(l,r.onPointerMove),n.pauseOnInteraction()&&!n.isPaused()&&n.pauseAllTimer()},u=l=>{oe(l,r.onPointerLeave),_e(t,Ze(t).activeElement)||n.resumeAllTimer()};return U(Ce([()=>t,()=>n.hotkey()],([l,c])=>{if(!l)return;const d=Ze(l),f=h=>{c.every(p=>h[p]||h.code===p)&&Ie(l)};d.addEventListener("keydown",f),W(()=>d.removeEventListener("keydown",f))})),U(()=>{if(!n.pauseOnPageIdle())return;const l=cc(t);l.addEventListener("blur",n.pauseAllTimer),l.addEventListener("focus",n.resumeAllTimer),W(()=>{l.removeEventListener("blur",n.pauseAllTimer),l.removeEventListener("focus",n.resumeAllTimer)})}),b(ae,A({as:"ol",ref(l){var c=ve(d=>t=d,r.ref);typeof c=="function"&&c(l)},tabIndex:-1,onFocusIn:i,onFocusOut:s,onPointerMove:a,onPointerLeave:u},o,{get children(){return b(nt,{get each(){return n.toasts()},children:l=>l.toastComponent({get toastId(){return l.id}})})}}))}function Sc(e){const t=vs(),n=po(),[r,o]=k(e,["style"]),[i,s]=B(100);let a=0;return U(()=>{if(t.isPaused()||n.isPersistent())return;const u=setInterval(()=>{const l=new Date().getTime()-n.closeTimerStartTime()+a,c=Math.trunc(100-l/n.duration()*100);s(c<0?0:c)});W(()=>{a+=new Date().getTime()-n.closeTimerStartTime(),clearInterval(u)})}),b(ae,A({as:"div",get style(){return vt({"--kb-toast-progress-fill-width":`${i()}%`},r.style)}},o))}function xc(e){return b(ae,A({as:"div","aria-hidden":"true",role:"presentation"},e))}var[ws,Mr]=co({toasts:[]});function Jg(e){Mr("toasts",t=>[...t,e])}function ep(e){return ws.toasts.find(t=>t.id===e)}function tp(e,t){const n=ws.toasts.findIndex(r=>r.id===e);n!==-1&&Mr("toasts",r=>[...r.slice(0,n),t,...r.slice(n+1)])}function np(e){Mr("toasts",t=>t.id===e,"dismiss",!0)}function rp(e){Mr("toasts",t=>t.filter(n=>n.id!==e))}function op(){Mr("toasts",[])}var dn={toasts:()=>ws.toasts,add:Jg,get:ep,update:tp,dismiss:np,remove:rp,clear:op},Xa="{hotkey}",ip={close:"Close"},sp={notifications:e=>`Notifications (${e})`};function bs(e){const t=Z({id:`toast-region-${Ee()}`,hotkey:["altKey","KeyT"],duration:5e3,limit:3,swipeDirection:"right",swipeThreshold:50,pauseOnInteraction:!0,pauseOnPageIdle:!0,topLayer:!0,translations:sp},e),[n,r]=k(t,["translations","style","hotkey","duration","limit","swipeDirection","swipeThreshold","pauseOnInteraction","pauseOnPageIdle","topLayer","aria-label","regionId"]),o=K(()=>dn.toasts().filter(f=>f.region===n.regionId&&f.dismiss===!1).slice(0,n.limit)),[i,s]=B(!1),a=()=>o().length>0,u=()=>n.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,""),l=()=>(n["aria-label"]||n.translations.notifications(Xa)).replace(Xa,u()),c=()=>({[vr]:n.topLayer?"":void 0}),d={isPaused:i,toasts:o,hotkey:()=>n.hotkey,duration:()=>n.duration,swipeDirection:()=>n.swipeDirection,swipeThreshold:()=>n.swipeThreshold,pauseOnInteraction:()=>n.pauseOnInteraction,pauseOnPageIdle:()=>n.pauseOnPageIdle,pauseAllTimer:()=>s(!0),resumeAllTimer:()=>s(!1),generateId:yt(()=>r.id)};return b(bc.Provider,{value:d,get children(){return b(ae,A({as:"div",role:"region",tabIndex:-1,get"aria-label"(){return l()},get style(){return vt({"pointer-events":a()?n.topLayer?"auto":void 0:"none"},n.style)}},c,r))}})}var ap="toast.swipeStart",lp="toast.swipeMove",up="toast.swipeCancel",cp="toast.swipeEnd";function Ss(e){const t=vs(),n=Z({id:`toast-${Ee()}`,priority:"high",translations:ip},e),[r,o]=k(n,["ref","translations","toastId","style","priority","duration","persistent","onPause","onResume","onSwipeStart","onSwipeMove","onSwipeCancel","onSwipeEnd","onEscapeKeyDown","onKeyDown","onPointerDown","onPointerMove","onPointerUp"]),[i,s]=B(!0),[a,u]=B(),[l,c]=B(),[d,f]=B(!0),[h,g]=B(),{present:p}=wr({show:i,element:()=>h()??null}),v=K(()=>r.duration||t.duration());let w,m=0,y=v(),x=null,C=null;const O=()=>{s(!1),f(!0)},L=()=>{dn.remove(r.toastId)},_=S=>{!S||r.persistent||(window.clearTimeout(w),m=new Date().getTime(),w=window.setTimeout(O,S))},T=()=>{var S;_(y),(S=r.onResume)==null||S.call(r)},V=()=>{var I;const S=new Date().getTime()-m;y=y-S,window.clearTimeout(w),(I=r.onPause)==null||I.call(r)},N=S=>{var I;oe(S,r.onKeyDown),S.key==="Escape"&&((I=r.onEscapeKeyDown)==null||I.call(r,S),S.defaultPrevented||O())},z=S=>{oe(S,r.onPointerDown),S.button===0&&(x={x:S.clientX,y:S.clientY})},ie=S=>{if(oe(S,r.onPointerMove),!x)return;const I=S.clientX-x.x,M=S.clientY-x.y,F=!!C,D=["left","right"].includes(t.swipeDirection()),j=["left","up"].includes(t.swipeDirection())?Math.min:Math.max,H=D?j(0,I):0,X=D?0:j(0,M),le=S.pointerType==="touch"?10:2,ne={x:H,y:X},Ae={originalEvent:S,delta:ne};if(F){C=ne,Nr(lp,r.onSwipeMove,Ae);const{x:Je,y:te}=ne;S.currentTarget.setAttribute("data-swipe","move"),S.currentTarget.style.setProperty("--kb-toast-swipe-move-x",`${Je}px`),S.currentTarget.style.setProperty("--kb-toast-swipe-move-y",`${te}px`)}else Qa(ne,t.swipeDirection(),le)?(C=ne,Nr(ap,r.onSwipeStart,Ae),S.currentTarget.setAttribute("data-swipe","start"),S.target.setPointerCapture(S.pointerId)):(Math.abs(I)>le||Math.abs(M)>le)&&(x=null)},P=S=>{oe(S,r.onPointerUp);const I=C,M=S.target;if(M.hasPointerCapture(S.pointerId)&&M.releasePointerCapture(S.pointerId),C=null,x=null,I){const F=S.currentTarget,D={originalEvent:S,delta:I};if(Qa(I,t.swipeDirection(),t.swipeThreshold())){Nr(cp,r.onSwipeEnd,D);const{x:j,y:H}=I;S.currentTarget.setAttribute("data-swipe","end"),S.currentTarget.style.removeProperty("--kb-toast-swipe-move-x"),S.currentTarget.style.removeProperty("--kb-toast-swipe-move-y"),S.currentTarget.style.setProperty("--kb-toast-swipe-end-x",`${j}px`),S.currentTarget.style.setProperty("--kb-toast-swipe-end-y",`${H}px`),O()}else Nr(up,r.onSwipeCancel,D),S.currentTarget.setAttribute("data-swipe","cancel"),S.currentTarget.style.removeProperty("--kb-toast-swipe-move-x"),S.currentTarget.style.removeProperty("--kb-toast-swipe-move-y"),S.currentTarget.style.removeProperty("--kb-toast-swipe-end-x"),S.currentTarget.style.removeProperty("--kb-toast-swipe-end-y");F.addEventListener("click",j=>j.preventDefault(),{once:!0})}};Bn(()=>{t.toasts().find(S=>S.id===r.toastId&&S.update)&&f(!1)}),U(Ce(()=>t.isPaused(),S=>{S?V():T()},{defer:!0})),U(Ce([i,v],([S,I])=>{S&&!t.isPaused()&&_(I)})),U(Ce(()=>{var S;return(S=dn.get(r.toastId))==null?void 0:S.dismiss},S=>S&&O())),U(Ce(()=>p(),S=>!S&&L()));const R={translations:()=>r.translations,close:O,duration:v,isPersistent:()=>r.persistent??!1,closeTimerStartTime:()=>m,generateId:yt(()=>o.id),registerTitleId:Be(u),registerDescriptionId:Be(c)};return b(Se,{get when(){return p()},get children(){return b(wc.Provider,{value:R,get children(){return b(ae,A({as:"li",ref(S){var I=ve(g,r.ref);typeof I=="function"&&I(S)},role:"status",tabIndex:0,get style(){return vt({animation:d()?void 0:"none","user-select":"none","touch-action":"none"},r.style)},get"aria-live"(){return r.priority==="high"?"assertive":"polite"},"aria-atomic":"true",get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},get"data-opened"(){return i()?"":void 0},get"data-closed"(){return i()?void 0:""},get"data-swipe-direction"(){return t.swipeDirection()},onKeyDown:N,onPointerDown:z,onPointerMove:ie,onPointerUp:P},o))}})}})}function Qa(e,t,n=0){const r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return t==="left"||t==="right"?i&&r>n:!i&&o>n}function Nr(e,t,n){const r=n.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),r.dispatchEvent(o)}function xs(e){const t=po(),n=Z({id:t.generateId("title")},e),[r,o]=k(n,["id"]);return U(()=>W(t.registerTitleId(r.id))),b(ae,A({as:"div",get id(){return r.id}},o))}var dp=0;function Cc(e,t){const n=dp++;return dn.add({id:n,toastComponent:e,dismiss:!1,update:!1,region:t==null?void 0:t.region}),n}function ki(e,t){dn.update(e,{id:e,toastComponent:t,dismiss:!1,update:!0})}function fp(e,t,n){const r=Cc(o=>t({get toastId(){return o.toastId},state:"pending"}),n);return(us(e)?e():e).then(o=>ki(r,i=>t({get toastId(){return i.toastId},state:"fulfilled",data:o}))).catch(o=>ki(r,i=>t({get toastId(){return i.toastId},state:"rejected",error:o}))),r}function hp(e){return dn.dismiss(e),e}function gp(){dn.clear()}var Cs={show:Cc,update:ki,promise:fp,dismiss:hp,clear:gp},pp=Object.assign(Ss,{CloseButton:ps,Description:ms,List:ys,ProgressFill:Sc,ProgressTrack:xc,Region:bs,Title:xs,toaster:Cs});function Ec(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Ec(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function mp(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Ec(e))&&(r&&(r+=" "),r+=t);return r}const Ya=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Za=mp,Fr=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Za(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(l=>{const c=n==null?void 0:n[l],d=i==null?void 0:i[l];if(c===null)return null;const f=Ya(c)||Ya(d);return o[l][f]}),a=n&&Object.entries(n).reduce((l,c)=>{let[d,f]=c;return f===void 0||(l[d]=f),l},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((l,c)=>{let{class:d,className:f,...h}=c;return Object.entries(h).every(g=>{let[p,v]=g;return Array.isArray(v)?v.includes({...i,...a}[p]):{...i,...a}[p]===v})?[...l,d,f]:l},[]);return Za(e,s,u,n==null?void 0:n.class,n==null?void 0:n.className)};function Rc(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Rc(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function vp(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Rc(e))&&(r&&(r+=" "),r+=t);return r}const Es="-",yp=e=>{const t=bp(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(Es);return a[0]===""&&a.length!==1&&a.shift(),Pc(a,t)||wp(s)},getConflictingClassGroupIds:(s,a)=>{const u=n[s]||[];return a&&r[s]?[...u,...r[s]]:u}}},Pc=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Pc(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Es);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId},Ja=/^\[(.+)\]$/,wp=e=>{if(Ja.test(e)){const t=Ja.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},bp=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return xp(Object.entries(e.classGroups),n).forEach(([i,s])=>{Vi(s,r,i,t)}),r},Vi=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:el(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(Sp(o)){Vi(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{Vi(s,el(t,i),n,r)})})},el=(e,t)=>{let n=e;return t.split(Es).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Sp=e=>e.isThemeGetter,xp=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e,Cp=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},Ic="!",Ep=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const u=[];let l=0,c=0,d;for(let v=0;v<a.length;v++){let w=a[v];if(l===0){if(w===o&&(r||a.slice(v,v+i)===t)){u.push(a.slice(c,v)),c=v+i;continue}if(w==="/"){d=v;continue}}w==="["?l++:w==="]"&&l--}const f=u.length===0?a:a.substring(c),h=f.startsWith(Ic),g=h?f.substring(1):f,p=d&&d>c?d-c:void 0;return{modifiers:u,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:s}):s},Rp=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Pp=e=>({cache:Cp(e.cacheSize),parseClassName:Ep(e),...yp(e)}),Ip=/\s+/,Mp=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(Ip);let a="";for(let u=s.length-1;u>=0;u-=1){const l=s[u],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=n(l);let g=!!h,p=r(g?f.substring(0,h):f);if(!p){if(!g){a=l+(a.length>0?" "+a:a);continue}if(p=r(f),!p){a=l+(a.length>0?" "+a:a);continue}g=!1}const v=Rp(c).join(":"),w=d?v+Ic:v,m=w+p;if(i.includes(m))continue;i.push(m);const y=o(p,g);for(let x=0;x<y.length;++x){const C=y[x];i.push(w+C)}a=l+(a.length>0?" "+a:a)}return a};function Fp(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Mc(t))&&(r&&(r+=" "),r+=n);return r}const Mc=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Mc(e[r]))&&(n&&(n+=" "),n+=t);return n};function Ap(e,...t){let n,r,o,i=s;function s(u){const l=t.reduce((c,d)=>d(c),e());return n=Pp(l),r=n.cache.get,o=n.cache.set,i=a,a(u)}function a(u){const l=r(u);if(l)return l;const c=Mp(u,n);return o(u,c),c}return function(){return i(Fp.apply(null,arguments))}}const ye=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Fc=/^\[(?:([a-z-]+):)?(.+)\]$/i,$p=/^\d+\/\d+$/,Op=new Set(["px","full","screen"]),Tp=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Dp=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Lp=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,_p=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kp=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xt=e=>En(e)||Op.has(e)||$p.test(e),Ot=e=>Gn(e,"length",Hp),En=e=>!!e&&!Number.isNaN(Number(e)),To=e=>Gn(e,"number",En),Zn=e=>!!e&&Number.isInteger(Number(e)),Vp=e=>e.endsWith("%")&&En(e.slice(0,-1)),re=e=>Fc.test(e),Tt=e=>Tp.test(e),Np=new Set(["length","size","percentage"]),Kp=e=>Gn(e,Np,Ac),jp=e=>Gn(e,"position",Ac),Bp=new Set(["image","url"]),zp=e=>Gn(e,Bp,qp),Gp=e=>Gn(e,"",Up),Jn=()=>!0,Gn=(e,t,n)=>{const r=Fc.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Hp=e=>Dp.test(e)&&!Lp.test(e),Ac=()=>!1,Up=e=>_p.test(e),qp=e=>kp.test(e),Wp=()=>{const e=ye("colors"),t=ye("spacing"),n=ye("blur"),r=ye("brightness"),o=ye("borderColor"),i=ye("borderRadius"),s=ye("borderSpacing"),a=ye("borderWidth"),u=ye("contrast"),l=ye("grayscale"),c=ye("hueRotate"),d=ye("invert"),f=ye("gap"),h=ye("gradientColorStops"),g=ye("gradientColorStopPositions"),p=ye("inset"),v=ye("margin"),w=ye("opacity"),m=ye("padding"),y=ye("saturate"),x=ye("scale"),C=ye("sepia"),O=ye("skew"),L=ye("space"),_=ye("translate"),T=()=>["auto","contain","none"],V=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",re,t],z=()=>[re,t],ie=()=>["",xt,Ot],P=()=>["auto",En,re],R=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],S=()=>["solid","dashed","dotted","double","none"],I=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",re],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>[En,re];return{cacheSize:500,separator:":",theme:{colors:[Jn],spacing:[xt,Ot],blur:["none","",Tt,re],brightness:j(),borderColor:[e],borderRadius:["none","","full",Tt,re],borderSpacing:z(),borderWidth:ie(),contrast:j(),grayscale:F(),hueRotate:j(),invert:F(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[Vp,Ot],inset:N(),margin:N(),opacity:j(),padding:z(),saturate:j(),scale:j(),sepia:F(),skew:j(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",re]}],container:["container"],columns:[{columns:[Tt]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...R(),re]}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Zn,re]}],basis:[{basis:N()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",re]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",Zn,re]}],"grid-cols":[{"grid-cols":[Jn]}],"col-start-end":[{col:["auto",{span:["full",Zn,re]},re]}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":[Jn]}],"row-start-end":[{row:["auto",{span:[Zn,re]},re]}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",re]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",re]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[m]}],px:[{px:[m]}],py:[{py:[m]}],ps:[{ps:[m]}],pe:[{pe:[m]}],pt:[{pt:[m]}],pr:[{pr:[m]}],pb:[{pb:[m]}],pl:[{pl:[m]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[L]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[L]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",re,t]}],"min-w":[{"min-w":[re,t,"min","max","fit"]}],"max-w":[{"max-w":[re,t,"none","full","min","max","fit","prose",{screen:[Tt]},Tt]}],h:[{h:[re,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[re,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[re,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[re,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Tt,Ot]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",To]}],"font-family":[{font:[Jn]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",re]}],"line-clamp":[{"line-clamp":["none",En,To]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",xt,re]}],"list-image":[{"list-image":["none",re]}],"list-style-type":[{list:["none","disc","decimal",re]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...S(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",xt,Ot]}],"underline-offset":[{"underline-offset":["auto",xt,re]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",re]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...R(),jp]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Kp]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},zp]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...S(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:S()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...S()]}],"outline-offset":[{"outline-offset":[xt,re]}],"outline-w":[{outline:[xt,Ot]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[xt,Ot]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Tt,Gp]}],"shadow-color":[{shadow:[Jn]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...I(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":I()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Tt,re]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",re]}],duration:[{duration:j()}],ease:[{ease:["linear","in","out","in-out",re]}],delay:[{delay:j()}],animate:[{animate:["none","spin","ping","pulse","bounce",re]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Zn,re]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",re]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",re]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",re]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[xt,Ot,To]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Xp=Ap(Wp);function de(...e){return Xp(vp(e))}var Qp=he('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><path d="M18 6l-12 12"></path><path d="M6 6l12 12">'),Yp=he('<div class="grid gap-1">');const Zp=Fr("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--kb-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--kb-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[opened]:animate-in data-[closed]:animate-out data-[swipe=end]:animate-out data-[closed]:fade-out-80 data-[closed]:slide-out-to-right-full data-[opened]:slide-in-from-top-full data-[opened]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground",success:"success border-success-foreground bg-success text-success-foreground",warning:"warning border-warning-foreground bg-warning text-warning-foreground",error:"error border-error-foreground bg-error text-error-foreground"}},defaultVariants:{variant:"default"}}),Jp=e=>{const[t,n]=k(e,["class"]);return b(rs,{get children(){return b(bs,{get children(){return b(ys,A({get class(){return de("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse gap-2 p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t.class)}},n))}})}})},em=e=>{const[t,n]=k(e,["class","variant"]);return b(Ss,A({get class(){return de(Zp({variant:t.variant}),t.class)}},n))},tm=e=>{const[t,n]=k(e,["class"]);return b(ps,A({get class(){return de("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-destructive-foreground group-[.error]:text-error-foreground group-[.success]:text-success-foreground group-[.warning]:text-warning-foreground",t.class)}},n,{get children(){return Qp()}}))},nm=e=>{const[t,n]=k(e,["class"]);return b(xs,A({get class(){return de("text-sm font-semibold",t.class)}},n))},rm=e=>{const[t,n]=k(e,["class"]);return b(ms,A({get class(){return de("text-sm opacity-90",t.class)}},n))};function tl(e){Cs.show(t=>b(em,{get toastId(){return t.toastId},get variant(){return e.variant},get duration(){return e.duration},get children(){return[(()=>{var n=Yp();return fe(n,(()=>{var r=K(()=>!!e.title);return()=>r()&&b(nm,{get children(){return e.title}})})(),null),fe(n,(()=>{var r=K(()=>!!e.description);return()=>r()&&b(rm,{get children(){return e.description}})})(),null),n})(),b(tm,{})]}}))}var Do="focusScope.autoFocusOnMount",Lo="focusScope.autoFocusOnUnmount",nl={bubbles:!1,cancelable:!0},rl={stack:[],active(){return this.stack[0]},add(e){var t;e!==this.active()&&((t=this.active())==null||t.pause()),this.stack=Di(this.stack,e),this.stack.unshift(e)},remove(e){var t;this.stack=Di(this.stack,e),(t=this.active())==null||t.resume()}};function $c(e,t){const[n,r]=B(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=g=>{var p;return(p=e.onMountAutoFocus)==null?void 0:p.call(e,g)},a=g=>{var p;return(p=e.onUnmountAutoFocus)==null?void 0:p.call(e,g)},u=()=>Ze(t()),l=()=>{const g=u().createElement("span");return g.setAttribute("data-focus-trap",""),g.tabIndex=0,Object.assign(g.style,pc),g},c=()=>{const g=t();return g?hc(g,!0).filter(p=>!p.hasAttribute("data-focus-trap")):[]},d=()=>{const g=c();return g.length>0?g[0]:null},f=()=>{const g=c();return g.length>0?g[g.length-1]:null},h=()=>{const g=t();if(!g)return!1;const p=ar(g);return!p||_e(g,p)?!1:gc(p)};U(()=>{const g=t();if(!g)return;rl.add(o);const p=ar(g);if(!_e(g,p)){const w=new CustomEvent(Do,nl);g.addEventListener(Do,s),g.dispatchEvent(w),w.defaultPrevented||setTimeout(()=>{Ie(d()),ar(g)===p&&Ie(g)},0)}W(()=>{g.removeEventListener(Do,s),setTimeout(()=>{const w=new CustomEvent(Lo,nl);h()&&w.preventDefault(),g.addEventListener(Lo,a),g.dispatchEvent(w),w.defaultPrevented||Ie(p??u().body),g.removeEventListener(Lo,a),rl.remove(o)},0)})}),U(()=>{const g=t();if(!g||!$(e.trapFocus)||n())return;const p=w=>{const m=w.target;m!=null&&m.closest(`[${vr}]`)||(_e(g,m)?i=m:Ie(i))},v=w=>{const y=w.relatedTarget??ar(g);y!=null&&y.closest(`[${vr}]`)||_e(g,y)||Ie(i)};u().addEventListener("focusin",p),u().addEventListener("focusout",v),W(()=>{u().removeEventListener("focusin",p),u().removeEventListener("focusout",v)})}),U(()=>{const g=t();if(!g||!$(e.trapFocus)||n())return;const p=l();g.insertAdjacentElement("afterbegin",p);const v=l();g.insertAdjacentElement("beforeend",v);function w(y){const x=d(),C=f();y.relatedTarget===x?Ie(C):Ie(x)}p.addEventListener("focusin",w),v.addEventListener("focusin",w);const m=new MutationObserver(y=>{for(const x of y)x.previousSibling===v&&(v.remove(),g.insertAdjacentElement("beforeend",v)),x.nextSibling===p&&(p.remove(),g.insertAdjacentElement("afterbegin",p))});m.observe(g,{childList:!0,subtree:!1}),W(()=>{p.removeEventListener("focusin",w),v.removeEventListener("focusin",w),p.remove(),v.remove(),m.disconnect()})})}var om="data-live-announcer";function Oc(e){U(()=>{$(e.isDisabled)||W(im($(e.targets),$(e.root)))})}var er=new WeakMap,We=[];function im(e,t=document.body){const n=new Set(e),r=new Set,o=u=>{for(const f of u.querySelectorAll(`[${om}], [${vr}]`))n.add(f);const l=f=>{if(n.has(f)||f.parentElement&&r.has(f.parentElement)&&f.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const h of n)if(f.contains(h))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},c=document.createTreeWalker(u,NodeFilter.SHOW_ELEMENT,{acceptNode:l}),d=l(u);if(d===NodeFilter.FILTER_ACCEPT&&i(u),d!==NodeFilter.FILTER_REJECT){let f=c.nextNode();for(;f!=null;)i(f),f=c.nextNode()}},i=u=>{const l=er.get(u)??0;u.getAttribute("aria-hidden")==="true"&&l===0||(l===0&&u.setAttribute("aria-hidden","true"),r.add(u),er.set(u,l+1))};We.length&&We[We.length-1].disconnect(),o(t);const s=new MutationObserver(u=>{for(const l of u)if(!(l.type!=="childList"||l.addedNodes.length===0)&&![...n,...r].some(c=>c.contains(l.target))){for(const c of l.removedNodes)c instanceof Element&&(n.delete(c),r.delete(c));for(const c of l.addedNodes)(c instanceof HTMLElement||c instanceof SVGElement)&&(c.dataset.liveAnnouncer==="true"||c.dataset.reactAriaTopLayer==="true")?n.add(c):c instanceof Element&&o(c)}});s.observe(t,{childList:!0,subtree:!0});const a={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return We.push(a),()=>{s.disconnect();for(const u of r){const l=er.get(u);if(l==null)return;l===1?(u.removeAttribute("aria-hidden"),er.delete(u)):er.set(u,l-1)}a===We[We.length-1]?(We.pop(),We.length&&We[We.length-1].observe()):We.splice(We.indexOf(a),1)}}function sm(e){const t=n=>{var r;n.key===cs.Escape&&((r=e.onEscapeKeyDown)==null||r.call(e,n))};U(()=>{var r;if($(e.isDisabled))return;const n=((r=e.ownerDocument)==null?void 0:r.call(e))??Ze();n.addEventListener("keydown",t),W(()=>{n.removeEventListener("keydown",t)})})}var ol="interactOutside.pointerDownOutside",il="interactOutside.focusOutside";function Tc(e,t){let n,r=Dg;const o=()=>Ze(t()),i=d=>{var f;return(f=e.onPointerDownOutside)==null?void 0:f.call(e,d)},s=d=>{var f;return(f=e.onFocusOutside)==null?void 0:f.call(e,d)},a=d=>{var f;return(f=e.onInteractOutside)==null?void 0:f.call(e,d)},u=d=>{var h;const f=d.target;return!(f instanceof HTMLElement)||f.closest(`[${vr}]`)||!_e(o(),f)||_e(t(),f)?!1:!((h=e.shouldExcludeElement)!=null&&h.call(e,f))},l=d=>{function f(){const h=t(),g=d.target;if(!h||!g||!u(d))return;const p=be([i,a]);g.addEventListener(ol,p,{once:!0});const v=new CustomEvent(ol,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||Cg(d)&&d.button===0}});g.dispatchEvent(v)}d.pointerType==="touch"?(o().removeEventListener("click",f),r=f,o().addEventListener("click",f,{once:!0})):f()},c=d=>{const f=t(),h=d.target;if(!f||!h||!u(d))return;const g=be([s,a]);h.addEventListener(il,g,{once:!0});const p=new CustomEvent(il,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});h.dispatchEvent(p)};U(()=>{$(e.isDisabled)||(n=window.setTimeout(()=>{o().addEventListener("pointerdown",l,!0)},0),o().addEventListener("focusin",c,!0),W(()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",l,!0),o().removeEventListener("focusin",c,!0)}))})}var Dc=we();function am(){return me(Dc)}function Rs(e){let t;const n=am(),[r,o]=k(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]),s=d=>{i.add(d);const f=n==null?void 0:n.registerNestedLayer(d);return()=>{i.delete(d),f==null||f()}};Tc({shouldExcludeElement:d=>{var f;return t?((f=r.excludedElements)==null?void 0:f.some(h=>_e(h(),d)))||[...i].some(h=>_e(h,d)):!1},onPointerDownOutside:d=>{var f,h,g;!t||ze.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!ze.isTopMostLayer(t)||((f=r.onPointerDownOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(g=r.onDismiss)==null||g.call(r))},onFocusOutside:d=>{var f,h,g;(f=r.onFocusOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(g=r.onDismiss)==null||g.call(r)}},()=>t),sm({ownerDocument:()=>Ze(t),onEscapeKeyDown:d=>{var f;!t||!ze.isTopMostLayer(t)||((f=r.onEscapeKeyDown)==null||f.call(r,d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),Bn(()=>{if(!t)return;ze.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n==null?void 0:n.registerNestedLayer(t);ze.assignPointerEventToLayers(),ze.disableBodyPointerEvents(t),W(()=>{t&&(ze.removeLayer(t),d==null||d(),ze.assignPointerEventToLayers(),ze.restoreBodyPointerEvents(t))})}),U(Ce([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const h=ze.find(d);h&&h.isPointerBlocking!==f&&(h.isPointerBlocking=f,ze.assignPointerEventToLayers()),f&&ze.disableBodyPointerEvents(d),W(()=>{ze.restoreBodyPointerEvents(d)})},{defer:!0}));const c={registerNestedLayer:s};return b(Dc.Provider,{value:c,get children(){return b(ae,A({as:"div",ref(d){var f=ve(h=>t=h,r.ref);typeof f=="function"&&f(d)}},o))}})}function pt(e){var s;const[t,n]=B((s=e.defaultValue)==null?void 0:s.call(e)),r=K(()=>{var a;return((a=e.value)==null?void 0:a.call(e))!==void 0}),o=K(()=>{var a;return r()?(a=e.value)==null?void 0:a.call(e):t()});return[o,a=>{Me(()=>{var l;const u=fg(a,o());return Object.is(u,o())||(r()||n(u),(l=e.onChange)==null||l.call(e,u)),u})}]}function Lc(e){const[t,n]=pt(e);return[()=>t()??!1,n]}function lm(e){const[t,n]=pt(e);return[()=>t()??[],n]}function Ps(e={}){const[t,n]=Lc({value:()=>$(e.open),defaultValue:()=>!!$(e.defaultOpen),onChange:s=>{var a;return(a=e.onOpenChange)==null?void 0:a.call(e,s)}}),r=()=>{n(!0)},o=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:o,toggle:()=>{t()?o():r()}}}var Ni=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},Kr=new Map,um=e=>{U(()=>{const t=Te(e.style)??{},n=Te(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=Kr.get(e.key);o?o.activeCount++:Kr.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(i=>i.key)}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);W(()=>{var s;const i=Kr.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}Kr.delete(e.key);for(const[a,u]of Object.entries(i.originalStyles))e.element.style[a]=u;for(const a of i.properties)e.element.style.removeProperty(a);e.element.style.length===0&&e.element.removeAttribute("style"),(s=e.cleanup)==null||s.call(e)}})})},sl=um,cm=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},dm=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},fm=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,i=0,s=0,a=!1;do{const[u,l,c]=cm(o,t),d=c-u-r*l;(l!==0||d!==0)&&dm(o,t)&&(i+=d,s+=l),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},[al,ll]=B([]),hm=e=>al().indexOf(e)===al().length-1,gm=e=>{const t=A({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Ee();let r=[0,0],o=null,i=null;U(()=>{Te(t.enabled)&&(ll(l=>[...l,n]),W(()=>{ll(l=>l.filter(c=>c!==n))}))}),U(()=>{if(!Te(t.enabled)||!Te(t.hideScrollbar))return;const{body:l}=document,c=window.innerWidth-l.offsetWidth;if(Te(t.preventScrollbarShift)){const d={overflow:"hidden"},f=[];c>0&&(Te(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(l).paddingRight} + ${c}px)`:d.marginRight=`calc(${window.getComputedStyle(l).marginRight} + ${c}px)`,f.push({key:"--scrollbar-width",value:`${c}px`}));const h=window.scrollY,g=window.scrollX;sl({key:"prevent-scroll",element:l,style:d,properties:f,cleanup:()=>{Te(t.restoreScrollPosition)&&c>0&&window.scrollTo(g,h)}})}else sl({key:"prevent-scroll",element:l,style:{overflow:"hidden"}})}),U(()=>{!hm(n)||!Te(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",u,{passive:!1}),W(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",u)}))});const s=l=>{r=ul(l),o=null,i=null},a=l=>{const c=l.target,d=Te(t.element),f=pm(l),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",g=h==="x"?f[0]:f[1],p=cl(c,h,g,d);let v;d&&Ni(d,c)?v=!p:v=!0,v&&l.cancelable&&l.preventDefault()},u=l=>{const c=Te(t.element),d=l.target;let f;if(l.touches.length===2)f=!Te(t.allowPinchZoom);else{if(o==null||i===null){const h=ul(l).map((p,v)=>r[v]-p),g=Math.abs(h[0])>Math.abs(h[1])?"x":"y";o=g,i=g==="x"?h[0]:h[1]}if(d.type==="range")f=!1;else{const h=cl(d,o,i,c);c&&Ni(c,d)?f=!h:f=!0}}f&&l.cancelable&&l.preventDefault()}},pm=e=>[e.deltaX,e.deltaY],ul=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],cl=(e,t,n,r)=>{const o=r!==null&&Ni(r,e),[i,s]=fm(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(s)<1)},mm=gm,_c=mm,vm={};Xt(vm,{CloseButton:()=>Is,Content:()=>Ms,Description:()=>Fs,Dialog:()=>ym,Overlay:()=>As,Portal:()=>$s,Root:()=>Os,Title:()=>Ts,Trigger:()=>Vc});var kc=we();function pn(){const e=me(kc);if(e===void 0)throw new Error("[kobalte]: `useDialogContext` must be used within a `Dialog` component");return e}function Is(e){const t=pn(),[n,r]=k(e,["aria-label","onClick"]);return b(wt,A({get"aria-label"(){return n["aria-label"]||t.translations().dismiss},onClick:i=>{oe(i,n.onClick),t.close()}},r))}function Ms(e){let t;const n=pn(),r=Z({id:n.generateId("content")},e),[o,i]=k(r,["ref","onOpenAutoFocus","onCloseAutoFocus","onPointerDownOutside","onFocusOutside","onInteractOutside"]);let s=!1,a=!1;const u=f=>{var h;(h=o.onPointerDownOutside)==null||h.call(o,f),n.modal()&&f.detail.isContextMenu&&f.preventDefault()},l=f=>{var h;(h=o.onFocusOutside)==null||h.call(o,f),n.modal()&&f.preventDefault()},c=f=>{var h;(h=o.onInteractOutside)==null||h.call(o,f),!n.modal()&&(f.defaultPrevented||(s=!0,f.detail.originalEvent.type==="pointerdown"&&(a=!0)),_e(n.triggerRef(),f.target)&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&a&&f.preventDefault())},d=f=>{var h;(h=o.onCloseAutoFocus)==null||h.call(o,f),n.modal()?(f.preventDefault(),Ie(n.triggerRef())):(f.defaultPrevented||(s||Ie(n.triggerRef()),f.preventDefault()),s=!1,a=!1)};return Oc({isDisabled:()=>!(n.isOpen()&&n.modal()),targets:()=>t?[t]:[]}),_c({element:()=>t??null,enabled:()=>n.contentPresent()&&n.preventScroll()}),$c({trapFocus:()=>n.isOpen()&&n.modal(),onMountAutoFocus:o.onOpenAutoFocus,onUnmountAutoFocus:d},()=>t),U(()=>W(n.registerContentId(i.id))),b(Se,{get when(){return n.contentPresent()},get children(){return b(Rs,A({ref(f){var h=ve(g=>{n.setContentRef(g),t=g},o.ref);typeof h=="function"&&h(f)},role:"dialog",tabIndex:-1,get disableOutsidePointerEvents(){return K(()=>!!n.modal())()&&n.isOpen()},get excludedElements(){return[n.triggerRef]},get"aria-labelledby"(){return n.titleId()},get"aria-describedby"(){return n.descriptionId()},get"data-expanded"(){return n.isOpen()?"":void 0},get"data-closed"(){return n.isOpen()?void 0:""},onPointerDownOutside:u,onFocusOutside:l,onInteractOutside:c,get onDismiss(){return n.close}},i))}})}function Fs(e){const t=pn(),n=Z({id:t.generateId("description")},e),[r,o]=k(n,["id"]);return U(()=>W(t.registerDescriptionId(r.id))),b(ae,A({as:"p",get id(){return r.id}},o))}function As(e){const t=pn(),[n,r]=k(e,["ref","style","onPointerDown"]),o=i=>{oe(i,n.onPointerDown),i.target===i.currentTarget&&i.preventDefault()};return b(Se,{get when(){return t.overlayPresent()},get children(){return b(ae,A({as:"div",ref(i){var s=ve(t.setOverlayRef,n.ref);typeof s=="function"&&s(i)},get style(){return vt({"pointer-events":"auto"},n.style)},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onPointerDown:o},r))}})}function $s(e){const t=pn();return b(Se,{get when(){return t.contentPresent()||t.overlayPresent()},get children(){return b(rs,e)}})}var dl={dismiss:"Dismiss"};function Os(e){const t=`dialog-${Ee()}`,n=Z({id:t,modal:!0,translations:dl},e),[r,o]=B(),[i,s]=B(),[a,u]=B(),[l,c]=B(),[d,f]=B(),[h,g]=B(),p=Ps({open:()=>n.open,defaultOpen:()=>n.defaultOpen,onOpenChange:x=>{var C;return(C=n.onOpenChange)==null?void 0:C.call(n,x)}}),v=()=>n.forceMount||p.isOpen(),{present:w}=wr({show:v,element:()=>l()??null}),{present:m}=wr({show:v,element:()=>d()??null}),y={translations:()=>n.translations??dl,isOpen:p.isOpen,modal:()=>n.modal??!0,preventScroll:()=>n.preventScroll??y.modal(),contentId:r,titleId:i,descriptionId:a,triggerRef:h,overlayRef:l,setOverlayRef:c,contentRef:d,setContentRef:f,overlayPresent:w,contentPresent:m,close:p.close,toggle:p.toggle,setTriggerRef:g,generateId:yt(()=>n.id),registerContentId:Be(o),registerTitleId:Be(s),registerDescriptionId:Be(u)};return b(kc.Provider,{value:y,get children(){return n.children}})}function Ts(e){const t=pn(),n=Z({id:t.generateId("title")},e),[r,o]=k(n,["id"]);return U(()=>W(t.registerTitleId(r.id))),b(ae,A({as:"h2",get id(){return r.id}},o))}function Vc(e){const t=pn(),[n,r]=k(e,["ref","onClick"]);return b(wt,A({ref(i){var s=ve(t.setTriggerRef,n.ref);typeof s=="function"&&s(i)},"aria-haspopup":"dialog",get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return K(()=>!!t.isOpen())()?t.contentId():void 0},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onClick:i=>{oe(i,n.onClick),t.toggle()}},r))}var ym=Object.assign(Os,{CloseButton:Is,Content:Ms,Description:Fs,Overlay:As,Portal:$s,Title:Ts,Trigger:Vc}),Nc=he("<div>"),wm=he('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><path d="M18 6l-12 12"></path><path d="M6 6l12 12">'),bm=he("<span class=sr-only>Close");const Sm=Os,xm=Fr("fixed inset-0 z-50 flex",{variants:{position:{top:"items-start",bottom:"items-end",left:"justify-start",right:"justify-end"}},defaultVariants:{position:"right"}}),Cm=e=>{const[t,n]=k(e,["position","children"]);return b($s,A(n,{get children(){var r=Nc();return fe(r,()=>t.children),Ke(()=>Tu(r,xm({position:t.position}))),r}}))},Em=e=>{const[t,n]=k(e,["class"]);return b(As,A({get class(){return de("fixed inset-0 z-50 bg-black/80 data-[expanded=]:animate-in data-[closed=]:animate-out data-[closed=]:fade-out-0 data-[expanded=]:fade-in-0",t.class)}},n))},Rm=Fr("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[closed=]:duration-300 data-[expanded=]:duration-500 data-[expanded=]:animate-in data-[closed=]:animate-out",{variants:{position:{top:"inset-x-0 top-0 border-b data-[closed=]:slide-out-to-top data-[expanded=]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[closed=]:slide-out-to-bottom data-[expanded=]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[closed=]:slide-out-to-left data-[expanded]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[closed=]:slide-out-to-right data-[expanded=]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{position:"right"}}),Pm=e=>{const[t,n]=k(e,["position","class","children"]);return b(Cm,{get position(){return t.position},get children(){return[b(Em,{}),b(Ms,A({get class(){return de(Rm({position:t.position}),t.class,"max-h-screen overflow-y-auto")}},n,{get children(){return[K(()=>t.children),b(Is,{class:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",get children(){return[wm(),bm()]}})]}}))]}})},Im=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=Nc();return at(r,A({get class(){return de("flex flex-col space-y-2 text-center sm:text-left",t.class)}},n),!1,!1),r})()},Mm=e=>{const[t,n]=k(e,["class"]);return b(Ts,A({get class(){return de("text-lg font-semibold text-foreground",t.class)}},n))},Fm=e=>{const[t,n]=k(e,["class"]);return b(Fs,A({get class(){return de("text-sm text-muted-foreground",t.class)}},n))},Kc=()=>{const[e,t]=fh(),n=K(()=>(e==null?void 0:e.bundleId)??null),r=K(()=>(e==null?void 0:e.channel)??null),o=K(()=>(e==null?void 0:e.platform)??null);return{bundleIdFilter:n,channelFilter:r,platformFilter:o,setBundleIdFilter:i=>{t({bundleId:i??void 0})},setChannelFilter:i=>{t({channel:i??void 0})},setPlatformFilter:i=>{t({platform:i??void 0})}}},Am=e=>{const t=e.split("-").join("").slice(0,12);return Number.parseInt(t,16)};function jc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yr={exports:{}},$m=Yr.exports,fl;function Om(){return fl||(fl=1,function(e,t){(function(n,r){e.exports=r()})($m,function(){var n=1e3,r=6e4,o=36e5,i="millisecond",s="second",a="minute",u="hour",l="day",c="week",d="month",f="quarter",h="year",g="date",p="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(P){var R=["th","st","nd","rd"],S=P%100;return"["+P+(R[(S-20)%10]||R[S]||R[0])+"]"}},y=function(P,R,S){var I=String(P);return!I||I.length>=R?P:""+Array(R+1-I.length).join(S)+P},x={s:y,z:function(P){var R=-P.utcOffset(),S=Math.abs(R),I=Math.floor(S/60),M=S%60;return(R<=0?"+":"-")+y(I,2,"0")+":"+y(M,2,"0")},m:function P(R,S){if(R.date()<S.date())return-P(S,R);var I=12*(S.year()-R.year())+(S.month()-R.month()),M=R.clone().add(I,d),F=S-M<0,D=R.clone().add(I+(F?-1:1),d);return+(-(I+(S-M)/(F?M-D:D-M))||0)},a:function(P){return P<0?Math.ceil(P)||0:Math.floor(P)},p:function(P){return{M:d,y:h,w:c,d:l,D:g,h:u,m:a,s,ms:i,Q:f}[P]||String(P||"").toLowerCase().replace(/s$/,"")},u:function(P){return P===void 0}},C="en",O={};O[C]=m;var L="$isDayjsObject",_=function(P){return P instanceof z||!(!P||!P[L])},T=function P(R,S,I){var M;if(!R)return C;if(typeof R=="string"){var F=R.toLowerCase();O[F]&&(M=F),S&&(O[F]=S,M=F);var D=R.split("-");if(!M&&D.length>1)return P(D[0])}else{var j=R.name;O[j]=R,M=j}return!I&&M&&(C=M),M||!I&&C},V=function(P,R){if(_(P))return P.clone();var S=typeof R=="object"?R:{};return S.date=P,S.args=arguments,new z(S)},N=x;N.l=T,N.i=_,N.w=function(P,R){return V(P,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var z=function(){function P(S){this.$L=T(S.locale,null,!0),this.parse(S),this.$x=this.$x||S.x||{},this[L]=!0}var R=P.prototype;return R.parse=function(S){this.$d=function(I){var M=I.date,F=I.utc;if(M===null)return new Date(NaN);if(N.u(M))return new Date;if(M instanceof Date)return new Date(M);if(typeof M=="string"&&!/Z$/i.test(M)){var D=M.match(v);if(D){var j=D[2]-1||0,H=(D[7]||"0").substring(0,3);return F?new Date(Date.UTC(D[1],j,D[3]||1,D[4]||0,D[5]||0,D[6]||0,H)):new Date(D[1],j,D[3]||1,D[4]||0,D[5]||0,D[6]||0,H)}}return new Date(M)}(S),this.init()},R.init=function(){var S=this.$d;this.$y=S.getFullYear(),this.$M=S.getMonth(),this.$D=S.getDate(),this.$W=S.getDay(),this.$H=S.getHours(),this.$m=S.getMinutes(),this.$s=S.getSeconds(),this.$ms=S.getMilliseconds()},R.$utils=function(){return N},R.isValid=function(){return this.$d.toString()!==p},R.isSame=function(S,I){var M=V(S);return this.startOf(I)<=M&&M<=this.endOf(I)},R.isAfter=function(S,I){return V(S)<this.startOf(I)},R.isBefore=function(S,I){return this.endOf(I)<V(S)},R.$g=function(S,I,M){return N.u(S)?this[I]:this.set(M,S)},R.unix=function(){return Math.floor(this.valueOf()/1e3)},R.valueOf=function(){return this.$d.getTime()},R.startOf=function(S,I){var M=this,F=!!N.u(I)||I,D=N.p(S),j=function(Fe,Pe){var $t=N.w(M.$u?Date.UTC(M.$y,Pe,Fe):new Date(M.$y,Pe,Fe),M);return F?$t:$t.endOf(l)},H=function(Fe,Pe){return N.w(M.toDate()[Fe].apply(M.toDate("s"),(F?[0,0,0,0]:[23,59,59,999]).slice(Pe)),M)},X=this.$W,le=this.$M,ne=this.$D,Ae="set"+(this.$u?"UTC":"");switch(D){case h:return F?j(1,0):j(31,11);case d:return F?j(1,le):j(0,le+1);case c:var Je=this.$locale().weekStart||0,te=(X<Je?X+7:X)-Je;return j(F?ne-te:ne+(6-te),le);case l:case g:return H(Ae+"Hours",0);case u:return H(Ae+"Minutes",1);case a:return H(Ae+"Seconds",2);case s:return H(Ae+"Milliseconds",3);default:return this.clone()}},R.endOf=function(S){return this.startOf(S,!1)},R.$set=function(S,I){var M,F=N.p(S),D="set"+(this.$u?"UTC":""),j=(M={},M[l]=D+"Date",M[g]=D+"Date",M[d]=D+"Month",M[h]=D+"FullYear",M[u]=D+"Hours",M[a]=D+"Minutes",M[s]=D+"Seconds",M[i]=D+"Milliseconds",M)[F],H=F===l?this.$D+(I-this.$W):I;if(F===d||F===h){var X=this.clone().set(g,1);X.$d[j](H),X.init(),this.$d=X.set(g,Math.min(this.$D,X.daysInMonth())).$d}else j&&this.$d[j](H);return this.init(),this},R.set=function(S,I){return this.clone().$set(S,I)},R.get=function(S){return this[N.p(S)]()},R.add=function(S,I){var M,F=this;S=Number(S);var D=N.p(I),j=function(le){var ne=V(F);return N.w(ne.date(ne.date()+Math.round(le*S)),F)};if(D===d)return this.set(d,this.$M+S);if(D===h)return this.set(h,this.$y+S);if(D===l)return j(1);if(D===c)return j(7);var H=(M={},M[a]=r,M[u]=o,M[s]=n,M)[D]||1,X=this.$d.getTime()+S*H;return N.w(X,this)},R.subtract=function(S,I){return this.add(-1*S,I)},R.format=function(S){var I=this,M=this.$locale();if(!this.isValid())return M.invalidDate||p;var F=S||"YYYY-MM-DDTHH:mm:ssZ",D=N.z(this),j=this.$H,H=this.$m,X=this.$M,le=M.weekdays,ne=M.months,Ae=M.meridiem,Je=function(Pe,$t,Qn,Dr){return Pe&&(Pe[$t]||Pe(I,F))||Qn[$t].slice(0,Dr)},te=function(Pe){return N.s(j%12||12,Pe,"0")},Fe=Ae||function(Pe,$t,Qn){var Dr=Pe<12?"AM":"PM";return Qn?Dr.toLowerCase():Dr};return F.replace(w,function(Pe,$t){return $t||function(Qn){switch(Qn){case"YY":return String(I.$y).slice(-2);case"YYYY":return N.s(I.$y,4,"0");case"M":return X+1;case"MM":return N.s(X+1,2,"0");case"MMM":return Je(M.monthsShort,X,ne,3);case"MMMM":return Je(ne,X);case"D":return I.$D;case"DD":return N.s(I.$D,2,"0");case"d":return String(I.$W);case"dd":return Je(M.weekdaysMin,I.$W,le,2);case"ddd":return Je(M.weekdaysShort,I.$W,le,3);case"dddd":return le[I.$W];case"H":return String(j);case"HH":return N.s(j,2,"0");case"h":return te(1);case"hh":return te(2);case"a":return Fe(j,H,!0);case"A":return Fe(j,H,!1);case"m":return String(H);case"mm":return N.s(H,2,"0");case"s":return String(I.$s);case"ss":return N.s(I.$s,2,"0");case"SSS":return N.s(I.$ms,3,"0");case"Z":return D}return null}(Pe)||D.replace(":","")})},R.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},R.diff=function(S,I,M){var F,D=this,j=N.p(I),H=V(S),X=(H.utcOffset()-this.utcOffset())*r,le=this-H,ne=function(){return N.m(D,H)};switch(j){case h:F=ne()/12;break;case d:F=ne();break;case f:F=ne()/3;break;case c:F=(le-X)/6048e5;break;case l:F=(le-X)/864e5;break;case u:F=le/o;break;case a:F=le/r;break;case s:F=le/n;break;default:F=le}return M?F:N.a(F)},R.daysInMonth=function(){return this.endOf(d).$D},R.$locale=function(){return O[this.$L]},R.locale=function(S,I){if(!S)return this.$L;var M=this.clone(),F=T(S,I,!0);return F&&(M.$L=F),M},R.clone=function(){return N.w(this.$d,this)},R.toDate=function(){return new Date(this.valueOf())},R.toJSON=function(){return this.isValid()?this.toISOString():null},R.toISOString=function(){return this.$d.toISOString()},R.toString=function(){return this.$d.toUTCString()},P}(),ie=z.prototype;return V.prototype=ie,[["$ms",i],["$s",s],["$m",a],["$H",u],["$W",l],["$M",d],["$y",h],["$D",g]].forEach(function(P){ie[P[1]]=function(R){return this.$g(R,P[0],P[1])}}),V.extend=function(P,R){return P.$i||(P(R,z,V),P.$i=!0),V},V.locale=T,V.isDayjs=_,V.unix=function(P){return V(1e3*P)},V.en=O[C],V.Ls=O,V.p={},V})}(Yr)),Yr.exports}var Tm=Om();const Dm=jc(Tm);/**
1
+ var of=Object.defineProperty;var ba=e=>{throw TypeError(e)};var sf=(e,t,n)=>t in e?of(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Re=(e,t,n)=>sf(e,typeof t!="symbol"?t+"":t,n),Io=(e,t,n)=>t.has(e)||ba("Cannot "+n);var E=(e,t,n)=>(Io(e,t,"read from private field"),n?n.call(e):t.get(e)),J=(e,t,n)=>t.has(e)?ba("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),q=(e,t,n,r)=>(Io(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ue=(e,t,n)=>(Io(e,t,"access private method"),n);var Lr=(e,t,n,r)=>({set _(o){q(e,t,o,n)},get _(){return E(e,t,r)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();const ee={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Sa(this.context.count)},getNextContextId(){return Sa(this.context.count++)}};function Sa(e){const t=String(e),n=t.length-1;return ee.context.id+(n?String.fromCharCode(96+n):"")+t}function or(e){ee.context=e}const af=(e,t)=>e===t,it=Symbol("solid-proxy"),Eu=typeof Proxy=="function",fi=Symbol("solid-track"),Zr={equals:af};let Ru=Fu;const st=1,dr=2,Pu={owned:null,cleanups:null,context:null,owner:null},Mo={};var se=null;let G=null,lf=null,ge=null,ke=null,De=null,so=0;function ln(e,t){const n=ge,r=se,o=e.length===0,i=t===void 0?r:t,s=o?Pu:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>Me(()=>zt(s)));se=s,ge=null;try{return He(a,!0)}finally{ge=n,se=r}}function B(e,t){t=t?Object.assign({},Zr,t):Zr;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(G&&G.running&&G.sources.has(n)?o=o(n.tValue):o=o(n.value)),Mu(n,o));return[Iu.bind(n),r]}function Mt(e,t,n){const r=uo(e,t,!0,st);zn(r)}function Ke(e,t,n){const r=uo(e,t,!1,st);zn(r)}function U(e,t,n){Ru=pf;const r=uo(e,t,!1,st),o=un&&me(un);o&&(r.suspense=o),(!n||!n.render)&&(r.user=!0),De?De.push(r):zn(r)}function K(e,t,n){n=n?Object.assign({},Zr,n):Zr;const r=uo(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,zn(r),Iu.bind(r)}function uf(e){return e&&typeof e=="object"&&"then"in e}function cf(e,t,n){let r,o,i;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,o=e,i=t||{}):(r=e,o=t,i={});let s=null,a=Mo,l=null,c=!1,u=!1,f="initialValue"in i,d=typeof r=="function"&&K(r);const h=new Set,[g,p]=(i.storage||B)(i.initialValue),[v,w]=B(void 0),[m,y]=B(void 0,{equals:!1}),[x,C]=B(f?"ready":"unresolved");ee.context&&(l=ee.getNextContextId(),i.ssrLoadFrom==="initial"?a=i.initialValue:ee.load&&ee.has(l)&&(a=ee.load(l)));function O(V,N,z,ie){return s===V&&(s=null,ie!==void 0&&(f=!0),(V===a||N===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(ie,{value:N})),a=Mo,G&&V&&c?(G.promises.delete(V),c=!1,He(()=>{G.running=!0,L(N,z)},!1)):L(N,z)),N}function L(V,N){He(()=>{N===void 0&&p(()=>V),C(N!==void 0?"errored":f?"ready":"unresolved"),w(N);for(const z of h.keys())z.decrement();h.clear()},!1)}function _(){const V=un&&me(un),N=g(),z=v();if(z!==void 0&&!s)throw z;return ge&&!ge.user&&V&&Mt(()=>{m(),s&&(V.resolved&&G&&c?G.promises.add(s):h.has(V)||(V.increment(),h.add(V)))}),N}function T(V=!0){if(V!==!1&&u)return;u=!1;const N=d?d():r;if(c=G&&G.running,N==null||N===!1){O(s,Me(g));return}G&&s&&G.promises.delete(s);const z=a!==Mo?a:Me(()=>o(N,{value:g(),refetching:V}));return uf(z)?(s=z,"value"in z?(z.status==="success"?O(s,z.value,void 0,N):O(s,void 0,gi(z.value),N),z):(u=!0,queueMicrotask(()=>u=!1),He(()=>{C(f?"refreshing":"pending"),y()},!1),z.then(ie=>O(z,ie,void 0,N),ie=>O(z,void 0,gi(ie),N)))):(O(s,z,void 0,N),z)}return Object.defineProperties(_,{state:{get:()=>x()},error:{get:()=>v()},loading:{get(){const V=x();return V==="pending"||V==="refreshing"}},latest:{get(){if(!f)return _();const V=v();if(V&&!s)throw V;return g()}}}),d?Mt(()=>T(!1)):T(!1),[_,{refetch:T,mutate:p}]}function ao(e){return He(e,!1)}function Me(e){if(ge===null)return e();const t=ge;ge=null;try{return e()}finally{ge=t}}function Ce(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]()}else a=e();if(i)return i=!1,s;const l=Me(()=>t(a,o,s));return o=a,l}}function Bn(e){U(()=>Me(e))}function W(e){return se===null||(se.cleanups===null?se.cleanups=[e]:se.cleanups.push(e)),e}function hi(){return ge}function fr(){return se}function ts(e,t){const n=se,r=ge;se=e,ge=null;try{return He(t,!0)}catch(o){ns(o)}finally{se=n,ge=r}}function df(e){if(G&&G.running)return e(),G.done;const t=ge,n=se;return Promise.resolve().then(()=>{ge=t,se=n;let r;return un&&(r=G||(G={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),r.done||(r.done=new Promise(o=>r.resolve=o)),r.running=!0),He(e,!1),ge=se=null,r?r.done:void 0})}const[mS,xa]=B(!1);function ff(e){De.push.apply(De,e),e.length=0}function we(e,t){const n=Symbol("context");return{id:n,Provider:mf(n),defaultValue:e}}function me(e){let t;return se&&se.context&&(t=se.context[e.id])!==void 0?t:e.defaultValue}function lo(e){const t=K(e),n=K(()=>pi(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let un;function hf(){return un||(un=we())}function Iu(){const e=G&&G.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===st)zn(this);else{const t=ke;ke=null,He(()=>eo(this),!1),ke=t}if(ge){const t=this.observers?this.observers.length:0;ge.sources?(ge.sources.push(this),ge.sourceSlots.push(t)):(ge.sources=[this],ge.sourceSlots=[t]),this.observers?(this.observers.push(ge),this.observerSlots.push(ge.sources.length-1)):(this.observers=[ge],this.observerSlots=[ge.sources.length-1])}return e&&G.sources.has(this)?this.tValue:this.value}function Mu(e,t,n){let r=G&&G.running&&G.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(G){const o=G.running;(o||!n&&G.sources.has(e))&&(G.sources.add(e),e.tValue=t),o||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&He(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=G&&G.running;s&&G.disposed.has(i)||((s?!i.tState:!i.state)&&(i.pure?ke.push(i):De.push(i),i.observers&&Au(i)),s?i.tState=st:i.state=st)}if(ke.length>1e6)throw ke=[],new Error},!1)}return t}function zn(e){if(!e.fn)return;zt(e);const t=so;Ca(e,G&&G.running&&G.sources.has(e)?e.tValue:e.value,t),G&&!G.running&&G.sources.has(e)&&queueMicrotask(()=>{He(()=>{G&&(G.running=!0),ge=se=e,Ca(e,e.tValue,t),ge=se=null},!1)})}function Ca(e,t,n){let r;const o=se,i=ge;ge=se=e;try{r=e.fn(t)}catch(s){return e.pure&&(G&&G.running?(e.tState=st,e.tOwned&&e.tOwned.forEach(zt),e.tOwned=void 0):(e.state=st,e.owned&&e.owned.forEach(zt),e.owned=null)),e.updatedAt=n+1,ns(s)}finally{ge=i,se=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Mu(e,r,!0):G&&G.running&&e.pure?(G.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function uo(e,t,n,r=st,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:se,context:se?se.context:null,pure:n};return G&&G.running&&(i.state=0,i.tState=r),se===null||se!==Pu&&(G&&G.running&&se.pure?se.tOwned?se.tOwned.push(i):se.tOwned=[i]:se.owned?se.owned.push(i):se.owned=[i]),i}function Jr(e){const t=G&&G.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===dr)return eo(e);if(e.suspense&&Me(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<so);){if(t&&G.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let o=e,i=n[r+1];for(;(o=o.owner)&&o!==i;)if(G.disposed.has(o))return}if((t?e.tState:e.state)===st)zn(e);else if((t?e.tState:e.state)===dr){const o=ke;ke=null,He(()=>eo(e,n[0]),!1),ke=o}}}function He(e,t){if(ke)return e();let n=!1;t||(ke=[]),De?n=!0:De=[],so++;try{const r=e();return gf(n),r}catch(r){n||(De=null),ke=null,ns(r)}}function gf(e){if(ke&&(Fu(ke),ke=null),e)return;let t;if(G){if(!G.promises.size&&!G.queue.size){const r=G.sources,o=G.disposed;De.push.apply(De,G.effects),t=G.resolve;for(const i of De)"tState"in i&&(i.state=i.tState),delete i.tState;G=null,He(()=>{for(const i of o)zt(i);for(const i of r){if(i.value=i.tValue,i.owned)for(let s=0,a=i.owned.length;s<a;s++)zt(i.owned[s]);i.tOwned&&(i.owned=i.tOwned),delete i.tValue,delete i.tOwned,i.tState=0}xa(!1)},!1)}else if(G.running){G.running=!1,G.effects.push.apply(G.effects,De),De=null,xa(!0);return}}const n=De;De=null,n.length&&He(()=>Ru(n),!1),t&&t()}function Fu(e){for(let t=0;t<e.length;t++)Jr(e[t])}function pf(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Jr(r)}if(ee.context){if(ee.count){ee.effects||(ee.effects=[]),ee.effects.push(...e.slice(0,n));return}or()}for(ee.effects&&(ee.done||!ee.count)&&(e=[...ee.effects,...e],n+=ee.effects.length,delete ee.effects),t=0;t<n;t++)Jr(e[t])}function eo(e,t){const n=G&&G.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){const o=e.sources[r];if(o.sources){const i=n?o.tState:o.state;i===st?o!==t&&(!o.updatedAt||o.updatedAt<so)&&Jr(o):i===dr&&eo(o,t)}}}function Au(e){const t=G&&G.running;for(let n=0;n<e.observers.length;n+=1){const r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=dr:r.state=dr,r.pure?ke.push(r):De.push(r),r.observers&&Au(r))}}function zt(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){const i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)zt(e.tOwned[t]);delete e.tOwned}if(G&&G.running&&e.pure)$u(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)zt(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}G&&G.running?e.tState=0:e.state=0}function $u(e,t){if(t||(e.tState=0,G.disposed.add(e)),e.owned)for(let n=0;n<e.owned.length;n++)$u(e.owned[n])}function gi(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function ns(e,t=se){throw gi(e)}function pi(e){if(typeof e=="function"&&!e.length)return pi(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=pi(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function mf(e,t){return function(r){let o;return Ke(()=>o=Me(()=>(se.context={...se.context,[e]:r.value},lo(()=>r.children))),void 0),o}}const vf=Symbol("fallback");function Ea(e){for(let t=0;t<e.length;t++)e[t]()}function yf(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return W(()=>Ea(i)),()=>{let l=e()||[],c=l.length,u,f;return l[fi],Me(()=>{let h,g,p,v,w,m,y,x,C;if(c===0)s!==0&&(Ea(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[vf],o[0]=ln(O=>(i[0]=O,n.fallback())),s=1);else if(s===0){for(o=new Array(c),f=0;f<c;f++)r[f]=l[f],o[f]=ln(d);s=c}else{for(p=new Array(c),v=new Array(c),a&&(w=new Array(c)),m=0,y=Math.min(s,c);m<y&&r[m]===l[m];m++);for(y=s-1,x=c-1;y>=m&&x>=m&&r[y]===l[x];y--,x--)p[x]=o[y],v[x]=i[y],a&&(w[x]=a[y]);for(h=new Map,g=new Array(x+1),f=x;f>=m;f--)C=l[f],u=h.get(C),g[f]=u===void 0?-1:u,h.set(C,f);for(u=m;u<=y;u++)C=r[u],f=h.get(C),f!==void 0&&f!==-1?(p[f]=o[u],v[f]=i[u],a&&(w[f]=a[u]),f=g[f],h.set(C,f)):i[u]();for(f=m;f<c;f++)f in p?(o[f]=p[f],i[f]=v[f],a&&(a[f]=w[f],a[f](f))):o[f]=ln(d);o=o.slice(0,s=c),r=l.slice(0)}return o});function d(h){if(i[f]=h,a){const[g,p]=B(f);return a[f]=p,t(l[f],g)}return t(l[f])}}}function b(e,t){return Me(()=>e(t||{}))}function _r(){return!0}const mi={get(e,t,n){return t===it?n:e.get(t)},has(e,t){return t===it?!0:e.has(t)},set:_r,deleteProperty:_r,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:_r,deleteProperty:_r}},ownKeys(e){return e.keys()}};function Fo(e){return(e=typeof e=="function"?e():e)?e:{}}function wf(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function A(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&it in a,e[s]=typeof a=="function"?(t=!0,K(a)):a}if(Eu&&t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const l=Fo(e[a])[s];if(l!==void 0)return l}},has(s){for(let a=e.length-1;a>=0;a--)if(s in Fo(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(Fo(e[a])));return[...new Set(s)]}},mi);const n={},r=Object.create(null);for(let s=e.length-1;s>=0;s--){const a=e[s];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u==="__proto__"||u==="constructor")continue;const f=Object.getOwnPropertyDescriptor(a,u);if(!r[u])r[u]=f.get?{enumerable:!0,configurable:!0,get:wf.bind(n[u]=[f.get.bind(a)])}:f.value!==void 0?f:void 0;else{const d=n[u];d&&(f.get?d.push(f.get.bind(a)):f.value!==void 0&&d.push(()=>f.value))}}}const o={},i=Object.keys(r);for(let s=i.length-1;s>=0;s--){const a=i[s],l=r[a];l&&l.get?Object.defineProperty(o,a,l):o[a]=l?l.value:void 0}return o}function k(e,...t){if(Eu&&it in e){const o=new Set(t.length>1?t.flat():t[0]),i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},mi));return i.push(new Proxy({get(s){return o.has(s)?void 0:e[s]},has(s){return o.has(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.has(s))}},mi)),i}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,o),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let a=!1,l=0;for(const c of t)c.includes(o)&&(a=!0,s?r[l][o]=i.value:Object.defineProperty(r[l],o,i)),++l;a||(s?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}let bf=0;function Ee(){return ee.context?ee.getNextContextId():`cl-${bf++}`}const Sf=e=>`Stale read from <${e}>.`;function nt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return K(yf(()=>e.each,e.children,t||void 0))}function Se(e){const t=e.keyed,n=K(()=>e.when,void 0,{equals:(r,o)=>t?r===o:!r==!o});return K(()=>{const r=n();if(r){const o=e.children;return typeof o=="function"&&o.length>0?Me(()=>o(t?r:()=>{if(!Me(n))throw Sf("Show");return e.when})):o}return e.fallback},void 0,void 0)}const xf=we();function Cf(e){let t=0,n,r,o,i,s;const[a,l]=B(!1),c=hf(),u={increment:()=>{++t===1&&l(!0)},decrement:()=>{--t===0&&l(!1)},inFallback:a,effects:[],resolved:!1},f=fr();if(ee.context&&ee.load){const g=ee.getContextId();let p=ee.load(g);if(p&&(typeof p!="object"||p.status!=="success"?o=p:ee.gather(g)),o&&o!=="$$f"){const[v,w]=B(void 0,{equals:!1});i=v,o.then(()=>{if(ee.done)return w();ee.gather(g),or(r),w(),or()},m=>{s=m,w()})}}const d=me(xf);d&&(n=d.register(u.inFallback));let h;return W(()=>h&&h()),b(c.Provider,{value:u,get children(){return K(()=>{if(s)throw s;if(r=ee.context,i)return i(),i=void 0;r&&o==="$$f"&&or();const g=K(()=>e.children);return K(p=>{const v=u.inFallback(),{showContent:w=!0,showFallback:m=!0}=n?n():{};if((!v||o&&o!=="$$f")&&w)return u.resolved=!0,h&&h(),h=r=o=void 0,ff(u.effects),g();if(m)return h?p:ln(y=>(h=y,r&&(or({id:r.id+"F",count:0}),r=void 0),e.fallback),f)})})}})}const Ef=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],Rf=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...Ef]),Pf=new Set(["innerHTML","textContent","innerText","children"]),If=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Mf=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function Ff(e,t){const n=Mf[e];return typeof n=="object"?n[t]?n.$:void 0:n}const Af=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),$f=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),Of={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Tf(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,c=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const u=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],u)}else if(i===a)for(;s<o;)(!c||!c.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const u=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],u),t[o]=n[i]}else{if(!c){c=new Map;let f=a;for(;f<i;)c.set(n[f],f++)}const u=c.get(t[s]);if(u!=null)if(a<u&&u<i){let f=s,d=1,h;for(;++f<o&&f<i&&!((h=c.get(t[f]))==null||h!==u+d);)d++;if(d>u-a){const g=t[s];for(;a<u;)e.insertBefore(n[a++],g)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const Ra="_$DX_DELEGATE";function Df(e,t,n,r={}){let o;return ln(i=>{o=i,t===document?e():fe(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{o(),t.textContent=""}}function he(e,t,n){let r;const o=()=>{const s=document.createElement("template");return s.innerHTML=e,s.content.firstChild},i=()=>(r||(r=o())).cloneNode(!0);return i.cloneNode=i,i}function Ou(e,t=window.document){const n=t[Ra]||(t[Ra]=new Set);for(let r=0,o=e.length;r<o;r++){const i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,Gf))}}function Nn(e,t,n){gn(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Lf(e,t,n,r){gn(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function _f(e,t,n){gn(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function Tu(e,t){gn(e)||(t==null?e.removeAttribute("class"):e.className=t)}function kf(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=i=>o.call(e,n[1],i))}else e.addEventListener(t,n,typeof n!="function"&&n)}function Vf(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,s;for(i=0,s=o.length;i<s;i++){const a=o[i];!a||a==="undefined"||t[a]||(Pa(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(Pa(e,a,!0),n[a]=l)}return n}function Nf(e,t,n){if(!t)return n?Nn(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function at(e,t={},n,r){const o={};return r||Ke(()=>o.children=hr(e,t.children,o.children)),Ke(()=>typeof t.ref=="function"&&Kf(t.ref,e)),Ke(()=>jf(e,t,n,!0,o,!0)),o}function Kf(e,t,n){return Me(()=>e(t,n))}function fe(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return hr(e,t,r,n);Ke(o=>hr(e,t(),o,n),r)}function jf(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=Ia(e,s,null,o[s],n,i,t)}for(const s in t){if(s==="children")continue;const a=t[s];o[s]=Ia(e,s,a,o[s],n,i,t)}}function Bf(e){let t,n;return!gn()||!(t=ee.registry.get(n=Hf()))?e():(ee.completed&&ee.completed.add(t),ee.registry.delete(n),t)}function gn(e){return!!ee.context&&!ee.done&&(!e||e.isConnected)}function zf(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Pa(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function Ia(e,t,n,r,o,i,s){let a,l,c,u,f;if(t==="style")return Nf(e,n,r);if(t==="classList")return Vf(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const d=t.slice(3);r&&e.removeEventListener(d,r,typeof r!="function"&&r),n&&e.addEventListener(d,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const d=t.slice(10);r&&e.removeEventListener(d,r,!0),n&&e.addEventListener(d,n,!0)}else if(t.slice(0,2)==="on"){const d=t.slice(2).toLowerCase(),h=Af.has(d);if(!h&&r){const g=Array.isArray(r)?r[0]:r;e.removeEventListener(d,g)}(h||n)&&(kf(e,d,n,h),h&&Ou([d]))}else if(t.slice(0,5)==="attr:")Nn(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")_f(e,t.slice(5),n);else if((f=t.slice(0,5)==="prop:")||(c=Pf.has(t))||!o&&((u=Ff(t,e.tagName))||(l=Rf.has(t)))||(a=e.nodeName.includes("-")||"is"in s)){if(f)t=t.slice(5),l=!0;else if(gn(e))return n;t==="class"||t==="className"?Tu(e,n):a&&!l&&!c?e[zf(t)]=n:e[u||t]=n}else{const d=o&&t.indexOf(":")>-1&&Of[t.split(":")[0]];d?Lf(e,d,t,n):Nn(e,If[t]||t,n)}return n}function Gf(e){if(ee.registry&&ee.events&&ee.events.find(([l,c])=>c===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),s=()=>{const l=t[n];if(l&&!t.disabled){const c=t[`${n}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),ee.registry&&!ee.done&&(ee.done=_$HY.done=!0),e.composedPath){const l=e.composedPath();i(l[0]);for(let c=0;c<l.length-2&&(t=l[c],!!s());c++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();i(r)}function hr(e,t,n,r,o){const i=gn(e);if(i){!n&&(n=[...e.childNodes]);let l=[];for(let c=0;c<n.length;c++){const u=n[c];u.nodeType===8&&u.data.slice(0,2)==="!$"?u.remove():l.push(u)}n=l}for(;typeof n=="function";)n=n();if(t===n)return n;const s=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(i||s==="number"&&(t=t.toString(),t===n))return n;if(a){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=vn(e,n,r,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||s==="boolean"){if(i)return n;n=vn(e,n,r)}else{if(s==="function")return Ke(()=>{let l=t();for(;typeof l=="function";)l=l();n=hr(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],c=n&&Array.isArray(n);if(vi(l,t,n,o))return Ke(()=>n=hr(e,l,n,r,!0)),()=>n;if(i){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let u=l[0];if(u.parentNode!==e)return n;const f=[u];for(;(u=u.nextSibling)!==r;)f.push(u);return n=f}if(l.length===0){if(n=vn(e,n,r),a)return n}else c?n.length===0?Ma(e,l,r):Tf(e,n,l):(n&&vn(e),Ma(e,l));n=l}else if(t.nodeType){if(i&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=vn(e,n,r,t);vn(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function vi(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[e.length],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=vi(e,a,l)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=vi(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const u=String(a);l&&l.nodeType===3&&l.data===u?e.push(l):e.push(document.createTextNode(u))}}return o}function Ma(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function vn(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let i=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(o!==a){const l=a.parentNode===e;!i&&!s?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}function Hf(){return ee.getNextContextId()}const Uf=!1,qf="http://www.w3.org/2000/svg";function Du(e,t=!1){return t?document.createElementNS(qf,e):document.createElement(e)}function rs(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=fr();let i,s=!!ee.context;return U(()=>{s&&(fr().user=s=!1),i||(i=ts(o,()=>K(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=B(!1),u=()=>c(!0);ln(f=>fe(a,()=>l()?f():i(),null)),W(u)}else{const l=Du(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),fe(c,i),a.appendChild(l),e.ref&&e.ref(l),W(()=>a.removeChild(l))}},void 0,{render:!s}),n}function Lu(e){const[t,n]=k(e,["component"]),r=K(()=>t.component);return K(()=>{const o=r();switch(typeof o){case"function":return Me(()=>o(n));case"string":const i=$f.has(o),s=ee.context?Bf():Du(o,i);return at(s,n,i),s}})}const _u=we(),Wf=["title","meta"],Fa=[],Aa=["name","http-equiv","content","charset","media"].concat(["property"]),$a=(e,t)=>{const n=Object.fromEntries(Object.entries(e.props).filter(([r])=>t.includes(r)).sort());return(Object.hasOwn(n,"name")||Object.hasOwn(n,"property"))&&(n.name=n.name||n.property,delete n.property),e.tag+JSON.stringify(n)};function Xf(){if(!ee.context){const n=document.head.querySelectorAll("[data-sm]");Array.prototype.forEach.call(n,r=>r.parentNode.removeChild(r))}const e=new Map;function t(n){if(n.ref)return n.ref;let r=document.querySelector(`[data-sm="${n.id}"]`);return r?(r.tagName.toLowerCase()!==n.tag&&(r.parentNode&&r.parentNode.removeChild(r),r=document.createElement(n.tag)),r.removeAttribute("data-sm")):r=document.createElement(n.tag),r}return{addTag(n){if(Wf.indexOf(n.tag)!==-1){const i=n.tag==="title"?Fa:Aa,s=$a(n,i);e.has(s)||e.set(s,[]);let a=e.get(s),l=a.length;a=[...a,n],e.set(s,a);let c=t(n);n.ref=c,at(c,n.props);let u=null;for(var r=l-1;r>=0;r--)if(a[r]!=null){u=a[r];break}return c.parentNode!=document.head&&document.head.appendChild(c),u&&u.ref&&u.ref.parentNode&&document.head.removeChild(u.ref),l}let o=t(n);return n.ref=o,at(o,n.props),o.parentNode!=document.head&&document.head.appendChild(o),-1},removeTag(n,r){const o=n.tag==="title"?Fa:Aa,i=$a(n,o);if(n.ref){const s=e.get(i);if(s){if(n.ref.parentNode){n.ref.parentNode.removeChild(n.ref);for(let a=r-1;a>=0;a--)s[a]!=null&&document.head.appendChild(s[a].ref)}s[r]=null,e.set(i,s)}else n.ref.parentNode&&n.ref.parentNode.removeChild(n.ref)}}}}const Qf=e=>{const t=Xf();return b(_u.Provider,{value:t,get children(){return e.children}})},Yf=(e,t,n)=>(Zf({tag:e,props:t,setting:n,id:Ee(),get name(){return t.name||t.property}}),null);function Zf(e){const t=me(_u);if(!t)throw new Error("<MetaProvider /> should be in the tree");Ke(()=>{const n=t.addTag(e);W(()=>t.removeTag(e,n))})}const Jf=e=>Yf("title",e,{escape:!0,close:!0});function ku(){let e=new Set;function t(o){return e.add(o),()=>e.delete(o)}let n=!1;function r(o,i){if(n)return!(n=!1);const s={to:o,options:i,defaultPrevented:!1,preventDefault:()=>s.defaultPrevented=!0};for(const a of e)a.listener({...s,from:a.location,retry:l=>{l&&(n=!0),a.navigate(o,{...i,resolve:!1})}});return!s.defaultPrevented}return{subscribe:t,confirm:r}}let yi;function os(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),yi=window.history.state._depth}os();function eh(e){return{...e,_depth:window.history.state&&window.history.state._depth}}function th(e,t){let n=!1;return()=>{const r=yi;os();const o=r==null?null:yi-r;if(n){n=!1;return}o&&t(o)?(n=!0,window.history.go(-o)):e()}}const nh=/^(?:[a-z0-9]+:)?\/\//i,rh=/^\/+|(\/)\/+$/g,Vu="http://sr";function ur(e,t=!1){const n=e.replace(rh,"$1");return n?t||/^[?#]/.test(n)?n:"/"+n:""}function Qr(e,t,n){if(nh.test(t))return;const r=ur(e),o=n&&ur(n);let i="";return!o||t.startsWith("/")?i=r:o.toLowerCase().indexOf(r.toLowerCase())!==0?i=r+o:i=o,(i||"/")+ur(t,!i)}function oh(e,t){if(e==null)throw new Error(t);return e}function ih(e,t){return ur(e).replace(/\/*(\*.*)?$/g,"")+ur(t)}function Nu(e){const t={};return e.searchParams.forEach((n,r)=>{r in t?Array.isArray(t[r])?t[r].push(n):t[r]=[t[r],n]:t[r]=n}),t}function sh(e,t,n){const[r,o]=e.split("/*",2),i=r.split("/").filter(Boolean),s=i.length;return a=>{const l=a.split("/").filter(Boolean),c=l.length-s;if(c<0||c>0&&o===void 0&&!t)return null;const u={path:s?"":"/",params:{}},f=d=>n===void 0?void 0:n[d];for(let d=0;d<s;d++){const h=i[d],g=h[0]===":",p=g?l[d]:l[d].toLowerCase(),v=g?h.slice(1):h.toLowerCase();if(g&&Ao(p,f(v)))u.params[v]=p;else if(g||!Ao(p,v))return null;u.path+=`/${p}`}if(o){const d=c?l.slice(-c).join("/"):"";if(Ao(d,f(o)))u.params[o]=d;else return null}return u}}function Ao(e,t){const n=r=>r===e;return t===void 0?!0:typeof t=="string"?n(t):typeof t=="function"?t(e):Array.isArray(t)?t.some(n):t instanceof RegExp?t.test(e):!1}function ah(e){const[t,n]=e.pattern.split("/*",2),r=t.split("/").filter(Boolean);return r.reduce((o,i)=>o+(i.startsWith(":")?2:3),r.length-(n===void 0?0:1))}function Ku(e){const t=new Map,n=fr();return new Proxy({},{get(r,o){return t.has(o)||ts(n,()=>t.set(o,K(()=>e()[o]))),t.get(o)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(e())}})}function lh(e,t){const n=new URLSearchParams(e);Object.entries(t).forEach(([o,i])=>{i==null||i===""||i instanceof Array&&!i.length?n.delete(o):i instanceof Array?(n.delete(o),i.forEach(s=>{n.append(o,String(s))})):n.set(o,String(i))});const r=n.toString();return r?`?${r}`:""}function ju(e){let t=/(\/?\:[^\/]+)\?/.exec(e);if(!t)return[e];let n=e.slice(0,t.index),r=e.slice(t.index+t[0].length);const o=[n,n+=t[1]];for(;t=/^(\/\:[^\/]+)\?/.exec(r);)o.push(n+=t[1]),r=r.slice(t[0].length);return ju(r).reduce((i,s)=>[...i,...o.map(a=>a+s)],[])}const uh=100,Bu=we(),zu=we(),Gu=()=>oh(me(Bu),"<A> and 'use' router primitives can be only used inside a Route."),ch=()=>Gu().navigatorFactory(),dh=()=>Gu().location,fh=()=>{const e=dh(),t=ch(),n=(r,o)=>{const i=Me(()=>lh(e.search,r)+e.hash);t(i,{scroll:!1,resolve:!1,...o})};return[e.query,n]};function hh(e,t=""){const{component:n,preload:r,load:o,children:i,info:s}=e,a=!i||Array.isArray(i)&&!i.length,l={key:e,component:n,preload:r||o,info:s};return Hu(e.path).reduce((c,u)=>{for(const f of ju(u)){const d=ih(t,f);let h=a?d:d.split("/*",1)[0];h=h.split("/").map(g=>g.startsWith(":")||g.startsWith("*")?g:encodeURIComponent(g)).join("/"),c.push({...l,originalPath:u,pattern:h,matcher:sh(h,!a,e.matchFilters)})}return c},[])}function gh(e,t=0){return{routes:e,score:ah(e[e.length-1])*1e4-t,matcher(n){const r=[];for(let o=e.length-1;o>=0;o--){const i=e[o],s=i.matcher(n);if(!s)return null;r.unshift({...s,route:i})}return r}}}function Hu(e){return Array.isArray(e)?e:[e]}function Uu(e,t="",n=[],r=[]){const o=Hu(e);for(let i=0,s=o.length;i<s;i++){const a=o[i];if(a&&typeof a=="object"){a.hasOwnProperty("path")||(a.path="");const l=hh(a,t);for(const c of l){n.push(c);const u=Array.isArray(a.children)&&a.children.length===0;if(a.children&&!u)Uu(a.children,c.pattern,n,r);else{const f=gh([...n],r.length);r.push(f)}n.pop()}}}return n.length?r:r.sort((i,s)=>s.score-i.score)}function $o(e,t){for(let n=0,r=e.length;n<r;n++){const o=e[n].matcher(t);if(o)return o}return[]}function ph(e,t,n){const r=new URL(Vu),o=K(u=>{const f=e();try{return new URL(f,r)}catch{return console.error(`Invalid path ${f}`),u}},r,{equals:(u,f)=>u.href===f.href}),i=K(()=>o().pathname),s=K(()=>o().search,!0),a=K(()=>o().hash),l=()=>"",c=Ce(s,()=>Nu(o()));return{get pathname(){return i()},get search(){return s()},get hash(){return a()},get state(){return t()},get key(){return l()},query:n?n(c):Ku(c)}}let Zt;function mh(){return Zt}function vh(e,t,n,r={}){const{signal:[o,i],utils:s={}}=e,a=s.parsePath||(P=>P),l=s.renderPath||(P=>P),c=s.beforeLeave||ku(),u=Qr("",r.base||"");if(u===void 0)throw new Error(`${u} is not a valid base path`);u&&!o().value&&i({value:u,replace:!0,scroll:!1});const[f,d]=B(!1);let h;const g=(P,R)=>{R.value===p()&&R.state===w()||(h===void 0&&d(!0),Zt=P,h=R,df(()=>{h===R&&(v(h.value),m(h.state),C[1]([]))}).finally(()=>{h===R&&ao(()=>{Zt=void 0,P==="navigate"&&z(h),d(!1),h=void 0})}))},[p,v]=B(o().value),[w,m]=B(o().state),y=ph(p,w,s.queryWrapper),x=[],C=B([]),O=K(()=>typeof r.transformUrl=="function"?$o(t(),r.transformUrl(y.pathname)):$o(t(),y.pathname)),L=()=>{const P=O(),R={};for(let S=0;S<P.length;S++)Object.assign(R,P[S].params);return R},_=s.paramsWrapper?s.paramsWrapper(L,t):Ku(L),T={pattern:u,path:()=>u,outlet:()=>null,resolvePath(P){return Qr(u,P)}};return Ke(Ce(o,P=>g("native",P),{defer:!0})),{base:T,location:y,params:_,isRouting:f,renderPath:l,parsePath:a,navigatorFactory:N,matches:O,beforeLeave:c,preloadRoute:ie,singleFlight:r.singleFlight===void 0?!0:r.singleFlight,submissions:C};function V(P,R,S){Me(()=>{if(typeof R=="number"){R&&(s.go?s.go(R):console.warn("Router integration does not support relative routing"));return}const I=!R||R[0]==="?",{replace:M,resolve:F,scroll:D,state:j}={replace:!1,resolve:!I,scroll:!0,...S},H=F?P.resolvePath(R):Qr(I&&y.pathname||"",R);if(H===void 0)throw new Error(`Path '${R}' is not a routable path`);if(x.length>=uh)throw new Error("Too many redirects");const X=p();(H!==X||j!==w())&&(Uf||c.confirm(H,S)&&(x.push({value:X,replace:M,scroll:D,state:w()}),g("navigate",{value:H,state:j})))})}function N(P){return P=P||me(zu)||T,(R,S)=>V(P,R,S)}function z(P){const R=x[0];R&&(i({...P,replace:R.replace,scroll:R.scroll}),x.length=0)}function ie(P,R){const S=$o(t(),P.pathname),I=Zt;Zt="preload";for(let M in S){const{route:F,params:D}=S[M];F.component&&F.component.preload&&F.component.preload();const{preload:j}=F;R&&j&&ts(n(),()=>j({params:D,location:{pathname:P.pathname,search:P.search,hash:P.hash,query:Nu(P),state:null,key:""},intent:"preload"}))}Zt=I}}function yh(e,t,n,r){const{base:o,location:i,params:s}=e,{pattern:a,component:l,preload:c}=r().route,u=K(()=>r().path);l&&l.preload&&l.preload();const f=c?c({params:s,location:i,intent:Zt||"initial"}):void 0;return{parent:t,pattern:a,path:u,outlet:()=>l?b(l,{params:s,location:i,data:f,get children(){return n()}}):n(),resolvePath(h){return Qr(o.path(),h,u())}}}const wh=e=>t=>{const{base:n}=t,r=lo(()=>t.children),o=K(()=>Uu(r(),t.base||""));let i;const s=vh(e,o,()=>i,{base:n,singleFlight:t.singleFlight,transformUrl:t.transformUrl});return e.create&&e.create(s),b(Bu.Provider,{value:s,get children(){return b(bh,{routerState:s,get root(){return t.root},get preload(){return t.rootPreload||t.rootLoad},get children(){return[K(()=>(i=fr())&&null),b(Sh,{routerState:s,get branches(){return o()}})]}})}})};function bh(e){const t=e.routerState.location,n=e.routerState.params,r=K(()=>e.preload&&Me(()=>{e.preload({params:n,location:t,intent:mh()||"initial"})}));return b(Se,{get when(){return e.root},keyed:!0,get fallback(){return e.children},children:o=>b(o,{params:n,location:t,get data(){return r()},get children(){return e.children}})})}function Sh(e){const t=[];let n;const r=K(Ce(e.routerState.matches,(o,i,s)=>{let a=i&&o.length===i.length;const l=[];for(let c=0,u=o.length;c<u;c++){const f=i&&i[c],d=o[c];s&&f&&d.route.key===f.route.key?l[c]=s[c]:(a=!1,t[c]&&t[c](),ln(h=>{t[c]=h,l[c]=yh(e.routerState,l[c-1]||e.routerState.base,Oa(()=>r()[c+1]),()=>e.routerState.matches()[c])}))}return t.splice(o.length).forEach(c=>c()),s&&a?s:(n=l[0],l)}));return Oa(()=>r()&&n)()}const Oa=e=>()=>b(Se,{get when(){return e()},keyed:!0,children:t=>b(zu.Provider,{value:t,get children(){return t.outlet()}})}),xh=e=>{const t=lo(()=>e.children);return A(e,{get children(){return t()}})};function Ch([e,t],n,r){return[e,r?o=>t(r(o)):t]}function Eh(e){let t=!1;const n=o=>typeof o=="string"?{value:o}:o,r=Ch(B(n(e.get()),{equals:(o,i)=>o.value===i.value&&o.state===i.state}),void 0,o=>(!t&&e.set(o),ee.registry&&!ee.done&&(ee.done=!0),o));return e.init&&W(e.init((o=e.get())=>{t=!0,r[1](n(o)),t=!1})),wh({signal:r,create:e.create,utils:e.utils})}function Rh(e,t,n){return e.addEventListener(t,n),()=>e.removeEventListener(t,n)}function Ph(e,t){const n=e&&document.getElementById(e);n?n.scrollIntoView():t&&window.scrollTo(0,0)}const Ih=new Map;function Mh(e=!0,t=!1,n="/_server",r){return o=>{const i=o.base.path(),s=o.navigatorFactory(o.base);let a,l;function c(p){return p.namespaceURI==="http://www.w3.org/2000/svg"}function u(p){if(p.defaultPrevented||p.button!==0||p.metaKey||p.altKey||p.ctrlKey||p.shiftKey)return;const v=p.composedPath().find(O=>O instanceof Node&&O.nodeName.toUpperCase()==="A");if(!v||t&&!v.hasAttribute("link"))return;const w=c(v),m=w?v.href.baseVal:v.href;if((w?v.target.baseVal:v.target)||!m&&!v.hasAttribute("state"))return;const x=(v.getAttribute("rel")||"").split(/\s+/);if(v.hasAttribute("download")||x&&x.includes("external"))return;const C=w?new URL(m,document.baseURI):new URL(m);if(!(C.origin!==window.location.origin||i&&C.pathname&&!C.pathname.toLowerCase().startsWith(i.toLowerCase())))return[v,C]}function f(p){const v=u(p);if(!v)return;const[w,m]=v,y=o.parsePath(m.pathname+m.search+m.hash),x=w.getAttribute("state");p.preventDefault(),s(y,{resolve:!1,replace:w.hasAttribute("replace"),scroll:!w.hasAttribute("noscroll"),state:x?JSON.parse(x):void 0})}function d(p){const v=u(p);if(!v)return;const[w,m]=v;r&&(m.pathname=r(m.pathname)),o.preloadRoute(m,w.getAttribute("preload")!=="false")}function h(p){clearTimeout(a);const v=u(p);if(!v)return l=null;const[w,m]=v;l!==w&&(r&&(m.pathname=r(m.pathname)),a=setTimeout(()=>{o.preloadRoute(m,w.getAttribute("preload")!=="false"),l=w},20))}function g(p){if(p.defaultPrevented)return;let v=p.submitter&&p.submitter.hasAttribute("formaction")?p.submitter.getAttribute("formaction"):p.target.getAttribute("action");if(!v)return;if(!v.startsWith("https://action/")){const m=new URL(v,Vu);if(v=o.parsePath(m.pathname+m.search),!v.startsWith(n))return}if(p.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const w=Ih.get(v);if(w){p.preventDefault();const m=new FormData(p.target,p.submitter);w.call({r:o,f:p.target},p.target.enctype==="multipart/form-data"?m:new URLSearchParams(m))}}Ou(["click","submit"]),document.addEventListener("click",f),e&&(document.addEventListener("mousemove",h,{passive:!0}),document.addEventListener("focusin",d,{passive:!0}),document.addEventListener("touchstart",d,{passive:!0})),document.addEventListener("submit",g),W(()=>{document.removeEventListener("click",f),e&&(document.removeEventListener("mousemove",h),document.removeEventListener("focusin",d),document.removeEventListener("touchstart",d)),document.removeEventListener("submit",g)})}}function Fh(e){const t=()=>{const r=window.location.pathname.replace(/^\/+/,"/")+window.location.search,o=window.history.state&&window.history.state._depth&&Object.keys(window.history.state).length===1?void 0:window.history.state;return{value:r+window.location.hash,state:o}},n=ku();return Eh({get:t,set({value:r,replace:o,scroll:i,state:s}){o?window.history.replaceState(eh(s),"",r):window.history.pushState(s,"",r),Ph(decodeURIComponent(window.location.hash.slice(1)),i),os()},init:r=>Rh(window,"popstate",th(r,o=>{if(o&&o<0)return!n.confirm(o);{const i=t();return!n.confirm(i.value,{state:i.state})}})),create:Mh(e.preload,e.explicitLinks,e.actionBase,e.transformUrl),utils:{go:r=>window.history.go(r),beforeLeave:n}})(e)}const wi=Symbol("store-raw"),xn=Symbol("store-node"),Rt=Symbol("store-has"),qu=Symbol("store-self");function Wu(e){let t=e[it];if(!t&&(Object.defineProperty(e,it,{value:t=new Proxy(e,Oh)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=n.length;o<i;o++){const s=n[o];r[s].get&&Object.defineProperty(e,s,{enumerable:r[s].enumerable,get:r[s].get.bind(t)})}}return t}function Gt(e){let t;return e!=null&&typeof e=="object"&&(e[it]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function cn(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[wi])return n;if(!Gt(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let s=0,a=e.length;s<a;s++)o=e[s],(r=cn(o,t))!==o&&(e[s]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const s=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let l=0,c=s.length;l<c;l++)i=s[l],!a[i].get&&(o=e[i],(r=cn(o,t))!==o&&(e[i]=r))}return e}function to(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function gr(e,t,n){if(e[t])return e[t];const[r,o]=B(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function Ah(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===it||t===xn||(delete n.value,delete n.writable,n.get=()=>e[it][t]),n}function Xu(e){hi()&&gr(to(e,xn),qu)()}function $h(e){return Xu(e),Reflect.ownKeys(e)}const Oh={get(e,t,n){if(t===wi)return e;if(t===it)return n;if(t===fi)return Xu(e),n;const r=to(e,xn),o=r[t];let i=o?o():e[t];if(t===xn||t===Rt||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);hi()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=gr(r,t,i)())}return Gt(i)?Wu(i):i},has(e,t){return t===wi||t===it||t===fi||t===xn||t===Rt||t==="__proto__"?!0:(hi()&&gr(to(e,Rt),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:$h,getOwnPropertyDescriptor:Ah};function Qe(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],i=e.length;n===void 0?(delete e[t],e[Rt]&&e[Rt][t]&&o!==void 0&&e[Rt][t].$()):(e[t]=n,e[Rt]&&e[Rt][t]&&o===void 0&&e[Rt][t].$());let s=to(e,xn),a;if((a=gr(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let l=e.length;l<i;l++)(a=s[l])&&a.$();(a=gr(s,"length",i))&&a.$(e.length)}(a=s[qu])&&a.$()}function Qu(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];Qe(e,o,t[o])}}function Th(e,t){if(typeof t=="function"&&(t=t(e)),t=cn(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const o=t[n];e[n]!==o&&Qe(e,n,o)}Qe(e,"length",r)}else Qu(e,t)}function ir(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const s=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let l=0;l<r.length;l++)ir(e,[r[l]].concat(t),n);return}else if(a&&s==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&ir(e,[l].concat(t),n);return}else if(a&&s==="object"){const{from:l=0,to:c=e.length-1,by:u=1}=r;for(let f=l;f<=c;f+=u)ir(e,[f].concat(t),n);return}else if(t.length>1){ir(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n)}let i=t[0];typeof i=="function"&&(i=i(o,n),i===o)||r===void 0&&i==null||(i=cn(i),r===void 0||Gt(o)&&Gt(i)&&!Array.isArray(i)?Qu(o,i):Qe(e,r,i))}function co(...[e,t]){const n=cn(e||{}),r=Array.isArray(n),o=Wu(n);function i(...s){ao(()=>{r&&s.length===1?Th(n,s[0]):ir(n,s)})}return[o,i]}const bi=Symbol("store-root");function wn(e,t,n,r,o){const i=t[n];if(e===i)return;const s=Array.isArray(e);if(n!==bi&&(!Gt(e)||!Gt(i)||s!==Array.isArray(i)||o&&e[o]!==i[o])){Qe(t,n,e);return}if(s){if(e.length&&i.length&&(!r||o&&e[0]&&e[0][o]!=null)){let c,u,f,d,h,g,p,v;for(f=0,d=Math.min(i.length,e.length);f<d&&(i[f]===e[f]||o&&i[f]&&e[f]&&i[f][o]===e[f][o]);f++)wn(e[f],i,f,r,o);const w=new Array(e.length),m=new Map;for(d=i.length-1,h=e.length-1;d>=f&&h>=f&&(i[d]===e[h]||o&&i[f]&&e[f]&&i[d][o]===e[h][o]);d--,h--)w[h]=i[d];if(f>h||f>d){for(u=f;u<=h;u++)Qe(i,u,e[u]);for(;u<e.length;u++)Qe(i,u,w[u]),wn(e[u],i,u,r,o);i.length>e.length&&Qe(i,"length",e.length);return}for(p=new Array(h+1),u=h;u>=f;u--)g=e[u],v=o&&g?g[o]:g,c=m.get(v),p[u]=c===void 0?-1:c,m.set(v,u);for(c=f;c<=d;c++)g=i[c],v=o&&g?g[o]:g,u=m.get(v),u!==void 0&&u!==-1&&(w[u]=i[c],u=p[u],m.set(v,u));for(u=f;u<e.length;u++)u in w?(Qe(i,u,w[u]),wn(e[u],i,u,r,o)):Qe(i,u,e[u])}else for(let c=0,u=e.length;c<u;c++)wn(e[c],i,c,r,o);i.length>e.length&&Qe(i,"length",e.length);return}const a=Object.keys(e);for(let c=0,u=a.length;c<u;c++)wn(e[a[c]],i,a[c],r,o);const l=Object.keys(i);for(let c=0,u=l.length;c<u;c++)e[l[c]]===void 0&&Qe(i,l[c],void 0)}function Yu(e,t={}){const{merge:n,key:r="id"}=t,o=cn(e);return i=>{if(!Gt(i)||!Gt(o))return o;const s=wn(o,{[bi]:i},bi,n,r);return s===void 0?i:s}}const Dh="/assets/logo-BYNFyja1.png";var Lh=he('<main class="w-full space-y-2.5"><div class="flex flex-row items-center gap-1"><img alt="Hot Updater Console"class="w-12 h-12"><a href=https://github.com/gronxb/hot-updater target=_blank class="text-2xl font-light"rel=noreferrer>Hot Updater Console');function _h({children:e}){return(()=>{var t=Lh(),n=t.firstChild,r=n.firstChild;return Nn(r,"src",Dh),fe(t,e,null),t})()}var Ir=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Kn=typeof window>"u"||"Deno"in globalThis;function Ye(){}function kh(e,t){return typeof e=="function"?e(t):e}function Si(e){return typeof e=="number"&&e>=0&&e!==1/0}function Zu(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Cn(e,t){return typeof e=="function"?e(t):e}function rt(e,t){return typeof e=="function"?e(t):e}function Ta(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==is(s,t.options))return!1}else if(!mr(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function Da(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(pr(t.options.mutationKey)!==pr(i))return!1}else if(!mr(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function is(e,t){return((t==null?void 0:t.queryKeyHashFn)||pr)(e)}function pr(e){return JSON.stringify(e,(t,n)=>Ci(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function mr(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!mr(e[n],t[n])):!1}function Ju(e,t){if(e===t)return e;const n=La(e)&&La(t);if(n||Ci(e)&&Ci(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:i[c];(!n&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(a[u]=void 0,l++):(a[u]=Ju(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function xi(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function La(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ci(e){if(!_a(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!_a(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function _a(e){return Object.prototype.toString.call(e)==="[object Object]"}function Vh(e){return new Promise(t=>{setTimeout(t,e)})}function Ei(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Ju(e,t):t}function Nh(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Kh(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ss=Symbol();function ec(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ss?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Jt,Lt,Pn,pu,jh=(pu=class extends Ir{constructor(){super();J(this,Jt);J(this,Lt);J(this,Pn);q(this,Pn,t=>{if(!Kn&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){E(this,Lt)||this.setEventListener(E(this,Pn))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,Lt))==null||t.call(this),q(this,Lt,void 0))}setEventListener(t){var n;q(this,Pn,t),(n=E(this,Lt))==null||n.call(this),q(this,Lt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){E(this,Jt)!==t&&(q(this,Jt,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof E(this,Jt)=="boolean"?E(this,Jt):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Jt=new WeakMap,Lt=new WeakMap,Pn=new WeakMap,pu),as=new jh,In,_t,Mn,mu,Bh=(mu=class extends Ir{constructor(){super();J(this,In,!0);J(this,_t);J(this,Mn);q(this,Mn,t=>{if(!Kn&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){E(this,_t)||this.setEventListener(E(this,Mn))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,_t))==null||t.call(this),q(this,_t,void 0))}setEventListener(t){var n;q(this,Mn,t),(n=E(this,_t))==null||n.call(this),q(this,_t,t(this.setOnline.bind(this)))}setOnline(t){E(this,In)!==t&&(q(this,In,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return E(this,In)}},In=new WeakMap,_t=new WeakMap,Mn=new WeakMap,mu),no=new Bh;function Ri(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function zh(e){return Math.min(1e3*2**e,3e4)}function tc(e){return(e??"online")==="online"?no.isOnline():!0}var nc=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Oo(e){return e instanceof nc}function rc(e){let t=!1,n=0,r=!1,o;const i=Ri(),s=p=>{var v;r||(d(new nc(p)),(v=e.abort)==null||v.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>as.isFocused()&&(e.networkMode==="always"||no.isOnline())&&e.canRun(),u=()=>tc(e.networkMode)&&e.canRun(),f=p=>{var v;r||(r=!0,(v=e.onSuccess)==null||v.call(e,p),o==null||o(),i.resolve(p))},d=p=>{var v;r||(r=!0,(v=e.onError)==null||v.call(e,p),o==null||o(),i.reject(p))},h=()=>new Promise(p=>{var v;o=w=>{(r||c())&&p(w)},(v=e.onPause)==null||v.call(e)}).then(()=>{var p;o=void 0,r||(p=e.onContinue)==null||p.call(e)}),g=()=>{if(r)return;let p;const v=n===0?e.initialPromise:void 0;try{p=v??e.fn()}catch(w){p=Promise.reject(w)}Promise.resolve(p).then(f).catch(w=>{var O;if(r)return;const m=e.retry??(Kn?0:3),y=e.retryDelay??zh,x=typeof y=="function"?y(n,w):y,C=m===!0||typeof m=="number"&&n<m||typeof m=="function"&&m(n,w);if(t||!C){d(w);return}n++,(O=e.onFail)==null||O.call(e,n,w),Vh(x).then(()=>c()?void 0:h()).then(()=>{t?d(w):g()})})};return{promise:i,cancel:s,continue:()=>(o==null||o(),i),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?g():h().then(g),i)}}function Gh(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0);const i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var Le=Gh(),en,vu,oc=(vu=class{constructor(){J(this,en)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Si(this.gcTime)&&q(this,en,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Kn?1/0:5*60*1e3))}clearGcTimeout(){E(this,en)&&(clearTimeout(E(this,en)),q(this,en,void 0))}},en=new WeakMap,vu),Fn,An,Xe,tn,Oe,Cr,nn,et,Ct,yu,Hh=(yu=class extends oc{constructor(t){super();J(this,et);J(this,Fn);J(this,An);J(this,Xe);J(this,tn);J(this,Oe);J(this,Cr);J(this,nn);q(this,nn,!1),q(this,Cr,t.defaultOptions),this.setOptions(t.options),this.observers=[],q(this,tn,t.client),q(this,Xe,E(this,tn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,q(this,Fn,Uh(this.options)),this.state=t.state??E(this,Fn),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=E(this,Oe))==null?void 0:t.promise}setOptions(t){this.options={...E(this,Cr),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&E(this,Xe).remove(this)}setData(t,n){const r=Ei(this.state.data,t,this.options);return ue(this,et,Ct).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ue(this,et,Ct).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=E(this,Oe))==null?void 0:r.promise;return(o=E(this,Oe))==null||o.cancel(t),n?n.then(Ye).catch(Ye):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(E(this,Fn))}isActive(){return this.observers.some(t=>rt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ss||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!Zu(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=E(this,Oe))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=E(this,Oe))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),E(this,Xe).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(E(this,Oe)&&(E(this,nn)?E(this,Oe).cancel({revert:!0}):E(this,Oe).cancelRetry()),this.scheduleGc()),E(this,Xe).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ue(this,et,Ct).call(this,{type:"invalidate"})}fetch(t,n){var l,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(E(this,Oe))return E(this,Oe).continueRetry(),E(this,Oe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(d=>d.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,o=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(q(this,nn,!0),r.signal)})},i=()=>{const f=ec(this.options,n),d={client:E(this,tn),queryKey:this.queryKey,meta:this.meta};return o(d),q(this,nn,!1),this.options.persister?this.options.persister(f,d,this):f(d)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:E(this,tn),state:this.state,fetchFn:i};o(s),(l=this.options.behavior)==null||l.onFetch(s,this),q(this,An,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=s.fetchOptions)==null?void 0:c.meta))&&ue(this,et,Ct).call(this,{type:"fetch",meta:(u=s.fetchOptions)==null?void 0:u.meta});const a=f=>{var d,h,g,p;Oo(f)&&f.silent||ue(this,et,Ct).call(this,{type:"error",error:f}),Oo(f)||((h=(d=E(this,Xe).config).onError)==null||h.call(d,f,this),(p=(g=E(this,Xe).config).onSettled)==null||p.call(g,this.state.data,f,this)),this.scheduleGc()};return q(this,Oe,rc({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var d,h,g,p;if(f===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(v){a(v);return}(h=(d=E(this,Xe).config).onSuccess)==null||h.call(d,f,this),(p=(g=E(this,Xe).config).onSettled)==null||p.call(g,f,this.state.error,this),this.scheduleGc()},onError:a,onFail:(f,d)=>{ue(this,et,Ct).call(this,{type:"failed",failureCount:f,error:d})},onPause:()=>{ue(this,et,Ct).call(this,{type:"pause"})},onContinue:()=>{ue(this,et,Ct).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),E(this,Oe).start()}},Fn=new WeakMap,An=new WeakMap,Xe=new WeakMap,tn=new WeakMap,Oe=new WeakMap,Cr=new WeakMap,nn=new WeakMap,et=new WeakSet,Ct=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...ic(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return Oo(o)&&o.revert&&E(this,An)?{...E(this,An),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Le.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),E(this,Xe).notify({query:this,type:"updated",action:t})})},yu);function ic(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:tc(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Uh(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ct,wu,qh=(wu=class extends Ir{constructor(t={}){super();J(this,ct);this.config=t,q(this,ct,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??is(o,n);let s=this.get(i);return s||(s=new Hh({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){E(this,ct).has(t.queryHash)||(E(this,ct).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=E(this,ct).get(t.queryHash);n&&(t.destroy(),n===t&&E(this,ct).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Le.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return E(this,ct).get(t)}getAll(){return[...E(this,ct).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Ta(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Ta(t,r)):n}notify(t){Le.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Le.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Le.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ct=new WeakMap,wu),dt,Ve,rn,ft,Dt,bu,Wh=(bu=class extends oc{constructor(t){super();J(this,ft);J(this,dt);J(this,Ve);J(this,rn);this.mutationId=t.mutationId,q(this,Ve,t.mutationCache),q(this,dt,[]),this.state=t.state||Xh(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){E(this,dt).includes(t)||(E(this,dt).push(t),this.clearGcTimeout(),E(this,Ve).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){q(this,dt,E(this,dt).filter(n=>n!==t)),this.scheduleGc(),E(this,Ve).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){E(this,dt).length||(this.state.status==="pending"?this.scheduleGc():E(this,Ve).remove(this))}continue(){var t;return((t=E(this,rn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,f,d,h,g,p,v,w,m,y,x,C,O,L;q(this,rn,rc({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(_,T)=>{ue(this,ft,Dt).call(this,{type:"failed",failureCount:_,error:T})},onPause:()=>{ue(this,ft,Dt).call(this,{type:"pause"})},onContinue:()=>{ue(this,ft,Dt).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>E(this,Ve).canRun(this)}));const n=this.state.status==="pending",r=!E(this,rn).canStart();try{if(!n){ue(this,ft,Dt).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(o=E(this,Ve).config).onMutate)==null?void 0:i.call(o,t,this));const T=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));T!==this.state.context&&ue(this,ft,Dt).call(this,{type:"pending",context:T,variables:t,isPaused:r})}const _=await E(this,rn).start();return await((c=(l=E(this,Ve).config).onSuccess)==null?void 0:c.call(l,_,t,this.state.context,this)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,_,t,this.state.context)),await((h=(d=E(this,Ve).config).onSettled)==null?void 0:h.call(d,_,null,this.state.variables,this.state.context,this)),await((p=(g=this.options).onSettled)==null?void 0:p.call(g,_,null,t,this.state.context)),ue(this,ft,Dt).call(this,{type:"success",data:_}),_}catch(_){try{throw await((w=(v=E(this,Ve).config).onError)==null?void 0:w.call(v,_,t,this.state.context,this)),await((y=(m=this.options).onError)==null?void 0:y.call(m,_,t,this.state.context)),await((C=(x=E(this,Ve).config).onSettled)==null?void 0:C.call(x,void 0,_,this.state.variables,this.state.context,this)),await((L=(O=this.options).onSettled)==null?void 0:L.call(O,void 0,_,t,this.state.context)),_}finally{ue(this,ft,Dt).call(this,{type:"error",error:_})}}finally{E(this,Ve).runNext(this)}}},dt=new WeakMap,Ve=new WeakMap,rn=new WeakMap,ft=new WeakSet,Dt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Le.batch(()=>{E(this,dt).forEach(r=>{r.onMutationUpdate(t)}),E(this,Ve).notify({mutation:this,type:"updated",action:t})})},bu);function Xh(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var It,tt,Er,Su,Qh=(Su=class extends Ir{constructor(t={}){super();J(this,It);J(this,tt);J(this,Er);this.config=t,q(this,It,new Set),q(this,tt,new Map),q(this,Er,0)}build(t,n,r){const o=new Wh({mutationCache:this,mutationId:++Lr(this,Er)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){E(this,It).add(t);const n=kr(t);if(typeof n=="string"){const r=E(this,tt).get(n);r?r.push(t):E(this,tt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(E(this,It).delete(t)){const n=kr(t);if(typeof n=="string"){const r=E(this,tt).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&E(this,tt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=kr(t);if(typeof n=="string"){const r=E(this,tt).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=kr(t);if(typeof n=="string"){const o=(r=E(this,tt).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Le.batch(()=>{E(this,It).forEach(t=>{this.notify({type:"removed",mutation:t})}),E(this,It).clear(),E(this,tt).clear()})}getAll(){return Array.from(E(this,It))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Da(n,r))}findAll(t={}){return this.getAll().filter(n=>Da(t,n))}notify(t){Le.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Le.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ye))))}},It=new WeakMap,tt=new WeakMap,Er=new WeakMap,Su);function kr(e){var t;return(t=e.options.scope)==null?void 0:t.id}function ka(e){return{onFetch:(t,n)=>{var u,f,d,h,g;const r=t.options,o=(d=(f=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:f.fetchMore)==null?void 0:d.direction,i=((h=t.state.data)==null?void 0:h.pages)||[],s=((g=t.state.data)==null?void 0:g.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let p=!1;const v=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},w=ec(t.options,t.fetchOptions),m=async(y,x,C)=>{if(p)return Promise.reject();if(x==null&&y.pages.length)return Promise.resolve(y);const O={client:t.client,queryKey:t.queryKey,pageParam:x,direction:C?"backward":"forward",meta:t.options.meta};v(O);const L=await w(O),{maxPages:_}=t.options,T=C?Kh:Nh;return{pages:T(y.pages,L,_),pageParams:T(y.pageParams,x,_)}};if(o&&i.length){const y=o==="backward",x=y?Yh:Va,C={pages:i,pageParams:s},O=x(r,C);a=await m(C,O,y)}else{const y=e??i.length;do{const x=l===0?s[0]??r.initialPageParam:Va(r,a);if(l>0&&x==null)break;a=await m(a,x),l++}while(l<y)}return a};t.options.persister?t.fetchFn=()=>{var p,v;return(v=(p=t.options).persister)==null?void 0:v.call(p,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Va(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Yh(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var xe,kt,Vt,$n,On,Nt,Tn,Dn,xu,Zh=(xu=class{constructor(t={}){J(this,xe);J(this,kt);J(this,Vt);J(this,$n);J(this,On);J(this,Nt);J(this,Tn);J(this,Dn);q(this,xe,t.queryCache||new qh),q(this,kt,t.mutationCache||new Qh),q(this,Vt,t.defaultOptions||{}),q(this,$n,new Map),q(this,On,new Map),q(this,Nt,0)}mount(){Lr(this,Nt)._++,E(this,Nt)===1&&(q(this,Tn,as.subscribe(async t=>{t&&(await this.resumePausedMutations(),E(this,xe).onFocus())})),q(this,Dn,no.subscribe(async t=>{t&&(await this.resumePausedMutations(),E(this,xe).onOnline())})))}unmount(){var t,n;Lr(this,Nt)._--,E(this,Nt)===0&&((t=E(this,Tn))==null||t.call(this),q(this,Tn,void 0),(n=E(this,Dn))==null||n.call(this),q(this,Dn,void 0))}isFetching(t){return E(this,xe).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return E(this,kt).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const n=this.defaultQueryOptions({queryKey:t});return(r=E(this,xe).get(n.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const n=this.defaultQueryOptions(t),r=E(this,xe).build(this,n),o=r.state.data;return o===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(Cn(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(o))}getQueriesData(t){return E(this,xe).findAll(t).map(({queryKey:n,state:r})=>{const o=r.data;return[n,o]})}setQueryData(t,n,r){const o=this.defaultQueryOptions({queryKey:t}),i=E(this,xe).get(o.queryHash),s=i==null?void 0:i.state.data,a=kh(n,s);if(a!==void 0)return E(this,xe).build(this,o).setData(a,{...r,manual:!0})}setQueriesData(t,n,r){return Le.batch(()=>E(this,xe).findAll(t).map(({queryKey:o})=>[o,this.setQueryData(o,n,r)]))}getQueryState(t){var r;const n=this.defaultQueryOptions({queryKey:t});return(r=E(this,xe).get(n.queryHash))==null?void 0:r.state}removeQueries(t){const n=E(this,xe);Le.batch(()=>{n.findAll(t).forEach(r=>{n.remove(r)})})}resetQueries(t,n){const r=E(this,xe),o={type:"active",...t};return Le.batch(()=>(r.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(o,n)))}cancelQueries(t,n={}){const r={revert:!0,...n},o=Le.batch(()=>E(this,xe).findAll(t).map(i=>i.cancel(r)));return Promise.all(o).then(Ye).catch(Ye)}invalidateQueries(t,n={}){return Le.batch(()=>{if(E(this,xe).findAll(t).forEach(o=>{o.invalidate()}),(t==null?void 0:t.refetchType)==="none")return Promise.resolve();const r={...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"};return this.refetchQueries(r,n)})}refetchQueries(t,n={}){const r={...n,cancelRefetch:n.cancelRefetch??!0},o=Le.batch(()=>E(this,xe).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,r);return r.throwOnError||(s=s.catch(Ye)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(o).then(Ye)}fetchQuery(t){const n=this.defaultQueryOptions(t);n.retry===void 0&&(n.retry=!1);const r=E(this,xe).build(this,n);return r.isStaleByTime(Cn(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Ye).catch(Ye)}fetchInfiniteQuery(t){return t.behavior=ka(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Ye).catch(Ye)}ensureInfiniteQueryData(t){return t.behavior=ka(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return no.isOnline()?E(this,kt).resumePausedMutations():Promise.resolve()}getQueryCache(){return E(this,xe)}getMutationCache(){return E(this,kt)}getDefaultOptions(){return E(this,Vt)}setDefaultOptions(t){q(this,Vt,t)}setQueryDefaults(t,n){E(this,$n).set(pr(t),{queryKey:t,defaultOptions:n})}getQueryDefaults(t){const n=[...E(this,$n).values()],r={};return n.forEach(o=>{mr(t,o.queryKey)&&Object.assign(r,o.defaultOptions)}),r}setMutationDefaults(t,n){E(this,On).set(pr(t),{mutationKey:t,defaultOptions:n})}getMutationDefaults(t){const n=[...E(this,On).values()];let r={};return n.forEach(o=>{mr(t,o.mutationKey)&&(r={...r,...o.defaultOptions})}),r}defaultQueryOptions(t){if(t._defaulted)return t;const n={...E(this,Vt).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return n.queryHash||(n.queryHash=is(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===ss&&(n.enabled=!1),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...E(this,Vt).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){E(this,xe).clear(),E(this,kt).clear()}},xe=new WeakMap,kt=new WeakMap,Vt=new WeakMap,$n=new WeakMap,On=new WeakMap,Nt=new WeakMap,Tn=new WeakMap,Dn=new WeakMap,xu),je,ce,Rr,Ne,on,Ln,Kt,ht,Pr,_n,kn,sn,an,jt,Vn,pe,sr,Pi,Ii,Mi,Fi,Ai,$i,Oi,sc,Cu,Jh=(Cu=class extends Ir{constructor(t,n){super();J(this,pe);J(this,je);J(this,ce);J(this,Rr);J(this,Ne);J(this,on);J(this,Ln);J(this,Kt);J(this,ht);J(this,Pr);J(this,_n);J(this,kn);J(this,sn);J(this,an);J(this,jt);J(this,Vn,new Set);this.options=n,q(this,je,t),q(this,ht,null),q(this,Kt,Ri()),this.options.experimental_prefetchInRender||E(this,Kt).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(E(this,ce).addObserver(this),Na(E(this,ce),this.options)?ue(this,pe,sr).call(this):this.updateResult(),ue(this,pe,Fi).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ti(E(this,ce),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ti(E(this,ce),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ue(this,pe,Ai).call(this),ue(this,pe,$i).call(this),E(this,ce).removeObserver(this)}setOptions(t,n){const r=this.options,o=E(this,ce);if(this.options=E(this,je).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof rt(this.options.enabled,E(this,ce))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ue(this,pe,Oi).call(this),E(this,ce).setOptions(this.options),r._defaulted&&!xi(this.options,r)&&E(this,je).getQueryCache().notify({type:"observerOptionsUpdated",query:E(this,ce),observer:this});const i=this.hasListeners();i&&Ka(E(this,ce),o,this.options,r)&&ue(this,pe,sr).call(this),this.updateResult(n),i&&(E(this,ce)!==o||rt(this.options.enabled,E(this,ce))!==rt(r.enabled,E(this,ce))||Cn(this.options.staleTime,E(this,ce))!==Cn(r.staleTime,E(this,ce)))&&ue(this,pe,Pi).call(this);const s=ue(this,pe,Ii).call(this);i&&(E(this,ce)!==o||rt(this.options.enabled,E(this,ce))!==rt(r.enabled,E(this,ce))||s!==E(this,jt))&&ue(this,pe,Mi).call(this,s)}getOptimisticResult(t){const n=E(this,je).getQueryCache().build(E(this,je),t),r=this.createResult(n,t);return tg(this,r)&&(q(this,Ne,r),q(this,Ln,this.options),q(this,on,E(this,ce).state)),r}getCurrentResult(){return E(this,Ne)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){E(this,Vn).add(t)}getCurrentQuery(){return E(this,ce)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=E(this,je).defaultQueryOptions(t),r=E(this,je).getQueryCache().build(E(this,je),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ue(this,pe,sr).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),E(this,Ne)))}createResult(t,n){var _;const r=E(this,ce),o=this.options,i=E(this,Ne),s=E(this,on),a=E(this,Ln),c=t!==r?t.state:E(this,Rr),{state:u}=t;let f={...u},d=!1,h;if(n._optimisticResults){const T=this.hasListeners(),V=!T&&Na(t,n),N=T&&Ka(t,r,n,o);(V||N)&&(f={...f,...ic(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:g,errorUpdatedAt:p,status:v}=f;if(n.select&&f.data!==void 0)if(i&&f.data===(s==null?void 0:s.data)&&n.select===E(this,Pr))h=E(this,_n);else try{q(this,Pr,n.select),h=n.select(f.data),h=Ei(i==null?void 0:i.data,h,n),q(this,_n,h),q(this,ht,null)}catch(T){q(this,ht,T)}else h=f.data;if(n.placeholderData!==void 0&&h===void 0&&v==="pending"){let T;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))T=i.data;else if(T=typeof n.placeholderData=="function"?n.placeholderData((_=E(this,kn))==null?void 0:_.state.data,E(this,kn)):n.placeholderData,n.select&&T!==void 0)try{T=n.select(T),q(this,ht,null)}catch(V){q(this,ht,V)}T!==void 0&&(v="success",h=Ei(i==null?void 0:i.data,T,n),d=!0)}E(this,ht)&&(g=E(this,ht),h=E(this,_n),p=Date.now(),v="error");const w=f.fetchStatus==="fetching",m=v==="pending",y=v==="error",x=m&&w,C=h!==void 0,L={status:v,fetchStatus:f.fetchStatus,isPending:m,isSuccess:v==="success",isError:y,isInitialLoading:x,isLoading:x,data:h,dataUpdatedAt:f.dataUpdatedAt,error:g,errorUpdatedAt:p,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:w,isRefetching:w&&!m,isLoadingError:y&&!C,isPaused:f.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:y&&C,isStale:ls(t,n),refetch:this.refetch,promise:E(this,Kt)};if(this.options.experimental_prefetchInRender){const T=z=>{L.status==="error"?z.reject(L.error):L.data!==void 0&&z.resolve(L.data)},V=()=>{const z=q(this,Kt,L.promise=Ri());T(z)},N=E(this,Kt);switch(N.status){case"pending":t.queryHash===r.queryHash&&T(N);break;case"fulfilled":(L.status==="error"||L.data!==N.value)&&V();break;case"rejected":(L.status!=="error"||L.error!==N.reason)&&V();break}}return L}updateResult(t){const n=E(this,Ne),r=this.createResult(E(this,ce),this.options);if(q(this,on,E(this,ce).state),q(this,Ln,this.options),E(this,on).data!==void 0&&q(this,kn,E(this,ce)),xi(r,n))return;q(this,Ne,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!E(this,Vn).size)return!0;const l=new Set(a??E(this,Vn));return this.options.throwOnError&&l.add("error"),Object.keys(E(this,Ne)).some(c=>{const u=c;return E(this,Ne)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),ue(this,pe,sc).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ue(this,pe,Fi).call(this)}},je=new WeakMap,ce=new WeakMap,Rr=new WeakMap,Ne=new WeakMap,on=new WeakMap,Ln=new WeakMap,Kt=new WeakMap,ht=new WeakMap,Pr=new WeakMap,_n=new WeakMap,kn=new WeakMap,sn=new WeakMap,an=new WeakMap,jt=new WeakMap,Vn=new WeakMap,pe=new WeakSet,sr=function(t){ue(this,pe,Oi).call(this);let n=E(this,ce).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ye)),n},Pi=function(){ue(this,pe,Ai).call(this);const t=Cn(this.options.staleTime,E(this,ce));if(Kn||E(this,Ne).isStale||!Si(t))return;const r=Zu(E(this,Ne).dataUpdatedAt,t)+1;q(this,sn,setTimeout(()=>{E(this,Ne).isStale||this.updateResult()},r))},Ii=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(E(this,ce)):this.options.refetchInterval)??!1},Mi=function(t){ue(this,pe,$i).call(this),q(this,jt,t),!(Kn||rt(this.options.enabled,E(this,ce))===!1||!Si(E(this,jt))||E(this,jt)===0)&&q(this,an,setInterval(()=>{(this.options.refetchIntervalInBackground||as.isFocused())&&ue(this,pe,sr).call(this)},E(this,jt)))},Fi=function(){ue(this,pe,Pi).call(this),ue(this,pe,Mi).call(this,ue(this,pe,Ii).call(this))},Ai=function(){E(this,sn)&&(clearTimeout(E(this,sn)),q(this,sn,void 0))},$i=function(){E(this,an)&&(clearInterval(E(this,an)),q(this,an,void 0))},Oi=function(){const t=E(this,je).getQueryCache().build(E(this,je),this.options);if(t===E(this,ce))return;const n=E(this,ce);q(this,ce,t),q(this,Rr,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},sc=function(t){Le.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(E(this,Ne))}),E(this,je).getQueryCache().notify({query:E(this,ce),type:"observerResultsUpdated"})})},Cu);function eg(e,t){return rt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Na(e,t){return eg(e,t)||e.state.data!==void 0&&Ti(e,t,t.refetchOnMount)}function Ti(e,t,n){if(rt(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&ls(e,t)}return!1}function Ka(e,t,n,r){return(e!==t||rt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ls(e,n)}function ls(e,t){return rt(t.enabled,e)!==!1&&e.isStaleByTime(Cn(t.staleTime,e))}function tg(e,t){return!xi(e.getCurrentResult(),t)}function ng(e){return e}function rg(e,t,n){var l;if(typeof t!="object"||t===null)return;const r=e.getMutationCache(),o=e.getQueryCache(),i=((l=e.getDefaultOptions().hydrate)==null?void 0:l.deserializeData)??ng,s=t.mutations||[],a=t.queries||[];s.forEach(({state:c,...u})=>{var f,d;r.build(e,{...(f=e.getDefaultOptions().hydrate)==null?void 0:f.mutations,...(d=n==null?void 0:n.defaultOptions)==null?void 0:d.mutations,...u},c)}),a.forEach(({queryKey:c,state:u,queryHash:f,meta:d,promise:h})=>{var v,w;let g=o.get(f);const p=u.data===void 0?u.data:i(u.data);if(g){if(g.state.dataUpdatedAt<u.dataUpdatedAt){const{fetchStatus:m,...y}=u;g.setState({...y,data:p})}}else g=o.build(e,{...(v=e.getDefaultOptions().hydrate)==null?void 0:v.queries,...(w=n==null?void 0:n.defaultOptions)==null?void 0:w.queries,queryKey:c,queryHash:f,meta:d},{...u,data:p,fetchStatus:"idle"});if(h){const m=Promise.resolve(h).then(i);g.fetch(void 0,{initialPromise:m})}})}var og=class extends Zh{constructor(e={}){super(e)}},ac=we(void 0),lc=e=>{const t=me(ac);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t()},ig=e=>(Ke(t=>(t==null||t(),e.client.mount(),e.client.unmount.bind(e.client))),W(()=>e.client.unmount()),b(ac.Provider,{value:()=>e.client,get children(){return e.children}}));function sg(e,t){return typeof e=="function"?e(...t):!!e}var uc=we(()=>!1),ag=()=>me(uc);uc.Provider;function lg(e,t,n,r){if(n===!1)return t;if(typeof n=="function"){const s=n(e.data,t.data);return{...t,data:s}}let o=t.data;if(e.data===void 0)try{o=structuredClone(o)}catch{}const i=Yu(o,{key:n})(e.data);return{...t,data:i}}var ug=(e,t)=>t;function cg(e,t,n){const r=K(()=>lc()),o=ag(),i=K(()=>{const x=r().defaultQueryOptions(e());return x._optimisticResults=o()?"isRestoring":"optimistic",x.structuralSharing=!1,x}),s=i(),[a,l]=B(new t(r(),i()));let c=a().getOptimisticResult(i());const[u,f]=co(c),d=()=>a().subscribe(C=>{c=C,queueMicrotask(()=>{p&&m()})});function h(x){const C=a().options,O=C.reconcile;f(L=>lg(L,x,O===void 0?!1:O,C.queryHash))}function g(){return[()=>u,x=>{const C=cn(u);if(typeof x=="function"&&(x=x(C)),x!=null&&x.hydrationData){const{hydrationData:O,...L}=x;x=L}h(x)}]}let p=null,v=null;const[w,{refetch:m}]=cf(()=>{const x=a();return new Promise((C,O)=>{if(v=C,!p&&!o()&&(p=d()),x.updateResult(),c.isError&&!c.isFetching&&!o()&&sg(x.options.throwOnError,[c.error,x.getCurrentQuery()]))return h(c),O(c.error);if(!c.isLoading)return v=null,C(ug(x.getCurrentQuery(),c));h(c)})},{storage:g,get deferStream(){return e().deferStream},onHydrated(x,C){if(C.value&&"hydrationData"in C.value&&rg(r(),{queries:[{...C.value.hydrationData}]}),p)return;const O={...s};(s.staleTime||!s.initialData)&&C.value&&(O.refetchOnMount=!1),a().setOptions(O),h(a().getOptimisticResult(O)),p=d()}});Mt(Ce(r,x=>{p&&p();const C=new t(x,i());p=d(),l(C)},{defer:!0})),Mt(Ce(o,x=>{x||m()},{defer:!0})),W(()=>{p&&(p(),p=null),v&&(v(c),v=null)}),Mt(Ce([a,i],([x,C])=>{x.setOptions(C),h(x.getOptimisticResult(C)),m()},{defer:!0}));const y={get(x,C){var O,L;return C==="data"?u.data!==void 0?(O=w.latest)==null?void 0:O.data:(L=w())==null?void 0:L.data:Reflect.get(x,C)}};return new Proxy(u,y)}function fo(e,t){return cg(K(()=>e()),Jh)}function dg(e){return(...t)=>{for(const n of e)n&&n(...t)}}var $=e=>typeof e=="function"&&!e.length?e():e,ja=e=>Array.isArray(e)?e:e?[e]:[];function fg(e,...t){return typeof e=="function"?e(...t):e}var hg=W;function gg(e,t,n,r){return e.addEventListener(t,n,r),hg(e.removeEventListener.bind(e,t,n,r))}function pg(e,t,n,r){const o=()=>{ja($(e)).forEach(i=>{i&&ja($(t)).forEach(s=>gg(i,s,n,r))})};typeof e=="function"?U(o):Ke(o)}var mg=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Ba(e){const t={};let n;for(;n=mg.exec(e);)t[n[1]]=n[2];return t}function vt(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=Ba(e)}else typeof t=="string"&&(t=Ba(t));return{...e,...t}}function ve(...e){return dg(e)}function vg(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function Di(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function yg(e){return typeof e=="number"}function bn(e){return Object.prototype.toString.call(e)==="[object String]"}function us(e){return typeof e=="function"}function yt(e){return t=>`${e()}-${t}`}function _e(e,t){return e?e===t||e.contains(t):!1}function ar(e,t=!1){const{activeElement:n}=Ze(e);if(!(n!=null&&n.nodeName))return null;if(dc(n)&&n.contentDocument)return ar(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=Ze(n).getElementById(r);if(o)return o}}return n}function cc(e){return Ze(e).defaultView||window}function Ze(e){return e?e.ownerDocument||e:document}function dc(e){return e.tagName==="IFRAME"}var cs=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(cs||{});function ds(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)==null?void 0:t.platform)||window.navigator.platform):!1}function ho(){return ds(/^Mac/i)}function wg(){return ds(/^iPhone/i)}function bg(){return ds(/^iPad/i)||ho()&&navigator.maxTouchPoints>1}function Sg(){return wg()||bg()}function xg(){return ho()||Sg()}function oe(e,t){return t&&(us(t)?t(e):t[0](t[1],e)),e==null?void 0:e.defaultPrevented}function be(e){return t=>{for(const n of e)oe(t,n)}}function Cg(e){return ho()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Ie(e){if(e)if(Eg())e.focus({preventScroll:!0});else{const t=Rg(e);e.focus(),Pg(t)}}var Vr=null;function Eg(){if(Vr==null){Vr=!1;try{document.createElement("div").focus({get preventScroll(){return Vr=!0,!0}})}catch{}}return Vr}function Rg(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function Pg(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var fc=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],Ig=[...fc,'[tabindex]:not([tabindex="-1"]):not([disabled])'],fs=`${fc.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,Mg=Ig.join(':not([hidden]):not([tabindex="-1"]),');function hc(e,t){const r=Array.from(e.querySelectorAll(fs)).filter(za);return t&&za(e)&&r.unshift(e),r.forEach((o,i)=>{if(dc(o)&&o.contentDocument){const s=o.contentDocument.body,a=hc(s,!1);r.splice(i,1,...a)}}),r}function za(e){return gc(e)&&!Fg(e)}function gc(e){return e.matches(fs)&&hs(e)}function Fg(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function hs(e,t){return e.nodeName!=="#comment"&&Ag(e)&&$g(e,t)&&(!e.parentElement||hs(e.parentElement,e))}function Ag(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:o}=e.ownerDocument.defaultView,{display:i,visibility:s}=o(e);r=i!=="none"&&s!=="hidden"&&s!=="collapse"}return r}function $g(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function Og(e,t,n){const r=t!=null&&t.tabbable?Mg:fs,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(i){var s;return(s=t==null?void 0:t.from)!=null&&s.contains(i)?NodeFilter.FILTER_REJECT:i.matches(r)&&hs(i)&&(!(t!=null&&t.accept)||t.accept(i))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t!=null&&t.from&&(o.currentNode=t.from),o}function Ga(e){let t=e;for(;t&&!Tg(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function Tg(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Dg(){}function Lg(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=i,a=0,l=s-1;a<s;l=a++){const[c,u]=t[a],[f,d]=t[l],[,h]=t[l===0?s-1:l-1]||[0,0],g=(u-d)*(n-c)-(c-f)*(r-u);if(d<u){if(r>=d&&r<u){if(g===0)return!0;g>0&&(r===d?r>h&&(o=!o):o=!o)}}else if(u<d){if(r>u&&r<=d){if(g===0)return!0;g<0&&(r===d?r<h&&(o=!o):o=!o)}}else if(r===u&&(n>=f&&n<=c||n>=c&&n<=f))return!0}return o}function Z(e,t){return A(e,t)}var Yn=new Map,Ha=new Set;function Ua(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Yn.get(n.target);r||(r=new Set,Yn.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Yn.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Yn.delete(n.target)),Yn.size===0)){for(const o of Ha)o();Ha.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?Ua():document.addEventListener("DOMContentLoaded",Ua));function Li(e,t){const n=qa(e,t,"left"),r=qa(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const l=s+e.offsetWidth,c=a+e.offsetHeight;n<=s?s=n:n+o>l&&(s+=n+o-l),r<=a?a=r:r+i>c&&(a+=r+i-c),e.scrollLeft=s,e.scrollTop=a}function qa(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}function _g(e,t){var n,r;if(document.contains(e)){const o=document.scrollingElement||document.documentElement;if(window.getComputedStyle(o).overflow==="hidden"){let s=Ga(e);for(;e&&s&&e!==o&&s!==o;)Li(s,e),e=s,s=Ga(e)}else{const{left:s,top:a}=e.getBoundingClientRect();(n=e==null?void 0:e.scrollIntoView)==null||n.call(e,{block:"nearest"});const{left:l,top:c}=e.getBoundingClientRect();(Math.abs(s-l)>1||Math.abs(a-c)>1)&&((r=e.scrollIntoView)==null||r.call(e,{block:"nearest"}))}}}var pc={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"},vr="data-kb-top-layer",mc,_i=!1,Ft=[];function yr(e){return Ft.findIndex(t=>t.node===e)}function kg(e){return Ft[yr(e)]}function Vg(e){return Ft[Ft.length-1].node===e}function vc(){return Ft.filter(e=>e.isPointerBlocking)}function Ng(){return[...vc()].slice(-1)[0]}function gs(){return vc().length>0}function yc(e){var n;const t=yr((n=Ng())==null?void 0:n.node);return yr(e)<t}function Kg(e){Ft.push(e)}function jg(e){const t=yr(e);t<0||Ft.splice(t,1)}function Bg(){for(const{node:e}of Ft)e.style.pointerEvents=yc(e)?"none":"auto"}function zg(e){if(gs()&&!_i){const t=Ze(e);mc=document.body.style.pointerEvents,t.body.style.pointerEvents="none",_i=!0}}function Gg(e){if(gs())return;const t=Ze(e);t.body.style.pointerEvents=mc,t.body.style.length===0&&t.body.removeAttribute("style"),_i=!1}var ze={layers:Ft,isTopMostLayer:Vg,hasPointerBlockingLayer:gs,isBelowPointerBlockingLayer:yc,addLayer:Kg,removeLayer:jg,indexOf:yr,find:kg,assignPointerEventToLayers:Bg,disableBodyPointerEvents:zg,restoreBodyPointerEvents:Gg};function go(e,t){const[n,r]=B(Wa(t==null?void 0:t()));return U(()=>{var o;r(((o=e())==null?void 0:o.tagName.toLowerCase())||Wa(t==null?void 0:t()))}),n}function Wa(e){return bn(e)?e:void 0}function ae(e){const[t,n]=k(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return b(Lu,A(n,{get component(){return t.as}}))}var Hg=Object.defineProperty,Xt=(e,t)=>{for(var n in t)Hg(e,n,{get:t[n],enumerable:!0})},Ug={};Xt(Ug,{Button:()=>Xg,Root:()=>wt});var qg=["button","color","file","image","reset","submit"];function Wg(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?qg.indexOf(e.type)!==-1:!1}function wt(e){let t;const n=Z({type:"button"},e),[r,o]=k(n,["ref","type","disabled"]),i=go(()=>t,()=>"button"),s=K(()=>{const c=i();return c==null?!1:Wg({tagName:c,type:r.type})}),a=K(()=>i()==="input"),l=K(()=>i()==="a"&&(t==null?void 0:t.getAttribute("href"))!=null);return b(ae,A({as:"button",ref(c){var u=ve(f=>t=f,r.ref);typeof u=="function"&&u(c)},get type(){return s()||a()?r.type:void 0},get role(){return!s()&&!l()?"button":void 0},get tabIndex(){return!s()&&!l()&&!r.disabled?0:void 0},get disabled(){return s()||a()?r.disabled:void 0},get"aria-disabled"(){return!s()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},o))}var Xg=wt;function Be(e){return t=>(e(t),()=>e(void 0))}var Te=e=>typeof e=="function"?e():e,Qg=e=>{const t=K(()=>{const s=Te(e.element);if(s)return getComputedStyle(s)}),n=()=>{var s;return((s=t())==null?void 0:s.animationName)??"none"},[r,o]=B(Te(e.show)?"present":"hidden");let i="none";return U(s=>{const a=Te(e.show);return Me(()=>{var u;if(s===a)return a;const l=i,c=n();a?o("present"):c==="none"||((u=t())==null?void 0:u.display)==="none"?o("hidden"):o(s===!0&&l!==c?"hiding":"hidden")}),a}),U(()=>{const s=Te(e.element);if(!s)return;const a=c=>{c.target===s&&(i=n())},l=c=>{const f=n().includes(c.animationName);c.target===s&&f&&r()==="hiding"&&o("hidden")};s.addEventListener("animationstart",a),s.addEventListener("animationcancel",l),s.addEventListener("animationend",l),W(()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",l),s.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:o}},Yg=Qg,wr=Yg,Zg={};Xt(Zg,{CloseButton:()=>ps,Description:()=>ms,List:()=>ys,ProgressFill:()=>Sc,ProgressTrack:()=>xc,Region:()=>bs,Root:()=>Ss,Title:()=>xs,Toast:()=>pp,toaster:()=>Cs});var wc=we();function po(){const e=me(wc);if(e===void 0)throw new Error("[kobalte]: `useToastContext` must be used within a `Toast.Root` component");return e}function ps(e){const t=po(),[n,r]=k(e,["aria-label","onClick"]);return b(wt,A({get"aria-label"(){return n["aria-label"]||t.translations().close},onClick:i=>{oe(i,n.onClick),t.close()}},r))}function ms(e){const t=po(),n=Z({id:t.generateId("description")},e),[r,o]=k(n,["id"]);return U(()=>W(t.registerDescriptionId(r.id))),b(ae,A({as:"div",get id(){return r.id}},o))}var bc=we();function vs(){const e=me(bc);if(e===void 0)throw new Error("[kobalte]: `useToastRegionContext` must be used within a `Toast.Region` component");return e}function ys(e){let t;const n=vs(),[r,o]=k(e,["ref","onFocusIn","onFocusOut","onPointerMove","onPointerLeave"]),i=c=>{oe(c,r.onFocusIn),n.pauseOnInteraction()&&!n.isPaused()&&n.pauseAllTimer()},s=c=>{oe(c,r.onFocusOut),_e(t,c.relatedTarget)||n.resumeAllTimer()},a=c=>{oe(c,r.onPointerMove),n.pauseOnInteraction()&&!n.isPaused()&&n.pauseAllTimer()},l=c=>{oe(c,r.onPointerLeave),_e(t,Ze(t).activeElement)||n.resumeAllTimer()};return U(Ce([()=>t,()=>n.hotkey()],([c,u])=>{if(!c)return;const f=Ze(c),d=h=>{u.every(p=>h[p]||h.code===p)&&Ie(c)};f.addEventListener("keydown",d),W(()=>f.removeEventListener("keydown",d))})),U(()=>{if(!n.pauseOnPageIdle())return;const c=cc(t);c.addEventListener("blur",n.pauseAllTimer),c.addEventListener("focus",n.resumeAllTimer),W(()=>{c.removeEventListener("blur",n.pauseAllTimer),c.removeEventListener("focus",n.resumeAllTimer)})}),b(ae,A({as:"ol",ref(c){var u=ve(f=>t=f,r.ref);typeof u=="function"&&u(c)},tabIndex:-1,onFocusIn:i,onFocusOut:s,onPointerMove:a,onPointerLeave:l},o,{get children(){return b(nt,{get each(){return n.toasts()},children:c=>c.toastComponent({get toastId(){return c.id}})})}}))}function Sc(e){const t=vs(),n=po(),[r,o]=k(e,["style"]),[i,s]=B(100);let a=0;return U(()=>{if(t.isPaused()||n.isPersistent())return;const l=setInterval(()=>{const c=new Date().getTime()-n.closeTimerStartTime()+a,u=Math.trunc(100-c/n.duration()*100);s(u<0?0:u)});W(()=>{a+=new Date().getTime()-n.closeTimerStartTime(),clearInterval(l)})}),b(ae,A({as:"div",get style(){return vt({"--kb-toast-progress-fill-width":`${i()}%`},r.style)}},o))}function xc(e){return b(ae,A({as:"div","aria-hidden":"true",role:"presentation"},e))}var[ws,Mr]=co({toasts:[]});function Jg(e){Mr("toasts",t=>[...t,e])}function ep(e){return ws.toasts.find(t=>t.id===e)}function tp(e,t){const n=ws.toasts.findIndex(r=>r.id===e);n!==-1&&Mr("toasts",r=>[...r.slice(0,n),t,...r.slice(n+1)])}function np(e){Mr("toasts",t=>t.id===e,"dismiss",!0)}function rp(e){Mr("toasts",t=>t.filter(n=>n.id!==e))}function op(){Mr("toasts",[])}var dn={toasts:()=>ws.toasts,add:Jg,get:ep,update:tp,dismiss:np,remove:rp,clear:op},Xa="{hotkey}",ip={close:"Close"},sp={notifications:e=>`Notifications (${e})`};function bs(e){const t=Z({id:`toast-region-${Ee()}`,hotkey:["altKey","KeyT"],duration:5e3,limit:3,swipeDirection:"right",swipeThreshold:50,pauseOnInteraction:!0,pauseOnPageIdle:!0,topLayer:!0,translations:sp},e),[n,r]=k(t,["translations","style","hotkey","duration","limit","swipeDirection","swipeThreshold","pauseOnInteraction","pauseOnPageIdle","topLayer","aria-label","regionId"]),o=K(()=>dn.toasts().filter(d=>d.region===n.regionId&&d.dismiss===!1).slice(0,n.limit)),[i,s]=B(!1),a=()=>o().length>0,l=()=>n.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,""),c=()=>(n["aria-label"]||n.translations.notifications(Xa)).replace(Xa,l()),u=()=>({[vr]:n.topLayer?"":void 0}),f={isPaused:i,toasts:o,hotkey:()=>n.hotkey,duration:()=>n.duration,swipeDirection:()=>n.swipeDirection,swipeThreshold:()=>n.swipeThreshold,pauseOnInteraction:()=>n.pauseOnInteraction,pauseOnPageIdle:()=>n.pauseOnPageIdle,pauseAllTimer:()=>s(!0),resumeAllTimer:()=>s(!1),generateId:yt(()=>r.id)};return b(bc.Provider,{value:f,get children(){return b(ae,A({as:"div",role:"region",tabIndex:-1,get"aria-label"(){return c()},get style(){return vt({"pointer-events":a()?n.topLayer?"auto":void 0:"none"},n.style)}},u,r))}})}var ap="toast.swipeStart",lp="toast.swipeMove",up="toast.swipeCancel",cp="toast.swipeEnd";function Ss(e){const t=vs(),n=Z({id:`toast-${Ee()}`,priority:"high",translations:ip},e),[r,o]=k(n,["ref","translations","toastId","style","priority","duration","persistent","onPause","onResume","onSwipeStart","onSwipeMove","onSwipeCancel","onSwipeEnd","onEscapeKeyDown","onKeyDown","onPointerDown","onPointerMove","onPointerUp"]),[i,s]=B(!0),[a,l]=B(),[c,u]=B(),[f,d]=B(!0),[h,g]=B(),{present:p}=wr({show:i,element:()=>h()??null}),v=K(()=>r.duration||t.duration());let w,m=0,y=v(),x=null,C=null;const O=()=>{s(!1),d(!0)},L=()=>{dn.remove(r.toastId)},_=S=>{!S||r.persistent||(window.clearTimeout(w),m=new Date().getTime(),w=window.setTimeout(O,S))},T=()=>{var S;_(y),(S=r.onResume)==null||S.call(r)},V=()=>{var I;const S=new Date().getTime()-m;y=y-S,window.clearTimeout(w),(I=r.onPause)==null||I.call(r)},N=S=>{var I;oe(S,r.onKeyDown),S.key==="Escape"&&((I=r.onEscapeKeyDown)==null||I.call(r,S),S.defaultPrevented||O())},z=S=>{oe(S,r.onPointerDown),S.button===0&&(x={x:S.clientX,y:S.clientY})},ie=S=>{if(oe(S,r.onPointerMove),!x)return;const I=S.clientX-x.x,M=S.clientY-x.y,F=!!C,D=["left","right"].includes(t.swipeDirection()),j=["left","up"].includes(t.swipeDirection())?Math.min:Math.max,H=D?j(0,I):0,X=D?0:j(0,M),le=S.pointerType==="touch"?10:2,ne={x:H,y:X},Ae={originalEvent:S,delta:ne};if(F){C=ne,Nr(lp,r.onSwipeMove,Ae);const{x:Je,y:te}=ne;S.currentTarget.setAttribute("data-swipe","move"),S.currentTarget.style.setProperty("--kb-toast-swipe-move-x",`${Je}px`),S.currentTarget.style.setProperty("--kb-toast-swipe-move-y",`${te}px`)}else Qa(ne,t.swipeDirection(),le)?(C=ne,Nr(ap,r.onSwipeStart,Ae),S.currentTarget.setAttribute("data-swipe","start"),S.target.setPointerCapture(S.pointerId)):(Math.abs(I)>le||Math.abs(M)>le)&&(x=null)},P=S=>{oe(S,r.onPointerUp);const I=C,M=S.target;if(M.hasPointerCapture(S.pointerId)&&M.releasePointerCapture(S.pointerId),C=null,x=null,I){const F=S.currentTarget,D={originalEvent:S,delta:I};if(Qa(I,t.swipeDirection(),t.swipeThreshold())){Nr(cp,r.onSwipeEnd,D);const{x:j,y:H}=I;S.currentTarget.setAttribute("data-swipe","end"),S.currentTarget.style.removeProperty("--kb-toast-swipe-move-x"),S.currentTarget.style.removeProperty("--kb-toast-swipe-move-y"),S.currentTarget.style.setProperty("--kb-toast-swipe-end-x",`${j}px`),S.currentTarget.style.setProperty("--kb-toast-swipe-end-y",`${H}px`),O()}else Nr(up,r.onSwipeCancel,D),S.currentTarget.setAttribute("data-swipe","cancel"),S.currentTarget.style.removeProperty("--kb-toast-swipe-move-x"),S.currentTarget.style.removeProperty("--kb-toast-swipe-move-y"),S.currentTarget.style.removeProperty("--kb-toast-swipe-end-x"),S.currentTarget.style.removeProperty("--kb-toast-swipe-end-y");F.addEventListener("click",j=>j.preventDefault(),{once:!0})}};Bn(()=>{t.toasts().find(S=>S.id===r.toastId&&S.update)&&d(!1)}),U(Ce(()=>t.isPaused(),S=>{S?V():T()},{defer:!0})),U(Ce([i,v],([S,I])=>{S&&!t.isPaused()&&_(I)})),U(Ce(()=>{var S;return(S=dn.get(r.toastId))==null?void 0:S.dismiss},S=>S&&O())),U(Ce(()=>p(),S=>!S&&L()));const R={translations:()=>r.translations,close:O,duration:v,isPersistent:()=>r.persistent??!1,closeTimerStartTime:()=>m,generateId:yt(()=>o.id),registerTitleId:Be(l),registerDescriptionId:Be(u)};return b(Se,{get when(){return p()},get children(){return b(wc.Provider,{value:R,get children(){return b(ae,A({as:"li",ref(S){var I=ve(g,r.ref);typeof I=="function"&&I(S)},role:"status",tabIndex:0,get style(){return vt({animation:f()?void 0:"none","user-select":"none","touch-action":"none"},r.style)},get"aria-live"(){return r.priority==="high"?"assertive":"polite"},"aria-atomic":"true",get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-opened"(){return i()?"":void 0},get"data-closed"(){return i()?void 0:""},get"data-swipe-direction"(){return t.swipeDirection()},onKeyDown:N,onPointerDown:z,onPointerMove:ie,onPointerUp:P},o))}})}})}function Qa(e,t,n=0){const r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return t==="left"||t==="right"?i&&r>n:!i&&o>n}function Nr(e,t,n){const r=n.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),r.dispatchEvent(o)}function xs(e){const t=po(),n=Z({id:t.generateId("title")},e),[r,o]=k(n,["id"]);return U(()=>W(t.registerTitleId(r.id))),b(ae,A({as:"div",get id(){return r.id}},o))}var dp=0;function Cc(e,t){const n=dp++;return dn.add({id:n,toastComponent:e,dismiss:!1,update:!1,region:t==null?void 0:t.region}),n}function ki(e,t){dn.update(e,{id:e,toastComponent:t,dismiss:!1,update:!0})}function fp(e,t,n){const r=Cc(o=>t({get toastId(){return o.toastId},state:"pending"}),n);return(us(e)?e():e).then(o=>ki(r,i=>t({get toastId(){return i.toastId},state:"fulfilled",data:o}))).catch(o=>ki(r,i=>t({get toastId(){return i.toastId},state:"rejected",error:o}))),r}function hp(e){return dn.dismiss(e),e}function gp(){dn.clear()}var Cs={show:Cc,update:ki,promise:fp,dismiss:hp,clear:gp},pp=Object.assign(Ss,{CloseButton:ps,Description:ms,List:ys,ProgressFill:Sc,ProgressTrack:xc,Region:bs,Title:xs,toaster:Cs});function Ec(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Ec(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function mp(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Ec(e))&&(r&&(r+=" "),r+=t);return r}const Ya=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Za=mp,Fr=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Za(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],f=i==null?void 0:i[c];if(u===null)return null;const d=Ya(u)||Ya(f);return o[c][d]}),a=n&&Object.entries(n).reduce((c,u)=>{let[f,d]=u;return d===void 0||(c[f]=d),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:d,...h}=u;return Object.entries(h).every(g=>{let[p,v]=g;return Array.isArray(v)?v.includes({...i,...a}[p]):{...i,...a}[p]===v})?[...c,f,d]:c},[]);return Za(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)};function Rc(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Rc(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function vp(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Rc(e))&&(r&&(r+=" "),r+=t);return r}const Es="-",yp=e=>{const t=bp(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(Es);return a[0]===""&&a.length!==1&&a.shift(),Pc(a,t)||wp(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},Pc=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Pc(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Es);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId},Ja=/^\[(.+)\]$/,wp=e=>{if(Ja.test(e)){const t=Ja.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},bp=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return xp(Object.entries(e.classGroups),n).forEach(([i,s])=>{Vi(s,r,i,t)}),r},Vi=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:el(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(Sp(o)){Vi(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{Vi(s,el(t,i),n,r)})})},el=(e,t)=>{let n=e;return t.split(Es).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Sp=e=>e.isThemeGetter,xp=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e,Cp=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},Ic="!",Ep=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const l=[];let c=0,u=0,f;for(let v=0;v<a.length;v++){let w=a[v];if(c===0){if(w===o&&(r||a.slice(v,v+i)===t)){l.push(a.slice(u,v)),u=v+i;continue}if(w==="/"){f=v;continue}}w==="["?c++:w==="]"&&c--}const d=l.length===0?a:a.substring(u),h=d.startsWith(Ic),g=h?d.substring(1):d,p=f&&f>u?f-u:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:p}};return n?a=>n({className:a,parseClassName:s}):s},Rp=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Pp=e=>({cache:Cp(e.cacheSize),parseClassName:Ep(e),...yp(e)}),Ip=/\s+/,Mp=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(Ip);let a="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:u,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:h}=n(c);let g=!!h,p=r(g?d.substring(0,h):d);if(!p){if(!g){a=c+(a.length>0?" "+a:a);continue}if(p=r(d),!p){a=c+(a.length>0?" "+a:a);continue}g=!1}const v=Rp(u).join(":"),w=f?v+Ic:v,m=w+p;if(i.includes(m))continue;i.push(m);const y=o(p,g);for(let x=0;x<y.length;++x){const C=y[x];i.push(w+C)}a=c+(a.length>0?" "+a:a)}return a};function Fp(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Mc(t))&&(r&&(r+=" "),r+=n);return r}const Mc=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Mc(e[r]))&&(n&&(n+=" "),n+=t);return n};function Ap(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,f)=>f(u),e());return n=Pp(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=Mp(l,n);return o(l,u),u}return function(){return i(Fp.apply(null,arguments))}}const ye=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Fc=/^\[(?:([a-z-]+):)?(.+)\]$/i,$p=/^\d+\/\d+$/,Op=new Set(["px","full","screen"]),Tp=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Dp=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Lp=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,_p=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kp=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xt=e=>En(e)||Op.has(e)||$p.test(e),Ot=e=>Gn(e,"length",Hp),En=e=>!!e&&!Number.isNaN(Number(e)),To=e=>Gn(e,"number",En),Zn=e=>!!e&&Number.isInteger(Number(e)),Vp=e=>e.endsWith("%")&&En(e.slice(0,-1)),re=e=>Fc.test(e),Tt=e=>Tp.test(e),Np=new Set(["length","size","percentage"]),Kp=e=>Gn(e,Np,Ac),jp=e=>Gn(e,"position",Ac),Bp=new Set(["image","url"]),zp=e=>Gn(e,Bp,qp),Gp=e=>Gn(e,"",Up),Jn=()=>!0,Gn=(e,t,n)=>{const r=Fc.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Hp=e=>Dp.test(e)&&!Lp.test(e),Ac=()=>!1,Up=e=>_p.test(e),qp=e=>kp.test(e),Wp=()=>{const e=ye("colors"),t=ye("spacing"),n=ye("blur"),r=ye("brightness"),o=ye("borderColor"),i=ye("borderRadius"),s=ye("borderSpacing"),a=ye("borderWidth"),l=ye("contrast"),c=ye("grayscale"),u=ye("hueRotate"),f=ye("invert"),d=ye("gap"),h=ye("gradientColorStops"),g=ye("gradientColorStopPositions"),p=ye("inset"),v=ye("margin"),w=ye("opacity"),m=ye("padding"),y=ye("saturate"),x=ye("scale"),C=ye("sepia"),O=ye("skew"),L=ye("space"),_=ye("translate"),T=()=>["auto","contain","none"],V=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",re,t],z=()=>[re,t],ie=()=>["",xt,Ot],P=()=>["auto",En,re],R=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],S=()=>["solid","dashed","dotted","double","none"],I=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",re],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>[En,re];return{cacheSize:500,separator:":",theme:{colors:[Jn],spacing:[xt,Ot],blur:["none","",Tt,re],brightness:j(),borderColor:[e],borderRadius:["none","","full",Tt,re],borderSpacing:z(),borderWidth:ie(),contrast:j(),grayscale:F(),hueRotate:j(),invert:F(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[Vp,Ot],inset:N(),margin:N(),opacity:j(),padding:z(),saturate:j(),scale:j(),sepia:F(),skew:j(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",re]}],container:["container"],columns:[{columns:[Tt]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...R(),re]}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Zn,re]}],basis:[{basis:N()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",re]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",Zn,re]}],"grid-cols":[{"grid-cols":[Jn]}],"col-start-end":[{col:["auto",{span:["full",Zn,re]},re]}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":[Jn]}],"row-start-end":[{row:["auto",{span:[Zn,re]},re]}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",re]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",re]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[m]}],px:[{px:[m]}],py:[{py:[m]}],ps:[{ps:[m]}],pe:[{pe:[m]}],pt:[{pt:[m]}],pr:[{pr:[m]}],pb:[{pb:[m]}],pl:[{pl:[m]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[L]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[L]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",re,t]}],"min-w":[{"min-w":[re,t,"min","max","fit"]}],"max-w":[{"max-w":[re,t,"none","full","min","max","fit","prose",{screen:[Tt]},Tt]}],h:[{h:[re,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[re,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[re,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[re,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Tt,Ot]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",To]}],"font-family":[{font:[Jn]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",re]}],"line-clamp":[{"line-clamp":["none",En,To]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",xt,re]}],"list-image":[{"list-image":["none",re]}],"list-style-type":[{list:["none","disc","decimal",re]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...S(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",xt,Ot]}],"underline-offset":[{"underline-offset":["auto",xt,re]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",re]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...R(),jp]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Kp]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},zp]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...S(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:S()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...S()]}],"outline-offset":[{"outline-offset":[xt,re]}],"outline-w":[{outline:[xt,Ot]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[xt,Ot]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Tt,Gp]}],"shadow-color":[{shadow:[Jn]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...I(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":I()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Tt,re]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[y]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",re]}],duration:[{duration:j()}],ease:[{ease:["linear","in","out","in-out",re]}],delay:[{delay:j()}],animate:[{animate:["none","spin","ping","pulse","bounce",re]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Zn,re]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",re]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",re]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",re]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[xt,Ot,To]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Xp=Ap(Wp);function de(...e){return Xp(vp(e))}var Qp=he('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><path d="M18 6l-12 12"></path><path d="M6 6l12 12">'),Yp=he('<div class="grid gap-1">');const Zp=Fr("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--kb-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--kb-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[opened]:animate-in data-[closed]:animate-out data-[swipe=end]:animate-out data-[closed]:fade-out-80 data-[closed]:slide-out-to-right-full data-[opened]:slide-in-from-top-full data-[opened]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground",success:"success border-success-foreground bg-success text-success-foreground",warning:"warning border-warning-foreground bg-warning text-warning-foreground",error:"error border-error-foreground bg-error text-error-foreground"}},defaultVariants:{variant:"default"}}),Jp=e=>{const[t,n]=k(e,["class"]);return b(rs,{get children(){return b(bs,{get children(){return b(ys,A({get class(){return de("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse gap-2 p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t.class)}},n))}})}})},em=e=>{const[t,n]=k(e,["class","variant"]);return b(Ss,A({get class(){return de(Zp({variant:t.variant}),t.class)}},n))},tm=e=>{const[t,n]=k(e,["class"]);return b(ps,A({get class(){return de("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-destructive-foreground group-[.error]:text-error-foreground group-[.success]:text-success-foreground group-[.warning]:text-warning-foreground",t.class)}},n,{get children(){return Qp()}}))},nm=e=>{const[t,n]=k(e,["class"]);return b(xs,A({get class(){return de("text-sm font-semibold",t.class)}},n))},rm=e=>{const[t,n]=k(e,["class"]);return b(ms,A({get class(){return de("text-sm opacity-90",t.class)}},n))};function tl(e){Cs.show(t=>b(em,{get toastId(){return t.toastId},get variant(){return e.variant},get duration(){return e.duration},get children(){return[(()=>{var n=Yp();return fe(n,(()=>{var r=K(()=>!!e.title);return()=>r()&&b(nm,{get children(){return e.title}})})(),null),fe(n,(()=>{var r=K(()=>!!e.description);return()=>r()&&b(rm,{get children(){return e.description}})})(),null),n})(),b(tm,{})]}}))}var Do="focusScope.autoFocusOnMount",Lo="focusScope.autoFocusOnUnmount",nl={bubbles:!1,cancelable:!0},rl={stack:[],active(){return this.stack[0]},add(e){var t;e!==this.active()&&((t=this.active())==null||t.pause()),this.stack=Di(this.stack,e),this.stack.unshift(e)},remove(e){var t;this.stack=Di(this.stack,e),(t=this.active())==null||t.resume()}};function $c(e,t){const[n,r]=B(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=g=>{var p;return(p=e.onMountAutoFocus)==null?void 0:p.call(e,g)},a=g=>{var p;return(p=e.onUnmountAutoFocus)==null?void 0:p.call(e,g)},l=()=>Ze(t()),c=()=>{const g=l().createElement("span");return g.setAttribute("data-focus-trap",""),g.tabIndex=0,Object.assign(g.style,pc),g},u=()=>{const g=t();return g?hc(g,!0).filter(p=>!p.hasAttribute("data-focus-trap")):[]},f=()=>{const g=u();return g.length>0?g[0]:null},d=()=>{const g=u();return g.length>0?g[g.length-1]:null},h=()=>{const g=t();if(!g)return!1;const p=ar(g);return!p||_e(g,p)?!1:gc(p)};U(()=>{const g=t();if(!g)return;rl.add(o);const p=ar(g);if(!_e(g,p)){const w=new CustomEvent(Do,nl);g.addEventListener(Do,s),g.dispatchEvent(w),w.defaultPrevented||setTimeout(()=>{Ie(f()),ar(g)===p&&Ie(g)},0)}W(()=>{g.removeEventListener(Do,s),setTimeout(()=>{const w=new CustomEvent(Lo,nl);h()&&w.preventDefault(),g.addEventListener(Lo,a),g.dispatchEvent(w),w.defaultPrevented||Ie(p??l().body),g.removeEventListener(Lo,a),rl.remove(o)},0)})}),U(()=>{const g=t();if(!g||!$(e.trapFocus)||n())return;const p=w=>{const m=w.target;m!=null&&m.closest(`[${vr}]`)||(_e(g,m)?i=m:Ie(i))},v=w=>{const y=w.relatedTarget??ar(g);y!=null&&y.closest(`[${vr}]`)||_e(g,y)||Ie(i)};l().addEventListener("focusin",p),l().addEventListener("focusout",v),W(()=>{l().removeEventListener("focusin",p),l().removeEventListener("focusout",v)})}),U(()=>{const g=t();if(!g||!$(e.trapFocus)||n())return;const p=c();g.insertAdjacentElement("afterbegin",p);const v=c();g.insertAdjacentElement("beforeend",v);function w(y){const x=f(),C=d();y.relatedTarget===x?Ie(C):Ie(x)}p.addEventListener("focusin",w),v.addEventListener("focusin",w);const m=new MutationObserver(y=>{for(const x of y)x.previousSibling===v&&(v.remove(),g.insertAdjacentElement("beforeend",v)),x.nextSibling===p&&(p.remove(),g.insertAdjacentElement("afterbegin",p))});m.observe(g,{childList:!0,subtree:!1}),W(()=>{p.removeEventListener("focusin",w),v.removeEventListener("focusin",w),p.remove(),v.remove(),m.disconnect()})})}var om="data-live-announcer";function Oc(e){U(()=>{$(e.isDisabled)||W(im($(e.targets),$(e.root)))})}var er=new WeakMap,We=[];function im(e,t=document.body){const n=new Set(e),r=new Set,o=l=>{for(const d of l.querySelectorAll(`[${om}], [${vr}]`))n.add(d);const c=d=>{if(n.has(d)||d.parentElement&&r.has(d.parentElement)&&d.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const h of n)if(d.contains(h))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},u=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),f=c(l);if(f===NodeFilter.FILTER_ACCEPT&&i(l),f!==NodeFilter.FILTER_REJECT){let d=u.nextNode();for(;d!=null;)i(d),d=u.nextNode()}},i=l=>{const c=er.get(l)??0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),er.set(l,c+1))};We.length&&We[We.length-1].disconnect(),o(t);const s=new MutationObserver(l=>{for(const c of l)if(!(c.type!=="childList"||c.addedNodes.length===0)&&![...n,...r].some(u=>u.contains(c.target))){for(const u of c.removedNodes)u instanceof Element&&(n.delete(u),r.delete(u));for(const u of c.addedNodes)(u instanceof HTMLElement||u instanceof SVGElement)&&(u.dataset.liveAnnouncer==="true"||u.dataset.reactAriaTopLayer==="true")?n.add(u):u instanceof Element&&o(u)}});s.observe(t,{childList:!0,subtree:!0});const a={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return We.push(a),()=>{s.disconnect();for(const l of r){const c=er.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),er.delete(l)):er.set(l,c-1)}a===We[We.length-1]?(We.pop(),We.length&&We[We.length-1].observe()):We.splice(We.indexOf(a),1)}}function sm(e){const t=n=>{var r;n.key===cs.Escape&&((r=e.onEscapeKeyDown)==null||r.call(e,n))};U(()=>{var r;if($(e.isDisabled))return;const n=((r=e.ownerDocument)==null?void 0:r.call(e))??Ze();n.addEventListener("keydown",t),W(()=>{n.removeEventListener("keydown",t)})})}var ol="interactOutside.pointerDownOutside",il="interactOutside.focusOutside";function Tc(e,t){let n,r=Dg;const o=()=>Ze(t()),i=f=>{var d;return(d=e.onPointerDownOutside)==null?void 0:d.call(e,f)},s=f=>{var d;return(d=e.onFocusOutside)==null?void 0:d.call(e,f)},a=f=>{var d;return(d=e.onInteractOutside)==null?void 0:d.call(e,f)},l=f=>{var h;const d=f.target;return!(d instanceof HTMLElement)||d.closest(`[${vr}]`)||!_e(o(),d)||_e(t(),d)?!1:!((h=e.shouldExcludeElement)!=null&&h.call(e,d))},c=f=>{function d(){const h=t(),g=f.target;if(!h||!g||!l(f))return;const p=be([i,a]);g.addEventListener(ol,p,{once:!0});const v=new CustomEvent(ol,{bubbles:!1,cancelable:!0,detail:{originalEvent:f,isContextMenu:f.button===2||Cg(f)&&f.button===0}});g.dispatchEvent(v)}f.pointerType==="touch"?(o().removeEventListener("click",d),r=d,o().addEventListener("click",d,{once:!0})):d()},u=f=>{const d=t(),h=f.target;if(!d||!h||!l(f))return;const g=be([s,a]);h.addEventListener(il,g,{once:!0});const p=new CustomEvent(il,{bubbles:!1,cancelable:!0,detail:{originalEvent:f,isContextMenu:!1}});h.dispatchEvent(p)};U(()=>{$(e.isDisabled)||(n=window.setTimeout(()=>{o().addEventListener("pointerdown",c,!0)},0),o().addEventListener("focusin",u,!0),W(()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",c,!0),o().removeEventListener("focusin",u,!0)}))})}var Dc=we();function am(){return me(Dc)}function Rs(e){let t;const n=am(),[r,o]=k(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]),s=f=>{i.add(f);const d=n==null?void 0:n.registerNestedLayer(f);return()=>{i.delete(f),d==null||d()}};Tc({shouldExcludeElement:f=>{var d;return t?((d=r.excludedElements)==null?void 0:d.some(h=>_e(h(),f)))||[...i].some(h=>_e(h,f)):!1},onPointerDownOutside:f=>{var d,h,g;!t||ze.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!ze.isTopMostLayer(t)||((d=r.onPointerDownOutside)==null||d.call(r,f),(h=r.onInteractOutside)==null||h.call(r,f),f.defaultPrevented||(g=r.onDismiss)==null||g.call(r))},onFocusOutside:f=>{var d,h,g;(d=r.onFocusOutside)==null||d.call(r,f),(h=r.onInteractOutside)==null||h.call(r,f),f.defaultPrevented||(g=r.onDismiss)==null||g.call(r)}},()=>t),sm({ownerDocument:()=>Ze(t),onEscapeKeyDown:f=>{var d;!t||!ze.isTopMostLayer(t)||((d=r.onEscapeKeyDown)==null||d.call(r,f),!f.defaultPrevented&&r.onDismiss&&(f.preventDefault(),r.onDismiss()))}}),Bn(()=>{if(!t)return;ze.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const f=n==null?void 0:n.registerNestedLayer(t);ze.assignPointerEventToLayers(),ze.disableBodyPointerEvents(t),W(()=>{t&&(ze.removeLayer(t),f==null||f(),ze.assignPointerEventToLayers(),ze.restoreBodyPointerEvents(t))})}),U(Ce([()=>t,()=>r.disableOutsidePointerEvents],([f,d])=>{if(!f)return;const h=ze.find(f);h&&h.isPointerBlocking!==d&&(h.isPointerBlocking=d,ze.assignPointerEventToLayers()),d&&ze.disableBodyPointerEvents(f),W(()=>{ze.restoreBodyPointerEvents(f)})},{defer:!0}));const u={registerNestedLayer:s};return b(Dc.Provider,{value:u,get children(){return b(ae,A({as:"div",ref(f){var d=ve(h=>t=h,r.ref);typeof d=="function"&&d(f)}},o))}})}function pt(e){var s;const[t,n]=B((s=e.defaultValue)==null?void 0:s.call(e)),r=K(()=>{var a;return((a=e.value)==null?void 0:a.call(e))!==void 0}),o=K(()=>{var a;return r()?(a=e.value)==null?void 0:a.call(e):t()});return[o,a=>{Me(()=>{var c;const l=fg(a,o());return Object.is(l,o())||(r()||n(l),(c=e.onChange)==null||c.call(e,l)),l})}]}function Lc(e){const[t,n]=pt(e);return[()=>t()??!1,n]}function lm(e){const[t,n]=pt(e);return[()=>t()??[],n]}function Ps(e={}){const[t,n]=Lc({value:()=>$(e.open),defaultValue:()=>!!$(e.defaultOpen),onChange:s=>{var a;return(a=e.onOpenChange)==null?void 0:a.call(e,s)}}),r=()=>{n(!0)},o=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:o,toggle:()=>{t()?o():r()}}}var Ni=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},Kr=new Map,um=e=>{U(()=>{const t=Te(e.style)??{},n=Te(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=Kr.get(e.key);o?o.activeCount++:Kr.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(i=>i.key)}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);W(()=>{var s;const i=Kr.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}Kr.delete(e.key);for(const[a,l]of Object.entries(i.originalStyles))e.element.style[a]=l;for(const a of i.properties)e.element.style.removeProperty(a);e.element.style.length===0&&e.element.removeAttribute("style"),(s=e.cleanup)==null||s.call(e)}})})},sl=um,cm=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},dm=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},fm=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let o=e,i=0,s=0,a=!1;do{const[l,c,u]=cm(o,t),f=u-l-r*c;(c!==0||f!==0)&&dm(o,t)&&(i+=f,s+=c),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},[al,ll]=B([]),hm=e=>al().indexOf(e)===al().length-1,gm=e=>{const t=A({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=Ee();let r=[0,0],o=null,i=null;U(()=>{Te(t.enabled)&&(ll(c=>[...c,n]),W(()=>{ll(c=>c.filter(u=>u!==n))}))}),U(()=>{if(!Te(t.enabled)||!Te(t.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(Te(t.preventScrollbarShift)){const f={overflow:"hidden"},d=[];u>0&&(Te(t.preventScrollbarShiftMode)==="padding"?f.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${u}px)`:f.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${u}px)`,d.push({key:"--scrollbar-width",value:`${u}px`}));const h=window.scrollY,g=window.scrollX;sl({key:"prevent-scroll",element:c,style:f,properties:d,cleanup:()=>{Te(t.restoreScrollPosition)&&u>0&&window.scrollTo(g,h)}})}else sl({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),U(()=>{!hm(n)||!Te(t.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),W(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)}))});const s=c=>{r=ul(c),o=null,i=null},a=c=>{const u=c.target,f=Te(t.element),d=pm(c),h=Math.abs(d[0])>Math.abs(d[1])?"x":"y",g=h==="x"?d[0]:d[1],p=cl(u,h,g,f);let v;f&&Ni(f,u)?v=!p:v=!0,v&&c.cancelable&&c.preventDefault()},l=c=>{const u=Te(t.element),f=c.target;let d;if(c.touches.length===2)d=!Te(t.allowPinchZoom);else{if(o==null||i===null){const h=ul(c).map((p,v)=>r[v]-p),g=Math.abs(h[0])>Math.abs(h[1])?"x":"y";o=g,i=g==="x"?h[0]:h[1]}if(f.type==="range")d=!1;else{const h=cl(f,o,i,u);u&&Ni(u,f)?d=!h:d=!0}}d&&c.cancelable&&c.preventDefault()}},pm=e=>[e.deltaX,e.deltaY],ul=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],cl=(e,t,n,r)=>{const o=r!==null&&Ni(r,e),[i,s]=fm(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(s)<1)},mm=gm,_c=mm,vm={};Xt(vm,{CloseButton:()=>Is,Content:()=>Ms,Description:()=>Fs,Dialog:()=>ym,Overlay:()=>As,Portal:()=>$s,Root:()=>Os,Title:()=>Ts,Trigger:()=>Vc});var kc=we();function pn(){const e=me(kc);if(e===void 0)throw new Error("[kobalte]: `useDialogContext` must be used within a `Dialog` component");return e}function Is(e){const t=pn(),[n,r]=k(e,["aria-label","onClick"]);return b(wt,A({get"aria-label"(){return n["aria-label"]||t.translations().dismiss},onClick:i=>{oe(i,n.onClick),t.close()}},r))}function Ms(e){let t;const n=pn(),r=Z({id:n.generateId("content")},e),[o,i]=k(r,["ref","onOpenAutoFocus","onCloseAutoFocus","onPointerDownOutside","onFocusOutside","onInteractOutside"]);let s=!1,a=!1;const l=d=>{var h;(h=o.onPointerDownOutside)==null||h.call(o,d),n.modal()&&d.detail.isContextMenu&&d.preventDefault()},c=d=>{var h;(h=o.onFocusOutside)==null||h.call(o,d),n.modal()&&d.preventDefault()},u=d=>{var h;(h=o.onInteractOutside)==null||h.call(o,d),!n.modal()&&(d.defaultPrevented||(s=!0,d.detail.originalEvent.type==="pointerdown"&&(a=!0)),_e(n.triggerRef(),d.target)&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&a&&d.preventDefault())},f=d=>{var h;(h=o.onCloseAutoFocus)==null||h.call(o,d),n.modal()?(d.preventDefault(),Ie(n.triggerRef())):(d.defaultPrevented||(s||Ie(n.triggerRef()),d.preventDefault()),s=!1,a=!1)};return Oc({isDisabled:()=>!(n.isOpen()&&n.modal()),targets:()=>t?[t]:[]}),_c({element:()=>t??null,enabled:()=>n.contentPresent()&&n.preventScroll()}),$c({trapFocus:()=>n.isOpen()&&n.modal(),onMountAutoFocus:o.onOpenAutoFocus,onUnmountAutoFocus:f},()=>t),U(()=>W(n.registerContentId(i.id))),b(Se,{get when(){return n.contentPresent()},get children(){return b(Rs,A({ref(d){var h=ve(g=>{n.setContentRef(g),t=g},o.ref);typeof h=="function"&&h(d)},role:"dialog",tabIndex:-1,get disableOutsidePointerEvents(){return K(()=>!!n.modal())()&&n.isOpen()},get excludedElements(){return[n.triggerRef]},get"aria-labelledby"(){return n.titleId()},get"aria-describedby"(){return n.descriptionId()},get"data-expanded"(){return n.isOpen()?"":void 0},get"data-closed"(){return n.isOpen()?void 0:""},onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,get onDismiss(){return n.close}},i))}})}function Fs(e){const t=pn(),n=Z({id:t.generateId("description")},e),[r,o]=k(n,["id"]);return U(()=>W(t.registerDescriptionId(r.id))),b(ae,A({as:"p",get id(){return r.id}},o))}function As(e){const t=pn(),[n,r]=k(e,["ref","style","onPointerDown"]),o=i=>{oe(i,n.onPointerDown),i.target===i.currentTarget&&i.preventDefault()};return b(Se,{get when(){return t.overlayPresent()},get children(){return b(ae,A({as:"div",ref(i){var s=ve(t.setOverlayRef,n.ref);typeof s=="function"&&s(i)},get style(){return vt({"pointer-events":"auto"},n.style)},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onPointerDown:o},r))}})}function $s(e){const t=pn();return b(Se,{get when(){return t.contentPresent()||t.overlayPresent()},get children(){return b(rs,e)}})}var dl={dismiss:"Dismiss"};function Os(e){const t=`dialog-${Ee()}`,n=Z({id:t,modal:!0,translations:dl},e),[r,o]=B(),[i,s]=B(),[a,l]=B(),[c,u]=B(),[f,d]=B(),[h,g]=B(),p=Ps({open:()=>n.open,defaultOpen:()=>n.defaultOpen,onOpenChange:x=>{var C;return(C=n.onOpenChange)==null?void 0:C.call(n,x)}}),v=()=>n.forceMount||p.isOpen(),{present:w}=wr({show:v,element:()=>c()??null}),{present:m}=wr({show:v,element:()=>f()??null}),y={translations:()=>n.translations??dl,isOpen:p.isOpen,modal:()=>n.modal??!0,preventScroll:()=>n.preventScroll??y.modal(),contentId:r,titleId:i,descriptionId:a,triggerRef:h,overlayRef:c,setOverlayRef:u,contentRef:f,setContentRef:d,overlayPresent:w,contentPresent:m,close:p.close,toggle:p.toggle,setTriggerRef:g,generateId:yt(()=>n.id),registerContentId:Be(o),registerTitleId:Be(s),registerDescriptionId:Be(l)};return b(kc.Provider,{value:y,get children(){return n.children}})}function Ts(e){const t=pn(),n=Z({id:t.generateId("title")},e),[r,o]=k(n,["id"]);return U(()=>W(t.registerTitleId(r.id))),b(ae,A({as:"h2",get id(){return r.id}},o))}function Vc(e){const t=pn(),[n,r]=k(e,["ref","onClick"]);return b(wt,A({ref(i){var s=ve(t.setTriggerRef,n.ref);typeof s=="function"&&s(i)},"aria-haspopup":"dialog",get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return K(()=>!!t.isOpen())()?t.contentId():void 0},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onClick:i=>{oe(i,n.onClick),t.toggle()}},r))}var ym=Object.assign(Os,{CloseButton:Is,Content:Ms,Description:Fs,Overlay:As,Portal:$s,Title:Ts,Trigger:Vc}),Nc=he("<div>"),wm=he('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><path d="M18 6l-12 12"></path><path d="M6 6l12 12">'),bm=he("<span class=sr-only>Close");const Sm=Os,xm=Fr("fixed inset-0 z-50 flex",{variants:{position:{top:"items-start",bottom:"items-end",left:"justify-start",right:"justify-end"}},defaultVariants:{position:"right"}}),Cm=e=>{const[t,n]=k(e,["position","children"]);return b($s,A(n,{get children(){var r=Nc();return fe(r,()=>t.children),Ke(()=>Tu(r,xm({position:t.position}))),r}}))},Em=e=>{const[t,n]=k(e,["class"]);return b(As,A({get class(){return de("fixed inset-0 z-50 bg-black/80 data-[expanded=]:animate-in data-[closed=]:animate-out data-[closed=]:fade-out-0 data-[expanded=]:fade-in-0",t.class)}},n))},Rm=Fr("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[closed=]:duration-300 data-[expanded=]:duration-500 data-[expanded=]:animate-in data-[closed=]:animate-out",{variants:{position:{top:"inset-x-0 top-0 border-b data-[closed=]:slide-out-to-top data-[expanded=]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[closed=]:slide-out-to-bottom data-[expanded=]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[closed=]:slide-out-to-left data-[expanded]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[closed=]:slide-out-to-right data-[expanded=]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{position:"right"}}),Pm=e=>{const[t,n]=k(e,["position","class","children"]);return b(Cm,{get position(){return t.position},get children(){return[b(Em,{}),b(Ms,A({get class(){return de(Rm({position:t.position}),t.class,"max-h-screen overflow-y-auto")}},n,{get children(){return[K(()=>t.children),b(Is,{class:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",get children(){return[wm(),bm()]}})]}}))]}})},Im=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=Nc();return at(r,A({get class(){return de("flex flex-col space-y-2 text-center sm:text-left",t.class)}},n),!1,!1),r})()},Mm=e=>{const[t,n]=k(e,["class"]);return b(Ts,A({get class(){return de("text-lg font-semibold text-foreground",t.class)}},n))},Fm=e=>{const[t,n]=k(e,["class"]);return b(Fs,A({get class(){return de("text-sm text-muted-foreground",t.class)}},n))},Kc=()=>{const[e,t]=fh(),n=K(()=>(e==null?void 0:e.bundleId)??null),r=K(()=>(e==null?void 0:e.channel)??null),o=K(()=>(e==null?void 0:e.platform)??null);return{bundleIdFilter:n,channelFilter:r,platformFilter:o,setBundleIdFilter:i=>{t({bundleId:i??void 0})},setChannelFilter:i=>{t({channel:i??void 0})},setPlatformFilter:i=>{t({platform:i??void 0})}}},Am=e=>{const t=e.split("-").join("").slice(0,12);return Number.parseInt(t,16)};function jc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yr={exports:{}},$m=Yr.exports,fl;function Om(){return fl||(fl=1,function(e,t){(function(n,r){e.exports=r()})($m,function(){var n=1e3,r=6e4,o=36e5,i="millisecond",s="second",a="minute",l="hour",c="day",u="week",f="month",d="quarter",h="year",g="date",p="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(P){var R=["th","st","nd","rd"],S=P%100;return"["+P+(R[(S-20)%10]||R[S]||R[0])+"]"}},y=function(P,R,S){var I=String(P);return!I||I.length>=R?P:""+Array(R+1-I.length).join(S)+P},x={s:y,z:function(P){var R=-P.utcOffset(),S=Math.abs(R),I=Math.floor(S/60),M=S%60;return(R<=0?"+":"-")+y(I,2,"0")+":"+y(M,2,"0")},m:function P(R,S){if(R.date()<S.date())return-P(S,R);var I=12*(S.year()-R.year())+(S.month()-R.month()),M=R.clone().add(I,f),F=S-M<0,D=R.clone().add(I+(F?-1:1),f);return+(-(I+(S-M)/(F?M-D:D-M))||0)},a:function(P){return P<0?Math.ceil(P)||0:Math.floor(P)},p:function(P){return{M:f,y:h,w:u,d:c,D:g,h:l,m:a,s,ms:i,Q:d}[P]||String(P||"").toLowerCase().replace(/s$/,"")},u:function(P){return P===void 0}},C="en",O={};O[C]=m;var L="$isDayjsObject",_=function(P){return P instanceof z||!(!P||!P[L])},T=function P(R,S,I){var M;if(!R)return C;if(typeof R=="string"){var F=R.toLowerCase();O[F]&&(M=F),S&&(O[F]=S,M=F);var D=R.split("-");if(!M&&D.length>1)return P(D[0])}else{var j=R.name;O[j]=R,M=j}return!I&&M&&(C=M),M||!I&&C},V=function(P,R){if(_(P))return P.clone();var S=typeof R=="object"?R:{};return S.date=P,S.args=arguments,new z(S)},N=x;N.l=T,N.i=_,N.w=function(P,R){return V(P,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var z=function(){function P(S){this.$L=T(S.locale,null,!0),this.parse(S),this.$x=this.$x||S.x||{},this[L]=!0}var R=P.prototype;return R.parse=function(S){this.$d=function(I){var M=I.date,F=I.utc;if(M===null)return new Date(NaN);if(N.u(M))return new Date;if(M instanceof Date)return new Date(M);if(typeof M=="string"&&!/Z$/i.test(M)){var D=M.match(v);if(D){var j=D[2]-1||0,H=(D[7]||"0").substring(0,3);return F?new Date(Date.UTC(D[1],j,D[3]||1,D[4]||0,D[5]||0,D[6]||0,H)):new Date(D[1],j,D[3]||1,D[4]||0,D[5]||0,D[6]||0,H)}}return new Date(M)}(S),this.init()},R.init=function(){var S=this.$d;this.$y=S.getFullYear(),this.$M=S.getMonth(),this.$D=S.getDate(),this.$W=S.getDay(),this.$H=S.getHours(),this.$m=S.getMinutes(),this.$s=S.getSeconds(),this.$ms=S.getMilliseconds()},R.$utils=function(){return N},R.isValid=function(){return this.$d.toString()!==p},R.isSame=function(S,I){var M=V(S);return this.startOf(I)<=M&&M<=this.endOf(I)},R.isAfter=function(S,I){return V(S)<this.startOf(I)},R.isBefore=function(S,I){return this.endOf(I)<V(S)},R.$g=function(S,I,M){return N.u(S)?this[I]:this.set(M,S)},R.unix=function(){return Math.floor(this.valueOf()/1e3)},R.valueOf=function(){return this.$d.getTime()},R.startOf=function(S,I){var M=this,F=!!N.u(I)||I,D=N.p(S),j=function(Fe,Pe){var $t=N.w(M.$u?Date.UTC(M.$y,Pe,Fe):new Date(M.$y,Pe,Fe),M);return F?$t:$t.endOf(c)},H=function(Fe,Pe){return N.w(M.toDate()[Fe].apply(M.toDate("s"),(F?[0,0,0,0]:[23,59,59,999]).slice(Pe)),M)},X=this.$W,le=this.$M,ne=this.$D,Ae="set"+(this.$u?"UTC":"");switch(D){case h:return F?j(1,0):j(31,11);case f:return F?j(1,le):j(0,le+1);case u:var Je=this.$locale().weekStart||0,te=(X<Je?X+7:X)-Je;return j(F?ne-te:ne+(6-te),le);case c:case g:return H(Ae+"Hours",0);case l:return H(Ae+"Minutes",1);case a:return H(Ae+"Seconds",2);case s:return H(Ae+"Milliseconds",3);default:return this.clone()}},R.endOf=function(S){return this.startOf(S,!1)},R.$set=function(S,I){var M,F=N.p(S),D="set"+(this.$u?"UTC":""),j=(M={},M[c]=D+"Date",M[g]=D+"Date",M[f]=D+"Month",M[h]=D+"FullYear",M[l]=D+"Hours",M[a]=D+"Minutes",M[s]=D+"Seconds",M[i]=D+"Milliseconds",M)[F],H=F===c?this.$D+(I-this.$W):I;if(F===f||F===h){var X=this.clone().set(g,1);X.$d[j](H),X.init(),this.$d=X.set(g,Math.min(this.$D,X.daysInMonth())).$d}else j&&this.$d[j](H);return this.init(),this},R.set=function(S,I){return this.clone().$set(S,I)},R.get=function(S){return this[N.p(S)]()},R.add=function(S,I){var M,F=this;S=Number(S);var D=N.p(I),j=function(le){var ne=V(F);return N.w(ne.date(ne.date()+Math.round(le*S)),F)};if(D===f)return this.set(f,this.$M+S);if(D===h)return this.set(h,this.$y+S);if(D===c)return j(1);if(D===u)return j(7);var H=(M={},M[a]=r,M[l]=o,M[s]=n,M)[D]||1,X=this.$d.getTime()+S*H;return N.w(X,this)},R.subtract=function(S,I){return this.add(-1*S,I)},R.format=function(S){var I=this,M=this.$locale();if(!this.isValid())return M.invalidDate||p;var F=S||"YYYY-MM-DDTHH:mm:ssZ",D=N.z(this),j=this.$H,H=this.$m,X=this.$M,le=M.weekdays,ne=M.months,Ae=M.meridiem,Je=function(Pe,$t,Qn,Dr){return Pe&&(Pe[$t]||Pe(I,F))||Qn[$t].slice(0,Dr)},te=function(Pe){return N.s(j%12||12,Pe,"0")},Fe=Ae||function(Pe,$t,Qn){var Dr=Pe<12?"AM":"PM";return Qn?Dr.toLowerCase():Dr};return F.replace(w,function(Pe,$t){return $t||function(Qn){switch(Qn){case"YY":return String(I.$y).slice(-2);case"YYYY":return N.s(I.$y,4,"0");case"M":return X+1;case"MM":return N.s(X+1,2,"0");case"MMM":return Je(M.monthsShort,X,ne,3);case"MMMM":return Je(ne,X);case"D":return I.$D;case"DD":return N.s(I.$D,2,"0");case"d":return String(I.$W);case"dd":return Je(M.weekdaysMin,I.$W,le,2);case"ddd":return Je(M.weekdaysShort,I.$W,le,3);case"dddd":return le[I.$W];case"H":return String(j);case"HH":return N.s(j,2,"0");case"h":return te(1);case"hh":return te(2);case"a":return Fe(j,H,!0);case"A":return Fe(j,H,!1);case"m":return String(H);case"mm":return N.s(H,2,"0");case"s":return String(I.$s);case"ss":return N.s(I.$s,2,"0");case"SSS":return N.s(I.$ms,3,"0");case"Z":return D}return null}(Pe)||D.replace(":","")})},R.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},R.diff=function(S,I,M){var F,D=this,j=N.p(I),H=V(S),X=(H.utcOffset()-this.utcOffset())*r,le=this-H,ne=function(){return N.m(D,H)};switch(j){case h:F=ne()/12;break;case f:F=ne();break;case d:F=ne()/3;break;case u:F=(le-X)/6048e5;break;case c:F=(le-X)/864e5;break;case l:F=le/o;break;case a:F=le/r;break;case s:F=le/n;break;default:F=le}return M?F:N.a(F)},R.daysInMonth=function(){return this.endOf(f).$D},R.$locale=function(){return O[this.$L]},R.locale=function(S,I){if(!S)return this.$L;var M=this.clone(),F=T(S,I,!0);return F&&(M.$L=F),M},R.clone=function(){return N.w(this.$d,this)},R.toDate=function(){return new Date(this.valueOf())},R.toJSON=function(){return this.isValid()?this.toISOString():null},R.toISOString=function(){return this.$d.toISOString()},R.toString=function(){return this.$d.toUTCString()},P}(),ie=z.prototype;return V.prototype=ie,[["$ms",i],["$s",s],["$m",a],["$H",l],["$W",c],["$M",f],["$y",h],["$D",g]].forEach(function(P){ie[P[1]]=function(R){return this.$g(R,P[0],P[1])}}),V.extend=function(P,R){return P.$i||(P(R,z,V),P.$i=!0),V},V.locale=T,V.isDayjs=_,V.unix=function(P){return V(1e3*P)},V.en=O[C],V.Ls=O,V.p={},V})}(Yr)),Yr.exports}var Tm=Om();const Dm=jc(Tm);/**
2
2
  * @license lucide-solid v0.454.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */var Lm={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},yn=Lm,_m=he("<svg>"),km=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Vm=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Nm=e=>{const[t,n]=k(e,["color","size","strokeWidth","children","class","name","iconNode","absoluteStrokeWidth"]);return(()=>{var r=_m();return at(r,A(yn,{get width(){return t.size??yn.width},get height(){return t.size??yn.height},get stroke(){return t.color??yn.stroke},get"stroke-width"(){return K(()=>!!t.absoluteStrokeWidth)()?Number(t.strokeWidth??yn["stroke-width"])*24/Number(t.size):Number(t.strokeWidth??yn["stroke-width"])},get class(){return Vm("lucide","lucide-icon",t.name!=null?`lucide-${km(t==null?void 0:t.name)}`:void 0,t.class!=null?t.class:"")}},n),!0,!0),fe(r,b(nt,{get each(){return t.iconNode},children:([o,i])=>b(Lu,A({component:o},i))})),r})()},Ds=Nm,Km=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],jm=e=>b(Ds,A(e,{name:"Check",iconNode:Km})),hl=jm,Bm=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],zm=e=>b(Ds,A(e,{name:"LoaderCircle",iconNode:Bm})),Gm=zm,Hm=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Um=e=>b(Ds,A(e,{name:"X",iconNode:Hm})),gl=Um,jr=he('<div class="flex flex-row items-center">');const qm=[{accessorKey:"id",header:"ID",cell:e=>e.getValue()},{accessorKey:"channel",header:"Channel",cell:e=>e.getValue()},{accessorKey:"platform",header:"Platform",cell:e=>{switch(e.getValue()){case"ios":return"iOS";case"android":return"Android"}}},{accessorKey:"targetAppVersion",header:"Target App Version",cell:e=>e.getValue()},{accessorKey:"enabled",header:"Enabled",cell:e=>e.getValue()?(()=>{var t=jr();return fe(t,b(hl,{class:"text-green-500"})),t})():(()=>{var t=jr();return fe(t,b(gl,{class:"text-red-500"})),t})()},{accessorKey:"shouldForceUpdate",header:"Force Update",cell:e=>e.getValue()?(()=>{var t=jr();return fe(t,b(hl,{class:"text-green-500"})),t})():(()=>{var t=jr();return fe(t,b(gl,{class:"text-red-500"})),t})()},{accessorKey:"message",header:"Message",cell:e=>e.getValue()},{accessorKey:"id",header:"Created At",cell:e=>Dm(Am(String(e.getValue()))).format("YYYY-MM-DD HH:mm:ss")}];function Wm(e){const[t,n]=B(0),[r,o]=B(0);U(()=>{const a=e();if(!a)return;s(a);const u=new ResizeObserver(i);u.observe(a),W(()=>{u.disconnect()})});const i=a=>{for(const u of a)u.target===e()&&s(u.target)},s=a=>{o(a.offsetWidth),n(a.offsetHeight)};return{width:r,height:t}}var Xm=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Qm=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Ym(e){if(Intl.Locale){const n=new Intl.Locale(e).maximize().script??"";return Xm.has(n)}const t=e.split("-")[0];return Qm.has(t)}function Zm(e){return Ym(e)?"rtl":"ltr"}function Bc(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:Zm(e)}}var Ki=Bc(),lr=new Set;function pl(){Ki=Bc();for(const e of lr)e(Ki)}function Jm(){const[e,t]=B(Ki),n=K(()=>e());return Bn(()=>{lr.size===0&&window.addEventListener("languagechange",pl),lr.add(t),W(()=>{lr.delete(t),lr.size===0&&window.removeEventListener("languagechange",pl)})}),{locale:()=>n().locale,direction:()=>n().direction}}var ev=we();function Qt(){const e=Jm();return me(ev)||e}var _o=new Map;function tv(e){const{locale:t}=Qt(),n=K(()=>t()+(e?Object.entries(e).sort((r,o)=>r[0]<o[0]?-1:1).join():""));return K(()=>{const r=n();let o;return _o.has(r)&&(o=_o.get(r)),o||(o=new Intl.Collator(t(),e),_o.set(r,o)),o})}const nv=["top","right","bottom","left"],Ht=Math.min,Ge=Math.max,ro=Math.round,Br=Math.floor,gt=e=>({x:e,y:e}),rv={left:"right",right:"left",bottom:"top",top:"bottom"},ov={start:"end",end:"start"};function ji(e,t,n){return Ge(e,Ht(t,n))}function mn(e,t){return typeof e=="function"?e(t):e}function Ut(e){return e.split("-")[0]}function Hn(e){return e.split("-")[1]}function zc(e){return e==="x"?"y":"x"}function Ls(e){return e==="y"?"height":"width"}function fn(e){return["top","bottom"].includes(Ut(e))?"y":"x"}function _s(e){return zc(fn(e))}function iv(e,t,n){n===void 0&&(n=!1);const r=Hn(e),o=_s(e),i=Ls(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=oo(s)),[s,oo(s)]}function sv(e){const t=oo(e);return[Bi(e),t,Bi(t)]}function Bi(e){return e.replace(/start|end/g,t=>ov[t])}function av(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function lv(e,t,n,r){const o=Hn(e);let i=av(Ut(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Bi)))),i}function oo(e){return e.replace(/left|right|bottom|top/g,t=>rv[t])}function uv(e){return{top:0,right:0,bottom:0,left:0,...e}}function Gc(e){return typeof e!="number"?uv(e):{top:e,right:e,bottom:e,left:e}}function io(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function ml(e,t,n){let{reference:r,floating:o}=e;const i=fn(t),s=_s(t),a=Ls(s),u=Ut(t),l=i==="y",c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let h;switch(u){case"top":h={x:c,y:r.y-o.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Hn(t)){case"start":h[s]-=f*(n&&l?-1:1);break;case"end":h[s]+=f*(n&&l?-1:1);break}return h}const cv=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=ml(l,r,u),f=r,h={},g=0;for(let p=0;p<a.length;p++){const{name:v,fn:w}=a[p],{x:m,y,data:x,reset:C}=await w({x:c,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:l,platform:s,elements:{reference:e,floating:t}});c=m??c,d=y??d,h={...h,[v]:{...h[v],...x}},C&&g<=50&&(g++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(l=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:c,y:d}=ml(l,f,u)),p=-1)}return{x:c,y:d,placement:f,strategy:o,middlewareData:h}};async function br(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=mn(t,e),g=Gc(h),v=a[f?d==="floating"?"reference":"floating":d],w=io(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:c,strategy:u})),m=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),x=await(i.isElement==null?void 0:i.isElement(y))?await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1}:{x:1,y:1},C=io(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:y,strategy:u}):m);return{top:(w.top-C.top+g.top)/x.y,bottom:(C.bottom-w.bottom+g.bottom)/x.y,left:(w.left-C.left+g.left)/x.x,right:(C.right-w.right+g.right)/x.x}}const dv=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:u}=t,{element:l,padding:c=0}=mn(e,t)||{};if(l==null)return{};const d=Gc(c),f={x:n,y:r},h=_s(o),g=Ls(h),p=await s.getDimensions(l),v=h==="y",w=v?"top":"left",m=v?"bottom":"right",y=v?"clientHeight":"clientWidth",x=i.reference[g]+i.reference[h]-f[h]-i.floating[g],C=f[h]-i.reference[h],O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let L=O?O[y]:0;(!L||!await(s.isElement==null?void 0:s.isElement(O)))&&(L=a.floating[y]||i.floating[g]);const _=x/2-C/2,T=L/2-p[g]/2-1,V=Ht(d[w],T),N=Ht(d[m],T),z=V,ie=L-p[g]-N,P=L/2-p[g]/2+_,R=ji(z,P,ie),S=!u.arrow&&Hn(o)!=null&&P!==R&&i.reference[g]/2-(P<z?V:N)-p[g]/2<0,I=S?P<z?P-z:P-ie:0;return{[h]:f[h]+I,data:{[h]:R,centerOffset:P-R-I,...S&&{alignmentOffset:I}},reset:S}}}),fv=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:u,elements:l}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...v}=mn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=Ut(o),m=fn(a),y=Ut(a)===a,x=await(u.isRTL==null?void 0:u.isRTL(l.floating)),C=f||(y||!p?[oo(a)]:sv(a)),O=g!=="none";!f&&O&&C.push(...lv(a,p,g,x));const L=[a,...C],_=await br(t,v),T=[];let V=((r=i.flip)==null?void 0:r.overflows)||[];if(c&&T.push(_[w]),d){const P=iv(o,s,x);T.push(_[P[0]],_[P[1]])}if(V=[...V,{placement:o,overflows:T}],!T.every(P=>P<=0)){var N,z;const P=(((N=i.flip)==null?void 0:N.index)||0)+1,R=L[P];if(R)return{data:{index:P,overflows:V},reset:{placement:R}};let S=(z=V.filter(I=>I.overflows[0]<=0).sort((I,M)=>I.overflows[1]-M.overflows[1])[0])==null?void 0:z.placement;if(!S)switch(h){case"bestFit":{var ie;const I=(ie=V.filter(M=>{if(O){const F=fn(M.placement);return F===m||F==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(F=>F>0).reduce((F,D)=>F+D,0)]).sort((M,F)=>M[1]-F[1])[0])==null?void 0:ie[0];I&&(S=I);break}case"initialPlacement":S=a;break}if(o!==S)return{reset:{placement:S}}}return{}}}};function vl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function yl(e){return nv.some(t=>e[t]>=0)}const hv=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=mn(e,t);switch(r){case"referenceHidden":{const i=await br(t,{...o,elementContext:"reference"}),s=vl(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:yl(s)}}}case"escaped":{const i=await br(t,{...o,altBoundary:!0}),s=vl(i,n.floating);return{data:{escapedOffsets:s,escaped:yl(s)}}}default:return{}}}}};async function gv(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Ut(n),a=Hn(n),u=fn(n)==="y",l=["left","top"].includes(s)?-1:1,c=i&&u?-1:1,d=mn(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),u?{x:h*c,y:f*l}:{x:f*l,y:h*c}}const pv=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,u=await gv(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:s}}}}},mv=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:v=>{let{x:w,y:m}=v;return{x:w,y:m}}},...u}=mn(e,t),l={x:n,y:r},c=await br(t,u),d=fn(Ut(o)),f=zc(d);let h=l[f],g=l[d];if(i){const v=f==="y"?"top":"left",w=f==="y"?"bottom":"right",m=h+c[v],y=h-c[w];h=ji(m,h,y)}if(s){const v=d==="y"?"top":"left",w=d==="y"?"bottom":"right",m=g+c[v],y=g-c[w];g=ji(m,g,y)}const p=a.fn({...t,[f]:h,[d]:g});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[f]:i,[d]:s}}}}}},vv=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:u=()=>{},...l}=mn(e,t),c=await br(t,l),d=Ut(o),f=Hn(o),h=fn(o)==="y",{width:g,height:p}=i.floating;let v,w;d==="top"||d==="bottom"?(v=d,w=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(w=d,v=f==="end"?"top":"bottom");const m=p-c.top-c.bottom,y=g-c.left-c.right,x=Ht(p-c[v],m),C=Ht(g-c[w],y),O=!t.middlewareData.shift;let L=x,_=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(L=m),O&&!f){const V=Ge(c.left,0),N=Ge(c.right,0),z=Ge(c.top,0),ie=Ge(c.bottom,0);h?_=g-2*(V!==0||N!==0?V+N:Ge(c.left,c.right)):L=p-2*(z!==0||ie!==0?z+ie:Ge(c.top,c.bottom))}await u({...t,availableWidth:_,availableHeight:L});const T=await s.getDimensions(a.floating);return g!==T.width||p!==T.height?{reset:{rects:!0}}:{}}}};function mo(){return typeof window<"u"}function Un(e){return Hc(e)?(e.nodeName||"").toLowerCase():"#document"}function Ue(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function bt(e){var t;return(t=(Hc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Hc(e){return mo()?e instanceof Node||e instanceof Ue(e).Node:!1}function lt(e){return mo()?e instanceof Element||e instanceof Ue(e).Element:!1}function mt(e){return mo()?e instanceof HTMLElement||e instanceof Ue(e).HTMLElement:!1}function wl(e){return!mo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ue(e).ShadowRoot}function Ar(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ut(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function yv(e){return["table","td","th"].includes(Un(e))}function vo(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ks(e){const t=Vs(),n=lt(e)?ut(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function wv(e){let t=qt(e);for(;mt(t)&&!jn(t);){if(ks(t))return t;if(vo(t))return null;t=qt(t)}return null}function Vs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function jn(e){return["html","body","#document"].includes(Un(e))}function ut(e){return Ue(e).getComputedStyle(e)}function yo(e){return lt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qt(e){if(Un(e)==="html")return e;const t=e.assignedSlot||e.parentNode||wl(e)&&e.host||bt(e);return wl(t)?t.host:t}function Uc(e){const t=qt(e);return jn(t)?e.ownerDocument?e.ownerDocument.body:e.body:mt(t)&&Ar(t)?t:Uc(t)}function Sr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Uc(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Ue(o);if(i){const a=zi(s);return t.concat(s,s.visualViewport||[],Ar(o)?o:[],a&&n?Sr(a):[])}return t.concat(o,Sr(o,[],n))}function zi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function qc(e){const t=ut(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=mt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=ro(n)!==i||ro(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Ns(e){return lt(e)?e:e.contextElement}function Rn(e){const t=Ns(e);if(!mt(t))return gt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=qc(t);let s=(i?ro(n.width):n.width)/r,a=(i?ro(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const bv=gt(0);function Wc(e){const t=Ue(e);return!Vs()||!t.visualViewport?bv:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Sv(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ue(e)?!1:t}function hn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Ns(e);let s=gt(1);t&&(r?lt(r)&&(s=Rn(r)):s=Rn(e));const a=Sv(i,n,r)?Wc(i):gt(0);let u=(o.left+a.x)/s.x,l=(o.top+a.y)/s.y,c=o.width/s.x,d=o.height/s.y;if(i){const f=Ue(i),h=r&&lt(r)?Ue(r):r;let g=f,p=zi(g);for(;p&&r&&h!==g;){const v=Rn(p),w=p.getBoundingClientRect(),m=ut(p),y=w.left+(p.clientLeft+parseFloat(m.paddingLeft))*v.x,x=w.top+(p.clientTop+parseFloat(m.paddingTop))*v.y;u*=v.x,l*=v.y,c*=v.x,d*=v.y,u+=y,l+=x,g=Ue(p),p=zi(g)}}return io({width:c,height:d,x:u,y:l})}function Ks(e,t){const n=yo(e).scrollLeft;return t?t.left+n:hn(bt(e)).left+n}function Xc(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Ks(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function xv(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=bt(r),a=t?vo(t.floating):!1;if(r===s||a&&i)return n;let u={scrollLeft:0,scrollTop:0},l=gt(1);const c=gt(0),d=mt(r);if((d||!d&&!i)&&((Un(r)!=="body"||Ar(s))&&(u=yo(r)),mt(r))){const h=hn(r);l=Rn(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const f=s&&!d&&!i?Xc(s,u,!0):gt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-u.scrollLeft*l.x+c.x+f.x,y:n.y*l.y-u.scrollTop*l.y+c.y+f.y}}function Cv(e){return Array.from(e.getClientRects())}function Ev(e){const t=bt(e),n=yo(e),r=e.ownerDocument.body,o=Ge(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ge(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Ks(e);const a=-n.scrollTop;return ut(r).direction==="rtl"&&(s+=Ge(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function Rv(e,t){const n=Ue(e),r=bt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,u=0;if(o){i=o.width,s=o.height;const l=Vs();(!l||l&&t==="fixed")&&(a=o.offsetLeft,u=o.offsetTop)}return{width:i,height:s,x:a,y:u}}function Pv(e,t){const n=hn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=mt(e)?Rn(e):gt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,u=o*i.x,l=r*i.y;return{width:s,height:a,x:u,y:l}}function bl(e,t,n){let r;if(t==="viewport")r=Rv(e,n);else if(t==="document")r=Ev(bt(e));else if(lt(t))r=Pv(t,n);else{const o=Wc(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return io(r)}function Qc(e,t){const n=qt(e);return n===t||!lt(n)||jn(n)?!1:ut(n).position==="fixed"||Qc(n,t)}function Iv(e,t){const n=t.get(e);if(n)return n;let r=Sr(e,[],!1).filter(a=>lt(a)&&Un(a)!=="body"),o=null;const i=ut(e).position==="fixed";let s=i?qt(e):e;for(;lt(s)&&!jn(s);){const a=ut(s),u=ks(s);!u&&a.position==="fixed"&&(o=null),(i?!u&&!o:!u&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Ar(s)&&!u&&Qc(e,s))?r=r.filter(c=>c!==s):o=a,s=qt(s)}return t.set(e,r),r}function Mv(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?vo(t)?[]:Iv(t,this._c):[].concat(n),r],a=s[0],u=s.reduce((l,c)=>{const d=bl(t,c,o);return l.top=Ge(d.top,l.top),l.right=Ht(d.right,l.right),l.bottom=Ht(d.bottom,l.bottom),l.left=Ge(d.left,l.left),l},bl(t,a,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Fv(e){const{width:t,height:n}=qc(e);return{width:t,height:n}}function Av(e,t,n){const r=mt(t),o=bt(t),i=n==="fixed",s=hn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const u=gt(0);if(r||!r&&!i)if((Un(t)!=="body"||Ar(o))&&(a=yo(t)),r){const f=hn(t,!0,i,t);u.x=f.x+t.clientLeft,u.y=f.y+t.clientTop}else o&&(u.x=Ks(o));const l=o&&!r&&!i?Xc(o,a):gt(0),c=s.left+a.scrollLeft-u.x-l.x,d=s.top+a.scrollTop-u.y-l.y;return{x:c,y:d,width:s.width,height:s.height}}function ko(e){return ut(e).position==="static"}function Sl(e,t){if(!mt(e)||ut(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return bt(e)===n&&(n=n.ownerDocument.body),n}function Yc(e,t){const n=Ue(e);if(vo(e))return n;if(!mt(e)){let o=qt(e);for(;o&&!jn(o);){if(lt(o)&&!ko(o))return o;o=qt(o)}return n}let r=Sl(e,t);for(;r&&yv(r)&&ko(r);)r=Sl(r,t);return r&&jn(r)&&ko(r)&&!ks(r)?n:r||wv(e)||n}const $v=async function(e){const t=this.getOffsetParent||Yc,n=this.getDimensions,r=await n(e.floating);return{reference:Av(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ov(e){return ut(e).direction==="rtl"}const Zc={convertOffsetParentRelativeRectToViewportRelativeRect:xv,getDocumentElement:bt,getClippingRect:Mv,getOffsetParent:Yc,getElementRects:$v,getClientRects:Cv,getDimensions:Fv,getScale:Rn,isElement:lt,isRTL:Ov};function Tv(e,t){let n=null,r;const o=bt(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),i();const{left:l,top:c,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h=Br(c),g=Br(o.clientWidth-(l+d)),p=Br(o.clientHeight-(c+f)),v=Br(l),m={rootMargin:-h+"px "+-g+"px "+-p+"px "+-v+"px",threshold:Ge(0,Ht(1,u))||1};let y=!0;function x(C){const O=C[0].intersectionRatio;if(O!==u){if(!y)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{n=new IntersectionObserver(x,{...m,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,m)}n.observe(e)}return s(!0),i}function Dv(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,l=Ns(e),c=o||i?[...l?Sr(l):[],...Sr(t)]:[];c.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const d=l&&a?Tv(l,n):null;let f=-1,h=null;s&&(h=new ResizeObserver(w=>{let[m]=w;m&&m.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=h)==null||y.observe(t)})),n()}),l&&!u&&h.observe(l),h.observe(t));let g,p=u?hn(e):null;u&&v();function v(){const w=hn(e);p&&(w.x!==p.x||w.y!==p.y||w.width!==p.width||w.height!==p.height)&&n(),p=w,g=requestAnimationFrame(v)}return n(),()=>{var w;c.forEach(m=>{o&&m.removeEventListener("scroll",n),i&&m.removeEventListener("resize",n)}),d==null||d(),(w=h)==null||w.disconnect(),h=null,u&&cancelAnimationFrame(g)}}const Lv=pv,_v=mv,kv=fv,Vv=vv,Nv=hv,Kv=dv,jv=(e,t,n)=>{const r=new Map,o={platform:Zc,...n},i={...o.platform,_c:r};return cv(e,t,{...o,platform:i})};var Bv=he('<svg display=block viewBox="0 0 30 30"style=transform:scale(1.02)><g><path fill=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z></path><path stroke=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z>'),js=we();function Bs(){const e=me(js);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var Gi=30,xl=Gi/2,zv={top:180,right:-90,bottom:0,left:90};function Jc(e){const t=Bs(),n=Z({size:Gi},e),[r,o]=k(n,["ref","style","size"]),i=()=>t.currentPlacement().split("-")[0],s=Gv(t.contentRef),a=()=>{var f;return((f=s())==null?void 0:f.getPropertyValue("background-color"))||"none"},u=()=>{var f;return((f=s())==null?void 0:f.getPropertyValue(`border-${i()}-color`))||"none"},l=()=>{var f;return((f=s())==null?void 0:f.getPropertyValue(`border-${i()}-width`))||"0px"},c=()=>Number.parseInt(l())*2*(Gi/r.size),d=()=>`rotate(${zv[i()]} ${xl} ${xl}) translate(0 2)`;return b(ae,A({as:"div",ref(f){var h=ve(t.setArrowRef,r.ref);typeof h=="function"&&h(f)},"aria-hidden":"true",get style(){return vt({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:a(),stroke:u(),"stroke-width":c()},r.style)}},o,{get children(){var f=Bv(),h=f.firstChild,g=h.firstChild;return g.nextSibling,Ke(()=>Nn(h,"transform",d())),f}}))}function Gv(e){const[t,n]=B();return U(()=>{const r=e();r&&n(cc(r).getComputedStyle(r))}),t}function Hv(e){const t=Bs(),[n,r]=k(e,["ref","style"]);return b(ae,A({as:"div",ref(o){var i=ve(t.setPositionerRef,n.ref);typeof i=="function"&&i(o)},"data-popper-positioner":"",get style(){return vt({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function Cl(e){const{x:t=0,y:n=0,width:r=0,height:o=0}=e??{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,o);const i={x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:n+o,left:t};return{...i,toJSON:()=>i}}function Uv(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?Cl(r):e?e.getBoundingClientRect():Cl()}}}function qv(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var Wv={top:"bottom",right:"left",bottom:"top",left:"right"};function Xv(e,t){const[n,r]=e.split("-"),o=Wv[n];return r?n==="left"||n==="right"?`${o} ${r==="start"?"top":"bottom"}`:r==="start"?`${o} ${t==="rtl"?"right":"left"}`:`${o} ${t==="rtl"?"left":"right"}`:`${o} center`}function Qv(e){const t=Z({getAnchorRect:f=>f==null?void 0:f.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=B(),[o,i]=B(),[s,a]=B(t.placement),u=()=>{var f;return Uv((f=t.anchorRef)==null?void 0:f.call(t),t.getAnchorRect)},{direction:l}=Qt();async function c(){var O,L;const f=u(),h=n(),g=o();if(!f||!h)return;const p=((g==null?void 0:g.clientHeight)||0)/2,v=typeof t.gutter=="number"?t.gutter+p:t.gutter??p;h.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const w=[Lv(({placement:_})=>{const T=!!_.split("-")[1];return{mainAxis:v,crossAxis:T?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const _=typeof t.flip=="string"?t.flip.split(" "):void 0;if(_!==void 0&&!_.every(qv))throw new Error("`flip` expects a spaced-delimited list of placements");w.push(kv({padding:t.overflowPadding,fallbackPlacements:_}))}(t.slide||t.overlap)&&w.push(_v({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),w.push(Vv({padding:t.overflowPadding,apply({availableWidth:_,availableHeight:T,rects:V}){const N=Math.round(V.reference.width);_=Math.floor(_),T=Math.floor(T),h.style.setProperty("--kb-popper-anchor-width",`${N}px`),h.style.setProperty("--kb-popper-content-available-width",`${_}px`),h.style.setProperty("--kb-popper-content-available-height",`${T}px`),t.sameWidth&&(h.style.width=`${N}px`),t.fitViewport&&(h.style.maxWidth=`${_}px`,h.style.maxHeight=`${T}px`)}})),t.hideWhenDetached&&w.push(Nv({padding:t.detachedPadding})),g&&w.push(Kv({element:g,padding:t.arrowPadding}));const m=await jv(f,h,{placement:t.placement,strategy:"absolute",middleware:w,platform:{...Zc,isRTL:()=>l()==="rtl"}});if(a(m.placement),(O=t.onCurrentPlacementChange)==null||O.call(t,m.placement),!h)return;h.style.setProperty("--kb-popper-content-transform-origin",Xv(m.placement,l()));const y=Math.round(m.x),x=Math.round(m.y);let C;if(t.hideWhenDetached&&(C=(L=m.middlewareData.hide)!=null&&L.referenceHidden?"hidden":"visible"),Object.assign(h.style,{top:"0",left:"0",transform:`translate3d(${y}px, ${x}px, 0)`,visibility:C}),g&&m.middlewareData.arrow){const{x:_,y:T}=m.middlewareData.arrow,V=m.placement.split("-")[0];Object.assign(g.style,{left:_!=null?`${_}px`:"",top:T!=null?`${T}px`:"",[V]:"100%"})}}U(()=>{const f=u(),h=n();if(!f||!h)return;const g=Dv(f,h,c,{elementResize:typeof ResizeObserver=="function"});W(g)}),U(()=>{var g;const f=n(),h=(g=t.contentRef)==null?void 0:g.call(t);!f||!h||queueMicrotask(()=>{f.style.zIndex=getComputedStyle(h).zIndex})});const d={currentPlacement:s,contentRef:()=>{var f;return(f=t.contentRef)==null?void 0:f.call(t)},setPositionerRef:r,setArrowRef:i};return b(js.Provider,{value:d,get children(){return t.children}})}var wo=Object.assign(Qv,{Arrow:Jc,Context:js,usePopperContext:Bs,Positioner:Hv}),ed=we();function td(){return me(ed)}function Yv(){const e=td();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function nd(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function Zv(e,t){var o;const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const i=(o=e[r])==null?void 0:o.ref();if(i&&nd(i,n))return r+1}return 0}function Jv(e){const t=e.map((r,o)=>[o,r]);let n=!1;return t.sort(([r,o],[i,s])=>{const a=o.ref(),u=s.ref();return a===u||!a||!u?0:nd(a,u)?(r>i&&(n=!0),-1):(r<i&&(n=!0),1)}),n?t.map(([r,o])=>o):e}function rd(e,t){const n=Jv(e);e!==n&&t(n)}function ey(e){var o,i;const t=e[0],n=(o=e[e.length-1])==null?void 0:o.ref();let r=(i=t==null?void 0:t.ref())==null?void 0:i.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return Ze(r).body}function ty(e,t){U(()=>{const n=setTimeout(()=>{rd(e(),t)});W(()=>clearTimeout(n))})}function ny(e,t){if(typeof IntersectionObserver!="function"){ty(e,t);return}let n=[];U(()=>{const r=()=>{const s=!!n.length;n=e(),s&&rd(e(),t)},o=ey(e()),i=new IntersectionObserver(r,{root:o});for(const s of e()){const a=s.ref();a&&i.observe(a)}W(()=>i.disconnect())})}function ry(e={}){const[t,n]=lm({value:()=>$(e.items),onChange:i=>{var s;return(s=e.onItemsChange)==null?void 0:s.call(e,i)}});ny(t,n);const r=i=>(n(s=>{const a=Zv(s,i);return vg(s,i,a)}),()=>{n(s=>{const a=s.filter(u=>u.ref()!==i.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:i=>b(ed.Provider,{value:{registerItem:r},get children(){return i.children}})}}function oy(e){const t=Yv(),n=Z({shouldRegisterItem:!0},e);U(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());W(r)})}function od(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=u=>{if(u==null)return"";const l=e.getKey??"key",c=bn(l)?u[l]:l(u);return c!=null?String(c):""},i=u=>{if(u==null)return"";const l=e.getTextValue??"textValue",c=bn(l)?u[l]:l(u);return c!=null?String(c):""},s=u=>{if(u==null)return!1;const l=e.getDisabled??"disabled";return(bn(l)?u[l]:l(u))??!1},a=u=>{var l;if(u!=null)return bn(e.getSectionChildren)?u[e.getSectionChildren]:(l=e.getSectionChildren)==null?void 0:l.call(e,u)};for(const u of e.dataSource){if(bn(u)||yg(u)){r.push({type:"item",rawValue:u,key:String(u),textValue:String(u),disabled:s(u),level:n,index:t}),t++;continue}if(a(u)!=null){r.push({type:"section",rawValue:u,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const l=a(u)??[];if(l.length>0){const c=od({dataSource:l,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...c),t+=c.length}}else r.push({type:"item",rawValue:u,key:o(u),textValue:i(u),disabled:s(u),level:n,index:t}),t++}return r}function iy(e,t=[]){return K(()=>{const n=od({dataSource:$(e.dataSource),getKey:$(e.getKey),getTextValue:$(e.getTextValue),getDisabled:$(e.getDisabled),getSectionChildren:$(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var Pt=class id extends Set{constructor(n,r,o){super(n);Re(this,"anchorKey");Re(this,"currentKey");n instanceof id?(this.anchorKey=r||n.anchorKey,this.currentKey=o||n.currentKey):(this.anchorKey=r,this.currentKey=o)}};function sy(e){const[t,n]=pt(e);return[()=>t()??new Pt,n]}function sd(e){return xg()?e.altKey:e.ctrlKey}function Sn(e){return ho()?e.metaKey:e.ctrlKey}function El(e){return new Pt(e)}function ay(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function ly(e){const t=Z({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=B(!1),[o,i]=B(),s=K(()=>{const p=$(t.selectedKeys);return p!=null?El(p):p}),a=K(()=>{const p=$(t.defaultSelectedKeys);return p!=null?El(p):new Pt}),[u,l]=sy({value:s,defaultValue:a,onChange:p=>{var v;return(v=t.onSelectionChange)==null?void 0:v.call(t,p)}}),[c,d]=B($(t.selectionBehavior)),f=()=>$(t.selectionMode),h=()=>$(t.disallowEmptySelection)??!1,g=p=>{($(t.allowDuplicateSelectionEvents)||!ay(p,u()))&&l(p)};return U(()=>{const p=u();$(t.selectionBehavior)==="replace"&&c()==="toggle"&&typeof p=="object"&&p.size===0&&d("replace")}),U(()=>{d($(t.selectionBehavior)??"toggle")}),{selectionMode:f,disallowEmptySelection:h,selectionBehavior:c,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:u,setSelectedKeys:g}}function uy(e){const[t,n]=B(""),[r,o]=B(-1);return{typeSelectHandlers:{onKeyDown:s=>{var f;if($(e.isDisabled))return;const a=$(e.keyboardDelegate),u=$(e.selectionManager);if(!a.getKeyForSearch)return;const l=cy(s.key);if(!l||s.ctrlKey||s.metaKey)return;l===" "&&t().trim().length>0&&(s.preventDefault(),s.stopPropagation());let c=n(h=>h+l),d=a.getKeyForSearch(c,u.focusedKey())??a.getKeyForSearch(c);d==null&&dy(c)&&(c=c[0],d=a.getKeyForSearch(c,u.focusedKey())??a.getKeyForSearch(c)),d!=null&&(u.setFocusedKey(d),(f=e.onTypeSelect)==null||f.call(e,d)),clearTimeout(r()),o(window.setTimeout(()=>n(""),500))}}}}function cy(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function dy(e){return e.split("").every(t=>t===e[0])}function fy(e,t,n){const o=A({selectOnFocus:()=>$(e.selectionManager).selectionBehavior()==="replace"},e),i=()=>t(),{direction:s}=Qt();let a={top:0,left:0};pg(()=>$(o.isVirtualized)?void 0:i(),"scroll",()=>{const v=i();v&&(a={top:v.scrollTop,left:v.scrollLeft})});const{typeSelectHandlers:u}=uy({isDisabled:()=>$(o.disallowTypeAhead),keyboardDelegate:()=>$(o.keyboardDelegate),selectionManager:()=>$(o.selectionManager)}),l=()=>$(o.orientation)??"vertical",c=v=>{var _,T,V,N,z,ie,P,R;oe(v,u.onKeyDown),v.altKey&&v.key==="Tab"&&v.preventDefault();const w=t();if(!(w!=null&&w.contains(v.target)))return;const m=$(o.selectionManager),y=$(o.selectOnFocus),x=S=>{S!=null&&(m.setFocusedKey(S),v.shiftKey&&m.selectionMode()==="multiple"?m.extendSelection(S):y&&!sd(v)&&m.replaceSelection(S))},C=$(o.keyboardDelegate),O=$(o.shouldFocusWrap),L=m.focusedKey();switch(v.key){case(l()==="vertical"?"ArrowDown":"ArrowRight"):{if(C.getKeyBelow){v.preventDefault();let S;L!=null?S=C.getKeyBelow(L):S=(_=C.getFirstKey)==null?void 0:_.call(C),S==null&&O&&(S=(T=C.getFirstKey)==null?void 0:T.call(C,L)),x(S)}break}case(l()==="vertical"?"ArrowUp":"ArrowLeft"):{if(C.getKeyAbove){v.preventDefault();let S;L!=null?S=C.getKeyAbove(L):S=(V=C.getLastKey)==null?void 0:V.call(C),S==null&&O&&(S=(N=C.getLastKey)==null?void 0:N.call(C,L)),x(S)}break}case(l()==="vertical"?"ArrowLeft":"ArrowUp"):{if(C.getKeyLeftOf){v.preventDefault();const S=s()==="rtl";let I;L!=null?I=C.getKeyLeftOf(L):I=S?(z=C.getFirstKey)==null?void 0:z.call(C):(ie=C.getLastKey)==null?void 0:ie.call(C),x(I)}break}case(l()==="vertical"?"ArrowRight":"ArrowDown"):{if(C.getKeyRightOf){v.preventDefault();const S=s()==="rtl";let I;L!=null?I=C.getKeyRightOf(L):I=S?(P=C.getLastKey)==null?void 0:P.call(C):(R=C.getFirstKey)==null?void 0:R.call(C),x(I)}break}case"Home":if(C.getFirstKey){v.preventDefault();const S=C.getFirstKey(L,Sn(v));S!=null&&(m.setFocusedKey(S),Sn(v)&&v.shiftKey&&m.selectionMode()==="multiple"?m.extendSelection(S):y&&m.replaceSelection(S))}break;case"End":if(C.getLastKey){v.preventDefault();const S=C.getLastKey(L,Sn(v));S!=null&&(m.setFocusedKey(S),Sn(v)&&v.shiftKey&&m.selectionMode()==="multiple"?m.extendSelection(S):y&&m.replaceSelection(S))}break;case"PageDown":if(C.getKeyPageBelow&&L!=null){v.preventDefault();const S=C.getKeyPageBelow(L);x(S)}break;case"PageUp":if(C.getKeyPageAbove&&L!=null){v.preventDefault();const S=C.getKeyPageAbove(L);x(S)}break;case"a":Sn(v)&&m.selectionMode()==="multiple"&&$(o.disallowSelectAll)!==!0&&(v.preventDefault(),m.selectAll());break;case"Escape":v.defaultPrevented||(v.preventDefault(),$(o.disallowEmptySelection)||m.clearSelection());break;case"Tab":if(!$(o.allowsTabNavigation)){if(v.shiftKey)w.focus();else{const S=Og(w,{tabbable:!0});let I,M;do M=S.lastChild(),M&&(I=M);while(M);I&&!I.contains(document.activeElement)&&Ie(I)}break}}},d=v=>{var x,C;const w=$(o.selectionManager),m=$(o.keyboardDelegate),y=$(o.selectOnFocus);if(w.isFocused()){v.currentTarget.contains(v.target)||w.setFocused(!1);return}if(v.currentTarget.contains(v.target)){if(w.setFocused(!0),w.focusedKey()==null){const O=_=>{_!=null&&(w.setFocusedKey(_),y&&w.replaceSelection(_))},L=v.relatedTarget;L&&v.currentTarget.compareDocumentPosition(L)&Node.DOCUMENT_POSITION_FOLLOWING?O(w.lastSelectedKey()??((x=m.getLastKey)==null?void 0:x.call(m))):O(w.firstSelectedKey()??((C=m.getFirstKey)==null?void 0:C.call(m)))}else if(!$(o.isVirtualized)){const O=i();if(O){O.scrollTop=a.top,O.scrollLeft=a.left;const L=O.querySelector(`[data-key="${w.focusedKey()}"]`);L&&(Ie(L),Li(O,L))}}}},f=v=>{const w=$(o.selectionManager);v.currentTarget.contains(v.relatedTarget)||w.setFocused(!1)},h=v=>{i()===v.target&&v.preventDefault()},g=()=>{var O,L;const v=$(o.autoFocus);if(!v)return;const w=$(o.selectionManager),m=$(o.keyboardDelegate);let y;v==="first"&&(y=(O=m.getFirstKey)==null?void 0:O.call(m)),v==="last"&&(y=(L=m.getLastKey)==null?void 0:L.call(m));const x=w.selectedKeys();x.size&&(y=x.values().next().value),w.setFocused(!0),w.setFocusedKey(y);const C=t();C&&y==null&&!$(o.shouldUseVirtualFocus)&&Ie(C)};return Bn(()=>{o.deferAutoFocus?setTimeout(g,0):g()}),U(Ce([i,()=>$(o.isVirtualized),()=>$(o.selectionManager).focusedKey()],v=>{var x;const[w,m,y]=v;if(m)y&&((x=o.scrollToKey)==null||x.call(o,y));else if(y&&w){const C=w.querySelector(`[data-key="${y}"]`);C&&Li(w,C)}})),{tabIndex:K(()=>{if(!$(o.shouldUseVirtualFocus))return $(o.selectionManager).focusedKey()==null?0:-1}),onKeyDown:c,onMouseDown:h,onFocusIn:d,onFocusOut:f}}function ad(e,t){const n=()=>$(e.selectionManager),r=()=>$(e.key),o=()=>$(e.shouldUseVirtualFocus),i=m=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):m!=null&&m.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||Sn(m)||"pointerType"in m&&m.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>n().isSelected(r()),a=()=>$(e.disabled)||n().isDisabled(r()),u=()=>!a()&&n().canSelectItem(r());let l=null;const c=m=>{u()&&(l=m.pointerType,m.pointerType==="mouse"&&m.button===0&&!$(e.shouldSelectOnPressUp)&&i(m))},d=m=>{u()&&m.pointerType==="mouse"&&m.button===0&&$(e.shouldSelectOnPressUp)&&$(e.allowsDifferentPressOrigin)&&i(m)},f=m=>{u()&&($(e.shouldSelectOnPressUp)&&!$(e.allowsDifferentPressOrigin)||l!=="mouse")&&i(m)},h=m=>{!u()||!["Enter"," "].includes(m.key)||(sd(m)?n().toggleSelection(r()):i(m))},g=m=>{a()&&m.preventDefault()},p=m=>{const y=t();o()||a()||!y||m.target===y&&n().setFocusedKey(r())},v=K(()=>{if(!(o()||a()))return r()===n().focusedKey()?0:-1}),w=K(()=>$(e.virtualized)?void 0:r());return U(Ce([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],([m,y,x,C,O])=>{m&&y===C&&O&&!x&&document.activeElement!==m&&(e.focus?e.focus():Ie(m))})),{isSelected:s,isDisabled:a,allowsSelection:u,tabIndex:v,dataKey:w,onPointerDown:c,onPointerUp:d,onClick:f,onKeyDown:h,onMouseDown:g,onFocus:p}}var hy=class{constructor(e,t){Re(this,"collection");Re(this,"state");this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(e==null||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if(this.state.selectionMode()==="none")return!1;const t=this.getKey(e);return t==null?!1:this.state.selectedKeys().has(t)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every(t=>e.has(t))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index<e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index>e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}extendSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,o=new Pt(n,r,t);for(const i of this.getKeyRange(r,n.currentKey||t))o.delete(i);for(const i of this.getKeyRange(t,r))this.canSelectItem(i)&&o.add(i);this.state.setSelectedKeys(o)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?n.index!=null&&r.index!=null&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;r!=null;){const o=this.collection().getItem(r);if(o&&o.type==="item"&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?!t||t.type!=="item"?null:t.key:e}toggleSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=new Pt(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection()&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode()==="none")return;const t=this.getKey(e);if(t==null)return;const n=this.canSelectItem(t)?new Pt([t],t,t):new Pt;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new Pt;for(const n of e){const r=this.getKey(n);if(r!=null&&(t.add(r),this.selectionMode()==="single"))break}this.state.setSelectedKeys(t)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new Pt)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior()==="toggle"||t&&t.pointerType==="touch"?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode()==="none")return!1;const t=this.collection().getItem(e);return t!=null&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(n=>{for(;n!=null;){if(this.canSelectItem(n)){const r=this.collection().getItem(n);if(!r)continue;r.type==="item"&&e.push(n)}n=this.collection().getKeyAfter(n)}})(this.collection().getFirstKey()),e}},Rl=class{constructor(e){Re(this,"keyMap",new Map);Re(this,"iterable");Re(this,"firstKey");Re(this,"lastKey");this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(this.keyMap.size===0)return;let t,n=0;for(const[r,o]of this.keyMap)t?(t.nextKey=r,o.prevKey=t.key):(this.firstKey=r,o.prevKey=void 0),o.type==="item"&&(o.index=n++),t=o,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.prevKey}getKeyAfter(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};function gy(e){const t=ly(e),r=iy({dataSource:()=>$(e.dataSource),getKey:()=>$(e.getKey),getTextValue:()=>$(e.getTextValue),getDisabled:()=>$(e.getDisabled),getSectionChildren:()=>$(e.getSectionChildren),factory:i=>e.filter?new Rl(e.filter(i)):new Rl(i)},[()=>e.filter]),o=new hy(r,t);return Mt(()=>{const i=t.focusedKey();i!=null&&!r().getItem(i)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>o}}var py=class{constructor(e,t,n){Re(this,"collection");Re(this,"ref");Re(this,"collator");this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){var t,n;return((n=(t=this.ref)==null?void 0:t.call(this))==null?void 0:n.querySelector(`[data-key="${e}"]`))??null}getKeyPageAbove(e){var i;const t=(i=this.ref)==null?void 0:i.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let o=e;for(;o&&n&&n.offsetTop>r;)o=this.getKeyAbove(o),n=o!=null?this.getItem(o):null;return o}getKeyPageBelow(e){var i;const t=(i=this.ref)==null?void 0:i.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let o=e;for(;o&&n&&n.offsetTop<r;)o=this.getKeyBelow(o),n=o!=null?this.getItem(o):null;return o}getKeyForSearch(e,t){var o;const n=(o=this.collator)==null?void 0:o.call(this);if(!n)return;let r=t!=null?this.getKeyBelow(t):this.getFirstKey();for(;r!=null;){const i=this.collection().getItem(r);if(i){const s=i.textValue.slice(0,e.length);if(i.textValue&&n.compare(s,e)===0)return r}r=this.getKeyBelow(r)}}};function my(e,t,n){const r=tv({usage:"search",sensitivity:"base"}),o=K(()=>{const i=$(e.keyboardDelegate);return i||new py(e.collection,t,r)});return fy({selectionManager:()=>$(e.selectionManager),keyboardDelegate:o,autoFocus:()=>$(e.autoFocus),deferAutoFocus:()=>$(e.deferAutoFocus),shouldFocusWrap:()=>$(e.shouldFocusWrap),disallowEmptySelection:()=>$(e.disallowEmptySelection),selectOnFocus:()=>$(e.selectOnFocus),disallowTypeAhead:()=>$(e.disallowTypeAhead),shouldUseVirtualFocus:()=>$(e.shouldUseVirtualFocus),allowsTabNavigation:()=>$(e.allowsTabNavigation),isVirtualized:()=>$(e.isVirtualized),scrollToKey:i=>{var s;return(s=$(e.scrollToKey))==null?void 0:s(i)},orientation:()=>$(e.orientation)},t)}function ld(e={}){const[t,n]=Lc({value:()=>$(e.isSelected),defaultValue:()=>!!$(e.defaultIsSelected),onChange:i=>{var s;return(s=e.onSelectedChange)==null?void 0:s.call(e,i)}});return{isSelected:t,setIsSelected:i=>{!$(e.isReadOnly)&&!$(e.isDisabled)&&n(i)},toggle:()=>{!$(e.isReadOnly)&&!$(e.isDisabled)&&n(!t())}}}var ud=we();function bo(){return me(ud)}function At(){const e=bo();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var cd=we();function zs(){const e=me(cd);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var dd=we();function St(){const e=me(dd);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function Gs(e){let t;const n=St(),r=At(),o=Z({id:n.generateId(`item-${Ee()}`)},e),[i,s]=k(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,u]=B(),[l,c]=B(),[d,f]=B(),h=()=>r.listState().selectionManager(),g=()=>s.id,p=()=>h().focusedKey()===g(),v=()=>{var T;(T=i.onSelect)==null||T.call(i),i.closeOnSelect&&setTimeout(()=>{r.close(!0)})};oy({getItem:()=>{var T;return{ref:()=>t,type:"item",key:g(),textValue:i.textValue??((T=d())==null?void 0:T.textContent)??(t==null?void 0:t.textContent)??"",disabled:i.disabled??!1}}});const w=ad({key:g,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),m=T=>{oe(T,i.onPointerMove),T.pointerType==="mouse"&&(i.disabled?r.onItemLeave(T):(r.onItemEnter(T),T.defaultPrevented||(Ie(T.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(g()))))},y=T=>{oe(T,i.onPointerLeave),T.pointerType==="mouse"&&r.onItemLeave(T)},x=T=>{oe(T,i.onPointerUp),!i.disabled&&T.button===0&&v()},C=T=>{if(oe(T,i.onKeyDown),!T.repeat&&!i.disabled)switch(T.key){case"Enter":case" ":v();break}},O=K(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),L=K(()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":p()?"":void 0})),_={isChecked:()=>i.checked,dataset:L,setLabelRef:f,generateId:yt(()=>s.id),registerLabel:Be(u),registerDescription:Be(c)};return b(cd.Provider,{value:_,get children(){return b(ae,A({as:"div",ref(T){var V=ve(N=>t=N,i.ref);typeof V=="function"&&V(T)},get tabIndex(){return w.tabIndex()},get"aria-checked"(){return O()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return l()},get"data-key"(){return w.dataKey()},get onPointerDown(){return be([i.onPointerDown,w.onPointerDown])},get onPointerUp(){return be([x,w.onPointerUp])},get onClick(){return be([i.onClick,w.onClick])},get onKeyDown(){return be([C,w.onKeyDown])},get onMouseDown(){return be([i.onMouseDown,w.onMouseDown])},get onFocus(){return be([i.onFocus,w.onFocus])},onPointerMove:m,onPointerLeave:y},L,s))}})}function vy(e){const t=Z({closeOnSelect:!1},e),[n,r]=k(t,["checked","defaultChecked","onChange","onSelect"]),o=ld({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:s=>{var a;return(a=n.onChange)==null?void 0:a.call(n,s)},isDisabled:()=>r.disabled});return b(Gs,A({role:"menuitemcheckbox",get checked(){return o.isSelected()},onSelect:()=>{var s;(s=n.onSelect)==null||s.call(n),o.toggle()}},r))}var fd=we();function $r(){return me(fd)}function qn(){const e=$r();if(e===void 0)throw new Error("[kobalte]: `useMenubarContext` must be used within a `Menubar` component");return e}var xr={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>xr.next(e==="ltr"?"rtl":"ltr",t)},Pl={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function Il(e){const t=St(),n=At(),r=$r(),{direction:o}=Qt(),i=Z({id:t.generateId("trigger")},e),[s,a]=k(i,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let u=()=>t.value();r!==void 0&&(u=()=>t.value()??s.id,r.lastValue()===void 0&&r.setLastValue(u));const l=go(()=>n.triggerRef(),()=>"button"),c=K(()=>{var w;return l()==="a"&&((w=n.triggerRef())==null?void 0:w.getAttribute("href"))!=null});U(Ce(()=>r==null?void 0:r.value(),w=>{var m;c()&&w===u()&&((m=n.triggerRef())==null||m.focus())}));const d=()=>{r!==void 0?n.isOpen()?r.value()===u()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)},f=w=>{oe(w,s.onPointerDown),w.currentTarget.dataset.pointerType=w.pointerType,!s.disabled&&w.pointerType!=="touch"&&w.button===0&&d()},h=w=>{oe(w,s.onClick),s.disabled||w.currentTarget.dataset.pointerType==="touch"&&d()},g=w=>{if(oe(w,s.onKeyDown),!s.disabled){if(c())switch(w.key){case"Enter":case" ":return}switch(w.key){case"Enter":case" ":case Pl.first(t.orientation()):w.stopPropagation(),w.preventDefault(),_g(w.currentTarget),n.open("first"),r==null||r.setAutoFocusMenu(!0),r==null||r.setValue(u);break;case Pl.last(t.orientation()):w.stopPropagation(),w.preventDefault(),n.open("last");break;case xr.next(o(),t.orientation()):if(r===void 0)break;w.stopPropagation(),w.preventDefault(),r.nextMenu();break;case xr.previous(o(),t.orientation()):if(r===void 0)break;w.stopPropagation(),w.preventDefault(),r.previousMenu();break}}},p=w=>{var m;oe(w,s.onMouseOver),((m=n.triggerRef())==null?void 0:m.dataset.pointerType)!=="touch"&&!s.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(u)},v=w=>{oe(w,s.onFocus),r!==void 0&&w.currentTarget.dataset.pointerType!=="touch"&&r.setValue(u)};return U(()=>W(n.registerTriggerId(s.id))),b(wt,A({ref(w){var m=ve(n.setTriggerRef,s.ref);typeof m=="function"&&m(w)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return s.id},get disabled(){return s.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return K(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return u()!==void 0&&(r==null?void 0:r.value())===u()?!0:void 0},get tabIndex(){return r!==void 0?r.value()===u()||r.lastValue()===u()?0:-1:void 0},onPointerDown:f,onMouseOver:p,onClick:h,onKeyDown:g,onFocus:v,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),a))}var hd=we();function Hs(){return me(hd)}function Or(){const e=Hs();if(e===void 0)throw new Error("[kobalte]: `useNavigationMenuContext` must be used within a `NavigationMenu` component");return e}function gd(e){let t;const n=St(),r=At(),o=$r(),i=Hs(),{direction:s}=Qt(),a=Z({id:n.generateId(`content-${Ee()}`)},e),[u,l]=k(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let c=0;const d=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),f=my({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>n.orientation()==="horizontal"?"vertical":"horizontal"},()=>t);$c({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:y=>{var x;o===void 0&&((x=u.onOpenAutoFocus)==null||x.call(u,y))},onUnmountAutoFocus:u.onCloseAutoFocus},()=>t);const h=y=>{if(_e(y.currentTarget,y.target)&&(y.key==="Tab"&&r.isOpen()&&y.preventDefault(),o!==void 0&&y.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(y.key){case xr.next(s(),n.orientation()):y.stopPropagation(),y.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case xr.previous(s(),n.orientation()):if(y.currentTarget.hasAttribute("data-closed"))break;y.stopPropagation(),y.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},g=y=>{var x;(x=u.onEscapeKeyDown)==null||x.call(u,y),o==null||o.setAutoFocusMenu(!1),r.close(!0)},p=y=>{var x;(x=u.onFocusOutside)==null||x.call(u,y),n.isModal()&&y.preventDefault()},v=y=>{var x,C;oe(y,u.onPointerEnter),r.isOpen()&&((x=r.parentMenuContext())==null||x.listState().selectionManager().setFocused(!1),(C=r.parentMenuContext())==null||C.listState().selectionManager().setFocusedKey(void 0))},w=y=>{if(oe(y,u.onPointerMove),y.pointerType!=="mouse")return;const x=y.target,C=c!==y.clientX;_e(y.currentTarget,x)&&C&&(r.setPointerDir(y.clientX>c?"right":"left"),c=y.clientX)};U(()=>W(r.registerContentId(u.id))),W(()=>r.setContentRef(void 0));const m={ref:ve(y=>{r.setContentRef(y),t=y},u.ref),role:"menu",get id(){return u.id},get tabIndex(){return f.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:be([u.onKeyDown,f.onKeyDown,h]),onMouseDown:be([u.onMouseDown,f.onMouseDown]),onFocusIn:be([u.onFocusIn,f.onFocusIn]),onFocusOut:be([u.onFocusOut,f.onFocusOut]),onPointerEnter:v,onPointerMove:w,get"data-orientation"(){return n.orientation()}};return b(Se,{get when(){return r.contentPresent()},get children(){return b(Se,{get when(){return i===void 0||r.parentMenuContext()!=null},get fallback(){return b(ae,A({as:"div"},()=>r.dataset(),m,l))},get children(){return b(wo.Positioner,{get children(){return b(Rs,A({get disableOutsidePointerEvents(){return K(()=>!!d())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return vt({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},u.style)},onEscapeKeyDown:g,onFocusOutside:p,get onDismiss(){return r.close}},()=>r.dataset(),m,l))}})}})}})}function yy(e){let t;const n=St(),r=At(),[o,i]=k(e,["ref"]);return _c({element:()=>t??null,enabled:()=>r.contentPresent()&&n.preventScroll()}),b(gd,A({ref(s){var a=ve(u=>{t=u},o.ref);typeof a=="function"&&a(s)}},i))}var pd=we();function wy(){const e=me(pd);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function md(e){const t=St(),n=Z({id:t.generateId(`group-${Ee()}`)},e),[r,o]=B(),i={generateId:yt(()=>n.id),registerLabelId:Be(o)};return b(pd.Provider,{value:i,get children(){return b(ae,A({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function by(e){const t=wy(),n=Z({id:t.generateId("label")},e),[r,o]=k(n,["id"]);return U(()=>W(t.registerLabelId(r.id))),b(ae,A({as:"span",get id(){return r.id},"aria-hidden":"true"},o))}function vd(e){const t=At(),n=Z({children:"▼"},e);return b(ae,A({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function Sy(e){return b(Gs,A({role:"menuitem",closeOnSelect:!0},e))}function xy(e){const t=zs(),n=Z({id:t.generateId("description")},e),[r,o]=k(n,["id"]);return U(()=>W(t.registerDescription(r.id))),b(ae,A({as:"div",get id(){return r.id}},()=>t.dataset(),o))}function Cy(e){const t=zs(),n=Z({id:t.generateId("indicator")},e),[r,o]=k(n,["forceMount"]);return b(Se,{get when(){return r.forceMount||t.isChecked()},get children(){return b(ae,A({as:"div"},()=>t.dataset(),o))}})}function Ey(e){const t=zs(),n=Z({id:t.generateId("label")},e),[r,o]=k(n,["ref","id"]);return U(()=>W(t.registerLabel(r.id))),b(ae,A({as:"div",ref(i){var s=ve(t.setLabelRef,r.ref);typeof s=="function"&&s(i)},get id(){return r.id}},()=>t.dataset(),o))}function Ry(e){const t=At();return b(Se,{get when(){return t.contentPresent()},get children(){return b(rs,e)}})}var yd=we();function Py(){const e=me(yd);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function Iy(e){const n=St().generateId(`radiogroup-${Ee()}`),r=Z({id:n},e),[o,i]=k(r,["value","defaultValue","onChange","disabled"]),[s,a]=pt({value:()=>o.value,defaultValue:()=>o.defaultValue,onChange:l=>{var c;return(c=o.onChange)==null?void 0:c.call(o,l)}}),u={isDisabled:()=>o.disabled,isSelectedValue:l=>l===s(),setSelectedValue:a};return b(yd.Provider,{value:u,get children(){return b(md,i)}})}function My(e){const t=Py(),n=Z({closeOnSelect:!1},e),[r,o]=k(n,["value","onSelect"]);return b(Gs,A({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{var s;(s=r.onSelect)==null||s.call(r),t.setSelectedValue(r.value)}},o))}function Fy(e,t,n){const r=e.split("-")[0],o=n.getBoundingClientRect(),i=[],s=t.clientX,a=t.clientY;switch(r){case"top":i.push([s,a+5]),i.push([o.left,o.bottom]),i.push([o.left,o.top]),i.push([o.right,o.top]),i.push([o.right,o.bottom]);break;case"right":i.push([s-5,a]),i.push([o.left,o.top]),i.push([o.right,o.top]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]);break;case"bottom":i.push([s,a-5]),i.push([o.right,o.top]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]),i.push([o.left,o.top]);break;case"left":i.push([s+5,a]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]),i.push([o.left,o.top]),i.push([o.right,o.top]);break}return i}function Ay(e,t){return t?Lg([e.clientX,e.clientY],t):!1}function wd(e){const t=St(),n=td(),r=bo(),o=$r(),i=Hs(),s=Z({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[a,u]=k(s,["open","defaultOpen","onOpenChange"]);let l=0,c=null,d="right";const[f,h]=B(),[g,p]=B(),[v,w]=B(),[m,y]=B(),[x,C]=B(!0),[O,L]=B(u.placement),[_,T]=B([]),[V,N]=B([]),{DomCollectionProvider:z}=ry({items:V,onItemsChange:N}),ie=Ps({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:te=>{var Fe;return(Fe=a.onOpenChange)==null?void 0:Fe.call(a,te)}}),{present:P}=wr({show:()=>t.forceMount()||ie.isOpen(),element:()=>m()??null}),R=gy({selectionMode:"none",dataSource:V}),S=te=>{C(te),ie.open()},I=(te=!1)=>{ie.close(),te&&r&&r.close(!0)},M=te=>{C(te),ie.toggle()},F=()=>{const te=m();te&&(Ie(te),R.selectionManager().setFocused(!0),R.selectionManager().setFocusedKey(void 0))},D=()=>{i!=null?setTimeout(()=>F()):F()},j=te=>{T(Pe=>[...Pe,te]);const Fe=r==null?void 0:r.registerNestedMenu(te);return()=>{T(Pe=>Di(Pe,te)),Fe==null||Fe()}},H=te=>d===(c==null?void 0:c.side)&&Ay(te,c==null?void 0:c.area),X=te=>{H(te)&&te.preventDefault()},le=te=>{H(te)||D()},ne=te=>{H(te)&&te.preventDefault()};Oc({isDisabled:()=>!(r==null&&ie.isOpen()&&t.isModal()),targets:()=>[m(),..._()].filter(Boolean)}),U(()=>{const te=m();if(!te||!r)return;const Fe=r.registerNestedMenu(te);W(()=>{Fe()})}),U(()=>{r===void 0&&(o==null||o.registerMenu(t.value(),[m(),..._()]))}),U(()=>{var te;r!==void 0||o===void 0||(o.value()===t.value()?((te=v())==null||te.focus(),o.autoFocusMenu()&&S(!0)):I())}),U(()=>{r!==void 0||o===void 0||ie.isOpen()&&o.setValue(t.value())}),W(()=>{r===void 0&&(o==null||o.unregisterMenu(t.value()))});const Je={dataset:K(()=>({"data-expanded":ie.isOpen()?"":void 0,"data-closed":ie.isOpen()?void 0:""})),isOpen:ie.isOpen,contentPresent:P,nestedMenus:_,currentPlacement:O,pointerGraceTimeoutId:()=>l,autoFocus:x,listState:()=>R,parentMenuContext:()=>r,triggerRef:v,contentRef:m,triggerId:f,contentId:g,setTriggerRef:w,setContentRef:y,open:S,close:I,toggle:M,focusContent:D,onItemEnter:X,onItemLeave:le,onTriggerLeave:ne,setPointerDir:te=>d=te,setPointerGraceTimeoutId:te=>l=te,setPointerGraceIntent:te=>c=te,registerNestedMenu:j,registerItemToParentDomCollection:n==null?void 0:n.registerItem,registerTriggerId:Be(h),registerContentId:Be(p)};return b(z,{get children(){return b(ud.Provider,{value:Je,get children(){return b(Se,{when:i===void 0,get fallback(){return u.children},get children(){return b(wo,A({anchorRef:v,contentRef:m,onCurrentPlacementChange:L},u))}})}})}})}function $y(e){const{direction:t}=Qt();return b(wd,A({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var Oy={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function Ty(e){const t=At(),n=St(),[r,o]=k(e,["onFocusOutside","onKeyDown"]),{direction:i}=Qt();return b(gd,A({onOpenAutoFocus:c=>{c.preventDefault()},onCloseAutoFocus:c=>{c.preventDefault()},onFocusOutside:c=>{var f;(f=r.onFocusOutside)==null||f.call(r,c);const d=c.target;_e(t.triggerRef(),d)||t.close()},onKeyDown:c=>{oe(c,r.onKeyDown);const d=_e(c.currentTarget,c.target),f=Oy.close(i(),n.orientation()).includes(c.key),h=t.parentMenuContext()!=null;d&&f&&h&&(t.close(),Ie(t.triggerRef()))}},o))}var Ml=["Enter"," "],Dy={open:(e,t)=>e==="ltr"?[...Ml,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...Ml,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function Ly(e){let t;const n=St(),r=At(),o=Z({id:n.generateId(`sub-trigger-${Ee()}`)},e),[i,s]=k(o,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const u=()=>{a&&window.clearTimeout(a),a=null},{direction:l}=Qt(),c=()=>i.id,d=()=>{const y=r.parentMenuContext();if(y==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return y.listState().selectionManager()},f=()=>r.listState().collection(),h=()=>d().focusedKey()===c(),g=ad({key:c,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),p=y=>{oe(y,i.onClick),!r.isOpen()&&!i.disabled&&r.open(!0)},v=y=>{var C;if(oe(y,i.onPointerMove),y.pointerType!=="mouse")return;const x=r.parentMenuContext();if(x==null||x.onItemEnter(y),!y.defaultPrevented){if(i.disabled){x==null||x.onItemLeave(y);return}!r.isOpen()&&!a&&((C=r.parentMenuContext())==null||C.setPointerGraceIntent(null),a=window.setTimeout(()=>{r.open(!1),u()},100)),x==null||x.onItemEnter(y),y.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),Ie(y.currentTarget),x==null||x.listState().selectionManager().setFocused(!0),x==null||x.listState().selectionManager().setFocusedKey(c()))}},w=y=>{if(oe(y,i.onPointerLeave),y.pointerType!=="mouse")return;u();const x=r.parentMenuContext(),C=r.contentRef();if(C){x==null||x.setPointerGraceIntent({area:Fy(r.currentPlacement(),y,C),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(x==null?void 0:x.pointerGraceTimeoutId());const O=window.setTimeout(()=>{x==null||x.setPointerGraceIntent(null)},300);x==null||x.setPointerGraceTimeoutId(O)}else{if(x==null||x.onTriggerLeave(y),y.defaultPrevented)return;x==null||x.setPointerGraceIntent(null)}x==null||x.onItemLeave(y)},m=y=>{oe(y,i.onKeyDown),!y.repeat&&(i.disabled||Dy.open(l(),n.orientation()).includes(y.key)&&(y.stopPropagation(),y.preventDefault(),d().setFocused(!1),d().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(f().getFirstKey())))};return U(()=>{if(r.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const y=r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:c(),textValue:i.textValue??(t==null?void 0:t.textContent)??"",disabled:i.disabled??!1});W(y)}),U(Ce(()=>{var y;return(y=r.parentMenuContext())==null?void 0:y.pointerGraceTimeoutId()},y=>{W(()=>{var x;window.clearTimeout(y),(x=r.parentMenuContext())==null||x.setPointerGraceIntent(null)})})),U(()=>W(r.registerTriggerId(i.id))),W(()=>{u()}),b(ae,A({as:"div",ref(y){var x=ve(C=>{r.setTriggerRef(C),t=C},i.ref);typeof x=="function"&&x(y)},get id(){return i.id},role:"menuitem",get tabIndex(){return g.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return K(()=>!!r.isOpen())()?r.contentId():void 0},get"aria-disabled"(){return i.disabled},get"data-key"(){return g.dataKey()},get"data-highlighted"(){return h()?"":void 0},get"data-disabled"(){return i.disabled?"":void 0},get onPointerDown(){return be([i.onPointerDown,g.onPointerDown])},get onPointerUp(){return be([i.onPointerUp,g.onPointerUp])},get onClick(){return be([p,g.onClick])},get onKeyDown(){return be([m,g.onKeyDown])},get onMouseDown(){return be([i.onMouseDown,g.onMouseDown])},get onFocus(){return be([i.onFocus,g.onFocus])},onPointerMove:v,onPointerLeave:w},()=>r.dataset(),s))}function _y(e){const t=$r(),n=`menu-${Ee()}`,r=Z({id:n,modal:!0},e),[o,i]=k(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),s=Ps({open:()=>o.open,defaultOpen:()=>o.defaultOpen,onOpenChange:u=>{var l;return(l=o.onOpenChange)==null?void 0:l.call(o,u)}}),a={isModal:()=>o.modal??!0,preventScroll:()=>o.preventScroll??a.isModal(),forceMount:()=>o.forceMount??!1,generateId:yt(()=>o.id),value:()=>o.value,orientation:()=>o.orientation??(t==null?void 0:t.orientation())??"horizontal"};return b(dd.Provider,{value:a,get children(){return b(wd,A({get open(){return s.isOpen()},get onOpenChange(){return s.setIsOpen}},i))}})}function bd(e){const t=qn(),n=Z({modal:!1},e),[r,o]=k(n,["value"]),i=Ee(),s=t.generateId(`menubar-menu-${i}`),a=Z({id:s},o);return b(_y,A({get value(){return r.value??i}},a))}function ky(e){let t;const n=`menubar-${Ee()}`,r=Z({id:n,loop:!0,orientation:"horizontal"},e),[o,i]=k(r,["ref","value","defaultValue","onValueChange","loop","focusOnAlt","autoFocusMenu","onAutoFocusMenuChange","orientation"]),[s,a]=pt({value:()=>o.value,defaultValue:()=>o.defaultValue,onChange:m=>{var y;return(y=o.onValueChange)==null?void 0:y.call(o,m)}}),[u,l]=B(),[c,d]=B(new Map),[f,h]=pt({value:()=>o.autoFocusMenu,defaultValue:()=>!1,onChange:o.onAutoFocusMenuChange}),g=()=>{var m;return s()&&f()&&!((m=s())!=null&&m.includes("link-trigger-"))},v={dataset:K(()=>({"data-expanded":g()?"":void 0,"data-closed":g()?void 0:""})),value:s,setValue:a,lastValue:u,setLastValue:l,menus:()=>new Set([...c().keys()]),menuRefs:()=>[...c().values()].flat(),menuRefMap:()=>c(),registerMenu:(m,y)=>{d(x=>{const C=new Map;return x.forEach((O,L)=>C.set(L,O)),C.set(m,y),C})},unregisterMenu:m=>{d(y=>{y.delete(m);const x=new Map;return y.forEach((C,O)=>x.set(O,C)),x})},nextMenu:()=>{const m=[...c().keys()];if(s()==null){a(m[0]);return}const y=m.indexOf(s());if(y===m.length-1){o.loop&&a(m[0]);return}a(m[y+1])},previousMenu:()=>{const m=[...c().keys()];if(s()==null){a(m[0]);return}const y=m.indexOf(s());if(y===0){o.loop&&a(m[m.length-1]);return}a(m[y-1])},closeMenu:()=>{h(!1),a(void 0)},autoFocusMenu:()=>f(),setAutoFocusMenu:h,generateId:yt(()=>i.id),orientation:()=>o.orientation};U(()=>{s()==null&&h(!1)}),Tc({onInteractOutside:()=>{v.closeMenu(),setTimeout(()=>v.closeMenu())},shouldExcludeElement:m=>[t,...c().values()].flat().some(y=>_e(y,m))},()=>t);const w=m=>{m.key==="Alt"&&(m.preventDefault(),m.stopPropagation(),v.value()===void 0?v.nextMenu():v.closeMenu())};return U(()=>{o.focusOnAlt?window.addEventListener("keydown",w):window.removeEventListener("keydown",w),W(()=>{window.removeEventListener("keydown",w)})}),U(()=>{s()!=null&&l(s())}),b(fd.Provider,{value:v,get children(){return b(ae,A({as:"div",ref(m){var y=ve(x=>t=x,o.ref);typeof y=="function"&&y(m)},role:"menubar",get"data-orientation"(){return o.orientation},get"aria-orientation"(){return o.orientation}},i))}})}function Vy(e){const t=qn();if(bo()===void 0&&Object.hasOwn(e,"href")){const r=t.generateId("link-trigger-")+Ee();return b(bd,{value:r,get children(){return b(Il,e)}})}return Il(e)}var Ny={};Xt(Ny,{Root:()=>Us,Separator:()=>Ky});function Us(e){let t;const n=Z({orientation:"horizontal"},e),[r,o]=k(n,["ref","orientation"]),i=go(()=>t,()=>"hr");return b(ae,A({as:"hr",ref(s){var a=ve(u=>t=u,r.ref);typeof a=="function"&&a(s)},get role(){return i()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},o))}var Ky=Us,Sd=he("<li role=presentation>"),jy=he("<nav>");function By(e){let t;const n=qn(),r=Z({size:15},e),[o,i]=k(r,["ref"]),[s,a]=B(0),u=()=>n.orientation()==="horizontal";return U(Ce(n.value,l=>{setTimeout(()=>{if(!l||l.includes("link-trigger-"))return;const c=document.querySelector(`[data-kb-menu-value-trigger="${l}"]`);if(!c||!t)return;const d=c.getBoundingClientRect()[u()?"x":"y"]+c.getBoundingClientRect()[u()?"width":"height"]/2,f=window.getComputedStyle(t),h=t.getBoundingClientRect()[u()?"x":"y"]+t.getBoundingClientRect()[u()?"width":"height"]/2-Number.parseFloat(f.transform.split(",")[u()?4:5]);a(d-h)})})),b(Jc,A({ref(l){var c=ve(d=>t=d,o.ref);typeof c=="function"&&c(l)},get style(){return{transform:`translate${u()?"X":"Y"}(${s()}px)`,color:"red"}}},i))}function xd(e){const t=Or(),n=qn(),r=St(),[o,i]=B(),[s,a]=k(e,["onPointerEnter","onPointerLeave"]),u=c=>{oe(c,s.onPointerEnter),t.cancelLeaveTimer()},l=c=>{oe(c,s.onPointerLeave),t.startLeaveTimer()};return U(Ce(n.value,c=>{ao(()=>{if(!c||c.includes("link-trigger-")){t.setPreviousMenu(void 0);return}if(c===r.value()){if(t.previousMenu()!=null){const g=[...n.menus()],p=g.indexOf(t.previousMenu()),v=g.indexOf(c);p<v?i("from-end"):i("from-start")}else i(void 0);t.setPreviousMenu(c);return}const d=[...n.menus()],f=d.indexOf(t.previousMenu()),h=d.indexOf(c);f>h?i("to-end"):i("to-start")})})),b(yy,A({as:"ul",onPointerEnter:u,onPointerLeave:l,onInteractOutside:()=>{t.setAutoFocusMenu(!1)},get"data-motion"(){return o()}},a))}function Cd(e){return(()=>{var t=Sd();return fe(t,b(Sy,A({as:"a"},e))),t})()}function Ed(e){const t=qn(),n=Or(),[r,o]=k(e,["value"]),i=Ee(),s=t.generateId(`navigation-menu-menu-${i}`),a=Z({id:s},o),u=()=>r.value??i,[l,c]=B(!1),d=()=>{var f,h;t.value()!==u()&&c(!1),(f=n.viewportRef())==null||f.removeEventListener("animationend",d),(h=n.viewportRef())==null||h.removeEventListener("animationcancel",d)};return U(Ce(t.value,f=>{if(f===u())c(!0);else{const h=n.viewportRef();if(!h||["","none"].includes(window.getComputedStyle(h).animationName)){c(!1);return}h.addEventListener("animationend",d)}})),b(bd,A({get forceMount(){return l()},get value(){return u()}},a))}function Rd(e){const t=Or(),n=At(),[r,o]=k(e,["ref"]);return b(Se,{get when(){return t.viewportPresent()},get children(){return b(Ry,A({ref(i){var s=ve(a=>{a&&a.setAttribute("role","presentation")},r.ref);typeof s=="function"&&s(i)},get mount(){return K(()=>n.parentMenuContext()==null)()?t.viewportRef():void 0}},o))}})}function Pd(e){const t=Z({delayDuration:200,skipDelayDuration:300},e),[n,r,o]=k(t,["ref","delayDuration","skipDelayDuration","autoFocusMenu","onAutoFocusMenuChange","defaultValue","value","onValueChange","forceMount"],["getAnchorRect","placement","gutter","shift","flip","slide","overlap","sameWidth","fitViewport","hideWhenDetached","detachedPadding","arrowPadding","overflowPadding"]),[i,s]=pt({value:()=>n.value,defaultValue:()=>n.defaultValue,onChange:T=>{var V;return(V=n.onValueChange)==null?void 0:V.call(n,T)}}),[a,u]=pt({value:()=>n.autoFocusMenu,defaultValue:()=>!1,onChange:n.onAutoFocusMenuChange}),[l,c]=B(),[d,f]=B(),[h,g]=B(r.placement??o.orientation==="vertical"?"right":"bottom");U(()=>{g(o.orientation==="vertical"?"right":"bottom")});let p;const[v,w]=B(),[m,y]=B(!1),[x,C]=B(!1);U(()=>{i()&&!i().includes("link-trigger-")&&a()?ao(()=>{C(!0),y(!0)}):(C(!1),y(!1))});const O=K(()=>({"data-expanded":x()?"":void 0,"data-closed":x()?void 0:""})),{present:L}=wr({show:()=>n.forceMount||m()||x(),element:()=>l()??null});U(()=>{L()||_.setPreviousMenu(void 0)});const _={dataset:O,delayDuration:()=>n.delayDuration,skipDelayDuration:()=>n.skipDelayDuration,autoFocusMenu:a,setAutoFocusMenu:u,startLeaveTimer:()=>{p=window.setTimeout(()=>{_.setAutoFocusMenu(!1),s(void 0)},_.skipDelayDuration())},cancelLeaveTimer:()=>{p&&clearTimeout(p)},rootRef:d,setRootRef:f,viewportRef:l,setViewportRef:c,viewportPresent:L,currentPlacement:h,previousMenu:v,setPreviousMenu:w};return b(hd.Provider,{value:_,get children(){return b(wo,A({anchorRef:d,contentRef:l,get placement(){return h()},onCurrentPlacementChange:g},r,{get children(){var T=jy();return fe(T,b(ky,A({as:"ul",ref(V){var N=ve(_.setRootRef,n.ref);typeof N=="function"&&N(V)},get value(){return i()??null},onValueChange:s,get autoFocusMenu(){return a()},onAutoFocusMenuChange:u},o))),T}}))}})}function Id(e){const t=Or(),n=bo(),[r,o]=k(e,["onPointerEnter","onPointerLeave","onClick"]);let i;const s=l=>{oe(l,r.onClick),i&&clearTimeout(i)},a=l=>{oe(l,r.onPointerEnter),l.pointerType!=="touch"&&(t.cancelLeaveTimer(),t.dataset()["data-expanded"]!==""&&(i=window.setTimeout(()=>{var c;(c=n==null?void 0:n.triggerRef())==null||c.focus(),setTimeout(()=>{t.setAutoFocusMenu(!0)})},t.delayDuration())))},u=l=>{oe(l,r.onPointerLeave),l.pointerType!=="touch"&&(t.startLeaveTimer(),i&&clearTimeout(i))};return(()=>{var l=Sd();return fe(l,b(Vy,A({onClick:s,onPointerEnter:a,onPointerLeave:u},o))),l})()}function Md(e){const t=Or(),n=qn(),[r,o]=B(),[i,s]=k(e,["ref","style","onEscapeKeyDown"]),a=()=>{n.setAutoFocusMenu(!1),n.closeMenu()},u=f=>{a()},l=Wm(r);U(Ce(()=>n.value()?n.menuRefMap().get(n.value()):void 0,f=>{f===void 0||f[0]===void 0||o(f[0])}));const c=K(f=>{if(!(r()===void 0||!t.viewportPresent()))return l.height()===0?f:l.height()}),d=K(f=>{if(!(r()===void 0||!t.viewportPresent()))return l.width()===0?f:l.width()});return b(Se,{get when(){return t.viewportPresent()},get children(){return b(wo.Positioner,{role:"presentation",get children(){return b(Rs,A({as:"li",ref(f){var h=ve(t.setViewportRef,i.ref);typeof h=="function"&&h(f)},get excludedElements(){return[t.rootRef]},bypassTopMostLayerCheck:!0,get style(){return vt({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)","--kb-navigation-menu-viewport-height":c()?`${c()}px`:void 0,"--kb-navigation-menu-viewport-width":d()?`${d()}px`:void 0,position:"relative"},i.style)},get onEscapeKeyDown(){return be([i.onEscapeKeyDown,u])},onDismiss:a,get"data-orientation"(){return n.orientation()}},()=>t.dataset(),s))}})}})}Object.assign(Pd,{Arrow:By,CheckboxItem:vy,Content:xd,Group:md,GroupLabel:by,Icon:vd,Item:Cd,ItemDescription:xy,ItemIndicator:Cy,ItemLabel:Ey,Portal:Rd,RadioGroup:Iy,RadioItem:My,Menu:Ed,Separator:Us,Sub:$y,SubContent:Ty,SubTrigger:Ly,Trigger:Id,Viewport:Md});var zy=he('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class="relative top-px ml-1 size-3 transition duration-200 group-data-[expanded]/trigger:rotate-180 group-data-[orientation=vertical]/menu:-rotate-90 group-data-[orientation=vertical]/menu:group-data-[expanded]/trigger:rotate-90"><path d="M6 9l6 6l6 -6">');const Fl=Ed,Al=e=>{const[t,n]=k(e,["class","children"]);return b(Pd,A({gutter:6,get class(){return de("group/menu flex w-max flex-1 list-none items-center justify-center data-[orientation=vertical]:flex-col [&>li]:w-full",t.class)}},n,{get children(){return[K(()=>t.children),b(Gy,{})]}}))},$l=e=>{const[t,n]=k(e,["class"]);return b(Id,A({get class(){return de("group/trigger inline-flex h-10 w-full items-center justify-center whitespace-nowrap rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[expanded]:bg-accent/50",t.class)}},n))},Ol=()=>b(vd,{"aria-hidden":"true",get children(){return zy()}}),Gy=e=>{const[t,n]=k(e,["class"]);return b(Md,A({get class(){return de("pointer-events-none z-[1000] flex h-[var(--kb-navigation-menu-viewport-height)] w-[var(--kb-navigation-menu-viewport-width)] origin-[var(--kb-menu-content-transform-origin)] items-center justify-center overflow-x-clip overflow-y-visible rounded-md border bg-popover opacity-0 shadow-lg data-[expanded]:pointer-events-auto data-[orientation=vertical]:overflow-y-clip data-[orientation=vertical]:overflow-x-visible data-[expanded]:rounded-md","animate-content-hide transition-[width,height] duration-200 ease-in data-[expanded]:animate-content-show data-[expanded]:opacity-100 data-[expanded]:ease-out",t.class)}},n))},Tl=e=>{const[t,n]=k(e,["class"]);return b(Rd,{get children(){return b(xd,A({get class(){return de("pointer-events-none absolute left-0 top-0 box-border p-1 focus:outline-none data-[expanded]:pointer-events-auto","data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out","data-[orientation=horizontal]:data-[motion=from-start]:slide-in-from-left-52 data-[orientation=horizontal]:data-[motion=to-end]:slide-out-to-right-52","data-[orientation=horizontal]:data-[motion=from-end]:slide-in-from-right-52 data-[orientation=horizontal]:data-[motion=to-start]:slide-out-to-left-52","data-[orientation=vertical]:data-[motion=from-start]:slide-in-from-top-52 data-[orientation=vertical]:data-[motion=to-end]:slide-out-to-bottom-52","data-[orientation=vertical]:data-[motion=from-end]:slide-in-from-bottom-52 data-[orientation=vertical]:data-[motion=to-start]:slide-out-to-bottom-52",t.class)}},n))}})},Dl=e=>{const[t,n]=k(e,["class"]);return b(Cd,A({get class(){return de("text-sm block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",t.class)}},n))};/**
6
+ */var Lm={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},yn=Lm,_m=he("<svg>"),km=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Vm=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Nm=e=>{const[t,n]=k(e,["color","size","strokeWidth","children","class","name","iconNode","absoluteStrokeWidth"]);return(()=>{var r=_m();return at(r,A(yn,{get width(){return t.size??yn.width},get height(){return t.size??yn.height},get stroke(){return t.color??yn.stroke},get"stroke-width"(){return K(()=>!!t.absoluteStrokeWidth)()?Number(t.strokeWidth??yn["stroke-width"])*24/Number(t.size):Number(t.strokeWidth??yn["stroke-width"])},get class(){return Vm("lucide","lucide-icon",t.name!=null?`lucide-${km(t==null?void 0:t.name)}`:void 0,t.class!=null?t.class:"")}},n),!0,!0),fe(r,b(nt,{get each(){return t.iconNode},children:([o,i])=>b(Lu,A({component:o},i))})),r})()},Ds=Nm,Km=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],jm=e=>b(Ds,A(e,{name:"Check",iconNode:Km})),hl=jm,Bm=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],zm=e=>b(Ds,A(e,{name:"LoaderCircle",iconNode:Bm})),Gm=zm,Hm=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Um=e=>b(Ds,A(e,{name:"X",iconNode:Hm})),gl=Um,jr=he('<div class="flex flex-row items-center">');const qm=[{accessorKey:"id",header:"ID",cell:e=>e.getValue()},{accessorKey:"channel",header:"Channel",cell:e=>e.getValue()},{accessorKey:"platform",header:"Platform",cell:e=>{switch(e.getValue()){case"ios":return"iOS";case"android":return"Android"}}},{accessorKey:"targetAppVersion",header:"Target App Version",cell:e=>e.getValue()},{accessorKey:"enabled",header:"Enabled",cell:e=>e.getValue()?(()=>{var t=jr();return fe(t,b(hl,{class:"text-green-500"})),t})():(()=>{var t=jr();return fe(t,b(gl,{class:"text-red-500"})),t})()},{accessorKey:"shouldForceUpdate",header:"Force Update",cell:e=>e.getValue()?(()=>{var t=jr();return fe(t,b(hl,{class:"text-green-500"})),t})():(()=>{var t=jr();return fe(t,b(gl,{class:"text-red-500"})),t})()},{accessorKey:"message",header:"Message",cell:e=>e.getValue()},{accessorKey:"id",header:"Created At",cell:e=>Dm(Am(String(e.getValue()))).format("YYYY-MM-DD HH:mm:ss")}];function Wm(e){const[t,n]=B(0),[r,o]=B(0);U(()=>{const a=e();if(!a)return;s(a);const l=new ResizeObserver(i);l.observe(a),W(()=>{l.disconnect()})});const i=a=>{for(const l of a)l.target===e()&&s(l.target)},s=a=>{o(a.offsetWidth),n(a.offsetHeight)};return{width:r,height:t}}var Xm=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Qm=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Ym(e){if(Intl.Locale){const n=new Intl.Locale(e).maximize().script??"";return Xm.has(n)}const t=e.split("-")[0];return Qm.has(t)}function Zm(e){return Ym(e)?"rtl":"ltr"}function Bc(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:Zm(e)}}var Ki=Bc(),lr=new Set;function pl(){Ki=Bc();for(const e of lr)e(Ki)}function Jm(){const[e,t]=B(Ki),n=K(()=>e());return Bn(()=>{lr.size===0&&window.addEventListener("languagechange",pl),lr.add(t),W(()=>{lr.delete(t),lr.size===0&&window.removeEventListener("languagechange",pl)})}),{locale:()=>n().locale,direction:()=>n().direction}}var ev=we();function Qt(){const e=Jm();return me(ev)||e}var _o=new Map;function tv(e){const{locale:t}=Qt(),n=K(()=>t()+(e?Object.entries(e).sort((r,o)=>r[0]<o[0]?-1:1).join():""));return K(()=>{const r=n();let o;return _o.has(r)&&(o=_o.get(r)),o||(o=new Intl.Collator(t(),e),_o.set(r,o)),o})}const nv=["top","right","bottom","left"],Ht=Math.min,Ge=Math.max,ro=Math.round,Br=Math.floor,gt=e=>({x:e,y:e}),rv={left:"right",right:"left",bottom:"top",top:"bottom"},ov={start:"end",end:"start"};function ji(e,t,n){return Ge(e,Ht(t,n))}function mn(e,t){return typeof e=="function"?e(t):e}function Ut(e){return e.split("-")[0]}function Hn(e){return e.split("-")[1]}function zc(e){return e==="x"?"y":"x"}function Ls(e){return e==="y"?"height":"width"}function fn(e){return["top","bottom"].includes(Ut(e))?"y":"x"}function _s(e){return zc(fn(e))}function iv(e,t,n){n===void 0&&(n=!1);const r=Hn(e),o=_s(e),i=Ls(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=oo(s)),[s,oo(s)]}function sv(e){const t=oo(e);return[Bi(e),t,Bi(t)]}function Bi(e){return e.replace(/start|end/g,t=>ov[t])}function av(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function lv(e,t,n,r){const o=Hn(e);let i=av(Ut(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Bi)))),i}function oo(e){return e.replace(/left|right|bottom|top/g,t=>rv[t])}function uv(e){return{top:0,right:0,bottom:0,left:0,...e}}function Gc(e){return typeof e!="number"?uv(e):{top:e,right:e,bottom:e,left:e}}function io(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function ml(e,t,n){let{reference:r,floating:o}=e;const i=fn(t),s=_s(t),a=Ls(s),l=Ut(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Hn(t)){case"start":h[s]-=d*(n&&c?-1:1);break;case"end":h[s]+=d*(n&&c?-1:1);break}return h}const cv=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=ml(c,r,l),d=r,h={},g=0;for(let p=0;p<a.length;p++){const{name:v,fn:w}=a[p],{x:m,y,data:x,reset:C}=await w({x:u,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=m??u,f=y??f,h={...h,[v]:{...h[v],...x}},C&&g<=50&&(g++,typeof C=="object"&&(C.placement&&(d=C.placement),C.rects&&(c=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:f}=ml(c,d,l)),p=-1)}return{x:u,y:f,placement:d,strategy:o,middlewareData:h}};async function br(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=mn(t,e),g=Gc(h),v=a[d?f==="floating"?"reference":"floating":f],w=io(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),m=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),x=await(i.isElement==null?void 0:i.isElement(y))?await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1}:{x:1,y:1},C=io(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:y,strategy:l}):m);return{top:(w.top-C.top+g.top)/x.y,bottom:(C.bottom-w.bottom+g.bottom)/x.y,left:(w.left-C.left+g.left)/x.x,right:(C.right-w.right+g.right)/x.x}}const dv=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=mn(e,t)||{};if(c==null)return{};const f=Gc(u),d={x:n,y:r},h=_s(o),g=Ls(h),p=await s.getDimensions(c),v=h==="y",w=v?"top":"left",m=v?"bottom":"right",y=v?"clientHeight":"clientWidth",x=i.reference[g]+i.reference[h]-d[h]-i.floating[g],C=d[h]-i.reference[h],O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let L=O?O[y]:0;(!L||!await(s.isElement==null?void 0:s.isElement(O)))&&(L=a.floating[y]||i.floating[g]);const _=x/2-C/2,T=L/2-p[g]/2-1,V=Ht(f[w],T),N=Ht(f[m],T),z=V,ie=L-p[g]-N,P=L/2-p[g]/2+_,R=ji(z,P,ie),S=!l.arrow&&Hn(o)!=null&&P!==R&&i.reference[g]/2-(P<z?V:N)-p[g]/2<0,I=S?P<z?P-z:P-ie:0;return{[h]:d[h]+I,data:{[h]:R,centerOffset:P-R-I,...S&&{alignmentOffset:I}},reset:S}}}),fv=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:p=!0,...v}=mn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=Ut(o),m=fn(a),y=Ut(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=d||(y||!p?[oo(a)]:sv(a)),O=g!=="none";!d&&O&&C.push(...lv(a,p,g,x));const L=[a,...C],_=await br(t,v),T=[];let V=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&T.push(_[w]),f){const P=iv(o,s,x);T.push(_[P[0]],_[P[1]])}if(V=[...V,{placement:o,overflows:T}],!T.every(P=>P<=0)){var N,z;const P=(((N=i.flip)==null?void 0:N.index)||0)+1,R=L[P];if(R)return{data:{index:P,overflows:V},reset:{placement:R}};let S=(z=V.filter(I=>I.overflows[0]<=0).sort((I,M)=>I.overflows[1]-M.overflows[1])[0])==null?void 0:z.placement;if(!S)switch(h){case"bestFit":{var ie;const I=(ie=V.filter(M=>{if(O){const F=fn(M.placement);return F===m||F==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(F=>F>0).reduce((F,D)=>F+D,0)]).sort((M,F)=>M[1]-F[1])[0])==null?void 0:ie[0];I&&(S=I);break}case"initialPlacement":S=a;break}if(o!==S)return{reset:{placement:S}}}return{}}}};function vl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function yl(e){return nv.some(t=>e[t]>=0)}const hv=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=mn(e,t);switch(r){case"referenceHidden":{const i=await br(t,{...o,elementContext:"reference"}),s=vl(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:yl(s)}}}case"escaped":{const i=await br(t,{...o,altBoundary:!0}),s=vl(i,n.floating);return{data:{escapedOffsets:s,escaped:yl(s)}}}default:return{}}}}};async function gv(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Ut(n),a=Hn(n),l=fn(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,f=mn(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:d*c}:{x:d*c,y:h*u}}const pv=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await gv(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},mv=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:v=>{let{x:w,y:m}=v;return{x:w,y:m}}},...l}=mn(e,t),c={x:n,y:r},u=await br(t,l),f=fn(Ut(o)),d=zc(f);let h=c[d],g=c[f];if(i){const v=d==="y"?"top":"left",w=d==="y"?"bottom":"right",m=h+u[v],y=h-u[w];h=ji(m,h,y)}if(s){const v=f==="y"?"top":"left",w=f==="y"?"bottom":"right",m=g+u[v],y=g-u[w];g=ji(m,g,y)}const p=a.fn({...t,[d]:h,[f]:g});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[d]:i,[f]:s}}}}}},vv=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=mn(e,t),u=await br(t,c),f=Ut(o),d=Hn(o),h=fn(o)==="y",{width:g,height:p}=i.floating;let v,w;f==="top"||f==="bottom"?(v=f,w=d===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(w=f,v=d==="end"?"top":"bottom");const m=p-u.top-u.bottom,y=g-u.left-u.right,x=Ht(p-u[v],m),C=Ht(g-u[w],y),O=!t.middlewareData.shift;let L=x,_=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(L=m),O&&!d){const V=Ge(u.left,0),N=Ge(u.right,0),z=Ge(u.top,0),ie=Ge(u.bottom,0);h?_=g-2*(V!==0||N!==0?V+N:Ge(u.left,u.right)):L=p-2*(z!==0||ie!==0?z+ie:Ge(u.top,u.bottom))}await l({...t,availableWidth:_,availableHeight:L});const T=await s.getDimensions(a.floating);return g!==T.width||p!==T.height?{reset:{rects:!0}}:{}}}};function mo(){return typeof window<"u"}function Un(e){return Hc(e)?(e.nodeName||"").toLowerCase():"#document"}function Ue(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function bt(e){var t;return(t=(Hc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Hc(e){return mo()?e instanceof Node||e instanceof Ue(e).Node:!1}function lt(e){return mo()?e instanceof Element||e instanceof Ue(e).Element:!1}function mt(e){return mo()?e instanceof HTMLElement||e instanceof Ue(e).HTMLElement:!1}function wl(e){return!mo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ue(e).ShadowRoot}function Ar(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ut(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function yv(e){return["table","td","th"].includes(Un(e))}function vo(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ks(e){const t=Vs(),n=lt(e)?ut(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function wv(e){let t=qt(e);for(;mt(t)&&!jn(t);){if(ks(t))return t;if(vo(t))return null;t=qt(t)}return null}function Vs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function jn(e){return["html","body","#document"].includes(Un(e))}function ut(e){return Ue(e).getComputedStyle(e)}function yo(e){return lt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qt(e){if(Un(e)==="html")return e;const t=e.assignedSlot||e.parentNode||wl(e)&&e.host||bt(e);return wl(t)?t.host:t}function Uc(e){const t=qt(e);return jn(t)?e.ownerDocument?e.ownerDocument.body:e.body:mt(t)&&Ar(t)?t:Uc(t)}function Sr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Uc(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Ue(o);if(i){const a=zi(s);return t.concat(s,s.visualViewport||[],Ar(o)?o:[],a&&n?Sr(a):[])}return t.concat(o,Sr(o,[],n))}function zi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function qc(e){const t=ut(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=mt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=ro(n)!==i||ro(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Ns(e){return lt(e)?e:e.contextElement}function Rn(e){const t=Ns(e);if(!mt(t))return gt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=qc(t);let s=(i?ro(n.width):n.width)/r,a=(i?ro(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const bv=gt(0);function Wc(e){const t=Ue(e);return!Vs()||!t.visualViewport?bv:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Sv(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ue(e)?!1:t}function hn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Ns(e);let s=gt(1);t&&(r?lt(r)&&(s=Rn(r)):s=Rn(e));const a=Sv(i,n,r)?Wc(i):gt(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const d=Ue(i),h=r&&lt(r)?Ue(r):r;let g=d,p=zi(g);for(;p&&r&&h!==g;){const v=Rn(p),w=p.getBoundingClientRect(),m=ut(p),y=w.left+(p.clientLeft+parseFloat(m.paddingLeft))*v.x,x=w.top+(p.clientTop+parseFloat(m.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,f*=v.y,l+=y,c+=x,g=Ue(p),p=zi(g)}}return io({width:u,height:f,x:l,y:c})}function Ks(e,t){const n=yo(e).scrollLeft;return t?t.left+n:hn(bt(e)).left+n}function Xc(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Ks(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function xv(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=bt(r),a=t?vo(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=gt(1);const u=gt(0),f=mt(r);if((f||!f&&!i)&&((Un(r)!=="body"||Ar(s))&&(l=yo(r)),mt(r))){const h=hn(r);c=Rn(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const d=s&&!f&&!i?Xc(s,l,!0):gt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+d.x,y:n.y*c.y-l.scrollTop*c.y+u.y+d.y}}function Cv(e){return Array.from(e.getClientRects())}function Ev(e){const t=bt(e),n=yo(e),r=e.ownerDocument.body,o=Ge(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ge(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Ks(e);const a=-n.scrollTop;return ut(r).direction==="rtl"&&(s+=Ge(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function Rv(e,t){const n=Ue(e),r=bt(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=Vs();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function Pv(e,t){const n=hn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=mt(e)?Rn(e):gt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function bl(e,t,n){let r;if(t==="viewport")r=Rv(e,n);else if(t==="document")r=Ev(bt(e));else if(lt(t))r=Pv(t,n);else{const o=Wc(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return io(r)}function Qc(e,t){const n=qt(e);return n===t||!lt(n)||jn(n)?!1:ut(n).position==="fixed"||Qc(n,t)}function Iv(e,t){const n=t.get(e);if(n)return n;let r=Sr(e,[],!1).filter(a=>lt(a)&&Un(a)!=="body"),o=null;const i=ut(e).position==="fixed";let s=i?qt(e):e;for(;lt(s)&&!jn(s);){const a=ut(s),l=ks(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Ar(s)&&!l&&Qc(e,s))?r=r.filter(u=>u!==s):o=a,s=qt(s)}return t.set(e,r),r}function Mv(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?vo(t)?[]:Iv(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=bl(t,u,o);return c.top=Ge(f.top,c.top),c.right=Ht(f.right,c.right),c.bottom=Ht(f.bottom,c.bottom),c.left=Ge(f.left,c.left),c},bl(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Fv(e){const{width:t,height:n}=qc(e);return{width:t,height:n}}function Av(e,t,n){const r=mt(t),o=bt(t),i=n==="fixed",s=hn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=gt(0);if(r||!r&&!i)if((Un(t)!=="body"||Ar(o))&&(a=yo(t)),r){const d=hn(t,!0,i,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&(l.x=Ks(o));const c=o&&!r&&!i?Xc(o,a):gt(0),u=s.left+a.scrollLeft-l.x-c.x,f=s.top+a.scrollTop-l.y-c.y;return{x:u,y:f,width:s.width,height:s.height}}function ko(e){return ut(e).position==="static"}function Sl(e,t){if(!mt(e)||ut(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return bt(e)===n&&(n=n.ownerDocument.body),n}function Yc(e,t){const n=Ue(e);if(vo(e))return n;if(!mt(e)){let o=qt(e);for(;o&&!jn(o);){if(lt(o)&&!ko(o))return o;o=qt(o)}return n}let r=Sl(e,t);for(;r&&yv(r)&&ko(r);)r=Sl(r,t);return r&&jn(r)&&ko(r)&&!ks(r)?n:r||wv(e)||n}const $v=async function(e){const t=this.getOffsetParent||Yc,n=this.getDimensions,r=await n(e.floating);return{reference:Av(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ov(e){return ut(e).direction==="rtl"}const Zc={convertOffsetParentRelativeRectToViewportRelativeRect:xv,getDocumentElement:bt,getClippingRect:Mv,getOffsetParent:Yc,getElementRects:$v,getClientRects:Cv,getDimensions:Fv,getScale:Rn,isElement:lt,isRTL:Ov};function Tv(e,t){let n=null,r;const o=bt(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:f,height:d}=e.getBoundingClientRect();if(a||t(),!f||!d)return;const h=Br(u),g=Br(o.clientWidth-(c+f)),p=Br(o.clientHeight-(u+d)),v=Br(c),m={rootMargin:-h+"px "+-g+"px "+-p+"px "+-v+"px",threshold:Ge(0,Ht(1,l))||1};let y=!0;function x(C){const O=C[0].intersectionRatio;if(O!==l){if(!y)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{n=new IntersectionObserver(x,{...m,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,m)}n.observe(e)}return s(!0),i}function Dv(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Ns(e),u=o||i?[...c?Sr(c):[],...Sr(t)]:[];u.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const f=c&&a?Tv(c,n):null;let d=-1,h=null;s&&(h=new ResizeObserver(w=>{let[m]=w;m&&m.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var y;(y=h)==null||y.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let g,p=l?hn(e):null;l&&v();function v(){const w=hn(e);p&&(w.x!==p.x||w.y!==p.y||w.width!==p.width||w.height!==p.height)&&n(),p=w,g=requestAnimationFrame(v)}return n(),()=>{var w;u.forEach(m=>{o&&m.removeEventListener("scroll",n),i&&m.removeEventListener("resize",n)}),f==null||f(),(w=h)==null||w.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const Lv=pv,_v=mv,kv=fv,Vv=vv,Nv=hv,Kv=dv,jv=(e,t,n)=>{const r=new Map,o={platform:Zc,...n},i={...o.platform,_c:r};return cv(e,t,{...o,platform:i})};var Bv=he('<svg display=block viewBox="0 0 30 30"style=transform:scale(1.02)><g><path fill=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z></path><path stroke=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z>'),js=we();function Bs(){const e=me(js);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var Gi=30,xl=Gi/2,zv={top:180,right:-90,bottom:0,left:90};function Jc(e){const t=Bs(),n=Z({size:Gi},e),[r,o]=k(n,["ref","style","size"]),i=()=>t.currentPlacement().split("-")[0],s=Gv(t.contentRef),a=()=>{var d;return((d=s())==null?void 0:d.getPropertyValue("background-color"))||"none"},l=()=>{var d;return((d=s())==null?void 0:d.getPropertyValue(`border-${i()}-color`))||"none"},c=()=>{var d;return((d=s())==null?void 0:d.getPropertyValue(`border-${i()}-width`))||"0px"},u=()=>Number.parseInt(c())*2*(Gi/r.size),f=()=>`rotate(${zv[i()]} ${xl} ${xl}) translate(0 2)`;return b(ae,A({as:"div",ref(d){var h=ve(t.setArrowRef,r.ref);typeof h=="function"&&h(d)},"aria-hidden":"true",get style(){return vt({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:a(),stroke:l(),"stroke-width":u()},r.style)}},o,{get children(){var d=Bv(),h=d.firstChild,g=h.firstChild;return g.nextSibling,Ke(()=>Nn(h,"transform",f())),d}}))}function Gv(e){const[t,n]=B();return U(()=>{const r=e();r&&n(cc(r).getComputedStyle(r))}),t}function Hv(e){const t=Bs(),[n,r]=k(e,["ref","style"]);return b(ae,A({as:"div",ref(o){var i=ve(t.setPositionerRef,n.ref);typeof i=="function"&&i(o)},"data-popper-positioner":"",get style(){return vt({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function Cl(e){const{x:t=0,y:n=0,width:r=0,height:o=0}=e??{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,o);const i={x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:n+o,left:t};return{...i,toJSON:()=>i}}function Uv(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?Cl(r):e?e.getBoundingClientRect():Cl()}}}function qv(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var Wv={top:"bottom",right:"left",bottom:"top",left:"right"};function Xv(e,t){const[n,r]=e.split("-"),o=Wv[n];return r?n==="left"||n==="right"?`${o} ${r==="start"?"top":"bottom"}`:r==="start"?`${o} ${t==="rtl"?"right":"left"}`:`${o} ${t==="rtl"?"left":"right"}`:`${o} center`}function Qv(e){const t=Z({getAnchorRect:d=>d==null?void 0:d.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=B(),[o,i]=B(),[s,a]=B(t.placement),l=()=>{var d;return Uv((d=t.anchorRef)==null?void 0:d.call(t),t.getAnchorRect)},{direction:c}=Qt();async function u(){var O,L;const d=l(),h=n(),g=o();if(!d||!h)return;const p=((g==null?void 0:g.clientHeight)||0)/2,v=typeof t.gutter=="number"?t.gutter+p:t.gutter??p;h.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),d.getBoundingClientRect();const w=[Lv(({placement:_})=>{const T=!!_.split("-")[1];return{mainAxis:v,crossAxis:T?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const _=typeof t.flip=="string"?t.flip.split(" "):void 0;if(_!==void 0&&!_.every(qv))throw new Error("`flip` expects a spaced-delimited list of placements");w.push(kv({padding:t.overflowPadding,fallbackPlacements:_}))}(t.slide||t.overlap)&&w.push(_v({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),w.push(Vv({padding:t.overflowPadding,apply({availableWidth:_,availableHeight:T,rects:V}){const N=Math.round(V.reference.width);_=Math.floor(_),T=Math.floor(T),h.style.setProperty("--kb-popper-anchor-width",`${N}px`),h.style.setProperty("--kb-popper-content-available-width",`${_}px`),h.style.setProperty("--kb-popper-content-available-height",`${T}px`),t.sameWidth&&(h.style.width=`${N}px`),t.fitViewport&&(h.style.maxWidth=`${_}px`,h.style.maxHeight=`${T}px`)}})),t.hideWhenDetached&&w.push(Nv({padding:t.detachedPadding})),g&&w.push(Kv({element:g,padding:t.arrowPadding}));const m=await jv(d,h,{placement:t.placement,strategy:"absolute",middleware:w,platform:{...Zc,isRTL:()=>c()==="rtl"}});if(a(m.placement),(O=t.onCurrentPlacementChange)==null||O.call(t,m.placement),!h)return;h.style.setProperty("--kb-popper-content-transform-origin",Xv(m.placement,c()));const y=Math.round(m.x),x=Math.round(m.y);let C;if(t.hideWhenDetached&&(C=(L=m.middlewareData.hide)!=null&&L.referenceHidden?"hidden":"visible"),Object.assign(h.style,{top:"0",left:"0",transform:`translate3d(${y}px, ${x}px, 0)`,visibility:C}),g&&m.middlewareData.arrow){const{x:_,y:T}=m.middlewareData.arrow,V=m.placement.split("-")[0];Object.assign(g.style,{left:_!=null?`${_}px`:"",top:T!=null?`${T}px`:"",[V]:"100%"})}}U(()=>{const d=l(),h=n();if(!d||!h)return;const g=Dv(d,h,u,{elementResize:typeof ResizeObserver=="function"});W(g)}),U(()=>{var g;const d=n(),h=(g=t.contentRef)==null?void 0:g.call(t);!d||!h||queueMicrotask(()=>{d.style.zIndex=getComputedStyle(h).zIndex})});const f={currentPlacement:s,contentRef:()=>{var d;return(d=t.contentRef)==null?void 0:d.call(t)},setPositionerRef:r,setArrowRef:i};return b(js.Provider,{value:f,get children(){return t.children}})}var wo=Object.assign(Qv,{Arrow:Jc,Context:js,usePopperContext:Bs,Positioner:Hv}),ed=we();function td(){return me(ed)}function Yv(){const e=td();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function nd(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function Zv(e,t){var o;const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const i=(o=e[r])==null?void 0:o.ref();if(i&&nd(i,n))return r+1}return 0}function Jv(e){const t=e.map((r,o)=>[o,r]);let n=!1;return t.sort(([r,o],[i,s])=>{const a=o.ref(),l=s.ref();return a===l||!a||!l?0:nd(a,l)?(r>i&&(n=!0),-1):(r<i&&(n=!0),1)}),n?t.map(([r,o])=>o):e}function rd(e,t){const n=Jv(e);e!==n&&t(n)}function ey(e){var o,i;const t=e[0],n=(o=e[e.length-1])==null?void 0:o.ref();let r=(i=t==null?void 0:t.ref())==null?void 0:i.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return Ze(r).body}function ty(e,t){U(()=>{const n=setTimeout(()=>{rd(e(),t)});W(()=>clearTimeout(n))})}function ny(e,t){if(typeof IntersectionObserver!="function"){ty(e,t);return}let n=[];U(()=>{const r=()=>{const s=!!n.length;n=e(),s&&rd(e(),t)},o=ey(e()),i=new IntersectionObserver(r,{root:o});for(const s of e()){const a=s.ref();a&&i.observe(a)}W(()=>i.disconnect())})}function ry(e={}){const[t,n]=lm({value:()=>$(e.items),onChange:i=>{var s;return(s=e.onItemsChange)==null?void 0:s.call(e,i)}});ny(t,n);const r=i=>(n(s=>{const a=Zv(s,i);return vg(s,i,a)}),()=>{n(s=>{const a=s.filter(l=>l.ref()!==i.ref());return s.length===a.length?s:a})});return{DomCollectionProvider:i=>b(ed.Provider,{value:{registerItem:r},get children(){return i.children}})}}function oy(e){const t=Yv(),n=Z({shouldRegisterItem:!0},e);U(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());W(r)})}function od(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=l=>{if(l==null)return"";const c=e.getKey??"key",u=bn(c)?l[c]:c(l);return u!=null?String(u):""},i=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",u=bn(c)?l[c]:c(l);return u!=null?String(u):""},s=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(bn(c)?l[c]:c(l))??!1},a=l=>{var c;if(l!=null)return bn(e.getSectionChildren)?l[e.getSectionChildren]:(c=e.getSectionChildren)==null?void 0:c.call(e,l)};for(const l of e.dataSource){if(bn(l)||yg(l)){r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:s(l),level:n,index:t}),t++;continue}if(a(l)!=null){r.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const c=a(l)??[];if(c.length>0){const u=od({dataSource:c,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...u),t+=u.length}}else r.push({type:"item",rawValue:l,key:o(l),textValue:i(l),disabled:s(l),level:n,index:t}),t++}return r}function iy(e,t=[]){return K(()=>{const n=od({dataSource:$(e.dataSource),getKey:$(e.getKey),getTextValue:$(e.getTextValue),getDisabled:$(e.getDisabled),getSectionChildren:$(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var Pt=class id extends Set{constructor(n,r,o){super(n);Re(this,"anchorKey");Re(this,"currentKey");n instanceof id?(this.anchorKey=r||n.anchorKey,this.currentKey=o||n.currentKey):(this.anchorKey=r,this.currentKey=o)}};function sy(e){const[t,n]=pt(e);return[()=>t()??new Pt,n]}function sd(e){return xg()?e.altKey:e.ctrlKey}function Sn(e){return ho()?e.metaKey:e.ctrlKey}function El(e){return new Pt(e)}function ay(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function ly(e){const t=Z({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=B(!1),[o,i]=B(),s=K(()=>{const p=$(t.selectedKeys);return p!=null?El(p):p}),a=K(()=>{const p=$(t.defaultSelectedKeys);return p!=null?El(p):new Pt}),[l,c]=sy({value:s,defaultValue:a,onChange:p=>{var v;return(v=t.onSelectionChange)==null?void 0:v.call(t,p)}}),[u,f]=B($(t.selectionBehavior)),d=()=>$(t.selectionMode),h=()=>$(t.disallowEmptySelection)??!1,g=p=>{($(t.allowDuplicateSelectionEvents)||!ay(p,l()))&&c(p)};return U(()=>{const p=l();$(t.selectionBehavior)==="replace"&&u()==="toggle"&&typeof p=="object"&&p.size===0&&f("replace")}),U(()=>{f($(t.selectionBehavior)??"toggle")}),{selectionMode:d,disallowEmptySelection:h,selectionBehavior:u,setSelectionBehavior:f,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:l,setSelectedKeys:g}}function uy(e){const[t,n]=B(""),[r,o]=B(-1);return{typeSelectHandlers:{onKeyDown:s=>{var d;if($(e.isDisabled))return;const a=$(e.keyboardDelegate),l=$(e.selectionManager);if(!a.getKeyForSearch)return;const c=cy(s.key);if(!c||s.ctrlKey||s.metaKey)return;c===" "&&t().trim().length>0&&(s.preventDefault(),s.stopPropagation());let u=n(h=>h+c),f=a.getKeyForSearch(u,l.focusedKey())??a.getKeyForSearch(u);f==null&&dy(u)&&(u=u[0],f=a.getKeyForSearch(u,l.focusedKey())??a.getKeyForSearch(u)),f!=null&&(l.setFocusedKey(f),(d=e.onTypeSelect)==null||d.call(e,f)),clearTimeout(r()),o(window.setTimeout(()=>n(""),500))}}}}function cy(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function dy(e){return e.split("").every(t=>t===e[0])}function fy(e,t,n){const o=A({selectOnFocus:()=>$(e.selectionManager).selectionBehavior()==="replace"},e),i=()=>t(),{direction:s}=Qt();let a={top:0,left:0};pg(()=>$(o.isVirtualized)?void 0:i(),"scroll",()=>{const v=i();v&&(a={top:v.scrollTop,left:v.scrollLeft})});const{typeSelectHandlers:l}=uy({isDisabled:()=>$(o.disallowTypeAhead),keyboardDelegate:()=>$(o.keyboardDelegate),selectionManager:()=>$(o.selectionManager)}),c=()=>$(o.orientation)??"vertical",u=v=>{var _,T,V,N,z,ie,P,R;oe(v,l.onKeyDown),v.altKey&&v.key==="Tab"&&v.preventDefault();const w=t();if(!(w!=null&&w.contains(v.target)))return;const m=$(o.selectionManager),y=$(o.selectOnFocus),x=S=>{S!=null&&(m.setFocusedKey(S),v.shiftKey&&m.selectionMode()==="multiple"?m.extendSelection(S):y&&!sd(v)&&m.replaceSelection(S))},C=$(o.keyboardDelegate),O=$(o.shouldFocusWrap),L=m.focusedKey();switch(v.key){case(c()==="vertical"?"ArrowDown":"ArrowRight"):{if(C.getKeyBelow){v.preventDefault();let S;L!=null?S=C.getKeyBelow(L):S=(_=C.getFirstKey)==null?void 0:_.call(C),S==null&&O&&(S=(T=C.getFirstKey)==null?void 0:T.call(C,L)),x(S)}break}case(c()==="vertical"?"ArrowUp":"ArrowLeft"):{if(C.getKeyAbove){v.preventDefault();let S;L!=null?S=C.getKeyAbove(L):S=(V=C.getLastKey)==null?void 0:V.call(C),S==null&&O&&(S=(N=C.getLastKey)==null?void 0:N.call(C,L)),x(S)}break}case(c()==="vertical"?"ArrowLeft":"ArrowUp"):{if(C.getKeyLeftOf){v.preventDefault();const S=s()==="rtl";let I;L!=null?I=C.getKeyLeftOf(L):I=S?(z=C.getFirstKey)==null?void 0:z.call(C):(ie=C.getLastKey)==null?void 0:ie.call(C),x(I)}break}case(c()==="vertical"?"ArrowRight":"ArrowDown"):{if(C.getKeyRightOf){v.preventDefault();const S=s()==="rtl";let I;L!=null?I=C.getKeyRightOf(L):I=S?(P=C.getLastKey)==null?void 0:P.call(C):(R=C.getFirstKey)==null?void 0:R.call(C),x(I)}break}case"Home":if(C.getFirstKey){v.preventDefault();const S=C.getFirstKey(L,Sn(v));S!=null&&(m.setFocusedKey(S),Sn(v)&&v.shiftKey&&m.selectionMode()==="multiple"?m.extendSelection(S):y&&m.replaceSelection(S))}break;case"End":if(C.getLastKey){v.preventDefault();const S=C.getLastKey(L,Sn(v));S!=null&&(m.setFocusedKey(S),Sn(v)&&v.shiftKey&&m.selectionMode()==="multiple"?m.extendSelection(S):y&&m.replaceSelection(S))}break;case"PageDown":if(C.getKeyPageBelow&&L!=null){v.preventDefault();const S=C.getKeyPageBelow(L);x(S)}break;case"PageUp":if(C.getKeyPageAbove&&L!=null){v.preventDefault();const S=C.getKeyPageAbove(L);x(S)}break;case"a":Sn(v)&&m.selectionMode()==="multiple"&&$(o.disallowSelectAll)!==!0&&(v.preventDefault(),m.selectAll());break;case"Escape":v.defaultPrevented||(v.preventDefault(),$(o.disallowEmptySelection)||m.clearSelection());break;case"Tab":if(!$(o.allowsTabNavigation)){if(v.shiftKey)w.focus();else{const S=Og(w,{tabbable:!0});let I,M;do M=S.lastChild(),M&&(I=M);while(M);I&&!I.contains(document.activeElement)&&Ie(I)}break}}},f=v=>{var x,C;const w=$(o.selectionManager),m=$(o.keyboardDelegate),y=$(o.selectOnFocus);if(w.isFocused()){v.currentTarget.contains(v.target)||w.setFocused(!1);return}if(v.currentTarget.contains(v.target)){if(w.setFocused(!0),w.focusedKey()==null){const O=_=>{_!=null&&(w.setFocusedKey(_),y&&w.replaceSelection(_))},L=v.relatedTarget;L&&v.currentTarget.compareDocumentPosition(L)&Node.DOCUMENT_POSITION_FOLLOWING?O(w.lastSelectedKey()??((x=m.getLastKey)==null?void 0:x.call(m))):O(w.firstSelectedKey()??((C=m.getFirstKey)==null?void 0:C.call(m)))}else if(!$(o.isVirtualized)){const O=i();if(O){O.scrollTop=a.top,O.scrollLeft=a.left;const L=O.querySelector(`[data-key="${w.focusedKey()}"]`);L&&(Ie(L),Li(O,L))}}}},d=v=>{const w=$(o.selectionManager);v.currentTarget.contains(v.relatedTarget)||w.setFocused(!1)},h=v=>{i()===v.target&&v.preventDefault()},g=()=>{var O,L;const v=$(o.autoFocus);if(!v)return;const w=$(o.selectionManager),m=$(o.keyboardDelegate);let y;v==="first"&&(y=(O=m.getFirstKey)==null?void 0:O.call(m)),v==="last"&&(y=(L=m.getLastKey)==null?void 0:L.call(m));const x=w.selectedKeys();x.size&&(y=x.values().next().value),w.setFocused(!0),w.setFocusedKey(y);const C=t();C&&y==null&&!$(o.shouldUseVirtualFocus)&&Ie(C)};return Bn(()=>{o.deferAutoFocus?setTimeout(g,0):g()}),U(Ce([i,()=>$(o.isVirtualized),()=>$(o.selectionManager).focusedKey()],v=>{var x;const[w,m,y]=v;if(m)y&&((x=o.scrollToKey)==null||x.call(o,y));else if(y&&w){const C=w.querySelector(`[data-key="${y}"]`);C&&Li(w,C)}})),{tabIndex:K(()=>{if(!$(o.shouldUseVirtualFocus))return $(o.selectionManager).focusedKey()==null?0:-1}),onKeyDown:u,onMouseDown:h,onFocusIn:f,onFocusOut:d}}function ad(e,t){const n=()=>$(e.selectionManager),r=()=>$(e.key),o=()=>$(e.shouldUseVirtualFocus),i=m=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):m!=null&&m.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||Sn(m)||"pointerType"in m&&m.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>n().isSelected(r()),a=()=>$(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let c=null;const u=m=>{l()&&(c=m.pointerType,m.pointerType==="mouse"&&m.button===0&&!$(e.shouldSelectOnPressUp)&&i(m))},f=m=>{l()&&m.pointerType==="mouse"&&m.button===0&&$(e.shouldSelectOnPressUp)&&$(e.allowsDifferentPressOrigin)&&i(m)},d=m=>{l()&&($(e.shouldSelectOnPressUp)&&!$(e.allowsDifferentPressOrigin)||c!=="mouse")&&i(m)},h=m=>{!l()||!["Enter"," "].includes(m.key)||(sd(m)?n().toggleSelection(r()):i(m))},g=m=>{a()&&m.preventDefault()},p=m=>{const y=t();o()||a()||!y||m.target===y&&n().setFocusedKey(r())},v=K(()=>{if(!(o()||a()))return r()===n().focusedKey()?0:-1}),w=K(()=>$(e.virtualized)?void 0:r());return U(Ce([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],([m,y,x,C,O])=>{m&&y===C&&O&&!x&&document.activeElement!==m&&(e.focus?e.focus():Ie(m))})),{isSelected:s,isDisabled:a,allowsSelection:l,tabIndex:v,dataKey:w,onPointerDown:u,onPointerUp:f,onClick:d,onKeyDown:h,onMouseDown:g,onFocus:p}}var hy=class{constructor(e,t){Re(this,"collection");Re(this,"state");this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(e==null||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if(this.state.selectionMode()==="none")return!1;const t=this.getKey(e);return t==null?!1:this.state.selectedKeys().has(t)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every(t=>e.has(t))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index<e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=(n==null?void 0:n.index)!=null&&(e==null?void 0:e.index)!=null&&n.index>e.index;(!e||r)&&(e=n)}return e==null?void 0:e.key}extendSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,o=new Pt(n,r,t);for(const i of this.getKeyRange(r,n.currentKey||t))o.delete(i);for(const i of this.getKeyRange(t,r))this.canSelectItem(i)&&o.add(i);this.state.setSelectedKeys(o)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?n.index!=null&&r.index!=null&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;r!=null;){const o=this.collection().getItem(r);if(o&&o.type==="item"&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?!t||t.type!=="item"?null:t.key:e}toggleSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=new Pt(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection()&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode()==="none")return;const t=this.getKey(e);if(t==null)return;const n=this.canSelectItem(t)?new Pt([t],t,t):new Pt;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new Pt;for(const n of e){const r=this.getKey(n);if(r!=null&&(t.add(r),this.selectionMode()==="single"))break}this.state.setSelectedKeys(t)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new Pt)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior()==="toggle"||t&&t.pointerType==="touch"?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode()==="none")return!1;const t=this.collection().getItem(e);return t!=null&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(n=>{for(;n!=null;){if(this.canSelectItem(n)){const r=this.collection().getItem(n);if(!r)continue;r.type==="item"&&e.push(n)}n=this.collection().getKeyAfter(n)}})(this.collection().getFirstKey()),e}},Rl=class{constructor(e){Re(this,"keyMap",new Map);Re(this,"iterable");Re(this,"firstKey");Re(this,"lastKey");this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(this.keyMap.size===0)return;let t,n=0;for(const[r,o]of this.keyMap)t?(t.nextKey=r,o.prevKey=t.key):(this.firstKey=r,o.prevKey=void 0),o.type==="item"&&(o.index=n++),t=o,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.prevKey}getKeyAfter(e){var t;return(t=this.keyMap.get(e))==null?void 0:t.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};function gy(e){const t=ly(e),r=iy({dataSource:()=>$(e.dataSource),getKey:()=>$(e.getKey),getTextValue:()=>$(e.getTextValue),getDisabled:()=>$(e.getDisabled),getSectionChildren:()=>$(e.getSectionChildren),factory:i=>e.filter?new Rl(e.filter(i)):new Rl(i)},[()=>e.filter]),o=new hy(r,t);return Mt(()=>{const i=t.focusedKey();i!=null&&!r().getItem(i)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>o}}var py=class{constructor(e,t,n){Re(this,"collection");Re(this,"ref");Re(this,"collator");this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){var t,n;return((n=(t=this.ref)==null?void 0:t.call(this))==null?void 0:n.querySelector(`[data-key="${e}"]`))??null}getKeyPageAbove(e){var i;const t=(i=this.ref)==null?void 0:i.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let o=e;for(;o&&n&&n.offsetTop>r;)o=this.getKeyAbove(o),n=o!=null?this.getItem(o):null;return o}getKeyPageBelow(e){var i;const t=(i=this.ref)==null?void 0:i.call(this);let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let o=e;for(;o&&n&&n.offsetTop<r;)o=this.getKeyBelow(o),n=o!=null?this.getItem(o):null;return o}getKeyForSearch(e,t){var o;const n=(o=this.collator)==null?void 0:o.call(this);if(!n)return;let r=t!=null?this.getKeyBelow(t):this.getFirstKey();for(;r!=null;){const i=this.collection().getItem(r);if(i){const s=i.textValue.slice(0,e.length);if(i.textValue&&n.compare(s,e)===0)return r}r=this.getKeyBelow(r)}}};function my(e,t,n){const r=tv({usage:"search",sensitivity:"base"}),o=K(()=>{const i=$(e.keyboardDelegate);return i||new py(e.collection,t,r)});return fy({selectionManager:()=>$(e.selectionManager),keyboardDelegate:o,autoFocus:()=>$(e.autoFocus),deferAutoFocus:()=>$(e.deferAutoFocus),shouldFocusWrap:()=>$(e.shouldFocusWrap),disallowEmptySelection:()=>$(e.disallowEmptySelection),selectOnFocus:()=>$(e.selectOnFocus),disallowTypeAhead:()=>$(e.disallowTypeAhead),shouldUseVirtualFocus:()=>$(e.shouldUseVirtualFocus),allowsTabNavigation:()=>$(e.allowsTabNavigation),isVirtualized:()=>$(e.isVirtualized),scrollToKey:i=>{var s;return(s=$(e.scrollToKey))==null?void 0:s(i)},orientation:()=>$(e.orientation)},t)}function ld(e={}){const[t,n]=Lc({value:()=>$(e.isSelected),defaultValue:()=>!!$(e.defaultIsSelected),onChange:i=>{var s;return(s=e.onSelectedChange)==null?void 0:s.call(e,i)}});return{isSelected:t,setIsSelected:i=>{!$(e.isReadOnly)&&!$(e.isDisabled)&&n(i)},toggle:()=>{!$(e.isReadOnly)&&!$(e.isDisabled)&&n(!t())}}}var ud=we();function bo(){return me(ud)}function At(){const e=bo();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var cd=we();function zs(){const e=me(cd);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var dd=we();function St(){const e=me(dd);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function Gs(e){let t;const n=St(),r=At(),o=Z({id:n.generateId(`item-${Ee()}`)},e),[i,s]=k(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=B(),[c,u]=B(),[f,d]=B(),h=()=>r.listState().selectionManager(),g=()=>s.id,p=()=>h().focusedKey()===g(),v=()=>{var T;(T=i.onSelect)==null||T.call(i),i.closeOnSelect&&setTimeout(()=>{r.close(!0)})};oy({getItem:()=>{var T;return{ref:()=>t,type:"item",key:g(),textValue:i.textValue??((T=f())==null?void 0:T.textContent)??(t==null?void 0:t.textContent)??"",disabled:i.disabled??!1}}});const w=ad({key:g,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),m=T=>{oe(T,i.onPointerMove),T.pointerType==="mouse"&&(i.disabled?r.onItemLeave(T):(r.onItemEnter(T),T.defaultPrevented||(Ie(T.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(g()))))},y=T=>{oe(T,i.onPointerLeave),T.pointerType==="mouse"&&r.onItemLeave(T)},x=T=>{oe(T,i.onPointerUp),!i.disabled&&T.button===0&&v()},C=T=>{if(oe(T,i.onKeyDown),!T.repeat&&!i.disabled)switch(T.key){case"Enter":case" ":v();break}},O=K(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),L=K(()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":p()?"":void 0})),_={isChecked:()=>i.checked,dataset:L,setLabelRef:d,generateId:yt(()=>s.id),registerLabel:Be(l),registerDescription:Be(u)};return b(cd.Provider,{value:_,get children(){return b(ae,A({as:"div",ref(T){var V=ve(N=>t=N,i.ref);typeof V=="function"&&V(T)},get tabIndex(){return w.tabIndex()},get"aria-checked"(){return O()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return w.dataKey()},get onPointerDown(){return be([i.onPointerDown,w.onPointerDown])},get onPointerUp(){return be([x,w.onPointerUp])},get onClick(){return be([i.onClick,w.onClick])},get onKeyDown(){return be([C,w.onKeyDown])},get onMouseDown(){return be([i.onMouseDown,w.onMouseDown])},get onFocus(){return be([i.onFocus,w.onFocus])},onPointerMove:m,onPointerLeave:y},L,s))}})}function vy(e){const t=Z({closeOnSelect:!1},e),[n,r]=k(t,["checked","defaultChecked","onChange","onSelect"]),o=ld({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:s=>{var a;return(a=n.onChange)==null?void 0:a.call(n,s)},isDisabled:()=>r.disabled});return b(Gs,A({role:"menuitemcheckbox",get checked(){return o.isSelected()},onSelect:()=>{var s;(s=n.onSelect)==null||s.call(n),o.toggle()}},r))}var fd=we();function $r(){return me(fd)}function qn(){const e=$r();if(e===void 0)throw new Error("[kobalte]: `useMenubarContext` must be used within a `Menubar` component");return e}var xr={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>xr.next(e==="ltr"?"rtl":"ltr",t)},Pl={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function Il(e){const t=St(),n=At(),r=$r(),{direction:o}=Qt(),i=Z({id:t.generateId("trigger")},e),[s,a]=k(i,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();r!==void 0&&(l=()=>t.value()??s.id,r.lastValue()===void 0&&r.setLastValue(l));const c=go(()=>n.triggerRef(),()=>"button"),u=K(()=>{var w;return c()==="a"&&((w=n.triggerRef())==null?void 0:w.getAttribute("href"))!=null});U(Ce(()=>r==null?void 0:r.value(),w=>{var m;u()&&w===l()&&((m=n.triggerRef())==null||m.focus())}));const f=()=>{r!==void 0?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)},d=w=>{oe(w,s.onPointerDown),w.currentTarget.dataset.pointerType=w.pointerType,!s.disabled&&w.pointerType!=="touch"&&w.button===0&&f()},h=w=>{oe(w,s.onClick),s.disabled||w.currentTarget.dataset.pointerType==="touch"&&f()},g=w=>{if(oe(w,s.onKeyDown),!s.disabled){if(u())switch(w.key){case"Enter":case" ":return}switch(w.key){case"Enter":case" ":case Pl.first(t.orientation()):w.stopPropagation(),w.preventDefault(),_g(w.currentTarget),n.open("first"),r==null||r.setAutoFocusMenu(!0),r==null||r.setValue(l);break;case Pl.last(t.orientation()):w.stopPropagation(),w.preventDefault(),n.open("last");break;case xr.next(o(),t.orientation()):if(r===void 0)break;w.stopPropagation(),w.preventDefault(),r.nextMenu();break;case xr.previous(o(),t.orientation()):if(r===void 0)break;w.stopPropagation(),w.preventDefault(),r.previousMenu();break}}},p=w=>{var m;oe(w,s.onMouseOver),((m=n.triggerRef())==null?void 0:m.dataset.pointerType)!=="touch"&&!s.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(l)},v=w=>{oe(w,s.onFocus),r!==void 0&&w.currentTarget.dataset.pointerType!=="touch"&&r.setValue(l)};return U(()=>W(n.registerTriggerId(s.id))),b(wt,A({ref(w){var m=ve(n.setTriggerRef,s.ref);typeof m=="function"&&m(w)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return s.id},get disabled(){return s.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return K(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return l()!==void 0&&(r==null?void 0:r.value())===l()?!0:void 0},get tabIndex(){return r!==void 0?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:d,onMouseOver:p,onClick:h,onKeyDown:g,onFocus:v,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),a))}var hd=we();function Hs(){return me(hd)}function Or(){const e=Hs();if(e===void 0)throw new Error("[kobalte]: `useNavigationMenuContext` must be used within a `NavigationMenu` component");return e}function gd(e){let t;const n=St(),r=At(),o=$r(),i=Hs(),{direction:s}=Qt(),a=Z({id:n.generateId(`content-${Ee()}`)},e),[l,c]=k(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let u=0;const f=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),d=my({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>n.orientation()==="horizontal"?"vertical":"horizontal"},()=>t);$c({trapFocus:()=>f()&&r.isOpen(),onMountAutoFocus:y=>{var x;o===void 0&&((x=l.onOpenAutoFocus)==null||x.call(l,y))},onUnmountAutoFocus:l.onCloseAutoFocus},()=>t);const h=y=>{if(_e(y.currentTarget,y.target)&&(y.key==="Tab"&&r.isOpen()&&y.preventDefault(),o!==void 0&&y.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(y.key){case xr.next(s(),n.orientation()):y.stopPropagation(),y.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case xr.previous(s(),n.orientation()):if(y.currentTarget.hasAttribute("data-closed"))break;y.stopPropagation(),y.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},g=y=>{var x;(x=l.onEscapeKeyDown)==null||x.call(l,y),o==null||o.setAutoFocusMenu(!1),r.close(!0)},p=y=>{var x;(x=l.onFocusOutside)==null||x.call(l,y),n.isModal()&&y.preventDefault()},v=y=>{var x,C;oe(y,l.onPointerEnter),r.isOpen()&&((x=r.parentMenuContext())==null||x.listState().selectionManager().setFocused(!1),(C=r.parentMenuContext())==null||C.listState().selectionManager().setFocusedKey(void 0))},w=y=>{if(oe(y,l.onPointerMove),y.pointerType!=="mouse")return;const x=y.target,C=u!==y.clientX;_e(y.currentTarget,x)&&C&&(r.setPointerDir(y.clientX>u?"right":"left"),u=y.clientX)};U(()=>W(r.registerContentId(l.id))),W(()=>r.setContentRef(void 0));const m={ref:ve(y=>{r.setContentRef(y),t=y},l.ref),role:"menu",get id(){return l.id},get tabIndex(){return d.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:be([l.onKeyDown,d.onKeyDown,h]),onMouseDown:be([l.onMouseDown,d.onMouseDown]),onFocusIn:be([l.onFocusIn,d.onFocusIn]),onFocusOut:be([l.onFocusOut,d.onFocusOut]),onPointerEnter:v,onPointerMove:w,get"data-orientation"(){return n.orientation()}};return b(Se,{get when(){return r.contentPresent()},get children(){return b(Se,{get when(){return i===void 0||r.parentMenuContext()!=null},get fallback(){return b(ae,A({as:"div"},()=>r.dataset(),m,c))},get children(){return b(wo.Positioner,{get children(){return b(Rs,A({get disableOutsidePointerEvents(){return K(()=>!!f())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return vt({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:g,onFocusOutside:p,get onDismiss(){return r.close}},()=>r.dataset(),m,c))}})}})}})}function yy(e){let t;const n=St(),r=At(),[o,i]=k(e,["ref"]);return _c({element:()=>t??null,enabled:()=>r.contentPresent()&&n.preventScroll()}),b(gd,A({ref(s){var a=ve(l=>{t=l},o.ref);typeof a=="function"&&a(s)}},i))}var pd=we();function wy(){const e=me(pd);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function md(e){const t=St(),n=Z({id:t.generateId(`group-${Ee()}`)},e),[r,o]=B(),i={generateId:yt(()=>n.id),registerLabelId:Be(o)};return b(pd.Provider,{value:i,get children(){return b(ae,A({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function by(e){const t=wy(),n=Z({id:t.generateId("label")},e),[r,o]=k(n,["id"]);return U(()=>W(t.registerLabelId(r.id))),b(ae,A({as:"span",get id(){return r.id},"aria-hidden":"true"},o))}function vd(e){const t=At(),n=Z({children:"▼"},e);return b(ae,A({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function Sy(e){return b(Gs,A({role:"menuitem",closeOnSelect:!0},e))}function xy(e){const t=zs(),n=Z({id:t.generateId("description")},e),[r,o]=k(n,["id"]);return U(()=>W(t.registerDescription(r.id))),b(ae,A({as:"div",get id(){return r.id}},()=>t.dataset(),o))}function Cy(e){const t=zs(),n=Z({id:t.generateId("indicator")},e),[r,o]=k(n,["forceMount"]);return b(Se,{get when(){return r.forceMount||t.isChecked()},get children(){return b(ae,A({as:"div"},()=>t.dataset(),o))}})}function Ey(e){const t=zs(),n=Z({id:t.generateId("label")},e),[r,o]=k(n,["ref","id"]);return U(()=>W(t.registerLabel(r.id))),b(ae,A({as:"div",ref(i){var s=ve(t.setLabelRef,r.ref);typeof s=="function"&&s(i)},get id(){return r.id}},()=>t.dataset(),o))}function Ry(e){const t=At();return b(Se,{get when(){return t.contentPresent()},get children(){return b(rs,e)}})}var yd=we();function Py(){const e=me(yd);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function Iy(e){const n=St().generateId(`radiogroup-${Ee()}`),r=Z({id:n},e),[o,i]=k(r,["value","defaultValue","onChange","disabled"]),[s,a]=pt({value:()=>o.value,defaultValue:()=>o.defaultValue,onChange:c=>{var u;return(u=o.onChange)==null?void 0:u.call(o,c)}}),l={isDisabled:()=>o.disabled,isSelectedValue:c=>c===s(),setSelectedValue:a};return b(yd.Provider,{value:l,get children(){return b(md,i)}})}function My(e){const t=Py(),n=Z({closeOnSelect:!1},e),[r,o]=k(n,["value","onSelect"]);return b(Gs,A({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{var s;(s=r.onSelect)==null||s.call(r),t.setSelectedValue(r.value)}},o))}function Fy(e,t,n){const r=e.split("-")[0],o=n.getBoundingClientRect(),i=[],s=t.clientX,a=t.clientY;switch(r){case"top":i.push([s,a+5]),i.push([o.left,o.bottom]),i.push([o.left,o.top]),i.push([o.right,o.top]),i.push([o.right,o.bottom]);break;case"right":i.push([s-5,a]),i.push([o.left,o.top]),i.push([o.right,o.top]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]);break;case"bottom":i.push([s,a-5]),i.push([o.right,o.top]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]),i.push([o.left,o.top]);break;case"left":i.push([s+5,a]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]),i.push([o.left,o.top]),i.push([o.right,o.top]);break}return i}function Ay(e,t){return t?Lg([e.clientX,e.clientY],t):!1}function wd(e){const t=St(),n=td(),r=bo(),o=$r(),i=Hs(),s=Z({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[a,l]=k(s,["open","defaultOpen","onOpenChange"]);let c=0,u=null,f="right";const[d,h]=B(),[g,p]=B(),[v,w]=B(),[m,y]=B(),[x,C]=B(!0),[O,L]=B(l.placement),[_,T]=B([]),[V,N]=B([]),{DomCollectionProvider:z}=ry({items:V,onItemsChange:N}),ie=Ps({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:te=>{var Fe;return(Fe=a.onOpenChange)==null?void 0:Fe.call(a,te)}}),{present:P}=wr({show:()=>t.forceMount()||ie.isOpen(),element:()=>m()??null}),R=gy({selectionMode:"none",dataSource:V}),S=te=>{C(te),ie.open()},I=(te=!1)=>{ie.close(),te&&r&&r.close(!0)},M=te=>{C(te),ie.toggle()},F=()=>{const te=m();te&&(Ie(te),R.selectionManager().setFocused(!0),R.selectionManager().setFocusedKey(void 0))},D=()=>{i!=null?setTimeout(()=>F()):F()},j=te=>{T(Pe=>[...Pe,te]);const Fe=r==null?void 0:r.registerNestedMenu(te);return()=>{T(Pe=>Di(Pe,te)),Fe==null||Fe()}},H=te=>f===(u==null?void 0:u.side)&&Ay(te,u==null?void 0:u.area),X=te=>{H(te)&&te.preventDefault()},le=te=>{H(te)||D()},ne=te=>{H(te)&&te.preventDefault()};Oc({isDisabled:()=>!(r==null&&ie.isOpen()&&t.isModal()),targets:()=>[m(),..._()].filter(Boolean)}),U(()=>{const te=m();if(!te||!r)return;const Fe=r.registerNestedMenu(te);W(()=>{Fe()})}),U(()=>{r===void 0&&(o==null||o.registerMenu(t.value(),[m(),..._()]))}),U(()=>{var te;r!==void 0||o===void 0||(o.value()===t.value()?((te=v())==null||te.focus(),o.autoFocusMenu()&&S(!0)):I())}),U(()=>{r!==void 0||o===void 0||ie.isOpen()&&o.setValue(t.value())}),W(()=>{r===void 0&&(o==null||o.unregisterMenu(t.value()))});const Je={dataset:K(()=>({"data-expanded":ie.isOpen()?"":void 0,"data-closed":ie.isOpen()?void 0:""})),isOpen:ie.isOpen,contentPresent:P,nestedMenus:_,currentPlacement:O,pointerGraceTimeoutId:()=>c,autoFocus:x,listState:()=>R,parentMenuContext:()=>r,triggerRef:v,contentRef:m,triggerId:d,contentId:g,setTriggerRef:w,setContentRef:y,open:S,close:I,toggle:M,focusContent:D,onItemEnter:X,onItemLeave:le,onTriggerLeave:ne,setPointerDir:te=>f=te,setPointerGraceTimeoutId:te=>c=te,setPointerGraceIntent:te=>u=te,registerNestedMenu:j,registerItemToParentDomCollection:n==null?void 0:n.registerItem,registerTriggerId:Be(h),registerContentId:Be(p)};return b(z,{get children(){return b(ud.Provider,{value:Je,get children(){return b(Se,{when:i===void 0,get fallback(){return l.children},get children(){return b(wo,A({anchorRef:v,contentRef:m,onCurrentPlacementChange:L},l))}})}})}})}function $y(e){const{direction:t}=Qt();return b(wd,A({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var Oy={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function Ty(e){const t=At(),n=St(),[r,o]=k(e,["onFocusOutside","onKeyDown"]),{direction:i}=Qt();return b(gd,A({onOpenAutoFocus:u=>{u.preventDefault()},onCloseAutoFocus:u=>{u.preventDefault()},onFocusOutside:u=>{var d;(d=r.onFocusOutside)==null||d.call(r,u);const f=u.target;_e(t.triggerRef(),f)||t.close()},onKeyDown:u=>{oe(u,r.onKeyDown);const f=_e(u.currentTarget,u.target),d=Oy.close(i(),n.orientation()).includes(u.key),h=t.parentMenuContext()!=null;f&&d&&h&&(t.close(),Ie(t.triggerRef()))}},o))}var Ml=["Enter"," "],Dy={open:(e,t)=>e==="ltr"?[...Ml,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...Ml,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function Ly(e){let t;const n=St(),r=At(),o=Z({id:n.generateId(`sub-trigger-${Ee()}`)},e),[i,s]=k(o,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const l=()=>{a&&window.clearTimeout(a),a=null},{direction:c}=Qt(),u=()=>i.id,f=()=>{const y=r.parentMenuContext();if(y==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return y.listState().selectionManager()},d=()=>r.listState().collection(),h=()=>f().focusedKey()===u(),g=ad({key:u,selectionManager:f,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),p=y=>{oe(y,i.onClick),!r.isOpen()&&!i.disabled&&r.open(!0)},v=y=>{var C;if(oe(y,i.onPointerMove),y.pointerType!=="mouse")return;const x=r.parentMenuContext();if(x==null||x.onItemEnter(y),!y.defaultPrevented){if(i.disabled){x==null||x.onItemLeave(y);return}!r.isOpen()&&!a&&((C=r.parentMenuContext())==null||C.setPointerGraceIntent(null),a=window.setTimeout(()=>{r.open(!1),l()},100)),x==null||x.onItemEnter(y),y.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),Ie(y.currentTarget),x==null||x.listState().selectionManager().setFocused(!0),x==null||x.listState().selectionManager().setFocusedKey(u()))}},w=y=>{if(oe(y,i.onPointerLeave),y.pointerType!=="mouse")return;l();const x=r.parentMenuContext(),C=r.contentRef();if(C){x==null||x.setPointerGraceIntent({area:Fy(r.currentPlacement(),y,C),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(x==null?void 0:x.pointerGraceTimeoutId());const O=window.setTimeout(()=>{x==null||x.setPointerGraceIntent(null)},300);x==null||x.setPointerGraceTimeoutId(O)}else{if(x==null||x.onTriggerLeave(y),y.defaultPrevented)return;x==null||x.setPointerGraceIntent(null)}x==null||x.onItemLeave(y)},m=y=>{oe(y,i.onKeyDown),!y.repeat&&(i.disabled||Dy.open(c(),n.orientation()).includes(y.key)&&(y.stopPropagation(),y.preventDefault(),f().setFocused(!1),f().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(d().getFirstKey())))};return U(()=>{if(r.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const y=r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:u(),textValue:i.textValue??(t==null?void 0:t.textContent)??"",disabled:i.disabled??!1});W(y)}),U(Ce(()=>{var y;return(y=r.parentMenuContext())==null?void 0:y.pointerGraceTimeoutId()},y=>{W(()=>{var x;window.clearTimeout(y),(x=r.parentMenuContext())==null||x.setPointerGraceIntent(null)})})),U(()=>W(r.registerTriggerId(i.id))),W(()=>{l()}),b(ae,A({as:"div",ref(y){var x=ve(C=>{r.setTriggerRef(C),t=C},i.ref);typeof x=="function"&&x(y)},get id(){return i.id},role:"menuitem",get tabIndex(){return g.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return K(()=>!!r.isOpen())()?r.contentId():void 0},get"aria-disabled"(){return i.disabled},get"data-key"(){return g.dataKey()},get"data-highlighted"(){return h()?"":void 0},get"data-disabled"(){return i.disabled?"":void 0},get onPointerDown(){return be([i.onPointerDown,g.onPointerDown])},get onPointerUp(){return be([i.onPointerUp,g.onPointerUp])},get onClick(){return be([p,g.onClick])},get onKeyDown(){return be([m,g.onKeyDown])},get onMouseDown(){return be([i.onMouseDown,g.onMouseDown])},get onFocus(){return be([i.onFocus,g.onFocus])},onPointerMove:v,onPointerLeave:w},()=>r.dataset(),s))}function _y(e){const t=$r(),n=`menu-${Ee()}`,r=Z({id:n,modal:!0},e),[o,i]=k(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),s=Ps({open:()=>o.open,defaultOpen:()=>o.defaultOpen,onOpenChange:l=>{var c;return(c=o.onOpenChange)==null?void 0:c.call(o,l)}}),a={isModal:()=>o.modal??!0,preventScroll:()=>o.preventScroll??a.isModal(),forceMount:()=>o.forceMount??!1,generateId:yt(()=>o.id),value:()=>o.value,orientation:()=>o.orientation??(t==null?void 0:t.orientation())??"horizontal"};return b(dd.Provider,{value:a,get children(){return b(wd,A({get open(){return s.isOpen()},get onOpenChange(){return s.setIsOpen}},i))}})}function bd(e){const t=qn(),n=Z({modal:!1},e),[r,o]=k(n,["value"]),i=Ee(),s=t.generateId(`menubar-menu-${i}`),a=Z({id:s},o);return b(_y,A({get value(){return r.value??i}},a))}function ky(e){let t;const n=`menubar-${Ee()}`,r=Z({id:n,loop:!0,orientation:"horizontal"},e),[o,i]=k(r,["ref","value","defaultValue","onValueChange","loop","focusOnAlt","autoFocusMenu","onAutoFocusMenuChange","orientation"]),[s,a]=pt({value:()=>o.value,defaultValue:()=>o.defaultValue,onChange:m=>{var y;return(y=o.onValueChange)==null?void 0:y.call(o,m)}}),[l,c]=B(),[u,f]=B(new Map),[d,h]=pt({value:()=>o.autoFocusMenu,defaultValue:()=>!1,onChange:o.onAutoFocusMenuChange}),g=()=>{var m;return s()&&d()&&!((m=s())!=null&&m.includes("link-trigger-"))},v={dataset:K(()=>({"data-expanded":g()?"":void 0,"data-closed":g()?void 0:""})),value:s,setValue:a,lastValue:l,setLastValue:c,menus:()=>new Set([...u().keys()]),menuRefs:()=>[...u().values()].flat(),menuRefMap:()=>u(),registerMenu:(m,y)=>{f(x=>{const C=new Map;return x.forEach((O,L)=>C.set(L,O)),C.set(m,y),C})},unregisterMenu:m=>{f(y=>{y.delete(m);const x=new Map;return y.forEach((C,O)=>x.set(O,C)),x})},nextMenu:()=>{const m=[...u().keys()];if(s()==null){a(m[0]);return}const y=m.indexOf(s());if(y===m.length-1){o.loop&&a(m[0]);return}a(m[y+1])},previousMenu:()=>{const m=[...u().keys()];if(s()==null){a(m[0]);return}const y=m.indexOf(s());if(y===0){o.loop&&a(m[m.length-1]);return}a(m[y-1])},closeMenu:()=>{h(!1),a(void 0)},autoFocusMenu:()=>d(),setAutoFocusMenu:h,generateId:yt(()=>i.id),orientation:()=>o.orientation};U(()=>{s()==null&&h(!1)}),Tc({onInteractOutside:()=>{v.closeMenu(),setTimeout(()=>v.closeMenu())},shouldExcludeElement:m=>[t,...u().values()].flat().some(y=>_e(y,m))},()=>t);const w=m=>{m.key==="Alt"&&(m.preventDefault(),m.stopPropagation(),v.value()===void 0?v.nextMenu():v.closeMenu())};return U(()=>{o.focusOnAlt?window.addEventListener("keydown",w):window.removeEventListener("keydown",w),W(()=>{window.removeEventListener("keydown",w)})}),U(()=>{s()!=null&&c(s())}),b(fd.Provider,{value:v,get children(){return b(ae,A({as:"div",ref(m){var y=ve(x=>t=x,o.ref);typeof y=="function"&&y(m)},role:"menubar",get"data-orientation"(){return o.orientation},get"aria-orientation"(){return o.orientation}},i))}})}function Vy(e){const t=qn();if(bo()===void 0&&Object.hasOwn(e,"href")){const r=t.generateId("link-trigger-")+Ee();return b(bd,{value:r,get children(){return b(Il,e)}})}return Il(e)}var Ny={};Xt(Ny,{Root:()=>Us,Separator:()=>Ky});function Us(e){let t;const n=Z({orientation:"horizontal"},e),[r,o]=k(n,["ref","orientation"]),i=go(()=>t,()=>"hr");return b(ae,A({as:"hr",ref(s){var a=ve(l=>t=l,r.ref);typeof a=="function"&&a(s)},get role(){return i()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},o))}var Ky=Us,Sd=he("<li role=presentation>"),jy=he("<nav>");function By(e){let t;const n=qn(),r=Z({size:15},e),[o,i]=k(r,["ref"]),[s,a]=B(0),l=()=>n.orientation()==="horizontal";return U(Ce(n.value,c=>{setTimeout(()=>{if(!c||c.includes("link-trigger-"))return;const u=document.querySelector(`[data-kb-menu-value-trigger="${c}"]`);if(!u||!t)return;const f=u.getBoundingClientRect()[l()?"x":"y"]+u.getBoundingClientRect()[l()?"width":"height"]/2,d=window.getComputedStyle(t),h=t.getBoundingClientRect()[l()?"x":"y"]+t.getBoundingClientRect()[l()?"width":"height"]/2-Number.parseFloat(d.transform.split(",")[l()?4:5]);a(f-h)})})),b(Jc,A({ref(c){var u=ve(f=>t=f,o.ref);typeof u=="function"&&u(c)},get style(){return{transform:`translate${l()?"X":"Y"}(${s()}px)`,color:"red"}}},i))}function xd(e){const t=Or(),n=qn(),r=St(),[o,i]=B(),[s,a]=k(e,["onPointerEnter","onPointerLeave"]),l=u=>{oe(u,s.onPointerEnter),t.cancelLeaveTimer()},c=u=>{oe(u,s.onPointerLeave),t.startLeaveTimer()};return U(Ce(n.value,u=>{ao(()=>{if(!u||u.includes("link-trigger-")){t.setPreviousMenu(void 0);return}if(u===r.value()){if(t.previousMenu()!=null){const g=[...n.menus()],p=g.indexOf(t.previousMenu()),v=g.indexOf(u);p<v?i("from-end"):i("from-start")}else i(void 0);t.setPreviousMenu(u);return}const f=[...n.menus()],d=f.indexOf(t.previousMenu()),h=f.indexOf(u);d>h?i("to-end"):i("to-start")})})),b(yy,A({as:"ul",onPointerEnter:l,onPointerLeave:c,onInteractOutside:()=>{t.setAutoFocusMenu(!1)},get"data-motion"(){return o()}},a))}function Cd(e){return(()=>{var t=Sd();return fe(t,b(Sy,A({as:"a"},e))),t})()}function Ed(e){const t=qn(),n=Or(),[r,o]=k(e,["value"]),i=Ee(),s=t.generateId(`navigation-menu-menu-${i}`),a=Z({id:s},o),l=()=>r.value??i,[c,u]=B(!1),f=()=>{var d,h;t.value()!==l()&&u(!1),(d=n.viewportRef())==null||d.removeEventListener("animationend",f),(h=n.viewportRef())==null||h.removeEventListener("animationcancel",f)};return U(Ce(t.value,d=>{if(d===l())u(!0);else{const h=n.viewportRef();if(!h||["","none"].includes(window.getComputedStyle(h).animationName)){u(!1);return}h.addEventListener("animationend",f)}})),b(bd,A({get forceMount(){return c()},get value(){return l()}},a))}function Rd(e){const t=Or(),n=At(),[r,o]=k(e,["ref"]);return b(Se,{get when(){return t.viewportPresent()},get children(){return b(Ry,A({ref(i){var s=ve(a=>{a&&a.setAttribute("role","presentation")},r.ref);typeof s=="function"&&s(i)},get mount(){return K(()=>n.parentMenuContext()==null)()?t.viewportRef():void 0}},o))}})}function Pd(e){const t=Z({delayDuration:200,skipDelayDuration:300},e),[n,r,o]=k(t,["ref","delayDuration","skipDelayDuration","autoFocusMenu","onAutoFocusMenuChange","defaultValue","value","onValueChange","forceMount"],["getAnchorRect","placement","gutter","shift","flip","slide","overlap","sameWidth","fitViewport","hideWhenDetached","detachedPadding","arrowPadding","overflowPadding"]),[i,s]=pt({value:()=>n.value,defaultValue:()=>n.defaultValue,onChange:T=>{var V;return(V=n.onValueChange)==null?void 0:V.call(n,T)}}),[a,l]=pt({value:()=>n.autoFocusMenu,defaultValue:()=>!1,onChange:n.onAutoFocusMenuChange}),[c,u]=B(),[f,d]=B(),[h,g]=B(r.placement??o.orientation==="vertical"?"right":"bottom");U(()=>{g(o.orientation==="vertical"?"right":"bottom")});let p;const[v,w]=B(),[m,y]=B(!1),[x,C]=B(!1);U(()=>{i()&&!i().includes("link-trigger-")&&a()?ao(()=>{C(!0),y(!0)}):(C(!1),y(!1))});const O=K(()=>({"data-expanded":x()?"":void 0,"data-closed":x()?void 0:""})),{present:L}=wr({show:()=>n.forceMount||m()||x(),element:()=>c()??null});U(()=>{L()||_.setPreviousMenu(void 0)});const _={dataset:O,delayDuration:()=>n.delayDuration,skipDelayDuration:()=>n.skipDelayDuration,autoFocusMenu:a,setAutoFocusMenu:l,startLeaveTimer:()=>{p=window.setTimeout(()=>{_.setAutoFocusMenu(!1),s(void 0)},_.skipDelayDuration())},cancelLeaveTimer:()=>{p&&clearTimeout(p)},rootRef:f,setRootRef:d,viewportRef:c,setViewportRef:u,viewportPresent:L,currentPlacement:h,previousMenu:v,setPreviousMenu:w};return b(hd.Provider,{value:_,get children(){return b(wo,A({anchorRef:f,contentRef:c,get placement(){return h()},onCurrentPlacementChange:g},r,{get children(){var T=jy();return fe(T,b(ky,A({as:"ul",ref(V){var N=ve(_.setRootRef,n.ref);typeof N=="function"&&N(V)},get value(){return i()??null},onValueChange:s,get autoFocusMenu(){return a()},onAutoFocusMenuChange:l},o))),T}}))}})}function Id(e){const t=Or(),n=bo(),[r,o]=k(e,["onPointerEnter","onPointerLeave","onClick"]);let i;const s=c=>{oe(c,r.onClick),i&&clearTimeout(i)},a=c=>{oe(c,r.onPointerEnter),c.pointerType!=="touch"&&(t.cancelLeaveTimer(),t.dataset()["data-expanded"]!==""&&(i=window.setTimeout(()=>{var u;(u=n==null?void 0:n.triggerRef())==null||u.focus(),setTimeout(()=>{t.setAutoFocusMenu(!0)})},t.delayDuration())))},l=c=>{oe(c,r.onPointerLeave),c.pointerType!=="touch"&&(t.startLeaveTimer(),i&&clearTimeout(i))};return(()=>{var c=Sd();return fe(c,b(Vy,A({onClick:s,onPointerEnter:a,onPointerLeave:l},o))),c})()}function Md(e){const t=Or(),n=qn(),[r,o]=B(),[i,s]=k(e,["ref","style","onEscapeKeyDown"]),a=()=>{n.setAutoFocusMenu(!1),n.closeMenu()},l=d=>{a()},c=Wm(r);U(Ce(()=>n.value()?n.menuRefMap().get(n.value()):void 0,d=>{d===void 0||d[0]===void 0||o(d[0])}));const u=K(d=>{if(!(r()===void 0||!t.viewportPresent()))return c.height()===0?d:c.height()}),f=K(d=>{if(!(r()===void 0||!t.viewportPresent()))return c.width()===0?d:c.width()});return b(Se,{get when(){return t.viewportPresent()},get children(){return b(wo.Positioner,{role:"presentation",get children(){return b(Rs,A({as:"li",ref(d){var h=ve(t.setViewportRef,i.ref);typeof h=="function"&&h(d)},get excludedElements(){return[t.rootRef]},bypassTopMostLayerCheck:!0,get style(){return vt({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)","--kb-navigation-menu-viewport-height":u()?`${u()}px`:void 0,"--kb-navigation-menu-viewport-width":f()?`${f()}px`:void 0,position:"relative"},i.style)},get onEscapeKeyDown(){return be([i.onEscapeKeyDown,l])},onDismiss:a,get"data-orientation"(){return n.orientation()}},()=>t.dataset(),s))}})}})}Object.assign(Pd,{Arrow:By,CheckboxItem:vy,Content:xd,Group:md,GroupLabel:by,Icon:vd,Item:Cd,ItemDescription:xy,ItemIndicator:Cy,ItemLabel:Ey,Portal:Rd,RadioGroup:Iy,RadioItem:My,Menu:Ed,Separator:Us,Sub:$y,SubContent:Ty,SubTrigger:Ly,Trigger:Id,Viewport:Md});var zy=he('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class="relative top-px ml-1 size-3 transition duration-200 group-data-[expanded]/trigger:rotate-180 group-data-[orientation=vertical]/menu:-rotate-90 group-data-[orientation=vertical]/menu:group-data-[expanded]/trigger:rotate-90"><path d="M6 9l6 6l6 -6">');const Fl=Ed,Al=e=>{const[t,n]=k(e,["class","children"]);return b(Pd,A({gutter:6,get class(){return de("group/menu flex w-max flex-1 list-none items-center justify-center data-[orientation=vertical]:flex-col [&>li]:w-full",t.class)}},n,{get children(){return[K(()=>t.children),b(Gy,{})]}}))},$l=e=>{const[t,n]=k(e,["class"]);return b(Id,A({get class(){return de("group/trigger inline-flex h-10 w-full items-center justify-center whitespace-nowrap rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[expanded]:bg-accent/50",t.class)}},n))},Ol=()=>b(vd,{"aria-hidden":"true",get children(){return zy()}}),Gy=e=>{const[t,n]=k(e,["class"]);return b(Md,A({get class(){return de("pointer-events-none z-[1000] flex h-[var(--kb-navigation-menu-viewport-height)] w-[var(--kb-navigation-menu-viewport-width)] origin-[var(--kb-menu-content-transform-origin)] items-center justify-center overflow-x-clip overflow-y-visible rounded-md border bg-popover opacity-0 shadow-lg data-[expanded]:pointer-events-auto data-[orientation=vertical]:overflow-y-clip data-[orientation=vertical]:overflow-x-visible data-[expanded]:rounded-md","animate-content-hide transition-[width,height] duration-200 ease-in data-[expanded]:animate-content-show data-[expanded]:opacity-100 data-[expanded]:ease-out",t.class)}},n))},Tl=e=>{const[t,n]=k(e,["class"]);return b(Rd,{get children(){return b(xd,A({get class(){return de("pointer-events-none absolute left-0 top-0 box-border p-1 focus:outline-none data-[expanded]:pointer-events-auto","data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out","data-[orientation=horizontal]:data-[motion=from-start]:slide-in-from-left-52 data-[orientation=horizontal]:data-[motion=to-end]:slide-out-to-right-52","data-[orientation=horizontal]:data-[motion=from-end]:slide-in-from-right-52 data-[orientation=horizontal]:data-[motion=to-start]:slide-out-to-left-52","data-[orientation=vertical]:data-[motion=from-start]:slide-in-from-top-52 data-[orientation=vertical]:data-[motion=to-end]:slide-out-to-bottom-52","data-[orientation=vertical]:data-[motion=from-end]:slide-in-from-bottom-52 data-[orientation=vertical]:data-[motion=to-start]:slide-out-to-bottom-52",t.class)}},n))}})},Dl=e=>{const[t,n]=k(e,["class"]);return b(Cd,A({get class(){return de("text-sm block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",t.class)}},n))};/**
7
7
  * table-core
8
8
  *
9
9
  * Copyright (c) TanStack
@@ -12,10 +12,10 @@ var of=Object.defineProperty;var ba=e=>{throw TypeError(e)};var sf=(e,t,n)=>t in
12
12
  * LICENSE.md file in the root directory of this source tree.
13
13
  *
14
14
  * @license MIT
15
- */function Bt(e,t){return typeof e=="function"?e(t):e}function qe(e,t){return n=>{t.setState(r=>({...r,[e]:Bt(n,r[e])}))}}function So(e){return e instanceof Function}function Hy(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Uy(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function Q(e,t,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((c,d)=>r[d]!==c)))return o;r=a;let l;if(n.key&&n.debug&&(l=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const c=Math.round((Date.now()-s)*100)/100,d=Math.round((Date.now()-l)*100)/100,f=d/16,h=(g,p)=>{for(g=String(g);g.length<p;)g=" "+g;return g};console.info(`%c⏱ ${h(d,5)} /${h(c,5)} ms`,`
15
+ */function Bt(e,t){return typeof e=="function"?e(t):e}function qe(e,t){return n=>{t.setState(r=>({...r,[e]:Bt(n,r[e])}))}}function So(e){return e instanceof Function}function Hy(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Uy(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function Q(e,t,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((u,f)=>r[f]!==u)))return o;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-s)*100)/100,f=Math.round((Date.now()-c)*100)/100,d=f/16,h=(g,p)=>{for(g=String(g);g.length<p;)g=" "+g;return g};console.info(`%c⏱ ${h(f,5)} /${h(u,5)} ms`,`
16
16
  font-size: .6rem;
17
17
  font-weight: bold;
18
- color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function Y(e,t,n,r){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:!1,onChange:r}}function qy(e,t,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:Q(()=>[e,n,t,i],(s,a,u,l)=>({table:s,column:a,row:u,cell:l,getValue:l.getValue,renderValue:l.renderValue}),Y(e.options,"debugCells"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}function Wy(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},u=a.accessorKey;let l=(o=(i=a.id)!=null?i:u?typeof String.prototype.replaceAll=="function"?u.replaceAll(".","_"):u.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,c;if(a.accessorFn?c=a.accessorFn:u&&(u.includes(".")?c=f=>{let h=f;for(const p of u.split(".")){var g;h=(g=h)==null?void 0:g[p]}return h}:c=f=>f[a.accessorKey]),!l)throw new Error;let d={id:`${String(l)}`,accessorFn:c,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:Q(()=>[!0],()=>{var f;return[d,...(f=d.columns)==null?void 0:f.flatMap(h=>h.getFlatColumns())]},Y(e.options,"debugColumns")),getLeafColumns:Q(()=>[e._getOrderColumnsFn()],f=>{var h;if((h=d.columns)!=null&&h.length){let g=d.columns.flatMap(p=>p.getLeafColumns());return f(g)}return[d]},Y(e.options,"debugColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(d,e);return d}const $e="debugHeaders";function Ll(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(a),s.push(u)};return a(i),s},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const Xy={createTable:e=>{e.getHeaderGroups=Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const a=(i=r==null?void 0:r.map(d=>n.find(f=>f.id===d)).filter(Boolean))!=null?i:[],u=(s=o==null?void 0:o.map(d=>n.find(f=>f.id===d)).filter(Boolean))!=null?s:[],l=n.filter(d=>!(r!=null&&r.includes(d.id))&&!(o!=null&&o.includes(d.id)));return zr(t,[...a,...l,...u],e)},Y(e.options,$e)),e.getCenterHeaderGroups=Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),zr(t,n,e,"center")),Y(e.options,$e)),e.getLeftHeaderGroups=Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return zr(t,i,e,"left")},Y(e.options,$e)),e.getRightHeaderGroups=Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return zr(t,i,e,"right")},Y(e.options,$e)),e.getFooterGroups=Q(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Y(e.options,$e)),e.getLeftFooterGroups=Q(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Y(e.options,$e)),e.getCenterFooterGroups=Q(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Y(e.options,$e)),e.getRightFooterGroups=Q(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Y(e.options,$e)),e.getFlatHeaders=Q(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Y(e.options,$e)),e.getLeftFlatHeaders=Q(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Y(e.options,$e)),e.getCenterFlatHeaders=Q(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Y(e.options,$e)),e.getRightFlatHeaders=Q(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Y(e.options,$e)),e.getCenterLeafHeaders=Q(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Y(e.options,$e)),e.getLeftLeafHeaders=Q(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Y(e.options,$e)),e.getRightLeafHeaders=Q(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Y(e.options,$e)),e.getLeafHeaders=Q(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,u,l;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(u=(l=r[0])==null?void 0:l.headers)!=null?u:[]].map(c=>c.getLeafHeaders()).flat()},Y(e.options,$e))}};function zr(e,t,n,r){var o,i;let s=0;const a=function(f,h){h===void 0&&(h=1),s=Math.max(s,h),f.filter(g=>g.getIsVisible()).forEach(g=>{var p;(p=g.columns)!=null&&p.length&&a(g.columns,h+1)},0)};a(e);let u=[];const l=(f,h)=>{const g={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},p=[];f.forEach(v=>{const w=[...p].reverse()[0],m=v.column.depth===g.depth;let y,x=!1;if(m&&v.column.parent?y=v.column.parent:(y=v.column,x=!0),w&&(w==null?void 0:w.column)===y)w.subHeaders.push(v);else{const C=Ll(n,y,{id:[r,h,y.id,v==null?void 0:v.id].filter(Boolean).join("_"),isPlaceholder:x,placeholderId:x?`${p.filter(O=>O.column===y).length}`:void 0,depth:h,index:p.length});C.subHeaders.push(v),p.push(C)}g.headers.push(v),v.headerGroup=g}),u.push(g),h>0&&l(p,h-1)},c=t.map((f,h)=>Ll(n,f,{depth:s,index:h}));l(c,s-1),u.reverse();const d=f=>f.filter(g=>g.column.getIsVisible()).map(g=>{let p=0,v=0,w=[0];g.subHeaders&&g.subHeaders.length?(w=[],d(g.subHeaders).forEach(y=>{let{colSpan:x,rowSpan:C}=y;p+=x,w.push(C)})):p=1;const m=Math.min(...w);return v=v+m,g.colSpan=p,g.rowSpan=v,{colSpan:p,rowSpan:v}});return d((o=(i=u[0])==null?void 0:i.headers)!=null?o:[]),u}const qs=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:u=>{if(a._valuesCache.hasOwnProperty(u))return a._valuesCache[u];const l=e.getColumn(u);if(l!=null&&l.accessorFn)return a._valuesCache[u]=l.accessorFn(a.original,r),a._valuesCache[u]},getUniqueValues:u=>{if(a._uniqueValuesCache.hasOwnProperty(u))return a._uniqueValuesCache[u];const l=e.getColumn(u);if(l!=null&&l.accessorFn)return l.columnDef.getUniqueValues?(a._uniqueValuesCache[u]=l.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[u]):(a._uniqueValuesCache[u]=[a.getValue(u)],a._uniqueValuesCache[u])},renderValue:u=>{var l;return(l=a.getValue(u))!=null?l:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Uy(a.subRows,u=>u.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let u=[],l=a;for(;;){const c=l.getParentRow();if(!c)break;u.push(c),l=c}return u.reverse()},getAllCells:Q(()=>[e.getAllLeafColumns()],u=>u.map(l=>qy(e,a,l,l.id)),Y(e.options,"debugRows")),_getAllCellsByColumnId:Q(()=>[a.getAllCells()],u=>u.reduce((l,c)=>(l[c.column.id]=c,l),{}),Y(e.options,"debugRows"))};for(let u=0;u<e._features.length;u++){const l=e._features[u];l==null||l.createRow==null||l.createRow(a,e)}return a},Qy={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Fd=(e,t,n)=>{var r,o;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};Fd.autoRemove=e=>ot(e);const Ad=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};Ad.autoRemove=e=>ot(e);const $d=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};$d.autoRemove=e=>ot(e);const Od=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};Od.autoRemove=e=>ot(e)||!(e!=null&&e.length);const Td=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});Td.autoRemove=e=>ot(e)||!(e!=null&&e.length);const Dd=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});Dd.autoRemove=e=>ot(e)||!(e!=null&&e.length);const Ld=(e,t,n)=>e.getValue(t)===n;Ld.autoRemove=e=>ot(e);const _d=(e,t,n)=>e.getValue(t)==n;_d.autoRemove=e=>ot(e);const Ws=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};Ws.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const a=i;i=s,s=a}return[i,s]};Ws.autoRemove=e=>ot(e)||ot(e[0])&&ot(e[1]);const Et={includesString:Fd,includesStringSensitive:Ad,equalsString:$d,arrIncludes:Od,arrIncludesAll:Td,arrIncludesSome:Dd,equals:Ld,weakEquals:_d,inNumberRange:Ws};function ot(e){return e==null||e===""}const Yy={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:qe("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?Et.includesString:typeof r=="number"?Et.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Et.equals:Array.isArray(r)?Et.arrIncludes:Et.weakEquals},e.getFilterFn=()=>{var n,r;return So(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:Et[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r==null?void 0:r.find(c=>c.id===e.id),s=Bt(n,i?i.value:void 0);if(_l(o,s,e)){var a;return(a=r==null?void 0:r.filter(c=>c.id!==e.id))!=null?a:[]}const u={id:e.id,value:s};if(i){var l;return(l=r==null?void 0:r.map(c=>c.id===e.id?u:c))!=null?l:[]}return r!=null&&r.length?[...r,u]:[u]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=Bt(t,o))==null?void 0:i.filter(s=>{const a=n.find(u=>u.id===s.id);if(a){const u=a.getFilterFn();if(_l(u,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function _l(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Zy=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),Jy=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},ew=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},tw=(e,t,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o<s&&(o=s)))}),[r,o]},nw=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},rw=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!Hy(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},ow=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),iw=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,sw=(e,t)=>t.length,Vo={sum:Zy,min:Jy,max:ew,extent:tw,mean:nw,median:rw,unique:ow,uniqueCount:iw,count:sw},aw={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:qe("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return Vo.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Vo.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return So(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:Vo[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function lw(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(s=>s.id===i)).filter(Boolean),...r]}const uw={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:qe("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Q(n=>[cr(t,n)],n=>n.findIndex(r=>r.id===e.id),Y(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=cr(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=cr(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=Q(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const s=[...t],a=[...o];for(;a.length&&s.length;){const u=s.shift(),l=a.findIndex(c=>c.id===u);l>-1&&i.push(a.splice(l,1)[0])}i=[...i,...a]}return lw(i,n,r)},Y(e.options,"debugTable"))}},No=()=>({left:[],right:[]}),cw={getInitialState:e=>({columnPinning:No(),...e}),getDefaultOptions:e=>({onColumnPinningChange:qe("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,s;if(n==="right"){var a,u;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(d=>!(r!=null&&r.includes(d))),right:[...((u=o==null?void 0:o.right)!=null?u:[]).filter(d=>!(r!=null&&r.includes(d))),...r]}}if(n==="left"){var l,c;return{left:[...((l=o==null?void 0:o.left)!=null?l:[]).filter(d=>!(r!=null&&r.includes(d))),...r],right:((c=o==null?void 0:o.right)!=null?c:[]).filter(d=>!(r!=null&&r.includes(d)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(d=>!(r!=null&&r.includes(d))),right:((s=o==null?void 0:o.right)!=null?s:[]).filter(d=>!(r!=null&&r.includes(d)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Q(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},Y(t.options,"debugRows")),e.getLeftVisibleCells=Q(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),Y(t.options,"debugRows")),e.getRightVisibleCells=Q(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),Y(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?No():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:No())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=Q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Y(e.options,"debugColumns")),e.getRightLeafColumns=Q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Y(e.options,"debugColumns")),e.getCenterLeafColumns=Q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},Y(e.options,"debugColumns"))}},Gr={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Ko=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),dw={getDefaultColumnDef:()=>Gr,getInitialState:e=>({columnSizing:{},columnSizingInfo:Ko(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:qe("columnSizing",e),onColumnSizingInfoChange:qe("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Gr.minSize,(r=i??e.columnDef.size)!=null?r:Gr.size),(o=e.columnDef.maxSize)!=null?o:Gr.maxSize)},e.getStart=Q(n=>[n,cr(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),Y(t.options,"debugColumns")),e.getAfter=Q(n=>[n,cr(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),Y(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),jo(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],u=jo(i)?Math.round(i.touches[0].clientX):i.clientX,l={},c=(w,m)=>{typeof m=="number"&&(t.setColumnSizingInfo(y=>{var x,C;const O=t.options.columnResizeDirection==="rtl"?-1:1,L=(m-((x=y==null?void 0:y.startOffset)!=null?x:0))*O,_=Math.max(L/((C=y==null?void 0:y.startSize)!=null?C:0),-.999999);return y.columnSizingStart.forEach(T=>{let[V,N]=T;l[V]=Math.round(Math.max(N+N*_,0)*100)/100}),{...y,deltaOffset:L,deltaPercentage:_}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(y=>({...y,...l})))},d=w=>c("move",w),f=w=>{c("end",w),t.setColumnSizingInfo(m=>({...m,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=n||typeof document<"u"?document:null,g={moveHandler:w=>d(w.clientX),upHandler:w=>{h==null||h.removeEventListener("mousemove",g.moveHandler),h==null||h.removeEventListener("mouseup",g.upHandler),f(w.clientX)}},p={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),d(w.touches[0].clientX),!1),upHandler:w=>{var m;h==null||h.removeEventListener("touchmove",p.moveHandler),h==null||h.removeEventListener("touchend",p.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),f((m=w.touches[0])==null?void 0:m.clientX)}},v=fw()?{passive:!1}:!1;jo(i)?(h==null||h.addEventListener("touchmove",p.moveHandler,v),h==null||h.addEventListener("touchend",p.upHandler,v)):(h==null||h.addEventListener("mousemove",g.moveHandler,v),h==null||h.addEventListener("mouseup",g.upHandler,v)),t.setColumnSizingInfo(w=>({...w,startOffset:u,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Ko():(n=e.initialState.columnSizingInfo)!=null?n:Ko())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Hr=null;function fw(){if(typeof Hr=="boolean")return Hr;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Hr=e,Hr}function jo(e){return e.type==="touchstart"}const hw={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:qe("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(i=>i.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Q(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Y(t.options,"debugRows")),e.getVisibleCells=Q(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],Y(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>Q(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),Y(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function cr(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const gw={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},pw={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:qe("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Et.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return So(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Et[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},mw={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:qe("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(o=n)!=null?o:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:a,...u}=s;return u}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},Hi=0,Ui=10,Bo=()=>({pageIndex:Hi,pageSize:Ui}),vw={getInitialState:e=>({...e,pagination:{...Bo(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:qe("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=i=>Bt(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Bo():(o=e.initialState.pagination)!=null?o:Bo())},e.setPageIndex=r=>{e.setPagination(o=>{let i=Bt(r,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?Hi:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:Hi)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?Ui:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:Ui)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,Bt(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let s=Bt(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=Q(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},Y(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},zo=()=>({top:[],bottom:[]}),yw={getInitialState:e=>({rowPinning:zo(),...e}),getDefaultOptions:e=>({onRowPinningChange:qe("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(u=>{let{id:l}=u;return l}):[],s=o?e.getParentRows().map(u=>{let{id:l}=u;return l}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(u=>{var l,c;if(n==="bottom"){var d,f;return{top:((d=u==null?void 0:u.top)!=null?d:[]).filter(p=>!(a!=null&&a.has(p))),bottom:[...((f=u==null?void 0:u.bottom)!=null?f:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)]}}if(n==="top"){var h,g;return{top:[...((h=u==null?void 0:u.top)!=null?h:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)],bottom:((g=u==null?void 0:u.bottom)!=null?g:[]).filter(p=>!(a!=null&&a.has(p)))}}return{top:((l=u==null?void 0:u.top)!=null?l:[]).filter(p=>!(a!=null&&a.has(p))),bottom:((c=u==null?void 0:u.bottom)!=null?c:[]).filter(p=>!(a!=null&&a.has(p)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i==null?void 0:i.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?zo():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:zo())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>t.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},e.getTopRows=Q(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Y(e.options,"debugRows")),e.getBottomRows=Q(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Y(e.options,"debugRows")),e.getCenterRows=Q(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},Y(e.options,"debugRows"))}},ww={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:qe("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{qi(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Q(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Go(e,n):{rows:[],flatRows:[],rowsById:{}},Y(e.options,"debugTable")),e.getFilteredSelectedRowModel=Q(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Go(e,n):{rows:[],flatRows:[],rowsById:{}},Y(e.options,"debugTable")),e.getGroupedSelectedRowModel=Q(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Go(e,n):{rows:[],flatRows:[],rowsById:{}},Y(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var s;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const a={...i};return qi(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Xs(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Wi(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Wi(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},qi=(e,t,n,r,o)=>{var i;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>qi(e,a.id,n,r,o))};function Go(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(u=>{var l;const c=Xs(u,n);if(c&&(r.push(u),o[u.id]=u),(l=u.subRows)!=null&&l.length&&(u={...u,subRows:i(u.subRows)}),c)return u}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function Xs(e,t){var n;return(n=t[e.id])!=null?n:!1}function Wi(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(Xs(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=Wi(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const Xi=/([0-9]+)/gm,bw=(e,t,n)=>kd(Wt(e.getValue(n)).toLowerCase(),Wt(t.getValue(n)).toLowerCase()),Sw=(e,t,n)=>kd(Wt(e.getValue(n)),Wt(t.getValue(n))),xw=(e,t,n)=>Qs(Wt(e.getValue(n)).toLowerCase(),Wt(t.getValue(n)).toLowerCase()),Cw=(e,t,n)=>Qs(Wt(e.getValue(n)),Wt(t.getValue(n))),Ew=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},Rw=(e,t,n)=>Qs(e.getValue(n),t.getValue(n));function Qs(e,t){return e===t?0:e>t?1:-1}function Wt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function kd(e,t){const n=e.split(Xi).filter(Boolean),r=t.split(Xi).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),a=parseInt(i,10),u=[s,a].sort();if(isNaN(u[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(u[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const tr={alphanumeric:bw,alphanumericCaseSensitive:Sw,text:xw,textCaseSensitive:Cw,datetime:Ew,basic:Rw},Pw={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:qe("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return tr.datetime;if(typeof i=="string"&&(r=!0,i.split(Xi).length>1))return tr.alphanumeric}return r?tr.text:tr.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return So(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:tr[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s==null?void 0:s.find(h=>h.id===e.id),u=s==null?void 0:s.findIndex(h=>h.id===e.id);let l=[],c,d=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?c="toggle":c="add":s!=null&&s.length&&u!==s.length-1?c="replace":a?c="toggle":c="replace",c==="toggle"&&(i||o||(c="remove")),c==="add"){var f;l=[...s,{id:e.id,desc:d}],l.splice(0,l.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else c==="toggle"?l=s.map(h=>h.id===e.id?{...h,desc:d}:h):c==="remove"?l=s.filter(h=>h.id!==e.id):l=[{id:e.id,desc:d}];return l})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Iw=[Xy,hw,uw,cw,Qy,Yy,gw,pw,Pw,aw,mw,vw,yw,ww,dw];function Mw(e){var t,n;const r=[...Iw,...(t=e._features)!=null?t:[]];let o={_features:r};const i=o._features.reduce((f,h)=>Object.assign(f,h.getDefaultOptions==null?void 0:h.getDefaultOptions(o)),{}),s=f=>o.options.mergeOptions?o.options.mergeOptions(i,f):{...i,...f};let u={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(f=>{var h;u=(h=f.getInitialState==null?void 0:f.getInitialState(u))!=null?h:u});const l=[];let c=!1;const d={_features:r,options:{...i,...e},initialState:u,_queue:f=>{l.push(f),c||(c=!0,Promise.resolve().then(()=>{for(;l.length;)l.shift()();c=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{o.setState(o.initialState)},setOptions:f=>{const h=Bt(f,o.options);o.options=s(h)},getState:()=>o.options.state,setState:f=>{o.options.onStateChange==null||o.options.onStateChange(f)},_getRowId:(f,h,g)=>{var p;return(p=o.options.getRowId==null?void 0:o.options.getRowId(f,h,g))!=null?p:`${g?[g.id,h].join("."):h}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(f,h)=>{let g=(h?o.getPrePaginationRowModel():o.getRowModel()).rowsById[f];if(!g&&(g=o.getCoreRowModel().rowsById[f],!g))throw new Error;return g},_getDefaultColumnDef:Q(()=>[o.options.defaultColumn],f=>{var h;return f=(h=f)!=null?h:{},{header:g=>{const p=g.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:g=>{var p,v;return(p=(v=g.renderValue())==null||v.toString==null?void 0:v.toString())!=null?p:null},...o._features.reduce((g,p)=>Object.assign(g,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...f}},Y(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:Q(()=>[o._getColumnDefs()],f=>{const h=function(g,p,v){return v===void 0&&(v=0),g.map(w=>{const m=Wy(o,w,v,p),y=w;return m.columns=y.columns?h(y.columns,m,v+1):[],m})};return h(f)},Y(e,"debugColumns")),getAllFlatColumns:Q(()=>[o.getAllColumns()],f=>f.flatMap(h=>h.getFlatColumns()),Y(e,"debugColumns")),_getAllFlatColumnsById:Q(()=>[o.getAllFlatColumns()],f=>f.reduce((h,g)=>(h[g.id]=g,h),{}),Y(e,"debugColumns")),getAllLeafColumns:Q(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(f,h)=>{let g=f.flatMap(p=>p.getLeafColumns());return h(g)},Y(e,"debugColumns")),getColumn:f=>o._getAllFlatColumnsById()[f]};Object.assign(o,d);for(let f=0;f<o._features.length;f++){const h=o._features[f];h==null||h.createTable==null||h.createTable(o)}return o}function Fw(){return e=>Q(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let l=0;l<o.length;l++){const c=qs(e,e._getRowId(o[l],l,s),o[l],l,i,void 0,s==null?void 0:s.id);if(n.flatRows.push(c),n.rowsById[c.id]=c,a.push(c),e.options.getSubRows){var u;c.originalSubRows=e.options.getSubRows(o[l],l),(u=c.originalSubRows)!=null&&u.length&&(c.subRows=r(c.originalSubRows,i+1,c))}}return a};return n.rows=r(t),n},Y(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Aw(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function $w(e,t,n){return n.options.filterFromLeafRows?Ow(e,t,n):Tw(e,t,n)}function Ow(e,t,n){var r;const o=[],i={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(u,l){l===void 0&&(l=0);const c=[];for(let f=0;f<u.length;f++){var d;let h=u[f];const g=qs(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);if(g.columnFilters=h.columnFilters,(d=h.subRows)!=null&&d.length&&l<s){if(g.subRows=a(h.subRows,l+1),h=g,t(h)&&!g.subRows.length){c.push(h),i[h.id]=h,o.push(h);continue}if(t(h)||g.subRows.length){c.push(h),i[h.id]=h,o.push(h);continue}}else h=g,t(h)&&(c.push(h),i[h.id]=h,o.push(h))}return c};return{rows:a(e),flatRows:o,rowsById:i}}function Tw(e,t,n){var r;const o=[],i={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(u,l){l===void 0&&(l=0);const c=[];for(let f=0;f<u.length;f++){let h=u[f];if(t(h)){var d;if((d=h.subRows)!=null&&d.length&&l<s){const p=qs(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);p.subRows=a(h.subRows,l+1),h=p}c.push(h),o.push(h),i[h.id]=h}}return c};return{rows:a(e),flatRows:o,rowsById:i}}function Dw(){return e=>Q(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let f=0;f<t.flatRows.length;f++)t.flatRows[f].columnFilters={},t.flatRows[f].columnFiltersMeta={};return t}const o=[],i=[];(n??[]).forEach(f=>{var h;const g=e.getColumn(f.id);if(!g)return;const p=g.getFilterFn();p&&o.push({id:f.id,filterFn:p,resolvedValue:(h=p.resolveFilterValue==null?void 0:p.resolveFilterValue(f.value))!=null?h:f.value})});const s=(n??[]).map(f=>f.id),a=e.getGlobalFilterFn(),u=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());r&&a&&u.length&&(s.push("__global__"),u.forEach(f=>{var h;i.push({id:f.id,filterFn:a,resolvedValue:(h=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?h:r})}));let l,c;for(let f=0;f<t.flatRows.length;f++){const h=t.flatRows[f];if(h.columnFilters={},o.length)for(let g=0;g<o.length;g++){l=o[g];const p=l.id;h.columnFilters[p]=l.filterFn(h,p,l.resolvedValue,v=>{h.columnFiltersMeta[p]=v})}if(i.length){for(let g=0;g<i.length;g++){c=i[g];const p=c.id;if(c.filterFn(h,p,c.resolvedValue,v=>{h.columnFiltersMeta[p]=v})){h.columnFilters.__global__=!0;break}}h.columnFilters.__global__!==!0&&(h.columnFilters.__global__=!1)}}const d=f=>{for(let h=0;h<s.length;h++)if(f.columnFilters[s[h]]===!1)return!1;return!0};return $w(t.rows,d,e)},Y(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Lw(e){return t=>Q(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:i}=n;let{rows:s,flatRows:a,rowsById:u}=r;const l=o*i,c=l+o;s=s.slice(l,c);let d;t.options.paginateExpandedRows?d={rows:s,flatRows:a,rowsById:u}:d=Aw({rows:s,flatRows:a,rowsById:u}),d.flatRows=[];const f=h=>{d.flatRows.push(h),h.subRows.length&&h.subRows.forEach(f)};return d.rows.forEach(f),d},Y(t.options,"debugTable"))}/**
18
+ color: hsl(${Math.max(0,Math.min(120-120*d,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function Y(e,t,n,r){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:!1,onChange:r}}function qy(e,t,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:Q(()=>[e,n,t,i],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),Y(e.options,"debugCells"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}function Wy(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(o=(i=a.id)!=null?i:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=d=>{let h=d;for(const p of l.split(".")){var g;h=(g=h)==null?void 0:g[p]}return h}:u=d=>d[a.accessorKey]),!c)throw new Error;let f={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:Q(()=>[!0],()=>{var d;return[f,...(d=f.columns)==null?void 0:d.flatMap(h=>h.getFlatColumns())]},Y(e.options,"debugColumns")),getLeafColumns:Q(()=>[e._getOrderColumnsFn()],d=>{var h;if((h=f.columns)!=null&&h.length){let g=f.columns.flatMap(p=>p.getLeafColumns());return d(g)}return[f]},Y(e.options,"debugColumns"))};for(const d of e._features)d.createColumn==null||d.createColumn(f,e);return f}const $e="debugHeaders";function Ll(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(i),s},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const Xy={createTable:e=>{e.getHeaderGroups=Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const a=(i=r==null?void 0:r.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?i:[],l=(s=o==null?void 0:o.map(f=>n.find(d=>d.id===f)).filter(Boolean))!=null?s:[],c=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(o!=null&&o.includes(f.id)));return zr(t,[...a,...c,...l],e)},Y(e.options,$e)),e.getCenterHeaderGroups=Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),zr(t,n,e,"center")),Y(e.options,$e)),e.getLeftHeaderGroups=Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return zr(t,i,e,"left")},Y(e.options,$e)),e.getRightHeaderGroups=Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return zr(t,i,e,"right")},Y(e.options,$e)),e.getFooterGroups=Q(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Y(e.options,$e)),e.getLeftFooterGroups=Q(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Y(e.options,$e)),e.getCenterFooterGroups=Q(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Y(e.options,$e)),e.getRightFooterGroups=Q(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Y(e.options,$e)),e.getFlatHeaders=Q(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Y(e.options,$e)),e.getLeftFlatHeaders=Q(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Y(e.options,$e)),e.getCenterFlatHeaders=Q(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Y(e.options,$e)),e.getRightFlatHeaders=Q(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Y(e.options,$e)),e.getCenterLeafHeaders=Q(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Y(e.options,$e)),e.getLeftLeafHeaders=Q(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Y(e.options,$e)),e.getRightLeafHeaders=Q(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Y(e.options,$e)),e.getLeafHeaders=Q(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,l,c;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},Y(e.options,$e))}};function zr(e,t,n,r){var o,i;let s=0;const a=function(d,h){h===void 0&&(h=1),s=Math.max(s,h),d.filter(g=>g.getIsVisible()).forEach(g=>{var p;(p=g.columns)!=null&&p.length&&a(g.columns,h+1)},0)};a(e);let l=[];const c=(d,h)=>{const g={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},p=[];d.forEach(v=>{const w=[...p].reverse()[0],m=v.column.depth===g.depth;let y,x=!1;if(m&&v.column.parent?y=v.column.parent:(y=v.column,x=!0),w&&(w==null?void 0:w.column)===y)w.subHeaders.push(v);else{const C=Ll(n,y,{id:[r,h,y.id,v==null?void 0:v.id].filter(Boolean).join("_"),isPlaceholder:x,placeholderId:x?`${p.filter(O=>O.column===y).length}`:void 0,depth:h,index:p.length});C.subHeaders.push(v),p.push(C)}g.headers.push(v),v.headerGroup=g}),l.push(g),h>0&&c(p,h-1)},u=t.map((d,h)=>Ll(n,d,{depth:s,index:h}));c(u,s-1),l.reverse();const f=d=>d.filter(g=>g.column.getIsVisible()).map(g=>{let p=0,v=0,w=[0];g.subHeaders&&g.subHeaders.length?(w=[],f(g.subHeaders).forEach(y=>{let{colSpan:x,rowSpan:C}=y;p+=x,w.push(C)})):p=1;const m=Math.min(...w);return v=v+m,g.colSpan=p,g.rowSpan=v,{colSpan:p,rowSpan:v}});return f((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const qs=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Uy(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:Q(()=>[e.getAllLeafColumns()],l=>l.map(c=>qy(e,a,c,c.id)),Y(e.options,"debugRows")),_getAllCellsByColumnId:Q(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),Y(e.options,"debugRows"))};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(a,e)}return a},Qy={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Fd=(e,t,n)=>{var r,o;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};Fd.autoRemove=e=>ot(e);const Ad=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};Ad.autoRemove=e=>ot(e);const $d=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};$d.autoRemove=e=>ot(e);const Od=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};Od.autoRemove=e=>ot(e)||!(e!=null&&e.length);const Td=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});Td.autoRemove=e=>ot(e)||!(e!=null&&e.length);const Dd=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});Dd.autoRemove=e=>ot(e)||!(e!=null&&e.length);const Ld=(e,t,n)=>e.getValue(t)===n;Ld.autoRemove=e=>ot(e);const _d=(e,t,n)=>e.getValue(t)==n;_d.autoRemove=e=>ot(e);const Ws=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};Ws.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const a=i;i=s,s=a}return[i,s]};Ws.autoRemove=e=>ot(e)||ot(e[0])&&ot(e[1]);const Et={includesString:Fd,includesStringSensitive:Ad,equalsString:$d,arrIncludes:Od,arrIncludesAll:Td,arrIncludesSome:Dd,equals:Ld,weakEquals:_d,inNumberRange:Ws};function ot(e){return e==null||e===""}const Yy={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:qe("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?Et.includesString:typeof r=="number"?Et.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Et.equals:Array.isArray(r)?Et.arrIncludes:Et.weakEquals},e.getFilterFn=()=>{var n,r;return So(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:Et[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r==null?void 0:r.find(u=>u.id===e.id),s=Bt(n,i?i.value:void 0);if(_l(o,s,e)){var a;return(a=r==null?void 0:r.filter(u=>u.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(i){var c;return(c=r==null?void 0:r.map(u=>u.id===e.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=Bt(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(_l(l,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function _l(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Zy=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),Jy=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},ew=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},tw=(e,t,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o<s&&(o=s)))}),[r,o]},nw=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},rw=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!Hy(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},ow=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),iw=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,sw=(e,t)=>t.length,Vo={sum:Zy,min:Jy,max:ew,extent:tw,mean:nw,median:rw,unique:ow,uniqueCount:iw,count:sw},aw={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:qe("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return Vo.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Vo.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return So(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:Vo[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function lw(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(s=>s.id===i)).filter(Boolean),...r]}const uw={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:qe("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Q(n=>[cr(t,n)],n=>n.findIndex(r=>r.id===e.id),Y(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=cr(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=cr(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=Q(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const s=[...t],a=[...o];for(;a.length&&s.length;){const l=s.shift(),c=a.findIndex(u=>u.id===l);c>-1&&i.push(a.splice(c,1)[0])}i=[...i,...a]}return lw(i,n,r)},Y(e.options,"debugTable"))}},No=()=>({left:[],right:[]}),cw={getInitialState:e=>({columnPinning:No(),...e}),getDefaultOptions:e=>({onColumnPinningChange:qe("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,s;if(n==="right"){var a,l;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(f=>!(r!=null&&r.includes(f))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(f=>!(r!=null&&r.includes(f))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(f=>!(r!=null&&r.includes(f))),...r],right:((u=o==null?void 0:o.right)!=null?u:[]).filter(f=>!(r!=null&&r.includes(f)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(f=>!(r!=null&&r.includes(f))),right:((s=o==null?void 0:o.right)!=null?s:[]).filter(f=>!(r!=null&&r.includes(f)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Q(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},Y(t.options,"debugRows")),e.getLeftVisibleCells=Q(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),Y(t.options,"debugRows")),e.getRightVisibleCells=Q(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),Y(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?No():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:No())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=Q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Y(e.options,"debugColumns")),e.getRightLeafColumns=Q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Y(e.options,"debugColumns")),e.getCenterLeafColumns=Q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},Y(e.options,"debugColumns"))}},Gr={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Ko=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),dw={getDefaultColumnDef:()=>Gr,getInitialState:e=>({columnSizing:{},columnSizingInfo:Ko(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:qe("columnSizing",e),onColumnSizingInfoChange:qe("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Gr.minSize,(r=i??e.columnDef.size)!=null?r:Gr.size),(o=e.columnDef.maxSize)!=null?o:Gr.maxSize)},e.getStart=Q(n=>[n,cr(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),Y(t.options,"debugColumns")),e.getAfter=Q(n=>[n,cr(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),Y(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),jo(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],l=jo(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(w,m)=>{typeof m=="number"&&(t.setColumnSizingInfo(y=>{var x,C;const O=t.options.columnResizeDirection==="rtl"?-1:1,L=(m-((x=y==null?void 0:y.startOffset)!=null?x:0))*O,_=Math.max(L/((C=y==null?void 0:y.startSize)!=null?C:0),-.999999);return y.columnSizingStart.forEach(T=>{let[V,N]=T;c[V]=Math.round(Math.max(N+N*_,0)*100)/100}),{...y,deltaOffset:L,deltaPercentage:_}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(y=>({...y,...c})))},f=w=>u("move",w),d=w=>{u("end",w),t.setColumnSizingInfo(m=>({...m,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=n||typeof document<"u"?document:null,g={moveHandler:w=>f(w.clientX),upHandler:w=>{h==null||h.removeEventListener("mousemove",g.moveHandler),h==null||h.removeEventListener("mouseup",g.upHandler),d(w.clientX)}},p={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),f(w.touches[0].clientX),!1),upHandler:w=>{var m;h==null||h.removeEventListener("touchmove",p.moveHandler),h==null||h.removeEventListener("touchend",p.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),d((m=w.touches[0])==null?void 0:m.clientX)}},v=fw()?{passive:!1}:!1;jo(i)?(h==null||h.addEventListener("touchmove",p.moveHandler,v),h==null||h.addEventListener("touchend",p.upHandler,v)):(h==null||h.addEventListener("mousemove",g.moveHandler,v),h==null||h.addEventListener("mouseup",g.upHandler,v)),t.setColumnSizingInfo(w=>({...w,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Ko():(n=e.initialState.columnSizingInfo)!=null?n:Ko())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Hr=null;function fw(){if(typeof Hr=="boolean")return Hr;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Hr=e,Hr}function jo(e){return e.type==="touchstart"}const hw={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:qe("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(i=>i.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Q(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Y(t.options,"debugRows")),e.getVisibleCells=Q(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],Y(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>Q(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),Y(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function cr(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const gw={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},pw={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:qe("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Et.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return So(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Et[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},mw={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:qe("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(o=n)!=null?o:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:a,...l}=s;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},Hi=0,Ui=10,Bo=()=>({pageIndex:Hi,pageSize:Ui}),vw={getInitialState:e=>({...e,pagination:{...Bo(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:qe("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=i=>Bt(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Bo():(o=e.initialState.pagination)!=null?o:Bo())},e.setPageIndex=r=>{e.setPagination(o=>{let i=Bt(r,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?Hi:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:Hi)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?Ui:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:Ui)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,Bt(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let s=Bt(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=Q(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},Y(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},zo=()=>({top:[],bottom:[]}),yw={getInitialState:e=>({rowPinning:zo(),...e}),getDefaultOptions:e=>({onRowPinningChange:qe("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],s=o?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(l=>{var c,u;if(n==="bottom"){var f,d;return{top:((f=l==null?void 0:l.top)!=null?f:[]).filter(p=>!(a!=null&&a.has(p))),bottom:[...((d=l==null?void 0:l.bottom)!=null?d:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)]}}if(n==="top"){var h,g;return{top:[...((h=l==null?void 0:l.top)!=null?h:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)],bottom:((g=l==null?void 0:l.bottom)!=null?g:[]).filter(p=>!(a!=null&&a.has(p)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(p=>!(a!=null&&a.has(p))),bottom:((u=l==null?void 0:l.bottom)!=null?u:[]).filter(p=>!(a!=null&&a.has(p)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i==null?void 0:i.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?zo():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:zo())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>t.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},e.getTopRows=Q(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Y(e.options,"debugRows")),e.getBottomRows=Q(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Y(e.options,"debugRows")),e.getCenterRows=Q(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},Y(e.options,"debugRows"))}},ww={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:qe("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{qi(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Q(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Go(e,n):{rows:[],flatRows:[],rowsById:{}},Y(e.options,"debugTable")),e.getFilteredSelectedRowModel=Q(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Go(e,n):{rows:[],flatRows:[],rowsById:{}},Y(e.options,"debugTable")),e.getGroupedSelectedRowModel=Q(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Go(e,n):{rows:[],flatRows:[],rowsById:{}},Y(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var s;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const a={...i};return qi(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Xs(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Wi(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Wi(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},qi=(e,t,n,r,o)=>{var i;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>qi(e,a.id,n,r,o))};function Go(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var c;const u=Xs(l,n);if(u&&(r.push(l),o[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:i(l.subRows)}),u)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function Xs(e,t){var n;return(n=t[e.id])!=null?n:!1}function Wi(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(Xs(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=Wi(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const Xi=/([0-9]+)/gm,bw=(e,t,n)=>kd(Wt(e.getValue(n)).toLowerCase(),Wt(t.getValue(n)).toLowerCase()),Sw=(e,t,n)=>kd(Wt(e.getValue(n)),Wt(t.getValue(n))),xw=(e,t,n)=>Qs(Wt(e.getValue(n)).toLowerCase(),Wt(t.getValue(n)).toLowerCase()),Cw=(e,t,n)=>Qs(Wt(e.getValue(n)),Wt(t.getValue(n))),Ew=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},Rw=(e,t,n)=>Qs(e.getValue(n),t.getValue(n));function Qs(e,t){return e===t?0:e>t?1:-1}function Wt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function kd(e,t){const n=e.split(Xi).filter(Boolean),r=t.split(Xi).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),a=parseInt(i,10),l=[s,a].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const tr={alphanumeric:bw,alphanumericCaseSensitive:Sw,text:xw,textCaseSensitive:Cw,datetime:Ew,basic:Rw},Pw={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:qe("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return tr.datetime;if(typeof i=="string"&&(r=!0,i.split(Xi).length>1))return tr.alphanumeric}return r?tr.text:tr.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return So(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:tr[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s==null?void 0:s.find(h=>h.id===e.id),l=s==null?void 0:s.findIndex(h=>h.id===e.id);let c=[],u,f=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?u="toggle":u="add":s!=null&&s.length&&l!==s.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(i||o||(u="remove")),u==="add"){var d;c=[...s,{id:e.id,desc:f}],c.splice(0,c.length-((d=t.options.maxMultiSortColCount)!=null?d:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(h=>h.id===e.id?{...h,desc:f}:h):u==="remove"?c=s.filter(h=>h.id!==e.id):c=[{id:e.id,desc:f}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Iw=[Xy,hw,uw,cw,Qy,Yy,gw,pw,Pw,aw,mw,vw,yw,ww,dw];function Mw(e){var t,n;const r=[...Iw,...(t=e._features)!=null?t:[]];let o={_features:r};const i=o._features.reduce((d,h)=>Object.assign(d,h.getDefaultOptions==null?void 0:h.getDefaultOptions(o)),{}),s=d=>o.options.mergeOptions?o.options.mergeOptions(i,d):{...i,...d};let l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(d=>{var h;l=(h=d.getInitialState==null?void 0:d.getInitialState(l))!=null?h:l});const c=[];let u=!1;const f={_features:r,options:{...i,...e},initialState:l,_queue:d=>{c.push(d),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{o.setState(o.initialState)},setOptions:d=>{const h=Bt(d,o.options);o.options=s(h)},getState:()=>o.options.state,setState:d=>{o.options.onStateChange==null||o.options.onStateChange(d)},_getRowId:(d,h,g)=>{var p;return(p=o.options.getRowId==null?void 0:o.options.getRowId(d,h,g))!=null?p:`${g?[g.id,h].join("."):h}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(d,h)=>{let g=(h?o.getPrePaginationRowModel():o.getRowModel()).rowsById[d];if(!g&&(g=o.getCoreRowModel().rowsById[d],!g))throw new Error;return g},_getDefaultColumnDef:Q(()=>[o.options.defaultColumn],d=>{var h;return d=(h=d)!=null?h:{},{header:g=>{const p=g.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:g=>{var p,v;return(p=(v=g.renderValue())==null||v.toString==null?void 0:v.toString())!=null?p:null},...o._features.reduce((g,p)=>Object.assign(g,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...d}},Y(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:Q(()=>[o._getColumnDefs()],d=>{const h=function(g,p,v){return v===void 0&&(v=0),g.map(w=>{const m=Wy(o,w,v,p),y=w;return m.columns=y.columns?h(y.columns,m,v+1):[],m})};return h(d)},Y(e,"debugColumns")),getAllFlatColumns:Q(()=>[o.getAllColumns()],d=>d.flatMap(h=>h.getFlatColumns()),Y(e,"debugColumns")),_getAllFlatColumnsById:Q(()=>[o.getAllFlatColumns()],d=>d.reduce((h,g)=>(h[g.id]=g,h),{}),Y(e,"debugColumns")),getAllLeafColumns:Q(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(d,h)=>{let g=d.flatMap(p=>p.getLeafColumns());return h(g)},Y(e,"debugColumns")),getColumn:d=>o._getAllFlatColumnsById()[d]};Object.assign(o,f);for(let d=0;d<o._features.length;d++){const h=o._features[d];h==null||h.createTable==null||h.createTable(o)}return o}function Fw(){return e=>Q(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let c=0;c<o.length;c++){const u=qs(e,e._getRowId(o[c],c,s),o[c],c,i,void 0,s==null?void 0:s.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(o[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,i+1,u))}}return a};return n.rows=r(t),n},Y(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Aw(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function $w(e,t,n){return n.options.filterFromLeafRows?Ow(e,t,n):Tw(e,t,n)}function Ow(e,t,n){var r;const o=[],i={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(l,c){c===void 0&&(c=0);const u=[];for(let d=0;d<l.length;d++){var f;let h=l[d];const g=qs(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);if(g.columnFilters=h.columnFilters,(f=h.subRows)!=null&&f.length&&c<s){if(g.subRows=a(h.subRows,c+1),h=g,t(h)&&!g.subRows.length){u.push(h),i[h.id]=h,o.push(h);continue}if(t(h)||g.subRows.length){u.push(h),i[h.id]=h,o.push(h);continue}}else h=g,t(h)&&(u.push(h),i[h.id]=h,o.push(h))}return u};return{rows:a(e),flatRows:o,rowsById:i}}function Tw(e,t,n){var r;const o=[],i={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(l,c){c===void 0&&(c=0);const u=[];for(let d=0;d<l.length;d++){let h=l[d];if(t(h)){var f;if((f=h.subRows)!=null&&f.length&&c<s){const p=qs(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);p.subRows=a(h.subRows,c+1),h=p}u.push(h),o.push(h),i[h.id]=h}}return u};return{rows:a(e),flatRows:o,rowsById:i}}function Dw(){return e=>Q(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let d=0;d<t.flatRows.length;d++)t.flatRows[d].columnFilters={},t.flatRows[d].columnFiltersMeta={};return t}const o=[],i=[];(n??[]).forEach(d=>{var h;const g=e.getColumn(d.id);if(!g)return;const p=g.getFilterFn();p&&o.push({id:d.id,filterFn:p,resolvedValue:(h=p.resolveFilterValue==null?void 0:p.resolveFilterValue(d.value))!=null?h:d.value})});const s=(n??[]).map(d=>d.id),a=e.getGlobalFilterFn(),l=e.getAllLeafColumns().filter(d=>d.getCanGlobalFilter());r&&a&&l.length&&(s.push("__global__"),l.forEach(d=>{var h;i.push({id:d.id,filterFn:a,resolvedValue:(h=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?h:r})}));let c,u;for(let d=0;d<t.flatRows.length;d++){const h=t.flatRows[d];if(h.columnFilters={},o.length)for(let g=0;g<o.length;g++){c=o[g];const p=c.id;h.columnFilters[p]=c.filterFn(h,p,c.resolvedValue,v=>{h.columnFiltersMeta[p]=v})}if(i.length){for(let g=0;g<i.length;g++){u=i[g];const p=u.id;if(u.filterFn(h,p,u.resolvedValue,v=>{h.columnFiltersMeta[p]=v})){h.columnFilters.__global__=!0;break}}h.columnFilters.__global__!==!0&&(h.columnFilters.__global__=!1)}}const f=d=>{for(let h=0;h<s.length;h++)if(d.columnFilters[s[h]]===!1)return!1;return!0};return $w(t.rows,f,e)},Y(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Lw(e){return t=>Q(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:i}=n;let{rows:s,flatRows:a,rowsById:l}=r;const c=o*i,u=c+o;s=s.slice(c,u);let f;t.options.paginateExpandedRows?f={rows:s,flatRows:a,rowsById:l}:f=Aw({rows:s,flatRows:a,rowsById:l}),f.flatRows=[];const d=h=>{f.flatRows.push(h),h.subRows.length&&h.subRows.forEach(d)};return f.rows.forEach(d),f},Y(t.options,"debugTable"))}/**
19
19
  * solid-table
20
20
  *
21
21
  * Copyright (c) TanStack
@@ -24,4 +24,4 @@ var of=Object.defineProperty;var ba=e=>{throw TypeError(e)};var sf=(e,t,n)=>t in
24
24
  * LICENSE.md file in the root directory of this source tree.
25
25
  *
26
26
  * @license MIT
27
- */function kl(e,t){return e?typeof e=="function"?b(e,t):e:null}function _w(e){const t=A({state:{},onStateChange:()=>{},renderFallbackValue:null,mergeOptions:(i,s)=>A(i,s)},e),n=Mw(t),[r,o]=co(n.initialState);return Mt(()=>{n.setOptions(i=>A(i,e,{state:A(r,e.state||{}),onStateChange:s=>{o(s),e.onStateChange==null||e.onStateChange(s)}}))}),n}var xo=he("<li>"),kw=he("<ul>"),Vw={};Xt(Vw,{Ellipsis:()=>Ys,Item:()=>Zs,Items:()=>Js,Next:()=>ea,Pagination:()=>Nw,Previous:()=>ta,Root:()=>na});function Ys(e){return(()=>{var t=xo();return fe(t,b(ae,A({as:"div"},e))),t})()}var Vd=we();function Co(){const e=me(Vd);if(e===void 0)throw new Error("[kobalte]: `usePaginationContext` must be used within a `Pagination` component");return e}function Zs(e){const t=Co(),[n,r]=k(e,["page","onClick"]),o=()=>t.page()===n.page,i=()=>{t.setPage(n.page)};return(()=>{var s=xo();return fe(s,b(wt,A({get"aria-current"(){return o()?"page":void 0},get"data-current"(){return o()?"":void 0},get onClick(){return be([n.onClick,i])}},r))),s})()}function Js(e){const t=Co(),n=K(()=>{const{count:r,siblingCount:o,page:i,fixedItems:s,showFirst:a,showLast:u}=t,l=r()<2*o()+(s()?6:4);if(l)return{renderItemsDirectly:l};const c=a()&&i()-1>o(),d=u()&&r()-i()>o();let f=i()-(a()?2:1)>o(),h=r()-i()-(u()?1:0)>o(),g=Math.min(i()-1,o()),p=Math.min(r()-i(),o());if(s()!==!1){const v=g,w=p;g+=Math.max(o()-w,0),p+=Math.max(o()-v,0),c||p++,d||g++,s()===!0&&(f||p++,h||g++),i()-g-(a()?2:1)===1&&(f=!1,g++),r()-i()-p-(u()?1:0)===1&&(h=!1,p++)}return{showFirst:c,showLast:d,showFirstEllipsis:f,showLastEllipsis:h,previousSiblingCount:g,nextSiblingCount:p,renderItemsDirectly:l}});return b(Se,{get when(){return n().renderItemsDirectly},get fallback(){return[b(Se,{get when(){return n().showFirst},get children(){return t.renderItem(1)}}),b(Se,{get when(){return n().showFirstEllipsis},get children(){return t.renderEllipsis()}}),b(nt,{get each(){return[...Array(n().previousSiblingCount).keys()].reverse()},children:r=>K(()=>t.renderItem(t.page()-(r+1)))}),K(()=>t.renderItem(t.page())),b(nt,{get each(){return[...Array(n().nextSiblingCount).keys()]},children:r=>K(()=>t.renderItem(t.page()+(r+1)))}),b(Se,{get when(){return n().showLastEllipsis},get children(){return t.renderEllipsis()}}),b(Se,{get when(){return n().showLast},get children(){return t.renderItem(t.count())}})]},get children(){return b(nt,{get each(){return[...Array(t.count()).keys()]},children:r=>K(()=>t.renderItem(r+1))})}})}function ea(e){const t=Co(),[n,r]=k(e,["onClick"]),o=()=>{t.setPage(t.page()+1)},i=()=>t.page()===t.count();return(()=>{var s=xo();return fe(s,b(wt,A({get tabIndex(){return i()||t.page()===t.count()?-1:void 0},get disabled(){return i()},get"aria-disabled"(){return i()||void 0},get"data-disabled"(){return i()?"":void 0},get onClick(){return be([n.onClick,o])}},r))),s})()}function ta(e){const t=Co(),[n,r]=k(e,["onClick"]),o=()=>{t.setPage(t.page()-1)},i=()=>t.page()===1;return(()=>{var s=xo();return fe(s,b(wt,A({get tabIndex(){return i()||t.page()===1?-1:void 0},get disabled(){return i()},get"aria-disabled"(){return i()||void 0},get"data-disabled"(){return i()?"":void 0},get onClick(){return be([n.onClick,o])}},r))),s})()}function na(e){const t=`pagination-${Ee()}`,n=Z({id:t},e),[r,o]=k(n,["page","defaultPage","onPageChange","count","siblingCount","showFirst","showLast","fixedItems","itemComponent","ellipsisComponent","disabled","children"]),i=pt({defaultValue:()=>r.defaultPage??1,onChange:r.onPageChange,value:()=>r.page}),s={count:()=>r.count,siblingCount:()=>r.siblingCount??1,showFirst:()=>r.showFirst??!0,showLast:()=>r.showLast??!0,fixedItems:()=>r.fixedItems??!1,isDisabled:()=>r.disabled??!1,renderItem:a=>r.itemComponent({page:a}),renderEllipsis:r.ellipsisComponent,page:()=>Math.min(i[0]()??1,r.count),setPage:i[1]};return b(Vd.Provider,{value:s,get children(){return b(ae,A({as:"nav",get"data-disabled"(){return r.disabled?"":void 0}},o,{get children(){var a=kw();return fe(a,()=>r.children),a}}))}})}var Nw=Object.assign(na,{Ellipsis:Ys,Item:Zs,Items:Js,Next:ea,Previous:ta});const Eo=Fr("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}}),Vl=e=>{const[t,n]=k(e,["variant","size","class"]);return b(wt,A({get class(){return de(Eo({variant:t.variant,size:t.size}),t.class)}},n))};var Kw=he('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><circle cx=12 cy=12 r=1></circle><circle cx=19 cy=12 r=1></circle><circle cx=5 cy=12 r=1>'),jw=he("<span class=sr-only>More pages"),Bw=he('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><path d="M15 6l-6 6l6 6">'),zw=he("<span>Previous"),Gw=he("<span>Next"),Hw=he('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><path d="M9 6l6 6l-6 6">');const Uw=Js,qw=e=>{const[t,n]=k(e,["class"]);return b(na,A({get class(){return de("[&>*]:flex [&>*]:flex-row [&>*]:items-center [&>*]:gap-1",t.class)}},n))},Ww=e=>{const[t,n]=k(e,["class"]);return b(Zs,A({get class(){return de(Eo({variant:"ghost"}),"size-10 data-[current]:border",t.class)}},n))},Xw=e=>{const[t,n]=k(e,["class"]);return b(Ys,A({get class(){return de("flex size-10 items-center justify-center",t.class)}},n,{get children(){return[Kw(),jw()]}}))},Qw=e=>{const[t,n]=k(e,["class","children"]);return b(ta,A({get class(){return de(Eo({variant:"ghost"}),"gap-1 pl-2.5",t.class)}},n,{get children(){return t.children??[Bw(),zw()]}}))},Yw=e=>{const[t,n]=k(e,["class","children"]);return b(ea,A({get class(){return de(Eo({variant:"ghost"}),"gap-1 pl-2.5",t.class)}},n,{get children(){return t.children??[Gw(),Hw()]}}))};var Zw=he('<div class="relative w-full overflow-auto"><table>'),Jw=he("<thead>"),eb=he("<tbody>"),tb=he("<tr>"),nb=he("<th>"),rb=he("<td>");const ob=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=Zw(),o=r.firstChild;return at(o,A({get class(){return de("w-full caption-bottom text-sm",t.class)}},n),!1,!1),r})()},ib=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=Jw();return at(r,A({get class(){return de("[&_tr]:border-b",t.class)}},n),!1,!1),r})()},sb=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=eb();return at(r,A({get class(){return de(t.class)}},n),!1,!1),r})()},Ho=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=tb();return at(r,A({get class(){return de("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t.class)}},n),!1,!1),r})()},ab=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=nb();return at(r,A({get class(){return de("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t.class)}},n),!1,!1),r})()},Nl=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=rb();return at(r,A({get class(){return de("p-4 align-middle [&:has([role=checkbox])]:pr-0",t.class)}},n),!1,!1),r})()};var lb=(e,t,n={})=>{let r=`${e}=${t}`;if(e.startsWith("__Secure-")&&!n.secure)throw new Error("__Secure- Cookie must have Secure attributes");if(e.startsWith("__Host-")){if(!n.secure)throw new Error("__Host- Cookie must have Secure attributes");if(n.path!=="/")throw new Error('__Host- Cookie must have Path attributes with "/"');if(n.domain)throw new Error("__Host- Cookie must not have Domain attributes")}if(n&&typeof n.maxAge=="number"&&n.maxAge>=0){if(n.maxAge>3456e4)throw new Error("Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.");r+=`; Max-Age=${Math.floor(n.maxAge)}`}if(n.domain&&n.prefix!=="host"&&(r+=`; Domain=${n.domain}`),n.path&&(r+=`; Path=${n.path}`),n.expires){if(n.expires.getTime()-Date.now()>3456e7)throw new Error("Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.");r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+="; HttpOnly"),n.secure&&(r+="; Secure"),n.sameSite&&(r+=`; SameSite=${n.sameSite.charAt(0).toUpperCase()+n.sameSite.slice(1)}`),n.partitioned){if(!n.secure)throw new Error("Partitioned Cookie must have Secure attributes");r+="; Partitioned"}return r},ub=(e,t,n)=>(t=encodeURIComponent(t),lb(e,t,n)),cb=(e,t)=>(e=e.replace(/\/+$/,""),e=e+"/",t=t.replace(/^\/+/,""),e+t),Qi=(e,t)=>{for(const[n,r]of Object.entries(t)){const o=new RegExp("/:"+n+"(?:{[^/]+})?\\??");e=e.replace(o,r?`/${r}`:"")}return e},db=(e,t)=>{switch(t){case"ws":return e.replace(/^http/,"ws");case"http":return e.replace(/^ws/,"http")}},fb=e=>/^https?:\/\/[^\/]+?\/index$/.test(e)?e.replace(/\/index$/,"/"):e.replace(/\/index$/,"");function Ur(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Nd(e,t){if(!Ur(e)&&!Ur(t))return t;const n={...e};for(const r in t){const o=t[r];Ur(n[r])&&Ur(o)?n[r]=Nd(n[r],o):n[r]=o}return n}var Kd=(e,t)=>new Proxy(()=>{},{get(r,o){if(!(typeof o!="string"||o==="then"))return Kd(e,[...t,o])},apply(r,o,i){return e({path:t,args:i})}}),hb=class{constructor(e,t){Re(this,"url");Re(this,"method");Re(this,"queryParams");Re(this,"pathParams",{});Re(this,"rBody");Re(this,"cType");Re(this,"fetch",async(e,t)=>{if(e){if(e.query){for(const[a,u]of Object.entries(e.query))if(u!==void 0)if(this.queryParams||(this.queryParams=new URLSearchParams),Array.isArray(u))for(const l of u)this.queryParams.append(a,l);else this.queryParams.set(a,u)}if(e.form){const a=new FormData;for(const[u,l]of Object.entries(e.form))if(Array.isArray(l))for(const c of l)a.append(u,c);else a.append(u,l);this.rBody=a}e.json&&(this.rBody=JSON.stringify(e.json),this.cType="application/json"),e.param&&(this.pathParams=e.param)}let n=this.method.toUpperCase();const r={...(e==null?void 0:e.header)??{},...typeof(t==null?void 0:t.headers)=="function"?await t.headers():t!=null&&t.headers?t.headers:{}};if(e!=null&&e.cookie){const a=[];for(const[u,l]of Object.entries(e.cookie))a.push(ub(u,l,{path:"/"}));r.Cookie=a.join(",")}this.cType&&(r["Content-Type"]=this.cType);const o=new Headers(r??void 0);let i=this.url;i=fb(i),i=Qi(i,this.pathParams),this.queryParams&&(i=i+"?"+this.queryParams.toString()),n=this.method.toUpperCase();const s=!(n==="GET"||n==="HEAD");return((t==null?void 0:t.fetch)||fetch)(i,{body:s?this.rBody:void 0,method:n,headers:o,...t==null?void 0:t.init})});this.url=e,this.method=t}},gb=(e,t)=>Kd(function n(r){var l;const o=[...r.path];if(o[o.length-1]==="toString")return o[o.length-2]==="name"?o[o.length-3]||"":n.toString();if(o[o.length-1]==="valueOf")return o[o.length-2]==="name"?o[o.length-3]||"":n;let i="";if(/^\$/.test(o[o.length-1])){const c=o.pop();c&&(i=c.replace(/^\$/,""))}const s=o.join("/"),a=cb(e,s);if(i==="url")return r.args[0]&&r.args[0].param?new URL(Qi(a,r.args[0].param)):new URL(a);if(i==="ws"){const c=db(r.args[0]&&r.args[0].param?Qi(a,r.args[0].param):a,"ws"),d=new URL(c),f=(l=r.args[0])==null?void 0:l.query;return f&&Object.entries(f).forEach(([g,p])=>{Array.isArray(p)?p.forEach(v=>d.searchParams.append(g,v)):d.searchParams.set(g,p)}),((...g)=>(t==null?void 0:t.webSocket)!==void 0&&typeof t.webSocket=="function"?t.webSocket(...g):new WebSocket(...g))(d.toString())}const u=new hb(a,i);if(i){t??(t={});const c=Nd(t,{...r.args[1]??{}});return u.fetch(r.args[0],c)}return u},[]);const Tr=gb("/rpc"),Uo="production",pb=e=>fo(()=>({queryKey:["bundles",e()],queryFn:async()=>(await Tr.bundles.$get({query:e()})).json(),placeholderData:t=>t,staleTime:Number.POSITIVE_INFINITY})),mb=e=>fo(()=>({queryKey:["bundle",e],queryFn:()=>Tr.bundles[":bundleId"].$get({param:{bundleId:e}}).then(t=>t.json()),placeholderData:t=>t,staleTime:Number.POSITIVE_INFINITY})),vb=()=>fo(()=>({queryKey:["config"],queryFn:()=>Tr.config.$get().then(e=>e.json()),staleTime:Number.POSITIVE_INFINITY,retryOnMount:!1})),yb=()=>fo(()=>({queryKey:["channels"],queryFn:()=>Tr.channels.$get().then(e=>e.json()),staleTime:Number.POSITIVE_INFINITY,retryOnMount:!1,select:e=>!e||e.length===0?null:e.includes(Uo)?[Uo,...e.filter(t=>t!==Uo)]:e}));var wb=he('<div class="transition-opacity duration-300"><div class="flex flex-row justify-end p-3"><div class="flex items-center gap-4"><div class="text-sm text-muted-foreground">Platform:</div><div class="text-sm text-muted-foreground">Channel:</div></div></div><div class="border rounded-md">');const bb=20,[nr,Sb]=B({pageIndex:0,pageSize:bb});function xb(e){const[t]=k(e,["columns","onRowClick"]),{channelFilter:n,platformFilter:r,setPlatformFilter:o,setChannelFilter:i}=Kc(),s=K(()=>({channel:n()??void 0,platform:r()??void 0,limit:nr().pageSize.toString(),offset:(nr().pageIndex*nr().pageSize).toString()})),a=pb(s),u=K(()=>a.data??[]),l=_w({get data(){return u()},columns:t.columns,getCoreRowModel:Fw(),getPaginationRowModel:Lw(),getFilteredRowModel:Dw(),state:{get pagination(){return nr()},get globalFilter(){return r()}},onPaginationChange:Sb,globalFilterFn:(f,h,g)=>g?f.original.platform.toLowerCase()===g:!0,manualPagination:!1}),c=f=>()=>{t.onRowClick(f.original)},d=yb();return U(()=>{d.isFetched&&d.data&&n()===null&&i(d.data[0])}),(()=>{var f=wb(),h=f.firstChild,g=h.firstChild,p=g.firstChild,v=p.nextSibling,w=h.nextSibling;return fe(g,b(Al,{get children(){return b(Fl,{get children(){return[b($l,{class:"w-[100px]",get children(){return[K(()=>K(()=>!!r())()?r():"All"),b(Ol,{})]}}),b(Tl,{get children(){return b(nt,{each:[{label:"All",value:null},{label:"iOS",value:"ios"},{label:"Android",value:"android"}],children:m=>b(Dl,{get classList(){return{"bg-primary text-primary-foreground":m.value===r()}},onClick:()=>o(m.value),get children(){return m.label}})})}})]}})}}),v),fe(g,b(Al,{get children(){return b(Fl,{get children(){return[b($l,{class:"w-[100px]",get children(){return[K(()=>n()),b(Ol,{})]}}),b(Tl,{get children(){return b(nt,{get each(){return d.data},children:m=>b(Dl,{get classList(){return{"bg-primary text-primary-foreground":m===n()}},onClick:()=>i(m),children:m})})}})]}})}}),null),fe(w,b(ob,{get children(){return[b(ib,{get children(){return b(nt,{get each(){return l.getHeaderGroups()},children:m=>b(Ho,{get children(){return b(nt,{get each(){return m.headers},children:y=>b(ab,{get children(){return K(()=>!!y.isPlaceholder)()?null:kl(y.column.columnDef.header,y.getContext())}})})}})})}}),b(sb,{get children(){return K(()=>{var m;return!!(a.isFetched&&((m=l.getRowModel().rows)==null?void 0:m.length)===0)})()?b(Ho,{get children(){return b(Nl,{get colSpan(){return t.columns.length},class:"h-full text-center",children:"No results."})}}):b(nt,{get each(){return l.getRowModel().rows},children:m=>b(Ho,{get"data-state"(){return m.getIsSelected()&&"selected"},class:"cursor-pointer",get onClick(){return c(m)},get children(){return b(nt,{get each(){return m.getVisibleCells()},children:y=>b(Nl,{get children(){return kl(y.column.columnDef.cell,y.getContext())}})})}})})}})]}})),fe(f,b(qw,{class:"mt-2.5 w-full [&>ul]:justify-center",itemComponent:m=>b(Ww,{get page(){return m.page},onClick:()=>l.setPageIndex(m.page-1),get children(){return m.page}}),ellipsisComponent:()=>b(Xw,{}),get count(){var m;return Math.ceil((((m=u())==null?void 0:m.length)??0)/nr().pageSize)},get children(){return[b(Qw,{onClick:()=>l.previousPage(),get disabled(){return!l.getCanPreviousPage()}}),b(Uw,{}),b(Yw,{onClick:()=>l.nextPage(),get disabled(){return!l.getCanNextPage()}})]}}),null),Ke(m=>{var y=!!a.isFetching,x=!!a.isFetching;return y!==m.e&&f.classList.toggle("opacity-50",m.e=y),x!==m.t&&w.classList.toggle("min-h-[400px]",m.t=x),m},{e:void 0,t:void 0}),f})()}var Cb={};Xt(Cb,{Root:()=>ra,Skeleton:()=>Eb});function ra(e){const t=`skeleton-${Ee()}`,n=Z({visible:!0,animate:!0,id:t},e),[r,o]=k(n,["style","radius","animate","height","width","visible","circle"]);return b(ae,A({as:"div",role:"group",get"data-animate"(){return r.animate||void 0},get"data-visible"(){return r.visible||void 0},get style(){return vt({"border-radius":r.circle?"9999px":r.radius?`${r.radius}px`:void 0,width:r.circle?`${r.height}px`:r.width?`${r.width}px`:"100%",height:r.height?`${r.height}px`:"auto"},r.style)}},o))}var Eb=ra;const Rb=e=>{const[t,n]=k(e,["class"]);return b(ra,A({get class(){return de("bg-primary/10 data-[animate='true']:animate-pulse",t.class)}},n))};var jd=["id","name","validationState","required","disabled","readOnly"];function Bd(e){const t=`form-control-${Ee()}`,n=Z({id:t},e),[r,o]=B(),[i,s]=B(),[a,u]=B(),[l,c]=B(),d=(p,v,w)=>{const m=w!=null||r()!=null;return[w,r(),m&&v!=null?p:void 0].filter(Boolean).join(" ")||void 0},f=p=>[a(),l(),p].filter(Boolean).join(" ")||void 0,h=K(()=>({"data-valid":$(n.validationState)==="valid"?"":void 0,"data-invalid":$(n.validationState)==="invalid"?"":void 0,"data-required":$(n.required)?"":void 0,"data-disabled":$(n.disabled)?"":void 0,"data-readonly":$(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>$(n.name)??$(n.id),dataset:h,validationState:()=>$(n.validationState),isRequired:()=>$(n.required),isDisabled:()=>$(n.disabled),isReadOnly:()=>$(n.readOnly),labelId:r,fieldId:i,descriptionId:a,errorMessageId:l,getAriaLabelledBy:d,getAriaDescribedBy:f,generateId:yt(()=>$(n.id)),registerLabel:Be(o),registerField:Be(s),registerDescription:Be(u),registerErrorMessage:Be(c)}}}var oa=we();function Yt(){const e=me(oa);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function ia(e){const t=Yt(),n=Z({id:t.generateId("description")},e);return U(()=>W(t.registerDescription(n.id))),b(ae,A({as:"div"},()=>t.dataset(),n))}function sa(e){const t=Yt(),n=Z({id:t.generateId("error-message")},e),[r,o]=k(n,["forceMount"]),i=()=>t.validationState()==="invalid";return U(()=>{i()&&W(t.registerErrorMessage(o.id))}),b(Se,{get when(){return r.forceMount||i()},get children(){return b(ae,A({as:"div"},()=>t.dataset(),o))}})}function Ro(e){let t;const n=Yt(),r=Z({id:n.generateId("label")},e),[o,i]=k(r,["ref"]),s=go(()=>t,()=>"label");return U(()=>W(n.registerLabel(i.id))),b(ae,A({as:"label",ref(a){var u=ve(l=>t=l,o.ref);typeof u=="function"&&u(a)},get for(){return K(()=>s()==="label")()?n.fieldId():void 0}},()=>n.dataset(),i))}var zd=["id","aria-label","aria-labelledby","aria-describedby"];function Gd(e){const t=Yt(),n=Z({id:t.generateId("field")},e);return U(()=>W(t.registerField($(n.id)))),{fieldProps:{id:()=>$(n.id),ariaLabel:()=>$(n["aria-label"]),ariaLabelledBy:()=>t.getAriaLabelledBy($(n.id),$(n["aria-label"]),$(n["aria-labelledby"])),ariaDescribedBy:()=>t.getAriaDescribedBy($(n["aria-describedby"]))}}}function Hd(e,t){U(Ce(e,n=>{if(n==null)return;const r=Pb(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),W(()=>{r.removeEventListener("reset",t)}))}))}function Pb(e){return Ib(e)?e.form:e.closest("form")}function Ib(e){return e.matches("textarea, input, select, button")}var Mb={};Xt(Mb,{Control:()=>aa,Description:()=>qd,ErrorMessage:()=>Wd,Input:()=>la,Label:()=>ua,Root:()=>ca,Switch:()=>Ab,Thumb:()=>da});var Ud=we();function Wn(){const e=me(Ud);if(e===void 0)throw new Error("[kobalte]: `useSwitchContext` must be used within a `Switch` component");return e}function aa(e){const t=Yt(),n=Wn(),r=Z({id:n.generateId("control")},e),[o,i]=k(r,["onClick","onKeyDown"]);return b(ae,A({as:"div",onClick:u=>{var l;oe(u,o.onClick),n.toggle(),(l=n.inputRef())==null||l.focus()},onKeyDown:u=>{var l;oe(u,o.onKeyDown),u.key===cs.Space&&(n.toggle(),(l=n.inputRef())==null||l.focus())}},()=>t.dataset(),()=>n.dataset(),i))}function qd(e){const t=Wn();return b(ia,A(()=>t.dataset(),e))}function Wd(e){const t=Wn();return b(sa,A(()=>t.dataset(),e))}function la(e){const t=Yt(),n=Wn(),r=Z({id:n.generateId("input")},e),[o,i,s]=k(r,["ref","style","onChange","onFocus","onBlur"],zd),{fieldProps:a}=Gd(i);return b(ae,A({as:"input",ref(d){var f=ve(n.setInputRef,o.ref);typeof f=="function"&&f(d)},type:"checkbox",role:"switch",get id(){return a.id()},get name(){return t.name()},get value(){return n.value()},get checked(){return n.checked()},get required(){return t.isRequired()},get disabled(){return t.isDisabled()},get readonly(){return t.isReadOnly()},get style(){return vt({...pc},o.style)},get"aria-checked"(){return n.checked()},get"aria-label"(){return a.ariaLabel()},get"aria-labelledby"(){return a.ariaLabelledBy()},get"aria-describedby"(){return a.ariaDescribedBy()},get"aria-invalid"(){return t.validationState()==="invalid"||void 0},get"aria-required"(){return t.isRequired()||void 0},get"aria-disabled"(){return t.isDisabled()||void 0},get"aria-readonly"(){return t.isReadOnly()||void 0},onChange:d=>{oe(d,o.onChange),d.stopPropagation();const f=d.target;n.setIsChecked(f.checked),f.checked=n.checked()},onFocus:d=>{oe(d,o.onFocus),n.setIsFocused(!0)},onBlur:d=>{oe(d,o.onBlur),n.setIsFocused(!1)}},()=>t.dataset(),()=>n.dataset(),s))}function ua(e){const t=Wn();return b(Ro,A(()=>t.dataset(),e))}function ca(e){let t;const n=`switch-${Ee()}`,r=Z({value:"on",id:n},e),[o,i,s]=k(r,["ref","children","value","checked","defaultChecked","onChange","onPointerDown"],jd),[a,u]=B(),[l,c]=B(!1),{formControlContext:d}=Bd(i),f=ld({isSelected:()=>o.checked,defaultIsSelected:()=>o.defaultChecked,onSelectedChange:v=>{var w;return(w=o.onChange)==null?void 0:w.call(o,v)},isDisabled:()=>d.isDisabled(),isReadOnly:()=>d.isReadOnly()});Hd(()=>t,()=>f.setIsSelected(o.defaultChecked??!1));const h=v=>{oe(v,o.onPointerDown),l()&&v.preventDefault()},g=K(()=>({"data-checked":f.isSelected()?"":void 0})),p={value:()=>o.value,dataset:g,checked:()=>f.isSelected(),inputRef:a,generateId:yt(()=>$(i.id)),toggle:()=>f.toggle(),setIsChecked:v=>f.setIsSelected(v),setIsFocused:c,setInputRef:u};return b(oa.Provider,{value:d,get children(){return b(Ud.Provider,{value:p,get children(){return b(ae,A({as:"div",ref(v){var w=ve(m=>t=m,o.ref);typeof w=="function"&&w(v)},role:"group",get id(){return $(i.id)},onPointerDown:h},()=>d.dataset(),g,s,{get children(){return b(Fb,{state:p,get children(){return o.children}})}}))}})}})}function Fb(e){const t=lo(()=>{const n=e.children;return us(n)?n(e.state):n});return K(t)}function da(e){const t=Yt(),n=Wn(),r=Z({id:n.generateId("thumb")},e);return b(ae,A({as:"div"},()=>t.dataset(),()=>n.dataset(),r))}var Ab=Object.assign(ca,{Control:aa,Description:qd,ErrorMessage:Wd,Input:la,Label:ua,Thumb:da});const Kl=ca,jl=e=>{const[t,n]=k(e,["class","children"]);return[b(la,{get class(){return de("[&:focus-visible+div]:outline-none [&:focus-visible+div]:ring-2 [&:focus-visible+div]:ring-ring [&:focus-visible+div]:ring-offset-2 [&:focus-visible+div]:ring-offset-background",t.class)}}),b(aa,A({get class(){return de("inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent bg-input transition-[color,background-color,box-shadow] data-[disabled]:cursor-not-allowed data-[checked]:bg-primary data-[disabled]:opacity-50",t.class)}},n,{get children(){return t.children}}))]},Bl=e=>{const[t,n]=k(e,["class"]);return b(da,A({get class(){return de("pointer-events-none block size-5 translate-x-0 rounded-full bg-background shadow-lg ring-0 transition-transform data-[checked]:translate-x-5",t.class)}},n))},zl=e=>{const[t,n]=k(e,["class"]);return b(ua,A({get class(){return de("text-sm font-medium leading-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-70",t.class)}},n))};var $b={};Xt($b,{Description:()=>ia,ErrorMessage:()=>sa,Input:()=>fa,Label:()=>Ro,Root:()=>ha,TextArea:()=>Zd,TextField:()=>Tb});var Xd=we();function Qd(){const e=me(Xd);if(e===void 0)throw new Error("[kobalte]: `useTextFieldContext` must be used within a `TextField` component");return e}function fa(e){return b(Yd,A({type:"text"},e))}function Yd(e){const t=Yt(),n=Qd(),r=Z({id:n.generateId("input")},e),[o,i,s]=k(r,["onInput"],zd),{fieldProps:a}=Gd(i);return b(ae,A({as:"input",get id(){return a.id()},get name(){return t.name()},get value(){return n.value()},get required(){return t.isRequired()},get disabled(){return t.isDisabled()},get readonly(){return t.isReadOnly()},get"aria-label"(){return a.ariaLabel()},get"aria-labelledby"(){return a.ariaLabelledBy()},get"aria-describedby"(){return a.ariaDescribedBy()},get"aria-invalid"(){return t.validationState()==="invalid"||void 0},get"aria-required"(){return t.isRequired()||void 0},get"aria-disabled"(){return t.isDisabled()||void 0},get"aria-readonly"(){return t.isReadOnly()||void 0},get onInput(){return be([o.onInput,n.onInput])}},()=>t.dataset(),s))}function ha(e){let t;const n=`textfield-${Ee()}`,r=Z({id:n},e),[o,i,s]=k(r,["ref","value","defaultValue","onChange"],jd),a=o.value,[u,l]=pt({value:()=>a===void 0?void 0:o.value??"",defaultValue:()=>o.defaultValue,onChange:h=>{var g;return(g=o.onChange)==null?void 0:g.call(o,h)}}),{formControlContext:c}=Bd(i);Hd(()=>t,()=>l(o.defaultValue??""));const d=h=>{if(c.isReadOnly()||c.isDisabled())return;const g=h.target;l(g.value),g.value=u()??""},f={value:u,generateId:yt(()=>$(i.id)),onInput:d};return b(oa.Provider,{value:c,get children(){return b(Xd.Provider,{value:f,get children(){return b(ae,A({as:"div",ref(h){var g=ve(p=>t=p,o.ref);typeof g=="function"&&g(h)},role:"group",get id(){return $(i.id)}},()=>c.dataset(),s))}})}})}function Zd(e){let t;const n=Qd(),r=Z({id:n.generateId("textarea")},e),[o,i]=k(r,["ref","autoResize","submitOnEnter","onKeyPress"]);U(Ce([()=>t,()=>o.autoResize,()=>n.value()],([a,u])=>{!a||!u||Ob(a)}));const s=a=>{t&&o.submitOnEnter&&a.key==="Enter"&&!a.shiftKey&&t.form&&(t.form.requestSubmit(),a.preventDefault())};return b(Yd,A({as:"textarea",get"aria-multiline"(){return o.submitOnEnter?"false":void 0},get onKeyPress(){return be([o.onKeyPress,s])},ref(a){var u=ve(l=>t=l,o.ref);typeof u=="function"&&u(a)}},i))}function Ob(e){const t=e.style.alignSelf,n=e.style.overflow;"MozAppearance"in e.style||(e.style.overflow="hidden"),e.style.alignSelf="start",e.style.height="auto",e.style.height=`${e.scrollHeight+(e.offsetHeight-e.clientHeight)}px`,e.style.overflow=n,e.style.alignSelf=t}var Tb=Object.assign(ha,{Description:ia,ErrorMessage:sa,Input:fa,Label:Ro,TextArea:Zd});const Gl=ha,Hl=e=>{const[t,n]=k(e,["type","class"]);return b(fa,A({get type(){return t.type},get class(){return de("flex h-10 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t.class)}},n))},Db=Fr("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{variant:{label:"data-[invalid]:text-destructive",description:"text-destructive",error:"font-normal text-red-500"}},defaultVariants:{variant:"label"}}),Ul=e=>{const[t,n]=k(e,["class"]);return b(Ro,A({get class(){return de(Db(),t.class)}},n))};class Jd{constructor(t,n){this.listeners=new Set,this._batching=!1,this._flushing=0,this.subscribe=r=>{var o,i;this.listeners.add(r);const s=(i=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:i.call(o,r,this);return()=>{this.listeners.delete(r),s==null||s()}},this.setState=r=>{var o,i,s;const a=this.state;this.state=(o=this.options)!=null&&o.updateFn?this.options.updateFn(a)(r):r(a),(s=(i=this.options)==null?void 0:i.onUpdate)==null||s.call(i),this._flush()},this._flush=()=>{if(this._batching)return;const r=++this._flushing;this.listeners.forEach(o=>{this._flushing===r&&o()})},this.batch=r=>{if(this._batching)return r();this._batching=!0,r(),this._batching=!1,this._flush()},this.state=t,this.options=n}}function ga(e,t){return typeof e=="function"?e(t):e}function ef(e,t){return pa(t).reduce((r,o)=>{if(r===null)return null;if(typeof r<"u")return r[o]},e)}function qo(e,t,n){const r=pa(t);function o(i){if(!r.length)return ga(n,i);const s=r.shift();if(typeof s=="string")return typeof i=="object"?(i===null&&(i={}),{...i,[s]:o(i[s])}):{[s]:o()};if(Array.isArray(i)&&s!==void 0){const a=i.slice(0,s);return[...a.length?a:new Array(s),o(i[s]),...i.slice(s+1)]}return[...new Array(s),o()]}return o(e)}function Lb(e,t){const n=pa(t);function r(o){if(!o)return;if(n.length===1){const s=n[0];if(Array.isArray(o)&&typeof s=="number")return o.filter((l,c)=>c!==s);const{[s]:a,...u}=o;return u}const i=n.shift();if(typeof i=="string"&&typeof o=="object")return{...o,[i]:r(o[i])};if(typeof i=="number"&&Array.isArray(o)){if(i>=o.length)return o;const s=o.slice(0,i);return[...s.length?s:new Array(i),r(o[i]),...o.slice(i+1)]}throw new Error("It seems we have created an infinite loop in deleteBy. ")}return r(e)}const _b=/^(\d*)$/gm,kb=/\.(\d*)\./gm,Vb=/^(\d*)\./gm,Nb=/\.(\d*$)/gm,Kb=/\.{2,}/gm,Yi="__int__",qr=`${Yi}$1`;function pa(e){if(Array.isArray(e))return[...e];if(typeof e!="string")throw new Error("Path must be a string.");return e.replaceAll("[",".").replaceAll("]","").replace(_b,qr).replace(kb,`.${qr}.`).replace(Vb,`${qr}.`).replace(Nb,`.${qr}`).replace(Kb,".").split(".").map(t=>t.indexOf(Yi)===0?parseInt(t.substring(Yi.length),10):t)}function jb(e){return!(Array.isArray(e)&&e.length===0)}function Zi(e,t){const{asyncDebounceMs:n}=t,{onChangeAsync:r,onBlurAsync:o,onSubmitAsync:i,onBlurAsyncDebounceMs:s,onChangeAsyncDebounceMs:a}=t.validators||{},u=n??0,l={cause:"change",validate:r,debounceMs:a??u},c={cause:"blur",validate:o,debounceMs:s??u},d={cause:"submit",validate:i,debounceMs:0},f=h=>({...h,debounceMs:0});switch(e){case"submit":return[f(l),f(c),d];case"blur":return[c];case"change":return[l];case"server":default:return[]}}function Ji(e,t){const{onChange:n,onBlur:r,onSubmit:o}=t.validators||{},i={cause:"change",validate:n},s={cause:"blur",validate:r},a={cause:"submit",validate:o},u={cause:"server",validate:()=>{}};switch(e){case"submit":return[i,s,a,u];case"server":return[u];case"blur":return[s,u];case"change":default:return[i,u]}}function Wo(e){return{values:e.values??{},errors:e.errors??[],errorMap:e.errorMap??{},fieldMeta:e.fieldMeta??{},canSubmit:e.canSubmit??!0,isFieldsValid:e.isFieldsValid??!1,isFieldsValidating:e.isFieldsValidating??!1,isFormValid:e.isFormValid??!1,isFormValidating:e.isFormValidating??!1,isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isTouched:e.isTouched??!1,isBlurred:e.isBlurred??!1,isPristine:e.isPristine??!0,isDirty:e.isDirty??!1,isValid:e.isValid??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,validationMetaMap:e.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0}}}const Bb=e=>typeof e=="object";class zb{constructor(t){var n;this.options={},this.fieldInfo={},this.prevTransformArray=[],this.mount=()=>{const{onMount:r}=this.options.validators||{};if(!r)return;const o=this.runValidator({validate:r,value:{value:this.state.values,formApi:this,validationSource:"form"},type:"validate"});o&&this.store.setState(i=>({...i,errorMap:{...i.errorMap,onMount:o}}))},this.update=r=>{if(!r)return;const o=this.options;this.options=r,this.store.batch(()=>{const i=r.defaultValues&&r.defaultValues!==o.defaultValues&&!this.state.isTouched,s=r.defaultState!==o.defaultState&&!this.state.isTouched;this.store.setState(()=>Wo(Object.assign({},this.state,s?r.defaultState:{},i?{values:r.defaultValues}:{})))})},this.reset=()=>{const{fieldMeta:r}=this.state,o=this.resetFieldMeta(r);this.store.setState(()=>{var i;return Wo({...this.options.defaultState,values:this.options.defaultValues??((i=this.options.defaultState)==null?void 0:i.values),fieldMeta:o})})},this.validateAllFields=async r=>{const o=[];return this.store.batch(()=>{Object.values(this.fieldInfo).forEach(s=>{if(!s.instance)return;const a=s.instance;o.push(Promise.resolve().then(()=>a.validate(r))),s.instance.state.meta.isTouched||s.instance.setMeta(u=>({...u,isTouched:!0})),s.instance.state.meta.isBlurred||s.instance.setMeta(u=>({...u,isBlurred:!0}))})}),(await Promise.all(o)).flat()},this.validateArrayFieldsStartingFrom=async(r,o,i)=>{const s=this.getFieldValue(r),a=Array.isArray(s)?Math.max(s.length-1,0):null,u=[`${r}[${o}]`];for(let f=o+1;f<=(a??0);f++)u.push(`${r}[${f}]`);const l=Object.keys(this.fieldInfo).filter(f=>u.some(h=>f.startsWith(h))),c=[];return this.store.batch(()=>{l.forEach(f=>{c.push(Promise.resolve().then(()=>this.validateField(f,i)))})}),(await Promise.all(c)).flat()},this.validateField=(r,o)=>{var i;const s=(i=this.fieldInfo[r])==null?void 0:i.instance;return s?(s.state.meta.isTouched||s.setMeta(a=>({...a,isTouched:!0})),s.state.meta.isBlurred||s.setMeta(a=>({...a,isBlurred:!0})),s.validate(o)):[]},this.validateSync=r=>{const o=Ji(r,this.options);let i=!1;const s={};this.store.batch(()=>{for(const u of o){if(!u.validate)continue;const l=this.runValidator({validate:u.validate,value:{value:this.state.values,formApi:this,validationSource:"form"},type:"validate"}),{formError:c,fieldErrors:d}=es(l),f=Wr(u.cause);if(d)for(const[h,g]of Object.entries(d)){const v={...s[h]||{},[f]:g};s[h]=v;const w=this.getFieldMeta(h);w&&w.errorMap[f]!==g&&this.setFieldMeta(h,m=>({...m,errorMap:{...m.errorMap,[f]:g}}))}this.state.errorMap[f]!==c&&this.store.setState(h=>({...h,errorMap:{...h.errorMap,[f]:c}})),(c||d)&&(i=!0)}});const a=Wr("submit");return this.state.errorMap[a]&&r!=="submit"&&!i&&this.store.setState(u=>({...u,errorMap:{...u.errorMap,[a]:void 0}})),{hasErrored:i,fieldsErrorMap:s}},this.validateAsync=async r=>{const o=Zi(r,this.options);this.state.isFormValidating||this.store.setState(l=>({...l,isFormValidating:!0}));const i=[];let s;for(const l of o){if(!l.validate)continue;const c=Wr(l.cause),d=this.state.validationMetaMap[c];d==null||d.lastAbortController.abort();const f=new AbortController;this.state.validationMetaMap[c]={lastAbortController:f},i.push(new Promise(async h=>{let g;try{g=await new Promise((m,y)=>{setTimeout(async()=>{if(f.signal.aborted)return m(void 0);try{m(await this.runValidator({validate:l.validate,value:{value:this.state.values,formApi:this,validationSource:"form",signal:f.signal},type:"validateAsync"}))}catch(x){y(x)}},l.debounceMs)})}catch(m){g=m}const{formError:p,fieldErrors:v}=es(g);v&&(s=s?{...s,...v}:v);const w=Wr(l.cause);if(s)for(const[m,y]of Object.entries(s)){const x=this.getFieldMeta(m);x&&x.errorMap[w]!==y&&this.setFieldMeta(m,C=>({...C,errorMap:{...C.errorMap,[w]:y}}))}this.store.setState(m=>({...m,errorMap:{...m.errorMap,[w]:p}})),h(s?{fieldErrors:s,errorMapKey:w}:void 0)}))}let a=[];const u={};if(i.length){a=await Promise.all(i);for(const l of a)if(l!=null&&l.fieldErrors){const{errorMapKey:c}=l;for(const[d,f]of Object.entries(l.fieldErrors)){const g={...u[d]||{},[c]:f};u[d]=g}}}return this.store.setState(l=>({...l,isFormValidating:!1})),u},this.validate=r=>{const{hasErrored:o,fieldsErrorMap:i}=this.validateSync(r);return o&&!this.options.asyncAlways?i:this.validateAsync(r)},this.handleSubmit=async()=>{var r,o,i,s,a,u;if(this.store.setState(c=>({...c,isSubmitted:!1,submissionAttempts:c.submissionAttempts+1})),!this.state.canSubmit)return;this.store.setState(c=>({...c,isSubmitting:!0}));const l=()=>{this.store.setState(c=>({...c,isSubmitting:!1}))};if(await this.validateAllFields("submit"),!this.state.isFieldsValid){l(),(o=(r=this.options).onSubmitInvalid)==null||o.call(r,{value:this.state.values,formApi:this});return}if(await this.validate("submit"),!this.state.isValid){l(),(s=(i=this.options).onSubmitInvalid)==null||s.call(i,{value:this.state.values,formApi:this});return}try{await((u=(a=this.options).onSubmit)==null?void 0:u.call(a,{value:this.state.values,formApi:this})),this.store.batch(()=>{this.store.setState(c=>({...c,isSubmitted:!0})),l()})}catch(c){throw l(),c}},this.getFieldValue=r=>ef(this.state.values,r),this.getFieldMeta=r=>this.state.fieldMeta[r],this.getFieldInfo=r=>{var o;return(o=this.fieldInfo)[r]||(o[r]={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0}})},this.setFieldMeta=(r,o)=>{this.store.setState(i=>({...i,fieldMeta:{...i.fieldMeta,[r]:ga(o,i.fieldMeta[r])}}))},this.resetFieldMeta=r=>Object.keys(r).reduce((o,i)=>{const s=i;return o[s]={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,errors:[],errorMap:{}},o},{}),this.setFieldValue=(r,o,i)=>{const s=(i==null?void 0:i.dontUpdateMeta)??!1;this.store.batch(()=>{s||this.setFieldMeta(r,a=>({...a,isTouched:!0,isBlurred:!0,isDirty:!0})),this.store.setState(a=>({...a,values:qo(a.values,r,o)}))})},this.deleteField=r=>{this.store.setState(o=>{const i={...o};return i.values=Lb(i.values,r),delete i.fieldMeta[r],i}),delete this.fieldInfo[r]},this.pushFieldValue=(r,o,i)=>{this.setFieldValue(r,s=>[...Array.isArray(s)?s:[],o],i),this.validateField(r,"change")},this.insertFieldValue=async(r,o,i,s)=>{this.setFieldValue(r,a=>[...a.slice(0,o),i,...a.slice(o)],s),await this.validateField(r,"change")},this.replaceFieldValue=async(r,o,i,s)=>{this.setFieldValue(r,a=>a.map((u,l)=>l===o?i:u),s),await this.validateField(r,"change"),await this.validateArrayFieldsStartingFrom(r,o,"change")},this.removeFieldValue=async(r,o,i)=>{const s=this.getFieldValue(r),a=Array.isArray(s)?Math.max(s.length-1,0):null;if(this.setFieldValue(r,u=>u.filter((l,c)=>c!==o),i),a!==null){const u=`${r}[${a}]`;Object.keys(this.fieldInfo).filter(c=>c.startsWith(u)).forEach(c=>this.deleteField(c))}await this.validateField(r,"change"),await this.validateArrayFieldsStartingFrom(r,o,"change")},this.swapFieldValues=(r,o,i,s)=>{this.setFieldValue(r,a=>{const u=a[o],l=a[i];return qo(qo(a,`${o}`,l),`${i}`,u)},s),this.validateField(r,"change"),this.validateField(`${r}[${o}]`,"change"),this.validateField(`${r}[${i}]`,"change")},this.moveFieldValues=(r,o,i,s)=>{this.setFieldValue(r,a=>(a.splice(i,0,a.splice(o,1)[0]),a),s),this.validateField(r,"change"),this.validateField(`${r}[${o}]`,"change"),this.validateField(`${r}[${i}]`,"change")},this.store=new Jd(Wo({...t==null?void 0:t.defaultState,values:(t==null?void 0:t.defaultValues)??((n=t==null?void 0:t.defaultState)==null?void 0:n.values),isFormValid:!0}),{onUpdate:()=>{var r,o;let{state:i}=this.store;const s=Object.values(i.fieldMeta),a=s.some(y=>y==null?void 0:y.isValidating),u=!s.some(y=>(y==null?void 0:y.errorMap)&&jb(Object.values(y.errorMap).filter(Boolean))),l=s.some(y=>y==null?void 0:y.isTouched),c=s.some(y=>y==null?void 0:y.isBlurred),d=s.some(y=>y==null?void 0:y.isDirty),f=!d,h=a||i.isFormValidating;i.errors=Object.values(i.errorMap).reduce((y,x)=>x===void 0?y:typeof x=="string"?(y.push(x),y):(x&&Bb(x)&&y.push(x.form),y),[]);const g=i.errors.length===0,p=u&&g,v=i.submissionAttempts===0&&!l||!h&&!i.isSubmitting&&p;i={...i,isFieldsValidating:a,isFieldsValid:u,isFormValid:g,isValid:p,canSubmit:v,isTouched:l,isBlurred:c,isPristine:f,isDirty:d},this.state=i,this.store.state=this.state;const w=((r=this.options.transform)==null?void 0:r.deps)??[];(w.length!==this.prevTransformArray.length||w.some((y,x)=>y!==this.prevTransformArray[x]))&&((o=this.options.transform)==null||o.fn(this),this.store.state=this.state,this.prevTransformArray=w)}}),this.state=this.store.state,this.update(t||{})}runValidator(t){const n=this.options.validatorAdapter;return n&&typeof t.validate!="function"?n()[t.type](t.value,t.validate):t.validate(t.value)}setErrorMap(t){this.store.setState(n=>({...n,errorMap:{...n.errorMap,...t}}))}}function es(e){if(e){if(typeof e=="object"){const t=es(e.form).formError,n=e.fields;return{formError:t,fieldErrors:n}}return typeof e!="string"?{formError:"Invalid Form Values"}:{formError:e}}return{formError:void 0}}function Wr(e){switch(e){case"submit":return"onSubmit";case"blur":return"onBlur";case"mount":return"onMount";case"server":return"onServer";case"change":default:return"onChange"}}class Gb{constructor(t){this.options={},this.mount=()=>{const n=this.getInfo();n.instance=this;const r=this.form.store.subscribe(()=>{this.store.batch(()=>{const i=this.getValue(),s=this.getMeta();i!==this.state.value&&this.store.setState(a=>({...a,value:i})),s!==this.state.meta&&this.store.setState(a=>({...a,meta:s}))})});this.update(this.options);const{onMount:o}=this.options.validators||{};if(o){const i=this.runValidator({validate:o,value:{value:this.state.value,fieldApi:this,validationSource:"field"},type:"validate"});i&&this.setMeta(s=>({...s,errorMap:{...s==null?void 0:s.errorMap,onMount:i}}))}return()=>{r()}},this.update=n=>{if(this.state.value===void 0){const r=ef(n.form.options.defaultValues,n.name);n.defaultValue!==void 0?this.setValue(n.defaultValue,{dontUpdateMeta:!0}):r!==void 0&&this.setValue(r,{dontUpdateMeta:!0})}this._getMeta()===void 0&&this.setMeta(this.state.meta),this.options=n},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(n,r)=>{this.form.setFieldValue(this.name,n,r),this.validate("change")},this._getMeta=()=>this.form.getFieldMeta(this.name),this.getMeta=()=>this._getMeta()??{isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,errors:[],errorMap:{},...this.options.defaultMeta},this.setMeta=n=>this.form.setFieldMeta(this.name,n),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(n,r)=>this.form.pushFieldValue(this.name,n,r),this.insertValue=(n,r,o)=>this.form.insertFieldValue(this.name,n,r,o),this.replaceValue=(n,r,o)=>this.form.replaceFieldValue(this.name,n,r,o),this.removeValue=(n,r)=>this.form.removeFieldValue(this.name,n,r),this.swapValues=(n,r,o)=>this.form.swapFieldValues(this.name,n,r,o),this.moveValue=(n,r,o)=>this.form.moveFieldValues(this.name,n,r,o),this.getLinkedFields=n=>{const r=Object.values(this.form.fieldInfo),o=[];for(const i of r){if(!i.instance)continue;const{onChangeListenTo:s,onBlurListenTo:a}=i.instance.options.validators||{};n==="change"&&(s!=null&&s.includes(this.name))&&o.push(i.instance),n==="blur"&&(a!=null&&a.includes(this.name))&&o.push(i.instance)}return o},this.validateSync=(n,r)=>{const o=Ji(n,this.options),s=this.getLinkedFields(n).reduce((l,c)=>{const d=Ji(n,c.options);return d.forEach(f=>{f.field=c}),l.concat(d)},[]);let a=!1;this.form.store.batch(()=>{const l=(c,d)=>{const f=rr(d.cause),h=d.validate?ql(c.runValidator({validate:d.validate,value:{value:c.getValue(),validationSource:"field",fieldApi:c},type:"validate"})):r[f];c.state.meta.errorMap[f]!==h&&c.setMeta(g=>({...g,errorMap:{...g.errorMap,[rr(d.cause)]:h||r[f]}})),(h||r[f])&&(a=!0)};for(const c of o)l(this,c);for(const c of s)c.validate&&l(c.field,c)});const u=rr("submit");return this.state.meta.errorMap[u]&&n!=="submit"&&!a&&this.setMeta(l=>({...l,errorMap:{...l.errorMap,[u]:void 0}})),{hasErrored:a}},this.validateAsync=async(n,r)=>{const o=Zi(n,this.options),i=await r,s=this.getLinkedFields(n),a=s.reduce((f,h)=>{const g=Zi(n,h.options);return g.forEach(p=>{p.field=h}),f.concat(g)},[]);this.state.meta.isValidating||this.setMeta(f=>({...f,isValidating:!0}));for(const f of s)f.setMeta(h=>({...h,isValidating:!0}));const u=[],l=[],c=(f,h,g)=>{const p=rr(h.cause),v=f.getInfo().validationMetaMap[p];v==null||v.lastAbortController.abort();const w=new AbortController;this.getInfo().validationMetaMap[p]={lastAbortController:w},g.push(new Promise(async m=>{var y;let x;try{x=await new Promise((_,T)=>{this.timeoutIds[h.cause]&&clearTimeout(this.timeoutIds[h.cause]),this.timeoutIds[h.cause]=setTimeout(async()=>{if(w.signal.aborted)return _(void 0);try{_(await this.runValidator({validate:h.validate,value:{value:f.getValue(),fieldApi:f,signal:w.signal,validationSource:"field"},type:"validateAsync"}))}catch(V){T(V)}},h.debounceMs)})}catch(_){x=_}if(w.signal.aborted)return m(void 0);const C=ql(x),O=(y=i[this.name])==null?void 0:y[p],L=C||O;f.setMeta(_=>({..._,errorMap:{..._==null?void 0:_.errorMap,[p]:L}})),m(L)}))};for(const f of o)f.validate&&c(this,f,u);for(const f of a)f.validate&&c(f.field,f,l);let d=[];(u.length||l.length)&&(d=await Promise.all(u),await Promise.all(l)),this.setMeta(f=>({...f,isValidating:!1}));for(const f of s)f.setMeta(h=>({...h,isValidating:!1}));return d.filter(Boolean)},this.validate=n=>{var r;if(!this.state.meta.isTouched)return[];let o={},i=Promise.resolve({});try{const a=this.form.validate(n);if(a instanceof Promise)i=a;else{const u=a[this.name];u&&(o=u)}}catch{}const{hasErrored:s}=this.validateSync(n,o);return s&&!this.options.asyncAlways?((r=this.getInfo().validationMetaMap[rr(n)])==null||r.lastAbortController.abort(),this.state.meta.errors):this.validateAsync(n,i)},this.handleChange=n=>{this.setValue(n)},this.handleBlur=()=>{this.state.meta.isTouched||(this.setMeta(r=>({...r,isTouched:!0})),this.validate("change")),this.state.meta.isBlurred||this.setMeta(r=>({...r,isBlurred:!0})),this.validate("blur")},this.form=t.form,this.name=t.name,this.timeoutIds={},t.defaultValue!==void 0&&this.form.setFieldValue(this.name,t.defaultValue,{dontUpdateMeta:!0}),this.store=new Jd({value:this.getValue(),meta:this._getMeta()??{isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,errors:[],errorMap:{},...t.defaultMeta}},{onUpdate:()=>{const n=this.store.state;n.meta.errors=Object.values(n.meta.errorMap).filter(r=>r!==void 0),n.meta.isPristine=!n.meta.isDirty,this.prevState=n,this.state=n}}),this.state=this.store.state,this.prevState=this.state,this.options=t}runValidator(t){const n=[this.form.options.validatorAdapter,this.options.validatorAdapter];for(const r of n)if(r&&typeof t.validate!="function")return r()[t.type](t.value,t.validate);return t.validate(t.value)}setErrorMap(t){this.setMeta(n=>({...n,errorMap:{...n.errorMap,...t}}))}}function ql(e){if(e)return typeof e!="string"?"Invalid Form Values":e}function rr(e){switch(e){case"submit":return"onSubmit";case"blur":return"onBlur";case"mount":return"onMount";case"server":return"onServer";case"change":default:return"onChange"}}function Wl(e,t=n=>n){const[n,r]=co({value:t(e.state)}),o=e.subscribe(()=>{const i=t(e.state);r("value",Yu(i))});return W(()=>{o()}),()=>n.value}function Hb(e){const[t,n]=B(!1),r=K(()=>[t(),e]),o=e.store.subscribe(()=>n(i=>!i));return W(o),()=>r()[1]}function tf(e){const t=e(),n=new Gb(t),r=n;return r.Field=nf,Mt(()=>n.update(e())),Bn(()=>W(n.mount())),Hb(r)}function nf(e){const t=tf(()=>{const{children:n,...r}=e;return r});return K(()=>b(()=>e.children(t),{}))}function Ub(e){const t=e==null?void 0:e(),n=new zb(t),r=n;return r.Field=o=>b(nf,A(o,{form:n})),r.createField=o=>tf(()=>({...o(),form:n})),r.useStore=o=>Wl(n.store,o),r.Subscribe=o=>ga(o.children,Wl(n.store,o.selector)),Bn(n.mount),Mt(()=>n.update(e==null?void 0:e())),r}var Xo,Xl;function qb(){if(Xl)return Xo;Xl=1;class e{constructor(){this.max=1e3,this.map=new Map}get(n){const r=this.map.get(n);if(r!==void 0)return this.map.delete(n),this.map.set(n,r),r}delete(n){return this.map.delete(n)}set(n,r){if(!this.delete(n)&&r!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(n,r)}return this}}return Xo=e,Xo}var Qo,Ql;function ma(){if(Ql)return Qo;Ql=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Qo=r=>r?typeof r!="object"?e:r:t,Qo}var Xr={exports:{}},Yo,Yl;function va(){if(Yl)return Yo;Yl=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,o=t-6;return Yo={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Yo}var Zo,Zl;function Po(){if(Zl)return Zo;Zl=1;var e={};return Zo=typeof process=="object"&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{},Zo}var Jl;function ya(){return Jl||(Jl=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:o}=va(),i=Po();t=e.exports={};const s=t.re=[],a=t.safeRe=[],u=t.src=[],l=t.t={};let c=0;const d="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",o],[d,r]],h=p=>{for(const[v,w]of f)p=p.split(`${v}*`).join(`${v}{0,${w}}`).split(`${v}+`).join(`${v}{1,${w}}`);return p},g=(p,v,w)=>{const m=h(v),y=c++;i(p,y,v),l[p]=y,u[y]=v,s[y]=new RegExp(v,w?"g":void 0),a[y]=new RegExp(m,w?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),g("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),g("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${d}+`),g("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),g("FULL",`^${u[l.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),g("LOOSE",`^${u[l.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),g("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),g("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?(?:${u[l.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",u[l.COERCE],!0),g("COERCERTLFULL",u[l.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Xr,Xr.exports)),Xr.exports}var Jo,eu;function Wb(){if(eu)return Jo;eu=1;const e=/^[0-9]+$/,t=(r,o)=>{const i=e.test(r),s=e.test(o);return i&&s&&(r=+r,o=+o),r===o?0:i&&!s?-1:s&&!i?1:r<o?-1:1};return Jo={compareIdentifiers:t,rcompareIdentifiers:(r,o)=>t(o,r)},Jo}var ei,tu;function wa(){if(tu)return ei;tu=1;const e=Po(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=va(),{safeRe:r,t:o}=ya(),i=ma(),{compareIdentifiers:s}=Wb();class a{constructor(l,c){if(c=i(c),l instanceof a){if(l.loose===!!c.loose&&l.includePrerelease===!!c.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",l,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const d=l.trim().match(c.loose?r[o.LOOSE]:r[o.FULL]);if(!d)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+d[1],this.minor=+d[2],this.patch=+d[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");d[4]?this.prerelease=d[4].split(".").map(f=>{if(/^[0-9]+$/.test(f)){const h=+f;if(h>=0&&h<n)return h}return f}):this.prerelease=[],this.build=d[5]?d[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(l){if(e("SemVer.compare",this.version,this.options,l),!(l instanceof a)){if(typeof l=="string"&&l===this.version)return 0;l=new a(l,this.options)}return l.version===this.version?0:this.compareMain(l)||this.comparePre(l)}compareMain(l){return l instanceof a||(l=new a(l,this.options)),s(this.major,l.major)||s(this.minor,l.minor)||s(this.patch,l.patch)}comparePre(l){if(l instanceof a||(l=new a(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let c=0;do{const d=this.prerelease[c],f=l.prerelease[c];if(e("prerelease compare",c,d,f),d===void 0&&f===void 0)return 0;if(f===void 0)return 1;if(d===void 0)return-1;if(d===f)continue;return s(d,f)}while(++c)}compareBuild(l){l instanceof a||(l=new a(l,this.options));let c=0;do{const d=this.build[c],f=l.build[c];if(e("build compare",c,d,f),d===void 0&&f===void 0)return 0;if(f===void 0)return 1;if(d===void 0)return-1;if(d===f)continue;return s(d,f)}while(++c)}inc(l,c,d){switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",c,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",c,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",c,d),this.inc("pre",c,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",c,d),this.inc("pre",c,d);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const f=Number(d)?1:0;if(!c&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[f];else{let h=this.prerelease.length;for(;--h>=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(c===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(f)}}if(c){let h=[c,f];d===!1&&(h=[c]),s(this.prerelease[0],c)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return ei=a,ei}var ti,nu;function Xn(){if(nu)return ti;nu=1;const e=wa();return ti=(n,r,o)=>new e(n,o).compare(new e(r,o)),ti}var ni,ru;function Xb(){if(ru)return ni;ru=1;const e=Xn();return ni=(n,r,o)=>e(n,r,o)===0,ni}var ri,ou;function Qb(){if(ou)return ri;ou=1;const e=Xn();return ri=(n,r,o)=>e(n,r,o)!==0,ri}var oi,iu;function Yb(){if(iu)return oi;iu=1;const e=Xn();return oi=(n,r,o)=>e(n,r,o)>0,oi}var ii,su;function Zb(){if(su)return ii;su=1;const e=Xn();return ii=(n,r,o)=>e(n,r,o)>=0,ii}var si,au;function Jb(){if(au)return si;au=1;const e=Xn();return si=(n,r,o)=>e(n,r,o)<0,si}var ai,lu;function eS(){if(lu)return ai;lu=1;const e=Xn();return ai=(n,r,o)=>e(n,r,o)<=0,ai}var li,uu;function tS(){if(uu)return li;uu=1;const e=Xb(),t=Qb(),n=Yb(),r=Zb(),o=Jb(),i=eS();return li=(a,u,l,c)=>{switch(u){case"===":return typeof a=="object"&&(a=a.version),typeof l=="object"&&(l=l.version),a===l;case"!==":return typeof a=="object"&&(a=a.version),typeof l=="object"&&(l=l.version),a!==l;case"":case"=":case"==":return e(a,l,c);case"!=":return t(a,l,c);case">":return n(a,l,c);case">=":return r(a,l,c);case"<":return o(a,l,c);case"<=":return i(a,l,c);default:throw new TypeError(`Invalid operator: ${u}`)}},li}var ui,cu;function nS(){if(cu)return ui;cu=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(c,d){if(d=n(d),c instanceof t){if(c.loose===!!d.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),s("comparator",c,d),this.options=d,this.loose=!!d.loose,this.parse(c),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(c){const d=this.options.loose?r[o.COMPARATORLOOSE]:r[o.COMPARATOR],f=c.match(d);if(!f)throw new TypeError(`Invalid comparator: ${c}`);this.operator=f[1]!==void 0?f[1]:"",this.operator==="="&&(this.operator=""),f[2]?this.semver=new a(f[2],this.options.loose):this.semver=e}toString(){return this.value}test(c){if(s("Comparator.test",c,this.options.loose),this.semver===e||c===e)return!0;if(typeof c=="string")try{c=new a(c,this.options)}catch{return!1}return i(c,this.operator,this.semver,this.options)}intersects(c,d){if(!(c instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(c.value,d).test(this.value):c.operator===""?c.value===""?!0:new u(this.value,d).test(c.semver):(d=n(d),d.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!d.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||i(this.semver,"<",c.semver,d)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||i(this.semver,">",c.semver,d)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}ui=t;const n=ma(),{safeRe:r,t:o}=ya(),i=tS(),s=Po(),a=wa(),u=rf();return ui}var ci,du;function rf(){if(du)return ci;du=1;const e=/\s+/g;class t{constructor(R,S){if(S=o(S),R instanceof t)return R.loose===!!S.loose&&R.includePrerelease===!!S.includePrerelease?R:new t(R.raw,S);if(R instanceof i)return this.raw=R.value,this.set=[[R]],this.formatted=void 0,this;if(this.options=S,this.loose=!!S.loose,this.includePrerelease=!!S.includePrerelease,this.raw=R.trim().replace(e," "),this.set=this.raw.split("||").map(I=>this.parseRange(I.trim())).filter(I=>I.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const I=this.set[0];if(this.set=this.set.filter(M=>!p(M[0])),this.set.length===0)this.set=[I];else if(this.set.length>1){for(const M of this.set)if(M.length===1&&v(M[0])){this.set=[M];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let R=0;R<this.set.length;R++){R>0&&(this.formatted+="||");const S=this.set[R];for(let I=0;I<S.length;I++)I>0&&(this.formatted+=" "),this.formatted+=S[I].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(R){const I=((this.options.includePrerelease&&h)|(this.options.loose&&g))+":"+R,M=r.get(I);if(M)return M;const F=this.options.loose,D=F?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];R=R.replace(D,z(this.options.includePrerelease)),s("hyphen replace",R),R=R.replace(u[l.COMPARATORTRIM],c),s("comparator trim",R),R=R.replace(u[l.TILDETRIM],d),s("tilde trim",R),R=R.replace(u[l.CARETTRIM],f),s("caret trim",R);let j=R.split(" ").map(ne=>m(ne,this.options)).join(" ").split(/\s+/).map(ne=>N(ne,this.options));F&&(j=j.filter(ne=>(s("loose invalid filter",ne,this.options),!!ne.match(u[l.COMPARATORLOOSE])))),s("range list",j);const H=new Map,X=j.map(ne=>new i(ne,this.options));for(const ne of X){if(p(ne))return[ne];H.set(ne.value,ne)}H.size>1&&H.has("")&&H.delete("");const le=[...H.values()];return r.set(I,le),le}intersects(R,S){if(!(R instanceof t))throw new TypeError("a Range is required");return this.set.some(I=>w(I,S)&&R.set.some(M=>w(M,S)&&I.every(F=>M.every(D=>F.intersects(D,S)))))}test(R){if(!R)return!1;if(typeof R=="string")try{R=new a(R,this.options)}catch{return!1}for(let S=0;S<this.set.length;S++)if(ie(this.set[S],R,this.options))return!0;return!1}}ci=t;const n=qb(),r=new n,o=ma(),i=nS(),s=Po(),a=wa(),{safeRe:u,t:l,comparatorTrimReplace:c,tildeTrimReplace:d,caretTrimReplace:f}=ya(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:g}=va(),p=P=>P.value==="<0.0.0-0",v=P=>P.value==="",w=(P,R)=>{let S=!0;const I=P.slice();let M=I.pop();for(;S&&I.length;)S=I.every(F=>M.intersects(F,R)),M=I.pop();return S},m=(P,R)=>(s("comp",P,R),P=O(P,R),s("caret",P),P=x(P,R),s("tildes",P),P=_(P,R),s("xrange",P),P=V(P,R),s("stars",P),P),y=P=>!P||P.toLowerCase()==="x"||P==="*",x=(P,R)=>P.trim().split(/\s+/).map(S=>C(S,R)).join(" "),C=(P,R)=>{const S=R.loose?u[l.TILDELOOSE]:u[l.TILDE];return P.replace(S,(I,M,F,D,j)=>{s("tilde",P,I,M,F,D,j);let H;return y(M)?H="":y(F)?H=`>=${M}.0.0 <${+M+1}.0.0-0`:y(D)?H=`>=${M}.${F}.0 <${M}.${+F+1}.0-0`:j?(s("replaceTilde pr",j),H=`>=${M}.${F}.${D}-${j} <${M}.${+F+1}.0-0`):H=`>=${M}.${F}.${D} <${M}.${+F+1}.0-0`,s("tilde return",H),H})},O=(P,R)=>P.trim().split(/\s+/).map(S=>L(S,R)).join(" "),L=(P,R)=>{s("caret",P,R);const S=R.loose?u[l.CARETLOOSE]:u[l.CARET],I=R.includePrerelease?"-0":"";return P.replace(S,(M,F,D,j,H)=>{s("caret",P,M,F,D,j,H);let X;return y(F)?X="":y(D)?X=`>=${F}.0.0${I} <${+F+1}.0.0-0`:y(j)?F==="0"?X=`>=${F}.${D}.0${I} <${F}.${+D+1}.0-0`:X=`>=${F}.${D}.0${I} <${+F+1}.0.0-0`:H?(s("replaceCaret pr",H),F==="0"?D==="0"?X=`>=${F}.${D}.${j}-${H} <${F}.${D}.${+j+1}-0`:X=`>=${F}.${D}.${j}-${H} <${F}.${+D+1}.0-0`:X=`>=${F}.${D}.${j}-${H} <${+F+1}.0.0-0`):(s("no pr"),F==="0"?D==="0"?X=`>=${F}.${D}.${j}${I} <${F}.${D}.${+j+1}-0`:X=`>=${F}.${D}.${j}${I} <${F}.${+D+1}.0-0`:X=`>=${F}.${D}.${j} <${+F+1}.0.0-0`),s("caret return",X),X})},_=(P,R)=>(s("replaceXRanges",P,R),P.split(/\s+/).map(S=>T(S,R)).join(" ")),T=(P,R)=>{P=P.trim();const S=R.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return P.replace(S,(I,M,F,D,j,H)=>{s("xRange",P,I,M,F,D,j,H);const X=y(F),le=X||y(D),ne=le||y(j),Ae=ne;return M==="="&&Ae&&(M=""),H=R.includePrerelease?"-0":"",X?M===">"||M==="<"?I="<0.0.0-0":I="*":M&&Ae?(le&&(D=0),j=0,M===">"?(M=">=",le?(F=+F+1,D=0,j=0):(D=+D+1,j=0)):M==="<="&&(M="<",le?F=+F+1:D=+D+1),M==="<"&&(H="-0"),I=`${M+F}.${D}.${j}${H}`):le?I=`>=${F}.0.0${H} <${+F+1}.0.0-0`:ne&&(I=`>=${F}.${D}.0${H} <${F}.${+D+1}.0-0`),s("xRange return",I),I})},V=(P,R)=>(s("replaceStars",P,R),P.trim().replace(u[l.STAR],"")),N=(P,R)=>(s("replaceGTE0",P,R),P.trim().replace(u[R.includePrerelease?l.GTE0PRE:l.GTE0],"")),z=P=>(R,S,I,M,F,D,j,H,X,le,ne,Ae)=>(y(I)?S="":y(M)?S=`>=${I}.0.0${P?"-0":""}`:y(F)?S=`>=${I}.${M}.0${P?"-0":""}`:D?S=`>=${S}`:S=`>=${S}${P?"-0":""}`,y(X)?H="":y(le)?H=`<${+X+1}.0.0-0`:y(ne)?H=`<${X}.${+le+1}.0-0`:Ae?H=`<=${X}.${le}.${ne}-${Ae}`:P?H=`<${X}.${le}.${+ne+1}-0`:H=`<=${H}`,`${S} ${H}`.trim()),ie=(P,R,S)=>{for(let I=0;I<P.length;I++)if(!P[I].test(R))return!1;if(R.prerelease.length&&!S.includePrerelease){for(let I=0;I<P.length;I++)if(s(P[I].semver),P[I].semver!==i.ANY&&P[I].semver.prerelease.length>0){const M=P[I].semver;if(M.major===R.major&&M.minor===R.minor&&M.patch===R.patch)return!0}return!1}return!0};return ci}var di,fu;function rS(){if(fu)return di;fu=1;const e=rf();return di=(n,r)=>{try{return new e(n,r).range||"*"}catch{return null}},di}var oS=rS();const hu=jc(oS);var iS=he('<form class="flex flex-col gap-3"><div></div><div></div><div><div class="flex items-center space-x-2"></div><p class="text-xs text-muted-foreground mt-[2px]">When disabled, this update will not be available to your users.</p></div><div><div class="flex items-center space-x-2"></div><p class="text-xs text-muted-foreground mt-[2px]">When enabled, this update will require users to update before continuing to use the application.</p></div><div class="flex justify-end">'),sS=he('<em class="text-xs text-red-500">'),aS=he('<em class="text-xs text-muted-foreground">'),lS=he('<a target=_blank rel=noreferrer class="text-xs text-muted-foreground">Commit Hash: '),uS=he('<p class="text-xs text-muted-foreground">Commit Hash: ');const cS=({bundleId:e,onClose:t})=>{const n=mb(e);return b(Pm,{class:"flex flex-col h-full",get children(){return[b(Im,{class:"mb-4",get children(){return b(Mm,{get children(){return["Edit ",e]}})}}),b(Se,{get when(){return n.data},get fallback(){return K(()=>!!n.isFetched)()?b(Fm,{get children(){return["No update bundle found for bundle id ",e]}}):b(Rb,{height:374,radius:10})},children:r=>b(dS,{get bundle(){return r()},onEditSuccess:t})})]}})},dS=({bundle:e,onEditSuccess:t})=>{const n=lc(),r=vb(),[o,i]=B(!1),s=K(()=>{var c,d;return((d=(c=r.data)==null?void 0:c.console)==null?void 0:d.gitUrl)??null}),a=K(()=>e.gitCommitHash),u=Ub(()=>({defaultValues:{message:e.message,targetAppVersion:e.targetAppVersion,enabled:e.enabled,shouldForceUpdate:e.shouldForceUpdate},onSubmit:async({value:c})=>{i(!0);try{const d=await Tr.bundles[":bundleId"].$patch({param:{bundleId:e.id},json:c});if(d.status!==200){const f=await d.json();tl({title:"Error",description:f.error,variant:"error"})}}catch(d){d instanceof Error&&tl({title:"Error",description:d.message,variant:"error"})}finally{i(!1),n.invalidateQueries({queryKey:["bundle",e.id]}),n.invalidateQueries({queryKey:["bundles"]}),t()}}})),l=u.useStore(c=>c.isValid);return(()=>{var c=iS(),d=c.firstChild,f=d.nextSibling,h=f.nextSibling,g=h.firstChild,p=h.nextSibling,v=p.firstChild,w=p.nextSibling;return c.addEventListener("submit",m=>{m.preventDefault(),m.stopPropagation(),u.handleSubmit()}),fe(d,b(Gl,{class:"grid w-full max-w-sm items-center gap-1.5",get children(){return[b(Ul,{for:"message",children:"Message"}),b(u.Field,{name:"message",children:m=>b(Hl,{type:"text",id:"message",placeholder:"Message",get name(){return m().name},get value(){return m().state.value??""},get onBlur(){return m().handleBlur},onInput:y=>m().handleChange(y.currentTarget.value)})})]}})),fe(f,b(Gl,{class:"grid w-full max-w-sm items-center gap-1.5",get children(){return[b(Ul,{for:"targetAppVersion",children:"Target App Version"}),b(u.Field,{name:"targetAppVersion",validators:{onChange:({value:m})=>{if((m==null?void 0:m.length)===0||!hu(m))return"Invalid target app version"}},children:m=>[b(Hl,{type:"text",id:"targetAppVersion",get class(){return de(m().state.meta.errors.length>0&&"border-red-500 focus-visible:ring-red-500")},placeholder:"Target App Version",get name(){return m().name},get value(){return m().state.value??""},get onBlur(){return m().handleBlur},onInput:y=>m().handleChange(y.currentTarget.value)}),K(()=>K(()=>m().state.meta.errors.length>0)()?(()=>{var y=sS();return fe(y,()=>m().state.meta.errors.join(", ")),y})():(()=>{var y=aS();return fe(y,()=>hu(m().state.value)),y})())]})]}})),fe(g,b(u.Field,{name:"enabled",children:m=>b(Kl,{class:"flex items-center space-x-2",get checked(){return m().state.value},get name(){return m().name},onChange:y=>m().handleChange(y),get children(){return[b(jl,{get children(){return b(Bl,{})}}),b(zl,{children:"Enabled"})]}})})),fe(v,b(u.Field,{name:"shouldForceUpdate",children:m=>b(Kl,{class:"flex items-center space-x-2",get checked(){return m().state.value},get name(){return m().name},onChange:y=>m().handleChange(y),get children(){return[b(jl,{get children(){return b(Bl,{})}}),b(zl,{children:"Force Update"})]}})})),fe(c,b(Se,{get when(){return!o()},get fallback(){return b(Vl,{type:"submit",class:"mt-4",disabled:!0,get children(){return b(Gm,{class:"animate-spin"})}})},get children(){return b(Vl,{type:"submit",class:"mt-4",get disabled(){return!l()},children:"Save"})}}),w),fe(w,b(Se,{get when(){return a()},children:m=>s()?(()=>{var y=lS();return y.firstChild,fe(y,()=>m().slice(0,8),null),Ke(()=>Nn(y,"href",`${s()}/commit/${m}`)),y})():(()=>{var y=uS();return y.firstChild,fe(y,()=>m().slice(0,8),null),y})()})),c})()};function fS(){const{bundleIdFilter:e,setBundleIdFilter:t}=Kc(),n=K(()=>e()!==null),r=()=>{t(null)};return b(Sm,{get open(){return n()},onOpenChange:o=>{o||t(null)},get children(){return[b(xb,{columns:qm,onRowClick:o=>{t(o.id)}}),b(Se,{get when(){return e()},get children(){return b(Cf,{get children(){return b(cS,{get bundleId(){return e()},onClose:r})}})}})]}})}const hS=new og;function gS(){return b(ig,{client:hS,get children(){return[b(Fh,{root:e=>b(Qf,{get children(){return[b(Jf,{children:"HotUpdater Console"}),b(_h,{get children(){return e.children}})]}}),get children(){return b(xh,{path:"/",component:fS})}}),b(Jp,{})]}})}const gu=document.getElementById("root");gu&&Df(()=>b(gS,{}),gu);
27
+ */function kl(e,t){return e?typeof e=="function"?b(e,t):e:null}function _w(e){const t=A({state:{},onStateChange:()=>{},renderFallbackValue:null,mergeOptions:(i,s)=>A(i,s)},e),n=Mw(t),[r,o]=co(n.initialState);return Mt(()=>{n.setOptions(i=>A(i,e,{state:A(r,e.state||{}),onStateChange:s=>{o(s),e.onStateChange==null||e.onStateChange(s)}}))}),n}var xo=he("<li>"),kw=he("<ul>"),Vw={};Xt(Vw,{Ellipsis:()=>Ys,Item:()=>Zs,Items:()=>Js,Next:()=>ea,Pagination:()=>Nw,Previous:()=>ta,Root:()=>na});function Ys(e){return(()=>{var t=xo();return fe(t,b(ae,A({as:"div"},e))),t})()}var Vd=we();function Co(){const e=me(Vd);if(e===void 0)throw new Error("[kobalte]: `usePaginationContext` must be used within a `Pagination` component");return e}function Zs(e){const t=Co(),[n,r]=k(e,["page","onClick"]),o=()=>t.page()===n.page,i=()=>{t.setPage(n.page)};return(()=>{var s=xo();return fe(s,b(wt,A({get"aria-current"(){return o()?"page":void 0},get"data-current"(){return o()?"":void 0},get onClick(){return be([n.onClick,i])}},r))),s})()}function Js(e){const t=Co(),n=K(()=>{const{count:r,siblingCount:o,page:i,fixedItems:s,showFirst:a,showLast:l}=t,c=r()<2*o()+(s()?6:4);if(c)return{renderItemsDirectly:c};const u=a()&&i()-1>o(),f=l()&&r()-i()>o();let d=i()-(a()?2:1)>o(),h=r()-i()-(l()?1:0)>o(),g=Math.min(i()-1,o()),p=Math.min(r()-i(),o());if(s()!==!1){const v=g,w=p;g+=Math.max(o()-w,0),p+=Math.max(o()-v,0),u||p++,f||g++,s()===!0&&(d||p++,h||g++),i()-g-(a()?2:1)===1&&(d=!1,g++),r()-i()-p-(l()?1:0)===1&&(h=!1,p++)}return{showFirst:u,showLast:f,showFirstEllipsis:d,showLastEllipsis:h,previousSiblingCount:g,nextSiblingCount:p,renderItemsDirectly:c}});return b(Se,{get when(){return n().renderItemsDirectly},get fallback(){return[b(Se,{get when(){return n().showFirst},get children(){return t.renderItem(1)}}),b(Se,{get when(){return n().showFirstEllipsis},get children(){return t.renderEllipsis()}}),b(nt,{get each(){return[...Array(n().previousSiblingCount).keys()].reverse()},children:r=>K(()=>t.renderItem(t.page()-(r+1)))}),K(()=>t.renderItem(t.page())),b(nt,{get each(){return[...Array(n().nextSiblingCount).keys()]},children:r=>K(()=>t.renderItem(t.page()+(r+1)))}),b(Se,{get when(){return n().showLastEllipsis},get children(){return t.renderEllipsis()}}),b(Se,{get when(){return n().showLast},get children(){return t.renderItem(t.count())}})]},get children(){return b(nt,{get each(){return[...Array(t.count()).keys()]},children:r=>K(()=>t.renderItem(r+1))})}})}function ea(e){const t=Co(),[n,r]=k(e,["onClick"]),o=()=>{t.setPage(t.page()+1)},i=()=>t.page()===t.count();return(()=>{var s=xo();return fe(s,b(wt,A({get tabIndex(){return i()||t.page()===t.count()?-1:void 0},get disabled(){return i()},get"aria-disabled"(){return i()||void 0},get"data-disabled"(){return i()?"":void 0},get onClick(){return be([n.onClick,o])}},r))),s})()}function ta(e){const t=Co(),[n,r]=k(e,["onClick"]),o=()=>{t.setPage(t.page()-1)},i=()=>t.page()===1;return(()=>{var s=xo();return fe(s,b(wt,A({get tabIndex(){return i()||t.page()===1?-1:void 0},get disabled(){return i()},get"aria-disabled"(){return i()||void 0},get"data-disabled"(){return i()?"":void 0},get onClick(){return be([n.onClick,o])}},r))),s})()}function na(e){const t=`pagination-${Ee()}`,n=Z({id:t},e),[r,o]=k(n,["page","defaultPage","onPageChange","count","siblingCount","showFirst","showLast","fixedItems","itemComponent","ellipsisComponent","disabled","children"]),i=pt({defaultValue:()=>r.defaultPage??1,onChange:r.onPageChange,value:()=>r.page}),s={count:()=>r.count,siblingCount:()=>r.siblingCount??1,showFirst:()=>r.showFirst??!0,showLast:()=>r.showLast??!0,fixedItems:()=>r.fixedItems??!1,isDisabled:()=>r.disabled??!1,renderItem:a=>r.itemComponent({page:a}),renderEllipsis:r.ellipsisComponent,page:()=>Math.min(i[0]()??1,r.count),setPage:i[1]};return b(Vd.Provider,{value:s,get children(){return b(ae,A({as:"nav",get"data-disabled"(){return r.disabled?"":void 0}},o,{get children(){var a=kw();return fe(a,()=>r.children),a}}))}})}var Nw=Object.assign(na,{Ellipsis:Ys,Item:Zs,Items:Js,Next:ea,Previous:ta});const Eo=Fr("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-10"}},defaultVariants:{variant:"default",size:"default"}}),Vl=e=>{const[t,n]=k(e,["variant","size","class"]);return b(wt,A({get class(){return de(Eo({variant:t.variant,size:t.size}),t.class)}},n))};var Kw=he('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><circle cx=12 cy=12 r=1></circle><circle cx=19 cy=12 r=1></circle><circle cx=5 cy=12 r=1>'),jw=he("<span class=sr-only>More pages"),Bw=he('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><path d="M15 6l-6 6l6 6">'),zw=he("<span>Previous"),Gw=he("<span>Next"),Hw=he('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round class=size-4><path d="M9 6l6 6l-6 6">');const Uw=Js,qw=e=>{const[t,n]=k(e,["class"]);return b(na,A({get class(){return de("[&>*]:flex [&>*]:flex-row [&>*]:items-center [&>*]:gap-1",t.class)}},n))},Ww=e=>{const[t,n]=k(e,["class"]);return b(Zs,A({get class(){return de(Eo({variant:"ghost"}),"size-10 data-[current]:border",t.class)}},n))},Xw=e=>{const[t,n]=k(e,["class"]);return b(Ys,A({get class(){return de("flex size-10 items-center justify-center",t.class)}},n,{get children(){return[Kw(),jw()]}}))},Qw=e=>{const[t,n]=k(e,["class","children"]);return b(ta,A({get class(){return de(Eo({variant:"ghost"}),"gap-1 pl-2.5",t.class)}},n,{get children(){return t.children??[Bw(),zw()]}}))},Yw=e=>{const[t,n]=k(e,["class","children"]);return b(ea,A({get class(){return de(Eo({variant:"ghost"}),"gap-1 pl-2.5",t.class)}},n,{get children(){return t.children??[Gw(),Hw()]}}))};var Zw=he('<div class="relative w-full overflow-auto"><table>'),Jw=he("<thead>"),eb=he("<tbody>"),tb=he("<tr>"),nb=he("<th>"),rb=he("<td>");const ob=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=Zw(),o=r.firstChild;return at(o,A({get class(){return de("w-full caption-bottom text-sm",t.class)}},n),!1,!1),r})()},ib=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=Jw();return at(r,A({get class(){return de("[&_tr]:border-b",t.class)}},n),!1,!1),r})()},sb=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=eb();return at(r,A({get class(){return de(t.class)}},n),!1,!1),r})()},Ho=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=tb();return at(r,A({get class(){return de("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t.class)}},n),!1,!1),r})()},ab=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=nb();return at(r,A({get class(){return de("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t.class)}},n),!1,!1),r})()},Nl=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=rb();return at(r,A({get class(){return de("p-4 align-middle [&:has([role=checkbox])]:pr-0",t.class)}},n),!1,!1),r})()};var lb=(e,t,n={})=>{let r=`${e}=${t}`;if(e.startsWith("__Secure-")&&!n.secure)throw new Error("__Secure- Cookie must have Secure attributes");if(e.startsWith("__Host-")){if(!n.secure)throw new Error("__Host- Cookie must have Secure attributes");if(n.path!=="/")throw new Error('__Host- Cookie must have Path attributes with "/"');if(n.domain)throw new Error("__Host- Cookie must not have Domain attributes")}if(n&&typeof n.maxAge=="number"&&n.maxAge>=0){if(n.maxAge>3456e4)throw new Error("Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.");r+=`; Max-Age=${Math.floor(n.maxAge)}`}if(n.domain&&n.prefix!=="host"&&(r+=`; Domain=${n.domain}`),n.path&&(r+=`; Path=${n.path}`),n.expires){if(n.expires.getTime()-Date.now()>3456e7)throw new Error("Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.");r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+="; HttpOnly"),n.secure&&(r+="; Secure"),n.sameSite&&(r+=`; SameSite=${n.sameSite.charAt(0).toUpperCase()+n.sameSite.slice(1)}`),n.partitioned){if(!n.secure)throw new Error("Partitioned Cookie must have Secure attributes");r+="; Partitioned"}return r},ub=(e,t,n)=>(t=encodeURIComponent(t),lb(e,t,n)),cb=(e,t)=>(e=e.replace(/\/+$/,""),e=e+"/",t=t.replace(/^\/+/,""),e+t),Qi=(e,t)=>{for(const[n,r]of Object.entries(t)){const o=new RegExp("/:"+n+"(?:{[^/]+})?\\??");e=e.replace(o,r?`/${r}`:"")}return e},db=(e,t)=>{switch(t){case"ws":return e.replace(/^http/,"ws");case"http":return e.replace(/^ws/,"http")}},fb=e=>/^https?:\/\/[^\/]+?\/index$/.test(e)?e.replace(/\/index$/,"/"):e.replace(/\/index$/,"");function Ur(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Nd(e,t){if(!Ur(e)&&!Ur(t))return t;const n={...e};for(const r in t){const o=t[r];Ur(n[r])&&Ur(o)?n[r]=Nd(n[r],o):n[r]=o}return n}var Kd=(e,t)=>new Proxy(()=>{},{get(r,o){if(!(typeof o!="string"||o==="then"))return Kd(e,[...t,o])},apply(r,o,i){return e({path:t,args:i})}}),hb=class{constructor(e,t){Re(this,"url");Re(this,"method");Re(this,"queryParams");Re(this,"pathParams",{});Re(this,"rBody");Re(this,"cType");Re(this,"fetch",async(e,t)=>{if(e){if(e.query){for(const[a,l]of Object.entries(e.query))if(l!==void 0)if(this.queryParams||(this.queryParams=new URLSearchParams),Array.isArray(l))for(const c of l)this.queryParams.append(a,c);else this.queryParams.set(a,l)}if(e.form){const a=new FormData;for(const[l,c]of Object.entries(e.form))if(Array.isArray(c))for(const u of c)a.append(l,u);else a.append(l,c);this.rBody=a}e.json&&(this.rBody=JSON.stringify(e.json),this.cType="application/json"),e.param&&(this.pathParams=e.param)}let n=this.method.toUpperCase();const r={...(e==null?void 0:e.header)??{},...typeof(t==null?void 0:t.headers)=="function"?await t.headers():t!=null&&t.headers?t.headers:{}};if(e!=null&&e.cookie){const a=[];for(const[l,c]of Object.entries(e.cookie))a.push(ub(l,c,{path:"/"}));r.Cookie=a.join(",")}this.cType&&(r["Content-Type"]=this.cType);const o=new Headers(r??void 0);let i=this.url;i=fb(i),i=Qi(i,this.pathParams),this.queryParams&&(i=i+"?"+this.queryParams.toString()),n=this.method.toUpperCase();const s=!(n==="GET"||n==="HEAD");return((t==null?void 0:t.fetch)||fetch)(i,{body:s?this.rBody:void 0,method:n,headers:o,...t==null?void 0:t.init})});this.url=e,this.method=t}},gb=(e,t)=>Kd(function n(r){var c;const o=[...r.path];if(o[o.length-1]==="toString")return o[o.length-2]==="name"?o[o.length-3]||"":n.toString();if(o[o.length-1]==="valueOf")return o[o.length-2]==="name"?o[o.length-3]||"":n;let i="";if(/^\$/.test(o[o.length-1])){const u=o.pop();u&&(i=u.replace(/^\$/,""))}const s=o.join("/"),a=cb(e,s);if(i==="url")return r.args[0]&&r.args[0].param?new URL(Qi(a,r.args[0].param)):new URL(a);if(i==="ws"){const u=db(r.args[0]&&r.args[0].param?Qi(a,r.args[0].param):a,"ws"),f=new URL(u),d=(c=r.args[0])==null?void 0:c.query;return d&&Object.entries(d).forEach(([g,p])=>{Array.isArray(p)?p.forEach(v=>f.searchParams.append(g,v)):f.searchParams.set(g,p)}),((...g)=>(t==null?void 0:t.webSocket)!==void 0&&typeof t.webSocket=="function"?t.webSocket(...g):new WebSocket(...g))(f.toString())}const l=new hb(a,i);if(i){t??(t={});const u=Nd(t,{...r.args[1]??{}});return l.fetch(r.args[0],u)}return l},[]);const Tr=gb("/rpc"),Uo="production",pb=e=>fo(()=>({queryKey:["bundles",e()],queryFn:async()=>(await Tr.bundles.$get({query:e()})).json(),placeholderData:t=>t,staleTime:Number.POSITIVE_INFINITY})),mb=e=>fo(()=>({queryKey:["bundle",e],queryFn:()=>Tr.bundles[":bundleId"].$get({param:{bundleId:e}}).then(t=>t.json()),placeholderData:t=>t,staleTime:Number.POSITIVE_INFINITY})),vb=()=>fo(()=>({queryKey:["config"],queryFn:()=>Tr.config.$get().then(e=>e.json()),staleTime:Number.POSITIVE_INFINITY,retryOnMount:!1})),yb=()=>fo(()=>({queryKey:["channels"],queryFn:()=>Tr.channels.$get().then(e=>e.json()),staleTime:Number.POSITIVE_INFINITY,retryOnMount:!1,select:e=>!e||e.length===0?null:e.includes(Uo)?[Uo,...e.filter(t=>t!==Uo)]:e}));var wb=he('<div class="transition-opacity duration-300"><div class="flex flex-row justify-end p-3"><div class="flex items-center gap-4"><div class="text-sm text-muted-foreground">Platform:</div><div class="text-sm text-muted-foreground">Channel:</div></div></div><div class="border rounded-md">');const bb=20,[nr,Sb]=B({pageIndex:0,pageSize:bb});function xb(e){const[t]=k(e,["columns","onRowClick"]),{channelFilter:n,platformFilter:r,setPlatformFilter:o,setChannelFilter:i}=Kc(),s=K(()=>({channel:n()??void 0,platform:r()??void 0,limit:nr().pageSize.toString(),offset:(nr().pageIndex*nr().pageSize).toString()})),a=pb(s),l=K(()=>a.data??[]),c=_w({get data(){return l()},columns:t.columns,getCoreRowModel:Fw(),getPaginationRowModel:Lw(),getFilteredRowModel:Dw(),state:{get pagination(){return nr()},get globalFilter(){return r()}},onPaginationChange:Sb,globalFilterFn:(d,h,g)=>g?d.original.platform.toLowerCase()===g:!0,manualPagination:!1}),u=d=>()=>{t.onRowClick(d.original)},f=yb();return U(()=>{f.isFetched&&f.data&&n()===null&&i(f.data[0])}),(()=>{var d=wb(),h=d.firstChild,g=h.firstChild,p=g.firstChild,v=p.nextSibling,w=h.nextSibling;return fe(g,b(Al,{get children(){return b(Fl,{get children(){return[b($l,{class:"w-[100px]",get children(){return[K(()=>K(()=>!!r())()?r():"All"),b(Ol,{})]}}),b(Tl,{get children(){return b(nt,{each:[{label:"All",value:null},{label:"iOS",value:"ios"},{label:"Android",value:"android"}],children:m=>b(Dl,{get classList(){return{"bg-primary text-primary-foreground":m.value===r()}},onClick:()=>o(m.value),get children(){return m.label}})})}})]}})}}),v),fe(g,b(Al,{get children(){return b(Fl,{get children(){return[b($l,{class:"w-[100px]",get children(){return[K(()=>n()),b(Ol,{})]}}),b(Tl,{get children(){return b(nt,{get each(){return f.data},children:m=>b(Dl,{get classList(){return{"bg-primary text-primary-foreground":m===n()}},onClick:()=>i(m),children:m})})}})]}})}}),null),fe(w,b(ob,{get children(){return[b(ib,{get children(){return b(nt,{get each(){return c.getHeaderGroups()},children:m=>b(Ho,{get children(){return b(nt,{get each(){return m.headers},children:y=>b(ab,{get children(){return K(()=>!!y.isPlaceholder)()?null:kl(y.column.columnDef.header,y.getContext())}})})}})})}}),b(sb,{get children(){return K(()=>{var m;return!!(a.isFetched&&((m=c.getRowModel().rows)==null?void 0:m.length)===0)})()?b(Ho,{get children(){return b(Nl,{get colSpan(){return t.columns.length},class:"h-full text-center",children:"No results."})}}):b(nt,{get each(){return c.getRowModel().rows},children:m=>b(Ho,{get"data-state"(){return m.getIsSelected()&&"selected"},class:"cursor-pointer",get onClick(){return u(m)},get children(){return b(nt,{get each(){return m.getVisibleCells()},children:y=>b(Nl,{get children(){return kl(y.column.columnDef.cell,y.getContext())}})})}})})}})]}})),fe(d,b(qw,{class:"mt-2.5 w-full [&>ul]:justify-center",itemComponent:m=>b(Ww,{get page(){return m.page},onClick:()=>c.setPageIndex(m.page-1),get children(){return m.page}}),ellipsisComponent:()=>b(Xw,{}),get count(){var m;return Math.ceil((((m=l())==null?void 0:m.length)??0)/nr().pageSize)},get children(){return[b(Qw,{onClick:()=>c.previousPage(),get disabled(){return!c.getCanPreviousPage()}}),b(Uw,{}),b(Yw,{onClick:()=>c.nextPage(),get disabled(){return!c.getCanNextPage()}})]}}),null),Ke(m=>{var y=!!a.isFetching,x=!!a.isFetching;return y!==m.e&&d.classList.toggle("opacity-50",m.e=y),x!==m.t&&w.classList.toggle("min-h-[400px]",m.t=x),m},{e:void 0,t:void 0}),d})()}var Cb={};Xt(Cb,{Root:()=>ra,Skeleton:()=>Eb});function ra(e){const t=`skeleton-${Ee()}`,n=Z({visible:!0,animate:!0,id:t},e),[r,o]=k(n,["style","radius","animate","height","width","visible","circle"]);return b(ae,A({as:"div",role:"group",get"data-animate"(){return r.animate||void 0},get"data-visible"(){return r.visible||void 0},get style(){return vt({"border-radius":r.circle?"9999px":r.radius?`${r.radius}px`:void 0,width:r.circle?`${r.height}px`:r.width?`${r.width}px`:"100%",height:r.height?`${r.height}px`:"auto"},r.style)}},o))}var Eb=ra;const Rb=e=>{const[t,n]=k(e,["class"]);return b(ra,A({get class(){return de("bg-primary/10 data-[animate='true']:animate-pulse",t.class)}},n))};var jd=["id","name","validationState","required","disabled","readOnly"];function Bd(e){const t=`form-control-${Ee()}`,n=Z({id:t},e),[r,o]=B(),[i,s]=B(),[a,l]=B(),[c,u]=B(),f=(p,v,w)=>{const m=w!=null||r()!=null;return[w,r(),m&&v!=null?p:void 0].filter(Boolean).join(" ")||void 0},d=p=>[a(),c(),p].filter(Boolean).join(" ")||void 0,h=K(()=>({"data-valid":$(n.validationState)==="valid"?"":void 0,"data-invalid":$(n.validationState)==="invalid"?"":void 0,"data-required":$(n.required)?"":void 0,"data-disabled":$(n.disabled)?"":void 0,"data-readonly":$(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>$(n.name)??$(n.id),dataset:h,validationState:()=>$(n.validationState),isRequired:()=>$(n.required),isDisabled:()=>$(n.disabled),isReadOnly:()=>$(n.readOnly),labelId:r,fieldId:i,descriptionId:a,errorMessageId:c,getAriaLabelledBy:f,getAriaDescribedBy:d,generateId:yt(()=>$(n.id)),registerLabel:Be(o),registerField:Be(s),registerDescription:Be(l),registerErrorMessage:Be(u)}}}var oa=we();function Yt(){const e=me(oa);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function ia(e){const t=Yt(),n=Z({id:t.generateId("description")},e);return U(()=>W(t.registerDescription(n.id))),b(ae,A({as:"div"},()=>t.dataset(),n))}function sa(e){const t=Yt(),n=Z({id:t.generateId("error-message")},e),[r,o]=k(n,["forceMount"]),i=()=>t.validationState()==="invalid";return U(()=>{i()&&W(t.registerErrorMessage(o.id))}),b(Se,{get when(){return r.forceMount||i()},get children(){return b(ae,A({as:"div"},()=>t.dataset(),o))}})}function Ro(e){let t;const n=Yt(),r=Z({id:n.generateId("label")},e),[o,i]=k(r,["ref"]),s=go(()=>t,()=>"label");return U(()=>W(n.registerLabel(i.id))),b(ae,A({as:"label",ref(a){var l=ve(c=>t=c,o.ref);typeof l=="function"&&l(a)},get for(){return K(()=>s()==="label")()?n.fieldId():void 0}},()=>n.dataset(),i))}var zd=["id","aria-label","aria-labelledby","aria-describedby"];function Gd(e){const t=Yt(),n=Z({id:t.generateId("field")},e);return U(()=>W(t.registerField($(n.id)))),{fieldProps:{id:()=>$(n.id),ariaLabel:()=>$(n["aria-label"]),ariaLabelledBy:()=>t.getAriaLabelledBy($(n.id),$(n["aria-label"]),$(n["aria-labelledby"])),ariaDescribedBy:()=>t.getAriaDescribedBy($(n["aria-describedby"]))}}}function Hd(e,t){U(Ce(e,n=>{if(n==null)return;const r=Pb(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),W(()=>{r.removeEventListener("reset",t)}))}))}function Pb(e){return Ib(e)?e.form:e.closest("form")}function Ib(e){return e.matches("textarea, input, select, button")}var Mb={};Xt(Mb,{Control:()=>aa,Description:()=>qd,ErrorMessage:()=>Wd,Input:()=>la,Label:()=>ua,Root:()=>ca,Switch:()=>Ab,Thumb:()=>da});var Ud=we();function Wn(){const e=me(Ud);if(e===void 0)throw new Error("[kobalte]: `useSwitchContext` must be used within a `Switch` component");return e}function aa(e){const t=Yt(),n=Wn(),r=Z({id:n.generateId("control")},e),[o,i]=k(r,["onClick","onKeyDown"]);return b(ae,A({as:"div",onClick:l=>{var c;oe(l,o.onClick),n.toggle(),(c=n.inputRef())==null||c.focus()},onKeyDown:l=>{var c;oe(l,o.onKeyDown),l.key===cs.Space&&(n.toggle(),(c=n.inputRef())==null||c.focus())}},()=>t.dataset(),()=>n.dataset(),i))}function qd(e){const t=Wn();return b(ia,A(()=>t.dataset(),e))}function Wd(e){const t=Wn();return b(sa,A(()=>t.dataset(),e))}function la(e){const t=Yt(),n=Wn(),r=Z({id:n.generateId("input")},e),[o,i,s]=k(r,["ref","style","onChange","onFocus","onBlur"],zd),{fieldProps:a}=Gd(i);return b(ae,A({as:"input",ref(f){var d=ve(n.setInputRef,o.ref);typeof d=="function"&&d(f)},type:"checkbox",role:"switch",get id(){return a.id()},get name(){return t.name()},get value(){return n.value()},get checked(){return n.checked()},get required(){return t.isRequired()},get disabled(){return t.isDisabled()},get readonly(){return t.isReadOnly()},get style(){return vt({...pc},o.style)},get"aria-checked"(){return n.checked()},get"aria-label"(){return a.ariaLabel()},get"aria-labelledby"(){return a.ariaLabelledBy()},get"aria-describedby"(){return a.ariaDescribedBy()},get"aria-invalid"(){return t.validationState()==="invalid"||void 0},get"aria-required"(){return t.isRequired()||void 0},get"aria-disabled"(){return t.isDisabled()||void 0},get"aria-readonly"(){return t.isReadOnly()||void 0},onChange:f=>{oe(f,o.onChange),f.stopPropagation();const d=f.target;n.setIsChecked(d.checked),d.checked=n.checked()},onFocus:f=>{oe(f,o.onFocus),n.setIsFocused(!0)},onBlur:f=>{oe(f,o.onBlur),n.setIsFocused(!1)}},()=>t.dataset(),()=>n.dataset(),s))}function ua(e){const t=Wn();return b(Ro,A(()=>t.dataset(),e))}function ca(e){let t;const n=`switch-${Ee()}`,r=Z({value:"on",id:n},e),[o,i,s]=k(r,["ref","children","value","checked","defaultChecked","onChange","onPointerDown"],jd),[a,l]=B(),[c,u]=B(!1),{formControlContext:f}=Bd(i),d=ld({isSelected:()=>o.checked,defaultIsSelected:()=>o.defaultChecked,onSelectedChange:v=>{var w;return(w=o.onChange)==null?void 0:w.call(o,v)},isDisabled:()=>f.isDisabled(),isReadOnly:()=>f.isReadOnly()});Hd(()=>t,()=>d.setIsSelected(o.defaultChecked??!1));const h=v=>{oe(v,o.onPointerDown),c()&&v.preventDefault()},g=K(()=>({"data-checked":d.isSelected()?"":void 0})),p={value:()=>o.value,dataset:g,checked:()=>d.isSelected(),inputRef:a,generateId:yt(()=>$(i.id)),toggle:()=>d.toggle(),setIsChecked:v=>d.setIsSelected(v),setIsFocused:u,setInputRef:l};return b(oa.Provider,{value:f,get children(){return b(Ud.Provider,{value:p,get children(){return b(ae,A({as:"div",ref(v){var w=ve(m=>t=m,o.ref);typeof w=="function"&&w(v)},role:"group",get id(){return $(i.id)},onPointerDown:h},()=>f.dataset(),g,s,{get children(){return b(Fb,{state:p,get children(){return o.children}})}}))}})}})}function Fb(e){const t=lo(()=>{const n=e.children;return us(n)?n(e.state):n});return K(t)}function da(e){const t=Yt(),n=Wn(),r=Z({id:n.generateId("thumb")},e);return b(ae,A({as:"div"},()=>t.dataset(),()=>n.dataset(),r))}var Ab=Object.assign(ca,{Control:aa,Description:qd,ErrorMessage:Wd,Input:la,Label:ua,Thumb:da});const Kl=ca,jl=e=>{const[t,n]=k(e,["class","children"]);return[b(la,{get class(){return de("[&:focus-visible+div]:outline-none [&:focus-visible+div]:ring-2 [&:focus-visible+div]:ring-ring [&:focus-visible+div]:ring-offset-2 [&:focus-visible+div]:ring-offset-background",t.class)}}),b(aa,A({get class(){return de("inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent bg-input transition-[color,background-color,box-shadow] data-[disabled]:cursor-not-allowed data-[checked]:bg-primary data-[disabled]:opacity-50",t.class)}},n,{get children(){return t.children}}))]},Bl=e=>{const[t,n]=k(e,["class"]);return b(da,A({get class(){return de("pointer-events-none block size-5 translate-x-0 rounded-full bg-background shadow-lg ring-0 transition-transform data-[checked]:translate-x-5",t.class)}},n))},zl=e=>{const[t,n]=k(e,["class"]);return b(ua,A({get class(){return de("text-sm font-medium leading-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-70",t.class)}},n))};var $b={};Xt($b,{Description:()=>ia,ErrorMessage:()=>sa,Input:()=>fa,Label:()=>Ro,Root:()=>ha,TextArea:()=>Zd,TextField:()=>Tb});var Xd=we();function Qd(){const e=me(Xd);if(e===void 0)throw new Error("[kobalte]: `useTextFieldContext` must be used within a `TextField` component");return e}function fa(e){return b(Yd,A({type:"text"},e))}function Yd(e){const t=Yt(),n=Qd(),r=Z({id:n.generateId("input")},e),[o,i,s]=k(r,["onInput"],zd),{fieldProps:a}=Gd(i);return b(ae,A({as:"input",get id(){return a.id()},get name(){return t.name()},get value(){return n.value()},get required(){return t.isRequired()},get disabled(){return t.isDisabled()},get readonly(){return t.isReadOnly()},get"aria-label"(){return a.ariaLabel()},get"aria-labelledby"(){return a.ariaLabelledBy()},get"aria-describedby"(){return a.ariaDescribedBy()},get"aria-invalid"(){return t.validationState()==="invalid"||void 0},get"aria-required"(){return t.isRequired()||void 0},get"aria-disabled"(){return t.isDisabled()||void 0},get"aria-readonly"(){return t.isReadOnly()||void 0},get onInput(){return be([o.onInput,n.onInput])}},()=>t.dataset(),s))}function ha(e){let t;const n=`textfield-${Ee()}`,r=Z({id:n},e),[o,i,s]=k(r,["ref","value","defaultValue","onChange"],jd),a=o.value,[l,c]=pt({value:()=>a===void 0?void 0:o.value??"",defaultValue:()=>o.defaultValue,onChange:h=>{var g;return(g=o.onChange)==null?void 0:g.call(o,h)}}),{formControlContext:u}=Bd(i);Hd(()=>t,()=>c(o.defaultValue??""));const f=h=>{if(u.isReadOnly()||u.isDisabled())return;const g=h.target;c(g.value),g.value=l()??""},d={value:l,generateId:yt(()=>$(i.id)),onInput:f};return b(oa.Provider,{value:u,get children(){return b(Xd.Provider,{value:d,get children(){return b(ae,A({as:"div",ref(h){var g=ve(p=>t=p,o.ref);typeof g=="function"&&g(h)},role:"group",get id(){return $(i.id)}},()=>u.dataset(),s))}})}})}function Zd(e){let t;const n=Qd(),r=Z({id:n.generateId("textarea")},e),[o,i]=k(r,["ref","autoResize","submitOnEnter","onKeyPress"]);U(Ce([()=>t,()=>o.autoResize,()=>n.value()],([a,l])=>{!a||!l||Ob(a)}));const s=a=>{t&&o.submitOnEnter&&a.key==="Enter"&&!a.shiftKey&&t.form&&(t.form.requestSubmit(),a.preventDefault())};return b(Yd,A({as:"textarea",get"aria-multiline"(){return o.submitOnEnter?"false":void 0},get onKeyPress(){return be([o.onKeyPress,s])},ref(a){var l=ve(c=>t=c,o.ref);typeof l=="function"&&l(a)}},i))}function Ob(e){const t=e.style.alignSelf,n=e.style.overflow;"MozAppearance"in e.style||(e.style.overflow="hidden"),e.style.alignSelf="start",e.style.height="auto",e.style.height=`${e.scrollHeight+(e.offsetHeight-e.clientHeight)}px`,e.style.overflow=n,e.style.alignSelf=t}var Tb=Object.assign(ha,{Description:ia,ErrorMessage:sa,Input:fa,Label:Ro,TextArea:Zd});const Gl=ha,Hl=e=>{const[t,n]=k(e,["type","class"]);return b(fa,A({get type(){return t.type},get class(){return de("flex h-10 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t.class)}},n))},Db=Fr("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{variants:{variant:{label:"data-[invalid]:text-destructive",description:"text-destructive",error:"font-normal text-red-500"}},defaultVariants:{variant:"label"}}),Ul=e=>{const[t,n]=k(e,["class"]);return b(Ro,A({get class(){return de(Db(),t.class)}},n))};class Jd{constructor(t,n){this.listeners=new Set,this._batching=!1,this._flushing=0,this.subscribe=r=>{var o,i;this.listeners.add(r);const s=(i=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:i.call(o,r,this);return()=>{this.listeners.delete(r),s==null||s()}},this.setState=r=>{var o,i,s;const a=this.state;this.state=(o=this.options)!=null&&o.updateFn?this.options.updateFn(a)(r):r(a),(s=(i=this.options)==null?void 0:i.onUpdate)==null||s.call(i),this._flush()},this._flush=()=>{if(this._batching)return;const r=++this._flushing;this.listeners.forEach(o=>{this._flushing===r&&o()})},this.batch=r=>{if(this._batching)return r();this._batching=!0,r(),this._batching=!1,this._flush()},this.state=t,this.options=n}}function ga(e,t){return typeof e=="function"?e(t):e}function ef(e,t){return pa(t).reduce((r,o)=>{if(r===null)return null;if(typeof r<"u")return r[o]},e)}function qo(e,t,n){const r=pa(t);function o(i){if(!r.length)return ga(n,i);const s=r.shift();if(typeof s=="string")return typeof i=="object"?(i===null&&(i={}),{...i,[s]:o(i[s])}):{[s]:o()};if(Array.isArray(i)&&s!==void 0){const a=i.slice(0,s);return[...a.length?a:new Array(s),o(i[s]),...i.slice(s+1)]}return[...new Array(s),o()]}return o(e)}function Lb(e,t){const n=pa(t);function r(o){if(!o)return;if(n.length===1){const s=n[0];if(Array.isArray(o)&&typeof s=="number")return o.filter((c,u)=>u!==s);const{[s]:a,...l}=o;return l}const i=n.shift();if(typeof i=="string"&&typeof o=="object")return{...o,[i]:r(o[i])};if(typeof i=="number"&&Array.isArray(o)){if(i>=o.length)return o;const s=o.slice(0,i);return[...s.length?s:new Array(i),r(o[i]),...o.slice(i+1)]}throw new Error("It seems we have created an infinite loop in deleteBy. ")}return r(e)}const _b=/^(\d*)$/gm,kb=/\.(\d*)\./gm,Vb=/^(\d*)\./gm,Nb=/\.(\d*$)/gm,Kb=/\.{2,}/gm,Yi="__int__",qr=`${Yi}$1`;function pa(e){if(Array.isArray(e))return[...e];if(typeof e!="string")throw new Error("Path must be a string.");return e.replaceAll("[",".").replaceAll("]","").replace(_b,qr).replace(kb,`.${qr}.`).replace(Vb,`${qr}.`).replace(Nb,`.${qr}`).replace(Kb,".").split(".").map(t=>t.indexOf(Yi)===0?parseInt(t.substring(Yi.length),10):t)}function jb(e){return!(Array.isArray(e)&&e.length===0)}function Zi(e,t){const{asyncDebounceMs:n}=t,{onChangeAsync:r,onBlurAsync:o,onSubmitAsync:i,onBlurAsyncDebounceMs:s,onChangeAsyncDebounceMs:a}=t.validators||{},l=n??0,c={cause:"change",validate:r,debounceMs:a??l},u={cause:"blur",validate:o,debounceMs:s??l},f={cause:"submit",validate:i,debounceMs:0},d=h=>({...h,debounceMs:0});switch(e){case"submit":return[d(c),d(u),f];case"blur":return[u];case"change":return[c];case"server":default:return[]}}function Ji(e,t){const{onChange:n,onBlur:r,onSubmit:o}=t.validators||{},i={cause:"change",validate:n},s={cause:"blur",validate:r},a={cause:"submit",validate:o},l={cause:"server",validate:()=>{}};switch(e){case"submit":return[i,s,a,l];case"server":return[l];case"blur":return[s,l];case"change":default:return[i,l]}}function Wo(e){return{values:e.values??{},errors:e.errors??[],errorMap:e.errorMap??{},fieldMeta:e.fieldMeta??{},canSubmit:e.canSubmit??!0,isFieldsValid:e.isFieldsValid??!1,isFieldsValidating:e.isFieldsValidating??!1,isFormValid:e.isFormValid??!1,isFormValidating:e.isFormValidating??!1,isSubmitted:e.isSubmitted??!1,isSubmitting:e.isSubmitting??!1,isTouched:e.isTouched??!1,isBlurred:e.isBlurred??!1,isPristine:e.isPristine??!0,isDirty:e.isDirty??!1,isValid:e.isValid??!1,isValidating:e.isValidating??!1,submissionAttempts:e.submissionAttempts??0,validationMetaMap:e.validationMetaMap??{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0}}}const Bb=e=>typeof e=="object";class zb{constructor(t){var n;this.options={},this.fieldInfo={},this.prevTransformArray=[],this.mount=()=>{const{onMount:r}=this.options.validators||{};if(!r)return;const o=this.runValidator({validate:r,value:{value:this.state.values,formApi:this,validationSource:"form"},type:"validate"});o&&this.store.setState(i=>({...i,errorMap:{...i.errorMap,onMount:o}}))},this.update=r=>{if(!r)return;const o=this.options;this.options=r,this.store.batch(()=>{const i=r.defaultValues&&r.defaultValues!==o.defaultValues&&!this.state.isTouched,s=r.defaultState!==o.defaultState&&!this.state.isTouched;this.store.setState(()=>Wo(Object.assign({},this.state,s?r.defaultState:{},i?{values:r.defaultValues}:{})))})},this.reset=()=>{const{fieldMeta:r}=this.state,o=this.resetFieldMeta(r);this.store.setState(()=>{var i;return Wo({...this.options.defaultState,values:this.options.defaultValues??((i=this.options.defaultState)==null?void 0:i.values),fieldMeta:o})})},this.validateAllFields=async r=>{const o=[];return this.store.batch(()=>{Object.values(this.fieldInfo).forEach(s=>{if(!s.instance)return;const a=s.instance;o.push(Promise.resolve().then(()=>a.validate(r))),s.instance.state.meta.isTouched||s.instance.setMeta(l=>({...l,isTouched:!0})),s.instance.state.meta.isBlurred||s.instance.setMeta(l=>({...l,isBlurred:!0}))})}),(await Promise.all(o)).flat()},this.validateArrayFieldsStartingFrom=async(r,o,i)=>{const s=this.getFieldValue(r),a=Array.isArray(s)?Math.max(s.length-1,0):null,l=[`${r}[${o}]`];for(let d=o+1;d<=(a??0);d++)l.push(`${r}[${d}]`);const c=Object.keys(this.fieldInfo).filter(d=>l.some(h=>d.startsWith(h))),u=[];return this.store.batch(()=>{c.forEach(d=>{u.push(Promise.resolve().then(()=>this.validateField(d,i)))})}),(await Promise.all(u)).flat()},this.validateField=(r,o)=>{var i;const s=(i=this.fieldInfo[r])==null?void 0:i.instance;return s?(s.state.meta.isTouched||s.setMeta(a=>({...a,isTouched:!0})),s.state.meta.isBlurred||s.setMeta(a=>({...a,isBlurred:!0})),s.validate(o)):[]},this.validateSync=r=>{const o=Ji(r,this.options);let i=!1;const s={};this.store.batch(()=>{for(const l of o){if(!l.validate)continue;const c=this.runValidator({validate:l.validate,value:{value:this.state.values,formApi:this,validationSource:"form"},type:"validate"}),{formError:u,fieldErrors:f}=es(c),d=Wr(l.cause);if(f)for(const[h,g]of Object.entries(f)){const v={...s[h]||{},[d]:g};s[h]=v;const w=this.getFieldMeta(h);w&&w.errorMap[d]!==g&&this.setFieldMeta(h,m=>({...m,errorMap:{...m.errorMap,[d]:g}}))}this.state.errorMap[d]!==u&&this.store.setState(h=>({...h,errorMap:{...h.errorMap,[d]:u}})),(u||f)&&(i=!0)}});const a=Wr("submit");return this.state.errorMap[a]&&r!=="submit"&&!i&&this.store.setState(l=>({...l,errorMap:{...l.errorMap,[a]:void 0}})),{hasErrored:i,fieldsErrorMap:s}},this.validateAsync=async r=>{const o=Zi(r,this.options);this.state.isFormValidating||this.store.setState(c=>({...c,isFormValidating:!0}));const i=[];let s;for(const c of o){if(!c.validate)continue;const u=Wr(c.cause),f=this.state.validationMetaMap[u];f==null||f.lastAbortController.abort();const d=new AbortController;this.state.validationMetaMap[u]={lastAbortController:d},i.push(new Promise(async h=>{let g;try{g=await new Promise((m,y)=>{setTimeout(async()=>{if(d.signal.aborted)return m(void 0);try{m(await this.runValidator({validate:c.validate,value:{value:this.state.values,formApi:this,validationSource:"form",signal:d.signal},type:"validateAsync"}))}catch(x){y(x)}},c.debounceMs)})}catch(m){g=m}const{formError:p,fieldErrors:v}=es(g);v&&(s=s?{...s,...v}:v);const w=Wr(c.cause);if(s)for(const[m,y]of Object.entries(s)){const x=this.getFieldMeta(m);x&&x.errorMap[w]!==y&&this.setFieldMeta(m,C=>({...C,errorMap:{...C.errorMap,[w]:y}}))}this.store.setState(m=>({...m,errorMap:{...m.errorMap,[w]:p}})),h(s?{fieldErrors:s,errorMapKey:w}:void 0)}))}let a=[];const l={};if(i.length){a=await Promise.all(i);for(const c of a)if(c!=null&&c.fieldErrors){const{errorMapKey:u}=c;for(const[f,d]of Object.entries(c.fieldErrors)){const g={...l[f]||{},[u]:d};l[f]=g}}}return this.store.setState(c=>({...c,isFormValidating:!1})),l},this.validate=r=>{const{hasErrored:o,fieldsErrorMap:i}=this.validateSync(r);return o&&!this.options.asyncAlways?i:this.validateAsync(r)},this.handleSubmit=async()=>{var r,o,i,s,a,l;if(this.store.setState(u=>({...u,isSubmitted:!1,submissionAttempts:u.submissionAttempts+1})),!this.state.canSubmit)return;this.store.setState(u=>({...u,isSubmitting:!0}));const c=()=>{this.store.setState(u=>({...u,isSubmitting:!1}))};if(await this.validateAllFields("submit"),!this.state.isFieldsValid){c(),(o=(r=this.options).onSubmitInvalid)==null||o.call(r,{value:this.state.values,formApi:this});return}if(await this.validate("submit"),!this.state.isValid){c(),(s=(i=this.options).onSubmitInvalid)==null||s.call(i,{value:this.state.values,formApi:this});return}try{await((l=(a=this.options).onSubmit)==null?void 0:l.call(a,{value:this.state.values,formApi:this})),this.store.batch(()=>{this.store.setState(u=>({...u,isSubmitted:!0})),c()})}catch(u){throw c(),u}},this.getFieldValue=r=>ef(this.state.values,r),this.getFieldMeta=r=>this.state.fieldMeta[r],this.getFieldInfo=r=>{var o;return(o=this.fieldInfo)[r]||(o[r]={instance:null,validationMetaMap:{onChange:void 0,onBlur:void 0,onSubmit:void 0,onMount:void 0,onServer:void 0}})},this.setFieldMeta=(r,o)=>{this.store.setState(i=>({...i,fieldMeta:{...i.fieldMeta,[r]:ga(o,i.fieldMeta[r])}}))},this.resetFieldMeta=r=>Object.keys(r).reduce((o,i)=>{const s=i;return o[s]={isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,errors:[],errorMap:{}},o},{}),this.setFieldValue=(r,o,i)=>{const s=(i==null?void 0:i.dontUpdateMeta)??!1;this.store.batch(()=>{s||this.setFieldMeta(r,a=>({...a,isTouched:!0,isBlurred:!0,isDirty:!0})),this.store.setState(a=>({...a,values:qo(a.values,r,o)}))})},this.deleteField=r=>{this.store.setState(o=>{const i={...o};return i.values=Lb(i.values,r),delete i.fieldMeta[r],i}),delete this.fieldInfo[r]},this.pushFieldValue=(r,o,i)=>{this.setFieldValue(r,s=>[...Array.isArray(s)?s:[],o],i),this.validateField(r,"change")},this.insertFieldValue=async(r,o,i,s)=>{this.setFieldValue(r,a=>[...a.slice(0,o),i,...a.slice(o)],s),await this.validateField(r,"change")},this.replaceFieldValue=async(r,o,i,s)=>{this.setFieldValue(r,a=>a.map((l,c)=>c===o?i:l),s),await this.validateField(r,"change"),await this.validateArrayFieldsStartingFrom(r,o,"change")},this.removeFieldValue=async(r,o,i)=>{const s=this.getFieldValue(r),a=Array.isArray(s)?Math.max(s.length-1,0):null;if(this.setFieldValue(r,l=>l.filter((c,u)=>u!==o),i),a!==null){const l=`${r}[${a}]`;Object.keys(this.fieldInfo).filter(u=>u.startsWith(l)).forEach(u=>this.deleteField(u))}await this.validateField(r,"change"),await this.validateArrayFieldsStartingFrom(r,o,"change")},this.swapFieldValues=(r,o,i,s)=>{this.setFieldValue(r,a=>{const l=a[o],c=a[i];return qo(qo(a,`${o}`,c),`${i}`,l)},s),this.validateField(r,"change"),this.validateField(`${r}[${o}]`,"change"),this.validateField(`${r}[${i}]`,"change")},this.moveFieldValues=(r,o,i,s)=>{this.setFieldValue(r,a=>(a.splice(i,0,a.splice(o,1)[0]),a),s),this.validateField(r,"change"),this.validateField(`${r}[${o}]`,"change"),this.validateField(`${r}[${i}]`,"change")},this.store=new Jd(Wo({...t==null?void 0:t.defaultState,values:(t==null?void 0:t.defaultValues)??((n=t==null?void 0:t.defaultState)==null?void 0:n.values),isFormValid:!0}),{onUpdate:()=>{var r,o;let{state:i}=this.store;const s=Object.values(i.fieldMeta),a=s.some(y=>y==null?void 0:y.isValidating),l=!s.some(y=>(y==null?void 0:y.errorMap)&&jb(Object.values(y.errorMap).filter(Boolean))),c=s.some(y=>y==null?void 0:y.isTouched),u=s.some(y=>y==null?void 0:y.isBlurred),f=s.some(y=>y==null?void 0:y.isDirty),d=!f,h=a||i.isFormValidating;i.errors=Object.values(i.errorMap).reduce((y,x)=>x===void 0?y:typeof x=="string"?(y.push(x),y):(x&&Bb(x)&&y.push(x.form),y),[]);const g=i.errors.length===0,p=l&&g,v=i.submissionAttempts===0&&!c||!h&&!i.isSubmitting&&p;i={...i,isFieldsValidating:a,isFieldsValid:l,isFormValid:g,isValid:p,canSubmit:v,isTouched:c,isBlurred:u,isPristine:d,isDirty:f},this.state=i,this.store.state=this.state;const w=((r=this.options.transform)==null?void 0:r.deps)??[];(w.length!==this.prevTransformArray.length||w.some((y,x)=>y!==this.prevTransformArray[x]))&&((o=this.options.transform)==null||o.fn(this),this.store.state=this.state,this.prevTransformArray=w)}}),this.state=this.store.state,this.update(t||{})}runValidator(t){const n=this.options.validatorAdapter;return n&&typeof t.validate!="function"?n()[t.type](t.value,t.validate):t.validate(t.value)}setErrorMap(t){this.store.setState(n=>({...n,errorMap:{...n.errorMap,...t}}))}}function es(e){if(e){if(typeof e=="object"){const t=es(e.form).formError,n=e.fields;return{formError:t,fieldErrors:n}}return typeof e!="string"?{formError:"Invalid Form Values"}:{formError:e}}return{formError:void 0}}function Wr(e){switch(e){case"submit":return"onSubmit";case"blur":return"onBlur";case"mount":return"onMount";case"server":return"onServer";case"change":default:return"onChange"}}class Gb{constructor(t){this.options={},this.mount=()=>{const n=this.getInfo();n.instance=this;const r=this.form.store.subscribe(()=>{this.store.batch(()=>{const i=this.getValue(),s=this.getMeta();i!==this.state.value&&this.store.setState(a=>({...a,value:i})),s!==this.state.meta&&this.store.setState(a=>({...a,meta:s}))})});this.update(this.options);const{onMount:o}=this.options.validators||{};if(o){const i=this.runValidator({validate:o,value:{value:this.state.value,fieldApi:this,validationSource:"field"},type:"validate"});i&&this.setMeta(s=>({...s,errorMap:{...s==null?void 0:s.errorMap,onMount:i}}))}return()=>{r()}},this.update=n=>{if(this.state.value===void 0){const r=ef(n.form.options.defaultValues,n.name);n.defaultValue!==void 0?this.setValue(n.defaultValue,{dontUpdateMeta:!0}):r!==void 0&&this.setValue(r,{dontUpdateMeta:!0})}this._getMeta()===void 0&&this.setMeta(this.state.meta),this.options=n},this.getValue=()=>this.form.getFieldValue(this.name),this.setValue=(n,r)=>{this.form.setFieldValue(this.name,n,r),this.validate("change")},this._getMeta=()=>this.form.getFieldMeta(this.name),this.getMeta=()=>this._getMeta()??{isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,errors:[],errorMap:{},...this.options.defaultMeta},this.setMeta=n=>this.form.setFieldMeta(this.name,n),this.getInfo=()=>this.form.getFieldInfo(this.name),this.pushValue=(n,r)=>this.form.pushFieldValue(this.name,n,r),this.insertValue=(n,r,o)=>this.form.insertFieldValue(this.name,n,r,o),this.replaceValue=(n,r,o)=>this.form.replaceFieldValue(this.name,n,r,o),this.removeValue=(n,r)=>this.form.removeFieldValue(this.name,n,r),this.swapValues=(n,r,o)=>this.form.swapFieldValues(this.name,n,r,o),this.moveValue=(n,r,o)=>this.form.moveFieldValues(this.name,n,r,o),this.getLinkedFields=n=>{const r=Object.values(this.form.fieldInfo),o=[];for(const i of r){if(!i.instance)continue;const{onChangeListenTo:s,onBlurListenTo:a}=i.instance.options.validators||{};n==="change"&&(s!=null&&s.includes(this.name))&&o.push(i.instance),n==="blur"&&(a!=null&&a.includes(this.name))&&o.push(i.instance)}return o},this.validateSync=(n,r)=>{const o=Ji(n,this.options),s=this.getLinkedFields(n).reduce((c,u)=>{const f=Ji(n,u.options);return f.forEach(d=>{d.field=u}),c.concat(f)},[]);let a=!1;this.form.store.batch(()=>{const c=(u,f)=>{const d=rr(f.cause),h=f.validate?ql(u.runValidator({validate:f.validate,value:{value:u.getValue(),validationSource:"field",fieldApi:u},type:"validate"})):r[d];u.state.meta.errorMap[d]!==h&&u.setMeta(g=>({...g,errorMap:{...g.errorMap,[rr(f.cause)]:h||r[d]}})),(h||r[d])&&(a=!0)};for(const u of o)c(this,u);for(const u of s)u.validate&&c(u.field,u)});const l=rr("submit");return this.state.meta.errorMap[l]&&n!=="submit"&&!a&&this.setMeta(c=>({...c,errorMap:{...c.errorMap,[l]:void 0}})),{hasErrored:a}},this.validateAsync=async(n,r)=>{const o=Zi(n,this.options),i=await r,s=this.getLinkedFields(n),a=s.reduce((d,h)=>{const g=Zi(n,h.options);return g.forEach(p=>{p.field=h}),d.concat(g)},[]);this.state.meta.isValidating||this.setMeta(d=>({...d,isValidating:!0}));for(const d of s)d.setMeta(h=>({...h,isValidating:!0}));const l=[],c=[],u=(d,h,g)=>{const p=rr(h.cause),v=d.getInfo().validationMetaMap[p];v==null||v.lastAbortController.abort();const w=new AbortController;this.getInfo().validationMetaMap[p]={lastAbortController:w},g.push(new Promise(async m=>{var y;let x;try{x=await new Promise((_,T)=>{this.timeoutIds[h.cause]&&clearTimeout(this.timeoutIds[h.cause]),this.timeoutIds[h.cause]=setTimeout(async()=>{if(w.signal.aborted)return _(void 0);try{_(await this.runValidator({validate:h.validate,value:{value:d.getValue(),fieldApi:d,signal:w.signal,validationSource:"field"},type:"validateAsync"}))}catch(V){T(V)}},h.debounceMs)})}catch(_){x=_}if(w.signal.aborted)return m(void 0);const C=ql(x),O=(y=i[this.name])==null?void 0:y[p],L=C||O;d.setMeta(_=>({..._,errorMap:{..._==null?void 0:_.errorMap,[p]:L}})),m(L)}))};for(const d of o)d.validate&&u(this,d,l);for(const d of a)d.validate&&u(d.field,d,c);let f=[];(l.length||c.length)&&(f=await Promise.all(l),await Promise.all(c)),this.setMeta(d=>({...d,isValidating:!1}));for(const d of s)d.setMeta(h=>({...h,isValidating:!1}));return f.filter(Boolean)},this.validate=n=>{var r;if(!this.state.meta.isTouched)return[];let o={},i=Promise.resolve({});try{const a=this.form.validate(n);if(a instanceof Promise)i=a;else{const l=a[this.name];l&&(o=l)}}catch{}const{hasErrored:s}=this.validateSync(n,o);return s&&!this.options.asyncAlways?((r=this.getInfo().validationMetaMap[rr(n)])==null||r.lastAbortController.abort(),this.state.meta.errors):this.validateAsync(n,i)},this.handleChange=n=>{this.setValue(n)},this.handleBlur=()=>{this.state.meta.isTouched||(this.setMeta(r=>({...r,isTouched:!0})),this.validate("change")),this.state.meta.isBlurred||this.setMeta(r=>({...r,isBlurred:!0})),this.validate("blur")},this.form=t.form,this.name=t.name,this.timeoutIds={},t.defaultValue!==void 0&&this.form.setFieldValue(this.name,t.defaultValue,{dontUpdateMeta:!0}),this.store=new Jd({value:this.getValue(),meta:this._getMeta()??{isValidating:!1,isTouched:!1,isBlurred:!1,isDirty:!1,isPristine:!0,errors:[],errorMap:{},...t.defaultMeta}},{onUpdate:()=>{const n=this.store.state;n.meta.errors=Object.values(n.meta.errorMap).filter(r=>r!==void 0),n.meta.isPristine=!n.meta.isDirty,this.prevState=n,this.state=n}}),this.state=this.store.state,this.prevState=this.state,this.options=t}runValidator(t){const n=[this.form.options.validatorAdapter,this.options.validatorAdapter];for(const r of n)if(r&&typeof t.validate!="function")return r()[t.type](t.value,t.validate);return t.validate(t.value)}setErrorMap(t){this.setMeta(n=>({...n,errorMap:{...n.errorMap,...t}}))}}function ql(e){if(e)return typeof e!="string"?"Invalid Form Values":e}function rr(e){switch(e){case"submit":return"onSubmit";case"blur":return"onBlur";case"mount":return"onMount";case"server":return"onServer";case"change":default:return"onChange"}}function Wl(e,t=n=>n){const[n,r]=co({value:t(e.state)}),o=e.subscribe(()=>{const i=t(e.state);r("value",Yu(i))});return W(()=>{o()}),()=>n.value}function Hb(e){const[t,n]=B(!1),r=K(()=>[t(),e]),o=e.store.subscribe(()=>n(i=>!i));return W(o),()=>r()[1]}function tf(e){const t=e(),n=new Gb(t),r=n;return r.Field=nf,Mt(()=>n.update(e())),Bn(()=>W(n.mount())),Hb(r)}function nf(e){const t=tf(()=>{const{children:n,...r}=e;return r});return K(()=>b(()=>e.children(t),{}))}function Ub(e){const t=e==null?void 0:e(),n=new zb(t),r=n;return r.Field=o=>b(nf,A(o,{form:n})),r.createField=o=>tf(()=>({...o(),form:n})),r.useStore=o=>Wl(n.store,o),r.Subscribe=o=>ga(o.children,Wl(n.store,o.selector)),Bn(n.mount),Mt(()=>n.update(e==null?void 0:e())),r}var Xo,Xl;function qb(){if(Xl)return Xo;Xl=1;class e{constructor(){this.max=1e3,this.map=new Map}get(n){const r=this.map.get(n);if(r!==void 0)return this.map.delete(n),this.map.set(n,r),r}delete(n){return this.map.delete(n)}set(n,r){if(!this.delete(n)&&r!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(n,r)}return this}}return Xo=e,Xo}var Qo,Ql;function ma(){if(Ql)return Qo;Ql=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Qo=r=>r?typeof r!="object"?e:r:t,Qo}var Xr={exports:{}},Yo,Yl;function va(){if(Yl)return Yo;Yl=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,o=t-6;return Yo={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Yo}var Zo,Zl;function Po(){if(Zl)return Zo;Zl=1;var e={};return Zo=typeof process=="object"&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{},Zo}var Jl;function ya(){return Jl||(Jl=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:o}=va(),i=Po();t=e.exports={};const s=t.re=[],a=t.safeRe=[],l=t.src=[],c=t.safeSrc=[],u=t.t={};let f=0;const d="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",o],[d,r]],g=v=>{for(const[w,m]of h)v=v.split(`${w}*`).join(`${w}{0,${m}}`).split(`${w}+`).join(`${w}{1,${m}}`);return v},p=(v,w,m)=>{const y=g(w),x=f++;i(v,x,w),u[v]=x,l[x]=w,c[x]=y,s[x]=new RegExp(w,m?"g":void 0),a[x]=new RegExp(y,m?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),p("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${l[u.NUMERICIDENTIFIER]}|${l[u.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NUMERICIDENTIFIERLOOSE]}|${l[u.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${d}+`),p("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),p("FULL",`^${l[u.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),p("LOOSE",`^${l[u.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),p("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),p("COERCE",`${l[u.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",l[u.COERCEPLAIN]+`(?:${l[u.PRERELEASE]})?(?:${l[u.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",l[u.COERCE],!0),p("COERCERTLFULL",l[u.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Xr,Xr.exports)),Xr.exports}var Jo,eu;function Wb(){if(eu)return Jo;eu=1;const e=/^[0-9]+$/,t=(r,o)=>{const i=e.test(r),s=e.test(o);return i&&s&&(r=+r,o=+o),r===o?0:i&&!s?-1:s&&!i?1:r<o?-1:1};return Jo={compareIdentifiers:t,rcompareIdentifiers:(r,o)=>t(o,r)},Jo}var ei,tu;function wa(){if(tu)return ei;tu=1;const e=Po(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=va(),{safeRe:r,safeSrc:o,t:i}=ya(),s=ma(),{compareIdentifiers:a}=Wb();class l{constructor(u,f){if(f=s(f),u instanceof l){if(u.loose===!!f.loose&&u.includePrerelease===!!f.includePrerelease)return u;u=u.version}else if(typeof u!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof u}".`);if(u.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",u,f),this.options=f,this.loose=!!f.loose,this.includePrerelease=!!f.includePrerelease;const d=u.trim().match(f.loose?r[i.LOOSE]:r[i.FULL]);if(!d)throw new TypeError(`Invalid Version: ${u}`);if(this.raw=u,this.major=+d[1],this.minor=+d[2],this.patch=+d[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");d[4]?this.prerelease=d[4].split(".").map(h=>{if(/^[0-9]+$/.test(h)){const g=+h;if(g>=0&&g<n)return g}return h}):this.prerelease=[],this.build=d[5]?d[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(u){if(e("SemVer.compare",this.version,this.options,u),!(u instanceof l)){if(typeof u=="string"&&u===this.version)return 0;u=new l(u,this.options)}return u.version===this.version?0:this.compareMain(u)||this.comparePre(u)}compareMain(u){return u instanceof l||(u=new l(u,this.options)),a(this.major,u.major)||a(this.minor,u.minor)||a(this.patch,u.patch)}comparePre(u){if(u instanceof l||(u=new l(u,this.options)),this.prerelease.length&&!u.prerelease.length)return-1;if(!this.prerelease.length&&u.prerelease.length)return 1;if(!this.prerelease.length&&!u.prerelease.length)return 0;let f=0;do{const d=this.prerelease[f],h=u.prerelease[f];if(e("prerelease compare",f,d,h),d===void 0&&h===void 0)return 0;if(h===void 0)return 1;if(d===void 0)return-1;if(d===h)continue;return a(d,h)}while(++f)}compareBuild(u){u instanceof l||(u=new l(u,this.options));let f=0;do{const d=this.build[f],h=u.build[f];if(e("build compare",f,d,h),d===void 0&&h===void 0)return 0;if(h===void 0)return 1;if(d===void 0)return-1;if(d===h)continue;return a(d,h)}while(++f)}inc(u,f,d){if(u.startsWith("pre")){if(!f&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(f){const h=new RegExp(`^${this.options.loose?o[i.PRERELEASELOOSE]:o[i.PRERELEASE]}$`),g=`-${f}`.match(h);if(!g||g[1]!==f)throw new Error(`invalid identifier: ${f}`)}}switch(u){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",f,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",f,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",f,d),this.inc("pre",f,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",f,d),this.inc("pre",f,d);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const h=Number(d)?1:0;if(this.prerelease.length===0)this.prerelease=[h];else{let g=this.prerelease.length;for(;--g>=0;)typeof this.prerelease[g]=="number"&&(this.prerelease[g]++,g=-2);if(g===-1){if(f===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(h)}}if(f){let g=[f,h];d===!1&&(g=[f]),a(this.prerelease[0],f)===0?isNaN(this.prerelease[1])&&(this.prerelease=g):this.prerelease=g}break}default:throw new Error(`invalid increment argument: ${u}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return ei=l,ei}var ti,nu;function Xn(){if(nu)return ti;nu=1;const e=wa();return ti=(n,r,o)=>new e(n,o).compare(new e(r,o)),ti}var ni,ru;function Xb(){if(ru)return ni;ru=1;const e=Xn();return ni=(n,r,o)=>e(n,r,o)===0,ni}var ri,ou;function Qb(){if(ou)return ri;ou=1;const e=Xn();return ri=(n,r,o)=>e(n,r,o)!==0,ri}var oi,iu;function Yb(){if(iu)return oi;iu=1;const e=Xn();return oi=(n,r,o)=>e(n,r,o)>0,oi}var ii,su;function Zb(){if(su)return ii;su=1;const e=Xn();return ii=(n,r,o)=>e(n,r,o)>=0,ii}var si,au;function Jb(){if(au)return si;au=1;const e=Xn();return si=(n,r,o)=>e(n,r,o)<0,si}var ai,lu;function eS(){if(lu)return ai;lu=1;const e=Xn();return ai=(n,r,o)=>e(n,r,o)<=0,ai}var li,uu;function tS(){if(uu)return li;uu=1;const e=Xb(),t=Qb(),n=Yb(),r=Zb(),o=Jb(),i=eS();return li=(a,l,c,u)=>{switch(l){case"===":return typeof a=="object"&&(a=a.version),typeof c=="object"&&(c=c.version),a===c;case"!==":return typeof a=="object"&&(a=a.version),typeof c=="object"&&(c=c.version),a!==c;case"":case"=":case"==":return e(a,c,u);case"!=":return t(a,c,u);case">":return n(a,c,u);case">=":return r(a,c,u);case"<":return o(a,c,u);case"<=":return i(a,c,u);default:throw new TypeError(`Invalid operator: ${l}`)}},li}var ui,cu;function nS(){if(cu)return ui;cu=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(u,f){if(f=n(f),u instanceof t){if(u.loose===!!f.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),s("comparator",u,f),this.options=f,this.loose=!!f.loose,this.parse(u),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(u){const f=this.options.loose?r[o.COMPARATORLOOSE]:r[o.COMPARATOR],d=u.match(f);if(!d)throw new TypeError(`Invalid comparator: ${u}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(u){if(s("Comparator.test",u,this.options.loose),this.semver===e||u===e)return!0;if(typeof u=="string")try{u=new a(u,this.options)}catch{return!1}return i(u,this.operator,this.semver,this.options)}intersects(u,f){if(!(u instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(u.value,f).test(this.value):u.operator===""?u.value===""?!0:new l(this.value,f).test(u.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||i(this.semver,"<",u.semver,f)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||i(this.semver,">",u.semver,f)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}ui=t;const n=ma(),{safeRe:r,t:o}=ya(),i=tS(),s=Po(),a=wa(),l=rf();return ui}var ci,du;function rf(){if(du)return ci;du=1;const e=/\s+/g;class t{constructor(R,S){if(S=o(S),R instanceof t)return R.loose===!!S.loose&&R.includePrerelease===!!S.includePrerelease?R:new t(R.raw,S);if(R instanceof i)return this.raw=R.value,this.set=[[R]],this.formatted=void 0,this;if(this.options=S,this.loose=!!S.loose,this.includePrerelease=!!S.includePrerelease,this.raw=R.trim().replace(e," "),this.set=this.raw.split("||").map(I=>this.parseRange(I.trim())).filter(I=>I.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const I=this.set[0];if(this.set=this.set.filter(M=>!p(M[0])),this.set.length===0)this.set=[I];else if(this.set.length>1){for(const M of this.set)if(M.length===1&&v(M[0])){this.set=[M];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let R=0;R<this.set.length;R++){R>0&&(this.formatted+="||");const S=this.set[R];for(let I=0;I<S.length;I++)I>0&&(this.formatted+=" "),this.formatted+=S[I].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(R){const I=((this.options.includePrerelease&&h)|(this.options.loose&&g))+":"+R,M=r.get(I);if(M)return M;const F=this.options.loose,D=F?l[c.HYPHENRANGELOOSE]:l[c.HYPHENRANGE];R=R.replace(D,z(this.options.includePrerelease)),s("hyphen replace",R),R=R.replace(l[c.COMPARATORTRIM],u),s("comparator trim",R),R=R.replace(l[c.TILDETRIM],f),s("tilde trim",R),R=R.replace(l[c.CARETTRIM],d),s("caret trim",R);let j=R.split(" ").map(ne=>m(ne,this.options)).join(" ").split(/\s+/).map(ne=>N(ne,this.options));F&&(j=j.filter(ne=>(s("loose invalid filter",ne,this.options),!!ne.match(l[c.COMPARATORLOOSE])))),s("range list",j);const H=new Map,X=j.map(ne=>new i(ne,this.options));for(const ne of X){if(p(ne))return[ne];H.set(ne.value,ne)}H.size>1&&H.has("")&&H.delete("");const le=[...H.values()];return r.set(I,le),le}intersects(R,S){if(!(R instanceof t))throw new TypeError("a Range is required");return this.set.some(I=>w(I,S)&&R.set.some(M=>w(M,S)&&I.every(F=>M.every(D=>F.intersects(D,S)))))}test(R){if(!R)return!1;if(typeof R=="string")try{R=new a(R,this.options)}catch{return!1}for(let S=0;S<this.set.length;S++)if(ie(this.set[S],R,this.options))return!0;return!1}}ci=t;const n=qb(),r=new n,o=ma(),i=nS(),s=Po(),a=wa(),{safeRe:l,t:c,comparatorTrimReplace:u,tildeTrimReplace:f,caretTrimReplace:d}=ya(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:g}=va(),p=P=>P.value==="<0.0.0-0",v=P=>P.value==="",w=(P,R)=>{let S=!0;const I=P.slice();let M=I.pop();for(;S&&I.length;)S=I.every(F=>M.intersects(F,R)),M=I.pop();return S},m=(P,R)=>(s("comp",P,R),P=O(P,R),s("caret",P),P=x(P,R),s("tildes",P),P=_(P,R),s("xrange",P),P=V(P,R),s("stars",P),P),y=P=>!P||P.toLowerCase()==="x"||P==="*",x=(P,R)=>P.trim().split(/\s+/).map(S=>C(S,R)).join(" "),C=(P,R)=>{const S=R.loose?l[c.TILDELOOSE]:l[c.TILDE];return P.replace(S,(I,M,F,D,j)=>{s("tilde",P,I,M,F,D,j);let H;return y(M)?H="":y(F)?H=`>=${M}.0.0 <${+M+1}.0.0-0`:y(D)?H=`>=${M}.${F}.0 <${M}.${+F+1}.0-0`:j?(s("replaceTilde pr",j),H=`>=${M}.${F}.${D}-${j} <${M}.${+F+1}.0-0`):H=`>=${M}.${F}.${D} <${M}.${+F+1}.0-0`,s("tilde return",H),H})},O=(P,R)=>P.trim().split(/\s+/).map(S=>L(S,R)).join(" "),L=(P,R)=>{s("caret",P,R);const S=R.loose?l[c.CARETLOOSE]:l[c.CARET],I=R.includePrerelease?"-0":"";return P.replace(S,(M,F,D,j,H)=>{s("caret",P,M,F,D,j,H);let X;return y(F)?X="":y(D)?X=`>=${F}.0.0${I} <${+F+1}.0.0-0`:y(j)?F==="0"?X=`>=${F}.${D}.0${I} <${F}.${+D+1}.0-0`:X=`>=${F}.${D}.0${I} <${+F+1}.0.0-0`:H?(s("replaceCaret pr",H),F==="0"?D==="0"?X=`>=${F}.${D}.${j}-${H} <${F}.${D}.${+j+1}-0`:X=`>=${F}.${D}.${j}-${H} <${F}.${+D+1}.0-0`:X=`>=${F}.${D}.${j}-${H} <${+F+1}.0.0-0`):(s("no pr"),F==="0"?D==="0"?X=`>=${F}.${D}.${j}${I} <${F}.${D}.${+j+1}-0`:X=`>=${F}.${D}.${j}${I} <${F}.${+D+1}.0-0`:X=`>=${F}.${D}.${j} <${+F+1}.0.0-0`),s("caret return",X),X})},_=(P,R)=>(s("replaceXRanges",P,R),P.split(/\s+/).map(S=>T(S,R)).join(" ")),T=(P,R)=>{P=P.trim();const S=R.loose?l[c.XRANGELOOSE]:l[c.XRANGE];return P.replace(S,(I,M,F,D,j,H)=>{s("xRange",P,I,M,F,D,j,H);const X=y(F),le=X||y(D),ne=le||y(j),Ae=ne;return M==="="&&Ae&&(M=""),H=R.includePrerelease?"-0":"",X?M===">"||M==="<"?I="<0.0.0-0":I="*":M&&Ae?(le&&(D=0),j=0,M===">"?(M=">=",le?(F=+F+1,D=0,j=0):(D=+D+1,j=0)):M==="<="&&(M="<",le?F=+F+1:D=+D+1),M==="<"&&(H="-0"),I=`${M+F}.${D}.${j}${H}`):le?I=`>=${F}.0.0${H} <${+F+1}.0.0-0`:ne&&(I=`>=${F}.${D}.0${H} <${F}.${+D+1}.0-0`),s("xRange return",I),I})},V=(P,R)=>(s("replaceStars",P,R),P.trim().replace(l[c.STAR],"")),N=(P,R)=>(s("replaceGTE0",P,R),P.trim().replace(l[R.includePrerelease?c.GTE0PRE:c.GTE0],"")),z=P=>(R,S,I,M,F,D,j,H,X,le,ne,Ae)=>(y(I)?S="":y(M)?S=`>=${I}.0.0${P?"-0":""}`:y(F)?S=`>=${I}.${M}.0${P?"-0":""}`:D?S=`>=${S}`:S=`>=${S}${P?"-0":""}`,y(X)?H="":y(le)?H=`<${+X+1}.0.0-0`:y(ne)?H=`<${X}.${+le+1}.0-0`:Ae?H=`<=${X}.${le}.${ne}-${Ae}`:P?H=`<${X}.${le}.${+ne+1}-0`:H=`<=${H}`,`${S} ${H}`.trim()),ie=(P,R,S)=>{for(let I=0;I<P.length;I++)if(!P[I].test(R))return!1;if(R.prerelease.length&&!S.includePrerelease){for(let I=0;I<P.length;I++)if(s(P[I].semver),P[I].semver!==i.ANY&&P[I].semver.prerelease.length>0){const M=P[I].semver;if(M.major===R.major&&M.minor===R.minor&&M.patch===R.patch)return!0}return!1}return!0};return ci}var di,fu;function rS(){if(fu)return di;fu=1;const e=rf();return di=(n,r)=>{try{return new e(n,r).range||"*"}catch{return null}},di}var oS=rS();const hu=jc(oS);var iS=he('<form class="flex flex-col gap-3"><div></div><div></div><div><div class="flex items-center space-x-2"></div><p class="text-xs text-muted-foreground mt-[2px]">When disabled, this update will not be available to your users.</p></div><div><div class="flex items-center space-x-2"></div><p class="text-xs text-muted-foreground mt-[2px]">When enabled, this update will require users to update before continuing to use the application.</p></div><div class="flex justify-end">'),sS=he('<em class="text-xs text-red-500">'),aS=he('<em class="text-xs text-muted-foreground">'),lS=he('<a target=_blank rel=noreferrer class="text-xs text-muted-foreground">Commit Hash: '),uS=he('<p class="text-xs text-muted-foreground">Commit Hash: ');const cS=({bundleId:e,onClose:t})=>{const n=mb(e);return b(Pm,{class:"flex flex-col h-full",get children(){return[b(Im,{class:"mb-4",get children(){return b(Mm,{get children(){return["Edit ",e]}})}}),b(Se,{get when(){return n.data},get fallback(){return K(()=>!!n.isFetched)()?b(Fm,{get children(){return["No update bundle found for bundle id ",e]}}):b(Rb,{height:374,radius:10})},children:r=>b(dS,{get bundle(){return r()},onEditSuccess:t})})]}})},dS=({bundle:e,onEditSuccess:t})=>{const n=lc(),r=vb(),[o,i]=B(!1),s=K(()=>{var u,f;return((f=(u=r.data)==null?void 0:u.console)==null?void 0:f.gitUrl)??null}),a=K(()=>e.gitCommitHash),l=Ub(()=>({defaultValues:{message:e.message,targetAppVersion:e.targetAppVersion,enabled:e.enabled,shouldForceUpdate:e.shouldForceUpdate},onSubmit:async({value:u})=>{i(!0);try{const f=await Tr.bundles[":bundleId"].$patch({param:{bundleId:e.id},json:u});if(f.status!==200){const d=await f.json();tl({title:"Error",description:d.error,variant:"error"})}}catch(f){f instanceof Error&&tl({title:"Error",description:f.message,variant:"error"})}finally{i(!1),n.invalidateQueries({queryKey:["bundle",e.id]}),n.invalidateQueries({queryKey:["bundles"]}),t()}}})),c=l.useStore(u=>u.isValid);return(()=>{var u=iS(),f=u.firstChild,d=f.nextSibling,h=d.nextSibling,g=h.firstChild,p=h.nextSibling,v=p.firstChild,w=p.nextSibling;return u.addEventListener("submit",m=>{m.preventDefault(),m.stopPropagation(),l.handleSubmit()}),fe(f,b(Gl,{class:"grid w-full max-w-sm items-center gap-1.5",get children(){return[b(Ul,{for:"message",children:"Message"}),b(l.Field,{name:"message",children:m=>b(Hl,{type:"text",id:"message",placeholder:"Message",get name(){return m().name},get value(){return m().state.value??""},get onBlur(){return m().handleBlur},onInput:y=>m().handleChange(y.currentTarget.value)})})]}})),fe(d,b(Gl,{class:"grid w-full max-w-sm items-center gap-1.5",get children(){return[b(Ul,{for:"targetAppVersion",children:"Target App Version"}),b(l.Field,{name:"targetAppVersion",validators:{onChange:({value:m})=>{if((m==null?void 0:m.length)===0||!hu(m))return"Invalid target app version"}},children:m=>[b(Hl,{type:"text",id:"targetAppVersion",get class(){return de(m().state.meta.errors.length>0&&"border-red-500 focus-visible:ring-red-500")},placeholder:"Target App Version",get name(){return m().name},get value(){return m().state.value??""},get onBlur(){return m().handleBlur},onInput:y=>m().handleChange(y.currentTarget.value)}),K(()=>K(()=>m().state.meta.errors.length>0)()?(()=>{var y=sS();return fe(y,()=>m().state.meta.errors.join(", ")),y})():(()=>{var y=aS();return fe(y,()=>hu(m().state.value)),y})())]})]}})),fe(g,b(l.Field,{name:"enabled",children:m=>b(Kl,{class:"flex items-center space-x-2",get checked(){return m().state.value},get name(){return m().name},onChange:y=>m().handleChange(y),get children(){return[b(jl,{get children(){return b(Bl,{})}}),b(zl,{children:"Enabled"})]}})})),fe(v,b(l.Field,{name:"shouldForceUpdate",children:m=>b(Kl,{class:"flex items-center space-x-2",get checked(){return m().state.value},get name(){return m().name},onChange:y=>m().handleChange(y),get children(){return[b(jl,{get children(){return b(Bl,{})}}),b(zl,{children:"Force Update"})]}})})),fe(u,b(Se,{get when(){return!o()},get fallback(){return b(Vl,{type:"submit",class:"mt-4",disabled:!0,get children(){return b(Gm,{class:"animate-spin"})}})},get children(){return b(Vl,{type:"submit",class:"mt-4",get disabled(){return!c()},children:"Save"})}}),w),fe(w,b(Se,{get when(){return a()},children:m=>s()?(()=>{var y=lS();return y.firstChild,fe(y,()=>m().slice(0,8),null),Ke(()=>Nn(y,"href",`${s()}/commit/${m}`)),y})():(()=>{var y=uS();return y.firstChild,fe(y,()=>m().slice(0,8),null),y})()})),u})()};function fS(){const{bundleIdFilter:e,setBundleIdFilter:t}=Kc(),n=K(()=>e()!==null),r=()=>{t(null)};return b(Sm,{get open(){return n()},onOpenChange:o=>{o||t(null)},get children(){return[b(xb,{columns:qm,onRowClick:o=>{t(o.id)}}),b(Se,{get when(){return e()},get children(){return b(Cf,{get children(){return b(cS,{get bundleId(){return e()},onClose:r})}})}})]}})}const hS=new og;function gS(){return b(ig,{client:hS,get children(){return[b(Fh,{root:e=>b(Qf,{get children(){return[b(Jf,{children:"HotUpdater Console"}),b(_h,{get children(){return e.children}})]}}),get children(){return b(xh,{path:"/",component:fS})}}),b(Jp,{})]}})}const gu=document.getElementById("root");gu&&Df(()=>b(gS,{}),gu);