var we=s=>{throw TypeError(s)};var Te=(s,e,t)=>e.has(s)||we("Cannot "+t);var u=(s,e,t)=>(Te(s,e,"read from private field"),t?t.call(s):e.get(s)),j=(s,e,t)=>e.has(s)?we("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,t),O=(s,e,t,r)=>(Te(s,e,"write to private field"),r?r.call(s,t):e.set(s,t),t);var re=(s,e,t,r)=>({set _(i){O(s,e,i,t)},get _(){return u(s,e,r)}});import{f as ke,h as ht,r as f,g as mt,k as vt,j as c,l as yt,n as gt,O as xe}from"./index-C743Obp6.js";import{S as _e,k as Qe,Q as wt,n as A,m as be,l as Pe,d as Q,o as Tt,q as xt,v as bt,f as Pt,w as Ee,b as Ce,x as Et,h as Se,y as Re,z as Ct,u as St,A as Rt}from"./QueryClientProvider-BZ49XY6e.js";import{M as Ot}from"./mutation-UnlnJH-7.js";import{u as Nt}from"./use-toast-DJwaBGGp.js";import{C as Mt}from"./react-icons.esm-LAYYvI5E.js";import{l as At,m as Dt,_ as Ft,r as jt,u as It,n as kt,M as _t,o as Qt,S as Lt}from"./components-DTlQfg3V.js";import{c as qt,B as Kt,u as Ht,P as Vt,e as oe,a as k,R as Wt,b as Bt,d as Ut}from"./index-DTW1YWju.js";import{u as Le,c as $t}from"./index-DPQhHc83.js";import{c as zt}from"./index-C4fLsqsu.js";import{P as X,d as Xt}from"./index-CIQW_kbJ.js";import{V as qe}from"./index-BAYFf5uG.js";import{c as Y}from"./utils-jM7Hu9J5.js";import{T as Yt}from"./theme-provider-CakCxgMd.js";/**
 * @remix-run/react v2.13.1
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */let Oe="positions";function Jt({getKey:s,...e}){let{isSpaMode:t}=At(),r=ke(),i=ht();Dt({getKey:s,storageKey:Oe});let l=f.useMemo(()=>{if(!s)return null;let v=s(r,i);return v!==r.key?v:null},[]);if(t)return null;let m=((v,x)=>{if(!window.history.state||!window.history.state.key){let d=Math.random().toString(32).slice(2);window.history.replaceState({key:d},"")}try{let b=JSON.parse(sessionStorage.getItem(v)||"{}")[x||window.history.state.key];typeof b=="number"&&window.scrollTo(0,b)}catch(d){console.error(d),sessionStorage.removeItem(v)}}).toString();return f.createElement("script",Ft({},e,{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${m})(${JSON.stringify(Oe)}, ${JSON.stringify(l)})`}}))}const Gt="/assets/tailwind-CWZ5WqoH.css";var Ke={exports:{}};/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
 * @license MIT */(function(s,e){(function(t,r){s.exports=r()})(vt,function(){var t={};t.version="0.2.0";var r=t.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};t.configure=function(n){var a,o;for(a in n)o=n[a],o!==void 0&&n.hasOwnProperty(a)&&(r[a]=o);return this},t.status=null,t.set=function(n){var a=t.isStarted();n=i(n,r.minimum,1),t.status=n===1?null:n;var o=t.render(!a),w=o.querySelector(r.barSelector),y=r.speed,h=r.easing;return o.offsetWidth,v(function(p){r.positionUsing===""&&(r.positionUsing=t.getPositioningCSS()),x(w,m(n,y,h)),n===1?(x(o,{transition:"none",opacity:1}),o.offsetWidth,setTimeout(function(){x(o,{transition:"all "+y+"ms linear",opacity:0}),setTimeout(function(){t.remove(),p()},y)},y)):setTimeout(p,y)}),this},t.isStarted=function(){return typeof t.status=="number"},t.start=function(){t.status||t.set(0);var n=function(){setTimeout(function(){t.status&&(t.trickle(),n())},r.trickleSpeed)};return r.trickle&&n(),this},t.done=function(n){return!n&&!t.status?this:t.inc(.3+.5*Math.random()).set(1)},t.inc=function(n){var a=t.status;return a?(typeof n!="number"&&(n=(1-a)*i(Math.random()*a,.1,.95)),a=i(a+n,0,.994),t.set(a)):t.start()},t.trickle=function(){return t.inc(Math.random()*r.trickleRate)},function(){var n=0,a=0;t.promise=function(o){return!o||o.state()==="resolved"?this:(a===0&&t.start(),n++,a++,o.always(function(){a--,a===0?(n=0,t.done()):t.set((n-a)/n)}),this)}}(),t.render=function(n){if(t.isRendered())return document.getElementById("nprogress");b(document.documentElement,"nprogress-busy");var a=document.createElement("div");a.id="nprogress",a.innerHTML=r.template;var o=a.querySelector(r.barSelector),w=n?"-100":l(t.status||0),y=document.querySelector(r.parent),h;return x(o,{transition:"all 0 linear",transform:"translate3d("+w+"%,0,0)"}),r.showSpinner||(h=a.querySelector(r.spinnerSelector),h&&N(h)),y!=document.body&&b(y,"nprogress-custom-parent"),y.appendChild(a),a},t.remove=function(){C(document.documentElement,"nprogress-busy"),C(document.querySelector(r.parent),"nprogress-custom-parent");var n=document.getElementById("nprogress");n&&N(n)},t.isRendered=function(){return!!document.getElementById("nprogress")},t.getPositioningCSS=function(){var n=document.body.style,a="WebkitTransform"in n?"Webkit":"MozTransform"in n?"Moz":"msTransform"in n?"ms":"OTransform"in n?"O":"";return a+"Perspective"in n?"translate3d":a+"Transform"in n?"translate":"margin"};function i(n,a,o){return n<a?a:n>o?o:n}function l(n){return(-1+n)*100}function m(n,a,o){var w;return r.positionUsing==="translate3d"?w={transform:"translate3d("+l(n)+"%,0,0)"}:r.positionUsing==="translate"?w={transform:"translate("+l(n)+"%,0)"}:w={"margin-left":l(n)+"%"},w.transition="all "+a+"ms "+o,w}var v=function(){var n=[];function a(){var o=n.shift();o&&o(a)}return function(o){n.push(o),n.length==1&&a()}}(),x=function(){var n=["Webkit","O","Moz","ms"],a={};function o(p){return p.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(T,P){return P.toUpperCase()})}function w(p){var T=document.body.style;if(p in T)return p;for(var P=n.length,S=p.charAt(0).toUpperCase()+p.slice(1),R;P--;)if(R=n[P]+S,R in T)return R;return p}function y(p){return p=o(p),a[p]||(a[p]=w(p))}function h(p,T,P){T=y(T),p.style[T]=P}return function(p,T){var P=arguments,S,R;if(P.length==2)for(S in T)R=T[S],R!==void 0&&T.hasOwnProperty(S)&&h(p,S,R);else h(p,P[1],P[2])}}();function d(n,a){var o=typeof n=="string"?n:D(n);return o.indexOf(" "+a+" ")>=0}function b(n,a){var o=D(n),w=o+a;d(o,a)||(n.className=w.substring(1))}function C(n,a){var o=D(n),w;d(n,a)&&(w=o.replace(" "+a+" "," "),n.className=w.substring(1,w.length-1))}function D(n){return(" "+(n.className||"")+" ").replace(/\s+/gi," ")}function N(n){n&&n.parentNode&&n.parentNode.removeChild(n)}return t})})(Ke);var Zt=Ke.exports;const Ne=mt(Zt),es="/assets/nprogress-DsBBVQQw.css";var I,Fe,ts=(Fe=class extends _e{constructor(e={}){super();j(this,I);this.config=e,O(this,I,new Map)}build(e,t,r){const i=t.queryKey,l=t.queryHash??Qe(i,t);let m=this.get(l);return m||(m=new wt({cache:this,queryKey:i,queryHash:l,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(m)),m}add(e){u(this,I).has(e.queryHash)||(u(this,I).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=u(this,I).get(e.queryHash);t&&(e.destroy(),t===e&&u(this,I).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){A.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return u(this,I).get(e)}getAll(){return[...u(this,I).values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>be(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>be(e,r)):t}notify(e){A.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){A.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){A.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},I=new WeakMap,Fe),M,Z,je,ss=(je=class extends _e{constructor(e={}){super();j(this,M);j(this,Z);this.config=e,O(this,M,new Map),O(this,Z,Date.now())}build(e,t,r){const i=new Ot({mutationCache:this,mutationId:++re(this,Z)._,options:e.defaultMutationOptions(t),state:r});return this.add(i),i}add(e){const t=ne(e),r=u(this,M).get(t)??[];r.push(e),u(this,M).set(t,r),this.notify({type:"added",mutation:e})}remove(e){var r;const t=ne(e);if(u(this,M).has(t)){const i=(r=u(this,M).get(t))==null?void 0:r.filter(l=>l!==e);i&&(i.length===0?u(this,M).delete(t):u(this,M).set(t,i))}this.notify({type:"removed",mutation:e})}canRun(e){var r;const t=(r=u(this,M).get(ne(e)))==null?void 0:r.find(i=>i.state.status==="pending");return!t||t===e}runNext(e){var r;const t=(r=u(this,M).get(ne(e)))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(t==null?void 0:t.continue())??Promise.resolve()}clear(){A.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...u(this,M).values()].flat()}find(e){const t={exact:!0,...e};return this.getAll().find(r=>Pe(t,r))}findAll(e={}){return this.getAll().filter(t=>Pe(e,t))}notify(e){A.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return A.batch(()=>Promise.all(e.map(t=>t.continue().catch(Q))))}},M=new WeakMap,Z=new WeakMap,je);function ne(s){var e;return((e=s.options.scope)==null?void 0:e.id)??String(s.mutationId)}function Me(s){return{onFetch:(e,t)=>{var b,C,D,N,n;const r=e.options,i=(D=(C=(b=e.fetchOptions)==null?void 0:b.meta)==null?void 0:C.fetchMore)==null?void 0:D.direction,l=((N=e.state.data)==null?void 0:N.pages)||[],m=((n=e.state.data)==null?void 0:n.pageParams)||[];let v={pages:[],pageParams:[]},x=0;const d=async()=>{let a=!1;const o=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(e.signal.aborted?a=!0:e.signal.addEventListener("abort",()=>{a=!0}),e.signal)})},w=Tt(e.options,e.fetchOptions),y=async(h,p,T)=>{if(a)return Promise.reject();if(p==null&&h.pages.length)return Promise.resolve(h);const P={queryKey:e.queryKey,pageParam:p,direction:T?"backward":"forward",meta:e.options.meta};o(P);const S=await w(P),{maxPages:R}=e.options,_=T?xt:bt;return{pages:_(h.pages,S,R),pageParams:_(h.pageParams,p,R)}};if(i&&l.length){const h=i==="backward",p=h?rs:Ae,T={pages:l,pageParams:m},P=p(r,T);v=await y(T,P,h)}else{const h=s??l.length;do{const p=x===0?m[0]??r.initialPageParam:Ae(r,v);if(x>0&&p==null)break;v=await y(v,p),x++}while(x<h)}return v};e.options.persister?e.fetchFn=()=>{var a,o;return(o=(a=e.options).persister)==null?void 0:o.call(a,d,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},t)}:e.fetchFn=d}}}function Ae(s,{pages:e,pageParams:t}){const r=e.length-1;return e.length>0?s.getNextPageParam(e[r],e,t[r],t):void 0}function rs(s,{pages:e,pageParams:t}){var r;return e.length>0?(r=s.getPreviousPageParam)==null?void 0:r.call(s,e[0],e,t[0],t):void 0}var E,q,K,B,U,H,$,z,Ie,ns=(Ie=class{constructor(s={}){j(this,E);j(this,q);j(this,K);j(this,B);j(this,U);j(this,H);j(this,$);j(this,z);O(this,E,s.queryCache||new ts),O(this,q,s.mutationCache||new ss),O(this,K,s.defaultOptions||{}),O(this,B,new Map),O(this,U,new Map),O(this,H,0)}mount(){re(this,H)._++,u(this,H)===1&&(O(this,$,Pt.subscribe(async s=>{s&&(await this.resumePausedMutations(),u(this,E).onFocus())})),O(this,z,Ee.subscribe(async s=>{s&&(await this.resumePausedMutations(),u(this,E).onOnline())})))}unmount(){var s,e;re(this,H)._--,u(this,H)===0&&((s=u(this,$))==null||s.call(this),O(this,$,void 0),(e=u(this,z))==null||e.call(this),O(this,z,void 0))}isFetching(s){return u(this,E).findAll({...s,fetchStatus:"fetching"}).length}isMutating(s){return u(this,q).findAll({...s,status:"pending"}).length}getQueryData(s){var t;const e=this.defaultQueryOptions({queryKey:s});return(t=u(this,E).get(e.queryHash))==null?void 0:t.state.data}ensureQueryData(s){const e=this.getQueryData(s.queryKey);if(e===void 0)return this.fetchQuery(s);{const t=this.defaultQueryOptions(s),r=u(this,E).build(this,t);return s.revalidateIfStale&&r.isStaleByTime(Ce(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(e)}}getQueriesData(s){return u(this,E).findAll(s).map(({queryKey:e,state:t})=>{const r=t.data;return[e,r]})}setQueryData(s,e,t){const r=this.defaultQueryOptions({queryKey:s}),i=u(this,E).get(r.queryHash),l=i==null?void 0:i.state.data,m=Et(e,l);if(m!==void 0)return u(this,E).build(this,r).setData(m,{...t,manual:!0})}setQueriesData(s,e,t){return A.batch(()=>u(this,E).findAll(s).map(({queryKey:r})=>[r,this.setQueryData(r,e,t)]))}getQueryState(s){var t;const e=this.defaultQueryOptions({queryKey:s});return(t=u(this,E).get(e.queryHash))==null?void 0:t.state}removeQueries(s){const e=u(this,E);A.batch(()=>{e.findAll(s).forEach(t=>{e.remove(t)})})}resetQueries(s,e){const t=u(this,E),r={type:"active",...s};return A.batch(()=>(t.findAll(s).forEach(i=>{i.reset()}),this.refetchQueries(r,e)))}cancelQueries(s={},e={}){const t={revert:!0,...e},r=A.batch(()=>u(this,E).findAll(s).map(i=>i.cancel(t)));return Promise.all(r).then(Q).catch(Q)}invalidateQueries(s={},e={}){return A.batch(()=>{if(u(this,E).findAll(s).forEach(r=>{r.invalidate()}),s.refetchType==="none")return Promise.resolve();const t={...s,type:s.refetchType??s.type??"active"};return this.refetchQueries(t,e)})}refetchQueries(s={},e){const t={...e,cancelRefetch:(e==null?void 0:e.cancelRefetch)??!0},r=A.batch(()=>u(this,E).findAll(s).filter(i=>!i.isDisabled()).map(i=>{let l=i.fetch(void 0,t);return t.throwOnError||(l=l.catch(Q)),i.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(r).then(Q)}fetchQuery(s){const e=this.defaultQueryOptions(s);e.retry===void 0&&(e.retry=!1);const t=u(this,E).build(this,e);return t.isStaleByTime(Ce(e.staleTime,t))?t.fetch(e):Promise.resolve(t.state.data)}prefetchQuery(s){return this.fetchQuery(s).then(Q).catch(Q)}fetchInfiniteQuery(s){return s.behavior=Me(s.pages),this.fetchQuery(s)}prefetchInfiniteQuery(s){return this.fetchInfiniteQuery(s).then(Q).catch(Q)}ensureInfiniteQueryData(s){return s.behavior=Me(s.pages),this.ensureQueryData(s)}resumePausedMutations(){return Ee.isOnline()?u(this,q).resumePausedMutations():Promise.resolve()}getQueryCache(){return u(this,E)}getMutationCache(){return u(this,q)}getDefaultOptions(){return u(this,K)}setDefaultOptions(s){O(this,K,s)}setQueryDefaults(s,e){u(this,B).set(Se(s),{queryKey:s,defaultOptions:e})}getQueryDefaults(s){const e=[...u(this,B).values()];let t={};return e.forEach(r=>{Re(s,r.queryKey)&&(t={...t,...r.defaultOptions})}),t}setMutationDefaults(s,e){u(this,U).set(Se(s),{mutationKey:s,defaultOptions:e})}getMutationDefaults(s){const e=[...u(this,U).values()];let t={};return e.forEach(r=>{Re(s,r.mutationKey)&&(t={...t,...r.defaultOptions})}),t}defaultQueryOptions(s){if(s._defaulted)return s;const e={...u(this,K).queries,...this.getQueryDefaults(s.queryKey),...s,_defaulted:!0};return e.queryHash||(e.queryHash=Qe(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.enabled!==!0&&e.queryFn===Ct&&(e.enabled=!1),e}defaultMutationOptions(s){return s!=null&&s._defaulted?s:{...u(this,K).mutations,...(s==null?void 0:s.mutationKey)&&this.getMutationDefaults(s.mutationKey),...s,_defaulted:!0}}clear(){u(this,E).clear(),u(this,q).clear()}},E=new WeakMap,q=new WeakMap,K=new WeakMap,B=new WeakMap,U=new WeakMap,H=new WeakMap,$=new WeakMap,z=new WeakMap,Ie),me="ToastProvider",[ve,as,os]=zt("Toast"),[He,Hs]=qt("Toast",[os]),[is,ie]=He(me),Ve=s=>{const{__scopeToast:e,label:t="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:l=50,children:m}=s,[v,x]=f.useState(null),[d,b]=f.useState(0),C=f.useRef(!1),D=f.useRef(!1);return t.trim()||console.error(`Invalid prop \`label\` supplied to \`${me}\`. Expected non-empty \`string\`.`),c.jsx(ve.Provider,{scope:e,children:c.jsx(is,{scope:e,label:t,duration:r,swipeDirection:i,swipeThreshold:l,toastCount:d,viewport:v,onViewportChange:x,onToastAdd:f.useCallback(()=>b(N=>N+1),[]),onToastRemove:f.useCallback(()=>b(N=>N-1),[]),isFocusedToastEscapeKeyDownRef:C,isClosePausedRef:D,children:m})})};Ve.displayName=me;var We="ToastViewport",cs=["F8"],fe="toast.viewportPause",pe="toast.viewportResume",Be=f.forwardRef((s,e)=>{const{__scopeToast:t,hotkey:r=cs,label:i="Notifications ({hotkey})",...l}=s,m=ie(We,t),v=as(t),x=f.useRef(null),d=f.useRef(null),b=f.useRef(null),C=f.useRef(null),D=Le(e,C,m.onViewportChange),N=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),n=m.toastCount>0;f.useEffect(()=>{const o=w=>{var h;r.length!==0&&r.every(p=>w[p]||w.code===p)&&((h=C.current)==null||h.focus())};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[r]),f.useEffect(()=>{const o=x.current,w=C.current;if(n&&o&&w){const y=()=>{if(!m.isClosePausedRef.current){const P=new CustomEvent(fe);w.dispatchEvent(P),m.isClosePausedRef.current=!0}},h=()=>{if(m.isClosePausedRef.current){const P=new CustomEvent(pe);w.dispatchEvent(P),m.isClosePausedRef.current=!1}},p=P=>{!o.contains(P.relatedTarget)&&h()},T=()=>{o.contains(document.activeElement)||h()};return o.addEventListener("focusin",y),o.addEventListener("focusout",p),o.addEventListener("pointermove",y),o.addEventListener("pointerleave",T),window.addEventListener("blur",y),window.addEventListener("focus",h),()=>{o.removeEventListener("focusin",y),o.removeEventListener("focusout",p),o.removeEventListener("pointermove",y),o.removeEventListener("pointerleave",T),window.removeEventListener("blur",y),window.removeEventListener("focus",h)}}},[n,m.isClosePausedRef]);const a=f.useCallback(({tabbingDirection:o})=>{const y=v().map(h=>{const p=h.ref.current,T=[p,...xs(p)];return o==="forwards"?T:T.reverse()});return(o==="forwards"?y.reverse():y).flat()},[v]);return f.useEffect(()=>{const o=C.current;if(o){const w=y=>{var T,P,S;const h=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!h){const R=document.activeElement,_=y.shiftKey;if(y.target===o&&_){(T=d.current)==null||T.focus();return}const V=a({tabbingDirection:_?"backwards":"forwards"}),ee=V.findIndex(g=>g===R);de(V.slice(ee+1))?y.preventDefault():_?(P=d.current)==null||P.focus():(S=b.current)==null||S.focus()}};return o.addEventListener("keydown",w),()=>o.removeEventListener("keydown",w)}},[v,a]),c.jsxs(Kt,{ref:x,role:"region","aria-label":i.replace("{hotkey}",N),tabIndex:-1,style:{pointerEvents:n?void 0:"none"},children:[n&&c.jsx(he,{ref:d,onFocusFromOutsideViewport:()=>{const o=a({tabbingDirection:"forwards"});de(o)}}),c.jsx(ve.Slot,{scope:t,children:c.jsx(X.ol,{tabIndex:-1,...l,ref:D})}),n&&c.jsx(he,{ref:b,onFocusFromOutsideViewport:()=>{const o=a({tabbingDirection:"backwards"});de(o)}})]})});Be.displayName=We;var Ue="ToastFocusProxy",he=f.forwardRef((s,e)=>{const{__scopeToast:t,onFocusFromOutsideViewport:r,...i}=s,l=ie(Ue,t);return c.jsx(qe,{"aria-hidden":!0,tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:m=>{var d;const v=m.relatedTarget;!((d=l.viewport)!=null&&d.contains(v))&&r()}})});he.displayName=Ue;var ce="Toast",us="toast.swipeStart",ls="toast.swipeMove",ds="toast.swipeCancel",fs="toast.swipeEnd",$e=f.forwardRef((s,e)=>{const{forceMount:t,open:r,defaultOpen:i,onOpenChange:l,...m}=s,[v=!0,x]=Ht({prop:r,defaultProp:i,onChange:l});return c.jsx(Vt,{present:t||v,children:c.jsx(ms,{open:v,...m,ref:e,onClose:()=>x(!1),onPause:oe(s.onPause),onResume:oe(s.onResume),onSwipeStart:k(s.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:k(s.onSwipeMove,d=>{const{x:b,y:C}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${b}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${C}px`)}),onSwipeCancel:k(s.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:k(s.onSwipeEnd,d=>{const{x:b,y:C}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${b}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${C}px`),x(!1)})})})});$e.displayName=ce;var[ps,hs]=He(ce,{onClose(){}}),ms=f.forwardRef((s,e)=>{const{__scopeToast:t,type:r="foreground",duration:i,open:l,onClose:m,onEscapeKeyDown:v,onPause:x,onResume:d,onSwipeStart:b,onSwipeMove:C,onSwipeCancel:D,onSwipeEnd:N,...n}=s,a=ie(ce,t),[o,w]=f.useState(null),y=Le(e,g=>w(g)),h=f.useRef(null),p=f.useRef(null),T=i||a.duration,P=f.useRef(0),S=f.useRef(T),R=f.useRef(0),{onToastAdd:_,onToastRemove:ue}=a,W=oe(()=>{var F;(o==null?void 0:o.contains(document.activeElement))&&((F=a.viewport)==null||F.focus()),m()}),V=f.useCallback(g=>{!g||g===1/0||(window.clearTimeout(R.current),P.current=new Date().getTime(),R.current=window.setTimeout(W,g))},[W]);f.useEffect(()=>{const g=a.viewport;if(g){const F=()=>{V(S.current),d==null||d()},L=()=>{const J=new Date().getTime()-P.current;S.current=S.current-J,window.clearTimeout(R.current),x==null||x()};return g.addEventListener(fe,L),g.addEventListener(pe,F),()=>{g.removeEventListener(fe,L),g.removeEventListener(pe,F)}}},[a.viewport,T,x,d,V]),f.useEffect(()=>{l&&!a.isClosePausedRef.current&&V(T)},[l,T,a.isClosePausedRef,V]),f.useEffect(()=>(_(),()=>ue()),[_,ue]);const ee=f.useMemo(()=>o?et(o):null,[o]);return a.viewport?c.jsxs(c.Fragment,{children:[ee&&c.jsx(vs,{__scopeToast:t,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:ee}),c.jsx(ps,{scope:t,onClose:W,children:jt.createPortal(c.jsx(ve.ItemSlot,{scope:t,children:c.jsx(Wt,{asChild:!0,onEscapeKeyDown:k(v,()=>{a.isFocusedToastEscapeKeyDownRef.current||W(),a.isFocusedToastEscapeKeyDownRef.current=!1}),children:c.jsx(X.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":l?"open":"closed","data-swipe-direction":a.swipeDirection,...n,ref:y,style:{userSelect:"none",touchAction:"none",...s.style},onKeyDown:k(s.onKeyDown,g=>{g.key==="Escape"&&(v==null||v(g.nativeEvent),g.nativeEvent.defaultPrevented||(a.isFocusedToastEscapeKeyDownRef.current=!0,W()))}),onPointerDown:k(s.onPointerDown,g=>{g.button===0&&(h.current={x:g.clientX,y:g.clientY})}),onPointerMove:k(s.onPointerMove,g=>{if(!h.current)return;const F=g.clientX-h.current.x,L=g.clientY-h.current.y,J=!!p.current,G=["left","right"].includes(a.swipeDirection),te=["left","up"].includes(a.swipeDirection)?Math.min:Math.max,ft=G?te(0,F):0,pt=G?0:te(0,L),le=g.pointerType==="touch"?10:2,se={x:ft,y:pt},ge={originalEvent:g,delta:se};J?(p.current=se,ae(ls,C,ge,{discrete:!1})):De(se,a.swipeDirection,le)?(p.current=se,ae(us,b,ge,{discrete:!1}),g.target.setPointerCapture(g.pointerId)):(Math.abs(F)>le||Math.abs(L)>le)&&(h.current=null)}),onPointerUp:k(s.onPointerUp,g=>{const F=p.current,L=g.target;if(L.hasPointerCapture(g.pointerId)&&L.releasePointerCapture(g.pointerId),p.current=null,h.current=null,F){const J=g.currentTarget,G={originalEvent:g,delta:F};De(F,a.swipeDirection,a.swipeThreshold)?ae(fs,N,G,{discrete:!0}):ae(ds,D,G,{discrete:!0}),J.addEventListener("click",te=>te.preventDefault(),{once:!0})}})})})}),a.viewport)})]}):null}),vs=s=>{const{__scopeToast:e,children:t,...r}=s,i=ie(ce,e),[l,m]=f.useState(!1),[v,x]=f.useState(!1);return ws(()=>m(!0)),f.useEffect(()=>{const d=window.setTimeout(()=>x(!0),1e3);return()=>window.clearTimeout(d)},[]),v?null:c.jsx(Bt,{asChild:!0,children:c.jsx(qe,{...r,children:l&&c.jsxs(c.Fragment,{children:[i.label," ",t]})})})},ys="ToastTitle",ze=f.forwardRef((s,e)=>{const{__scopeToast:t,...r}=s;return c.jsx(X.div,{...r,ref:e})});ze.displayName=ys;var gs="ToastDescription",Xe=f.forwardRef((s,e)=>{const{__scopeToast:t,...r}=s;return c.jsx(X.div,{...r,ref:e})});Xe.displayName=gs;var Ye="ToastAction",Je=f.forwardRef((s,e)=>{const{altText:t,...r}=s;return t.trim()?c.jsx(Ze,{altText:t,asChild:!0,children:c.jsx(ye,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${Ye}\`. Expected non-empty \`string\`.`),null)});Je.displayName=Ye;var Ge="ToastClose",ye=f.forwardRef((s,e)=>{const{__scopeToast:t,...r}=s,i=hs(Ge,t);return c.jsx(Ze,{asChild:!0,children:c.jsx(X.button,{type:"button",...r,ref:e,onClick:k(s.onClick,i.onClose)})})});ye.displayName=Ge;var Ze=f.forwardRef((s,e)=>{const{__scopeToast:t,altText:r,...i}=s;return c.jsx(X.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:e})});function et(s){const e=[];return Array.from(s.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),Ts(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",l=r.dataset.radixToastAnnounceExclude==="";if(!i)if(l){const m=r.dataset.radixToastAnnounceAlt;m&&e.push(m)}else e.push(...et(r))}}),e}function ae(s,e,t,{discrete:r}){const i=t.originalEvent.currentTarget,l=new CustomEvent(s,{bubbles:!0,cancelable:!0,detail:t});e&&i.addEventListener(s,e,{once:!0}),r?Xt(i,l):i.dispatchEvent(l)}var De=(s,e,t=0)=>{const r=Math.abs(s.x),i=Math.abs(s.y),l=r>i;return e==="left"||e==="right"?l&&r>t:!l&&i>t};function ws(s=()=>{}){const e=oe(s);Ut(()=>{let t=0,r=0;return t=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(t),window.cancelAnimationFrame(r)}},[e])}function Ts(s){return s.nodeType===s.ELEMENT_NODE}function xs(s){const e=[],t=document.createTreeWalker(s,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function de(s){const e=document.activeElement;return s.some(t=>t===e?!0:(t.focus(),document.activeElement!==e))}var bs=Ve,tt=Be,st=$e,rt=ze,nt=Xe,at=Je,ot=ye;const Ps=bs,it=f.forwardRef(({className:s,...e},t)=>c.jsx(tt,{ref:t,className:Y("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",s),...e}));it.displayName=tt.displayName;const Es=$t("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),ct=f.forwardRef(({className:s,variant:e,...t},r)=>c.jsx(st,{ref:r,className:Y(Es({variant:e}),s),...t}));ct.displayName=st.displayName;const Cs=f.forwardRef(({className:s,...e},t)=>c.jsx(at,{ref:t,className:Y("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",s),...e}));Cs.displayName=at.displayName;const ut=f.forwardRef(({className:s,...e},t)=>c.jsx(ot,{ref:t,className:Y("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",s),"toast-close":"",...e,children:c.jsx(Mt,{className:"h-4 w-4"})}));ut.displayName=ot.displayName;const lt=f.forwardRef(({className:s,...e},t)=>c.jsx(rt,{ref:t,className:Y("text-sm font-semibold [&+div]:text-xs",s),...e}));lt.displayName=rt.displayName;const dt=f.forwardRef(({className:s,...e},t)=>c.jsx(nt,{ref:t,className:Y("text-sm opacity-90",s),...e}));dt.displayName=nt.displayName;function Ss(){const{toasts:s}=Nt();return c.jsxs(Ps,{children:[s.map(function({id:e,title:t,description:r,action:i,...l}){return c.jsxs(ct,{...l,children:[c.jsxs("div",{className:"grid gap-1",children:[t&&c.jsx(lt,{children:t}),r&&c.jsx(dt,{children:r})]}),i,c.jsx(ut,{})]},e)}),c.jsx(it,{})]})}const Vs=()=>[{rel:"stylesheet",href:Gt},{rel:"stylesheet",href:es}];function Ws({children:s}){return c.jsxs("html",{lang:"en",suppressHydrationWarning:!0,children:[c.jsxs("head",{children:[c.jsx("meta",{charSet:"utf-8"}),c.jsx("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),c.jsx(_t,{}),c.jsx(Qt,{})]}),c.jsxs("body",{className:"min-h-screen bg-background font-sans antialiased",children:[s,c.jsx(Jt,{}),c.jsx(Lt,{})]})]})}const Rs=new ns({defaultOptions:{queries:{staleTime:1e3*60*1}}});function Bs(){const{session:s}=It(),e=St(),t=yt(),r=ke(),i=s==null?void 0:s.access_token;f.useEffect(()=>{const{data:{subscription:x}}=e.auth.onAuthStateChange((d,b)=>{(b==null?void 0:b.access_token)!==i&&t.revalidate()});return()=>{x.unsubscribe()}},[i,e]);const l=gt(),m=kt(),v=f.useMemo(function(){return[l.state,...m.map(b=>b.state)].every(b=>b==="idle")?"idle":"loading"},[l.state,m]);return f.useEffect(()=>{v==="loading"&&Ne.start(),v==="idle"&&Ne.done()},[v,l.state]),c.jsx(Rt,{client:Rs,children:r.pathname==="/"?c.jsx(xe,{}):c.jsxs(Yt,{children:[c.jsx(Ss,{}),c.jsx(xe,{})]})})}export{Ws as Layout,Bs as default,Vs as links};
