diff --git a/public/assets/admin/assets/index-_xd8OyP8.js b/public/assets/admin/assets/index-_xd8OyP8.js index 0daa9aa..632963d 100644 --- a/public/assets/admin/assets/index-_xd8OyP8.js +++ b/public/assets/admin/assets/index-_xd8OyP8.js @@ -80,4 +80,4 @@ Error generating stack: `+i.message+` `+i.map(Ch).join(` `):" "+Ch(i[0]):"as no adapter specified";throw new Z("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:Ku};function Ml(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new wo(null,e)}function kh(e){return Ml(e),e.headers=ht.from(e.headers),e.data=Dl.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),fg.getAdapter(e.adapter||Ii.adapter)(e).then(function(r){return Ml(e),r.data=Dl.call(e,e.transformResponse,r),r.headers=ht.from(r.headers),r},function(r){return ag(r)||(Ml(e),r&&r.response&&(r.response.data=Dl.call(e,e.transformResponse,r.response),r.response.headers=ht.from(r.response.headers))),Promise.reject(r)})}const hg="1.7.9",Hs={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Hs[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const bh={};Hs.transitional=function(t,n,r){function o(i,a){return"[Axios v"+hg+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,s)=>{if(t===!1)throw new Z(o(a," has been removed"+(n?" in "+n:"")),Z.ERR_DEPRECATED);return n&&!bh[a]&&(bh[a]=!0,console.warn(o(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,a,s):!0}};Hs.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function B_(e,t,n){if(typeof e!="object")throw new Z("options must be an object",Z.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const s=e[i],l=s===void 0||a(s,i,e);if(l!==!0)throw new Z("option "+i+" must be "+l,Z.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Z("Unknown option "+i,Z.ERR_BAD_OPTION)}}const Na={assertOptions:B_,validators:Hs},Zt=Na.validators;class pr{constructor(t){this.defaults=t,this.interceptors={request:new gh,response:new gh}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=` `+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Cr(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&Na.assertOptions(r,{silentJSONParsing:Zt.transitional(Zt.boolean),forcedJSONParsing:Zt.transitional(Zt.boolean),clarifyTimeoutError:Zt.transitional(Zt.boolean)},!1),o!=null&&(b.isFunction(o)?n.paramsSerializer={serialize:o}:Na.assertOptions(o,{encode:Zt.function,serialize:Zt.function},!0)),Na.assertOptions(n,{baseUrl:Zt.spelling("baseURL"),withXsrfToken:Zt.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&b.merge(i.common,i[n.method]);i&&b.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),n.headers=ht.concat(a,i);const s=[];let l=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(l=l&&v.synchronous,s.unshift(v.fulfilled,v.rejected))});const u=[];this.interceptors.response.forEach(function(v){u.push(v.fulfilled,v.rejected)});let c,d=0,p;if(!l){const y=[kh.bind(this),void 0];for(y.unshift.apply(y,s),y.push.apply(y,u),p=y.length,c=Promise.resolve(n);d{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(s=>{r.subscribe(s),i=s}).then(o);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,s){r.reason||(r.reason=new wo(i,a,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new sd(function(o){t=o}),cancel:t}}}function $_(e){return function(n){return e.apply(null,n)}}function H_(e){return b.isObject(e)&&e.isAxiosError===!0}const Qu={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};Object.entries(Qu).forEach(([e,t])=>{Qu[t]=e});function pg(e){const t=new pr(e),n=Wy(pr.prototype.request,t);return b.extend(n,pr.prototype,t,{allOwnKeys:!0}),b.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return pg(Cr(e,o))},n}const Ue=pg(Ii);Ue.Axios=pr;Ue.CanceledError=wo;Ue.CancelToken=sd;Ue.isCancel=ag;Ue.VERSION=hg;Ue.toFormData=Bs;Ue.AxiosError=Z;Ue.Cancel=Ue.CanceledError;Ue.all=function(t){return Promise.all(t)};Ue.spread=$_;Ue.isAxiosError=H_;Ue.mergeConfig=Cr;Ue.AxiosHeaders=ht;Ue.formToJSON=e=>ig(b.isHTMLForm(e)?new FormData(e):e);Ue.getAdapter=fg.getAdapter;Ue.HttpStatusCode=Qu;Ue.default=Ue;const V_="locale";function W_(){return ed.get(V_)}var K_=e=>{switch(e){case"success":return G_;case"info":return J_;case"warning":return Y_;case"error":return X_;default:return null}},Q_=Array(12).fill(0),q_=({visible:e,className:t})=>M.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},M.createElement("div",{className:"sonner-spinner"},Q_.map((n,r)=>M.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),G_=M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},M.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"})),Y_=M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},M.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"})),J_=M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},M.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"})),X_=M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},M.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"})),Z_=M.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"},M.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),M.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),eC=()=>{let[e,t]=M.useState(document.hidden);return M.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},qu=1,tC=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof e?.id=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:qu++,i=this.toasts.find(s=>s.id===o),a=e.dismissible===void 0?!0:e.dismissible;return i?this.toasts=this.toasts.map(s=>s.id===o?(this.publish({...s,...e,id:o,title:n}),{...s,...e,id:o,dismissible:a,title:n}):s):this.addToast({title:n,...r,dismissible:a,id:o}),o},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0,i,a=r.then(async l=>{if(i=["resolve",l],M.isValidElement(l))o=!1,this.create({id:n,type:"default",message:l});else if(rC(l)&&!l.ok){o=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,c=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:u,description:c})}else if(t.success!==void 0){o=!1;let u=typeof t.success=="function"?await t.success(l):t.success,c=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:u,description:c})}}).catch(async l=>{if(i=["reject",l],t.error!==void 0){o=!1;let u=typeof t.error=="function"?await t.error(l):t.error,c=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:u,description:c})}}).finally(()=>{var l;o&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),s=()=>new Promise((l,u)=>a.then(()=>i[0]==="reject"?u(i[1]):l(i[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||qu++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},vt=new tC,nC=(e,t)=>{let n=t?.id||qu++;return vt.addToast({title:e,...t,id:n}),n},rC=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",oC=nC,iC=()=>vt.toasts,aC=Object.assign(oC,{success:vt.success,info:vt.info,warning:vt.warning,error:vt.error,custom:vt.custom,message:vt.message,promise:vt.promise,dismiss:vt.dismiss,loading:vt.loading},{getHistory:iC});function sC(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}sC(`:where(html[dir="ltr"]),:where([data-sonner-toaster][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%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][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%)}:where([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:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([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);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([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 #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([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)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([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;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([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);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-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([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}:where([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}:where([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, 0px));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:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--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-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-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--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, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--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-rich-colors=true][data-sonner-toast][data-type=success],[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],[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],[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],[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:nth-child(1){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)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{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 pa(e){return e.label!==void 0}var lC=3,uC="32px",Rh=4e3,cC=356,dC=14,fC=20,hC=200;function pC(...e){return e.filter(Boolean).join(" ")}var mC=e=>{var t,n,r,o,i,a,s,l,u,c,d;let{invert:p,toast:f,unstyled:y,interacting:v,setHeights:E,visibleToasts:m,heights:h,index:g,toasts:x,expanded:R,removeToast:w,defaultRichColors:P,closeButton:T,style:A,cancelButtonStyle:z,actionButtonStyle:te,className:H="",descriptionClassName:pe="",duration:le,position:tt,gap:De,loadingIcon:ie,expandByDefault:D,classNames:L,icons:B,closeButtonAriaLabel:G="Close toast",pauseWhenPageIsHidden:K,cn:J}=e,[X,ge]=M.useState(!1),[be,fe]=M.useState(!1),[So,Jn]=M.useState(!1),[Xn,Me]=M.useState(!1),[xn,Eo]=M.useState(!1),[Ks,zt]=M.useState(0),[Qs,Ui]=M.useState(0),Zn=M.useRef(f.duration||le||Rh),Bi=M.useRef(null),_n=M.useRef(null),qs=g===0,Gs=g+1<=m,ze=f.type,Tt=f.dismissible!==!1,$i=f.className||"",xo=f.descriptionClassName||"",pt=M.useMemo(()=>h.findIndex(q=>q.toastId===f.id)||0,[h,f.id]),jt=M.useMemo(()=>{var q;return(q=f.closeButton)!=null?q:T},[f.closeButton,T]);M.useMemo(()=>f.duration||le||Rh,[f.duration,le]);let Pr=M.useRef(0),Ft=M.useRef(0),Hi=M.useRef(0),mt=M.useRef(null),[_o,Vi]=tt.split("-"),Co=M.useMemo(()=>h.reduce((q,de,ye)=>ye>=pt?q:q+de.height,0),[h,pt]),Wi=eC(),Ki=f.invert||p,Cn=ze==="loading";Ft.current=M.useMemo(()=>pt*De+Co,[pt,Co]),M.useEffect(()=>{ge(!0)},[]),M.useEffect(()=>{let q=_n.current;if(q){let de=q.getBoundingClientRect().height;return Ui(de),E(ye=>[{toastId:f.id,height:de,position:f.position},...ye]),()=>E(ye=>ye.filter(yt=>yt.toastId!==f.id))}},[E,f.id]),M.useLayoutEffect(()=>{if(!X)return;let q=_n.current,de=q.style.height;q.style.height="auto";let ye=q.getBoundingClientRect().height;q.style.height=de,Ui(ye),E(yt=>yt.find(gt=>gt.toastId===f.id)?yt.map(gt=>gt.toastId===f.id?{...gt,height:ye}:gt):[{toastId:f.id,height:ye,position:f.position},...yt])},[X,f.title,f.description,E,f.id]);let It=M.useCallback(()=>{fe(!0),zt(Ft.current),E(q=>q.filter(de=>de.toastId!==f.id)),setTimeout(()=>{w(f)},hC)},[f,w,E,Ft]);M.useEffect(()=>{if(f.promise&&ze==="loading"||f.duration===1/0||f.type==="loading")return;let q;return R||v||K&&Wi?(()=>{if(Hi.current{var de;(de=f.onAutoClose)==null||de.call(f,f),It()},Zn.current)),()=>clearTimeout(q)},[R,v,f,ze,K,Wi,It]),M.useEffect(()=>{f.delete&&It()},[It,f.delete]);function ko(){var q,de,ye;return B!=null&&B.loading?M.createElement("div",{className:J(L?.loader,(q=f?.classNames)==null?void 0:q.loader,"sonner-loader"),"data-visible":ze==="loading"},B.loading):ie?M.createElement("div",{className:J(L?.loader,(de=f?.classNames)==null?void 0:de.loader,"sonner-loader"),"data-visible":ze==="loading"},ie):M.createElement(q_,{className:J(L?.loader,(ye=f?.classNames)==null?void 0:ye.loader),visible:ze==="loading"})}return M.createElement("li",{tabIndex:0,ref:_n,className:J(H,$i,L?.toast,(t=f?.classNames)==null?void 0:t.toast,L?.default,L?.[ze],(n=f?.classNames)==null?void 0:n[ze]),"data-sonner-toast":"","data-rich-colors":(r=f.richColors)!=null?r:P,"data-styled":!(f.jsx||f.unstyled||y),"data-mounted":X,"data-promise":!!f.promise,"data-swiped":xn,"data-removed":be,"data-visible":Gs,"data-y-position":_o,"data-x-position":Vi,"data-index":g,"data-front":qs,"data-swiping":So,"data-dismissible":Tt,"data-type":ze,"data-invert":Ki,"data-swipe-out":Xn,"data-expanded":!!(R||D&&X),style:{"--index":g,"--toasts-before":g,"--z-index":x.length-g,"--offset":`${be?Ks:Ft.current}px`,"--initial-height":D?"auto":`${Qs}px`,...A,...f.style},onPointerDown:q=>{Cn||!Tt||(Bi.current=new Date,zt(Ft.current),q.target.setPointerCapture(q.pointerId),q.target.tagName!=="BUTTON"&&(Jn(!0),mt.current={x:q.clientX,y:q.clientY}))},onPointerUp:()=>{var q,de,ye,yt;if(Xn||!Tt)return;mt.current=null;let gt=Number(((q=_n.current)==null?void 0:q.style.getPropertyValue("--swipe-amount").replace("px",""))||0),on=new Date().getTime()-((de=Bi.current)==null?void 0:de.getTime()),Tr=Math.abs(gt)/on;if(Math.abs(gt)>=fC||Tr>.11){zt(Ft.current),(ye=f.onDismiss)==null||ye.call(f,f),It(),Me(!0),Eo(!1);return}(yt=_n.current)==null||yt.style.setProperty("--swipe-amount","0px"),Jn(!1)},onPointerMove:q=>{var de,ye;if(!mt.current||!Tt)return;let yt=q.clientY-mt.current.y,gt=((de=window.getSelection())==null?void 0:de.toString().length)>0,on=_o==="top"?Math.min(0,yt):Math.max(0,yt);Math.abs(on)>0&&Eo(!0),!gt&&((ye=_n.current)==null||ye.style.setProperty("--swipe-amount",`${on}px`))}},jt&&!f.jsx?M.createElement("button",{"aria-label":G,"data-disabled":Cn,"data-close-button":!0,onClick:Cn||!Tt?()=>{}:()=>{var q;It(),(q=f.onDismiss)==null||q.call(f,f)},className:J(L?.closeButton,(o=f?.classNames)==null?void 0:o.closeButton)},(i=B?.close)!=null?i:Z_):null,f.jsx||M.isValidElement(f.title)?f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title:M.createElement(M.Fragment,null,ze||f.icon||f.promise?M.createElement("div",{"data-icon":"",className:J(L?.icon,(a=f?.classNames)==null?void 0:a.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||ko():null,f.type!=="loading"?f.icon||B?.[ze]||K_(ze):null):null,M.createElement("div",{"data-content":"",className:J(L?.content,(s=f?.classNames)==null?void 0:s.content)},M.createElement("div",{"data-title":"",className:J(L?.title,(l=f?.classNames)==null?void 0:l.title)},typeof f.title=="function"?f.title():f.title),f.description?M.createElement("div",{"data-description":"",className:J(pe,xo,L?.description,(u=f?.classNames)==null?void 0:u.description)},typeof f.description=="function"?f.description():f.description):null),M.isValidElement(f.cancel)?f.cancel:f.cancel&&pa(f.cancel)?M.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||z,onClick:q=>{var de,ye;pa(f.cancel)&&Tt&&((ye=(de=f.cancel).onClick)==null||ye.call(de,q),It())},className:J(L?.cancelButton,(c=f?.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,M.isValidElement(f.action)?f.action:f.action&&pa(f.action)?M.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||te,onClick:q=>{var de,ye;pa(f.action)&&((ye=(de=f.action).onClick)==null||ye.call(de,q),!q.defaultPrevented&&It())},className:J(L?.actionButton,(d=f?.classNames)==null?void 0:d.actionButton)},f.action.label):null))};function Ph(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var yC=k.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:i,closeButton:a,className:s,offset:l,theme:u="light",richColors:c,duration:d,style:p,visibleToasts:f=lC,toastOptions:y,dir:v=Ph(),gap:E=dC,loadingIcon:m,icons:h,containerAriaLabel:g="Notifications",pauseWhenPageIsHidden:x,cn:R=pC}=e,[w,P]=M.useState([]),T=M.useMemo(()=>Array.from(new Set([r].concat(w.filter(K=>K.position).map(K=>K.position)))),[w,r]),[A,z]=M.useState([]),[te,H]=M.useState(!1),[pe,le]=M.useState(!1),[tt,De]=M.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),ie=M.useRef(null),D=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=M.useRef(null),B=M.useRef(!1),G=M.useCallback(K=>{P(J=>{var X;return(X=J.find(ge=>ge.id===K.id))!=null&&X.delete||vt.dismiss(K.id),J.filter(({id:ge})=>ge!==K.id)})},[]);return M.useEffect(()=>vt.subscribe(K=>{if(K.dismiss){P(J=>J.map(X=>X.id===K.id?{...X,delete:!0}:X));return}setTimeout(()=>{Gm.flushSync(()=>{P(J=>{let X=J.findIndex(ge=>ge.id===K.id);return X!==-1?[...J.slice(0,X),{...J[X],...K},...J.slice(X+1)]:[K,...J]})})})}),[]),M.useEffect(()=>{if(u!=="system"){De(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?De("dark"):De("light")),typeof window>"u")return;let K=window.matchMedia("(prefers-color-scheme: dark)");try{K.addEventListener("change",({matches:J})=>{De(J?"dark":"light")})}catch{K.addListener(({matches:X})=>{try{De(X?"dark":"light")}catch(ge){console.error(ge)}})}},[u]),M.useEffect(()=>{w.length<=1&&H(!1)},[w]),M.useEffect(()=>{let K=J=>{var X,ge;o.every(be=>J[be]||J.code===be)&&(H(!0),(X=ie.current)==null||X.focus()),J.code==="Escape"&&(document.activeElement===ie.current||(ge=ie.current)!=null&&ge.contains(document.activeElement))&&H(!1)};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[o]),M.useEffect(()=>{if(ie.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,B.current=!1)}},[ie.current]),M.createElement("section",{"aria-label":`${g} ${D}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false"},T.map((K,J)=>{var X;let[ge,be]=K.split("-");return w.length?M.createElement("ol",{key:K,dir:v==="auto"?Ph():v,tabIndex:-1,ref:ie,className:s,"data-sonner-toaster":!0,"data-theme":tt,"data-y-position":ge,"data-lifted":te&&w.length>1&&!i,"data-x-position":be,style:{"--front-toast-height":`${((X=A[0])==null?void 0:X.height)||0}px`,"--offset":typeof l=="number"?`${l}px`:l||uC,"--width":`${cC}px`,"--gap":`${E}px`,...p},onBlur:fe=>{B.current&&!fe.currentTarget.contains(fe.relatedTarget)&&(B.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:fe=>{fe.target instanceof HTMLElement&&fe.target.dataset.dismissible==="false"||B.current||(B.current=!0,L.current=fe.relatedTarget)},onMouseEnter:()=>H(!0),onMouseMove:()=>H(!0),onMouseLeave:()=>{pe||H(!1)},onPointerDown:fe=>{fe.target instanceof HTMLElement&&fe.target.dataset.dismissible==="false"||le(!0)},onPointerUp:()=>le(!1)},w.filter(fe=>!fe.position&&J===0||fe.position===K).map((fe,So)=>{var Jn,Xn;return M.createElement(mC,{key:fe.id,icons:h,index:So,toast:fe,defaultRichColors:c,duration:(Jn=y?.duration)!=null?Jn:d,className:y?.className,descriptionClassName:y?.descriptionClassName,invert:n,visibleToasts:f,closeButton:(Xn=y?.closeButton)!=null?Xn:a,interacting:pe,position:K,style:y?.style,unstyled:y?.unstyled,classNames:y?.classNames,cancelButtonStyle:y?.cancelButtonStyle,actionButtonStyle:y?.actionButtonStyle,removeToast:G,toasts:w.filter(Me=>Me.position==fe.position),heights:A.filter(Me=>Me.position==fe.position),setHeights:z,expandByDefault:i,gap:E,loadingIcon:m,expanded:te,pauseWhenPageIsHidden:x,cn:R})})):null}))});function mg(){vE();const e=window.location.pathname,t=e&&!["/404","/sign-in"].includes(e);window.location.href="/sign-in"+(t?`?redirect=${e}`:"")}const gC=["/passport/auth/login","/passport/auth/token2Login","/passport/auth/register","/guest/comm/config","/passport/comm/sendEmailVerify","/passport/auth/forget"];function vC(){const e="http://127.0.0.1:8000/";return e.endsWith("/")?e+"api/v2":e+"/api/v2"}const ld=Ue.create({baseURL:vC(),timeout:12e3,headers:{"Content-Type":"application/json"}});ld.interceptors.request.use(e=>{e.method?.toLowerCase()==="get"&&(e.params={...e.params,t:Date.now()});const t=Ci();if(!gC.includes(e.url?.split("?")[0]||"")){if(!t.value)return mg(),Promise.reject({code:-1,message:"未登录"});e.headers.Authorization=t.value}return e.headers["Content-Language"]=W_().value||"zh-CN",e},e=>Promise.reject(e));ld.interceptors.response.use(e=>{const t=e?.data||{code:-1,message:"未知错误"};return Promise.resolve(t)},e=>{const t=e.response?.data||{data:null,code:-1,message:"未知错误"},n=e.response?.status;let r=t.message;return n===401||n===403?(mg(),r=n===401?r||"登录已过期":r||"没有权限"):n===404?r=r||"资源或接口不存在":r=r||"未知异常",aC.error(r),Promise.resolve(t)});function wC(){return ld.get("/user/info")}const Al={token:Ci()?.value||"",userInfo:null,isLoggedIn:!!Ci()?.value,loading:!1,error:null},La=nx("user/fetchUserInfo",async()=>(await wC()).data,{condition:(e,{getState:t})=>{const{user:n}=t();return!!n.token&&!n.loading}}),yg=ux({name:"user",initialState:Al,reducers:{setToken(e,t){e.token=t.payload,e.isLoggedIn=!!t.payload},resetUserState:()=>Al},extraReducers:e=>{e.addCase(La.pending,t=>{t.loading=!0,t.error=null}).addCase(La.fulfilled,(t,n)=>{t.loading=!1,t.userInfo=n.payload,t.error=null}).addCase(La.rejected,(t,n)=>{if(t.loading=!1,t.error=n.error.message||"Failed to fetch user info",!t.token)return Al})}}),{setToken:XC,resetUserState:ZC}=yg.actions,ek=e=>e.user.userInfo,SC=yg.reducer,gg=QE({reducer:{user:SC}});Ci()?.value&&gg.dispatch(La());var Vs=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(){}},Ws=typeof window>"u"||"Deno"in globalThis;function $t(){}function EC(e,t){return typeof e=="function"?e(t):e}function xC(e){return typeof e=="number"&&e>=0&&e!==1/0}function _C(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Th(e,t){return typeof e=="function"?e(t):e}function CC(e,t){return typeof e=="function"?e(t):e}function Oh(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==ud(a,t.options))return!1}else if(!Ti(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||o&&o!==t.state.fetchStatus||i&&!i(t))}function Nh(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Pi(t.options.mutationKey)!==Pi(i))return!1}else if(!Ti(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function ud(e,t){return(t?.queryKeyHashFn||Pi)(e)}function Pi(e){return JSON.stringify(e,(t,n)=>Gu(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Ti(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Ti(e[n],t[n])):!1}function vg(e,t){if(e===t)return e;const n=Lh(e)&&Lh(t);if(n||Gu(e)&&Gu(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),a=i.length,s=n?[]:{};let l=0;for(let u=0;u{setTimeout(t,e)})}function bC(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?vg(e,t):t}function RC(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function PC(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var cd=Symbol();function wg(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===cd?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var TC=class extends Vs{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Ws&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Sg=new TC,OC=class extends Vs{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Ws&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},ms=new OC;function NC(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function LC(e){return Math.min(1e3*2**e,3e4)}function Eg(e){return(e??"online")==="online"?ms.isOnline():!0}var xg=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function zl(e){return e instanceof xg}function _g(e){let t=!1,n=0,r=!1,o;const i=NC(),a=v=>{r||(p(new xg(v)),e.abort?.())},s=()=>{t=!0},l=()=>{t=!1},u=()=>Sg.isFocused()&&(e.networkMode==="always"||ms.isOnline())&&e.canRun(),c=()=>Eg(e.networkMode)&&e.canRun(),d=v=>{r||(r=!0,e.onSuccess?.(v),o?.(),i.resolve(v))},p=v=>{r||(r=!0,e.onError?.(v),o?.(),i.reject(v))},f=()=>new Promise(v=>{o=E=>{(r||u())&&v(E)},e.onPause?.()}).then(()=>{o=void 0,r||e.onContinue?.()}),y=()=>{if(r)return;let v;const E=n===0?e.initialPromise:void 0;try{v=E??e.fn()}catch(m){v=Promise.reject(m)}Promise.resolve(v).then(d).catch(m=>{if(r)return;const h=e.retry??(Ws?0:3),g=e.retryDelay??LC,x=typeof g=="function"?g(n,m):g,R=h===!0||typeof h=="number"&&nu()?void 0:f()).then(()=>{t?p(m):y()})})};return{promise:i,cancel:a,continue:()=>(o?.(),i),cancelRetry:s,continueRetry:l,canStart:c,start:()=>(c()?y():f().then(y),i)}}function DC(){let e=[],t=0,n=s=>{s()},r=s=>{s()},o=s=>setTimeout(s,0);const i=s=>{t?e.push(s):o(()=>{n(s)})},a=()=>{const s=e;e=[],s.length&&o(()=>{r(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||a()}return l},batchCalls:s=>(...l)=>{i(()=>{s(...l)})},schedule:i,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{o=s}}}var rt=DC(),Cg=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),xC(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ws?1/0:5*60*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},MC=class extends Cg{#e;#t;#n;#r;#a;#i;constructor(e){super(),this.#i=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#n=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=zC(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=bC(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then($t).catch($t):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>CC(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===cd||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!_C(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.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(t=>t!==e),this.observers.length||(this.#r&&(this.#i?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}fetch(e,t){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const s=this.observers.find(l=>l.options.queryFn);s&&this.setOptions(s.options)}const n=new AbortController,r=s=>{Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},o=()=>{const s=wg(this.options,t),l={queryKey:this.queryKey,meta:this.meta};return r(l),this.#i=!1,this.options.persister?this.options.persister(s,l,this):s(l)},i={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};r(i),this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#o({type:"fetch",meta:i.fetchOptions?.meta});const a=s=>{zl(s)&&s.silent||this.#o({type:"error",error:s}),zl(s)||(this.#n.config.onError?.(s,this),this.#n.config.onSettled?.(this.state.data,s,this)),this.scheduleGc()};return this.#r=_g({initialPromise:t?.initialPromise,fn:i.fetchFn,abort:n.abort.bind(n),onSuccess:s=>{if(s===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(s)}catch(l){a(l);return}this.#n.config.onSuccess?.(s,this),this.#n.config.onSettled?.(s,this.state.error,this),this.scheduleGc()},onError:a,onFail:(s,l)=>{this.#o({type:"failed",failureCount:s,error:l})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}),this.#r.start()}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...AC(n.data,this.options),fetchMeta:e.meta??null};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=e.error;return zl(r)&&r.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),rt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function AC(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Eg(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function zC(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var jC=class extends Vs{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,o=t.queryHash??ud(r,t);let i=this.get(o);return i||(i=new MC({cache:this,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(i)),i}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){rt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Oh(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Oh(e,n)):t}notify(e){rt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){rt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){rt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},FC=class extends Cg{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||IC(),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.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){this.#n=_g({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(r,o)=>{this.#r({type:"failed",failureCount:r,error:o})},onPause:()=>{this.#r({type:"pause"})},onContinue:()=>{this.#r({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const t=this.state.status==="pending",n=!this.#n.canStart();try{if(!t){this.#r({type:"pending",variables:e,isPaused:n}),await this.#t.config.onMutate?.(e,this);const o=await this.options.onMutate?.(e);o!==this.state.context&&this.#r({type:"pending",context:o,variables:e,isPaused:n})}const r=await this.#n.start();return await this.#t.config.onSuccess?.(r,e,this.state.context,this),await this.options.onSuccess?.(r,e,this.state.context),await this.#t.config.onSettled?.(r,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(r,null,e,this.state.context),this.#r({type:"success",data:r}),r}catch(r){try{throw await this.#t.config.onError?.(r,e,this.state.context,this),await this.options.onError?.(r,e,this.state.context),await this.#t.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,r,e,this.state.context),r}finally{this.#r({type:"error",error:r})}}finally{this.#t.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,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{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),rt.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function IC(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var UC=class extends Vs{constructor(e={}){super(),this.config=e,this.#e=new Map,this.#t=Date.now()}#e;#t;build(e,t,n){const r=new FC({mutationCache:this,mutationId:++this.#t,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){const t=ma(e),n=this.#e.get(t)??[];n.push(e),this.#e.set(t,n),this.notify({type:"added",mutation:e})}remove(e){const t=ma(e);if(this.#e.has(t)){const n=this.#e.get(t)?.filter(r=>r!==e);n&&(n.length===0?this.#e.delete(t):this.#e.set(t,n))}this.notify({type:"removed",mutation:e})}canRun(e){const t=this.#e.get(ma(e))?.find(n=>n.state.status==="pending");return!t||t===e}runNext(e){return this.#e.get(ma(e))?.find(n=>n!==e&&n.state.isPaused)?.continue()??Promise.resolve()}clear(){rt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...this.#e.values()].flat()}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Nh(t,n))}findAll(e={}){return this.getAll().filter(t=>Nh(e,t))}notify(e){rt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return rt.batch(()=>Promise.all(e.map(t=>t.continue().catch($t))))}};function ma(e){return e.options.scope?.id??String(e.mutationId)}function Mh(e){return{onFetch:(t,n)=>{const r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]},l=0;const u=async()=>{let c=!1;const d=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},p=wg(t.options,t.fetchOptions),f=async(y,v,E)=>{if(c)return Promise.reject();if(v==null&&y.pages.length)return Promise.resolve(y);const m={queryKey:t.queryKey,pageParam:v,direction:E?"backward":"forward",meta:t.options.meta};d(m);const h=await p(m),{maxPages:g}=t.options,x=E?PC:RC;return{pages:x(y.pages,h,g),pageParams:x(y.pageParams,v,g)}};if(o&&i.length){const y=o==="backward",v=y?BC:Ah,E={pages:i,pageParams:a},m=v(r,E);s=await f(E,m,y)}else{const y=e??i.length;do{const v=l===0?a[0]??r.initialPageParam:Ah(r,s);if(l>0&&v==null)break;s=await f(s,v),l++}while(lt.options.persister?.(u,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function Ah(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function BC(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var $C=class{#e;#t;#n;#r;#a;#i;#o;#s;constructor(e={}){this.#e=e.queryCache||new jC,this.#t=e.mutationCache||new UC,this.#n=e.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=Sg.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ms.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Th(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=EC(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return rt.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;rt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e,r={type:"active",...e};return rt.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=rt.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then($t).catch($t)}invalidateQueries(e,t={}){return rt.batch(()=>{if(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none")return Promise.resolve();const n={...e,type:e?.refetchType??e?.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=rt.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch($t)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then($t)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Th(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then($t).catch($t)}fetchInfiniteQuery(e){return e.behavior=Mh(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then($t).catch($t)}ensureInfiniteQueryData(e){return e.behavior=Mh(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ms.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Pi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Ti(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#a.set(Pi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#a.values()];let n={};return t.forEach(r=>{Ti(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ud(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===cd&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},kg=k.createContext(void 0),nk=e=>{const t=k.useContext(kg);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},HC=({client:e,children:t})=>(k.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),Q.jsx(kg.Provider,{value:e,children:t}));const VC=new $C;jl.createRoot(document.getElementById("root")).render(Q.jsx(M.StrictMode,{children:Q.jsx(HC,{client:VC,children:Q.jsx(lS,{store:gg,children:Q.jsxs(U1,{defaultTheme:"light",storageKey:"vite-ui-theme",children:[Q.jsx(D1,{router:EE}),Q.jsx(yC,{richColors:!0,position:"top-right"})]})})})}));export{Vg as $,NC as A,uo as B,CC as C,Th as D,$t as E,Ws as F,xC as G,_C as H,Sg as I,AC as J,bC as K,KC as L,Wc as M,Gm as N,m1 as O,tr as P,qC as Q,M as R,Vs as S,YC as T,ek as U,vE as V,ZC as W,yy as X,ky as a,ld as b,uE as c,GC as d,yo as e,La as f,cE as g,WC as h,Yu as i,Q as j,wy as k,ed as l,tk as m,Pi as n,IC as o,rt as p,nk as q,k as r,XC as s,aC as t,zi as u,JC as v,QC as w,wS as x,mS as y,gy as z}; +`);function pa(e){return e.label!==void 0}var lC=3,uC="32px",Rh=4e3,cC=356,dC=14,fC=20,hC=200;function pC(...e){return e.filter(Boolean).join(" ")}var mC=e=>{var t,n,r,o,i,a,s,l,u,c,d;let{invert:p,toast:f,unstyled:y,interacting:v,setHeights:E,visibleToasts:m,heights:h,index:g,toasts:x,expanded:R,removeToast:w,defaultRichColors:P,closeButton:T,style:A,cancelButtonStyle:z,actionButtonStyle:te,className:H="",descriptionClassName:pe="",duration:le,position:tt,gap:De,loadingIcon:ie,expandByDefault:D,classNames:L,icons:B,closeButtonAriaLabel:G="Close toast",pauseWhenPageIsHidden:K,cn:J}=e,[X,ge]=M.useState(!1),[be,fe]=M.useState(!1),[So,Jn]=M.useState(!1),[Xn,Me]=M.useState(!1),[xn,Eo]=M.useState(!1),[Ks,zt]=M.useState(0),[Qs,Ui]=M.useState(0),Zn=M.useRef(f.duration||le||Rh),Bi=M.useRef(null),_n=M.useRef(null),qs=g===0,Gs=g+1<=m,ze=f.type,Tt=f.dismissible!==!1,$i=f.className||"",xo=f.descriptionClassName||"",pt=M.useMemo(()=>h.findIndex(q=>q.toastId===f.id)||0,[h,f.id]),jt=M.useMemo(()=>{var q;return(q=f.closeButton)!=null?q:T},[f.closeButton,T]);M.useMemo(()=>f.duration||le||Rh,[f.duration,le]);let Pr=M.useRef(0),Ft=M.useRef(0),Hi=M.useRef(0),mt=M.useRef(null),[_o,Vi]=tt.split("-"),Co=M.useMemo(()=>h.reduce((q,de,ye)=>ye>=pt?q:q+de.height,0),[h,pt]),Wi=eC(),Ki=f.invert||p,Cn=ze==="loading";Ft.current=M.useMemo(()=>pt*De+Co,[pt,Co]),M.useEffect(()=>{ge(!0)},[]),M.useEffect(()=>{let q=_n.current;if(q){let de=q.getBoundingClientRect().height;return Ui(de),E(ye=>[{toastId:f.id,height:de,position:f.position},...ye]),()=>E(ye=>ye.filter(yt=>yt.toastId!==f.id))}},[E,f.id]),M.useLayoutEffect(()=>{if(!X)return;let q=_n.current,de=q.style.height;q.style.height="auto";let ye=q.getBoundingClientRect().height;q.style.height=de,Ui(ye),E(yt=>yt.find(gt=>gt.toastId===f.id)?yt.map(gt=>gt.toastId===f.id?{...gt,height:ye}:gt):[{toastId:f.id,height:ye,position:f.position},...yt])},[X,f.title,f.description,E,f.id]);let It=M.useCallback(()=>{fe(!0),zt(Ft.current),E(q=>q.filter(de=>de.toastId!==f.id)),setTimeout(()=>{w(f)},hC)},[f,w,E,Ft]);M.useEffect(()=>{if(f.promise&&ze==="loading"||f.duration===1/0||f.type==="loading")return;let q;return R||v||K&&Wi?(()=>{if(Hi.current{var de;(de=f.onAutoClose)==null||de.call(f,f),It()},Zn.current)),()=>clearTimeout(q)},[R,v,f,ze,K,Wi,It]),M.useEffect(()=>{f.delete&&It()},[It,f.delete]);function ko(){var q,de,ye;return B!=null&&B.loading?M.createElement("div",{className:J(L?.loader,(q=f?.classNames)==null?void 0:q.loader,"sonner-loader"),"data-visible":ze==="loading"},B.loading):ie?M.createElement("div",{className:J(L?.loader,(de=f?.classNames)==null?void 0:de.loader,"sonner-loader"),"data-visible":ze==="loading"},ie):M.createElement(q_,{className:J(L?.loader,(ye=f?.classNames)==null?void 0:ye.loader),visible:ze==="loading"})}return M.createElement("li",{tabIndex:0,ref:_n,className:J(H,$i,L?.toast,(t=f?.classNames)==null?void 0:t.toast,L?.default,L?.[ze],(n=f?.classNames)==null?void 0:n[ze]),"data-sonner-toast":"","data-rich-colors":(r=f.richColors)!=null?r:P,"data-styled":!(f.jsx||f.unstyled||y),"data-mounted":X,"data-promise":!!f.promise,"data-swiped":xn,"data-removed":be,"data-visible":Gs,"data-y-position":_o,"data-x-position":Vi,"data-index":g,"data-front":qs,"data-swiping":So,"data-dismissible":Tt,"data-type":ze,"data-invert":Ki,"data-swipe-out":Xn,"data-expanded":!!(R||D&&X),style:{"--index":g,"--toasts-before":g,"--z-index":x.length-g,"--offset":`${be?Ks:Ft.current}px`,"--initial-height":D?"auto":`${Qs}px`,...A,...f.style},onPointerDown:q=>{Cn||!Tt||(Bi.current=new Date,zt(Ft.current),q.target.setPointerCapture(q.pointerId),q.target.tagName!=="BUTTON"&&(Jn(!0),mt.current={x:q.clientX,y:q.clientY}))},onPointerUp:()=>{var q,de,ye,yt;if(Xn||!Tt)return;mt.current=null;let gt=Number(((q=_n.current)==null?void 0:q.style.getPropertyValue("--swipe-amount").replace("px",""))||0),on=new Date().getTime()-((de=Bi.current)==null?void 0:de.getTime()),Tr=Math.abs(gt)/on;if(Math.abs(gt)>=fC||Tr>.11){zt(Ft.current),(ye=f.onDismiss)==null||ye.call(f,f),It(),Me(!0),Eo(!1);return}(yt=_n.current)==null||yt.style.setProperty("--swipe-amount","0px"),Jn(!1)},onPointerMove:q=>{var de,ye;if(!mt.current||!Tt)return;let yt=q.clientY-mt.current.y,gt=((de=window.getSelection())==null?void 0:de.toString().length)>0,on=_o==="top"?Math.min(0,yt):Math.max(0,yt);Math.abs(on)>0&&Eo(!0),!gt&&((ye=_n.current)==null||ye.style.setProperty("--swipe-amount",`${on}px`))}},jt&&!f.jsx?M.createElement("button",{"aria-label":G,"data-disabled":Cn,"data-close-button":!0,onClick:Cn||!Tt?()=>{}:()=>{var q;It(),(q=f.onDismiss)==null||q.call(f,f)},className:J(L?.closeButton,(o=f?.classNames)==null?void 0:o.closeButton)},(i=B?.close)!=null?i:Z_):null,f.jsx||M.isValidElement(f.title)?f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title:M.createElement(M.Fragment,null,ze||f.icon||f.promise?M.createElement("div",{"data-icon":"",className:J(L?.icon,(a=f?.classNames)==null?void 0:a.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||ko():null,f.type!=="loading"?f.icon||B?.[ze]||K_(ze):null):null,M.createElement("div",{"data-content":"",className:J(L?.content,(s=f?.classNames)==null?void 0:s.content)},M.createElement("div",{"data-title":"",className:J(L?.title,(l=f?.classNames)==null?void 0:l.title)},typeof f.title=="function"?f.title():f.title),f.description?M.createElement("div",{"data-description":"",className:J(pe,xo,L?.description,(u=f?.classNames)==null?void 0:u.description)},typeof f.description=="function"?f.description():f.description):null),M.isValidElement(f.cancel)?f.cancel:f.cancel&&pa(f.cancel)?M.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||z,onClick:q=>{var de,ye;pa(f.cancel)&&Tt&&((ye=(de=f.cancel).onClick)==null||ye.call(de,q),It())},className:J(L?.cancelButton,(c=f?.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,M.isValidElement(f.action)?f.action:f.action&&pa(f.action)?M.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||te,onClick:q=>{var de,ye;pa(f.action)&&((ye=(de=f.action).onClick)==null||ye.call(de,q),!q.defaultPrevented&&It())},className:J(L?.actionButton,(d=f?.classNames)==null?void 0:d.actionButton)},f.action.label):null))};function Ph(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var yC=k.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:i,closeButton:a,className:s,offset:l,theme:u="light",richColors:c,duration:d,style:p,visibleToasts:f=lC,toastOptions:y,dir:v=Ph(),gap:E=dC,loadingIcon:m,icons:h,containerAriaLabel:g="Notifications",pauseWhenPageIsHidden:x,cn:R=pC}=e,[w,P]=M.useState([]),T=M.useMemo(()=>Array.from(new Set([r].concat(w.filter(K=>K.position).map(K=>K.position)))),[w,r]),[A,z]=M.useState([]),[te,H]=M.useState(!1),[pe,le]=M.useState(!1),[tt,De]=M.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),ie=M.useRef(null),D=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=M.useRef(null),B=M.useRef(!1),G=M.useCallback(K=>{P(J=>{var X;return(X=J.find(ge=>ge.id===K.id))!=null&&X.delete||vt.dismiss(K.id),J.filter(({id:ge})=>ge!==K.id)})},[]);return M.useEffect(()=>vt.subscribe(K=>{if(K.dismiss){P(J=>J.map(X=>X.id===K.id?{...X,delete:!0}:X));return}setTimeout(()=>{Gm.flushSync(()=>{P(J=>{let X=J.findIndex(ge=>ge.id===K.id);return X!==-1?[...J.slice(0,X),{...J[X],...K},...J.slice(X+1)]:[K,...J]})})})}),[]),M.useEffect(()=>{if(u!=="system"){De(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?De("dark"):De("light")),typeof window>"u")return;let K=window.matchMedia("(prefers-color-scheme: dark)");try{K.addEventListener("change",({matches:J})=>{De(J?"dark":"light")})}catch{K.addListener(({matches:X})=>{try{De(X?"dark":"light")}catch(ge){console.error(ge)}})}},[u]),M.useEffect(()=>{w.length<=1&&H(!1)},[w]),M.useEffect(()=>{let K=J=>{var X,ge;o.every(be=>J[be]||J.code===be)&&(H(!0),(X=ie.current)==null||X.focus()),J.code==="Escape"&&(document.activeElement===ie.current||(ge=ie.current)!=null&&ge.contains(document.activeElement))&&H(!1)};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[o]),M.useEffect(()=>{if(ie.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,B.current=!1)}},[ie.current]),M.createElement("section",{"aria-label":`${g} ${D}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false"},T.map((K,J)=>{var X;let[ge,be]=K.split("-");return w.length?M.createElement("ol",{key:K,dir:v==="auto"?Ph():v,tabIndex:-1,ref:ie,className:s,"data-sonner-toaster":!0,"data-theme":tt,"data-y-position":ge,"data-lifted":te&&w.length>1&&!i,"data-x-position":be,style:{"--front-toast-height":`${((X=A[0])==null?void 0:X.height)||0}px`,"--offset":typeof l=="number"?`${l}px`:l||uC,"--width":`${cC}px`,"--gap":`${E}px`,...p},onBlur:fe=>{B.current&&!fe.currentTarget.contains(fe.relatedTarget)&&(B.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:fe=>{fe.target instanceof HTMLElement&&fe.target.dataset.dismissible==="false"||B.current||(B.current=!0,L.current=fe.relatedTarget)},onMouseEnter:()=>H(!0),onMouseMove:()=>H(!0),onMouseLeave:()=>{pe||H(!1)},onPointerDown:fe=>{fe.target instanceof HTMLElement&&fe.target.dataset.dismissible==="false"||le(!0)},onPointerUp:()=>le(!1)},w.filter(fe=>!fe.position&&J===0||fe.position===K).map((fe,So)=>{var Jn,Xn;return M.createElement(mC,{key:fe.id,icons:h,index:So,toast:fe,defaultRichColors:c,duration:(Jn=y?.duration)!=null?Jn:d,className:y?.className,descriptionClassName:y?.descriptionClassName,invert:n,visibleToasts:f,closeButton:(Xn=y?.closeButton)!=null?Xn:a,interacting:pe,position:K,style:y?.style,unstyled:y?.unstyled,classNames:y?.classNames,cancelButtonStyle:y?.cancelButtonStyle,actionButtonStyle:y?.actionButtonStyle,removeToast:G,toasts:w.filter(Me=>Me.position==fe.position),heights:A.filter(Me=>Me.position==fe.position),setHeights:z,expandByDefault:i,gap:E,loadingIcon:m,expanded:te,pauseWhenPageIsHidden:x,cn:R})})):null}))});function mg(){vE();const e=window.location.pathname,t=e&&!["/404","/sign-in"].includes(e);window.location.href="/sign-in"+(t?`?redirect=${e}`:"")}const gC=["/passport/auth/login","/passport/auth/token2Login","/passport/auth/register","/guest/comm/config","/passport/comm/sendEmailVerify","/passport/auth/forget"];function vC(){const e="/";return e.endsWith("/")?e+"api/v2":e+"/api/v2"}const ld=Ue.create({baseURL:vC(),timeout:12e3,headers:{"Content-Type":"application/json"}});ld.interceptors.request.use(e=>{e.method?.toLowerCase()==="get"&&(e.params={...e.params,t:Date.now()});const t=Ci();if(!gC.includes(e.url?.split("?")[0]||"")){if(!t.value)return mg(),Promise.reject({code:-1,message:"未登录"});e.headers.Authorization=t.value}return e.headers["Content-Language"]=W_().value||"zh-CN",e},e=>Promise.reject(e));ld.interceptors.response.use(e=>{const t=e?.data||{code:-1,message:"未知错误"};return Promise.resolve(t)},e=>{const t=e.response?.data||{data:null,code:-1,message:"未知错误"},n=e.response?.status;let r=t.message;return n===401||n===403?(mg(),r=n===401?r||"登录已过期":r||"没有权限"):n===404?r=r||"资源或接口不存在":r=r||"未知异常",aC.error(r),Promise.resolve(t)});function wC(){return ld.get("/user/info")}const Al={token:Ci()?.value||"",userInfo:null,isLoggedIn:!!Ci()?.value,loading:!1,error:null},La=nx("user/fetchUserInfo",async()=>(await wC()).data,{condition:(e,{getState:t})=>{const{user:n}=t();return!!n.token&&!n.loading}}),yg=ux({name:"user",initialState:Al,reducers:{setToken(e,t){e.token=t.payload,e.isLoggedIn=!!t.payload},resetUserState:()=>Al},extraReducers:e=>{e.addCase(La.pending,t=>{t.loading=!0,t.error=null}).addCase(La.fulfilled,(t,n)=>{t.loading=!1,t.userInfo=n.payload,t.error=null}).addCase(La.rejected,(t,n)=>{if(t.loading=!1,t.error=n.error.message||"Failed to fetch user info",!t.token)return Al})}}),{setToken:XC,resetUserState:ZC}=yg.actions,ek=e=>e.user.userInfo,SC=yg.reducer,gg=QE({reducer:{user:SC}});Ci()?.value&&gg.dispatch(La());var Vs=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(){}},Ws=typeof window>"u"||"Deno"in globalThis;function $t(){}function EC(e,t){return typeof e=="function"?e(t):e}function xC(e){return typeof e=="number"&&e>=0&&e!==1/0}function _C(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Th(e,t){return typeof e=="function"?e(t):e}function CC(e,t){return typeof e=="function"?e(t):e}function Oh(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==ud(a,t.options))return!1}else if(!Ti(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||o&&o!==t.state.fetchStatus||i&&!i(t))}function Nh(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Pi(t.options.mutationKey)!==Pi(i))return!1}else if(!Ti(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function ud(e,t){return(t?.queryKeyHashFn||Pi)(e)}function Pi(e){return JSON.stringify(e,(t,n)=>Gu(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Ti(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Ti(e[n],t[n])):!1}function vg(e,t){if(e===t)return e;const n=Lh(e)&&Lh(t);if(n||Gu(e)&&Gu(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),a=i.length,s=n?[]:{};let l=0;for(let u=0;u{setTimeout(t,e)})}function bC(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?vg(e,t):t}function RC(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function PC(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var cd=Symbol();function wg(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===cd?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var TC=class extends Vs{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Ws&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Sg=new TC,OC=class extends Vs{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Ws&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},ms=new OC;function NC(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function LC(e){return Math.min(1e3*2**e,3e4)}function Eg(e){return(e??"online")==="online"?ms.isOnline():!0}var xg=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function zl(e){return e instanceof xg}function _g(e){let t=!1,n=0,r=!1,o;const i=NC(),a=v=>{r||(p(new xg(v)),e.abort?.())},s=()=>{t=!0},l=()=>{t=!1},u=()=>Sg.isFocused()&&(e.networkMode==="always"||ms.isOnline())&&e.canRun(),c=()=>Eg(e.networkMode)&&e.canRun(),d=v=>{r||(r=!0,e.onSuccess?.(v),o?.(),i.resolve(v))},p=v=>{r||(r=!0,e.onError?.(v),o?.(),i.reject(v))},f=()=>new Promise(v=>{o=E=>{(r||u())&&v(E)},e.onPause?.()}).then(()=>{o=void 0,r||e.onContinue?.()}),y=()=>{if(r)return;let v;const E=n===0?e.initialPromise:void 0;try{v=E??e.fn()}catch(m){v=Promise.reject(m)}Promise.resolve(v).then(d).catch(m=>{if(r)return;const h=e.retry??(Ws?0:3),g=e.retryDelay??LC,x=typeof g=="function"?g(n,m):g,R=h===!0||typeof h=="number"&&nu()?void 0:f()).then(()=>{t?p(m):y()})})};return{promise:i,cancel:a,continue:()=>(o?.(),i),cancelRetry:s,continueRetry:l,canStart:c,start:()=>(c()?y():f().then(y),i)}}function DC(){let e=[],t=0,n=s=>{s()},r=s=>{s()},o=s=>setTimeout(s,0);const i=s=>{t?e.push(s):o(()=>{n(s)})},a=()=>{const s=e;e=[],s.length&&o(()=>{r(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||a()}return l},batchCalls:s=>(...l)=>{i(()=>{s(...l)})},schedule:i,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{o=s}}}var rt=DC(),Cg=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),xC(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ws?1/0:5*60*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},MC=class extends Cg{#e;#t;#n;#r;#a;#i;constructor(e){super(),this.#i=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#n=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=zC(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=bC(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then($t).catch($t):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>CC(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===cd||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!_C(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.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(t=>t!==e),this.observers.length||(this.#r&&(this.#i?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}fetch(e,t){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const s=this.observers.find(l=>l.options.queryFn);s&&this.setOptions(s.options)}const n=new AbortController,r=s=>{Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},o=()=>{const s=wg(this.options,t),l={queryKey:this.queryKey,meta:this.meta};return r(l),this.#i=!1,this.options.persister?this.options.persister(s,l,this):s(l)},i={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};r(i),this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#o({type:"fetch",meta:i.fetchOptions?.meta});const a=s=>{zl(s)&&s.silent||this.#o({type:"error",error:s}),zl(s)||(this.#n.config.onError?.(s,this),this.#n.config.onSettled?.(this.state.data,s,this)),this.scheduleGc()};return this.#r=_g({initialPromise:t?.initialPromise,fn:i.fetchFn,abort:n.abort.bind(n),onSuccess:s=>{if(s===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(s)}catch(l){a(l);return}this.#n.config.onSuccess?.(s,this),this.#n.config.onSettled?.(s,this.state.error,this),this.scheduleGc()},onError:a,onFail:(s,l)=>{this.#o({type:"failed",failureCount:s,error:l})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}),this.#r.start()}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...AC(n.data,this.options),fetchMeta:e.meta??null};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=e.error;return zl(r)&&r.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),rt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function AC(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Eg(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function zC(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var jC=class extends Vs{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,o=t.queryHash??ud(r,t);let i=this.get(o);return i||(i=new MC({cache:this,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(i)),i}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){rt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Oh(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Oh(e,n)):t}notify(e){rt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){rt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){rt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},FC=class extends Cg{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||IC(),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.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){this.#n=_g({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(r,o)=>{this.#r({type:"failed",failureCount:r,error:o})},onPause:()=>{this.#r({type:"pause"})},onContinue:()=>{this.#r({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const t=this.state.status==="pending",n=!this.#n.canStart();try{if(!t){this.#r({type:"pending",variables:e,isPaused:n}),await this.#t.config.onMutate?.(e,this);const o=await this.options.onMutate?.(e);o!==this.state.context&&this.#r({type:"pending",context:o,variables:e,isPaused:n})}const r=await this.#n.start();return await this.#t.config.onSuccess?.(r,e,this.state.context,this),await this.options.onSuccess?.(r,e,this.state.context),await this.#t.config.onSettled?.(r,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(r,null,e,this.state.context),this.#r({type:"success",data:r}),r}catch(r){try{throw await this.#t.config.onError?.(r,e,this.state.context,this),await this.options.onError?.(r,e,this.state.context),await this.#t.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,r,e,this.state.context),r}finally{this.#r({type:"error",error:r})}}finally{this.#t.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,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{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),rt.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function IC(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var UC=class extends Vs{constructor(e={}){super(),this.config=e,this.#e=new Map,this.#t=Date.now()}#e;#t;build(e,t,n){const r=new FC({mutationCache:this,mutationId:++this.#t,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){const t=ma(e),n=this.#e.get(t)??[];n.push(e),this.#e.set(t,n),this.notify({type:"added",mutation:e})}remove(e){const t=ma(e);if(this.#e.has(t)){const n=this.#e.get(t)?.filter(r=>r!==e);n&&(n.length===0?this.#e.delete(t):this.#e.set(t,n))}this.notify({type:"removed",mutation:e})}canRun(e){const t=this.#e.get(ma(e))?.find(n=>n.state.status==="pending");return!t||t===e}runNext(e){return this.#e.get(ma(e))?.find(n=>n!==e&&n.state.isPaused)?.continue()??Promise.resolve()}clear(){rt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...this.#e.values()].flat()}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Nh(t,n))}findAll(e={}){return this.getAll().filter(t=>Nh(e,t))}notify(e){rt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return rt.batch(()=>Promise.all(e.map(t=>t.continue().catch($t))))}};function ma(e){return e.options.scope?.id??String(e.mutationId)}function Mh(e){return{onFetch:(t,n)=>{const r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]},l=0;const u=async()=>{let c=!1;const d=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},p=wg(t.options,t.fetchOptions),f=async(y,v,E)=>{if(c)return Promise.reject();if(v==null&&y.pages.length)return Promise.resolve(y);const m={queryKey:t.queryKey,pageParam:v,direction:E?"backward":"forward",meta:t.options.meta};d(m);const h=await p(m),{maxPages:g}=t.options,x=E?PC:RC;return{pages:x(y.pages,h,g),pageParams:x(y.pageParams,v,g)}};if(o&&i.length){const y=o==="backward",v=y?BC:Ah,E={pages:i,pageParams:a},m=v(r,E);s=await f(E,m,y)}else{const y=e??i.length;do{const v=l===0?a[0]??r.initialPageParam:Ah(r,s);if(l>0&&v==null)break;s=await f(s,v),l++}while(lt.options.persister?.(u,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function Ah(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function BC(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var $C=class{#e;#t;#n;#r;#a;#i;#o;#s;constructor(e={}){this.#e=e.queryCache||new jC,this.#t=e.mutationCache||new UC,this.#n=e.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=Sg.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ms.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Th(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=EC(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return rt.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;rt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e,r={type:"active",...e};return rt.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=rt.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then($t).catch($t)}invalidateQueries(e,t={}){return rt.batch(()=>{if(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none")return Promise.resolve();const n={...e,type:e?.refetchType??e?.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=rt.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch($t)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then($t)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Th(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then($t).catch($t)}fetchInfiniteQuery(e){return e.behavior=Mh(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then($t).catch($t)}ensureInfiniteQueryData(e){return e.behavior=Mh(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ms.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Pi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Ti(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#a.set(Pi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#a.values()];let n={};return t.forEach(r=>{Ti(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ud(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===cd&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},kg=k.createContext(void 0),nk=e=>{const t=k.useContext(kg);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},HC=({client:e,children:t})=>(k.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),Q.jsx(kg.Provider,{value:e,children:t}));const VC=new $C;jl.createRoot(document.getElementById("root")).render(Q.jsx(M.StrictMode,{children:Q.jsx(HC,{client:VC,children:Q.jsx(lS,{store:gg,children:Q.jsxs(U1,{defaultTheme:"light",storageKey:"vite-ui-theme",children:[Q.jsx(D1,{router:EE}),Q.jsx(yC,{richColors:!0,position:"top-right"})]})})})}));export{Vg as $,NC as A,uo as B,CC as C,Th as D,$t as E,Ws as F,xC as G,_C as H,Sg as I,AC as J,bC as K,KC as L,Wc as M,Gm as N,m1 as O,tr as P,qC as Q,M as R,Vs as S,YC as T,ek as U,vE as V,ZC as W,yy as X,ky as a,ld as b,uE as c,GC as d,yo as e,La as f,cE as g,WC as h,Yu as i,Q as j,wy as k,ed as l,tk as m,Pi as n,IC as o,rt as p,nk as q,k as r,XC as s,aC as t,zi as u,JC as v,QC as w,wS as x,mS as y,gy as z};