@commandkit/devtools 1.2.0-dev.20260302005919 → 1.2.0-dev.20260302104221
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.
- package/LICENSE +21 -0
- package/package.json +4 -4
- package/ui/assets/{commands-Cof2eLB0.js → commands-qU7AMiq3.js} +1 -1
- package/ui/assets/{events-D8j5RlvU.js → events-CP5YTD8j.js} +1 -1
- package/ui/assets/{feature-flags-D9HnT4_P.js → feature-flags-DtTJqVGy.js} +1 -1
- package/ui/assets/{guilds-C8C2yqBX.js → guilds-DpjA4ejz.js} +1 -1
- package/ui/assets/{index-Ctjq1-je.js → index-MQlxaR0w.js} +1 -1
- package/ui/assets/index-dwRFzfPU.css +1 -0
- package/ui/assets/{index-DSl_X0am.js → index-o7tU8EM7.js} +1 -1
- package/ui/assets/{plugins-DT6C7FH7.js → plugins-Da1IKaVI.js} +1 -1
- package/ui/index.html +2 -2
- package/LICENSE.md +0 -684
- package/ui/assets/index-Pr_4qNno.css +0 -1
|
@@ -56,4 +56,4 @@ For more information, see https://radix-ui.com/primitives/docs/components/${a.do
|
|
|
56
56
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(a){return a instanceof this?a:new this(a)}static concat(a,...i){const o=new this(a);return i.forEach(l=>o.set(l)),o}static accessor(a){const o=(this[u0]=this[u0]={accessors:{}}).accessors,l=this.prototype;function u(d){const h=$o(d);o[h]||(CM(l,d),o[h]=!0)}return G.isArray(a)?a.forEach(u):u(a),this}};Ve.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);G.reduceDescriptors(Ve.prototype,({value:e},a)=>{let i=a[0].toUpperCase()+a.slice(1);return{get:()=>e,set(o){this[i]=o}}});G.freezeMethods(Ve);function _d(e,a){const i=this||vs,o=a||i,l=Ve.from(o.headers);let u=o.data;return G.forEach(e,function(h){u=h.call(i,u,l.normalize(),a?a.status:void 0)}),l.normalize(),u}function i1(e){return!!(e&&e.__CANCEL__)}let ys=class extends yt{constructor(a,i,o){super(a??"canceled",yt.ERR_CANCELED,i,o),this.name="CanceledError",this.__CANCEL__=!0}};function o1(e,a,i){const o=i.config.validateStatus;!i.status||!o||o(i.status)?e(i):a(new yt("Request failed with status code "+i.status,[yt.ERR_BAD_REQUEST,yt.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function TM(e){const a=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return a&&a[1]||""}function AM(e,a){e=e||10;const i=new Array(e),o=new Array(e);let l=0,u=0,d;return a=a!==void 0?a:1e3,function(p){const m=Date.now(),v=o[u];d||(d=m),i[l]=p,o[l]=m;let g=u,b=0;for(;g!==l;)b+=i[g++],g=g%e;if(l=(l+1)%e,l===u&&(u=(u+1)%e),m-d<a)return;const x=v&&m-v;return x?Math.round(b*1e3/x):void 0}}function OM(e,a){let i=0,o=1e3/a,l,u;const d=(m,v=Date.now())=>{i=v,l=null,u&&(clearTimeout(u),u=null),e(...m)};return[(...m)=>{const v=Date.now(),g=v-i;g>=o?d(m,v):(l=m,u||(u=setTimeout(()=>{u=null,d(l)},o-g)))},()=>l&&d(l)]}const gu=(e,a,i=3)=>{let o=0;const l=AM(50,250);return OM(u=>{const d=u.loaded,h=u.lengthComputable?u.total:void 0,p=d-o,m=l(p),v=d<=h;o=d;const g={loaded:d,total:h,progress:h?d/h:void 0,bytes:p,rate:m||void 0,estimated:m&&h&&v?(h-d)/m:void 0,event:u,lengthComputable:h!=null,[a?"download":"upload"]:!0};e(g)},i)},c0=(e,a)=>{const i=e!=null;return[o=>a[0]({lengthComputable:i,total:e,loaded:o}),a[1]]},f0=e=>(...a)=>G.asap(()=>e(...a)),MM=Ee.hasStandardBrowserEnv?((e,a)=>i=>(i=new URL(i,Ee.origin),e.protocol===i.protocol&&e.host===i.host&&(a||e.port===i.port)))(new URL(Ee.origin),Ee.navigator&&/(msie|trident)/i.test(Ee.navigator.userAgent)):()=>!0,NM=Ee.hasStandardBrowserEnv?{write(e,a,i,o,l,u,d){if(typeof document>"u")return;const h=[`${e}=${encodeURIComponent(a)}`];G.isNumber(i)&&h.push(`expires=${new Date(i).toUTCString()}`),G.isString(o)&&h.push(`path=${o}`),G.isString(l)&&h.push(`domain=${l}`),u===!0&&h.push("secure"),G.isString(d)&&h.push(`SameSite=${d}`),document.cookie=h.join("; ")},read(e){if(typeof document>"u")return null;const a=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return a?decodeURIComponent(a[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function DM(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function zM(e,a){return a?e.replace(/\/?\/$/,"")+"/"+a.replace(/^\/+/,""):e}function s1(e,a,i){let o=!DM(a);return e&&(o||i==!1)?zM(e,a):a}const d0=e=>e instanceof Ve?{...e}:e;function zr(e,a){a=a||{};const i={};function o(m,v,g,b){return G.isPlainObject(m)&&G.isPlainObject(v)?G.merge.call({caseless:b},m,v):G.isPlainObject(v)?G.merge({},v):G.isArray(v)?v.slice():v}function l(m,v,g,b){if(G.isUndefined(v)){if(!G.isUndefined(m))return o(void 0,m,g,b)}else return o(m,v,g,b)}function u(m,v){if(!G.isUndefined(v))return o(void 0,v)}function d(m,v){if(G.isUndefined(v)){if(!G.isUndefined(m))return o(void 0,m)}else return o(void 0,v)}function h(m,v,g){if(g in a)return o(m,v);if(g in e)return o(void 0,m)}const p={url:u,method:u,data:u,baseURL:d,transformRequest:d,transformResponse:d,paramsSerializer:d,timeout:d,timeoutMessage:d,withCredentials:d,withXSRFToken:d,adapter:d,responseType:d,xsrfCookieName:d,xsrfHeaderName:d,onUploadProgress:d,onDownloadProgress:d,decompress:d,maxContentLength:d,maxBodyLength:d,beforeRedirect:d,transport:d,httpAgent:d,httpsAgent:d,cancelToken:d,socketPath:d,responseEncoding:d,validateStatus:h,headers:(m,v,g)=>l(d0(m),d0(v),g,!0)};return G.forEach(Object.keys({...e,...a}),function(v){if(v==="__proto__"||v==="constructor"||v==="prototype")return;const g=G.hasOwnProp(p,v)?p[v]:l,b=g(e[v],a[v],v);G.isUndefined(b)&&g!==h||(i[v]=b)}),i}const l1=e=>{const a=zr({},e);let{data:i,withXSRFToken:o,xsrfHeaderName:l,xsrfCookieName:u,headers:d,auth:h}=a;if(a.headers=d=Ve.from(d),a.url=a1(s1(a.baseURL,a.url,a.allowAbsoluteUrls),e.params,e.paramsSerializer),h&&d.set("Authorization","Basic "+btoa((h.username||"")+":"+(h.password?unescape(encodeURIComponent(h.password)):""))),G.isFormData(i)){if(Ee.hasStandardBrowserEnv||Ee.hasStandardBrowserWebWorkerEnv)d.setContentType(void 0);else if(G.isFunction(i.getHeaders)){const p=i.getHeaders(),m=["content-type","content-length"];Object.entries(p).forEach(([v,g])=>{m.includes(v.toLowerCase())&&d.set(v,g)})}}if(Ee.hasStandardBrowserEnv&&(o&&G.isFunction(o)&&(o=o(a)),o||o!==!1&&MM(a.url))){const p=l&&u&&NM.read(u);p&&d.set(l,p)}return a},LM=typeof XMLHttpRequest<"u",jM=LM&&function(e){return new Promise(function(i,o){const l=l1(e);let u=l.data;const d=Ve.from(l.headers).normalize();let{responseType:h,onUploadProgress:p,onDownloadProgress:m}=l,v,g,b,x,S;function w(){x&&x(),S&&S(),l.cancelToken&&l.cancelToken.unsubscribe(v),l.signal&&l.signal.removeEventListener("abort",v)}let C=new XMLHttpRequest;C.open(l.method.toUpperCase(),l.url,!0),C.timeout=l.timeout;function T(){if(!C)return;const D=Ve.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),B={data:!h||h==="text"||h==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:D,config:e,request:C};o1(function(j){i(j),w()},function(j){o(j),w()},B),C=null}"onloadend"in C?C.onloadend=T:C.onreadystatechange=function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(T)},C.onabort=function(){C&&(o(new yt("Request aborted",yt.ECONNABORTED,e,C)),C=null)},C.onerror=function(U){const B=U&&U.message?U.message:"Network Error",K=new yt(B,yt.ERR_NETWORK,e,C);K.event=U||null,o(K),C=null},C.ontimeout=function(){let U=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded";const B=l.transitional||Vh;l.timeoutErrorMessage&&(U=l.timeoutErrorMessage),o(new yt(U,B.clarifyTimeoutError?yt.ETIMEDOUT:yt.ECONNABORTED,e,C)),C=null},u===void 0&&d.setContentType(null),"setRequestHeader"in C&&G.forEach(d.toJSON(),function(U,B){C.setRequestHeader(B,U)}),G.isUndefined(l.withCredentials)||(C.withCredentials=!!l.withCredentials),h&&h!=="json"&&(C.responseType=l.responseType),m&&([b,S]=gu(m,!0),C.addEventListener("progress",b)),p&&C.upload&&([g,x]=gu(p),C.upload.addEventListener("progress",g),C.upload.addEventListener("loadend",x)),(l.cancelToken||l.signal)&&(v=D=>{C&&(o(!D||D.type?new ys(null,e,C):D),C.abort(),C=null)},l.cancelToken&&l.cancelToken.subscribe(v),l.signal&&(l.signal.aborted?v():l.signal.addEventListener("abort",v)));const z=TM(l.url);if(z&&Ee.protocols.indexOf(z)===-1){o(new yt("Unsupported protocol "+z+":",yt.ERR_BAD_REQUEST,e));return}C.send(u||null)})},UM=(e,a)=>{const{length:i}=e=e?e.filter(Boolean):[];if(a||i){let o=new AbortController,l;const u=function(m){if(!l){l=!0,h();const v=m instanceof Error?m:this.reason;o.abort(v instanceof yt?v:new ys(v instanceof Error?v.message:v))}};let d=a&&setTimeout(()=>{d=null,u(new yt(`timeout of ${a}ms exceeded`,yt.ETIMEDOUT))},a);const h=()=>{e&&(d&&clearTimeout(d),d=null,e.forEach(m=>{m.unsubscribe?m.unsubscribe(u):m.removeEventListener("abort",u)}),e=null)};e.forEach(m=>m.addEventListener("abort",u));const{signal:p}=o;return p.unsubscribe=()=>G.asap(h),p}},BM=function*(e,a){let i=e.byteLength;if(i<a){yield e;return}let o=0,l;for(;o<i;)l=o+a,yield e.slice(o,l),o=l},kM=async function*(e,a){for await(const i of PM(e))yield*BM(i,a)},PM=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const a=e.getReader();try{for(;;){const{done:i,value:o}=await a.read();if(i)break;yield o}}finally{await a.cancel()}},h0=(e,a,i,o)=>{const l=kM(e,a);let u=0,d,h=p=>{d||(d=!0,o&&o(p))};return new ReadableStream({async pull(p){try{const{done:m,value:v}=await l.next();if(m){h(),p.close();return}let g=v.byteLength;if(i){let b=u+=g;i(b)}p.enqueue(new Uint8Array(v))}catch(m){throw h(m),m}},cancel(p){return h(p),l.return()}},{highWaterMark:2})},m0=64*1024,{isFunction:Ql}=G,HM=(({Request:e,Response:a})=>({Request:e,Response:a}))(G.global),{ReadableStream:p0,TextEncoder:g0}=G.global,v0=(e,...a)=>{try{return!!e(...a)}catch{return!1}},qM=e=>{e=G.merge.call({skipUndefined:!0},HM,e);const{fetch:a,Request:i,Response:o}=e,l=a?Ql(a):typeof fetch=="function",u=Ql(i),d=Ql(o);if(!l)return!1;const h=l&&Ql(p0),p=l&&(typeof g0=="function"?(S=>w=>S.encode(w))(new g0):async S=>new Uint8Array(await new i(S).arrayBuffer())),m=u&&h&&v0(()=>{let S=!1;const w=new i(Ee.origin,{body:new p0,method:"POST",get duplex(){return S=!0,"half"}}).headers.has("Content-Type");return S&&!w}),v=d&&h&&v0(()=>G.isReadableStream(new o("").body)),g={stream:v&&(S=>S.body)};l&&["text","arrayBuffer","blob","formData","stream"].forEach(S=>{!g[S]&&(g[S]=(w,C)=>{let T=w&&w[S];if(T)return T.call(w);throw new yt(`Response type '${S}' is not supported`,yt.ERR_NOT_SUPPORT,C)})});const b=async S=>{if(S==null)return 0;if(G.isBlob(S))return S.size;if(G.isSpecCompliantForm(S))return(await new i(Ee.origin,{method:"POST",body:S}).arrayBuffer()).byteLength;if(G.isArrayBufferView(S)||G.isArrayBuffer(S))return S.byteLength;if(G.isURLSearchParams(S)&&(S=S+""),G.isString(S))return(await p(S)).byteLength},x=async(S,w)=>{const C=G.toFiniteNumber(S.getContentLength());return C??b(w)};return async S=>{let{url:w,method:C,data:T,signal:z,cancelToken:D,timeout:U,onDownloadProgress:B,onUploadProgress:K,responseType:j,headers:V,withCredentials:et="same-origin",fetchOptions:J}=l1(S),at=a||fetch;j=j?(j+"").toLowerCase():"text";let rt=UM([z,D&&D.toAbortSignal()],U),ht=null;const st=rt&&rt.unsubscribe&&(()=>{rt.unsubscribe()});let bt;try{if(K&&m&&C!=="get"&&C!=="head"&&(bt=await x(V,T))!==0){let O=new i(w,{method:"POST",body:T,duplex:"half"}),Y;if(G.isFormData(T)&&(Y=O.headers.get("content-type"))&&V.setContentType(Y),O.body){const[Q,W]=c0(bt,gu(f0(K)));T=h0(O.body,m0,Q,W)}}G.isString(et)||(et=et?"include":"omit");const M=u&&"credentials"in i.prototype,X={...J,signal:rt,method:C.toUpperCase(),headers:V.normalize().toJSON(),body:T,duplex:"half",credentials:M?et:void 0};ht=u&&new i(w,X);let H=await(u?at(ht,J):at(w,X));const ft=v&&(j==="stream"||j==="response");if(v&&(B||ft&&st)){const O={};["status","statusText","headers"].forEach(nt=>{O[nt]=H[nt]});const Y=G.toFiniteNumber(H.headers.get("content-length")),[Q,W]=B&&c0(Y,gu(f0(B),!0))||[];H=new o(h0(H.body,m0,Q,()=>{W&&W(),st&&st()}),O)}j=j||"text";let mt=await g[G.findKey(g,j)||"text"](H,S);return!ft&&st&&st(),await new Promise((O,Y)=>{o1(O,Y,{data:mt,headers:Ve.from(H.headers),status:H.status,statusText:H.statusText,config:S,request:ht})})}catch(M){throw st&&st(),M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new yt("Network Error",yt.ERR_NETWORK,S,ht,M&&M.response),{cause:M.cause||M}):yt.from(M,M&&M.code,S,ht,M&&M.response)}}},VM=new Map,u1=e=>{let a=e&&e.env||{};const{fetch:i,Request:o,Response:l}=a,u=[o,l,i];let d=u.length,h=d,p,m,v=VM;for(;h--;)p=u[h],m=v.get(p),m===void 0&&v.set(p,m=h?new Map:qM(a)),v=m;return m};u1();const Fh={http:iM,xhr:jM,fetch:{get:u1}};G.forEach(Fh,(e,a)=>{if(e){try{Object.defineProperty(e,"name",{value:a})}catch{}Object.defineProperty(e,"adapterName",{value:a})}});const y0=e=>`- ${e}`,GM=e=>G.isFunction(e)||e===null||e===!1;function FM(e,a){e=G.isArray(e)?e:[e];const{length:i}=e;let o,l;const u={};for(let d=0;d<i;d++){o=e[d];let h;if(l=o,!GM(o)&&(l=Fh[(h=String(o)).toLowerCase()],l===void 0))throw new yt(`Unknown adapter '${h}'`);if(l&&(G.isFunction(l)||(l=l.get(a))))break;u[h||"#"+d]=l}if(!l){const d=Object.entries(u).map(([p,m])=>`adapter ${p} `+(m===!1?"is not supported by the environment":"is not available in the build"));let h=i?d.length>1?`since :
|
|
57
57
|
`+d.map(y0).join(`
|
|
58
58
|
`):" "+y0(d[0]):"as no adapter specified";throw new yt("There is no suitable adapter to dispatch the request "+h,"ERR_NOT_SUPPORT")}return l}const c1={getAdapter:FM,adapters:Fh};function Cd(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ys(null,e)}function b0(e){return Cd(e),e.headers=Ve.from(e.headers),e.data=_d.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),c1.getAdapter(e.adapter||vs.adapter,e)(e).then(function(o){return Cd(e),o.data=_d.call(e,e.transformResponse,o),o.headers=Ve.from(o.headers),o},function(o){return i1(o)||(Cd(e),o&&o.response&&(o.response.data=_d.call(e,e.transformResponse,o.response),o.response.headers=Ve.from(o.response.headers))),Promise.reject(o)})}const f1="1.13.6",ju={};["object","boolean","number","function","string","symbol"].forEach((e,a)=>{ju[e]=function(o){return typeof o===e||"a"+(a<1?"n ":" ")+e}});const S0={};ju.transitional=function(a,i,o){function l(u,d){return"[Axios v"+f1+"] Transitional option '"+u+"'"+d+(o?". "+o:"")}return(u,d,h)=>{if(a===!1)throw new yt(l(d," has been removed"+(i?" in "+i:"")),yt.ERR_DEPRECATED);return i&&!S0[d]&&(S0[d]=!0,console.warn(l(d," has been deprecated since v"+i+" and will be removed in the near future"))),a?a(u,d,h):!0}};ju.spelling=function(a){return(i,o)=>(console.warn(`${o} is likely a misspelling of ${a}`),!0)};function YM(e,a,i){if(typeof e!="object")throw new yt("options must be an object",yt.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let l=o.length;for(;l-- >0;){const u=o[l],d=a[u];if(d){const h=e[u],p=h===void 0||d(h,u,e);if(p!==!0)throw new yt("option "+u+" must be "+p,yt.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new yt("Unknown option "+u,yt.ERR_BAD_OPTION)}}const nu={assertOptions:YM,validators:ju},un=nu.validators;let Tr=class{constructor(a){this.defaults=a||{},this.interceptors={request:new l0,response:new l0}}async request(a,i){try{return await this._request(a,i)}catch(o){if(o instanceof Error){let l={};Error.captureStackTrace?Error.captureStackTrace(l):l=new Error;const u=l.stack?l.stack.replace(/^.+\n/,""):"";try{o.stack?u&&!String(o.stack).endsWith(u.replace(/^.+\n.+\n/,""))&&(o.stack+=`
|
|
59
|
-
`+u):o.stack=u}catch{}}throw o}}_request(a,i){typeof a=="string"?(i=i||{},i.url=a):i=a||{},i=zr(this.defaults,i);const{transitional:o,paramsSerializer:l,headers:u}=i;o!==void 0&&nu.assertOptions(o,{silentJSONParsing:un.transitional(un.boolean),forcedJSONParsing:un.transitional(un.boolean),clarifyTimeoutError:un.transitional(un.boolean),legacyInterceptorReqResOrdering:un.transitional(un.boolean)},!1),l!=null&&(G.isFunction(l)?i.paramsSerializer={serialize:l}:nu.assertOptions(l,{encode:un.function,serialize:un.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),nu.assertOptions(i,{baseUrl:un.spelling("baseURL"),withXsrfToken:un.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let d=u&&G.merge(u.common,u[i.method]);u&&G.forEach(["delete","get","head","post","put","patch","common"],S=>{delete u[S]}),i.headers=Ve.concat(d,u);const h=[];let p=!0;this.interceptors.request.forEach(function(w){if(typeof w.runWhen=="function"&&w.runWhen(i)===!1)return;p=p&&w.synchronous;const C=i.transitional||Vh;C&&C.legacyInterceptorReqResOrdering?h.unshift(w.fulfilled,w.rejected):h.push(w.fulfilled,w.rejected)});const m=[];this.interceptors.response.forEach(function(w){m.push(w.fulfilled,w.rejected)});let v,g=0,b;if(!p){const S=[b0.bind(this),void 0];for(S.unshift(...h),S.push(...m),b=S.length,v=Promise.resolve(i);g<b;)v=v.then(S[g++],S[g++]);return v}b=h.length;let x=i;for(;g<b;){const S=h[g++],w=h[g++];try{x=S(x)}catch(C){w.call(this,C);break}}try{v=b0.call(this,x)}catch(S){return Promise.reject(S)}for(g=0,b=m.length;g<b;)v=v.then(m[g++],m[g++]);return v}getUri(a){a=zr(this.defaults,a);const i=s1(a.baseURL,a.url,a.allowAbsoluteUrls);return a1(i,a.params,a.paramsSerializer)}};G.forEach(["delete","get","head","options"],function(a){Tr.prototype[a]=function(i,o){return this.request(zr(o||{},{method:a,url:i,data:(o||{}).data}))}});G.forEach(["post","put","patch"],function(a){function i(o){return function(u,d,h){return this.request(zr(h||{},{method:a,headers:o?{"Content-Type":"multipart/form-data"}:{},url:u,data:d}))}}Tr.prototype[a]=i(),Tr.prototype[a+"Form"]=i(!0)});let QM=class d1{constructor(a){if(typeof a!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(u){i=u});const o=this;this.promise.then(l=>{if(!o._listeners)return;let u=o._listeners.length;for(;u-- >0;)o._listeners[u](l);o._listeners=null}),this.promise.then=l=>{let u;const d=new Promise(h=>{o.subscribe(h),u=h}).then(l);return d.cancel=function(){o.unsubscribe(u)},d},a(function(u,d,h){o.reason||(o.reason=new ys(u,d,h),i(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(a){if(this.reason){a(this.reason);return}this._listeners?this._listeners.push(a):this._listeners=[a]}unsubscribe(a){if(!this._listeners)return;const i=this._listeners.indexOf(a);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const a=new AbortController,i=o=>{a.abort(o)};return this.subscribe(i),a.signal.unsubscribe=()=>this.unsubscribe(i),a.signal}static source(){let a;return{token:new d1(function(l){a=l}),cancel:a}}};function KM(e){return function(i){return e.apply(null,i)}}function XM(e){return G.isObject(e)&&e.isAxiosError===!0}const Id={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Id).forEach(([e,a])=>{Id[a]=e});function h1(e){const a=new Tr(e),i=QS(Tr.prototype.request,a);return G.extend(i,Tr.prototype,a,{allOwnKeys:!0}),G.extend(i,a,null,{allOwnKeys:!0}),i.create=function(l){return h1(zr(e,l))},i}const ne=h1(vs);ne.Axios=Tr;ne.CanceledError=ys;ne.CancelToken=QM;ne.isCancel=i1;ne.VERSION=f1;ne.toFormData=Lu;ne.AxiosError=yt;ne.Cancel=ne.CanceledError;ne.all=function(a){return Promise.all(a)};ne.spread=KM;ne.isAxiosError=XM;ne.mergeConfig=zr;ne.AxiosHeaders=Ve;ne.formToJSON=e=>r1(G.isHTMLForm(e)?new FormData(e):e);ne.getAdapter=c1.getAdapter;ne.HttpStatusCode=Id;ne.default=ne;const{Axios:gN,AxiosError:vN,CanceledError:yN,isCancel:bN,CancelToken:SN,VERSION:xN,all:wN,Cancel:EN,isAxiosError:RN,spread:_N,toFormData:CN,AxiosHeaders:TN,HttpStatusCode:AN,formToJSON:ON,getAdapter:MN,mergeConfig:NN}=ne,Yh=ne.create({baseURL:"/api"});Yh.interceptors.request.use(e=>{const a=localStorage.getItem("access_token");return a&&(e.headers.Authorization=`Bearer ${a}`),e});Yh.interceptors.response.use(e=>e,e=>(e.response.status===401&&(localStorage.removeItem("access_token"),window.location.href="/"),Promise.reject(e)));class x0{constructor(a,i){this.client=a,this.data=i}}class $M{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/events");return a.events}}class IM{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/guilds");return a.guilds}}class ZM{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/plugins");return a.plugins}}class JM{api=Yh;guilds=new IM(this);plugins=new ZM(this);events=new $M(this);_user=null;get user(){return this._user}isReady(){return this._user!==null}logout(){localStorage.removeItem("access_token"),this._user=null}async fetchMe(a=!1){if(this._user&&!a)return this._user;const{data:i}=await this.api.get("/auth/@me");return this._user=new x0(this,i),this._user}async getFeatureFlags(){const{data:a}=await this.api.get("/feature-flags");return a}async login(a,i){const{data:o}=await this.api.post("/auth/login",{username:a,password:i});return o.accessToken&&localStorage.setItem("access_token",o.accessToken),this._user=new x0(this,o.user),o}}const m1=R.createContext(null);function WM({children:e}){const[a,i]=R.useState(()=>new JM);return _.jsx(m1.Provider,{value:{client:a,setClient:i},children:e})}function Qh(){const e=R.use(m1);if(!e)throw new Error("useClient must be used within a ClientProvider");return e.client}const Td={navMain:[{title:"Commands",url:"/commands",icon:wy,isActive:!1},{title:"Events",url:"/events",icon:xy,isActive:!1},{title:"Plugins",url:"/plugins",icon:GR,isActive:!1},{title:"Guilds",url:"/guilds",icon:_y,isActive:!1},{title:"Feature Flags",url:"/feature-flags",icon:YR,isActive:!1}],navSecondary:[{title:"GitHub",url:"https://github.com/neplextech/commandkit",icon:r_},{title:"Discord",url:"https://commandkit.dev/discord",icon:_y}],projects:[{name:"Commands",url:"#",icon:wy},{name:"Middlewares",url:"#",icon:XR},{name:"Events",url:"#",icon:xy}]};function t4({...e}){const a=Qh();return _.jsxs(QA,{className:"top-(--header-height) h-[calc(100svh-var(--header-height))]!",...e,children:[_.jsx(XA,{children:_.jsx(fs,{children:_.jsx(ds,{children:_.jsx(hs,{size:"lg",asChild:!0,children:_.jsxs(Vi,{to:"/",children:[_.jsx("div",{className:"border-sidebar-primary border text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-lg",children:_.jsx("img",{src:"/logo.webp",alt:"Logo",className:"size-6"})}),_.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[_.jsx("span",{className:"truncate font-medium",children:"CommandKit"}),_.jsx("span",{className:"truncate text-xs",children:"DevTools"})]})]})})})})}),_.jsxs(IA,{children:[_.jsx(WA,{items:Td.navMain}),_.jsx(tO,{projects:Td.projects}),_.jsx(eO,{items:Td.navSecondary,className:"mt-auto"})]}),_.jsx($A,{children:_.jsx(gO,{user:{avatar:a.user.data.displayAvatarURL,name:a.user.data.globalName||a.user?.data.username,username:a.user.data.username}})})]})}function e4({className:e,...a}){return _.jsx("div",{"data-slot":"card",className:Rt("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...a})}function n4({className:e,...a}){return _.jsx("div",{"data-slot":"card-header",className:Rt("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...a})}function a4({className:e,...a}){return _.jsx("div",{"data-slot":"card-title",className:Rt("leading-none font-semibold",e),...a})}function r4({className:e,...a}){return _.jsx("div",{"data-slot":"card-description",className:Rt("text-muted-foreground text-sm",e),...a})}function i4({className:e,...a}){return _.jsx("div",{"data-slot":"card-content",className:Rt("px-6",e),...a})}function DN({className:e,...a}){return _.jsx("div",{"data-slot":"card-footer",className:Rt("flex items-center px-6 [.border-t]:pt-6",e),...a})}var o4="Label",p1=R.forwardRef((e,a)=>_.jsx(Jt.label,{...e,ref:a,onMouseDown:i=>{i.target.closest("button, input, select, textarea")||(e.onMouseDown?.(i),!i.defaultPrevented&&i.detail>1&&i.preventDefault())}}));p1.displayName=o4;var s4=p1;function w0({className:e,...a}){return _.jsx(s4,{"data-slot":"label",className:Rt("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...a})}const E0=e=>{let a;const i=new Set,o=(m,v)=>{const g=typeof m=="function"?m(a):m;if(!Object.is(g,a)){const b=a;a=v??(typeof g!="object"||g===null)?g:Object.assign({},a,g),i.forEach(x=>x(a,b))}},l=()=>a,h={setState:o,getState:l,getInitialState:()=>p,subscribe:m=>(i.add(m),()=>i.delete(m))},p=a=e(o,l,h);return h},l4=(e=>e?E0(e):E0),u4=e=>e;function c4(e,a=u4){const i=tt.useSyncExternalStore(e.subscribe,tt.useCallback(()=>a(e.getState()),[e,a]),tt.useCallback(()=>a(e.getInitialState()),[e,a]));return tt.useDebugValue(i),i}const R0=e=>{const a=l4(e),i=o=>c4(a,o);return Object.assign(i,a),i},f4=(e=>e?R0(e):R0),g1=f4(e=>({authenticated:!1,setAuthenticated:a=>e({authenticated:a})}));function d4(e){if(typeof document>"u")return;let a=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",a.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}const h4=e=>{switch(e){case"success":return g4;case"info":return y4;case"warning":return v4;case"error":return b4;default:return null}},m4=Array(12).fill(0),p4=({visible:e,className:a})=>tt.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":e},tt.createElement("div",{className:"sonner-spinner"},m4.map((i,o)=>tt.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),g4=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},tt.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),v4=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},tt.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),y4=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},tt.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),b4=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},tt.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),S4=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},tt.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),tt.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),x4=()=>{const[e,a]=tt.useState(document.hidden);return tt.useEffect(()=>{const i=()=>{a(document.hidden)};return document.addEventListener("visibilitychange",i),()=>window.removeEventListener("visibilitychange",i)},[]),e};let Zd=1;class w4{constructor(){this.subscribe=a=>(this.subscribers.push(a),()=>{const i=this.subscribers.indexOf(a);this.subscribers.splice(i,1)}),this.publish=a=>{this.subscribers.forEach(i=>i(a))},this.addToast=a=>{this.publish(a),this.toasts=[...this.toasts,a]},this.create=a=>{var i;const{message:o,...l}=a,u=typeof a?.id=="number"||((i=a.id)==null?void 0:i.length)>0?a.id:Zd++,d=this.toasts.find(p=>p.id===u),h=a.dismissible===void 0?!0:a.dismissible;return this.dismissedToasts.has(u)&&this.dismissedToasts.delete(u),d?this.toasts=this.toasts.map(p=>p.id===u?(this.publish({...p,...a,id:u,title:o}),{...p,...a,id:u,dismissible:h,title:o}):p):this.addToast({title:o,...l,dismissible:h,id:u}),u},this.dismiss=a=>(a?(this.dismissedToasts.add(a),requestAnimationFrame(()=>this.subscribers.forEach(i=>i({id:a,dismiss:!0})))):this.toasts.forEach(i=>{this.subscribers.forEach(o=>o({id:i.id,dismiss:!0}))}),a),this.message=(a,i)=>this.create({...i,message:a}),this.error=(a,i)=>this.create({...i,message:a,type:"error"}),this.success=(a,i)=>this.create({...i,type:"success",message:a}),this.info=(a,i)=>this.create({...i,type:"info",message:a}),this.warning=(a,i)=>this.create({...i,type:"warning",message:a}),this.loading=(a,i)=>this.create({...i,type:"loading",message:a}),this.promise=(a,i)=>{if(!i)return;let o;i.loading!==void 0&&(o=this.create({...i,promise:a,type:"loading",message:i.loading,description:typeof i.description!="function"?i.description:void 0}));const l=Promise.resolve(a instanceof Function?a():a);let u=o!==void 0,d;const h=l.then(async m=>{if(d=["resolve",m],tt.isValidElement(m))u=!1,this.create({id:o,type:"default",message:m});else if(R4(m)&&!m.ok){u=!1;const g=typeof i.error=="function"?await i.error(`HTTP error! status: ${m.status}`):i.error,b=typeof i.description=="function"?await i.description(`HTTP error! status: ${m.status}`):i.description,S=typeof g=="object"&&!tt.isValidElement(g)?g:{message:g};this.create({id:o,type:"error",description:b,...S})}else if(m instanceof Error){u=!1;const g=typeof i.error=="function"?await i.error(m):i.error,b=typeof i.description=="function"?await i.description(m):i.description,S=typeof g=="object"&&!tt.isValidElement(g)?g:{message:g};this.create({id:o,type:"error",description:b,...S})}else if(i.success!==void 0){u=!1;const g=typeof i.success=="function"?await i.success(m):i.success,b=typeof i.description=="function"?await i.description(m):i.description,S=typeof g=="object"&&!tt.isValidElement(g)?g:{message:g};this.create({id:o,type:"success",description:b,...S})}}).catch(async m=>{if(d=["reject",m],i.error!==void 0){u=!1;const v=typeof i.error=="function"?await i.error(m):i.error,g=typeof i.description=="function"?await i.description(m):i.description,x=typeof v=="object"&&!tt.isValidElement(v)?v:{message:v};this.create({id:o,type:"error",description:g,...x})}}).finally(()=>{u&&(this.dismiss(o),o=void 0),i.finally==null||i.finally.call(i)}),p=()=>new Promise((m,v)=>h.then(()=>d[0]==="reject"?v(d[1]):m(d[1])).catch(v));return typeof o!="string"&&typeof o!="number"?{unwrap:p}:Object.assign(o,{unwrap:p})},this.custom=(a,i)=>{const o=i?.id||Zd++;return this.create({jsx:a(o),id:o,...i}),o},this.getActiveToasts=()=>this.toasts.filter(a=>!this.dismissedToasts.has(a.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Pe=new w4,E4=(e,a)=>{const i=a?.id||Zd++;return Pe.addToast({title:e,...a,id:i}),i},R4=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",_4=E4,C4=()=>Pe.toasts,T4=()=>Pe.getActiveToasts(),_0=Object.assign(_4,{success:Pe.success,info:Pe.info,warning:Pe.warning,error:Pe.error,custom:Pe.custom,message:Pe.message,promise:Pe.promise,dismiss:Pe.dismiss,loading:Pe.loading},{getHistory:C4,getToasts:T4});d4("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Kl(e){return e.label!==void 0}const A4=3,O4="24px",M4="16px",C0=4e3,N4=356,D4=14,z4=45,L4=200;function Ln(...e){return e.filter(Boolean).join(" ")}function j4(e){const[a,i]=e.split("-"),o=[];return a&&o.push(a),i&&o.push(i),o}const U4=e=>{var a,i,o,l,u,d,h,p,m;const{invert:v,toast:g,unstyled:b,interacting:x,setHeights:S,visibleToasts:w,heights:C,index:T,toasts:z,expanded:D,removeToast:U,defaultRichColors:B,closeButton:K,style:j,cancelButtonStyle:V,actionButtonStyle:et,className:J="",descriptionClassName:at="",duration:rt,position:ht,gap:st,expandByDefault:bt,classNames:M,icons:X,closeButtonAriaLabel:H="Close toast"}=e,[ft,mt]=tt.useState(null),[O,Y]=tt.useState(null),[Q,W]=tt.useState(!1),[nt,ct]=tt.useState(!1),[it,gt]=tt.useState(!1),[_t,Wt]=tt.useState(!1),[Kt,se]=tt.useState(!1),[vn,Ae]=tt.useState(0),[Wa,ma]=tt.useState(0),Vn=tt.useRef(g.duration||rt||C0),Tn=tt.useRef(null),fe=tt.useRef(null),pa=T===0,ga=T+1<=w,Ct=g.type,Xt=g.dismissible!==!1,Ft=g.className||"",bs=g.descriptionClassName||"",tr=tt.useMemo(()=>C.findIndex(St=>St.toastId===g.id)||0,[C,g.id]),Ss=tt.useMemo(()=>{var St;return(St=g.closeButton)!=null?St:K},[g.closeButton,K]),er=tt.useMemo(()=>g.duration||rt||C0,[g.duration,rt]),Zi=tt.useRef(0),Gn=tt.useRef(0),xs=tt.useRef(0),va=tt.useRef(null),[nr,Re]=ht.split("-"),yn=tt.useMemo(()=>C.reduce((St,Yt,de)=>de>=tr?St:St+Yt.height,0),[C,tr]),Se=x4(),Uu=g.invert||v,Ji=Ct==="loading";Gn.current=tt.useMemo(()=>tr*st+yn,[tr,yn]),tt.useEffect(()=>{Vn.current=er},[er]),tt.useEffect(()=>{W(!0)},[]),tt.useEffect(()=>{const St=fe.current;if(St){const Yt=St.getBoundingClientRect().height;return ma(Yt),S(de=>[{toastId:g.id,height:Yt,position:g.position},...de]),()=>S(de=>de.filter(xe=>xe.toastId!==g.id))}},[S,g.id]),tt.useLayoutEffect(()=>{if(!Q)return;const St=fe.current,Yt=St.style.height;St.style.height="auto";const de=St.getBoundingClientRect().height;St.style.height=Yt,ma(de),S(xe=>xe.find($t=>$t.toastId===g.id)?xe.map($t=>$t.toastId===g.id?{...$t,height:de}:$t):[{toastId:g.id,height:de,position:g.position},...xe])},[Q,g.title,g.description,S,g.id,g.jsx,g.action,g.cancel]);const An=tt.useCallback(()=>{ct(!0),Ae(Gn.current),S(St=>St.filter(Yt=>Yt.toastId!==g.id)),setTimeout(()=>{U(g)},L4)},[g,U,S,Gn]);tt.useEffect(()=>{if(g.promise&&Ct==="loading"||g.duration===1/0||g.type==="loading")return;let St;return D||x||Se?(()=>{if(xs.current<Zi.current){const xe=new Date().getTime()-Zi.current;Vn.current=Vn.current-xe}xs.current=new Date().getTime()})():Vn.current!==1/0&&(Zi.current=new Date().getTime(),St=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),An()},Vn.current)),()=>clearTimeout(St)},[D,x,g,Ct,Se,An]),tt.useEffect(()=>{g.delete&&(An(),g.onDismiss==null||g.onDismiss.call(g,g))},[An,g.delete]);function kr(){var St;if(X?.loading){var Yt;return tt.createElement("div",{className:Ln(M?.loader,g==null||(Yt=g.classNames)==null?void 0:Yt.loader,"sonner-loader"),"data-visible":Ct==="loading"},X.loading)}return tt.createElement(p4,{className:Ln(M?.loader,g==null||(St=g.classNames)==null?void 0:St.loader),visible:Ct==="loading"})}const Pr=g.icon||X?.[Ct]||h4(Ct);var ar,On;return tt.createElement("li",{tabIndex:0,ref:fe,className:Ln(J,Ft,M?.toast,g==null||(a=g.classNames)==null?void 0:a.toast,M?.default,M?.[Ct],g==null||(i=g.classNames)==null?void 0:i[Ct]),"data-sonner-toast":"","data-rich-colors":(ar=g.richColors)!=null?ar:B,"data-styled":!(g.jsx||g.unstyled||b),"data-mounted":Q,"data-promise":!!g.promise,"data-swiped":Kt,"data-removed":nt,"data-visible":ga,"data-y-position":nr,"data-x-position":Re,"data-index":T,"data-front":pa,"data-swiping":it,"data-dismissible":Xt,"data-type":Ct,"data-invert":Uu,"data-swipe-out":_t,"data-swipe-direction":O,"data-expanded":!!(D||bt&&Q),"data-testid":g.testId,style:{"--index":T,"--toasts-before":T,"--z-index":z.length-T,"--offset":`${nt?vn:Gn.current}px`,"--initial-height":bt?"auto":`${Wa}px`,...j,...g.style},onDragEnd:()=>{gt(!1),mt(null),va.current=null},onPointerDown:St=>{St.button!==2&&(Ji||!Xt||(Tn.current=new Date,Ae(Gn.current),St.target.setPointerCapture(St.pointerId),St.target.tagName!=="BUTTON"&&(gt(!0),va.current={x:St.clientX,y:St.clientY})))},onPointerUp:()=>{var St,Yt,de;if(_t||!Xt)return;va.current=null;const xe=Number(((St=fe.current)==null?void 0:St.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ya=Number(((Yt=fe.current)==null?void 0:Yt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),$t=new Date().getTime()-((de=Tn.current)==null?void 0:de.getTime()),Oe=ft==="x"?xe:ya,rr=Math.abs(Oe)/$t;if(Math.abs(Oe)>=z4||rr>.11){Ae(Gn.current),g.onDismiss==null||g.onDismiss.call(g,g),Y(ft==="x"?xe>0?"right":"left":ya>0?"down":"up"),An(),Wt(!0);return}else{var Me,Ne;(Me=fe.current)==null||Me.style.setProperty("--swipe-amount-x","0px"),(Ne=fe.current)==null||Ne.style.setProperty("--swipe-amount-y","0px")}se(!1),gt(!1),mt(null)},onPointerMove:St=>{var Yt,de,xe;if(!va.current||!Xt||((Yt=window.getSelection())==null?void 0:Yt.toString().length)>0)return;const $t=St.clientY-va.current.y,Oe=St.clientX-va.current.x;var rr;const Me=(rr=e.swipeDirections)!=null?rr:j4(ht);!ft&&(Math.abs(Oe)>1||Math.abs($t)>1)&&mt(Math.abs(Oe)>Math.abs($t)?"x":"y");let Ne={x:0,y:0};const Hr=bn=>1/(1.5+Math.abs(bn)/20);if(ft==="y"){if(Me.includes("top")||Me.includes("bottom"))if(Me.includes("top")&&$t<0||Me.includes("bottom")&&$t>0)Ne.y=$t;else{const bn=$t*Hr($t);Ne.y=Math.abs(bn)<Math.abs($t)?bn:$t}}else if(ft==="x"&&(Me.includes("left")||Me.includes("right")))if(Me.includes("left")&&Oe<0||Me.includes("right")&&Oe>0)Ne.x=Oe;else{const bn=Oe*Hr(Oe);Ne.x=Math.abs(bn)<Math.abs(Oe)?bn:Oe}(Math.abs(Ne.x)>0||Math.abs(Ne.y)>0)&&se(!0),(de=fe.current)==null||de.style.setProperty("--swipe-amount-x",`${Ne.x}px`),(xe=fe.current)==null||xe.style.setProperty("--swipe-amount-y",`${Ne.y}px`)}},Ss&&!g.jsx&&Ct!=="loading"?tt.createElement("button",{"aria-label":H,"data-disabled":Ji,"data-close-button":!0,onClick:Ji||!Xt?()=>{}:()=>{An(),g.onDismiss==null||g.onDismiss.call(g,g)},className:Ln(M?.closeButton,g==null||(o=g.classNames)==null?void 0:o.closeButton)},(On=X?.close)!=null?On:S4):null,(Ct||g.icon||g.promise)&&g.icon!==null&&(X?.[Ct]!==null||g.icon)?tt.createElement("div",{"data-icon":"",className:Ln(M?.icon,g==null||(l=g.classNames)==null?void 0:l.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||kr():null,g.type!=="loading"?Pr:null):null,tt.createElement("div",{"data-content":"",className:Ln(M?.content,g==null||(u=g.classNames)==null?void 0:u.content)},tt.createElement("div",{"data-title":"",className:Ln(M?.title,g==null||(d=g.classNames)==null?void 0:d.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?tt.createElement("div",{"data-description":"",className:Ln(at,bs,M?.description,g==null||(h=g.classNames)==null?void 0:h.description)},typeof g.description=="function"?g.description():g.description):null),tt.isValidElement(g.cancel)?g.cancel:g.cancel&&Kl(g.cancel)?tt.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||V,onClick:St=>{Kl(g.cancel)&&Xt&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,St),An())},className:Ln(M?.cancelButton,g==null||(p=g.classNames)==null?void 0:p.cancelButton)},g.cancel.label):null,tt.isValidElement(g.action)?g.action:g.action&&Kl(g.action)?tt.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||et,onClick:St=>{Kl(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,St),!St.defaultPrevented&&An())},className:Ln(M?.actionButton,g==null||(m=g.classNames)==null?void 0:m.actionButton)},g.action.label):null)};function T0(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function B4(e,a){const i={};return[e,a].forEach((o,l)=>{const u=l===1,d=u?"--mobile-offset":"--offset",h=u?M4:O4;function p(m){["top","right","bottom","left"].forEach(v=>{i[`${d}-${v}`]=typeof m=="number"?`${m}px`:m})}typeof o=="number"||typeof o=="string"?p(o):typeof o=="object"?["top","right","bottom","left"].forEach(m=>{o[m]===void 0?i[`${d}-${m}`]=h:i[`${d}-${m}`]=typeof o[m]=="number"?`${o[m]}px`:o[m]}):p(h)}),i}const k4=tt.forwardRef(function(a,i){const{id:o,invert:l,position:u="bottom-right",hotkey:d=["altKey","KeyT"],expand:h,closeButton:p,className:m,offset:v,mobileOffset:g,theme:b="light",richColors:x,duration:S,style:w,visibleToasts:C=A4,toastOptions:T,dir:z=T0(),gap:D=D4,icons:U,containerAriaLabel:B="Notifications"}=a,[K,j]=tt.useState([]),V=tt.useMemo(()=>o?K.filter(Q=>Q.toasterId===o):K.filter(Q=>!Q.toasterId),[K,o]),et=tt.useMemo(()=>Array.from(new Set([u].concat(V.filter(Q=>Q.position).map(Q=>Q.position)))),[V,u]),[J,at]=tt.useState([]),[rt,ht]=tt.useState(!1),[st,bt]=tt.useState(!1),[M,X]=tt.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=tt.useRef(null),ft=d.join("+").replace(/Key/g,"").replace(/Digit/g,""),mt=tt.useRef(null),O=tt.useRef(!1),Y=tt.useCallback(Q=>{j(W=>{var nt;return(nt=W.find(ct=>ct.id===Q.id))!=null&&nt.delete||Pe.dismiss(Q.id),W.filter(({id:ct})=>ct!==Q.id)})},[]);return tt.useEffect(()=>Pe.subscribe(Q=>{if(Q.dismiss){requestAnimationFrame(()=>{j(W=>W.map(nt=>nt.id===Q.id?{...nt,delete:!0}:nt))});return}setTimeout(()=>{ib.flushSync(()=>{j(W=>{const nt=W.findIndex(ct=>ct.id===Q.id);return nt!==-1?[...W.slice(0,nt),{...W[nt],...Q},...W.slice(nt+1)]:[Q,...W]})})})}),[K]),tt.useEffect(()=>{if(b!=="system"){X(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?X("dark"):X("light")),typeof window>"u")return;const Q=window.matchMedia("(prefers-color-scheme: dark)");try{Q.addEventListener("change",({matches:W})=>{X(W?"dark":"light")})}catch{Q.addListener(({matches:nt})=>{try{X(nt?"dark":"light")}catch(ct){console.error(ct)}})}},[b]),tt.useEffect(()=>{K.length<=1&&ht(!1)},[K]),tt.useEffect(()=>{const Q=W=>{var nt;if(d.every(gt=>W[gt]||W.code===gt)){var it;ht(!0),(it=H.current)==null||it.focus()}W.code==="Escape"&&(document.activeElement===H.current||(nt=H.current)!=null&&nt.contains(document.activeElement))&&ht(!1)};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[d]),tt.useEffect(()=>{if(H.current)return()=>{mt.current&&(mt.current.focus({preventScroll:!0}),mt.current=null,O.current=!1)}},[H.current]),tt.createElement("section",{ref:i,"aria-label":`${B} ${ft}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},et.map((Q,W)=>{var nt;const[ct,it]=Q.split("-");return V.length?tt.createElement("ol",{key:Q,dir:z==="auto"?T0():z,tabIndex:-1,ref:H,className:m,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":ct,"data-x-position":it,style:{"--front-toast-height":`${((nt=J[0])==null?void 0:nt.height)||0}px`,"--width":`${N4}px`,"--gap":`${D}px`,...w,...B4(v,g)},onBlur:gt=>{O.current&&!gt.currentTarget.contains(gt.relatedTarget)&&(O.current=!1,mt.current&&(mt.current.focus({preventScroll:!0}),mt.current=null))},onFocus:gt=>{gt.target instanceof HTMLElement&>.target.dataset.dismissible==="false"||O.current||(O.current=!0,mt.current=gt.relatedTarget)},onMouseEnter:()=>ht(!0),onMouseMove:()=>ht(!0),onMouseLeave:()=>{st||ht(!1)},onDragEnd:()=>ht(!1),onPointerDown:gt=>{gt.target instanceof HTMLElement&>.target.dataset.dismissible==="false"||bt(!0)},onPointerUp:()=>bt(!1)},V.filter(gt=>!gt.position&&W===0||gt.position===Q).map((gt,_t)=>{var Wt,Kt;return tt.createElement(U4,{key:gt.id,icons:U,index:_t,toast:gt,defaultRichColors:x,duration:(Wt=T?.duration)!=null?Wt:S,className:T?.className,descriptionClassName:T?.descriptionClassName,invert:l,visibleToasts:C,closeButton:(Kt=T?.closeButton)!=null?Kt:p,interacting:st,position:Q,style:T?.style,unstyled:T?.unstyled,classNames:T?.classNames,cancelButtonStyle:T?.cancelButtonStyle,actionButtonStyle:T?.actionButtonStyle,closeButtonAriaLabel:T?.closeButtonAriaLabel,removeToast:Y,toasts:V.filter(se=>se.position==gt.position),heights:J.filter(se=>se.position==gt.position),setHeights:at,expandByDefault:h,gap:D,expanded:rt,swipeDirections:a.swipeDirections})})):null}))});var $i=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(){}},P4={setTimeout:(e,a)=>setTimeout(e,a),clearTimeout:e=>clearTimeout(e),setInterval:(e,a)=>setInterval(e,a),clearInterval:e=>clearInterval(e)},H4=class{#t=P4;#e=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,a){return this.#t.setTimeout(e,a)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,a){return this.#t.setInterval(e,a)}clearInterval(e){this.#t.clearInterval(e)}},Rr=new H4;function q4(e){setTimeout(e,0)}var Lr=typeof window>"u"||"Deno"in globalThis;function Ce(){}function V4(e,a){return typeof e=="function"?e(a):e}function Jd(e){return typeof e=="number"&&e>=0&&e!==1/0}function v1(e,a){return Math.max(e+(a||0)-Date.now(),0)}function Xa(e,a){return typeof e=="function"?e(a):e}function dn(e,a){return typeof e=="function"?e(a):e}function A0(e,a){const{type:i="all",exact:o,fetchStatus:l,predicate:u,queryKey:d,stale:h}=e;if(d){if(o){if(a.queryHash!==Kh(d,a.options))return!1}else if(!is(a.queryKey,d))return!1}if(i!=="all"){const p=a.isActive();if(i==="active"&&!p||i==="inactive"&&p)return!1}return!(typeof h=="boolean"&&a.isStale()!==h||l&&l!==a.state.fetchStatus||u&&!u(a))}function O0(e,a){const{exact:i,status:o,predicate:l,mutationKey:u}=e;if(u){if(!a.options.mutationKey)return!1;if(i){if(jr(a.options.mutationKey)!==jr(u))return!1}else if(!is(a.options.mutationKey,u))return!1}return!(o&&a.state.status!==o||l&&!l(a))}function Kh(e,a){return(a?.queryKeyHashFn||jr)(e)}function jr(e){return JSON.stringify(e,(a,i)=>Wd(i)?Object.keys(i).sort().reduce((o,l)=>(o[l]=i[l],o),{}):i)}function is(e,a){return e===a?!0:typeof e!=typeof a?!1:e&&a&&typeof e=="object"&&typeof a=="object"?Object.keys(a).every(i=>is(e[i],a[i])):!1}var G4=Object.prototype.hasOwnProperty;function y1(e,a){if(e===a)return e;const i=M0(e)&&M0(a);if(!i&&!(Wd(e)&&Wd(a)))return a;const l=(i?e:Object.keys(e)).length,u=i?a:Object.keys(a),d=u.length,h=i?new Array(d):{};let p=0;for(let m=0;m<d;m++){const v=i?m:u[m],g=e[v],b=a[v];if(g===b){h[v]=g,(i?m<l:G4.call(e,v))&&p++;continue}if(g===null||b===null||typeof g!="object"||typeof b!="object"){h[v]=b;continue}const x=y1(g,b);h[v]=x,x===g&&p++}return l===d&&p===l?e:h}function vu(e,a){if(!a||Object.keys(e).length!==Object.keys(a).length)return!1;for(const i in e)if(e[i]!==a[i])return!1;return!0}function M0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Wd(e){if(!N0(e))return!1;const a=e.constructor;if(a===void 0)return!0;const i=a.prototype;return!(!N0(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function N0(e){return Object.prototype.toString.call(e)==="[object Object]"}function F4(e){return new Promise(a=>{Rr.setTimeout(a,e)})}function th(e,a,i){return typeof i.structuralSharing=="function"?i.structuralSharing(e,a):i.structuralSharing!==!1?y1(e,a):a}function Y4(e,a,i=0){const o=[...e,a];return i&&o.length>i?o.slice(1):o}function Q4(e,a,i=0){const o=[a,...e];return i&&o.length>i?o.slice(0,-1):o}var Xh=Symbol();function b1(e,a){return!e.queryFn&&a?.initialPromise?()=>a.initialPromise:!e.queryFn||e.queryFn===Xh?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function S1(e,a){return typeof e=="function"?e(...a):!!e}var K4=class extends $i{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Lr&&window.addEventListener){const a=()=>e();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(a=>{a(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},$h=new K4;function eh(){let e,a;const i=new Promise((l,u)=>{e=l,a=u});i.status="pending",i.catch(()=>{});function o(l){Object.assign(i,l),delete i.resolve,delete i.reject}return i.resolve=l=>{o({status:"fulfilled",value:l}),e(l)},i.reject=l=>{o({status:"rejected",reason:l}),a(l)},i}var X4=q4;function $4(){let e=[],a=0,i=h=>{h()},o=h=>{h()},l=X4;const u=h=>{a?e.push(h):l(()=>{i(h)})},d=()=>{const h=e;e=[],h.length&&l(()=>{o(()=>{h.forEach(p=>{i(p)})})})};return{batch:h=>{let p;a++;try{p=h()}finally{a--,a||d()}return p},batchCalls:h=>(...p)=>{u(()=>{h(...p)})},schedule:u,setNotifyFunction:h=>{i=h},setBatchNotifyFunction:h=>{o=h},setScheduler:h=>{l=h}}}var ce=$4(),I4=class extends $i{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Lr&&window.addEventListener){const a=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(i=>{i(e)}))}isOnline(){return this.#t}},yu=new I4;function Z4(e){return Math.min(1e3*2**e,3e4)}function x1(e){return(e??"online")==="online"?yu.isOnline():!0}var nh=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function w1(e){let a=!1,i=0,o;const l=eh(),u=()=>l.status!=="pending",d=w=>{if(!u()){const C=new nh(w);b(C),e.onCancel?.(C)}},h=()=>{a=!0},p=()=>{a=!1},m=()=>$h.isFocused()&&(e.networkMode==="always"||yu.isOnline())&&e.canRun(),v=()=>x1(e.networkMode)&&e.canRun(),g=w=>{u()||(o?.(),l.resolve(w))},b=w=>{u()||(o?.(),l.reject(w))},x=()=>new Promise(w=>{o=C=>{(u()||m())&&w(C)},e.onPause?.()}).then(()=>{o=void 0,u()||e.onContinue?.()}),S=()=>{if(u())return;let w;const C=i===0?e.initialPromise:void 0;try{w=C??e.fn()}catch(T){w=Promise.reject(T)}Promise.resolve(w).then(g).catch(T=>{if(u())return;const z=e.retry??(Lr?0:3),D=e.retryDelay??Z4,U=typeof D=="function"?D(i,T):D,B=z===!0||typeof z=="number"&&i<z||typeof z=="function"&&z(i,T);if(a||!B){b(T);return}i++,e.onFail?.(i,T),F4(U).then(()=>m()?void 0:x()).then(()=>{a?b(T):S()})})};return{promise:l,status:()=>l.status,cancel:d,continue:()=>(o?.(),l),cancelRetry:h,continueRetry:p,canStart:v,start:()=>(v()?S():x().then(S),l)}}var E1=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Jd(this.gcTime)&&(this.#t=Rr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Lr?1/0:300*1e3))}clearGcTimeout(){this.#t&&(Rr.clearTimeout(this.#t),this.#t=void 0)}},J4=class extends E1{#t;#e;#n;#r;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=D0(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=D0(this.options);a.data!==void 0&&(this.setData(a.data,{updatedAt:a.dataUpdatedAt,manual:!0}),this.#t=a)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,a){const i=th(this.state.data,e,this.options);return this.#i({data:i,type:"success",dataUpdatedAt:a?.updatedAt,manual:a?.manual}),i}setState(e,a){this.#i({type:"setState",state:e,setStateOptions:a})}cancel(e){const a=this.#a?.promise;return this.#a?.cancel(e),a?a.then(Ce).catch(Ce):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>dn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Xh||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Xa(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!v1(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(a=>a.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(a=>a.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(a=>a!==e),this.observers.length||(this.#a&&(this.#s?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,a){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&a?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const i=new AbortController,o=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#s=!0,i.signal)})},l=()=>{const h=b1(this.options,a),m=(()=>{const v={client:this.#r,queryKey:this.queryKey,meta:this.meta};return o(v),v})();return this.#s=!1,this.options.persister?this.options.persister(h,m,this):h(m)},d=(()=>{const h={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:l};return o(h),h})();this.options.behavior?.onFetch(d,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#i({type:"fetch",meta:d.fetchOptions?.meta}),this.#a=w1({initialPromise:a?.initialPromise,fn:d.fetchFn,onCancel:h=>{h instanceof nh&&h.revert&&this.setState({...this.#e,fetchStatus:"idle"}),i.abort()},onFail:(h,p)=>{this.#i({type:"failed",failureCount:h,error:p})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0});try{const h=await this.#a.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#n.config.onSuccess?.(h,this),this.#n.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof nh){if(h.silent)return this.#a.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#i({type:"error",error:h}),this.#n.config.onError?.(h,this),this.#n.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#i(e){const a=i=>{switch(e.type){case"failed":return{...i,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...R1(i.data,this.options),fetchMeta:e.meta??null};case"success":const o={...i,data:e.data,dataUpdateCount:i.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=e.manual?o:void 0,o;case"error":const l=e.error;return{...i,error:l,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error"};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...e.state}}};this.state=a(this.state),ce.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function R1(e,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:x1(a.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function D0(e){const a=typeof e.initialData=="function"?e.initialData():e.initialData,i=a!==void 0,o=i?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:i?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var W4=class extends $i{constructor(e,a){super(),this.options=a,this.#t=e,this.#i=null,this.#s=eh(),this.bindMethods(),this.setOptions(a)}#t;#e=void 0;#n=void 0;#r=void 0;#a;#o;#s;#i;#p;#d;#h;#u;#c;#l;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),z0(this.#e,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ah(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ah(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#S(),this.#x(),this.#e.removeObserver(this)}setOptions(e){const a=this.options,i=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof dn(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#e.setOptions(this.options),a._defaulted&&!vu(this.options,a)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const o=this.hasListeners();o&&L0(this.#e,i,this.options,a)&&this.#f(),this.updateResult(),o&&(this.#e!==i||dn(this.options.enabled,this.#e)!==dn(a.enabled,this.#e)||Xa(this.options.staleTime,this.#e)!==Xa(a.staleTime,this.#e))&&this.#g();const l=this.#v();o&&(this.#e!==i||dn(this.options.enabled,this.#e)!==dn(a.enabled,this.#e)||l!==this.#l)&&this.#y(l)}getOptimisticResult(e){const a=this.#t.getQueryCache().build(this.#t,e),i=this.createResult(a,e);return e3(this,i)&&(this.#r=i,this.#o=this.options,this.#a=this.#e.state),i}getCurrentResult(){return this.#r}trackResult(e,a){return new Proxy(e,{get:(i,o)=>(this.trackProp(o),a?.(o),o==="promise"&&!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(i,o))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const a=this.#t.defaultQueryOptions(e),i=this.#t.getQueryCache().build(this.#t,a);return i.fetch().then(()=>this.createResult(i,a))}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#f(e){this.#w();let a=this.#e.fetch(this.options,e);return e?.throwOnError||(a=a.catch(Ce)),a}#g(){this.#S();const e=Xa(this.options.staleTime,this.#e);if(Lr||this.#r.isStale||!Jd(e))return;const i=v1(this.#r.dataUpdatedAt,e)+1;this.#u=Rr.setTimeout(()=>{this.#r.isStale||this.updateResult()},i)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(e){this.#x(),this.#l=e,!(Lr||dn(this.options.enabled,this.#e)===!1||!Jd(this.#l)||this.#l===0)&&(this.#c=Rr.setInterval(()=>{(this.options.refetchIntervalInBackground||$h.isFocused())&&this.#f()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#S(){this.#u&&(Rr.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#c&&(Rr.clearInterval(this.#c),this.#c=void 0)}createResult(e,a){const i=this.#e,o=this.options,l=this.#r,u=this.#a,d=this.#o,p=e!==i?e.state:this.#n,{state:m}=e;let v={...m},g=!1,b;if(a._optimisticResults){const V=this.hasListeners(),et=!V&&z0(e,a),J=V&&L0(e,i,a,o);(et||J)&&(v={...v,...R1(m.data,e.options)}),a._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:x,errorUpdatedAt:S,status:w}=v;b=v.data;let C=!1;if(a.placeholderData!==void 0&&b===void 0&&w==="pending"){let V;l?.isPlaceholderData&&a.placeholderData===d?.placeholderData?(V=l.data,C=!0):V=typeof a.placeholderData=="function"?a.placeholderData(this.#h?.state.data,this.#h):a.placeholderData,V!==void 0&&(w="success",b=th(l?.data,V,a),g=!0)}if(a.select&&b!==void 0&&!C)if(l&&b===u?.data&&a.select===this.#p)b=this.#d;else try{this.#p=a.select,b=a.select(b),b=th(l?.data,b,a),this.#d=b,this.#i=null}catch(V){this.#i=V}this.#i&&(x=this.#i,b=this.#d,S=Date.now(),w="error");const T=v.fetchStatus==="fetching",z=w==="pending",D=w==="error",U=z&&T,B=b!==void 0,j={status:w,fetchStatus:v.fetchStatus,isPending:z,isSuccess:w==="success",isError:D,isInitialLoading:U,isLoading:U,data:b,dataUpdatedAt:v.dataUpdatedAt,error:x,errorUpdatedAt:S,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>p.dataUpdateCount||v.errorUpdateCount>p.errorUpdateCount,isFetching:T,isRefetching:T&&!z,isLoadingError:D&&!B,isPaused:v.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:D&&B,isStale:Ih(e,a),refetch:this.refetch,promise:this.#s,isEnabled:dn(a.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const V=at=>{j.status==="error"?at.reject(j.error):j.data!==void 0&&at.resolve(j.data)},et=()=>{const at=this.#s=j.promise=eh();V(at)},J=this.#s;switch(J.status){case"pending":e.queryHash===i.queryHash&&V(J);break;case"fulfilled":(j.status==="error"||j.data!==J.value)&&et();break;case"rejected":(j.status!=="error"||j.error!==J.reason)&&et();break}}return j}updateResult(){const e=this.#r,a=this.createResult(this.#e,this.options);if(this.#a=this.#e.state,this.#o=this.options,this.#a.data!==void 0&&(this.#h=this.#e),vu(a,e))return;this.#r=a;const i=()=>{if(!e)return!0;const{notifyOnChangeProps:o}=this.options,l=typeof o=="function"?o():o;if(l==="all"||!l&&!this.#m.size)return!0;const u=new Set(l??this.#m);return this.options.throwOnError&&u.add("error"),Object.keys(this.#r).some(d=>{const h=d;return this.#r[h]!==e[h]&&u.has(h)})};this.#E({listeners:i()})}#w(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const a=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(a?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#E(e){ce.batch(()=>{e.listeners&&this.listeners.forEach(a=>{a(this.#r)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function t3(e,a){return dn(a.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&a.retryOnMount===!1)}function z0(e,a){return t3(e,a)||e.state.data!==void 0&&ah(e,a,a.refetchOnMount)}function ah(e,a,i){if(dn(a.enabled,e)!==!1&&Xa(a.staleTime,e)!=="static"){const o=typeof i=="function"?i(e):i;return o==="always"||o!==!1&&Ih(e,a)}return!1}function L0(e,a,i,o){return(e!==a||dn(o.enabled,e)===!1)&&(!i.suspense||e.state.status!=="error")&&Ih(e,i)}function Ih(e,a){return dn(a.enabled,e)!==!1&&e.isStaleByTime(Xa(a.staleTime,e))}function e3(e,a){return!vu(e.getCurrentResult(),a)}function j0(e){return{onFetch:(a,i)=>{const o=a.options,l=a.fetchOptions?.meta?.fetchMore?.direction,u=a.state.data?.pages||[],d=a.state.data?.pageParams||[];let h={pages:[],pageParams:[]},p=0;const m=async()=>{let v=!1;const g=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(a.signal.aborted?v=!0:a.signal.addEventListener("abort",()=>{v=!0}),a.signal)})},b=b1(a.options,a.fetchOptions),x=async(S,w,C)=>{if(v)return Promise.reject();if(w==null&&S.pages.length)return Promise.resolve(S);const z=(()=>{const K={client:a.client,queryKey:a.queryKey,pageParam:w,direction:C?"backward":"forward",meta:a.options.meta};return g(K),K})(),D=await b(z),{maxPages:U}=a.options,B=C?Q4:Y4;return{pages:B(S.pages,D,U),pageParams:B(S.pageParams,w,U)}};if(l&&u.length){const S=l==="backward",w=S?n3:U0,C={pages:u,pageParams:d},T=w(o,C);h=await x(C,T,S)}else{const S=e??u.length;do{const w=p===0?d[0]??o.initialPageParam:U0(o,h);if(p>0&&w==null)break;h=await x(h,w),p++}while(p<S)}return h};a.options.persister?a.fetchFn=()=>a.options.persister?.(m,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},i):a.fetchFn=m}}}function U0(e,{pages:a,pageParams:i}){const o=a.length-1;return a.length>0?e.getNextPageParam(a[o],a,i[o],i):void 0}function n3(e,{pages:a,pageParams:i}){return a.length>0?e.getPreviousPageParam?.(a[0],a,i[0],i):void 0}var a3=class extends E1{#t;#e;#n;#r;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#e=[],this.state=e.state||_1(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(a=>a!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const a=()=>{this.#a({type:"continue"})},i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=w1({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(new Error("No mutationFn found")),onFail:(u,d)=>{this.#a({type:"failed",failureCount:u,error:d})},onPause:()=>{this.#a({type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const o=this.state.status==="pending",l=!this.#r.canStart();try{if(o)a();else{this.#a({type:"pending",variables:e,isPaused:l}),await this.#n.config.onMutate?.(e,this,i);const d=await this.options.onMutate?.(e,i);d!==this.state.context&&this.#a({type:"pending",context:d,variables:e,isPaused:l})}const u=await this.#r.start();return await this.#n.config.onSuccess?.(u,e,this.state.context,this,i),await this.options.onSuccess?.(u,e,this.state.context,i),await this.#n.config.onSettled?.(u,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(u,null,e,this.state.context,i),this.#a({type:"success",data:u}),u}catch(u){try{throw await this.#n.config.onError?.(u,e,this.state.context,this,i),await this.options.onError?.(u,e,this.state.context,i),await this.#n.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(void 0,u,e,this.state.context,i),u}finally{this.#a({type:"error",error:u})}}finally{this.#n.runNext(this)}}#a(e){const a=i=>{switch(e.type){case"failed":return{...i,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...i,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:e.error,failureCount:i.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=a(this.state),ce.batch(()=>{this.#e.forEach(i=>{i.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function _1(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var r3=class extends $i{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,a,i){const o=new a3({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(a),state:i});return this.add(o),o}add(e){this.#t.add(e);const a=Xl(e);if(typeof a=="string"){const i=this.#e.get(a);i?i.push(e):this.#e.set(a,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const a=Xl(e);if(typeof a=="string"){const i=this.#e.get(a);if(i)if(i.length>1){const o=i.indexOf(e);o!==-1&&i.splice(o,1)}else i[0]===e&&this.#e.delete(a)}}this.notify({type:"removed",mutation:e})}canRun(e){const a=Xl(e);if(typeof a=="string"){const o=this.#e.get(a)?.find(l=>l.state.status==="pending");return!o||o===e}else return!0}runNext(e){const a=Xl(e);return typeof a=="string"?this.#e.get(a)?.find(o=>o!==e&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ce.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const a={exact:!0,...e};return this.getAll().find(i=>O0(a,i))}findAll(e={}){return this.getAll().filter(a=>O0(e,a))}notify(e){ce.batch(()=>{this.listeners.forEach(a=>{a(e)})})}resumePausedMutations(){const e=this.getAll().filter(a=>a.state.isPaused);return ce.batch(()=>Promise.all(e.map(a=>a.continue().catch(Ce))))}};function Xl(e){return e.options.scope?.id}var i3=class extends $i{#t;#e=void 0;#n;#r;constructor(a,i){super(),this.#t=a,this.setOptions(i),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(a){const i=this.options;this.options=this.#t.defaultMutationOptions(a),vu(this.options,i)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),i?.mutationKey&&this.options.mutationKey&&jr(i.mutationKey)!==jr(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(a){this.#a(),this.#o(a)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#a(),this.#o()}mutate(a,i){return this.#r=i,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(a)}#a(){const a=this.#n?.state??_1();this.#e={...a,isPending:a.status==="pending",isSuccess:a.status==="success",isError:a.status==="error",isIdle:a.status==="idle",mutate:this.mutate,reset:this.reset}}#o(a){ce.batch(()=>{if(this.#r&&this.hasListeners()){const i=this.#e.variables,o=this.#e.context,l={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};a?.type==="success"?(this.#r.onSuccess?.(a.data,i,o,l),this.#r.onSettled?.(a.data,null,i,o,l)):a?.type==="error"&&(this.#r.onError?.(a.error,i,o,l),this.#r.onSettled?.(void 0,a.error,i,o,l))}this.listeners.forEach(i=>{i(this.#e)})})}},o3=class extends $i{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,a,i){const o=a.queryKey,l=a.queryHash??Kh(o,a);let u=this.get(l);return u||(u=new J4({client:e,queryKey:o,queryHash:l,options:e.defaultQueryOptions(a),state:i,defaultOptions:e.getQueryDefaults(o)}),this.add(u)),u}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const a=this.#t.get(e.queryHash);a&&(e.destroy(),a===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ce.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const a={exact:!0,...e};return this.getAll().find(i=>A0(a,i))}findAll(e={}){const a=this.getAll();return Object.keys(e).length>0?a.filter(i=>A0(e,i)):a}notify(e){ce.batch(()=>{this.listeners.forEach(a=>{a(e)})})}onFocus(){ce.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ce.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},s3=class{#t;#e;#n;#r;#a;#o;#s;#i;constructor(e={}){this.#t=e.queryCache||new o3,this.#e=e.mutationCache||new r3,this.#n=e.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#s=$h.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#i=yu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#s?.(),this.#s=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const a=this.defaultQueryOptions({queryKey:e});return this.#t.get(a.queryHash)?.state.data}ensureQueryData(e){const a=this.defaultQueryOptions(e),i=this.#t.build(this,a),o=i.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(Xa(a.staleTime,i))&&this.prefetchQuery(a),Promise.resolve(o))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:a,state:i})=>{const o=i.data;return[a,o]})}setQueryData(e,a,i){const o=this.defaultQueryOptions({queryKey:e}),u=this.#t.get(o.queryHash)?.state.data,d=V4(a,u);if(d!==void 0)return this.#t.build(this,o).setData(d,{...i,manual:!0})}setQueriesData(e,a,i){return ce.batch(()=>this.#t.findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,a,i)]))}getQueryState(e){const a=this.defaultQueryOptions({queryKey:e});return this.#t.get(a.queryHash)?.state}removeQueries(e){const a=this.#t;ce.batch(()=>{a.findAll(e).forEach(i=>{a.remove(i)})})}resetQueries(e,a){const i=this.#t;return ce.batch(()=>(i.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...e},a)))}cancelQueries(e,a={}){const i={revert:!0,...a},o=ce.batch(()=>this.#t.findAll(e).map(l=>l.cancel(i)));return Promise.all(o).then(Ce).catch(Ce)}invalidateQueries(e,a={}){return ce.batch(()=>(this.#t.findAll(e).forEach(i=>{i.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},a)))}refetchQueries(e,a={}){const i={...a,cancelRefetch:a.cancelRefetch??!0},o=ce.batch(()=>this.#t.findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let u=l.fetch(void 0,i);return i.throwOnError||(u=u.catch(Ce)),l.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(o).then(Ce)}fetchQuery(e){const a=this.defaultQueryOptions(e);a.retry===void 0&&(a.retry=!1);const i=this.#t.build(this,a);return i.isStaleByTime(Xa(a.staleTime,i))?i.fetch(a):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ce).catch(Ce)}fetchInfiniteQuery(e){return e.behavior=j0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ce).catch(Ce)}ensureInfiniteQueryData(e){return e.behavior=j0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return yu.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,a){this.#r.set(jr(e),{queryKey:e,defaultOptions:a})}getQueryDefaults(e){const a=[...this.#r.values()],i={};return a.forEach(o=>{is(e,o.queryKey)&&Object.assign(i,o.defaultOptions)}),i}setMutationDefaults(e,a){this.#a.set(jr(e),{mutationKey:e,defaultOptions:a})}getMutationDefaults(e){const a=[...this.#a.values()],i={};return a.forEach(o=>{is(e,o.mutationKey)&&Object.assign(i,o.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const a={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return a.queryHash||(a.queryHash=Kh(a.queryKey,a)),a.refetchOnReconnect===void 0&&(a.refetchOnReconnect=a.networkMode!=="always"),a.throwOnError===void 0&&(a.throwOnError=!!a.suspense),!a.networkMode&&a.persister&&(a.networkMode="offlineFirst"),a.queryFn===Xh&&(a.enabled=!1),a}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},C1=R.createContext(void 0),T1=e=>{const a=R.useContext(C1);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},l3=({client:e,children:a})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),_.jsx(C1.Provider,{value:e,children:a})),A1=R.createContext(!1),u3=()=>R.useContext(A1);A1.Provider;function c3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var f3=R.createContext(c3()),d3=()=>R.useContext(f3),h3=(e,a)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(a.isReset()||(e.retryOnMount=!1))},m3=e=>{R.useEffect(()=>{e.clearReset()},[e])},p3=({result:e,errorResetBoundary:a,throwOnError:i,query:o,suspense:l})=>e.isError&&!a.isReset()&&!e.isFetching&&o&&(l&&e.data===void 0||S1(i,[e.error,o])),g3=e=>{if(e.suspense){const i=l=>l==="static"?l:Math.max(l??1e3,1e3),o=e.staleTime;e.staleTime=typeof o=="function"?(...l)=>i(o(...l)):i(o),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},v3=(e,a)=>e.isLoading&&e.isFetching&&!a,y3=(e,a)=>e?.suspense&&a.isPending,B0=(e,a,i)=>a.fetchOptimistic(e).catch(()=>{i.clearReset()});function b3(e,a,i){const o=u3(),l=d3(),u=T1(),d=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(d),d._optimisticResults=o?"isRestoring":"optimistic",g3(d),h3(d,l),m3(l);const h=!u.getQueryCache().get(d.queryHash),[p]=R.useState(()=>new a(u,d)),m=p.getOptimisticResult(d),v=!o&&e.subscribed!==!1;if(R.useSyncExternalStore(R.useCallback(g=>{const b=v?p.subscribe(ce.batchCalls(g)):Ce;return p.updateResult(),b},[p,v]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),R.useEffect(()=>{p.setOptions(d)},[d,p]),y3(d,m))throw B0(d,p,l);if(p3({result:m,errorResetBoundary:l,throwOnError:d.throwOnError,query:u.getQueryCache().get(d.queryHash),suspense:d.suspense}))throw m.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(d,m),d.experimental_prefetchInRender&&!Lr&&v3(m,o)&&(h?B0(d,p,l):u.getQueryCache().get(d.queryHash)?.promise)?.catch(Ce).finally(()=>{p.updateResult()}),d.notifyOnChangeProps?m:p.trackResult(m)}function S3(e,a){return b3(e,W4)}function x3(e,a){const i=T1(),[o]=R.useState(()=>new i3(i,e));R.useEffect(()=>{o.setOptions(e)},[o,e]);const l=R.useSyncExternalStore(R.useCallback(d=>o.subscribe(ce.batchCalls(d)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),u=R.useCallback((d,h)=>{o.mutate(d,h).catch(Ce)},[o]);if(l.error&&S1(o.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:u,mutateAsync:l.mutate}}function w3(){return _.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(db,{className:"size-8 animate-spin"})})}function E3({className:e,...a}){const{setAuthenticated:i}=g1(),[o,l]=R.useState(""),[u,d]=R.useState(""),h=Qh(),{isPending:p,mutate:m}=x3({mutationFn:async()=>h.login(o,u),onError(){_0.error("Invalid credentials",{description:"The credentials you provided are invalid."})},onSuccess(){_0.success("Login successful",{description:"You have successfully logged in."}),i(!0)}});return p?_.jsx(w3,{}):_.jsx("div",{className:Rt("flex flex-col gap-6 w-[20%]",e),...a,children:_.jsxs(e4,{children:[_.jsxs(n4,{children:[_.jsx(a4,{className:"text-2xl",children:"Login"}),_.jsx(r4,{children:"Enter your credentials below to proceed"})]}),_.jsx(i4,{children:_.jsxs("div",{className:"flex flex-col gap-6",children:[_.jsxs("div",{className:"grid gap-2",children:[_.jsx(w0,{htmlFor:"username",children:"Username"}),_.jsx(zy,{id:"username",type:"username",placeholder:"Enter your username",required:!0,value:o,onChange:v=>l(v.target.value)})]}),_.jsxs("div",{className:"grid gap-2",children:[_.jsx("div",{className:"flex items-center",children:_.jsx(w0,{htmlFor:"password",children:"Password"})}),_.jsx(zy,{id:"password",type:"password",required:!0,value:u,onChange:v=>d(v.target.value)})]}),_.jsx(Ob,{type:"button",className:"w-full",onClick:()=>{m()},children:"Login"})]})})]})})}function R3({children:e}){const{authenticated:a,setAuthenticated:i}=g1(),o=Qh(),{isLoading:l,isError:u}=S3({queryKey:[],enabled:!a,queryFn:async()=>{const d=await o.fetchMe();return i(!!d),d},refetchOnWindowFocus:!0});return l?_.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(db,{className:"size-8 animate-spin"})}):u?_.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching user data."})}):a?_.jsx(_.Fragment,{children:e}):_.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(E3,{})})}function _3({...e}){return _.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function C3({className:e,...a}){return _.jsx("ol",{"data-slot":"breadcrumb-list",className:Rt("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...a})}function Ad({className:e,...a}){return _.jsx("li",{"data-slot":"breadcrumb-item",className:Rt("inline-flex items-center gap-1.5",e),...a})}function k0({asChild:e,className:a,...i}){const o=e?ls:"a";return _.jsx(o,{"data-slot":"breadcrumb-link",className:Rt("hover:text-foreground transition-colors",a),...i})}function T3({className:e,...a}){return _.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:Rt("text-foreground font-normal",e),...a})}function P0({children:e,className:a,...i}){return _.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Rt("[&>svg]:size-3.5",a),...i,children:e??_.jsx(PR,{})})}function A3(){const{toggleSidebar:e}=Bh();return _.jsx("header",{className:"bg-background sticky top-0 z-50 flex w-full items-center border-b",children:_.jsxs("div",{className:"flex h-(--header-height) w-full items-center gap-2 px-4",children:[_.jsx(Ob,{className:"h-8 w-8",variant:"ghost",size:"icon",onClick:e,children:_.jsx(qR,{})}),_.jsx(p2,{orientation:"vertical",className:"mr-2 h-4"}),_.jsx(_3,{className:"hidden sm:block",children:_.jsxs(C3,{children:[_.jsx(Ad,{children:_.jsx(k0,{href:"#",children:"/"})}),_.jsx(P0,{}),_.jsx(Ad,{children:_.jsx(T3,{children:"CommandKit"})}),_.jsx(P0,{}),_.jsx(Ad,{children:_.jsx(k0,{href:"#",children:"DevTools"})})]})})]})})}var O3=(e,a,i,o,l,u,d,h)=>{let p=document.documentElement,m=["light","dark"];function v(x){(Array.isArray(e)?e:[e]).forEach(S=>{let w=S==="class",C=w&&u?l.map(T=>u[T]||T):l;w?(p.classList.remove(...C),p.classList.add(u&&u[x]?u[x]:x)):p.setAttribute(S,x)}),g(x)}function g(x){h&&m.includes(x)&&(p.style.colorScheme=x)}function b(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(o)v(o);else try{let x=localStorage.getItem(a)||i,S=d&&x==="system"?b():x;v(S)}catch{}},H0=["light","dark"],O1="(prefers-color-scheme: dark)",M3=typeof window>"u",Zh=R.createContext(void 0),N3={setTheme:e=>{},themes:[]},D3=()=>{var e;return(e=R.useContext(Zh))!=null?e:N3},z3=e=>R.useContext(Zh)?R.createElement(R.Fragment,null,e.children):R.createElement(j3,{...e}),L3=["light","dark"],j3=({forcedTheme:e,disableTransitionOnChange:a=!1,enableSystem:i=!0,enableColorScheme:o=!0,storageKey:l="theme",themes:u=L3,defaultTheme:d=i?"system":"light",attribute:h="data-theme",value:p,children:m,nonce:v,scriptProps:g})=>{let[b,x]=R.useState(()=>B3(l,d)),[S,w]=R.useState(()=>b==="system"?Od():b),C=p?Object.values(p):u,T=R.useCallback(B=>{let K=B;if(!K)return;B==="system"&&i&&(K=Od());let j=p?p[K]:K,V=a?k3(v):null,et=document.documentElement,J=at=>{at==="class"?(et.classList.remove(...C),j&&et.classList.add(j)):at.startsWith("data-")&&(j?et.setAttribute(at,j):et.removeAttribute(at))};if(Array.isArray(h)?h.forEach(J):J(h),o){let at=H0.includes(d)?d:null,rt=H0.includes(K)?K:at;et.style.colorScheme=rt}V?.()},[v]),z=R.useCallback(B=>{let K=typeof B=="function"?B(b):B;x(K);try{localStorage.setItem(l,K)}catch{}},[b]),D=R.useCallback(B=>{let K=Od(B);w(K),b==="system"&&i&&!e&&T("system")},[b,e]);R.useEffect(()=>{let B=window.matchMedia(O1);return B.addListener(D),D(B),()=>B.removeListener(D)},[D]),R.useEffect(()=>{let B=K=>{K.key===l&&(K.newValue?x(K.newValue):z(d))};return window.addEventListener("storage",B),()=>window.removeEventListener("storage",B)},[z]),R.useEffect(()=>{T(e??b)},[e,b]);let U=R.useMemo(()=>({theme:b,setTheme:z,forcedTheme:e,resolvedTheme:b==="system"?S:b,themes:i?[...u,"system"]:u,systemTheme:i?S:void 0}),[b,z,e,S,i,u]);return R.createElement(Zh.Provider,{value:U},R.createElement(U3,{forcedTheme:e,storageKey:l,attribute:h,enableSystem:i,enableColorScheme:o,defaultTheme:d,value:p,themes:u,nonce:v,scriptProps:g}),m)},U3=R.memo(({forcedTheme:e,storageKey:a,attribute:i,enableSystem:o,enableColorScheme:l,defaultTheme:u,value:d,themes:h,nonce:p,scriptProps:m})=>{let v=JSON.stringify([i,a,u,e,h,d,o,l]).slice(1,-1);return R.createElement("script",{...m,suppressHydrationWarning:!0,nonce:typeof window>"u"?p:"",dangerouslySetInnerHTML:{__html:`(${O3.toString()})(${v})`}})}),B3=(e,a)=>{if(M3)return;let i;try{i=localStorage.getItem(e)||void 0}catch{}return i||a},k3=e=>{let a=document.createElement("style");return e&&a.setAttribute("nonce",e),a.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(a),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(a)},1)}},Od=e=>(e||(e=window.matchMedia(O1)),e.matches?"dark":"light");const P3=({...e})=>{const{theme:a="system"}=D3();return _.jsx(k4,{theme:a,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...e})},Br=bR({head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1"},{title:"CommandKit DevTools"}]}),component:H3});function H3(){return _.jsxs(z3,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!1,children:[_.jsx(P3,{}),_.jsx(WM,{children:_.jsx(R3,{children:_.jsx("div",{className:"[--header-height:calc(theme(spacing.14))]",children:_.jsxs(YA,{className:"flex flex-col",children:[_.jsx(A3,{}),_.jsxs("div",{className:"flex flex-1",children:[_.jsx(t4,{}),_.jsx(KA,{children:_.jsx(lb,{})})]})]})})})})]})}const q3="modulepreload",V3=function(e){return"/"+e},q0={},Ii=function(a,i,o){let l=Promise.resolve();if(i&&i.length>0){let p=function(m){return Promise.all(m.map(v=>Promise.resolve(v).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),h=d?.nonce||d?.getAttribute("nonce");l=p(i.map(m=>{if(m=V3(m),m in q0)return;q0[m]=!0;const v=m.endsWith(".css"),g=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${g}`))return;const b=document.createElement("link");if(b.rel=v?"stylesheet":q3,v||(b.as="script"),b.crossOrigin="",b.href=m,h&&b.setAttribute("nonce",h),document.head.appendChild(b),v)return new Promise((x,S)=>{b.addEventListener("load",x),b.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${m}`)))})}))}function u(d){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=d,window.dispatchEvent(h),!h.defaultPrevented)throw d}return l.then(d=>{for(const h of d||[])h.status==="rejected"&&u(h.reason);return a().catch(u)})},G3=()=>Ii(()=>import("./plugins-DT6C7FH7.js"),[]),F3=$a("/plugins")({component:Gi(G3,"component")}),Y3=()=>Ii(()=>import("./guilds-C8C2yqBX.js"),[]),Q3=$a("/guilds")({component:Gi(Y3,"component")}),K3=()=>Ii(()=>import("./feature-flags-D9HnT4_P.js"),[]),X3=$a("/feature-flags")({component:Gi(K3,"component")}),$3=()=>Ii(()=>import("./events-D8j5RlvU.js"),[]),I3=$a("/events")({component:Gi($3,"component")}),Z3=()=>Ii(()=>import("./commands-Cof2eLB0.js"),[]),J3=$a("/commands")({component:Gi(Z3,"component")}),W3=()=>Ii(()=>import("./index-Ctjq1-je.js"),[]),tN=$a("/")({component:Gi(W3,"component")}),eN=F3.update({id:"/plugins",path:"/plugins",getParentRoute:()=>Br}),nN=Q3.update({id:"/guilds",path:"/guilds",getParentRoute:()=>Br}),aN=X3.update({id:"/feature-flags",path:"/feature-flags",getParentRoute:()=>Br}),rN=I3.update({id:"/events",path:"/events",getParentRoute:()=>Br}),iN=J3.update({id:"/commands",path:"/commands",getParentRoute:()=>Br}),oN=tN.update({id:"/",path:"/",getParentRoute:()=>Br}),sN={IndexRoute:oN,CommandsRoute:iN,EventsRoute:rN,FeatureFlagsRoute:aN,GuildsRoute:nN,PluginsRoute:eN},lN=Br._addFileChildren(sN)._addFileTypes(),uN=AR({routeTree:lN,defaultPreload:"intent",defaultStaleTime:5e3,scrollRestoration:!0,defaultViewTransition:!0}),cN=new s3;Iw.createRoot(document.getElementById("root")).render(_.jsx(R.StrictMode,{children:_.jsx(l3,{client:cN,children:_.jsx(NR,{router:uN})})}));export{fO as A,pO as B,e4 as C,w3 as L,S3 as a,n4 as b,dO as c,hO as d,i4 as e,a4 as f,V0 as g,r4 as h,Ja as i,_ as j,PR as k,DN as l,Vi as m,Ob as n,R as r,Qh as u};
|
|
59
|
+
`+u):o.stack=u}catch{}}throw o}}_request(a,i){typeof a=="string"?(i=i||{},i.url=a):i=a||{},i=zr(this.defaults,i);const{transitional:o,paramsSerializer:l,headers:u}=i;o!==void 0&&nu.assertOptions(o,{silentJSONParsing:un.transitional(un.boolean),forcedJSONParsing:un.transitional(un.boolean),clarifyTimeoutError:un.transitional(un.boolean),legacyInterceptorReqResOrdering:un.transitional(un.boolean)},!1),l!=null&&(G.isFunction(l)?i.paramsSerializer={serialize:l}:nu.assertOptions(l,{encode:un.function,serialize:un.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),nu.assertOptions(i,{baseUrl:un.spelling("baseURL"),withXsrfToken:un.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let d=u&&G.merge(u.common,u[i.method]);u&&G.forEach(["delete","get","head","post","put","patch","common"],S=>{delete u[S]}),i.headers=Ve.concat(d,u);const h=[];let p=!0;this.interceptors.request.forEach(function(w){if(typeof w.runWhen=="function"&&w.runWhen(i)===!1)return;p=p&&w.synchronous;const C=i.transitional||Vh;C&&C.legacyInterceptorReqResOrdering?h.unshift(w.fulfilled,w.rejected):h.push(w.fulfilled,w.rejected)});const m=[];this.interceptors.response.forEach(function(w){m.push(w.fulfilled,w.rejected)});let v,g=0,b;if(!p){const S=[b0.bind(this),void 0];for(S.unshift(...h),S.push(...m),b=S.length,v=Promise.resolve(i);g<b;)v=v.then(S[g++],S[g++]);return v}b=h.length;let x=i;for(;g<b;){const S=h[g++],w=h[g++];try{x=S(x)}catch(C){w.call(this,C);break}}try{v=b0.call(this,x)}catch(S){return Promise.reject(S)}for(g=0,b=m.length;g<b;)v=v.then(m[g++],m[g++]);return v}getUri(a){a=zr(this.defaults,a);const i=s1(a.baseURL,a.url,a.allowAbsoluteUrls);return a1(i,a.params,a.paramsSerializer)}};G.forEach(["delete","get","head","options"],function(a){Tr.prototype[a]=function(i,o){return this.request(zr(o||{},{method:a,url:i,data:(o||{}).data}))}});G.forEach(["post","put","patch"],function(a){function i(o){return function(u,d,h){return this.request(zr(h||{},{method:a,headers:o?{"Content-Type":"multipart/form-data"}:{},url:u,data:d}))}}Tr.prototype[a]=i(),Tr.prototype[a+"Form"]=i(!0)});let QM=class d1{constructor(a){if(typeof a!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(u){i=u});const o=this;this.promise.then(l=>{if(!o._listeners)return;let u=o._listeners.length;for(;u-- >0;)o._listeners[u](l);o._listeners=null}),this.promise.then=l=>{let u;const d=new Promise(h=>{o.subscribe(h),u=h}).then(l);return d.cancel=function(){o.unsubscribe(u)},d},a(function(u,d,h){o.reason||(o.reason=new ys(u,d,h),i(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(a){if(this.reason){a(this.reason);return}this._listeners?this._listeners.push(a):this._listeners=[a]}unsubscribe(a){if(!this._listeners)return;const i=this._listeners.indexOf(a);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const a=new AbortController,i=o=>{a.abort(o)};return this.subscribe(i),a.signal.unsubscribe=()=>this.unsubscribe(i),a.signal}static source(){let a;return{token:new d1(function(l){a=l}),cancel:a}}};function KM(e){return function(i){return e.apply(null,i)}}function XM(e){return G.isObject(e)&&e.isAxiosError===!0}const Id={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Id).forEach(([e,a])=>{Id[a]=e});function h1(e){const a=new Tr(e),i=QS(Tr.prototype.request,a);return G.extend(i,Tr.prototype,a,{allOwnKeys:!0}),G.extend(i,a,null,{allOwnKeys:!0}),i.create=function(l){return h1(zr(e,l))},i}const ne=h1(vs);ne.Axios=Tr;ne.CanceledError=ys;ne.CancelToken=QM;ne.isCancel=i1;ne.VERSION=f1;ne.toFormData=Lu;ne.AxiosError=yt;ne.Cancel=ne.CanceledError;ne.all=function(a){return Promise.all(a)};ne.spread=KM;ne.isAxiosError=XM;ne.mergeConfig=zr;ne.AxiosHeaders=Ve;ne.formToJSON=e=>r1(G.isHTMLForm(e)?new FormData(e):e);ne.getAdapter=c1.getAdapter;ne.HttpStatusCode=Id;ne.default=ne;const{Axios:gN,AxiosError:vN,CanceledError:yN,isCancel:bN,CancelToken:SN,VERSION:xN,all:wN,Cancel:EN,isAxiosError:RN,spread:_N,toFormData:CN,AxiosHeaders:TN,HttpStatusCode:AN,formToJSON:ON,getAdapter:MN,mergeConfig:NN}=ne,Yh=ne.create({baseURL:"/api"});Yh.interceptors.request.use(e=>{const a=localStorage.getItem("access_token");return a&&(e.headers.Authorization=`Bearer ${a}`),e});Yh.interceptors.response.use(e=>e,e=>(e.response.status===401&&(localStorage.removeItem("access_token"),window.location.href="/"),Promise.reject(e)));class x0{constructor(a,i){this.client=a,this.data=i}}class $M{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/events");return a.events}}class IM{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/guilds");return a.guilds}}class ZM{constructor(a){this.client=a}async fetch(){const{data:a}=await this.client.api.get("/plugins");return a.plugins}}class JM{api=Yh;guilds=new IM(this);plugins=new ZM(this);events=new $M(this);_user=null;get user(){return this._user}isReady(){return this._user!==null}logout(){localStorage.removeItem("access_token"),this._user=null}async fetchMe(a=!1){if(this._user&&!a)return this._user;const{data:i}=await this.api.get("/auth/@me");return this._user=new x0(this,i),this._user}async getFeatureFlags(){const{data:a}=await this.api.get("/feature-flags");return a}async login(a,i){const{data:o}=await this.api.post("/auth/login",{username:a,password:i});return o.accessToken&&localStorage.setItem("access_token",o.accessToken),this._user=new x0(this,o.user),o}}const m1=R.createContext(null);function WM({children:e}){const[a,i]=R.useState(()=>new JM);return _.jsx(m1.Provider,{value:{client:a,setClient:i},children:e})}function Qh(){const e=R.use(m1);if(!e)throw new Error("useClient must be used within a ClientProvider");return e.client}const Td={navMain:[{title:"Commands",url:"/commands",icon:wy,isActive:!1},{title:"Events",url:"/events",icon:xy,isActive:!1},{title:"Plugins",url:"/plugins",icon:GR,isActive:!1},{title:"Guilds",url:"/guilds",icon:_y,isActive:!1},{title:"Feature Flags",url:"/feature-flags",icon:YR,isActive:!1}],navSecondary:[{title:"GitHub",url:"https://github.com/neplextech/commandkit",icon:r_},{title:"Discord",url:"https://commandkit.dev/discord",icon:_y}],projects:[{name:"Commands",url:"#",icon:wy},{name:"Middlewares",url:"#",icon:XR},{name:"Events",url:"#",icon:xy}]};function t4({...e}){const a=Qh();return _.jsxs(QA,{className:"top-(--header-height) h-[calc(100svh-var(--header-height))]!",...e,children:[_.jsx(XA,{children:_.jsx(fs,{children:_.jsx(ds,{children:_.jsx(hs,{size:"lg",asChild:!0,children:_.jsxs(Vi,{to:"/",children:[_.jsx("div",{className:"border-sidebar-primary border text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-lg",children:_.jsx("img",{src:"/logo.webp",alt:"Logo",className:"size-6"})}),_.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[_.jsx("span",{className:"truncate font-medium",children:"CommandKit"}),_.jsx("span",{className:"truncate text-xs",children:"DevTools"})]})]})})})})}),_.jsxs(IA,{children:[_.jsx(WA,{items:Td.navMain}),_.jsx(tO,{projects:Td.projects}),_.jsx(eO,{items:Td.navSecondary,className:"mt-auto"})]}),_.jsx($A,{children:_.jsx(gO,{user:{avatar:a.user.data.displayAvatarURL,name:a.user.data.globalName||a.user?.data.username,username:a.user.data.username}})})]})}function e4({className:e,...a}){return _.jsx("div",{"data-slot":"card",className:Rt("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...a})}function n4({className:e,...a}){return _.jsx("div",{"data-slot":"card-header",className:Rt("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...a})}function a4({className:e,...a}){return _.jsx("div",{"data-slot":"card-title",className:Rt("leading-none font-semibold",e),...a})}function r4({className:e,...a}){return _.jsx("div",{"data-slot":"card-description",className:Rt("text-muted-foreground text-sm",e),...a})}function i4({className:e,...a}){return _.jsx("div",{"data-slot":"card-content",className:Rt("px-6",e),...a})}function DN({className:e,...a}){return _.jsx("div",{"data-slot":"card-footer",className:Rt("flex items-center px-6 [.border-t]:pt-6",e),...a})}var o4="Label",p1=R.forwardRef((e,a)=>_.jsx(Jt.label,{...e,ref:a,onMouseDown:i=>{i.target.closest("button, input, select, textarea")||(e.onMouseDown?.(i),!i.defaultPrevented&&i.detail>1&&i.preventDefault())}}));p1.displayName=o4;var s4=p1;function w0({className:e,...a}){return _.jsx(s4,{"data-slot":"label",className:Rt("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...a})}const E0=e=>{let a;const i=new Set,o=(m,v)=>{const g=typeof m=="function"?m(a):m;if(!Object.is(g,a)){const b=a;a=v??(typeof g!="object"||g===null)?g:Object.assign({},a,g),i.forEach(x=>x(a,b))}},l=()=>a,h={setState:o,getState:l,getInitialState:()=>p,subscribe:m=>(i.add(m),()=>i.delete(m))},p=a=e(o,l,h);return h},l4=(e=>e?E0(e):E0),u4=e=>e;function c4(e,a=u4){const i=tt.useSyncExternalStore(e.subscribe,tt.useCallback(()=>a(e.getState()),[e,a]),tt.useCallback(()=>a(e.getInitialState()),[e,a]));return tt.useDebugValue(i),i}const R0=e=>{const a=l4(e),i=o=>c4(a,o);return Object.assign(i,a),i},f4=(e=>e?R0(e):R0),g1=f4(e=>({authenticated:!1,setAuthenticated:a=>e({authenticated:a})}));function d4(e){if(typeof document>"u")return;let a=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",a.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}const h4=e=>{switch(e){case"success":return g4;case"info":return y4;case"warning":return v4;case"error":return b4;default:return null}},m4=Array(12).fill(0),p4=({visible:e,className:a})=>tt.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":e},tt.createElement("div",{className:"sonner-spinner"},m4.map((i,o)=>tt.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),g4=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},tt.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),v4=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},tt.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),y4=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},tt.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),b4=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},tt.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),S4=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},tt.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),tt.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),x4=()=>{const[e,a]=tt.useState(document.hidden);return tt.useEffect(()=>{const i=()=>{a(document.hidden)};return document.addEventListener("visibilitychange",i),()=>window.removeEventListener("visibilitychange",i)},[]),e};let Zd=1;class w4{constructor(){this.subscribe=a=>(this.subscribers.push(a),()=>{const i=this.subscribers.indexOf(a);this.subscribers.splice(i,1)}),this.publish=a=>{this.subscribers.forEach(i=>i(a))},this.addToast=a=>{this.publish(a),this.toasts=[...this.toasts,a]},this.create=a=>{var i;const{message:o,...l}=a,u=typeof a?.id=="number"||((i=a.id)==null?void 0:i.length)>0?a.id:Zd++,d=this.toasts.find(p=>p.id===u),h=a.dismissible===void 0?!0:a.dismissible;return this.dismissedToasts.has(u)&&this.dismissedToasts.delete(u),d?this.toasts=this.toasts.map(p=>p.id===u?(this.publish({...p,...a,id:u,title:o}),{...p,...a,id:u,dismissible:h,title:o}):p):this.addToast({title:o,...l,dismissible:h,id:u}),u},this.dismiss=a=>(a?(this.dismissedToasts.add(a),requestAnimationFrame(()=>this.subscribers.forEach(i=>i({id:a,dismiss:!0})))):this.toasts.forEach(i=>{this.subscribers.forEach(o=>o({id:i.id,dismiss:!0}))}),a),this.message=(a,i)=>this.create({...i,message:a}),this.error=(a,i)=>this.create({...i,message:a,type:"error"}),this.success=(a,i)=>this.create({...i,type:"success",message:a}),this.info=(a,i)=>this.create({...i,type:"info",message:a}),this.warning=(a,i)=>this.create({...i,type:"warning",message:a}),this.loading=(a,i)=>this.create({...i,type:"loading",message:a}),this.promise=(a,i)=>{if(!i)return;let o;i.loading!==void 0&&(o=this.create({...i,promise:a,type:"loading",message:i.loading,description:typeof i.description!="function"?i.description:void 0}));const l=Promise.resolve(a instanceof Function?a():a);let u=o!==void 0,d;const h=l.then(async m=>{if(d=["resolve",m],tt.isValidElement(m))u=!1,this.create({id:o,type:"default",message:m});else if(R4(m)&&!m.ok){u=!1;const g=typeof i.error=="function"?await i.error(`HTTP error! status: ${m.status}`):i.error,b=typeof i.description=="function"?await i.description(`HTTP error! status: ${m.status}`):i.description,S=typeof g=="object"&&!tt.isValidElement(g)?g:{message:g};this.create({id:o,type:"error",description:b,...S})}else if(m instanceof Error){u=!1;const g=typeof i.error=="function"?await i.error(m):i.error,b=typeof i.description=="function"?await i.description(m):i.description,S=typeof g=="object"&&!tt.isValidElement(g)?g:{message:g};this.create({id:o,type:"error",description:b,...S})}else if(i.success!==void 0){u=!1;const g=typeof i.success=="function"?await i.success(m):i.success,b=typeof i.description=="function"?await i.description(m):i.description,S=typeof g=="object"&&!tt.isValidElement(g)?g:{message:g};this.create({id:o,type:"success",description:b,...S})}}).catch(async m=>{if(d=["reject",m],i.error!==void 0){u=!1;const v=typeof i.error=="function"?await i.error(m):i.error,g=typeof i.description=="function"?await i.description(m):i.description,x=typeof v=="object"&&!tt.isValidElement(v)?v:{message:v};this.create({id:o,type:"error",description:g,...x})}}).finally(()=>{u&&(this.dismiss(o),o=void 0),i.finally==null||i.finally.call(i)}),p=()=>new Promise((m,v)=>h.then(()=>d[0]==="reject"?v(d[1]):m(d[1])).catch(v));return typeof o!="string"&&typeof o!="number"?{unwrap:p}:Object.assign(o,{unwrap:p})},this.custom=(a,i)=>{const o=i?.id||Zd++;return this.create({jsx:a(o),id:o,...i}),o},this.getActiveToasts=()=>this.toasts.filter(a=>!this.dismissedToasts.has(a.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Pe=new w4,E4=(e,a)=>{const i=a?.id||Zd++;return Pe.addToast({title:e,...a,id:i}),i},R4=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",_4=E4,C4=()=>Pe.toasts,T4=()=>Pe.getActiveToasts(),_0=Object.assign(_4,{success:Pe.success,info:Pe.info,warning:Pe.warning,error:Pe.error,custom:Pe.custom,message:Pe.message,promise:Pe.promise,dismiss:Pe.dismiss,loading:Pe.loading},{getHistory:C4,getToasts:T4});d4("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Kl(e){return e.label!==void 0}const A4=3,O4="24px",M4="16px",C0=4e3,N4=356,D4=14,z4=45,L4=200;function Ln(...e){return e.filter(Boolean).join(" ")}function j4(e){const[a,i]=e.split("-"),o=[];return a&&o.push(a),i&&o.push(i),o}const U4=e=>{var a,i,o,l,u,d,h,p,m;const{invert:v,toast:g,unstyled:b,interacting:x,setHeights:S,visibleToasts:w,heights:C,index:T,toasts:z,expanded:D,removeToast:U,defaultRichColors:B,closeButton:K,style:j,cancelButtonStyle:V,actionButtonStyle:et,className:J="",descriptionClassName:at="",duration:rt,position:ht,gap:st,expandByDefault:bt,classNames:M,icons:X,closeButtonAriaLabel:H="Close toast"}=e,[ft,mt]=tt.useState(null),[O,Y]=tt.useState(null),[Q,W]=tt.useState(!1),[nt,ct]=tt.useState(!1),[it,gt]=tt.useState(!1),[_t,Wt]=tt.useState(!1),[Kt,se]=tt.useState(!1),[vn,Ae]=tt.useState(0),[Wa,ma]=tt.useState(0),Vn=tt.useRef(g.duration||rt||C0),Tn=tt.useRef(null),fe=tt.useRef(null),pa=T===0,ga=T+1<=w,Ct=g.type,Xt=g.dismissible!==!1,Ft=g.className||"",bs=g.descriptionClassName||"",tr=tt.useMemo(()=>C.findIndex(St=>St.toastId===g.id)||0,[C,g.id]),Ss=tt.useMemo(()=>{var St;return(St=g.closeButton)!=null?St:K},[g.closeButton,K]),er=tt.useMemo(()=>g.duration||rt||C0,[g.duration,rt]),Zi=tt.useRef(0),Gn=tt.useRef(0),xs=tt.useRef(0),va=tt.useRef(null),[nr,Re]=ht.split("-"),yn=tt.useMemo(()=>C.reduce((St,Yt,de)=>de>=tr?St:St+Yt.height,0),[C,tr]),Se=x4(),Uu=g.invert||v,Ji=Ct==="loading";Gn.current=tt.useMemo(()=>tr*st+yn,[tr,yn]),tt.useEffect(()=>{Vn.current=er},[er]),tt.useEffect(()=>{W(!0)},[]),tt.useEffect(()=>{const St=fe.current;if(St){const Yt=St.getBoundingClientRect().height;return ma(Yt),S(de=>[{toastId:g.id,height:Yt,position:g.position},...de]),()=>S(de=>de.filter(xe=>xe.toastId!==g.id))}},[S,g.id]),tt.useLayoutEffect(()=>{if(!Q)return;const St=fe.current,Yt=St.style.height;St.style.height="auto";const de=St.getBoundingClientRect().height;St.style.height=Yt,ma(de),S(xe=>xe.find($t=>$t.toastId===g.id)?xe.map($t=>$t.toastId===g.id?{...$t,height:de}:$t):[{toastId:g.id,height:de,position:g.position},...xe])},[Q,g.title,g.description,S,g.id,g.jsx,g.action,g.cancel]);const An=tt.useCallback(()=>{ct(!0),Ae(Gn.current),S(St=>St.filter(Yt=>Yt.toastId!==g.id)),setTimeout(()=>{U(g)},L4)},[g,U,S,Gn]);tt.useEffect(()=>{if(g.promise&&Ct==="loading"||g.duration===1/0||g.type==="loading")return;let St;return D||x||Se?(()=>{if(xs.current<Zi.current){const xe=new Date().getTime()-Zi.current;Vn.current=Vn.current-xe}xs.current=new Date().getTime()})():Vn.current!==1/0&&(Zi.current=new Date().getTime(),St=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),An()},Vn.current)),()=>clearTimeout(St)},[D,x,g,Ct,Se,An]),tt.useEffect(()=>{g.delete&&(An(),g.onDismiss==null||g.onDismiss.call(g,g))},[An,g.delete]);function kr(){var St;if(X?.loading){var Yt;return tt.createElement("div",{className:Ln(M?.loader,g==null||(Yt=g.classNames)==null?void 0:Yt.loader,"sonner-loader"),"data-visible":Ct==="loading"},X.loading)}return tt.createElement(p4,{className:Ln(M?.loader,g==null||(St=g.classNames)==null?void 0:St.loader),visible:Ct==="loading"})}const Pr=g.icon||X?.[Ct]||h4(Ct);var ar,On;return tt.createElement("li",{tabIndex:0,ref:fe,className:Ln(J,Ft,M?.toast,g==null||(a=g.classNames)==null?void 0:a.toast,M?.default,M?.[Ct],g==null||(i=g.classNames)==null?void 0:i[Ct]),"data-sonner-toast":"","data-rich-colors":(ar=g.richColors)!=null?ar:B,"data-styled":!(g.jsx||g.unstyled||b),"data-mounted":Q,"data-promise":!!g.promise,"data-swiped":Kt,"data-removed":nt,"data-visible":ga,"data-y-position":nr,"data-x-position":Re,"data-index":T,"data-front":pa,"data-swiping":it,"data-dismissible":Xt,"data-type":Ct,"data-invert":Uu,"data-swipe-out":_t,"data-swipe-direction":O,"data-expanded":!!(D||bt&&Q),"data-testid":g.testId,style:{"--index":T,"--toasts-before":T,"--z-index":z.length-T,"--offset":`${nt?vn:Gn.current}px`,"--initial-height":bt?"auto":`${Wa}px`,...j,...g.style},onDragEnd:()=>{gt(!1),mt(null),va.current=null},onPointerDown:St=>{St.button!==2&&(Ji||!Xt||(Tn.current=new Date,Ae(Gn.current),St.target.setPointerCapture(St.pointerId),St.target.tagName!=="BUTTON"&&(gt(!0),va.current={x:St.clientX,y:St.clientY})))},onPointerUp:()=>{var St,Yt,de;if(_t||!Xt)return;va.current=null;const xe=Number(((St=fe.current)==null?void 0:St.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ya=Number(((Yt=fe.current)==null?void 0:Yt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),$t=new Date().getTime()-((de=Tn.current)==null?void 0:de.getTime()),Oe=ft==="x"?xe:ya,rr=Math.abs(Oe)/$t;if(Math.abs(Oe)>=z4||rr>.11){Ae(Gn.current),g.onDismiss==null||g.onDismiss.call(g,g),Y(ft==="x"?xe>0?"right":"left":ya>0?"down":"up"),An(),Wt(!0);return}else{var Me,Ne;(Me=fe.current)==null||Me.style.setProperty("--swipe-amount-x","0px"),(Ne=fe.current)==null||Ne.style.setProperty("--swipe-amount-y","0px")}se(!1),gt(!1),mt(null)},onPointerMove:St=>{var Yt,de,xe;if(!va.current||!Xt||((Yt=window.getSelection())==null?void 0:Yt.toString().length)>0)return;const $t=St.clientY-va.current.y,Oe=St.clientX-va.current.x;var rr;const Me=(rr=e.swipeDirections)!=null?rr:j4(ht);!ft&&(Math.abs(Oe)>1||Math.abs($t)>1)&&mt(Math.abs(Oe)>Math.abs($t)?"x":"y");let Ne={x:0,y:0};const Hr=bn=>1/(1.5+Math.abs(bn)/20);if(ft==="y"){if(Me.includes("top")||Me.includes("bottom"))if(Me.includes("top")&&$t<0||Me.includes("bottom")&&$t>0)Ne.y=$t;else{const bn=$t*Hr($t);Ne.y=Math.abs(bn)<Math.abs($t)?bn:$t}}else if(ft==="x"&&(Me.includes("left")||Me.includes("right")))if(Me.includes("left")&&Oe<0||Me.includes("right")&&Oe>0)Ne.x=Oe;else{const bn=Oe*Hr(Oe);Ne.x=Math.abs(bn)<Math.abs(Oe)?bn:Oe}(Math.abs(Ne.x)>0||Math.abs(Ne.y)>0)&&se(!0),(de=fe.current)==null||de.style.setProperty("--swipe-amount-x",`${Ne.x}px`),(xe=fe.current)==null||xe.style.setProperty("--swipe-amount-y",`${Ne.y}px`)}},Ss&&!g.jsx&&Ct!=="loading"?tt.createElement("button",{"aria-label":H,"data-disabled":Ji,"data-close-button":!0,onClick:Ji||!Xt?()=>{}:()=>{An(),g.onDismiss==null||g.onDismiss.call(g,g)},className:Ln(M?.closeButton,g==null||(o=g.classNames)==null?void 0:o.closeButton)},(On=X?.close)!=null?On:S4):null,(Ct||g.icon||g.promise)&&g.icon!==null&&(X?.[Ct]!==null||g.icon)?tt.createElement("div",{"data-icon":"",className:Ln(M?.icon,g==null||(l=g.classNames)==null?void 0:l.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||kr():null,g.type!=="loading"?Pr:null):null,tt.createElement("div",{"data-content":"",className:Ln(M?.content,g==null||(u=g.classNames)==null?void 0:u.content)},tt.createElement("div",{"data-title":"",className:Ln(M?.title,g==null||(d=g.classNames)==null?void 0:d.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?tt.createElement("div",{"data-description":"",className:Ln(at,bs,M?.description,g==null||(h=g.classNames)==null?void 0:h.description)},typeof g.description=="function"?g.description():g.description):null),tt.isValidElement(g.cancel)?g.cancel:g.cancel&&Kl(g.cancel)?tt.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||V,onClick:St=>{Kl(g.cancel)&&Xt&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,St),An())},className:Ln(M?.cancelButton,g==null||(p=g.classNames)==null?void 0:p.cancelButton)},g.cancel.label):null,tt.isValidElement(g.action)?g.action:g.action&&Kl(g.action)?tt.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||et,onClick:St=>{Kl(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,St),!St.defaultPrevented&&An())},className:Ln(M?.actionButton,g==null||(m=g.classNames)==null?void 0:m.actionButton)},g.action.label):null)};function T0(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function B4(e,a){const i={};return[e,a].forEach((o,l)=>{const u=l===1,d=u?"--mobile-offset":"--offset",h=u?M4:O4;function p(m){["top","right","bottom","left"].forEach(v=>{i[`${d}-${v}`]=typeof m=="number"?`${m}px`:m})}typeof o=="number"||typeof o=="string"?p(o):typeof o=="object"?["top","right","bottom","left"].forEach(m=>{o[m]===void 0?i[`${d}-${m}`]=h:i[`${d}-${m}`]=typeof o[m]=="number"?`${o[m]}px`:o[m]}):p(h)}),i}const k4=tt.forwardRef(function(a,i){const{id:o,invert:l,position:u="bottom-right",hotkey:d=["altKey","KeyT"],expand:h,closeButton:p,className:m,offset:v,mobileOffset:g,theme:b="light",richColors:x,duration:S,style:w,visibleToasts:C=A4,toastOptions:T,dir:z=T0(),gap:D=D4,icons:U,containerAriaLabel:B="Notifications"}=a,[K,j]=tt.useState([]),V=tt.useMemo(()=>o?K.filter(Q=>Q.toasterId===o):K.filter(Q=>!Q.toasterId),[K,o]),et=tt.useMemo(()=>Array.from(new Set([u].concat(V.filter(Q=>Q.position).map(Q=>Q.position)))),[V,u]),[J,at]=tt.useState([]),[rt,ht]=tt.useState(!1),[st,bt]=tt.useState(!1),[M,X]=tt.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=tt.useRef(null),ft=d.join("+").replace(/Key/g,"").replace(/Digit/g,""),mt=tt.useRef(null),O=tt.useRef(!1),Y=tt.useCallback(Q=>{j(W=>{var nt;return(nt=W.find(ct=>ct.id===Q.id))!=null&&nt.delete||Pe.dismiss(Q.id),W.filter(({id:ct})=>ct!==Q.id)})},[]);return tt.useEffect(()=>Pe.subscribe(Q=>{if(Q.dismiss){requestAnimationFrame(()=>{j(W=>W.map(nt=>nt.id===Q.id?{...nt,delete:!0}:nt))});return}setTimeout(()=>{ib.flushSync(()=>{j(W=>{const nt=W.findIndex(ct=>ct.id===Q.id);return nt!==-1?[...W.slice(0,nt),{...W[nt],...Q},...W.slice(nt+1)]:[Q,...W]})})})}),[K]),tt.useEffect(()=>{if(b!=="system"){X(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?X("dark"):X("light")),typeof window>"u")return;const Q=window.matchMedia("(prefers-color-scheme: dark)");try{Q.addEventListener("change",({matches:W})=>{X(W?"dark":"light")})}catch{Q.addListener(({matches:nt})=>{try{X(nt?"dark":"light")}catch(ct){console.error(ct)}})}},[b]),tt.useEffect(()=>{K.length<=1&&ht(!1)},[K]),tt.useEffect(()=>{const Q=W=>{var nt;if(d.every(gt=>W[gt]||W.code===gt)){var it;ht(!0),(it=H.current)==null||it.focus()}W.code==="Escape"&&(document.activeElement===H.current||(nt=H.current)!=null&&nt.contains(document.activeElement))&&ht(!1)};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[d]),tt.useEffect(()=>{if(H.current)return()=>{mt.current&&(mt.current.focus({preventScroll:!0}),mt.current=null,O.current=!1)}},[H.current]),tt.createElement("section",{ref:i,"aria-label":`${B} ${ft}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},et.map((Q,W)=>{var nt;const[ct,it]=Q.split("-");return V.length?tt.createElement("ol",{key:Q,dir:z==="auto"?T0():z,tabIndex:-1,ref:H,className:m,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":ct,"data-x-position":it,style:{"--front-toast-height":`${((nt=J[0])==null?void 0:nt.height)||0}px`,"--width":`${N4}px`,"--gap":`${D}px`,...w,...B4(v,g)},onBlur:gt=>{O.current&&!gt.currentTarget.contains(gt.relatedTarget)&&(O.current=!1,mt.current&&(mt.current.focus({preventScroll:!0}),mt.current=null))},onFocus:gt=>{gt.target instanceof HTMLElement&>.target.dataset.dismissible==="false"||O.current||(O.current=!0,mt.current=gt.relatedTarget)},onMouseEnter:()=>ht(!0),onMouseMove:()=>ht(!0),onMouseLeave:()=>{st||ht(!1)},onDragEnd:()=>ht(!1),onPointerDown:gt=>{gt.target instanceof HTMLElement&>.target.dataset.dismissible==="false"||bt(!0)},onPointerUp:()=>bt(!1)},V.filter(gt=>!gt.position&&W===0||gt.position===Q).map((gt,_t)=>{var Wt,Kt;return tt.createElement(U4,{key:gt.id,icons:U,index:_t,toast:gt,defaultRichColors:x,duration:(Wt=T?.duration)!=null?Wt:S,className:T?.className,descriptionClassName:T?.descriptionClassName,invert:l,visibleToasts:C,closeButton:(Kt=T?.closeButton)!=null?Kt:p,interacting:st,position:Q,style:T?.style,unstyled:T?.unstyled,classNames:T?.classNames,cancelButtonStyle:T?.cancelButtonStyle,actionButtonStyle:T?.actionButtonStyle,closeButtonAriaLabel:T?.closeButtonAriaLabel,removeToast:Y,toasts:V.filter(se=>se.position==gt.position),heights:J.filter(se=>se.position==gt.position),setHeights:at,expandByDefault:h,gap:D,expanded:rt,swipeDirections:a.swipeDirections})})):null}))});var $i=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(){}},P4={setTimeout:(e,a)=>setTimeout(e,a),clearTimeout:e=>clearTimeout(e),setInterval:(e,a)=>setInterval(e,a),clearInterval:e=>clearInterval(e)},H4=class{#t=P4;#e=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,a){return this.#t.setTimeout(e,a)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,a){return this.#t.setInterval(e,a)}clearInterval(e){this.#t.clearInterval(e)}},Rr=new H4;function q4(e){setTimeout(e,0)}var Lr=typeof window>"u"||"Deno"in globalThis;function Ce(){}function V4(e,a){return typeof e=="function"?e(a):e}function Jd(e){return typeof e=="number"&&e>=0&&e!==1/0}function v1(e,a){return Math.max(e+(a||0)-Date.now(),0)}function Xa(e,a){return typeof e=="function"?e(a):e}function dn(e,a){return typeof e=="function"?e(a):e}function A0(e,a){const{type:i="all",exact:o,fetchStatus:l,predicate:u,queryKey:d,stale:h}=e;if(d){if(o){if(a.queryHash!==Kh(d,a.options))return!1}else if(!is(a.queryKey,d))return!1}if(i!=="all"){const p=a.isActive();if(i==="active"&&!p||i==="inactive"&&p)return!1}return!(typeof h=="boolean"&&a.isStale()!==h||l&&l!==a.state.fetchStatus||u&&!u(a))}function O0(e,a){const{exact:i,status:o,predicate:l,mutationKey:u}=e;if(u){if(!a.options.mutationKey)return!1;if(i){if(jr(a.options.mutationKey)!==jr(u))return!1}else if(!is(a.options.mutationKey,u))return!1}return!(o&&a.state.status!==o||l&&!l(a))}function Kh(e,a){return(a?.queryKeyHashFn||jr)(e)}function jr(e){return JSON.stringify(e,(a,i)=>Wd(i)?Object.keys(i).sort().reduce((o,l)=>(o[l]=i[l],o),{}):i)}function is(e,a){return e===a?!0:typeof e!=typeof a?!1:e&&a&&typeof e=="object"&&typeof a=="object"?Object.keys(a).every(i=>is(e[i],a[i])):!1}var G4=Object.prototype.hasOwnProperty;function y1(e,a){if(e===a)return e;const i=M0(e)&&M0(a);if(!i&&!(Wd(e)&&Wd(a)))return a;const l=(i?e:Object.keys(e)).length,u=i?a:Object.keys(a),d=u.length,h=i?new Array(d):{};let p=0;for(let m=0;m<d;m++){const v=i?m:u[m],g=e[v],b=a[v];if(g===b){h[v]=g,(i?m<l:G4.call(e,v))&&p++;continue}if(g===null||b===null||typeof g!="object"||typeof b!="object"){h[v]=b;continue}const x=y1(g,b);h[v]=x,x===g&&p++}return l===d&&p===l?e:h}function vu(e,a){if(!a||Object.keys(e).length!==Object.keys(a).length)return!1;for(const i in e)if(e[i]!==a[i])return!1;return!0}function M0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Wd(e){if(!N0(e))return!1;const a=e.constructor;if(a===void 0)return!0;const i=a.prototype;return!(!N0(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function N0(e){return Object.prototype.toString.call(e)==="[object Object]"}function F4(e){return new Promise(a=>{Rr.setTimeout(a,e)})}function th(e,a,i){return typeof i.structuralSharing=="function"?i.structuralSharing(e,a):i.structuralSharing!==!1?y1(e,a):a}function Y4(e,a,i=0){const o=[...e,a];return i&&o.length>i?o.slice(1):o}function Q4(e,a,i=0){const o=[a,...e];return i&&o.length>i?o.slice(0,-1):o}var Xh=Symbol();function b1(e,a){return!e.queryFn&&a?.initialPromise?()=>a.initialPromise:!e.queryFn||e.queryFn===Xh?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function S1(e,a){return typeof e=="function"?e(...a):!!e}var K4=class extends $i{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Lr&&window.addEventListener){const a=()=>e();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(a=>{a(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},$h=new K4;function eh(){let e,a;const i=new Promise((l,u)=>{e=l,a=u});i.status="pending",i.catch(()=>{});function o(l){Object.assign(i,l),delete i.resolve,delete i.reject}return i.resolve=l=>{o({status:"fulfilled",value:l}),e(l)},i.reject=l=>{o({status:"rejected",reason:l}),a(l)},i}var X4=q4;function $4(){let e=[],a=0,i=h=>{h()},o=h=>{h()},l=X4;const u=h=>{a?e.push(h):l(()=>{i(h)})},d=()=>{const h=e;e=[],h.length&&l(()=>{o(()=>{h.forEach(p=>{i(p)})})})};return{batch:h=>{let p;a++;try{p=h()}finally{a--,a||d()}return p},batchCalls:h=>(...p)=>{u(()=>{h(...p)})},schedule:u,setNotifyFunction:h=>{i=h},setBatchNotifyFunction:h=>{o=h},setScheduler:h=>{l=h}}}var ce=$4(),I4=class extends $i{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Lr&&window.addEventListener){const a=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(i=>{i(e)}))}isOnline(){return this.#t}},yu=new I4;function Z4(e){return Math.min(1e3*2**e,3e4)}function x1(e){return(e??"online")==="online"?yu.isOnline():!0}var nh=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function w1(e){let a=!1,i=0,o;const l=eh(),u=()=>l.status!=="pending",d=w=>{if(!u()){const C=new nh(w);b(C),e.onCancel?.(C)}},h=()=>{a=!0},p=()=>{a=!1},m=()=>$h.isFocused()&&(e.networkMode==="always"||yu.isOnline())&&e.canRun(),v=()=>x1(e.networkMode)&&e.canRun(),g=w=>{u()||(o?.(),l.resolve(w))},b=w=>{u()||(o?.(),l.reject(w))},x=()=>new Promise(w=>{o=C=>{(u()||m())&&w(C)},e.onPause?.()}).then(()=>{o=void 0,u()||e.onContinue?.()}),S=()=>{if(u())return;let w;const C=i===0?e.initialPromise:void 0;try{w=C??e.fn()}catch(T){w=Promise.reject(T)}Promise.resolve(w).then(g).catch(T=>{if(u())return;const z=e.retry??(Lr?0:3),D=e.retryDelay??Z4,U=typeof D=="function"?D(i,T):D,B=z===!0||typeof z=="number"&&i<z||typeof z=="function"&&z(i,T);if(a||!B){b(T);return}i++,e.onFail?.(i,T),F4(U).then(()=>m()?void 0:x()).then(()=>{a?b(T):S()})})};return{promise:l,status:()=>l.status,cancel:d,continue:()=>(o?.(),l),cancelRetry:h,continueRetry:p,canStart:v,start:()=>(v()?S():x().then(S),l)}}var E1=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Jd(this.gcTime)&&(this.#t=Rr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Lr?1/0:300*1e3))}clearGcTimeout(){this.#t&&(Rr.clearTimeout(this.#t),this.#t=void 0)}},J4=class extends E1{#t;#e;#n;#r;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=D0(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=D0(this.options);a.data!==void 0&&(this.setData(a.data,{updatedAt:a.dataUpdatedAt,manual:!0}),this.#t=a)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,a){const i=th(this.state.data,e,this.options);return this.#i({data:i,type:"success",dataUpdatedAt:a?.updatedAt,manual:a?.manual}),i}setState(e,a){this.#i({type:"setState",state:e,setStateOptions:a})}cancel(e){const a=this.#a?.promise;return this.#a?.cancel(e),a?a.then(Ce).catch(Ce):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>dn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Xh||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Xa(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!v1(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(a=>a.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(a=>a.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(a=>a!==e),this.observers.length||(this.#a&&(this.#s?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,a){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&a?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const i=new AbortController,o=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#s=!0,i.signal)})},l=()=>{const h=b1(this.options,a),m=(()=>{const v={client:this.#r,queryKey:this.queryKey,meta:this.meta};return o(v),v})();return this.#s=!1,this.options.persister?this.options.persister(h,m,this):h(m)},d=(()=>{const h={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:l};return o(h),h})();this.options.behavior?.onFetch(d,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#i({type:"fetch",meta:d.fetchOptions?.meta}),this.#a=w1({initialPromise:a?.initialPromise,fn:d.fetchFn,onCancel:h=>{h instanceof nh&&h.revert&&this.setState({...this.#e,fetchStatus:"idle"}),i.abort()},onFail:(h,p)=>{this.#i({type:"failed",failureCount:h,error:p})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0});try{const h=await this.#a.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#n.config.onSuccess?.(h,this),this.#n.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof nh){if(h.silent)return this.#a.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#i({type:"error",error:h}),this.#n.config.onError?.(h,this),this.#n.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#i(e){const a=i=>{switch(e.type){case"failed":return{...i,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...R1(i.data,this.options),fetchMeta:e.meta??null};case"success":const o={...i,data:e.data,dataUpdateCount:i.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=e.manual?o:void 0,o;case"error":const l=e.error;return{...i,error:l,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error"};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...e.state}}};this.state=a(this.state),ce.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function R1(e,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:x1(a.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function D0(e){const a=typeof e.initialData=="function"?e.initialData():e.initialData,i=a!==void 0,o=i?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:i?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var W4=class extends $i{constructor(e,a){super(),this.options=a,this.#t=e,this.#i=null,this.#s=eh(),this.bindMethods(),this.setOptions(a)}#t;#e=void 0;#n=void 0;#r=void 0;#a;#o;#s;#i;#p;#d;#h;#u;#c;#l;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),z0(this.#e,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ah(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ah(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#S(),this.#x(),this.#e.removeObserver(this)}setOptions(e){const a=this.options,i=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof dn(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#e.setOptions(this.options),a._defaulted&&!vu(this.options,a)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const o=this.hasListeners();o&&L0(this.#e,i,this.options,a)&&this.#f(),this.updateResult(),o&&(this.#e!==i||dn(this.options.enabled,this.#e)!==dn(a.enabled,this.#e)||Xa(this.options.staleTime,this.#e)!==Xa(a.staleTime,this.#e))&&this.#g();const l=this.#v();o&&(this.#e!==i||dn(this.options.enabled,this.#e)!==dn(a.enabled,this.#e)||l!==this.#l)&&this.#y(l)}getOptimisticResult(e){const a=this.#t.getQueryCache().build(this.#t,e),i=this.createResult(a,e);return e3(this,i)&&(this.#r=i,this.#o=this.options,this.#a=this.#e.state),i}getCurrentResult(){return this.#r}trackResult(e,a){return new Proxy(e,{get:(i,o)=>(this.trackProp(o),a?.(o),o==="promise"&&!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(i,o))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const a=this.#t.defaultQueryOptions(e),i=this.#t.getQueryCache().build(this.#t,a);return i.fetch().then(()=>this.createResult(i,a))}fetch(e){return this.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#f(e){this.#w();let a=this.#e.fetch(this.options,e);return e?.throwOnError||(a=a.catch(Ce)),a}#g(){this.#S();const e=Xa(this.options.staleTime,this.#e);if(Lr||this.#r.isStale||!Jd(e))return;const i=v1(this.#r.dataUpdatedAt,e)+1;this.#u=Rr.setTimeout(()=>{this.#r.isStale||this.updateResult()},i)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(e){this.#x(),this.#l=e,!(Lr||dn(this.options.enabled,this.#e)===!1||!Jd(this.#l)||this.#l===0)&&(this.#c=Rr.setInterval(()=>{(this.options.refetchIntervalInBackground||$h.isFocused())&&this.#f()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#S(){this.#u&&(Rr.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#c&&(Rr.clearInterval(this.#c),this.#c=void 0)}createResult(e,a){const i=this.#e,o=this.options,l=this.#r,u=this.#a,d=this.#o,p=e!==i?e.state:this.#n,{state:m}=e;let v={...m},g=!1,b;if(a._optimisticResults){const V=this.hasListeners(),et=!V&&z0(e,a),J=V&&L0(e,i,a,o);(et||J)&&(v={...v,...R1(m.data,e.options)}),a._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:x,errorUpdatedAt:S,status:w}=v;b=v.data;let C=!1;if(a.placeholderData!==void 0&&b===void 0&&w==="pending"){let V;l?.isPlaceholderData&&a.placeholderData===d?.placeholderData?(V=l.data,C=!0):V=typeof a.placeholderData=="function"?a.placeholderData(this.#h?.state.data,this.#h):a.placeholderData,V!==void 0&&(w="success",b=th(l?.data,V,a),g=!0)}if(a.select&&b!==void 0&&!C)if(l&&b===u?.data&&a.select===this.#p)b=this.#d;else try{this.#p=a.select,b=a.select(b),b=th(l?.data,b,a),this.#d=b,this.#i=null}catch(V){this.#i=V}this.#i&&(x=this.#i,b=this.#d,S=Date.now(),w="error");const T=v.fetchStatus==="fetching",z=w==="pending",D=w==="error",U=z&&T,B=b!==void 0,j={status:w,fetchStatus:v.fetchStatus,isPending:z,isSuccess:w==="success",isError:D,isInitialLoading:U,isLoading:U,data:b,dataUpdatedAt:v.dataUpdatedAt,error:x,errorUpdatedAt:S,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>p.dataUpdateCount||v.errorUpdateCount>p.errorUpdateCount,isFetching:T,isRefetching:T&&!z,isLoadingError:D&&!B,isPaused:v.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:D&&B,isStale:Ih(e,a),refetch:this.refetch,promise:this.#s,isEnabled:dn(a.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const V=at=>{j.status==="error"?at.reject(j.error):j.data!==void 0&&at.resolve(j.data)},et=()=>{const at=this.#s=j.promise=eh();V(at)},J=this.#s;switch(J.status){case"pending":e.queryHash===i.queryHash&&V(J);break;case"fulfilled":(j.status==="error"||j.data!==J.value)&&et();break;case"rejected":(j.status!=="error"||j.error!==J.reason)&&et();break}}return j}updateResult(){const e=this.#r,a=this.createResult(this.#e,this.options);if(this.#a=this.#e.state,this.#o=this.options,this.#a.data!==void 0&&(this.#h=this.#e),vu(a,e))return;this.#r=a;const i=()=>{if(!e)return!0;const{notifyOnChangeProps:o}=this.options,l=typeof o=="function"?o():o;if(l==="all"||!l&&!this.#m.size)return!0;const u=new Set(l??this.#m);return this.options.throwOnError&&u.add("error"),Object.keys(this.#r).some(d=>{const h=d;return this.#r[h]!==e[h]&&u.has(h)})};this.#E({listeners:i()})}#w(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const a=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(a?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#E(e){ce.batch(()=>{e.listeners&&this.listeners.forEach(a=>{a(this.#r)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function t3(e,a){return dn(a.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&a.retryOnMount===!1)}function z0(e,a){return t3(e,a)||e.state.data!==void 0&&ah(e,a,a.refetchOnMount)}function ah(e,a,i){if(dn(a.enabled,e)!==!1&&Xa(a.staleTime,e)!=="static"){const o=typeof i=="function"?i(e):i;return o==="always"||o!==!1&&Ih(e,a)}return!1}function L0(e,a,i,o){return(e!==a||dn(o.enabled,e)===!1)&&(!i.suspense||e.state.status!=="error")&&Ih(e,i)}function Ih(e,a){return dn(a.enabled,e)!==!1&&e.isStaleByTime(Xa(a.staleTime,e))}function e3(e,a){return!vu(e.getCurrentResult(),a)}function j0(e){return{onFetch:(a,i)=>{const o=a.options,l=a.fetchOptions?.meta?.fetchMore?.direction,u=a.state.data?.pages||[],d=a.state.data?.pageParams||[];let h={pages:[],pageParams:[]},p=0;const m=async()=>{let v=!1;const g=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(a.signal.aborted?v=!0:a.signal.addEventListener("abort",()=>{v=!0}),a.signal)})},b=b1(a.options,a.fetchOptions),x=async(S,w,C)=>{if(v)return Promise.reject();if(w==null&&S.pages.length)return Promise.resolve(S);const z=(()=>{const K={client:a.client,queryKey:a.queryKey,pageParam:w,direction:C?"backward":"forward",meta:a.options.meta};return g(K),K})(),D=await b(z),{maxPages:U}=a.options,B=C?Q4:Y4;return{pages:B(S.pages,D,U),pageParams:B(S.pageParams,w,U)}};if(l&&u.length){const S=l==="backward",w=S?n3:U0,C={pages:u,pageParams:d},T=w(o,C);h=await x(C,T,S)}else{const S=e??u.length;do{const w=p===0?d[0]??o.initialPageParam:U0(o,h);if(p>0&&w==null)break;h=await x(h,w),p++}while(p<S)}return h};a.options.persister?a.fetchFn=()=>a.options.persister?.(m,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},i):a.fetchFn=m}}}function U0(e,{pages:a,pageParams:i}){const o=a.length-1;return a.length>0?e.getNextPageParam(a[o],a,i[o],i):void 0}function n3(e,{pages:a,pageParams:i}){return a.length>0?e.getPreviousPageParam?.(a[0],a,i[0],i):void 0}var a3=class extends E1{#t;#e;#n;#r;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#e=[],this.state=e.state||_1(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(a=>a!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const a=()=>{this.#a({type:"continue"})},i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=w1({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(new Error("No mutationFn found")),onFail:(u,d)=>{this.#a({type:"failed",failureCount:u,error:d})},onPause:()=>{this.#a({type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const o=this.state.status==="pending",l=!this.#r.canStart();try{if(o)a();else{this.#a({type:"pending",variables:e,isPaused:l}),await this.#n.config.onMutate?.(e,this,i);const d=await this.options.onMutate?.(e,i);d!==this.state.context&&this.#a({type:"pending",context:d,variables:e,isPaused:l})}const u=await this.#r.start();return await this.#n.config.onSuccess?.(u,e,this.state.context,this,i),await this.options.onSuccess?.(u,e,this.state.context,i),await this.#n.config.onSettled?.(u,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(u,null,e,this.state.context,i),this.#a({type:"success",data:u}),u}catch(u){try{throw await this.#n.config.onError?.(u,e,this.state.context,this,i),await this.options.onError?.(u,e,this.state.context,i),await this.#n.config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(void 0,u,e,this.state.context,i),u}finally{this.#a({type:"error",error:u})}}finally{this.#n.runNext(this)}}#a(e){const a=i=>{switch(e.type){case"failed":return{...i,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...i,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:e.error,failureCount:i.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=a(this.state),ce.batch(()=>{this.#e.forEach(i=>{i.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function _1(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var r3=class extends $i{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,a,i){const o=new a3({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(a),state:i});return this.add(o),o}add(e){this.#t.add(e);const a=Xl(e);if(typeof a=="string"){const i=this.#e.get(a);i?i.push(e):this.#e.set(a,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const a=Xl(e);if(typeof a=="string"){const i=this.#e.get(a);if(i)if(i.length>1){const o=i.indexOf(e);o!==-1&&i.splice(o,1)}else i[0]===e&&this.#e.delete(a)}}this.notify({type:"removed",mutation:e})}canRun(e){const a=Xl(e);if(typeof a=="string"){const o=this.#e.get(a)?.find(l=>l.state.status==="pending");return!o||o===e}else return!0}runNext(e){const a=Xl(e);return typeof a=="string"?this.#e.get(a)?.find(o=>o!==e&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ce.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const a={exact:!0,...e};return this.getAll().find(i=>O0(a,i))}findAll(e={}){return this.getAll().filter(a=>O0(e,a))}notify(e){ce.batch(()=>{this.listeners.forEach(a=>{a(e)})})}resumePausedMutations(){const e=this.getAll().filter(a=>a.state.isPaused);return ce.batch(()=>Promise.all(e.map(a=>a.continue().catch(Ce))))}};function Xl(e){return e.options.scope?.id}var i3=class extends $i{#t;#e=void 0;#n;#r;constructor(a,i){super(),this.#t=a,this.setOptions(i),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(a){const i=this.options;this.options=this.#t.defaultMutationOptions(a),vu(this.options,i)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),i?.mutationKey&&this.options.mutationKey&&jr(i.mutationKey)!==jr(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(a){this.#a(),this.#o(a)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#a(),this.#o()}mutate(a,i){return this.#r=i,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(a)}#a(){const a=this.#n?.state??_1();this.#e={...a,isPending:a.status==="pending",isSuccess:a.status==="success",isError:a.status==="error",isIdle:a.status==="idle",mutate:this.mutate,reset:this.reset}}#o(a){ce.batch(()=>{if(this.#r&&this.hasListeners()){const i=this.#e.variables,o=this.#e.context,l={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};a?.type==="success"?(this.#r.onSuccess?.(a.data,i,o,l),this.#r.onSettled?.(a.data,null,i,o,l)):a?.type==="error"&&(this.#r.onError?.(a.error,i,o,l),this.#r.onSettled?.(void 0,a.error,i,o,l))}this.listeners.forEach(i=>{i(this.#e)})})}},o3=class extends $i{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,a,i){const o=a.queryKey,l=a.queryHash??Kh(o,a);let u=this.get(l);return u||(u=new J4({client:e,queryKey:o,queryHash:l,options:e.defaultQueryOptions(a),state:i,defaultOptions:e.getQueryDefaults(o)}),this.add(u)),u}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const a=this.#t.get(e.queryHash);a&&(e.destroy(),a===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ce.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const a={exact:!0,...e};return this.getAll().find(i=>A0(a,i))}findAll(e={}){const a=this.getAll();return Object.keys(e).length>0?a.filter(i=>A0(e,i)):a}notify(e){ce.batch(()=>{this.listeners.forEach(a=>{a(e)})})}onFocus(){ce.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ce.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},s3=class{#t;#e;#n;#r;#a;#o;#s;#i;constructor(e={}){this.#t=e.queryCache||new o3,this.#e=e.mutationCache||new r3,this.#n=e.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#s=$h.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#i=yu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#s?.(),this.#s=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const a=this.defaultQueryOptions({queryKey:e});return this.#t.get(a.queryHash)?.state.data}ensureQueryData(e){const a=this.defaultQueryOptions(e),i=this.#t.build(this,a),o=i.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(Xa(a.staleTime,i))&&this.prefetchQuery(a),Promise.resolve(o))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:a,state:i})=>{const o=i.data;return[a,o]})}setQueryData(e,a,i){const o=this.defaultQueryOptions({queryKey:e}),u=this.#t.get(o.queryHash)?.state.data,d=V4(a,u);if(d!==void 0)return this.#t.build(this,o).setData(d,{...i,manual:!0})}setQueriesData(e,a,i){return ce.batch(()=>this.#t.findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,a,i)]))}getQueryState(e){const a=this.defaultQueryOptions({queryKey:e});return this.#t.get(a.queryHash)?.state}removeQueries(e){const a=this.#t;ce.batch(()=>{a.findAll(e).forEach(i=>{a.remove(i)})})}resetQueries(e,a){const i=this.#t;return ce.batch(()=>(i.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...e},a)))}cancelQueries(e,a={}){const i={revert:!0,...a},o=ce.batch(()=>this.#t.findAll(e).map(l=>l.cancel(i)));return Promise.all(o).then(Ce).catch(Ce)}invalidateQueries(e,a={}){return ce.batch(()=>(this.#t.findAll(e).forEach(i=>{i.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},a)))}refetchQueries(e,a={}){const i={...a,cancelRefetch:a.cancelRefetch??!0},o=ce.batch(()=>this.#t.findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let u=l.fetch(void 0,i);return i.throwOnError||(u=u.catch(Ce)),l.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(o).then(Ce)}fetchQuery(e){const a=this.defaultQueryOptions(e);a.retry===void 0&&(a.retry=!1);const i=this.#t.build(this,a);return i.isStaleByTime(Xa(a.staleTime,i))?i.fetch(a):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ce).catch(Ce)}fetchInfiniteQuery(e){return e.behavior=j0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ce).catch(Ce)}ensureInfiniteQueryData(e){return e.behavior=j0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return yu.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,a){this.#r.set(jr(e),{queryKey:e,defaultOptions:a})}getQueryDefaults(e){const a=[...this.#r.values()],i={};return a.forEach(o=>{is(e,o.queryKey)&&Object.assign(i,o.defaultOptions)}),i}setMutationDefaults(e,a){this.#a.set(jr(e),{mutationKey:e,defaultOptions:a})}getMutationDefaults(e){const a=[...this.#a.values()],i={};return a.forEach(o=>{is(e,o.mutationKey)&&Object.assign(i,o.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const a={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return a.queryHash||(a.queryHash=Kh(a.queryKey,a)),a.refetchOnReconnect===void 0&&(a.refetchOnReconnect=a.networkMode!=="always"),a.throwOnError===void 0&&(a.throwOnError=!!a.suspense),!a.networkMode&&a.persister&&(a.networkMode="offlineFirst"),a.queryFn===Xh&&(a.enabled=!1),a}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},C1=R.createContext(void 0),T1=e=>{const a=R.useContext(C1);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},l3=({client:e,children:a})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),_.jsx(C1.Provider,{value:e,children:a})),A1=R.createContext(!1),u3=()=>R.useContext(A1);A1.Provider;function c3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var f3=R.createContext(c3()),d3=()=>R.useContext(f3),h3=(e,a)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(a.isReset()||(e.retryOnMount=!1))},m3=e=>{R.useEffect(()=>{e.clearReset()},[e])},p3=({result:e,errorResetBoundary:a,throwOnError:i,query:o,suspense:l})=>e.isError&&!a.isReset()&&!e.isFetching&&o&&(l&&e.data===void 0||S1(i,[e.error,o])),g3=e=>{if(e.suspense){const i=l=>l==="static"?l:Math.max(l??1e3,1e3),o=e.staleTime;e.staleTime=typeof o=="function"?(...l)=>i(o(...l)):i(o),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},v3=(e,a)=>e.isLoading&&e.isFetching&&!a,y3=(e,a)=>e?.suspense&&a.isPending,B0=(e,a,i)=>a.fetchOptimistic(e).catch(()=>{i.clearReset()});function b3(e,a,i){const o=u3(),l=d3(),u=T1(),d=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(d),d._optimisticResults=o?"isRestoring":"optimistic",g3(d),h3(d,l),m3(l);const h=!u.getQueryCache().get(d.queryHash),[p]=R.useState(()=>new a(u,d)),m=p.getOptimisticResult(d),v=!o&&e.subscribed!==!1;if(R.useSyncExternalStore(R.useCallback(g=>{const b=v?p.subscribe(ce.batchCalls(g)):Ce;return p.updateResult(),b},[p,v]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),R.useEffect(()=>{p.setOptions(d)},[d,p]),y3(d,m))throw B0(d,p,l);if(p3({result:m,errorResetBoundary:l,throwOnError:d.throwOnError,query:u.getQueryCache().get(d.queryHash),suspense:d.suspense}))throw m.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(d,m),d.experimental_prefetchInRender&&!Lr&&v3(m,o)&&(h?B0(d,p,l):u.getQueryCache().get(d.queryHash)?.promise)?.catch(Ce).finally(()=>{p.updateResult()}),d.notifyOnChangeProps?m:p.trackResult(m)}function S3(e,a){return b3(e,W4)}function x3(e,a){const i=T1(),[o]=R.useState(()=>new i3(i,e));R.useEffect(()=>{o.setOptions(e)},[o,e]);const l=R.useSyncExternalStore(R.useCallback(d=>o.subscribe(ce.batchCalls(d)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),u=R.useCallback((d,h)=>{o.mutate(d,h).catch(Ce)},[o]);if(l.error&&S1(o.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:u,mutateAsync:l.mutate}}function w3(){return _.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(db,{className:"size-8 animate-spin"})})}function E3({className:e,...a}){const{setAuthenticated:i}=g1(),[o,l]=R.useState(""),[u,d]=R.useState(""),h=Qh(),{isPending:p,mutate:m}=x3({mutationFn:async()=>h.login(o,u),onError(){_0.error("Invalid credentials",{description:"The credentials you provided are invalid."})},onSuccess(){_0.success("Login successful",{description:"You have successfully logged in."}),i(!0)}});return p?_.jsx(w3,{}):_.jsx("div",{className:Rt("flex flex-col gap-6 w-[20%]",e),...a,children:_.jsxs(e4,{children:[_.jsxs(n4,{children:[_.jsx(a4,{className:"text-2xl",children:"Login"}),_.jsx(r4,{children:"Enter your credentials below to proceed"})]}),_.jsx(i4,{children:_.jsxs("div",{className:"flex flex-col gap-6",children:[_.jsxs("div",{className:"grid gap-2",children:[_.jsx(w0,{htmlFor:"username",children:"Username"}),_.jsx(zy,{id:"username",type:"username",placeholder:"Enter your username",required:!0,value:o,onChange:v=>l(v.target.value)})]}),_.jsxs("div",{className:"grid gap-2",children:[_.jsx("div",{className:"flex items-center",children:_.jsx(w0,{htmlFor:"password",children:"Password"})}),_.jsx(zy,{id:"password",type:"password",required:!0,value:u,onChange:v=>d(v.target.value)})]}),_.jsx(Ob,{type:"button",className:"w-full",onClick:()=>{m()},children:"Login"})]})})]})})}function R3({children:e}){const{authenticated:a,setAuthenticated:i}=g1(),o=Qh(),{isLoading:l,isError:u}=S3({queryKey:[],enabled:!a,queryFn:async()=>{const d=await o.fetchMe();return i(!!d),d},refetchOnWindowFocus:!0});return l?_.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(db,{className:"size-8 animate-spin"})}):u?_.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching user data."})}):a?_.jsx(_.Fragment,{children:e}):_.jsx("div",{className:"h-screen grid place-items-center",children:_.jsx(E3,{})})}function _3({...e}){return _.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function C3({className:e,...a}){return _.jsx("ol",{"data-slot":"breadcrumb-list",className:Rt("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...a})}function Ad({className:e,...a}){return _.jsx("li",{"data-slot":"breadcrumb-item",className:Rt("inline-flex items-center gap-1.5",e),...a})}function k0({asChild:e,className:a,...i}){const o=e?ls:"a";return _.jsx(o,{"data-slot":"breadcrumb-link",className:Rt("hover:text-foreground transition-colors",a),...i})}function T3({className:e,...a}){return _.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:Rt("text-foreground font-normal",e),...a})}function P0({children:e,className:a,...i}){return _.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Rt("[&>svg]:size-3.5",a),...i,children:e??_.jsx(PR,{})})}function A3(){const{toggleSidebar:e}=Bh();return _.jsx("header",{className:"bg-background sticky top-0 z-50 flex w-full items-center border-b",children:_.jsxs("div",{className:"flex h-(--header-height) w-full items-center gap-2 px-4",children:[_.jsx(Ob,{className:"h-8 w-8",variant:"ghost",size:"icon",onClick:e,children:_.jsx(qR,{})}),_.jsx(p2,{orientation:"vertical",className:"mr-2 h-4"}),_.jsx(_3,{className:"hidden sm:block",children:_.jsxs(C3,{children:[_.jsx(Ad,{children:_.jsx(k0,{href:"#",children:"/"})}),_.jsx(P0,{}),_.jsx(Ad,{children:_.jsx(T3,{children:"CommandKit"})}),_.jsx(P0,{}),_.jsx(Ad,{children:_.jsx(k0,{href:"#",children:"DevTools"})})]})})]})})}var O3=(e,a,i,o,l,u,d,h)=>{let p=document.documentElement,m=["light","dark"];function v(x){(Array.isArray(e)?e:[e]).forEach(S=>{let w=S==="class",C=w&&u?l.map(T=>u[T]||T):l;w?(p.classList.remove(...C),p.classList.add(u&&u[x]?u[x]:x)):p.setAttribute(S,x)}),g(x)}function g(x){h&&m.includes(x)&&(p.style.colorScheme=x)}function b(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(o)v(o);else try{let x=localStorage.getItem(a)||i,S=d&&x==="system"?b():x;v(S)}catch{}},H0=["light","dark"],O1="(prefers-color-scheme: dark)",M3=typeof window>"u",Zh=R.createContext(void 0),N3={setTheme:e=>{},themes:[]},D3=()=>{var e;return(e=R.useContext(Zh))!=null?e:N3},z3=e=>R.useContext(Zh)?R.createElement(R.Fragment,null,e.children):R.createElement(j3,{...e}),L3=["light","dark"],j3=({forcedTheme:e,disableTransitionOnChange:a=!1,enableSystem:i=!0,enableColorScheme:o=!0,storageKey:l="theme",themes:u=L3,defaultTheme:d=i?"system":"light",attribute:h="data-theme",value:p,children:m,nonce:v,scriptProps:g})=>{let[b,x]=R.useState(()=>B3(l,d)),[S,w]=R.useState(()=>b==="system"?Od():b),C=p?Object.values(p):u,T=R.useCallback(B=>{let K=B;if(!K)return;B==="system"&&i&&(K=Od());let j=p?p[K]:K,V=a?k3(v):null,et=document.documentElement,J=at=>{at==="class"?(et.classList.remove(...C),j&&et.classList.add(j)):at.startsWith("data-")&&(j?et.setAttribute(at,j):et.removeAttribute(at))};if(Array.isArray(h)?h.forEach(J):J(h),o){let at=H0.includes(d)?d:null,rt=H0.includes(K)?K:at;et.style.colorScheme=rt}V?.()},[v]),z=R.useCallback(B=>{let K=typeof B=="function"?B(b):B;x(K);try{localStorage.setItem(l,K)}catch{}},[b]),D=R.useCallback(B=>{let K=Od(B);w(K),b==="system"&&i&&!e&&T("system")},[b,e]);R.useEffect(()=>{let B=window.matchMedia(O1);return B.addListener(D),D(B),()=>B.removeListener(D)},[D]),R.useEffect(()=>{let B=K=>{K.key===l&&(K.newValue?x(K.newValue):z(d))};return window.addEventListener("storage",B),()=>window.removeEventListener("storage",B)},[z]),R.useEffect(()=>{T(e??b)},[e,b]);let U=R.useMemo(()=>({theme:b,setTheme:z,forcedTheme:e,resolvedTheme:b==="system"?S:b,themes:i?[...u,"system"]:u,systemTheme:i?S:void 0}),[b,z,e,S,i,u]);return R.createElement(Zh.Provider,{value:U},R.createElement(U3,{forcedTheme:e,storageKey:l,attribute:h,enableSystem:i,enableColorScheme:o,defaultTheme:d,value:p,themes:u,nonce:v,scriptProps:g}),m)},U3=R.memo(({forcedTheme:e,storageKey:a,attribute:i,enableSystem:o,enableColorScheme:l,defaultTheme:u,value:d,themes:h,nonce:p,scriptProps:m})=>{let v=JSON.stringify([i,a,u,e,h,d,o,l]).slice(1,-1);return R.createElement("script",{...m,suppressHydrationWarning:!0,nonce:typeof window>"u"?p:"",dangerouslySetInnerHTML:{__html:`(${O3.toString()})(${v})`}})}),B3=(e,a)=>{if(M3)return;let i;try{i=localStorage.getItem(e)||void 0}catch{}return i||a},k3=e=>{let a=document.createElement("style");return e&&a.setAttribute("nonce",e),a.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(a),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(a)},1)}},Od=e=>(e||(e=window.matchMedia(O1)),e.matches?"dark":"light");const P3=({...e})=>{const{theme:a="system"}=D3();return _.jsx(k4,{theme:a,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...e})},Br=bR({head:()=>({meta:[{charSet:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1"},{title:"CommandKit DevTools"}]}),component:H3});function H3(){return _.jsxs(z3,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!1,children:[_.jsx(P3,{}),_.jsx(WM,{children:_.jsx(R3,{children:_.jsx("div",{className:"[--header-height:calc(theme(spacing.14))]",children:_.jsxs(YA,{className:"flex flex-col",children:[_.jsx(A3,{}),_.jsxs("div",{className:"flex flex-1",children:[_.jsx(t4,{}),_.jsx(KA,{children:_.jsx(lb,{})})]})]})})})})]})}const q3="modulepreload",V3=function(e){return"/"+e},q0={},Ii=function(a,i,o){let l=Promise.resolve();if(i&&i.length>0){let p=function(m){return Promise.all(m.map(v=>Promise.resolve(v).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),h=d?.nonce||d?.getAttribute("nonce");l=p(i.map(m=>{if(m=V3(m),m in q0)return;q0[m]=!0;const v=m.endsWith(".css"),g=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${g}`))return;const b=document.createElement("link");if(b.rel=v?"stylesheet":q3,v||(b.as="script"),b.crossOrigin="",b.href=m,h&&b.setAttribute("nonce",h),document.head.appendChild(b),v)return new Promise((x,S)=>{b.addEventListener("load",x),b.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${m}`)))})}))}function u(d){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=d,window.dispatchEvent(h),!h.defaultPrevented)throw d}return l.then(d=>{for(const h of d||[])h.status==="rejected"&&u(h.reason);return a().catch(u)})},G3=()=>Ii(()=>import("./plugins-Da1IKaVI.js"),[]),F3=$a("/plugins")({component:Gi(G3,"component")}),Y3=()=>Ii(()=>import("./guilds-DpjA4ejz.js"),[]),Q3=$a("/guilds")({component:Gi(Y3,"component")}),K3=()=>Ii(()=>import("./feature-flags-DtTJqVGy.js"),[]),X3=$a("/feature-flags")({component:Gi(K3,"component")}),$3=()=>Ii(()=>import("./events-CP5YTD8j.js"),[]),I3=$a("/events")({component:Gi($3,"component")}),Z3=()=>Ii(()=>import("./commands-qU7AMiq3.js"),[]),J3=$a("/commands")({component:Gi(Z3,"component")}),W3=()=>Ii(()=>import("./index-MQlxaR0w.js"),[]),tN=$a("/")({component:Gi(W3,"component")}),eN=F3.update({id:"/plugins",path:"/plugins",getParentRoute:()=>Br}),nN=Q3.update({id:"/guilds",path:"/guilds",getParentRoute:()=>Br}),aN=X3.update({id:"/feature-flags",path:"/feature-flags",getParentRoute:()=>Br}),rN=I3.update({id:"/events",path:"/events",getParentRoute:()=>Br}),iN=J3.update({id:"/commands",path:"/commands",getParentRoute:()=>Br}),oN=tN.update({id:"/",path:"/",getParentRoute:()=>Br}),sN={IndexRoute:oN,CommandsRoute:iN,EventsRoute:rN,FeatureFlagsRoute:aN,GuildsRoute:nN,PluginsRoute:eN},lN=Br._addFileChildren(sN)._addFileTypes(),uN=AR({routeTree:lN,defaultPreload:"intent",defaultStaleTime:5e3,scrollRestoration:!0,defaultViewTransition:!0}),cN=new s3;Iw.createRoot(document.getElementById("root")).render(_.jsx(R.StrictMode,{children:_.jsx(l3,{client:cN,children:_.jsx(NR,{router:uN})})}));export{fO as A,pO as B,e4 as C,w3 as L,S3 as a,n4 as b,dO as c,hO as d,i4 as e,a4 as f,V0 as g,r4 as h,Ja as i,_ as j,PR as k,DN as l,Vi as m,Ob as n,R as r,Qh as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as X,u as tt,a as et,j as y,L as rt,B as nt}from"./index-
|
|
1
|
+
import{g as X,u as tt,a as et,j as y,L as rt,B as nt}from"./index-o7tU8EM7.js";var I={exports:{}},st=I.exports,V;function it(){return V||(V=1,(function(k,H){(function(N,D){k.exports=D()})(st,(function(){var N=1e3,D=6e4,g=36e5,U="millisecond",_="second",O="minute",b="hour",v="day",C="week",m="month",J="quarter",M="year",j="date",Z="Invalid Date",P=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,Q=/\[([^\]]+)]|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,K={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(s){var r=["th","st","nd","rd"],t=s%100;return"["+s+(r[(t-20)%10]||r[t]||r[0])+"]"}},q=function(s,r,t){var n=String(s);return!n||n.length>=r?s:""+Array(r+1-n.length).join(t)+s},G={s:q,z:function(s){var r=-s.utcOffset(),t=Math.abs(r),n=Math.floor(t/60),e=t%60;return(r<=0?"+":"-")+q(n,2,"0")+":"+q(e,2,"0")},m:function s(r,t){if(r.date()<t.date())return-s(t,r);var n=12*(t.year()-r.year())+(t.month()-r.month()),e=r.clone().add(n,m),i=t-e<0,a=r.clone().add(n+(i?-1:1),m);return+(-(n+(t-e)/(i?e-a:a-e))||0)},a:function(s){return s<0?Math.ceil(s)||0:Math.floor(s)},p:function(s){return{M:m,y:M,w:C,d:v,D:j,h:b,m:O,s:_,ms:U,Q:J}[s]||String(s||"").toLowerCase().replace(/s$/,"")},u:function(s){return s===void 0}},T="en",x={};x[T]=K;var z="$isDayjsObject",R=function(s){return s instanceof F||!(!s||!s[z])},W=function s(r,t,n){var e;if(!r)return T;if(typeof r=="string"){var i=r.toLowerCase();x[i]&&(e=i),t&&(x[i]=t,e=i);var a=r.split("-");if(!e&&a.length>1)return s(a[0])}else{var o=r.name;x[o]=r,e=o}return!n&&e&&(T=e),e||!n&&T},f=function(s,r){if(R(s))return s.clone();var t=typeof r=="object"?r:{};return t.date=s,t.args=arguments,new F(t)},u=G;u.l=W,u.i=R,u.w=function(s,r){return f(s,{locale:r.$L,utc:r.$u,x:r.$x,$offset:r.$offset})};var F=(function(){function s(t){this.$L=W(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[z]=!0}var r=s.prototype;return r.parse=function(t){this.$d=(function(n){var e=n.date,i=n.utc;if(e===null)return new Date(NaN);if(u.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(P);if(a){var o=a[2]-1||0,c=(a[7]||"0").substring(0,3);return i?new Date(Date.UTC(a[1],o,a[3]||1,a[4]||0,a[5]||0,a[6]||0,c)):new Date(a[1],o,a[3]||1,a[4]||0,a[5]||0,a[6]||0,c)}}return new Date(e)})(t),this.init()},r.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},r.$utils=function(){return u},r.isValid=function(){return this.$d.toString()!==Z},r.isSame=function(t,n){var e=f(t);return this.startOf(n)<=e&&e<=this.endOf(n)},r.isAfter=function(t,n){return f(t)<this.startOf(n)},r.isBefore=function(t,n){return this.endOf(n)<f(t)},r.$g=function(t,n,e){return u.u(t)?this[n]:this.set(e,t)},r.unix=function(){return Math.floor(this.valueOf()/1e3)},r.valueOf=function(){return this.$d.getTime()},r.startOf=function(t,n){var e=this,i=!!u.u(n)||n,a=u.p(t),o=function(w,l){var p=u.w(e.$u?Date.UTC(e.$y,l,w):new Date(e.$y,l,w),e);return i?p:p.endOf(v)},c=function(w,l){return u.w(e.toDate()[w].apply(e.toDate("s"),(i?[0,0,0,0]:[23,59,59,999]).slice(l)),e)},d=this.$W,h=this.$M,$=this.$D,Y="set"+(this.$u?"UTC":"");switch(a){case M:return i?o(1,0):o(31,11);case m:return i?o(1,h):o(0,h+1);case C:var S=this.$locale().weekStart||0,L=(d<S?d+7:d)-S;return o(i?$-L:$+(6-L),h);case v:case j:return c(Y+"Hours",0);case b:return c(Y+"Minutes",1);case O:return c(Y+"Seconds",2);case _:return c(Y+"Milliseconds",3);default:return this.clone()}},r.endOf=function(t){return this.startOf(t,!1)},r.$set=function(t,n){var e,i=u.p(t),a="set"+(this.$u?"UTC":""),o=(e={},e[v]=a+"Date",e[j]=a+"Date",e[m]=a+"Month",e[M]=a+"FullYear",e[b]=a+"Hours",e[O]=a+"Minutes",e[_]=a+"Seconds",e[U]=a+"Milliseconds",e)[i],c=i===v?this.$D+(n-this.$W):n;if(i===m||i===M){var d=this.clone().set(j,1);d.$d[o](c),d.init(),this.$d=d.set(j,Math.min(this.$D,d.daysInMonth())).$d}else o&&this.$d[o](c);return this.init(),this},r.set=function(t,n){return this.clone().$set(t,n)},r.get=function(t){return this[u.p(t)]()},r.add=function(t,n){var e,i=this;t=Number(t);var a=u.p(n),o=function(h){var $=f(i);return u.w($.date($.date()+Math.round(h*t)),i)};if(a===m)return this.set(m,this.$M+t);if(a===M)return this.set(M,this.$y+t);if(a===v)return o(1);if(a===C)return o(7);var c=(e={},e[O]=D,e[b]=g,e[_]=N,e)[a]||1,d=this.$d.getTime()+t*c;return u.w(d,this)},r.subtract=function(t,n){return this.add(-1*t,n)},r.format=function(t){var n=this,e=this.$locale();if(!this.isValid())return e.invalidDate||Z;var i=t||"YYYY-MM-DDTHH:mm:ssZ",a=u.z(this),o=this.$H,c=this.$m,d=this.$M,h=e.weekdays,$=e.months,Y=e.meridiem,S=function(l,p,A,E){return l&&(l[p]||l(n,i))||A[p].slice(0,E)},L=function(l){return u.s(o%12||12,l,"0")},w=Y||function(l,p,A){var E=l<12?"AM":"PM";return A?E.toLowerCase():E};return i.replace(Q,(function(l,p){return p||(function(A){switch(A){case"YY":return String(n.$y).slice(-2);case"YYYY":return u.s(n.$y,4,"0");case"M":return d+1;case"MM":return u.s(d+1,2,"0");case"MMM":return S(e.monthsShort,d,$,3);case"MMMM":return S($,d);case"D":return n.$D;case"DD":return u.s(n.$D,2,"0");case"d":return String(n.$W);case"dd":return S(e.weekdaysMin,n.$W,h,2);case"ddd":return S(e.weekdaysShort,n.$W,h,3);case"dddd":return h[n.$W];case"H":return String(o);case"HH":return u.s(o,2,"0");case"h":return L(1);case"hh":return L(2);case"a":return w(o,c,!0);case"A":return w(o,c,!1);case"m":return String(c);case"mm":return u.s(c,2,"0");case"s":return String(n.$s);case"ss":return u.s(n.$s,2,"0");case"SSS":return u.s(n.$ms,3,"0");case"Z":return a}return null})(l)||a.replace(":","")}))},r.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},r.diff=function(t,n,e){var i,a=this,o=u.p(n),c=f(t),d=(c.utcOffset()-this.utcOffset())*D,h=this-c,$=function(){return u.m(a,c)};switch(o){case M:i=$()/12;break;case m:i=$();break;case J:i=$()/3;break;case C:i=(h-d)/6048e5;break;case v:i=(h-d)/864e5;break;case b:i=h/g;break;case O:i=h/D;break;case _:i=h/N;break;default:i=h}return e?i:u.a(i)},r.daysInMonth=function(){return this.endOf(m).$D},r.$locale=function(){return x[this.$L]},r.locale=function(t,n){if(!t)return this.$L;var e=this.clone(),i=W(t,n,!0);return i&&(e.$L=i),e},r.clone=function(){return u.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()},s})(),B=F.prototype;return f.prototype=B,[["$ms",U],["$s",_],["$m",O],["$H",b],["$W",v],["$M",m],["$y",M],["$D",j]].forEach((function(s){B[s[1]]=function(r){return this.$g(r,s[0],s[1])}})),f.extend=function(s,r){return s.$i||(s(r,F,f),s.$i=!0),f},f.locale=W,f.isDayjs=R,f.unix=function(s){return f(1e3*s)},f.en=x[T],f.Ls=x,f.p={},f}))})(I)),I.exports}var at=it();const ut=X(at),ot="YYYY-MM-DD HH:mm:ss";function ct(k,H=ot){return ut(k).format(H)}function dt(){const k=tt(),{data:H,isLoading:N,isError:D}=et({queryKey:["plugins"],queryFn:async()=>await k.plugins.fetch()});return N||!H?y.jsx(rt,{}):D?y.jsx("div",{className:"h-screen grid place-items-center",children:y.jsx("h1",{className:"text-2xl text-red-500",children:"An error occurred while fetching plugins data."})}):y.jsxs("div",{className:"p-4",children:[y.jsx("h1",{className:"text-2xl font-bold mb-6",children:"Plugins"}),y.jsx("div",{className:"grid grid-cols-3 gap-4 py-4",children:H.map(g=>y.jsxs("div",{className:"border p-4 rounded",children:[y.jsx("h2",{className:"text-lg font-semibold",children:g.name}),y.jsx(nt,{variant:"outline",className:"text-sm text-gray-500 mt-2 font-mono",children:g.id}),y.jsxs("p",{className:"text-muted-foreground text-xs mt-2 font-medium",children:["Registered at ",ct(g.loadedAt)]})]},g.id))})]})}export{dt as component};
|
package/ui/index.html
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
<style>
|
|
12
12
|
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');
|
|
13
13
|
</style>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
15
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-o7tU8EM7.js"></script>
|
|
15
|
+
<link rel="stylesheet" crossorigin href="/assets/index-dwRFzfPU.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
18
18
|
<div id="root"></div>
|