agent-tower 0.4.5 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/git/git-cli.js +2 -2
- package/dist/git/git-cli.js.map +1 -1
- package/dist/web/assets/{AgentDemoPage-CB48v8IV.js → AgentDemoPage-B4p6JOaa.js} +1 -1
- package/dist/web/assets/{DemoPage-_dT9rdpV.js → DemoPage-a61F8WUp.js} +1 -1
- package/dist/web/assets/{GeneralSettingsPage-DtD_oirE.js → GeneralSettingsPage-CQmEjFi8.js} +1 -1
- package/dist/web/assets/{NotificationSettingsPage-DQqz8xJs.js → NotificationSettingsPage-BRw2fFTj.js} +1 -1
- package/dist/web/assets/{ProfileSettingsPage-BaFNyfse.js → ProfileSettingsPage-D-zyXwz1.js} +1 -1
- package/dist/web/assets/{ProjectKanbanPage-DNCKy0g4.js → ProjectKanbanPage-DSO5OEi0.js} +22 -22
- package/dist/web/assets/{ProjectSettingsPage-Cv6VpL1g.js → ProjectSettingsPage-CKb-5dhB.js} +1 -1
- package/dist/web/assets/{ProviderSettingsPage-BqmSJV2I.js → ProviderSettingsPage-dGoaMV8Q.js} +1 -1
- package/dist/web/assets/{button-Cg3N0RX4.js → button-yc8E-9mL.js} +1 -1
- package/dist/web/assets/{chevron-down-BZ2n6wh3.js → chevron-down-CgN79gJE.js} +1 -1
- package/dist/web/assets/{chevron-right-BrrhT2ph.js → chevron-right-DlWP8lVM.js} +1 -1
- package/dist/web/assets/{circle-alert-a6g1jQyL.js → circle-alert-CgMmay1J.js} +1 -1
- package/dist/web/assets/{circle-check-CQEg-cq1.js → circle-check-CSmMKb6_.js} +1 -1
- package/dist/web/assets/{code-block-OCS4YCEC-C72vBOSD.js → code-block-OCS4YCEC-DiXG3CzW.js} +1 -1
- package/dist/web/assets/{confirm-dialog-DmuQeQ0J.js → confirm-dialog-Q8BsN1Up.js} +1 -1
- package/dist/web/assets/{folder-picker-Dl5GZRtL.js → folder-picker-C45cXliN.js} +1 -1
- package/dist/web/assets/{index-D3_Vq2xm.js → index-DK-vt3Cl.js} +2 -2
- package/dist/web/assets/{loader-circle-DRKF9OZx.js → loader-circle-DYUWI5Dr.js} +1 -1
- package/dist/web/assets/{mermaid-NOHMQCX5-DyQsSSRd.js → mermaid-NOHMQCX5-C5mvGqWa.js} +3 -3
- package/dist/web/assets/{modal-wSbeXj_V.js → modal-BgEFLccc.js} +1 -1
- package/dist/web/assets/{pencil-CT2HBX6f.js → pencil-CjaX70qm.js} +1 -1
- package/dist/web/assets/{rotate-ccw-DkZPjdAj.js → rotate-ccw-CDDSxb2s.js} +1 -1
- package/dist/web/assets/{select-BRJQTh28.js → select-DKQPvWiV.js} +1 -1
- package/dist/web/assets/{use-profiles-zSSuAJaA.js → use-profiles-Brdh89vT.js} +1 -1
- package/dist/web/assets/{use-providers-BfLpM8PB.js → use-providers-Es21U-kq.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectKanbanPage-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectKanbanPage-DSO5OEi0.js","assets/mermaid-NOHMQCX5-C5mvGqWa.js","assets/log-adapter-50wgehrc.js","assets/chevron-right-DlWP8lVM.js","assets/chevron-down-CgN79gJE.js","assets/utils-CkSf8FUe.js","assets/mermaid-NOHMQCX5-lI9o3AWT.css","assets/modal-BgEFLccc.js","assets/confirm-dialog-Q8BsN1Up.js","assets/button-yc8E-9mL.js","assets/rotate-ccw-CDDSxb2s.js","assets/loader-circle-DYUWI5Dr.js","assets/use-providers-Es21U-kq.js","assets/select-DKQPvWiV.js","assets/ProjectKanbanPage-G5OQeJvU.css","assets/DemoPage-a61F8WUp.js","assets/AgentDemoPage-B4p6JOaa.js","assets/use-profiles-Brdh89vT.js","assets/GeneralSettingsPage-CQmEjFi8.js","assets/ProfileSettingsPage-D-zyXwz1.js","assets/pencil-CjaX70qm.js","assets/ProviderSettingsPage-dGoaMV8Q.js","assets/circle-check-CSmMKb6_.js","assets/NotificationSettingsPage-BRw2fFTj.js","assets/circle-alert-CgMmay1J.js","assets/ProjectSettingsPage-CKb-5dhB.js","assets/folder-picker-C45cXliN.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
function D0(a,i){for(var r=0;r<i.length;r++){const s=i[r];if(typeof s!="string"&&!Array.isArray(s)){for(const c in s)if(c!=="default"&&!(c in a)){const f=Object.getOwnPropertyDescriptor(s,c);f&&Object.defineProperty(a,c,f.get?f:{enumerable:!0,get:()=>s[c]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))s(c);new MutationObserver(c=>{for(const f of c)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&s(h)}).observe(document,{childList:!0,subtree:!0});function r(c){const f={};return c.integrity&&(f.integrity=c.integrity),c.referrerPolicy&&(f.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?f.credentials="include":c.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function s(c){if(c.ep)return;c.ep=!0;const f=r(c);fetch(c.href,f)}})();function my(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var wc={exports:{}},fr={};var fp;function M0(){if(fp)return fr;fp=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(s,c,f){var h=null;if(f!==void 0&&(h=""+f),c.key!==void 0&&(h=""+c.key),"key"in c){f={};for(var m in c)m!=="key"&&(f[m]=c[m])}else f=c;return c=f.ref,{$$typeof:a,type:s,key:h,ref:c!==void 0?c:null,props:f}}return fr.Fragment=i,fr.jsx=r,fr.jsxs=r,fr}var dp;function N0(){return dp||(dp=1,wc.exports=M0()),wc.exports}var se=N0(),_c={exports:{}},_e={};var hp;function z0(){if(hp)return _e;hp=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),w=Symbol.iterator;function D(T){return T===null||typeof T!="object"?null:(T=w&&T[w]||T["@@iterator"],typeof T=="function"?T:null)}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},q=Object.assign,X={};function V(T,j,k){this.props=T,this.context=j,this.refs=X,this.updater=k||B}V.prototype.isReactComponent={},V.prototype.setState=function(T,j){if(typeof T!="object"&&typeof T!="function"&&T!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,T,j,"setState")},V.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function Z(){}Z.prototype=V.prototype;function $(T,j,k){this.props=T,this.context=j,this.refs=X,this.updater=k||B}var be=$.prototype=new Z;be.constructor=$,q(be,V.prototype),be.isPureReactComponent=!0;var me=Array.isArray;function ye(){}var C={H:null,A:null,T:null,S:null},W=Object.prototype.hasOwnProperty;function ge(T,j,k){var F=k.ref;return{$$typeof:a,type:T,key:j,ref:F!==void 0?F:null,props:k}}function Oe(T,j){return ge(T.type,j,T.props)}function Re(T){return typeof T=="object"&&T!==null&&T.$$typeof===a}function we(T){var j={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(k){return j[k]})}var Le=/\/+/g;function Ye(T,j){return typeof T=="object"&&T!==null&&T.key!=null?we(""+T.key):j.toString(36)}function Te(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(ye,ye):(T.status="pending",T.then(function(j){T.status==="pending"&&(T.status="fulfilled",T.value=j)},function(j){T.status==="pending"&&(T.status="rejected",T.reason=j)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function x(T,j,k,F,ee){var ue=typeof T;(ue==="undefined"||ue==="boolean")&&(T=null);var Ae=!1;if(T===null)Ae=!0;else switch(ue){case"bigint":case"string":case"number":Ae=!0;break;case"object":switch(T.$$typeof){case a:case i:Ae=!0;break;case b:return Ae=T._init,x(Ae(T._payload),j,k,F,ee)}}if(Ae)return ee=ee(T),Ae=F===""?"."+Ye(T,0):F,me(ee)?(k="",Ae!=null&&(k=Ae.replace(Le,"$&/")+"/"),x(ee,j,k,"",function(pn){return pn})):ee!=null&&(Re(ee)&&(ee=Oe(ee,k+(ee.key==null||T&&T.key===ee.key?"":(""+ee.key).replace(Le,"$&/")+"/")+Ae)),j.push(ee)),1;Ae=0;var Ee=F===""?".":F+":";if(me(T))for(var Ze=0;Ze<T.length;Ze++)F=T[Ze],ue=Ee+Ye(F,Ze),Ae+=x(F,j,k,ue,ee);else if(Ze=D(T),typeof Ze=="function")for(T=Ze.call(T),Ze=0;!(F=T.next()).done;)F=F.value,ue=Ee+Ye(F,Ze++),Ae+=x(F,j,k,ue,ee);else if(ue==="object"){if(typeof T.then=="function")return x(Te(T),j,k,F,ee);throw j=String(T),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.")}return Ae}function K(T,j,k){if(T==null)return T;var F=[],ee=0;return x(T,F,"","",function(ue){return j.call(k,ue,ee++)}),F}function J(T){if(T._status===-1){var j=T._result;j=j(),j.then(function(k){(T._status===0||T._status===-1)&&(T._status=1,T._result=k)},function(k){(T._status===0||T._status===-1)&&(T._status=2,T._result=k)}),T._status===-1&&(T._status=0,T._result=j)}if(T._status===1)return T._result.default;throw T._result}var fe=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var j=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(j))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},he={map:K,forEach:function(T,j,k){K(T,function(){j.apply(this,arguments)},k)},count:function(T){var j=0;return K(T,function(){j++}),j},toArray:function(T){return K(T,function(j){return j})||[]},only:function(T){if(!Re(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return _e.Activity=p,_e.Children=he,_e.Component=V,_e.Fragment=r,_e.Profiler=c,_e.PureComponent=$,_e.StrictMode=s,_e.Suspense=g,_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=C,_e.__COMPILER_RUNTIME={__proto__:null,c:function(T){return C.H.useMemoCache(T)}},_e.cache=function(T){return function(){return T.apply(null,arguments)}},_e.cacheSignal=function(){return null},_e.cloneElement=function(T,j,k){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var F=q({},T.props),ee=T.key;if(j!=null)for(ue in j.key!==void 0&&(ee=""+j.key),j)!W.call(j,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&j.ref===void 0||(F[ue]=j[ue]);var ue=arguments.length-2;if(ue===1)F.children=k;else if(1<ue){for(var Ae=Array(ue),Ee=0;Ee<ue;Ee++)Ae[Ee]=arguments[Ee+2];F.children=Ae}return ge(T.type,ee,F)},_e.createContext=function(T){return T={$$typeof:h,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:f,_context:T},T},_e.createElement=function(T,j,k){var F,ee={},ue=null;if(j!=null)for(F in j.key!==void 0&&(ue=""+j.key),j)W.call(j,F)&&F!=="key"&&F!=="__self"&&F!=="__source"&&(ee[F]=j[F]);var Ae=arguments.length-2;if(Ae===1)ee.children=k;else if(1<Ae){for(var Ee=Array(Ae),Ze=0;Ze<Ae;Ze++)Ee[Ze]=arguments[Ze+2];ee.children=Ee}if(T&&T.defaultProps)for(F in Ae=T.defaultProps,Ae)ee[F]===void 0&&(ee[F]=Ae[F]);return ge(T,ue,ee)},_e.createRef=function(){return{current:null}},_e.forwardRef=function(T){return{$$typeof:m,render:T}},_e.isValidElement=Re,_e.lazy=function(T){return{$$typeof:b,_payload:{_status:-1,_result:T},_init:J}},_e.memo=function(T,j){return{$$typeof:y,type:T,compare:j===void 0?null:j}},_e.startTransition=function(T){var j=C.T,k={};C.T=k;try{var F=T(),ee=C.S;ee!==null&&ee(k,F),typeof F=="object"&&F!==null&&typeof F.then=="function"&&F.then(ye,fe)}catch(ue){fe(ue)}finally{j!==null&&k.types!==null&&(j.types=k.types),C.T=j}},_e.unstable_useCacheRefresh=function(){return C.H.useCacheRefresh()},_e.use=function(T){return C.H.use(T)},_e.useActionState=function(T,j,k){return C.H.useActionState(T,j,k)},_e.useCallback=function(T,j){return C.H.useCallback(T,j)},_e.useContext=function(T){return C.H.useContext(T)},_e.useDebugValue=function(){},_e.useDeferredValue=function(T,j){return C.H.useDeferredValue(T,j)},_e.useEffect=function(T,j){return C.H.useEffect(T,j)},_e.useEffectEvent=function(T){return C.H.useEffectEvent(T)},_e.useId=function(){return C.H.useId()},_e.useImperativeHandle=function(T,j,k){return C.H.useImperativeHandle(T,j,k)},_e.useInsertionEffect=function(T,j){return C.H.useInsertionEffect(T,j)},_e.useLayoutEffect=function(T,j){return C.H.useLayoutEffect(T,j)},_e.useMemo=function(T,j){return C.H.useMemo(T,j)},_e.useOptimistic=function(T,j){return C.H.useOptimistic(T,j)},_e.useReducer=function(T,j,k){return C.H.useReducer(T,j,k)},_e.useRef=function(T){return C.H.useRef(T)},_e.useState=function(T){return C.H.useState(T)},_e.useSyncExternalStore=function(T,j,k){return C.H.useSyncExternalStore(T,j,k)},_e.useTransition=function(){return C.H.useTransition()},_e.version="19.2.4",_e}var mp;function lf(){return mp||(mp=1,_c.exports=z0()),_c.exports}var R=lf();const I=my(R),U0=D0({__proto__:null,default:I},[R]);var Rc={exports:{}},dr={},Ac={exports:{}},Cc={};var pp;function L0(){return pp||(pp=1,(function(a){function i(x,K){var J=x.length;x.push(K);e:for(;0<J;){var fe=J-1>>>1,he=x[fe];if(0<c(he,K))x[fe]=K,x[J]=he,J=fe;else break e}}function r(x){return x.length===0?null:x[0]}function s(x){if(x.length===0)return null;var K=x[0],J=x.pop();if(J!==K){x[0]=J;e:for(var fe=0,he=x.length,T=he>>>1;fe<T;){var j=2*(fe+1)-1,k=x[j],F=j+1,ee=x[F];if(0>c(k,J))F<he&&0>c(ee,k)?(x[fe]=ee,x[F]=J,fe=F):(x[fe]=k,x[j]=J,fe=j);else if(F<he&&0>c(ee,J))x[fe]=ee,x[F]=J,fe=F;else break e}}return K}function c(x,K){var J=x.sortIndex-K.sortIndex;return J!==0?J:x.id-K.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;a.unstable_now=function(){return f.now()}}else{var h=Date,m=h.now();a.unstable_now=function(){return h.now()-m}}var g=[],y=[],b=1,p=null,w=3,D=!1,B=!1,q=!1,X=!1,V=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function be(x){for(var K=r(y);K!==null;){if(K.callback===null)s(y);else if(K.startTime<=x)s(y),K.sortIndex=K.expirationTime,i(g,K);else break;K=r(y)}}function me(x){if(q=!1,be(x),!B)if(r(g)!==null)B=!0,ye||(ye=!0,we());else{var K=r(y);K!==null&&Te(me,K.startTime-x)}}var ye=!1,C=-1,W=5,ge=-1;function Oe(){return X?!0:!(a.unstable_now()-ge<W)}function Re(){if(X=!1,ye){var x=a.unstable_now();ge=x;var K=!0;try{e:{B=!1,q&&(q=!1,Z(C),C=-1),D=!0;var J=w;try{t:{for(be(x),p=r(g);p!==null&&!(p.expirationTime>x&&Oe());){var fe=p.callback;if(typeof fe=="function"){p.callback=null,w=p.priorityLevel;var he=fe(p.expirationTime<=x);if(x=a.unstable_now(),typeof he=="function"){p.callback=he,be(x),K=!0;break t}p===r(g)&&s(g),be(x)}else s(g);p=r(g)}if(p!==null)K=!0;else{var T=r(y);T!==null&&Te(me,T.startTime-x),K=!1}}break e}finally{p=null,w=J,D=!1}K=void 0}}finally{K?we():ye=!1}}}var we;if(typeof $=="function")we=function(){$(Re)};else if(typeof MessageChannel<"u"){var Le=new MessageChannel,Ye=Le.port2;Le.port1.onmessage=Re,we=function(){Ye.postMessage(null)}}else we=function(){V(Re,0)};function Te(x,K){C=V(function(){x(a.unstable_now())},K)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(x){x.callback=null},a.unstable_forceFrameRate=function(x){0>x||125<x?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<x?Math.floor(1e3/x):5},a.unstable_getCurrentPriorityLevel=function(){return w},a.unstable_next=function(x){switch(w){case 1:case 2:case 3:var K=3;break;default:K=w}var J=w;w=K;try{return x()}finally{w=J}},a.unstable_requestPaint=function(){X=!0},a.unstable_runWithPriority=function(x,K){switch(x){case 1:case 2:case 3:case 4:case 5:break;default:x=3}var J=w;w=x;try{return K()}finally{w=J}},a.unstable_scheduleCallback=function(x,K,J){var fe=a.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?fe+J:fe):J=fe,x){case 1:var he=-1;break;case 2:he=250;break;case 5:he=1073741823;break;case 4:he=1e4;break;default:he=5e3}return he=J+he,x={id:b++,callback:K,priorityLevel:x,startTime:J,expirationTime:he,sortIndex:-1},J>fe?(x.sortIndex=J,i(y,x),r(g)===null&&x===r(y)&&(q?(Z(C),C=-1):q=!0,Te(me,J-fe))):(x.sortIndex=he,i(g,x),B||D||(B=!0,ye||(ye=!0,we()))),x},a.unstable_shouldYield=Oe,a.unstable_wrapCallback=function(x){var K=w;return function(){var J=w;w=K;try{return x.apply(this,arguments)}finally{w=J}}}})(Cc)),Cc}var yp;function B0(){return yp||(yp=1,Ac.exports=L0()),Ac.exports}var Oc={exports:{}},kt={};var gp;function j0(){if(gp)return kt;gp=1;var a=lf();function i(g){var y="https://react.dev/errors/"+g;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)y+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+g+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var s={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},c=Symbol.for("react.portal");function f(g,y,b){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:p==null?null:""+p,children:g,containerInfo:y,implementation:b}}var h=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,y){if(g==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return kt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,kt.createPortal=function(g,y){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(i(299));return f(g,y,null,b)},kt.flushSync=function(g){var y=h.T,b=s.p;try{if(h.T=null,s.p=2,g)return g()}finally{h.T=y,s.p=b,s.d.f()}},kt.preconnect=function(g,y){typeof g=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,s.d.C(g,y))},kt.prefetchDNS=function(g){typeof g=="string"&&s.d.D(g)},kt.preinit=function(g,y){if(typeof g=="string"&&y&&typeof y.as=="string"){var b=y.as,p=m(b,y.crossOrigin),w=typeof y.integrity=="string"?y.integrity:void 0,D=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;b==="style"?s.d.S(g,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:p,integrity:w,fetchPriority:D}):b==="script"&&s.d.X(g,{crossOrigin:p,integrity:w,fetchPriority:D,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},kt.preinitModule=function(g,y){if(typeof g=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var b=m(y.as,y.crossOrigin);s.d.M(g,{crossOrigin:b,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&s.d.M(g)},kt.preload=function(g,y){if(typeof g=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var b=y.as,p=m(b,y.crossOrigin);s.d.L(g,b,{crossOrigin:p,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},kt.preloadModule=function(g,y){if(typeof g=="string")if(y){var b=m(y.as,y.crossOrigin);s.d.m(g,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:b,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else s.d.m(g)},kt.requestFormReset=function(g){s.d.r(g)},kt.unstable_batchedUpdates=function(g,y){return g(y)},kt.useFormState=function(g,y,b){return h.H.useFormState(g,y,b)},kt.useFormStatus=function(){return h.H.useHostTransitionStatus()},kt.version="19.2.4",kt}var vp;function py(){if(vp)return Oc.exports;vp=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(i){console.error(i)}}return a(),Oc.exports=j0(),Oc.exports}var bp;function H0(){if(bp)return dr;bp=1;var a=B0(),i=lf(),r=py();function s(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(f(e)!==e)throw Error(s(188))}function y(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(s(188));return t!==e?null:e}for(var n=e,l=t;;){var o=n.return;if(o===null)break;var u=o.alternate;if(u===null){if(l=o.return,l!==null){n=l;continue}break}if(o.child===u.child){for(u=o.child;u;){if(u===n)return g(o),e;if(u===l)return g(o),t;u=u.sibling}throw Error(s(188))}if(n.return!==l.return)n=o,l=u;else{for(var d=!1,v=o.child;v;){if(v===n){d=!0,n=o,l=u;break}if(v===l){d=!0,l=o,n=u;break}v=v.sibling}if(!d){for(v=u.child;v;){if(v===n){d=!0,n=u,l=o;break}if(v===l){d=!0,l=u,n=o;break}v=v.sibling}if(!d)throw Error(s(189))}}if(n.alternate!==l)throw Error(s(190))}if(n.tag!==3)throw Error(s(188));return n.stateNode.current===n?e:t}function b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,w=Symbol.for("react.element"),D=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),X=Symbol.for("react.strict_mode"),V=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),$=Symbol.for("react.context"),be=Symbol.for("react.forward_ref"),me=Symbol.for("react.suspense"),ye=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),ge=Symbol.for("react.activity"),Oe=Symbol.for("react.memo_cache_sentinel"),Re=Symbol.iterator;function we(e){return e===null||typeof e!="object"?null:(e=Re&&e[Re]||e["@@iterator"],typeof e=="function"?e:null)}var Le=Symbol.for("react.client.reference");function Ye(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Le?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case q:return"Fragment";case V:return"Profiler";case X:return"StrictMode";case me:return"Suspense";case ye:return"SuspenseList";case ge:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case B:return"Portal";case $:return e.displayName||"Context";case Z:return(e._context.displayName||"Context")+".Consumer";case be:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case C:return t=e.displayName||null,t!==null?t:Ye(e.type)||"Memo";case W:t=e._payload,e=e._init;try{return Ye(e(t))}catch{}}return null}var Te=Array.isArray,x=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J={pending:!1,data:null,method:null,action:null},fe=[],he=-1;function T(e){return{current:e}}function j(e){0>he||(e.current=fe[he],fe[he]=null,he--)}function k(e,t){he++,fe[he]=e.current,e.current=t}var F=T(null),ee=T(null),ue=T(null),Ae=T(null);function Ee(e,t){switch(k(ue,t),k(ee,e),k(F,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Um(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Um(t),e=Lm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}j(F),k(F,e)}function Ze(){j(F),j(ee),j(ue)}function pn(e){e.memoizedState!==null&&k(Ae,e);var t=F.current,n=Lm(t,e.type);t!==n&&(k(ee,e),k(F,n))}function zn(e){ee.current===e&&(j(F),j(ee)),Ae.current===e&&(j(Ae),sr._currentValue=J)}var We,Un;function Kt(e){if(We===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);We=t&&t[1]||"",Un=-1<n.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+We+e+Un}var ri=!1;function Xt(e,t){if(!e||ri)return"";ri=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(L){var z=L}Reflect.construct(e,[],Y)}else{try{Y.call()}catch(L){z=L}e.call(Y.prototype)}}else{try{throw Error()}catch(L){z=L}(Y=e())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(L){if(L&&z&&typeof L.stack=="string")return[L.stack,z.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=l.DetermineComponentFrameRoot(),d=u[0],v=u[1];if(d&&v){var E=d.split(`
|
|
@@ -10,4 +10,4 @@ Error generating stack: `+l.message+`
|
|
|
10
10
|
`).replace(Iv,"")}function Nm(e,t){return t=Mm(t),Mm(e)===t}function $e(e,t,n,l,o,u){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Hi(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Hi(e,""+l);break;case"className":qn(e,"class",l);break;case"tabIndex":qn(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":qn(e,n,l);break;case"style":Nf(e,l,u);break;case"data":if(t!=="object"){qn(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=zr(""+l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(n==="formAction"?(t!=="input"&&$e(e,t,"name",o.name,o,null),$e(e,t,"formEncType",o.formEncType,o,null),$e(e,t,"formMethod",o.formMethod,o,null),$e(e,t,"formTarget",o.formTarget,o,null)):($e(e,t,"encType",o.encType,o,null),$e(e,t,"method",o.method,o,null),$e(e,t,"target",o.target,o,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=zr(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=sa);break;case"onScroll":l!=null&&Ne("scroll",e);break;case"onScrollEnd":l!=null&&Ne("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(n=l.__html,n!=null){if(o.children!=null)throw Error(s(60));e.innerHTML=n}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=zr(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""+l):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":Ne("beforetoggle",e),Ne("toggle",e),gt(e,"popover",l);break;case"xlinkActuate":zt(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":zt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":zt(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":zt(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":zt(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":zt(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":zt(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":zt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":zt(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":gt(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Ag.get(n)||n,gt(e,n,l))}}function lc(e,t,n,l,o,u){switch(n){case"style":Nf(e,l,u);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(n=l.__html,n!=null){if(o.children!=null)throw Error(s(60));e.innerHTML=n}}break;case"children":typeof l=="string"?Hi(e,l):(typeof l=="number"||typeof l=="bigint")&&Hi(e,""+l);break;case"onScroll":l!=null&&Ne("scroll",e);break;case"onScrollEnd":l!=null&&Ne("scrollend",e);break;case"onClick":l!=null&&(e.onclick=sa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ln.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(o=n.endsWith("Capture"),t=n.slice(2,o?n.length-7:void 0),u=e[ae]||null,u=u!=null?u[n]:null,typeof u=="function"&&e.removeEventListener(t,u,o),typeof l=="function")){typeof u!="function"&&u!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,o);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):gt(e,n,l)}}}function jt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ne("error",e),Ne("load",e);var l=!1,o=!1,u;for(u in n)if(n.hasOwnProperty(u)){var d=n[u];if(d!=null)switch(u){case"src":l=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:$e(e,t,u,d,n,null)}}o&&$e(e,t,"srcSet",n.srcSet,n,null),l&&$e(e,t,"src",n.src,n,null);return;case"input":Ne("invalid",e);var v=u=d=o=null,E=null,N=null;for(l in n)if(n.hasOwnProperty(l)){var H=n[l];if(H!=null)switch(l){case"name":o=H;break;case"type":d=H;break;case"checked":E=H;break;case"defaultChecked":N=H;break;case"value":u=H;break;case"defaultValue":v=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(s(137,t));break;default:$e(e,t,l,H,n,null)}}Of(e,u,v,E,N,d,o,!1);return;case"select":Ne("invalid",e),l=d=u=null;for(o in n)if(n.hasOwnProperty(o)&&(v=n[o],v!=null))switch(o){case"value":u=v;break;case"defaultValue":d=v;break;case"multiple":l=v;default:$e(e,t,o,v,n,null)}t=u,n=d,e.multiple=!!l,t!=null?ji(e,!!l,t,!1):n!=null&&ji(e,!!l,n,!0);return;case"textarea":Ne("invalid",e),u=o=l=null;for(d in n)if(n.hasOwnProperty(d)&&(v=n[d],v!=null))switch(d){case"value":l=v;break;case"defaultValue":o=v;break;case"children":u=v;break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(s(91));break;default:$e(e,t,d,v,n,null)}Df(e,l,o,u);return;case"option":for(E in n)n.hasOwnProperty(E)&&(l=n[E],l!=null)&&(E==="selected"?e.selected=l&&typeof l!="function"&&typeof l!="symbol":$e(e,t,E,l,n,null));return;case"dialog":Ne("beforetoggle",e),Ne("toggle",e),Ne("cancel",e),Ne("close",e);break;case"iframe":case"object":Ne("load",e);break;case"video":case"audio":for(l=0;l<nr.length;l++)Ne(nr[l],e);break;case"image":Ne("error",e),Ne("load",e);break;case"details":Ne("toggle",e);break;case"embed":case"source":case"link":Ne("error",e),Ne("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(N in n)if(n.hasOwnProperty(N)&&(l=n[N],l!=null))switch(N){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:$e(e,t,N,l,n,null)}return;default:if(bo(t)){for(H in n)n.hasOwnProperty(H)&&(l=n[H],l!==void 0&&lc(e,t,H,l,n,void 0));return}}for(v in n)n.hasOwnProperty(v)&&(l=n[v],l!=null&&$e(e,t,v,l,n,null))}function Wv(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,u=null,d=null,v=null,E=null,N=null,H=null;for(L in n){var Y=n[L];if(n.hasOwnProperty(L)&&Y!=null)switch(L){case"checked":break;case"value":break;case"defaultValue":E=Y;default:l.hasOwnProperty(L)||$e(e,t,L,null,l,Y)}}for(var z in l){var L=l[z];if(Y=n[z],l.hasOwnProperty(z)&&(L!=null||Y!=null))switch(z){case"type":u=L;break;case"name":o=L;break;case"checked":N=L;break;case"defaultChecked":H=L;break;case"value":d=L;break;case"defaultValue":v=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(s(137,t));break;default:L!==Y&&$e(e,t,z,L,l,Y)}}go(e,d,v,E,N,H,u,o);return;case"select":L=d=v=z=null;for(u in n)if(E=n[u],n.hasOwnProperty(u)&&E!=null)switch(u){case"value":break;case"multiple":L=E;default:l.hasOwnProperty(u)||$e(e,t,u,null,l,E)}for(o in l)if(u=l[o],E=n[o],l.hasOwnProperty(o)&&(u!=null||E!=null))switch(o){case"value":z=u;break;case"defaultValue":v=u;break;case"multiple":d=u;default:u!==E&&$e(e,t,o,u,l,E)}t=v,n=d,l=L,z!=null?ji(e,!!n,z,!1):!!l!=!!n&&(t!=null?ji(e,!!n,t,!0):ji(e,!!n,n?[]:"",!1));return;case"textarea":L=z=null;for(v in n)if(o=n[v],n.hasOwnProperty(v)&&o!=null&&!l.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:$e(e,t,v,null,l,o)}for(d in l)if(o=l[d],u=n[d],l.hasOwnProperty(d)&&(o!=null||u!=null))switch(d){case"value":z=o;break;case"defaultValue":L=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(s(91));break;default:o!==u&&$e(e,t,d,o,l,u)}xf(e,z,L);return;case"option":for(var ie in n)z=n[ie],n.hasOwnProperty(ie)&&z!=null&&!l.hasOwnProperty(ie)&&(ie==="selected"?e.selected=!1:$e(e,t,ie,null,l,z));for(E in l)z=l[E],L=n[E],l.hasOwnProperty(E)&&z!==L&&(z!=null||L!=null)&&(E==="selected"?e.selected=z&&typeof z!="function"&&typeof z!="symbol":$e(e,t,E,z,l,L));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ve in n)z=n[ve],n.hasOwnProperty(ve)&&z!=null&&!l.hasOwnProperty(ve)&&$e(e,t,ve,null,l,z);for(N in l)if(z=l[N],L=n[N],l.hasOwnProperty(N)&&z!==L&&(z!=null||L!=null))switch(N){case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(s(137,t));break;default:$e(e,t,N,z,l,L)}return;default:if(bo(t)){for(var Ie in n)z=n[Ie],n.hasOwnProperty(Ie)&&z!==void 0&&!l.hasOwnProperty(Ie)&&lc(e,t,Ie,void 0,l,z);for(H in l)z=l[H],L=n[H],!l.hasOwnProperty(H)||z===L||z===void 0&&L===void 0||lc(e,t,H,z,l,L);return}}for(var O in n)z=n[O],n.hasOwnProperty(O)&&z!=null&&!l.hasOwnProperty(O)&&$e(e,t,O,null,l,z);for(Y in l)z=l[Y],L=n[Y],!l.hasOwnProperty(Y)||z===L||z==null&&L==null||$e(e,t,Y,z,l,L)}function zm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function e0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var o=n[l],u=o.transferSize,d=o.initiatorType,v=o.duration;if(u&&v&&zm(d)){for(d=0,v=o.responseEnd,l+=1;l<n.length;l++){var E=n[l],N=E.startTime;if(N>v)break;var H=E.transferSize,Y=E.initiatorType;H&&zm(Y)&&(E=E.responseEnd,d+=H*(E<v?1:(v-N)/(E-N)))}if(--l,t+=8*(u+d)/(o.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var rc=null,sc=null;function Os(e){return e.nodeType===9?e:e.ownerDocument}function Um(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Lm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function oc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var uc=null;function t0(){var e=window.event;return e&&e.type==="popstate"?e===uc?!1:(uc=e,!0):(uc=null,!1)}var Bm=typeof setTimeout=="function"?setTimeout:void 0,n0=typeof clearTimeout=="function"?clearTimeout:void 0,jm=typeof Promise=="function"?Promise:void 0,a0=typeof queueMicrotask=="function"?queueMicrotask:typeof jm<"u"?function(e){return jm.resolve(null).then(e).catch(i0)}:Bm;function i0(e){setTimeout(function(){throw e})}function Ga(e){return e==="head"}function Hm(e,t){var n=t,l=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(o),pl(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")ir(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,ir(n);for(var u=n.firstChild;u;){var d=u.nextSibling,v=u.nodeName;u[ut]||v==="SCRIPT"||v==="STYLE"||v==="LINK"&&u.rel.toLowerCase()==="stylesheet"||n.removeChild(u),u=d}}else n==="body"&&ir(e.ownerDocument.body);n=o}while(n);pl(t)}function qm(e,t){var n=e;e=0;do{var l=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function cc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":cc(n),ct(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function l0(e,t,n,l){for(;e.nodeType===1;){var o=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[ut])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=Cn(e.nextSibling),e===null)break}return null}function r0(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Cn(e.nextSibling),e===null))return null;return e}function km(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Cn(e.nextSibling),e===null))return null;return e}function fc(e){return e.data==="$?"||e.data==="$~"}function dc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function s0(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Cn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var hc=null;function Qm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Cn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Ym(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Vm(e,t,n){switch(t=Os(n),e){case"html":if(e=t.documentElement,!e)throw Error(s(452));return e;case"head":if(e=t.head,!e)throw Error(s(453));return e;case"body":if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function ir(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ct(e)}var On=new Map,Gm=new Set;function xs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var wa=K.d;K.d={f:o0,r:u0,D:c0,C:f0,L:d0,m:h0,X:p0,S:m0,M:y0};function o0(){var e=wa.f(),t=Ss();return e||t}function u0(e){var t=je(e);t!==null&&t.tag===5&&t.type==="form"?sh(t):wa.r(e)}var dl=typeof document>"u"?null:document;function Km(e,t,n){var l=dl;if(l&&typeof t=="string"&&t){var o=Sn(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof n=="string"&&(o+='[crossorigin="'+n+'"]'),Gm.has(o)||(Gm.add(o),e={rel:e,crossOrigin:n,href:t},l.querySelector(o)===null&&(t=l.createElement("link"),jt(t,"link",e),rt(t),l.head.appendChild(t)))}}function c0(e){wa.D(e),Km("dns-prefetch",e,null)}function f0(e,t){wa.C(e,t),Km("preconnect",e,t)}function d0(e,t,n){wa.L(e,t,n);var l=dl;if(l&&e&&t){var o='link[rel="preload"][as="'+Sn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(o+='[imagesrcset="'+Sn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(o+='[imagesizes="'+Sn(n.imageSizes)+'"]')):o+='[href="'+Sn(e)+'"]';var u=o;switch(t){case"style":u=hl(e);break;case"script":u=ml(e)}On.has(u)||(e=p({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),On.set(u,e),l.querySelector(o)!==null||t==="style"&&l.querySelector(lr(u))||t==="script"&&l.querySelector(rr(u))||(t=l.createElement("link"),jt(t,"link",e),rt(t),l.head.appendChild(t)))}}function h0(e,t){wa.m(e,t);var n=dl;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+Sn(l)+'"][href="'+Sn(e)+'"]',u=o;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=ml(e)}if(!On.has(u)&&(e=p({rel:"modulepreload",href:e},t),On.set(u,e),n.querySelector(o)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(rr(u)))return}l=n.createElement("link"),jt(l,"link",e),rt(l),n.head.appendChild(l)}}}function m0(e,t,n){wa.S(e,t,n);var l=dl;if(l&&e){var o=Ft(l).hoistableStyles,u=hl(e);t=t||"default";var d=o.get(u);if(!d){var v={loading:0,preload:null};if(d=l.querySelector(lr(u)))v.loading=5;else{e=p({rel:"stylesheet",href:e,"data-precedence":t},n),(n=On.get(u))&&mc(e,n);var E=d=l.createElement("link");rt(E),jt(E,"link",e),E._p=new Promise(function(N,H){E.onload=N,E.onerror=H}),E.addEventListener("load",function(){v.loading|=1}),E.addEventListener("error",function(){v.loading|=2}),v.loading|=4,Ds(d,t,l)}d={type:"stylesheet",instance:d,count:1,state:v},o.set(u,d)}}}function p0(e,t){wa.X(e,t);var n=dl;if(n&&e){var l=Ft(n).hoistableScripts,o=ml(e),u=l.get(o);u||(u=n.querySelector(rr(o)),u||(e=p({src:e,async:!0},t),(t=On.get(o))&&pc(e,t),u=n.createElement("script"),rt(u),jt(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(o,u))}}function y0(e,t){wa.M(e,t);var n=dl;if(n&&e){var l=Ft(n).hoistableScripts,o=ml(e),u=l.get(o);u||(u=n.querySelector(rr(o)),u||(e=p({src:e,async:!0,type:"module"},t),(t=On.get(o))&&pc(e,t),u=n.createElement("script"),rt(u),jt(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(o,u))}}function Xm(e,t,n,l){var o=(o=ue.current)?xs(o):null;if(!o)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=hl(n.href),n=Ft(o).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=hl(n.href);var u=Ft(o).hoistableStyles,d=u.get(e);if(d||(o=o.ownerDocument||o,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,d),(u=o.querySelector(lr(e)))&&!u._p&&(d.instance=u,d.state.loading=5),On.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},On.set(e,n),u||g0(o,e,n,d.state))),t&&l===null)throw Error(s(528,""));return d}if(t&&l!==null)throw Error(s(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ml(n),n=Ft(o).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function hl(e){return'href="'+Sn(e)+'"'}function lr(e){return'link[rel="stylesheet"]['+e+"]"}function Zm(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function g0(e,t,n,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),jt(t,"link",n),rt(t),e.head.appendChild(t))}function ml(e){return'[src="'+Sn(e)+'"]'}function rr(e){return"script[async]"+e}function Fm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Sn(n.href)+'"]');if(l)return t.instance=l,rt(l),l;var o=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),rt(l),jt(l,"style",o),Ds(l,n.precedence,e),t.instance=l;case"stylesheet":o=hl(n.href);var u=e.querySelector(lr(o));if(u)return t.state.loading|=4,t.instance=u,rt(u),u;l=Zm(n),(o=On.get(o))&&mc(l,o),u=(e.ownerDocument||e).createElement("link"),rt(u);var d=u;return d._p=new Promise(function(v,E){d.onload=v,d.onerror=E}),jt(u,"link",l),t.state.loading|=4,Ds(u,n.precedence,e),t.instance=u;case"script":return u=ml(n.src),(o=e.querySelector(rr(u)))?(t.instance=o,rt(o),o):(l=n,(o=On.get(u))&&(l=p({},n),pc(l,o)),e=e.ownerDocument||e,o=e.createElement("script"),rt(o),jt(o,"link",l),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Ds(l,n.precedence,e));return t.instance}function Ds(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=l.length?l[l.length-1]:null,u=o,d=0;d<l.length;d++){var v=l[d];if(v.dataset.precedence===t)u=v;else if(u!==o)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function mc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function pc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ms=null;function Jm(e,t,n){if(Ms===null){var l=new Map,o=Ms=new Map;o.set(n,l)}else o=Ms,l=o.get(n),l||(l=new Map,o.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),o=0;o<n.length;o++){var u=n[o];if(!(u[ut]||u[te]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var d=u.getAttribute(t)||"";d=e+d;var v=l.get(d);v?v.push(u):l.set(d,[u])}}return l}function Pm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function v0(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function $m(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function b0(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var o=hl(l.href),u=t.querySelector(lr(o));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ns.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,rt(u);return}u=t.ownerDocument||t,l=Zm(l),(o=On.get(o))&&mc(l,o),u=u.createElement("link"),rt(u);var d=u;d._p=new Promise(function(v,E){d.onload=v,d.onerror=E}),jt(u,"link",l),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Ns.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var yc=0;function S0(e,t){return e.stylesheets&&e.count===0&&Us(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&Us(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&yc===0&&(yc=62500*e0());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Us(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>yc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(o)}}:null}function Ns(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Us(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var zs=null;function Us(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,zs=new Map,t.forEach(E0,e),zs=null,Ns.call(e))}function E0(e,t){if(!(t.state.loading&4)){var n=zs.get(e);if(n)var l=n.get(null);else{n=new Map,zs.set(e,n);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<o.length;u++){var d=o[u];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(n.set(d.dataset.precedence,d),l=d)}l&&n.set(null,l)}o=t.instance,d=o.getAttribute("data-precedence"),u=n.get(d)||l,u===l&&n.set(null,o),n.set(d,o),this.count++,l=Ns.bind(this),o.addEventListener("load",l),o.addEventListener("error",l),u?u.parentNode.insertBefore(o,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var sr={$$typeof:$,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function T0(e,t,n,l,o,u,d,v,E){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=an(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=an(0),this.hiddenUpdates=an(null),this.identifierPrefix=l,this.onUncaughtError=o,this.onCaughtError=u,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=E,this.incompleteTransitions=new Map}function Im(e,t,n,l,o,u,d,v,E,N,H,Y){return e=new T0(e,t,n,d,E,N,H,Y,v),t=1,u===!0&&(t|=24),u=sn(3,null,null,t),e.current=u,u.stateNode=e,t=Jo(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:l,isDehydrated:n,cache:t},Wo(u),e}function Wm(e){return e?(e=Ki,e):Ki}function ep(e,t,n,l,o,u){o=Wm(o),l.context===null?l.context=o:l.pendingContext=o,l=za(t),l.payload={element:n},u=u===void 0?null:u,u!==null&&(l.callback=u),n=Ua(e,l,t),n!==null&&(en(n,e,t),ql(n,e,t))}function tp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function gc(e,t){tp(e,t),(e=e.alternate)&&tp(e,t)}function np(e){if(e.tag===13||e.tag===31){var t=gi(e,67108864);t!==null&&en(t,e,67108864),gc(e,67108864)}}function ap(e){if(e.tag===13||e.tag===31){var t=dn();t=U(t);var n=gi(e,t);n!==null&&en(n,e,t),gc(e,t)}}var Ls=!0;function w0(e,t,n,l){var o=x.T;x.T=null;var u=K.p;try{K.p=2,vc(e,t,n,l)}finally{K.p=u,x.T=o}}function _0(e,t,n,l){var o=x.T;x.T=null;var u=K.p;try{K.p=8,vc(e,t,n,l)}finally{K.p=u,x.T=o}}function vc(e,t,n,l){if(Ls){var o=bc(l);if(o===null)ic(e,t,l,Bs,n),lp(e,l);else if(A0(o,e,t,n,l))l.stopPropagation();else if(lp(e,l),t&4&&-1<R0.indexOf(e)){for(;o!==null;){var u=je(o);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var d=vn(u.pendingLanes);if(d!==0){var v=u;for(v.pendingLanes|=2,v.entangledLanes|=2;d;){var E=1<<31-At(d);v.entanglements[1]|=E,d&=~E}Pn(u),(Xe&6)===0&&(vs=ot()+500,tr(0))}}break;case 31:case 13:v=gi(u,2),v!==null&&en(v,u,2),Ss(),gc(u,2)}if(u=bc(l),u===null&&ic(e,t,l,Bs,n),u===o)break;o=u}o!==null&&l.stopPropagation()}else ic(e,t,l,null,n)}}function bc(e){return e=Eo(e),Sc(e)}var Bs=null;function Sc(e){if(Bs=null,e=ft(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=h(t),e!==null)return e;e=null}else if(n===31){if(e=m(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Bs=e,null}function ip(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(na()){case Xn:return 2;case Aa:return 8;case Nt:case Yt:return 32;case yn:return 268435456;default:return 32}default:return 32}}var Ec=!1,Ka=null,Xa=null,Za=null,or=new Map,ur=new Map,Fa=[],R0="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function lp(e,t){switch(e){case"focusin":case"focusout":Ka=null;break;case"dragenter":case"dragleave":Xa=null;break;case"mouseover":case"mouseout":Za=null;break;case"pointerover":case"pointerout":or.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ur.delete(t.pointerId)}}function cr(e,t,n,l,o,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:u,targetContainers:[o]},t!==null&&(t=je(t),t!==null&&np(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function A0(e,t,n,l,o){switch(t){case"focusin":return Ka=cr(Ka,e,t,n,l,o),!0;case"dragenter":return Xa=cr(Xa,e,t,n,l,o),!0;case"mouseover":return Za=cr(Za,e,t,n,l,o),!0;case"pointerover":var u=o.pointerId;return or.set(u,cr(or.get(u)||null,e,t,n,l,o)),!0;case"gotpointercapture":return u=o.pointerId,ur.set(u,cr(ur.get(u)||null,e,t,n,l,o)),!0}return!1}function rp(e){var t=ft(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=h(n),t!==null){e.blockedOn=t,oe(e.priority,function(){ap(n)});return}}else if(t===31){if(t=m(n),t!==null){e.blockedOn=t,oe(e.priority,function(){ap(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function js(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bc(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);So=l,n.target.dispatchEvent(l),So=null}else return t=je(n),t!==null&&np(t),e.blockedOn=n,!1;t.shift()}return!0}function sp(e,t,n){js(e)&&n.delete(t)}function C0(){Ec=!1,Ka!==null&&js(Ka)&&(Ka=null),Xa!==null&&js(Xa)&&(Xa=null),Za!==null&&js(Za)&&(Za=null),or.forEach(sp),ur.forEach(sp)}function Hs(e,t){e.blockedOn===t&&(e.blockedOn=null,Ec||(Ec=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,C0)))}var qs=null;function op(e){qs!==e&&(qs=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){qs===e&&(qs=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],o=e[t+2];if(typeof l!="function"){if(Sc(l||n)===null)continue;break}var u=je(n);u!==null&&(e.splice(t,3),t-=3,bu(u,{pending:!0,data:o,method:n.method,action:l},l,o))}}))}function pl(e){function t(E){return Hs(E,e)}Ka!==null&&Hs(Ka,e),Xa!==null&&Hs(Xa,e),Za!==null&&Hs(Za,e),or.forEach(t),ur.forEach(t);for(var n=0;n<Fa.length;n++){var l=Fa[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Fa.length&&(n=Fa[0],n.blockedOn===null);)rp(n),n.blockedOn===null&&Fa.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var o=n[l],u=n[l+1],d=o[ae]||null;if(typeof u=="function")d||op(n);else if(d){var v=null;if(u&&u.hasAttribute("formAction")){if(o=u,d=u[ae]||null)v=d.formAction;else if(Sc(o)!==null)continue}else v=d.action;typeof v=="function"?n[l+1]=v:(n.splice(l,3),l-=3),op(n)}}}function up(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(d){return o=d})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function Tc(e){this._internalRoot=e}ks.prototype.render=Tc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var n=t.current,l=dn();ep(n,l,e,t,null,null)},ks.prototype.unmount=Tc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ep(e.current,2,null,e,null,null),Ss(),t[re]=null}};function ks(e){this._internalRoot=e}ks.prototype.unstable_scheduleHydration=function(e){if(e){var t=P();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Fa.length&&t!==0&&t<Fa[n].priority;n++);Fa.splice(n,0,e),n===0&&rp(e)}};var cp=i.version;if(cp!=="19.2.4")throw Error(s(527,cp,"19.2.4"));K.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=y(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var O0={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:x,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Qs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qs.isDisabled&&Qs.supportsFiber)try{aa=Qs.inject(O0),at=Qs}catch{}}return dr.createRoot=function(e,t){if(!c(e))throw Error(s(299));var n=!1,l="",o=gh,u=vh,d=bh;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=Im(e,1,!1,null,null,n,l,null,o,u,d,up),e[re]=t.current,ac(e),new Tc(t)},dr.hydrateRoot=function(e,t,n){if(!c(e))throw Error(s(299));var l=!1,o="",u=gh,d=vh,v=bh,E=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError),n.formState!==void 0&&(E=n.formState)),t=Im(e,1,!0,t,n??null,l,o,E,u,d,v,up),t.context=Wm(null),n=t.current,l=dn(),l=U(l),o=za(l),o.callback=null,Ua(n,o,l),n=l,t.current.lanes=n,nt(t,n),Pn(t),e[re]=t.current,ac(e),new ks(t)},dr.version="19.2.4",dr}var Sp;function q0(){if(Sp)return Rc.exports;Sp=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(i){console.error(i)}}return a(),Rc.exports=H0(),Rc.exports}var k0=q0(),Sl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(a){return this.listeners.add(a),this.onSubscribe(),()=>{this.listeners.delete(a),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Q0={setTimeout:(a,i)=>setTimeout(a,i),clearTimeout:a=>clearTimeout(a),setInterval:(a,i)=>setInterval(a,i),clearInterval:a=>clearInterval(a)},Y0=class{#e=Q0;#t=!1;setTimeoutProvider(a){this.#e=a}setTimeout(a,i){return this.#e.setTimeout(a,i)}clearTimeout(a){this.#e.clearTimeout(a)}setInterval(a,i){return this.#e.setInterval(a,i)}clearInterval(a){this.#e.clearInterval(a)}},Di=new Y0;function V0(a){setTimeout(a,0)}var Ni=typeof window>"u"||"Deno"in globalThis;function Gt(){}function G0(a,i){return typeof a=="function"?a(i):a}function Hc(a){return typeof a=="number"&&a>=0&&a!==1/0}function yy(a,i){return Math.max(a+(i||0)-Date.now(),0)}function ei(a,i){return typeof a=="function"?a(i):a}function Dn(a,i){return typeof a=="function"?a(i):a}function Ep(a,i){const{type:r="all",exact:s,fetchStatus:c,predicate:f,queryKey:h,stale:m}=a;if(h){if(s){if(i.queryHash!==rf(h,i.options))return!1}else if(!Er(i.queryKey,h))return!1}if(r!=="all"){const g=i.isActive();if(r==="active"&&!g||r==="inactive"&&g)return!1}return!(typeof m=="boolean"&&i.isStale()!==m||c&&c!==i.state.fetchStatus||f&&!f(i))}function Tp(a,i){const{exact:r,status:s,predicate:c,mutationKey:f}=a;if(f){if(!i.options.mutationKey)return!1;if(r){if(zi(i.options.mutationKey)!==zi(f))return!1}else if(!Er(i.options.mutationKey,f))return!1}return!(s&&i.state.status!==s||c&&!c(i))}function rf(a,i){return(i?.queryKeyHashFn||zi)(a)}function zi(a){return JSON.stringify(a,(i,r)=>qc(r)?Object.keys(r).sort().reduce((s,c)=>(s[c]=r[c],s),{}):r)}function Er(a,i){return a===i?!0:typeof a!=typeof i?!1:a&&i&&typeof a=="object"&&typeof i=="object"?Object.keys(i).every(r=>Er(a[r],i[r])):!1}var K0=Object.prototype.hasOwnProperty;function gy(a,i,r=0){if(a===i)return a;if(r>500)return i;const s=wp(a)&&wp(i);if(!s&&!(qc(a)&&qc(i)))return i;const f=(s?a:Object.keys(a)).length,h=s?i:Object.keys(i),m=h.length,g=s?new Array(m):{};let y=0;for(let b=0;b<m;b++){const p=s?b:h[b],w=a[p],D=i[p];if(w===D){g[p]=w,(s?b<f:K0.call(a,p))&&y++;continue}if(w===null||D===null||typeof w!="object"||typeof D!="object"){g[p]=D;continue}const B=gy(w,D,r+1);g[p]=B,B===w&&y++}return f===m&&y===f?a:g}function ro(a,i){if(!i||Object.keys(a).length!==Object.keys(i).length)return!1;for(const r in a)if(a[r]!==i[r])return!1;return!0}function wp(a){return Array.isArray(a)&&a.length===Object.keys(a).length}function qc(a){if(!_p(a))return!1;const i=a.constructor;if(i===void 0)return!0;const r=i.prototype;return!(!_p(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(a)!==Object.prototype)}function _p(a){return Object.prototype.toString.call(a)==="[object Object]"}function X0(a){return new Promise(i=>{Di.setTimeout(i,a)})}function kc(a,i,r){return typeof r.structuralSharing=="function"?r.structuralSharing(a,i):r.structuralSharing!==!1?gy(a,i):i}function Z0(a,i,r=0){const s=[...a,i];return r&&s.length>r?s.slice(1):s}function F0(a,i,r=0){const s=[i,...a];return r&&s.length>r?s.slice(0,-1):s}var sf=Symbol();function vy(a,i){return!a.queryFn&&i?.initialPromise?()=>i.initialPromise:!a.queryFn||a.queryFn===sf?()=>Promise.reject(new Error(`Missing queryFn: '${a.queryHash}'`)):a.queryFn}function of(a,i){return typeof a=="function"?a(...i):!!a}function J0(a,i,r){let s=!1,c;return Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(c??=i(),s||(s=!0,c.aborted?r():c.addEventListener("abort",r,{once:!0})),c)}),a}var P0=class extends Sl{#e;#t;#n;constructor(){super(),this.#n=a=>{if(!Ni&&window.addEventListener){const i=()=>a();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(a){this.#n=a,this.#t?.(),this.#t=a(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()})}setFocused(a){this.#e!==a&&(this.#e=a,this.onFocus())}onFocus(){const a=this.isFocused();this.listeners.forEach(i=>{i(a)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},uf=new P0;function Qc(){let a,i;const r=new Promise((c,f)=>{a=c,i=f});r.status="pending",r.catch(()=>{});function s(c){Object.assign(r,c),delete r.resolve,delete r.reject}return r.resolve=c=>{s({status:"fulfilled",value:c}),a(c)},r.reject=c=>{s({status:"rejected",reason:c}),i(c)},r}var $0=V0;function I0(){let a=[],i=0,r=m=>{m()},s=m=>{m()},c=$0;const f=m=>{i?a.push(m):c(()=>{r(m)})},h=()=>{const m=a;a=[],m.length&&c(()=>{s(()=>{m.forEach(g=>{r(g)})})})};return{batch:m=>{let g;i++;try{g=m()}finally{i--,i||h()}return g},batchCalls:m=>(...g)=>{f(()=>{m(...g)})},schedule:f,setNotifyFunction:m=>{r=m},setBatchNotifyFunction:m=>{s=m},setScheduler:m=>{c=m}}}var Ot=I0(),W0=class extends Sl{#e=!0;#t;#n;constructor(){super(),this.#n=a=>{if(!Ni&&window.addEventListener){const i=()=>a(!0),r=()=>a(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(a){this.#n=a,this.#t?.(),this.#t=a(this.setOnline.bind(this))}setOnline(a){this.#e!==a&&(this.#e=a,this.listeners.forEach(r=>{r(a)}))}isOnline(){return this.#e}},so=new W0;function eb(a){return Math.min(1e3*2**a,3e4)}function by(a){return(a??"online")==="online"?so.isOnline():!0}var Yc=class extends Error{constructor(a){super("CancelledError"),this.revert=a?.revert,this.silent=a?.silent}};function Sy(a){let i=!1,r=0,s;const c=Qc(),f=()=>c.status!=="pending",h=q=>{if(!f()){const X=new Yc(q);w(X),a.onCancel?.(X)}},m=()=>{i=!0},g=()=>{i=!1},y=()=>uf.isFocused()&&(a.networkMode==="always"||so.isOnline())&&a.canRun(),b=()=>by(a.networkMode)&&a.canRun(),p=q=>{f()||(s?.(),c.resolve(q))},w=q=>{f()||(s?.(),c.reject(q))},D=()=>new Promise(q=>{s=X=>{(f()||y())&&q(X)},a.onPause?.()}).then(()=>{s=void 0,f()||a.onContinue?.()}),B=()=>{if(f())return;let q;const X=r===0?a.initialPromise:void 0;try{q=X??a.fn()}catch(V){q=Promise.reject(V)}Promise.resolve(q).then(p).catch(V=>{if(f())return;const Z=a.retry??(Ni?0:3),$=a.retryDelay??eb,be=typeof $=="function"?$(r,V):$,me=Z===!0||typeof Z=="number"&&r<Z||typeof Z=="function"&&Z(r,V);if(i||!me){w(V);return}r++,a.onFail?.(r,V),X0(be).then(()=>y()?void 0:D()).then(()=>{i?w(V):B()})})};return{promise:c,status:()=>c.status,cancel:h,continue:()=>(s?.(),c),cancelRetry:m,continueRetry:g,canStart:b,start:()=>(b()?B():D().then(B),c)}}var Ey=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Hc(this.gcTime)&&(this.#e=Di.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(a){this.gcTime=Math.max(this.gcTime||0,a??(Ni?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Di.clearTimeout(this.#e),this.#e=void 0)}},tb=class extends Ey{#e;#t;#n;#i;#a;#r;#s;constructor(a){super(),this.#s=!1,this.#r=a.defaultOptions,this.setOptions(a.options),this.observers=[],this.#i=a.client,this.#n=this.#i.getQueryCache(),this.queryKey=a.queryKey,this.queryHash=a.queryHash,this.#e=Ap(this.options),this.state=a.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(a){if(this.options={...this.#r,...a},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=Ap(this.options);i.data!==void 0&&(this.setState(Rp(i.data,i.dataUpdatedAt)),this.#e=i)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(a,i){const r=kc(this.state.data,a,this.options);return this.#l({data:r,type:"success",dataUpdatedAt:i?.updatedAt,manual:i?.manual}),r}setState(a,i){this.#l({type:"setState",state:a,setStateOptions:i})}cancel(a){const i=this.#a?.promise;return this.#a?.cancel(a),i?i.then(Gt).catch(Gt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(a=>Dn(a.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===sf||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(a=>ei(a.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(a=>a.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(a=0){return this.state.data===void 0?!0:a==="static"?!1:this.state.isInvalidated?!0:!yy(this.state.dataUpdatedAt,a)}onFocus(){this.observers.find(i=>i.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(i=>i.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(a){this.observers.includes(a)||(this.observers.push(a),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:a}))}removeObserver(a){this.observers.includes(a)&&(this.observers=this.observers.filter(i=>i!==a),this.observers.length||(this.#a&&(this.#s?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:a}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(a,i){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&i?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(a&&this.setOptions(a),!this.options.queryFn){const m=this.observers.find(g=>g.options.queryFn);m&&this.setOptions(m.options)}const r=new AbortController,s=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(this.#s=!0,r.signal)})},c=()=>{const m=vy(this.options,i),y=(()=>{const b={client:this.#i,queryKey:this.queryKey,meta:this.meta};return s(b),b})();return this.#s=!1,this.options.persister?this.options.persister(m,y,this):m(y)},h=(()=>{const m={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:c};return s(m),m})();this.options.behavior?.onFetch(h,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==h.fetchOptions?.meta)&&this.#l({type:"fetch",meta:h.fetchOptions?.meta}),this.#a=Sy({initialPromise:i?.initialPromise,fn:h.fetchFn,onCancel:m=>{m instanceof Yc&&m.revert&&this.setState({...this.#t,fetchStatus:"idle"}),r.abort()},onFail:(m,g)=>{this.#l({type:"failed",failureCount:m,error:g})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0});try{const m=await this.#a.start();if(m===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(m),this.#n.config.onSuccess?.(m,this),this.#n.config.onSettled?.(m,this.state.error,this),m}catch(m){if(m instanceof Yc){if(m.silent)return this.#a.promise;if(m.revert){if(this.state.data===void 0)throw m;return this.state.data}}throw this.#l({type:"error",error:m}),this.#n.config.onError?.(m,this),this.#n.config.onSettled?.(this.state.data,m,this),m}finally{this.scheduleGc()}}#l(a){const i=r=>{switch(a.type){case"failed":return{...r,fetchFailureCount:a.failureCount,fetchFailureReason:a.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Ty(r.data,this.options),fetchMeta:a.meta??null};case"success":const s={...r,...Rp(a.data,a.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!a.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=a.manual?s:void 0,s;case"error":const c=a.error;return{...r,error:c,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...a.state}}};this.state=i(this.state),Ot.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:a})})}};function Ty(a,i){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:by(i.networkMode)?"fetching":"paused",...a===void 0&&{error:null,status:"pending"}}}function Rp(a,i){return{data:a,dataUpdatedAt:i??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ap(a){const i=typeof a.initialData=="function"?a.initialData():a.initialData,r=i!==void 0,s=r?typeof a.initialDataUpdatedAt=="function"?a.initialDataUpdatedAt():a.initialDataUpdatedAt:0;return{data:i,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var nb=class extends Sl{constructor(a,i){super(),this.options=i,this.#e=a,this.#l=null,this.#s=Qc(),this.bindMethods(),this.setOptions(i)}#e;#t=void 0;#n=void 0;#i=void 0;#a;#r;#s;#l;#p;#d;#h;#u;#c;#o;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Cp(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Vc(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Vc(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#S(),this.#E(),this.#t.removeObserver(this)}setOptions(a){const i=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(a),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Dn(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#T(),this.#t.setOptions(this.options),i._defaulted&&!ro(this.options,i)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&Op(this.#t,r,this.options,i)&&this.#f(),this.updateResult(),s&&(this.#t!==r||Dn(this.options.enabled,this.#t)!==Dn(i.enabled,this.#t)||ei(this.options.staleTime,this.#t)!==ei(i.staleTime,this.#t))&&this.#y();const c=this.#g();s&&(this.#t!==r||Dn(this.options.enabled,this.#t)!==Dn(i.enabled,this.#t)||c!==this.#o)&&this.#v(c)}getOptimisticResult(a){const i=this.#e.getQueryCache().build(this.#e,a),r=this.createResult(i,a);return ib(this,r)&&(this.#i=r,this.#r=this.options,this.#a=this.#t.state),r}getCurrentResult(){return this.#i}trackResult(a,i){return new Proxy(a,{get:(r,s)=>(this.trackProp(s),i?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(a){this.#m.add(a)}getCurrentQuery(){return this.#t}refetch({...a}={}){return this.fetch({...a})}fetchOptimistic(a){const i=this.#e.defaultQueryOptions(a),r=this.#e.getQueryCache().build(this.#e,i);return r.fetch().then(()=>this.createResult(r,i))}fetch(a){return this.#f({...a,cancelRefetch:a.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#f(a){this.#T();let i=this.#t.fetch(this.options,a);return a?.throwOnError||(i=i.catch(Gt)),i}#y(){this.#S();const a=ei(this.options.staleTime,this.#t);if(Ni||this.#i.isStale||!Hc(a))return;const r=yy(this.#i.dataUpdatedAt,a)+1;this.#u=Di.setTimeout(()=>{this.#i.isStale||this.updateResult()},r)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(a){this.#E(),this.#o=a,!(Ni||Dn(this.options.enabled,this.#t)===!1||!Hc(this.#o)||this.#o===0)&&(this.#c=Di.setInterval(()=>{(this.options.refetchIntervalInBackground||uf.isFocused())&&this.#f()},this.#o))}#b(){this.#y(),this.#v(this.#g())}#S(){this.#u&&(Di.clearTimeout(this.#u),this.#u=void 0)}#E(){this.#c&&(Di.clearInterval(this.#c),this.#c=void 0)}createResult(a,i){const r=this.#t,s=this.options,c=this.#i,f=this.#a,h=this.#r,g=a!==r?a.state:this.#n,{state:y}=a;let b={...y},p=!1,w;if(i._optimisticResults){const W=this.hasListeners(),ge=!W&&Cp(a,i),Oe=W&&Op(a,r,i,s);(ge||Oe)&&(b={...b,...Ty(y.data,a.options)}),i._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:D,errorUpdatedAt:B,status:q}=b;w=b.data;let X=!1;if(i.placeholderData!==void 0&&w===void 0&&q==="pending"){let W;c?.isPlaceholderData&&i.placeholderData===h?.placeholderData?(W=c.data,X=!0):W=typeof i.placeholderData=="function"?i.placeholderData(this.#h?.state.data,this.#h):i.placeholderData,W!==void 0&&(q="success",w=kc(c?.data,W,i),p=!0)}if(i.select&&w!==void 0&&!X)if(c&&w===f?.data&&i.select===this.#p)w=this.#d;else try{this.#p=i.select,w=i.select(w),w=kc(c?.data,w,i),this.#d=w,this.#l=null}catch(W){this.#l=W}this.#l&&(D=this.#l,w=this.#d,B=Date.now(),q="error");const V=b.fetchStatus==="fetching",Z=q==="pending",$=q==="error",be=Z&&V,me=w!==void 0,C={status:q,fetchStatus:b.fetchStatus,isPending:Z,isSuccess:q==="success",isError:$,isInitialLoading:be,isLoading:be,data:w,dataUpdatedAt:b.dataUpdatedAt,error:D,errorUpdatedAt:B,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:b.dataUpdateCount>0||b.errorUpdateCount>0,isFetchedAfterMount:b.dataUpdateCount>g.dataUpdateCount||b.errorUpdateCount>g.errorUpdateCount,isFetching:V,isRefetching:V&&!Z,isLoadingError:$&&!me,isPaused:b.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:$&&me,isStale:cf(a,i),refetch:this.refetch,promise:this.#s,isEnabled:Dn(i.enabled,a)!==!1};if(this.options.experimental_prefetchInRender){const W=C.data!==void 0,ge=C.status==="error"&&!W,Oe=Le=>{ge?Le.reject(C.error):W&&Le.resolve(C.data)},Re=()=>{const Le=this.#s=C.promise=Qc();Oe(Le)},we=this.#s;switch(we.status){case"pending":a.queryHash===r.queryHash&&Oe(we);break;case"fulfilled":(ge||C.data!==we.value)&&Re();break;case"rejected":(!ge||C.error!==we.reason)&&Re();break}}return C}updateResult(){const a=this.#i,i=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#r=this.options,this.#a.data!==void 0&&(this.#h=this.#t),ro(i,a))return;this.#i=i;const r=()=>{if(!a)return!0;const{notifyOnChangeProps:s}=this.options,c=typeof s=="function"?s():s;if(c==="all"||!c&&!this.#m.size)return!0;const f=new Set(c??this.#m);return this.options.throwOnError&&f.add("error"),Object.keys(this.#i).some(h=>{const m=h;return this.#i[m]!==a[m]&&f.has(m)})};this.#w({listeners:r()})}#T(){const a=this.#e.getQueryCache().build(this.#e,this.options);if(a===this.#t)return;const i=this.#t;this.#t=a,this.#n=a.state,this.hasListeners()&&(i?.removeObserver(this),a.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#w(a){Ot.batch(()=>{a.listeners&&this.listeners.forEach(i=>{i(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function ab(a,i){return Dn(i.enabled,a)!==!1&&a.state.data===void 0&&!(a.state.status==="error"&&i.retryOnMount===!1)}function Cp(a,i){return ab(a,i)||a.state.data!==void 0&&Vc(a,i,i.refetchOnMount)}function Vc(a,i,r){if(Dn(i.enabled,a)!==!1&&ei(i.staleTime,a)!=="static"){const s=typeof r=="function"?r(a):r;return s==="always"||s!==!1&&cf(a,i)}return!1}function Op(a,i,r,s){return(a!==i||Dn(s.enabled,a)===!1)&&(!r.suspense||a.state.status!=="error")&&cf(a,r)}function cf(a,i){return Dn(i.enabled,a)!==!1&&a.isStaleByTime(ei(i.staleTime,a))}function ib(a,i){return!ro(a.getCurrentResult(),i)}function xp(a){return{onFetch:(i,r)=>{const s=i.options,c=i.fetchOptions?.meta?.fetchMore?.direction,f=i.state.data?.pages||[],h=i.state.data?.pageParams||[];let m={pages:[],pageParams:[]},g=0;const y=async()=>{let b=!1;const p=B=>{J0(B,()=>i.signal,()=>b=!0)},w=vy(i.options,i.fetchOptions),D=async(B,q,X)=>{if(b)return Promise.reject();if(q==null&&B.pages.length)return Promise.resolve(B);const Z=(()=>{const ye={client:i.client,queryKey:i.queryKey,pageParam:q,direction:X?"backward":"forward",meta:i.options.meta};return p(ye),ye})(),$=await w(Z),{maxPages:be}=i.options,me=X?F0:Z0;return{pages:me(B.pages,$,be),pageParams:me(B.pageParams,q,be)}};if(c&&f.length){const B=c==="backward",q=B?wy:Gc,X={pages:f,pageParams:h},V=q(s,X);m=await D(X,V,B)}else{const B=a??f.length;do{const q=g===0?h[0]??s.initialPageParam:Gc(s,m);if(g>0&&q==null)break;m=await D(m,q),g++}while(g<B)}return m};i.options.persister?i.fetchFn=()=>i.options.persister?.(y,{client:i.client,queryKey:i.queryKey,meta:i.options.meta,signal:i.signal},r):i.fetchFn=y}}}function Gc(a,{pages:i,pageParams:r}){const s=i.length-1;return i.length>0?a.getNextPageParam(i[s],i,r[s],r):void 0}function wy(a,{pages:i,pageParams:r}){return i.length>0?a.getPreviousPageParam?.(i[0],i,r[0],r):void 0}function f2(a,i){return i?Gc(a,i)!=null:!1}function d2(a,i){return!i||!a.getPreviousPageParam?!1:wy(a,i)!=null}var lb=class extends Ey{#e;#t;#n;#i;constructor(a){super(),this.#e=a.client,this.mutationId=a.mutationId,this.#n=a.mutationCache,this.#t=[],this.state=a.state||_y(),this.setOptions(a.options),this.scheduleGc()}setOptions(a){this.options=a,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(a){this.#t.includes(a)||(this.#t.push(a),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:a}))}removeObserver(a){this.#t=this.#t.filter(i=>i!==a),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:a})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(a){const i=()=>{this.#a({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=Sy({fn:()=>this.options.mutationFn?this.options.mutationFn(a,r):Promise.reject(new Error("No mutationFn found")),onFail:(f,h)=>{this.#a({type:"failed",failureCount:f,error:h})},onPause:()=>{this.#a({type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const s=this.state.status==="pending",c=!this.#i.canStart();try{if(s)i();else{this.#a({type:"pending",variables:a,isPaused:c}),this.#n.config.onMutate&&await this.#n.config.onMutate(a,this,r);const h=await this.options.onMutate?.(a,r);h!==this.state.context&&this.#a({type:"pending",context:h,variables:a,isPaused:c})}const f=await this.#i.start();return await this.#n.config.onSuccess?.(f,a,this.state.context,this,r),await this.options.onSuccess?.(f,a,this.state.context,r),await this.#n.config.onSettled?.(f,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(f,null,a,this.state.context,r),this.#a({type:"success",data:f}),f}catch(f){try{await this.#n.config.onError?.(f,a,this.state.context,this,r)}catch(h){Promise.reject(h)}try{await this.options.onError?.(f,a,this.state.context,r)}catch(h){Promise.reject(h)}try{await this.#n.config.onSettled?.(void 0,f,this.state.variables,this.state.context,this,r)}catch(h){Promise.reject(h)}try{await this.options.onSettled?.(void 0,f,a,this.state.context,r)}catch(h){Promise.reject(h)}throw this.#a({type:"error",error:f}),f}finally{this.#n.runNext(this)}}#a(a){const i=r=>{switch(a.type){case"failed":return{...r,failureCount:a.failureCount,failureReason:a.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:a.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:a.isPaused,status:"pending",variables:a.variables,submittedAt:Date.now()};case"success":return{...r,data:a.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:a.error,failureCount:r.failureCount+1,failureReason:a.error,isPaused:!1,status:"error"}}};this.state=i(this.state),Ot.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(a)}),this.#n.notify({mutation:this,type:"updated",action:a})})}};function _y(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var rb=class extends Sl{constructor(a={}){super(),this.config=a,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(a,i,r){const s=new lb({client:a,mutationCache:this,mutationId:++this.#n,options:a.defaultMutationOptions(i),state:r});return this.add(s),s}add(a){this.#e.add(a);const i=Ys(a);if(typeof i=="string"){const r=this.#t.get(i);r?r.push(a):this.#t.set(i,[a])}this.notify({type:"added",mutation:a})}remove(a){if(this.#e.delete(a)){const i=Ys(a);if(typeof i=="string"){const r=this.#t.get(i);if(r)if(r.length>1){const s=r.indexOf(a);s!==-1&&r.splice(s,1)}else r[0]===a&&this.#t.delete(i)}}this.notify({type:"removed",mutation:a})}canRun(a){const i=Ys(a);if(typeof i=="string"){const s=this.#t.get(i)?.find(c=>c.state.status==="pending");return!s||s===a}else return!0}runNext(a){const i=Ys(a);return typeof i=="string"?this.#t.get(i)?.find(s=>s!==a&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Ot.batch(()=>{this.#e.forEach(a=>{this.notify({type:"removed",mutation:a})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(a){const i={exact:!0,...a};return this.getAll().find(r=>Tp(i,r))}findAll(a={}){return this.getAll().filter(i=>Tp(a,i))}notify(a){Ot.batch(()=>{this.listeners.forEach(i=>{i(a)})})}resumePausedMutations(){const a=this.getAll().filter(i=>i.state.isPaused);return Ot.batch(()=>Promise.all(a.map(i=>i.continue().catch(Gt))))}};function Ys(a){return a.options.scope?.id}var sb=class extends Sl{#e;#t=void 0;#n;#i;constructor(i,r){super(),this.#e=i,this.setOptions(r),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(i){const r=this.options;this.options=this.#e.defaultMutationOptions(i),ro(this.options,r)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),r?.mutationKey&&this.options.mutationKey&&zi(r.mutationKey)!==zi(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(i){this.#a(),this.#r(i)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#a(),this.#r()}mutate(i,r){return this.#i=r,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(i)}#a(){const i=this.#n?.state??_y();this.#t={...i,isPending:i.status==="pending",isSuccess:i.status==="success",isError:i.status==="error",isIdle:i.status==="idle",mutate:this.mutate,reset:this.reset}}#r(i){Ot.batch(()=>{if(this.#i&&this.hasListeners()){const r=this.#t.variables,s=this.#t.context,c={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(i?.type==="success"){try{this.#i.onSuccess?.(i.data,r,s,c)}catch(f){Promise.reject(f)}try{this.#i.onSettled?.(i.data,null,r,s,c)}catch(f){Promise.reject(f)}}else if(i?.type==="error"){try{this.#i.onError?.(i.error,r,s,c)}catch(f){Promise.reject(f)}try{this.#i.onSettled?.(void 0,i.error,r,s,c)}catch(f){Promise.reject(f)}}}this.listeners.forEach(r=>{r(this.#t)})})}},ob=class extends Sl{constructor(a={}){super(),this.config=a,this.#e=new Map}#e;build(a,i,r){const s=i.queryKey,c=i.queryHash??rf(s,i);let f=this.get(c);return f||(f=new tb({client:a,queryKey:s,queryHash:c,options:a.defaultQueryOptions(i),state:r,defaultOptions:a.getQueryDefaults(s)}),this.add(f)),f}add(a){this.#e.has(a.queryHash)||(this.#e.set(a.queryHash,a),this.notify({type:"added",query:a}))}remove(a){const i=this.#e.get(a.queryHash);i&&(a.destroy(),i===a&&this.#e.delete(a.queryHash),this.notify({type:"removed",query:a}))}clear(){Ot.batch(()=>{this.getAll().forEach(a=>{this.remove(a)})})}get(a){return this.#e.get(a)}getAll(){return[...this.#e.values()]}find(a){const i={exact:!0,...a};return this.getAll().find(r=>Ep(i,r))}findAll(a={}){const i=this.getAll();return Object.keys(a).length>0?i.filter(r=>Ep(a,r)):i}notify(a){Ot.batch(()=>{this.listeners.forEach(i=>{i(a)})})}onFocus(){Ot.batch(()=>{this.getAll().forEach(a=>{a.onFocus()})})}onOnline(){Ot.batch(()=>{this.getAll().forEach(a=>{a.onOnline()})})}},ub=class{#e;#t;#n;#i;#a;#r;#s;#l;constructor(a={}){this.#e=a.queryCache||new ob,this.#t=a.mutationCache||new rb,this.#n=a.defaultOptions||{},this.#i=new Map,this.#a=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#s=uf.subscribe(async a=>{a&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#l=so.subscribe(async a=>{a&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#s?.(),this.#s=void 0,this.#l?.(),this.#l=void 0)}isFetching(a){return this.#e.findAll({...a,fetchStatus:"fetching"}).length}isMutating(a){return this.#t.findAll({...a,status:"pending"}).length}getQueryData(a){const i=this.defaultQueryOptions({queryKey:a});return this.#e.get(i.queryHash)?.state.data}ensureQueryData(a){const i=this.defaultQueryOptions(a),r=this.#e.build(this,i),s=r.state.data;return s===void 0?this.fetchQuery(a):(a.revalidateIfStale&&r.isStaleByTime(ei(i.staleTime,r))&&this.prefetchQuery(i),Promise.resolve(s))}getQueriesData(a){return this.#e.findAll(a).map(({queryKey:i,state:r})=>{const s=r.data;return[i,s]})}setQueryData(a,i,r){const s=this.defaultQueryOptions({queryKey:a}),f=this.#e.get(s.queryHash)?.state.data,h=G0(i,f);if(h!==void 0)return this.#e.build(this,s).setData(h,{...r,manual:!0})}setQueriesData(a,i,r){return Ot.batch(()=>this.#e.findAll(a).map(({queryKey:s})=>[s,this.setQueryData(s,i,r)]))}getQueryState(a){const i=this.defaultQueryOptions({queryKey:a});return this.#e.get(i.queryHash)?.state}removeQueries(a){const i=this.#e;Ot.batch(()=>{i.findAll(a).forEach(r=>{i.remove(r)})})}resetQueries(a,i){const r=this.#e;return Ot.batch(()=>(r.findAll(a).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...a},i)))}cancelQueries(a,i={}){const r={revert:!0,...i},s=Ot.batch(()=>this.#e.findAll(a).map(c=>c.cancel(r)));return Promise.all(s).then(Gt).catch(Gt)}invalidateQueries(a,i={}){return Ot.batch(()=>(this.#e.findAll(a).forEach(r=>{r.invalidate()}),a?.refetchType==="none"?Promise.resolve():this.refetchQueries({...a,type:a?.refetchType??a?.type??"active"},i)))}refetchQueries(a,i={}){const r={...i,cancelRefetch:i.cancelRefetch??!0},s=Ot.batch(()=>this.#e.findAll(a).filter(c=>!c.isDisabled()&&!c.isStatic()).map(c=>{let f=c.fetch(void 0,r);return r.throwOnError||(f=f.catch(Gt)),c.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(s).then(Gt)}fetchQuery(a){const i=this.defaultQueryOptions(a);i.retry===void 0&&(i.retry=!1);const r=this.#e.build(this,i);return r.isStaleByTime(ei(i.staleTime,r))?r.fetch(i):Promise.resolve(r.state.data)}prefetchQuery(a){return this.fetchQuery(a).then(Gt).catch(Gt)}fetchInfiniteQuery(a){return a.behavior=xp(a.pages),this.fetchQuery(a)}prefetchInfiniteQuery(a){return this.fetchInfiniteQuery(a).then(Gt).catch(Gt)}ensureInfiniteQueryData(a){return a.behavior=xp(a.pages),this.ensureQueryData(a)}resumePausedMutations(){return so.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(a){this.#n=a}setQueryDefaults(a,i){this.#i.set(zi(a),{queryKey:a,defaultOptions:i})}getQueryDefaults(a){const i=[...this.#i.values()],r={};return i.forEach(s=>{Er(a,s.queryKey)&&Object.assign(r,s.defaultOptions)}),r}setMutationDefaults(a,i){this.#a.set(zi(a),{mutationKey:a,defaultOptions:i})}getMutationDefaults(a){const i=[...this.#a.values()],r={};return i.forEach(s=>{Er(a,s.mutationKey)&&Object.assign(r,s.defaultOptions)}),r}defaultQueryOptions(a){if(a._defaulted)return a;const i={...this.#n.queries,...this.getQueryDefaults(a.queryKey),...a,_defaulted:!0};return i.queryHash||(i.queryHash=rf(i.queryKey,i)),i.refetchOnReconnect===void 0&&(i.refetchOnReconnect=i.networkMode!=="always"),i.throwOnError===void 0&&(i.throwOnError=!!i.suspense),!i.networkMode&&i.persister&&(i.networkMode="offlineFirst"),i.queryFn===sf&&(i.enabled=!1),i}defaultMutationOptions(a){return a?._defaulted?a:{...this.#n.mutations,...a?.mutationKey&&this.getMutationDefaults(a.mutationKey),...a,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Ry=R.createContext(void 0),ni=a=>{const i=R.useContext(Ry);if(!i)throw new Error("No QueryClient set, use QueryClientProvider to set one");return i},cb=({client:a,children:i})=>(R.useEffect(()=>(a.mount(),()=>{a.unmount()}),[a]),se.jsx(Ry.Provider,{value:a,children:i})),Ay=R.createContext(!1),fb=()=>R.useContext(Ay);Ay.Provider;function db(){let a=!1;return{clearReset:()=>{a=!1},reset:()=>{a=!0},isReset:()=>a}}var hb=R.createContext(db()),mb=()=>R.useContext(hb),pb=(a,i,r)=>{const s=r?.state.error&&typeof a.throwOnError=="function"?of(a.throwOnError,[r.state.error,r]):a.throwOnError;(a.suspense||a.experimental_prefetchInRender||s)&&(i.isReset()||(a.retryOnMount=!1))},yb=a=>{R.useEffect(()=>{a.clearReset()},[a])},gb=({result:a,errorResetBoundary:i,throwOnError:r,query:s,suspense:c})=>a.isError&&!i.isReset()&&!a.isFetching&&s&&(c&&a.data===void 0||of(r,[a.error,s])),vb=a=>{if(a.suspense){const r=c=>c==="static"?c:Math.max(c??1e3,1e3),s=a.staleTime;a.staleTime=typeof s=="function"?(...c)=>r(s(...c)):r(s),typeof a.gcTime=="number"&&(a.gcTime=Math.max(a.gcTime,1e3))}},bb=(a,i)=>a.isLoading&&a.isFetching&&!i,Sb=(a,i)=>a?.suspense&&i.isPending,Dp=(a,i,r)=>i.fetchOptimistic(a).catch(()=>{r.clearReset()});function Eb(a,i,r){const s=fb(),c=mb(),f=ni(),h=f.defaultQueryOptions(a);f.getDefaultOptions().queries?._experimental_beforeQuery?.(h);const m=f.getQueryCache().get(h.queryHash);h._optimisticResults=s?"isRestoring":"optimistic",vb(h),pb(h,c,m),yb(c);const g=!f.getQueryCache().get(h.queryHash),[y]=R.useState(()=>new i(f,h)),b=y.getOptimisticResult(h),p=!s&&a.subscribed!==!1;if(R.useSyncExternalStore(R.useCallback(w=>{const D=p?y.subscribe(Ot.batchCalls(w)):Gt;return y.updateResult(),D},[y,p]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),R.useEffect(()=>{y.setOptions(h)},[h,y]),Sb(h,b))throw Dp(h,y,c);if(gb({result:b,errorResetBoundary:c,throwOnError:h.throwOnError,query:m,suspense:h.suspense}))throw b.error;return f.getDefaultOptions().queries?._experimental_afterQuery?.(h,b),h.experimental_prefetchInRender&&!Ni&&bb(b,s)&&(g?Dp(h,y,c):m?.promise)?.catch(Gt).finally(()=>{y.updateResult()}),h.notifyOnChangeProps?b:y.trackResult(b)}function uo(a,i){return Eb(a,nb)}function Rr(a,i){const r=ni(),[s]=R.useState(()=>new sb(r,a));R.useEffect(()=>{s.setOptions(a)},[s,a]);const c=R.useSyncExternalStore(R.useCallback(h=>s.subscribe(Ot.batchCalls(h)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),f=R.useCallback((h,m)=>{s.mutate(h,m).catch(Gt)},[s]);if(c.error&&of(s.options.throwOnError,[c.error]))throw c.error;return{...c,mutate:f,mutateAsync:c.mutate}}var Cy=py();const Tb=my(Cy);function wb(a){if(typeof document>"u")return;let i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",i.appendChild(r),r.styleSheet?r.styleSheet.cssText=a:r.appendChild(document.createTextNode(a))}const _b=a=>{switch(a){case"success":return Cb;case"info":return xb;case"warning":return Ob;case"error":return Db;default:return null}},Rb=Array(12).fill(0),Ab=({visible:a,className:i})=>I.createElement("div",{className:["sonner-loading-wrapper",i].filter(Boolean).join(" "),"data-visible":a},I.createElement("div",{className:"sonner-spinner"},Rb.map((r,s)=>I.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),Cb=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.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"})),Ob=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},I.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"})),xb=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.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"})),Db=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.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"})),Mb=I.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"},I.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),I.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Nb=()=>{const[a,i]=I.useState(document.hidden);return I.useEffect(()=>{const r=()=>{i(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),a};let Kc=1;class zb{constructor(){this.subscribe=i=>(this.subscribers.push(i),()=>{const r=this.subscribers.indexOf(i);this.subscribers.splice(r,1)}),this.publish=i=>{this.subscribers.forEach(r=>r(i))},this.addToast=i=>{this.publish(i),this.toasts=[...this.toasts,i]},this.create=i=>{var r;const{message:s,...c}=i,f=typeof i?.id=="number"||((r=i.id)==null?void 0:r.length)>0?i.id:Kc++,h=this.toasts.find(g=>g.id===f),m=i.dismissible===void 0?!0:i.dismissible;return this.dismissedToasts.has(f)&&this.dismissedToasts.delete(f),h?this.toasts=this.toasts.map(g=>g.id===f?(this.publish({...g,...i,id:f,title:s}),{...g,...i,id:f,dismissible:m,title:s}):g):this.addToast({title:s,...c,dismissible:m,id:f}),f},this.dismiss=i=>(i?(this.dismissedToasts.add(i),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:i,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),i),this.message=(i,r)=>this.create({...r,message:i}),this.error=(i,r)=>this.create({...r,message:i,type:"error"}),this.success=(i,r)=>this.create({...r,type:"success",message:i}),this.info=(i,r)=>this.create({...r,type:"info",message:i}),this.warning=(i,r)=>this.create({...r,type:"warning",message:i}),this.loading=(i,r)=>this.create({...r,type:"loading",message:i}),this.promise=(i,r)=>{if(!r)return;let s;r.loading!==void 0&&(s=this.create({...r,promise:i,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const c=Promise.resolve(i instanceof Function?i():i);let f=s!==void 0,h;const m=c.then(async y=>{if(h=["resolve",y],I.isValidElement(y))f=!1,this.create({id:s,type:"default",message:y});else if(Lb(y)&&!y.ok){f=!1;const p=typeof r.error=="function"?await r.error(`HTTP error! status: ${y.status}`):r.error,w=typeof r.description=="function"?await r.description(`HTTP error! status: ${y.status}`):r.description,B=typeof p=="object"&&!I.isValidElement(p)?p:{message:p};this.create({id:s,type:"error",description:w,...B})}else if(y instanceof Error){f=!1;const p=typeof r.error=="function"?await r.error(y):r.error,w=typeof r.description=="function"?await r.description(y):r.description,B=typeof p=="object"&&!I.isValidElement(p)?p:{message:p};this.create({id:s,type:"error",description:w,...B})}else if(r.success!==void 0){f=!1;const p=typeof r.success=="function"?await r.success(y):r.success,w=typeof r.description=="function"?await r.description(y):r.description,B=typeof p=="object"&&!I.isValidElement(p)?p:{message:p};this.create({id:s,type:"success",description:w,...B})}}).catch(async y=>{if(h=["reject",y],r.error!==void 0){f=!1;const b=typeof r.error=="function"?await r.error(y):r.error,p=typeof r.description=="function"?await r.description(y):r.description,D=typeof b=="object"&&!I.isValidElement(b)?b:{message:b};this.create({id:s,type:"error",description:p,...D})}}).finally(()=>{f&&(this.dismiss(s),s=void 0),r.finally==null||r.finally.call(r)}),g=()=>new Promise((y,b)=>m.then(()=>h[0]==="reject"?b(h[1]):y(h[1])).catch(b));return typeof s!="string"&&typeof s!="number"?{unwrap:g}:Object.assign(s,{unwrap:g})},this.custom=(i,r)=>{const s=r?.id||Kc++;return this.create({jsx:i(s),id:s,...r}),s},this.getActiveToasts=()=>this.toasts.filter(i=>!this.dismissedToasts.has(i.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const tn=new zb,Ub=(a,i)=>{const r=i?.id||Kc++;return tn.addToast({title:a,...i,id:r}),r},Lb=a=>a&&typeof a=="object"&&"ok"in a&&typeof a.ok=="boolean"&&"status"in a&&typeof a.status=="number",Bb=Ub,jb=()=>tn.toasts,Hb=()=>tn.getActiveToasts(),qb=Object.assign(Bb,{success:tn.success,info:tn.info,warning:tn.warning,error:tn.error,custom:tn.custom,message:tn.message,promise:tn.promise,dismiss:tn.dismiss,loading:tn.loading},{getHistory:jb,getToasts:Hb});wb("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Vs(a){return a.label!==void 0}const kb=3,Qb="24px",Yb="16px",Mp=4e3,Vb=356,Gb=14,Kb=45,Xb=200;function $n(...a){return a.filter(Boolean).join(" ")}function Zb(a){const[i,r]=a.split("-"),s=[];return i&&s.push(i),r&&s.push(r),s}const Fb=a=>{var i,r,s,c,f,h,m,g,y;const{invert:b,toast:p,unstyled:w,interacting:D,setHeights:B,visibleToasts:q,heights:X,index:V,toasts:Z,expanded:$,removeToast:be,defaultRichColors:me,closeButton:ye,style:C,cancelButtonStyle:W,actionButtonStyle:ge,className:Oe="",descriptionClassName:Re="",duration:we,position:Le,gap:Ye,expandByDefault:Te,classNames:x,icons:K,closeButtonAriaLabel:J="Close toast"}=a,[fe,he]=I.useState(null),[T,j]=I.useState(null),[k,F]=I.useState(!1),[ee,ue]=I.useState(!1),[Ae,Ee]=I.useState(!1),[Ze,pn]=I.useState(!1),[zn,We]=I.useState(!1),[Un,Kt]=I.useState(0),[ri,Xt]=I.useState(0),ta=I.useRef(p.duration||we||Mp),si=I.useRef(null),Ht=I.useRef(null),oi=V===0,ui=V+1<=q,Mt=p.type,Kn=p.dismissible!==!1,ot=p.className||"",na=p.descriptionClassName||"",Xn=I.useMemo(()=>X.findIndex(Se=>Se.toastId===p.id)||0,[X,p.id]),Aa=I.useMemo(()=>{var Se;return(Se=p.closeButton)!=null?Se:ye},[p.closeButton,ye]),Nt=I.useMemo(()=>p.duration||we||Mp,[p.duration,we]),Yt=I.useRef(0),yn=I.useRef(0),Li=I.useRef(0),gn=I.useRef(null),[aa,at]=Le.split("-"),Zt=I.useMemo(()=>X.reduce((Se,tt,pt)=>pt>=Xn?Se:Se+tt.height,0),[X,Xn]),At=Nb(),Bi=p.invert||b,ci=Mt==="loading";yn.current=I.useMemo(()=>Xn*Ye+Zt,[Xn,Zt]),I.useEffect(()=>{ta.current=Nt},[Nt]),I.useEffect(()=>{F(!0)},[]),I.useEffect(()=>{const Se=Ht.current;if(Se){const tt=Se.getBoundingClientRect().height;return Xt(tt),B(pt=>[{toastId:p.id,height:tt,position:p.position},...pt]),()=>B(pt=>pt.filter(yt=>yt.toastId!==p.id))}},[B,p.id]),I.useLayoutEffect(()=>{if(!k)return;const Se=Ht.current,tt=Se.style.height;Se.style.height="auto";const pt=Se.getBoundingClientRect().height;Se.style.height=tt,Xt(pt),B(yt=>yt.find(nt=>nt.toastId===p.id)?yt.map(nt=>nt.toastId===p.id?{...nt,height:pt}:nt):[{toastId:p.id,height:pt,position:p.position},...yt])},[k,p.title,p.description,B,p.id,p.jsx,p.action,p.cancel]);const nn=I.useCallback(()=>{ue(!0),Kt(yn.current),B(Se=>Se.filter(tt=>tt.toastId!==p.id)),setTimeout(()=>{be(p)},Xb)},[p,be,B,yn]);I.useEffect(()=>{if(p.promise&&Mt==="loading"||p.duration===1/0||p.type==="loading")return;let Se;return $||D||At?(()=>{if(Li.current<Yt.current){const yt=new Date().getTime()-Yt.current;ta.current=ta.current-yt}Li.current=new Date().getTime()})():ta.current!==1/0&&(Yt.current=new Date().getTime(),Se=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),nn()},ta.current)),()=>clearTimeout(Se)},[$,D,p,Mt,At,nn]),I.useEffect(()=>{p.delete&&(nn(),p.onDismiss==null||p.onDismiss.call(p,p))},[nn,p.delete]);function Ln(){var Se;if(K?.loading){var tt;return I.createElement("div",{className:$n(x?.loader,p==null||(tt=p.classNames)==null?void 0:tt.loader,"sonner-loader"),"data-visible":Mt==="loading"},K.loading)}return I.createElement(Ab,{className:$n(x?.loader,p==null||(Se=p.classNames)==null?void 0:Se.loader),visible:Mt==="loading"})}const ia=p.icon||K?.[Mt]||_b(Mt);var Bn,vn;return I.createElement("li",{tabIndex:0,ref:Ht,className:$n(Oe,ot,x?.toast,p==null||(i=p.classNames)==null?void 0:i.toast,x?.default,x?.[Mt],p==null||(r=p.classNames)==null?void 0:r[Mt]),"data-sonner-toast":"","data-rich-colors":(Bn=p.richColors)!=null?Bn:me,"data-styled":!(p.jsx||p.unstyled||w),"data-mounted":k,"data-promise":!!p.promise,"data-swiped":zn,"data-removed":ee,"data-visible":ui,"data-y-position":aa,"data-x-position":at,"data-index":V,"data-front":oi,"data-swiping":Ae,"data-dismissible":Kn,"data-type":Mt,"data-invert":Bi,"data-swipe-out":Ze,"data-swipe-direction":T,"data-expanded":!!($||Te&&k),"data-testid":p.testId,style:{"--index":V,"--toasts-before":V,"--z-index":Z.length-V,"--offset":`${ee?Un:yn.current}px`,"--initial-height":Te?"auto":`${ri}px`,...C,...p.style},onDragEnd:()=>{Ee(!1),he(null),gn.current=null},onPointerDown:Se=>{Se.button!==2&&(ci||!Kn||(si.current=new Date,Kt(yn.current),Se.target.setPointerCapture(Se.pointerId),Se.target.tagName!=="BUTTON"&&(Ee(!0),gn.current={x:Se.clientX,y:Se.clientY})))},onPointerUp:()=>{var Se,tt,pt;if(Ze||!Kn)return;gn.current=null;const yt=Number(((Se=Ht.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),an=Number(((tt=Ht.current)==null?void 0:tt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),nt=new Date().getTime()-((pt=si.current)==null?void 0:pt.getTime()),qt=fe==="x"?yt:an,la=Math.abs(qt)/nt;if(Math.abs(qt)>=Kb||la>.11){Kt(yn.current),p.onDismiss==null||p.onDismiss.call(p,p),j(fe==="x"?yt>0?"right":"left":an>0?"down":"up"),nn(),pn(!0);return}else{var S,A;(S=Ht.current)==null||S.style.setProperty("--swipe-amount-x","0px"),(A=Ht.current)==null||A.style.setProperty("--swipe-amount-y","0px")}We(!1),Ee(!1),he(null)},onPointerMove:Se=>{var tt,pt,yt;if(!gn.current||!Kn||((tt=window.getSelection())==null?void 0:tt.toString().length)>0)return;const nt=Se.clientY-gn.current.y,qt=Se.clientX-gn.current.x;var la;const S=(la=a.swipeDirections)!=null?la:Zb(Le);!fe&&(Math.abs(qt)>1||Math.abs(nt)>1)&&he(Math.abs(qt)>Math.abs(nt)?"x":"y");let A={x:0,y:0};const U=G=>1/(1.5+Math.abs(G)/20);if(fe==="y"){if(S.includes("top")||S.includes("bottom"))if(S.includes("top")&&nt<0||S.includes("bottom")&&nt>0)A.y=nt;else{const G=nt*U(nt);A.y=Math.abs(G)<Math.abs(nt)?G:nt}}else if(fe==="x"&&(S.includes("left")||S.includes("right")))if(S.includes("left")&&qt<0||S.includes("right")&&qt>0)A.x=qt;else{const G=qt*U(qt);A.x=Math.abs(G)<Math.abs(qt)?G:qt}(Math.abs(A.x)>0||Math.abs(A.y)>0)&&We(!0),(pt=Ht.current)==null||pt.style.setProperty("--swipe-amount-x",`${A.x}px`),(yt=Ht.current)==null||yt.style.setProperty("--swipe-amount-y",`${A.y}px`)}},Aa&&!p.jsx&&Mt!=="loading"?I.createElement("button",{"aria-label":J,"data-disabled":ci,"data-close-button":!0,onClick:ci||!Kn?()=>{}:()=>{nn(),p.onDismiss==null||p.onDismiss.call(p,p)},className:$n(x?.closeButton,p==null||(s=p.classNames)==null?void 0:s.closeButton)},(vn=K?.close)!=null?vn:Mb):null,(Mt||p.icon||p.promise)&&p.icon!==null&&(K?.[Mt]!==null||p.icon)?I.createElement("div",{"data-icon":"",className:$n(x?.icon,p==null||(c=p.classNames)==null?void 0:c.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Ln():null,p.type!=="loading"?ia:null):null,I.createElement("div",{"data-content":"",className:$n(x?.content,p==null||(f=p.classNames)==null?void 0:f.content)},I.createElement("div",{"data-title":"",className:$n(x?.title,p==null||(h=p.classNames)==null?void 0:h.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?I.createElement("div",{"data-description":"",className:$n(Re,na,x?.description,p==null||(m=p.classNames)==null?void 0:m.description)},typeof p.description=="function"?p.description():p.description):null),I.isValidElement(p.cancel)?p.cancel:p.cancel&&Vs(p.cancel)?I.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||W,onClick:Se=>{Vs(p.cancel)&&Kn&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Se),nn())},className:$n(x?.cancelButton,p==null||(g=p.classNames)==null?void 0:g.cancelButton)},p.cancel.label):null,I.isValidElement(p.action)?p.action:p.action&&Vs(p.action)?I.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||ge,onClick:Se=>{Vs(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Se),!Se.defaultPrevented&&nn())},className:$n(x?.actionButton,p==null||(y=p.classNames)==null?void 0:y.actionButton)},p.action.label):null)};function Np(){if(typeof window>"u"||typeof document>"u")return"ltr";const a=document.documentElement.getAttribute("dir");return a==="auto"||!a?window.getComputedStyle(document.documentElement).direction:a}function Jb(a,i){const r={};return[a,i].forEach((s,c)=>{const f=c===1,h=f?"--mobile-offset":"--offset",m=f?Yb:Qb;function g(y){["top","right","bottom","left"].forEach(b=>{r[`${h}-${b}`]=typeof y=="number"?`${y}px`:y})}typeof s=="number"||typeof s=="string"?g(s):typeof s=="object"?["top","right","bottom","left"].forEach(y=>{s[y]===void 0?r[`${h}-${y}`]=m:r[`${h}-${y}`]=typeof s[y]=="number"?`${s[y]}px`:s[y]}):g(m)}),r}const Pb=I.forwardRef(function(i,r){const{id:s,invert:c,position:f="bottom-right",hotkey:h=["altKey","KeyT"],expand:m,closeButton:g,className:y,offset:b,mobileOffset:p,theme:w="light",richColors:D,duration:B,style:q,visibleToasts:X=kb,toastOptions:V,dir:Z=Np(),gap:$=Gb,icons:be,containerAriaLabel:me="Notifications"}=i,[ye,C]=I.useState([]),W=I.useMemo(()=>s?ye.filter(k=>k.toasterId===s):ye.filter(k=>!k.toasterId),[ye,s]),ge=I.useMemo(()=>Array.from(new Set([f].concat(W.filter(k=>k.position).map(k=>k.position)))),[W,f]),[Oe,Re]=I.useState([]),[we,Le]=I.useState(!1),[Ye,Te]=I.useState(!1),[x,K]=I.useState(w!=="system"?w:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),J=I.useRef(null),fe=h.join("+").replace(/Key/g,"").replace(/Digit/g,""),he=I.useRef(null),T=I.useRef(!1),j=I.useCallback(k=>{C(F=>{var ee;return(ee=F.find(ue=>ue.id===k.id))!=null&&ee.delete||tn.dismiss(k.id),F.filter(({id:ue})=>ue!==k.id)})},[]);return I.useEffect(()=>tn.subscribe(k=>{if(k.dismiss){requestAnimationFrame(()=>{C(F=>F.map(ee=>ee.id===k.id?{...ee,delete:!0}:ee))});return}setTimeout(()=>{Tb.flushSync(()=>{C(F=>{const ee=F.findIndex(ue=>ue.id===k.id);return ee!==-1?[...F.slice(0,ee),{...F[ee],...k},...F.slice(ee+1)]:[k,...F]})})})}),[ye]),I.useEffect(()=>{if(w!=="system"){K(w);return}if(w==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?K("dark"):K("light")),typeof window>"u")return;const k=window.matchMedia("(prefers-color-scheme: dark)");try{k.addEventListener("change",({matches:F})=>{K(F?"dark":"light")})}catch{k.addListener(({matches:ee})=>{try{K(ee?"dark":"light")}catch(ue){console.error(ue)}})}},[w]),I.useEffect(()=>{ye.length<=1&&Le(!1)},[ye]),I.useEffect(()=>{const k=F=>{var ee;if(h.every(Ee=>F[Ee]||F.code===Ee)){var Ae;Le(!0),(Ae=J.current)==null||Ae.focus()}F.code==="Escape"&&(document.activeElement===J.current||(ee=J.current)!=null&&ee.contains(document.activeElement))&&Le(!1)};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[h]),I.useEffect(()=>{if(J.current)return()=>{he.current&&(he.current.focus({preventScroll:!0}),he.current=null,T.current=!1)}},[J.current]),I.createElement("section",{ref:r,"aria-label":`${me} ${fe}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},ge.map((k,F)=>{var ee;const[ue,Ae]=k.split("-");return W.length?I.createElement("ol",{key:k,dir:Z==="auto"?Np():Z,tabIndex:-1,ref:J,className:y,"data-sonner-toaster":!0,"data-sonner-theme":x,"data-y-position":ue,"data-x-position":Ae,style:{"--front-toast-height":`${((ee=Oe[0])==null?void 0:ee.height)||0}px`,"--width":`${Vb}px`,"--gap":`${$}px`,...q,...Jb(b,p)},onBlur:Ee=>{T.current&&!Ee.currentTarget.contains(Ee.relatedTarget)&&(T.current=!1,he.current&&(he.current.focus({preventScroll:!0}),he.current=null))},onFocus:Ee=>{Ee.target instanceof HTMLElement&&Ee.target.dataset.dismissible==="false"||T.current||(T.current=!0,he.current=Ee.relatedTarget)},onMouseEnter:()=>Le(!0),onMouseMove:()=>Le(!0),onMouseLeave:()=>{Ye||Le(!1)},onDragEnd:()=>Le(!1),onPointerDown:Ee=>{Ee.target instanceof HTMLElement&&Ee.target.dataset.dismissible==="false"||Te(!0)},onPointerUp:()=>Te(!1)},W.filter(Ee=>!Ee.position&&F===0||Ee.position===k).map((Ee,Ze)=>{var pn,zn;return I.createElement(Fb,{key:Ee.id,icons:be,index:Ze,toast:Ee,defaultRichColors:D,duration:(pn=V?.duration)!=null?pn:B,className:V?.className,descriptionClassName:V?.descriptionClassName,invert:c,visibleToasts:X,closeButton:(zn=V?.closeButton)!=null?zn:g,interacting:Ye,position:k,style:V?.style,unstyled:V?.unstyled,classNames:V?.classNames,cancelButtonStyle:V?.cancelButtonStyle,actionButtonStyle:V?.actionButtonStyle,closeButtonAriaLabel:V?.closeButtonAriaLabel,removeToast:j,toasts:W.filter(We=>We.position==Ee.position),heights:Oe.filter(We=>We.position==Ee.position),setHeights:Re,expandByDefault:m,gap:$,expanded:we,swipeDirections:i.swipeDirections})})):null}))}),$b=new ub({defaultOptions:{queries:{staleTime:1e3*60,retry:1}}}),Ib="modulepreload",Wb=function(a){return"/"+a},zp={},ai=function(i,r,s){let c=Promise.resolve();if(r&&r.length>0){let g=function(y){return Promise.all(y.map(b=>Promise.resolve(b).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const h=document.querySelector("meta[property=csp-nonce]"),m=h?.nonce||h?.getAttribute("nonce");c=g(r.map(y=>{if(y=Wb(y),y in zp)return;zp[y]=!0;const b=y.endsWith(".css"),p=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${p}`))return;const w=document.createElement("link");if(w.rel=b?"stylesheet":Ib,b||(w.as="script"),w.crossOrigin="",w.href=y,m&&w.setAttribute("nonce",m),document.head.appendChild(w),b)return new Promise((D,B)=>{w.addEventListener("load",D),w.addEventListener("error",()=>B(new Error(`Unable to preload CSS for ${y}`)))})}))}function f(h){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=h,window.dispatchEvent(m),!m.defaultPrevented)throw h}return c.then(h=>{for(const m of h||[])m.status==="rejected"&&f(m.reason);return i().catch(f)})};var Oy=a=>{throw TypeError(a)},eS=(a,i,r)=>i.has(a)||Oy("Cannot "+r),xc=(a,i,r)=>(eS(a,i,"read from private field"),r?r.call(a):i.get(a)),tS=(a,i,r)=>i.has(a)?Oy("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(a):i.set(a,r),Up="popstate";function nS(a={}){function i(s,c){let{pathname:f,search:h,hash:m}=s.location;return Tr("",{pathname:f,search:h,hash:m},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function r(s,c){return typeof c=="string"?c:Wn(c)}return iS(i,r,null,a)}function De(a,i){if(a===!1||a===null||typeof a>"u")throw new Error(i)}function St(a,i){if(!a){typeof console<"u"&&console.warn(i);try{throw new Error(i)}catch{}}}function aS(){return Math.random().toString(36).substring(2,10)}function Lp(a,i){return{usr:a.state,key:a.key,idx:i}}function Tr(a,i,r=null,s){return{pathname:typeof a=="string"?a:a.pathname,search:"",hash:"",...typeof i=="string"?ii(i):i,state:r,key:i&&i.key||s||aS()}}function Wn({pathname:a="/",search:i="",hash:r=""}){return i&&i!=="?"&&(a+=i.charAt(0)==="?"?i:"?"+i),r&&r!=="#"&&(a+=r.charAt(0)==="#"?r:"#"+r),a}function ii(a){let i={};if(a){let r=a.indexOf("#");r>=0&&(i.hash=a.substring(r),a=a.substring(0,r));let s=a.indexOf("?");s>=0&&(i.search=a.substring(s),a=a.substring(0,s)),a&&(i.pathname=a)}return i}function iS(a,i,r,s={}){let{window:c=document.defaultView,v5Compat:f=!1}=s,h=c.history,m="POP",g=null,y=b();y==null&&(y=0,h.replaceState({...h.state,idx:y},""));function b(){return(h.state||{idx:null}).idx}function p(){m="POP";let X=b(),V=X==null?null:X-y;y=X,g&&g({action:m,location:q.location,delta:V})}function w(X,V){m="PUSH";let Z=Tr(q.location,X,V);y=b()+1;let $=Lp(Z,y),be=q.createHref(Z);try{h.pushState($,"",be)}catch(me){if(me instanceof DOMException&&me.name==="DataCloneError")throw me;c.location.assign(be)}f&&g&&g({action:m,location:q.location,delta:1})}function D(X,V){m="REPLACE";let Z=Tr(q.location,X,V);y=b();let $=Lp(Z,y),be=q.createHref(Z);h.replaceState($,"",be),f&&g&&g({action:m,location:q.location,delta:0})}function B(X){return xy(X)}let q={get action(){return m},get location(){return a(c,h)},listen(X){if(g)throw new Error("A history only accepts one active listener");return c.addEventListener(Up,p),g=X,()=>{c.removeEventListener(Up,p),g=null}},createHref(X){return i(c,X)},createURL:B,encodeLocation(X){let V=B(X);return{pathname:V.pathname,search:V.search,hash:V.hash}},push:w,replace:D,go(X){return h.go(X)}};return q}function xy(a,i=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),De(r,"No window.location.(origin|href) available to create URL");let s=typeof a=="string"?a:Wn(a);return s=s.replace(/ $/,"%20"),!i&&s.startsWith("//")&&(s=r+s),new URL(s,r)}var gr,Bp=class{constructor(a){if(tS(this,gr,new Map),a)for(let[i,r]of a)this.set(i,r)}get(a){if(xc(this,gr).has(a))return xc(this,gr).get(a);if(a.defaultValue!==void 0)return a.defaultValue;throw new Error("No value found for context")}set(a,i){xc(this,gr).set(a,i)}};gr=new WeakMap;var lS=new Set(["lazy","caseSensitive","path","id","index","children"]);function rS(a){return lS.has(a)}var sS=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function oS(a){return sS.has(a)}function uS(a){return a.index===!0}function wr(a,i,r=[],s={},c=!1){return a.map((f,h)=>{let m=[...r,String(h)],g=typeof f.id=="string"?f.id:m.join("-");if(De(f.index!==!0||!f.children,"Cannot specify children on an index route"),De(c||!s[g],`Found a route id collision on id "${g}". Route id's must be globally unique within Data Router usages`),uS(f)){let y={...f,id:g};return s[g]=jp(y,i(y)),y}else{let y={...f,id:g,children:void 0};return s[g]=jp(y,i(y)),f.children&&(y.children=wr(f.children,i,m,s,c)),y}})}function jp(a,i){return Object.assign(a,{...i,...typeof i.lazy=="object"&&i.lazy!=null?{lazy:{...a.lazy,...i.lazy}}:{}})}function $a(a,i,r="/"){return vr(a,i,r,!1)}function vr(a,i,r,s){let c=typeof i=="string"?ii(i):i,f=Nn(c.pathname||"/",r);if(f==null)return null;let h=Dy(a);fS(h);let m=null;for(let g=0;m==null&&g<h.length;++g){let y=TS(f);m=SS(h[g],y,s)}return m}function cS(a,i){let{route:r,pathname:s,params:c}=a;return{id:r.id,pathname:s,params:c,data:i[r.id],loaderData:i[r.id],handle:r.handle}}function Dy(a,i=[],r=[],s="",c=!1){let f=(h,m,g=c,y)=>{let b={relativePath:y===void 0?h.path||"":y,caseSensitive:h.caseSensitive===!0,childrenIndex:m,route:h};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(s)&&g)return;De(b.relativePath.startsWith(s),`Absolute route path "${b.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(s.length)}let p=In([s,b.relativePath]),w=r.concat(b);h.children&&h.children.length>0&&(De(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),Dy(h.children,i,w,p,g)),!(h.path==null&&!h.index)&&i.push({path:p,score:vS(p,h.index),routesMeta:w})};return a.forEach((h,m)=>{if(h.path===""||!h.path?.includes("?"))f(h,m);else for(let g of My(h.path))f(h,m,!0,g)}),i}function My(a){let i=a.split("/");if(i.length===0)return[];let[r,...s]=i,c=r.endsWith("?"),f=r.replace(/\?$/,"");if(s.length===0)return c?[f,""]:[f];let h=My(s.join("/")),m=[];return m.push(...h.map(g=>g===""?f:[f,g].join("/"))),c&&m.push(...h),m.map(g=>a.startsWith("/")&&g===""?"/":g)}function fS(a){a.sort((i,r)=>i.score!==r.score?r.score-i.score:bS(i.routesMeta.map(s=>s.childrenIndex),r.routesMeta.map(s=>s.childrenIndex)))}var dS=/^:[\w-]+$/,hS=3,mS=2,pS=1,yS=10,gS=-2,Hp=a=>a==="*";function vS(a,i){let r=a.split("/"),s=r.length;return r.some(Hp)&&(s+=gS),i&&(s+=mS),r.filter(c=>!Hp(c)).reduce((c,f)=>c+(dS.test(f)?hS:f===""?pS:yS),s)}function bS(a,i){return a.length===i.length&&a.slice(0,-1).every((s,c)=>s===i[c])?a[a.length-1]-i[i.length-1]:0}function SS(a,i,r=!1){let{routesMeta:s}=a,c={},f="/",h=[];for(let m=0;m<s.length;++m){let g=s[m],y=m===s.length-1,b=f==="/"?i:i.slice(f.length)||"/",p=oo({path:g.relativePath,caseSensitive:g.caseSensitive,end:y},b),w=g.route;if(!p&&y&&r&&!s[s.length-1].route.index&&(p=oo({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},b)),!p)return null;Object.assign(c,p.params),h.push({params:c,pathname:In([f,p.pathname]),pathnameBase:RS(In([f,p.pathnameBase])),route:w}),p.pathnameBase!=="/"&&(f=In([f,p.pathnameBase]))}return h}function oo(a,i){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[r,s]=ES(a.path,a.caseSensitive,a.end),c=i.match(r);if(!c)return null;let f=c[0],h=f.replace(/(.)\/+$/,"$1"),m=c.slice(1);return{params:s.reduce((y,{paramName:b,isOptional:p},w)=>{if(b==="*"){let B=m[w]||"";h=f.slice(0,f.length-B.length).replace(/(.)\/+$/,"$1")}const D=m[w];return p&&!D?y[b]=void 0:y[b]=(D||"").replace(/%2F/g,"/"),y},{}),pathname:f,pathnameBase:h,pattern:a}}function ES(a,i=!1,r=!0){St(a==="*"||!a.endsWith("*")||a.endsWith("/*"),`Route path "${a}" will be treated as if it were "${a.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${a.replace(/\*$/,"/*")}".`);let s=[],c="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,m,g)=>(s.push({paramName:m,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return a.endsWith("*")?(s.push({paramName:"*"}),c+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?c+="\\/*$":a!==""&&a!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,i?void 0:"i"),s]}function TS(a){try{return a.split("/").map(i=>decodeURIComponent(i).replace(/\//g,"%2F")).join("/")}catch(i){return St(!1,`The URL path "${a}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${i}).`),a}}function Nn(a,i){if(i==="/")return a;if(!a.toLowerCase().startsWith(i.toLowerCase()))return null;let r=i.endsWith("/")?i.length-1:i.length,s=a.charAt(r);return s&&s!=="/"?null:a.slice(r)||"/"}function wS({basename:a,pathname:i}){return i==="/"?a:In([a,i])}var Ny=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ff=a=>Ny.test(a);function _S(a,i="/"){let{pathname:r,search:s="",hash:c=""}=typeof a=="string"?ii(a):a,f;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?f=qp(r.substring(1),"/"):f=qp(r,i)):f=i,{pathname:f,search:AS(s),hash:CS(c)}}function qp(a,i){let r=i.replace(/\/+$/,"").split("/");return a.split("/").forEach(c=>{c===".."?r.length>1&&r.pop():c!=="."&&r.push(c)}),r.length>1?r.join("/"):"/"}function Dc(a,i,r,s){return`Cannot include a '${a}' character in a manually specified \`to.${i}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function zy(a){return a.filter((i,r)=>r===0||i.route.path&&i.route.path.length>0)}function co(a){let i=zy(a);return i.map((r,s)=>s===i.length-1?r.pathname:r.pathnameBase)}function fo(a,i,r,s=!1){let c;typeof a=="string"?c=ii(a):(c={...a},De(!c.pathname||!c.pathname.includes("?"),Dc("?","pathname","search",c)),De(!c.pathname||!c.pathname.includes("#"),Dc("#","pathname","hash",c)),De(!c.search||!c.search.includes("#"),Dc("#","search","hash",c)));let f=a===""||c.pathname==="",h=f?"/":c.pathname,m;if(h==null)m=r;else{let p=i.length-1;if(!s&&h.startsWith("..")){let w=h.split("/");for(;w[0]==="..";)w.shift(),p-=1;c.pathname=w.join("/")}m=p>=0?i[p]:"/"}let g=_S(c,m),y=h&&h!=="/"&&h.endsWith("/"),b=(f||h===".")&&r.endsWith("/");return!g.pathname.endsWith("/")&&(y||b)&&(g.pathname+="/"),g}var In=a=>a.join("/").replace(/\/\/+/g,"/"),RS=a=>a.replace(/\/+$/,"").replace(/^\/*/,"/"),AS=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,CS=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a,Ar=class{constructor(a,i,r,s=!1){this.status=a,this.statusText=i||"",this.internal=s,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function _r(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}function Cr(a){return a.map(i=>i.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Uy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ly(a,i){let r=a;if(typeof r!="string"||!Ny.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let s=r,c=!1;if(Uy)try{let f=new URL(window.location.href),h=r.startsWith("//")?new URL(f.protocol+r):new URL(r),m=Nn(h.pathname,i);h.origin===f.origin&&m!=null?r=m+h.search+h.hash:c=!0}catch{St(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:c,to:r}}var Wa=Symbol("Uninstrumented");function OS(a,i){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};a.forEach(c=>c({id:i.id,index:i.index,path:i.path,instrument(f){let h=Object.keys(r);for(let m of h)f[m]&&r[m].push(f[m])}}));let s={};if(typeof i.lazy=="function"&&r.lazy.length>0){let c=gl(r.lazy,i.lazy,()=>{});c&&(s.lazy=c)}if(typeof i.lazy=="object"){let c=i.lazy;["middleware","loader","action"].forEach(f=>{let h=c[f],m=r[`lazy.${f}`];if(typeof h=="function"&&m.length>0){let g=gl(m,h,()=>{});g&&(s.lazy=Object.assign(s.lazy||{},{[f]:g}))}})}return["loader","action"].forEach(c=>{let f=i[c];if(typeof f=="function"&&r[c].length>0){let h=f[Wa]??f,m=gl(r[c],h,(...g)=>kp(g[0]));m&&(c==="loader"&&h.hydrate===!0&&(m.hydrate=!0),m[Wa]=h,s[c]=m)}}),i.middleware&&i.middleware.length>0&&r.middleware.length>0&&(s.middleware=i.middleware.map(c=>{let f=c[Wa]??c,h=gl(r.middleware,f,(...m)=>kp(m[0]));return h?(h[Wa]=f,h):c})),s}function xS(a,i){let r={navigate:[],fetch:[]};if(i.forEach(s=>s({instrument(c){let f=Object.keys(c);for(let h of f)c[h]&&r[h].push(c[h])}})),r.navigate.length>0){let s=a.navigate[Wa]??a.navigate,c=gl(r.navigate,s,(...f)=>{let[h,m]=f;return{to:typeof h=="number"||typeof h=="string"?h:h?Wn(h):".",...Qp(a,m??{})}});c&&(c[Wa]=s,a.navigate=c)}if(r.fetch.length>0){let s=a.fetch[Wa]??a.fetch,c=gl(r.fetch,s,(...f)=>{let[h,,m,g]=f;return{href:m??".",fetcherKey:h,...Qp(a,g??{})}});c&&(c[Wa]=s,a.fetch=c)}return a}function gl(a,i,r){return a.length===0?null:async(...s)=>{let c=await By(a,r(...s),()=>i(...s),a.length-1);if(c.type==="error")throw c.value;return c.value}}async function By(a,i,r,s){let c=a[s],f;if(c){let h,m=async()=>(h?console.error("You cannot call instrumented handlers more than once"):h=By(a,i,r,s-1),f=await h,De(f,"Expected a result"),f.type==="error"&&f.value instanceof Error?{status:"error",error:f.value}:{status:"success",error:void 0});try{await c(m,i)}catch(g){console.error("An instrumentation function threw an error:",g)}h||await m(),await h}else try{f={type:"success",value:await r()}}catch(h){f={type:"error",value:h}}return f||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function kp(a){let{request:i,context:r,params:s,unstable_pattern:c}=a;return{request:DS(i),params:{...s},unstable_pattern:c,context:MS(r)}}function Qp(a,i){return{currentUrl:Wn(a.state.location),..."formMethod"in i?{formMethod:i.formMethod}:{},..."formEncType"in i?{formEncType:i.formEncType}:{},..."formData"in i?{formData:i.formData}:{},..."body"in i?{body:i.body}:{}}}function DS(a){return{method:a.method,url:a.url,headers:{get:(...i)=>a.headers.get(...i)}}}function MS(a){if(zS(a)){let i={...a};return Object.freeze(i),i}else return{get:i=>a.get(i)}}var NS=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function zS(a){if(a===null||typeof a!="object")return!1;const i=Object.getPrototypeOf(a);return i===Object.prototype||i===null||Object.getOwnPropertyNames(i).sort().join("\0")===NS}var jy=["POST","PUT","PATCH","DELETE"],US=new Set(jy),LS=["GET",...jy],BS=new Set(LS),Hy=new Set([301,302,303,307,308]),jS=new Set([307,308]),Mc={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},HS={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},hr={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},qS=a=>({hasErrorBoundary:!!a.hasErrorBoundary}),qy="remix-router-transitions",ky=Symbol("ResetLoaderData");function kS(a){const i=a.window?a.window:typeof window<"u"?window:void 0,r=typeof i<"u"&&typeof i.document<"u"&&typeof i.document.createElement<"u";De(a.routes.length>0,"You must provide a non-empty routes array to createRouter");let s=a.hydrationRouteProperties||[],c=a.mapRouteProperties||qS,f=c;if(a.unstable_instrumentations){let S=a.unstable_instrumentations;f=A=>({...c(A),...OS(S.map(U=>U.route).filter(Boolean),A)})}let h={},m=wr(a.routes,f,void 0,h),g,y=a.basename||"/";y.startsWith("/")||(y=`/${y}`);let b=a.dataStrategy||KS,p={...a.future},w=null,D=new Set,B=null,q=null,X=null,V=a.hydrationData!=null,Z=$a(m,a.history.location,y),$=!1,be=null,me;if(Z==null&&!a.patchRoutesOnNavigation){let S=xn(404,{pathname:a.history.location.pathname}),{matches:A,route:U}=Gs(m);me=!0,Z=A,be={[U.id]:S}}else if(Z&&!a.hydrationData&&yt(Z,m,a.history.location.pathname).active&&(Z=null),Z)if(Z.some(S=>S.route.lazy))me=!1;else if(!Z.some(S=>df(S.route)))me=!0;else{let S=a.hydrationData?a.hydrationData.loaderData:null,A=a.hydrationData?a.hydrationData.errors:null;if(A){let U=Z.findIndex(G=>A[G.route.id]!==void 0);me=Z.slice(0,U+1).every(G=>!Zc(G.route,S,A))}else me=Z.every(U=>!Zc(U.route,S,A))}else{me=!1,Z=[];let S=yt(null,m,a.history.location.pathname);S.active&&S.matches&&($=!0,Z=S.matches)}let ye,C={historyAction:a.history.action,location:a.history.location,matches:Z,initialized:me,navigation:Mc,restoreScrollPosition:a.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:a.hydrationData&&a.hydrationData.loaderData||{},actionData:a.hydrationData&&a.hydrationData.actionData||null,errors:a.hydrationData&&a.hydrationData.errors||be,fetchers:new Map,blockers:new Map},W="POP",ge=null,Oe=!1,Re,we=!1,Le=new Map,Ye=null,Te=!1,x=!1,K=new Set,J=new Map,fe=0,he=-1,T=new Map,j=new Set,k=new Map,F=new Map,ee=new Set,ue=new Map,Ae,Ee=null;function Ze(){if(w=a.history.listen(({action:S,location:A,delta:U})=>{if(Ae){Ae(),Ae=void 0;return}St(ue.size===0||U!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let G=ia({currentLocation:C.location,nextLocation:A,historyAction:S});if(G&&U!=null){let P=new Promise(oe=>{Ae=oe});a.history.go(U*-1),Ln(G,{state:"blocked",location:A,proceed(){Ln(G,{state:"proceeding",proceed:void 0,reset:void 0,location:A}),P.then(()=>a.history.go(U))},reset(){let oe=new Map(C.blockers);oe.set(G,hr),We({blockers:oe})}}),ge?.resolve(),ge=null;return}return Xt(S,A)}),r){u1(i,Le);let S=()=>c1(i,Le);i.addEventListener("pagehide",S),Ye=()=>i.removeEventListener("pagehide",S)}return C.initialized||Xt("POP",C.location,{initialHydration:!0}),ye}function pn(){w&&w(),Ye&&Ye(),D.clear(),Re&&Re.abort(),C.fetchers.forEach((S,A)=>gn(A)),C.blockers.forEach((S,A)=>nn(A))}function zn(S){return D.add(S),()=>D.delete(S)}function We(S,A={}){S.matches&&(S.matches=S.matches.map(P=>{let oe=h[P.route.id],ne=P.route;return ne.element!==oe.element||ne.errorElement!==oe.errorElement||ne.hydrateFallbackElement!==oe.hydrateFallbackElement?{...P,route:oe}:P})),C={...C,...S};let U=[],G=[];C.fetchers.forEach((P,oe)=>{P.state==="idle"&&(ee.has(oe)?U.push(oe):G.push(oe))}),ee.forEach(P=>{!C.fetchers.has(P)&&!J.has(P)&&U.push(P)}),[...D].forEach(P=>P(C,{deletedFetchers:U,newErrors:S.errors??null,viewTransitionOpts:A.viewTransitionOpts,flushSync:A.flushSync===!0})),U.forEach(P=>gn(P)),G.forEach(P=>C.fetchers.delete(P))}function Un(S,A,{flushSync:U}={}){let G=C.actionData!=null&&C.navigation.formMethod!=null&&Qt(C.navigation.formMethod)&&C.navigation.state==="loading"&&S.state?._isRedirect!==!0,P;A.actionData?Object.keys(A.actionData).length>0?P=A.actionData:P=null:G?P=C.actionData:P=null;let oe=A.loaderData?$p(C.loaderData,A.loaderData,A.matches||[],A.errors):C.loaderData,ne=C.blockers;ne.size>0&&(ne=new Map(ne),ne.forEach((pe,ce)=>ne.set(ce,hr)));let te=Te?!1:pt(S,A.matches||C.matches),ae=Oe===!0||C.navigation.formMethod!=null&&Qt(C.navigation.formMethod)&&S.state?._isRedirect!==!0;g&&(m=g,g=void 0),Te||W==="POP"||(W==="PUSH"?a.history.push(S,S.state):W==="REPLACE"&&a.history.replace(S,S.state));let re;if(W==="POP"){let pe=Le.get(C.location.pathname);pe&&pe.has(S.pathname)?re={currentLocation:C.location,nextLocation:S}:Le.has(S.pathname)&&(re={currentLocation:S,nextLocation:C.location})}else if(we){let pe=Le.get(C.location.pathname);pe?pe.add(S.pathname):(pe=new Set([S.pathname]),Le.set(C.location.pathname,pe)),re={currentLocation:C.location,nextLocation:S}}We({...A,actionData:P,loaderData:oe,historyAction:W,location:S,initialized:!0,navigation:Mc,revalidation:"idle",restoreScrollPosition:te,preventScrollReset:ae,blockers:ne},{viewTransitionOpts:re,flushSync:U===!0}),W="POP",Oe=!1,we=!1,Te=!1,x=!1,ge?.resolve(),ge=null,Ee?.resolve(),Ee=null}async function Kt(S,A){if(ge?.resolve(),ge=null,typeof S=="number"){ge||(ge=ty());let Be=ge.promise;return a.history.go(S),Be}let U=Xc(C.location,C.matches,y,S,A?.fromRouteId,A?.relative),{path:G,submission:P,error:oe}=Yp(!1,U,A),ne=C.location,te=Tr(C.location,G,A&&A.state);te={...te,...a.history.encodeLocation(te)};let ae=A&&A.replace!=null?A.replace:void 0,re="PUSH";ae===!0?re="REPLACE":ae===!1||P!=null&&Qt(P.formMethod)&&P.formAction===C.location.pathname+C.location.search&&(re="REPLACE");let pe=A&&"preventScrollReset"in A?A.preventScrollReset===!0:void 0,ce=(A&&A.flushSync)===!0,Ve=ia({currentLocation:ne,nextLocation:te,historyAction:re});if(Ve){Ln(Ve,{state:"blocked",location:te,proceed(){Ln(Ve,{state:"proceeding",proceed:void 0,reset:void 0,location:te}),Kt(S,A)},reset(){let Be=new Map(C.blockers);Be.set(Ve,hr),We({blockers:Be})}});return}await Xt(re,te,{submission:P,pendingError:oe,preventScrollReset:pe,replace:A&&A.replace,enableViewTransition:A&&A.viewTransition,flushSync:ce,callSiteDefaultShouldRevalidate:A&&A.unstable_defaultShouldRevalidate})}function ri(){Ee||(Ee=ty()),Aa(),We({revalidation:"loading"});let S=Ee.promise;return C.navigation.state==="submitting"?S:C.navigation.state==="idle"?(Xt(C.historyAction,C.location,{startUninterruptedRevalidation:!0}),S):(Xt(W||C.historyAction,C.navigation.location,{overrideNavigation:C.navigation,enableViewTransition:we===!0}),S)}async function Xt(S,A,U){Re&&Re.abort(),Re=null,W=S,Te=(U&&U.startUninterruptedRevalidation)===!0,tt(C.location,C.matches),Oe=(U&&U.preventScrollReset)===!0,we=(U&&U.enableViewTransition)===!0;let G=g||m,P=U&&U.overrideNavigation,oe=U?.initialHydration&&C.matches&&C.matches.length>0&&!$?C.matches:$a(G,A,y),ne=(U&&U.flushSync)===!0;if(oe&&C.initialized&&!x&&WS(C.location,A)&&!(U&&U.submission&&Qt(U.submission.formMethod))){Un(A,{matches:oe},{flushSync:ne});return}let te=yt(oe,G,A.pathname);if(te.active&&te.matches&&(oe=te.matches),!oe){let{error:ct,notFoundMatches:ft,route:je}=Bn(A.pathname);Un(A,{matches:ft,loaderData:{},errors:{[je.id]:ct}},{flushSync:ne});return}Re=new AbortController;let ae=yl(a.history,A,Re.signal,U&&U.submission),re=a.getContext?await a.getContext():new Bp,pe;if(U&&U.pendingError)pe=[Ia(oe).route.id,{type:"error",error:U.pendingError}];else if(U&&U.submission&&Qt(U.submission.formMethod)){let ct=await ta(ae,A,U.submission,oe,re,te.active,U&&U.initialHydration===!0,{replace:U.replace,flushSync:ne});if(ct.shortCircuited)return;if(ct.pendingActionResult){let[ft,je]=ct.pendingActionResult;if(hn(je)&&_r(je.error)&&je.error.status===404){Re=null,Un(A,{matches:ct.matches,loaderData:{},errors:{[ft]:je.error}});return}}oe=ct.matches||oe,pe=ct.pendingActionResult,P=Nc(A,U.submission),ne=!1,te.active=!1,ae=yl(a.history,ae.url,ae.signal)}let{shortCircuited:ce,matches:Ve,loaderData:Be,errors:ut}=await si(ae,A,oe,re,te.active,P,U&&U.submission,U&&U.fetcherSubmission,U&&U.replace,U&&U.initialHydration===!0,ne,pe,U&&U.callSiteDefaultShouldRevalidate);ce||(Re=null,Un(A,{matches:Ve||oe,...Ip(pe),loaderData:Be,errors:ut}))}async function ta(S,A,U,G,P,oe,ne,te={}){Aa();let ae=s1(A,U);if(We({navigation:ae},{flushSync:te.flushSync===!0}),oe){let ce=await an(G,A.pathname,S.signal);if(ce.type==="aborted")return{shortCircuited:!0};if(ce.type==="error"){if(ce.partialMatches.length===0){let{matches:Be,route:ut}=Gs(m);return{matches:Be,pendingActionResult:[ut.id,{type:"error",error:ce.error}]}}let Ve=Ia(ce.partialMatches).route.id;return{matches:ce.partialMatches,pendingActionResult:[Ve,{type:"error",error:ce.error}]}}else if(ce.matches)G=ce.matches;else{let{notFoundMatches:Ve,error:Be,route:ut}=Bn(A.pathname);return{matches:Ve,pendingActionResult:[ut.id,{type:"error",error:Be}]}}}let re,pe=Is(G,A);if(!pe.route.action&&!pe.route.lazy)re={type:"error",error:xn(405,{method:S.method,pathname:A.pathname,routeId:pe.route.id})};else{let ce=vl(f,h,S,G,pe,ne?[]:s,P),Ve=await na(S,ce,P,null);if(re=Ve[pe.route.id],!re){for(let Be of G)if(Ve[Be.route.id]){re=Ve[Be.route.id];break}}if(S.signal.aborted)return{shortCircuited:!0}}if(Mi(re)){let ce;return te&&te.replace!=null?ce=te.replace:ce=Fp(re.response.headers.get("Location"),new URL(S.url),y,a.history)===C.location.pathname+C.location.search,await ot(S,re,!0,{submission:U,replace:ce}),{shortCircuited:!0}}if(hn(re)){let ce=Ia(G,pe.route.id);return(te&&te.replace)!==!0&&(W="PUSH"),{matches:G,pendingActionResult:[ce.route.id,re,pe.route.id]}}return{matches:G,pendingActionResult:[pe.route.id,re]}}async function si(S,A,U,G,P,oe,ne,te,ae,re,pe,ce,Ve){let Be=oe||Nc(A,ne),ut=ne||te||ey(Be),ct=!Te&&!re;if(P){if(ct){let gt=Ht(ce);We({navigation:Be,...gt!==void 0?{actionData:gt}:{}},{flushSync:pe})}let He=await an(U,A.pathname,S.signal);if(He.type==="aborted")return{shortCircuited:!0};if(He.type==="error"){if(He.partialMatches.length===0){let{matches:qn,route:zt}=Gs(m);return{matches:qn,loaderData:{},errors:{[zt.id]:He.error}}}let gt=Ia(He.partialMatches).route.id;return{matches:He.partialMatches,loaderData:{},errors:{[gt]:He.error}}}else if(He.matches)U=He.matches;else{let{error:gt,notFoundMatches:qn,route:zt}=Bn(A.pathname);return{matches:qn,loaderData:{},errors:{[zt.id]:gt}}}}let ft=g||m,{dsMatches:je,revalidatingFetchers:xt}=Vp(S,G,f,h,a.history,C,U,ut,A,re?[]:s,re===!0,x,K,ee,k,j,ft,y,a.patchRoutesOnNavigation!=null,ce,Ve);if(he=++fe,!a.dataStrategy&&!je.some(He=>He.shouldLoad)&&!je.some(He=>He.route.middleware&&He.route.middleware.length>0)&&xt.length===0){let He=At();return Un(A,{matches:U,loaderData:{},errors:ce&&hn(ce[1])?{[ce[0]]:ce[1].error}:null,...Ip(ce),...He?{fetchers:new Map(C.fetchers)}:{}},{flushSync:pe}),{shortCircuited:!0}}if(ct){let He={};if(!P){He.navigation=Be;let gt=Ht(ce);gt!==void 0&&(He.actionData=gt)}xt.length>0&&(He.fetchers=oi(xt)),We(He,{flushSync:pe})}xt.forEach(He=>{at(He.key),He.controller&&J.set(He.key,He.controller)});let Ft=()=>xt.forEach(He=>at(He.key));Re&&Re.signal.addEventListener("abort",Ft);let{loaderResults:rt,fetcherResults:jn}=await Xn(je,xt,S,G);if(S.signal.aborted)return{shortCircuited:!0};Re&&Re.signal.removeEventListener("abort",Ft),xt.forEach(He=>J.delete(He.key));let ln=Ks(rt);if(ln)return await ot(S,ln.result,!0,{replace:ae}),{shortCircuited:!0};if(ln=Ks(jn),ln)return j.add(ln.key),await ot(S,ln.result,!0,{replace:ae}),{shortCircuited:!0};let{loaderData:Hn,errors:bn}=Pp(C,U,rt,ce,xt,jn);re&&C.errors&&(bn={...C.errors,...bn});let ra=At(),fi=Bi(he),di=ra||fi||xt.length>0;return{matches:U,loaderData:Hn,errors:bn,...di?{fetchers:new Map(C.fetchers)}:{}}}function Ht(S){if(S&&!hn(S[1]))return{[S[0]]:S[1].data};if(C.actionData)return Object.keys(C.actionData).length===0?null:C.actionData}function oi(S){return S.forEach(A=>{let U=C.fetchers.get(A.key),G=mr(void 0,U?U.data:void 0);C.fetchers.set(A.key,G)}),new Map(C.fetchers)}async function ui(S,A,U,G){at(S);let P=(G&&G.flushSync)===!0,oe=g||m,ne=Xc(C.location,C.matches,y,U,A,G?.relative),te=$a(oe,ne,y),ae=yt(te,oe,ne);if(ae.active&&ae.matches&&(te=ae.matches),!te){Yt(S,A,xn(404,{pathname:ne}),{flushSync:P});return}let{path:re,submission:pe,error:ce}=Yp(!0,ne,G);if(ce){Yt(S,A,ce,{flushSync:P});return}let Ve=a.getContext?await a.getContext():new Bp,Be=(G&&G.preventScrollReset)===!0;if(pe&&Qt(pe.formMethod)){await Mt(S,A,re,te,Ve,ae.active,P,Be,pe,G&&G.unstable_defaultShouldRevalidate);return}k.set(S,{routeId:A,path:re}),await Kn(S,A,re,te,Ve,ae.active,P,Be,pe)}async function Mt(S,A,U,G,P,oe,ne,te,ae,re){Aa(),k.delete(S);let pe=C.fetchers.get(S);Nt(S,o1(ae,pe),{flushSync:ne});let ce=new AbortController,Ve=yl(a.history,U,ce.signal,ae);if(oe){let qe=await an(G,new URL(Ve.url).pathname,Ve.signal,S);if(qe.type==="aborted")return;if(qe.type==="error"){Yt(S,A,qe.error,{flushSync:ne});return}else if(qe.matches)G=qe.matches;else{Yt(S,A,xn(404,{pathname:U}),{flushSync:ne});return}}let Be=Is(G,U);if(!Be.route.action&&!Be.route.lazy){let qe=xn(405,{method:ae.formMethod,pathname:U,routeId:A});Yt(S,A,qe,{flushSync:ne});return}J.set(S,ce);let ut=fe,ct=vl(f,h,Ve,G,Be,s,P),ft=await na(Ve,ct,P,S),je=ft[Be.route.id];if(!je){for(let qe of ct)if(ft[qe.route.id]){je=ft[qe.route.id];break}}if(Ve.signal.aborted){J.get(S)===ce&&J.delete(S);return}if(ee.has(S)){if(Mi(je)||hn(je)){Nt(S,_a(void 0));return}}else{if(Mi(je))if(J.delete(S),he>ut){Nt(S,_a(void 0));return}else return j.add(S),Nt(S,mr(ae)),ot(Ve,je,!1,{fetcherSubmission:ae,preventScrollReset:te});if(hn(je)){Yt(S,A,je.error);return}}let xt=C.navigation.location||C.location,Ft=yl(a.history,xt,ce.signal),rt=g||m,jn=C.navigation.state!=="idle"?$a(rt,C.navigation.location,y):C.matches;De(jn,"Didn't find any matches after fetcher action");let ln=++fe;T.set(S,ln);let Hn=mr(ae,je.data);C.fetchers.set(S,Hn);let{dsMatches:bn,revalidatingFetchers:ra}=Vp(Ft,P,f,h,a.history,C,jn,ae,xt,s,!1,x,K,ee,k,j,rt,y,a.patchRoutesOnNavigation!=null,[Be.route.id,je],re);ra.filter(qe=>qe.key!==S).forEach(qe=>{let hi=qe.key,Mr=C.fetchers.get(hi),wl=mr(void 0,Mr?Mr.data:void 0);C.fetchers.set(hi,wl),at(hi),qe.controller&&J.set(hi,qe.controller)}),We({fetchers:new Map(C.fetchers)});let fi=()=>ra.forEach(qe=>at(qe.key));ce.signal.addEventListener("abort",fi);let{loaderResults:di,fetcherResults:He}=await Xn(bn,ra,Ft,P);if(ce.signal.aborted)return;if(ce.signal.removeEventListener("abort",fi),T.delete(S),J.delete(S),ra.forEach(qe=>J.delete(qe.key)),C.fetchers.has(S)){let qe=_a(je.data);C.fetchers.set(S,qe)}let gt=Ks(di);if(gt)return ot(Ft,gt.result,!1,{preventScrollReset:te});if(gt=Ks(He),gt)return j.add(gt.key),ot(Ft,gt.result,!1,{preventScrollReset:te});let{loaderData:qn,errors:zt}=Pp(C,jn,di,void 0,ra,He);Bi(ln),C.navigation.state==="loading"&&ln>he?(De(W,"Expected pending action"),Re&&Re.abort(),Un(C.navigation.location,{matches:jn,loaderData:qn,errors:zt,fetchers:new Map(C.fetchers)})):(We({errors:zt,loaderData:$p(C.loaderData,qn,jn,zt),fetchers:new Map(C.fetchers)}),x=!1)}async function Kn(S,A,U,G,P,oe,ne,te,ae){let re=C.fetchers.get(S);Nt(S,mr(ae,re?re.data:void 0),{flushSync:ne});let pe=new AbortController,ce=yl(a.history,U,pe.signal);if(oe){let je=await an(G,new URL(ce.url).pathname,ce.signal,S);if(je.type==="aborted")return;if(je.type==="error"){Yt(S,A,je.error,{flushSync:ne});return}else if(je.matches)G=je.matches;else{Yt(S,A,xn(404,{pathname:U}),{flushSync:ne});return}}let Ve=Is(G,U);J.set(S,pe);let Be=fe,ut=vl(f,h,ce,G,Ve,s,P),ft=(await na(ce,ut,P,S))[Ve.route.id];if(J.get(S)===pe&&J.delete(S),!ce.signal.aborted){if(ee.has(S)){Nt(S,_a(void 0));return}if(Mi(ft))if(he>Be){Nt(S,_a(void 0));return}else{j.add(S),await ot(ce,ft,!1,{preventScrollReset:te});return}if(hn(ft)){Yt(S,A,ft.error);return}Nt(S,_a(ft.data))}}async function ot(S,A,U,{submission:G,fetcherSubmission:P,preventScrollReset:oe,replace:ne}={}){U||(ge?.resolve(),ge=null),A.response.headers.has("X-Remix-Revalidate")&&(x=!0);let te=A.response.headers.get("Location");De(te,"Expected a Location header on the redirect Response"),te=Fp(te,new URL(S.url),y,a.history);let ae=Tr(C.location,te,{_isRedirect:!0});if(r){let ut=!1;if(A.response.headers.has("X-Remix-Reload-Document"))ut=!0;else if(ff(te)){const ct=xy(te,!0);ut=ct.origin!==i.location.origin||Nn(ct.pathname,y)==null}if(ut){ne?i.location.replace(te):i.location.assign(te);return}}Re=null;let re=ne===!0||A.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:pe,formAction:ce,formEncType:Ve}=C.navigation;!G&&!P&&pe&&ce&&Ve&&(G=ey(C.navigation));let Be=G||P;if(jS.has(A.response.status)&&Be&&Qt(Be.formMethod))await Xt(re,ae,{submission:{...Be,formAction:te},preventScrollReset:oe||Oe,enableViewTransition:U?we:void 0});else{let ut=Nc(ae,G);await Xt(re,ae,{overrideNavigation:ut,fetcherSubmission:P,preventScrollReset:oe||Oe,enableViewTransition:U?we:void 0})}}async function na(S,A,U,G){let P,oe={};try{P=await ZS(b,S,A,G,U,!1)}catch(ne){return A.filter(te=>te.shouldLoad).forEach(te=>{oe[te.route.id]={type:"error",error:ne}}),oe}if(S.signal.aborted)return oe;if(!Qt(S.method))for(let ne of A){if(P[ne.route.id]?.type==="error")break;!P.hasOwnProperty(ne.route.id)&&!C.loaderData.hasOwnProperty(ne.route.id)&&(!C.errors||!C.errors.hasOwnProperty(ne.route.id))&&ne.shouldCallHandler()&&(P[ne.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${ne.route.id}`)})}for(let[ne,te]of Object.entries(P))if(a1(te)){let ae=te.result;oe[ne]={type:"redirect",response:$S(ae,S,ne,A,y)}}else oe[ne]=await PS(te);return oe}async function Xn(S,A,U,G){let P=na(U,S,G,null),oe=Promise.all(A.map(async ae=>{if(ae.matches&&ae.match&&ae.request&&ae.controller){let pe=(await na(ae.request,ae.matches,G,ae.key))[ae.match.route.id];return{[ae.key]:pe}}else return Promise.resolve({[ae.key]:{type:"error",error:xn(404,{pathname:ae.path})}})})),ne=await P,te=(await oe).reduce((ae,re)=>Object.assign(ae,re),{});return{loaderResults:ne,fetcherResults:te}}function Aa(){x=!0,k.forEach((S,A)=>{J.has(A)&&K.add(A),at(A)})}function Nt(S,A,U={}){C.fetchers.set(S,A),We({fetchers:new Map(C.fetchers)},{flushSync:(U&&U.flushSync)===!0})}function Yt(S,A,U,G={}){let P=Ia(C.matches,A);gn(S),We({errors:{[P.route.id]:U},fetchers:new Map(C.fetchers)},{flushSync:(G&&G.flushSync)===!0})}function yn(S){return F.set(S,(F.get(S)||0)+1),ee.has(S)&&ee.delete(S),C.fetchers.get(S)||HS}function Li(S,A){at(S,A?.reason),Nt(S,_a(null))}function gn(S){let A=C.fetchers.get(S);J.has(S)&&!(A&&A.state==="loading"&&T.has(S))&&at(S),k.delete(S),T.delete(S),j.delete(S),ee.delete(S),K.delete(S),C.fetchers.delete(S)}function aa(S){let A=(F.get(S)||0)-1;A<=0?(F.delete(S),ee.add(S)):F.set(S,A),We({fetchers:new Map(C.fetchers)})}function at(S,A){let U=J.get(S);U&&(U.abort(A),J.delete(S))}function Zt(S){for(let A of S){let U=yn(A),G=_a(U.data);C.fetchers.set(A,G)}}function At(){let S=[],A=!1;for(let U of j){let G=C.fetchers.get(U);De(G,`Expected fetcher: ${U}`),G.state==="loading"&&(j.delete(U),S.push(U),A=!0)}return Zt(S),A}function Bi(S){let A=[];for(let[U,G]of T)if(G<S){let P=C.fetchers.get(U);De(P,`Expected fetcher: ${U}`),P.state==="loading"&&(at(U),T.delete(U),A.push(U))}return Zt(A),A.length>0}function ci(S,A){let U=C.blockers.get(S)||hr;return ue.get(S)!==A&&ue.set(S,A),U}function nn(S){C.blockers.delete(S),ue.delete(S)}function Ln(S,A){let U=C.blockers.get(S)||hr;De(U.state==="unblocked"&&A.state==="blocked"||U.state==="blocked"&&A.state==="blocked"||U.state==="blocked"&&A.state==="proceeding"||U.state==="blocked"&&A.state==="unblocked"||U.state==="proceeding"&&A.state==="unblocked",`Invalid blocker state transition: ${U.state} -> ${A.state}`);let G=new Map(C.blockers);G.set(S,A),We({blockers:G})}function ia({currentLocation:S,nextLocation:A,historyAction:U}){if(ue.size===0)return;ue.size>1&&St(!1,"A router only supports one blocker at a time");let G=Array.from(ue.entries()),[P,oe]=G[G.length-1],ne=C.blockers.get(P);if(!(ne&&ne.state==="proceeding")&&oe({currentLocation:S,nextLocation:A,historyAction:U}))return P}function Bn(S){let A=xn(404,{pathname:S}),U=g||m,{matches:G,route:P}=Gs(U);return{notFoundMatches:G,route:P,error:A}}function vn(S,A,U){if(B=S,X=A,q=U||null,!V&&C.navigation===Mc){V=!0;let G=pt(C.location,C.matches);G!=null&&We({restoreScrollPosition:G})}return()=>{B=null,X=null,q=null}}function Se(S,A){return q&&q(S,A.map(G=>cS(G,C.loaderData)))||S.key}function tt(S,A){if(B&&X){let U=Se(S,A);B[U]=X()}}function pt(S,A){if(B){let U=Se(S,A),G=B[U];if(typeof G=="number")return G}return null}function yt(S,A,U){if(a.patchRoutesOnNavigation)if(S){if(Object.keys(S[0].params).length>0)return{active:!0,matches:vr(A,U,y,!0)}}else return{active:!0,matches:vr(A,U,y,!0)||[]};return{active:!1,matches:null}}async function an(S,A,U,G){if(!a.patchRoutesOnNavigation)return{type:"success",matches:S};let P=S;for(;;){let oe=g==null,ne=g||m,te=h;try{await a.patchRoutesOnNavigation({signal:U,path:A,matches:P,fetcherKey:G,patch:(pe,ce)=>{U.aborted||Gp(pe,ce,ne,te,f,!1)}})}catch(pe){return{type:"error",error:pe,partialMatches:P}}finally{oe&&!U.aborted&&(m=[...m])}if(U.aborted)return{type:"aborted"};let ae=$a(ne,A,y),re=null;if(ae){if(Object.keys(ae[0].params).length===0)return{type:"success",matches:ae};if(re=vr(ne,A,y,!0),!(re&&P.length<re.length&&nt(P,re.slice(0,P.length))))return{type:"success",matches:ae}}if(re||(re=vr(ne,A,y,!0)),!re||nt(P,re))return{type:"success",matches:null};P=re}}function nt(S,A){return S.length===A.length&&S.every((U,G)=>U.route.id===A[G].route.id)}function qt(S){h={},g=wr(S,f,void 0,h)}function la(S,A,U=!1){let G=g==null;Gp(S,A,g||m,h,f,U),G&&(m=[...m],We({}))}return ye={get basename(){return y},get future(){return p},get state(){return C},get routes(){return m},get window(){return i},initialize:Ze,subscribe:zn,enableScrollRestoration:vn,navigate:Kt,fetch:ui,revalidate:ri,createHref:S=>a.history.createHref(S),encodeLocation:S=>a.history.encodeLocation(S),getFetcher:yn,resetFetcher:Li,deleteFetcher:aa,dispose:pn,getBlocker:ci,deleteBlocker:nn,patchRoutes:la,_internalFetchControllers:J,_internalSetRoutes:qt,_internalSetStateDoNotUseOrYouWillBreakYourApp(S){We(S)}},a.unstable_instrumentations&&(ye=xS(ye,a.unstable_instrumentations.map(S=>S.router).filter(Boolean))),ye}function QS(a){return a!=null&&("formData"in a&&a.formData!=null||"body"in a&&a.body!==void 0)}function Xc(a,i,r,s,c,f){let h,m;if(c){h=[];for(let y of i)if(h.push(y),y.route.id===c){m=y;break}}else h=i,m=i[i.length-1];let g=fo(s||".",co(h),Nn(a.pathname,r)||a.pathname,f==="path");if(s==null&&(g.search=a.search,g.hash=a.hash),(s==null||s===""||s===".")&&m){let y=mf(g.search);if(m.route.index&&!y)g.search=g.search?g.search.replace(/^\?/,"?index&"):"?index";else if(!m.route.index&&y){let b=new URLSearchParams(g.search),p=b.getAll("index");b.delete("index"),p.filter(D=>D).forEach(D=>b.append("index",D));let w=b.toString();g.search=w?`?${w}`:""}}return r!=="/"&&(g.pathname=wS({basename:r,pathname:g.pathname})),Wn(g)}function Yp(a,i,r){if(!r||!QS(r))return{path:i};if(r.formMethod&&!r1(r.formMethod))return{path:i,error:xn(405,{method:r.formMethod})};let s=()=>({path:i,error:xn(400,{type:"invalid-body"})}),f=(r.formMethod||"get").toUpperCase(),h=Xy(i);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Qt(f))return s();let p=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((w,[D,B])=>`${w}${D}=${B}
|
|
11
11
|
`,""):String(r.body);return{path:i,submission:{formMethod:f,formAction:h,formEncType:r.formEncType,formData:void 0,json:void 0,text:p}}}else if(r.formEncType==="application/json"){if(!Qt(f))return s();try{let p=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:i,submission:{formMethod:f,formAction:h,formEncType:r.formEncType,formData:void 0,json:p,text:void 0}}}catch{return s()}}}De(typeof FormData=="function","FormData is not available in this environment");let m,g;if(r.formData)m=Jc(r.formData),g=r.formData;else if(r.body instanceof FormData)m=Jc(r.body),g=r.body;else if(r.body instanceof URLSearchParams)m=r.body,g=Jp(m);else if(r.body==null)m=new URLSearchParams,g=new FormData;else try{m=new URLSearchParams(r.body),g=Jp(m)}catch{return s()}let y={formMethod:f,formAction:h,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:g,json:void 0,text:void 0};if(Qt(y.formMethod))return{path:i,submission:y};let b=ii(i);return a&&b.search&&mf(b.search)&&m.append("index",""),b.search=`?${m}`,{path:Wn(b),submission:y}}function Vp(a,i,r,s,c,f,h,m,g,y,b,p,w,D,B,q,X,V,Z,$,be){let me=$?hn($[1])?$[1].error:$[1].data:void 0,ye=c.createURL(f.location),C=c.createURL(g),W;if(b&&f.errors){let Te=Object.keys(f.errors)[0];W=h.findIndex(x=>x.route.id===Te)}else if($&&hn($[1])){let Te=$[0];W=h.findIndex(x=>x.route.id===Te)-1}let ge=$?$[1].statusCode:void 0,Oe=ge&&ge>=400,Re={currentUrl:ye,currentParams:f.matches[0]?.params||{},nextUrl:C,nextParams:h[0].params,...m,actionResult:me,actionStatus:ge},we=Cr(h),Le=h.map((Te,x)=>{let{route:K}=Te,J=null;if(W!=null&&x>W?J=!1:K.lazy?J=!0:df(K)?b?J=Zc(K,f.loaderData,f.errors):YS(f.loaderData,f.matches[x],Te)&&(J=!0):J=!1,J!==null)return Fc(r,s,a,we,Te,y,i,J);let fe=!1;typeof be=="boolean"?fe=be:Oe?fe=!1:(p||ye.pathname+ye.search===C.pathname+C.search||ye.search!==C.search||VS(f.matches[x],Te))&&(fe=!0);let he={...Re,defaultShouldRevalidate:fe},T=Sr(Te,he);return Fc(r,s,a,we,Te,y,i,T,he,be)}),Ye=[];return B.forEach((Te,x)=>{if(b||!h.some(F=>F.route.id===Te.routeId)||D.has(x))return;let K=f.fetchers.get(x),J=K&&K.state!=="idle"&&K.data===void 0,fe=$a(X,Te.path,V);if(!fe){if(Z&&J)return;Ye.push({key:x,routeId:Te.routeId,path:Te.path,matches:null,match:null,request:null,controller:null});return}if(q.has(x))return;let he=Is(fe,Te.path),T=new AbortController,j=yl(c,Te.path,T.signal),k=null;if(w.has(x))w.delete(x),k=vl(r,s,j,fe,he,y,i);else if(J)p&&(k=vl(r,s,j,fe,he,y,i));else{let F;typeof be=="boolean"?F=be:Oe?F=!1:F=p;let ee={...Re,defaultShouldRevalidate:F};Sr(he,ee)&&(k=vl(r,s,j,fe,he,y,i,ee))}k&&Ye.push({key:x,routeId:Te.routeId,path:Te.path,matches:k,match:he,request:j,controller:T})}),{dsMatches:Le,revalidatingFetchers:Ye}}function df(a){return a.loader!=null||a.middleware!=null&&a.middleware.length>0}function Zc(a,i,r){if(a.lazy)return!0;if(!df(a))return!1;let s=i!=null&&a.id in i,c=r!=null&&r[a.id]!==void 0;return!s&&c?!1:typeof a.loader=="function"&&a.loader.hydrate===!0?!0:!s&&!c}function YS(a,i,r){let s=!i||r.route.id!==i.route.id,c=!a.hasOwnProperty(r.route.id);return s||c}function VS(a,i){let r=a.route.path;return a.pathname!==i.pathname||r!=null&&r.endsWith("*")&&a.params["*"]!==i.params["*"]}function Sr(a,i){if(a.route.shouldRevalidate){let r=a.route.shouldRevalidate(i);if(typeof r=="boolean")return r}return i.defaultShouldRevalidate}function Gp(a,i,r,s,c,f){let h;if(a){let y=s[a];De(y,`No route found to patch children into: routeId = ${a}`),y.children||(y.children=[]),h=y.children}else h=r;let m=[],g=[];if(i.forEach(y=>{let b=h.find(p=>Qy(y,p));b?g.push({existingRoute:b,newRoute:y}):m.push(y)}),m.length>0){let y=wr(m,c,[a||"_","patch",String(h?.length||"0")],s);h.push(...y)}if(f&&g.length>0)for(let y=0;y<g.length;y++){let{existingRoute:b,newRoute:p}=g[y],w=b,[D]=wr([p],c,[],{},!0);Object.assign(w,{element:D.element?D.element:w.element,errorElement:D.errorElement?D.errorElement:w.errorElement,hydrateFallbackElement:D.hydrateFallbackElement?D.hydrateFallbackElement:w.hydrateFallbackElement})}}function Qy(a,i){return"id"in a&&"id"in i&&a.id===i.id?!0:a.index===i.index&&a.path===i.path&&a.caseSensitive===i.caseSensitive?(!a.children||a.children.length===0)&&(!i.children||i.children.length===0)?!0:a.children.every((r,s)=>i.children?.some(c=>Qy(r,c))):!1}var Kp=new WeakMap,Yy=({key:a,route:i,manifest:r,mapRouteProperties:s})=>{let c=r[i.id];if(De(c,"No route found in manifest"),!c.lazy||typeof c.lazy!="object")return;let f=c.lazy[a];if(!f)return;let h=Kp.get(c);h||(h={},Kp.set(c,h));let m=h[a];if(m)return m;let g=(async()=>{let y=rS(a),p=c[a]!==void 0&&a!=="hasErrorBoundary";if(y)St(!y,"Route property "+a+" is not a supported lazy route property. This property will be ignored."),h[a]=Promise.resolve();else if(p)St(!1,`Route "${c.id}" has a static property "${a}" defined. The lazy property will be ignored.`);else{let w=await f();w!=null&&(Object.assign(c,{[a]:w}),Object.assign(c,s(c)))}typeof c.lazy=="object"&&(c.lazy[a]=void 0,Object.values(c.lazy).every(w=>w===void 0)&&(c.lazy=void 0))})();return h[a]=g,g},Xp=new WeakMap;function GS(a,i,r,s,c){let f=r[a.id];if(De(f,"No route found in manifest"),!a.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof a.lazy=="function"){let b=Xp.get(f);if(b)return{lazyRoutePromise:b,lazyHandlerPromise:b};let p=(async()=>{De(typeof a.lazy=="function","No lazy route function found");let w=await a.lazy(),D={};for(let B in w){let q=w[B];if(q===void 0)continue;let X=oS(B),Z=f[B]!==void 0&&B!=="hasErrorBoundary";X?St(!X,"Route property "+B+" is not a supported property to be returned from a lazy route function. This property will be ignored."):Z?St(!Z,`Route "${f.id}" has a static property "${B}" defined but its lazy function is also returning a value for this property. The lazy route property "${B}" will be ignored.`):D[B]=q}Object.assign(f,D),Object.assign(f,{...s(f),lazy:void 0})})();return Xp.set(f,p),p.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:p}}let h=Object.keys(a.lazy),m=[],g;for(let b of h){if(c&&c.includes(b))continue;let p=Yy({key:b,route:a,manifest:r,mapRouteProperties:s});p&&(m.push(p),b===i&&(g=p))}let y=m.length>0?Promise.all(m).then(()=>{}):void 0;return y?.catch(()=>{}),g?.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:g}}async function Zp(a){let i=a.matches.filter(c=>c.shouldLoad),r={};return(await Promise.all(i.map(c=>c.resolve()))).forEach((c,f)=>{r[i[f].route.id]=c}),r}async function KS(a){return a.matches.some(i=>i.route.middleware)?Vy(a,()=>Zp(a)):Zp(a)}function Vy(a,i){return XS(a,i,s=>{if(l1(s))throw s;return s},t1,r);function r(s,c,f){if(f)return Promise.resolve(Object.assign(f.value,{[c]:{type:"error",result:s}}));{let{matches:h}=a,m=Math.min(Math.max(h.findIndex(y=>y.route.id===c),0),Math.max(h.findIndex(y=>y.shouldCallHandler()),0)),g=Ia(h,h[m].route.id).route.id;return Promise.resolve({[g]:{type:"error",result:s}})}}}async function XS(a,i,r,s,c){let{matches:f,request:h,params:m,context:g,unstable_pattern:y}=a,b=f.flatMap(w=>w.route.middleware?w.route.middleware.map(D=>[w.route.id,D]):[]);return await Gy({request:h,params:m,context:g,unstable_pattern:y},b,i,r,s,c)}async function Gy(a,i,r,s,c,f,h=0){let{request:m}=a;if(m.signal.aborted)throw m.signal.reason??new Error(`Request aborted: ${m.method} ${m.url}`);let g=i[h];if(!g)return await r();let[y,b]=g,p,w=async()=>{if(p)throw new Error("You may only call `next()` once per middleware");try{return p={value:await Gy(a,i,r,s,c,f,h+1)},p.value}catch(D){return p={value:await f(D,y,p)},p.value}};try{let D=await b(a,w),B=D!=null?s(D):void 0;return c(B)?B:p?B??p.value:(p={value:await w()},p.value)}catch(D){return await f(D,y,p)}}function Ky(a,i,r,s,c){let f=Yy({key:"middleware",route:s.route,manifest:i,mapRouteProperties:a}),h=GS(s.route,Qt(r.method)?"action":"loader",i,a,c);return{middleware:f,route:h.lazyRoutePromise,handler:h.lazyHandlerPromise}}function Fc(a,i,r,s,c,f,h,m,g=null,y){let b=!1,p=Ky(a,i,r,c,f);return{...c,_lazyPromises:p,shouldLoad:m,shouldRevalidateArgs:g,shouldCallHandler(w){return b=!0,g?typeof y=="boolean"?Sr(c,{...g,defaultShouldRevalidate:y}):typeof w=="boolean"?Sr(c,{...g,defaultShouldRevalidate:w}):Sr(c,g):m},resolve(w){let{lazy:D,loader:B,middleware:q}=c.route,X=b||m||w&&!Qt(r.method)&&(D||B),V=q&&q.length>0&&!B&&!D;return X&&(Qt(r.method)||!V)?FS({request:r,unstable_pattern:s,match:c,lazyHandlerPromise:p?.handler,lazyRoutePromise:p?.route,handlerOverride:w,scopedContext:h}):Promise.resolve({type:"data",result:void 0})}}}function vl(a,i,r,s,c,f,h,m=null){return s.map(g=>g.route.id!==c.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:m,shouldCallHandler:()=>!1,_lazyPromises:Ky(a,i,r,g,f),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Fc(a,i,r,Cr(s),g,f,h,!0,m))}async function ZS(a,i,r,s,c,f){r.some(y=>y._lazyPromises?.middleware)&&await Promise.all(r.map(y=>y._lazyPromises?.middleware));let h={request:i,unstable_pattern:Cr(r),params:r[0].params,context:c,matches:r},g=await a({...h,fetcherKey:s,runClientMiddleware:y=>{let b=h;return Vy(b,()=>y({...b,fetcherKey:s,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(y=>[y._lazyPromises?.handler,y._lazyPromises?.route]))}catch{}return g}async function FS({request:a,unstable_pattern:i,match:r,lazyHandlerPromise:s,lazyRoutePromise:c,handlerOverride:f,scopedContext:h}){let m,g,y=Qt(a.method),b=y?"action":"loader",p=w=>{let D,B=new Promise((V,Z)=>D=Z);g=()=>D(),a.signal.addEventListener("abort",g);let q=V=>typeof w!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${b}" [routeId: ${r.route.id}]`)):w({request:a,unstable_pattern:i,params:r.params,context:h},...V!==void 0?[V]:[]),X=(async()=>{try{return{type:"data",result:await(f?f(Z=>q(Z)):q())}}catch(V){return{type:"error",result:V}}})();return Promise.race([X,B])};try{let w=y?r.route.action:r.route.loader;if(s||c)if(w){let D,[B]=await Promise.all([p(w).catch(q=>{D=q}),s,c]);if(D!==void 0)throw D;m=B}else{await s;let D=y?r.route.action:r.route.loader;if(D)[m]=await Promise.all([p(D),c]);else if(b==="action"){let B=new URL(a.url),q=B.pathname+B.search;throw xn(405,{method:a.method,pathname:q,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(w)m=await p(w);else{let D=new URL(a.url),B=D.pathname+D.search;throw xn(404,{pathname:B})}}catch(w){return{type:"error",result:w}}finally{g&&a.signal.removeEventListener("abort",g)}return m}async function JS(a){let i=a.headers.get("Content-Type");return i&&/\bapplication\/json\b/.test(i)?a.body==null?null:a.json():a.text()}async function PS(a){let{result:i,type:r}=a;if(hf(i)){let s;try{s=await JS(i)}catch(c){return{type:"error",error:c}}return r==="error"?{type:"error",error:new Ar(i.status,i.statusText,s),statusCode:i.status,headers:i.headers}:{type:"data",data:s,statusCode:i.status,headers:i.headers}}return r==="error"?Wp(i)?i.data instanceof Error?{type:"error",error:i.data,statusCode:i.init?.status,headers:i.init?.headers?new Headers(i.init.headers):void 0}:{type:"error",error:e1(i),statusCode:_r(i)?i.status:void 0,headers:i.init?.headers?new Headers(i.init.headers):void 0}:{type:"error",error:i,statusCode:_r(i)?i.status:void 0}:Wp(i)?{type:"data",data:i.data,statusCode:i.init?.status,headers:i.init?.headers?new Headers(i.init.headers):void 0}:{type:"data",data:i}}function $S(a,i,r,s,c){let f=a.headers.get("Location");if(De(f,"Redirects returned/thrown from loaders/actions must have a Location header"),!ff(f)){let h=s.slice(0,s.findIndex(m=>m.route.id===r)+1);f=Xc(new URL(i.url),h,c,f),a.headers.set("Location",f)}return a}function Fp(a,i,r,s){let c=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(ff(a)){let f=a,h=f.startsWith("//")?new URL(i.protocol+f):new URL(f);if(c.includes(h.protocol))throw new Error("Invalid redirect location");let m=Nn(h.pathname,r)!=null;if(h.origin===i.origin&&m)return h.pathname+h.search+h.hash}try{let f=s.createURL(a);if(c.includes(f.protocol))throw new Error("Invalid redirect location")}catch{}return a}function yl(a,i,r,s){let c=a.createURL(Xy(i)).toString(),f={signal:r};if(s&&Qt(s.formMethod)){let{formMethod:h,formEncType:m}=s;f.method=h.toUpperCase(),m==="application/json"?(f.headers=new Headers({"Content-Type":m}),f.body=JSON.stringify(s.json)):m==="text/plain"?f.body=s.text:m==="application/x-www-form-urlencoded"&&s.formData?f.body=Jc(s.formData):f.body=s.formData}return new Request(c,f)}function Jc(a){let i=new URLSearchParams;for(let[r,s]of a.entries())i.append(r,typeof s=="string"?s:s.name);return i}function Jp(a){let i=new FormData;for(let[r,s]of a.entries())i.append(r,s);return i}function IS(a,i,r,s=!1,c=!1){let f={},h=null,m,g=!1,y={},b=r&&hn(r[1])?r[1].error:void 0;return a.forEach(p=>{if(!(p.route.id in i))return;let w=p.route.id,D=i[w];if(De(!Mi(D),"Cannot handle redirect results in processLoaderData"),hn(D)){let B=D.error;if(b!==void 0&&(B=b,b=void 0),h=h||{},c)h[w]=B;else{let q=Ia(a,w);h[q.route.id]==null&&(h[q.route.id]=B)}s||(f[w]=ky),g||(g=!0,m=_r(D.error)?D.error.status:500),D.headers&&(y[w]=D.headers)}else f[w]=D.data,D.statusCode&&D.statusCode!==200&&!g&&(m=D.statusCode),D.headers&&(y[w]=D.headers)}),b!==void 0&&r&&(h={[r[0]]:b},r[2]&&(f[r[2]]=void 0)),{loaderData:f,errors:h,statusCode:m||200,loaderHeaders:y}}function Pp(a,i,r,s,c,f){let{loaderData:h,errors:m}=IS(i,r,s);return c.filter(g=>!g.matches||g.matches.some(y=>y.shouldLoad)).forEach(g=>{let{key:y,match:b,controller:p}=g;if(p&&p.signal.aborted)return;let w=f[y];if(De(w,"Did not find corresponding fetcher result"),hn(w)){let D=Ia(a.matches,b?.route.id);m&&m[D.route.id]||(m={...m,[D.route.id]:w.error}),a.fetchers.delete(y)}else if(Mi(w))De(!1,"Unhandled fetcher revalidation redirect");else{let D=_a(w.data);a.fetchers.set(y,D)}}),{loaderData:h,errors:m}}function $p(a,i,r,s){let c=Object.entries(i).filter(([,f])=>f!==ky).reduce((f,[h,m])=>(f[h]=m,f),{});for(let f of r){let h=f.route.id;if(!i.hasOwnProperty(h)&&a.hasOwnProperty(h)&&f.route.loader&&(c[h]=a[h]),s&&s.hasOwnProperty(h))break}return c}function Ip(a){return a?hn(a[1])?{actionData:{}}:{actionData:{[a[0]]:a[1].data}}:{}}function Ia(a,i){return(i?a.slice(0,a.findIndex(s=>s.route.id===i)+1):[...a]).reverse().find(s=>s.route.hasErrorBoundary===!0)||a[0]}function Gs(a){let i=a.length===1?a[0]:a.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:i}],route:i}}function xn(a,{pathname:i,routeId:r,method:s,type:c,message:f}={}){let h="Unknown Server Error",m="Unknown @remix-run/router error";return a===400?(h="Bad Request",s&&i&&r?m=`You made a ${s} request to "${i}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:c==="invalid-body"&&(m="Unable to encode submission body")):a===403?(h="Forbidden",m=`Route "${r}" does not match URL "${i}"`):a===404?(h="Not Found",m=`No route matches URL "${i}"`):a===405&&(h="Method Not Allowed",s&&i&&r?m=`You made a ${s.toUpperCase()} request to "${i}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:s&&(m=`Invalid request method "${s.toUpperCase()}"`)),new Ar(a||500,h,new Error(m),!0)}function Ks(a){let i=Object.entries(a);for(let r=i.length-1;r>=0;r--){let[s,c]=i[r];if(Mi(c))return{key:s,result:c}}}function Xy(a){let i=typeof a=="string"?ii(a):a;return Wn({...i,hash:""})}function WS(a,i){return a.pathname!==i.pathname||a.search!==i.search?!1:a.hash===""?i.hash!=="":a.hash===i.hash?!0:i.hash!==""}function e1(a){return new Ar(a.init?.status??500,a.init?.statusText??"Internal Server Error",a.data)}function t1(a){return a!=null&&typeof a=="object"&&Object.entries(a).every(([i,r])=>typeof i=="string"&&n1(r))}function n1(a){return a!=null&&typeof a=="object"&&"type"in a&&"result"in a&&(a.type==="data"||a.type==="error")}function a1(a){return hf(a.result)&&Hy.has(a.result.status)}function hn(a){return a.type==="error"}function Mi(a){return(a&&a.type)==="redirect"}function Wp(a){return typeof a=="object"&&a!=null&&"type"in a&&"data"in a&&"init"in a&&a.type==="DataWithResponseInit"}function hf(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.headers=="object"&&typeof a.body<"u"}function i1(a){return Hy.has(a)}function l1(a){return hf(a)&&i1(a.status)&&a.headers.has("Location")}function r1(a){return BS.has(a.toUpperCase())}function Qt(a){return US.has(a.toUpperCase())}function mf(a){return new URLSearchParams(a).getAll("index").some(i=>i==="")}function Is(a,i){let r=typeof i=="string"?ii(i).search:i.search;if(a[a.length-1].route.index&&mf(r||""))return a[a.length-1];let s=zy(a);return s[s.length-1]}function ey(a){let{formMethod:i,formAction:r,formEncType:s,text:c,formData:f,json:h}=a;if(!(!i||!r||!s)){if(c!=null)return{formMethod:i,formAction:r,formEncType:s,formData:void 0,json:void 0,text:c};if(f!=null)return{formMethod:i,formAction:r,formEncType:s,formData:f,json:void 0,text:void 0};if(h!==void 0)return{formMethod:i,formAction:r,formEncType:s,formData:void 0,json:h,text:void 0}}}function Nc(a,i){return i?{state:"loading",location:a,formMethod:i.formMethod,formAction:i.formAction,formEncType:i.formEncType,formData:i.formData,json:i.json,text:i.text}:{state:"loading",location:a,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function s1(a,i){return{state:"submitting",location:a,formMethod:i.formMethod,formAction:i.formAction,formEncType:i.formEncType,formData:i.formData,json:i.json,text:i.text}}function mr(a,i){return a?{state:"loading",formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text,data:i}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:i}}function o1(a,i){return{state:"submitting",formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text,data:i?i.data:void 0}}function _a(a){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:a}}function u1(a,i){try{let r=a.sessionStorage.getItem(qy);if(r){let s=JSON.parse(r);for(let[c,f]of Object.entries(s||{}))f&&Array.isArray(f)&&i.set(c,new Set(f||[]))}}catch{}}function c1(a,i){if(i.size>0){let r={};for(let[s,c]of i)r[s]=[...c];try{a.sessionStorage.setItem(qy,JSON.stringify(r))}catch(s){St(!1,`Failed to save applied view transitions in sessionStorage (${s}).`)}}}function ty(){let a,i,r=new Promise((s,c)=>{a=async f=>{s(f);try{await r}catch{}},i=async f=>{c(f);try{await r}catch{}}});return{promise:r,resolve:a,reject:i}}var Ui=R.createContext(null);Ui.displayName="DataRouter";var Or=R.createContext(null);Or.displayName="DataRouterState";var Zy=R.createContext(!1);function f1(){return R.useContext(Zy)}var pf=R.createContext({isTransitioning:!1});pf.displayName="ViewTransition";var Fy=R.createContext(new Map);Fy.displayName="Fetchers";var d1=R.createContext(null);d1.displayName="Await";var mn=R.createContext(null);mn.displayName="Navigation";var ho=R.createContext(null);ho.displayName="Location";var Gn=R.createContext({outlet:null,matches:[],isDataRoute:!1});Gn.displayName="Route";var yf=R.createContext(null);yf.displayName="RouteError";var Jy="REACT_ROUTER_ERROR",h1="REDIRECT",m1="ROUTE_ERROR_RESPONSE";function p1(a){if(a.startsWith(`${Jy}:${h1}:{`))try{let i=JSON.parse(a.slice(28));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.location=="string"&&typeof i.reloadDocument=="boolean"&&typeof i.replace=="boolean")return i}catch{}}function y1(a){if(a.startsWith(`${Jy}:${m1}:{`))try{let i=JSON.parse(a.slice(40));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string")return new Ar(i.status,i.statusText,i.data)}catch{}}function g1(a,{relative:i}={}){De(El(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:s}=R.useContext(mn),{hash:c,pathname:f,search:h}=xr(a,{relative:i}),m=f;return r!=="/"&&(m=f==="/"?r:In([r,f])),s.createHref({pathname:m,search:h,hash:c})}function El(){return R.useContext(ho)!=null}function li(){return De(El(),"useLocation() may be used only in the context of a <Router> component."),R.useContext(ho).location}var Py="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function $y(a){R.useContext(mn).static||R.useLayoutEffect(a)}function gf(){let{isDataRoute:a}=R.useContext(Gn);return a?N1():v1()}function v1(){De(El(),"useNavigate() may be used only in the context of a <Router> component.");let a=R.useContext(Ui),{basename:i,navigator:r}=R.useContext(mn),{matches:s}=R.useContext(Gn),{pathname:c}=li(),f=JSON.stringify(co(s)),h=R.useRef(!1);return $y(()=>{h.current=!0}),R.useCallback((g,y={})=>{if(St(h.current,Py),!h.current)return;if(typeof g=="number"){r.go(g);return}let b=fo(g,JSON.parse(f),c,y.relative==="path");a==null&&i!=="/"&&(b.pathname=b.pathname==="/"?i:In([i,b.pathname])),(y.replace?r.replace:r.push)(b,y.state,y)},[i,r,f,c,a])}var b1=R.createContext(null);function S1(a){let i=R.useContext(Gn).outlet;return R.useMemo(()=>i&&R.createElement(b1.Provider,{value:a},i),[i,a])}function xr(a,{relative:i}={}){let{matches:r}=R.useContext(Gn),{pathname:s}=li(),c=JSON.stringify(co(r));return R.useMemo(()=>fo(a,JSON.parse(c),s,i==="path"),[a,c,s,i])}function E1(a,i,r,s,c){De(El(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:f}=R.useContext(mn),{matches:h}=R.useContext(Gn),m=h[h.length-1],g=m?m.params:{},y=m?m.pathname:"/",b=m?m.pathnameBase:"/",p=m&&m.route;{let Z=p&&p.path||"";Wy(y,!p||Z.endsWith("*")||Z.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${y}" (under <Route path="${Z}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
12
12
|
|
|
13
|
-
Please change the parent <Route path="${Z}"> to <Route path="${Z==="/"?"*":`${Z}/*`}">.`)}let w=li(),D;D=w;let B=D.pathname||"/",q=B;if(b!=="/"){let Z=b.replace(/^\//,"").split("/");q="/"+B.replace(/^\//,"").split("/").slice(Z.length).join("/")}let X=$a(a,{pathname:q});return St(p||X!=null,`No routes matched location "${D.pathname}${D.search}${D.hash}" `),St(X==null||X[X.length-1].route.element!==void 0||X[X.length-1].route.Component!==void 0||X[X.length-1].route.lazy!==void 0,`Matched leaf route at location "${D.pathname}${D.search}${D.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),A1(X&&X.map(Z=>Object.assign({},Z,{params:Object.assign({},g,Z.params),pathname:In([b,f.encodeLocation?f.encodeLocation(Z.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:Z.pathname]),pathnameBase:Z.pathnameBase==="/"?b:In([b,f.encodeLocation?f.encodeLocation(Z.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:Z.pathnameBase])})),h,r,s,c)}function T1(){let a=M1(),i=_r(a)?`${a.status} ${a.statusText}`:a instanceof Error?a.message:JSON.stringify(a),r=a instanceof Error?a.stack:null,s="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:s},f={padding:"2px 4px",backgroundColor:s},h=null;return console.error("Error handled by React Router default ErrorBoundary:",a),h=R.createElement(R.Fragment,null,R.createElement("p",null,"💿 Hey developer 👋"),R.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",R.createElement("code",{style:f},"ErrorBoundary")," or"," ",R.createElement("code",{style:f},"errorElement")," prop on your route.")),R.createElement(R.Fragment,null,R.createElement("h2",null,"Unexpected Application Error!"),R.createElement("h3",{style:{fontStyle:"italic"}},i),r?R.createElement("pre",{style:c},r):null,h)}var w1=R.createElement(T1,null),Iy=class extends R.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,i){return i.location!==a.location||i.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:i.error,location:i.location,revalidation:a.revalidation||i.revalidation}}componentDidCatch(a,i){this.props.onError?this.props.onError(a,i):console.error("React Router caught the following error during render",a)}render(){let a=this.state.error;if(this.context&&typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){const r=y1(a.digest);r&&(a=r)}let i=a!==void 0?R.createElement(Gn.Provider,{value:this.props.routeContext},R.createElement(yf.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?R.createElement(_1,{error:a},i):i}};Iy.contextType=Zy;var zc=new WeakMap;function _1({children:a,error:i}){let{basename:r}=R.useContext(mn);if(typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){let s=p1(i.digest);if(s){let c=zc.get(i);if(c)throw c;let f=Ly(s.location,r);if(Uy&&!zc.get(i))if(f.isExternal||s.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const h=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:s.replace}));throw zc.set(i,h),h}return R.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return a}function R1({routeContext:a,match:i,children:r}){let s=R.useContext(Ui);return s&&s.static&&s.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=i.route.id),R.createElement(Gn.Provider,{value:a},r)}function A1(a,i=[],r=null,s=null,c=null){if(a==null){if(!r)return null;if(r.errors)a=r.matches;else if(i.length===0&&!r.initialized&&r.matches.length>0)a=r.matches;else return null}let f=a,h=r?.errors;if(h!=null){let b=f.findIndex(p=>p.route.id&&h?.[p.route.id]!==void 0);De(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(h).join(",")}`),f=f.slice(0,Math.min(f.length,b+1))}let m=!1,g=-1;if(r)for(let b=0;b<f.length;b++){let p=f[b];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(g=b),p.route.id){let{loaderData:w,errors:D}=r,B=p.route.loader&&!w.hasOwnProperty(p.route.id)&&(!D||D[p.route.id]===void 0);if(p.route.lazy||B){m=!0,g>=0?f=f.slice(0,g+1):f=[f[0]];break}}}let y=r&&s?(b,p)=>{s(b,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:Cr(r.matches),errorInfo:p})}:void 0;return f.reduceRight((b,p,w)=>{let D,B=!1,q=null,X=null;r&&(D=h&&p.route.id?h[p.route.id]:void 0,q=p.route.errorElement||w1,m&&(g<0&&w===0?(Wy("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),B=!0,X=null):g===w&&(B=!0,X=p.route.hydrateFallbackElement||null)));let V=i.concat(f.slice(0,w+1)),Z=()=>{let $;return D?$=q:B?$=X:p.route.Component?$=R.createElement(p.route.Component,null):p.route.element?$=p.route.element:$=b,R.createElement(R1,{match:p,routeContext:{outlet:b,matches:V,isDataRoute:r!=null},children:$})};return r&&(p.route.ErrorBoundary||p.route.errorElement||w===0)?R.createElement(Iy,{location:r.location,revalidation:r.revalidation,component:q,error:D,children:Z(),routeContext:{outlet:null,matches:V,isDataRoute:!0},onError:y}):Z()},null)}function vf(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function C1(a){let i=R.useContext(Ui);return De(i,vf(a)),i}function O1(a){let i=R.useContext(Or);return De(i,vf(a)),i}function x1(a){let i=R.useContext(Gn);return De(i,vf(a)),i}function bf(a){let i=x1(a),r=i.matches[i.matches.length-1];return De(r.route.id,`${a} can only be used on routes that contain a unique "id"`),r.route.id}function D1(){return bf("useRouteId")}function M1(){let a=R.useContext(yf),i=O1("useRouteError"),r=bf("useRouteError");return a!==void 0?a:i.errors?.[r]}function N1(){let{router:a}=C1("useNavigate"),i=bf("useNavigate"),r=R.useRef(!1);return $y(()=>{r.current=!0}),R.useCallback(async(c,f={})=>{St(r.current,Py),r.current&&(typeof c=="number"?await a.navigate(c):await a.navigate(c,{fromRouteId:i,...f}))},[a,i])}var ny={};function Wy(a,i,r){!i&&!ny[a]&&(ny[a]=!0,St(!1,r))}var ay={};function iy(a,i){!a&&!ay[i]&&(ay[i]=!0,console.warn(i))}var z1="useOptimistic",ly=U0[z1],U1=()=>{};function L1(a){return ly?ly(a):[a,U1]}function B1(a){let i={hasErrorBoundary:a.hasErrorBoundary||a.ErrorBoundary!=null||a.errorElement!=null};return a.Component&&(a.element&&St(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(i,{element:R.createElement(a.Component),Component:void 0})),a.HydrateFallback&&(a.hydrateFallbackElement&&St(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(i,{hydrateFallbackElement:R.createElement(a.HydrateFallback),HydrateFallback:void 0})),a.ErrorBoundary&&(a.errorElement&&St(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(i,{errorElement:R.createElement(a.ErrorBoundary),ErrorBoundary:void 0})),i}var j1=["HydrateFallback","hydrateFallbackElement"],H1=class{constructor(){this.status="pending",this.promise=new Promise((a,i)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",a(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",i(r))}})}};function q1({router:a,flushSync:i,onError:r,unstable_useTransitions:s}){s=f1()||s;let[f,h]=R.useState(a.state),[m,g]=L1(f),[y,b]=R.useState(),[p,w]=R.useState({isTransitioning:!1}),[D,B]=R.useState(),[q,X]=R.useState(),[V,Z]=R.useState(),$=R.useRef(new Map),be=R.useCallback((W,{deletedFetchers:ge,newErrors:Oe,flushSync:Re,viewTransitionOpts:we})=>{Oe&&r&&Object.values(Oe).forEach(Ye=>r(Ye,{location:W.location,params:W.matches[0]?.params??{},unstable_pattern:Cr(W.matches)})),W.fetchers.forEach((Ye,Te)=>{Ye.data!==void 0&&$.current.set(Te,Ye.data)}),ge.forEach(Ye=>$.current.delete(Ye)),iy(Re===!1||i!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let Le=a.window!=null&&a.window.document!=null&&typeof a.window.document.startViewTransition=="function";if(iy(we==null||Le,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!we||!Le){i&&Re?i(()=>h(W)):s===!1?h(W):R.startTransition(()=>{s===!0&&g(Ye=>ry(Ye,W)),h(W)});return}if(i&&Re){i(()=>{q&&(D?.resolve(),q.skipTransition()),w({isTransitioning:!0,flushSync:!0,currentLocation:we.currentLocation,nextLocation:we.nextLocation})});let Ye=a.window.document.startViewTransition(()=>{i(()=>h(W))});Ye.finished.finally(()=>{i(()=>{B(void 0),X(void 0),b(void 0),w({isTransitioning:!1})})}),i(()=>X(Ye));return}q?(D?.resolve(),q.skipTransition(),Z({state:W,currentLocation:we.currentLocation,nextLocation:we.nextLocation})):(b(W),w({isTransitioning:!0,flushSync:!1,currentLocation:we.currentLocation,nextLocation:we.nextLocation}))},[a.window,i,q,D,s,g,r]);R.useLayoutEffect(()=>a.subscribe(be),[a,be]),R.useEffect(()=>{p.isTransitioning&&!p.flushSync&&B(new H1)},[p]),R.useEffect(()=>{if(D&&y&&a.window){let W=y,ge=D.promise,Oe=a.window.document.startViewTransition(async()=>{s===!1?h(W):R.startTransition(()=>{s===!0&&g(Re=>ry(Re,W)),h(W)}),await ge});Oe.finished.finally(()=>{B(void 0),X(void 0),b(void 0),w({isTransitioning:!1})}),X(Oe)}},[y,D,a.window,s,g]),R.useEffect(()=>{D&&y&&m.location.key===y.location.key&&D.resolve()},[D,q,m.location,y]),R.useEffect(()=>{!p.isTransitioning&&V&&(b(V.state),w({isTransitioning:!0,flushSync:!1,currentLocation:V.currentLocation,nextLocation:V.nextLocation}),Z(void 0))},[p.isTransitioning,V]);let me=R.useMemo(()=>({createHref:a.createHref,encodeLocation:a.encodeLocation,go:W=>a.navigate(W),push:(W,ge,Oe)=>a.navigate(W,{state:ge,preventScrollReset:Oe?.preventScrollReset}),replace:(W,ge,Oe)=>a.navigate(W,{replace:!0,state:ge,preventScrollReset:Oe?.preventScrollReset})}),[a]),ye=a.basename||"/",C=R.useMemo(()=>({router:a,navigator:me,static:!1,basename:ye,onError:r}),[a,me,ye,r]);return R.createElement(R.Fragment,null,R.createElement(Ui.Provider,{value:C},R.createElement(Or.Provider,{value:m},R.createElement(Fy.Provider,{value:$.current},R.createElement(pf.Provider,{value:p},R.createElement(V1,{basename:ye,location:m.location,navigationType:m.historyAction,navigator:me,unstable_useTransitions:s},R.createElement(k1,{routes:a.routes,future:a.future,state:m,onError:r})))))),null)}function ry(a,i){return{...a,navigation:i.navigation.state!=="idle"?i.navigation:a.navigation,revalidation:i.revalidation!=="idle"?i.revalidation:a.revalidation,actionData:i.navigation.state!=="submitting"?i.actionData:a.actionData,fetchers:i.fetchers}}var k1=R.memo(Q1);function Q1({routes:a,future:i,state:r,onError:s}){return E1(a,void 0,r,s,i)}function Y1({to:a,replace:i,state:r,relative:s}){De(El(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=R.useContext(mn);St(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:f}=R.useContext(Gn),{pathname:h}=li(),m=gf(),g=fo(a,co(f),h,s==="path"),y=JSON.stringify(g);return R.useEffect(()=>{m(JSON.parse(y),{replace:i,state:r,relative:s})},[m,y,s,i,r]),null}function eg(a){return S1(a.context)}function V1({basename:a="/",children:i=null,location:r,navigationType:s="POP",navigator:c,static:f=!1,unstable_useTransitions:h}){De(!El(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=a.replace(/^\/*/,"/"),g=R.useMemo(()=>({basename:m,navigator:c,static:f,unstable_useTransitions:h,future:{}}),[m,c,f,h]);typeof r=="string"&&(r=ii(r));let{pathname:y="/",search:b="",hash:p="",state:w=null,key:D="default"}=r,B=R.useMemo(()=>{let q=Nn(y,m);return q==null?null:{location:{pathname:q,search:b,hash:p,state:w,key:D},navigationType:s}},[m,y,b,p,w,D,s]);return St(B!=null,`<Router basename="${m}"> is not able to match the URL "${y}${b}${p}" because it does not start with the basename, so the <Router> won't render anything.`),B==null?null:R.createElement(mn.Provider,{value:g},R.createElement(ho.Provider,{children:i,value:B}))}var Ws="get",eo="application/x-www-form-urlencoded";function mo(a){return typeof HTMLElement<"u"&&a instanceof HTMLElement}function G1(a){return mo(a)&&a.tagName.toLowerCase()==="button"}function K1(a){return mo(a)&&a.tagName.toLowerCase()==="form"}function X1(a){return mo(a)&&a.tagName.toLowerCase()==="input"}function Z1(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function F1(a,i){return a.button===0&&(!i||i==="_self")&&!Z1(a)}var Xs=null;function J1(){if(Xs===null)try{new FormData(document.createElement("form"),0),Xs=!1}catch{Xs=!0}return Xs}var P1=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Uc(a){return a!=null&&!P1.has(a)?(St(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${eo}"`),null):a}function $1(a,i){let r,s,c,f,h;if(K1(a)){let m=a.getAttribute("action");s=m?Nn(m,i):null,r=a.getAttribute("method")||Ws,c=Uc(a.getAttribute("enctype"))||eo,f=new FormData(a)}else if(G1(a)||X1(a)&&(a.type==="submit"||a.type==="image")){let m=a.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=a.getAttribute("formaction")||m.getAttribute("action");if(s=g?Nn(g,i):null,r=a.getAttribute("formmethod")||m.getAttribute("method")||Ws,c=Uc(a.getAttribute("formenctype"))||Uc(m.getAttribute("enctype"))||eo,f=new FormData(m,a),!J1()){let{name:y,type:b,value:p}=a;if(b==="image"){let w=y?`${y}.`:"";f.append(`${w}x`,"0"),f.append(`${w}y`,"0")}else y&&f.append(y,p)}}else{if(mo(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Ws,s=null,c=eo,h=a}return f&&c==="text/plain"&&(h=f,f=void 0),{action:s,method:r.toLowerCase(),encType:c,formData:f,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Sf(a,i){if(a===!1||a===null||typeof a>"u")throw new Error(i)}function I1(a,i,r,s){let c=typeof a=="string"?new URL(a,typeof window>"u"?"server://singlefetch/":window.location.origin):a;return r?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${s}`:c.pathname=`${c.pathname}.${s}`:c.pathname==="/"?c.pathname=`_root.${s}`:i&&Nn(c.pathname,i)==="/"?c.pathname=`${i.replace(/\/$/,"")}/_root.${s}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${s}`,c}async function W1(a,i){if(a.id in i)return i[a.id];try{let r=await import(a.module);return i[a.id]=r,r}catch(r){return console.error(`Error loading route module \`${a.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function eE(a){return a==null?!1:a.href==null?a.rel==="preload"&&typeof a.imageSrcSet=="string"&&typeof a.imageSizes=="string":typeof a.rel=="string"&&typeof a.href=="string"}async function tE(a,i,r){let s=await Promise.all(a.map(async c=>{let f=i.routes[c.route.id];if(f){let h=await W1(f,r);return h.links?h.links():[]}return[]}));return lE(s.flat(1).filter(eE).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function sy(a,i,r,s,c,f){let h=(g,y)=>r[y]?g.route.id!==r[y].route.id:!0,m=(g,y)=>r[y].pathname!==g.pathname||r[y].route.path?.endsWith("*")&&r[y].params["*"]!==g.params["*"];return f==="assets"?i.filter((g,y)=>h(g,y)||m(g,y)):f==="data"?i.filter((g,y)=>{let b=s.routes[g.route.id];if(!b||!b.hasLoader)return!1;if(h(g,y)||m(g,y))return!0;if(g.route.shouldRevalidate){let p=g.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(a,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function nE(a,i,{includeHydrateFallback:r}={}){return aE(a.map(s=>{let c=i.routes[s.route.id];if(!c)return[];let f=[c.module];return c.clientActionModule&&(f=f.concat(c.clientActionModule)),c.clientLoaderModule&&(f=f.concat(c.clientLoaderModule)),r&&c.hydrateFallbackModule&&(f=f.concat(c.hydrateFallbackModule)),c.imports&&(f=f.concat(c.imports)),f}).flat(1))}function aE(a){return[...new Set(a)]}function iE(a){let i={},r=Object.keys(a).sort();for(let s of r)i[s]=a[s];return i}function lE(a,i){let r=new Set;return new Set(i),a.reduce((s,c)=>{let f=JSON.stringify(iE(c));return r.has(f)||(r.add(f),s.push({key:f,link:c})),s},[])}function tg(){let a=R.useContext(Ui);return Sf(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function rE(){let a=R.useContext(Or);return Sf(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var Ef=R.createContext(void 0);Ef.displayName="FrameworkContext";function ng(){let a=R.useContext(Ef);return Sf(a,"You must render this element inside a <HydratedRouter> element"),a}function sE(a,i){let r=R.useContext(Ef),[s,c]=R.useState(!1),[f,h]=R.useState(!1),{onFocus:m,onBlur:g,onMouseEnter:y,onMouseLeave:b,onTouchStart:p}=i,w=R.useRef(null);R.useEffect(()=>{if(a==="render"&&h(!0),a==="viewport"){let q=V=>{V.forEach(Z=>{h(Z.isIntersecting)})},X=new IntersectionObserver(q,{threshold:.5});return w.current&&X.observe(w.current),()=>{X.disconnect()}}},[a]),R.useEffect(()=>{if(s){let q=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(q)}}},[s]);let D=()=>{c(!0)},B=()=>{c(!1),h(!1)};return r?a!=="intent"?[f,w,{}]:[f,w,{onFocus:pr(m,D),onBlur:pr(g,B),onMouseEnter:pr(y,D),onMouseLeave:pr(b,B),onTouchStart:pr(p,D)}]:[!1,w,{}]}function pr(a,i){return r=>{a&&a(r),r.defaultPrevented||i(r)}}function oE({page:a,...i}){let{router:r}=tg(),s=R.useMemo(()=>$a(r.routes,a,r.basename),[r.routes,a,r.basename]);return s?R.createElement(cE,{page:a,matches:s,...i}):null}function uE(a){let{manifest:i,routeModules:r}=ng(),[s,c]=R.useState([]);return R.useEffect(()=>{let f=!1;return tE(a,i,r).then(h=>{f||c(h)}),()=>{f=!0}},[a,i,r]),s}function cE({page:a,matches:i,...r}){let s=li(),{future:c,manifest:f,routeModules:h}=ng(),{basename:m}=tg(),{loaderData:g,matches:y}=rE(),b=R.useMemo(()=>sy(a,i,y,f,s,"data"),[a,i,y,f,s]),p=R.useMemo(()=>sy(a,i,y,f,s,"assets"),[a,i,y,f,s]),w=R.useMemo(()=>{if(a===s.pathname+s.search+s.hash)return[];let q=new Set,X=!1;if(i.forEach(Z=>{let $=f.routes[Z.route.id];!$||!$.hasLoader||(!b.some(be=>be.route.id===Z.route.id)&&Z.route.id in g&&h[Z.route.id]?.shouldRevalidate||$.hasClientLoader?X=!0:q.add(Z.route.id))}),q.size===0)return[];let V=I1(a,m,c.unstable_trailingSlashAwareDataRequests,"data");return X&&q.size>0&&V.searchParams.set("_routes",i.filter(Z=>q.has(Z.route.id)).map(Z=>Z.route.id).join(",")),[V.pathname+V.search]},[m,c.unstable_trailingSlashAwareDataRequests,g,s,f,b,i,a,h]),D=R.useMemo(()=>nE(p,f),[p,f]),B=uE(p);return R.createElement(R.Fragment,null,w.map(q=>R.createElement("link",{key:q,rel:"prefetch",as:"fetch",href:q,...r})),D.map(q=>R.createElement("link",{key:q,rel:"modulepreload",href:q,...r})),B.map(({key:q,link:X})=>R.createElement("link",{key:q,nonce:r.nonce,...X,crossOrigin:X.crossOrigin??r.crossOrigin})))}function fE(...a){return i=>{a.forEach(r=>{typeof r=="function"?r(i):r!=null&&(r.current=i)})}}var dE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{dE&&(window.__reactRouterVersion="7.13.0")}catch{}function hE(a,i){return kS({basename:i?.basename,getContext:i?.getContext,future:i?.future,history:nS({window:i?.window}),hydrationData:mE(),routes:a,mapRouteProperties:B1,hydrationRouteProperties:j1,dataStrategy:i?.dataStrategy,patchRoutesOnNavigation:i?.patchRoutesOnNavigation,window:i?.window,unstable_instrumentations:i?.unstable_instrumentations}).initialize()}function mE(){let a=window?.__staticRouterHydrationData;return a&&a.errors&&(a={...a,errors:pE(a.errors)}),a}function pE(a){if(!a)return null;let i=Object.entries(a),r={};for(let[s,c]of i)if(c&&c.__type==="RouteErrorResponse")r[s]=new Ar(c.status,c.statusText,c.data,c.internal===!0);else if(c&&c.__type==="Error"){if(c.__subType){let f=window[c.__subType];if(typeof f=="function")try{let h=new f(c.message);h.stack="",r[s]=h}catch{}}if(r[s]==null){let f=new Error(c.message);f.stack="",r[s]=f}}else r[s]=c;return r}var ag=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ig=R.forwardRef(function({onClick:i,discover:r="render",prefetch:s="none",relative:c,reloadDocument:f,replace:h,state:m,target:g,to:y,preventScrollReset:b,viewTransition:p,unstable_defaultShouldRevalidate:w,...D},B){let{basename:q,unstable_useTransitions:X}=R.useContext(mn),V=typeof y=="string"&&ag.test(y),Z=Ly(y,q);y=Z.to;let $=g1(y,{relative:c}),[be,me,ye]=sE(s,D),C=vE(y,{replace:h,state:m,target:g,preventScrollReset:b,relative:c,viewTransition:p,unstable_defaultShouldRevalidate:w,unstable_useTransitions:X});function W(Oe){i&&i(Oe),Oe.defaultPrevented||C(Oe)}let ge=R.createElement("a",{...D,...ye,href:Z.absoluteURL||$,onClick:Z.isExternal||f?i:W,ref:fE(B,me),target:g,"data-discover":!V&&r==="render"?"true":void 0});return be&&!V?R.createElement(R.Fragment,null,ge,R.createElement(oE,{page:$})):ge});ig.displayName="Link";var lg=R.forwardRef(function({"aria-current":i="page",caseSensitive:r=!1,className:s="",end:c=!1,style:f,to:h,viewTransition:m,children:g,...y},b){let p=xr(h,{relative:y.relative}),w=li(),D=R.useContext(Or),{navigator:B,basename:q}=R.useContext(mn),X=D!=null&&wE(p)&&m===!0,V=B.encodeLocation?B.encodeLocation(p).pathname:p.pathname,Z=w.pathname,$=D&&D.navigation&&D.navigation.location?D.navigation.location.pathname:null;r||(Z=Z.toLowerCase(),$=$?$.toLowerCase():null,V=V.toLowerCase()),$&&q&&($=Nn($,q)||$);const be=V!=="/"&&V.endsWith("/")?V.length-1:V.length;let me=Z===V||!c&&Z.startsWith(V)&&Z.charAt(be)==="/",ye=$!=null&&($===V||!c&&$.startsWith(V)&&$.charAt(V.length)==="/"),C={isActive:me,isPending:ye,isTransitioning:X},W=me?i:void 0,ge;typeof s=="function"?ge=s(C):ge=[s,me?"active":null,ye?"pending":null,X?"transitioning":null].filter(Boolean).join(" ");let Oe=typeof f=="function"?f(C):f;return R.createElement(ig,{...y,"aria-current":W,className:ge,ref:b,style:Oe,to:h,viewTransition:m},typeof g=="function"?g(C):g)});lg.displayName="NavLink";var yE=R.forwardRef(({discover:a="render",fetcherKey:i,navigate:r,reloadDocument:s,replace:c,state:f,method:h=Ws,action:m,onSubmit:g,relative:y,preventScrollReset:b,viewTransition:p,unstable_defaultShouldRevalidate:w,...D},B)=>{let{unstable_useTransitions:q}=R.useContext(mn),X=EE(),V=TE(m,{relative:y}),Z=h.toLowerCase()==="get"?"get":"post",$=typeof m=="string"&&ag.test(m),be=me=>{if(g&&g(me),me.defaultPrevented)return;me.preventDefault();let ye=me.nativeEvent.submitter,C=ye?.getAttribute("formmethod")||h,W=()=>X(ye||me.currentTarget,{fetcherKey:i,method:C,navigate:r,replace:c,state:f,relative:y,preventScrollReset:b,viewTransition:p,unstable_defaultShouldRevalidate:w});q&&r!==!1?R.startTransition(()=>W()):W()};return R.createElement("form",{ref:B,method:Z,action:V,onSubmit:s?g:be,...D,"data-discover":!$&&a==="render"?"true":void 0})});yE.displayName="Form";function gE(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function rg(a){let i=R.useContext(Ui);return De(i,gE(a)),i}function vE(a,{target:i,replace:r,state:s,preventScrollReset:c,relative:f,viewTransition:h,unstable_defaultShouldRevalidate:m,unstable_useTransitions:g}={}){let y=gf(),b=li(),p=xr(a,{relative:f});return R.useCallback(w=>{if(F1(w,i)){w.preventDefault();let D=r!==void 0?r:Wn(b)===Wn(p),B=()=>y(a,{replace:D,state:s,preventScrollReset:c,relative:f,viewTransition:h,unstable_defaultShouldRevalidate:m});g?R.startTransition(()=>B()):B()}},[b,y,p,r,s,i,a,c,f,h,m,g])}var bE=0,SE=()=>`__${String(++bE)}__`;function EE(){let{router:a}=rg("useSubmit"),{basename:i}=R.useContext(mn),r=D1(),s=a.fetch,c=a.navigate;return R.useCallback(async(f,h={})=>{let{action:m,method:g,encType:y,formData:b,body:p}=$1(f,i);if(h.navigate===!1){let w=h.fetcherKey||SE();await s(w,r,h.action||m,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:b,body:p,formMethod:h.method||g,formEncType:h.encType||y,flushSync:h.flushSync})}else await c(h.action||m,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:b,body:p,formMethod:h.method||g,formEncType:h.encType||y,replace:h.replace,state:h.state,fromRouteId:r,flushSync:h.flushSync,viewTransition:h.viewTransition})},[s,c,i,r])}function TE(a,{relative:i}={}){let{basename:r}=R.useContext(mn),s=R.useContext(Gn);De(s,"useFormAction must be used inside a RouteContext");let[c]=s.matches.slice(-1),f={...xr(a||".",{relative:i})},h=li();if(a==null){f.search=h.search;let m=new URLSearchParams(f.search),g=m.getAll("index");if(g.some(b=>b==="")){m.delete("index"),g.filter(p=>p).forEach(p=>m.append("index",p));let b=m.toString();f.search=b?`?${b}`:""}}return(!a||a===".")&&c.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(f.pathname=f.pathname==="/"?r:In([r,f.pathname])),Wn(f)}function wE(a,{relative:i}={}){let r=R.useContext(pf);De(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=rg("useViewTransitionState"),c=xr(a,{relative:i});if(!r.isTransitioning)return!1;let f=Nn(r.currentLocation.pathname,s)||r.currentLocation.pathname,h=Nn(r.nextLocation.pathname,s)||r.nextLocation.pathname;return oo(c.pathname,h)!=null||oo(c.pathname,f)!=null}function _E(a){return R.createElement(q1,{flushSync:Cy.flushSync,...a})}function RE(){return se.jsx("div",{className:"min-h-screen bg-background text-foreground",children:se.jsx(eg,{})})}const sg=(...a)=>a.filter((i,r,s)=>!!i&&i.trim()!==""&&s.indexOf(i)===r).join(" ").trim();const AE=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const CE=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,r,s)=>s?s.toUpperCase():r.toLowerCase());const oy=a=>{const i=CE(a);return i.charAt(0).toUpperCase()+i.slice(1)};var OE={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const xE=a=>{for(const i in a)if(i.startsWith("aria-")||i==="role"||i==="title")return!0;return!1};const DE=R.forwardRef(({color:a="currentColor",size:i=24,strokeWidth:r=2,absoluteStrokeWidth:s,className:c="",children:f,iconNode:h,...m},g)=>R.createElement("svg",{ref:g,...OE,width:i,height:i,stroke:a,strokeWidth:s?Number(r)*24/Number(i):r,className:sg("lucide",c),...!f&&!xE(m)&&{"aria-hidden":"true"},...m},[...h.map(([y,b])=>R.createElement(y,b)),...Array.isArray(f)?f:[f]]));const Dr=(a,i)=>{const r=R.forwardRef(({className:s,...c},f)=>R.createElement(DE,{ref:f,iconNode:i,className:sg(`lucide-${AE(oy(a))}`,`lucide-${a}`,s),...c}));return r.displayName=oy(a),r};const ME=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],NE=Dr("arrow-left",ME);const zE=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],UE=Dr("bell",zE);const LE=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],BE=Dr("cpu",LE);const jE=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],HE=Dr("folder-git-2",jE);const qE=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],kE=Dr("languages",qE),QE="/api";class YE{baseUrl;constructor(i){this.baseUrl=i}async request(i,r={}){const{params:s,...c}=r;let f=`${this.baseUrl}${i}`;if(s){const g=new URLSearchParams(s);f+=`?${g.toString()}`}const h={...c.headers};c.body!==void 0&&(h["Content-Type"]="application/json");const m=await fetch(f,{...c,headers:h});if(!m.ok){const g=await m.json().catch(()=>({}));throw new VE(m.status,g.message||g.error||"Request failed")}if(m.status!==204)return m.json()}get(i,r){return this.request(i,{...r,method:"GET"})}post(i,r,s){return this.request(i,{...s,method:"POST",body:r?JSON.stringify(r):void 0})}put(i,r,s){return this.request(i,{...s,method:"PUT",body:r?JSON.stringify(r):void 0})}patch(i,r,s){return this.request(i,{...s,method:"PATCH",body:r?JSON.stringify(r):void 0})}delete(i,r){return this.request(i,{...r,method:"DELETE"})}}class VE extends Error{status;constructor(i,r){super(r),this.name="ApiError",this.status=i}}const Ra=new YE(QE),mt={projects:{all:["projects"],list:a=>["projects","list",a],detail:a=>["projects","detail",a]},tasks:{all:["tasks"],list:(a,i)=>["tasks","list",a,i],detail:a=>["tasks","detail",a],stats:a=>["tasks","stats",a]},workspaces:{all:["workspaces"],list:a=>["workspaces","list",a],detail:a=>["workspaces","detail",a],diff:a=>["workspaces","diff",a],gitStatus:a=>["workspaces","gitStatus",a]},sessions:{all:["sessions"],detail:a=>["sessions","detail",a]},files:{all:["files"],tree:(a,i)=>["files","tree",a,i],content:(a,i)=>["files","content",a,i]},git:{all:["git"],changes:a=>["git","changes",a],diff:(a,i,r)=>["git","diff",a,i,r],log:a=>["git","log",a],commitFiles:(a,i)=>["git","commitFiles",a,i],commitDiff:(a,i,r)=>["git","commitDiff",a,i,r]},profiles:{all:["profiles"],defaults:["profiles","defaults"],agent:a=>["profiles","agent",a],variant:(a,i)=>["profiles","variant",a,i]},providers:{all:["providers"],detail:a=>["providers","detail",a]},tunnel:{status:["tunnel","status"]},notifications:{settings:["notifications","settings"]},appSettings:{detail:["app-settings"]},system:{cursorAgentModels:["system","cursor-agent-models"],slashCommandCatalog:(a,i)=>["system","slash-command-catalog",a??null,i??null],skillCatalog:(a,i)=>["system","skill-catalog",a??null,i??null]}};function GE(){return uo({queryKey:mt.appSettings.detail,queryFn:()=>Ra.get("/app-settings")})}function KE(){const a=ni();return Rr({mutationFn:i=>Ra.put("/app-settings",i),onSuccess:()=>{a.invalidateQueries({queryKey:mt.appSettings.detail})}})}function m2(){return uo({queryKey:[...mt.appSettings.detail,"commit-message-defaults"],queryFn:()=>Ra.get("/app-settings/commit-message-defaults")})}const XE={"zh-CN":{Settings:"设置",General:"通用",Back:"返回","Loading...":"加载中...","No options":"暂无选项","Processing...":"处理中...",Confirm:"确认",Cancel:"取消","General Settings":"通用设置","Display Language":"显示语言","Choose the interface language. The setting is saved to the local Agent Tower database and will still apply after restart.":"选择界面语言。设置会保存到本地 Agent Tower 数据库,并在重新打开后继续生效。",English:"English","Simplified Chinese":"简体中文","Language setting":"语言设置","Language setting could not be saved":"语言设置保存失败","Browse and select a Git repository, or type a path and press Enter":"浏览并选择一个 Git 仓库,或输入路径后按 Enter","Agent 配置":"Agent 配置",项目配置:"项目配置",通知:"通知",通用:"通用","AI Agent Task Management Dashboard":"AI Agent 任务管理面板","Project Management":"项目管理","Manage your AI agent projects":"管理你的 AI Agent 项目","View Projects":"查看项目","Task Board":"任务看板","Kanban-style task management":"Kanban 风格的任务管理","Open Board":"打开看板",Workspace:"工作区","Git worktree isolated environments":"Git Worktree 隔离环境","Manage Workspaces":"管理工作区","Move to":"移动到","Delete Task":"删除任务","Drop into {title}":"放入 {title}","Drop here":"拖到此处","No tasks":"暂无任务","All Projects":"所有项目","Select View":"选择视图","Create New Project...":"创建新项目...","New Task":"新建任务","{count} tasks":"{count} 个任务","Clear filter":"清除筛选",Review:"待审查",Running:"进行中",Pending:"待开始",Done:"已完成",Cancelled:"已取消",Changes:"变更",History:"历史",Editor:"编辑器",Terminal:"终端",Preview:"预览","Coming soon...":"即将推出...",Modified:"已修改",Added:"已新增",Deleted:"已删除",Renamed:"已重命名","Loading diff...":"正在加载差异...","Failed to load diff.":"加载差异失败。","No diff content available.":"没有可显示的差异内容。","No workspace selected.":"未选择工作区。","Loading changes...":"正在加载变更...","Failed to load changes.":"加载变更失败。","No pending changes":"暂无待处理变更",Uncommitted:"未提交",Committed:"已提交","Select a file to view diff":"选择一个文件以查看差异","{count}s ago":"{count} 秒前","{count}m ago":"{count} 分钟前","{count}h ago":"{count} 小时前","{count}d ago":"{count} 天前","Loading files...":"正在加载文件列表...","No files changed":"没有文件变更","Loading history...":"正在加载历史记录...","Failed to load history.":"加载历史记录失败。","No commit history":"暂无提交历史","Load more":"加载更多","Select a commit to view changes":"选择一个提交以查看变更","Zoom out":"缩小","Reset zoom":"重置缩放","Zoom in":"放大","Fit to view":"适应视图","Failed to load image.":"加载图片失败。","Close tab":"关闭标签页",Close:"关闭","Expand file tree":"展开文件树","No open files":"暂无打开文件",Saving:"保存中",Unsaved:"未保存","Select a file from the tree to open.":"从文件树中选择一个文件以打开。","Loading file...":"正在加载文件...","Failed to load file":"加载文件失败","Failed to load":"加载失败",Files:"文件","No working directory":"未选择工作目录","Refresh file tree":"刷新文件树","Collapse file tree":"收起文件树","Shell {count}":"终端 {count}","New Terminal":"新终端","No terminals open":"暂无打开终端",Disconnected:"未连接","Connecting...":"连接中...",Connected:"已连接","No active session":"暂无活动会话","Create a workspace and start a session to see terminal output.":"创建工作区并启动会话后即可查看终端输出。","Process exited with code {code}":"进程已退出,退出码 {code}","Error: {message}":"错误: {message}","Session: {id}":"会话: {id}","Tunnel active":"隧道已启用","Share via tunnel":"通过隧道分享","Tunnel Active":"隧道已启用","Token protected":"受 Token 保护","Copy shareable link":"复制分享链接","Hide token":"隐藏 Token","Show token":"显示 Token","Copy token":"复制 Token","Stopping...":"停止中...","Stop Tunnel":"停止隧道","Create & Start":"创建并启动","Creating Task...":"正在创建任务...","Creating Workspace...":"正在创建工作区...","Creating Session...":"正在创建会话...","Starting Agent...":"正在启动 Agent...","Create New Project":"创建新项目","Creating...":"创建中...",Create:"创建","Create Project":"创建项目","Project Name":"项目名称","e.g., Agent Tower":"例如:Agent Tower","Repository Path":"仓库路径","Create New Task":"创建新任务",Project:"项目",Provider:"Provider",Agent:"Agent","Select project...":"选择项目...","Select provider...":"选择 Provider...","Task Title":"任务标题","e.g., Implement login flow":"例如:实现登录流程",Description:"描述","Optional...":"可选...","Optional description...":"可选描述...","Drop files here":"将文件拖到这里","Attach files":"添加文件","or paste files":"或粘贴文件","or paste/drag files":"或粘贴/拖拽文件","Drag to resize":"拖动以调整大小","Failed to create project":"创建项目失败","Select a task from the sidebar to view logs, monitor execution, or interact with an agent.":"从侧边栏选择一个任务,以查看日志、监控执行过程,或与 Agent 交互。","Open in IDE":"在 IDE 中打开","Toggle Workspace":"切换工作区面板","More actions":"更多操作","No description":"暂无描述","Setup ({current}/{total}): {command}":"Setup({current}/{total}):{command}","Loading logs...":"正在加载日志...","Waiting for agent output...":"等待 Agent 输出...","No logs recorded for this session.":"当前会话暂无日志记录。","Scroll to bottom":"滚动到底部","Drop files here...":"将文件拖到这里...","Continue conversation...":"继续对话...","Message Agent...":"给 Agent 发送消息...","Upload file":"上传文件"},en:{设置:"Settings",通用:"General",返回:"Back","加载中...":"Loading...",暂无选项:"No options","处理中...":"Processing...",确认:"Confirm",取消:"Cancel",通用设置:"General Settings",显示语言:"Display Language","选择界面语言。设置会保存到本地 Agent Tower 数据库,并在重新打开后继续生效。":"Choose the interface language. The setting is saved to the local Agent Tower database and will still apply after restart.",简体中文:"Simplified Chinese",语言设置:"Language setting",语言设置保存失败:"Language setting could not be saved","Agent 配置":"Agent Settings",项目配置:"Project Settings",通知:"Notifications","暂无项目,请先创建项目":"No projects yet. Create one first.",选择项目:"Select Project","选择项目...":"Select project...",自动复制文件:"Auto-copy Files","创建 worktree 时自动从主仓库复制的文件或目录。支持 glob 模式。":"Files or directories to copy from the main repository when creating a worktree. Glob patterns are supported.","适用于不在 git 管理中但启动必需的文件,如 .env、node_modules、数据库文件等":"Useful for required startup files that are not tracked by git, such as .env, node_modules, or database files.","Setup 脚本":"Setup Script","创建 worktree 后自动执行的命令,每行一条,按顺序执行。":"Commands to run automatically after creating the worktree, one per line in order.","命令在 worktree 目录下执行,单条命令超时 5 分钟,失败不会阻断后续命令":"Commands run inside the worktree directory. Each command times out after 5 minutes, and a failure does not block later commands.",常用命令:"Quick Commands","在终端中可快速执行的命令,不会自动运行。":"Commands that can be run quickly in the terminal. They are not executed automatically.","保存中...":"Saving...",保存:"Save",系统通知:"System Notifications",任务完成时弹出桌面通知:"Show a desktop notification when a task finishes.",第三方通知:"Third-party Notifications",选择一个第三方渠道接收通知:"Choose a third-party channel to receive notifications.",无:"None",飞书:"Feishu",测试发送:"Send Test",发送成功:"Sent successfully",发送失败:"Send failed","跳转地址(用于生成任务链接)":"Base URL (used to generate task links)",'通知卡片中的"查看任务"按钮将跳转到 {path}':'The "View Task" button in the notification card will open {path}',通知模板:"Notification Templates","支持变量: {taskTitle}, {taskId}, {projectId}, {projectName}, {status}":"Supported variables: {taskTitle}, {taskId}, {projectId}, {projectName}, {status}",标题模板:"Title Template",内容模板:"Body Template",'✅ "{taskTitle}" 已完成,等待审查':'✅ "{taskTitle}" is complete and ready for review',保存所有更改:"Save All Changes","启动失败: {message}":"Start failed: {message}",未知错误:"Unknown error",会话已停止:"Session stopped","Agent 交互演示":"Agent Interaction Demo","选择 Agent":"Select Agent","输入你的问题或任务...":"Enter your question or task...","启动中...":"Starting...",开始:"Start",对话:"Conversation",已连接:"Connected","连接中...":"Connecting...",未连接:"Disconnected",停止:"Stop","选择 Agent 并输入问题开始对话":"Select an agent and enter a prompt to start chatting.",你:"You","发送后续消息...":"Send a follow-up message...",发送:"Send",新会话:"New Session",未选择:"Not selected",连接:"Connection","Profiles 设置":"Profile Settings","配置变体 (Profile Variant)":"Profile Variant",输入任务:"Task Input","等待 Agent 响应...":"Waiting for agent output...","发送消息给 Agent...":"Send a message to the agent...","启动失败,请重试":"Failed to start. Please try again.",启动:"Start","创建工作空间...":"Creating workspace...","创建会话...":"Creating session...","启动 Agent...":"Starting agent...","启动 Agent":"Start Agent","选择 Provider":"Select Provider"," (不可用)":" (Unavailable)",任务描述:"Task Description","描述你想让 Agent 完成的任务...":"Describe the task you want the agent to complete...","输入文件路径...":"Enter a file path...",添加:"Add",添加此目录:"Add this directory",名称:"Name",命令:"Command",切换渠道:"Switch Provider","(默认)":"(Default)","留空为 auto;或直接输入模型 ID(与 cursor-agent --model 一致)":"Leave empty for auto, or enter a model ID directly (same as cursor-agent --model).","正在加载 cursor-agent 模型列表…":"Loading cursor-agent model list...",收起列表:"Collapse List","从本机 cursor-agent 选择({count} 个)":"Choose from local cursor-agent ({count})","筛选模型…":"Filter models...","默认 (auto)":"Default (auto)",无匹配项:"No matches",请求失败:"Request failed","无法从本机加载模型列表({error})。仍可手动输入;或在安装 cursor-agent 的机器上运行":"Could not load models from the local machine ({error}). You can still enter one manually, or run","查看 ID。":"to inspect available IDs.","JSON 格式错误":"Invalid JSON format","确定删除 {agentType} / {variant}?":"Delete {agentType} / {variant}?",新增:"New",内置:"Built-in","新增 Variant — {agentType}":"New Variant — {agentType}","编辑 {variant}":"Edit {variant}","Variant 名称":"Variant Name","例如: CUSTOM":"e.g. CUSTOM","配置 (JSON)":"Configuration (JSON)","状态变更失败,该操作不被允许":"Status change failed. This action is not allowed.","Git 操作":"Git Operations",删除任务:"Delete Task","Setup 完成":"Setup complete","Setup 失败: {error}":"Setup failed: {error}","尚未启动 Agent":"No agent started yet","选择一个 Agent 来执行此任务":"Choose an agent to execute this task.","选择一个 Agent 来执行此任务,Agent 将自动创建工作空间并开始工作。":"Choose an agent to execute this task. The agent will create a workspace automatically and start working.",回到底部:"Back to Bottom","代码已合并,以上为历史沟通记录":"The code has been merged. The conversation above is historical.","启动新 Agent":"Start New Agent","确认删除任务「{title}」?此操作不可撤销。":'Delete task "{title}"? This action cannot be undone.',删除:"Delete","正在运行的 Agent 将被停止":"The running agent will be stopped.",分支上未合并的变更将丢失:"Unmerged changes on the branch will be lost.","关联的工作目录(worktree)将被清理":"The associated worktree directory will be cleaned up.","{opLabel} 冲突 — {count} 个文件":"{opLabel} conflicts — {count} files",中止操作:"Abort Operation",解决冲突:"Resolve Conflicts","解决 {opLabel} 冲突":"Resolve {opLabel} Conflicts","在 IDE 中打开":"Open in IDE","发送中...":"Sending...","AI 辅助解决":"Resolve with AI","冲突文件({count})":"Conflicted Files ({count})","选择 Session(AI 辅助解决)":"Choose Session (Resolve with AI)","选择一个 Session...":"Select a session...","没有可用的 Session,请在 IDE 中手动解决冲突。":"No session is available. Please resolve the conflicts manually in your IDE.",快捷命令:"Quick Commands",待办:"Todos","上下文: {used} / {max} tokens":"Context: {used} / {max} tokens","已使用: {used} tokens":"Used: {used} tokens",可用:"Available",不可用:"Unavailable",该类型暂无运行配置:"No runtime configuration is available for this type.","追加 Prompt":"Append Prompt","追加到每次 prompt 末尾的文本":"Text appended to the end of every prompt.",跳过权限确认:"Skip Permission Confirmation",模型:"Model",强制执行:"Force Execution",跳过所有确认和沙盒:"Skip All Confirmations and Sandbox",Profile:"Profile","~/.codex/config.toml 中的 profile 名称":"Profile name in ~/.codex/config.toml",是:"Yes",否:"No",覆盖:"Overwrite",跳过:"Skip","JSON 语法错误":"Invalid JSON syntax","TOML 语法错误: {message}":"Invalid TOML syntax: {message}","编辑 Provider":"Edit Provider","新建 Provider":"New Provider","例如: Claude Code (官方)":"e.g. Claude Code (Official)","Agent 类型":"Agent Type","选择 Agent 类型":"Select Agent Type","设为该类型的默认 Provider":"Set as the default provider for this agent type",运行配置:"Runtime Configuration",环境变量:"Environment Variables","注入到 Agent 进程的环境变量。Codex 的":"Environment variables injected into the agent process. Codex","指定的是变量名,实际值需在此处设置。":"specifies the variable name in env_key, and the actual value must be set here.","变量名,如 AZURE_OPENAI_API_KEY":"Variable name, e.g. AZURE_OPENAI_API_KEY",值:"Value",添加变量:"Add Variable","CLI 原生配置 (config.toml)":"Native CLI Config (config.toml)","CLI 原生配置 (settings.json)":"Native CLI Config (settings.json)","直接填写 Codex":"Enter a Codex","格式的配置片段,通过":"configuration snippet directly and inject it via","参数注入。不会修改你的":". It will not modify your","文件。":"file.","对应 Claude Code 的":"This corresponds to Claude Code",通过:"and is injected through","参数注入。在":". Configure","中设置 ANTHROPIC_API_KEY、ANTHROPIC_BASE_URL 等。":"inside env, such as ANTHROPIC_API_KEY and ANTHROPIC_BASE_URL.","导出 Provider 备份":"Export Provider Backup","导出中...":"Exporting...",导出备份:"Export Backup","导出的备份文件将包含完整的 Provider 配置,包括环境变量、CLI settings 等敏感信息。任何拿到文件的人都可能直接使用这些 Provider。":"The exported backup file contains the full provider configuration, including sensitive information such as environment variables and CLI settings. Anyone with this file may be able to use those providers directly.","这个功能用于备份和迁移,不用于分享配置。":"This feature is for backup and migration, not for sharing configuration.","导出内容只包含用户层配置:自定义 Provider,以及对内置 Provider 的覆盖。":"The export only contains user-level configuration: custom providers and overrides of built-in providers.","我已知晓该备份文件包含敏感信息,只会保存在安全位置。":"I understand that this backup contains sensitive information and will only store it in a secure location.","导入 Provider 备份":"Import Provider Backup","导入中...":"Importing...","确认导入 {count} 项":"Import {count} item(s)","导出时间:{value}":"Exported at: {value}","模式:完整备份(含敏感信息)":"Mode: Full backup (contains sensitive data)","文件内 Provider 数量:{count}":"Providers in file: {count}","将覆盖当前已有的 Provider:{name}":"This will overwrite the existing provider: {name}","当前同 ID Provider 配置一致,本次不会重复写入。":"The provider with the same ID is already identical. It will not be written again.","当前不存在同 ID Provider,将直接新增。":"No provider with the same ID exists. It will be created directly.","系统内置 Provider 不可删除":"Built-in providers cannot be deleted.","已恢复默认 Provider 配置":"Default provider configuration restored.","Provider 已删除":"Provider deleted.","删除 Provider 失败":"Failed to delete provider.","Provider 备份已导出":"Provider backup exported.","导出 Provider 备份失败":"Failed to export provider backup.","备份文件不是有效的 JSON":"The backup file is not valid JSON.",导入预览失败:"Failed to preview import.","导入完成,当前配置无需变更":"Import complete. No changes were needed.","导入完成:新增 {create},覆盖 {overwrite},跳过 {skip}":"Import complete: created {create}, overwritten {overwrite}, skipped {skip}","导入 Provider 备份失败":"Failed to import provider backup.","Provider 配置":"Provider Configuration","管理 AI Agent 的连接配置和运行参数":"Manage AI agent connection settings and runtime parameters.",导入备份:"Import Backup","暂无 Provider 配置":"No providers configured yet.",默认:"Default","CLI 配置:":"CLI Config:",已配置:"Configured","环境变量:":"Environment Variables:",编辑:"Edit",删除自定义覆盖并恢复默认:"Delete custom override and restore default","恢复默认 Provider":"Restore Default Provider",'确定删除 "{name}" 的自定义覆盖,并恢复系统默认配置?':'Delete the custom override for "{name}" and restore the system default configuration?','确定删除 "{name}"?此操作不可撤销。':'Delete "{name}"? This action cannot be undone.',恢复默认:"Restore Default","{count} 个未提交变更":"{count} uncommitted changes","{count} 个冲突文件":"{count} conflicted files",变基进行中:"Rebase in progress",合并进行中:"Merge in progress","领先 {count} 个提交":"{count} commits ahead","落后 {count} 个提交":"{count} commits behind",已是最新:"Up to date","工作区有未提交的变更,请先让 Agent 提交或手动处理后再执行 Rebase / Merge 操作。":"The workspace has uncommitted changes. Ask the agent to commit them or handle them manually before running Rebase / Merge.",变基失败:"Rebase failed",合并失败:"Merge failed",确认合并:"Confirm Merge","加载分支状态...":"Loading branch status...","变基中...":"Rebasing...","变基 (Rebase)":"Rebase","将当前分支变基到最新的 {targetBranch}":"Rebase the current branch onto the latest {targetBranch}","合并 (Merge)":"Merge","合并中...":"Merging...","Squash merge 到 {targetBranch}":"Squash merge into {targetBranch}",提交消息:"Commit Message","输入提交消息...":"Enter commit message...",留空将使用默认消息:"Leave blank to use the default message.","Git Commit Message":"Git Commit Message","配置自动生成 commit message 时使用的 Agent 渠道和提示词。":"Configure the agent provider and prompt used for auto-generating commit messages.","Agent 渠道":"Agent Provider",跟随任务:"Follow Task",'"跟随任务"表示使用当前任务所用的 Agent 渠道。选择具体渠道可使用更经济的模型。':'"Follow Task" uses the same provider as the current task. Select a specific provider to use a more cost-effective model.',提示词模板:"Prompt Template","自定义生成 commit message 的提示词。留空则使用内置默认模板。":"Custom prompt for generating commit messages. Leave empty to use the built-in default template.",保存失败:"Save failed",已保存:"Saved"}},og=R.createContext(null);function ZE(a){return a?a==="en"?"en":a==="zh-CN"?"zh-CN":null:null}function FE(){return typeof navigator>"u"||navigator.language.toLowerCase().startsWith("zh")?"zh-CN":"en"}function JE(a,i){if(!i)return a;let r=a;for(const[s,c]of Object.entries(i))r=r.replaceAll(`{${s}}`,String(c??""));return r}let Pc="zh-CN";function ug(a,i,r){const s=XE[a][i]??i;return JE(s,r)}function PE(a,i){return ug(Pc,a,i)}function $E({children:a}){const i=R.useRef(FE()),[r,s]=R.useState(i.current),{data:c}=GE(),f=KE(),h=R.useRef(!1),m=R.useCallback(b=>{Pc=b,s(b),document.documentElement.lang=b},[]);R.useEffect(()=>{const b=ZE(c?.locale)??i.current;m(b),c&&c.locale===null&&!h.current&&(h.current=!0,f.mutate({locale:b}))},[c,m,f]);const g=R.useCallback(b=>{const p=Pc;m(b),f.mutate({locale:b},{onError:()=>{m(p),qb.error(PE("语言设置保存失败"))}})},[m,f]),y=R.useMemo(()=>({locale:r,setLocale:g,t:(b,p)=>ug(r,b,p)}),[r,g]);return se.jsx(og.Provider,{value:y,children:a})}function cg(){const a=R.useContext(og);if(!a)throw new Error("useI18n must be used within I18nProvider");return a}const IE=[{to:"/settings/general",label:"通用",icon:kE},{to:"/settings/agents",label:"Agent 配置",icon:BE},{to:"/settings/projects",label:"项目配置",icon:HE},{to:"/settings/notifications",label:"通知",icon:UE}],WE=se.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-neutral-900",children:[se.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z",fill:"currentColor"}),se.jsx("path",{d:"M2 17L12 22L22 17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),se.jsx("path",{d:"M2 12L12 17L22 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]});function eT(){const a=gf(),{t:i}=cg();return se.jsxs("div",{className:"h-screen flex flex-col bg-white",children:[se.jsxs("header",{className:"h-12 flex items-center justify-between px-4 border-b border-neutral-100 bg-white shrink-0 z-30",children:[se.jsxs("div",{className:"flex items-center gap-2.5",children:[WE,se.jsx("span",{className:"text-sm font-bold tracking-tight text-neutral-900",children:"Agent Tower"}),se.jsx("span",{className:"text-neutral-200 text-sm",children:"/"}),se.jsx("span",{className:"text-sm text-neutral-500",children:i("设置")})]}),se.jsxs("button",{onClick:()=>a("/"),className:"flex items-center gap-1.5 text-xs text-neutral-400 hover:text-neutral-900 transition-colors",children:[se.jsx(NE,{size:14}),se.jsx("span",{children:i("返回")})]})]}),se.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[se.jsx("nav",{className:"w-48 border-r border-neutral-100 pt-3 px-2 shrink-0",children:IE.map(r=>se.jsxs(lg,{to:r.to,className:({isActive:s})=>`flex items-center gap-2 px-3 py-1.5 rounded-md text-[13px] transition-colors ${s?"bg-neutral-100 text-neutral-900 font-medium":"text-neutral-500 hover:text-neutral-900 hover:bg-neutral-50"}`,children:[se.jsx(r.icon,{size:14}),se.jsx("span",{children:i(r.label)})]},r.to))}),se.jsx("div",{className:"flex-1 overflow-y-auto",children:se.jsx(eg,{})})]})]})}const tT=R.lazy(()=>ai(()=>import("./ProjectKanbanPage-DNCKy0g4.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(a=>({default:a.ProjectKanbanPage}))),nT=R.lazy(()=>ai(()=>import("./DemoPage-_dT9rdpV.js"),__vite__mapDeps([15,9,5])).then(a=>({default:a.DemoPage}))),aT=R.lazy(()=>ai(()=>import("./AgentDemoPage-CB48v8IV.js"),__vite__mapDeps([16,1,2,3,4,5,6,9,17])).then(a=>({default:a.AgentDemoPage}))),iT=R.lazy(()=>ai(()=>import("./GeneralSettingsPage-DtD_oirE.js"),__vite__mapDeps([18,13,5,4,12])).then(a=>({default:a.GeneralSettingsPage}))),lT=R.lazy(()=>ai(()=>import("./ProfileSettingsPage-BaFNyfse.js"),__vite__mapDeps([19,17,9,5,7,20])).then(a=>({default:a.ProfileSettingsPage}))),rT=R.lazy(()=>ai(()=>import("./ProviderSettingsPage-BqmSJV2I.js"),__vite__mapDeps([21,12,9,5,8,7,13,4,2,20,22])).then(a=>({default:a.ProviderSettingsPage}))),sT=R.lazy(()=>ai(()=>import("./NotificationSettingsPage-DQqz8xJs.js"),__vite__mapDeps([23,9,5,13,4,11,22,24])).then(a=>({default:a.NotificationSettingsPage}))),oT=R.lazy(()=>ai(()=>import("./ProjectSettingsPage-Cv6VpL1g.js"),__vite__mapDeps([25,9,5,13,4,10,7,26,3,11,24])).then(a=>({default:a.ProjectSettingsPage})));function Pa(){const{t:a}=cg();return se.jsx("div",{className:"p-8",children:a("Loading...")})}const uT=hE([{path:"/",element:se.jsx(RE,{}),children:[{index:!0,element:se.jsx(R.Suspense,{fallback:se.jsx(Pa,{}),children:se.jsx(tT,{})})},{path:"demo",element:se.jsx(R.Suspense,{fallback:se.jsx(Pa,{}),children:se.jsx(nT,{})})},{path:"agent-demo",element:se.jsx(R.Suspense,{fallback:se.jsx(Pa,{}),children:se.jsx(aT,{})})},{path:"settings",element:se.jsx(eT,{}),children:[{index:!0,element:se.jsx(Y1,{to:"general",replace:!0})},{path:"general",element:se.jsx(R.Suspense,{fallback:se.jsx(Pa,{}),children:se.jsx(iT,{})})},{path:"agents",element:se.jsx(R.Suspense,{fallback:se.jsx(Pa,{}),children:se.jsx(rT,{})})},{path:"agents-legacy",element:se.jsx(R.Suspense,{fallback:se.jsx(Pa,{}),children:se.jsx(lT,{})})},{path:"notifications",element:se.jsx(R.Suspense,{fallback:se.jsx(Pa,{}),children:se.jsx(sT,{})})},{path:"projects",element:se.jsx(R.Suspense,{fallback:se.jsx(Pa,{}),children:se.jsx(oT,{})})}]}]}]);function cT(){return se.jsx(_E,{router:uT})}const ea=Object.create(null);ea.open="0";ea.close="1";ea.ping="2";ea.pong="3";ea.message="4";ea.upgrade="5";ea.noop="6";const to=Object.create(null);Object.keys(ea).forEach(a=>{to[ea[a]]=a});const $c={type:"error",data:"parser error"},fg=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",dg=typeof ArrayBuffer=="function",hg=a=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(a):a&&a.buffer instanceof ArrayBuffer,Tf=({type:a,data:i},r,s)=>fg&&i instanceof Blob?r?s(i):uy(i,s):dg&&(i instanceof ArrayBuffer||hg(i))?r?s(i):uy(new Blob([i]),s):s(ea[a]+(i||"")),uy=(a,i)=>{const r=new FileReader;return r.onload=function(){const s=r.result.split(",")[1];i("b"+(s||""))},r.readAsDataURL(a)};function cy(a){return a instanceof Uint8Array?a:a instanceof ArrayBuffer?new Uint8Array(a):new Uint8Array(a.buffer,a.byteOffset,a.byteLength)}let Lc;function fT(a,i){if(fg&&a.data instanceof Blob)return a.data.arrayBuffer().then(cy).then(i);if(dg&&(a.data instanceof ArrayBuffer||hg(a.data)))return i(cy(a.data));Tf(a,!1,r=>{Lc||(Lc=new TextEncoder),i(Lc.encode(r))})}const fy="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",br=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let a=0;a<fy.length;a++)br[fy.charCodeAt(a)]=a;const dT=a=>{let i=a.length*.75,r=a.length,s,c=0,f,h,m,g;a[a.length-1]==="="&&(i--,a[a.length-2]==="="&&i--);const y=new ArrayBuffer(i),b=new Uint8Array(y);for(s=0;s<r;s+=4)f=br[a.charCodeAt(s)],h=br[a.charCodeAt(s+1)],m=br[a.charCodeAt(s+2)],g=br[a.charCodeAt(s+3)],b[c++]=f<<2|h>>4,b[c++]=(h&15)<<4|m>>2,b[c++]=(m&3)<<6|g&63;return y},hT=typeof ArrayBuffer=="function",wf=(a,i)=>{if(typeof a!="string")return{type:"message",data:mg(a,i)};const r=a.charAt(0);return r==="b"?{type:"message",data:mT(a.substring(1),i)}:to[r]?a.length>1?{type:to[r],data:a.substring(1)}:{type:to[r]}:$c},mT=(a,i)=>{if(hT){const r=dT(a);return mg(r,i)}else return{base64:!0,data:a}},mg=(a,i)=>i==="blob"?a instanceof Blob?a:new Blob([a]):a instanceof ArrayBuffer?a:a.buffer,pg="",pT=(a,i)=>{const r=a.length,s=new Array(r);let c=0;a.forEach((f,h)=>{Tf(f,!1,m=>{s[h]=m,++c===r&&i(s.join(pg))})})},yT=(a,i)=>{const r=a.split(pg),s=[];for(let c=0;c<r.length;c++){const f=wf(r[c],i);if(s.push(f),f.type==="error")break}return s};function gT(){return new TransformStream({transform(a,i){fT(a,r=>{const s=r.length;let c;if(s<126)c=new Uint8Array(1),new DataView(c.buffer).setUint8(0,s);else if(s<65536){c=new Uint8Array(3);const f=new DataView(c.buffer);f.setUint8(0,126),f.setUint16(1,s)}else{c=new Uint8Array(9);const f=new DataView(c.buffer);f.setUint8(0,127),f.setBigUint64(1,BigInt(s))}a.data&&typeof a.data!="string"&&(c[0]|=128),i.enqueue(c),i.enqueue(r)})}})}let Bc;function Zs(a){return a.reduce((i,r)=>i+r.length,0)}function Fs(a,i){if(a[0].length===i)return a.shift();const r=new Uint8Array(i);let s=0;for(let c=0;c<i;c++)r[c]=a[0][s++],s===a[0].length&&(a.shift(),s=0);return a.length&&s<a[0].length&&(a[0]=a[0].slice(s)),r}function vT(a,i){Bc||(Bc=new TextDecoder);const r=[];let s=0,c=-1,f=!1;return new TransformStream({transform(h,m){for(r.push(h);;){if(s===0){if(Zs(r)<1)break;const g=Fs(r,1);f=(g[0]&128)===128,c=g[0]&127,c<126?s=3:c===126?s=1:s=2}else if(s===1){if(Zs(r)<2)break;const g=Fs(r,2);c=new DataView(g.buffer,g.byteOffset,g.length).getUint16(0),s=3}else if(s===2){if(Zs(r)<8)break;const g=Fs(r,8),y=new DataView(g.buffer,g.byteOffset,g.length),b=y.getUint32(0);if(b>Math.pow(2,21)-1){m.enqueue($c);break}c=b*Math.pow(2,32)+y.getUint32(4),s=3}else{if(Zs(r)<c)break;const g=Fs(r,c);m.enqueue(wf(f?g:Bc.decode(g),i)),s=0}if(c===0||c>a){m.enqueue($c);break}}}})}const yg=4;function Rt(a){if(a)return bT(a)}function bT(a){for(var i in Rt.prototype)a[i]=Rt.prototype[i];return a}Rt.prototype.on=Rt.prototype.addEventListener=function(a,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+a]=this._callbacks["$"+a]||[]).push(i),this};Rt.prototype.once=function(a,i){function r(){this.off(a,r),i.apply(this,arguments)}return r.fn=i,this.on(a,r),this};Rt.prototype.off=Rt.prototype.removeListener=Rt.prototype.removeAllListeners=Rt.prototype.removeEventListener=function(a,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+a];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+a],this;for(var s,c=0;c<r.length;c++)if(s=r[c],s===i||s.fn===i){r.splice(c,1);break}return r.length===0&&delete this._callbacks["$"+a],this};Rt.prototype.emit=function(a){this._callbacks=this._callbacks||{};for(var i=new Array(arguments.length-1),r=this._callbacks["$"+a],s=1;s<arguments.length;s++)i[s-1]=arguments[s];if(r){r=r.slice(0);for(var s=0,c=r.length;s<c;++s)r[s].apply(this,i)}return this};Rt.prototype.emitReserved=Rt.prototype.emit;Rt.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks["$"+a]||[]};Rt.prototype.hasListeners=function(a){return!!this.listeners(a).length};const po=typeof Promise=="function"&&typeof Promise.resolve=="function"?i=>Promise.resolve().then(i):(i,r)=>r(i,0),Mn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),ST="arraybuffer";function gg(a,...i){return i.reduce((r,s)=>(a.hasOwnProperty(s)&&(r[s]=a[s]),r),{})}const ET=Mn.setTimeout,TT=Mn.clearTimeout;function yo(a,i){i.useNativeTimers?(a.setTimeoutFn=ET.bind(Mn),a.clearTimeoutFn=TT.bind(Mn)):(a.setTimeoutFn=Mn.setTimeout.bind(Mn),a.clearTimeoutFn=Mn.clearTimeout.bind(Mn))}const wT=1.33;function _T(a){return typeof a=="string"?RT(a):Math.ceil((a.byteLength||a.size)*wT)}function RT(a){let i=0,r=0;for(let s=0,c=a.length;s<c;s++)i=a.charCodeAt(s),i<128?r+=1:i<2048?r+=2:i<55296||i>=57344?r+=3:(s++,r+=4);return r}function vg(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function AT(a){let i="";for(let r in a)a.hasOwnProperty(r)&&(i.length&&(i+="&"),i+=encodeURIComponent(r)+"="+encodeURIComponent(a[r]));return i}function CT(a){let i={},r=a.split("&");for(let s=0,c=r.length;s<c;s++){let f=r[s].split("=");i[decodeURIComponent(f[0])]=decodeURIComponent(f[1])}return i}class OT extends Error{constructor(i,r,s){super(i),this.description=r,this.context=s,this.type="TransportError"}}class _f extends Rt{constructor(i){super(),this.writable=!1,yo(this,i),this.opts=i,this.query=i.query,this.socket=i.socket,this.supportsBinary=!i.forceBase64}onError(i,r,s){return super.emitReserved("error",new OT(i,r,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(i){this.readyState==="open"&&this.write(i)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(i){const r=wf(i,this.socket.binaryType);this.onPacket(r)}onPacket(i){super.emitReserved("packet",i)}onClose(i){this.readyState="closed",super.emitReserved("close",i)}pause(i){}createUri(i,r={}){return i+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_hostname(){const i=this.opts.hostname;return i.indexOf(":")===-1?i:"["+i+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(i){const r=AT(i);return r.length?"?"+r:""}}class xT extends _f{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(i){this.readyState="pausing";const r=()=>{this.readyState="paused",i()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||r()})),this.writable||(s++,this.once("drain",function(){--s||r()}))}else r()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(i){const r=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};yT(i,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const i=()=>{this.write([{type:"close"}])};this.readyState==="open"?i():this.once("open",i)}write(i){this.writable=!1,pT(i,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const i=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=vg()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(i,r)}}let bg=!1;try{bg=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const DT=bg;function MT(){}class NT extends xT{constructor(i){if(super(i),typeof location<"u"){const r=location.protocol==="https:";let s=location.port;s||(s=r?"443":"80"),this.xd=typeof location<"u"&&i.hostname!==location.hostname||s!==i.port}}doWrite(i,r){const s=this.request({method:"POST",data:i});s.on("success",r),s.on("error",(c,f)=>{this.onError("xhr post error",c,f)})}doPoll(){const i=this.request();i.on("data",this.onData.bind(this)),i.on("error",(r,s)=>{this.onError("xhr poll error",r,s)}),this.pollXhr=i}}let bl=class no extends Rt{constructor(i,r,s){super(),this.createRequest=i,yo(this,s),this._opts=s,this._method=s.method||"GET",this._uri=r,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var i;const r=gg(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(r);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let c in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(c)&&s.setRequestHeader(c,this._opts.extraHeaders[c])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(i=this._opts.cookieJar)===null||i===void 0||i.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var c;s.readyState===3&&((c=this._opts.cookieJar)===null||c===void 0||c.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(c){this.setTimeoutFn(()=>{this._onError(c)},0);return}typeof document<"u"&&(this._index=no.requestsCount++,no.requests[this._index]=this)}_onError(i){this.emitReserved("error",i,this._xhr),this._cleanup(!0)}_cleanup(i){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=MT,i)try{this._xhr.abort()}catch{}typeof document<"u"&&delete no.requests[this._index],this._xhr=null}}_onLoad(){const i=this._xhr.responseText;i!==null&&(this.emitReserved("data",i),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};bl.requestsCount=0;bl.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",dy);else if(typeof addEventListener=="function"){const a="onpagehide"in Mn?"pagehide":"unload";addEventListener(a,dy,!1)}}function dy(){for(let a in bl.requests)bl.requests.hasOwnProperty(a)&&bl.requests[a].abort()}const zT=(function(){const a=Sg({xdomain:!1});return a&&a.responseType!==null})();class UT extends NT{constructor(i){super(i);const r=i&&i.forceBase64;this.supportsBinary=zT&&!r}request(i={}){return Object.assign(i,{xd:this.xd},this.opts),new bl(Sg,this.uri(),i)}}function Sg(a){const i=a.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!i||DT))return new XMLHttpRequest}catch{}if(!i)try{return new Mn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Eg=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class LT extends _f{get name(){return"websocket"}doOpen(){const i=this.uri(),r=this.opts.protocols,s=Eg?{}:gg(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(i,r,s)}catch(c){return this.emitReserved("error",c)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=i=>this.onClose({description:"websocket connection closed",context:i}),this.ws.onmessage=i=>this.onData(i.data),this.ws.onerror=i=>this.onError("websocket error",i)}write(i){this.writable=!1;for(let r=0;r<i.length;r++){const s=i[r],c=r===i.length-1;Tf(s,this.supportsBinary,f=>{try{this.doWrite(s,f)}catch{}c&&po(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const i=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=vg()),this.supportsBinary||(r.b64=1),this.createUri(i,r)}}const jc=Mn.WebSocket||Mn.MozWebSocket;class BT extends LT{createSocket(i,r,s){return Eg?new jc(i,r,s):r?new jc(i,r):new jc(i)}doWrite(i,r){this.ws.send(r)}}class jT extends _f{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(i){return this.emitReserved("error",i)}this._transport.closed.then(()=>{this.onClose()}).catch(i=>{this.onError("webtransport error",i)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(i=>{const r=vT(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=i.readable.pipeThrough(r).getReader(),c=gT();c.readable.pipeTo(i.writable),this._writer=c.writable.getWriter();const f=()=>{s.read().then(({done:m,value:g})=>{m||(this.onPacket(g),f())}).catch(m=>{})};f();const h={type:"open"};this.query.sid&&(h.data=`{"sid":"${this.query.sid}"}`),this._writer.write(h).then(()=>this.onOpen())})})}write(i){this.writable=!1;for(let r=0;r<i.length;r++){const s=i[r],c=r===i.length-1;this._writer.write(s).then(()=>{c&&po(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var i;(i=this._transport)===null||i===void 0||i.close()}}const HT={websocket:BT,webtransport:jT,polling:UT},qT=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,kT=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ic(a){if(a.length>8e3)throw"URI too long";const i=a,r=a.indexOf("["),s=a.indexOf("]");r!=-1&&s!=-1&&(a=a.substring(0,r)+a.substring(r,s).replace(/:/g,";")+a.substring(s,a.length));let c=qT.exec(a||""),f={},h=14;for(;h--;)f[kT[h]]=c[h]||"";return r!=-1&&s!=-1&&(f.source=i,f.host=f.host.substring(1,f.host.length-1).replace(/;/g,":"),f.authority=f.authority.replace("[","").replace("]","").replace(/;/g,":"),f.ipv6uri=!0),f.pathNames=QT(f,f.path),f.queryKey=YT(f,f.query),f}function QT(a,i){const r=/\/{2,9}/g,s=i.replace(r,"/").split("/");return(i.slice(0,1)=="/"||i.length===0)&&s.splice(0,1),i.slice(-1)=="/"&&s.splice(s.length-1,1),s}function YT(a,i){const r={};return i.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,c,f){c&&(r[c]=f)}),r}const Wc=typeof addEventListener=="function"&&typeof removeEventListener=="function",ao=[];Wc&&addEventListener("offline",()=>{ao.forEach(a=>a())},!1);class ti extends Rt{constructor(i,r){if(super(),this.binaryType=ST,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,i&&typeof i=="object"&&(r=i,i=null),i){const s=Ic(i);r.hostname=s.host,r.secure=s.protocol==="https"||s.protocol==="wss",r.port=s.port,s.query&&(r.query=s.query)}else r.host&&(r.hostname=Ic(r.host).host);yo(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(s=>{const c=s.prototype.name;this.transports.push(c),this._transportsByName[c]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=CT(this.opts.query)),Wc&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ao.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(i){const r=Object.assign({},this.opts.query);r.EIO=yg,r.transport=i,this.id&&(r.sid=this.id);const s=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[i]);return new this._transportsByName[i](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const i=this.opts.rememberUpgrade&&ti.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(i);r.open(),this.setTransport(r)}setTransport(i){this.transport&&this.transport.removeAllListeners(),this.transport=i,i.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",ti.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",i),this.emitReserved("heartbeat"),i.type){case"open":this.onHandshake(JSON.parse(i.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const r=new Error("server error");r.code=i.data,this._onError(r);break;case"message":this.emitReserved("data",i.data),this.emitReserved("message",i.data);break}}onHandshake(i){this.emitReserved("handshake",i),this.id=i.sid,this.transport.query.sid=i.sid,this._pingInterval=i.pingInterval,this._pingTimeout=i.pingTimeout,this._maxPayload=i.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const i=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+i,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},i),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const i=this._getWritablePackets();this.transport.send(i),this._prevBufferLen=i.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let s=0;s<this.writeBuffer.length;s++){const c=this.writeBuffer[s].data;if(c&&(r+=_T(c)),s>0&&r>this._maxPayload)return this.writeBuffer.slice(0,s);r+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const i=Date.now()>this._pingTimeoutTime;return i&&(this._pingTimeoutTime=0,po(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),i}write(i,r,s){return this._sendPacket("message",i,r,s),this}send(i,r,s){return this._sendPacket("message",i,r,s),this}_sendPacket(i,r,s,c){if(typeof r=="function"&&(c=r,r=void 0),typeof s=="function"&&(c=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const f={type:i,data:r,options:s};this.emitReserved("packetCreate",f),this.writeBuffer.push(f),c&&this.once("flush",c),this.flush()}close(){const i=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),i()},s=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():i()}):this.upgrading?s():i()),this}_onError(i){if(ti.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",i),this._onClose("transport error",i)}_onClose(i,r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Wc&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=ao.indexOf(this._offlineEventListener);s!==-1&&ao.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",i,r),this.writeBuffer=[],this._prevBufferLen=0}}}ti.protocol=yg;class VT extends ti{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let i=0;i<this._upgrades.length;i++)this._probe(this._upgrades[i])}_probe(i){let r=this.createTransport(i),s=!1;ti.priorWebsocketSuccess=!1;const c=()=>{s||(r.send([{type:"ping",data:"probe"}]),r.once("packet",p=>{if(!s)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;ti.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(b(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const w=new Error("probe error");w.transport=r.name,this.emitReserved("upgradeError",w)}}))};function f(){s||(s=!0,b(),r.close(),r=null)}const h=p=>{const w=new Error("probe error: "+p);w.transport=r.name,f(),this.emitReserved("upgradeError",w)};function m(){h("transport closed")}function g(){h("socket closed")}function y(p){r&&p.name!==r.name&&f()}const b=()=>{r.removeListener("open",c),r.removeListener("error",h),r.removeListener("close",m),this.off("close",g),this.off("upgrading",y)};r.once("open",c),r.once("error",h),r.once("close",m),this.once("close",g),this.once("upgrading",y),this._upgrades.indexOf("webtransport")!==-1&&i!=="webtransport"?this.setTimeoutFn(()=>{s||r.open()},200):r.open()}onHandshake(i){this._upgrades=this._filterUpgrades(i.upgrades),super.onHandshake(i)}_filterUpgrades(i){const r=[];for(let s=0;s<i.length;s++)~this.transports.indexOf(i[s])&&r.push(i[s]);return r}}let GT=class extends VT{constructor(i,r={}){const s=typeof i=="object"?i:r;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(c=>HT[c]).filter(c=>!!c)),super(i,s)}};function KT(a,i="",r){let s=a;r=r||typeof location<"u"&&location,a==null&&(a=r.protocol+"//"+r.host),typeof a=="string"&&(a.charAt(0)==="/"&&(a.charAt(1)==="/"?a=r.protocol+a:a=r.host+a),/^(https?|wss?):\/\//.test(a)||(typeof r<"u"?a=r.protocol+"//"+a:a="https://"+a),s=Ic(a)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const f=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+f+":"+s.port+i,s.href=s.protocol+"://"+f+(r&&r.port===s.port?"":":"+s.port),s}const XT=typeof ArrayBuffer=="function",ZT=a=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(a):a.buffer instanceof ArrayBuffer,Tg=Object.prototype.toString,FT=typeof Blob=="function"||typeof Blob<"u"&&Tg.call(Blob)==="[object BlobConstructor]",JT=typeof File=="function"||typeof File<"u"&&Tg.call(File)==="[object FileConstructor]";function Rf(a){return XT&&(a instanceof ArrayBuffer||ZT(a))||FT&&a instanceof Blob||JT&&a instanceof File}function io(a,i){if(!a||typeof a!="object")return!1;if(Array.isArray(a)){for(let r=0,s=a.length;r<s;r++)if(io(a[r]))return!0;return!1}if(Rf(a))return!0;if(a.toJSON&&typeof a.toJSON=="function"&&arguments.length===1)return io(a.toJSON(),!0);for(const r in a)if(Object.prototype.hasOwnProperty.call(a,r)&&io(a[r]))return!0;return!1}function PT(a){const i=[],r=a.data,s=a;return s.data=ef(r,i),s.attachments=i.length,{packet:s,buffers:i}}function ef(a,i){if(!a)return a;if(Rf(a)){const r={_placeholder:!0,num:i.length};return i.push(a),r}else if(Array.isArray(a)){const r=new Array(a.length);for(let s=0;s<a.length;s++)r[s]=ef(a[s],i);return r}else if(typeof a=="object"&&!(a instanceof Date)){const r={};for(const s in a)Object.prototype.hasOwnProperty.call(a,s)&&(r[s]=ef(a[s],i));return r}return a}function $T(a,i){return a.data=tf(a.data,i),delete a.attachments,a}function tf(a,i){if(!a)return a;if(a&&a._placeholder===!0){if(typeof a.num=="number"&&a.num>=0&&a.num<i.length)return i[a.num];throw new Error("illegal attachments")}else if(Array.isArray(a))for(let r=0;r<a.length;r++)a[r]=tf(a[r],i);else if(typeof a=="object")for(const r in a)Object.prototype.hasOwnProperty.call(a,r)&&(a[r]=tf(a[r],i));return a}const IT=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Qe;(function(a){a[a.CONNECT=0]="CONNECT",a[a.DISCONNECT=1]="DISCONNECT",a[a.EVENT=2]="EVENT",a[a.ACK=3]="ACK",a[a.CONNECT_ERROR=4]="CONNECT_ERROR",a[a.BINARY_EVENT=5]="BINARY_EVENT",a[a.BINARY_ACK=6]="BINARY_ACK"})(Qe||(Qe={}));class WT{constructor(i){this.replacer=i}encode(i){return(i.type===Qe.EVENT||i.type===Qe.ACK)&&io(i)?this.encodeAsBinary({type:i.type===Qe.EVENT?Qe.BINARY_EVENT:Qe.BINARY_ACK,nsp:i.nsp,data:i.data,id:i.id}):[this.encodeAsString(i)]}encodeAsString(i){let r=""+i.type;return(i.type===Qe.BINARY_EVENT||i.type===Qe.BINARY_ACK)&&(r+=i.attachments+"-"),i.nsp&&i.nsp!=="/"&&(r+=i.nsp+","),i.id!=null&&(r+=i.id),i.data!=null&&(r+=JSON.stringify(i.data,this.replacer)),r}encodeAsBinary(i){const r=PT(i),s=this.encodeAsString(r.packet),c=r.buffers;return c.unshift(s),c}}class Af extends Rt{constructor(i){super(),this.reviver=i}add(i){let r;if(typeof i=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(i);const s=r.type===Qe.BINARY_EVENT;s||r.type===Qe.BINARY_ACK?(r.type=s?Qe.EVENT:Qe.ACK,this.reconstructor=new e2(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r)}else if(Rf(i)||i.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(i),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+i)}decodeString(i){let r=0;const s={type:Number(i.charAt(0))};if(Qe[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===Qe.BINARY_EVENT||s.type===Qe.BINARY_ACK){const f=r+1;for(;i.charAt(++r)!=="-"&&r!=i.length;);const h=i.substring(f,r);if(h!=Number(h)||i.charAt(r)!=="-")throw new Error("Illegal attachments");s.attachments=Number(h)}if(i.charAt(r+1)==="/"){const f=r+1;for(;++r&&!(i.charAt(r)===","||r===i.length););s.nsp=i.substring(f,r)}else s.nsp="/";const c=i.charAt(r+1);if(c!==""&&Number(c)==c){const f=r+1;for(;++r;){const h=i.charAt(r);if(h==null||Number(h)!=h){--r;break}if(r===i.length)break}s.id=Number(i.substring(f,r+1))}if(i.charAt(++r)){const f=this.tryParse(i.substr(r));if(Af.isPayloadValid(s.type,f))s.data=f;else throw new Error("invalid payload")}return s}tryParse(i){try{return JSON.parse(i,this.reviver)}catch{return!1}}static isPayloadValid(i,r){switch(i){case Qe.CONNECT:return hy(r);case Qe.DISCONNECT:return r===void 0;case Qe.CONNECT_ERROR:return typeof r=="string"||hy(r);case Qe.EVENT:case Qe.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&IT.indexOf(r[0])===-1);case Qe.ACK:case Qe.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class e2{constructor(i){this.packet=i,this.buffers=[],this.reconPack=i}takeBinaryData(i){if(this.buffers.push(i),this.buffers.length===this.reconPack.attachments){const r=$T(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function hy(a){return Object.prototype.toString.call(a)==="[object Object]"}const t2=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Af,Encoder:WT,get PacketType(){return Qe}},Symbol.toStringTag,{value:"Module"}));function Vn(a,i,r){return a.on(i,r),function(){a.off(i,r)}}const n2=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class wg extends Rt{constructor(i,r,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=i,this.nsp=r,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const i=this.io;this.subs=[Vn(i,"open",this.onopen.bind(this)),Vn(i,"packet",this.onpacket.bind(this)),Vn(i,"error",this.onerror.bind(this)),Vn(i,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...i){return i.unshift("message"),this.emit.apply(this,i),this}emit(i,...r){var s,c,f;if(n2.hasOwnProperty(i))throw new Error('"'+i.toString()+'" is a reserved event name');if(r.unshift(i),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const h={type:Qe.EVENT,data:r};if(h.options={},h.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const b=this.ids++,p=r.pop();this._registerAckCallback(b,p),h.id=b}const m=(c=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||c===void 0?void 0:c.writable,g=this.connected&&!(!((f=this.io.engine)===null||f===void 0)&&f._hasPingExpired());return this.flags.volatile&&!m||(g?(this.notifyOutgoingListeners(h),this.packet(h)):this.sendBuffer.push(h)),this.flags={},this}_registerAckCallback(i,r){var s;const c=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(c===void 0){this.acks[i]=r;return}const f=this.io.setTimeoutFn(()=>{delete this.acks[i];for(let m=0;m<this.sendBuffer.length;m++)this.sendBuffer[m].id===i&&this.sendBuffer.splice(m,1);r.call(this,new Error("operation has timed out"))},c),h=(...m)=>{this.io.clearTimeoutFn(f),r.apply(this,m)};h.withError=!0,this.acks[i]=h}emitWithAck(i,...r){return new Promise((s,c)=>{const f=(h,m)=>h?c(h):s(m);f.withError=!0,r.push(f),this.emit(i,...r)})}_addToQueue(i){let r;typeof i[i.length-1]=="function"&&(r=i.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:i,flags:Object.assign({fromQueue:!0},this.flags)};i.push((c,...f)=>(this._queue[0],c!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(c)):(this._queue.shift(),r&&r(null,...f)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(i=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!i||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(i){i.nsp=this.nsp,this.io._packet(i)}onopen(){typeof this.auth=="function"?this.auth(i=>{this._sendConnectPacket(i)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(i){this.packet({type:Qe.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},i):i})}onerror(i){this.connected||this.emitReserved("connect_error",i)}onclose(i,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",i,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(i=>{if(!this.sendBuffer.some(s=>String(s.id)===i)){const s=this.acks[i];delete this.acks[i],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(i){if(i.nsp===this.nsp)switch(i.type){case Qe.CONNECT:i.data&&i.data.sid?this.onconnect(i.data.sid,i.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Qe.EVENT:case Qe.BINARY_EVENT:this.onevent(i);break;case Qe.ACK:case Qe.BINARY_ACK:this.onack(i);break;case Qe.DISCONNECT:this.ondisconnect();break;case Qe.CONNECT_ERROR:this.destroy();const s=new Error(i.data.message);s.data=i.data.data,this.emitReserved("connect_error",s);break}}onevent(i){const r=i.data||[];i.id!=null&&r.push(this.ack(i.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(i){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const s of r)s.apply(this,i)}super.emit.apply(this,i),this._pid&&i.length&&typeof i[i.length-1]=="string"&&(this._lastOffset=i[i.length-1])}ack(i){const r=this;let s=!1;return function(...c){s||(s=!0,r.packet({type:Qe.ACK,id:i,data:c}))}}onack(i){const r=this.acks[i.id];typeof r=="function"&&(delete this.acks[i.id],r.withError&&i.data.unshift(null),r.apply(this,i.data))}onconnect(i,r){this.id=i,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(i=>this.emitEvent(i)),this.receiveBuffer=[],this.sendBuffer.forEach(i=>{this.notifyOutgoingListeners(i),this.packet(i)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(i=>i()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Qe.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(i){return this.flags.compress=i,this}get volatile(){return this.flags.volatile=!0,this}timeout(i){return this.flags.timeout=i,this}onAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(i),this}prependAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(i),this}offAny(i){if(!this._anyListeners)return this;if(i){const r=this._anyListeners;for(let s=0;s<r.length;s++)if(i===r[s])return r.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(i),this}prependAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(i),this}offAnyOutgoing(i){if(!this._anyOutgoingListeners)return this;if(i){const r=this._anyOutgoingListeners;for(let s=0;s<r.length;s++)if(i===r[s])return r.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(i){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const s of r)s.apply(this,i.data)}}}function Tl(a){a=a||{},this.ms=a.min||100,this.max=a.max||1e4,this.factor=a.factor||2,this.jitter=a.jitter>0&&a.jitter<=1?a.jitter:0,this.attempts=0}Tl.prototype.duration=function(){var a=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),r=Math.floor(i*this.jitter*a);a=(Math.floor(i*10)&1)==0?a-r:a+r}return Math.min(a,this.max)|0};Tl.prototype.reset=function(){this.attempts=0};Tl.prototype.setMin=function(a){this.ms=a};Tl.prototype.setMax=function(a){this.max=a};Tl.prototype.setJitter=function(a){this.jitter=a};class nf extends Rt{constructor(i,r){var s;super(),this.nsps={},this.subs=[],i&&typeof i=="object"&&(r=i,i=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,yo(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((s=r.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new Tl({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=i;const c=r.parser||t2;this.encoder=new c.Encoder,this.decoder=new c.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(i){return arguments.length?(this._reconnection=!!i,i||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(i){return i===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=i,this)}reconnectionDelay(i){var r;return i===void 0?this._reconnectionDelay:(this._reconnectionDelay=i,(r=this.backoff)===null||r===void 0||r.setMin(i),this)}randomizationFactor(i){var r;return i===void 0?this._randomizationFactor:(this._randomizationFactor=i,(r=this.backoff)===null||r===void 0||r.setJitter(i),this)}reconnectionDelayMax(i){var r;return i===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=i,(r=this.backoff)===null||r===void 0||r.setMax(i),this)}timeout(i){return arguments.length?(this._timeout=i,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(i){if(~this._readyState.indexOf("open"))return this;this.engine=new GT(this.uri,this.opts);const r=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const c=Vn(r,"open",function(){s.onopen(),i&&i()}),f=m=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",m),i?i(m):this.maybeReconnectOnOpen()},h=Vn(r,"error",f);if(this._timeout!==!1){const m=this._timeout,g=this.setTimeoutFn(()=>{c(),f(new Error("timeout")),r.close()},m);this.opts.autoUnref&&g.unref(),this.subs.push(()=>{this.clearTimeoutFn(g)})}return this.subs.push(c),this.subs.push(h),this}connect(i){return this.open(i)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const i=this.engine;this.subs.push(Vn(i,"ping",this.onping.bind(this)),Vn(i,"data",this.ondata.bind(this)),Vn(i,"error",this.onerror.bind(this)),Vn(i,"close",this.onclose.bind(this)),Vn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(i){try{this.decoder.add(i)}catch(r){this.onclose("parse error",r)}}ondecoded(i){po(()=>{this.emitReserved("packet",i)},this.setTimeoutFn)}onerror(i){this.emitReserved("error",i)}socket(i,r){let s=this.nsps[i];return s?this._autoConnect&&!s.active&&s.connect():(s=new wg(this,i,r),this.nsps[i]=s),s}_destroy(i){const r=Object.keys(this.nsps);for(const s of r)if(this.nsps[s].active)return;this._close()}_packet(i){const r=this.encoder.encode(i);for(let s=0;s<r.length;s++)this.engine.write(r[s],i.options)}cleanup(){this.subs.forEach(i=>i()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(i,r){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",i,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const i=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{i.skipReconnect||(this.emitReserved("reconnect_attempt",i.backoff.attempts),!i.skipReconnect&&i.open(c=>{c?(i._reconnecting=!1,i.reconnect(),this.emitReserved("reconnect_error",c)):i.onreconnect()}))},r);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const i=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",i)}}const yr={};function lo(a,i){typeof a=="object"&&(i=a,a=void 0),i=i||{};const r=KT(a,i.path||"/socket.io"),s=r.source,c=r.id,f=r.path,h=yr[c]&&f in yr[c].nsps,m=i.forceNew||i["force new connection"]||i.multiplex===!1||h;let g;return m?g=new nf(s,i):(yr[c]||(yr[c]=new nf(s,i)),g=yr[c]),r.query&&!i.query&&(i.query=r.queryKey),g.socket(r.path,i)}Object.assign(lo,{Manager:nf,Socket:wg,io:lo,connect:lo});const Js="/events",Ps={SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe",INPUT:"input",RESIZE:"resize",TERMINAL_INPUT:"terminal:input",TERMINAL_RESIZE:"terminal:resize"},$s={SESSION_SUBSCRIBED:"session:subscribed",SESSION_UNSUBSCRIBED:"session:unsubscribed",SESSION_STDOUT:"session:stdout",SESSION_PATCH:"session:patch",SESSION_EXIT:"session:exit",SESSION_COMPLETED:"session:completed",SESSION_ID:"session:sessionId",SESSION_ERROR:"session:error",TASK_UPDATED:"task:updated",TASK_DELETED:"task:deleted",TERMINAL_STDOUT:"terminal:stdout",TERMINAL_EXIT:"terminal:exit",TERMINAL_SUBSCRIBED:"terminal:subscribed",TERMINAL_UNSUBSCRIBED:"terminal:unsubscribed",WORKSPACE_SETUP_PROGRESS:"workspace:setup_progress",WORKSPACE_COMMIT_MESSAGE_UPDATED:"workspace:commit_message_updated"};class a2{socket=null;baseUrl;visibilityHandler=null;constructor(){this.baseUrl=""}getSocket(){return this.socket||(this.socket=lo(`${this.baseUrl}${Js}`,{autoConnect:!1,transports:["websocket"],reconnection:!0,reconnectionAttempts:1/0,reconnectionDelay:1e3,reconnectionDelayMax:1e4}),this.socket.on("connect",()=>{console.log(`[Socket] Connected to ${Js} t=${Date.now()}`)}),this.socket.on("disconnect",i=>{console.log(`[Socket] Disconnected from ${Js}: t=${Date.now()}`,i)}),this.socket.on("connect_error",i=>{console.error(`[Socket] Connection error on ${Js}: t=${Date.now()}`,i.message)})),this.socket}connect(){const i=this.getSocket();return i.connected||i.connect(),this.visibilityHandler||(this.visibilityHandler=()=>{document.visibilityState==="visible"&&this.socket&&!this.socket.connected&&(console.log("[Socket] Page became visible, socket disconnected — reconnecting"),this.socket.connect())},document.addEventListener("visibilitychange",this.visibilityHandler)),i}disconnect(){this.visibilityHandler&&(document.removeEventListener("visibilitychange",this.visibilityHandler),this.visibilityHandler=null),this.socket&&(this.socket.disconnect(),this.socket=null)}isConnected(){return this.socket?.connected??!1}}const af=new a2;function i2(a){const i={};return a?.page!=null&&(i.page=String(a.page)),a?.limit!=null&&(i.limit=String(a.limit)),a?.includeArchived&&(i.includeArchived="true"),uo({queryKey:mt.projects.list(a),queryFn:()=>Ra.get("/projects",{params:i})})}function y2(a){return uo({queryKey:mt.projects.detail(a),queryFn:()=>Ra.get(`/projects/${a}`),enabled:!!a})}function g2(){const a=ni();return Rr({mutationFn:i=>Ra.post("/projects",i),onSuccess:()=>{a.invalidateQueries({queryKey:mt.projects.all})}})}function v2(){const a=ni();return Rr({mutationFn:({id:i,...r})=>Ra.put(`/projects/${i}`,r),onSuccess:(i,r)=>{a.invalidateQueries({queryKey:mt.projects.all}),a.invalidateQueries({queryKey:mt.projects.detail(r.id)})}})}function b2(){const a=ni();return Rr({mutationFn:({id:i,deleteRepo:r})=>Ra.post(`/projects/${i}/archive`,{deleteRepo:r??!1}),onSuccess:(i,r)=>{a.invalidateQueries({queryKey:mt.projects.all}),a.invalidateQueries({queryKey:mt.projects.detail(r.id)}),a.invalidateQueries({queryKey:mt.tasks.all}),a.invalidateQueries({queryKey:mt.workspaces.all})}})}function S2(){const a=ni();return Rr({mutationFn:({id:i,repoPath:r})=>Ra.post(`/projects/${i}/restore`,r?{repoPath:r}:{}),onSuccess:(i,r)=>{a.invalidateQueries({queryKey:mt.projects.all}),a.invalidateQueries({queryKey:mt.projects.detail(r.id)}),a.invalidateQueries({queryKey:mt.tasks.all}),a.invalidateQueries({queryKey:mt.workspaces.all})}})}function l2(a){const i=ni(),r=R.useRef(new Set),s=R.useRef(a);s.current=a,R.useEffect(()=>{if(a.length===0)return;const c=af.connect(),f=r.current,h=()=>{for(const p of s.current)c.emit(Ps.SUBSCRIBE,{topic:"project",id:p},w=>{w.success&&f.add(p)})},m=new Set(a);for(const p of m)f.has(p)||c.emit(Ps.SUBSCRIBE,{topic:"project",id:p},w=>{w.success&&f.add(p)});for(const p of f)m.has(p)||c.emit(Ps.UNSUBSCRIBE,{topic:"project",id:p},()=>{f.delete(p)});const g=()=>{f.clear(),h(),i.invalidateQueries({queryKey:mt.tasks.all})},y=async p=>{await i.cancelQueries({queryKey:mt.tasks.list(p.projectId)}),i.invalidateQueries({queryKey:mt.tasks.list(p.projectId)}),i.invalidateQueries({queryKey:mt.tasks.detail(p.taskId)})},b=p=>{i.invalidateQueries({queryKey:mt.tasks.list(p.projectId)}),i.removeQueries({queryKey:mt.tasks.detail(p.taskId)})};return c.on("connect",g),c.on($s.TASK_UPDATED,y),c.on($s.TASK_DELETED,b),()=>{c.off("connect",g),c.off($s.TASK_UPDATED,y),c.off($s.TASK_DELETED,b);for(const p of f)c.emit(Ps.UNSUBSCRIBE,{topic:"project",id:p});f.clear()}},[a,i])}function r2(){const{data:a}=i2(),i=R.useMemo(()=>a?.data.map(r=>r.id)??[],[a]);return l2(i),null}function s2(){return R.useEffect(()=>(af.connect(),()=>af.disconnect()),[]),se.jsx(cb,{client:$b,children:se.jsxs($E,{children:[se.jsx(r2,{}),se.jsx(cT,{}),se.jsx(Pb,{position:"top-center",toastOptions:{className:"text-sm",style:{fontFamily:"inherit"},classNames:{error:"!bg-neutral-900 !text-neutral-100 !border-neutral-800 !shadow-lg",success:"!bg-neutral-900 !text-neutral-100 !border-neutral-800 !shadow-lg",default:"!bg-neutral-900 !text-neutral-100 !border-neutral-800 !shadow-lg"}}})]})})}const o2="/api/tunnel/bootstrap";async function u2(){const a=new URL(window.location.href),i=a.searchParams.get("token");if(!i)return;const r=await fetch(`${o2}?token=${encodeURIComponent(i)}`,{method:"POST",credentials:"same-origin"});if(!r.ok)throw new Error(`Tunnel bootstrap failed (${r.status})`);a.searchParams.delete("token"),window.history.replaceState({},"",a.toString())}async function c2(){try{await u2()}catch(a){console.error("[Tunnel] Failed to bootstrap tunnel session",a)}k0.createRoot(document.getElementById("root")).render(se.jsx(R.StrictMode,{children:se.jsx(s2,{})}))}c2();export{fb as A,mb as B,Ps as C,vb as D,pb as E,HE as F,yb as G,Gt as H,Sb as I,Dp as J,bb as K,ig as L,gb as M,Eb as N,Cy as O,y2 as P,nb as Q,I as R,$s as S,BE as T,NE as U,g2 as V,my as W,ai as _,GE as a,m2 as b,KE as c,uo as d,ni as e,Rr as f,Ra as g,Dr as h,i2 as i,se as j,v2 as k,b2 as l,S2 as m,PE as n,xp as o,d2 as p,mt as q,R as r,af as s,qb as t,cg as u,f2 as v,Sl as w,Ot as x,ro as y,gy as z};
|
|
13
|
+
Please change the parent <Route path="${Z}"> to <Route path="${Z==="/"?"*":`${Z}/*`}">.`)}let w=li(),D;D=w;let B=D.pathname||"/",q=B;if(b!=="/"){let Z=b.replace(/^\//,"").split("/");q="/"+B.replace(/^\//,"").split("/").slice(Z.length).join("/")}let X=$a(a,{pathname:q});return St(p||X!=null,`No routes matched location "${D.pathname}${D.search}${D.hash}" `),St(X==null||X[X.length-1].route.element!==void 0||X[X.length-1].route.Component!==void 0||X[X.length-1].route.lazy!==void 0,`Matched leaf route at location "${D.pathname}${D.search}${D.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),A1(X&&X.map(Z=>Object.assign({},Z,{params:Object.assign({},g,Z.params),pathname:In([b,f.encodeLocation?f.encodeLocation(Z.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:Z.pathname]),pathnameBase:Z.pathnameBase==="/"?b:In([b,f.encodeLocation?f.encodeLocation(Z.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:Z.pathnameBase])})),h,r,s,c)}function T1(){let a=M1(),i=_r(a)?`${a.status} ${a.statusText}`:a instanceof Error?a.message:JSON.stringify(a),r=a instanceof Error?a.stack:null,s="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:s},f={padding:"2px 4px",backgroundColor:s},h=null;return console.error("Error handled by React Router default ErrorBoundary:",a),h=R.createElement(R.Fragment,null,R.createElement("p",null,"💿 Hey developer 👋"),R.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",R.createElement("code",{style:f},"ErrorBoundary")," or"," ",R.createElement("code",{style:f},"errorElement")," prop on your route.")),R.createElement(R.Fragment,null,R.createElement("h2",null,"Unexpected Application Error!"),R.createElement("h3",{style:{fontStyle:"italic"}},i),r?R.createElement("pre",{style:c},r):null,h)}var w1=R.createElement(T1,null),Iy=class extends R.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,i){return i.location!==a.location||i.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:i.error,location:i.location,revalidation:a.revalidation||i.revalidation}}componentDidCatch(a,i){this.props.onError?this.props.onError(a,i):console.error("React Router caught the following error during render",a)}render(){let a=this.state.error;if(this.context&&typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){const r=y1(a.digest);r&&(a=r)}let i=a!==void 0?R.createElement(Gn.Provider,{value:this.props.routeContext},R.createElement(yf.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?R.createElement(_1,{error:a},i):i}};Iy.contextType=Zy;var zc=new WeakMap;function _1({children:a,error:i}){let{basename:r}=R.useContext(mn);if(typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){let s=p1(i.digest);if(s){let c=zc.get(i);if(c)throw c;let f=Ly(s.location,r);if(Uy&&!zc.get(i))if(f.isExternal||s.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const h=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:s.replace}));throw zc.set(i,h),h}return R.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return a}function R1({routeContext:a,match:i,children:r}){let s=R.useContext(Ui);return s&&s.static&&s.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=i.route.id),R.createElement(Gn.Provider,{value:a},r)}function A1(a,i=[],r=null,s=null,c=null){if(a==null){if(!r)return null;if(r.errors)a=r.matches;else if(i.length===0&&!r.initialized&&r.matches.length>0)a=r.matches;else return null}let f=a,h=r?.errors;if(h!=null){let b=f.findIndex(p=>p.route.id&&h?.[p.route.id]!==void 0);De(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(h).join(",")}`),f=f.slice(0,Math.min(f.length,b+1))}let m=!1,g=-1;if(r)for(let b=0;b<f.length;b++){let p=f[b];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(g=b),p.route.id){let{loaderData:w,errors:D}=r,B=p.route.loader&&!w.hasOwnProperty(p.route.id)&&(!D||D[p.route.id]===void 0);if(p.route.lazy||B){m=!0,g>=0?f=f.slice(0,g+1):f=[f[0]];break}}}let y=r&&s?(b,p)=>{s(b,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:Cr(r.matches),errorInfo:p})}:void 0;return f.reduceRight((b,p,w)=>{let D,B=!1,q=null,X=null;r&&(D=h&&p.route.id?h[p.route.id]:void 0,q=p.route.errorElement||w1,m&&(g<0&&w===0?(Wy("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),B=!0,X=null):g===w&&(B=!0,X=p.route.hydrateFallbackElement||null)));let V=i.concat(f.slice(0,w+1)),Z=()=>{let $;return D?$=q:B?$=X:p.route.Component?$=R.createElement(p.route.Component,null):p.route.element?$=p.route.element:$=b,R.createElement(R1,{match:p,routeContext:{outlet:b,matches:V,isDataRoute:r!=null},children:$})};return r&&(p.route.ErrorBoundary||p.route.errorElement||w===0)?R.createElement(Iy,{location:r.location,revalidation:r.revalidation,component:q,error:D,children:Z(),routeContext:{outlet:null,matches:V,isDataRoute:!0},onError:y}):Z()},null)}function vf(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function C1(a){let i=R.useContext(Ui);return De(i,vf(a)),i}function O1(a){let i=R.useContext(Or);return De(i,vf(a)),i}function x1(a){let i=R.useContext(Gn);return De(i,vf(a)),i}function bf(a){let i=x1(a),r=i.matches[i.matches.length-1];return De(r.route.id,`${a} can only be used on routes that contain a unique "id"`),r.route.id}function D1(){return bf("useRouteId")}function M1(){let a=R.useContext(yf),i=O1("useRouteError"),r=bf("useRouteError");return a!==void 0?a:i.errors?.[r]}function N1(){let{router:a}=C1("useNavigate"),i=bf("useNavigate"),r=R.useRef(!1);return $y(()=>{r.current=!0}),R.useCallback(async(c,f={})=>{St(r.current,Py),r.current&&(typeof c=="number"?await a.navigate(c):await a.navigate(c,{fromRouteId:i,...f}))},[a,i])}var ny={};function Wy(a,i,r){!i&&!ny[a]&&(ny[a]=!0,St(!1,r))}var ay={};function iy(a,i){!a&&!ay[i]&&(ay[i]=!0,console.warn(i))}var z1="useOptimistic",ly=U0[z1],U1=()=>{};function L1(a){return ly?ly(a):[a,U1]}function B1(a){let i={hasErrorBoundary:a.hasErrorBoundary||a.ErrorBoundary!=null||a.errorElement!=null};return a.Component&&(a.element&&St(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(i,{element:R.createElement(a.Component),Component:void 0})),a.HydrateFallback&&(a.hydrateFallbackElement&&St(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(i,{hydrateFallbackElement:R.createElement(a.HydrateFallback),HydrateFallback:void 0})),a.ErrorBoundary&&(a.errorElement&&St(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(i,{errorElement:R.createElement(a.ErrorBoundary),ErrorBoundary:void 0})),i}var j1=["HydrateFallback","hydrateFallbackElement"],H1=class{constructor(){this.status="pending",this.promise=new Promise((a,i)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",a(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",i(r))}})}};function q1({router:a,flushSync:i,onError:r,unstable_useTransitions:s}){s=f1()||s;let[f,h]=R.useState(a.state),[m,g]=L1(f),[y,b]=R.useState(),[p,w]=R.useState({isTransitioning:!1}),[D,B]=R.useState(),[q,X]=R.useState(),[V,Z]=R.useState(),$=R.useRef(new Map),be=R.useCallback((W,{deletedFetchers:ge,newErrors:Oe,flushSync:Re,viewTransitionOpts:we})=>{Oe&&r&&Object.values(Oe).forEach(Ye=>r(Ye,{location:W.location,params:W.matches[0]?.params??{},unstable_pattern:Cr(W.matches)})),W.fetchers.forEach((Ye,Te)=>{Ye.data!==void 0&&$.current.set(Te,Ye.data)}),ge.forEach(Ye=>$.current.delete(Ye)),iy(Re===!1||i!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let Le=a.window!=null&&a.window.document!=null&&typeof a.window.document.startViewTransition=="function";if(iy(we==null||Le,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!we||!Le){i&&Re?i(()=>h(W)):s===!1?h(W):R.startTransition(()=>{s===!0&&g(Ye=>ry(Ye,W)),h(W)});return}if(i&&Re){i(()=>{q&&(D?.resolve(),q.skipTransition()),w({isTransitioning:!0,flushSync:!0,currentLocation:we.currentLocation,nextLocation:we.nextLocation})});let Ye=a.window.document.startViewTransition(()=>{i(()=>h(W))});Ye.finished.finally(()=>{i(()=>{B(void 0),X(void 0),b(void 0),w({isTransitioning:!1})})}),i(()=>X(Ye));return}q?(D?.resolve(),q.skipTransition(),Z({state:W,currentLocation:we.currentLocation,nextLocation:we.nextLocation})):(b(W),w({isTransitioning:!0,flushSync:!1,currentLocation:we.currentLocation,nextLocation:we.nextLocation}))},[a.window,i,q,D,s,g,r]);R.useLayoutEffect(()=>a.subscribe(be),[a,be]),R.useEffect(()=>{p.isTransitioning&&!p.flushSync&&B(new H1)},[p]),R.useEffect(()=>{if(D&&y&&a.window){let W=y,ge=D.promise,Oe=a.window.document.startViewTransition(async()=>{s===!1?h(W):R.startTransition(()=>{s===!0&&g(Re=>ry(Re,W)),h(W)}),await ge});Oe.finished.finally(()=>{B(void 0),X(void 0),b(void 0),w({isTransitioning:!1})}),X(Oe)}},[y,D,a.window,s,g]),R.useEffect(()=>{D&&y&&m.location.key===y.location.key&&D.resolve()},[D,q,m.location,y]),R.useEffect(()=>{!p.isTransitioning&&V&&(b(V.state),w({isTransitioning:!0,flushSync:!1,currentLocation:V.currentLocation,nextLocation:V.nextLocation}),Z(void 0))},[p.isTransitioning,V]);let me=R.useMemo(()=>({createHref:a.createHref,encodeLocation:a.encodeLocation,go:W=>a.navigate(W),push:(W,ge,Oe)=>a.navigate(W,{state:ge,preventScrollReset:Oe?.preventScrollReset}),replace:(W,ge,Oe)=>a.navigate(W,{replace:!0,state:ge,preventScrollReset:Oe?.preventScrollReset})}),[a]),ye=a.basename||"/",C=R.useMemo(()=>({router:a,navigator:me,static:!1,basename:ye,onError:r}),[a,me,ye,r]);return R.createElement(R.Fragment,null,R.createElement(Ui.Provider,{value:C},R.createElement(Or.Provider,{value:m},R.createElement(Fy.Provider,{value:$.current},R.createElement(pf.Provider,{value:p},R.createElement(V1,{basename:ye,location:m.location,navigationType:m.historyAction,navigator:me,unstable_useTransitions:s},R.createElement(k1,{routes:a.routes,future:a.future,state:m,onError:r})))))),null)}function ry(a,i){return{...a,navigation:i.navigation.state!=="idle"?i.navigation:a.navigation,revalidation:i.revalidation!=="idle"?i.revalidation:a.revalidation,actionData:i.navigation.state!=="submitting"?i.actionData:a.actionData,fetchers:i.fetchers}}var k1=R.memo(Q1);function Q1({routes:a,future:i,state:r,onError:s}){return E1(a,void 0,r,s,i)}function Y1({to:a,replace:i,state:r,relative:s}){De(El(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=R.useContext(mn);St(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:f}=R.useContext(Gn),{pathname:h}=li(),m=gf(),g=fo(a,co(f),h,s==="path"),y=JSON.stringify(g);return R.useEffect(()=>{m(JSON.parse(y),{replace:i,state:r,relative:s})},[m,y,s,i,r]),null}function eg(a){return S1(a.context)}function V1({basename:a="/",children:i=null,location:r,navigationType:s="POP",navigator:c,static:f=!1,unstable_useTransitions:h}){De(!El(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=a.replace(/^\/*/,"/"),g=R.useMemo(()=>({basename:m,navigator:c,static:f,unstable_useTransitions:h,future:{}}),[m,c,f,h]);typeof r=="string"&&(r=ii(r));let{pathname:y="/",search:b="",hash:p="",state:w=null,key:D="default"}=r,B=R.useMemo(()=>{let q=Nn(y,m);return q==null?null:{location:{pathname:q,search:b,hash:p,state:w,key:D},navigationType:s}},[m,y,b,p,w,D,s]);return St(B!=null,`<Router basename="${m}"> is not able to match the URL "${y}${b}${p}" because it does not start with the basename, so the <Router> won't render anything.`),B==null?null:R.createElement(mn.Provider,{value:g},R.createElement(ho.Provider,{children:i,value:B}))}var Ws="get",eo="application/x-www-form-urlencoded";function mo(a){return typeof HTMLElement<"u"&&a instanceof HTMLElement}function G1(a){return mo(a)&&a.tagName.toLowerCase()==="button"}function K1(a){return mo(a)&&a.tagName.toLowerCase()==="form"}function X1(a){return mo(a)&&a.tagName.toLowerCase()==="input"}function Z1(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function F1(a,i){return a.button===0&&(!i||i==="_self")&&!Z1(a)}var Xs=null;function J1(){if(Xs===null)try{new FormData(document.createElement("form"),0),Xs=!1}catch{Xs=!0}return Xs}var P1=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Uc(a){return a!=null&&!P1.has(a)?(St(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${eo}"`),null):a}function $1(a,i){let r,s,c,f,h;if(K1(a)){let m=a.getAttribute("action");s=m?Nn(m,i):null,r=a.getAttribute("method")||Ws,c=Uc(a.getAttribute("enctype"))||eo,f=new FormData(a)}else if(G1(a)||X1(a)&&(a.type==="submit"||a.type==="image")){let m=a.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=a.getAttribute("formaction")||m.getAttribute("action");if(s=g?Nn(g,i):null,r=a.getAttribute("formmethod")||m.getAttribute("method")||Ws,c=Uc(a.getAttribute("formenctype"))||Uc(m.getAttribute("enctype"))||eo,f=new FormData(m,a),!J1()){let{name:y,type:b,value:p}=a;if(b==="image"){let w=y?`${y}.`:"";f.append(`${w}x`,"0"),f.append(`${w}y`,"0")}else y&&f.append(y,p)}}else{if(mo(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Ws,s=null,c=eo,h=a}return f&&c==="text/plain"&&(h=f,f=void 0),{action:s,method:r.toLowerCase(),encType:c,formData:f,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Sf(a,i){if(a===!1||a===null||typeof a>"u")throw new Error(i)}function I1(a,i,r,s){let c=typeof a=="string"?new URL(a,typeof window>"u"?"server://singlefetch/":window.location.origin):a;return r?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${s}`:c.pathname=`${c.pathname}.${s}`:c.pathname==="/"?c.pathname=`_root.${s}`:i&&Nn(c.pathname,i)==="/"?c.pathname=`${i.replace(/\/$/,"")}/_root.${s}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${s}`,c}async function W1(a,i){if(a.id in i)return i[a.id];try{let r=await import(a.module);return i[a.id]=r,r}catch(r){return console.error(`Error loading route module \`${a.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function eE(a){return a==null?!1:a.href==null?a.rel==="preload"&&typeof a.imageSrcSet=="string"&&typeof a.imageSizes=="string":typeof a.rel=="string"&&typeof a.href=="string"}async function tE(a,i,r){let s=await Promise.all(a.map(async c=>{let f=i.routes[c.route.id];if(f){let h=await W1(f,r);return h.links?h.links():[]}return[]}));return lE(s.flat(1).filter(eE).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function sy(a,i,r,s,c,f){let h=(g,y)=>r[y]?g.route.id!==r[y].route.id:!0,m=(g,y)=>r[y].pathname!==g.pathname||r[y].route.path?.endsWith("*")&&r[y].params["*"]!==g.params["*"];return f==="assets"?i.filter((g,y)=>h(g,y)||m(g,y)):f==="data"?i.filter((g,y)=>{let b=s.routes[g.route.id];if(!b||!b.hasLoader)return!1;if(h(g,y)||m(g,y))return!0;if(g.route.shouldRevalidate){let p=g.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(a,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function nE(a,i,{includeHydrateFallback:r}={}){return aE(a.map(s=>{let c=i.routes[s.route.id];if(!c)return[];let f=[c.module];return c.clientActionModule&&(f=f.concat(c.clientActionModule)),c.clientLoaderModule&&(f=f.concat(c.clientLoaderModule)),r&&c.hydrateFallbackModule&&(f=f.concat(c.hydrateFallbackModule)),c.imports&&(f=f.concat(c.imports)),f}).flat(1))}function aE(a){return[...new Set(a)]}function iE(a){let i={},r=Object.keys(a).sort();for(let s of r)i[s]=a[s];return i}function lE(a,i){let r=new Set;return new Set(i),a.reduce((s,c)=>{let f=JSON.stringify(iE(c));return r.has(f)||(r.add(f),s.push({key:f,link:c})),s},[])}function tg(){let a=R.useContext(Ui);return Sf(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function rE(){let a=R.useContext(Or);return Sf(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var Ef=R.createContext(void 0);Ef.displayName="FrameworkContext";function ng(){let a=R.useContext(Ef);return Sf(a,"You must render this element inside a <HydratedRouter> element"),a}function sE(a,i){let r=R.useContext(Ef),[s,c]=R.useState(!1),[f,h]=R.useState(!1),{onFocus:m,onBlur:g,onMouseEnter:y,onMouseLeave:b,onTouchStart:p}=i,w=R.useRef(null);R.useEffect(()=>{if(a==="render"&&h(!0),a==="viewport"){let q=V=>{V.forEach(Z=>{h(Z.isIntersecting)})},X=new IntersectionObserver(q,{threshold:.5});return w.current&&X.observe(w.current),()=>{X.disconnect()}}},[a]),R.useEffect(()=>{if(s){let q=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(q)}}},[s]);let D=()=>{c(!0)},B=()=>{c(!1),h(!1)};return r?a!=="intent"?[f,w,{}]:[f,w,{onFocus:pr(m,D),onBlur:pr(g,B),onMouseEnter:pr(y,D),onMouseLeave:pr(b,B),onTouchStart:pr(p,D)}]:[!1,w,{}]}function pr(a,i){return r=>{a&&a(r),r.defaultPrevented||i(r)}}function oE({page:a,...i}){let{router:r}=tg(),s=R.useMemo(()=>$a(r.routes,a,r.basename),[r.routes,a,r.basename]);return s?R.createElement(cE,{page:a,matches:s,...i}):null}function uE(a){let{manifest:i,routeModules:r}=ng(),[s,c]=R.useState([]);return R.useEffect(()=>{let f=!1;return tE(a,i,r).then(h=>{f||c(h)}),()=>{f=!0}},[a,i,r]),s}function cE({page:a,matches:i,...r}){let s=li(),{future:c,manifest:f,routeModules:h}=ng(),{basename:m}=tg(),{loaderData:g,matches:y}=rE(),b=R.useMemo(()=>sy(a,i,y,f,s,"data"),[a,i,y,f,s]),p=R.useMemo(()=>sy(a,i,y,f,s,"assets"),[a,i,y,f,s]),w=R.useMemo(()=>{if(a===s.pathname+s.search+s.hash)return[];let q=new Set,X=!1;if(i.forEach(Z=>{let $=f.routes[Z.route.id];!$||!$.hasLoader||(!b.some(be=>be.route.id===Z.route.id)&&Z.route.id in g&&h[Z.route.id]?.shouldRevalidate||$.hasClientLoader?X=!0:q.add(Z.route.id))}),q.size===0)return[];let V=I1(a,m,c.unstable_trailingSlashAwareDataRequests,"data");return X&&q.size>0&&V.searchParams.set("_routes",i.filter(Z=>q.has(Z.route.id)).map(Z=>Z.route.id).join(",")),[V.pathname+V.search]},[m,c.unstable_trailingSlashAwareDataRequests,g,s,f,b,i,a,h]),D=R.useMemo(()=>nE(p,f),[p,f]),B=uE(p);return R.createElement(R.Fragment,null,w.map(q=>R.createElement("link",{key:q,rel:"prefetch",as:"fetch",href:q,...r})),D.map(q=>R.createElement("link",{key:q,rel:"modulepreload",href:q,...r})),B.map(({key:q,link:X})=>R.createElement("link",{key:q,nonce:r.nonce,...X,crossOrigin:X.crossOrigin??r.crossOrigin})))}function fE(...a){return i=>{a.forEach(r=>{typeof r=="function"?r(i):r!=null&&(r.current=i)})}}var dE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{dE&&(window.__reactRouterVersion="7.13.0")}catch{}function hE(a,i){return kS({basename:i?.basename,getContext:i?.getContext,future:i?.future,history:nS({window:i?.window}),hydrationData:mE(),routes:a,mapRouteProperties:B1,hydrationRouteProperties:j1,dataStrategy:i?.dataStrategy,patchRoutesOnNavigation:i?.patchRoutesOnNavigation,window:i?.window,unstable_instrumentations:i?.unstable_instrumentations}).initialize()}function mE(){let a=window?.__staticRouterHydrationData;return a&&a.errors&&(a={...a,errors:pE(a.errors)}),a}function pE(a){if(!a)return null;let i=Object.entries(a),r={};for(let[s,c]of i)if(c&&c.__type==="RouteErrorResponse")r[s]=new Ar(c.status,c.statusText,c.data,c.internal===!0);else if(c&&c.__type==="Error"){if(c.__subType){let f=window[c.__subType];if(typeof f=="function")try{let h=new f(c.message);h.stack="",r[s]=h}catch{}}if(r[s]==null){let f=new Error(c.message);f.stack="",r[s]=f}}else r[s]=c;return r}var ag=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ig=R.forwardRef(function({onClick:i,discover:r="render",prefetch:s="none",relative:c,reloadDocument:f,replace:h,state:m,target:g,to:y,preventScrollReset:b,viewTransition:p,unstable_defaultShouldRevalidate:w,...D},B){let{basename:q,unstable_useTransitions:X}=R.useContext(mn),V=typeof y=="string"&&ag.test(y),Z=Ly(y,q);y=Z.to;let $=g1(y,{relative:c}),[be,me,ye]=sE(s,D),C=vE(y,{replace:h,state:m,target:g,preventScrollReset:b,relative:c,viewTransition:p,unstable_defaultShouldRevalidate:w,unstable_useTransitions:X});function W(Oe){i&&i(Oe),Oe.defaultPrevented||C(Oe)}let ge=R.createElement("a",{...D,...ye,href:Z.absoluteURL||$,onClick:Z.isExternal||f?i:W,ref:fE(B,me),target:g,"data-discover":!V&&r==="render"?"true":void 0});return be&&!V?R.createElement(R.Fragment,null,ge,R.createElement(oE,{page:$})):ge});ig.displayName="Link";var lg=R.forwardRef(function({"aria-current":i="page",caseSensitive:r=!1,className:s="",end:c=!1,style:f,to:h,viewTransition:m,children:g,...y},b){let p=xr(h,{relative:y.relative}),w=li(),D=R.useContext(Or),{navigator:B,basename:q}=R.useContext(mn),X=D!=null&&wE(p)&&m===!0,V=B.encodeLocation?B.encodeLocation(p).pathname:p.pathname,Z=w.pathname,$=D&&D.navigation&&D.navigation.location?D.navigation.location.pathname:null;r||(Z=Z.toLowerCase(),$=$?$.toLowerCase():null,V=V.toLowerCase()),$&&q&&($=Nn($,q)||$);const be=V!=="/"&&V.endsWith("/")?V.length-1:V.length;let me=Z===V||!c&&Z.startsWith(V)&&Z.charAt(be)==="/",ye=$!=null&&($===V||!c&&$.startsWith(V)&&$.charAt(V.length)==="/"),C={isActive:me,isPending:ye,isTransitioning:X},W=me?i:void 0,ge;typeof s=="function"?ge=s(C):ge=[s,me?"active":null,ye?"pending":null,X?"transitioning":null].filter(Boolean).join(" ");let Oe=typeof f=="function"?f(C):f;return R.createElement(ig,{...y,"aria-current":W,className:ge,ref:b,style:Oe,to:h,viewTransition:m},typeof g=="function"?g(C):g)});lg.displayName="NavLink";var yE=R.forwardRef(({discover:a="render",fetcherKey:i,navigate:r,reloadDocument:s,replace:c,state:f,method:h=Ws,action:m,onSubmit:g,relative:y,preventScrollReset:b,viewTransition:p,unstable_defaultShouldRevalidate:w,...D},B)=>{let{unstable_useTransitions:q}=R.useContext(mn),X=EE(),V=TE(m,{relative:y}),Z=h.toLowerCase()==="get"?"get":"post",$=typeof m=="string"&&ag.test(m),be=me=>{if(g&&g(me),me.defaultPrevented)return;me.preventDefault();let ye=me.nativeEvent.submitter,C=ye?.getAttribute("formmethod")||h,W=()=>X(ye||me.currentTarget,{fetcherKey:i,method:C,navigate:r,replace:c,state:f,relative:y,preventScrollReset:b,viewTransition:p,unstable_defaultShouldRevalidate:w});q&&r!==!1?R.startTransition(()=>W()):W()};return R.createElement("form",{ref:B,method:Z,action:V,onSubmit:s?g:be,...D,"data-discover":!$&&a==="render"?"true":void 0})});yE.displayName="Form";function gE(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function rg(a){let i=R.useContext(Ui);return De(i,gE(a)),i}function vE(a,{target:i,replace:r,state:s,preventScrollReset:c,relative:f,viewTransition:h,unstable_defaultShouldRevalidate:m,unstable_useTransitions:g}={}){let y=gf(),b=li(),p=xr(a,{relative:f});return R.useCallback(w=>{if(F1(w,i)){w.preventDefault();let D=r!==void 0?r:Wn(b)===Wn(p),B=()=>y(a,{replace:D,state:s,preventScrollReset:c,relative:f,viewTransition:h,unstable_defaultShouldRevalidate:m});g?R.startTransition(()=>B()):B()}},[b,y,p,r,s,i,a,c,f,h,m,g])}var bE=0,SE=()=>`__${String(++bE)}__`;function EE(){let{router:a}=rg("useSubmit"),{basename:i}=R.useContext(mn),r=D1(),s=a.fetch,c=a.navigate;return R.useCallback(async(f,h={})=>{let{action:m,method:g,encType:y,formData:b,body:p}=$1(f,i);if(h.navigate===!1){let w=h.fetcherKey||SE();await s(w,r,h.action||m,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:b,body:p,formMethod:h.method||g,formEncType:h.encType||y,flushSync:h.flushSync})}else await c(h.action||m,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:b,body:p,formMethod:h.method||g,formEncType:h.encType||y,replace:h.replace,state:h.state,fromRouteId:r,flushSync:h.flushSync,viewTransition:h.viewTransition})},[s,c,i,r])}function TE(a,{relative:i}={}){let{basename:r}=R.useContext(mn),s=R.useContext(Gn);De(s,"useFormAction must be used inside a RouteContext");let[c]=s.matches.slice(-1),f={...xr(a||".",{relative:i})},h=li();if(a==null){f.search=h.search;let m=new URLSearchParams(f.search),g=m.getAll("index");if(g.some(b=>b==="")){m.delete("index"),g.filter(p=>p).forEach(p=>m.append("index",p));let b=m.toString();f.search=b?`?${b}`:""}}return(!a||a===".")&&c.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(f.pathname=f.pathname==="/"?r:In([r,f.pathname])),Wn(f)}function wE(a,{relative:i}={}){let r=R.useContext(pf);De(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=rg("useViewTransitionState"),c=xr(a,{relative:i});if(!r.isTransitioning)return!1;let f=Nn(r.currentLocation.pathname,s)||r.currentLocation.pathname,h=Nn(r.nextLocation.pathname,s)||r.nextLocation.pathname;return oo(c.pathname,h)!=null||oo(c.pathname,f)!=null}function _E(a){return R.createElement(q1,{flushSync:Cy.flushSync,...a})}function RE(){return se.jsx("div",{className:"min-h-screen bg-background text-foreground",children:se.jsx(eg,{})})}const sg=(...a)=>a.filter((i,r,s)=>!!i&&i.trim()!==""&&s.indexOf(i)===r).join(" ").trim();const AE=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const CE=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,r,s)=>s?s.toUpperCase():r.toLowerCase());const oy=a=>{const i=CE(a);return i.charAt(0).toUpperCase()+i.slice(1)};var OE={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const xE=a=>{for(const i in a)if(i.startsWith("aria-")||i==="role"||i==="title")return!0;return!1};const DE=R.forwardRef(({color:a="currentColor",size:i=24,strokeWidth:r=2,absoluteStrokeWidth:s,className:c="",children:f,iconNode:h,...m},g)=>R.createElement("svg",{ref:g,...OE,width:i,height:i,stroke:a,strokeWidth:s?Number(r)*24/Number(i):r,className:sg("lucide",c),...!f&&!xE(m)&&{"aria-hidden":"true"},...m},[...h.map(([y,b])=>R.createElement(y,b)),...Array.isArray(f)?f:[f]]));const Dr=(a,i)=>{const r=R.forwardRef(({className:s,...c},f)=>R.createElement(DE,{ref:f,iconNode:i,className:sg(`lucide-${AE(oy(a))}`,`lucide-${a}`,s),...c}));return r.displayName=oy(a),r};const ME=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],NE=Dr("arrow-left",ME);const zE=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],UE=Dr("bell",zE);const LE=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],BE=Dr("cpu",LE);const jE=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],HE=Dr("folder-git-2",jE);const qE=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],kE=Dr("languages",qE),QE="/api";class YE{baseUrl;constructor(i){this.baseUrl=i}async request(i,r={}){const{params:s,...c}=r;let f=`${this.baseUrl}${i}`;if(s){const g=new URLSearchParams(s);f+=`?${g.toString()}`}const h={...c.headers};c.body!==void 0&&(h["Content-Type"]="application/json");const m=await fetch(f,{...c,headers:h});if(!m.ok){const g=await m.json().catch(()=>({}));throw new VE(m.status,g.message||g.error||"Request failed")}if(m.status!==204)return m.json()}get(i,r){return this.request(i,{...r,method:"GET"})}post(i,r,s){return this.request(i,{...s,method:"POST",body:r?JSON.stringify(r):void 0})}put(i,r,s){return this.request(i,{...s,method:"PUT",body:r?JSON.stringify(r):void 0})}patch(i,r,s){return this.request(i,{...s,method:"PATCH",body:r?JSON.stringify(r):void 0})}delete(i,r){return this.request(i,{...r,method:"DELETE"})}}class VE extends Error{status;constructor(i,r){super(r),this.name="ApiError",this.status=i}}const Ra=new YE(QE),mt={projects:{all:["projects"],list:a=>["projects","list",a],detail:a=>["projects","detail",a]},tasks:{all:["tasks"],list:(a,i)=>["tasks","list",a,i],detail:a=>["tasks","detail",a],stats:a=>["tasks","stats",a]},workspaces:{all:["workspaces"],list:a=>["workspaces","list",a],detail:a=>["workspaces","detail",a],diff:a=>["workspaces","diff",a],gitStatus:a=>["workspaces","gitStatus",a]},sessions:{all:["sessions"],detail:a=>["sessions","detail",a]},files:{all:["files"],tree:(a,i)=>["files","tree",a,i],content:(a,i)=>["files","content",a,i]},git:{all:["git"],changes:a=>["git","changes",a],diff:(a,i,r)=>["git","diff",a,i,r],log:a=>["git","log",a],commitFiles:(a,i)=>["git","commitFiles",a,i],commitDiff:(a,i,r)=>["git","commitDiff",a,i,r]},profiles:{all:["profiles"],defaults:["profiles","defaults"],agent:a=>["profiles","agent",a],variant:(a,i)=>["profiles","variant",a,i]},providers:{all:["providers"],detail:a=>["providers","detail",a]},tunnel:{status:["tunnel","status"]},notifications:{settings:["notifications","settings"]},appSettings:{detail:["app-settings"]},system:{cursorAgentModels:["system","cursor-agent-models"],slashCommandCatalog:(a,i)=>["system","slash-command-catalog",a??null,i??null],skillCatalog:(a,i)=>["system","skill-catalog",a??null,i??null]}};function GE(){return uo({queryKey:mt.appSettings.detail,queryFn:()=>Ra.get("/app-settings")})}function KE(){const a=ni();return Rr({mutationFn:i=>Ra.put("/app-settings",i),onSuccess:()=>{a.invalidateQueries({queryKey:mt.appSettings.detail})}})}function m2(){return uo({queryKey:[...mt.appSettings.detail,"commit-message-defaults"],queryFn:()=>Ra.get("/app-settings/commit-message-defaults")})}const XE={"zh-CN":{Settings:"设置",General:"通用",Back:"返回","Loading...":"加载中...","No options":"暂无选项","Processing...":"处理中...",Confirm:"确认",Cancel:"取消","General Settings":"通用设置","Display Language":"显示语言","Choose the interface language. The setting is saved to the local Agent Tower database and will still apply after restart.":"选择界面语言。设置会保存到本地 Agent Tower 数据库,并在重新打开后继续生效。",English:"English","Simplified Chinese":"简体中文","Language setting":"语言设置","Language setting could not be saved":"语言设置保存失败","Browse and select a Git repository, or type a path and press Enter":"浏览并选择一个 Git 仓库,或输入路径后按 Enter","Agent 配置":"Agent 配置",项目配置:"项目配置",通知:"通知",通用:"通用","AI Agent Task Management Dashboard":"AI Agent 任务管理面板","Project Management":"项目管理","Manage your AI agent projects":"管理你的 AI Agent 项目","View Projects":"查看项目","Task Board":"任务看板","Kanban-style task management":"Kanban 风格的任务管理","Open Board":"打开看板",Workspace:"工作区","Git worktree isolated environments":"Git Worktree 隔离环境","Manage Workspaces":"管理工作区","Move to":"移动到","Delete Task":"删除任务","Drop into {title}":"放入 {title}","Drop here":"拖到此处","No tasks":"暂无任务","All Projects":"所有项目","Select View":"选择视图","Create New Project...":"创建新项目...","New Task":"新建任务","{count} tasks":"{count} 个任务","Clear filter":"清除筛选",Review:"待审查",Running:"进行中",Pending:"待开始",Done:"已完成",Cancelled:"已取消",Changes:"变更",History:"历史",Editor:"编辑器",Terminal:"终端",Preview:"预览","Coming soon...":"即将推出...",Modified:"已修改",Added:"已新增",Deleted:"已删除",Renamed:"已重命名","Loading diff...":"正在加载差异...","Failed to load diff.":"加载差异失败。","No diff content available.":"没有可显示的差异内容。","No workspace selected.":"未选择工作区。","Loading changes...":"正在加载变更...","Failed to load changes.":"加载变更失败。","No pending changes":"暂无待处理变更",Uncommitted:"未提交",Committed:"已提交","Select a file to view diff":"选择一个文件以查看差异","{count}s ago":"{count} 秒前","{count}m ago":"{count} 分钟前","{count}h ago":"{count} 小时前","{count}d ago":"{count} 天前","Loading files...":"正在加载文件列表...","No files changed":"没有文件变更","Loading history...":"正在加载历史记录...","Failed to load history.":"加载历史记录失败。","No commit history":"暂无提交历史","Load more":"加载更多","Select a commit to view changes":"选择一个提交以查看变更","Zoom out":"缩小","Reset zoom":"重置缩放","Zoom in":"放大","Fit to view":"适应视图","Failed to load image.":"加载图片失败。","Close tab":"关闭标签页",Close:"关闭","Expand file tree":"展开文件树","No open files":"暂无打开文件",Saving:"保存中",Unsaved:"未保存","Select a file from the tree to open.":"从文件树中选择一个文件以打开。","Loading file...":"正在加载文件...","Failed to load file":"加载文件失败","Failed to load":"加载失败",Files:"文件","No working directory":"未选择工作目录","Refresh file tree":"刷新文件树","Collapse file tree":"收起文件树","Shell {count}":"终端 {count}","New Terminal":"新终端","No terminals open":"暂无打开终端",Disconnected:"未连接","Connecting...":"连接中...",Connected:"已连接","No active session":"暂无活动会话","Create a workspace and start a session to see terminal output.":"创建工作区并启动会话后即可查看终端输出。","Process exited with code {code}":"进程已退出,退出码 {code}","Error: {message}":"错误: {message}","Session: {id}":"会话: {id}","Tunnel active":"隧道已启用","Share via tunnel":"通过隧道分享","Tunnel Active":"隧道已启用","Token protected":"受 Token 保护","Copy shareable link":"复制分享链接","Hide token":"隐藏 Token","Show token":"显示 Token","Copy token":"复制 Token","Stopping...":"停止中...","Stop Tunnel":"停止隧道","Create & Start":"创建并启动","Creating Task...":"正在创建任务...","Creating Workspace...":"正在创建工作区...","Creating Session...":"正在创建会话...","Starting Agent...":"正在启动 Agent...","Create New Project":"创建新项目","Creating...":"创建中...",Create:"创建","Create Project":"创建项目","Project Name":"项目名称","e.g., Agent Tower":"例如:Agent Tower","Repository Path":"仓库路径","Create New Task":"创建新任务",Project:"项目",Provider:"Provider",Agent:"Agent","Select project...":"选择项目...","Select provider...":"选择 Provider...","Task Title":"任务标题","e.g., Implement login flow":"例如:实现登录流程",Description:"描述","Optional...":"可选...","Optional description...":"可选描述...","Drop files here":"将文件拖到这里","Attach files":"添加文件","or paste files":"或粘贴文件","or paste/drag files":"或粘贴/拖拽文件","Drag to resize":"拖动以调整大小","Failed to create project":"创建项目失败","Select a task from the sidebar to view logs, monitor execution, or interact with an agent.":"从侧边栏选择一个任务,以查看日志、监控执行过程,或与 Agent 交互。","Open in IDE":"在 IDE 中打开","Toggle Workspace":"切换工作区面板","More actions":"更多操作","No description":"暂无描述","Setup ({current}/{total}): {command}":"Setup({current}/{total}):{command}","Loading logs...":"正在加载日志...","Waiting for agent output...":"等待 Agent 输出...","No logs recorded for this session.":"当前会话暂无日志记录。","Scroll to bottom":"滚动到底部","Drop files here...":"将文件拖到这里...","Continue conversation...":"继续对话...","Message Agent...":"给 Agent 发送消息...","Upload file":"上传文件"},en:{设置:"Settings",通用:"General",返回:"Back","加载中...":"Loading...",暂无选项:"No options","处理中...":"Processing...",确认:"Confirm",取消:"Cancel",通用设置:"General Settings",显示语言:"Display Language","选择界面语言。设置会保存到本地 Agent Tower 数据库,并在重新打开后继续生效。":"Choose the interface language. The setting is saved to the local Agent Tower database and will still apply after restart.",简体中文:"Simplified Chinese",语言设置:"Language setting",语言设置保存失败:"Language setting could not be saved","Agent 配置":"Agent Settings",项目配置:"Project Settings",通知:"Notifications","暂无项目,请先创建项目":"No projects yet. Create one first.",选择项目:"Select Project","选择项目...":"Select project...",自动复制文件:"Auto-copy Files","创建 worktree 时自动从主仓库复制的文件或目录。支持 glob 模式。":"Files or directories to copy from the main repository when creating a worktree. Glob patterns are supported.","适用于不在 git 管理中但启动必需的文件,如 .env、node_modules、数据库文件等":"Useful for required startup files that are not tracked by git, such as .env, node_modules, or database files.","Setup 脚本":"Setup Script","创建 worktree 后自动执行的命令,每行一条,按顺序执行。":"Commands to run automatically after creating the worktree, one per line in order.","命令在 worktree 目录下执行,单条命令超时 5 分钟,失败不会阻断后续命令":"Commands run inside the worktree directory. Each command times out after 5 minutes, and a failure does not block later commands.",常用命令:"Quick Commands","在终端中可快速执行的命令,不会自动运行。":"Commands that can be run quickly in the terminal. They are not executed automatically.","保存中...":"Saving...",保存:"Save",系统通知:"System Notifications",任务完成时弹出桌面通知:"Show a desktop notification when a task finishes.",第三方通知:"Third-party Notifications",选择一个第三方渠道接收通知:"Choose a third-party channel to receive notifications.",无:"None",飞书:"Feishu",测试发送:"Send Test",发送成功:"Sent successfully",发送失败:"Send failed","跳转地址(用于生成任务链接)":"Base URL (used to generate task links)",'通知卡片中的"查看任务"按钮将跳转到 {path}':'The "View Task" button in the notification card will open {path}',通知模板:"Notification Templates","支持变量: {taskTitle}, {taskId}, {projectId}, {projectName}, {status}":"Supported variables: {taskTitle}, {taskId}, {projectId}, {projectName}, {status}",标题模板:"Title Template",内容模板:"Body Template",'✅ "{taskTitle}" 已完成,等待审查':'✅ "{taskTitle}" is complete and ready for review',保存所有更改:"Save All Changes","启动失败: {message}":"Start failed: {message}",未知错误:"Unknown error",会话已停止:"Session stopped","Agent 交互演示":"Agent Interaction Demo","选择 Agent":"Select Agent","输入你的问题或任务...":"Enter your question or task...","启动中...":"Starting...",开始:"Start",对话:"Conversation",已连接:"Connected","连接中...":"Connecting...",未连接:"Disconnected",停止:"Stop","选择 Agent 并输入问题开始对话":"Select an agent and enter a prompt to start chatting.",你:"You","发送后续消息...":"Send a follow-up message...",发送:"Send",新会话:"New Session",未选择:"Not selected",连接:"Connection","Profiles 设置":"Profile Settings","配置变体 (Profile Variant)":"Profile Variant",输入任务:"Task Input","等待 Agent 响应...":"Waiting for agent output...","发送消息给 Agent...":"Send a message to the agent...","启动失败,请重试":"Failed to start. Please try again.",启动:"Start","创建工作空间...":"Creating workspace...","创建会话...":"Creating session...","启动 Agent...":"Starting agent...","启动 Agent":"Start Agent","选择 Provider":"Select Provider"," (不可用)":" (Unavailable)",任务描述:"Task Description","描述你想让 Agent 完成的任务...":"Describe the task you want the agent to complete...","输入文件路径...":"Enter a file path...",添加:"Add",添加此目录:"Add this directory",名称:"Name",命令:"Command",切换渠道:"Switch Provider","(默认)":"(Default)","留空为 auto;或直接输入模型 ID(与 cursor-agent --model 一致)":"Leave empty for auto, or enter a model ID directly (same as cursor-agent --model).","正在加载 cursor-agent 模型列表…":"Loading cursor-agent model list...",收起列表:"Collapse List","从本机 cursor-agent 选择({count} 个)":"Choose from local cursor-agent ({count})","筛选模型…":"Filter models...","默认 (auto)":"Default (auto)",无匹配项:"No matches",请求失败:"Request failed","无法从本机加载模型列表({error})。仍可手动输入;或在安装 cursor-agent 的机器上运行":"Could not load models from the local machine ({error}). You can still enter one manually, or run","查看 ID。":"to inspect available IDs.","JSON 格式错误":"Invalid JSON format","确定删除 {agentType} / {variant}?":"Delete {agentType} / {variant}?",新增:"New",内置:"Built-in","新增 Variant — {agentType}":"New Variant — {agentType}","编辑 {variant}":"Edit {variant}","Variant 名称":"Variant Name","例如: CUSTOM":"e.g. CUSTOM","配置 (JSON)":"Configuration (JSON)","状态变更失败,该操作不被允许":"Status change failed. This action is not allowed.","Git 操作":"Git Operations",删除任务:"Delete Task","Setup 完成":"Setup complete","Setup 失败: {error}":"Setup failed: {error}","尚未启动 Agent":"No agent started yet","选择一个 Agent 来执行此任务":"Choose an agent to execute this task.","选择一个 Agent 来执行此任务,Agent 将自动创建工作空间并开始工作。":"Choose an agent to execute this task. The agent will create a workspace automatically and start working.",回到底部:"Back to Bottom","代码已合并,以上为历史沟通记录":"The code has been merged. The conversation above is historical.","启动新 Agent":"Start New Agent","确认删除任务「{title}」?此操作不可撤销。":'Delete task "{title}"? This action cannot be undone.',删除:"Delete","正在运行的 Agent 将被停止":"The running agent will be stopped.",分支上未合并的变更将丢失:"Unmerged changes on the branch will be lost.","关联的工作目录(worktree)将被清理":"The associated worktree directory will be cleaned up.","{opLabel} 冲突 — {count} 个文件":"{opLabel} conflicts — {count} files",中止操作:"Abort Operation",解决冲突:"Resolve Conflicts","解决 {opLabel} 冲突":"Resolve {opLabel} Conflicts","在 IDE 中打开":"Open in IDE","发送中...":"Sending...","AI 辅助解决":"Resolve with AI","冲突文件({count})":"Conflicted Files ({count})","选择 Session(AI 辅助解决)":"Choose Session (Resolve with AI)","选择一个 Session...":"Select a session...","没有可用的 Session,请在 IDE 中手动解决冲突。":"No session is available. Please resolve the conflicts manually in your IDE.",快捷命令:"Quick Commands",待办:"Todos","上下文: {used} / {max} tokens":"Context: {used} / {max} tokens","已使用: {used} tokens":"Used: {used} tokens",可用:"Available",不可用:"Unavailable",该类型暂无运行配置:"No runtime configuration is available for this type.","追加 Prompt":"Append Prompt","追加到每次 prompt 末尾的文本":"Text appended to the end of every prompt.",跳过权限确认:"Skip Permission Confirmation",模型:"Model",强制执行:"Force Execution",跳过所有确认和沙盒:"Skip All Confirmations and Sandbox",Profile:"Profile","~/.codex/config.toml 中的 profile 名称":"Profile name in ~/.codex/config.toml",是:"Yes",否:"No",覆盖:"Overwrite",跳过:"Skip","JSON 语法错误":"Invalid JSON syntax","TOML 语法错误: {message}":"Invalid TOML syntax: {message}","编辑 Provider":"Edit Provider","新建 Provider":"New Provider","例如: Claude Code (官方)":"e.g. Claude Code (Official)","Agent 类型":"Agent Type","选择 Agent 类型":"Select Agent Type","设为该类型的默认 Provider":"Set as the default provider for this agent type",运行配置:"Runtime Configuration",环境变量:"Environment Variables","注入到 Agent 进程的环境变量。Codex 的":"Environment variables injected into the agent process. Codex","指定的是变量名,实际值需在此处设置。":"specifies the variable name in env_key, and the actual value must be set here.","变量名,如 AZURE_OPENAI_API_KEY":"Variable name, e.g. AZURE_OPENAI_API_KEY",值:"Value",添加变量:"Add Variable","CLI 原生配置 (config.toml)":"Native CLI Config (config.toml)","CLI 原生配置 (settings.json)":"Native CLI Config (settings.json)","直接填写 Codex":"Enter a Codex","格式的配置片段,通过":"configuration snippet directly and inject it via","参数注入。不会修改你的":". It will not modify your","文件。":"file.","对应 Claude Code 的":"This corresponds to Claude Code",通过:"and is injected through","参数注入。在":". Configure","中设置 ANTHROPIC_API_KEY、ANTHROPIC_BASE_URL 等。":"inside env, such as ANTHROPIC_API_KEY and ANTHROPIC_BASE_URL.","导出 Provider 备份":"Export Provider Backup","导出中...":"Exporting...",导出备份:"Export Backup","导出的备份文件将包含完整的 Provider 配置,包括环境变量、CLI settings 等敏感信息。任何拿到文件的人都可能直接使用这些 Provider。":"The exported backup file contains the full provider configuration, including sensitive information such as environment variables and CLI settings. Anyone with this file may be able to use those providers directly.","这个功能用于备份和迁移,不用于分享配置。":"This feature is for backup and migration, not for sharing configuration.","导出内容只包含用户层配置:自定义 Provider,以及对内置 Provider 的覆盖。":"The export only contains user-level configuration: custom providers and overrides of built-in providers.","我已知晓该备份文件包含敏感信息,只会保存在安全位置。":"I understand that this backup contains sensitive information and will only store it in a secure location.","导入 Provider 备份":"Import Provider Backup","导入中...":"Importing...","确认导入 {count} 项":"Import {count} item(s)","导出时间:{value}":"Exported at: {value}","模式:完整备份(含敏感信息)":"Mode: Full backup (contains sensitive data)","文件内 Provider 数量:{count}":"Providers in file: {count}","将覆盖当前已有的 Provider:{name}":"This will overwrite the existing provider: {name}","当前同 ID Provider 配置一致,本次不会重复写入。":"The provider with the same ID is already identical. It will not be written again.","当前不存在同 ID Provider,将直接新增。":"No provider with the same ID exists. It will be created directly.","系统内置 Provider 不可删除":"Built-in providers cannot be deleted.","已恢复默认 Provider 配置":"Default provider configuration restored.","Provider 已删除":"Provider deleted.","删除 Provider 失败":"Failed to delete provider.","Provider 备份已导出":"Provider backup exported.","导出 Provider 备份失败":"Failed to export provider backup.","备份文件不是有效的 JSON":"The backup file is not valid JSON.",导入预览失败:"Failed to preview import.","导入完成,当前配置无需变更":"Import complete. No changes were needed.","导入完成:新增 {create},覆盖 {overwrite},跳过 {skip}":"Import complete: created {create}, overwritten {overwrite}, skipped {skip}","导入 Provider 备份失败":"Failed to import provider backup.","Provider 配置":"Provider Configuration","管理 AI Agent 的连接配置和运行参数":"Manage AI agent connection settings and runtime parameters.",导入备份:"Import Backup","暂无 Provider 配置":"No providers configured yet.",默认:"Default","CLI 配置:":"CLI Config:",已配置:"Configured","环境变量:":"Environment Variables:",编辑:"Edit",删除自定义覆盖并恢复默认:"Delete custom override and restore default","恢复默认 Provider":"Restore Default Provider",'确定删除 "{name}" 的自定义覆盖,并恢复系统默认配置?':'Delete the custom override for "{name}" and restore the system default configuration?','确定删除 "{name}"?此操作不可撤销。':'Delete "{name}"? This action cannot be undone.',恢复默认:"Restore Default","{count} 个未提交变更":"{count} uncommitted changes","{count} 个冲突文件":"{count} conflicted files",变基进行中:"Rebase in progress",合并进行中:"Merge in progress","领先 {count} 个提交":"{count} commits ahead","落后 {count} 个提交":"{count} commits behind",已是最新:"Up to date","工作区有未提交的变更,请先让 Agent 提交或手动处理后再执行 Rebase / Merge 操作。":"The workspace has uncommitted changes. Ask the agent to commit them or handle them manually before running Rebase / Merge.",变基失败:"Rebase failed",合并失败:"Merge failed",确认合并:"Confirm Merge","加载分支状态...":"Loading branch status...","变基中...":"Rebasing...","变基 (Rebase)":"Rebase","将当前分支变基到最新的 {targetBranch}":"Rebase the current branch onto the latest {targetBranch}","合并 (Merge)":"Merge","合并中...":"Merging...","Squash merge 到 {targetBranch}":"Squash merge into {targetBranch}",提交消息:"Commit Message","输入提交消息...":"Enter commit message...",留空将使用默认消息:"Leave blank to use the default message.","Git Commit Message":"Git Commit Message","配置自动生成 commit message 时使用的 Agent 渠道和提示词。":"Configure the agent provider and prompt used for auto-generating commit messages.","Agent 渠道":"Agent Provider",跟随任务:"Follow Task",'"跟随任务"表示使用当前任务所用的 Agent 渠道。选择具体渠道可使用更经济的模型。':'"Follow Task" uses the same provider as the current task. Select a specific provider to use a more cost-effective model.',提示词模板:"Prompt Template","自定义生成 commit message 的提示词。留空则使用内置默认模板。":"Custom prompt for generating commit messages. Leave empty to use the built-in default template.",保存失败:"Save failed",已保存:"Saved"}},og=R.createContext(null);function ZE(a){return a?a==="en"?"en":a==="zh-CN"?"zh-CN":null:null}function FE(){return typeof navigator>"u"||navigator.language.toLowerCase().startsWith("zh")?"zh-CN":"en"}function JE(a,i){if(!i)return a;let r=a;for(const[s,c]of Object.entries(i))r=r.replaceAll(`{${s}}`,String(c??""));return r}let Pc="zh-CN";function ug(a,i,r){const s=XE[a][i]??i;return JE(s,r)}function PE(a,i){return ug(Pc,a,i)}function $E({children:a}){const i=R.useRef(FE()),[r,s]=R.useState(i.current),{data:c}=GE(),f=KE(),h=R.useRef(!1),m=R.useCallback(b=>{Pc=b,s(b),document.documentElement.lang=b},[]);R.useEffect(()=>{const b=ZE(c?.locale)??i.current;m(b),c&&c.locale===null&&!h.current&&(h.current=!0,f.mutate({locale:b}))},[c,m,f]);const g=R.useCallback(b=>{const p=Pc;m(b),f.mutate({locale:b},{onError:()=>{m(p),qb.error(PE("语言设置保存失败"))}})},[m,f]),y=R.useMemo(()=>({locale:r,setLocale:g,t:(b,p)=>ug(r,b,p)}),[r,g]);return se.jsx(og.Provider,{value:y,children:a})}function cg(){const a=R.useContext(og);if(!a)throw new Error("useI18n must be used within I18nProvider");return a}const IE=[{to:"/settings/general",label:"通用",icon:kE},{to:"/settings/agents",label:"Agent 配置",icon:BE},{to:"/settings/projects",label:"项目配置",icon:HE},{to:"/settings/notifications",label:"通知",icon:UE}],WE=se.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-neutral-900",children:[se.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z",fill:"currentColor"}),se.jsx("path",{d:"M2 17L12 22L22 17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),se.jsx("path",{d:"M2 12L12 17L22 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]});function eT(){const a=gf(),{t:i}=cg();return se.jsxs("div",{className:"h-screen flex flex-col bg-white",children:[se.jsxs("header",{className:"h-12 flex items-center justify-between px-4 border-b border-neutral-100 bg-white shrink-0 z-30",children:[se.jsxs("div",{className:"flex items-center gap-2.5",children:[WE,se.jsx("span",{className:"text-sm font-bold tracking-tight text-neutral-900",children:"Agent Tower"}),se.jsx("span",{className:"text-neutral-200 text-sm",children:"/"}),se.jsx("span",{className:"text-sm text-neutral-500",children:i("设置")})]}),se.jsxs("button",{onClick:()=>a("/"),className:"flex items-center gap-1.5 text-xs text-neutral-400 hover:text-neutral-900 transition-colors",children:[se.jsx(NE,{size:14}),se.jsx("span",{children:i("返回")})]})]}),se.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[se.jsx("nav",{className:"w-48 border-r border-neutral-100 pt-3 px-2 shrink-0",children:IE.map(r=>se.jsxs(lg,{to:r.to,className:({isActive:s})=>`flex items-center gap-2 px-3 py-1.5 rounded-md text-[13px] transition-colors ${s?"bg-neutral-100 text-neutral-900 font-medium":"text-neutral-500 hover:text-neutral-900 hover:bg-neutral-50"}`,children:[se.jsx(r.icon,{size:14}),se.jsx("span",{children:i(r.label)})]},r.to))}),se.jsx("div",{className:"flex-1 overflow-y-auto",children:se.jsx(eg,{})})]})]})}const tT=R.lazy(()=>ai(()=>import("./ProjectKanbanPage-DSO5OEi0.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(a=>({default:a.ProjectKanbanPage}))),nT=R.lazy(()=>ai(()=>import("./DemoPage-a61F8WUp.js"),__vite__mapDeps([15,9,5])).then(a=>({default:a.DemoPage}))),aT=R.lazy(()=>ai(()=>import("./AgentDemoPage-B4p6JOaa.js"),__vite__mapDeps([16,1,2,3,4,5,6,9,17])).then(a=>({default:a.AgentDemoPage}))),iT=R.lazy(()=>ai(()=>import("./GeneralSettingsPage-CQmEjFi8.js"),__vite__mapDeps([18,13,5,4,12])).then(a=>({default:a.GeneralSettingsPage}))),lT=R.lazy(()=>ai(()=>import("./ProfileSettingsPage-D-zyXwz1.js"),__vite__mapDeps([19,17,9,5,7,20])).then(a=>({default:a.ProfileSettingsPage}))),rT=R.lazy(()=>ai(()=>import("./ProviderSettingsPage-dGoaMV8Q.js"),__vite__mapDeps([21,12,9,5,8,7,13,4,2,20,22])).then(a=>({default:a.ProviderSettingsPage}))),sT=R.lazy(()=>ai(()=>import("./NotificationSettingsPage-BRw2fFTj.js"),__vite__mapDeps([23,9,5,13,4,11,22,24])).then(a=>({default:a.NotificationSettingsPage}))),oT=R.lazy(()=>ai(()=>import("./ProjectSettingsPage-CKb-5dhB.js"),__vite__mapDeps([25,9,5,13,4,10,7,26,3,11,24])).then(a=>({default:a.ProjectSettingsPage})));function Pa(){const{t:a}=cg();return se.jsx("div",{className:"p-8",children:a("Loading...")})}const uT=hE([{path:"/",element:se.jsx(RE,{}),children:[{index:!0,element:se.jsx(R.Suspense,{fallback:se.jsx(Pa,{}),children:se.jsx(tT,{})})},{path:"demo",element:se.jsx(R.Suspense,{fallback:se.jsx(Pa,{}),children:se.jsx(nT,{})})},{path:"agent-demo",element:se.jsx(R.Suspense,{fallback:se.jsx(Pa,{}),children:se.jsx(aT,{})})},{path:"settings",element:se.jsx(eT,{}),children:[{index:!0,element:se.jsx(Y1,{to:"general",replace:!0})},{path:"general",element:se.jsx(R.Suspense,{fallback:se.jsx(Pa,{}),children:se.jsx(iT,{})})},{path:"agents",element:se.jsx(R.Suspense,{fallback:se.jsx(Pa,{}),children:se.jsx(rT,{})})},{path:"agents-legacy",element:se.jsx(R.Suspense,{fallback:se.jsx(Pa,{}),children:se.jsx(lT,{})})},{path:"notifications",element:se.jsx(R.Suspense,{fallback:se.jsx(Pa,{}),children:se.jsx(sT,{})})},{path:"projects",element:se.jsx(R.Suspense,{fallback:se.jsx(Pa,{}),children:se.jsx(oT,{})})}]}]}]);function cT(){return se.jsx(_E,{router:uT})}const ea=Object.create(null);ea.open="0";ea.close="1";ea.ping="2";ea.pong="3";ea.message="4";ea.upgrade="5";ea.noop="6";const to=Object.create(null);Object.keys(ea).forEach(a=>{to[ea[a]]=a});const $c={type:"error",data:"parser error"},fg=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",dg=typeof ArrayBuffer=="function",hg=a=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(a):a&&a.buffer instanceof ArrayBuffer,Tf=({type:a,data:i},r,s)=>fg&&i instanceof Blob?r?s(i):uy(i,s):dg&&(i instanceof ArrayBuffer||hg(i))?r?s(i):uy(new Blob([i]),s):s(ea[a]+(i||"")),uy=(a,i)=>{const r=new FileReader;return r.onload=function(){const s=r.result.split(",")[1];i("b"+(s||""))},r.readAsDataURL(a)};function cy(a){return a instanceof Uint8Array?a:a instanceof ArrayBuffer?new Uint8Array(a):new Uint8Array(a.buffer,a.byteOffset,a.byteLength)}let Lc;function fT(a,i){if(fg&&a.data instanceof Blob)return a.data.arrayBuffer().then(cy).then(i);if(dg&&(a.data instanceof ArrayBuffer||hg(a.data)))return i(cy(a.data));Tf(a,!1,r=>{Lc||(Lc=new TextEncoder),i(Lc.encode(r))})}const fy="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",br=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let a=0;a<fy.length;a++)br[fy.charCodeAt(a)]=a;const dT=a=>{let i=a.length*.75,r=a.length,s,c=0,f,h,m,g;a[a.length-1]==="="&&(i--,a[a.length-2]==="="&&i--);const y=new ArrayBuffer(i),b=new Uint8Array(y);for(s=0;s<r;s+=4)f=br[a.charCodeAt(s)],h=br[a.charCodeAt(s+1)],m=br[a.charCodeAt(s+2)],g=br[a.charCodeAt(s+3)],b[c++]=f<<2|h>>4,b[c++]=(h&15)<<4|m>>2,b[c++]=(m&3)<<6|g&63;return y},hT=typeof ArrayBuffer=="function",wf=(a,i)=>{if(typeof a!="string")return{type:"message",data:mg(a,i)};const r=a.charAt(0);return r==="b"?{type:"message",data:mT(a.substring(1),i)}:to[r]?a.length>1?{type:to[r],data:a.substring(1)}:{type:to[r]}:$c},mT=(a,i)=>{if(hT){const r=dT(a);return mg(r,i)}else return{base64:!0,data:a}},mg=(a,i)=>i==="blob"?a instanceof Blob?a:new Blob([a]):a instanceof ArrayBuffer?a:a.buffer,pg="",pT=(a,i)=>{const r=a.length,s=new Array(r);let c=0;a.forEach((f,h)=>{Tf(f,!1,m=>{s[h]=m,++c===r&&i(s.join(pg))})})},yT=(a,i)=>{const r=a.split(pg),s=[];for(let c=0;c<r.length;c++){const f=wf(r[c],i);if(s.push(f),f.type==="error")break}return s};function gT(){return new TransformStream({transform(a,i){fT(a,r=>{const s=r.length;let c;if(s<126)c=new Uint8Array(1),new DataView(c.buffer).setUint8(0,s);else if(s<65536){c=new Uint8Array(3);const f=new DataView(c.buffer);f.setUint8(0,126),f.setUint16(1,s)}else{c=new Uint8Array(9);const f=new DataView(c.buffer);f.setUint8(0,127),f.setBigUint64(1,BigInt(s))}a.data&&typeof a.data!="string"&&(c[0]|=128),i.enqueue(c),i.enqueue(r)})}})}let Bc;function Zs(a){return a.reduce((i,r)=>i+r.length,0)}function Fs(a,i){if(a[0].length===i)return a.shift();const r=new Uint8Array(i);let s=0;for(let c=0;c<i;c++)r[c]=a[0][s++],s===a[0].length&&(a.shift(),s=0);return a.length&&s<a[0].length&&(a[0]=a[0].slice(s)),r}function vT(a,i){Bc||(Bc=new TextDecoder);const r=[];let s=0,c=-1,f=!1;return new TransformStream({transform(h,m){for(r.push(h);;){if(s===0){if(Zs(r)<1)break;const g=Fs(r,1);f=(g[0]&128)===128,c=g[0]&127,c<126?s=3:c===126?s=1:s=2}else if(s===1){if(Zs(r)<2)break;const g=Fs(r,2);c=new DataView(g.buffer,g.byteOffset,g.length).getUint16(0),s=3}else if(s===2){if(Zs(r)<8)break;const g=Fs(r,8),y=new DataView(g.buffer,g.byteOffset,g.length),b=y.getUint32(0);if(b>Math.pow(2,21)-1){m.enqueue($c);break}c=b*Math.pow(2,32)+y.getUint32(4),s=3}else{if(Zs(r)<c)break;const g=Fs(r,c);m.enqueue(wf(f?g:Bc.decode(g),i)),s=0}if(c===0||c>a){m.enqueue($c);break}}}})}const yg=4;function Rt(a){if(a)return bT(a)}function bT(a){for(var i in Rt.prototype)a[i]=Rt.prototype[i];return a}Rt.prototype.on=Rt.prototype.addEventListener=function(a,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+a]=this._callbacks["$"+a]||[]).push(i),this};Rt.prototype.once=function(a,i){function r(){this.off(a,r),i.apply(this,arguments)}return r.fn=i,this.on(a,r),this};Rt.prototype.off=Rt.prototype.removeListener=Rt.prototype.removeAllListeners=Rt.prototype.removeEventListener=function(a,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+a];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+a],this;for(var s,c=0;c<r.length;c++)if(s=r[c],s===i||s.fn===i){r.splice(c,1);break}return r.length===0&&delete this._callbacks["$"+a],this};Rt.prototype.emit=function(a){this._callbacks=this._callbacks||{};for(var i=new Array(arguments.length-1),r=this._callbacks["$"+a],s=1;s<arguments.length;s++)i[s-1]=arguments[s];if(r){r=r.slice(0);for(var s=0,c=r.length;s<c;++s)r[s].apply(this,i)}return this};Rt.prototype.emitReserved=Rt.prototype.emit;Rt.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks["$"+a]||[]};Rt.prototype.hasListeners=function(a){return!!this.listeners(a).length};const po=typeof Promise=="function"&&typeof Promise.resolve=="function"?i=>Promise.resolve().then(i):(i,r)=>r(i,0),Mn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),ST="arraybuffer";function gg(a,...i){return i.reduce((r,s)=>(a.hasOwnProperty(s)&&(r[s]=a[s]),r),{})}const ET=Mn.setTimeout,TT=Mn.clearTimeout;function yo(a,i){i.useNativeTimers?(a.setTimeoutFn=ET.bind(Mn),a.clearTimeoutFn=TT.bind(Mn)):(a.setTimeoutFn=Mn.setTimeout.bind(Mn),a.clearTimeoutFn=Mn.clearTimeout.bind(Mn))}const wT=1.33;function _T(a){return typeof a=="string"?RT(a):Math.ceil((a.byteLength||a.size)*wT)}function RT(a){let i=0,r=0;for(let s=0,c=a.length;s<c;s++)i=a.charCodeAt(s),i<128?r+=1:i<2048?r+=2:i<55296||i>=57344?r+=3:(s++,r+=4);return r}function vg(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function AT(a){let i="";for(let r in a)a.hasOwnProperty(r)&&(i.length&&(i+="&"),i+=encodeURIComponent(r)+"="+encodeURIComponent(a[r]));return i}function CT(a){let i={},r=a.split("&");for(let s=0,c=r.length;s<c;s++){let f=r[s].split("=");i[decodeURIComponent(f[0])]=decodeURIComponent(f[1])}return i}class OT extends Error{constructor(i,r,s){super(i),this.description=r,this.context=s,this.type="TransportError"}}class _f extends Rt{constructor(i){super(),this.writable=!1,yo(this,i),this.opts=i,this.query=i.query,this.socket=i.socket,this.supportsBinary=!i.forceBase64}onError(i,r,s){return super.emitReserved("error",new OT(i,r,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(i){this.readyState==="open"&&this.write(i)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(i){const r=wf(i,this.socket.binaryType);this.onPacket(r)}onPacket(i){super.emitReserved("packet",i)}onClose(i){this.readyState="closed",super.emitReserved("close",i)}pause(i){}createUri(i,r={}){return i+"://"+this._hostname()+this._port()+this.opts.path+this._query(r)}_hostname(){const i=this.opts.hostname;return i.indexOf(":")===-1?i:"["+i+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(i){const r=AT(i);return r.length?"?"+r:""}}class xT extends _f{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(i){this.readyState="pausing";const r=()=>{this.readyState="paused",i()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||r()})),this.writable||(s++,this.once("drain",function(){--s||r()}))}else r()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(i){const r=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};yT(i,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const i=()=>{this.write([{type:"close"}])};this.readyState==="open"?i():this.once("open",i)}write(i){this.writable=!1,pT(i,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const i=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=vg()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(i,r)}}let bg=!1;try{bg=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const DT=bg;function MT(){}class NT extends xT{constructor(i){if(super(i),typeof location<"u"){const r=location.protocol==="https:";let s=location.port;s||(s=r?"443":"80"),this.xd=typeof location<"u"&&i.hostname!==location.hostname||s!==i.port}}doWrite(i,r){const s=this.request({method:"POST",data:i});s.on("success",r),s.on("error",(c,f)=>{this.onError("xhr post error",c,f)})}doPoll(){const i=this.request();i.on("data",this.onData.bind(this)),i.on("error",(r,s)=>{this.onError("xhr poll error",r,s)}),this.pollXhr=i}}let bl=class no extends Rt{constructor(i,r,s){super(),this.createRequest=i,yo(this,s),this._opts=s,this._method=s.method||"GET",this._uri=r,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var i;const r=gg(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(r);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let c in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(c)&&s.setRequestHeader(c,this._opts.extraHeaders[c])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(i=this._opts.cookieJar)===null||i===void 0||i.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var c;s.readyState===3&&((c=this._opts.cookieJar)===null||c===void 0||c.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(c){this.setTimeoutFn(()=>{this._onError(c)},0);return}typeof document<"u"&&(this._index=no.requestsCount++,no.requests[this._index]=this)}_onError(i){this.emitReserved("error",i,this._xhr),this._cleanup(!0)}_cleanup(i){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=MT,i)try{this._xhr.abort()}catch{}typeof document<"u"&&delete no.requests[this._index],this._xhr=null}}_onLoad(){const i=this._xhr.responseText;i!==null&&(this.emitReserved("data",i),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};bl.requestsCount=0;bl.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",dy);else if(typeof addEventListener=="function"){const a="onpagehide"in Mn?"pagehide":"unload";addEventListener(a,dy,!1)}}function dy(){for(let a in bl.requests)bl.requests.hasOwnProperty(a)&&bl.requests[a].abort()}const zT=(function(){const a=Sg({xdomain:!1});return a&&a.responseType!==null})();class UT extends NT{constructor(i){super(i);const r=i&&i.forceBase64;this.supportsBinary=zT&&!r}request(i={}){return Object.assign(i,{xd:this.xd},this.opts),new bl(Sg,this.uri(),i)}}function Sg(a){const i=a.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!i||DT))return new XMLHttpRequest}catch{}if(!i)try{return new Mn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Eg=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class LT extends _f{get name(){return"websocket"}doOpen(){const i=this.uri(),r=this.opts.protocols,s=Eg?{}:gg(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(i,r,s)}catch(c){return this.emitReserved("error",c)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=i=>this.onClose({description:"websocket connection closed",context:i}),this.ws.onmessage=i=>this.onData(i.data),this.ws.onerror=i=>this.onError("websocket error",i)}write(i){this.writable=!1;for(let r=0;r<i.length;r++){const s=i[r],c=r===i.length-1;Tf(s,this.supportsBinary,f=>{try{this.doWrite(s,f)}catch{}c&&po(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const i=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=vg()),this.supportsBinary||(r.b64=1),this.createUri(i,r)}}const jc=Mn.WebSocket||Mn.MozWebSocket;class BT extends LT{createSocket(i,r,s){return Eg?new jc(i,r,s):r?new jc(i,r):new jc(i)}doWrite(i,r){this.ws.send(r)}}class jT extends _f{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(i){return this.emitReserved("error",i)}this._transport.closed.then(()=>{this.onClose()}).catch(i=>{this.onError("webtransport error",i)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(i=>{const r=vT(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=i.readable.pipeThrough(r).getReader(),c=gT();c.readable.pipeTo(i.writable),this._writer=c.writable.getWriter();const f=()=>{s.read().then(({done:m,value:g})=>{m||(this.onPacket(g),f())}).catch(m=>{})};f();const h={type:"open"};this.query.sid&&(h.data=`{"sid":"${this.query.sid}"}`),this._writer.write(h).then(()=>this.onOpen())})})}write(i){this.writable=!1;for(let r=0;r<i.length;r++){const s=i[r],c=r===i.length-1;this._writer.write(s).then(()=>{c&&po(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var i;(i=this._transport)===null||i===void 0||i.close()}}const HT={websocket:BT,webtransport:jT,polling:UT},qT=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,kT=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ic(a){if(a.length>8e3)throw"URI too long";const i=a,r=a.indexOf("["),s=a.indexOf("]");r!=-1&&s!=-1&&(a=a.substring(0,r)+a.substring(r,s).replace(/:/g,";")+a.substring(s,a.length));let c=qT.exec(a||""),f={},h=14;for(;h--;)f[kT[h]]=c[h]||"";return r!=-1&&s!=-1&&(f.source=i,f.host=f.host.substring(1,f.host.length-1).replace(/;/g,":"),f.authority=f.authority.replace("[","").replace("]","").replace(/;/g,":"),f.ipv6uri=!0),f.pathNames=QT(f,f.path),f.queryKey=YT(f,f.query),f}function QT(a,i){const r=/\/{2,9}/g,s=i.replace(r,"/").split("/");return(i.slice(0,1)=="/"||i.length===0)&&s.splice(0,1),i.slice(-1)=="/"&&s.splice(s.length-1,1),s}function YT(a,i){const r={};return i.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,c,f){c&&(r[c]=f)}),r}const Wc=typeof addEventListener=="function"&&typeof removeEventListener=="function",ao=[];Wc&&addEventListener("offline",()=>{ao.forEach(a=>a())},!1);class ti extends Rt{constructor(i,r){if(super(),this.binaryType=ST,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,i&&typeof i=="object"&&(r=i,i=null),i){const s=Ic(i);r.hostname=s.host,r.secure=s.protocol==="https"||s.protocol==="wss",r.port=s.port,s.query&&(r.query=s.query)}else r.host&&(r.hostname=Ic(r.host).host);yo(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},r.transports.forEach(s=>{const c=s.prototype.name;this.transports.push(c),this._transportsByName[c]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=CT(this.opts.query)),Wc&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ao.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(i){const r=Object.assign({},this.opts.query);r.EIO=yg,r.transport=i,this.id&&(r.sid=this.id);const s=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[i]);return new this._transportsByName[i](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const i=this.opts.rememberUpgrade&&ti.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const r=this.createTransport(i);r.open(),this.setTransport(r)}setTransport(i){this.transport&&this.transport.removeAllListeners(),this.transport=i,i.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",r=>this._onClose("transport close",r))}onOpen(){this.readyState="open",ti.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",i),this.emitReserved("heartbeat"),i.type){case"open":this.onHandshake(JSON.parse(i.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const r=new Error("server error");r.code=i.data,this._onError(r);break;case"message":this.emitReserved("data",i.data),this.emitReserved("message",i.data);break}}onHandshake(i){this.emitReserved("handshake",i),this.id=i.sid,this.transport.query.sid=i.sid,this._pingInterval=i.pingInterval,this._pingTimeout=i.pingTimeout,this._maxPayload=i.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const i=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+i,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},i),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const i=this._getWritablePackets();this.transport.send(i),this._prevBufferLen=i.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let s=0;s<this.writeBuffer.length;s++){const c=this.writeBuffer[s].data;if(c&&(r+=_T(c)),s>0&&r>this._maxPayload)return this.writeBuffer.slice(0,s);r+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const i=Date.now()>this._pingTimeoutTime;return i&&(this._pingTimeoutTime=0,po(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),i}write(i,r,s){return this._sendPacket("message",i,r,s),this}send(i,r,s){return this._sendPacket("message",i,r,s),this}_sendPacket(i,r,s,c){if(typeof r=="function"&&(c=r,r=void 0),typeof s=="function"&&(c=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const f={type:i,data:r,options:s};this.emitReserved("packetCreate",f),this.writeBuffer.push(f),c&&this.once("flush",c),this.flush()}close(){const i=()=>{this._onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),i()},s=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():i()}):this.upgrading?s():i()),this}_onError(i){if(ti.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",i),this._onClose("transport error",i)}_onClose(i,r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Wc&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=ao.indexOf(this._offlineEventListener);s!==-1&&ao.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",i,r),this.writeBuffer=[],this._prevBufferLen=0}}}ti.protocol=yg;class VT extends ti{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let i=0;i<this._upgrades.length;i++)this._probe(this._upgrades[i])}_probe(i){let r=this.createTransport(i),s=!1;ti.priorWebsocketSuccess=!1;const c=()=>{s||(r.send([{type:"ping",data:"probe"}]),r.once("packet",p=>{if(!s)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;ti.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(b(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const w=new Error("probe error");w.transport=r.name,this.emitReserved("upgradeError",w)}}))};function f(){s||(s=!0,b(),r.close(),r=null)}const h=p=>{const w=new Error("probe error: "+p);w.transport=r.name,f(),this.emitReserved("upgradeError",w)};function m(){h("transport closed")}function g(){h("socket closed")}function y(p){r&&p.name!==r.name&&f()}const b=()=>{r.removeListener("open",c),r.removeListener("error",h),r.removeListener("close",m),this.off("close",g),this.off("upgrading",y)};r.once("open",c),r.once("error",h),r.once("close",m),this.once("close",g),this.once("upgrading",y),this._upgrades.indexOf("webtransport")!==-1&&i!=="webtransport"?this.setTimeoutFn(()=>{s||r.open()},200):r.open()}onHandshake(i){this._upgrades=this._filterUpgrades(i.upgrades),super.onHandshake(i)}_filterUpgrades(i){const r=[];for(let s=0;s<i.length;s++)~this.transports.indexOf(i[s])&&r.push(i[s]);return r}}let GT=class extends VT{constructor(i,r={}){const s=typeof i=="object"?i:r;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(c=>HT[c]).filter(c=>!!c)),super(i,s)}};function KT(a,i="",r){let s=a;r=r||typeof location<"u"&&location,a==null&&(a=r.protocol+"//"+r.host),typeof a=="string"&&(a.charAt(0)==="/"&&(a.charAt(1)==="/"?a=r.protocol+a:a=r.host+a),/^(https?|wss?):\/\//.test(a)||(typeof r<"u"?a=r.protocol+"//"+a:a="https://"+a),s=Ic(a)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const f=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+f+":"+s.port+i,s.href=s.protocol+"://"+f+(r&&r.port===s.port?"":":"+s.port),s}const XT=typeof ArrayBuffer=="function",ZT=a=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(a):a.buffer instanceof ArrayBuffer,Tg=Object.prototype.toString,FT=typeof Blob=="function"||typeof Blob<"u"&&Tg.call(Blob)==="[object BlobConstructor]",JT=typeof File=="function"||typeof File<"u"&&Tg.call(File)==="[object FileConstructor]";function Rf(a){return XT&&(a instanceof ArrayBuffer||ZT(a))||FT&&a instanceof Blob||JT&&a instanceof File}function io(a,i){if(!a||typeof a!="object")return!1;if(Array.isArray(a)){for(let r=0,s=a.length;r<s;r++)if(io(a[r]))return!0;return!1}if(Rf(a))return!0;if(a.toJSON&&typeof a.toJSON=="function"&&arguments.length===1)return io(a.toJSON(),!0);for(const r in a)if(Object.prototype.hasOwnProperty.call(a,r)&&io(a[r]))return!0;return!1}function PT(a){const i=[],r=a.data,s=a;return s.data=ef(r,i),s.attachments=i.length,{packet:s,buffers:i}}function ef(a,i){if(!a)return a;if(Rf(a)){const r={_placeholder:!0,num:i.length};return i.push(a),r}else if(Array.isArray(a)){const r=new Array(a.length);for(let s=0;s<a.length;s++)r[s]=ef(a[s],i);return r}else if(typeof a=="object"&&!(a instanceof Date)){const r={};for(const s in a)Object.prototype.hasOwnProperty.call(a,s)&&(r[s]=ef(a[s],i));return r}return a}function $T(a,i){return a.data=tf(a.data,i),delete a.attachments,a}function tf(a,i){if(!a)return a;if(a&&a._placeholder===!0){if(typeof a.num=="number"&&a.num>=0&&a.num<i.length)return i[a.num];throw new Error("illegal attachments")}else if(Array.isArray(a))for(let r=0;r<a.length;r++)a[r]=tf(a[r],i);else if(typeof a=="object")for(const r in a)Object.prototype.hasOwnProperty.call(a,r)&&(a[r]=tf(a[r],i));return a}const IT=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Qe;(function(a){a[a.CONNECT=0]="CONNECT",a[a.DISCONNECT=1]="DISCONNECT",a[a.EVENT=2]="EVENT",a[a.ACK=3]="ACK",a[a.CONNECT_ERROR=4]="CONNECT_ERROR",a[a.BINARY_EVENT=5]="BINARY_EVENT",a[a.BINARY_ACK=6]="BINARY_ACK"})(Qe||(Qe={}));class WT{constructor(i){this.replacer=i}encode(i){return(i.type===Qe.EVENT||i.type===Qe.ACK)&&io(i)?this.encodeAsBinary({type:i.type===Qe.EVENT?Qe.BINARY_EVENT:Qe.BINARY_ACK,nsp:i.nsp,data:i.data,id:i.id}):[this.encodeAsString(i)]}encodeAsString(i){let r=""+i.type;return(i.type===Qe.BINARY_EVENT||i.type===Qe.BINARY_ACK)&&(r+=i.attachments+"-"),i.nsp&&i.nsp!=="/"&&(r+=i.nsp+","),i.id!=null&&(r+=i.id),i.data!=null&&(r+=JSON.stringify(i.data,this.replacer)),r}encodeAsBinary(i){const r=PT(i),s=this.encodeAsString(r.packet),c=r.buffers;return c.unshift(s),c}}class Af extends Rt{constructor(i){super(),this.reviver=i}add(i){let r;if(typeof i=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");r=this.decodeString(i);const s=r.type===Qe.BINARY_EVENT;s||r.type===Qe.BINARY_ACK?(r.type=s?Qe.EVENT:Qe.ACK,this.reconstructor=new e2(r),r.attachments===0&&super.emitReserved("decoded",r)):super.emitReserved("decoded",r)}else if(Rf(i)||i.base64)if(this.reconstructor)r=this.reconstructor.takeBinaryData(i),r&&(this.reconstructor=null,super.emitReserved("decoded",r));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+i)}decodeString(i){let r=0;const s={type:Number(i.charAt(0))};if(Qe[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===Qe.BINARY_EVENT||s.type===Qe.BINARY_ACK){const f=r+1;for(;i.charAt(++r)!=="-"&&r!=i.length;);const h=i.substring(f,r);if(h!=Number(h)||i.charAt(r)!=="-")throw new Error("Illegal attachments");s.attachments=Number(h)}if(i.charAt(r+1)==="/"){const f=r+1;for(;++r&&!(i.charAt(r)===","||r===i.length););s.nsp=i.substring(f,r)}else s.nsp="/";const c=i.charAt(r+1);if(c!==""&&Number(c)==c){const f=r+1;for(;++r;){const h=i.charAt(r);if(h==null||Number(h)!=h){--r;break}if(r===i.length)break}s.id=Number(i.substring(f,r+1))}if(i.charAt(++r)){const f=this.tryParse(i.substr(r));if(Af.isPayloadValid(s.type,f))s.data=f;else throw new Error("invalid payload")}return s}tryParse(i){try{return JSON.parse(i,this.reviver)}catch{return!1}}static isPayloadValid(i,r){switch(i){case Qe.CONNECT:return hy(r);case Qe.DISCONNECT:return r===void 0;case Qe.CONNECT_ERROR:return typeof r=="string"||hy(r);case Qe.EVENT:case Qe.BINARY_EVENT:return Array.isArray(r)&&(typeof r[0]=="number"||typeof r[0]=="string"&&IT.indexOf(r[0])===-1);case Qe.ACK:case Qe.BINARY_ACK:return Array.isArray(r)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class e2{constructor(i){this.packet=i,this.buffers=[],this.reconPack=i}takeBinaryData(i){if(this.buffers.push(i),this.buffers.length===this.reconPack.attachments){const r=$T(this.reconPack,this.buffers);return this.finishedReconstruction(),r}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function hy(a){return Object.prototype.toString.call(a)==="[object Object]"}const t2=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Af,Encoder:WT,get PacketType(){return Qe}},Symbol.toStringTag,{value:"Module"}));function Vn(a,i,r){return a.on(i,r),function(){a.off(i,r)}}const n2=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class wg extends Rt{constructor(i,r,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=i,this.nsp=r,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const i=this.io;this.subs=[Vn(i,"open",this.onopen.bind(this)),Vn(i,"packet",this.onpacket.bind(this)),Vn(i,"error",this.onerror.bind(this)),Vn(i,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...i){return i.unshift("message"),this.emit.apply(this,i),this}emit(i,...r){var s,c,f;if(n2.hasOwnProperty(i))throw new Error('"'+i.toString()+'" is a reserved event name');if(r.unshift(i),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(r),this;const h={type:Qe.EVENT,data:r};if(h.options={},h.options.compress=this.flags.compress!==!1,typeof r[r.length-1]=="function"){const b=this.ids++,p=r.pop();this._registerAckCallback(b,p),h.id=b}const m=(c=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||c===void 0?void 0:c.writable,g=this.connected&&!(!((f=this.io.engine)===null||f===void 0)&&f._hasPingExpired());return this.flags.volatile&&!m||(g?(this.notifyOutgoingListeners(h),this.packet(h)):this.sendBuffer.push(h)),this.flags={},this}_registerAckCallback(i,r){var s;const c=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(c===void 0){this.acks[i]=r;return}const f=this.io.setTimeoutFn(()=>{delete this.acks[i];for(let m=0;m<this.sendBuffer.length;m++)this.sendBuffer[m].id===i&&this.sendBuffer.splice(m,1);r.call(this,new Error("operation has timed out"))},c),h=(...m)=>{this.io.clearTimeoutFn(f),r.apply(this,m)};h.withError=!0,this.acks[i]=h}emitWithAck(i,...r){return new Promise((s,c)=>{const f=(h,m)=>h?c(h):s(m);f.withError=!0,r.push(f),this.emit(i,...r)})}_addToQueue(i){let r;typeof i[i.length-1]=="function"&&(r=i.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:i,flags:Object.assign({fromQueue:!0},this.flags)};i.push((c,...f)=>(this._queue[0],c!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(c)):(this._queue.shift(),r&&r(null,...f)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(i=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!i||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(i){i.nsp=this.nsp,this.io._packet(i)}onopen(){typeof this.auth=="function"?this.auth(i=>{this._sendConnectPacket(i)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(i){this.packet({type:Qe.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},i):i})}onerror(i){this.connected||this.emitReserved("connect_error",i)}onclose(i,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",i,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(i=>{if(!this.sendBuffer.some(s=>String(s.id)===i)){const s=this.acks[i];delete this.acks[i],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(i){if(i.nsp===this.nsp)switch(i.type){case Qe.CONNECT:i.data&&i.data.sid?this.onconnect(i.data.sid,i.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Qe.EVENT:case Qe.BINARY_EVENT:this.onevent(i);break;case Qe.ACK:case Qe.BINARY_ACK:this.onack(i);break;case Qe.DISCONNECT:this.ondisconnect();break;case Qe.CONNECT_ERROR:this.destroy();const s=new Error(i.data.message);s.data=i.data.data,this.emitReserved("connect_error",s);break}}onevent(i){const r=i.data||[];i.id!=null&&r.push(this.ack(i.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(i){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const s of r)s.apply(this,i)}super.emit.apply(this,i),this._pid&&i.length&&typeof i[i.length-1]=="string"&&(this._lastOffset=i[i.length-1])}ack(i){const r=this;let s=!1;return function(...c){s||(s=!0,r.packet({type:Qe.ACK,id:i,data:c}))}}onack(i){const r=this.acks[i.id];typeof r=="function"&&(delete this.acks[i.id],r.withError&&i.data.unshift(null),r.apply(this,i.data))}onconnect(i,r){this.id=i,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(i=>this.emitEvent(i)),this.receiveBuffer=[],this.sendBuffer.forEach(i=>{this.notifyOutgoingListeners(i),this.packet(i)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(i=>i()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Qe.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(i){return this.flags.compress=i,this}get volatile(){return this.flags.volatile=!0,this}timeout(i){return this.flags.timeout=i,this}onAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(i),this}prependAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(i),this}offAny(i){if(!this._anyListeners)return this;if(i){const r=this._anyListeners;for(let s=0;s<r.length;s++)if(i===r[s])return r.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(i),this}prependAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(i),this}offAnyOutgoing(i){if(!this._anyOutgoingListeners)return this;if(i){const r=this._anyOutgoingListeners;for(let s=0;s<r.length;s++)if(i===r[s])return r.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(i){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const r=this._anyOutgoingListeners.slice();for(const s of r)s.apply(this,i.data)}}}function Tl(a){a=a||{},this.ms=a.min||100,this.max=a.max||1e4,this.factor=a.factor||2,this.jitter=a.jitter>0&&a.jitter<=1?a.jitter:0,this.attempts=0}Tl.prototype.duration=function(){var a=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),r=Math.floor(i*this.jitter*a);a=(Math.floor(i*10)&1)==0?a-r:a+r}return Math.min(a,this.max)|0};Tl.prototype.reset=function(){this.attempts=0};Tl.prototype.setMin=function(a){this.ms=a};Tl.prototype.setMax=function(a){this.max=a};Tl.prototype.setJitter=function(a){this.jitter=a};class nf extends Rt{constructor(i,r){var s;super(),this.nsps={},this.subs=[],i&&typeof i=="object"&&(r=i,i=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,yo(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((s=r.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new Tl({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=i;const c=r.parser||t2;this.encoder=new c.Encoder,this.decoder=new c.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(i){return arguments.length?(this._reconnection=!!i,i||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(i){return i===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=i,this)}reconnectionDelay(i){var r;return i===void 0?this._reconnectionDelay:(this._reconnectionDelay=i,(r=this.backoff)===null||r===void 0||r.setMin(i),this)}randomizationFactor(i){var r;return i===void 0?this._randomizationFactor:(this._randomizationFactor=i,(r=this.backoff)===null||r===void 0||r.setJitter(i),this)}reconnectionDelayMax(i){var r;return i===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=i,(r=this.backoff)===null||r===void 0||r.setMax(i),this)}timeout(i){return arguments.length?(this._timeout=i,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(i){if(~this._readyState.indexOf("open"))return this;this.engine=new GT(this.uri,this.opts);const r=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const c=Vn(r,"open",function(){s.onopen(),i&&i()}),f=m=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",m),i?i(m):this.maybeReconnectOnOpen()},h=Vn(r,"error",f);if(this._timeout!==!1){const m=this._timeout,g=this.setTimeoutFn(()=>{c(),f(new Error("timeout")),r.close()},m);this.opts.autoUnref&&g.unref(),this.subs.push(()=>{this.clearTimeoutFn(g)})}return this.subs.push(c),this.subs.push(h),this}connect(i){return this.open(i)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const i=this.engine;this.subs.push(Vn(i,"ping",this.onping.bind(this)),Vn(i,"data",this.ondata.bind(this)),Vn(i,"error",this.onerror.bind(this)),Vn(i,"close",this.onclose.bind(this)),Vn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(i){try{this.decoder.add(i)}catch(r){this.onclose("parse error",r)}}ondecoded(i){po(()=>{this.emitReserved("packet",i)},this.setTimeoutFn)}onerror(i){this.emitReserved("error",i)}socket(i,r){let s=this.nsps[i];return s?this._autoConnect&&!s.active&&s.connect():(s=new wg(this,i,r),this.nsps[i]=s),s}_destroy(i){const r=Object.keys(this.nsps);for(const s of r)if(this.nsps[s].active)return;this._close()}_packet(i){const r=this.encoder.encode(i);for(let s=0;s<r.length;s++)this.engine.write(r[s],i.options)}cleanup(){this.subs.forEach(i=>i()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(i,r){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",i,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const i=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{i.skipReconnect||(this.emitReserved("reconnect_attempt",i.backoff.attempts),!i.skipReconnect&&i.open(c=>{c?(i._reconnecting=!1,i.reconnect(),this.emitReserved("reconnect_error",c)):i.onreconnect()}))},r);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const i=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",i)}}const yr={};function lo(a,i){typeof a=="object"&&(i=a,a=void 0),i=i||{};const r=KT(a,i.path||"/socket.io"),s=r.source,c=r.id,f=r.path,h=yr[c]&&f in yr[c].nsps,m=i.forceNew||i["force new connection"]||i.multiplex===!1||h;let g;return m?g=new nf(s,i):(yr[c]||(yr[c]=new nf(s,i)),g=yr[c]),r.query&&!i.query&&(i.query=r.queryKey),g.socket(r.path,i)}Object.assign(lo,{Manager:nf,Socket:wg,io:lo,connect:lo});const Js="/events",Ps={SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe",INPUT:"input",RESIZE:"resize",TERMINAL_INPUT:"terminal:input",TERMINAL_RESIZE:"terminal:resize"},$s={SESSION_SUBSCRIBED:"session:subscribed",SESSION_UNSUBSCRIBED:"session:unsubscribed",SESSION_STDOUT:"session:stdout",SESSION_PATCH:"session:patch",SESSION_EXIT:"session:exit",SESSION_COMPLETED:"session:completed",SESSION_ID:"session:sessionId",SESSION_ERROR:"session:error",TASK_UPDATED:"task:updated",TASK_DELETED:"task:deleted",TERMINAL_STDOUT:"terminal:stdout",TERMINAL_EXIT:"terminal:exit",TERMINAL_SUBSCRIBED:"terminal:subscribed",TERMINAL_UNSUBSCRIBED:"terminal:unsubscribed",WORKSPACE_SETUP_PROGRESS:"workspace:setup_progress",WORKSPACE_COMMIT_MESSAGE_UPDATED:"workspace:commit_message_updated"};class a2{socket=null;baseUrl;visibilityHandler=null;constructor(){this.baseUrl=""}getSocket(){return this.socket||(this.socket=lo(`${this.baseUrl}${Js}`,{autoConnect:!1,transports:["websocket"],reconnection:!0,reconnectionAttempts:1/0,reconnectionDelay:1e3,reconnectionDelayMax:1e4}),this.socket.on("connect",()=>{console.log(`[Socket] Connected to ${Js} t=${Date.now()}`)}),this.socket.on("disconnect",i=>{console.log(`[Socket] Disconnected from ${Js}: t=${Date.now()}`,i)}),this.socket.on("connect_error",i=>{console.error(`[Socket] Connection error on ${Js}: t=${Date.now()}`,i.message)})),this.socket}connect(){const i=this.getSocket();return i.connected||i.connect(),this.visibilityHandler||(this.visibilityHandler=()=>{document.visibilityState==="visible"&&this.socket&&!this.socket.connected&&(console.log("[Socket] Page became visible, socket disconnected — reconnecting"),this.socket.connect())},document.addEventListener("visibilitychange",this.visibilityHandler)),i}disconnect(){this.visibilityHandler&&(document.removeEventListener("visibilitychange",this.visibilityHandler),this.visibilityHandler=null),this.socket&&(this.socket.disconnect(),this.socket=null)}isConnected(){return this.socket?.connected??!1}}const af=new a2;function i2(a){const i={};return a?.page!=null&&(i.page=String(a.page)),a?.limit!=null&&(i.limit=String(a.limit)),a?.includeArchived&&(i.includeArchived="true"),uo({queryKey:mt.projects.list(a),queryFn:()=>Ra.get("/projects",{params:i})})}function y2(a){return uo({queryKey:mt.projects.detail(a),queryFn:()=>Ra.get(`/projects/${a}`),enabled:!!a})}function g2(){const a=ni();return Rr({mutationFn:i=>Ra.post("/projects",i),onSuccess:()=>{a.invalidateQueries({queryKey:mt.projects.all})}})}function v2(){const a=ni();return Rr({mutationFn:({id:i,...r})=>Ra.put(`/projects/${i}`,r),onSuccess:(i,r)=>{a.invalidateQueries({queryKey:mt.projects.all}),a.invalidateQueries({queryKey:mt.projects.detail(r.id)})}})}function b2(){const a=ni();return Rr({mutationFn:({id:i,deleteRepo:r})=>Ra.post(`/projects/${i}/archive`,{deleteRepo:r??!1}),onSuccess:(i,r)=>{a.invalidateQueries({queryKey:mt.projects.all}),a.invalidateQueries({queryKey:mt.projects.detail(r.id)}),a.invalidateQueries({queryKey:mt.tasks.all}),a.invalidateQueries({queryKey:mt.workspaces.all})}})}function S2(){const a=ni();return Rr({mutationFn:({id:i,repoPath:r})=>Ra.post(`/projects/${i}/restore`,r?{repoPath:r}:{}),onSuccess:(i,r)=>{a.invalidateQueries({queryKey:mt.projects.all}),a.invalidateQueries({queryKey:mt.projects.detail(r.id)}),a.invalidateQueries({queryKey:mt.tasks.all}),a.invalidateQueries({queryKey:mt.workspaces.all})}})}function l2(a){const i=ni(),r=R.useRef(new Set),s=R.useRef(a);s.current=a,R.useEffect(()=>{if(a.length===0)return;const c=af.connect(),f=r.current,h=()=>{for(const p of s.current)c.emit(Ps.SUBSCRIBE,{topic:"project",id:p},w=>{w.success&&f.add(p)})},m=new Set(a);for(const p of m)f.has(p)||c.emit(Ps.SUBSCRIBE,{topic:"project",id:p},w=>{w.success&&f.add(p)});for(const p of f)m.has(p)||c.emit(Ps.UNSUBSCRIBE,{topic:"project",id:p},()=>{f.delete(p)});const g=()=>{f.clear(),h(),i.invalidateQueries({queryKey:mt.tasks.all})},y=async p=>{await i.cancelQueries({queryKey:mt.tasks.list(p.projectId)}),i.invalidateQueries({queryKey:mt.tasks.list(p.projectId)}),i.invalidateQueries({queryKey:mt.tasks.detail(p.taskId)})},b=p=>{i.invalidateQueries({queryKey:mt.tasks.list(p.projectId)}),i.removeQueries({queryKey:mt.tasks.detail(p.taskId)})};return c.on("connect",g),c.on($s.TASK_UPDATED,y),c.on($s.TASK_DELETED,b),()=>{c.off("connect",g),c.off($s.TASK_UPDATED,y),c.off($s.TASK_DELETED,b);for(const p of f)c.emit(Ps.UNSUBSCRIBE,{topic:"project",id:p});f.clear()}},[a,i])}function r2(){const{data:a}=i2(),i=R.useMemo(()=>a?.data.map(r=>r.id)??[],[a]);return l2(i),null}function s2(){return R.useEffect(()=>(af.connect(),()=>af.disconnect()),[]),se.jsx(cb,{client:$b,children:se.jsxs($E,{children:[se.jsx(r2,{}),se.jsx(cT,{}),se.jsx(Pb,{position:"top-center",toastOptions:{className:"text-sm",style:{fontFamily:"inherit"},classNames:{error:"!bg-neutral-900 !text-neutral-100 !border-neutral-800 !shadow-lg",success:"!bg-neutral-900 !text-neutral-100 !border-neutral-800 !shadow-lg",default:"!bg-neutral-900 !text-neutral-100 !border-neutral-800 !shadow-lg"}}})]})})}const o2="/api/tunnel/bootstrap";async function u2(){const a=new URL(window.location.href),i=a.searchParams.get("token");if(!i)return;const r=await fetch(`${o2}?token=${encodeURIComponent(i)}`,{method:"POST",credentials:"same-origin"});if(!r.ok)throw new Error(`Tunnel bootstrap failed (${r.status})`);a.searchParams.delete("token"),window.history.replaceState({},"",a.toString())}async function c2(){try{await u2()}catch(a){console.error("[Tunnel] Failed to bootstrap tunnel session",a)}k0.createRoot(document.getElementById("root")).render(se.jsx(R.StrictMode,{children:se.jsx(s2,{})}))}c2();export{fb as A,mb as B,Ps as C,vb as D,pb as E,HE as F,yb as G,Gt as H,Sb as I,Dp as J,bb as K,ig as L,gb as M,Eb as N,Cy as O,y2 as P,nb as Q,I as R,$s as S,BE as T,NE as U,g2 as V,my as W,ai as _,GE as a,m2 as b,KE as c,uo as d,ni as e,Rr as f,Ra as g,Dr as h,i2 as i,se as j,v2 as k,b2 as l,S2 as m,PE as n,xp as o,d2 as p,mt as q,R as r,af as s,qb as t,cg as u,f2 as v,Sl as w,Ot as x,ro as y,gy as z};
|