@hot-updater/console 0.18.3 → 0.18.5

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.
@@ -0,0 +1,27 @@
1
+ var Kf=Object.defineProperty;var Wa=e=>{throw TypeError(e)};var zf=(e,t,n)=>t in e?Kf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Re=(e,t,n)=>zf(e,typeof t!="symbol"?t+"":t,n),ti=(e,t,n)=>t.has(e)||Wa("Cannot "+n);var C=(e,t,n)=>(ti(e,t,"read from private field"),n?n.call(e):t.get(e)),Q=(e,t,n)=>t.has(e)?Wa("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),q=(e,t,n,r)=>(ti(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),le=(e,t,n)=>(ti(e,t,"access private method"),n);var ro=(e,t,n,r)=>({set _(o){q(e,t,o,n)},get _(){return C(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 ne={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return Xa(this.context.count)},getNextContextId(){return Xa(this.context.count++)}};function Xa(e){const t=String(e),n=t.length-1;return ne.context.id+(n?String.fromCharCode(96+n):"")+t}function Ir(e){ne.context=e}const jf=(e,t)=>e===t,lt=Symbol("solid-proxy"),ec=typeof Proxy=="function",Bi=Symbol("solid-track"),xo={equals:jf};let tc=ic;const ut=1,_r=2,nc={owned:null,cleanups:null,context:null,owner:null},ni={};var de=null;let G=null,Bf=null,pe=null,ke=null,Le=null,Ao=0;function mn(e,t){const n=pe,r=de,o=e.length===0,i=t===void 0?r:t,s=o?nc:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>Me(()=>Yt(s)));de=s,pe=null;try{return qe(a,!0)}finally{pe=n,de=r}}function z(e,t){t=t?Object.assign({},xo,t):xo;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)),oc(n,o));return[rc.bind(n),r]}function st(e,t,n){const r=Do(e,t,!0,ut);nr(r)}function ze(e,t,n){const r=Do(e,t,!1,ut);nr(r)}function H(e,t,n){tc=Qf;const r=Do(e,t,!1,ut),o=vn&&ye(vn);o&&(r.suspense=o),(!n||!n.render)&&(r.user=!0),Le?Le.push(r):nr(r)}function L(e,t,n){n=n?Object.assign({},xo,n):xo;const r=Do(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,nr(r),rc.bind(r)}function Hf(e){return e&&typeof e=="object"&&"then"in e}function Gf(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=ni,l=null,c=!1,u=!1,d="initialValue"in i,f=typeof r=="function"&&L(r);const h=new Set,[p,g]=(i.storage||z)(i.initialValue),[v,m]=z(void 0),[y,w]=z(void 0,{equals:!1}),[S,E]=z(d?"ready":"unresolved");ne.context&&(l=ne.getNextContextId(),i.ssrLoadFrom==="initial"?a=i.initialValue:ne.load&&ne.has(l)&&(a=ne.load(l)));function $(K,N,j,oe){return s===K&&(s=null,oe!==void 0&&(d=!0),(K===a||N===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(oe,{value:N})),a=ni,G&&K&&c?(G.promises.delete(K),c=!1,qe(()=>{G.running=!0,F(N,j)},!1)):F(N,j)),N}function F(K,N){qe(()=>{N===void 0&&g(()=>K),E(N!==void 0?"errored":d?"ready":"unresolved"),m(N);for(const j of h.keys())j.decrement();h.clear()},!1)}function _(){const K=vn&&ye(vn),N=p(),j=v();if(j!==void 0&&!s)throw j;return pe&&!pe.user&&K&&st(()=>{y(),s&&(K.resolved&&G&&c?G.promises.add(s):h.has(K)||(K.increment(),h.add(K)))}),N}function T(K=!0){if(K!==!1&&u)return;u=!1;const N=f?f():r;if(c=G&&G.running,N==null||N===!1){$(s,Me(p));return}G&&s&&G.promises.delete(s);const j=a!==ni?a:Me(()=>o(N,{value:p(),refetching:K}));return Hf(j)?(s=j,"value"in j?(j.status==="success"?$(s,j.value,void 0,N):$(s,void 0,Gi(j.value),N),j):(u=!0,queueMicrotask(()=>u=!1),qe(()=>{E(d?"refreshing":"pending"),w()},!1),j.then(oe=>$(j,oe,void 0,N),oe=>$(j,void 0,Gi(oe),N)))):($(s,j,void 0,N),j)}return Object.defineProperties(_,{state:{get:()=>S()},error:{get:()=>v()},loading:{get(){const K=S();return K==="pending"||K==="refreshing"}},latest:{get(){if(!d)return _();const K=v();if(K&&!s)throw K;return p()}}}),f?st(()=>T(!1)):T(!1),[_,{refetch:T,mutate:g}]}function Fo(e){return qe(e,!1)}function Me(e){if(pe===null)return e();const t=pe;pe=null;try{return e()}finally{pe=t}}function xe(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 tr(e){H(()=>Me(e))}function W(e){return de===null||(de.cleanups===null?de.cleanups=[e]:de.cleanups.push(e)),e}function Hi(){return pe}function Lr(){return de}function Ts(e,t){const n=de,r=pe;de=e,pe=null;try{return qe(t,!0)}catch(o){Ds(o)}finally{de=n,pe=r}}function Uf(e){if(G&&G.running)return e(),G.done;const t=pe,n=de;return Promise.resolve().then(()=>{pe=t,de=n;let r;return vn&&(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),qe(e,!1),pe=de=null,r?r.done:void 0})}const[MS,Qa]=z(!1);function qf(e){Le.push.apply(Le,e),e.length=0}function we(e,t){const n=Symbol("context");return{id:n,Provider:Yf(n),defaultValue:e}}function ye(e){let t;return de&&de.context&&(t=de.context[e.id])!==void 0?t:e.defaultValue}function To(e){const t=L(e),n=L(()=>Ui(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let vn;function Wf(){return vn||(vn=we())}function rc(){const e=G&&G.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===ut)nr(this);else{const t=ke;ke=null,qe(()=>Eo(this),!1),ke=t}if(pe){const t=this.observers?this.observers.length:0;pe.sources?(pe.sources.push(this),pe.sourceSlots.push(t)):(pe.sources=[this],pe.sourceSlots=[t]),this.observers?(this.observers.push(pe),this.observerSlots.push(pe.sources.length-1)):(this.observers=[pe],this.observerSlots=[pe.sources.length-1])}return e&&G.sources.has(this)?this.tValue:this.value}function oc(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&&qe(()=>{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):Le.push(i),i.observers&&sc(i)),s?i.tState=ut:i.state=ut)}if(ke.length>1e6)throw ke=[],new Error},!1)}return t}function nr(e){if(!e.fn)return;Yt(e);const t=Ao;Ya(e,G&&G.running&&G.sources.has(e)?e.tValue:e.value,t),G&&!G.running&&G.sources.has(e)&&queueMicrotask(()=>{qe(()=>{G&&(G.running=!0),pe=de=e,Ya(e,e.tValue,t),pe=de=null},!1)})}function Ya(e,t,n){let r;const o=de,i=pe;pe=de=e;try{r=e.fn(t)}catch(s){return e.pure&&(G&&G.running?(e.tState=ut,e.tOwned&&e.tOwned.forEach(Yt),e.tOwned=void 0):(e.state=ut,e.owned&&e.owned.forEach(Yt),e.owned=null)),e.updatedAt=n+1,Ds(s)}finally{pe=i,de=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?oc(e,r,!0):G&&G.running&&e.pure?(G.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function Do(e,t,n,r=ut,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:de,context:de?de.context:null,pure:n};return G&&G.running&&(i.state=0,i.tState=r),de===null||de!==nc&&(G&&G.running&&de.pure?de.tOwned?de.tOwned.push(i):de.tOwned=[i]:de.owned?de.owned.push(i):de.owned=[i]),i}function Co(e){const t=G&&G.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===_r)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<Ao);){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)===ut)nr(e);else if((t?e.tState:e.state)===_r){const o=ke;ke=null,qe(()=>Eo(e,n[0]),!1),ke=o}}}function qe(e,t){if(ke)return e();let n=!1;t||(ke=[]),Le?n=!0:Le=[],Ao++;try{const r=e();return Xf(n),r}catch(r){n||(Le=null),ke=null,Ds(r)}}function Xf(e){if(ke&&(ic(ke),ke=null),e)return;let t;if(G){if(!G.promises.size&&!G.queue.size){const r=G.sources,o=G.disposed;Le.push.apply(Le,G.effects),t=G.resolve;for(const i of Le)"tState"in i&&(i.state=i.tState),delete i.tState;G=null,qe(()=>{for(const i of o)Yt(i);for(const i of r){if(i.value=i.tValue,i.owned)for(let s=0,a=i.owned.length;s<a;s++)Yt(i.owned[s]);i.tOwned&&(i.owned=i.tOwned),delete i.tValue,delete i.tOwned,i.tState=0}Qa(!1)},!1)}else if(G.running){G.running=!1,G.effects.push.apply(G.effects,Le),Le=null,Qa(!0);return}}const n=Le;Le=null,n.length&&qe(()=>tc(n),!1),t&&t()}function ic(e){for(let t=0;t<e.length;t++)Co(e[t])}function Qf(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Co(r)}if(ne.context){if(ne.count){ne.effects||(ne.effects=[]),ne.effects.push(...e.slice(0,n));return}Ir()}for(ne.effects&&(ne.done||!ne.count)&&(e=[...ne.effects,...e],n+=ne.effects.length,delete ne.effects),t=0;t<n;t++)Co(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===ut?o!==t&&(!o.updatedAt||o.updatedAt<Ao)&&Co(o):i===_r&&Eo(o,t)}}}function sc(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=_r:r.state=_r,r.pure?ke.push(r):Le.push(r),r.observers&&sc(r))}}function Yt(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--)Yt(e.tOwned[t]);delete e.tOwned}if(G&&G.running&&e.pure)ac(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)Yt(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 ac(e,t){if(t||(e.tState=0,G.disposed.add(e)),e.owned)for(let n=0;n<e.owned.length;n++)ac(e.owned[n])}function Gi(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Ds(e,t=de){throw Gi(e)}function Ui(e){if(typeof e=="function"&&!e.length)return Ui(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=Ui(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function Yf(e,t){return function(r){let o;return ze(()=>o=Me(()=>(de.context={...de.context,[e]:r.value},To(()=>r.children))),void 0),o}}const Zf=Symbol("fallback");function Za(e){for(let t=0;t<e.length;t++)e[t]()}function Jf(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return W(()=>Za(i)),()=>{let l=e()||[],c=l.length,u,d;return l[Bi],Me(()=>{let h,p,g,v,m,y,w,S,E;if(c===0)s!==0&&(Za(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[Zf],o[0]=mn($=>(i[0]=$,n.fallback())),s=1);else if(s===0){for(o=new Array(c),d=0;d<c;d++)r[d]=l[d],o[d]=mn(f);s=c}else{for(g=new Array(c),v=new Array(c),a&&(m=new Array(c)),y=0,w=Math.min(s,c);y<w&&r[y]===l[y];y++);for(w=s-1,S=c-1;w>=y&&S>=y&&r[w]===l[S];w--,S--)g[S]=o[w],v[S]=i[w],a&&(m[S]=a[w]);for(h=new Map,p=new Array(S+1),d=S;d>=y;d--)E=l[d],u=h.get(E),p[d]=u===void 0?-1:u,h.set(E,d);for(u=y;u<=w;u++)E=r[u],d=h.get(E),d!==void 0&&d!==-1?(g[d]=o[u],v[d]=i[u],a&&(m[d]=a[u]),d=p[d],h.set(E,d)):i[u]();for(d=y;d<c;d++)d in g?(o[d]=g[d],i[d]=v[d],a&&(a[d]=m[d],a[d](d))):o[d]=mn(f);o=o.slice(0,s=c),r=l.slice(0)}return o});function f(h){if(i[d]=h,a){const[p,g]=z(d);return a[d]=g,t(l[d],p)}return t(l[d])}}}function b(e,t){return Me(()=>e(t||{}))}function oo(){return!0}const qi={get(e,t,n){return t===lt?n:e.get(t)},has(e,t){return t===lt?!0:e.has(t)},set:oo,deleteProperty:oo,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:oo,deleteProperty:oo}},ownKeys(e){return e.keys()}};function ri(e){return(e=typeof e=="function"?e():e)?e:{}}function eh(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function O(...e){let t=!1;for(let s=0;s<e.length;s++){const a=e[s];t=t||!!a&&lt in a,e[s]=typeof a=="function"?(t=!0,L(a)):a}if(ec&&t)return new Proxy({get(s){for(let a=e.length-1;a>=0;a--){const l=ri(e[a])[s];if(l!==void 0)return l}},has(s){for(let a=e.length-1;a>=0;a--)if(s in ri(e[a]))return!0;return!1},keys(){const s=[];for(let a=0;a<e.length;a++)s.push(...Object.keys(ri(e[a])));return[...new Set(s)]}},qi);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 d=Object.getOwnPropertyDescriptor(a,u);if(!r[u])r[u]=d.get?{enumerable:!0,configurable:!0,get:eh.bind(n[u]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const f=n[u];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],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(ec&&lt 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)}},qi));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))}},qi)),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 th=0;function Ee(){return ne.context?ne.getNextContextId():`cl-${th++}`}const nh=e=>`Stale read from <${e}>.`;function ot(e){const t="fallback"in e&&{fallback:()=>e.fallback};return L(Jf(()=>e.each,e.children,t||void 0))}function ge(e){const t=e.keyed,n=L(()=>e.when,void 0,{equals:(r,o)=>t?r===o:!r==!o});return L(()=>{const r=n();if(r){const o=e.children;return typeof o=="function"&&o.length>0?Me(()=>o(t?r:()=>{if(!Me(n))throw nh("Show");return e.when})):o}return e.fallback},void 0,void 0)}const rh=we();function oh(e){let t=0,n,r,o,i,s;const[a,l]=z(!1),c=Wf(),u={increment:()=>{++t===1&&l(!0)},decrement:()=>{--t===0&&l(!1)},inFallback:a,effects:[],resolved:!1},d=Lr();if(ne.context&&ne.load){const p=ne.getContextId();let g=ne.load(p);if(g&&(typeof g!="object"||g.status!=="success"?o=g:ne.gather(p)),o&&o!=="$$f"){const[v,m]=z(void 0,{equals:!1});i=v,o.then(()=>{if(ne.done)return m();ne.gather(p),Ir(r),m(),Ir()},y=>{s=y,m()})}}const f=ye(rh);f&&(n=f.register(u.inFallback));let h;return W(()=>h&&h()),b(c.Provider,{value:u,get children(){return L(()=>{if(s)throw s;if(r=ne.context,i)return i(),i=void 0;r&&o==="$$f"&&Ir();const p=L(()=>e.children);return L(g=>{const v=u.inFallback(),{showContent:m=!0,showFallback:y=!0}=n?n():{};if((!v||o&&o!=="$$f")&&m)return u.resolved=!0,h&&h(),h=r=o=void 0,qf(u.effects),p();if(y)return h?g:mn(w=>(h=w,r&&(Ir({id:r.id+"F",count:0}),r=void 0),e.fallback),d)})})}})}const ih=["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"],sh=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...ih]),ah=new Set(["innerHTML","textContent","innerText","children"]),lh=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),uh=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 ch(e,t){const n=uh[e];return typeof n=="object"?n[t]?n.$:void 0:n}const dh=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),fh=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"]),hh={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function gh(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 d=a;for(;d<i;)c.set(n[d],d++)}const u=c.get(t[s]);if(u!=null)if(a<u&&u<i){let d=s,f=1,h;for(;++d<o&&d<i&&!((h=c.get(t[d]))==null||h!==u+f);)f++;if(f>u-a){const p=t[s];for(;a<u;)e.insertBefore(n[a++],p)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}const Ja="_$DX_DELEGATE";function ph(e,t,n,r={}){let o;return mn(i=>{o=i,t===document?e():X(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{o(),t.textContent=""}}function te(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 lc(e,t=window.document){const n=t[Ja]||(t[Ja]=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,Rh))}}function Yn(e,t,n){Cn(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function mh(e,t,n,r){Cn(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function vh(e,t,n){Cn(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function uc(e,t){Cn(e)||(t==null?e.removeAttribute("class"):e.className=t)}function yh(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 wh(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]||(el(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||(el(e,a,!0),n[a]=l)}return n}function bh(e,t,n){if(!t)return n?Yn(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 et(e,t={},n,r){const o={};return r||ze(()=>o.children=kr(e,t.children,o.children)),ze(()=>typeof t.ref=="function"&&Sh(t.ref,e)),ze(()=>xh(e,t,n,!0,o,!0)),o}function Sh(e,t,n){return Me(()=>e(t,n))}function X(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return kr(e,t,r,n);ze(o=>kr(e,t(),o,n),r)}function xh(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=tl(e,s,null,o[s],n,i,t)}for(const s in t){if(s==="children")continue;const a=t[s];o[s]=tl(e,s,a,o[s],n,i,t)}}function Ch(e){let t,n;return!Cn()||!(t=ne.registry.get(n=Ph()))?e():(ne.completed&&ne.completed.add(t),ne.registry.delete(n),t)}function Cn(e){return!!ne.context&&!ne.done&&(!e||e.isConnected)}function Eh(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function el(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 tl(e,t,n,r,o,i,s){let a,l,c,u,d;if(t==="style")return bh(e,n,r);if(t==="classList")return wh(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=dh.has(f);if(!h&&r){const p=Array.isArray(r)?r[0]:r;e.removeEventListener(f,p)}(h||n)&&(yh(e,f,n,h),h&&lc([f]))}else if(t.slice(0,5)==="attr:")Yn(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")vh(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(c=ah.has(t))||!o&&((u=ch(t,e.tagName))||(l=sh.has(t)))||(a=e.nodeName.includes("-")||"is"in s)){if(d)t=t.slice(5),l=!0;else if(Cn(e))return n;t==="class"||t==="className"?uc(e,n):a&&!l&&!c?e[Eh(t)]=n:e[u||t]=n}else{const f=o&&t.indexOf(":")>-1&&hh[t.split(":")[0]];f?mh(e,f,t,n):Yn(e,lh[t]||t,n)}return n}function Rh(e){if(ne.registry&&ne.events&&ne.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}}),ne.registry&&!ne.done&&(ne.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 kr(e,t,n,r,o){const i=Cn(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=In(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=In(e,n,r)}else{if(s==="function")return ze(()=>{let l=t();for(;typeof l=="function";)l=l();n=kr(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],c=n&&Array.isArray(n);if(Wi(l,t,n,o))return ze(()=>n=kr(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 d=[u];for(;(u=u.nextSibling)!==r;)d.push(u);return n=d}if(l.length===0){if(n=In(e,n,r),a)return n}else c?n.length===0?nl(e,l,r):gh(e,n,l):(n&&In(e),nl(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=In(e,n,r,t);In(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Wi(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=Wi(e,a,l)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=Wi(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 nl(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function In(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 Ph(){return ne.getNextContextId()}const cc=!1,Ih="http://www.w3.org/2000/svg";function dc(e,t=!1){return t?document.createElementNS(Ih,e):document.createElement(e)}function _o(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=Lr();let i,s=!!ne.context;return H(()=>{s&&(Lr().user=s=!1),i||(i=Ts(o,()=>L(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=z(!1),u=()=>c(!0);mn(d=>X(a,()=>l()?d():i(),null)),W(u)}else{const l=dc(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}),X(c,i),a.appendChild(l),e.ref&&e.ref(l),W(()=>a.removeChild(l))}},void 0,{render:!s}),n}function fc(e){const[t,n]=k(e,["component"]),r=L(()=>t.component);return L(()=>{const o=r();switch(typeof o){case"function":return Me(()=>o(n));case"string":const i=fh.has(o),s=ne.context?Ch():dc(o,i);return et(s,n,i),s}})}const hc=we(),$h=["title","meta"],rl=[],ol=["name","http-equiv","content","charset","media"].concat(["property"]),il=(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 Mh(){if(!ne.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($h.indexOf(n.tag)!==-1){const i=n.tag==="title"?rl:ol,s=il(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,et(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,et(o,n.props),o.parentNode!=document.head&&document.head.appendChild(o),-1},removeTag(n,r){const o=n.tag==="title"?rl:ol,i=il(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 Oh=e=>{const t=Mh();return b(hc.Provider,{value:t,get children(){return e.children}})},Ah=(e,t,n)=>(Fh({tag:e,props:t,setting:n,id:Ee(),get name(){return t.name||t.property}}),null);function Fh(e){const t=ye(hc);if(!t)throw new Error("<MetaProvider /> should be in the tree");ze(()=>{const n=t.addTag(e);W(()=>t.removeTag(e,n))})}const Th=e=>Ah("title",e,{escape:!0,close:!0});function gc(){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 Xi;function _s(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),Xi=window.history.state._depth}_s();function Dh(e){return{...e,_depth:window.history.state&&window.history.state._depth}}function _h(e,t){let n=!1;return()=>{const r=Xi;_s();const o=r==null?null:Xi-r;if(n){n=!1;return}o&&t(o)?(n=!0,window.history.go(-o)):e()}}const Lh=/^(?:[a-z0-9]+:)?\/\//i,kh=/^\/+|(\/)\/+$/g,pc="http://sr";function Fr(e,t=!1){const n=e.replace(kh,"$1");return n?t||/^[?#]/.test(n)?n:"/"+n:""}function wo(e,t,n){if(Lh.test(t))return;const r=Fr(e),o=n&&Fr(n);let i="";return!o||t.startsWith("/")?i=r:o.toLowerCase().indexOf(r.toLowerCase())!==0?i=r+o:i=o,(i||"/")+Fr(t,!i)}function Vh(e,t){if(e==null)throw new Error(t);return e}function Nh(e,t){return Fr(e).replace(/\/*(\*.*)?$/g,"")+Fr(t)}function mc(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 Kh(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:{}},d=f=>n===void 0?void 0:n[f];for(let f=0;f<s;f++){const h=i[f],p=h[0]===":",g=p?l[f]:l[f].toLowerCase(),v=p?h.slice(1):h.toLowerCase();if(p&&oi(g,d(v)))u.params[v]=g;else if(p||!oi(g,v))return null;u.path+=`/${g}`}if(o){const f=c?l.slice(-c).join("/"):"";if(oi(f,d(o)))u.params[o]=f;else return null}return u}}function oi(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 zh(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 vc(e){const t=new Map,n=Lr();return new Proxy({},{get(r,o){return t.has(o)||Ts(n,()=>t.set(o,L(()=>e()[o]))),t.get(o)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(e())}})}function jh(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 yc(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 yc(r).reduce((i,s)=>[...i,...o.map(a=>a+s)],[])}const Bh=100,wc=we(),bc=we(),Sc=()=>Vh(ye(wc),"<A> and 'use' router primitives can be only used inside a Route."),Hh=()=>Sc().navigatorFactory(),Gh=()=>Sc().location,Uh=()=>{const e=Gh(),t=Hh(),n=(r,o)=>{const i=Me(()=>jh(e.search,r)+e.hash);t(i,{scroll:!1,resolve:!1,...o})};return[e.query,n]};function qh(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 xc(e.path).reduce((c,u)=>{for(const d of yc(u)){const f=Nh(t,d);let h=a?f:f.split("/*",1)[0];h=h.split("/").map(p=>p.startsWith(":")||p.startsWith("*")?p:encodeURIComponent(p)).join("/"),c.push({...l,originalPath:u,pattern:h,matcher:Kh(h,!a,e.matchFilters)})}return c},[])}function Wh(e,t=0){return{routes:e,score:zh(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 xc(e){return Array.isArray(e)?e:[e]}function Cc(e,t="",n=[],r=[]){const o=xc(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=qh(a,t);for(const c of l){n.push(c);const u=Array.isArray(a.children)&&a.children.length===0;if(a.children&&!u)Cc(a.children,c.pattern,n,r);else{const d=Wh([...n],r.length);r.push(d)}n.pop()}}}return n.length?r:r.sort((i,s)=>s.score-i.score)}function ii(e,t){for(let n=0,r=e.length;n<r;n++){const o=e[n].matcher(t);if(o)return o}return[]}function Xh(e,t,n){const r=new URL(pc),o=L(u=>{const d=e();try{return new URL(d,r)}catch{return console.error(`Invalid path ${d}`),u}},r,{equals:(u,d)=>u.href===d.href}),i=L(()=>o().pathname),s=L(()=>o().search,!0),a=L(()=>o().hash),l=()=>"",c=xe(s,()=>mc(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):vc(c)}}let an;function Qh(){return an}function Yh(e,t,n,r={}){const{signal:[o,i],utils:s={}}=e,a=s.parsePath||(P=>P),l=s.renderPath||(P=>P),c=s.beforeLeave||gc(),u=wo("",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[d,f]=z(!1);let h;const p=(P,R)=>{R.value===g()&&R.state===m()||(h===void 0&&f(!0),an=P,h=R,Uf(()=>{h===R&&(v(h.value),y(h.state),E[1]([]))}).finally(()=>{h===R&&Fo(()=>{an=void 0,P==="navigate"&&j(h),f(!1),h=void 0})}))},[g,v]=z(o().value),[m,y]=z(o().state),w=Xh(g,m,s.queryWrapper),S=[],E=z([]),$=L(()=>typeof r.transformUrl=="function"?ii(t(),r.transformUrl(w.pathname)):ii(t(),w.pathname)),F=()=>{const P=$(),R={};for(let x=0;x<P.length;x++)Object.assign(R,P[x].params);return R},_=s.paramsWrapper?s.paramsWrapper(F,t):vc(F),T={pattern:u,path:()=>u,outlet:()=>null,resolvePath(P){return wo(u,P)}};return ze(xe(o,P=>p("native",P),{defer:!0})),{base:T,location:w,params:_,isRouting:d,renderPath:l,parsePath:a,navigatorFactory:N,matches:$,beforeLeave:c,preloadRoute:oe,singleFlight:r.singleFlight===void 0?!0:r.singleFlight,submissions:E};function K(P,R,x){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:A,scroll:V,state:B}={replace:!1,resolve:!I,scroll:!0,...x},U=A?P.resolvePath(R):wo(I&&w.pathname||"",R);if(U===void 0)throw new Error(`Path '${R}' is not a routable path`);if(S.length>=Bh)throw new Error("Too many redirects");const Z=g();(U!==Z||B!==m())&&(cc||c.confirm(U,x)&&(S.push({value:Z,replace:M,scroll:V,state:m()}),p("navigate",{value:U,state:B})))})}function N(P){return P=P||ye(bc)||T,(R,x)=>K(P,R,x)}function j(P){const R=S[0];R&&(i({...P,replace:R.replace,scroll:R.scroll}),S.length=0)}function oe(P,R){const x=ii(t(),P.pathname),I=an;an="preload";for(let M in x){const{route:A,params:V}=x[M];A.component&&A.component.preload&&A.component.preload();const{preload:B}=A;R&&B&&Ts(n(),()=>B({params:V,location:{pathname:P.pathname,search:P.search,hash:P.hash,query:mc(P),state:null,key:""},intent:"preload"}))}an=I}}function Zh(e,t,n,r){const{base:o,location:i,params:s}=e,{pattern:a,component:l,preload:c}=r().route,u=L(()=>r().path);l&&l.preload&&l.preload();const d=c?c({params:s,location:i,intent:an||"initial"}):void 0;return{parent:t,pattern:a,path:u,outlet:()=>l?b(l,{params:s,location:i,data:d,get children(){return n()}}):n(),resolvePath(h){return wo(o.path(),h,u())}}}const Jh=e=>t=>{const{base:n}=t,r=To(()=>t.children),o=L(()=>Cc(r(),t.base||""));let i;const s=Yh(e,o,()=>i,{base:n,singleFlight:t.singleFlight,transformUrl:t.transformUrl});return e.create&&e.create(s),b(wc.Provider,{value:s,get children(){return b(eg,{routerState:s,get root(){return t.root},get preload(){return t.rootPreload||t.rootLoad},get children(){return[L(()=>(i=Lr())&&null),b(tg,{routerState:s,get branches(){return o()}})]}})}})};function eg(e){const t=e.routerState.location,n=e.routerState.params,r=L(()=>e.preload&&Me(()=>{e.preload({params:n,location:t,intent:Qh()||"initial"})}));return b(ge,{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 tg(e){const t=[];let n;const r=L(xe(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 d=i&&i[c],f=o[c];s&&d&&f.route.key===d.route.key?l[c]=s[c]:(a=!1,t[c]&&t[c](),mn(h=>{t[c]=h,l[c]=Zh(e.routerState,l[c-1]||e.routerState.base,sl(()=>r()[c+1]),()=>e.routerState.matches()[c])}))}return t.splice(o.length).forEach(c=>c()),s&&a?s:(n=l[0],l)}));return sl(()=>r()&&n)()}const sl=e=>()=>b(ge,{get when(){return e()},keyed:!0,children:t=>b(bc.Provider,{value:t,get children(){return t.outlet()}})}),ng=e=>{const t=To(()=>e.children);return O(e,{get children(){return t()}})};function rg([e,t],n,r){return[e,r?o=>t(r(o)):t]}function og(e){let t=!1;const n=o=>typeof o=="string"?{value:o}:o,r=rg(z(n(e.get()),{equals:(o,i)=>o.value===i.value&&o.state===i.state}),void 0,o=>(!t&&e.set(o),ne.registry&&!ne.done&&(ne.done=!0),o));return e.init&&W(e.init((o=e.get())=>{t=!0,r[1](n(o)),t=!1})),Jh({signal:r,create:e.create,utils:e.utils})}function ig(e,t,n){return e.addEventListener(t,n),()=>e.removeEventListener(t,n)}function sg(e,t){const n=e&&document.getElementById(e);n?n.scrollIntoView():t&&window.scrollTo(0,0)}const ag=new Map;function lg(e=!0,t=!1,n="/_server",r){return o=>{const i=o.base.path(),s=o.navigatorFactory(o.base);let a,l;function c(g){return g.namespaceURI==="http://www.w3.org/2000/svg"}function u(g){if(g.defaultPrevented||g.button!==0||g.metaKey||g.altKey||g.ctrlKey||g.shiftKey)return;const v=g.composedPath().find($=>$ instanceof Node&&$.nodeName.toUpperCase()==="A");if(!v||t&&!v.hasAttribute("link"))return;const m=c(v),y=m?v.href.baseVal:v.href;if((m?v.target.baseVal:v.target)||!y&&!v.hasAttribute("state"))return;const S=(v.getAttribute("rel")||"").split(/\s+/);if(v.hasAttribute("download")||S&&S.includes("external"))return;const E=m?new URL(y,document.baseURI):new URL(y);if(!(E.origin!==window.location.origin||i&&E.pathname&&!E.pathname.toLowerCase().startsWith(i.toLowerCase())))return[v,E]}function d(g){const v=u(g);if(!v)return;const[m,y]=v,w=o.parsePath(y.pathname+y.search+y.hash),S=m.getAttribute("state");g.preventDefault(),s(w,{resolve:!1,replace:m.hasAttribute("replace"),scroll:!m.hasAttribute("noscroll"),state:S?JSON.parse(S):void 0})}function f(g){const v=u(g);if(!v)return;const[m,y]=v;r&&(y.pathname=r(y.pathname)),o.preloadRoute(y,m.getAttribute("preload")!=="false")}function h(g){clearTimeout(a);const v=u(g);if(!v)return l=null;const[m,y]=v;l!==m&&(r&&(y.pathname=r(y.pathname)),a=setTimeout(()=>{o.preloadRoute(y,m.getAttribute("preload")!=="false"),l=m},20))}function p(g){if(g.defaultPrevented)return;let v=g.submitter&&g.submitter.hasAttribute("formaction")?g.submitter.getAttribute("formaction"):g.target.getAttribute("action");if(!v)return;if(!v.startsWith("https://action/")){const y=new URL(v,pc);if(v=o.parsePath(y.pathname+y.search),!v.startsWith(n))return}if(g.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const m=ag.get(v);if(m){g.preventDefault();const y=new FormData(g.target,g.submitter);m.call({r:o,f:g.target},g.target.enctype==="multipart/form-data"?y:new URLSearchParams(y))}}lc(["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",p),W(()=>{document.removeEventListener("click",d),e&&(document.removeEventListener("mousemove",h),document.removeEventListener("focusin",f),document.removeEventListener("touchstart",f)),document.removeEventListener("submit",p)})}}function ug(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=gc();return og({get:t,set({value:r,replace:o,scroll:i,state:s}){o?window.history.replaceState(Dh(s),"",r):window.history.pushState(s,"",r),sg(decodeURIComponent(window.location.hash.slice(1)),i),_s()},init:r=>ig(window,"popstate",_h(r,o=>{if(o&&o<0)return!n.confirm(o);{const i=t();return!n.confirm(i.value,{state:i.state})}})),create:lg(e.preload,e.explicitLinks,e.actionBase,e.transformUrl),utils:{go:r=>window.history.go(r),beforeLeave:n}})(e)}const Qi=Symbol("store-raw"),Dn=Symbol("store-node"),Ot=Symbol("store-has"),Ec=Symbol("store-self");function Rc(e){let t=e[lt];if(!t&&(Object.defineProperty(e,lt,{value:t=new Proxy(e,fg)}),!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 Zt(e){let t;return e!=null&&typeof e=="object"&&(e[lt]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function yn(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[Qi])return n;if(!Zt(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=yn(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=yn(o,t))!==o&&(e[i]=r))}return e}function Ro(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function Vr(e,t,n){if(e[t])return e[t];const[r,o]=z(n,{equals:!1,internal:!0});return r.$=o,e[t]=r}function cg(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===lt||t===Dn||(delete n.value,delete n.writable,n.get=()=>e[lt][t]),n}function Pc(e){Hi()&&Vr(Ro(e,Dn),Ec)()}function dg(e){return Pc(e),Reflect.ownKeys(e)}const fg={get(e,t,n){if(t===Qi)return e;if(t===lt)return n;if(t===Bi)return Pc(e),n;const r=Ro(e,Dn),o=r[t];let i=o?o():e[t];if(t===Dn||t===Ot||t==="__proto__")return i;if(!o){const s=Object.getOwnPropertyDescriptor(e,t);Hi()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=Vr(r,t,i)())}return Zt(i)?Rc(i):i},has(e,t){return t===Qi||t===lt||t===Bi||t===Dn||t===Ot||t==="__proto__"?!0:(Hi()&&Vr(Ro(e,Ot),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:dg,getOwnPropertyDescriptor:cg};function Ze(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[Ot]&&e[Ot][t]&&o!==void 0&&e[Ot][t].$()):(e[t]=n,e[Ot]&&e[Ot][t]&&o===void 0&&e[Ot][t].$());let s=Ro(e,Dn),a;if((a=Vr(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let l=e.length;l<i;l++)(a=s[l])&&a.$();(a=Vr(s,"length",i))&&a.$(e.length)}(a=s[Ec])&&a.$()}function Ic(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];Ze(e,o,t[o])}}function hg(e,t){if(typeof t=="function"&&(t=t(e)),t=yn(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&&Ze(e,n,o)}Ze(e,"length",r)}else Ic(e,t)}function $r(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++)$r(e,[r[l]].concat(t),n);return}else if(a&&s==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&$r(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 d=l;d<=c;d+=u)$r(e,[d].concat(t),n);return}else if(t.length>1){$r(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=yn(i),r===void 0||Zt(o)&&Zt(i)&&!Array.isArray(i)?Ic(o,i):Ze(e,r,i))}function Xr(...[e,t]){const n=yn(e||{}),r=Array.isArray(n),o=Rc(n);function i(...s){Fo(()=>{r&&s.length===1?hg(n,s[0]):$r(n,s)})}return[o,i]}const Yi=Symbol("store-root");function An(e,t,n,r,o){const i=t[n];if(e===i)return;const s=Array.isArray(e);if(n!==Yi&&(!Zt(e)||!Zt(i)||s!==Array.isArray(i)||o&&e[o]!==i[o])){Ze(t,n,e);return}if(s){if(e.length&&i.length&&(!r||o&&e[0]&&e[0][o]!=null)){let c,u,d,f,h,p,g,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++)An(e[d],i,d,r,o);const m=new Array(e.length),y=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--)m[h]=i[f];if(d>h||d>f){for(u=d;u<=h;u++)Ze(i,u,e[u]);for(;u<e.length;u++)Ze(i,u,m[u]),An(e[u],i,u,r,o);i.length>e.length&&Ze(i,"length",e.length);return}for(g=new Array(h+1),u=h;u>=d;u--)p=e[u],v=o&&p?p[o]:p,c=y.get(v),g[u]=c===void 0?-1:c,y.set(v,u);for(c=d;c<=f;c++)p=i[c],v=o&&p?p[o]:p,u=y.get(v),u!==void 0&&u!==-1&&(m[u]=i[c],u=g[u],y.set(v,u));for(u=d;u<e.length;u++)u in m?(Ze(i,u,m[u]),An(e[u],i,u,r,o)):Ze(i,u,e[u])}else for(let c=0,u=e.length;c<u;c++)An(e[c],i,c,r,o);i.length>e.length&&Ze(i,"length",e.length);return}const a=Object.keys(e);for(let c=0,u=a.length;c<u;c++)An(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&&Ze(i,l[c],void 0)}function $c(e,t={}){const{merge:n,key:r="id"}=t,o=yn(e);return i=>{if(!Zt(i)||!Zt(o))return o;const s=An(o,{[Yi]:i},Yi,n,r);return s===void 0?i:s}}const gg="/assets/logo-BYNFyja1.png";var pg=te('<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 mg({children:e}){return(()=>{var t=pg(),n=t.firstChild,r=n.firstChild;return Yn(r,"src",gg),X(t,e,null),t})()}var rr=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(){}},Zn=typeof window>"u"||"Deno"in globalThis;function Je(){}function vg(e,t){return typeof e=="function"?e(t):e}function Zi(e){return typeof e=="number"&&e>=0&&e!==1/0}function Mc(e,t){return Math.max(e+(t||0)-Date.now(),0)}function _n(e,t){return typeof e=="function"?e(t):e}function it(e,t){return typeof e=="function"?e(t):e}function al(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Ls(s,t.options))return!1}else if(!Nr(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 ll(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(wn(t.options.mutationKey)!==wn(i))return!1}else if(!Nr(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Ls(e,t){return((t==null?void 0:t.queryKeyHashFn)||wn)(e)}function wn(e){return JSON.stringify(e,(t,n)=>Ji(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Nr(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Nr(e[n],t[n])):!1}function Oc(e,t){if(e===t)return e;const n=ul(e)&&ul(t);if(n||Ji(e)&&Ji(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]=Oc(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function Po(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 ul(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ji(e){if(!cl(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!cl(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function cl(e){return Object.prototype.toString.call(e)==="[object Object]"}function yg(e){return new Promise(t=>{setTimeout(t,e)})}function es(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Oc(e,t):t}function wg(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function bg(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ks=Symbol();function Ac(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ks?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var ln,zt,Vn,Hu,Sg=(Hu=class extends rr{constructor(){super();Q(this,ln);Q(this,zt);Q(this,Vn);q(this,Vn,t=>{if(!Zn&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){C(this,zt)||this.setEventListener(C(this,Vn))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,zt))==null||t.call(this),q(this,zt,void 0))}setEventListener(t){var n;q(this,Vn,t),(n=C(this,zt))==null||n.call(this),q(this,zt,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){C(this,ln)!==t&&(q(this,ln,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof C(this,ln)=="boolean"?C(this,ln):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ln=new WeakMap,zt=new WeakMap,Vn=new WeakMap,Hu),Vs=new Sg,Nn,jt,Kn,Gu,xg=(Gu=class extends rr{constructor(){super();Q(this,Nn,!0);Q(this,jt);Q(this,Kn);q(this,Kn,t=>{if(!Zn&&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(){C(this,jt)||this.setEventListener(C(this,Kn))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,jt))==null||t.call(this),q(this,jt,void 0))}setEventListener(t){var n;q(this,Kn,t),(n=C(this,jt))==null||n.call(this),q(this,jt,t(this.setOnline.bind(this)))}setOnline(t){C(this,Nn)!==t&&(q(this,Nn,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return C(this,Nn)}},Nn=new WeakMap,jt=new WeakMap,Kn=new WeakMap,Gu),Io=new xg;function ts(){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 Cg(e){return Math.min(1e3*2**e,3e4)}function Fc(e){return(e??"online")==="online"?Io.isOnline():!0}var Tc=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function si(e){return e instanceof Tc}function Dc(e){let t=!1,n=0,r=!1,o;const i=ts(),s=g=>{var v;r||(f(new Tc(g)),(v=e.abort)==null||v.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>Vs.isFocused()&&(e.networkMode==="always"||Io.isOnline())&&e.canRun(),u=()=>Fc(e.networkMode)&&e.canRun(),d=g=>{var v;r||(r=!0,(v=e.onSuccess)==null||v.call(e,g),o==null||o(),i.resolve(g))},f=g=>{var v;r||(r=!0,(v=e.onError)==null||v.call(e,g),o==null||o(),i.reject(g))},h=()=>new Promise(g=>{var v;o=m=>{(r||c())&&g(m)},(v=e.onPause)==null||v.call(e)}).then(()=>{var g;o=void 0,r||(g=e.onContinue)==null||g.call(e)}),p=()=>{if(r)return;let g;const v=n===0?e.initialPromise:void 0;try{g=v??e.fn()}catch(m){g=Promise.reject(m)}Promise.resolve(g).then(d).catch(m=>{var $;if(r)return;const y=e.retry??(Zn?0:3),w=e.retryDelay??Cg,S=typeof w=="function"?w(n,m):w,E=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,m);if(t||!E){f(m);return}n++,($=e.onFail)==null||$.call(e,n,m),yg(S).then(()=>c()?void 0:h()).then(()=>{t?f(m):p()})})};return{promise:i,cancel:s,continue:()=>(o==null||o(),i),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?p():h().then(p),i)}}function Eg(){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 Ae=Eg(),un,Uu,_c=(Uu=class{constructor(){Q(this,un)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Zi(this.gcTime)&&q(this,un,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Zn?1/0:5*60*1e3))}clearGcTimeout(){C(this,un)&&(clearTimeout(C(this,un)),q(this,un,void 0))}},un=new WeakMap,Uu),zn,jn,Ye,cn,De,Gr,dn,nt,$t,qu,Rg=(qu=class extends _c{constructor(t){super();Q(this,nt);Q(this,zn);Q(this,jn);Q(this,Ye);Q(this,cn);Q(this,De);Q(this,Gr);Q(this,dn);q(this,dn,!1),q(this,Gr,t.defaultOptions),this.setOptions(t.options),this.observers=[],q(this,cn,t.client),q(this,Ye,C(this,cn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,q(this,zn,Pg(this.options)),this.state=t.state??C(this,zn),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=C(this,De))==null?void 0:t.promise}setOptions(t){this.options={...C(this,Gr),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,Ye).remove(this)}setData(t,n){const r=es(this.state.data,t,this.options);return le(this,nt,$t).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){le(this,nt,$t).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=C(this,De))==null?void 0:r.promise;return(o=C(this,De))==null||o.cancel(t),n?n.then(Je).catch(Je):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(C(this,zn))}isActive(){return this.observers.some(t=>it(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ks||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||!Mc(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=C(this,De))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=C(this,De))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),C(this,Ye).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(C(this,De)&&(C(this,dn)?C(this,De).cancel({revert:!0}):C(this,De).cancelRetry()),this.scheduleGc()),C(this,Ye).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||le(this,nt,$t).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(C(this,De))return C(this,De).continueRetry(),C(this,De).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,dn,!0),r.signal)})},i=()=>{const d=Ac(this.options,n),f={client:C(this,cn),queryKey:this.queryKey,meta:this.meta};return o(f),q(this,dn,!1),this.options.persister?this.options.persister(d,f,this):d(f)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:C(this,cn),state:this.state,fetchFn:i};o(s),(l=this.options.behavior)==null||l.onFetch(s,this),q(this,jn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=s.fetchOptions)==null?void 0:c.meta))&&le(this,nt,$t).call(this,{type:"fetch",meta:(u=s.fetchOptions)==null?void 0:u.meta});const a=d=>{var f,h,p,g;si(d)&&d.silent||le(this,nt,$t).call(this,{type:"error",error:d}),si(d)||((h=(f=C(this,Ye).config).onError)==null||h.call(f,d,this),(g=(p=C(this,Ye).config).onSettled)==null||g.call(p,this.state.data,d,this)),this.scheduleGc()};return q(this,De,Dc({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var f,h,p,g;if(d===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(v){a(v);return}(h=(f=C(this,Ye).config).onSuccess)==null||h.call(f,d,this),(g=(p=C(this,Ye).config).onSettled)==null||g.call(p,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,f)=>{le(this,nt,$t).call(this,{type:"failed",failureCount:d,error:f})},onPause:()=>{le(this,nt,$t).call(this,{type:"pause"})},onContinue:()=>{le(this,nt,$t).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),C(this,De).start()}},zn=new WeakMap,jn=new WeakMap,Ye=new WeakMap,cn=new WeakMap,De=new WeakMap,Gr=new WeakMap,dn=new WeakMap,nt=new WeakSet,$t=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,...Lc(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 si(o)&&o.revert&&C(this,jn)?{...C(this,jn),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),Ae.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),C(this,Ye).notify({query:this,type:"updated",action:t})})},qu);function Lc(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Fc(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Pg(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 pt,Wu,Ig=(Wu=class extends rr{constructor(t={}){super();Q(this,pt);this.config=t,q(this,pt,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??Ls(o,n);let s=this.get(i);return s||(s=new Rg({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){C(this,pt).has(t.queryHash)||(C(this,pt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=C(this,pt).get(t.queryHash);n&&(t.destroy(),n===t&&C(this,pt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ae.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return C(this,pt).get(t)}getAll(){return[...C(this,pt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>al(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>al(t,r)):n}notify(t){Ae.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ae.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ae.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},pt=new WeakMap,Wu),mt,Ve,fn,vt,Kt,Xu,$g=(Xu=class extends _c{constructor(t){super();Q(this,vt);Q(this,mt);Q(this,Ve);Q(this,fn);this.mutationId=t.mutationId,q(this,Ve,t.mutationCache),q(this,mt,[]),this.state=t.state||kc(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){C(this,mt).includes(t)||(C(this,mt).push(t),this.clearGcTimeout(),C(this,Ve).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){q(this,mt,C(this,mt).filter(n=>n!==t)),this.scheduleGc(),C(this,Ve).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){C(this,mt).length||(this.state.status==="pending"?this.scheduleGc():C(this,Ve).remove(this))}continue(){var t;return((t=C(this,fn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,d,f,h,p,g,v,m,y,w,S,E,$,F;q(this,fn,Dc({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(_,T)=>{le(this,vt,Kt).call(this,{type:"failed",failureCount:_,error:T})},onPause:()=>{le(this,vt,Kt).call(this,{type:"pause"})},onContinue:()=>{le(this,vt,Kt).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,Ve).canRun(this)}));const n=this.state.status==="pending",r=!C(this,fn).canStart();try{if(!n){le(this,vt,Kt).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(o=C(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&&le(this,vt,Kt).call(this,{type:"pending",context:T,variables:t,isPaused:r})}const _=await C(this,fn).start();return await((c=(l=C(this,Ve).config).onSuccess)==null?void 0:c.call(l,_,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,_,t,this.state.context)),await((h=(f=C(this,Ve).config).onSettled)==null?void 0:h.call(f,_,null,this.state.variables,this.state.context,this)),await((g=(p=this.options).onSettled)==null?void 0:g.call(p,_,null,t,this.state.context)),le(this,vt,Kt).call(this,{type:"success",data:_}),_}catch(_){try{throw await((m=(v=C(this,Ve).config).onError)==null?void 0:m.call(v,_,t,this.state.context,this)),await((w=(y=this.options).onError)==null?void 0:w.call(y,_,t,this.state.context)),await((E=(S=C(this,Ve).config).onSettled)==null?void 0:E.call(S,void 0,_,this.state.variables,this.state.context,this)),await((F=($=this.options).onSettled)==null?void 0:F.call($,void 0,_,t,this.state.context)),_}finally{le(this,vt,Kt).call(this,{type:"error",error:_})}}finally{C(this,Ve).runNext(this)}}},mt=new WeakMap,Ve=new WeakMap,fn=new WeakMap,vt=new WeakSet,Kt=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),Ae.batch(()=>{C(this,mt).forEach(r=>{r.onMutationUpdate(t)}),C(this,Ve).notify({mutation:this,type:"updated",action:t})})},Xu);function kc(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ft,rt,Ur,Qu,Mg=(Qu=class extends rr{constructor(t={}){super();Q(this,Ft);Q(this,rt);Q(this,Ur);this.config=t,q(this,Ft,new Set),q(this,rt,new Map),q(this,Ur,0)}build(t,n,r){const o=new $g({mutationCache:this,mutationId:++ro(this,Ur)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){C(this,Ft).add(t);const n=io(t);if(typeof n=="string"){const r=C(this,rt).get(n);r?r.push(t):C(this,rt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(C(this,Ft).delete(t)){const n=io(t);if(typeof n=="string"){const r=C(this,rt).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&C(this,rt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=io(t);if(typeof n=="string"){const r=C(this,rt).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=io(t);if(typeof n=="string"){const o=(r=C(this,rt).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(){Ae.batch(()=>{C(this,Ft).forEach(t=>{this.notify({type:"removed",mutation:t})}),C(this,Ft).clear(),C(this,rt).clear()})}getAll(){return Array.from(C(this,Ft))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>ll(n,r))}findAll(t={}){return this.getAll().filter(n=>ll(t,n))}notify(t){Ae.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ae.batch(()=>Promise.all(t.map(n=>n.continue().catch(Je))))}},Ft=new WeakMap,rt=new WeakMap,Ur=new WeakMap,Qu);function io(e){var t;return(t=e.options.scope)==null?void 0:t.id}function dl(e){return{onFetch:(t,n)=>{var u,d,f,h,p;const r=t.options,o=(f=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,i=((h=t.state.data)==null?void 0:h.pages)||[],s=((p=t.state.data)==null?void 0:p.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let g=!1;const v=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},m=Ac(t.options,t.fetchOptions),y=async(w,S,E)=>{if(g)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const $={client:t.client,queryKey:t.queryKey,pageParam:S,direction:E?"backward":"forward",meta:t.options.meta};v($);const F=await m($),{maxPages:_}=t.options,T=E?bg:wg;return{pages:T(w.pages,F,_),pageParams:T(w.pageParams,S,_)}};if(o&&i.length){const w=o==="backward",S=w?Og:fl,E={pages:i,pageParams:s},$=S(r,E);a=await y(E,$,w)}else{const w=e??i.length;do{const S=l===0?s[0]??r.initialPageParam:fl(r,a);if(l>0&&S==null)break;a=await y(a,S),l++}while(l<w)}return a};t.options.persister?t.fetchFn=()=>{var g,v;return(v=(g=t.options).persister)==null?void 0:v.call(g,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function fl(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 Og(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 Ce,Bt,Ht,Bn,Hn,Gt,Gn,Un,Yu,Ag=(Yu=class{constructor(t={}){Q(this,Ce);Q(this,Bt);Q(this,Ht);Q(this,Bn);Q(this,Hn);Q(this,Gt);Q(this,Gn);Q(this,Un);q(this,Ce,t.queryCache||new Ig),q(this,Bt,t.mutationCache||new Mg),q(this,Ht,t.defaultOptions||{}),q(this,Bn,new Map),q(this,Hn,new Map),q(this,Gt,0)}mount(){ro(this,Gt)._++,C(this,Gt)===1&&(q(this,Gn,Vs.subscribe(async t=>{t&&(await this.resumePausedMutations(),C(this,Ce).onFocus())})),q(this,Un,Io.subscribe(async t=>{t&&(await this.resumePausedMutations(),C(this,Ce).onOnline())})))}unmount(){var t,n;ro(this,Gt)._--,C(this,Gt)===0&&((t=C(this,Gn))==null||t.call(this),q(this,Gn,void 0),(n=C(this,Un))==null||n.call(this),q(this,Un,void 0))}isFetching(t){return C(this,Ce).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return C(this,Bt).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const n=this.defaultQueryOptions({queryKey:t});return(r=C(this,Ce).get(n.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const n=this.defaultQueryOptions(t),r=C(this,Ce).build(this,n),o=r.state.data;return o===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(_n(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(o))}getQueriesData(t){return C(this,Ce).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=C(this,Ce).get(o.queryHash),s=i==null?void 0:i.state.data,a=vg(n,s);if(a!==void 0)return C(this,Ce).build(this,o).setData(a,{...r,manual:!0})}setQueriesData(t,n,r){return Ae.batch(()=>C(this,Ce).findAll(t).map(({queryKey:o})=>[o,this.setQueryData(o,n,r)]))}getQueryState(t){var r;const n=this.defaultQueryOptions({queryKey:t});return(r=C(this,Ce).get(n.queryHash))==null?void 0:r.state}removeQueries(t){const n=C(this,Ce);Ae.batch(()=>{n.findAll(t).forEach(r=>{n.remove(r)})})}resetQueries(t,n){const r=C(this,Ce),o={type:"active",...t};return Ae.batch(()=>(r.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(o,n)))}cancelQueries(t,n={}){const r={revert:!0,...n},o=Ae.batch(()=>C(this,Ce).findAll(t).map(i=>i.cancel(r)));return Promise.all(o).then(Je).catch(Je)}invalidateQueries(t,n={}){return Ae.batch(()=>{if(C(this,Ce).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=Ae.batch(()=>C(this,Ce).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,r);return r.throwOnError||(s=s.catch(Je)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(o).then(Je)}fetchQuery(t){const n=this.defaultQueryOptions(t);n.retry===void 0&&(n.retry=!1);const r=C(this,Ce).build(this,n);return r.isStaleByTime(_n(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Je).catch(Je)}fetchInfiniteQuery(t){return t.behavior=dl(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Je).catch(Je)}ensureInfiniteQueryData(t){return t.behavior=dl(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Io.isOnline()?C(this,Bt).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,Ce)}getMutationCache(){return C(this,Bt)}getDefaultOptions(){return C(this,Ht)}setDefaultOptions(t){q(this,Ht,t)}setQueryDefaults(t,n){C(this,Bn).set(wn(t),{queryKey:t,defaultOptions:n})}getQueryDefaults(t){const n=[...C(this,Bn).values()],r={};return n.forEach(o=>{Nr(t,o.queryKey)&&Object.assign(r,o.defaultOptions)}),r}setMutationDefaults(t,n){C(this,Hn).set(wn(t),{mutationKey:t,defaultOptions:n})}getMutationDefaults(t){const n=[...C(this,Hn).values()];let r={};return n.forEach(o=>{Nr(t,o.mutationKey)&&(r={...r,...o.defaultOptions})}),r}defaultQueryOptions(t){if(t._defaulted)return t;const n={...C(this,Ht).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return n.queryHash||(n.queryHash=Ls(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===ks&&(n.enabled=!1),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...C(this,Ht).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){C(this,Ce).clear(),C(this,Bt).clear()}},Ce=new WeakMap,Bt=new WeakMap,Ht=new WeakMap,Bn=new WeakMap,Hn=new WeakMap,Gt=new WeakMap,Gn=new WeakMap,Un=new WeakMap,Yu),Be,he,qr,Ne,hn,qn,Ut,yt,Wr,Wn,Xn,gn,pn,qt,Qn,me,Mr,ns,rs,os,is,ss,as,ls,Vc,Zu,Fg=(Zu=class extends rr{constructor(t,n){super();Q(this,me);Q(this,Be);Q(this,he);Q(this,qr);Q(this,Ne);Q(this,hn);Q(this,qn);Q(this,Ut);Q(this,yt);Q(this,Wr);Q(this,Wn);Q(this,Xn);Q(this,gn);Q(this,pn);Q(this,qt);Q(this,Qn,new Set);this.options=n,q(this,Be,t),q(this,yt,null),q(this,Ut,ts()),this.options.experimental_prefetchInRender||C(this,Ut).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&&(C(this,he).addObserver(this),hl(C(this,he),this.options)?le(this,me,Mr).call(this):this.updateResult(),le(this,me,is).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return us(C(this,he),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return us(C(this,he),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,le(this,me,ss).call(this),le(this,me,as).call(this),C(this,he).removeObserver(this)}setOptions(t,n){const r=this.options,o=C(this,he);if(this.options=C(this,Be).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof it(this.options.enabled,C(this,he))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");le(this,me,ls).call(this),C(this,he).setOptions(this.options),r._defaulted&&!Po(this.options,r)&&C(this,Be).getQueryCache().notify({type:"observerOptionsUpdated",query:C(this,he),observer:this});const i=this.hasListeners();i&&gl(C(this,he),o,this.options,r)&&le(this,me,Mr).call(this),this.updateResult(n),i&&(C(this,he)!==o||it(this.options.enabled,C(this,he))!==it(r.enabled,C(this,he))||_n(this.options.staleTime,C(this,he))!==_n(r.staleTime,C(this,he)))&&le(this,me,ns).call(this);const s=le(this,me,rs).call(this);i&&(C(this,he)!==o||it(this.options.enabled,C(this,he))!==it(r.enabled,C(this,he))||s!==C(this,qt))&&le(this,me,os).call(this,s)}getOptimisticResult(t){const n=C(this,Be).getQueryCache().build(C(this,Be),t),r=this.createResult(n,t);return Dg(this,r)&&(q(this,Ne,r),q(this,qn,this.options),q(this,hn,C(this,he).state)),r}getCurrentResult(){return C(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){C(this,Qn).add(t)}getCurrentQuery(){return C(this,he)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=C(this,Be).defaultQueryOptions(t),r=C(this,Be).getQueryCache().build(C(this,Be),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return le(this,me,Mr).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),C(this,Ne)))}createResult(t,n){var _;const r=C(this,he),o=this.options,i=C(this,Ne),s=C(this,hn),a=C(this,qn),c=t!==r?t.state:C(this,qr),{state:u}=t;let d={...u},f=!1,h;if(n._optimisticResults){const T=this.hasListeners(),K=!T&&hl(t,n),N=T&&gl(t,r,n,o);(K||N)&&(d={...d,...Lc(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:p,errorUpdatedAt:g,status:v}=d;if(n.select&&d.data!==void 0)if(i&&d.data===(s==null?void 0:s.data)&&n.select===C(this,Wr))h=C(this,Wn);else try{q(this,Wr,n.select),h=n.select(d.data),h=es(i==null?void 0:i.data,h,n),q(this,Wn,h),q(this,yt,null)}catch(T){q(this,yt,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((_=C(this,Xn))==null?void 0:_.state.data,C(this,Xn)):n.placeholderData,n.select&&T!==void 0)try{T=n.select(T),q(this,yt,null)}catch(K){q(this,yt,K)}T!==void 0&&(v="success",h=es(i==null?void 0:i.data,T,n),f=!0)}C(this,yt)&&(p=C(this,yt),h=C(this,Wn),g=Date.now(),v="error");const m=d.fetchStatus==="fetching",y=v==="pending",w=v==="error",S=y&&m,E=h!==void 0,F={status:v,fetchStatus:d.fetchStatus,isPending:y,isSuccess:v==="success",isError:w,isInitialLoading:S,isLoading:S,data:h,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:m,isRefetching:m&&!y,isLoadingError:w&&!E,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:w&&E,isStale:Ns(t,n),refetch:this.refetch,promise:C(this,Ut)};if(this.options.experimental_prefetchInRender){const T=j=>{F.status==="error"?j.reject(F.error):F.data!==void 0&&j.resolve(F.data)},K=()=>{const j=q(this,Ut,F.promise=ts());T(j)},N=C(this,Ut);switch(N.status){case"pending":t.queryHash===r.queryHash&&T(N);break;case"fulfilled":(F.status==="error"||F.data!==N.value)&&K();break;case"rejected":(F.status!=="error"||F.error!==N.reason)&&K();break}}return F}updateResult(t){const n=C(this,Ne),r=this.createResult(C(this,he),this.options);if(q(this,hn,C(this,he).state),q(this,qn,this.options),C(this,hn).data!==void 0&&q(this,Xn,C(this,he)),Po(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&&!C(this,Qn).size)return!0;const l=new Set(a??C(this,Qn));return this.options.throwOnError&&l.add("error"),Object.keys(C(this,Ne)).some(c=>{const u=c;return C(this,Ne)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),le(this,me,Vc).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&le(this,me,is).call(this)}},Be=new WeakMap,he=new WeakMap,qr=new WeakMap,Ne=new WeakMap,hn=new WeakMap,qn=new WeakMap,Ut=new WeakMap,yt=new WeakMap,Wr=new WeakMap,Wn=new WeakMap,Xn=new WeakMap,gn=new WeakMap,pn=new WeakMap,qt=new WeakMap,Qn=new WeakMap,me=new WeakSet,Mr=function(t){le(this,me,ls).call(this);let n=C(this,he).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Je)),n},ns=function(){le(this,me,ss).call(this);const t=_n(this.options.staleTime,C(this,he));if(Zn||C(this,Ne).isStale||!Zi(t))return;const r=Mc(C(this,Ne).dataUpdatedAt,t)+1;q(this,gn,setTimeout(()=>{C(this,Ne).isStale||this.updateResult()},r))},rs=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(C(this,he)):this.options.refetchInterval)??!1},os=function(t){le(this,me,as).call(this),q(this,qt,t),!(Zn||it(this.options.enabled,C(this,he))===!1||!Zi(C(this,qt))||C(this,qt)===0)&&q(this,pn,setInterval(()=>{(this.options.refetchIntervalInBackground||Vs.isFocused())&&le(this,me,Mr).call(this)},C(this,qt)))},is=function(){le(this,me,ns).call(this),le(this,me,os).call(this,le(this,me,rs).call(this))},ss=function(){C(this,gn)&&(clearTimeout(C(this,gn)),q(this,gn,void 0))},as=function(){C(this,pn)&&(clearInterval(C(this,pn)),q(this,pn,void 0))},ls=function(){const t=C(this,Be).getQueryCache().build(C(this,Be),this.options);if(t===C(this,he))return;const n=C(this,he);q(this,he,t),q(this,qr,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Vc=function(t){Ae.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(C(this,Ne))}),C(this,Be).getQueryCache().notify({query:C(this,he),type:"observerResultsUpdated"})})},Zu);function Tg(e,t){return it(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function hl(e,t){return Tg(e,t)||e.state.data!==void 0&&us(e,t,t.refetchOnMount)}function us(e,t,n){if(it(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Ns(e,t)}return!1}function gl(e,t,n,r){return(e!==t||it(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Ns(e,n)}function Ns(e,t){return it(t.enabled,e)!==!1&&e.isStaleByTime(_n(t.staleTime,e))}function Dg(e,t){return!Po(e.getCurrentResult(),t)}var Wt,Xt,He,Tt,Dt,bo,cs,Ju,_g=(Ju=class extends rr{constructor(n,r){super();Q(this,Dt);Q(this,Wt);Q(this,Xt);Q(this,He);Q(this,Tt);q(this,Wt,n),this.setOptions(r),this.bindMethods(),le(this,Dt,bo).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=C(this,Wt).defaultMutationOptions(n),Po(this.options,r)||C(this,Wt).getMutationCache().notify({type:"observerOptionsUpdated",mutation:C(this,He),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&wn(r.mutationKey)!==wn(this.options.mutationKey)?this.reset():((o=C(this,He))==null?void 0:o.state.status)==="pending"&&C(this,He).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=C(this,He))==null||n.removeObserver(this)}onMutationUpdate(n){le(this,Dt,bo).call(this),le(this,Dt,cs).call(this,n)}getCurrentResult(){return C(this,Xt)}reset(){var n;(n=C(this,He))==null||n.removeObserver(this),q(this,He,void 0),le(this,Dt,bo).call(this),le(this,Dt,cs).call(this)}mutate(n,r){var o;return q(this,Tt,r),(o=C(this,He))==null||o.removeObserver(this),q(this,He,C(this,Wt).getMutationCache().build(C(this,Wt),this.options)),C(this,He).addObserver(this),C(this,He).execute(n)}},Wt=new WeakMap,Xt=new WeakMap,He=new WeakMap,Tt=new WeakMap,Dt=new WeakSet,bo=function(){var r;const n=((r=C(this,He))==null?void 0:r.state)??kc();q(this,Xt,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},cs=function(n){Ae.batch(()=>{var r,o,i,s,a,l,c,u;if(C(this,Tt)&&this.hasListeners()){const d=C(this,Xt).variables,f=C(this,Xt).context;(n==null?void 0:n.type)==="success"?((o=(r=C(this,Tt)).onSuccess)==null||o.call(r,n.data,d,f),(s=(i=C(this,Tt)).onSettled)==null||s.call(i,n.data,null,d,f)):(n==null?void 0:n.type)==="error"&&((l=(a=C(this,Tt)).onError)==null||l.call(a,n.error,d,f),(u=(c=C(this,Tt)).onSettled)==null||u.call(c,void 0,n.error,d,f))}this.listeners.forEach(d=>{d(C(this,Xt))})})},Ju);function Lg(e){return e}function kg(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)??Lg,s=t.mutations||[],a=t.queries||[];s.forEach(({state:c,...u})=>{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,...u},c)}),a.forEach(({queryKey:c,state:u,queryHash:d,meta:f,promise:h})=>{var v,m;let p=o.get(d);const g=u.data===void 0?u.data:i(u.data);if(p){if(p.state.dataUpdatedAt<u.dataUpdatedAt){const{fetchStatus:y,...w}=u;p.setState({...w,data:g})}}else p=o.build(e,{...(v=e.getDefaultOptions().hydrate)==null?void 0:v.queries,...(m=n==null?void 0:n.defaultOptions)==null?void 0:m.queries,queryKey:c,queryHash:d,meta:f},{...u,data:g,fetchStatus:"idle"});if(h){const y=Promise.resolve(h).then(i);p.fetch(void 0,{initialPromise:y})}})}var Vg=class extends Ag{constructor(e={}){super(e)}},Nc=we(void 0),Lo=e=>{const t=ye(Nc);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t()},Ng=e=>(ze(t=>(t==null||t(),e.client.mount(),e.client.unmount.bind(e.client))),W(()=>e.client.unmount()),b(Nc.Provider,{value:()=>e.client,get children(){return e.children}}));function Kc(e,t){return typeof e=="function"?e(...t):!!e}function Kg(){}var zc=we(()=>!1),zg=()=>ye(zc);zc.Provider;function jg(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=$c(o,{key:n})(e.data);return{...t,data:i}}var Bg=(e,t)=>t;function Hg(e,t,n){const r=L(()=>Lo()),o=zg(),i=L(()=>{const S=r().defaultQueryOptions(e());return S._optimisticResults=o()?"isRestoring":"optimistic",S.structuralSharing=!1,S}),s=i(),[a,l]=z(new t(r(),i()));let c=a().getOptimisticResult(i());const[u,d]=Xr(c),f=()=>a().subscribe(E=>{c=E,queueMicrotask(()=>{g&&y()})});function h(S){const E=a().options,$=E.reconcile;d(F=>jg(F,S,$===void 0?!1:$,E.queryHash))}function p(){return[()=>u,S=>{const E=yn(u);if(typeof S=="function"&&(S=S(E)),S!=null&&S.hydrationData){const{hydrationData:$,...F}=S;S=F}h(S)}]}let g=null,v=null;const[m,{refetch:y}]=Gf(()=>{const S=a();return new Promise((E,$)=>{if(v=E,!g&&!o()&&(g=f()),S.updateResult(),c.isError&&!c.isFetching&&!o()&&Kc(S.options.throwOnError,[c.error,S.getCurrentQuery()]))return h(c),$(c.error);if(!c.isLoading)return v=null,E(Bg(S.getCurrentQuery(),c));h(c)})},{storage:p,get deferStream(){return e().deferStream},onHydrated(S,E){if(E.value&&"hydrationData"in E.value&&kg(r(),{queries:[{...E.value.hydrationData}]}),g)return;const $={...s};(s.staleTime||!s.initialData)&&E.value&&($.refetchOnMount=!1),a().setOptions($),h(a().getOptimisticResult($)),g=f()}});st(xe(r,S=>{g&&g();const E=new t(S,i());g=f(),l(E)},{defer:!0})),st(xe(o,S=>{S||y()},{defer:!0})),W(()=>{g&&(g(),g=null),v&&(v(c),v=null)}),st(xe([a,i],([S,E])=>{S.setOptions(E),h(S.getOptimisticResult(E)),y()},{defer:!0}));const w={get(S,E){var $,F;return E==="data"?u.data!==void 0?($=m.latest)==null?void 0:$.data:(F=m())==null?void 0:F.data:Reflect.get(S,E)}};return new Proxy(u,w)}function ko(e,t){return Hg(L(()=>e()),Fg)}function Gg(e,t){const n=L(()=>Lo()),r=new _g(n(),e()),o=(l,c)=>{r.mutate(l,c).catch(Kg)},[i,s]=Xr({...r.getCurrentResult(),mutate:o,mutateAsync:r.getCurrentResult().mutate});st(()=>{r.setOptions(e())}),st(xe(()=>i.status,()=>{if(i.isError&&Kc(r.options.throwOnError,[i.error]))throw i.error}));const a=r.subscribe(l=>{s({...l,mutate:o,mutateAsync:l.mutate})});return W(a),i}function Ug(e){return(...t)=>{for(const n of e)n&&n(...t)}}var D=e=>typeof e=="function"&&!e.length?e():e,pl=e=>Array.isArray(e)?e:e?[e]:[];function qg(e,...t){return typeof e=="function"?e(...t):e}var Wg=W;function Xg(e,t,n,r){return e.addEventListener(t,n,r),Wg(e.removeEventListener.bind(e,t,n,r))}function Qg(e,t,n,r){const o=()=>{pl(D(e)).forEach(i=>{i&&pl(D(t)).forEach(s=>Xg(i,s,n,r))})};typeof e=="function"?H(o):ze(o)}var Yg=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function ml(e){const t={};let n;for(;n=Yg.exec(e);)t[n[1]]=n[2];return t}function ft(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=ml(e)}else typeof t=="string"&&(t=ml(t));return{...e,...t}}function ve(...e){return Ug(e)}function Zg(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function ds(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Jg(e){return typeof e=="number"}function Fn(e){return Object.prototype.toString.call(e)==="[object String]"}function Ks(e){return typeof e=="function"}function ht(e){return t=>`${e()}-${t}`}function Pe(e,t){return e?e===t||e.contains(t):!1}function Or(e,t=!1){const{activeElement:n}=je(e);if(!(n!=null&&n.nodeName))return null;if(jc(n)&&n.contentDocument)return Or(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=je(n).getElementById(r);if(o)return o}}return n}function zs(e){return je(e).defaultView||window}function je(e){return e?e.ownerDocument||e:document}function jc(e){return e.tagName==="IFRAME"}var js=(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))(js||{});function Bs(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 Vo(){return Bs(/^Mac/i)}function ep(){return Bs(/^iPhone/i)}function tp(){return Bs(/^iPad/i)||Vo()&&navigator.maxTouchPoints>1}function np(){return ep()||tp()}function rp(){return Vo()||np()}function re(e,t){return t&&(Ks(t)?t(e):t[0](t[1],e)),e==null?void 0:e.defaultPrevented}function Se(e){return t=>{for(const n of e)re(t,n)}}function op(e){return Vo()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function $e(e){if(e)if(ip())e.focus({preventScroll:!0});else{const t=sp(e);e.focus(),ap(t)}}var so=null;function ip(){if(so==null){so=!1;try{document.createElement("div").focus({get preventScroll(){return so=!0,!0}})}catch{}}return so}function sp(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 ap(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var Bc=["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'])"],lp=[...Bc,'[tabindex]:not([tabindex="-1"]):not([disabled])'],Hs=`${Bc.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,up=lp.join(':not([hidden]):not([tabindex="-1"]),');function Hc(e,t){const r=Array.from(e.querySelectorAll(Hs)).filter(vl);return t&&vl(e)&&r.unshift(e),r.forEach((o,i)=>{if(jc(o)&&o.contentDocument){const s=o.contentDocument.body,a=Hc(s,!1);r.splice(i,1,...a)}}),r}function vl(e){return Gc(e)&&!cp(e)}function Gc(e){return e.matches(Hs)&&Gs(e)}function cp(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function Gs(e,t){return e.nodeName!=="#comment"&&dp(e)&&fp(e,t)&&(!e.parentElement||Gs(e.parentElement,e))}function dp(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 fp(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function hp(e,t,n){const r=t!=null&&t.tabbable?up:Hs,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)&&Gs(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 yl(e){let t=e;for(;t&&!gp(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function gp(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function pp(){}function mp(e){return[e.clientX,e.clientY]}function Uc(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],[d,f]=t[l],[,h]=t[l===0?s-1:l-1]||[0,0],p=(u-f)*(n-c)-(c-d)*(r-u);if(f<u){if(r>=f&&r<u){if(p===0)return!0;p>0&&(r===f?r>h&&(o=!o):o=!o)}}else if(u<f){if(r>u&&r<=f){if(p===0)return!0;p<0&&(r===f?r<h&&(o=!o):o=!o)}}else if(r===u&&(n>=d&&n<=c||n>=c&&n<=d))return!0}return o}function Y(e,t){return O(e,t)}var wr=new Map,wl=new Set;function bl(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=wr.get(n.target);r||(r=new Set,wr.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=wr.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),wr.delete(n.target)),wr.size===0)){for(const o of wl)o();wl.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?bl():document.addEventListener("DOMContentLoaded",bl));function fs(e,t){const n=Sl(e,t,"left"),r=Sl(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 Sl(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 vp(e,t){var n,r;if(document.contains(e)){const o=document.scrollingElement||document.documentElement;if(window.getComputedStyle(o).overflow==="hidden"){let s=yl(e);for(;e&&s&&e!==o&&s!==o;)fs(s,e),e=s,s=yl(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 qc={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"},Kr="data-kb-top-layer",Wc,hs=!1,_t=[];function zr(e){return _t.findIndex(t=>t.node===e)}function yp(e){return _t[zr(e)]}function wp(e){return _t[_t.length-1].node===e}function Xc(){return _t.filter(e=>e.isPointerBlocking)}function bp(){return[...Xc()].slice(-1)[0]}function Us(){return Xc().length>0}function Qc(e){var n;const t=zr((n=bp())==null?void 0:n.node);return zr(e)<t}function Sp(e){_t.push(e)}function xp(e){const t=zr(e);t<0||_t.splice(t,1)}function Cp(){for(const{node:e}of _t)e.style.pointerEvents=Qc(e)?"none":"auto"}function Ep(e){if(Us()&&!hs){const t=je(e);Wc=document.body.style.pointerEvents,t.body.style.pointerEvents="none",hs=!0}}function Rp(e){if(Us())return;const t=je(e);t.body.style.pointerEvents=Wc,t.body.style.length===0&&t.body.removeAttribute("style"),hs=!1}var Ge={layers:_t,isTopMostLayer:wp,hasPointerBlockingLayer:Us,isBelowPointerBlockingLayer:Qc,addLayer:Sp,removeLayer:xp,indexOf:zr,find:yp,assignPointerEventToLayers:Cp,disableBodyPointerEvents:Ep,restoreBodyPointerEvents:Rp};function No(e,t){const[n,r]=z(xl(t==null?void 0:t()));return H(()=>{var o;r(((o=e())==null?void 0:o.tagName.toLowerCase())||xl(t==null?void 0:t()))}),n}function xl(e){return Fn(e)?e:void 0}function ce(e){const[t,n]=k(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return b(fc,O(n,{get component(){return t.as}}))}var Pp=Object.defineProperty,xt=(e,t)=>{for(var n in t)Pp(e,n,{get:t[n],enumerable:!0})},Ip={};xt(Ip,{Button:()=>Op,Root:()=>Ct});var $p=["button","color","file","image","reset","submit"];function Mp(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?$p.indexOf(e.type)!==-1:!1}function Ct(e){let t;const n=Y({type:"button"},e),[r,o]=k(n,["ref","type","disabled"]),i=No(()=>t,()=>"button"),s=L(()=>{const c=i();return c==null?!1:Mp({tagName:c,type:r.type})}),a=L(()=>i()==="input"),l=L(()=>i()==="a"&&(t==null?void 0:t.getAttribute("href"))!=null);return b(ce,O({as:"button",ref(c){var u=ve(d=>t=d,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 Op=Ct;function Ke(e){return t=>(e(t),()=>e(void 0))}var _e=e=>typeof e=="function"?e():e,Ap=e=>{const t=L(()=>{const s=_e(e.element);if(s)return getComputedStyle(s)}),n=()=>{var s;return((s=t())==null?void 0:s.animationName)??"none"},[r,o]=z(_e(e.show)?"present":"hidden");let i="none";return H(s=>{const a=_e(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}),H(()=>{const s=_e(e.element);if(!s)return;const a=c=>{c.target===s&&(i=n())},l=c=>{const d=n().includes(c.animationName);c.target===s&&d&&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}},Fp=Ap,Jn=Fp,Tp={};xt(Tp,{CloseButton:()=>qs,Description:()=>Ws,List:()=>Qs,ProgressFill:()=>Jc,ProgressTrack:()=>ed,Region:()=>Zs,Root:()=>Js,Title:()=>ea,Toast:()=>Qp,toaster:()=>ta});var Yc=we();function Ko(){const e=ye(Yc);if(e===void 0)throw new Error("[kobalte]: `useToastContext` must be used within a `Toast.Root` component");return e}function qs(e){const t=Ko(),[n,r]=k(e,["aria-label","onClick"]);return b(Ct,O({get"aria-label"(){return n["aria-label"]||t.translations().close},onClick:i=>{re(i,n.onClick),t.close()}},r))}function Ws(e){const t=Ko(),n=Y({id:t.generateId("description")},e),[r,o]=k(n,["id"]);return H(()=>W(t.registerDescriptionId(r.id))),b(ce,O({as:"div",get id(){return r.id}},o))}var Zc=we();function Xs(){const e=ye(Zc);if(e===void 0)throw new Error("[kobalte]: `useToastRegionContext` must be used within a `Toast.Region` component");return e}function Qs(e){let t;const n=Xs(),[r,o]=k(e,["ref","onFocusIn","onFocusOut","onPointerMove","onPointerLeave"]),i=c=>{re(c,r.onFocusIn),n.pauseOnInteraction()&&!n.isPaused()&&n.pauseAllTimer()},s=c=>{re(c,r.onFocusOut),Pe(t,c.relatedTarget)||n.resumeAllTimer()},a=c=>{re(c,r.onPointerMove),n.pauseOnInteraction()&&!n.isPaused()&&n.pauseAllTimer()},l=c=>{re(c,r.onPointerLeave),Pe(t,je(t).activeElement)||n.resumeAllTimer()};return H(xe([()=>t,()=>n.hotkey()],([c,u])=>{if(!c)return;const d=je(c),f=h=>{u.every(g=>h[g]||h.code===g)&&$e(c)};d.addEventListener("keydown",f),W(()=>d.removeEventListener("keydown",f))})),H(()=>{if(!n.pauseOnPageIdle())return;const c=zs(t);c.addEventListener("blur",n.pauseAllTimer),c.addEventListener("focus",n.resumeAllTimer),W(()=>{c.removeEventListener("blur",n.pauseAllTimer),c.removeEventListener("focus",n.resumeAllTimer)})}),b(ce,O({as:"ol",ref(c){var u=ve(d=>t=d,r.ref);typeof u=="function"&&u(c)},tabIndex:-1,onFocusIn:i,onFocusOut:s,onPointerMove:a,onPointerLeave:l},o,{get children(){return b(ot,{get each(){return n.toasts()},children:c=>c.toastComponent({get toastId(){return c.id}})})}}))}function Jc(e){const t=Xs(),n=Ko(),[r,o]=k(e,["style"]),[i,s]=z(100);let a=0;return H(()=>{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(ce,O({as:"div",get style(){return ft({"--kb-toast-progress-fill-width":`${i()}%`},r.style)}},o))}function ed(e){return b(ce,O({as:"div","aria-hidden":"true",role:"presentation"},e))}var[Ys,Qr]=Xr({toasts:[]});function Dp(e){Qr("toasts",t=>[...t,e])}function _p(e){return Ys.toasts.find(t=>t.id===e)}function Lp(e,t){const n=Ys.toasts.findIndex(r=>r.id===e);n!==-1&&Qr("toasts",r=>[...r.slice(0,n),t,...r.slice(n+1)])}function kp(e){Qr("toasts",t=>t.id===e,"dismiss",!0)}function Vp(e){Qr("toasts",t=>t.filter(n=>n.id!==e))}function Np(){Qr("toasts",[])}var bn={toasts:()=>Ys.toasts,add:Dp,get:_p,update:Lp,dismiss:kp,remove:Vp,clear:Np},Cl="{hotkey}",Kp={close:"Close"},zp={notifications:e=>`Notifications (${e})`};function Zs(e){const t=Y({id:`toast-region-${Ee()}`,hotkey:["altKey","KeyT"],duration:5e3,limit:3,swipeDirection:"right",swipeThreshold:50,pauseOnInteraction:!0,pauseOnPageIdle:!0,topLayer:!0,translations:zp},e),[n,r]=k(t,["translations","style","hotkey","duration","limit","swipeDirection","swipeThreshold","pauseOnInteraction","pauseOnPageIdle","topLayer","aria-label","regionId"]),o=L(()=>bn.toasts().filter(f=>f.region===n.regionId&&f.dismiss===!1).slice(0,n.limit)),[i,s]=z(!1),a=()=>o().length>0,l=()=>n.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,""),c=()=>(n["aria-label"]||n.translations.notifications(Cl)).replace(Cl,l()),u=()=>({[Kr]: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:ht(()=>r.id)};return b(Zc.Provider,{value:d,get children(){return b(ce,O({as:"div",role:"region",tabIndex:-1,get"aria-label"(){return c()},get style(){return ft({"pointer-events":a()?n.topLayer?"auto":void 0:"none"},n.style)}},u,r))}})}var jp="toast.swipeStart",Bp="toast.swipeMove",Hp="toast.swipeCancel",Gp="toast.swipeEnd";function Js(e){const t=Xs(),n=Y({id:`toast-${Ee()}`,priority:"high",translations:Kp},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]=z(!0),[a,l]=z(),[c,u]=z(),[d,f]=z(!0),[h,p]=z(),{present:g}=Jn({show:i,element:()=>h()??null}),v=L(()=>r.duration||t.duration());let m,y=0,w=v(),S=null,E=null;const $=()=>{s(!1),f(!0)},F=()=>{bn.remove(r.toastId)},_=x=>{!x||r.persistent||(window.clearTimeout(m),y=new Date().getTime(),m=window.setTimeout($,x))},T=()=>{var x;_(w),(x=r.onResume)==null||x.call(r)},K=()=>{var I;const x=new Date().getTime()-y;w=w-x,window.clearTimeout(m),(I=r.onPause)==null||I.call(r)},N=x=>{var I;re(x,r.onKeyDown),x.key==="Escape"&&((I=r.onEscapeKeyDown)==null||I.call(r,x),x.defaultPrevented||$())},j=x=>{re(x,r.onPointerDown),x.button===0&&(S={x:x.clientX,y:x.clientY})},oe=x=>{if(re(x,r.onPointerMove),!S)return;const I=x.clientX-S.x,M=x.clientY-S.y,A=!!E,V=["left","right"].includes(t.swipeDirection()),B=["left","up"].includes(t.swipeDirection())?Math.min:Math.max,U=V?B(0,I):0,Z=V?0:B(0,M),fe=x.pointerType==="touch"?10:2,se={x:U,y:Z},Fe={originalEvent:x,delta:se};if(A){E=se,ao(Bp,r.onSwipeMove,Fe);const{x:tt,y:ie}=se;x.currentTarget.setAttribute("data-swipe","move"),x.currentTarget.style.setProperty("--kb-toast-swipe-move-x",`${tt}px`),x.currentTarget.style.setProperty("--kb-toast-swipe-move-y",`${ie}px`)}else El(se,t.swipeDirection(),fe)?(E=se,ao(jp,r.onSwipeStart,Fe),x.currentTarget.setAttribute("data-swipe","start"),x.target.setPointerCapture(x.pointerId)):(Math.abs(I)>fe||Math.abs(M)>fe)&&(S=null)},P=x=>{re(x,r.onPointerUp);const I=E,M=x.target;if(M.hasPointerCapture(x.pointerId)&&M.releasePointerCapture(x.pointerId),E=null,S=null,I){const A=x.currentTarget,V={originalEvent:x,delta:I};if(El(I,t.swipeDirection(),t.swipeThreshold())){ao(Gp,r.onSwipeEnd,V);const{x:B,y:U}=I;x.currentTarget.setAttribute("data-swipe","end"),x.currentTarget.style.removeProperty("--kb-toast-swipe-move-x"),x.currentTarget.style.removeProperty("--kb-toast-swipe-move-y"),x.currentTarget.style.setProperty("--kb-toast-swipe-end-x",`${B}px`),x.currentTarget.style.setProperty("--kb-toast-swipe-end-y",`${U}px`),$()}else ao(Hp,r.onSwipeCancel,V),x.currentTarget.setAttribute("data-swipe","cancel"),x.currentTarget.style.removeProperty("--kb-toast-swipe-move-x"),x.currentTarget.style.removeProperty("--kb-toast-swipe-move-y"),x.currentTarget.style.removeProperty("--kb-toast-swipe-end-x"),x.currentTarget.style.removeProperty("--kb-toast-swipe-end-y");A.addEventListener("click",B=>B.preventDefault(),{once:!0})}};tr(()=>{t.toasts().find(x=>x.id===r.toastId&&x.update)&&f(!1)}),H(xe(()=>t.isPaused(),x=>{x?K():T()},{defer:!0})),H(xe([i,v],([x,I])=>{x&&!t.isPaused()&&_(I)})),H(xe(()=>{var x;return(x=bn.get(r.toastId))==null?void 0:x.dismiss},x=>x&&$())),H(xe(()=>g(),x=>!x&&F()));const R={translations:()=>r.translations,close:$,duration:v,isPersistent:()=>r.persistent??!1,closeTimerStartTime:()=>y,generateId:ht(()=>o.id),registerTitleId:Ke(l),registerDescriptionId:Ke(u)};return b(ge,{get when(){return g()},get children(){return b(Yc.Provider,{value:R,get children(){return b(ce,O({as:"li",ref(x){var I=ve(p,r.ref);typeof I=="function"&&I(x)},role:"status",tabIndex:0,get style(){return ft({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 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:j,onPointerMove:oe,onPointerUp:P},o))}})}})}function El(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 ao(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 ea(e){const t=Ko(),n=Y({id:t.generateId("title")},e),[r,o]=k(n,["id"]);return H(()=>W(t.registerTitleId(r.id))),b(ce,O({as:"div",get id(){return r.id}},o))}var Up=0;function td(e,t){const n=Up++;return bn.add({id:n,toastComponent:e,dismiss:!1,update:!1,region:t==null?void 0:t.region}),n}function gs(e,t){bn.update(e,{id:e,toastComponent:t,dismiss:!1,update:!0})}function qp(e,t,n){const r=td(o=>t({get toastId(){return o.toastId},state:"pending"}),n);return(Ks(e)?e():e).then(o=>gs(r,i=>t({get toastId(){return i.toastId},state:"fulfilled",data:o}))).catch(o=>gs(r,i=>t({get toastId(){return i.toastId},state:"rejected",error:o}))),r}function Wp(e){return bn.dismiss(e),e}function Xp(){bn.clear()}var ta={show:td,update:gs,promise:qp,dismiss:Wp,clear:Xp},Qp=Object.assign(Js,{CloseButton:qs,Description:Ws,List:Qs,ProgressFill:Jc,ProgressTrack:ed,Region:Zs,Title:ea,toaster:ta});function nd(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=nd(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Yp(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=nd(e))&&(r&&(r+=" "),r+=t);return r}const Rl=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,Pl=Yp,Yr=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Pl(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],d=i==null?void 0:i[c];if(u===null)return null;const f=Rl(u)||Rl(d);return o[c][f]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...h}=u;return Object.entries(h).every(p=>{let[g,v]=p;return Array.isArray(v)?v.includes({...i,...a}[g]):{...i,...a}[g]===v})?[...c,d,f]:c},[]);return Pl(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)};function rd(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=rd(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Zp(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=rd(e))&&(r&&(r+=" "),r+=t);return r}const na="-",Jp=e=>{const t=tm(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(na);return a[0]===""&&a.length!==1&&a.shift(),od(a,t)||em(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},od=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?od(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(na);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId},Il=/^\[(.+)\]$/,em=e=>{if(Il.test(e)){const t=Il.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},tm=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return rm(Object.entries(e.classGroups),n).forEach(([i,s])=>{ps(s,r,i,t)}),r},ps=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:$l(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(nm(o)){ps(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{ps(s,$l(t,i),n,r)})})},$l=(e,t)=>{let n=e;return t.split(na).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},nm=e=>e.isThemeGetter,rm=(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,om=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)}}},id="!",im=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,d;for(let v=0;v<a.length;v++){let m=a[v];if(c===0){if(m===o&&(r||a.slice(v,v+i)===t)){l.push(a.slice(u,v)),u=v+i;continue}if(m==="/"){d=v;continue}}m==="["?c++:m==="]"&&c--}const f=l.length===0?a:a.substring(u),h=f.startsWith(id),p=h?f.substring(1):f,g=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:s}):s},sm=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},am=e=>({cache:om(e.cacheSize),parseClassName:im(e),...Jp(e)}),lm=/\s+/,um=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(lm);let a="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=n(c);let p=!!h,g=r(p?f.substring(0,h):f);if(!g){if(!p){a=c+(a.length>0?" "+a:a);continue}if(g=r(f),!g){a=c+(a.length>0?" "+a:a);continue}p=!1}const v=sm(u).join(":"),m=d?v+id:v,y=m+g;if(i.includes(y))continue;i.push(y);const w=o(g,p);for(let S=0;S<w.length;++S){const E=w[S];i.push(m+E)}a=c+(a.length>0?" "+a:a)}return a};function cm(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=sd(t))&&(r&&(r+=" "),r+=n);return r}const sd=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=sd(e[r]))&&(n&&(n+=" "),n+=t);return n};function dm(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=am(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=um(l,n);return o(l,u),u}return function(){return i(cm.apply(null,arguments))}}const be=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},ad=/^\[(?:([a-z-]+):)?(.+)\]$/i,fm=/^\d+\/\d+$/,hm=new Set(["px","full","screen"]),gm=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pm=/\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$/,mm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,vm=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ym=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pt=e=>Ln(e)||hm.has(e)||fm.test(e),Vt=e=>or(e,"length",Pm),Ln=e=>!!e&&!Number.isNaN(Number(e)),ai=e=>or(e,"number",Ln),br=e=>!!e&&Number.isInteger(Number(e)),wm=e=>e.endsWith("%")&&Ln(e.slice(0,-1)),ae=e=>ad.test(e),Nt=e=>gm.test(e),bm=new Set(["length","size","percentage"]),Sm=e=>or(e,bm,ld),xm=e=>or(e,"position",ld),Cm=new Set(["image","url"]),Em=e=>or(e,Cm,$m),Rm=e=>or(e,"",Im),Sr=()=>!0,or=(e,t,n)=>{const r=ad.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Pm=e=>pm.test(e)&&!mm.test(e),ld=()=>!1,Im=e=>vm.test(e),$m=e=>ym.test(e),Mm=()=>{const e=be("colors"),t=be("spacing"),n=be("blur"),r=be("brightness"),o=be("borderColor"),i=be("borderRadius"),s=be("borderSpacing"),a=be("borderWidth"),l=be("contrast"),c=be("grayscale"),u=be("hueRotate"),d=be("invert"),f=be("gap"),h=be("gradientColorStops"),p=be("gradientColorStopPositions"),g=be("inset"),v=be("margin"),m=be("opacity"),y=be("padding"),w=be("saturate"),S=be("scale"),E=be("sepia"),$=be("skew"),F=be("space"),_=be("translate"),T=()=>["auto","contain","none"],K=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",ae,t],j=()=>[ae,t],oe=()=>["",Pt,Vt],P=()=>["auto",Ln,ae],R=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],x=()=>["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"],A=()=>["","0",ae],V=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[Ln,ae];return{cacheSize:500,separator:":",theme:{colors:[Sr],spacing:[Pt,Vt],blur:["none","",Nt,ae],brightness:B(),borderColor:[e],borderRadius:["none","","full",Nt,ae],borderSpacing:j(),borderWidth:oe(),contrast:B(),grayscale:A(),hueRotate:B(),invert:A(),gap:j(),gradientColorStops:[e],gradientColorStopPositions:[wm,Vt],inset:N(),margin:N(),opacity:B(),padding:j(),saturate:B(),scale:B(),sepia:A(),skew:B(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",ae]}],container:["container"],columns:[{columns:[Nt]}],"break-after":[{"break-after":V()}],"break-before":[{"break-before":V()}],"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(),ae]}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",br,ae]}],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",ae]}],grow:[{grow:A()}],shrink:[{shrink:A()}],order:[{order:["first","last","none",br,ae]}],"grid-cols":[{"grid-cols":[Sr]}],"col-start-end":[{col:["auto",{span:["full",br,ae]},ae]}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":[Sr]}],"row-start-end":[{row:["auto",{span:[br,ae]},ae]}],"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",ae]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ae]}],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:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],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":[F]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[F]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ae,t]}],"min-w":[{"min-w":[ae,t,"min","max","fit"]}],"max-w":[{"max-w":[ae,t,"none","full","min","max","fit","prose",{screen:[Nt]},Nt]}],h:[{h:[ae,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ae,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ae,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ae,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Nt,Vt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ai]}],"font-family":[{font:[Sr]}],"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",ae]}],"line-clamp":[{"line-clamp":["none",Ln,ai]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Pt,ae]}],"list-image":[{"list-image":["none",ae]}],"list-style-type":[{list:["none","disc","decimal",ae]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...x(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Pt,Vt]}],"underline-offset":[{"underline-offset":["auto",Pt,ae]}],"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:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ae]}],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",ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...R(),xm]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Sm]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Em]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"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":[m]}],"border-style":[{border:[...x(),"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":[m]}],"divide-style":[{divide:x()}],"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:["",...x()]}],"outline-offset":[{"outline-offset":[Pt,ae]}],"outline-w":[{outline:[Pt,Vt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[Pt,Vt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Nt,Rm]}],"shadow-color":[{shadow:[Sr]}],opacity:[{opacity:[m]}],"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",Nt,ae]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[E]}],"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":[d]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"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",ae]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",ae]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",ae]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[br,ae]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[$]}],"skew-y":[{"skew-y":[$]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ae]}],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",ae]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",ae]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Pt,Vt,ai]}],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"]}}},Om=dm(Mm);function ue(...e){return Om(Zp(e))}var Am=te('<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">'),Fm=te('<div class="grid gap-1">');const Tm=Yr("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"}}),Dm=e=>{const[t,n]=k(e,["class"]);return b(_o,{get children(){return b(Zs,{get children(){return b(Qs,O({get class(){return ue("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))}})}})},_m=e=>{const[t,n]=k(e,["class","variant"]);return b(Js,O({get class(){return ue(Tm({variant:t.variant}),t.class)}},n))},Lm=e=>{const[t,n]=k(e,["class"]);return b(qs,O({get class(){return ue("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 Am()}}))},km=e=>{const[t,n]=k(e,["class"]);return b(ea,O({get class(){return ue("text-sm font-semibold",t.class)}},n))},Vm=e=>{const[t,n]=k(e,["class"]);return b(Ws,O({get class(){return ue("text-sm opacity-90",t.class)}},n))};function ms(e){ta.show(t=>b(_m,{get toastId(){return t.toastId},get variant(){return e.variant},get duration(){return e.duration},get children(){return[(()=>{var n=Fm();return X(n,(()=>{var r=L(()=>!!e.title);return()=>r()&&b(km,{get children(){return e.title}})})(),null),X(n,(()=>{var r=L(()=>!!e.description);return()=>r()&&b(Vm,{get children(){return e.description}})})(),null),n})(),b(Lm,{})]}}))}var li="focusScope.autoFocusOnMount",ui="focusScope.autoFocusOnUnmount",Ml={bubbles:!1,cancelable:!0},Ol={stack:[],active(){return this.stack[0]},add(e){var t;e!==this.active()&&((t=this.active())==null||t.pause()),this.stack=ds(this.stack,e),this.stack.unshift(e)},remove(e){var t;this.stack=ds(this.stack,e),(t=this.active())==null||t.resume()}};function ud(e,t){const[n,r]=z(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=p=>{var g;return(g=e.onMountAutoFocus)==null?void 0:g.call(e,p)},a=p=>{var g;return(g=e.onUnmountAutoFocus)==null?void 0:g.call(e,p)},l=()=>je(t()),c=()=>{const p=l().createElement("span");return p.setAttribute("data-focus-trap",""),p.tabIndex=0,Object.assign(p.style,qc),p},u=()=>{const p=t();return p?Hc(p,!0).filter(g=>!g.hasAttribute("data-focus-trap")):[]},d=()=>{const p=u();return p.length>0?p[0]:null},f=()=>{const p=u();return p.length>0?p[p.length-1]:null},h=()=>{const p=t();if(!p)return!1;const g=Or(p);return!g||Pe(p,g)?!1:Gc(g)};H(()=>{const p=t();if(!p)return;Ol.add(o);const g=Or(p);if(!Pe(p,g)){const m=new CustomEvent(li,Ml);p.addEventListener(li,s),p.dispatchEvent(m),m.defaultPrevented||setTimeout(()=>{$e(d()),Or(p)===g&&$e(p)},0)}W(()=>{p.removeEventListener(li,s),setTimeout(()=>{const m=new CustomEvent(ui,Ml);h()&&m.preventDefault(),p.addEventListener(ui,a),p.dispatchEvent(m),m.defaultPrevented||$e(g??l().body),p.removeEventListener(ui,a),Ol.remove(o)},0)})}),H(()=>{const p=t();if(!p||!D(e.trapFocus)||n())return;const g=m=>{const y=m.target;y!=null&&y.closest(`[${Kr}]`)||(Pe(p,y)?i=y:$e(i))},v=m=>{const w=m.relatedTarget??Or(p);w!=null&&w.closest(`[${Kr}]`)||Pe(p,w)||$e(i)};l().addEventListener("focusin",g),l().addEventListener("focusout",v),W(()=>{l().removeEventListener("focusin",g),l().removeEventListener("focusout",v)})}),H(()=>{const p=t();if(!p||!D(e.trapFocus)||n())return;const g=c();p.insertAdjacentElement("afterbegin",g);const v=c();p.insertAdjacentElement("beforeend",v);function m(w){const S=d(),E=f();w.relatedTarget===S?$e(E):$e(S)}g.addEventListener("focusin",m),v.addEventListener("focusin",m);const y=new MutationObserver(w=>{for(const S of w)S.previousSibling===v&&(v.remove(),p.insertAdjacentElement("beforeend",v)),S.nextSibling===g&&(g.remove(),p.insertAdjacentElement("afterbegin",g))});y.observe(p,{childList:!0,subtree:!1}),W(()=>{g.removeEventListener("focusin",m),v.removeEventListener("focusin",m),g.remove(),v.remove(),y.disconnect()})})}var Nm="data-live-announcer";function cd(e){H(()=>{D(e.isDisabled)||W(Km(D(e.targets),D(e.root)))})}var xr=new WeakMap,Qe=[];function Km(e,t=document.body){const n=new Set(e),r=new Set,o=l=>{for(const f of l.querySelectorAll(`[${Nm}], [${Kr}]`))n.add(f);const c=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},u=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),d=c(l);if(d===NodeFilter.FILTER_ACCEPT&&i(l),d!==NodeFilter.FILTER_REJECT){let f=u.nextNode();for(;f!=null;)i(f),f=u.nextNode()}},i=l=>{const c=xr.get(l)??0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),xr.set(l,c+1))};Qe.length&&Qe[Qe.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 Qe.push(a),()=>{s.disconnect();for(const l of r){const c=xr.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),xr.delete(l)):xr.set(l,c-1)}a===Qe[Qe.length-1]?(Qe.pop(),Qe.length&&Qe[Qe.length-1].observe()):Qe.splice(Qe.indexOf(a),1)}}function zm(e){const t=n=>{var r;n.key===js.Escape&&((r=e.onEscapeKeyDown)==null||r.call(e,n))};H(()=>{var r;if(D(e.isDisabled))return;const n=((r=e.ownerDocument)==null?void 0:r.call(e))??je();n.addEventListener("keydown",t),W(()=>{n.removeEventListener("keydown",t)})})}var Al="interactOutside.pointerDownOutside",Fl="interactOutside.focusOutside";function dd(e,t){let n,r=pp;const o=()=>je(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)},l=d=>{var h;const f=d.target;return!(f instanceof HTMLElement)||f.closest(`[${Kr}]`)||!Pe(o(),f)||Pe(t(),f)?!1:!((h=e.shouldExcludeElement)!=null&&h.call(e,f))},c=d=>{function f(){const h=t(),p=d.target;if(!h||!p||!l(d))return;const g=Se([i,a]);p.addEventListener(Al,g,{once:!0});const v=new CustomEvent(Al,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||op(d)&&d.button===0}});p.dispatchEvent(v)}d.pointerType==="touch"?(o().removeEventListener("click",f),r=f,o().addEventListener("click",f,{once:!0})):f()},u=d=>{const f=t(),h=d.target;if(!f||!h||!l(d))return;const p=Se([s,a]);h.addEventListener(Fl,p,{once:!0});const g=new CustomEvent(Fl,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});h.dispatchEvent(g)};H(()=>{D(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 fd=we();function jm(){return ye(fd)}function zo(e){let t;const n=jm(),[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()}};dd({shouldExcludeElement:d=>{var f;return t?((f=r.excludedElements)==null?void 0:f.some(h=>Pe(h(),d)))||[...i].some(h=>Pe(h,d)):!1},onPointerDownOutside:d=>{var f,h,p;!t||Ge.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!Ge.isTopMostLayer(t)||((f=r.onPointerDownOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(p=r.onDismiss)==null||p.call(r))},onFocusOutside:d=>{var f,h,p;(f=r.onFocusOutside)==null||f.call(r,d),(h=r.onInteractOutside)==null||h.call(r,d),d.defaultPrevented||(p=r.onDismiss)==null||p.call(r)}},()=>t),zm({ownerDocument:()=>je(t),onEscapeKeyDown:d=>{var f;!t||!Ge.isTopMostLayer(t)||((f=r.onEscapeKeyDown)==null||f.call(r,d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),tr(()=>{if(!t)return;Ge.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n==null?void 0:n.registerNestedLayer(t);Ge.assignPointerEventToLayers(),Ge.disableBodyPointerEvents(t),W(()=>{t&&(Ge.removeLayer(t),d==null||d(),Ge.assignPointerEventToLayers(),Ge.restoreBodyPointerEvents(t))})}),H(xe([()=>t,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const h=Ge.find(d);h&&h.isPointerBlocking!==f&&(h.isPointerBlocking=f,Ge.assignPointerEventToLayers()),f&&Ge.disableBodyPointerEvents(d),W(()=>{Ge.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:s};return b(fd.Provider,{value:u,get children(){return b(ce,O({as:"div",ref(d){var f=ve(h=>t=h,r.ref);typeof f=="function"&&f(d)}},o))}})}function bt(e){var s;const[t,n]=z((s=e.defaultValue)==null?void 0:s.call(e)),r=L(()=>{var a;return((a=e.value)==null?void 0:a.call(e))!==void 0}),o=L(()=>{var a;return r()?(a=e.value)==null?void 0:a.call(e):t()});return[o,a=>{Me(()=>{var c;const l=qg(a,o());return Object.is(l,o())||(r()||n(l),(c=e.onChange)==null||c.call(e,l)),l})}]}function hd(e){const[t,n]=bt(e);return[()=>t()??!1,n]}function Bm(e){const[t,n]=bt(e);return[()=>t()??[],n]}function jo(e={}){const[t,n]=hd({value:()=>D(e.open),defaultValue:()=>!!D(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 vs=(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},lo=new Map,Hm=e=>{H(()=>{const t=_e(e.style)??{},n=_e(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=lo.get(e.key);o?o.activeCount++:lo.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=lo.get(e.key);if(i){if(i.activeCount!==1){i.activeCount--;return}lo.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)}})})},Tl=Hm,Gm=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},Um=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},qm=(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]=Gm(o,t),d=u-l-r*c;(c!==0||d!==0)&&Um(o,t)&&(i+=d,s+=c),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]},[Dl,_l]=z([]),Wm=e=>Dl().indexOf(e)===Dl().length-1,Xm=e=>{const t=O({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;H(()=>{_e(t.enabled)&&(_l(c=>[...c,n]),W(()=>{_l(c=>c.filter(u=>u!==n))}))}),H(()=>{if(!_e(t.enabled)||!_e(t.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(_e(t.preventScrollbarShift)){const d={overflow:"hidden"},f=[];u>0&&(_e(t.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${u}px)`:d.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${u}px)`,f.push({key:"--scrollbar-width",value:`${u}px`}));const h=window.scrollY,p=window.scrollX;Tl({key:"prevent-scroll",element:c,style:d,properties:f,cleanup:()=>{_e(t.restoreScrollPosition)&&u>0&&window.scrollTo(p,h)}})}else Tl({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),H(()=>{!Wm(n)||!_e(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=Ll(c),o=null,i=null},a=c=>{const u=c.target,d=_e(t.element),f=Qm(c),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",p=h==="x"?f[0]:f[1],g=kl(u,h,p,d);let v;d&&vs(d,u)?v=!g:v=!0,v&&c.cancelable&&c.preventDefault()},l=c=>{const u=_e(t.element),d=c.target;let f;if(c.touches.length===2)f=!_e(t.allowPinchZoom);else{if(o==null||i===null){const h=Ll(c).map((g,v)=>r[v]-g),p=Math.abs(h[0])>Math.abs(h[1])?"x":"y";o=p,i=p==="x"?h[0]:h[1]}if(d.type==="range")f=!1;else{const h=kl(d,o,i,u);u&&vs(u,d)?f=!h:f=!0}}f&&c.cancelable&&c.preventDefault()}},Qm=e=>[e.deltaX,e.deltaY],Ll=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],kl=(e,t,n,r)=>{const o=r!==null&&vs(r,e),[i,s]=qm(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(s)<1)},Ym=Xm,gd=Ym,Zm={};xt(Zm,{CloseButton:()=>Rn,Content:()=>Bo,Description:()=>ir,Dialog:()=>Jm,Overlay:()=>sr,Portal:()=>ar,Root:()=>lr,Title:()=>ur,Trigger:()=>Zr});var pd=we();function En(){const e=ye(pd);if(e===void 0)throw new Error("[kobalte]: `useDialogContext` must be used within a `Dialog` component");return e}function Rn(e){const t=En(),[n,r]=k(e,["aria-label","onClick"]);return b(Ct,O({get"aria-label"(){return n["aria-label"]||t.translations().dismiss},onClick:i=>{re(i,n.onClick),t.close()}},r))}function Bo(e){let t;const n=En(),r=Y({id:n.generateId("content")},e),[o,i]=k(r,["ref","onOpenAutoFocus","onCloseAutoFocus","onPointerDownOutside","onFocusOutside","onInteractOutside"]);let s=!1,a=!1;const l=f=>{var h;(h=o.onPointerDownOutside)==null||h.call(o,f),n.modal()&&f.detail.isContextMenu&&f.preventDefault()},c=f=>{var h;(h=o.onFocusOutside)==null||h.call(o,f),n.modal()&&f.preventDefault()},u=f=>{var h;(h=o.onInteractOutside)==null||h.call(o,f),!n.modal()&&(f.defaultPrevented||(s=!0,f.detail.originalEvent.type==="pointerdown"&&(a=!0)),Pe(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(),$e(n.triggerRef())):(f.defaultPrevented||(s||$e(n.triggerRef()),f.preventDefault()),s=!1,a=!1)};return cd({isDisabled:()=>!(n.isOpen()&&n.modal()),targets:()=>t?[t]:[]}),gd({element:()=>t??null,enabled:()=>n.contentPresent()&&n.preventScroll()}),ud({trapFocus:()=>n.isOpen()&&n.modal(),onMountAutoFocus:o.onOpenAutoFocus,onUnmountAutoFocus:d},()=>t),H(()=>W(n.registerContentId(i.id))),b(ge,{get when(){return n.contentPresent()},get children(){return b(zo,O({ref(f){var h=ve(p=>{n.setContentRef(p),t=p},o.ref);typeof h=="function"&&h(f)},role:"dialog",tabIndex:-1,get disableOutsidePointerEvents(){return L(()=>!!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 ir(e){const t=En(),n=Y({id:t.generateId("description")},e),[r,o]=k(n,["id"]);return H(()=>W(t.registerDescriptionId(r.id))),b(ce,O({as:"p",get id(){return r.id}},o))}function sr(e){const t=En(),[n,r]=k(e,["ref","style","onPointerDown"]),o=i=>{re(i,n.onPointerDown),i.target===i.currentTarget&&i.preventDefault()};return b(ge,{get when(){return t.overlayPresent()},get children(){return b(ce,O({as:"div",ref(i){var s=ve(t.setOverlayRef,n.ref);typeof s=="function"&&s(i)},get style(){return ft({"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 ar(e){const t=En();return b(ge,{get when(){return t.contentPresent()||t.overlayPresent()},get children(){return b(_o,e)}})}var Vl={dismiss:"Dismiss"};function lr(e){const t=`dialog-${Ee()}`,n=Y({id:t,modal:!0,translations:Vl},e),[r,o]=z(),[i,s]=z(),[a,l]=z(),[c,u]=z(),[d,f]=z(),[h,p]=z(),g=jo({open:()=>n.open,defaultOpen:()=>n.defaultOpen,onOpenChange:S=>{var E;return(E=n.onOpenChange)==null?void 0:E.call(n,S)}}),v=()=>n.forceMount||g.isOpen(),{present:m}=Jn({show:v,element:()=>c()??null}),{present:y}=Jn({show:v,element:()=>d()??null}),w={translations:()=>n.translations??Vl,isOpen:g.isOpen,modal:()=>n.modal??!0,preventScroll:()=>n.preventScroll??w.modal(),contentId:r,titleId:i,descriptionId:a,triggerRef:h,overlayRef:c,setOverlayRef:u,contentRef:d,setContentRef:f,overlayPresent:m,contentPresent:y,close:g.close,toggle:g.toggle,setTriggerRef:p,generateId:ht(()=>n.id),registerContentId:Ke(o),registerTitleId:Ke(s),registerDescriptionId:Ke(l)};return b(pd.Provider,{value:w,get children(){return n.children}})}function ur(e){const t=En(),n=Y({id:t.generateId("title")},e),[r,o]=k(n,["id"]);return H(()=>W(t.registerTitleId(r.id))),b(ce,O({as:"h2",get id(){return r.id}},o))}function Zr(e){const t=En(),[n,r]=k(e,["ref","onClick"]);return b(Ct,O({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 L(()=>!!t.isOpen())()?t.contentId():void 0},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onClick:i=>{re(i,n.onClick),t.toggle()}},r))}var Jm=Object.assign(lr,{CloseButton:Rn,Content:Bo,Description:ir,Overlay:sr,Portal:ar,Title:ur,Trigger:Zr}),md=te("<div>"),ev=te('<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">'),tv=te("<span class=sr-only>Close");const nv=lr,rv=Yr("fixed inset-0 z-50 flex",{variants:{position:{top:"items-start",bottom:"items-end",left:"justify-start",right:"justify-end"}},defaultVariants:{position:"right"}}),ov=e=>{const[t,n]=k(e,["position","children"]);return b(ar,O(n,{get children(){var r=md();return X(r,()=>t.children),ze(()=>uc(r,rv({position:t.position}))),r}}))},iv=e=>{const[t,n]=k(e,["class"]);return b(sr,O({get class(){return ue("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))},sv=Yr("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"}}),av=e=>{const[t,n]=k(e,["position","class","children"]);return b(ov,{get position(){return t.position},get children(){return[b(iv,{}),b(Bo,O({get class(){return ue(sv({position:t.position}),t.class,"max-h-screen overflow-y-auto")}},n,{get children(){return[L(()=>t.children),b(Rn,{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[ev(),tv()]}})]}}))]}})},lv=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=md();return et(r,O({get class(){return ue("flex flex-col space-y-2 text-center sm:text-left",t.class)}},n),!1,!1),r})()},uv=e=>{const[t,n]=k(e,["class"]);return b(ur,O({get class(){return ue("text-lg font-semibold text-foreground",t.class)}},n))},cv=e=>{const[t,n]=k(e,["class"]);return b(ir,O({get class(){return ue("text-sm text-muted-foreground",t.class)}},n))},vd=()=>{const[e,t]=Uh(),n=L(()=>(e==null?void 0:e.bundleId)??null),r=L(()=>(e==null?void 0:e.channel)??null),o=L(()=>(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})}}};var dv=te("<svg stroke-width=0>");function yd(e,t){const n=O(e.a,t),[r,o]=k(n,["src"]),[i,s]=z(""),a=L(()=>t.title?`${e.c}<title>${t.title}</title>`:e.c);return H(()=>s(a())),W(()=>{s("")}),(()=>{var l=dv();return et(l,O({get stroke(){var c;return(c=e.a)==null?void 0:c.stroke},get color(){return t.color||"currentColor"},get fill(){return t.color||"currentColor"},get style(){return{...t.style,overflow:"visible"}}},o,{get height(){return t.size||"1em"},get width(){return t.size||"1em"},xmlns:"http://www.w3.org/2000/svg",get innerHTML(){return i()}}),!0,!0),X(l,()=>cc),l})()}function wd(e){return yd({a:{viewBox:"0 0 1024 1024"},c:'<path d="M270.1 741.7c0 23.4 19.1 42.5 42.6 42.5h48.7v120.4c0 30.5 24.5 55.4 54.6 55.4 30.2 0 54.6-24.8 54.6-55.4V784.1h85v120.4c0 30.5 24.5 55.4 54.6 55.4 30.2 0 54.6-24.8 54.6-55.4V784.1h48.7c23.5 0 42.6-19.1 42.6-42.5V346.4h-486v395.3zm357.1-600.1 44.9-65c2.6-3.8 2-8.9-1.5-11.4-3.5-2.4-8.5-1.2-11.1 2.6l-46.6 67.6c-30.7-12.1-64.9-18.8-100.8-18.8-35.9 0-70.1 6.7-100.8 18.8l-46.6-67.5c-2.6-3.8-7.6-5.1-11.1-2.6-3.5 2.4-4.1 7.4-1.5 11.4l44.9 65c-71.4 33.2-121.4 96.1-127.8 169.6h486c-6.6-73.6-56.7-136.5-128-169.7zM409.5 244.1a26.9 26.9 0 1 1 26.9-26.9 26.97 26.97 0 0 1-26.9 26.9zm208.4 0a26.9 26.9 0 1 1 26.9-26.9 26.97 26.97 0 0 1-26.9 26.9zm223.4 100.7c-30.2 0-54.6 24.8-54.6 55.4v216.4c0 30.5 24.5 55.4 54.6 55.4 30.2 0 54.6-24.8 54.6-55.4V400.1c.1-30.6-24.3-55.3-54.6-55.3zm-658.6 0c-30.2 0-54.6 24.8-54.6 55.4v216.4c0 30.5 24.5 55.4 54.6 55.4 30.2 0 54.6-24.8 54.6-55.4V400.1c0-30.6-24.5-55.3-54.6-55.3z"/>'},e)}function bd(e){return yd({a:{viewBox:"0 0 1024 1024"},c:'<path d="M747.4 535.7c-.4-68.2 30.5-119.6 92.9-157.5-34.9-50-87.7-77.5-157.3-82.8-65.9-5.2-138 38.4-164.4 38.4-27.9 0-91.7-36.6-141.9-36.6C273.1 298.8 163 379.8 163 544.6c0 48.7 8.9 99 26.7 150.8 23.8 68.2 109.6 235.3 199.1 232.6 46.8-1.1 79.9-33.2 140.8-33.2 59.1 0 89.7 33.2 141.9 33.2 90.3-1.3 167.9-153.2 190.5-221.6-121.1-57.1-114.6-167.2-114.6-170.7zm-105.1-305c50.7-60.2 46.1-115 44.6-134.7-44.8 2.6-96.6 30.5-126.1 64.8-32.5 36.8-51.6 82.3-47.5 133.6 48.4 3.7 92.6-21.2 129-63.7z"/>'},e)}var fv=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),hv=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function gv(e){if(Intl.Locale){const n=new Intl.Locale(e).maximize().script??"";return fv.has(n)}const t=e.split("-")[0];return hv.has(t)}function pv(e){return gv(e)?"rtl":"ltr"}function Sd(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:pv(e)}}var ys=Sd(),Ar=new Set;function Nl(){ys=Sd();for(const e of Ar)e(ys)}function mv(){const[e,t]=z(ys),n=L(()=>e());return tr(()=>{Ar.size===0&&window.addEventListener("languagechange",Nl),Ar.add(t),W(()=>{Ar.delete(t),Ar.size===0&&window.removeEventListener("languagechange",Nl)})}),{locale:()=>n().locale,direction:()=>n().direction}}var vv=we();function rn(){const e=mv();return ye(vv)||e}var ci=new Map;function yv(e){const{locale:t}=rn(),n=L(()=>t()+(e?Object.entries(e).sort((r,o)=>r[0]<o[0]?-1:1).join():""));return L(()=>{const r=n();let o;return ci.has(r)&&(o=ci.get(r)),o||(o=new Intl.Collator(t(),e),ci.set(r,o)),o})}const wv=["top","right","bottom","left"],Jt=Math.min,Ue=Math.max,$o=Math.round,uo=Math.floor,wt=e=>({x:e,y:e}),bv={left:"right",right:"left",bottom:"top",top:"bottom"},Sv={start:"end",end:"start"};function ws(e,t,n){return Ue(e,Jt(t,n))}function Pn(e,t){return typeof e=="function"?e(t):e}function en(e){return e.split("-")[0]}function cr(e){return e.split("-")[1]}function xd(e){return e==="x"?"y":"x"}function ra(e){return e==="y"?"height":"width"}function Sn(e){return["top","bottom"].includes(en(e))?"y":"x"}function oa(e){return xd(Sn(e))}function xv(e,t,n){n===void 0&&(n=!1);const r=cr(e),o=oa(e),i=ra(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Mo(s)),[s,Mo(s)]}function Cv(e){const t=Mo(e);return[bs(e),t,bs(t)]}function bs(e){return e.replace(/start|end/g,t=>Sv[t])}function Ev(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 Rv(e,t,n,r){const o=cr(e);let i=Ev(en(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(bs)))),i}function Mo(e){return e.replace(/left|right|bottom|top/g,t=>bv[t])}function Pv(e){return{top:0,right:0,bottom:0,left:0,...e}}function Cd(e){return typeof e!="number"?Pv(e):{top:e,right:e,bottom:e,left:e}}function Oo(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 Kl(e,t,n){let{reference:r,floating:o}=e;const i=Sn(t),s=oa(t),a=ra(s),l=en(t),c=i==="y",u=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(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:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(cr(t)){case"start":h[s]-=f*(n&&c?-1:1);break;case"end":h[s]+=f*(n&&c?-1:1);break}return h}const Iv=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:d}=Kl(c,r,l),f=r,h={},p=0;for(let g=0;g<a.length;g++){const{name:v,fn:m}=a[g],{x:y,y:w,data:S,reset:E}=await m({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=y??u,d=w??d,h={...h,[v]:{...h[v],...S}},E&&p<=50&&(p++,typeof E=="object"&&(E.placement&&(f=E.placement),E.rects&&(c=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:u,y:d}=Kl(c,f,l)),g=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:h}};async function jr(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:d="floating",altBoundary:f=!1,padding:h=0}=Pn(t,e),p=Cd(h),v=a[f?d==="floating"?"reference":"floating":d],m=Oo(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})),y=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},E=Oo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:w,strategy:l}):y);return{top:(m.top-E.top+p.top)/S.y,bottom:(E.bottom-m.bottom+p.bottom)/S.y,left:(m.left-E.left+p.left)/S.x,right:(E.right-m.right+p.right)/S.x}}const $v=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}=Pn(e,t)||{};if(c==null)return{};const d=Cd(u),f={x:n,y:r},h=oa(o),p=ra(h),g=await s.getDimensions(c),v=h==="y",m=v?"top":"left",y=v?"bottom":"right",w=v?"clientHeight":"clientWidth",S=i.reference[p]+i.reference[h]-f[h]-i.floating[p],E=f[h]-i.reference[h],$=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let F=$?$[w]:0;(!F||!await(s.isElement==null?void 0:s.isElement($)))&&(F=a.floating[w]||i.floating[p]);const _=S/2-E/2,T=F/2-g[p]/2-1,K=Jt(d[m],T),N=Jt(d[y],T),j=K,oe=F-g[p]-N,P=F/2-g[p]/2+_,R=ws(j,P,oe),x=!l.arrow&&cr(o)!=null&&P!==R&&i.reference[p]/2-(P<j?K:N)-g[p]/2<0,I=x?P<j?P-j:P-oe:0;return{[h]:f[h]+I,data:{[h]:R,centerOffset:P-R-I,...x&&{alignmentOffset:I}},reset:x}}}),Mv=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:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...v}=Pn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const m=en(o),y=Sn(a),w=en(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),E=f||(w||!g?[Mo(a)]:Cv(a)),$=p!=="none";!f&&$&&E.push(...Rv(a,g,p,S));const F=[a,...E],_=await jr(t,v),T=[];let K=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&T.push(_[m]),d){const P=xv(o,s,S);T.push(_[P[0]],_[P[1]])}if(K=[...K,{placement:o,overflows:T}],!T.every(P=>P<=0)){var N,j;const P=(((N=i.flip)==null?void 0:N.index)||0)+1,R=F[P];if(R)return{data:{index:P,overflows:K},reset:{placement:R}};let x=(j=K.filter(I=>I.overflows[0]<=0).sort((I,M)=>I.overflows[1]-M.overflows[1])[0])==null?void 0:j.placement;if(!x)switch(h){case"bestFit":{var oe;const I=(oe=K.filter(M=>{if($){const A=Sn(M.placement);return A===y||A==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(A=>A>0).reduce((A,V)=>A+V,0)]).sort((M,A)=>M[1]-A[1])[0])==null?void 0:oe[0];I&&(x=I);break}case"initialPlacement":x=a;break}if(o!==x)return{reset:{placement:x}}}return{}}}};function zl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function jl(e){return wv.some(t=>e[t]>=0)}const Ov=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Pn(e,t);switch(r){case"referenceHidden":{const i=await jr(t,{...o,elementContext:"reference"}),s=zl(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:jl(s)}}}case"escaped":{const i=await jr(t,{...o,altBoundary:!0}),s=zl(i,n.floating);return{data:{escapedOffsets:s,escaped:jl(s)}}}default:return{}}}}};async function Av(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=en(n),a=cr(n),l=Sn(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=Pn(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const Fv=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 Av(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}}}}},Tv=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:m,y}=v;return{x:m,y}}},...l}=Pn(e,t),c={x:n,y:r},u=await jr(t,l),d=Sn(en(o)),f=xd(d);let h=c[f],p=c[d];if(i){const v=f==="y"?"top":"left",m=f==="y"?"bottom":"right",y=h+u[v],w=h-u[m];h=ws(y,h,w)}if(s){const v=d==="y"?"top":"left",m=d==="y"?"bottom":"right",y=p+u[v],w=p-u[m];p=ws(y,p,w)}const g=a.fn({...t,[f]:h,[d]:p});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[f]:i,[d]:s}}}}}},Dv=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}=Pn(e,t),u=await jr(t,c),d=en(o),f=cr(o),h=Sn(o)==="y",{width:p,height:g}=i.floating;let v,m;d==="top"||d==="bottom"?(v=d,m=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(m=d,v=f==="end"?"top":"bottom");const y=g-u.top-u.bottom,w=p-u.left-u.right,S=Jt(g-u[v],y),E=Jt(p-u[m],w),$=!t.middlewareData.shift;let F=S,_=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(F=y),$&&!f){const K=Ue(u.left,0),N=Ue(u.right,0),j=Ue(u.top,0),oe=Ue(u.bottom,0);h?_=p-2*(K!==0||N!==0?K+N:Ue(u.left,u.right)):F=g-2*(j!==0||oe!==0?j+oe:Ue(u.top,u.bottom))}await l({...t,availableWidth:_,availableHeight:F});const T=await s.getDimensions(a.floating);return p!==T.width||g!==T.height?{reset:{rects:!0}}:{}}}};function Ho(){return typeof window<"u"}function dr(e){return Ed(e)?(e.nodeName||"").toLowerCase():"#document"}function We(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Et(e){var t;return(t=(Ed(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ed(e){return Ho()?e instanceof Node||e instanceof We(e).Node:!1}function ct(e){return Ho()?e instanceof Element||e instanceof We(e).Element:!1}function St(e){return Ho()?e instanceof HTMLElement||e instanceof We(e).HTMLElement:!1}function Bl(e){return!Ho()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof We(e).ShadowRoot}function Jr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=dt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function _v(e){return["table","td","th"].includes(dr(e))}function Go(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ia(e){const t=sa(),n=ct(e)?dt(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 Lv(e){let t=tn(e);for(;St(t)&&!er(t);){if(ia(t))return t;if(Go(t))return null;t=tn(t)}return null}function sa(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function er(e){return["html","body","#document"].includes(dr(e))}function dt(e){return We(e).getComputedStyle(e)}function Uo(e){return ct(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function tn(e){if(dr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Bl(e)&&e.host||Et(e);return Bl(t)?t.host:t}function Rd(e){const t=tn(e);return er(t)?e.ownerDocument?e.ownerDocument.body:e.body:St(t)&&Jr(t)?t:Rd(t)}function Br(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Rd(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=We(o);if(i){const a=Ss(s);return t.concat(s,s.visualViewport||[],Jr(o)?o:[],a&&n?Br(a):[])}return t.concat(o,Br(o,[],n))}function Ss(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Pd(e){const t=dt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=St(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=$o(n)!==i||$o(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function aa(e){return ct(e)?e:e.contextElement}function kn(e){const t=aa(e);if(!St(t))return wt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Pd(t);let s=(i?$o(n.width):n.width)/r,a=(i?$o(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const kv=wt(0);function Id(e){const t=We(e);return!sa()||!t.visualViewport?kv:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Vv(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==We(e)?!1:t}function xn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=aa(e);let s=wt(1);t&&(r?ct(r)&&(s=kn(r)):s=kn(e));const a=Vv(i,n,r)?Id(i):wt(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const f=We(i),h=r&&ct(r)?We(r):r;let p=f,g=Ss(p);for(;g&&r&&h!==p;){const v=kn(g),m=g.getBoundingClientRect(),y=dt(g),w=m.left+(g.clientLeft+parseFloat(y.paddingLeft))*v.x,S=m.top+(g.clientTop+parseFloat(y.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=w,c+=S,p=We(g),g=Ss(p)}}return Oo({width:u,height:d,x:l,y:c})}function la(e,t){const n=Uo(e).scrollLeft;return t?t.left+n:xn(Et(e)).left+n}function $d(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:la(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Nv(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Et(r),a=t?Go(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=wt(1);const u=wt(0),d=St(r);if((d||!d&&!i)&&((dr(r)!=="body"||Jr(s))&&(l=Uo(r)),St(r))){const h=xn(r);c=kn(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const f=s&&!d&&!i?$d(s,l,!0):wt(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function Kv(e){return Array.from(e.getClientRects())}function zv(e){const t=Et(e),n=Uo(e),r=e.ownerDocument.body,o=Ue(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ue(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+la(e);const a=-n.scrollTop;return dt(r).direction==="rtl"&&(s+=Ue(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function jv(e,t){const n=We(e),r=Et(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=sa();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function Bv(e,t){const n=xn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=St(e)?kn(e):wt(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 Hl(e,t,n){let r;if(t==="viewport")r=jv(e,n);else if(t==="document")r=zv(Et(e));else if(ct(t))r=Bv(t,n);else{const o=Id(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Oo(r)}function Md(e,t){const n=tn(e);return n===t||!ct(n)||er(n)?!1:dt(n).position==="fixed"||Md(n,t)}function Hv(e,t){const n=t.get(e);if(n)return n;let r=Br(e,[],!1).filter(a=>ct(a)&&dr(a)!=="body"),o=null;const i=dt(e).position==="fixed";let s=i?tn(e):e;for(;ct(s)&&!er(s);){const a=dt(s),l=ia(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Jr(s)&&!l&&Md(e,s))?r=r.filter(u=>u!==s):o=a,s=tn(s)}return t.set(e,r),r}function Gv(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Go(t)?[]:Hv(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=Hl(t,u,o);return c.top=Ue(d.top,c.top),c.right=Jt(d.right,c.right),c.bottom=Jt(d.bottom,c.bottom),c.left=Ue(d.left,c.left),c},Hl(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Uv(e){const{width:t,height:n}=Pd(e);return{width:t,height:n}}function qv(e,t,n){const r=St(t),o=Et(t),i=n==="fixed",s=xn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=wt(0);if(r||!r&&!i)if((dr(t)!=="body"||Jr(o))&&(a=Uo(t)),r){const f=xn(t,!0,i,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&(l.x=la(o));const c=o&&!r&&!i?$d(o,a):wt(0),u=s.left+a.scrollLeft-l.x-c.x,d=s.top+a.scrollTop-l.y-c.y;return{x:u,y:d,width:s.width,height:s.height}}function di(e){return dt(e).position==="static"}function Gl(e,t){if(!St(e)||dt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Et(e)===n&&(n=n.ownerDocument.body),n}function Od(e,t){const n=We(e);if(Go(e))return n;if(!St(e)){let o=tn(e);for(;o&&!er(o);){if(ct(o)&&!di(o))return o;o=tn(o)}return n}let r=Gl(e,t);for(;r&&_v(r)&&di(r);)r=Gl(r,t);return r&&er(r)&&di(r)&&!ia(r)?n:r||Lv(e)||n}const Wv=async function(e){const t=this.getOffsetParent||Od,n=this.getDimensions,r=await n(e.floating);return{reference:qv(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Xv(e){return dt(e).direction==="rtl"}const Ad={convertOffsetParentRelativeRectToViewportRelativeRect:Nv,getDocumentElement:Et,getClippingRect:Gv,getOffsetParent:Od,getElementRects:Wv,getClientRects:Kv,getDimensions:Uv,getScale:kn,isElement:ct,isRTL:Xv};function Qv(e,t){let n=null,r;const o=Et(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:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const h=uo(u),p=uo(o.clientWidth-(c+d)),g=uo(o.clientHeight-(u+f)),v=uo(c),y={rootMargin:-h+"px "+-p+"px "+-g+"px "+-v+"px",threshold:Ue(0,Jt(1,l))||1};let w=!0;function S(E){const $=E[0].intersectionRatio;if($!==l){if(!w)return s();$?s(!1,$):r=setTimeout(()=>{s(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(S,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(S,y)}n.observe(e)}return s(!0),i}function Yv(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=aa(e),u=o||i?[...c?Br(c):[],...Br(t)]:[];u.forEach(m=>{o&&m.addEventListener("scroll",n,{passive:!0}),i&&m.addEventListener("resize",n)});const d=c&&a?Qv(c,n):null;let f=-1,h=null;s&&(h=new ResizeObserver(m=>{let[y]=m;y&&y.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let p,g=l?xn(e):null;l&&v();function v(){const m=xn(e);g&&(m.x!==g.x||m.y!==g.y||m.width!==g.width||m.height!==g.height)&&n(),g=m,p=requestAnimationFrame(v)}return n(),()=>{var m;u.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),d==null||d(),(m=h)==null||m.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const Zv=Fv,Jv=Tv,ey=Mv,ty=Dv,ny=Ov,ry=$v,oy=(e,t,n)=>{const r=new Map,o={platform:Ad,...n},i={...o.platform,_c:r};return Iv(e,t,{...o,platform:i})};var iy=te('<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>'),ua=we();function ca(){const e=ye(ua);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var xs=30,Ul=xs/2,sy={top:180,right:-90,bottom:0,left:90};function qo(e){const t=ca(),n=Y({size:xs},e),[r,o]=k(n,["ref","style","size"]),i=()=>t.currentPlacement().split("-")[0],s=ay(t.contentRef),a=()=>{var f;return((f=s())==null?void 0:f.getPropertyValue("background-color"))||"none"},l=()=>{var f;return((f=s())==null?void 0:f.getPropertyValue(`border-${i()}-color`))||"none"},c=()=>{var f;return((f=s())==null?void 0:f.getPropertyValue(`border-${i()}-width`))||"0px"},u=()=>Number.parseInt(c())*2*(xs/r.size),d=()=>`rotate(${sy[i()]} ${Ul} ${Ul}) translate(0 2)`;return b(ce,O({as:"div",ref(f){var h=ve(t.setArrowRef,r.ref);typeof h=="function"&&h(f)},"aria-hidden":"true",get style(){return ft({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 f=iy(),h=f.firstChild,p=h.firstChild;return p.nextSibling,ze(()=>Yn(h,"transform",d())),f}}))}function ay(e){const[t,n]=z();return H(()=>{const r=e();r&&n(zs(r).getComputedStyle(r))}),t}function ly(e){const t=ca(),[n,r]=k(e,["ref","style"]);return b(ce,O({as:"div",ref(o){var i=ve(t.setPositionerRef,n.ref);typeof i=="function"&&i(o)},"data-popper-positioner":"",get style(){return ft({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function ql(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 uy(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?ql(r):e?e.getBoundingClientRect():ql()}}}function cy(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var dy={top:"bottom",right:"left",bottom:"top",left:"right"};function fy(e,t){const[n,r]=e.split("-"),o=dy[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 hy(e){const t=Y({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]=z(),[o,i]=z(),[s,a]=z(t.placement),l=()=>{var f;return uy((f=t.anchorRef)==null?void 0:f.call(t),t.getAnchorRect)},{direction:c}=rn();async function u(){var $,F;const f=l(),h=n(),p=o();if(!f||!h)return;const g=((p==null?void 0:p.clientHeight)||0)/2,v=typeof t.gutter=="number"?t.gutter+g:t.gutter??g;h.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),f.getBoundingClientRect();const m=[Zv(({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(cy))throw new Error("`flip` expects a spaced-delimited list of placements");m.push(ey({padding:t.overflowPadding,fallbackPlacements:_}))}(t.slide||t.overlap)&&m.push(Jv({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),m.push(ty({padding:t.overflowPadding,apply({availableWidth:_,availableHeight:T,rects:K}){const N=Math.round(K.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&&m.push(ny({padding:t.detachedPadding})),p&&m.push(ry({element:p,padding:t.arrowPadding}));const y=await oy(f,h,{placement:t.placement,strategy:"absolute",middleware:m,platform:{...Ad,isRTL:()=>c()==="rtl"}});if(a(y.placement),($=t.onCurrentPlacementChange)==null||$.call(t,y.placement),!h)return;h.style.setProperty("--kb-popper-content-transform-origin",fy(y.placement,c()));const w=Math.round(y.x),S=Math.round(y.y);let E;if(t.hideWhenDetached&&(E=(F=y.middlewareData.hide)!=null&&F.referenceHidden?"hidden":"visible"),Object.assign(h.style,{top:"0",left:"0",transform:`translate3d(${w}px, ${S}px, 0)`,visibility:E}),p&&y.middlewareData.arrow){const{x:_,y:T}=y.middlewareData.arrow,K=y.placement.split("-")[0];Object.assign(p.style,{left:_!=null?`${_}px`:"",top:T!=null?`${T}px`:"",[K]:"100%"})}}H(()=>{const f=l(),h=n();if(!f||!h)return;const p=Yv(f,h,u,{elementResize:typeof ResizeObserver=="function"});W(p)}),H(()=>{var p;const f=n(),h=(p=t.contentRef)==null?void 0:p.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(ua.Provider,{value:d,get children(){return t.children}})}var fr=Object.assign(hy,{Arrow:qo,Context:ua,usePopperContext:ca,Positioner:ly}),gy={};xt(gy,{Arrow:()=>qo,Content:()=>fa,Portal:()=>ha,Root:()=>ga,Tooltip:()=>vy,Trigger:()=>pa});var Fd=we();function da(){const e=ye(Fd);if(e===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function fa(e){const t=da(),n=Y({id:t.generateId("content")},e),[r,o]=k(n,["ref","style"]);return H(()=>W(t.registerContentId(o.id))),b(ge,{get when(){return t.contentPresent()},get children(){return b(fr.Positioner,{get children(){return b(zo,O({ref(i){var s=ve(a=>{t.setContentRef(a)},r.ref);typeof s=="function"&&s(i)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return ft({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},r.style)},onFocusOutside:i=>i.preventDefault(),onDismiss:()=>t.hideTooltip(!0)},()=>t.dataset(),o))}})}})}function ha(e){const t=da();return b(ge,{get when(){return t.contentPresent()},get children(){return b(_o,e)}})}function py(e,t,n){const r=e.split("-")[0],o=t.getBoundingClientRect(),i=n.getBoundingClientRect(),s=[],a=o.left+o.width/2,l=o.top+o.height/2;switch(r){case"top":s.push([o.left,l]),s.push([i.left,i.bottom]),s.push([i.left,i.top]),s.push([i.right,i.top]),s.push([i.right,i.bottom]),s.push([o.right,l]);break;case"right":s.push([a,o.top]),s.push([i.left,i.top]),s.push([i.right,i.top]),s.push([i.right,i.bottom]),s.push([i.left,i.bottom]),s.push([a,o.bottom]);break;case"bottom":s.push([o.left,l]),s.push([i.left,i.top]),s.push([i.left,i.bottom]),s.push([i.right,i.bottom]),s.push([i.right,i.top]),s.push([o.right,l]);break;case"left":s.push([a,o.top]),s.push([i.right,i.top]),s.push([i.left,i.top]),s.push([i.left,i.bottom]),s.push([i.right,i.bottom]),s.push([a,o.bottom]);break}return s}var sn={},my=0,$n=!1,It,Cr,Mn;function ga(e){const t=`tooltip-${Ee()}`,n=`${++my}`,r=Y({id:t,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[o,i]=k(r,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount"]);let s;const[a,l]=z(),[c,u]=z(),[d,f]=z(),[h,p]=z(i.placement),g=jo({open:()=>o.open,defaultOpen:()=>o.defaultOpen,onOpenChange:P=>{var R;return(R=o.onOpenChange)==null?void 0:R.call(o,P)}}),{present:v}=Jn({show:()=>o.forceMount||g.isOpen(),element:()=>d()??null}),m=()=>{sn[n]=w},y=()=>{for(const P in sn)P!==n&&(sn[P](!0),delete sn[P])},w=(P=!1)=>{P||o.closeDelay&&o.closeDelay<=0?(window.clearTimeout(s),s=void 0,g.close()):s||(s=window.setTimeout(()=>{s=void 0,g.close()},o.closeDelay)),window.clearTimeout(It),It=void 0,o.skipDelayDuration&&o.skipDelayDuration>=0&&(Mn=window.setTimeout(()=>{window.clearTimeout(Mn),Mn=void 0},o.skipDelayDuration)),$n&&(window.clearTimeout(Cr),Cr=window.setTimeout(()=>{delete sn[n],Cr=void 0,$n=!1},o.closeDelay))},S=()=>{clearTimeout(s),s=void 0,y(),m(),$n=!0,g.open(),window.clearTimeout(It),It=void 0,window.clearTimeout(Cr),Cr=void 0,window.clearTimeout(Mn),Mn=void 0},E=()=>{y(),m(),!g.isOpen()&&!It&&!$n?It=window.setTimeout(()=>{It=void 0,$n=!0,S()},o.openDelay):g.isOpen()||S()},$=(P=!1)=>{!P&&o.openDelay&&o.openDelay>0&&!s&&!Mn?E():S()},F=()=>{window.clearTimeout(It),It=void 0,$n=!1},_=()=>{window.clearTimeout(s),s=void 0},T=P=>Pe(c(),P)||Pe(d(),P),K=P=>{const R=c(),x=d();if(!(!R||!x))return py(P,R,x)},N=P=>{const R=P.target;if(T(R)){_();return}if(!o.ignoreSafeArea){const x=K(h());if(x&&Uc(mp(P),x)){_();return}}s||w()};H(()=>{if(!g.isOpen())return;const P=je();P.addEventListener("pointermove",N,!0),W(()=>{P.removeEventListener("pointermove",N,!0)})}),H(()=>{const P=c();if(!P||!g.isOpen())return;const R=I=>{const M=I.target;Pe(M,P)&&w(!0)},x=zs();x.addEventListener("scroll",R,{capture:!0}),W(()=>{x.removeEventListener("scroll",R,{capture:!0})})}),W(()=>{clearTimeout(s),sn[n]&&delete sn[n]});const oe={dataset:L(()=>({"data-expanded":g.isOpen()?"":void 0,"data-closed":g.isOpen()?void 0:""})),isOpen:g.isOpen,isDisabled:()=>o.disabled??!1,triggerOnFocusOnly:()=>o.triggerOnFocusOnly??!1,contentId:a,contentPresent:v,openTooltip:$,hideTooltip:w,cancelOpening:F,generateId:ht(()=>r.id),registerContentId:Ke(l),isTargetOnTooltip:T,setTriggerRef:u,setContentRef:f};return b(Fd.Provider,{value:oe,get children(){return b(fr,O({anchorRef:c,contentRef:d,onCurrentPlacementChange:p},i))}})}function pa(e){let t;const n=da(),[r,o]=k(e,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let i=!1,s=!1,a=!1;const l=()=>{i=!1},c=()=>{!n.isOpen()&&(s||a)&&n.openTooltip(a)},u=m=>{n.isOpen()&&!s&&!a&&n.hideTooltip(m)},d=m=>{re(m,r.onPointerEnter),!(m.pointerType==="touch"||n.triggerOnFocusOnly()||n.isDisabled()||m.defaultPrevented)&&(s=!0,c())},f=m=>{re(m,r.onPointerLeave),m.pointerType!=="touch"&&(s=!1,a=!1,n.isOpen()?u():n.cancelOpening())},h=m=>{re(m,r.onPointerDown),i=!0,je(t).addEventListener("pointerup",l,{once:!0})},p=m=>{re(m,r.onClick),s=!1,a=!1,u(!0)},g=m=>{re(m,r.onFocus),!(n.isDisabled()||m.defaultPrevented||i)&&(a=!0,c())},v=m=>{re(m,r.onBlur);const y=m.relatedTarget;n.isTargetOnTooltip(y)||(s=!1,a=!1,u(!0))};return W(()=>{je(t).removeEventListener("pointerup",l)}),b(ce,O({as:"button",ref(m){var y=ve(w=>{n.setTriggerRef(w),t=w},r.ref);typeof y=="function"&&y(m)},get"aria-describedby"(){return L(()=>!!n.isOpen())()?n.contentId():void 0},onPointerEnter:d,onPointerLeave:f,onPointerDown:h,onClick:p,onFocus:g,onBlur:v},()=>n.dataset(),o))}var vy=Object.assign(ga,{Arrow:qo,Content:fa,Portal:ha,Trigger:pa});const Wl=pa,Xl=e=>b(ga,O({gutter:4},e)),Ql=e=>{const[t,n]=k(e,["class"]);return b(ha,{get children(){return b(fa,O({get class(){return ue("z-50 origin-[var(--kb-popover-content-transform-origin)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",t.class)}},n))}})},yy=e=>{const t=e.split("-").join("").slice(0,12);return Number.parseInt(t,16)};function Td(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var So={exports:{}},wy=So.exports,Yl;function by(){return Yl||(Yl=1,function(e,t){(function(n,r){e.exports=r()})(wy,function(){var n=1e3,r=6e4,o=36e5,i="millisecond",s="second",a="minute",l="hour",c="day",u="week",d="month",f="quarter",h="year",p="date",g="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|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,y={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"],x=P%100;return"["+P+(R[(x-20)%10]||R[x]||R[0])+"]"}},w=function(P,R,x){var I=String(P);return!I||I.length>=R?P:""+Array(R+1-I.length).join(x)+P},S={s:w,z:function(P){var R=-P.utcOffset(),x=Math.abs(R),I=Math.floor(x/60),M=x%60;return(R<=0?"+":"-")+w(I,2,"0")+":"+w(M,2,"0")},m:function P(R,x){if(R.date()<x.date())return-P(x,R);var I=12*(x.year()-R.year())+(x.month()-R.month()),M=R.clone().add(I,d),A=x-M<0,V=R.clone().add(I+(A?-1:1),d);return+(-(I+(x-M)/(A?M-V:V-M))||0)},a:function(P){return P<0?Math.ceil(P)||0:Math.floor(P)},p:function(P){return{M:d,y:h,w:u,d:c,D:p,h:l,m:a,s,ms:i,Q:f}[P]||String(P||"").toLowerCase().replace(/s$/,"")},u:function(P){return P===void 0}},E="en",$={};$[E]=y;var F="$isDayjsObject",_=function(P){return P instanceof j||!(!P||!P[F])},T=function P(R,x,I){var M;if(!R)return E;if(typeof R=="string"){var A=R.toLowerCase();$[A]&&(M=A),x&&($[A]=x,M=A);var V=R.split("-");if(!M&&V.length>1)return P(V[0])}else{var B=R.name;$[B]=R,M=B}return!I&&M&&(E=M),M||!I&&E},K=function(P,R){if(_(P))return P.clone();var x=typeof R=="object"?R:{};return x.date=P,x.args=arguments,new j(x)},N=S;N.l=T,N.i=_,N.w=function(P,R){return K(P,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var j=function(){function P(x){this.$L=T(x.locale,null,!0),this.parse(x),this.$x=this.$x||x.x||{},this[F]=!0}var R=P.prototype;return R.parse=function(x){this.$d=function(I){var M=I.date,A=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 V=M.match(v);if(V){var B=V[2]-1||0,U=(V[7]||"0").substring(0,3);return A?new Date(Date.UTC(V[1],B,V[3]||1,V[4]||0,V[5]||0,V[6]||0,U)):new Date(V[1],B,V[3]||1,V[4]||0,V[5]||0,V[6]||0,U)}}return new Date(M)}(x),this.init()},R.init=function(){var x=this.$d;this.$y=x.getFullYear(),this.$M=x.getMonth(),this.$D=x.getDate(),this.$W=x.getDay(),this.$H=x.getHours(),this.$m=x.getMinutes(),this.$s=x.getSeconds(),this.$ms=x.getMilliseconds()},R.$utils=function(){return N},R.isValid=function(){return this.$d.toString()!==g},R.isSame=function(x,I){var M=K(x);return this.startOf(I)<=M&&M<=this.endOf(I)},R.isAfter=function(x,I){return K(x)<this.startOf(I)},R.isBefore=function(x,I){return this.endOf(I)<K(x)},R.$g=function(x,I,M){return N.u(x)?this[I]:this.set(M,x)},R.unix=function(){return Math.floor(this.valueOf()/1e3)},R.valueOf=function(){return this.$d.getTime()},R.startOf=function(x,I){var M=this,A=!!N.u(I)||I,V=N.p(x),B=function(Oe,Ie){var kt=N.w(M.$u?Date.UTC(M.$y,Ie,Oe):new Date(M.$y,Ie,Oe),M);return A?kt:kt.endOf(c)},U=function(Oe,Ie){return N.w(M.toDate()[Oe].apply(M.toDate("s"),(A?[0,0,0,0]:[23,59,59,999]).slice(Ie)),M)},Z=this.$W,fe=this.$M,se=this.$D,Fe="set"+(this.$u?"UTC":"");switch(V){case h:return A?B(1,0):B(31,11);case d:return A?B(1,fe):B(0,fe+1);case u:var tt=this.$locale().weekStart||0,ie=(Z<tt?Z+7:Z)-tt;return B(A?se-ie:se+(6-ie),fe);case c:case p:return U(Fe+"Hours",0);case l:return U(Fe+"Minutes",1);case a:return U(Fe+"Seconds",2);case s:return U(Fe+"Milliseconds",3);default:return this.clone()}},R.endOf=function(x){return this.startOf(x,!1)},R.$set=function(x,I){var M,A=N.p(x),V="set"+(this.$u?"UTC":""),B=(M={},M[c]=V+"Date",M[p]=V+"Date",M[d]=V+"Month",M[h]=V+"FullYear",M[l]=V+"Hours",M[a]=V+"Minutes",M[s]=V+"Seconds",M[i]=V+"Milliseconds",M)[A],U=A===c?this.$D+(I-this.$W):I;if(A===d||A===h){var Z=this.clone().set(p,1);Z.$d[B](U),Z.init(),this.$d=Z.set(p,Math.min(this.$D,Z.daysInMonth())).$d}else B&&this.$d[B](U);return this.init(),this},R.set=function(x,I){return this.clone().$set(x,I)},R.get=function(x){return this[N.p(x)]()},R.add=function(x,I){var M,A=this;x=Number(x);var V=N.p(I),B=function(fe){var se=K(A);return N.w(se.date(se.date()+Math.round(fe*x)),A)};if(V===d)return this.set(d,this.$M+x);if(V===h)return this.set(h,this.$y+x);if(V===c)return B(1);if(V===u)return B(7);var U=(M={},M[a]=r,M[l]=o,M[s]=n,M)[V]||1,Z=this.$d.getTime()+x*U;return N.w(Z,this)},R.subtract=function(x,I){return this.add(-1*x,I)},R.format=function(x){var I=this,M=this.$locale();if(!this.isValid())return M.invalidDate||g;var A=x||"YYYY-MM-DDTHH:mm:ssZ",V=N.z(this),B=this.$H,U=this.$m,Z=this.$M,fe=M.weekdays,se=M.months,Fe=M.meridiem,tt=function(Ie,kt,yr,no){return Ie&&(Ie[kt]||Ie(I,A))||yr[kt].slice(0,no)},ie=function(Ie){return N.s(B%12||12,Ie,"0")},Oe=Fe||function(Ie,kt,yr){var no=Ie<12?"AM":"PM";return yr?no.toLowerCase():no};return A.replace(m,function(Ie,kt){return kt||function(yr){switch(yr){case"YY":return String(I.$y).slice(-2);case"YYYY":return N.s(I.$y,4,"0");case"M":return Z+1;case"MM":return N.s(Z+1,2,"0");case"MMM":return tt(M.monthsShort,Z,se,3);case"MMMM":return tt(se,Z);case"D":return I.$D;case"DD":return N.s(I.$D,2,"0");case"d":return String(I.$W);case"dd":return tt(M.weekdaysMin,I.$W,fe,2);case"ddd":return tt(M.weekdaysShort,I.$W,fe,3);case"dddd":return fe[I.$W];case"H":return String(B);case"HH":return N.s(B,2,"0");case"h":return ie(1);case"hh":return ie(2);case"a":return Oe(B,U,!0);case"A":return Oe(B,U,!1);case"m":return String(U);case"mm":return N.s(U,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 V}return null}(Ie)||V.replace(":","")})},R.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},R.diff=function(x,I,M){var A,V=this,B=N.p(I),U=K(x),Z=(U.utcOffset()-this.utcOffset())*r,fe=this-U,se=function(){return N.m(V,U)};switch(B){case h:A=se()/12;break;case d:A=se();break;case f:A=se()/3;break;case u:A=(fe-Z)/6048e5;break;case c:A=(fe-Z)/864e5;break;case l:A=fe/o;break;case a:A=fe/r;break;case s:A=fe/n;break;default:A=fe}return M?A:N.a(A)},R.daysInMonth=function(){return this.endOf(d).$D},R.$locale=function(){return $[this.$L]},R.locale=function(x,I){if(!x)return this.$L;var M=this.clone(),A=T(x,I,!0);return A&&(M.$L=A),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}(),oe=j.prototype;return K.prototype=oe,[["$ms",i],["$s",s],["$m",a],["$H",l],["$W",c],["$M",d],["$y",h],["$D",p]].forEach(function(P){oe[P[1]]=function(R){return this.$g(R,P[0],P[1])}}),K.extend=function(P,R){return P.$i||(P(R,j,K),P.$i=!0),K},K.locale=T,K.isDayjs=_,K.unix=function(P){return K(1e3*P)},K.en=$[E],K.Ls=$,K.p={},K})}(So)),So.exports}var Sy=by();const xy=Td(Sy);/**
2
+ * @license lucide-solid v0.454.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */var Cy={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"},On=Cy,Ey=te("<svg>"),Ry=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Py=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Iy=e=>{const[t,n]=k(e,["color","size","strokeWidth","children","class","name","iconNode","absoluteStrokeWidth"]);return(()=>{var r=Ey();return et(r,O(On,{get width(){return t.size??On.width},get height(){return t.size??On.height},get stroke(){return t.color??On.stroke},get"stroke-width"(){return L(()=>!!t.absoluteStrokeWidth)()?Number(t.strokeWidth??On["stroke-width"])*24/Number(t.size):Number(t.strokeWidth??On["stroke-width"])},get class(){return Py("lucide","lucide-icon",t.name!=null?`lucide-${Ry(t==null?void 0:t.name)}`:void 0,t.class!=null?t.class:"")}},n),!0,!0),X(r,b(ot,{get each(){return t.iconNode},children:([o,i])=>b(fc,O({component:o},i))})),r})()},hr=Iy,$y=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],My=e=>b(hr,O(e,{name:"Check",iconNode:$y})),Zl=My,Oy=[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]],Ay=e=>b(hr,O(e,{name:"Fingerprint",iconNode:Oy})),Fy=Ay,Ty=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Dy=e=>b(hr,O(e,{name:"LoaderCircle",iconNode:Ty})),_y=Dy,Ly=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],ky=e=>b(hr,O(e,{name:"Package",iconNode:Ly})),Vy=ky,Ny=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Ky=e=>b(hr,O(e,{name:"Trash2",iconNode:Ny})),Jl=Ky,zy=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],jy=e=>b(hr,O(e,{name:"X",iconNode:zy})),eu=jy,tu=te("<p>"),By=te('<div class="flex flex-row items-center">iOS'),Hy=te('<div class="flex flex-row items-center">Android'),Er=te('<div class="flex flex-row items-center">'),Gy=te('<span class="ml-2 text-muted-foreground">(<!>)');const Uy=[{accessorKey:"id",header:"ID",cell:e=>b(Xl,{openDelay:0,closeDelay:0,get children(){return[b(Wl,{get children(){return e.row.original.id.slice(-12)}}),b(Ql,{get children(){var t=tu();return X(t,()=>e.row.original.id),t}})]}})},{accessorKey:"channel",header:"Channel",cell:e=>e.getValue()},{accessorKey:"platform",header:"Platform",cell:e=>{switch(e.getValue()){case"ios":return(()=>{var t=By(),n=t.firstChild;return X(t,b(bd,{class:"mr-2",size:16}),n),t})();case"android":return(()=>{var t=Hy(),n=t.firstChild;return X(t,b(wd,{class:"mr-2",size:16,color:"#3DDC84"}),n),t})()}}},{header:"Target",cell:e=>e.row.original.targetAppVersion?(()=>{var t=Er();return X(t,b(Vy,{class:"mr-2",size:16}),null),X(t,()=>e.row.original.targetAppVersion,null),t})():e.row.original.fingerprintHash?b(Xl,{openDelay:0,closeDelay:0,get children(){return[b(Wl,{class:"flex flex-row items-center",get children(){return[b(Fy,{class:"mr-2",size:16}),L(()=>e.row.original.fingerprintHash.slice(0,8)),b(ge,{get when(){var t;return(t=e.row.original.metadata)==null?void 0:t.app_version},get children(){var t=Gy(),n=t.firstChild,r=n.nextSibling;return r.nextSibling,X(t,()=>{var o;return(o=e.row.original.metadata)==null?void 0:o.app_version},r),t}})]}}),b(Ql,{get children(){var t=tu();return X(t,()=>e.row.original.fingerprintHash),t}})]}}):"N/A"},{accessorKey:"enabled",header:"Enabled",cell:e=>e.getValue()?(()=>{var t=Er();return X(t,b(Zl,{class:"text-green-500"})),t})():(()=>{var t=Er();return X(t,b(eu,{class:"text-red-500"})),t})()},{accessorKey:"shouldForceUpdate",header:"Force Update",cell:e=>e.getValue()?(()=>{var t=Er();return X(t,b(Zl,{class:"text-green-500"})),t})():(()=>{var t=Er();return X(t,b(eu,{class:"text-red-500"})),t})()},{accessorKey:"message",header:"Message",cell:e=>e.getValue()},{accessorKey:"id",header:"Created At",cell:e=>xy(yy(String(e.getValue()))).format("YYYY-MM-DD HH:mm:ss")}];function qy(e){const[t,n]=z(0),[r,o]=z(0);H(()=>{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 Dd=we();function _d(){return ye(Dd)}function Wy(){const e=_d();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function Ld(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function Xy(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&&Ld(i,n))return r+1}return 0}function Qy(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:Ld(a,l)?(r>i&&(n=!0),-1):(r<i&&(n=!0),1)}),n?t.map(([r,o])=>o):e}function kd(e,t){const n=Qy(e);e!==n&&t(n)}function Yy(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 je(r).body}function Zy(e,t){H(()=>{const n=setTimeout(()=>{kd(e(),t)});W(()=>clearTimeout(n))})}function Jy(e,t){if(typeof IntersectionObserver!="function"){Zy(e,t);return}let n=[];H(()=>{const r=()=>{const s=!!n.length;n=e(),s&&kd(e(),t)},o=Yy(e()),i=new IntersectionObserver(r,{root:o});for(const s of e()){const a=s.ref();a&&i.observe(a)}W(()=>i.disconnect())})}function ew(e={}){const[t,n]=Bm({value:()=>D(e.items),onChange:i=>{var s;return(s=e.onItemsChange)==null?void 0:s.call(e,i)}});Jy(t,n);const r=i=>(n(s=>{const a=Xy(s,i);return Zg(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(Dd.Provider,{value:{registerItem:r},get children(){return i.children}})}}function tw(e){const t=Wy(),n=Y({shouldRegisterItem:!0},e);H(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());W(r)})}function Vd(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=l=>{if(l==null)return"";const c=e.getKey??"key",u=Fn(c)?l[c]:c(l);return u!=null?String(u):""},i=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",u=Fn(c)?l[c]:c(l);return u!=null?String(u):""},s=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(Fn(c)?l[c]:c(l))??!1},a=l=>{var c;if(l!=null)return Fn(e.getSectionChildren)?l[e.getSectionChildren]:(c=e.getSectionChildren)==null?void 0:c.call(e,l)};for(const l of e.dataSource){if(Fn(l)||Jg(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=Vd({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 nw(e,t=[]){return L(()=>{const n=Vd({dataSource:D(e.dataSource),getKey:D(e.getKey),getTextValue:D(e.getTextValue),getDisabled:D(e.getDisabled),getSectionChildren:D(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var At=class Nd extends Set{constructor(n,r,o){super(n);Re(this,"anchorKey");Re(this,"currentKey");n instanceof Nd?(this.anchorKey=r||n.anchorKey,this.currentKey=o||n.currentKey):(this.anchorKey=r,this.currentKey=o)}};function rw(e){const[t,n]=bt(e);return[()=>t()??new At,n]}function Kd(e){return rp()?e.altKey:e.ctrlKey}function Tn(e){return Vo()?e.metaKey:e.ctrlKey}function nu(e){return new At(e)}function ow(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function iw(e){const t=Y({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=z(!1),[o,i]=z(),s=L(()=>{const g=D(t.selectedKeys);return g!=null?nu(g):g}),a=L(()=>{const g=D(t.defaultSelectedKeys);return g!=null?nu(g):new At}),[l,c]=rw({value:s,defaultValue:a,onChange:g=>{var v;return(v=t.onSelectionChange)==null?void 0:v.call(t,g)}}),[u,d]=z(D(t.selectionBehavior)),f=()=>D(t.selectionMode),h=()=>D(t.disallowEmptySelection)??!1,p=g=>{(D(t.allowDuplicateSelectionEvents)||!ow(g,l()))&&c(g)};return H(()=>{const g=l();D(t.selectionBehavior)==="replace"&&u()==="toggle"&&typeof g=="object"&&g.size===0&&d("replace")}),H(()=>{d(D(t.selectionBehavior)??"toggle")}),{selectionMode:f,disallowEmptySelection:h,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:l,setSelectedKeys:p}}function sw(e){const[t,n]=z(""),[r,o]=z(-1);return{typeSelectHandlers:{onKeyDown:s=>{var f;if(D(e.isDisabled))return;const a=D(e.keyboardDelegate),l=D(e.selectionManager);if(!a.getKeyForSearch)return;const c=aw(s.key);if(!c||s.ctrlKey||s.metaKey)return;c===" "&&t().trim().length>0&&(s.preventDefault(),s.stopPropagation());let u=n(h=>h+c),d=a.getKeyForSearch(u,l.focusedKey())??a.getKeyForSearch(u);d==null&&lw(u)&&(u=u[0],d=a.getKeyForSearch(u,l.focusedKey())??a.getKeyForSearch(u)),d!=null&&(l.setFocusedKey(d),(f=e.onTypeSelect)==null||f.call(e,d)),clearTimeout(r()),o(window.setTimeout(()=>n(""),500))}}}}function aw(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function lw(e){return e.split("").every(t=>t===e[0])}function uw(e,t,n){const o=O({selectOnFocus:()=>D(e.selectionManager).selectionBehavior()==="replace"},e),i=()=>t(),{direction:s}=rn();let a={top:0,left:0};Qg(()=>D(o.isVirtualized)?void 0:i(),"scroll",()=>{const v=i();v&&(a={top:v.scrollTop,left:v.scrollLeft})});const{typeSelectHandlers:l}=sw({isDisabled:()=>D(o.disallowTypeAhead),keyboardDelegate:()=>D(o.keyboardDelegate),selectionManager:()=>D(o.selectionManager)}),c=()=>D(o.orientation)??"vertical",u=v=>{var _,T,K,N,j,oe,P,R;re(v,l.onKeyDown),v.altKey&&v.key==="Tab"&&v.preventDefault();const m=t();if(!(m!=null&&m.contains(v.target)))return;const y=D(o.selectionManager),w=D(o.selectOnFocus),S=x=>{x!=null&&(y.setFocusedKey(x),v.shiftKey&&y.selectionMode()==="multiple"?y.extendSelection(x):w&&!Kd(v)&&y.replaceSelection(x))},E=D(o.keyboardDelegate),$=D(o.shouldFocusWrap),F=y.focusedKey();switch(v.key){case(c()==="vertical"?"ArrowDown":"ArrowRight"):{if(E.getKeyBelow){v.preventDefault();let x;F!=null?x=E.getKeyBelow(F):x=(_=E.getFirstKey)==null?void 0:_.call(E),x==null&&$&&(x=(T=E.getFirstKey)==null?void 0:T.call(E,F)),S(x)}break}case(c()==="vertical"?"ArrowUp":"ArrowLeft"):{if(E.getKeyAbove){v.preventDefault();let x;F!=null?x=E.getKeyAbove(F):x=(K=E.getLastKey)==null?void 0:K.call(E),x==null&&$&&(x=(N=E.getLastKey)==null?void 0:N.call(E,F)),S(x)}break}case(c()==="vertical"?"ArrowLeft":"ArrowUp"):{if(E.getKeyLeftOf){v.preventDefault();const x=s()==="rtl";let I;F!=null?I=E.getKeyLeftOf(F):I=x?(j=E.getFirstKey)==null?void 0:j.call(E):(oe=E.getLastKey)==null?void 0:oe.call(E),S(I)}break}case(c()==="vertical"?"ArrowRight":"ArrowDown"):{if(E.getKeyRightOf){v.preventDefault();const x=s()==="rtl";let I;F!=null?I=E.getKeyRightOf(F):I=x?(P=E.getLastKey)==null?void 0:P.call(E):(R=E.getFirstKey)==null?void 0:R.call(E),S(I)}break}case"Home":if(E.getFirstKey){v.preventDefault();const x=E.getFirstKey(F,Tn(v));x!=null&&(y.setFocusedKey(x),Tn(v)&&v.shiftKey&&y.selectionMode()==="multiple"?y.extendSelection(x):w&&y.replaceSelection(x))}break;case"End":if(E.getLastKey){v.preventDefault();const x=E.getLastKey(F,Tn(v));x!=null&&(y.setFocusedKey(x),Tn(v)&&v.shiftKey&&y.selectionMode()==="multiple"?y.extendSelection(x):w&&y.replaceSelection(x))}break;case"PageDown":if(E.getKeyPageBelow&&F!=null){v.preventDefault();const x=E.getKeyPageBelow(F);S(x)}break;case"PageUp":if(E.getKeyPageAbove&&F!=null){v.preventDefault();const x=E.getKeyPageAbove(F);S(x)}break;case"a":Tn(v)&&y.selectionMode()==="multiple"&&D(o.disallowSelectAll)!==!0&&(v.preventDefault(),y.selectAll());break;case"Escape":v.defaultPrevented||(v.preventDefault(),D(o.disallowEmptySelection)||y.clearSelection());break;case"Tab":if(!D(o.allowsTabNavigation)){if(v.shiftKey)m.focus();else{const x=hp(m,{tabbable:!0});let I,M;do M=x.lastChild(),M&&(I=M);while(M);I&&!I.contains(document.activeElement)&&$e(I)}break}}},d=v=>{var S,E;const m=D(o.selectionManager),y=D(o.keyboardDelegate),w=D(o.selectOnFocus);if(m.isFocused()){v.currentTarget.contains(v.target)||m.setFocused(!1);return}if(v.currentTarget.contains(v.target)){if(m.setFocused(!0),m.focusedKey()==null){const $=_=>{_!=null&&(m.setFocusedKey(_),w&&m.replaceSelection(_))},F=v.relatedTarget;F&&v.currentTarget.compareDocumentPosition(F)&Node.DOCUMENT_POSITION_FOLLOWING?$(m.lastSelectedKey()??((S=y.getLastKey)==null?void 0:S.call(y))):$(m.firstSelectedKey()??((E=y.getFirstKey)==null?void 0:E.call(y)))}else if(!D(o.isVirtualized)){const $=i();if($){$.scrollTop=a.top,$.scrollLeft=a.left;const F=$.querySelector(`[data-key="${m.focusedKey()}"]`);F&&($e(F),fs($,F))}}}},f=v=>{const m=D(o.selectionManager);v.currentTarget.contains(v.relatedTarget)||m.setFocused(!1)},h=v=>{i()===v.target&&v.preventDefault()},p=()=>{var $,F;const v=D(o.autoFocus);if(!v)return;const m=D(o.selectionManager),y=D(o.keyboardDelegate);let w;v==="first"&&(w=($=y.getFirstKey)==null?void 0:$.call(y)),v==="last"&&(w=(F=y.getLastKey)==null?void 0:F.call(y));const S=m.selectedKeys();S.size&&(w=S.values().next().value),m.setFocused(!0),m.setFocusedKey(w);const E=t();E&&w==null&&!D(o.shouldUseVirtualFocus)&&$e(E)};return tr(()=>{o.deferAutoFocus?setTimeout(p,0):p()}),H(xe([i,()=>D(o.isVirtualized),()=>D(o.selectionManager).focusedKey()],v=>{var S;const[m,y,w]=v;if(y)w&&((S=o.scrollToKey)==null||S.call(o,w));else if(w&&m){const E=m.querySelector(`[data-key="${w}"]`);E&&fs(m,E)}})),{tabIndex:L(()=>{if(!D(o.shouldUseVirtualFocus))return D(o.selectionManager).focusedKey()==null?0:-1}),onKeyDown:u,onMouseDown:h,onFocusIn:d,onFocusOut:f}}function zd(e,t){const n=()=>D(e.selectionManager),r=()=>D(e.key),o=()=>D(e.shouldUseVirtualFocus),i=y=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):y!=null&&y.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||Tn(y)||"pointerType"in y&&y.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>n().isSelected(r()),a=()=>D(e.disabled)||n().isDisabled(r()),l=()=>!a()&&n().canSelectItem(r());let c=null;const u=y=>{l()&&(c=y.pointerType,y.pointerType==="mouse"&&y.button===0&&!D(e.shouldSelectOnPressUp)&&i(y))},d=y=>{l()&&y.pointerType==="mouse"&&y.button===0&&D(e.shouldSelectOnPressUp)&&D(e.allowsDifferentPressOrigin)&&i(y)},f=y=>{l()&&(D(e.shouldSelectOnPressUp)&&!D(e.allowsDifferentPressOrigin)||c!=="mouse")&&i(y)},h=y=>{!l()||!["Enter"," "].includes(y.key)||(Kd(y)?n().toggleSelection(r()):i(y))},p=y=>{a()&&y.preventDefault()},g=y=>{const w=t();o()||a()||!w||y.target===w&&n().setFocusedKey(r())},v=L(()=>{if(!(o()||a()))return r()===n().focusedKey()?0:-1}),m=L(()=>D(e.virtualized)?void 0:r());return H(xe([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],([y,w,S,E,$])=>{y&&w===E&&$&&!S&&document.activeElement!==y&&(e.focus?e.focus():$e(y))})),{isSelected:s,isDisabled:a,allowsSelection:l,tabIndex:v,dataKey:m,onPointerDown:u,onPointerUp:d,onClick:f,onKeyDown:h,onMouseDown:p,onFocus:g}}var cw=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 At(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 At(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 At([t],t,t):new At;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new At;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 At)}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}},ru=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 dw(e){const t=iw(e),r=nw({dataSource:()=>D(e.dataSource),getKey:()=>D(e.getKey),getTextValue:()=>D(e.getTextValue),getDisabled:()=>D(e.getDisabled),getSectionChildren:()=>D(e.getSectionChildren),factory:i=>e.filter?new ru(e.filter(i)):new ru(i)},[()=>e.filter]),o=new cw(r,t);return st(()=>{const i=t.focusedKey();i!=null&&!r().getItem(i)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>o}}var fw=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 hw(e,t,n){const r=yv({usage:"search",sensitivity:"base"}),o=L(()=>{const i=D(e.keyboardDelegate);return i||new fw(e.collection,t,r)});return uw({selectionManager:()=>D(e.selectionManager),keyboardDelegate:o,autoFocus:()=>D(e.autoFocus),deferAutoFocus:()=>D(e.deferAutoFocus),shouldFocusWrap:()=>D(e.shouldFocusWrap),disallowEmptySelection:()=>D(e.disallowEmptySelection),selectOnFocus:()=>D(e.selectOnFocus),disallowTypeAhead:()=>D(e.disallowTypeAhead),shouldUseVirtualFocus:()=>D(e.shouldUseVirtualFocus),allowsTabNavigation:()=>D(e.allowsTabNavigation),isVirtualized:()=>D(e.isVirtualized),scrollToKey:i=>{var s;return(s=D(e.scrollToKey))==null?void 0:s(i)},orientation:()=>D(e.orientation)},t)}function jd(e={}){const[t,n]=hd({value:()=>D(e.isSelected),defaultValue:()=>!!D(e.defaultIsSelected),onChange:i=>{var s;return(s=e.onSelectedChange)==null?void 0:s.call(e,i)}});return{isSelected:t,setIsSelected:i=>{!D(e.isReadOnly)&&!D(e.isDisabled)&&n(i)},toggle:()=>{!D(e.isReadOnly)&&!D(e.isDisabled)&&n(!t())}}}var Bd=we();function Wo(){return ye(Bd)}function Lt(){const e=Wo();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var Hd=we();function ma(){const e=ye(Hd);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var Gd=we();function Rt(){const e=ye(Gd);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function va(e){let t;const n=Rt(),r=Lt(),o=Y({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]=z(),[c,u]=z(),[d,f]=z(),h=()=>r.listState().selectionManager(),p=()=>s.id,g=()=>h().focusedKey()===p(),v=()=>{var T;(T=i.onSelect)==null||T.call(i),i.closeOnSelect&&setTimeout(()=>{r.close(!0)})};tw({getItem:()=>{var T;return{ref:()=>t,type:"item",key:p(),textValue:i.textValue??((T=d())==null?void 0:T.textContent)??(t==null?void 0:t.textContent)??"",disabled:i.disabled??!1}}});const m=zd({key:p,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),y=T=>{re(T,i.onPointerMove),T.pointerType==="mouse"&&(i.disabled?r.onItemLeave(T):(r.onItemEnter(T),T.defaultPrevented||($e(T.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(p()))))},w=T=>{re(T,i.onPointerLeave),T.pointerType==="mouse"&&r.onItemLeave(T)},S=T=>{re(T,i.onPointerUp),!i.disabled&&T.button===0&&v()},E=T=>{if(re(T,i.onKeyDown),!T.repeat&&!i.disabled)switch(T.key){case"Enter":case" ":v();break}},$=L(()=>{if(i.indeterminate)return"mixed";if(i.checked!=null)return i.checked}),F=L(()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":g()?"":void 0})),_={isChecked:()=>i.checked,dataset:F,setLabelRef:f,generateId:ht(()=>s.id),registerLabel:Ke(l),registerDescription:Ke(u)};return b(Hd.Provider,{value:_,get children(){return b(ce,O({as:"div",ref(T){var K=ve(N=>t=N,i.ref);typeof K=="function"&&K(T)},get tabIndex(){return m.tabIndex()},get"aria-checked"(){return $()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return m.dataKey()},get onPointerDown(){return Se([i.onPointerDown,m.onPointerDown])},get onPointerUp(){return Se([S,m.onPointerUp])},get onClick(){return Se([i.onClick,m.onClick])},get onKeyDown(){return Se([E,m.onKeyDown])},get onMouseDown(){return Se([i.onMouseDown,m.onMouseDown])},get onFocus(){return Se([i.onFocus,m.onFocus])},onPointerMove:y,onPointerLeave:w},F,s))}})}function gw(e){const t=Y({closeOnSelect:!1},e),[n,r]=k(t,["checked","defaultChecked","onChange","onSelect"]),o=jd({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(va,O({role:"menuitemcheckbox",get checked(){return o.isSelected()},onSelect:()=>{var s;(s=n.onSelect)==null||s.call(n),o.toggle()}},r))}var Ud=we();function eo(){return ye(Ud)}function gr(){const e=eo();if(e===void 0)throw new Error("[kobalte]: `useMenubarContext` must be used within a `Menubar` component");return e}var Hr={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>Hr.next(e==="ltr"?"rtl":"ltr",t)},ou={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function iu(e){const t=Rt(),n=Lt(),r=eo(),{direction:o}=rn(),i=Y({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=No(()=>n.triggerRef(),()=>"button"),u=L(()=>{var m;return c()==="a"&&((m=n.triggerRef())==null?void 0:m.getAttribute("href"))!=null});H(xe(()=>r==null?void 0:r.value(),m=>{var y;u()&&m===l()&&((y=n.triggerRef())==null||y.focus())}));const d=()=>{r!==void 0?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)},f=m=>{re(m,s.onPointerDown),m.currentTarget.dataset.pointerType=m.pointerType,!s.disabled&&m.pointerType!=="touch"&&m.button===0&&d()},h=m=>{re(m,s.onClick),s.disabled||m.currentTarget.dataset.pointerType==="touch"&&d()},p=m=>{if(re(m,s.onKeyDown),!s.disabled){if(u())switch(m.key){case"Enter":case" ":return}switch(m.key){case"Enter":case" ":case ou.first(t.orientation()):m.stopPropagation(),m.preventDefault(),vp(m.currentTarget),n.open("first"),r==null||r.setAutoFocusMenu(!0),r==null||r.setValue(l);break;case ou.last(t.orientation()):m.stopPropagation(),m.preventDefault(),n.open("last");break;case Hr.next(o(),t.orientation()):if(r===void 0)break;m.stopPropagation(),m.preventDefault(),r.nextMenu();break;case Hr.previous(o(),t.orientation()):if(r===void 0)break;m.stopPropagation(),m.preventDefault(),r.previousMenu();break}}},g=m=>{var y;re(m,s.onMouseOver),((y=n.triggerRef())==null?void 0:y.dataset.pointerType)!=="touch"&&!s.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(l)},v=m=>{re(m,s.onFocus),r!==void 0&&m.currentTarget.dataset.pointerType!=="touch"&&r.setValue(l)};return H(()=>W(n.registerTriggerId(s.id))),b(Ct,O({ref(m){var y=ve(n.setTriggerRef,s.ref);typeof y=="function"&&y(m)},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 L(()=>!!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:f,onMouseOver:g,onClick:h,onKeyDown:p,onFocus:v,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),a))}var qd=we();function ya(){return ye(qd)}function to(){const e=ya();if(e===void 0)throw new Error("[kobalte]: `useNavigationMenuContext` must be used within a `NavigationMenu` component");return e}function Wd(e){let t;const n=Rt(),r=Lt(),o=eo(),i=ya(),{direction:s}=rn(),a=Y({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 d=()=>r.parentMenuContext()==null&&o===void 0&&n.isModal(),f=hw({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);ud({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:w=>{var S;o===void 0&&((S=l.onOpenAutoFocus)==null||S.call(l,w))},onUnmountAutoFocus:l.onCloseAutoFocus},()=>t);const h=w=>{if(Pe(w.currentTarget,w.target)&&(w.key==="Tab"&&r.isOpen()&&w.preventDefault(),o!==void 0&&w.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(w.key){case Hr.next(s(),n.orientation()):w.stopPropagation(),w.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case Hr.previous(s(),n.orientation()):if(w.currentTarget.hasAttribute("data-closed"))break;w.stopPropagation(),w.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu();break}},p=w=>{var S;(S=l.onEscapeKeyDown)==null||S.call(l,w),o==null||o.setAutoFocusMenu(!1),r.close(!0)},g=w=>{var S;(S=l.onFocusOutside)==null||S.call(l,w),n.isModal()&&w.preventDefault()},v=w=>{var S,E;re(w,l.onPointerEnter),r.isOpen()&&((S=r.parentMenuContext())==null||S.listState().selectionManager().setFocused(!1),(E=r.parentMenuContext())==null||E.listState().selectionManager().setFocusedKey(void 0))},m=w=>{if(re(w,l.onPointerMove),w.pointerType!=="mouse")return;const S=w.target,E=u!==w.clientX;Pe(w.currentTarget,S)&&E&&(r.setPointerDir(w.clientX>u?"right":"left"),u=w.clientX)};H(()=>W(r.registerContentId(l.id))),W(()=>r.setContentRef(void 0));const y={ref:ve(w=>{r.setContentRef(w),t=w},l.ref),role:"menu",get id(){return l.id},get tabIndex(){return f.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:Se([l.onKeyDown,f.onKeyDown,h]),onMouseDown:Se([l.onMouseDown,f.onMouseDown]),onFocusIn:Se([l.onFocusIn,f.onFocusIn]),onFocusOut:Se([l.onFocusOut,f.onFocusOut]),onPointerEnter:v,onPointerMove:m,get"data-orientation"(){return n.orientation()}};return b(ge,{get when(){return r.contentPresent()},get children(){return b(ge,{get when(){return i===void 0||r.parentMenuContext()!=null},get fallback(){return b(ce,O({as:"div"},()=>r.dataset(),y,c))},get children(){return b(fr.Positioner,{get children(){return b(zo,O({get disableOutsidePointerEvents(){return L(()=>!!d())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return ft({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:p,onFocusOutside:g,get onDismiss(){return r.close}},()=>r.dataset(),y,c))}})}})}})}function pw(e){let t;const n=Rt(),r=Lt(),[o,i]=k(e,["ref"]);return gd({element:()=>t??null,enabled:()=>r.contentPresent()&&n.preventScroll()}),b(Wd,O({ref(s){var a=ve(l=>{t=l},o.ref);typeof a=="function"&&a(s)}},i))}var Xd=we();function mw(){const e=ye(Xd);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function Qd(e){const t=Rt(),n=Y({id:t.generateId(`group-${Ee()}`)},e),[r,o]=z(),i={generateId:ht(()=>n.id),registerLabelId:Ke(o)};return b(Xd.Provider,{value:i,get children(){return b(ce,O({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function vw(e){const t=mw(),n=Y({id:t.generateId("label")},e),[r,o]=k(n,["id"]);return H(()=>W(t.registerLabelId(r.id))),b(ce,O({as:"span",get id(){return r.id},"aria-hidden":"true"},o))}function Yd(e){const t=Lt(),n=Y({children:"▼"},e);return b(ce,O({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function yw(e){return b(va,O({role:"menuitem",closeOnSelect:!0},e))}function ww(e){const t=ma(),n=Y({id:t.generateId("description")},e),[r,o]=k(n,["id"]);return H(()=>W(t.registerDescription(r.id))),b(ce,O({as:"div",get id(){return r.id}},()=>t.dataset(),o))}function bw(e){const t=ma(),n=Y({id:t.generateId("indicator")},e),[r,o]=k(n,["forceMount"]);return b(ge,{get when(){return r.forceMount||t.isChecked()},get children(){return b(ce,O({as:"div"},()=>t.dataset(),o))}})}function Sw(e){const t=ma(),n=Y({id:t.generateId("label")},e),[r,o]=k(n,["ref","id"]);return H(()=>W(t.registerLabel(r.id))),b(ce,O({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 xw(e){const t=Lt();return b(ge,{get when(){return t.contentPresent()},get children(){return b(_o,e)}})}var Zd=we();function Cw(){const e=ye(Zd);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function Ew(e){const n=Rt().generateId(`radiogroup-${Ee()}`),r=Y({id:n},e),[o,i]=k(r,["value","defaultValue","onChange","disabled"]),[s,a]=bt({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(Zd.Provider,{value:l,get children(){return b(Qd,i)}})}function Rw(e){const t=Cw(),n=Y({closeOnSelect:!1},e),[r,o]=k(n,["value","onSelect"]);return b(va,O({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 Pw(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 Iw(e,t){return t?Uc([e.clientX,e.clientY],t):!1}function Jd(e){const t=Rt(),n=_d(),r=Wo(),o=eo(),i=ya(),s=Y({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[a,l]=k(s,["open","defaultOpen","onOpenChange"]);let c=0,u=null,d="right";const[f,h]=z(),[p,g]=z(),[v,m]=z(),[y,w]=z(),[S,E]=z(!0),[$,F]=z(l.placement),[_,T]=z([]),[K,N]=z([]),{DomCollectionProvider:j}=ew({items:K,onItemsChange:N}),oe=jo({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:ie=>{var Oe;return(Oe=a.onOpenChange)==null?void 0:Oe.call(a,ie)}}),{present:P}=Jn({show:()=>t.forceMount()||oe.isOpen(),element:()=>y()??null}),R=dw({selectionMode:"none",dataSource:K}),x=ie=>{E(ie),oe.open()},I=(ie=!1)=>{oe.close(),ie&&r&&r.close(!0)},M=ie=>{E(ie),oe.toggle()},A=()=>{const ie=y();ie&&($e(ie),R.selectionManager().setFocused(!0),R.selectionManager().setFocusedKey(void 0))},V=()=>{i!=null?setTimeout(()=>A()):A()},B=ie=>{T(Ie=>[...Ie,ie]);const Oe=r==null?void 0:r.registerNestedMenu(ie);return()=>{T(Ie=>ds(Ie,ie)),Oe==null||Oe()}},U=ie=>d===(u==null?void 0:u.side)&&Iw(ie,u==null?void 0:u.area),Z=ie=>{U(ie)&&ie.preventDefault()},fe=ie=>{U(ie)||V()},se=ie=>{U(ie)&&ie.preventDefault()};cd({isDisabled:()=>!(r==null&&oe.isOpen()&&t.isModal()),targets:()=>[y(),..._()].filter(Boolean)}),H(()=>{const ie=y();if(!ie||!r)return;const Oe=r.registerNestedMenu(ie);W(()=>{Oe()})}),H(()=>{r===void 0&&(o==null||o.registerMenu(t.value(),[y(),..._()]))}),H(()=>{var ie;r!==void 0||o===void 0||(o.value()===t.value()?((ie=v())==null||ie.focus(),o.autoFocusMenu()&&x(!0)):I())}),H(()=>{r!==void 0||o===void 0||oe.isOpen()&&o.setValue(t.value())}),W(()=>{r===void 0&&(o==null||o.unregisterMenu(t.value()))});const tt={dataset:L(()=>({"data-expanded":oe.isOpen()?"":void 0,"data-closed":oe.isOpen()?void 0:""})),isOpen:oe.isOpen,contentPresent:P,nestedMenus:_,currentPlacement:$,pointerGraceTimeoutId:()=>c,autoFocus:S,listState:()=>R,parentMenuContext:()=>r,triggerRef:v,contentRef:y,triggerId:f,contentId:p,setTriggerRef:m,setContentRef:w,open:x,close:I,toggle:M,focusContent:V,onItemEnter:Z,onItemLeave:fe,onTriggerLeave:se,setPointerDir:ie=>d=ie,setPointerGraceTimeoutId:ie=>c=ie,setPointerGraceIntent:ie=>u=ie,registerNestedMenu:B,registerItemToParentDomCollection:n==null?void 0:n.registerItem,registerTriggerId:Ke(h),registerContentId:Ke(g)};return b(j,{get children(){return b(Bd.Provider,{value:tt,get children(){return b(ge,{when:i===void 0,get fallback(){return l.children},get children(){return b(fr,O({anchorRef:v,contentRef:y,onCurrentPlacementChange:F},l))}})}})}})}function $w(e){const{direction:t}=rn();return b(Jd,O({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var Mw={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function Ow(e){const t=Lt(),n=Rt(),[r,o]=k(e,["onFocusOutside","onKeyDown"]),{direction:i}=rn();return b(Wd,O({onOpenAutoFocus:u=>{u.preventDefault()},onCloseAutoFocus:u=>{u.preventDefault()},onFocusOutside:u=>{var f;(f=r.onFocusOutside)==null||f.call(r,u);const d=u.target;Pe(t.triggerRef(),d)||t.close()},onKeyDown:u=>{re(u,r.onKeyDown);const d=Pe(u.currentTarget,u.target),f=Mw.close(i(),n.orientation()).includes(u.key),h=t.parentMenuContext()!=null;d&&f&&h&&(t.close(),$e(t.triggerRef()))}},o))}var su=["Enter"," "],Aw={open:(e,t)=>e==="ltr"?[...su,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...su,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function Fw(e){let t;const n=Rt(),r=Lt(),o=Y({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}=rn(),u=()=>i.id,d=()=>{const w=r.parentMenuContext();if(w==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return w.listState().selectionManager()},f=()=>r.listState().collection(),h=()=>d().focusedKey()===u(),p=zd({key:u,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),g=w=>{re(w,i.onClick),!r.isOpen()&&!i.disabled&&r.open(!0)},v=w=>{var E;if(re(w,i.onPointerMove),w.pointerType!=="mouse")return;const S=r.parentMenuContext();if(S==null||S.onItemEnter(w),!w.defaultPrevented){if(i.disabled){S==null||S.onItemLeave(w);return}!r.isOpen()&&!a&&((E=r.parentMenuContext())==null||E.setPointerGraceIntent(null),a=window.setTimeout(()=>{r.open(!1),l()},100)),S==null||S.onItemEnter(w),w.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),$e(w.currentTarget),S==null||S.listState().selectionManager().setFocused(!0),S==null||S.listState().selectionManager().setFocusedKey(u()))}},m=w=>{if(re(w,i.onPointerLeave),w.pointerType!=="mouse")return;l();const S=r.parentMenuContext(),E=r.contentRef();if(E){S==null||S.setPointerGraceIntent({area:Pw(r.currentPlacement(),w,E),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(S==null?void 0:S.pointerGraceTimeoutId());const $=window.setTimeout(()=>{S==null||S.setPointerGraceIntent(null)},300);S==null||S.setPointerGraceTimeoutId($)}else{if(S==null||S.onTriggerLeave(w),w.defaultPrevented)return;S==null||S.setPointerGraceIntent(null)}S==null||S.onItemLeave(w)},y=w=>{re(w,i.onKeyDown),!w.repeat&&(i.disabled||Aw.open(c(),n.orientation()).includes(w.key)&&(w.stopPropagation(),w.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 H(()=>{if(r.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const w=r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:u(),textValue:i.textValue??(t==null?void 0:t.textContent)??"",disabled:i.disabled??!1});W(w)}),H(xe(()=>{var w;return(w=r.parentMenuContext())==null?void 0:w.pointerGraceTimeoutId()},w=>{W(()=>{var S;window.clearTimeout(w),(S=r.parentMenuContext())==null||S.setPointerGraceIntent(null)})})),H(()=>W(r.registerTriggerId(i.id))),W(()=>{l()}),b(ce,O({as:"div",ref(w){var S=ve(E=>{r.setTriggerRef(E),t=E},i.ref);typeof S=="function"&&S(w)},get id(){return i.id},role:"menuitem",get tabIndex(){return p.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return L(()=>!!r.isOpen())()?r.contentId():void 0},get"aria-disabled"(){return i.disabled},get"data-key"(){return p.dataKey()},get"data-highlighted"(){return h()?"":void 0},get"data-disabled"(){return i.disabled?"":void 0},get onPointerDown(){return Se([i.onPointerDown,p.onPointerDown])},get onPointerUp(){return Se([i.onPointerUp,p.onPointerUp])},get onClick(){return Se([g,p.onClick])},get onKeyDown(){return Se([y,p.onKeyDown])},get onMouseDown(){return Se([i.onMouseDown,p.onMouseDown])},get onFocus(){return Se([i.onFocus,p.onFocus])},onPointerMove:v,onPointerLeave:m},()=>r.dataset(),s))}function Tw(e){const t=eo(),n=`menu-${Ee()}`,r=Y({id:n,modal:!0},e),[o,i]=k(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),s=jo({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:ht(()=>o.id),value:()=>o.value,orientation:()=>o.orientation??(t==null?void 0:t.orientation())??"horizontal"};return b(Gd.Provider,{value:a,get children(){return b(Jd,O({get open(){return s.isOpen()},get onOpenChange(){return s.setIsOpen}},i))}})}function ef(e){const t=gr(),n=Y({modal:!1},e),[r,o]=k(n,["value"]),i=Ee(),s=t.generateId(`menubar-menu-${i}`),a=Y({id:s},o);return b(Tw,O({get value(){return r.value??i}},a))}function Dw(e){let t;const n=`menubar-${Ee()}`,r=Y({id:n,loop:!0,orientation:"horizontal"},e),[o,i]=k(r,["ref","value","defaultValue","onValueChange","loop","focusOnAlt","autoFocusMenu","onAutoFocusMenuChange","orientation"]),[s,a]=bt({value:()=>o.value,defaultValue:()=>o.defaultValue,onChange:y=>{var w;return(w=o.onValueChange)==null?void 0:w.call(o,y)}}),[l,c]=z(),[u,d]=z(new Map),[f,h]=bt({value:()=>o.autoFocusMenu,defaultValue:()=>!1,onChange:o.onAutoFocusMenuChange}),p=()=>{var y;return s()&&f()&&!((y=s())!=null&&y.includes("link-trigger-"))},v={dataset:L(()=>({"data-expanded":p()?"":void 0,"data-closed":p()?void 0:""})),value:s,setValue:a,lastValue:l,setLastValue:c,menus:()=>new Set([...u().keys()]),menuRefs:()=>[...u().values()].flat(),menuRefMap:()=>u(),registerMenu:(y,w)=>{d(S=>{const E=new Map;return S.forEach(($,F)=>E.set(F,$)),E.set(y,w),E})},unregisterMenu:y=>{d(w=>{w.delete(y);const S=new Map;return w.forEach((E,$)=>S.set($,E)),S})},nextMenu:()=>{const y=[...u().keys()];if(s()==null){a(y[0]);return}const w=y.indexOf(s());if(w===y.length-1){o.loop&&a(y[0]);return}a(y[w+1])},previousMenu:()=>{const y=[...u().keys()];if(s()==null){a(y[0]);return}const w=y.indexOf(s());if(w===0){o.loop&&a(y[y.length-1]);return}a(y[w-1])},closeMenu:()=>{h(!1),a(void 0)},autoFocusMenu:()=>f(),setAutoFocusMenu:h,generateId:ht(()=>i.id),orientation:()=>o.orientation};H(()=>{s()==null&&h(!1)}),dd({onInteractOutside:()=>{v.closeMenu(),setTimeout(()=>v.closeMenu())},shouldExcludeElement:y=>[t,...u().values()].flat().some(w=>Pe(w,y))},()=>t);const m=y=>{y.key==="Alt"&&(y.preventDefault(),y.stopPropagation(),v.value()===void 0?v.nextMenu():v.closeMenu())};return H(()=>{o.focusOnAlt?window.addEventListener("keydown",m):window.removeEventListener("keydown",m),W(()=>{window.removeEventListener("keydown",m)})}),H(()=>{s()!=null&&c(s())}),b(Ud.Provider,{value:v,get children(){return b(ce,O({as:"div",ref(y){var w=ve(S=>t=S,o.ref);typeof w=="function"&&w(y)},role:"menubar",get"data-orientation"(){return o.orientation},get"aria-orientation"(){return o.orientation}},i))}})}function _w(e){const t=gr();if(Wo()===void 0&&Object.hasOwn(e,"href")){const r=t.generateId("link-trigger-")+Ee();return b(ef,{value:r,get children(){return b(iu,e)}})}return iu(e)}var Lw={};xt(Lw,{Root:()=>wa,Separator:()=>kw});function wa(e){let t;const n=Y({orientation:"horizontal"},e),[r,o]=k(n,["ref","orientation"]),i=No(()=>t,()=>"hr");return b(ce,O({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 kw=wa,tf=te("<li role=presentation>"),Vw=te("<nav>");function Nw(e){let t;const n=gr(),r=Y({size:15},e),[o,i]=k(r,["ref"]),[s,a]=z(0),l=()=>n.orientation()==="horizontal";return H(xe(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 d=u.getBoundingClientRect()[l()?"x":"y"]+u.getBoundingClientRect()[l()?"width":"height"]/2,f=window.getComputedStyle(t),h=t.getBoundingClientRect()[l()?"x":"y"]+t.getBoundingClientRect()[l()?"width":"height"]/2-Number.parseFloat(f.transform.split(",")[l()?4:5]);a(d-h)})})),b(qo,O({ref(c){var u=ve(d=>t=d,o.ref);typeof u=="function"&&u(c)},get style(){return{transform:`translate${l()?"X":"Y"}(${s()}px)`,color:"red"}}},i))}function nf(e){const t=to(),n=gr(),r=Rt(),[o,i]=z(),[s,a]=k(e,["onPointerEnter","onPointerLeave"]),l=u=>{re(u,s.onPointerEnter),t.cancelLeaveTimer()},c=u=>{re(u,s.onPointerLeave),t.startLeaveTimer()};return H(xe(n.value,u=>{Fo(()=>{if(!u||u.includes("link-trigger-")){t.setPreviousMenu(void 0);return}if(u===r.value()){if(t.previousMenu()!=null){const p=[...n.menus()],g=p.indexOf(t.previousMenu()),v=p.indexOf(u);g<v?i("from-end"):i("from-start")}else i(void 0);t.setPreviousMenu(u);return}const d=[...n.menus()],f=d.indexOf(t.previousMenu()),h=d.indexOf(u);f>h?i("to-end"):i("to-start")})})),b(pw,O({as:"ul",onPointerEnter:l,onPointerLeave:c,onInteractOutside:()=>{t.setAutoFocusMenu(!1)},get"data-motion"(){return o()}},a))}function rf(e){return(()=>{var t=tf();return X(t,b(yw,O({as:"a"},e))),t})()}function of(e){const t=gr(),n=to(),[r,o]=k(e,["value"]),i=Ee(),s=t.generateId(`navigation-menu-menu-${i}`),a=Y({id:s},o),l=()=>r.value??i,[c,u]=z(!1),d=()=>{var f,h;t.value()!==l()&&u(!1),(f=n.viewportRef())==null||f.removeEventListener("animationend",d),(h=n.viewportRef())==null||h.removeEventListener("animationcancel",d)};return H(xe(t.value,f=>{if(f===l())u(!0);else{const h=n.viewportRef();if(!h||["","none"].includes(window.getComputedStyle(h).animationName)){u(!1);return}h.addEventListener("animationend",d)}})),b(ef,O({get forceMount(){return c()},get value(){return l()}},a))}function sf(e){const t=to(),n=Lt(),[r,o]=k(e,["ref"]);return b(ge,{get when(){return t.viewportPresent()},get children(){return b(xw,O({ref(i){var s=ve(a=>{a&&a.setAttribute("role","presentation")},r.ref);typeof s=="function"&&s(i)},get mount(){return L(()=>n.parentMenuContext()==null)()?t.viewportRef():void 0}},o))}})}function af(e){const t=Y({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]=bt({value:()=>n.value,defaultValue:()=>n.defaultValue,onChange:T=>{var K;return(K=n.onValueChange)==null?void 0:K.call(n,T)}}),[a,l]=bt({value:()=>n.autoFocusMenu,defaultValue:()=>!1,onChange:n.onAutoFocusMenuChange}),[c,u]=z(),[d,f]=z(),[h,p]=z(r.placement??o.orientation==="vertical"?"right":"bottom");H(()=>{p(o.orientation==="vertical"?"right":"bottom")});let g;const[v,m]=z(),[y,w]=z(!1),[S,E]=z(!1);H(()=>{i()&&!i().includes("link-trigger-")&&a()?Fo(()=>{E(!0),w(!0)}):(E(!1),w(!1))});const $=L(()=>({"data-expanded":S()?"":void 0,"data-closed":S()?void 0:""})),{present:F}=Jn({show:()=>n.forceMount||y()||S(),element:()=>c()??null});H(()=>{F()||_.setPreviousMenu(void 0)});const _={dataset:$,delayDuration:()=>n.delayDuration,skipDelayDuration:()=>n.skipDelayDuration,autoFocusMenu:a,setAutoFocusMenu:l,startLeaveTimer:()=>{g=window.setTimeout(()=>{_.setAutoFocusMenu(!1),s(void 0)},_.skipDelayDuration())},cancelLeaveTimer:()=>{g&&clearTimeout(g)},rootRef:d,setRootRef:f,viewportRef:c,setViewportRef:u,viewportPresent:F,currentPlacement:h,previousMenu:v,setPreviousMenu:m};return b(qd.Provider,{value:_,get children(){return b(fr,O({anchorRef:d,contentRef:c,get placement(){return h()},onCurrentPlacementChange:p},r,{get children(){var T=Vw();return X(T,b(Dw,O({as:"ul",ref(K){var N=ve(_.setRootRef,n.ref);typeof N=="function"&&N(K)},get value(){return i()??null},onValueChange:s,get autoFocusMenu(){return a()},onAutoFocusMenuChange:l},o))),T}}))}})}function lf(e){const t=to(),n=Wo(),[r,o]=k(e,["onPointerEnter","onPointerLeave","onClick"]);let i;const s=c=>{re(c,r.onClick),i&&clearTimeout(i)},a=c=>{re(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=>{re(c,r.onPointerLeave),c.pointerType!=="touch"&&(t.startLeaveTimer(),i&&clearTimeout(i))};return(()=>{var c=tf();return X(c,b(_w,O({onClick:s,onPointerEnter:a,onPointerLeave:l},o))),c})()}function uf(e){const t=to(),n=gr(),[r,o]=z(),[i,s]=k(e,["ref","style","onEscapeKeyDown"]),a=()=>{n.setAutoFocusMenu(!1),n.closeMenu()},l=f=>{a()},c=qy(r);H(xe(()=>n.value()?n.menuRefMap().get(n.value()):void 0,f=>{f===void 0||f[0]===void 0||o(f[0])}));const u=L(f=>{if(!(r()===void 0||!t.viewportPresent()))return c.height()===0?f:c.height()}),d=L(f=>{if(!(r()===void 0||!t.viewportPresent()))return c.width()===0?f:c.width()});return b(ge,{get when(){return t.viewportPresent()},get children(){return b(fr.Positioner,{role:"presentation",get children(){return b(zo,O({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 ft({"--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":d()?`${d()}px`:void 0,position:"relative"},i.style)},get onEscapeKeyDown(){return Se([i.onEscapeKeyDown,l])},onDismiss:a,get"data-orientation"(){return n.orientation()}},()=>t.dataset(),s))}})}})}Object.assign(af,{Arrow:Nw,CheckboxItem:gw,Content:nf,Group:Qd,GroupLabel:vw,Icon:Yd,Item:rf,ItemDescription:ww,ItemIndicator:bw,ItemLabel:Sw,Portal:sf,RadioGroup:Ew,RadioItem:Rw,Menu:of,Separator:wa,Sub:$w,SubContent:Ow,SubTrigger:Fw,Trigger:lf,Viewport:uf});var Kw=te('<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 au=of,lu=e=>{const[t,n]=k(e,["class","children"]);return b(af,O({gutter:6,get class(){return ue("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[L(()=>t.children),b(zw,{})]}}))},uu=e=>{const[t,n]=k(e,["class"]);return b(lf,O({get class(){return ue("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))},cu=()=>b(Yd,{"aria-hidden":"true",get children(){return Kw()}}),zw=e=>{const[t,n]=k(e,["class"]);return b(uf,O({get class(){return ue("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))},du=e=>{const[t,n]=k(e,["class"]);return b(sf,{get children(){return b(nf,O({get class(){return ue("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))}})},fu=e=>{const[t,n]=k(e,["class"]);return b(rf,O({get class(){return ue("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
+ * table-core
8
+ *
9
+ * Copyright (c) TanStack
10
+ *
11
+ * This source code is licensed under the MIT license found in the
12
+ * LICENSE.md file in the root directory of this source tree.
13
+ *
14
+ * @license MIT
15
+ */function Qt(e,t){return typeof e=="function"?e(t):e}function Xe(e,t){return n=>{t.setState(r=>({...r,[e]:Qt(n,r[e])}))}}function Xo(e){return e instanceof Function}function jw(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Bw(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 J(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,d)=>r[d]!==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,d=Math.round((Date.now()-c)*100)/100,f=d/16,h=(p,g)=>{for(p=String(p);p.length<g;)p=" "+p;return p};console.info(`%c⏱ ${h(d,5)} /${h(u,5)} ms`,`
16
+ font-size: .6rem;
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 ee(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 Hw(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:J(()=>[e,n,t,i],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),ee(e.options,"debugCells"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}function Gw(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=f=>{let h=f;for(const g of l.split(".")){var p;h=(p=h)==null?void 0:p[g]}return h}:u=f=>f[a.accessorKey]),!c)throw new Error;let d={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:J(()=>[!0],()=>{var f;return[d,...(f=d.columns)==null?void 0:f.flatMap(h=>h.getFlatColumns())]},ee(e.options,"debugColumns")),getLeafColumns:J(()=>[e._getOrderColumnsFn()],f=>{var h;if((h=d.columns)!=null&&h.length){let p=d.columns.flatMap(g=>g.getLeafColumns());return f(p)}return[d]},ee(e.options,"debugColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(d,e);return d}const Te="debugHeaders";function hu(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 Uw={createTable:e=>{e.getHeaderGroups=J(()=>[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:[],l=(s=o==null?void 0:o.map(d=>n.find(f=>f.id===d)).filter(Boolean))!=null?s:[],c=n.filter(d=>!(r!=null&&r.includes(d.id))&&!(o!=null&&o.includes(d.id)));return co(t,[...a,...c,...l],e)},ee(e.options,Te)),e.getCenterHeaderGroups=J(()=>[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))),co(t,n,e,"center")),ee(e.options,Te)),e.getLeftHeaderGroups=J(()=>[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 co(t,i,e,"left")},ee(e.options,Te)),e.getRightHeaderGroups=J(()=>[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 co(t,i,e,"right")},ee(e.options,Te)),e.getFooterGroups=J(()=>[e.getHeaderGroups()],t=>[...t].reverse(),ee(e.options,Te)),e.getLeftFooterGroups=J(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),ee(e.options,Te)),e.getCenterFooterGroups=J(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),ee(e.options,Te)),e.getRightFooterGroups=J(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),ee(e.options,Te)),e.getFlatHeaders=J(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),ee(e.options,Te)),e.getLeftFlatHeaders=J(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),ee(e.options,Te)),e.getCenterFlatHeaders=J(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),ee(e.options,Te)),e.getRightFlatHeaders=J(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),ee(e.options,Te)),e.getCenterLeafHeaders=J(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ee(e.options,Te)),e.getLeftLeafHeaders=J(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ee(e.options,Te)),e.getRightLeafHeaders=J(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ee(e.options,Te)),e.getLeafHeaders=J(()=>[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()},ee(e.options,Te))}};function co(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(p=>p.getIsVisible()).forEach(p=>{var g;(g=p.columns)!=null&&g.length&&a(p.columns,h+1)},0)};a(e);let l=[];const c=(f,h)=>{const p={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},g=[];f.forEach(v=>{const m=[...g].reverse()[0],y=v.column.depth===p.depth;let w,S=!1;if(y&&v.column.parent?w=v.column.parent:(w=v.column,S=!0),m&&(m==null?void 0:m.column)===w)m.subHeaders.push(v);else{const E=hu(n,w,{id:[r,h,w.id,v==null?void 0:v.id].filter(Boolean).join("_"),isPlaceholder:S,placeholderId:S?`${g.filter($=>$.column===w).length}`:void 0,depth:h,index:g.length});E.subHeaders.push(v),g.push(E)}p.headers.push(v),v.headerGroup=p}),l.push(p),h>0&&c(g,h-1)},u=t.map((f,h)=>hu(n,f,{depth:s,index:h}));c(u,s-1),l.reverse();const d=f=>f.filter(p=>p.column.getIsVisible()).map(p=>{let g=0,v=0,m=[0];p.subHeaders&&p.subHeaders.length?(m=[],d(p.subHeaders).forEach(w=>{let{colSpan:S,rowSpan:E}=w;g+=S,m.push(E)})):g=1;const y=Math.min(...m);return v=v+y,p.colSpan=g,p.rowSpan=v,{colSpan:g,rowSpan:v}});return d((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const ba=(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:()=>Bw(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:J(()=>[e.getAllLeafColumns()],l=>l.map(c=>Hw(e,a,c,c.id)),ee(e.options,"debugRows")),_getAllCellsByColumnId:J(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),ee(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},qw={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()}}},cf=(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))};cf.autoRemove=e=>at(e);const df=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};df.autoRemove=e=>at(e);const ff=(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())};ff.autoRemove=e=>at(e);const hf=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};hf.autoRemove=e=>at(e)||!(e!=null&&e.length);const gf=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});gf.autoRemove=e=>at(e)||!(e!=null&&e.length);const pf=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});pf.autoRemove=e=>at(e)||!(e!=null&&e.length);const mf=(e,t,n)=>e.getValue(t)===n;mf.autoRemove=e=>at(e);const vf=(e,t,n)=>e.getValue(t)==n;vf.autoRemove=e=>at(e);const Sa=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};Sa.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]};Sa.autoRemove=e=>at(e)||at(e[0])&&at(e[1]);const Mt={includesString:cf,includesStringSensitive:df,equalsString:ff,arrIncludes:hf,arrIncludesAll:gf,arrIncludesSome:pf,equals:mf,weakEquals:vf,inNumberRange:Sa};function at(e){return e==null||e===""}const Ww={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Xe("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"?Mt.includesString:typeof r=="number"?Mt.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Mt.equals:Array.isArray(r)?Mt.arrIncludes:Mt.weakEquals},e.getFilterFn=()=>{var n,r;return Xo(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:Mt[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=Qt(n,i?i.value:void 0);if(gu(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=Qt(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(gu(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 gu(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Xw=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),Qw=(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},Yw=(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},Zw=(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]},Jw=(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},eb=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!jw(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},tb=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),nb=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,rb=(e,t)=>t.length,fi={sum:Xw,min:Qw,max:Yw,extent:Zw,mean:Jw,median:eb,unique:tb,uniqueCount:nb,count:rb},ob={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:Xe("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 fi.sum;if(Object.prototype.toString.call(r)==="[object Date]")return fi.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Xo(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:fi[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 ib(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 sb={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Xe("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=J(n=>[Tr(t,n)],n=>n.findIndex(r=>r.id===e.id),ee(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=Tr(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Tr(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=J(()=>[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 ib(i,n,r)},ee(e.options,"debugTable"))}},hi=()=>({left:[],right:[]}),ab={getInitialState:e=>({columnPinning:hi(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Xe("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(d=>!(r!=null&&r.includes(d))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(d=>!(r!=null&&r.includes(d))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(d=>!(r!=null&&r.includes(d))),...r],right:((u=o==null?void 0:o.right)!=null?u:[]).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=J(()=>[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))},ee(t.options,"debugRows")),e.getLeftVisibleCells=J(()=>[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"})),ee(t.options,"debugRows")),e.getRightVisibleCells=J(()=>[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"})),ee(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?hi():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:hi())},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=J(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),ee(e.options,"debugColumns")),e.getRightLeafColumns=J(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),ee(e.options,"debugColumns")),e.getCenterLeafColumns=J(()=>[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))},ee(e.options,"debugColumns"))}},fo={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},gi=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),lb={getDefaultColumnDef:()=>fo,getInitialState:e=>({columnSizing:{},columnSizingInfo:gi(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Xe("columnSizing",e),onColumnSizingInfoChange:Xe("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:fo.minSize,(r=i??e.columnDef.size)!=null?r:fo.size),(o=e.columnDef.maxSize)!=null?o:fo.maxSize)},e.getStart=J(n=>[n,Tr(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),ee(t.options,"debugColumns")),e.getAfter=J(n=>[n,Tr(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),ee(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(),pi(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(m=>[m.column.id,m.column.getSize()]):[[r.id,r.getSize()]],l=pi(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(m,y)=>{typeof y=="number"&&(t.setColumnSizingInfo(w=>{var S,E;const $=t.options.columnResizeDirection==="rtl"?-1:1,F=(y-((S=w==null?void 0:w.startOffset)!=null?S:0))*$,_=Math.max(F/((E=w==null?void 0:w.startSize)!=null?E:0),-.999999);return w.columnSizingStart.forEach(T=>{let[K,N]=T;c[K]=Math.round(Math.max(N+N*_,0)*100)/100}),{...w,deltaOffset:F,deltaPercentage:_}}),(t.options.columnResizeMode==="onChange"||m==="end")&&t.setColumnSizing(w=>({...w,...c})))},d=m=>u("move",m),f=m=>{u("end",m),t.setColumnSizingInfo(y=>({...y,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=n||typeof document<"u"?document:null,p={moveHandler:m=>d(m.clientX),upHandler:m=>{h==null||h.removeEventListener("mousemove",p.moveHandler),h==null||h.removeEventListener("mouseup",p.upHandler),f(m.clientX)}},g={moveHandler:m=>(m.cancelable&&(m.preventDefault(),m.stopPropagation()),d(m.touches[0].clientX),!1),upHandler:m=>{var y;h==null||h.removeEventListener("touchmove",g.moveHandler),h==null||h.removeEventListener("touchend",g.upHandler),m.cancelable&&(m.preventDefault(),m.stopPropagation()),f((y=m.touches[0])==null?void 0:y.clientX)}},v=ub()?{passive:!1}:!1;pi(i)?(h==null||h.addEventListener("touchmove",g.moveHandler,v),h==null||h.addEventListener("touchend",g.upHandler,v)):(h==null||h.addEventListener("mousemove",p.moveHandler,v),h==null||h.addEventListener("mouseup",p.upHandler,v)),t.setColumnSizingInfo(m=>({...m,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?gi():(n=e.initialState.columnSizingInfo)!=null?n:gi())},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 ho=null;function ub(){if(typeof ho=="boolean")return ho;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 ho=e,ho}function pi(e){return e.type==="touchstart"}const cb={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Xe("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=J(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),ee(t.options,"debugRows")),e.getVisibleCells=J(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],ee(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>J(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),ee(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 Tr(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const db={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()}}},fb={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Xe("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=()=>Mt.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Xo(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Mt[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},hb={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Xe("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()}}}},Cs=0,Es=10,mi=()=>({pageIndex:Cs,pageSize:Es}),gb={getInitialState:e=>({...e,pagination:{...mi(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Xe("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=>Qt(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?mi():(o=e.initialState.pagination)!=null?o:mi())},e.setPageIndex=r=>{e.setPagination(o=>{let i=Qt(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?Cs:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:Cs)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?Es:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:Es)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,Qt(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=Qt(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=J(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},ee(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}}},vi=()=>({top:[],bottom:[]}),pb={getInitialState:e=>({rowPinning:vi(),...e}),getDefaultOptions:e=>({onRowPinningChange:Xe("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 d,f;return{top:((d=l==null?void 0:l.top)!=null?d:[]).filter(g=>!(a!=null&&a.has(g))),bottom:[...((f=l==null?void 0:l.bottom)!=null?f:[]).filter(g=>!(a!=null&&a.has(g))),...Array.from(a)]}}if(n==="top"){var h,p;return{top:[...((h=l==null?void 0:l.top)!=null?h:[]).filter(g=>!(a!=null&&a.has(g))),...Array.from(a)],bottom:((p=l==null?void 0:l.bottom)!=null?p:[]).filter(g=>!(a!=null&&a.has(g)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(g=>!(a!=null&&a.has(g))),bottom:((u=l==null?void 0:l.bottom)!=null?u:[]).filter(g=>!(a!=null&&a.has(g)))}})},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?vi():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:vi())},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=J(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),ee(e.options,"debugRows")),e.getBottomRows=J(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),ee(e.options,"debugRows")),e.getCenterRows=J(()=>[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))},ee(e.options,"debugRows"))}},mb={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Xe("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=>{Rs(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=J(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?yi(e,n):{rows:[],flatRows:[],rowsById:{}},ee(e.options,"debugTable")),e.getFilteredSelectedRowModel=J(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?yi(e,n):{rows:[],flatRows:[],rowsById:{}},ee(e.options,"debugTable")),e.getGroupedSelectedRowModel=J(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?yi(e,n):{rows:[],flatRows:[],rowsById:{}},ee(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 Rs(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return xa(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Ps(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Ps(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)}}}},Rs=(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=>Rs(e,a.id,n,r,o))};function yi(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var c;const u=xa(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 xa(e,t){var n;return(n=t[e.id])!=null?n:!1}function Ps(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()&&(xa(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=Ps(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const Is=/([0-9]+)/gm,vb=(e,t,n)=>yf(nn(e.getValue(n)).toLowerCase(),nn(t.getValue(n)).toLowerCase()),yb=(e,t,n)=>yf(nn(e.getValue(n)),nn(t.getValue(n))),wb=(e,t,n)=>Ca(nn(e.getValue(n)).toLowerCase(),nn(t.getValue(n)).toLowerCase()),bb=(e,t,n)=>Ca(nn(e.getValue(n)),nn(t.getValue(n))),Sb=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},xb=(e,t,n)=>Ca(e.getValue(n),t.getValue(n));function Ca(e,t){return e===t?0:e>t?1:-1}function nn(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function yf(e,t){const n=e.split(Is).filter(Boolean),r=t.split(Is).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 Rr={alphanumeric:vb,alphanumericCaseSensitive:yb,text:wb,textCaseSensitive:bb,datetime:Sb,basic:xb},Cb={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Xe("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 Rr.datetime;if(typeof i=="string"&&(r=!0,i.split(Is).length>1))return Rr.alphanumeric}return r?Rr.text:Rr.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 Xo(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:Rr[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,d=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 f;c=[...s,{id:e.id,desc:d}],c.splice(0,c.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(h=>h.id===e.id?{...h,desc:d}:h):u==="remove"?c=s.filter(h=>h.id!==e.id):c=[{id:e.id,desc:d}];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())}},Eb=[Uw,cb,sb,ab,qw,Ww,db,fb,Cb,ob,hb,gb,pb,mb,lb];function Rb(e){var t,n;const r=[...Eb,...(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 l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(f=>{var h;l=(h=f.getInitialState==null?void 0:f.getInitialState(l))!=null?h:l});const c=[];let u=!1;const d={_features:r,options:{...i,...e},initialState:l,_queue:f=>{c.push(f),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{o.setState(o.initialState)},setOptions:f=>{const h=Qt(f,o.options);o.options=s(h)},getState:()=>o.options.state,setState:f=>{o.options.onStateChange==null||o.options.onStateChange(f)},_getRowId:(f,h,p)=>{var g;return(g=o.options.getRowId==null?void 0:o.options.getRowId(f,h,p))!=null?g:`${p?[p.id,h].join("."):h}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(f,h)=>{let p=(h?o.getPrePaginationRowModel():o.getRowModel()).rowsById[f];if(!p&&(p=o.getCoreRowModel().rowsById[f],!p))throw new Error;return p},_getDefaultColumnDef:J(()=>[o.options.defaultColumn],f=>{var h;return f=(h=f)!=null?h:{},{header:p=>{const g=p.header.column.columnDef;return g.accessorKey?g.accessorKey:g.accessorFn?g.id:null},cell:p=>{var g,v;return(g=(v=p.renderValue())==null||v.toString==null?void 0:v.toString())!=null?g:null},...o._features.reduce((p,g)=>Object.assign(p,g.getDefaultColumnDef==null?void 0:g.getDefaultColumnDef()),{}),...f}},ee(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:J(()=>[o._getColumnDefs()],f=>{const h=function(p,g,v){return v===void 0&&(v=0),p.map(m=>{const y=Gw(o,m,v,g),w=m;return y.columns=w.columns?h(w.columns,y,v+1):[],y})};return h(f)},ee(e,"debugColumns")),getAllFlatColumns:J(()=>[o.getAllColumns()],f=>f.flatMap(h=>h.getFlatColumns()),ee(e,"debugColumns")),_getAllFlatColumnsById:J(()=>[o.getAllFlatColumns()],f=>f.reduce((h,p)=>(h[p.id]=p,h),{}),ee(e,"debugColumns")),getAllLeafColumns:J(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(f,h)=>{let p=f.flatMap(g=>g.getLeafColumns());return h(p)},ee(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 Pb(){return e=>J(()=>[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=ba(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},ee(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Ib(e,t,n){return n.options.filterFromLeafRows?$b(e,t,n):Mb(e,t,n)}function $b(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 f=0;f<l.length;f++){var d;let h=l[f];const p=ba(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);if(p.columnFilters=h.columnFilters,(d=h.subRows)!=null&&d.length&&c<s){if(p.subRows=a(h.subRows,c+1),h=p,t(h)&&!p.subRows.length){u.push(h),i[h.id]=h,o.push(h);continue}if(t(h)||p.subRows.length){u.push(h),i[h.id]=h,o.push(h);continue}}else h=p,t(h)&&(u.push(h),i[h.id]=h,o.push(h))}return u};return{rows:a(e),flatRows:o,rowsById:i}}function Mb(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 f=0;f<l.length;f++){let h=l[f];if(t(h)){var d;if((d=h.subRows)!=null&&d.length&&c<s){const g=ba(n,h.id,h.original,h.index,h.depth,void 0,h.parentId);g.subRows=a(h.subRows,c+1),h=g}u.push(h),o.push(h),i[h.id]=h}}return u};return{rows:a(e),flatRows:o,rowsById:i}}function Ob(){return e=>J(()=>[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 p=e.getColumn(f.id);if(!p)return;const g=p.getFilterFn();g&&o.push({id:f.id,filterFn:g,resolvedValue:(h=g.resolveFilterValue==null?void 0:g.resolveFilterValue(f.value))!=null?h:f.value})});const s=(n??[]).map(f=>f.id),a=e.getGlobalFilterFn(),l=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());r&&a&&l.length&&(s.push("__global__"),l.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 c,u;for(let f=0;f<t.flatRows.length;f++){const h=t.flatRows[f];if(h.columnFilters={},o.length)for(let p=0;p<o.length;p++){c=o[p];const g=c.id;h.columnFilters[g]=c.filterFn(h,g,c.resolvedValue,v=>{h.columnFiltersMeta[g]=v})}if(i.length){for(let p=0;p<i.length;p++){u=i[p];const g=u.id;if(u.filterFn(h,g,u.resolvedValue,v=>{h.columnFiltersMeta[g]=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 Ib(t.rows,d,e)},ee(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}/**
19
+ * solid-table
20
+ *
21
+ * Copyright (c) TanStack
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE.md file in the root directory of this source tree.
25
+ *
26
+ * @license MIT
27
+ */function pu(e,t){return e?typeof e=="function"?b(e,t):e:null}function Ab(e){const t=O({state:{},onStateChange:()=>{},renderFallbackValue:null,mergeOptions:(i,s)=>O(i,s)},e),n=Rb(t),[r,o]=Xr(n.initialState);return st(()=>{n.setOptions(i=>O(i,e,{state:O(r,e.state||{}),onStateChange:s=>{o(s),e.onStateChange==null||e.onStateChange(s)}}))}),n}var Qo=te("<li>"),Fb=te("<ul>"),Tb={};xt(Tb,{Ellipsis:()=>Ea,Item:()=>Ra,Items:()=>Pa,Next:()=>Ia,Pagination:()=>Db,Previous:()=>$a,Root:()=>Ma});function Ea(e){return(()=>{var t=Qo();return X(t,b(ce,O({as:"div"},e))),t})()}var wf=we();function Yo(){const e=ye(wf);if(e===void 0)throw new Error("[kobalte]: `usePaginationContext` must be used within a `Pagination` component");return e}function Ra(e){const t=Yo(),[n,r]=k(e,["page","onClick"]),o=()=>t.page()===n.page,i=()=>{t.setPage(n.page)};return(()=>{var s=Qo();return X(s,b(Ct,O({get"aria-current"(){return o()?"page":void 0},get"data-current"(){return o()?"":void 0},get onClick(){return Se([n.onClick,i])}},r))),s})()}function Pa(e){const t=Yo(),n=L(()=>{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(),d=l()&&r()-i()>o();let f=i()-(a()?2:1)>o(),h=r()-i()-(l()?1:0)>o(),p=Math.min(i()-1,o()),g=Math.min(r()-i(),o());if(s()!==!1){const v=p,m=g;p+=Math.max(o()-m,0),g+=Math.max(o()-v,0),u||g++,d||p++,s()===!0&&(f||g++,h||p++),i()-p-(a()?2:1)===1&&(f=!1,p++),r()-i()-g-(l()?1:0)===1&&(h=!1,g++)}return{showFirst:u,showLast:d,showFirstEllipsis:f,showLastEllipsis:h,previousSiblingCount:p,nextSiblingCount:g,renderItemsDirectly:c}});return b(ge,{get when(){return n().renderItemsDirectly},get fallback(){return[b(ge,{get when(){return n().showFirst},get children(){return t.renderItem(1)}}),b(ge,{get when(){return n().showFirstEllipsis},get children(){return t.renderEllipsis()}}),b(ot,{get each(){return[...Array(n().previousSiblingCount).keys()].reverse()},children:r=>L(()=>t.renderItem(t.page()-(r+1)))}),L(()=>t.renderItem(t.page())),b(ot,{get each(){return[...Array(n().nextSiblingCount).keys()]},children:r=>L(()=>t.renderItem(t.page()+(r+1)))}),b(ge,{get when(){return n().showLastEllipsis},get children(){return t.renderEllipsis()}}),b(ge,{get when(){return n().showLast},get children(){return t.renderItem(t.count())}})]},get children(){return b(ot,{get each(){return[...Array(t.count()).keys()]},children:r=>L(()=>t.renderItem(r+1))})}})}function Ia(e){const t=Yo(),[n,r]=k(e,["onClick"]),o=()=>{t.setPage(t.page()+1)},i=()=>t.page()===t.count();return(()=>{var s=Qo();return X(s,b(Ct,O({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 Se([n.onClick,o])}},r))),s})()}function $a(e){const t=Yo(),[n,r]=k(e,["onClick"]),o=()=>{t.setPage(t.page()-1)},i=()=>t.page()===1;return(()=>{var s=Qo();return X(s,b(Ct,O({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 Se([n.onClick,o])}},r))),s})()}function Ma(e){const t=`pagination-${Ee()}`,n=Y({id:t},e),[r,o]=k(n,["page","defaultPage","onPageChange","count","siblingCount","showFirst","showLast","fixedItems","itemComponent","ellipsisComponent","disabled","children"]),i=bt({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(wf.Provider,{value:s,get children(){return b(ce,O({as:"nav",get"data-disabled"(){return r.disabled?"":void 0}},o,{get children(){var a=Fb();return X(a,()=>r.children),a}}))}})}var Db=Object.assign(Ma,{Ellipsis:Ea,Item:Ra,Items:Pa,Next:Ia,Previous:$a});const Zo=Yr("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"}}),Dr=e=>{const[t,n]=k(e,["variant","size","class"]);return b(Ct,O({get class(){return ue(Zo({variant:t.variant,size:t.size}),t.class)}},n))};var _b=te('<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>'),Lb=te("<span class=sr-only>More pages"),kb=te('<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">'),Vb=te("<span>Previous"),Nb=te("<span>Next"),Kb=te('<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 zb=Pa,jb=e=>{const[t,n]=k(e,["class"]);return b(Ma,O({get class(){return ue("[&>*]:flex [&>*]:flex-row [&>*]:items-center [&>*]:gap-1",t.class)}},n))},Bb=e=>{const[t,n]=k(e,["class"]);return b(Ra,O({get class(){return ue(Zo({variant:"ghost"}),"size-10 data-[current]:border",t.class)}},n))},Hb=e=>{const[t,n]=k(e,["class"]);return b(Ea,O({get class(){return ue("flex size-10 items-center justify-center",t.class)}},n,{get children(){return[_b(),Lb()]}}))},Gb=e=>{const[t,n]=k(e,["class","children"]);return b($a,O({get class(){return ue(Zo({variant:"ghost"}),"gap-1 pl-2.5",t.class)}},n,{get children(){return t.children??[kb(),Vb()]}}))},Ub=e=>{const[t,n]=k(e,["class","children"]);return b(Ia,O({get class(){return ue(Zo({variant:"ghost"}),"gap-1 pl-2.5",t.class)}},n,{get children(){return t.children??[Nb(),Kb()]}}))};var qb=te('<div class="relative w-full overflow-auto"><table>'),Wb=te("<thead>"),Xb=te("<tbody>"),Qb=te("<tr>"),Yb=te("<th>"),Zb=te("<td>");const Jb=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=qb(),o=r.firstChild;return et(o,O({get class(){return ue("w-full caption-bottom text-sm",t.class)}},n),!1,!1),r})()},e0=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=Wb();return et(r,O({get class(){return ue("[&_tr]:border-b",t.class)}},n),!1,!1),r})()},t0=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=Xb();return et(r,O({get class(){return ue(t.class)}},n),!1,!1),r})()},wi=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=Qb();return et(r,O({get class(){return ue("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t.class)}},n),!1,!1),r})()},n0=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=Yb();return et(r,O({get class(){return ue("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t.class)}},n),!1,!1),r})()},mu=e=>{const[t,n]=k(e,["class"]);return(()=>{var r=Zb();return et(r,O({get class(){return ue("p-4 align-middle [&:has([role=checkbox])]:pr-0",t.class)}},n),!1,!1),r})()};var r0=(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},o0=(e,t,n)=>(t=encodeURIComponent(t),r0(e,t,n)),i0=(e,t)=>(e=e.replace(/\/+$/,""),e=e+"/",t=t.replace(/^\/+/,""),e+t),$s=(e,t)=>{for(const[n,r]of Object.entries(t)){const o=new RegExp("/:"+n+"(?:{[^/]+})?\\??");e=e.replace(o,r?`/${r}`:"")}return e},s0=(e,t)=>{switch(t){case"ws":return e.replace(/^http/,"ws");case"http":return e.replace(/^ws/,"http")}},a0=e=>/^https?:\/\/[^\/]+?\/index$/.test(e)?e.replace(/\/index$/,"/"):e.replace(/\/index$/,"");function go(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function bf(e,t){if(!go(e)&&!go(t))return t;const n={...e};for(const r in t){const o=t[r];go(n[r])&&go(o)?n[r]=bf(n[r],o):n[r]=o}return n}var Sf=(e,t)=>new Proxy(()=>{},{get(r,o){if(!(typeof o!="string"||o==="then"))return Sf(e,[...t,o])},apply(r,o,i){return e({path:t,args:i})}}),l0=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(o0(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=a0(i),i=$s(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}},u0=(e,t)=>Sf(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=i0(e,s);if(i==="url")return r.args[0]&&r.args[0].param?new URL($s(a,r.args[0].param)):new URL(a);if(i==="ws"){const u=s0(r.args[0]&&r.args[0].param?$s(a,r.args[0].param):a,"ws"),d=new URL(u),f=(c=r.args[0])==null?void 0:c.query;return f&&Object.entries(f).forEach(([p,g])=>{Array.isArray(g)?g.forEach(v=>d.searchParams.append(p,v)):d.searchParams.set(p,g)}),((...p)=>(t==null?void 0:t.webSocket)!==void 0&&typeof t.webSocket=="function"?t.webSocket(...p):new WebSocket(...p))(d.toString())}const l=new l0(a,i);if(i){t??(t={});const u=bf(t,{...r.args[1]??{}});return l.fetch(r.args[0],u)}return l},[]);const pr=u0("/rpc"),bi="production",c0=e=>ko(()=>({queryKey:["bundles",e()],queryFn:async()=>(await pr.bundles.$get({query:e()})).json(),placeholderData:t=>t,staleTime:Number.POSITIVE_INFINITY})),d0=e=>ko(()=>({queryKey:["bundle",e],queryFn:()=>pr.bundles[":bundleId"].$get({param:{bundleId:e}}).then(t=>t.json()),placeholderData:t=>t,staleTime:Number.POSITIVE_INFINITY})),f0=()=>ko(()=>({queryKey:["config"],queryFn:()=>pr.config.$get().then(e=>e.json()),staleTime:Number.POSITIVE_INFINITY,retryOnMount:!1})),h0=()=>ko(()=>({queryKey:["channels"],queryFn:()=>pr.channels.$get().then(e=>e.json()),staleTime:Number.POSITIVE_INFINITY,retryOnMount:!1,select:e=>!e||e.length===0?null:e.includes(bi)?[bi,...e.filter(t=>t!==bi)]:e})),g0=()=>{const e=Lo();return Gg(()=>({mutationFn:async t=>{const n=await pr.bundles[":bundleId"].$delete({param:{bundleId:t}});if(!n.ok)throw new Error(`Failed to delete bundle: ${n.status}`);return n.json()},onSuccess:()=>{e.invalidateQueries({queryKey:["bundles"]})}}))};var p0=te('<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">'),m0=te('<div class="mt-2 text-sm text-muted-foreground text-center">Showing <!> to <!> of <!> results');const v0=20,[gt,po]=z({pageIndex:0,pageSize:v0});function y0(e){var g;const[t]=k(e,["columns","onRowClick"]),{channelFilter:n,platformFilter:r,setPlatformFilter:o,setChannelFilter:i}=vd(),s=L(()=>({channel:n()??void 0,platform:r()??void 0,limit:gt().pageSize.toString(),offset:(gt().pageIndex*gt().pageSize).toString()})),a=c0(s),l=L(()=>a.data??{data:[],pagination:null}),c=L(()=>l().data??[]),u=L(()=>l().pagination),d=Ab({get data(){return c()},columns:t.columns,getCoreRowModel:Pb(),getFilteredRowModel:Ob(),state:{get pagination(){return gt()},get globalFilter(){return r()}},onPaginationChange:po,globalFilterFn:(v,m,y)=>y?v.original.platform.toLowerCase()===y:!0,manualPagination:!0,pageCount:((g=u())==null?void 0:g.totalPages)??0}),f=v=>()=>{t.onRowClick(v.original)},h=h0();H(()=>{h.isFetched&&h.data&&n()===null&&i(h.data[0])});const p=v=>{po(m=>({...m,pageIndex:v}))};return(()=>{var v=p0(),m=v.firstChild,y=m.firstChild,w=y.firstChild,S=w.nextSibling,E=m.nextSibling;return X(y,b(lu,{get children(){return b(au,{get children(){return[b(uu,{class:"w-[100px]",get children(){return[L(()=>L(()=>!!r())()?r():"All"),b(cu,{})]}}),b(du,{get children(){return b(ot,{each:[{label:"All",value:null},{label:"iOS",value:"ios"},{label:"Android",value:"android"}],children:$=>b(fu,{get classList(){return{"bg-primary text-primary-foreground":$.value===r()}},onClick:()=>{o($.value),po(F=>({...F,pageIndex:0}))},get children(){return $.label}})})}})]}})}}),S),X(y,b(lu,{get children(){return b(au,{get children(){return[b(uu,{class:"w-[100px]",get children(){return[L(()=>n()),b(cu,{})]}}),b(du,{get children(){return b(ot,{get each(){return h.data},children:$=>b(fu,{get classList(){return{"bg-primary text-primary-foreground":$===n()}},onClick:()=>{i($),po(F=>({...F,pageIndex:0}))},children:$})})}})]}})}}),null),X(E,b(Jb,{get children(){return[b(e0,{get children(){return b(ot,{get each(){return d.getHeaderGroups()},children:$=>b(wi,{get children(){return b(ot,{get each(){return $.headers},children:F=>b(n0,{get children(){return L(()=>!!F.isPlaceholder)()?null:pu(F.column.columnDef.header,F.getContext())}})})}})})}}),b(t0,{get children(){return L(()=>!!(a.isFetched&&c().length===0))()?b(wi,{get children(){return b(mu,{get colSpan(){return t.columns.length},class:"h-full text-center",children:"No results."})}}):b(ot,{get each(){return d.getRowModel().rows},children:$=>b(wi,{get"data-state"(){return $.getIsSelected()&&"selected"},class:"cursor-pointer",get onClick(){return f($)},get children(){return b(ot,{get each(){return $.getVisibleCells()},children:F=>b(mu,{get children(){return pu(F.column.columnDef.cell,F.getContext())}})})}})})}})]}})),X(v,b(jb,{class:"mt-2.5 w-full [&>ul]:justify-center",itemComponent:$=>b(Bb,{get page(){return $.page},onClick:()=>p($.page-1),get children(){return $.page}}),ellipsisComponent:()=>b(Hb,{}),get count(){var $;return(($=u())==null?void 0:$.totalPages)??1},get children(){return[b(Gb,{onClick:()=>p(gt().pageIndex-1),get disabled(){var $;return!(($=u())!=null&&$.hasPreviousPage)}}),b(zb,{}),b(Ub,{onClick:()=>p(gt().pageIndex+1),get disabled(){var $;return!(($=u())!=null&&$.hasNextPage)}})]}}),null),X(v,(()=>{var $=L(()=>!!u());return()=>$()&&(()=>{var F=m0(),_=F.firstChild,T=_.nextSibling,K=T.nextSibling,N=K.nextSibling,j=N.nextSibling,oe=j.nextSibling;return oe.nextSibling,X(F,()=>gt().pageIndex*gt().pageSize+1,T),X(F,()=>Math.min((gt().pageIndex+1)*gt().pageSize,u().total),N),X(F,()=>u().total,oe),F})()})(),null),ze($=>{var F=!!a.isFetching,_=!!a.isFetching;return F!==$.e&&v.classList.toggle("opacity-50",$.e=F),_!==$.t&&E.classList.toggle("min-h-[400px]",$.t=_),$},{e:void 0,t:void 0}),v})()}var w0={};xt(w0,{AlertDialog:()=>b0,CloseButton:()=>Rn,Content:()=>Oa,Description:()=>ir,Overlay:()=>sr,Portal:()=>ar,Root:()=>lr,Title:()=>ur,Trigger:()=>Zr});function Oa(e){return b(Bo,O({role:"alertdialog"},e))}var b0=Object.assign(lr,{CloseButton:Rn,Content:Oa,Description:ir,Overlay:sr,Portal:ar,Title:ur,Trigger:Zr}),S0=te('<svg 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 class=size-4><title>Close dialog</title><path d="M18 6l-12 12"></path><path d="M6 6l12 12">'),x0=te("<span class=sr-only>Close");const C0=lr,E0=Zr,R0=ar,xf=e=>{const[t,n]=k(e,["class"]);return b(sr,O({get class(){return ue("fixed inset-0 z-50 backdrop-blur-sm data-[expanded]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[expanded]:fade-in-0",t.class)}},n))},P0=e=>{const[t,n]=k(e,["class","children"]);return b(R0,{get children(){return[b(xf,{}),b(Oa,O({get class(){return ue("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[expanded]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[expanded]:fade-in-0 data-[closed]:zoom-out-95 data-[expanded]:zoom-in-95 data-[closed]:slide-out-to-left-1/2 data-[closed]:slide-out-to-top-[48%] data-[expanded]:slide-in-from-left-1/2 data-[expanded]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",t.class)}},n,{get children(){return[L(()=>t.children),b(Rn,{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-[expanded]:bg-accent data-[expanded]:text-muted-foreground",get children(){return[S0(),x0()]}})]}}))]}})},I0=e=>{const[t,n]=k(e,["class"]);return b(ur,O({get class(){return ue("text-lg font-semibold",t.class)}},n))},$0=e=>{const[t,n]=k(e,["class"]);return b(ir,O({get class(){return ue("text-sm text-muted-foreground",t.class)}},n))};var M0={};xt(M0,{Root:()=>Aa,Skeleton:()=>O0});function Aa(e){const t=`skeleton-${Ee()}`,n=Y({visible:!0,animate:!0,id:t},e),[r,o]=k(n,["style","radius","animate","height","width","visible","circle"]);return b(ce,O({as:"div",role:"group",get"data-animate"(){return r.animate||void 0},get"data-visible"(){return r.visible||void 0},get style(){return ft({"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 O0=Aa;const A0=e=>{const[t,n]=k(e,["class"]);return b(Aa,O({get class(){return ue("bg-primary/10 data-[animate='true']:animate-pulse",t.class)}},n))};var Cf=["id","name","validationState","required","disabled","readOnly"];function Ef(e){const t=`form-control-${Ee()}`,n=Y({id:t},e),[r,o]=z(),[i,s]=z(),[a,l]=z(),[c,u]=z(),d=(g,v,m)=>{const y=m!=null||r()!=null;return[m,r(),y&&v!=null?g:void 0].filter(Boolean).join(" ")||void 0},f=g=>[a(),c(),g].filter(Boolean).join(" ")||void 0,h=L(()=>({"data-valid":D(n.validationState)==="valid"?"":void 0,"data-invalid":D(n.validationState)==="invalid"?"":void 0,"data-required":D(n.required)?"":void 0,"data-disabled":D(n.disabled)?"":void 0,"data-readonly":D(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>D(n.name)??D(n.id),dataset:h,validationState:()=>D(n.validationState),isRequired:()=>D(n.required),isDisabled:()=>D(n.disabled),isReadOnly:()=>D(n.readOnly),labelId:r,fieldId:i,descriptionId:a,errorMessageId:c,getAriaLabelledBy:d,getAriaDescribedBy:f,generateId:ht(()=>D(n.id)),registerLabel:Ke(o),registerField:Ke(s),registerDescription:Ke(l),registerErrorMessage:Ke(u)}}}var Fa=we();function on(){const e=ye(Fa);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function Ta(e){const t=on(),n=Y({id:t.generateId("description")},e);return H(()=>W(t.registerDescription(n.id))),b(ce,O({as:"div"},()=>t.dataset(),n))}function Da(e){const t=on(),n=Y({id:t.generateId("error-message")},e),[r,o]=k(n,["forceMount"]),i=()=>t.validationState()==="invalid";return H(()=>{i()&&W(t.registerErrorMessage(o.id))}),b(ge,{get when(){return r.forceMount||i()},get children(){return b(ce,O({as:"div"},()=>t.dataset(),o))}})}function Jo(e){let t;const n=on(),r=Y({id:n.generateId("label")},e),[o,i]=k(r,["ref"]),s=No(()=>t,()=>"label");return H(()=>W(n.registerLabel(i.id))),b(ce,O({as:"label",ref(a){var l=ve(c=>t=c,o.ref);typeof l=="function"&&l(a)},get for(){return L(()=>s()==="label")()?n.fieldId():void 0}},()=>n.dataset(),i))}var Rf=["id","aria-label","aria-labelledby","aria-describedby"];function Pf(e){const t=on(),n=Y({id:t.generateId("field")},e);return H(()=>W(t.registerField(D(n.id)))),{fieldProps:{id:()=>D(n.id),ariaLabel:()=>D(n["aria-label"]),ariaLabelledBy:()=>t.getAriaLabelledBy(D(n.id),D(n["aria-label"]),D(n["aria-labelledby"])),ariaDescribedBy:()=>t.getAriaDescribedBy(D(n["aria-describedby"]))}}}function If(e,t){H(xe(e,n=>{if(n==null)return;const r=F0(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),W(()=>{r.removeEventListener("reset",t)}))}))}function F0(e){return T0(e)?e.form:e.closest("form")}function T0(e){return e.matches("textarea, input, select, button")}var D0={};xt(D0,{Control:()=>_a,Description:()=>Mf,ErrorMessage:()=>Of,Input:()=>La,Label:()=>ka,Root:()=>Va,Switch:()=>L0,Thumb:()=>Na});var $f=we();function mr(){const e=ye($f);if(e===void 0)throw new Error("[kobalte]: `useSwitchContext` must be used within a `Switch` component");return e}function _a(e){const t=on(),n=mr(),r=Y({id:n.generateId("control")},e),[o,i]=k(r,["onClick","onKeyDown"]);return b(ce,O({as:"div",onClick:l=>{var c;re(l,o.onClick),n.toggle(),(c=n.inputRef())==null||c.focus()},onKeyDown:l=>{var c;re(l,o.onKeyDown),l.key===js.Space&&(n.toggle(),(c=n.inputRef())==null||c.focus())}},()=>t.dataset(),()=>n.dataset(),i))}function Mf(e){const t=mr();return b(Ta,O(()=>t.dataset(),e))}function Of(e){const t=mr();return b(Da,O(()=>t.dataset(),e))}function La(e){const t=on(),n=mr(),r=Y({id:n.generateId("input")},e),[o,i,s]=k(r,["ref","style","onChange","onFocus","onBlur"],Rf),{fieldProps:a}=Pf(i);return b(ce,O({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 ft({...qc},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=>{re(d,o.onChange),d.stopPropagation();const f=d.target;n.setIsChecked(f.checked),f.checked=n.checked()},onFocus:d=>{re(d,o.onFocus),n.setIsFocused(!0)},onBlur:d=>{re(d,o.onBlur),n.setIsFocused(!1)}},()=>t.dataset(),()=>n.dataset(),s))}function ka(e){const t=mr();return b(Jo,O(()=>t.dataset(),e))}function Va(e){let t;const n=`switch-${Ee()}`,r=Y({value:"on",id:n},e),[o,i,s]=k(r,["ref","children","value","checked","defaultChecked","onChange","onPointerDown"],Cf),[a,l]=z(),[c,u]=z(!1),{formControlContext:d}=Ef(i),f=jd({isSelected:()=>o.checked,defaultIsSelected:()=>o.defaultChecked,onSelectedChange:v=>{var m;return(m=o.onChange)==null?void 0:m.call(o,v)},isDisabled:()=>d.isDisabled(),isReadOnly:()=>d.isReadOnly()});If(()=>t,()=>f.setIsSelected(o.defaultChecked??!1));const h=v=>{re(v,o.onPointerDown),c()&&v.preventDefault()},p=L(()=>({"data-checked":f.isSelected()?"":void 0})),g={value:()=>o.value,dataset:p,checked:()=>f.isSelected(),inputRef:a,generateId:ht(()=>D(i.id)),toggle:()=>f.toggle(),setIsChecked:v=>f.setIsSelected(v),setIsFocused:u,setInputRef:l};return b(Fa.Provider,{value:d,get children(){return b($f.Provider,{value:g,get children(){return b(ce,O({as:"div",ref(v){var m=ve(y=>t=y,o.ref);typeof m=="function"&&m(v)},role:"group",get id(){return D(i.id)},onPointerDown:h},()=>d.dataset(),p,s,{get children(){return b(_0,{state:g,get children(){return o.children}})}}))}})}})}function _0(e){const t=To(()=>{const n=e.children;return Ks(n)?n(e.state):n});return L(t)}function Na(e){const t=on(),n=mr(),r=Y({id:n.generateId("thumb")},e);return b(ce,O({as:"div"},()=>t.dataset(),()=>n.dataset(),r))}var L0=Object.assign(Va,{Control:_a,Description:Mf,ErrorMessage:Of,Input:La,Label:ka,Thumb:Na});const vu=Va,yu=e=>{const[t,n]=k(e,["class","children"]);return[b(La,{get class(){return ue("[&: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(_a,O({get class(){return ue("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}}))]},wu=e=>{const[t,n]=k(e,["class"]);return b(Na,O({get class(){return ue("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))},bu=e=>{const[t,n]=k(e,["class"]);return b(ka,O({get class(){return ue("text-sm font-medium leading-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-70",t.class)}},n))};var k0={};xt(k0,{Description:()=>Ta,ErrorMessage:()=>Da,Input:()=>Ka,Label:()=>Jo,Root:()=>za,TextArea:()=>Df,TextField:()=>N0});var Af=we();function Ff(){const e=ye(Af);if(e===void 0)throw new Error("[kobalte]: `useTextFieldContext` must be used within a `TextField` component");return e}function Ka(e){return b(Tf,O({type:"text"},e))}function Tf(e){const t=on(),n=Ff(),r=Y({id:n.generateId("input")},e),[o,i,s]=k(r,["onInput"],Rf),{fieldProps:a}=Pf(i);return b(ce,O({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 Se([o.onInput,n.onInput])}},()=>t.dataset(),s))}function za(e){let t;const n=`textfield-${Ee()}`,r=Y({id:n},e),[o,i,s]=k(r,["ref","value","defaultValue","onChange"],Cf),a=o.value,[l,c]=bt({value:()=>a===void 0?void 0:o.value??"",defaultValue:()=>o.defaultValue,onChange:h=>{var p;return(p=o.onChange)==null?void 0:p.call(o,h)}}),{formControlContext:u}=Ef(i);If(()=>t,()=>c(o.defaultValue??""));const d=h=>{if(u.isReadOnly()||u.isDisabled())return;const p=h.target;c(p.value),p.value=l()??""},f={value:l,generateId:ht(()=>D(i.id)),onInput:d};return b(Fa.Provider,{value:u,get children(){return b(Af.Provider,{value:f,get children(){return b(ce,O({as:"div",ref(h){var p=ve(g=>t=g,o.ref);typeof p=="function"&&p(h)},role:"group",get id(){return D(i.id)}},()=>u.dataset(),s))}})}})}function Df(e){let t;const n=Ff(),r=Y({id:n.generateId("textarea")},e),[o,i]=k(r,["ref","autoResize","submitOnEnter","onKeyPress"]);H(xe([()=>t,()=>o.autoResize,()=>n.value()],([a,l])=>{!a||!l||V0(a)}));const s=a=>{t&&o.submitOnEnter&&a.key==="Enter"&&!a.shiftKey&&t.form&&(t.form.requestSubmit(),a.preventDefault())};return b(Tf,O({as:"textarea",get"aria-multiline"(){return o.submitOnEnter?"false":void 0},get onKeyPress(){return Se([o.onKeyPress,s])},ref(a){var l=ve(c=>t=c,o.ref);typeof l=="function"&&l(a)}},i))}function V0(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 N0=Object.assign(za,{Description:Ta,ErrorMessage:Da,Input:Ka,Label:Jo,TextArea:Df});const Si=za,xi=e=>{const[t,n]=k(e,["type","class"]);return b(Ka,O({get type(){return t.type},get class(){return ue("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:opacity-50",t.class)}},n))},K0=Yr("text-sm font-medium leading-none peer-disabled:opacity-70",{variants:{variant:{label:"data-[invalid]:text-destructive",description:"text-destructive",error:"font-normal text-red-500"}},defaultVariants:{variant:"label"}}),Ci=e=>{const[t,n]=k(e,["class"]);return b(Jo,O({get class(){return ue(K0(),t.class)}},n))};class _f{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 ja(e,t){return typeof e=="function"?e(t):e}function Lf(e,t){return Ba(t).reduce((r,o)=>{if(r===null)return null;if(typeof r<"u")return r[o]},e)}function Ei(e,t,n){const r=Ba(t);function o(i){if(!r.length)return ja(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 z0(e,t){const n=Ba(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 j0=/^(\d*)$/gm,B0=/\.(\d*)\./gm,H0=/^(\d*)\./gm,G0=/\.(\d*$)/gm,U0=/\.{2,}/gm,Ms="__int__",mo=`${Ms}$1`;function Ba(e){if(Array.isArray(e))return[...e];if(typeof e!="string")throw new Error("Path must be a string.");return e.replaceAll("[",".").replaceAll("]","").replace(j0,mo).replace(B0,`.${mo}.`).replace(H0,`${mo}.`).replace(G0,`.${mo}`).replace(U0,".").split(".").map(t=>t.indexOf(Ms)===0?parseInt(t.substring(Ms.length),10):t)}function q0(e){return!(Array.isArray(e)&&e.length===0)}function Os(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},d={cause:"submit",validate:i,debounceMs:0},f=h=>({...h,debounceMs:0});switch(e){case"submit":return[f(c),f(u),d];case"blur":return[u];case"change":return[c];case"server":default:return[]}}function As(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 Ri(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 W0=e=>typeof e=="object";class X0{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(()=>Ri(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 Ri({...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 f=o+1;f<=(a??0);f++)l.push(`${r}[${f}]`);const c=Object.keys(this.fieldInfo).filter(f=>l.some(h=>f.startsWith(h))),u=[];return this.store.batch(()=>{c.forEach(f=>{u.push(Promise.resolve().then(()=>this.validateField(f,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=As(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:d}=Fs(c),f=vo(l.cause);if(d)for(const[h,p]of Object.entries(d)){const v={...s[h]||{},[f]:p};s[h]=v;const m=this.getFieldMeta(h);m&&m.errorMap[f]!==p&&this.setFieldMeta(h,y=>({...y,errorMap:{...y.errorMap,[f]:p}}))}this.state.errorMap[f]!==u&&this.store.setState(h=>({...h,errorMap:{...h.errorMap,[f]:u}})),(u||d)&&(i=!0)}});const a=vo("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=Os(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=vo(c.cause),d=this.state.validationMetaMap[u];d==null||d.lastAbortController.abort();const f=new AbortController;this.state.validationMetaMap[u]={lastAbortController:f},i.push(new Promise(async h=>{let p;try{p=await new Promise((y,w)=>{setTimeout(async()=>{if(f.signal.aborted)return y(void 0);try{y(await this.runValidator({validate:c.validate,value:{value:this.state.values,formApi:this,validationSource:"form",signal:f.signal},type:"validateAsync"}))}catch(S){w(S)}},c.debounceMs)})}catch(y){p=y}const{formError:g,fieldErrors:v}=Fs(p);v&&(s=s?{...s,...v}:v);const m=vo(c.cause);if(s)for(const[y,w]of Object.entries(s)){const S=this.getFieldMeta(y);S&&S.errorMap[m]!==w&&this.setFieldMeta(y,E=>({...E,errorMap:{...E.errorMap,[m]:w}}))}this.store.setState(y=>({...y,errorMap:{...y.errorMap,[m]:g}})),h(s?{fieldErrors:s,errorMapKey:m}: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[d,f]of Object.entries(c.fieldErrors)){const p={...l[d]||{},[u]:f};l[d]=p}}}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=>Lf(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]:ja(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:Ei(a.values,r,o)}))})},this.deleteField=r=>{this.store.setState(o=>{const i={...o};return i.values=z0(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 Ei(Ei(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 _f(Ri({...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(w=>w==null?void 0:w.isValidating),l=!s.some(w=>(w==null?void 0:w.errorMap)&&q0(Object.values(w.errorMap).filter(Boolean))),c=s.some(w=>w==null?void 0:w.isTouched),u=s.some(w=>w==null?void 0:w.isBlurred),d=s.some(w=>w==null?void 0:w.isDirty),f=!d,h=a||i.isFormValidating;i.errors=Object.values(i.errorMap).reduce((w,S)=>S===void 0?w:typeof S=="string"?(w.push(S),w):(S&&W0(S)&&w.push(S.form),w),[]);const p=i.errors.length===0,g=l&&p,v=i.submissionAttempts===0&&!c||!h&&!i.isSubmitting&&g;i={...i,isFieldsValidating:a,isFieldsValid:l,isFormValid:p,isValid:g,canSubmit:v,isTouched:c,isBlurred:u,isPristine:f,isDirty:d},this.state=i,this.store.state=this.state;const m=((r=this.options.transform)==null?void 0:r.deps)??[];(m.length!==this.prevTransformArray.length||m.some((w,S)=>w!==this.prevTransformArray[S]))&&((o=this.options.transform)==null||o.fn(this),this.store.state=this.state,this.prevTransformArray=m)}}),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 Fs(e){if(e){if(typeof e=="object"){const t=Fs(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 vo(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 Q0{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=Lf(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=As(n,this.options),s=this.getLinkedFields(n).reduce((c,u)=>{const d=As(n,u.options);return d.forEach(f=>{f.field=u}),c.concat(d)},[]);let a=!1;this.form.store.batch(()=>{const c=(u,d)=>{const f=Pr(d.cause),h=d.validate?Su(u.runValidator({validate:d.validate,value:{value:u.getValue(),validationSource:"field",fieldApi:u},type:"validate"})):r[f];u.state.meta.errorMap[f]!==h&&u.setMeta(p=>({...p,errorMap:{...p.errorMap,[Pr(d.cause)]:h||r[f]}})),(h||r[f])&&(a=!0)};for(const u of o)c(this,u);for(const u of s)u.validate&&c(u.field,u)});const l=Pr("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=Os(n,this.options),i=await r,s=this.getLinkedFields(n),a=s.reduce((f,h)=>{const p=Os(n,h.options);return p.forEach(g=>{g.field=h}),f.concat(p)},[]);this.state.meta.isValidating||this.setMeta(f=>({...f,isValidating:!0}));for(const f of s)f.setMeta(h=>({...h,isValidating:!0}));const l=[],c=[],u=(f,h,p)=>{const g=Pr(h.cause),v=f.getInfo().validationMetaMap[g];v==null||v.lastAbortController.abort();const m=new AbortController;this.getInfo().validationMetaMap[g]={lastAbortController:m},p.push(new Promise(async y=>{var w;let S;try{S=await new Promise((_,T)=>{this.timeoutIds[h.cause]&&clearTimeout(this.timeoutIds[h.cause]),this.timeoutIds[h.cause]=setTimeout(async()=>{if(m.signal.aborted)return _(void 0);try{_(await this.runValidator({validate:h.validate,value:{value:f.getValue(),fieldApi:f,signal:m.signal,validationSource:"field"},type:"validateAsync"}))}catch(K){T(K)}},h.debounceMs)})}catch(_){S=_}if(m.signal.aborted)return y(void 0);const E=Su(S),$=(w=i[this.name])==null?void 0:w[g],F=E||$;f.setMeta(_=>({..._,errorMap:{..._==null?void 0:_.errorMap,[g]:F}})),y(F)}))};for(const f of o)f.validate&&u(this,f,l);for(const f of a)f.validate&&u(f.field,f,c);let d=[];(l.length||c.length)&&(d=await Promise.all(l),await Promise.all(c)),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 l=a[this.name];l&&(o=l)}}catch{}const{hasErrored:s}=this.validateSync(n,o);return s&&!this.options.asyncAlways?((r=this.getInfo().validationMetaMap[Pr(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 _f({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 Su(e){if(e)return typeof e!="string"?"Invalid Form Values":e}function Pr(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 xu(e,t=n=>n){const[n,r]=Xr({value:t(e.state)}),o=e.subscribe(()=>{const i=t(e.state);r("value",$c(i))});return W(()=>{o()}),()=>n.value}function Y0(e){const[t,n]=z(!1),r=L(()=>[t(),e]),o=e.store.subscribe(()=>n(i=>!i));return W(o),()=>r()[1]}function kf(e){const t=e(),n=new Q0(t),r=n;return r.Field=Vf,st(()=>n.update(e())),tr(()=>W(n.mount())),Y0(r)}function Vf(e){const t=kf(()=>{const{children:n,...r}=e;return r});return L(()=>b(()=>e.children(t),{}))}function Z0(e){const t=e==null?void 0:e(),n=new X0(t),r=n;return r.Field=o=>b(Vf,O(o,{form:n})),r.createField=o=>kf(()=>({...o(),form:n})),r.useStore=o=>xu(n.store,o),r.Subscribe=o=>ja(o.children,xu(n.store,o.selector)),tr(n.mount),st(()=>n.update(e==null?void 0:e())),r}var Pi,Cu;function J0(){if(Cu)return Pi;Cu=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 Pi=e,Pi}var Ii,Eu;function Ha(){if(Eu)return Ii;Eu=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Ii=r=>r?typeof r!="object"?e:r:t,Ii}var yo={exports:{}},$i,Ru;function Ga(){if(Ru)return $i;Ru=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,o=t-6;return $i={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},$i}var Mi,Pu;function ei(){if(Pu)return Mi;Pu=1;var e={};return Mi=typeof process=="object"&&e&&e.NODE_DEBUG&&/\bsemver\b/i.test(e.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{},Mi}var Iu;function Ua(){return Iu||(Iu=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:o}=Ga(),i=ei();t=e.exports={};const s=t.re=[],a=t.safeRe=[],l=t.src=[],c=t.safeSrc=[],u=t.t={};let d=0;const f="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",o],[f,r]],p=v=>{for(const[m,y]of h)v=v.split(`${m}*`).join(`${m}{0,${y}}`).split(`${m}+`).join(`${m}{1,${y}}`);return v},g=(v,m,y)=>{const w=p(m),S=d++;i(v,S,m),u[v]=S,l[S]=m,c[S]=w,s[S]=new RegExp(m,y?"g":void 0),a[S]=new RegExp(w,y?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),g("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${l[u.NONNUMERICIDENTIFIER]}|${l[u.NUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NONNUMERICIDENTIFIER]}|${l[u.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${f}+`),g("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),g("FULL",`^${l[u.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),g("LOOSE",`^${l[u.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),g("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),g("COERCE",`${l[u.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",l[u.COERCEPLAIN]+`(?:${l[u.PRERELEASE]})?(?:${l[u.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",l[u.COERCE],!0),g("COERCERTLFULL",l[u.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(yo,yo.exports)),yo.exports}var Oi,$u;function eS(){if($u)return Oi;$u=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 Oi={compareIdentifiers:t,rcompareIdentifiers:(r,o)=>t(o,r)},Oi}var Ai,Mu;function qa(){if(Mu)return Ai;Mu=1;const e=ei(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=Ga(),{safeRe:r,t:o}=Ua(),i=Ha(),{compareIdentifiers:s}=eS();class a{constructor(c,u){if(u=i(u),c instanceof a){if(c.loose===!!u.loose&&c.includePrerelease===!!u.includePrerelease)return c;c=c.version}else if(typeof c!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof c}".`);if(c.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",c,u),this.options=u,this.loose=!!u.loose,this.includePrerelease=!!u.includePrerelease;const d=c.trim().match(u.loose?r[o.LOOSE]:r[o.FULL]);if(!d)throw new TypeError(`Invalid Version: ${c}`);if(this.raw=c,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(c){if(e("SemVer.compare",this.version,this.options,c),!(c instanceof a)){if(typeof c=="string"&&c===this.version)return 0;c=new a(c,this.options)}return c.version===this.version?0:this.compareMain(c)||this.comparePre(c)}compareMain(c){return c instanceof a||(c=new a(c,this.options)),s(this.major,c.major)||s(this.minor,c.minor)||s(this.patch,c.patch)}comparePre(c){if(c instanceof a||(c=new a(c,this.options)),this.prerelease.length&&!c.prerelease.length)return-1;if(!this.prerelease.length&&c.prerelease.length)return 1;if(!this.prerelease.length&&!c.prerelease.length)return 0;let u=0;do{const d=this.prerelease[u],f=c.prerelease[u];if(e("prerelease compare",u,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(++u)}compareBuild(c){c instanceof a||(c=new a(c,this.options));let u=0;do{const d=this.build[u],f=c.build[u];if(e("build compare",u,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(++u)}inc(c,u,d){if(c.startsWith("pre")){if(!u&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(u){const f=`-${u}`.match(this.options.loose?r[o.PRERELEASELOOSE]:r[o.PRERELEASE]);if(!f||f[1]!==u)throw new Error(`invalid identifier: ${u}`)}}switch(c){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",u,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",u,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",u,d),this.inc("pre",u,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",u,d),this.inc("pre",u,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 f=Number(d)?1:0;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(u===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(f)}}if(u){let h=[u,f];d===!1&&(h=[u]),s(this.prerelease[0],u)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${c}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Ai=a,Ai}var Fi,Ou;function vr(){if(Ou)return Fi;Ou=1;const e=qa();return Fi=(n,r,o)=>new e(n,o).compare(new e(r,o)),Fi}var Ti,Au;function tS(){if(Au)return Ti;Au=1;const e=vr();return Ti=(n,r,o)=>e(n,r,o)===0,Ti}var Di,Fu;function nS(){if(Fu)return Di;Fu=1;const e=vr();return Di=(n,r,o)=>e(n,r,o)!==0,Di}var _i,Tu;function rS(){if(Tu)return _i;Tu=1;const e=vr();return _i=(n,r,o)=>e(n,r,o)>0,_i}var Li,Du;function oS(){if(Du)return Li;Du=1;const e=vr();return Li=(n,r,o)=>e(n,r,o)>=0,Li}var ki,_u;function iS(){if(_u)return ki;_u=1;const e=vr();return ki=(n,r,o)=>e(n,r,o)<0,ki}var Vi,Lu;function sS(){if(Lu)return Vi;Lu=1;const e=vr();return Vi=(n,r,o)=>e(n,r,o)<=0,Vi}var Ni,ku;function aS(){if(ku)return Ni;ku=1;const e=tS(),t=nS(),n=rS(),r=oS(),o=iS(),i=sS();return Ni=(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}`)}},Ni}var Ki,Vu;function lS(){if(Vu)return Ki;Vu=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(u,d){if(d=n(d),u instanceof t){if(u.loose===!!d.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),s("comparator",u,d),this.options=d,this.loose=!!d.loose,this.parse(u),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(u){const d=this.options.loose?r[o.COMPARATORLOOSE]:r[o.COMPARATOR],f=u.match(d);if(!f)throw new TypeError(`Invalid comparator: ${u}`);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(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,d){if(!(u instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(u.value,d).test(this.value):u.operator===""?u.value===""?!0:new l(this.value,d).test(u.semver):(d=n(d),d.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!d.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,d)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||i(this.semver,">",u.semver,d)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}Ki=t;const n=Ha(),{safeRe:r,t:o}=Ua(),i=aS(),s=ei(),a=qa(),l=Nf();return Ki}var zi,Nu;function Nf(){if(Nu)return zi;Nu=1;const e=/\s+/g;class t{constructor(R,x){if(x=o(x),R instanceof t)return R.loose===!!x.loose&&R.includePrerelease===!!x.includePrerelease?R:new t(R.raw,x);if(R instanceof i)return this.raw=R.value,this.set=[[R]],this.formatted=void 0,this;if(this.options=x,this.loose=!!x.loose,this.includePrerelease=!!x.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=>!g(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 x=this.set[R];for(let I=0;I<x.length;I++)I>0&&(this.formatted+=" "),this.formatted+=x[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&&p))+":"+R,M=r.get(I);if(M)return M;const A=this.options.loose,V=A?l[c.HYPHENRANGELOOSE]:l[c.HYPHENRANGE];R=R.replace(V,j(this.options.includePrerelease)),s("hyphen replace",R),R=R.replace(l[c.COMPARATORTRIM],u),s("comparator trim",R),R=R.replace(l[c.TILDETRIM],d),s("tilde trim",R),R=R.replace(l[c.CARETTRIM],f),s("caret trim",R);let B=R.split(" ").map(se=>y(se,this.options)).join(" ").split(/\s+/).map(se=>N(se,this.options));A&&(B=B.filter(se=>(s("loose invalid filter",se,this.options),!!se.match(l[c.COMPARATORLOOSE])))),s("range list",B);const U=new Map,Z=B.map(se=>new i(se,this.options));for(const se of Z){if(g(se))return[se];U.set(se.value,se)}U.size>1&&U.has("")&&U.delete("");const fe=[...U.values()];return r.set(I,fe),fe}intersects(R,x){if(!(R instanceof t))throw new TypeError("a Range is required");return this.set.some(I=>m(I,x)&&R.set.some(M=>m(M,x)&&I.every(A=>M.every(V=>A.intersects(V,x)))))}test(R){if(!R)return!1;if(typeof R=="string")try{R=new a(R,this.options)}catch{return!1}for(let x=0;x<this.set.length;x++)if(oe(this.set[x],R,this.options))return!0;return!1}}zi=t;const n=J0(),r=new n,o=Ha(),i=lS(),s=ei(),a=qa(),{safeRe:l,t:c,comparatorTrimReplace:u,tildeTrimReplace:d,caretTrimReplace:f}=Ua(),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:p}=Ga(),g=P=>P.value==="<0.0.0-0",v=P=>P.value==="",m=(P,R)=>{let x=!0;const I=P.slice();let M=I.pop();for(;x&&I.length;)x=I.every(A=>M.intersects(A,R)),M=I.pop();return x},y=(P,R)=>(s("comp",P,R),P=$(P,R),s("caret",P),P=S(P,R),s("tildes",P),P=_(P,R),s("xrange",P),P=K(P,R),s("stars",P),P),w=P=>!P||P.toLowerCase()==="x"||P==="*",S=(P,R)=>P.trim().split(/\s+/).map(x=>E(x,R)).join(" "),E=(P,R)=>{const x=R.loose?l[c.TILDELOOSE]:l[c.TILDE];return P.replace(x,(I,M,A,V,B)=>{s("tilde",P,I,M,A,V,B);let U;return w(M)?U="":w(A)?U=`>=${M}.0.0 <${+M+1}.0.0-0`:w(V)?U=`>=${M}.${A}.0 <${M}.${+A+1}.0-0`:B?(s("replaceTilde pr",B),U=`>=${M}.${A}.${V}-${B} <${M}.${+A+1}.0-0`):U=`>=${M}.${A}.${V} <${M}.${+A+1}.0-0`,s("tilde return",U),U})},$=(P,R)=>P.trim().split(/\s+/).map(x=>F(x,R)).join(" "),F=(P,R)=>{s("caret",P,R);const x=R.loose?l[c.CARETLOOSE]:l[c.CARET],I=R.includePrerelease?"-0":"";return P.replace(x,(M,A,V,B,U)=>{s("caret",P,M,A,V,B,U);let Z;return w(A)?Z="":w(V)?Z=`>=${A}.0.0${I} <${+A+1}.0.0-0`:w(B)?A==="0"?Z=`>=${A}.${V}.0${I} <${A}.${+V+1}.0-0`:Z=`>=${A}.${V}.0${I} <${+A+1}.0.0-0`:U?(s("replaceCaret pr",U),A==="0"?V==="0"?Z=`>=${A}.${V}.${B}-${U} <${A}.${V}.${+B+1}-0`:Z=`>=${A}.${V}.${B}-${U} <${A}.${+V+1}.0-0`:Z=`>=${A}.${V}.${B}-${U} <${+A+1}.0.0-0`):(s("no pr"),A==="0"?V==="0"?Z=`>=${A}.${V}.${B}${I} <${A}.${V}.${+B+1}-0`:Z=`>=${A}.${V}.${B}${I} <${A}.${+V+1}.0-0`:Z=`>=${A}.${V}.${B} <${+A+1}.0.0-0`),s("caret return",Z),Z})},_=(P,R)=>(s("replaceXRanges",P,R),P.split(/\s+/).map(x=>T(x,R)).join(" ")),T=(P,R)=>{P=P.trim();const x=R.loose?l[c.XRANGELOOSE]:l[c.XRANGE];return P.replace(x,(I,M,A,V,B,U)=>{s("xRange",P,I,M,A,V,B,U);const Z=w(A),fe=Z||w(V),se=fe||w(B),Fe=se;return M==="="&&Fe&&(M=""),U=R.includePrerelease?"-0":"",Z?M===">"||M==="<"?I="<0.0.0-0":I="*":M&&Fe?(fe&&(V=0),B=0,M===">"?(M=">=",fe?(A=+A+1,V=0,B=0):(V=+V+1,B=0)):M==="<="&&(M="<",fe?A=+A+1:V=+V+1),M==="<"&&(U="-0"),I=`${M+A}.${V}.${B}${U}`):fe?I=`>=${A}.0.0${U} <${+A+1}.0.0-0`:se&&(I=`>=${A}.${V}.0${U} <${A}.${+V+1}.0-0`),s("xRange return",I),I})},K=(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],"")),j=P=>(R,x,I,M,A,V,B,U,Z,fe,se,Fe)=>(w(I)?x="":w(M)?x=`>=${I}.0.0${P?"-0":""}`:w(A)?x=`>=${I}.${M}.0${P?"-0":""}`:V?x=`>=${x}`:x=`>=${x}${P?"-0":""}`,w(Z)?U="":w(fe)?U=`<${+Z+1}.0.0-0`:w(se)?U=`<${Z}.${+fe+1}.0-0`:Fe?U=`<=${Z}.${fe}.${se}-${Fe}`:P?U=`<${Z}.${fe}.${+se+1}-0`:U=`<=${U}`,`${x} ${U}`.trim()),oe=(P,R,x)=>{for(let I=0;I<P.length;I++)if(!P[I].test(R))return!1;if(R.prerelease.length&&!x.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 zi}var ji,Ku;function uS(){if(Ku)return ji;Ku=1;const e=Nf();return ji=(n,r)=>{try{return new e(n,r).range||"*"}catch{return null}},ji}var cS=uS();const zu=Td(cS);var dS=te('<div class="h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent">'),fS=te('<div class="flex gap-2 justify-end mt-4">'),hS=te('<div class="mt-auto pt-4 flex justify-end">'),ju=te("<div>"),gS=te('<div class="text-sm text-muted-foreground flex flex-row items-center">Platform: <p class="ml-2 flex flex-row items-center"> iOS'),pS=te('<div class="text-sm text-muted-foreground flex flex-row items-center">Platform: <p class="ml-2 flex flex-row items-center"> Android'),mS=te('<form class="flex flex-col gap-3 flex-1"><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="mt-2 space-y-1"><h3 class="text-md text-bold font-medium">Metadata'),vS=te('<em class="text-xs text-red-500">'),yS=te('<em class="text-xs text-muted-foreground">'),wS=te('<div class="text-sm text-muted-foreground flex flex-row items-center">App Version: <p class=ml-2>'),bS=te('<div class="text-sm text-muted-foreground flex flex-row items-center">Commit Hash: '),SS=te("<a target=_blank rel=noreferrer class=ml-2>"),xS=te("<p class=ml-2>");const CS=({bundleId:e,onClose:t})=>{const n=d0(e),r=g0(),o=()=>{r.mutate(e,{onSuccess:()=>{t()},onError:i=>{console.error("Failed to delete bundle:",i),ms({title:"Error",description:"Failed to delete bundle. Please try again.",variant:"error"})}})};return b(av,{class:"flex flex-col h-full",get children(){return[b(lv,{class:"mb-4",get children(){return b(uv,{get children(){return["Edit ",e]}})}}),b(ge,{get when(){return n.data},get fallback(){return L(()=>!!n.isFetched)()?b(cv,{get children(){return["No update bundle found for bundle id ",e]}}):b(A0,{height:374,radius:10})},children:i=>b(ES,{get bundle(){return i()},onEditSuccess:t})}),(()=>{var i=hS();return X(i,b(C0,{get children(){return[b(E0,{as:Dr,variant:"destructive",size:"sm",class:"gap-2",get children(){return[b(Jl,{class:"h-4 w-4"}),"Delete Bundle"]}}),b(xf,{}),b(P0,{get children(){return[b(I0,{children:"Delete Bundle"}),b($0,{children:"Are you sure you want to delete this bundle storage? This action cannot be undone."}),(()=>{var s=fS();return X(s,b(Rn,{as:Dr,variant:"outline",size:"sm",children:"Cancel"}),null),X(s,b(Dr,{variant:"destructive",size:"sm",onClick:o,get disabled(){return r.isPending},class:"gap-2",get children(){return[b(ge,{get when(){return r.isPending},get fallback(){return b(Jl,{class:"h-4 w-4"})},get children(){return dS()}}),L(()=>r.isPending?"Deleting...":"Delete")]}}),null),s})()]}})]}})),i})()]}})},ES=({bundle:e,onEditSuccess:t})=>{const n=Lo(),r=f0(),[o,i]=z(!1),s=L(()=>{var u,d;return((d=(u=r.data)==null?void 0:u.console)==null?void 0:d.gitUrl)??null}),a=L(()=>e.gitCommitHash),l=Z0(()=>({defaultValues:{message:e.message,targetAppVersion:e.targetAppVersion,enabled:e.enabled,shouldForceUpdate:e.shouldForceUpdate},onSubmit:async({value:u})=>{i(!0);try{const d=await pr.bundles[":bundleId"].$patch({param:{bundleId:e.id},json:u});if(d.status!==200){const f=await d.json();ms({title:"Error",description:f.error,variant:"error"})}}catch(d){d instanceof Error&&ms({title:"Error",description:d.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=mS(),d=u.firstChild,f=d.nextSibling,h=f.firstChild,p=f.nextSibling,g=p.firstChild,v=p.nextSibling;return v.firstChild,u.addEventListener("submit",m=>{m.preventDefault(),m.stopPropagation(),l.handleSubmit()}),X(d,b(Si,{class:"grid w-full max-w-sm items-center gap-1.5",get children(){return[b(Ci,{for:"message",children:"Message"}),b(l.Field,{name:"message",children:m=>b(xi,{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)})})]}})),X(u,b(ge,{get when(){return e.targetAppVersion},get children(){var m=ju();return X(m,b(Si,{class:"grid w-full max-w-sm items-center gap-1.5",get children(){return[b(Ci,{for:"targetAppVersion",children:"Target App Version"}),b(l.Field,{name:"targetAppVersion",validators:{onChange:({value:y})=>{if((y==null?void 0:y.length)===0||!zu(y))return"Invalid target app version"}},children:y=>[b(xi,{type:"text",id:"targetAppVersion",get class(){return ue(y().state.meta.errors.length>0&&"border-red-500 focus-visible:ring-red-500")},placeholder:"Target App Version",get name(){return y().name},get value(){return y().state.value??""},get onBlur(){return y().handleBlur},onInput:w=>y().handleChange(w.currentTarget.value)}),L(()=>L(()=>y().state.meta.errors.length>0)()?(()=>{var w=vS();return X(w,()=>y().state.meta.errors.join(", ")),w})():(()=>{var w=yS();return X(w,()=>zu(y().state.value)),w})())]})]}})),m}}),f),X(u,b(ge,{get when(){return e.fingerprintHash},get children(){var m=ju();return X(m,b(Si,{class:"grid w-full max-w-sm items-center gap-1.5",get children(){return[b(Ci,{for:"fingerprintHash",children:"Fingerprint Hash"}),b(xi,{type:"text",id:"fingerprintHash",get value(){return e.fingerprintHash??""},disabled:!0})]}})),m}}),f),X(h,b(l.Field,{name:"enabled",children:m=>b(vu,{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(yu,{get children(){return b(wu,{})}}),b(bu,{children:"Enabled"})]}})})),X(g,b(l.Field,{name:"shouldForceUpdate",children:m=>b(vu,{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(yu,{get children(){return b(wu,{})}}),b(bu,{children:"Force Update"})]}})})),X(u,b(ge,{get when(){return!o()},get fallback(){return b(Dr,{type:"submit",class:"mt-4",disabled:!0,get children(){return b(_y,{class:"animate-spin"})}})},get children(){return b(Dr,{type:"submit",class:"mt-4",get disabled(){return!c()},children:"Save"})}}),v),X(v,b(ge,{get when(){return e.platform==="ios"},get children(){var m=gS(),y=m.firstChild,w=y.nextSibling,S=w.firstChild;return X(w,b(bd,{class:"inline-block"}),S),m}}),null),X(v,b(ge,{get when(){return e.platform==="android"},get children(){var m=pS(),y=m.firstChild,w=y.nextSibling,S=w.firstChild;return X(w,b(wd,{class:"inline-block"}),S),m}}),null),X(v,b(ge,{get when(){var m;return(m=e.metadata)==null?void 0:m.app_version},children:m=>(()=>{var y=wS(),w=y.firstChild,S=w.nextSibling;return X(S,m),y})()}),null),X(v,b(ge,{get when(){return a()},children:m=>(()=>{var y=bS();return y.firstChild,X(y,(()=>{var w=L(()=>!!s());return()=>w()?(()=>{var S=SS();return X(S,()=>m().slice(0,8)),ze(()=>Yn(S,"href",`${s()}/commit/${m}`)),S})():(()=>{var S=xS();return X(S,()=>m().slice(0,8)),S})()})(),null),y})()}),null),u})()};function RS(){const{bundleIdFilter:e,setBundleIdFilter:t}=vd(),n=L(()=>e()!==null),r=()=>{t(null)};return b(nv,{get open(){return n()},onOpenChange:o=>{o||t(null)},get children(){return[b(y0,{columns:Uy,onRowClick:o=>{t(o.id)}}),b(ge,{get when(){return e()},get children(){return b(oh,{get children(){return b(CS,{get bundleId(){return e()},onClose:r})}})}})]}})}const PS=new Vg;function IS(){return b(Ng,{client:PS,get children(){return[b(ug,{root:e=>b(Oh,{get children(){return[b(Th,{children:"HotUpdater Console"}),b(mg,{get children(){return e.children}})]}}),get children(){return b(ng,{path:"/",component:RS})}}),b(Dm,{})]}})}const Bu=document.getElementById("root");Bu&&ph(()=>b(IS,{}),Bu);