specweave 1.0.352 → 1.0.354
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/dashboard/assets/index-Bg3O0ISk.js +11 -0
- package/dist/dashboard/assets/index-SBBktW9a.css +1 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/plugins/specweave-github/lib/github-ac-comment-poster.d.ts.map +1 -1
- package/dist/plugins/specweave-github/lib/github-ac-comment-poster.js +55 -44
- package/dist/plugins/specweave-github/lib/github-ac-comment-poster.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-push-sync.js +1 -0
- package/dist/plugins/specweave-github/lib/github-push-sync.js.map +1 -1
- package/dist/plugins/specweave-github/lib/github-us-auto-closer.js +2 -1
- package/dist/plugins/specweave-github/lib/github-us-auto-closer.js.map +1 -1
- package/dist/src/core/ac-progress-sync.d.ts.map +1 -1
- package/dist/src/core/ac-progress-sync.js +6 -2
- package/dist/src/core/ac-progress-sync.js.map +1 -1
- package/dist/src/core/hooks/LifecycleHookDispatcher.d.ts +10 -0
- package/dist/src/core/hooks/LifecycleHookDispatcher.d.ts.map +1 -1
- package/dist/src/core/hooks/LifecycleHookDispatcher.js +85 -1
- package/dist/src/core/hooks/LifecycleHookDispatcher.js.map +1 -1
- package/package.json +1 -1
- package/plugins/specweave/agents/sw-architect.md +81 -0
- package/plugins/specweave/agents/sw-planner.md +95 -0
- package/plugins/specweave/agents/sw-pm.md +117 -0
- package/plugins/specweave/commands/docs-updater.md +1 -1
- package/plugins/specweave/hooks/v2/dispatchers/pre-tool-use.sh +15 -0
- package/plugins/specweave/hooks/v2/guards/skill-chain-enforcement-guard.sh +8 -0
- package/plugins/specweave/skills/docs-updater/SKILL.md +84 -0
- package/plugins/specweave/skills/done/SKILL.md +12 -0
- package/plugins/specweave/skills/increment/SKILL.md +28 -51
- package/plugins/specweave-github/hooks/github-auto-create-handler.sh +7 -3
- package/plugins/specweave-github/lib/github-ac-comment-poster.js +52 -40
- package/plugins/specweave-github/lib/github-ac-comment-poster.ts +81 -56
- package/plugins/specweave-github/lib/github-push-sync.js +2 -0
- package/plugins/specweave-github/lib/github-push-sync.ts +1 -0
- package/plugins/specweave-github/lib/github-us-auto-closer.js +1 -1
- package/plugins/specweave-github/lib/github-us-auto-closer.ts +2 -1
- package/dist/dashboard/assets/index-BkMbqwTc.css +0 -1
- package/dist/dashboard/assets/index-DgSCJ-tE.js +0 -11
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))c(f);new MutationObserver(f=>{for(const m of f)if(m.type==="childList")for(const g of m.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&c(g)}).observe(document,{childList:!0,subtree:!0});function u(f){const m={};return f.integrity&&(m.integrity=f.integrity),f.referrerPolicy&&(m.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?m.credentials="include":f.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function c(f){if(f.ep)return;f.ep=!0;const m=u(f);fetch(f.href,m)}})();var Zc={exports:{}},Vn={};var S0;function Ph(){if(S0)return Vn;S0=1;var r=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function u(c,f,m){var g=null;if(m!==void 0&&(g=""+m),f.key!==void 0&&(g=""+f.key),"key"in f){m={};for(var j in f)j!=="key"&&(m[j]=f[j])}else m=f;return f=m.ref,{$$typeof:r,type:c,key:g,ref:f!==void 0?f:null,props:m}}return Vn.Fragment=o,Vn.jsx=u,Vn.jsxs=u,Vn}var E0;function Ih(){return E0||(E0=1,Zc.exports=Ph()),Zc.exports}var n=Ih(),Kc={exports:{}},re={};var C0;function eg(){if(C0)return re;C0=1;var r=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),g=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),E=Symbol.iterator;function _(b){return b===null||typeof b!="object"?null:(b=E&&b[E]||b["@@iterator"],typeof b=="function"?b:null)}var U={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,T={};function q(b,Y,Z){this.props=b,this.context=Y,this.refs=T,this.updater=Z||U}q.prototype.isReactComponent={},q.prototype.setState=function(b,Y){if(typeof b!="object"&&typeof b!="function"&&b!=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,b,Y,"setState")},q.prototype.forceUpdate=function(b){this.updater.enqueueForceUpdate(this,b,"forceUpdate")};function A(){}A.prototype=q.prototype;function L(b,Y,Z){this.props=b,this.context=Y,this.refs=T,this.updater=Z||U}var te=L.prototype=new A;te.constructor=L,O(te,q.prototype),te.isPureReactComponent=!0;var K=Array.isArray;function ce(){}var V={H:null,A:null,T:null,S:null},X=Object.prototype.hasOwnProperty;function $(b,Y,Z){var W=Z.ref;return{$$typeof:r,type:b,key:Y,ref:W!==void 0?W:null,props:Z}}function ee(b,Y){return $(b.type,Y,b.props)}function P(b){return typeof b=="object"&&b!==null&&b.$$typeof===r}function Se(b){var Y={"=":"=0",":":"=2"};return"$"+b.replace(/[=:]/g,function(Z){return Y[Z]})}var Ge=/\/+/g;function Le(b,Y){return typeof b=="object"&&b!==null&&b.key!=null?Se(""+b.key):Y.toString(36)}function Ee(b){switch(b.status){case"fulfilled":return b.value;case"rejected":throw b.reason;default:switch(typeof b.status=="string"?b.then(ce,ce):(b.status="pending",b.then(function(Y){b.status==="pending"&&(b.status="fulfilled",b.value=Y)},function(Y){b.status==="pending"&&(b.status="rejected",b.reason=Y)})),b.status){case"fulfilled":return b.value;case"rejected":throw b.reason}}throw b}function H(b,Y,Z,W,ie){var fe=typeof b;(fe==="undefined"||fe==="boolean")&&(b=null);var F=!1;if(b===null)F=!0;else switch(fe){case"bigint":case"string":case"number":F=!0;break;case"object":switch(b.$$typeof){case r:case o:F=!0;break;case v:return F=b._init,H(F(b._payload),Y,Z,W,ie)}}if(F)return ie=ie(b),F=W===""?"."+Le(b,0):W,K(ie)?(Z="",F!=null&&(Z=F.replace(Ge,"$&/")+"/"),H(ie,Y,Z,"",function(Wl){return Wl})):ie!=null&&(P(ie)&&(ie=ee(ie,Z+(ie.key==null||b&&b.key===ie.key?"":(""+ie.key).replace(Ge,"$&/")+"/")+F)),Y.push(ie)),1;F=0;var Ke=W===""?".":W+":";if(K(b))for(var qe=0;qe<b.length;qe++)W=b[qe],fe=Ke+Le(W,qe),F+=H(W,Y,Z,fe,ie);else if(qe=_(b),typeof qe=="function")for(b=qe.call(b),qe=0;!(W=b.next()).done;)W=W.value,fe=Ke+Le(W,qe++),F+=H(W,Y,Z,fe,ie);else if(fe==="object"){if(typeof b.then=="function")return H(Ee(b),Y,Z,W,ie);throw Y=String(b),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(b).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return F}function Q(b,Y,Z){if(b==null)return b;var W=[],ie=0;return H(b,W,"","",function(fe){return Y.call(Z,fe,ie++)}),W}function le(b){if(b._status===-1){var Y=b._result;Y=Y(),Y.then(function(Z){(b._status===0||b._status===-1)&&(b._status=1,b._result=Z)},function(Z){(b._status===0||b._status===-1)&&(b._status=2,b._result=Z)}),b._status===-1&&(b._status=0,b._result=Y)}if(b._status===1)return b._result.default;throw b._result}var pe=typeof reportError=="function"?reportError:function(b){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof b=="object"&&b!==null&&typeof b.message=="string"?String(b.message):String(b),error:b});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",b);return}console.error(b)},je={map:Q,forEach:function(b,Y,Z){Q(b,function(){Y.apply(this,arguments)},Z)},count:function(b){var Y=0;return Q(b,function(){Y++}),Y},toArray:function(b){return Q(b,function(Y){return Y})||[]},only:function(b){if(!P(b))throw Error("React.Children.only expected to receive a single React element child.");return b}};return re.Activity=y,re.Children=je,re.Component=q,re.Fragment=u,re.Profiler=f,re.PureComponent=L,re.StrictMode=c,re.Suspense=p,re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,re.__COMPILER_RUNTIME={__proto__:null,c:function(b){return V.H.useMemoCache(b)}},re.cache=function(b){return function(){return b.apply(null,arguments)}},re.cacheSignal=function(){return null},re.cloneElement=function(b,Y,Z){if(b==null)throw Error("The argument must be a React element, but you passed "+b+".");var W=O({},b.props),ie=b.key;if(Y!=null)for(fe in Y.key!==void 0&&(ie=""+Y.key),Y)!X.call(Y,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&Y.ref===void 0||(W[fe]=Y[fe]);var fe=arguments.length-2;if(fe===1)W.children=Z;else if(1<fe){for(var F=Array(fe),Ke=0;Ke<fe;Ke++)F[Ke]=arguments[Ke+2];W.children=F}return $(b.type,ie,W)},re.createContext=function(b){return b={$$typeof:g,_currentValue:b,_currentValue2:b,_threadCount:0,Provider:null,Consumer:null},b.Provider=b,b.Consumer={$$typeof:m,_context:b},b},re.createElement=function(b,Y,Z){var W,ie={},fe=null;if(Y!=null)for(W in Y.key!==void 0&&(fe=""+Y.key),Y)X.call(Y,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(ie[W]=Y[W]);var F=arguments.length-2;if(F===1)ie.children=Z;else if(1<F){for(var Ke=Array(F),qe=0;qe<F;qe++)Ke[qe]=arguments[qe+2];ie.children=Ke}if(b&&b.defaultProps)for(W in F=b.defaultProps,F)ie[W]===void 0&&(ie[W]=F[W]);return $(b,fe,ie)},re.createRef=function(){return{current:null}},re.forwardRef=function(b){return{$$typeof:j,render:b}},re.isValidElement=P,re.lazy=function(b){return{$$typeof:v,_payload:{_status:-1,_result:b},_init:le}},re.memo=function(b,Y){return{$$typeof:x,type:b,compare:Y===void 0?null:Y}},re.startTransition=function(b){var Y=V.T,Z={};V.T=Z;try{var W=b(),ie=V.S;ie!==null&&ie(Z,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(ce,pe)}catch(fe){pe(fe)}finally{Y!==null&&Z.types!==null&&(Y.types=Z.types),V.T=Y}},re.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},re.use=function(b){return V.H.use(b)},re.useActionState=function(b,Y,Z){return V.H.useActionState(b,Y,Z)},re.useCallback=function(b,Y){return V.H.useCallback(b,Y)},re.useContext=function(b){return V.H.useContext(b)},re.useDebugValue=function(){},re.useDeferredValue=function(b,Y){return V.H.useDeferredValue(b,Y)},re.useEffect=function(b,Y){return V.H.useEffect(b,Y)},re.useEffectEvent=function(b){return V.H.useEffectEvent(b)},re.useId=function(){return V.H.useId()},re.useImperativeHandle=function(b,Y,Z){return V.H.useImperativeHandle(b,Y,Z)},re.useInsertionEffect=function(b,Y){return V.H.useInsertionEffect(b,Y)},re.useLayoutEffect=function(b,Y){return V.H.useLayoutEffect(b,Y)},re.useMemo=function(b,Y){return V.H.useMemo(b,Y)},re.useOptimistic=function(b,Y){return V.H.useOptimistic(b,Y)},re.useReducer=function(b,Y,Z){return V.H.useReducer(b,Y,Z)},re.useRef=function(b){return V.H.useRef(b)},re.useState=function(b){return V.H.useState(b)},re.useSyncExternalStore=function(b,Y,Z){return V.H.useSyncExternalStore(b,Y,Z)},re.useTransition=function(){return V.H.useTransition()},re.version="19.2.4",re}var T0;function uu(){return T0||(T0=1,Kc.exports=eg()),Kc.exports}var N=uu(),Jc={exports:{}},Xn={},Wc={exports:{}},Fc={};var w0;function tg(){return w0||(w0=1,(function(r){function o(H,Q){var le=H.length;H.push(Q);e:for(;0<le;){var pe=le-1>>>1,je=H[pe];if(0<f(je,Q))H[pe]=Q,H[le]=je,le=pe;else break e}}function u(H){return H.length===0?null:H[0]}function c(H){if(H.length===0)return null;var Q=H[0],le=H.pop();if(le!==Q){H[0]=le;e:for(var pe=0,je=H.length,b=je>>>1;pe<b;){var Y=2*(pe+1)-1,Z=H[Y],W=Y+1,ie=H[W];if(0>f(Z,le))W<je&&0>f(ie,Z)?(H[pe]=ie,H[W]=le,pe=W):(H[pe]=Z,H[Y]=le,pe=Y);else if(W<je&&0>f(ie,le))H[pe]=ie,H[W]=le,pe=W;else break e}}return Q}function f(H,Q){var le=H.sortIndex-Q.sortIndex;return le!==0?le:H.id-Q.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;r.unstable_now=function(){return m.now()}}else{var g=Date,j=g.now();r.unstable_now=function(){return g.now()-j}}var p=[],x=[],v=1,y=null,E=3,_=!1,U=!1,O=!1,T=!1,q=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function te(H){for(var Q=u(x);Q!==null;){if(Q.callback===null)c(x);else if(Q.startTime<=H)c(x),Q.sortIndex=Q.expirationTime,o(p,Q);else break;Q=u(x)}}function K(H){if(O=!1,te(H),!U)if(u(p)!==null)U=!0,ce||(ce=!0,Se());else{var Q=u(x);Q!==null&&Ee(K,Q.startTime-H)}}var ce=!1,V=-1,X=5,$=-1;function ee(){return T?!0:!(r.unstable_now()-$<X)}function P(){if(T=!1,ce){var H=r.unstable_now();$=H;var Q=!0;try{e:{U=!1,O&&(O=!1,A(V),V=-1),_=!0;var le=E;try{t:{for(te(H),y=u(p);y!==null&&!(y.expirationTime>H&&ee());){var pe=y.callback;if(typeof pe=="function"){y.callback=null,E=y.priorityLevel;var je=pe(y.expirationTime<=H);if(H=r.unstable_now(),typeof je=="function"){y.callback=je,te(H),Q=!0;break t}y===u(p)&&c(p),te(H)}else c(p);y=u(p)}if(y!==null)Q=!0;else{var b=u(x);b!==null&&Ee(K,b.startTime-H),Q=!1}}break e}finally{y=null,E=le,_=!1}Q=void 0}}finally{Q?Se():ce=!1}}}var Se;if(typeof L=="function")Se=function(){L(P)};else if(typeof MessageChannel<"u"){var Ge=new MessageChannel,Le=Ge.port2;Ge.port1.onmessage=P,Se=function(){Le.postMessage(null)}}else Se=function(){q(P,0)};function Ee(H,Q){V=q(function(){H(r.unstable_now())},Q)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(H){H.callback=null},r.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<H?Math.floor(1e3/H):5},r.unstable_getCurrentPriorityLevel=function(){return E},r.unstable_next=function(H){switch(E){case 1:case 2:case 3:var Q=3;break;default:Q=E}var le=E;E=Q;try{return H()}finally{E=le}},r.unstable_requestPaint=function(){T=!0},r.unstable_runWithPriority=function(H,Q){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var le=E;E=H;try{return Q()}finally{E=le}},r.unstable_scheduleCallback=function(H,Q,le){var pe=r.unstable_now();switch(typeof le=="object"&&le!==null?(le=le.delay,le=typeof le=="number"&&0<le?pe+le:pe):le=pe,H){case 1:var je=-1;break;case 2:je=250;break;case 5:je=1073741823;break;case 4:je=1e4;break;default:je=5e3}return je=le+je,H={id:v++,callback:Q,priorityLevel:H,startTime:le,expirationTime:je,sortIndex:-1},le>pe?(H.sortIndex=le,o(x,H),u(p)===null&&H===u(x)&&(O?(A(V),V=-1):O=!0,Ee(K,le-pe))):(H.sortIndex=je,o(p,H),U||_||(U=!0,ce||(ce=!0,Se()))),H},r.unstable_shouldYield=ee,r.unstable_wrapCallback=function(H){var Q=E;return function(){var le=E;E=Q;try{return H.apply(this,arguments)}finally{E=le}}}})(Fc)),Fc}var A0;function ag(){return A0||(A0=1,Wc.exports=tg()),Wc.exports}var Pc={exports:{}},nt={};var R0;function lg(){if(R0)return nt;R0=1;var r=uu();function o(p){var x="https://react.dev/errors/"+p;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)x+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+p+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(){}var c={d:{f:u,r:function(){throw Error(o(522))},D:u,C:u,L:u,m:u,X:u,S:u,M:u},p:0,findDOMNode:null},f=Symbol.for("react.portal");function m(p,x,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:y==null?null:""+y,children:p,containerInfo:x,implementation:v}}var g=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function j(p,x){if(p==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return nt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,nt.createPortal=function(p,x){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(o(299));return m(p,x,null,v)},nt.flushSync=function(p){var x=g.T,v=c.p;try{if(g.T=null,c.p=2,p)return p()}finally{g.T=x,c.p=v,c.d.f()}},nt.preconnect=function(p,x){typeof p=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,c.d.C(p,x))},nt.prefetchDNS=function(p){typeof p=="string"&&c.d.D(p)},nt.preinit=function(p,x){if(typeof p=="string"&&x&&typeof x.as=="string"){var v=x.as,y=j(v,x.crossOrigin),E=typeof x.integrity=="string"?x.integrity:void 0,_=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;v==="style"?c.d.S(p,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:y,integrity:E,fetchPriority:_}):v==="script"&&c.d.X(p,{crossOrigin:y,integrity:E,fetchPriority:_,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},nt.preinitModule=function(p,x){if(typeof p=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var v=j(x.as,x.crossOrigin);c.d.M(p,{crossOrigin:v,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&c.d.M(p)},nt.preload=function(p,x){if(typeof p=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var v=x.as,y=j(v,x.crossOrigin);c.d.L(p,v,{crossOrigin:y,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},nt.preloadModule=function(p,x){if(typeof p=="string")if(x){var v=j(x.as,x.crossOrigin);c.d.m(p,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:v,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else c.d.m(p)},nt.requestFormReset=function(p){c.d.r(p)},nt.unstable_batchedUpdates=function(p,x){return p(x)},nt.useFormState=function(p,x,v){return g.H.useFormState(p,x,v)},nt.useFormStatus=function(){return g.H.useHostTransitionStatus()},nt.version="19.2.4",nt}var M0;function ng(){if(M0)return Pc.exports;M0=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(o){console.error(o)}}return r(),Pc.exports=lg(),Pc.exports}var _0;function sg(){if(_0)return Xn;_0=1;var r=ag(),o=uu(),u=ng();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}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 f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function g(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 j(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 p(e){if(m(e)!==e)throw Error(c(188))}function x(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(c(188));return t!==e?null:e}for(var a=e,l=t;;){var s=a.return;if(s===null)break;var i=s.alternate;if(i===null){if(l=s.return,l!==null){a=l;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===a)return p(s),e;if(i===l)return p(s),t;i=i.sibling}throw Error(c(188))}if(a.return!==l.return)a=s,l=i;else{for(var d=!1,h=s.child;h;){if(h===a){d=!0,a=s,l=i;break}if(h===l){d=!0,l=s,a=i;break}h=h.sibling}if(!d){for(h=i.child;h;){if(h===a){d=!0,a=i,l=s;break}if(h===l){d=!0,l=i,a=s;break}h=h.sibling}if(!d)throw Error(c(189))}}if(a.alternate!==l)throw Error(c(190))}if(a.tag!==3)throw Error(c(188));return a.stateNode.current===a?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,E=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),U=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),q=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),L=Symbol.for("react.context"),te=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),ce=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),ee=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function Se(e){return e===null||typeof e!="object"?null:(e=P&&e[P]||e["@@iterator"],typeof e=="function"?e:null)}var Ge=Symbol.for("react.client.reference");function Le(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ge?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case O:return"Fragment";case q:return"Profiler";case T:return"StrictMode";case K:return"Suspense";case ce:return"SuspenseList";case $:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case U:return"Portal";case L:return e.displayName||"Context";case A:return(e._context.displayName||"Context")+".Consumer";case te:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case V:return t=e.displayName||null,t!==null?t:Le(e.type)||"Memo";case X:t=e._payload,e=e._init;try{return Le(e(t))}catch{}}return null}var Ee=Array.isArray,H=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},pe=[],je=-1;function b(e){return{current:e}}function Y(e){0>je||(e.current=pe[je],pe[je]=null,je--)}function Z(e,t){je++,pe[je]=e.current,e.current=t}var W=b(null),ie=b(null),fe=b(null),F=b(null);function Ke(e,t){switch(Z(fe,t),Z(ie,e),Z(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Qf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Qf(t),e=Zf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Y(W),Z(W,e)}function qe(){Y(W),Y(ie),Y(fe)}function Wl(e){e.memoizedState!==null&&Z(F,e);var t=W.current,a=Zf(t,e.type);t!==a&&(Z(ie,e),Z(W,a))}function ts(e){ie.current===e&&(Y(W),Y(ie)),F.current===e&&(Y(F),Yn._currentValue=le)}var Ri,bu;function $a(e){if(Ri===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Ri=t&&t[1]||"",bu=-1<a.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+Ri+e+bu}var Mi=!1;function _i(e,t){if(!e||Mi)return"";Mi=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var G=function(){throw Error()};if(Object.defineProperty(G.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(G,[])}catch(D){var z=D}Reflect.construct(e,[],G)}else{try{G.call()}catch(D){z=D}e.call(G.prototype)}}else{try{throw Error()}catch(D){z=D}(G=e())&&typeof G.catch=="function"&&G.catch(function(){})}}catch(D){if(D&&z&&typeof D.stack=="string")return[D.stack,z.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=l.DetermineComponentFrameRoot(),d=i[0],h=i[1];if(d&&h){var S=d.split(`
|
|
4
|
+
`),M=h.split(`
|
|
5
|
+
`);for(s=l=0;l<S.length&&!S[l].includes("DetermineComponentFrameRoot");)l++;for(;s<M.length&&!M[s].includes("DetermineComponentFrameRoot");)s++;if(l===S.length||s===M.length)for(l=S.length-1,s=M.length-1;1<=l&&0<=s&&S[l]!==M[s];)s--;for(;1<=l&&0<=s;l--,s--)if(S[l]!==M[s]){if(l!==1||s!==1)do if(l--,s--,0>s||S[l]!==M[s]){var B=`
|
|
6
|
+
`+S[l].replace(" at new "," at ");return e.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",e.displayName)),B}while(1<=l&&0<=s);break}}}finally{Mi=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?$a(a):""}function Rm(e,t){switch(e.tag){case 26:case 27:case 5:return $a(e.type);case 16:return $a("Lazy");case 13:return e.child!==t&&t!==null?$a("Suspense Fallback"):$a("Suspense");case 19:return $a("SuspenseList");case 0:case 15:return _i(e.type,!1);case 11:return _i(e.type.render,!1);case 1:return _i(e.type,!0);case 31:return $a("Activity");default:return""}}function ju(e){try{var t="",a=null;do t+=Rm(e,a),a=e,e=e.return;while(e);return t}catch(l){return`
|
|
7
|
+
Error generating stack: `+l.message+`
|
|
8
|
+
`+l.stack}}var zi=Object.prototype.hasOwnProperty,Oi=r.unstable_scheduleCallback,Di=r.unstable_cancelCallback,Mm=r.unstable_shouldYield,_m=r.unstable_requestPaint,ht=r.unstable_now,zm=r.unstable_getCurrentPriorityLevel,Nu=r.unstable_ImmediatePriority,Su=r.unstable_UserBlockingPriority,as=r.unstable_NormalPriority,Om=r.unstable_LowPriority,Eu=r.unstable_IdlePriority,Dm=r.log,Um=r.unstable_setDisableYieldValue,Fl=null,gt=null;function xa(e){if(typeof Dm=="function"&&Um(e),gt&&typeof gt.setStrictMode=="function")try{gt.setStrictMode(Fl,e)}catch{}}var yt=Math.clz32?Math.clz32:Bm,Lm=Math.log,Hm=Math.LN2;function Bm(e){return e>>>=0,e===0?32:31-(Lm(e)/Hm|0)|0}var ls=256,ns=262144,ss=4194304;function ka(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function is(e,t,a){var l=e.pendingLanes;if(l===0)return 0;var s=0,i=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var h=l&134217727;return h!==0?(l=h&~i,l!==0?s=ka(l):(d&=h,d!==0?s=ka(d):a||(a=h&~e,a!==0&&(s=ka(a))))):(h=l&~i,h!==0?s=ka(h):d!==0?s=ka(d):a||(a=l&~e,a!==0&&(s=ka(a)))),s===0?0:t!==0&&t!==s&&(t&i)===0&&(i=s&-s,a=t&-t,i>=a||i===32&&(a&4194048)!==0)?t:s}function Pl(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function qm(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Cu(){var e=ss;return ss<<=1,(ss&62914560)===0&&(ss=4194304),e}function Ui(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Il(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ym(e,t,a,l,s,i){var d=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var h=e.entanglements,S=e.expirationTimes,M=e.hiddenUpdates;for(a=d&~a;0<a;){var B=31-yt(a),G=1<<B;h[B]=0,S[B]=-1;var z=M[B];if(z!==null)for(M[B]=null,B=0;B<z.length;B++){var D=z[B];D!==null&&(D.lane&=-536870913)}a&=~G}l!==0&&Tu(e,l,0),i!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=i&~(d&~t))}function Tu(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-yt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|a&261930}function wu(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var l=31-yt(a),s=1<<l;s&t|e[l]&t&&(e[l]|=t),a&=~s}}function Au(e,t){var a=t&-t;return a=(a&42)!==0?1:Li(a),(a&(e.suspendedLanes|t))!==0?0:a}function Li(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Hi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ru(){var e=Q.p;return e!==0?e:(e=window.event,e===void 0?32:g0(e.type))}function Mu(e,t){var a=Q.p;try{return Q.p=e,t()}finally{Q.p=a}}var ha=Math.random().toString(36).slice(2),Pe="__reactFiber$"+ha,ct="__reactProps$"+ha,il="__reactContainer$"+ha,Bi="__reactEvents$"+ha,$m="__reactListeners$"+ha,km="__reactHandles$"+ha,_u="__reactResources$"+ha,en="__reactMarker$"+ha;function qi(e){delete e[Pe],delete e[ct],delete e[Bi],delete e[$m],delete e[km]}function rl(e){var t=e[Pe];if(t)return t;for(var a=e.parentNode;a;){if(t=a[il]||a[Pe]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=e0(e);e!==null;){if(a=e[Pe])return a;e=e0(e)}return t}e=a,a=e.parentNode}return null}function cl(e){if(e=e[Pe]||e[il]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function tn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function ul(e){var t=e[_u];return t||(t=e[_u]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function We(e){e[en]=!0}var zu=new Set,Ou={};function Ga(e,t){ol(e,t),ol(e+"Capture",t)}function ol(e,t){for(Ou[e]=t,e=0;e<t.length;e++)zu.add(t[e])}var Gm=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Du={},Uu={};function Vm(e){return zi.call(Uu,e)?!0:zi.call(Du,e)?!1:Gm.test(e)?Uu[e]=!0:(Du[e]=!0,!1)}function rs(e,t,a){if(Vm(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function cs(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Kt(e,t,a,l){if(l===null)e.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+l)}}function Ct(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Lu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Xm(e,t,a){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var s=l.get,i=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(d){a=""+d,i.call(this,d)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(d){a=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Yi(e){if(!e._valueTracker){var t=Lu(e)?"checked":"value";e._valueTracker=Xm(e,t,""+e[t])}}function Hu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),l="";return e&&(l=Lu(e)?e.checked?"true":"false":e.value),e=l,e!==a?(t.setValue(e),!0):!1}function us(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Qm=/[\n"\\]/g;function Tt(e){return e.replace(Qm,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function $i(e,t,a,l,s,i,d,h){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ct(t)):e.value!==""+Ct(t)&&(e.value=""+Ct(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?ki(e,d,Ct(t)):a!=null?ki(e,d,Ct(a)):l!=null&&e.removeAttribute("value"),s==null&&i!=null&&(e.defaultChecked=!!i),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.name=""+Ct(h):e.removeAttribute("name")}function Bu(e,t,a,l,s,i,d,h){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||a!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){Yi(e);return}a=a!=null?""+Ct(a):"",t=t!=null?""+Ct(t):a,h||t===e.value||(e.value=t),e.defaultValue=t}l=l??s,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=h?e.checked:!!l,e.defaultChecked=!!l,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),Yi(e)}function ki(e,t,a){t==="number"&&us(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function dl(e,t,a,l){if(e=e.options,t){t={};for(var s=0;s<a.length;s++)t["$"+a[s]]=!0;for(a=0;a<e.length;a++)s=t.hasOwnProperty("$"+e[a].value),e[a].selected!==s&&(e[a].selected=s),s&&l&&(e[a].defaultSelected=!0)}else{for(a=""+Ct(a),t=null,s=0;s<e.length;s++){if(e[s].value===a){e[s].selected=!0,l&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function qu(e,t,a){if(t!=null&&(t=""+Ct(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Ct(a):""}function Yu(e,t,a,l){if(t==null){if(l!=null){if(a!=null)throw Error(c(92));if(Ee(l)){if(1<l.length)throw Error(c(93));l=l[0]}a=l}a==null&&(a=""),t=a}a=Ct(t),e.defaultValue=a,l=e.textContent,l===a&&l!==""&&l!==null&&(e.value=l),Yi(e)}function fl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Zm=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function $u(e,t,a){var l=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,a):typeof a!="number"||a===0||Zm.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function ku(e,t,a){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var s in t)l=t[s],t.hasOwnProperty(s)&&a[s]!==l&&$u(e,s,l)}else for(var i in t)t.hasOwnProperty(i)&&$u(e,i,t[i])}function Gi(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Km=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Jm=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function os(e){return Jm.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Jt(){}var Vi=null;function Xi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ml=null,xl=null;function Gu(e){var t=cl(e);if(t&&(e=t.stateNode)){var a=e[ct]||null;e:switch(e=t.stateNode,t.type){case"input":if($i(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Tt(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var l=a[t];if(l!==e&&l.form===e.form){var s=l[ct]||null;if(!s)throw Error(c(90));$i(l,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<a.length;t++)l=a[t],l.form===e.form&&Hu(l)}break e;case"textarea":qu(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&dl(e,!!a.multiple,t,!1)}}}var Qi=!1;function Vu(e,t,a){if(Qi)return e(t,a);Qi=!0;try{var l=e(t);return l}finally{if(Qi=!1,(ml!==null||xl!==null)&&(Fs(),ml&&(t=ml,e=xl,xl=ml=null,Gu(t),e)))for(t=0;t<e.length;t++)Gu(e[t])}}function an(e,t){var a=e.stateNode;if(a===null)return null;var l=a[ct]||null;if(l===null)return null;a=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(c(231,t,typeof a));return a}var Wt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zi=!1;if(Wt)try{var ln={};Object.defineProperty(ln,"passive",{get:function(){Zi=!0}}),window.addEventListener("test",ln,ln),window.removeEventListener("test",ln,ln)}catch{Zi=!1}var ga=null,Ki=null,ds=null;function Xu(){if(ds)return ds;var e,t=Ki,a=t.length,l,s="value"in ga?ga.value:ga.textContent,i=s.length;for(e=0;e<a&&t[e]===s[e];e++);var d=a-e;for(l=1;l<=d&&t[a-l]===s[i-l];l++);return ds=s.slice(e,1<l?1-l:void 0)}function fs(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ms(){return!0}function Qu(){return!1}function ut(e){function t(a,l,s,i,d){this._reactName=a,this._targetInst=s,this.type=l,this.nativeEvent=i,this.target=d,this.currentTarget=null;for(var h in e)e.hasOwnProperty(h)&&(a=e[h],this[h]=a?a(i):i[h]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?ms:Qu,this.isPropagationStopped=Qu,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=ms)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ms)},persist:function(){},isPersistent:ms}),t}var Va={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xs=ut(Va),nn=y({},Va,{view:0,detail:0}),Wm=ut(nn),Ji,Wi,sn,hs=y({},nn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pi,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==sn&&(sn&&e.type==="mousemove"?(Ji=e.screenX-sn.screenX,Wi=e.screenY-sn.screenY):Wi=Ji=0,sn=e),Ji)},movementY:function(e){return"movementY"in e?e.movementY:Wi}}),Zu=ut(hs),Fm=y({},hs,{dataTransfer:0}),Pm=ut(Fm),Im=y({},nn,{relatedTarget:0}),Fi=ut(Im),ex=y({},Va,{animationName:0,elapsedTime:0,pseudoElement:0}),tx=ut(ex),ax=y({},Va,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),lx=ut(ax),nx=y({},Va,{data:0}),Ku=ut(nx),sx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ix={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},rx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function cx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=rx[e])?!!t[e]:!1}function Pi(){return cx}var ux=y({},nn,{key:function(e){if(e.key){var t=sx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=fs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ix[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pi,charCode:function(e){return e.type==="keypress"?fs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?fs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ox=ut(ux),dx=y({},hs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ju=ut(dx),fx=y({},nn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pi}),mx=ut(fx),xx=y({},Va,{propertyName:0,elapsedTime:0,pseudoElement:0}),hx=ut(xx),gx=y({},hs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),yx=ut(gx),px=y({},Va,{newState:0,oldState:0}),vx=ut(px),bx=[9,13,27,32],Ii=Wt&&"CompositionEvent"in window,rn=null;Wt&&"documentMode"in document&&(rn=document.documentMode);var jx=Wt&&"TextEvent"in window&&!rn,Wu=Wt&&(!Ii||rn&&8<rn&&11>=rn),Fu=" ",Pu=!1;function Iu(e,t){switch(e){case"keyup":return bx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function eo(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var hl=!1;function Nx(e,t){switch(e){case"compositionend":return eo(t);case"keypress":return t.which!==32?null:(Pu=!0,Fu);case"textInput":return e=t.data,e===Fu&&Pu?null:e;default:return null}}function Sx(e,t){if(hl)return e==="compositionend"||!Ii&&Iu(e,t)?(e=Xu(),ds=Ki=ga=null,hl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Wu&&t.locale!=="ko"?null:t.data;default:return null}}var Ex={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function to(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ex[e.type]:t==="textarea"}function ao(e,t,a,l){ml?xl?xl.push(l):xl=[l]:ml=l,t=ni(t,"onChange"),0<t.length&&(a=new xs("onChange","change",null,a,l),e.push({event:a,listeners:t}))}var cn=null,un=null;function Cx(e){Yf(e,0)}function gs(e){var t=tn(e);if(Hu(t))return e}function lo(e,t){if(e==="change")return t}var no=!1;if(Wt){var er;if(Wt){var tr="oninput"in document;if(!tr){var so=document.createElement("div");so.setAttribute("oninput","return;"),tr=typeof so.oninput=="function"}er=tr}else er=!1;no=er&&(!document.documentMode||9<document.documentMode)}function io(){cn&&(cn.detachEvent("onpropertychange",ro),un=cn=null)}function ro(e){if(e.propertyName==="value"&&gs(un)){var t=[];ao(t,un,e,Xi(e)),Vu(Cx,t)}}function Tx(e,t,a){e==="focusin"?(io(),cn=t,un=a,cn.attachEvent("onpropertychange",ro)):e==="focusout"&&io()}function wx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return gs(un)}function Ax(e,t){if(e==="click")return gs(t)}function Rx(e,t){if(e==="input"||e==="change")return gs(t)}function Mx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pt=typeof Object.is=="function"?Object.is:Mx;function on(e,t){if(pt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var s=a[l];if(!zi.call(t,s)||!pt(e[s],t[s]))return!1}return!0}function co(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function uo(e,t){var a=co(e);e=0;for(var l;a;){if(a.nodeType===3){if(l=e+a.textContent.length,e<=t&&l>=t)return{node:a,offset:t-e};e=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=co(a)}}function oo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?oo(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function fo(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=us(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=us(e.document)}return t}function ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var _x=Wt&&"documentMode"in document&&11>=document.documentMode,gl=null,lr=null,dn=null,nr=!1;function mo(e,t,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;nr||gl==null||gl!==us(l)||(l=gl,"selectionStart"in l&&ar(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),dn&&on(dn,l)||(dn=l,l=ni(lr,"onSelect"),0<l.length&&(t=new xs("onSelect","select",null,t,a),e.push({event:t,listeners:l}),t.target=gl)))}function Xa(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var yl={animationend:Xa("Animation","AnimationEnd"),animationiteration:Xa("Animation","AnimationIteration"),animationstart:Xa("Animation","AnimationStart"),transitionrun:Xa("Transition","TransitionRun"),transitionstart:Xa("Transition","TransitionStart"),transitioncancel:Xa("Transition","TransitionCancel"),transitionend:Xa("Transition","TransitionEnd")},sr={},xo={};Wt&&(xo=document.createElement("div").style,"AnimationEvent"in window||(delete yl.animationend.animation,delete yl.animationiteration.animation,delete yl.animationstart.animation),"TransitionEvent"in window||delete yl.transitionend.transition);function Qa(e){if(sr[e])return sr[e];if(!yl[e])return e;var t=yl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in xo)return sr[e]=t[a];return e}var ho=Qa("animationend"),go=Qa("animationiteration"),yo=Qa("animationstart"),zx=Qa("transitionrun"),Ox=Qa("transitionstart"),Dx=Qa("transitioncancel"),po=Qa("transitionend"),vo=new Map,ir="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");ir.push("scrollEnd");function Lt(e,t){vo.set(e,t),Ga(t,[e])}var ys=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},wt=[],pl=0,rr=0;function ps(){for(var e=pl,t=rr=pl=0;t<e;){var a=wt[t];wt[t++]=null;var l=wt[t];wt[t++]=null;var s=wt[t];wt[t++]=null;var i=wt[t];if(wt[t++]=null,l!==null&&s!==null){var d=l.pending;d===null?s.next=s:(s.next=d.next,d.next=s),l.pending=s}i!==0&&bo(a,s,i)}}function vs(e,t,a,l){wt[pl++]=e,wt[pl++]=t,wt[pl++]=a,wt[pl++]=l,rr|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function cr(e,t,a,l){return vs(e,t,a,l),bs(e)}function Za(e,t){return vs(e,null,null,t),bs(e)}function bo(e,t,a){e.lanes|=a;var l=e.alternate;l!==null&&(l.lanes|=a);for(var s=!1,i=e.return;i!==null;)i.childLanes|=a,l=i.alternate,l!==null&&(l.childLanes|=a),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(s=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,s&&t!==null&&(s=31-yt(a),e=i.hiddenUpdates,l=e[s],l===null?e[s]=[t]:l.push(t),t.lane=a|536870912),i):null}function bs(e){if(50<On)throw On=0,yc=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var vl={};function Ux(e,t,a,l){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vt(e,t,a,l){return new Ux(e,t,a,l)}function ur(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ft(e,t){var a=e.alternate;return a===null?(a=vt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function jo(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function js(e,t,a,l,s,i){var d=0;if(l=e,typeof e=="function")ur(e)&&(d=1);else if(typeof e=="string")d=Yh(e,a,W.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case $:return e=vt(31,a,t,s),e.elementType=$,e.lanes=i,e;case O:return Ka(a.children,s,i,t);case T:d=8,s|=24;break;case q:return e=vt(12,a,t,s|2),e.elementType=q,e.lanes=i,e;case K:return e=vt(13,a,t,s),e.elementType=K,e.lanes=i,e;case ce:return e=vt(19,a,t,s),e.elementType=ce,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case L:d=10;break e;case A:d=9;break e;case te:d=11;break e;case V:d=14;break e;case X:d=16,l=null;break e}d=29,a=Error(c(130,e===null?"null":typeof e,"")),l=null}return t=vt(d,a,t,s),t.elementType=e,t.type=l,t.lanes=i,t}function Ka(e,t,a,l){return e=vt(7,e,l,t),e.lanes=a,e}function or(e,t,a){return e=vt(6,e,null,t),e.lanes=a,e}function No(e){var t=vt(18,null,null,0);return t.stateNode=e,t}function dr(e,t,a){return t=vt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var So=new WeakMap;function At(e,t){if(typeof e=="object"&&e!==null){var a=So.get(e);return a!==void 0?a:(t={value:e,source:t,stack:ju(t)},So.set(e,t),t)}return{value:e,source:t,stack:ju(t)}}var bl=[],jl=0,Ns=null,fn=0,Rt=[],Mt=0,ya=null,Yt=1,$t="";function Pt(e,t){bl[jl++]=fn,bl[jl++]=Ns,Ns=e,fn=t}function Eo(e,t,a){Rt[Mt++]=Yt,Rt[Mt++]=$t,Rt[Mt++]=ya,ya=e;var l=Yt;e=$t;var s=32-yt(l)-1;l&=~(1<<s),a+=1;var i=32-yt(t)+s;if(30<i){var d=s-s%5;i=(l&(1<<d)-1).toString(32),l>>=d,s-=d,Yt=1<<32-yt(t)+s|a<<s|l,$t=i+e}else Yt=1<<i|a<<s|l,$t=e}function fr(e){e.return!==null&&(Pt(e,1),Eo(e,1,0))}function mr(e){for(;e===Ns;)Ns=bl[--jl],bl[jl]=null,fn=bl[--jl],bl[jl]=null;for(;e===ya;)ya=Rt[--Mt],Rt[Mt]=null,$t=Rt[--Mt],Rt[Mt]=null,Yt=Rt[--Mt],Rt[Mt]=null}function Co(e,t){Rt[Mt++]=Yt,Rt[Mt++]=$t,Rt[Mt++]=ya,Yt=t.id,$t=t.overflow,ya=e}var Ie=null,ze=null,ye=!1,pa=null,_t=!1,xr=Error(c(519));function va(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw mn(At(t,e)),xr}function To(e){var t=e.stateNode,a=e.type,l=e.memoizedProps;switch(t[Pe]=e,t[ct]=l,a){case"dialog":xe("cancel",t),xe("close",t);break;case"iframe":case"object":case"embed":xe("load",t);break;case"video":case"audio":for(a=0;a<Un.length;a++)xe(Un[a],t);break;case"source":xe("error",t);break;case"img":case"image":case"link":xe("error",t),xe("load",t);break;case"details":xe("toggle",t);break;case"input":xe("invalid",t),Bu(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":xe("invalid",t);break;case"textarea":xe("invalid",t),Yu(t,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||l.suppressHydrationWarning===!0||Vf(t.textContent,a)?(l.popover!=null&&(xe("beforetoggle",t),xe("toggle",t)),l.onScroll!=null&&xe("scroll",t),l.onScrollEnd!=null&&xe("scrollend",t),l.onClick!=null&&(t.onclick=Jt),t=!0):t=!1,t||va(e,!0)}function wo(e){for(Ie=e.return;Ie;)switch(Ie.tag){case 5:case 31:case 13:_t=!1;return;case 27:case 3:_t=!0;return;default:Ie=Ie.return}}function Nl(e){if(e!==Ie)return!1;if(!ye)return wo(e),ye=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||zc(e.type,e.memoizedProps)),a=!a),a&&ze&&va(e),wo(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));ze=If(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));ze=If(e)}else t===27?(t=ze,Oa(e.type)?(e=Hc,Hc=null,ze=e):ze=t):ze=Ie?Ot(e.stateNode.nextSibling):null;return!0}function Ja(){ze=Ie=null,ye=!1}function hr(){var e=pa;return e!==null&&(mt===null?mt=e:mt.push.apply(mt,e),pa=null),e}function mn(e){pa===null?pa=[e]:pa.push(e)}var gr=b(null),Wa=null,It=null;function ba(e,t,a){Z(gr,t._currentValue),t._currentValue=a}function ea(e){e._currentValue=gr.current,Y(gr)}function yr(e,t,a){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===a)break;e=e.return}}function pr(e,t,a,l){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var i=s.dependencies;if(i!==null){var d=s.child;i=i.firstContext;e:for(;i!==null;){var h=i;i=s;for(var S=0;S<t.length;S++)if(h.context===t[S]){i.lanes|=a,h=i.alternate,h!==null&&(h.lanes|=a),yr(i.return,a,e),l||(d=null);break e}i=h.next}}else if(s.tag===18){if(d=s.return,d===null)throw Error(c(341));d.lanes|=a,i=d.alternate,i!==null&&(i.lanes|=a),yr(d,a,e),d=null}else d=s.child;if(d!==null)d.return=s;else for(d=s;d!==null;){if(d===e){d=null;break}if(s=d.sibling,s!==null){s.return=d.return,d=s;break}d=d.return}s=d}}function Sl(e,t,a,l){e=null;for(var s=t,i=!1;s!==null;){if(!i){if((s.flags&524288)!==0)i=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var d=s.alternate;if(d===null)throw Error(c(387));if(d=d.memoizedProps,d!==null){var h=s.type;pt(s.pendingProps.value,d.value)||(e!==null?e.push(h):e=[h])}}else if(s===F.current){if(d=s.alternate,d===null)throw Error(c(387));d.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(Yn):e=[Yn])}s=s.return}e!==null&&pr(t,e,a,l),t.flags|=262144}function Ss(e){for(e=e.firstContext;e!==null;){if(!pt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Fa(e){Wa=e,It=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function et(e){return Ao(Wa,e)}function Es(e,t){return Wa===null&&Fa(e),Ao(e,t)}function Ao(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},It===null){if(e===null)throw Error(c(308));It=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else It=It.next=t;return a}var Lx=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Hx=r.unstable_scheduleCallback,Bx=r.unstable_NormalPriority,Ve={$$typeof:L,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function vr(){return{controller:new Lx,data:new Map,refCount:0}}function xn(e){e.refCount--,e.refCount===0&&Hx(Bx,function(){e.controller.abort()})}var hn=null,br=0,El=0,Cl=null;function qx(e,t){if(hn===null){var a=hn=[];br=0,El=Sc(),Cl={status:"pending",value:void 0,then:function(l){a.push(l)}}}return br++,t.then(Ro,Ro),t}function Ro(){if(--br===0&&hn!==null){Cl!==null&&(Cl.status="fulfilled");var e=hn;hn=null,El=0,Cl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Yx(e,t){var a=[],l={status:"pending",value:null,reason:null,then:function(s){a.push(s)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var s=0;s<a.length;s++)(0,a[s])(t)},function(s){for(l.status="rejected",l.reason=s,s=0;s<a.length;s++)(0,a[s])(void 0)}),l}var Mo=H.S;H.S=function(e,t){xf=ht(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&qx(e,t),Mo!==null&&Mo(e,t)};var Pa=b(null);function jr(){var e=Pa.current;return e!==null?e:Me.pooledCache}function Cs(e,t){t===null?Z(Pa,Pa.current):Z(Pa,t.pool)}function _o(){var e=jr();return e===null?null:{parent:Ve._currentValue,pool:e}}var Tl=Error(c(460)),Nr=Error(c(474)),Ts=Error(c(542)),ws={then:function(){}};function zo(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Oo(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Jt,Jt),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Uo(e),e;default:if(typeof t.status=="string")t.then(Jt,Jt);else{if(e=Me,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=l}},function(l){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Uo(e),e}throw el=t,Tl}}function Ia(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(el=a,Tl):a}}var el=null;function Do(){if(el===null)throw Error(c(459));var e=el;return el=null,e}function Uo(e){if(e===Tl||e===Ts)throw Error(c(483))}var wl=null,gn=0;function As(e){var t=gn;return gn+=1,wl===null&&(wl=[]),Oo(wl,e,t)}function yn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Rs(e,t){throw t.$$typeof===E?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Lo(e){function t(w,C){if(e){var R=w.deletions;R===null?(w.deletions=[C],w.flags|=16):R.push(C)}}function a(w,C){if(!e)return null;for(;C!==null;)t(w,C),C=C.sibling;return null}function l(w){for(var C=new Map;w!==null;)w.key!==null?C.set(w.key,w):C.set(w.index,w),w=w.sibling;return C}function s(w,C){return w=Ft(w,C),w.index=0,w.sibling=null,w}function i(w,C,R){return w.index=R,e?(R=w.alternate,R!==null?(R=R.index,R<C?(w.flags|=67108866,C):R):(w.flags|=67108866,C)):(w.flags|=1048576,C)}function d(w){return e&&w.alternate===null&&(w.flags|=67108866),w}function h(w,C,R,k){return C===null||C.tag!==6?(C=or(R,w.mode,k),C.return=w,C):(C=s(C,R),C.return=w,C)}function S(w,C,R,k){var ae=R.type;return ae===O?B(w,C,R.props.children,k,R.key):C!==null&&(C.elementType===ae||typeof ae=="object"&&ae!==null&&ae.$$typeof===X&&Ia(ae)===C.type)?(C=s(C,R.props),yn(C,R),C.return=w,C):(C=js(R.type,R.key,R.props,null,w.mode,k),yn(C,R),C.return=w,C)}function M(w,C,R,k){return C===null||C.tag!==4||C.stateNode.containerInfo!==R.containerInfo||C.stateNode.implementation!==R.implementation?(C=dr(R,w.mode,k),C.return=w,C):(C=s(C,R.children||[]),C.return=w,C)}function B(w,C,R,k,ae){return C===null||C.tag!==7?(C=Ka(R,w.mode,k,ae),C.return=w,C):(C=s(C,R),C.return=w,C)}function G(w,C,R){if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return C=or(""+C,w.mode,R),C.return=w,C;if(typeof C=="object"&&C!==null){switch(C.$$typeof){case _:return R=js(C.type,C.key,C.props,null,w.mode,R),yn(R,C),R.return=w,R;case U:return C=dr(C,w.mode,R),C.return=w,C;case X:return C=Ia(C),G(w,C,R)}if(Ee(C)||Se(C))return C=Ka(C,w.mode,R,null),C.return=w,C;if(typeof C.then=="function")return G(w,As(C),R);if(C.$$typeof===L)return G(w,Es(w,C),R);Rs(w,C)}return null}function z(w,C,R,k){var ae=C!==null?C.key:null;if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return ae!==null?null:h(w,C,""+R,k);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case _:return R.key===ae?S(w,C,R,k):null;case U:return R.key===ae?M(w,C,R,k):null;case X:return R=Ia(R),z(w,C,R,k)}if(Ee(R)||Se(R))return ae!==null?null:B(w,C,R,k,null);if(typeof R.then=="function")return z(w,C,As(R),k);if(R.$$typeof===L)return z(w,C,Es(w,R),k);Rs(w,R)}return null}function D(w,C,R,k,ae){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return w=w.get(R)||null,h(C,w,""+k,ae);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case _:return w=w.get(k.key===null?R:k.key)||null,S(C,w,k,ae);case U:return w=w.get(k.key===null?R:k.key)||null,M(C,w,k,ae);case X:return k=Ia(k),D(w,C,R,k,ae)}if(Ee(k)||Se(k))return w=w.get(R)||null,B(C,w,k,ae,null);if(typeof k.then=="function")return D(w,C,R,As(k),ae);if(k.$$typeof===L)return D(w,C,R,Es(C,k),ae);Rs(C,k)}return null}function J(w,C,R,k){for(var ae=null,ve=null,I=C,oe=C=0,ge=null;I!==null&&oe<R.length;oe++){I.index>oe?(ge=I,I=null):ge=I.sibling;var be=z(w,I,R[oe],k);if(be===null){I===null&&(I=ge);break}e&&I&&be.alternate===null&&t(w,I),C=i(be,C,oe),ve===null?ae=be:ve.sibling=be,ve=be,I=ge}if(oe===R.length)return a(w,I),ye&&Pt(w,oe),ae;if(I===null){for(;oe<R.length;oe++)I=G(w,R[oe],k),I!==null&&(C=i(I,C,oe),ve===null?ae=I:ve.sibling=I,ve=I);return ye&&Pt(w,oe),ae}for(I=l(I);oe<R.length;oe++)ge=D(I,w,oe,R[oe],k),ge!==null&&(e&&ge.alternate!==null&&I.delete(ge.key===null?oe:ge.key),C=i(ge,C,oe),ve===null?ae=ge:ve.sibling=ge,ve=ge);return e&&I.forEach(function(Ba){return t(w,Ba)}),ye&&Pt(w,oe),ae}function ne(w,C,R,k){if(R==null)throw Error(c(151));for(var ae=null,ve=null,I=C,oe=C=0,ge=null,be=R.next();I!==null&&!be.done;oe++,be=R.next()){I.index>oe?(ge=I,I=null):ge=I.sibling;var Ba=z(w,I,be.value,k);if(Ba===null){I===null&&(I=ge);break}e&&I&&Ba.alternate===null&&t(w,I),C=i(Ba,C,oe),ve===null?ae=Ba:ve.sibling=Ba,ve=Ba,I=ge}if(be.done)return a(w,I),ye&&Pt(w,oe),ae;if(I===null){for(;!be.done;oe++,be=R.next())be=G(w,be.value,k),be!==null&&(C=i(be,C,oe),ve===null?ae=be:ve.sibling=be,ve=be);return ye&&Pt(w,oe),ae}for(I=l(I);!be.done;oe++,be=R.next())be=D(I,w,oe,be.value,k),be!==null&&(e&&be.alternate!==null&&I.delete(be.key===null?oe:be.key),C=i(be,C,oe),ve===null?ae=be:ve.sibling=be,ve=be);return e&&I.forEach(function(Fh){return t(w,Fh)}),ye&&Pt(w,oe),ae}function Re(w,C,R,k){if(typeof R=="object"&&R!==null&&R.type===O&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case _:e:{for(var ae=R.key;C!==null;){if(C.key===ae){if(ae=R.type,ae===O){if(C.tag===7){a(w,C.sibling),k=s(C,R.props.children),k.return=w,w=k;break e}}else if(C.elementType===ae||typeof ae=="object"&&ae!==null&&ae.$$typeof===X&&Ia(ae)===C.type){a(w,C.sibling),k=s(C,R.props),yn(k,R),k.return=w,w=k;break e}a(w,C);break}else t(w,C);C=C.sibling}R.type===O?(k=Ka(R.props.children,w.mode,k,R.key),k.return=w,w=k):(k=js(R.type,R.key,R.props,null,w.mode,k),yn(k,R),k.return=w,w=k)}return d(w);case U:e:{for(ae=R.key;C!==null;){if(C.key===ae)if(C.tag===4&&C.stateNode.containerInfo===R.containerInfo&&C.stateNode.implementation===R.implementation){a(w,C.sibling),k=s(C,R.children||[]),k.return=w,w=k;break e}else{a(w,C);break}else t(w,C);C=C.sibling}k=dr(R,w.mode,k),k.return=w,w=k}return d(w);case X:return R=Ia(R),Re(w,C,R,k)}if(Ee(R))return J(w,C,R,k);if(Se(R)){if(ae=Se(R),typeof ae!="function")throw Error(c(150));return R=ae.call(R),ne(w,C,R,k)}if(typeof R.then=="function")return Re(w,C,As(R),k);if(R.$$typeof===L)return Re(w,C,Es(w,R),k);Rs(w,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,C!==null&&C.tag===6?(a(w,C.sibling),k=s(C,R),k.return=w,w=k):(a(w,C),k=or(R,w.mode,k),k.return=w,w=k),d(w)):a(w,C)}return function(w,C,R,k){try{gn=0;var ae=Re(w,C,R,k);return wl=null,ae}catch(I){if(I===Tl||I===Ts)throw I;var ve=vt(29,I,null,w.mode);return ve.lanes=k,ve.return=w,ve}}}var tl=Lo(!0),Ho=Lo(!1),ja=!1;function Sr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Er(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Na(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Sa(e,t,a){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ne&2)!==0){var s=l.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),l.pending=t,t=bs(e),bo(e,null,a),t}return vs(e,l,t,a),bs(e)}function pn(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,wu(e,a)}}function Cr(e,t){var a=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var s=null,i=null;if(a=a.firstBaseUpdate,a!==null){do{var d={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};i===null?s=i=d:i=i.next=d,a=a.next}while(a!==null);i===null?s=i=t:i=i.next=t}else s=i=t;a={baseState:l.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:l.shared,callbacks:l.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Tr=!1;function vn(){if(Tr){var e=Cl;if(e!==null)throw e}}function bn(e,t,a,l){Tr=!1;var s=e.updateQueue;ja=!1;var i=s.firstBaseUpdate,d=s.lastBaseUpdate,h=s.shared.pending;if(h!==null){s.shared.pending=null;var S=h,M=S.next;S.next=null,d===null?i=M:d.next=M,d=S;var B=e.alternate;B!==null&&(B=B.updateQueue,h=B.lastBaseUpdate,h!==d&&(h===null?B.firstBaseUpdate=M:h.next=M,B.lastBaseUpdate=S))}if(i!==null){var G=s.baseState;d=0,B=M=S=null,h=i;do{var z=h.lane&-536870913,D=z!==h.lane;if(D?(he&z)===z:(l&z)===z){z!==0&&z===El&&(Tr=!0),B!==null&&(B=B.next={lane:0,tag:h.tag,payload:h.payload,callback:null,next:null});e:{var J=e,ne=h;z=t;var Re=a;switch(ne.tag){case 1:if(J=ne.payload,typeof J=="function"){G=J.call(Re,G,z);break e}G=J;break e;case 3:J.flags=J.flags&-65537|128;case 0:if(J=ne.payload,z=typeof J=="function"?J.call(Re,G,z):J,z==null)break e;G=y({},G,z);break e;case 2:ja=!0}}z=h.callback,z!==null&&(e.flags|=64,D&&(e.flags|=8192),D=s.callbacks,D===null?s.callbacks=[z]:D.push(z))}else D={lane:z,tag:h.tag,payload:h.payload,callback:h.callback,next:null},B===null?(M=B=D,S=G):B=B.next=D,d|=z;if(h=h.next,h===null){if(h=s.shared.pending,h===null)break;D=h,h=D.next,D.next=null,s.lastBaseUpdate=D,s.shared.pending=null}}while(!0);B===null&&(S=G),s.baseState=S,s.firstBaseUpdate=M,s.lastBaseUpdate=B,i===null&&(s.shared.lanes=0),Aa|=d,e.lanes=d,e.memoizedState=G}}function Bo(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function qo(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Bo(a[e],t)}var Al=b(null),Ms=b(0);function Yo(e,t){e=ua,Z(Ms,e),Z(Al,t),ua=e|t.baseLanes}function wr(){Z(Ms,ua),Z(Al,Al.current)}function Ar(){ua=Ms.current,Y(Al),Y(Ms)}var bt=b(null),zt=null;function Ea(e){var t=e.alternate;Z(Ye,Ye.current&1),Z(bt,e),zt===null&&(t===null||Al.current!==null||t.memoizedState!==null)&&(zt=e)}function Rr(e){Z(Ye,Ye.current),Z(bt,e),zt===null&&(zt=e)}function $o(e){e.tag===22?(Z(Ye,Ye.current),Z(bt,e),zt===null&&(zt=e)):Ca()}function Ca(){Z(Ye,Ye.current),Z(bt,bt.current)}function jt(e){Y(bt),zt===e&&(zt=null),Y(Ye)}var Ye=b(0);function _s(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Uc(a)||Lc(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ta=0,ue=null,we=null,Xe=null,zs=!1,Rl=!1,al=!1,Os=0,jn=0,Ml=null,$x=0;function He(){throw Error(c(321))}function Mr(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!pt(e[a],t[a]))return!1;return!0}function _r(e,t,a,l,s,i){return ta=i,ue=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,H.H=e===null||e.memoizedState===null?Ed:Qr,al=!1,i=a(l,s),al=!1,Rl&&(i=Go(t,a,l,s)),ko(e),i}function ko(e){H.H=En;var t=we!==null&&we.next!==null;if(ta=0,Xe=we=ue=null,zs=!1,jn=0,Ml=null,t)throw Error(c(300));e===null||Qe||(e=e.dependencies,e!==null&&Ss(e)&&(Qe=!0))}function Go(e,t,a,l){ue=e;var s=0;do{if(Rl&&(Ml=null),jn=0,Rl=!1,25<=s)throw Error(c(301));if(s+=1,Xe=we=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}H.H=Cd,i=t(a,l)}while(Rl);return i}function kx(){var e=H.H,t=e.useState()[0];return t=typeof t.then=="function"?Nn(t):t,e=e.useState()[0],(we!==null?we.memoizedState:null)!==e&&(ue.flags|=1024),t}function zr(){var e=Os!==0;return Os=0,e}function Or(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Dr(e){if(zs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}zs=!1}ta=0,Xe=we=ue=null,Rl=!1,jn=Os=0,Ml=null}function it(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xe===null?ue.memoizedState=Xe=e:Xe=Xe.next=e,Xe}function $e(){if(we===null){var e=ue.alternate;e=e!==null?e.memoizedState:null}else e=we.next;var t=Xe===null?ue.memoizedState:Xe.next;if(t!==null)Xe=t,we=e;else{if(e===null)throw ue.alternate===null?Error(c(467)):Error(c(310));we=e,e={memoizedState:we.memoizedState,baseState:we.baseState,baseQueue:we.baseQueue,queue:we.queue,next:null},Xe===null?ue.memoizedState=Xe=e:Xe=Xe.next=e}return Xe}function Ds(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Nn(e){var t=jn;return jn+=1,Ml===null&&(Ml=[]),e=Oo(Ml,e,t),t=ue,(Xe===null?t.memoizedState:Xe.next)===null&&(t=t.alternate,H.H=t===null||t.memoizedState===null?Ed:Qr),e}function Us(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Nn(e);if(e.$$typeof===L)return et(e)}throw Error(c(438,String(e)))}function Ur(e){var t=null,a=ue.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var l=ue.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Ds(),ue.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),l=0;l<e;l++)a[l]=ee;return t.index++,a}function aa(e,t){return typeof t=="function"?t(e):t}function Ls(e){var t=$e();return Lr(t,we,e)}function Lr(e,t,a){var l=e.queue;if(l===null)throw Error(c(311));l.lastRenderedReducer=a;var s=e.baseQueue,i=l.pending;if(i!==null){if(s!==null){var d=s.next;s.next=i.next,i.next=d}t.baseQueue=s=i,l.pending=null}if(i=e.baseState,s===null)e.memoizedState=i;else{t=s.next;var h=d=null,S=null,M=t,B=!1;do{var G=M.lane&-536870913;if(G!==M.lane?(he&G)===G:(ta&G)===G){var z=M.revertLane;if(z===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null}),G===El&&(B=!0);else if((ta&z)===z){M=M.next,z===El&&(B=!0);continue}else G={lane:0,revertLane:M.revertLane,gesture:null,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null},S===null?(h=S=G,d=i):S=S.next=G,ue.lanes|=z,Aa|=z;G=M.action,al&&a(i,G),i=M.hasEagerState?M.eagerState:a(i,G)}else z={lane:G,revertLane:M.revertLane,gesture:M.gesture,action:M.action,hasEagerState:M.hasEagerState,eagerState:M.eagerState,next:null},S===null?(h=S=z,d=i):S=S.next=z,ue.lanes|=G,Aa|=G;M=M.next}while(M!==null&&M!==t);if(S===null?d=i:S.next=h,!pt(i,e.memoizedState)&&(Qe=!0,B&&(a=Cl,a!==null)))throw a;e.memoizedState=i,e.baseState=d,e.baseQueue=S,l.lastRenderedState=i}return s===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Hr(e){var t=$e(),a=t.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=e;var l=a.dispatch,s=a.pending,i=t.memoizedState;if(s!==null){a.pending=null;var d=s=s.next;do i=e(i,d.action),d=d.next;while(d!==s);pt(i,t.memoizedState)||(Qe=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),a.lastRenderedState=i}return[i,l]}function Vo(e,t,a){var l=ue,s=$e(),i=ye;if(i){if(a===void 0)throw Error(c(407));a=a()}else a=t();var d=!pt((we||s).memoizedState,a);if(d&&(s.memoizedState=a,Qe=!0),s=s.queue,Yr(Zo.bind(null,l,s,e),[e]),s.getSnapshot!==t||d||Xe!==null&&Xe.memoizedState.tag&1){if(l.flags|=2048,_l(9,{destroy:void 0},Qo.bind(null,l,s,a,t),null),Me===null)throw Error(c(349));i||(ta&127)!==0||Xo(l,t,a)}return a}function Xo(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=ue.updateQueue,t===null?(t=Ds(),ue.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Qo(e,t,a,l){t.value=a,t.getSnapshot=l,Ko(t)&&Jo(e)}function Zo(e,t,a){return a(function(){Ko(t)&&Jo(e)})}function Ko(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!pt(e,a)}catch{return!0}}function Jo(e){var t=Za(e,2);t!==null&&xt(t,e,2)}function Br(e){var t=it();if(typeof e=="function"){var a=e;if(e=a(),al){xa(!0);try{a()}finally{xa(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:aa,lastRenderedState:e},t}function Wo(e,t,a,l){return e.baseState=a,Lr(e,we,typeof l=="function"?l:aa)}function Gx(e,t,a,l,s){if(qs(e))throw Error(c(485));if(e=t.action,e!==null){var i={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){i.listeners.push(d)}};H.T!==null?a(!0):i.isTransition=!1,l(i),a=t.pending,a===null?(i.next=t.pending=i,Fo(t,i)):(i.next=a.next,t.pending=a.next=i)}}function Fo(e,t){var a=t.action,l=t.payload,s=e.state;if(t.isTransition){var i=H.T,d={};H.T=d;try{var h=a(s,l),S=H.S;S!==null&&S(d,h),Po(e,t,h)}catch(M){qr(e,t,M)}finally{i!==null&&d.types!==null&&(i.types=d.types),H.T=i}}else try{i=a(s,l),Po(e,t,i)}catch(M){qr(e,t,M)}}function Po(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){Io(e,t,l)},function(l){return qr(e,t,l)}):Io(e,t,a)}function Io(e,t,a){t.status="fulfilled",t.value=a,ed(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Fo(e,a)))}function qr(e,t,a){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=a,ed(t),t=t.next;while(t!==l)}e.action=null}function ed(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function td(e,t){return t}function ad(e,t){if(ye){var a=Me.formState;if(a!==null){e:{var l=ue;if(ye){if(ze){t:{for(var s=ze,i=_t;s.nodeType!==8;){if(!i){s=null;break t}if(s=Ot(s.nextSibling),s===null){s=null;break t}}i=s.data,s=i==="F!"||i==="F"?s:null}if(s){ze=Ot(s.nextSibling),l=s.data==="F!";break e}}va(l)}l=!1}l&&(t=a[0])}}return a=it(),a.memoizedState=a.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:td,lastRenderedState:t},a.queue=l,a=jd.bind(null,ue,l),l.dispatch=a,l=Br(!1),i=Xr.bind(null,ue,!1,l.queue),l=it(),s={state:t,dispatch:null,action:e,pending:null},l.queue=s,a=Gx.bind(null,ue,s,i,a),s.dispatch=a,l.memoizedState=e,[t,a,!1]}function ld(e){var t=$e();return nd(t,we,e)}function nd(e,t,a){if(t=Lr(e,t,td)[0],e=Ls(aa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Nn(t)}catch(d){throw d===Tl?Ts:d}else l=t;t=$e();var s=t.queue,i=s.dispatch;return a!==t.memoizedState&&(ue.flags|=2048,_l(9,{destroy:void 0},Vx.bind(null,s,a),null)),[l,i,e]}function Vx(e,t){e.action=t}function sd(e){var t=$e(),a=we;if(a!==null)return nd(t,a,e);$e(),t=t.memoizedState,a=$e();var l=a.queue.dispatch;return a.memoizedState=e,[t,l,!1]}function _l(e,t,a,l){return e={tag:e,create:a,deps:l,inst:t,next:null},t=ue.updateQueue,t===null&&(t=Ds(),ue.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(l=a.next,a.next=e,e.next=l,t.lastEffect=e),e}function id(){return $e().memoizedState}function Hs(e,t,a,l){var s=it();ue.flags|=e,s.memoizedState=_l(1|t,{destroy:void 0},a,l===void 0?null:l)}function Bs(e,t,a,l){var s=$e();l=l===void 0?null:l;var i=s.memoizedState.inst;we!==null&&l!==null&&Mr(l,we.memoizedState.deps)?s.memoizedState=_l(t,i,a,l):(ue.flags|=e,s.memoizedState=_l(1|t,i,a,l))}function rd(e,t){Hs(8390656,8,e,t)}function Yr(e,t){Bs(2048,8,e,t)}function Xx(e){ue.flags|=4;var t=ue.updateQueue;if(t===null)t=Ds(),ue.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function cd(e){var t=$e().memoizedState;return Xx({ref:t,nextImpl:e}),function(){if((Ne&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function ud(e,t){return Bs(4,2,e,t)}function od(e,t){return Bs(4,4,e,t)}function dd(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function fd(e,t,a){a=a!=null?a.concat([e]):null,Bs(4,4,dd.bind(null,t,e),a)}function $r(){}function md(e,t){var a=$e();t=t===void 0?null:t;var l=a.memoizedState;return t!==null&&Mr(t,l[1])?l[0]:(a.memoizedState=[e,t],e)}function xd(e,t){var a=$e();t=t===void 0?null:t;var l=a.memoizedState;if(t!==null&&Mr(t,l[1]))return l[0];if(l=e(),al){xa(!0);try{e()}finally{xa(!1)}}return a.memoizedState=[l,t],l}function kr(e,t,a){return a===void 0||(ta&1073741824)!==0&&(he&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=gf(),ue.lanes|=e,Aa|=e,a)}function hd(e,t,a,l){return pt(a,t)?a:Al.current!==null?(e=kr(e,a,l),pt(e,t)||(Qe=!0),e):(ta&42)===0||(ta&1073741824)!==0&&(he&261930)===0?(Qe=!0,e.memoizedState=a):(e=gf(),ue.lanes|=e,Aa|=e,t)}function gd(e,t,a,l,s){var i=Q.p;Q.p=i!==0&&8>i?i:8;var d=H.T,h={};H.T=h,Xr(e,!1,t,a);try{var S=s(),M=H.S;if(M!==null&&M(h,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var B=Yx(S,l);Sn(e,t,B,Et(e))}else Sn(e,t,l,Et(e))}catch(G){Sn(e,t,{then:function(){},status:"rejected",reason:G},Et())}finally{Q.p=i,d!==null&&h.types!==null&&(d.types=h.types),H.T=d}}function Qx(){}function Gr(e,t,a,l){if(e.tag!==5)throw Error(c(476));var s=yd(e).queue;gd(e,s,t,le,a===null?Qx:function(){return pd(e),a(l)})}function yd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:aa,lastRenderedState:le},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:aa,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function pd(e){var t=yd(e);t.next===null&&(t=e.alternate.memoizedState),Sn(e,t.next.queue,{},Et())}function Vr(){return et(Yn)}function vd(){return $e().memoizedState}function bd(){return $e().memoizedState}function Zx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Et();e=Na(a);var l=Sa(t,e,a);l!==null&&(xt(l,t,a),pn(l,t,a)),t={cache:vr()},e.payload=t;return}t=t.return}}function Kx(e,t,a){var l=Et();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},qs(e)?Nd(t,a):(a=cr(e,t,a,l),a!==null&&(xt(a,e,l),Sd(a,t,l)))}function jd(e,t,a){var l=Et();Sn(e,t,a,l)}function Sn(e,t,a,l){var s={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(qs(e))Nd(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var d=t.lastRenderedState,h=i(d,a);if(s.hasEagerState=!0,s.eagerState=h,pt(h,d))return vs(e,t,s,0),Me===null&&ps(),!1}catch{}if(a=cr(e,t,s,l),a!==null)return xt(a,e,l),Sd(a,t,l),!0}return!1}function Xr(e,t,a,l){if(l={lane:2,revertLane:Sc(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},qs(e)){if(t)throw Error(c(479))}else t=cr(e,a,l,2),t!==null&&xt(t,e,2)}function qs(e){var t=e.alternate;return e===ue||t!==null&&t===ue}function Nd(e,t){Rl=zs=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Sd(e,t,a){if((a&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,wu(e,a)}}var En={readContext:et,use:Us,useCallback:He,useContext:He,useEffect:He,useImperativeHandle:He,useLayoutEffect:He,useInsertionEffect:He,useMemo:He,useReducer:He,useRef:He,useState:He,useDebugValue:He,useDeferredValue:He,useTransition:He,useSyncExternalStore:He,useId:He,useHostTransitionStatus:He,useFormState:He,useActionState:He,useOptimistic:He,useMemoCache:He,useCacheRefresh:He};En.useEffectEvent=He;var Ed={readContext:et,use:Us,useCallback:function(e,t){return it().memoizedState=[e,t===void 0?null:t],e},useContext:et,useEffect:rd,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Hs(4194308,4,dd.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Hs(4194308,4,e,t)},useInsertionEffect:function(e,t){Hs(4,2,e,t)},useMemo:function(e,t){var a=it();t=t===void 0?null:t;var l=e();if(al){xa(!0);try{e()}finally{xa(!1)}}return a.memoizedState=[l,t],l},useReducer:function(e,t,a){var l=it();if(a!==void 0){var s=a(t);if(al){xa(!0);try{a(t)}finally{xa(!1)}}}else s=t;return l.memoizedState=l.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},l.queue=e,e=e.dispatch=Kx.bind(null,ue,e),[l.memoizedState,e]},useRef:function(e){var t=it();return e={current:e},t.memoizedState=e},useState:function(e){e=Br(e);var t=e.queue,a=jd.bind(null,ue,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:$r,useDeferredValue:function(e,t){var a=it();return kr(a,e,t)},useTransition:function(){var e=Br(!1);return e=gd.bind(null,ue,e.queue,!0,!1),it().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var l=ue,s=it();if(ye){if(a===void 0)throw Error(c(407));a=a()}else{if(a=t(),Me===null)throw Error(c(349));(he&127)!==0||Xo(l,t,a)}s.memoizedState=a;var i={value:a,getSnapshot:t};return s.queue=i,rd(Zo.bind(null,l,i,e),[e]),l.flags|=2048,_l(9,{destroy:void 0},Qo.bind(null,l,i,a,t),null),a},useId:function(){var e=it(),t=Me.identifierPrefix;if(ye){var a=$t,l=Yt;a=(l&~(1<<32-yt(l)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Os++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=$x++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Vr,useFormState:ad,useActionState:ad,useOptimistic:function(e){var t=it();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Xr.bind(null,ue,!0,a),a.dispatch=t,[e,t]},useMemoCache:Ur,useCacheRefresh:function(){return it().memoizedState=Zx.bind(null,ue)},useEffectEvent:function(e){var t=it(),a={impl:e};return t.memoizedState=a,function(){if((Ne&2)!==0)throw Error(c(440));return a.impl.apply(void 0,arguments)}}},Qr={readContext:et,use:Us,useCallback:md,useContext:et,useEffect:Yr,useImperativeHandle:fd,useInsertionEffect:ud,useLayoutEffect:od,useMemo:xd,useReducer:Ls,useRef:id,useState:function(){return Ls(aa)},useDebugValue:$r,useDeferredValue:function(e,t){var a=$e();return hd(a,we.memoizedState,e,t)},useTransition:function(){var e=Ls(aa)[0],t=$e().memoizedState;return[typeof e=="boolean"?e:Nn(e),t]},useSyncExternalStore:Vo,useId:vd,useHostTransitionStatus:Vr,useFormState:ld,useActionState:ld,useOptimistic:function(e,t){var a=$e();return Wo(a,we,e,t)},useMemoCache:Ur,useCacheRefresh:bd};Qr.useEffectEvent=cd;var Cd={readContext:et,use:Us,useCallback:md,useContext:et,useEffect:Yr,useImperativeHandle:fd,useInsertionEffect:ud,useLayoutEffect:od,useMemo:xd,useReducer:Hr,useRef:id,useState:function(){return Hr(aa)},useDebugValue:$r,useDeferredValue:function(e,t){var a=$e();return we===null?kr(a,e,t):hd(a,we.memoizedState,e,t)},useTransition:function(){var e=Hr(aa)[0],t=$e().memoizedState;return[typeof e=="boolean"?e:Nn(e),t]},useSyncExternalStore:Vo,useId:vd,useHostTransitionStatus:Vr,useFormState:sd,useActionState:sd,useOptimistic:function(e,t){var a=$e();return we!==null?Wo(a,we,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Ur,useCacheRefresh:bd};Cd.useEffectEvent=cd;function Zr(e,t,a,l){t=e.memoizedState,a=a(l,t),a=a==null?t:y({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Kr={enqueueSetState:function(e,t,a){e=e._reactInternals;var l=Et(),s=Na(l);s.payload=t,a!=null&&(s.callback=a),t=Sa(e,s,l),t!==null&&(xt(t,e,l),pn(t,e,l))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var l=Et(),s=Na(l);s.tag=1,s.payload=t,a!=null&&(s.callback=a),t=Sa(e,s,l),t!==null&&(xt(t,e,l),pn(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Et(),l=Na(a);l.tag=2,t!=null&&(l.callback=t),t=Sa(e,l,a),t!==null&&(xt(t,e,a),pn(t,e,a))}};function Td(e,t,a,l,s,i,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,i,d):t.prototype&&t.prototype.isPureReactComponent?!on(a,l)||!on(s,i):!0}function wd(e,t,a,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,l),t.state!==e&&Kr.enqueueReplaceState(t,t.state,null)}function ll(e,t){var a=t;if("ref"in t){a={};for(var l in t)l!=="ref"&&(a[l]=t[l])}if(e=e.defaultProps){a===t&&(a=y({},a));for(var s in e)a[s]===void 0&&(a[s]=e[s])}return a}function Ad(e){ys(e)}function Rd(e){console.error(e)}function Md(e){ys(e)}function Ys(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function _d(e,t,a){try{var l=e.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function Jr(e,t,a){return a=Na(a),a.tag=3,a.payload={element:null},a.callback=function(){Ys(e,t)},a}function zd(e){return e=Na(e),e.tag=3,e}function Od(e,t,a,l){var s=a.type.getDerivedStateFromError;if(typeof s=="function"){var i=l.value;e.payload=function(){return s(i)},e.callback=function(){_d(t,a,l)}}var d=a.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){_d(t,a,l),typeof s!="function"&&(Ra===null?Ra=new Set([this]):Ra.add(this));var h=l.stack;this.componentDidCatch(l.value,{componentStack:h!==null?h:""})})}function Jx(e,t,a,l,s){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=a.alternate,t!==null&&Sl(t,a,s,!0),a=bt.current,a!==null){switch(a.tag){case 31:case 13:return zt===null?Ps():a.alternate===null&&Be===0&&(Be=3),a.flags&=-257,a.flags|=65536,a.lanes=s,l===ws?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([l]):t.add(l),bc(e,l,s)),!1;case 22:return a.flags|=65536,l===ws?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([l]):a.add(l)),bc(e,l,s)),!1}throw Error(c(435,a.tag))}return bc(e,l,s),Ps(),!1}if(ye)return t=bt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,l!==xr&&(e=Error(c(422),{cause:l}),mn(At(e,a)))):(l!==xr&&(t=Error(c(423),{cause:l}),mn(At(t,a))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,l=At(l,a),s=Jr(e.stateNode,l,s),Cr(e,s),Be!==4&&(Be=2)),!1;var i=Error(c(520),{cause:l});if(i=At(i,a),zn===null?zn=[i]:zn.push(i),Be!==4&&(Be=2),t===null)return!0;l=At(l,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=s&-s,a.lanes|=e,e=Jr(a.stateNode,l,e),Cr(a,e),!1;case 1:if(t=a.type,i=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Ra===null||!Ra.has(i))))return a.flags|=65536,s&=-s,a.lanes|=s,s=zd(s),Od(s,e,a,l),Cr(a,s),!1}a=a.return}while(a!==null);return!1}var Wr=Error(c(461)),Qe=!1;function tt(e,t,a,l){t.child=e===null?Ho(t,null,a,l):tl(t,e.child,a,l)}function Dd(e,t,a,l,s){a=a.render;var i=t.ref;if("ref"in l){var d={};for(var h in l)h!=="ref"&&(d[h]=l[h])}else d=l;return Fa(t),l=_r(e,t,a,d,i,s),h=zr(),e!==null&&!Qe?(Or(e,t,s),la(e,t,s)):(ye&&h&&fr(t),t.flags|=1,tt(e,t,l,s),t.child)}function Ud(e,t,a,l,s){if(e===null){var i=a.type;return typeof i=="function"&&!ur(i)&&i.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=i,Ld(e,t,i,l,s)):(e=js(a.type,null,l,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!nc(e,s)){var d=i.memoizedProps;if(a=a.compare,a=a!==null?a:on,a(d,l)&&e.ref===t.ref)return la(e,t,s)}return t.flags|=1,e=Ft(i,l),e.ref=t.ref,e.return=t,t.child=e}function Ld(e,t,a,l,s){if(e!==null){var i=e.memoizedProps;if(on(i,l)&&e.ref===t.ref)if(Qe=!1,t.pendingProps=l=i,nc(e,s))(e.flags&131072)!==0&&(Qe=!0);else return t.lanes=e.lanes,la(e,t,s)}return Fr(e,t,a,l,s)}function Hd(e,t,a,l){var s=l.children,i=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(i=i!==null?i.baseLanes|a:a,e!==null){for(l=t.child=e.child,s=0;l!==null;)s=s|l.lanes|l.childLanes,l=l.sibling;l=s&~i}else l=0,t.child=null;return Bd(e,t,i,a,l)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Cs(t,i!==null?i.cachePool:null),i!==null?Yo(t,i):wr(),$o(t);else return l=t.lanes=536870912,Bd(e,t,i!==null?i.baseLanes|a:a,a,l)}else i!==null?(Cs(t,i.cachePool),Yo(t,i),Ca(),t.memoizedState=null):(e!==null&&Cs(t,null),wr(),Ca());return tt(e,t,s,a),t.child}function Cn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Bd(e,t,a,l,s){var i=jr();return i=i===null?null:{parent:Ve._currentValue,pool:i},t.memoizedState={baseLanes:a,cachePool:i},e!==null&&Cs(t,null),wr(),$o(t),e!==null&&Sl(e,t,l,!0),t.childLanes=s,null}function $s(e,t){return t=Gs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function qd(e,t,a){return tl(t,e.child,null,a),e=$s(t,t.pendingProps),e.flags|=2,jt(t),t.memoizedState=null,e}function Wx(e,t,a){var l=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ye){if(l.mode==="hidden")return e=$s(t,l),t.lanes=536870912,Cn(null,e);if(Rr(t),(e=ze)?(e=Pf(e,_t),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ya!==null?{id:Yt,overflow:$t}:null,retryLane:536870912,hydrationErrors:null},a=No(e),a.return=t,t.child=a,Ie=t,ze=null)):e=null,e===null)throw va(t);return t.lanes=536870912,null}return $s(t,l)}var i=e.memoizedState;if(i!==null){var d=i.dehydrated;if(Rr(t),s)if(t.flags&256)t.flags&=-257,t=qd(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Qe||Sl(e,t,a,!1),s=(a&e.childLanes)!==0,Qe||s){if(l=Me,l!==null&&(d=Au(l,a),d!==0&&d!==i.retryLane))throw i.retryLane=d,Za(e,d),xt(l,e,d),Wr;Ps(),t=qd(e,t,a)}else e=i.treeContext,ze=Ot(d.nextSibling),Ie=t,ye=!0,pa=null,_t=!1,e!==null&&Co(t,e),t=$s(t,l),t.flags|=4096;return t}return e=Ft(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ks(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(c(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Fr(e,t,a,l,s){return Fa(t),a=_r(e,t,a,l,void 0,s),l=zr(),e!==null&&!Qe?(Or(e,t,s),la(e,t,s)):(ye&&l&&fr(t),t.flags|=1,tt(e,t,a,s),t.child)}function Yd(e,t,a,l,s,i){return Fa(t),t.updateQueue=null,a=Go(t,l,a,s),ko(e),l=zr(),e!==null&&!Qe?(Or(e,t,i),la(e,t,i)):(ye&&l&&fr(t),t.flags|=1,tt(e,t,a,i),t.child)}function $d(e,t,a,l,s){if(Fa(t),t.stateNode===null){var i=vl,d=a.contextType;typeof d=="object"&&d!==null&&(i=et(d)),i=new a(l,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Kr,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=l,i.state=t.memoizedState,i.refs={},Sr(t),d=a.contextType,i.context=typeof d=="object"&&d!==null?et(d):vl,i.state=t.memoizedState,d=a.getDerivedStateFromProps,typeof d=="function"&&(Zr(t,a,d,l),i.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(d=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),d!==i.state&&Kr.enqueueReplaceState(i,i.state,null),bn(t,l,i,s),vn(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){i=t.stateNode;var h=t.memoizedProps,S=ll(a,h);i.props=S;var M=i.context,B=a.contextType;d=vl,typeof B=="object"&&B!==null&&(d=et(B));var G=a.getDerivedStateFromProps;B=typeof G=="function"||typeof i.getSnapshotBeforeUpdate=="function",h=t.pendingProps!==h,B||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(h||M!==d)&&wd(t,i,l,d),ja=!1;var z=t.memoizedState;i.state=z,bn(t,l,i,s),vn(),M=t.memoizedState,h||z!==M||ja?(typeof G=="function"&&(Zr(t,a,G,l),M=t.memoizedState),(S=ja||Td(t,a,S,l,z,M,d))?(B||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=M),i.props=l,i.state=M,i.context=d,l=S):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{i=t.stateNode,Er(e,t),d=t.memoizedProps,B=ll(a,d),i.props=B,G=t.pendingProps,z=i.context,M=a.contextType,S=vl,typeof M=="object"&&M!==null&&(S=et(M)),h=a.getDerivedStateFromProps,(M=typeof h=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(d!==G||z!==S)&&wd(t,i,l,S),ja=!1,z=t.memoizedState,i.state=z,bn(t,l,i,s),vn();var D=t.memoizedState;d!==G||z!==D||ja||e!==null&&e.dependencies!==null&&Ss(e.dependencies)?(typeof h=="function"&&(Zr(t,a,h,l),D=t.memoizedState),(B=ja||Td(t,a,B,l,z,D,S)||e!==null&&e.dependencies!==null&&Ss(e.dependencies))?(M||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(l,D,S),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(l,D,S)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||d===e.memoizedProps&&z===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&z===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=D),i.props=l,i.state=D,i.context=S,l=B):(typeof i.componentDidUpdate!="function"||d===e.memoizedProps&&z===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&z===e.memoizedState||(t.flags|=1024),l=!1)}return i=l,ks(e,t),l=(t.flags&128)!==0,i||l?(i=t.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&l?(t.child=tl(t,e.child,null,s),t.child=tl(t,null,a,s)):tt(e,t,a,s),t.memoizedState=i.state,e=t.child):e=la(e,t,s),e}function kd(e,t,a,l){return Ja(),t.flags|=256,tt(e,t,a,l),t.child}var Pr={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ir(e){return{baseLanes:e,cachePool:_o()}}function ec(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=St),e}function Gd(e,t,a){var l=t.pendingProps,s=!1,i=(t.flags&128)!==0,d;if((d=i)||(d=e!==null&&e.memoizedState===null?!1:(Ye.current&2)!==0),d&&(s=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(ye){if(s?Ea(t):Ca(),(e=ze)?(e=Pf(e,_t),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ya!==null?{id:Yt,overflow:$t}:null,retryLane:536870912,hydrationErrors:null},a=No(e),a.return=t,t.child=a,Ie=t,ze=null)):e=null,e===null)throw va(t);return Lc(e)?t.lanes=32:t.lanes=536870912,null}var h=l.children;return l=l.fallback,s?(Ca(),s=t.mode,h=Gs({mode:"hidden",children:h},s),l=Ka(l,s,a,null),h.return=t,l.return=t,h.sibling=l,t.child=h,l=t.child,l.memoizedState=Ir(a),l.childLanes=ec(e,d,a),t.memoizedState=Pr,Cn(null,l)):(Ea(t),tc(t,h))}var S=e.memoizedState;if(S!==null&&(h=S.dehydrated,h!==null)){if(i)t.flags&256?(Ea(t),t.flags&=-257,t=ac(e,t,a)):t.memoizedState!==null?(Ca(),t.child=e.child,t.flags|=128,t=null):(Ca(),h=l.fallback,s=t.mode,l=Gs({mode:"visible",children:l.children},s),h=Ka(h,s,a,null),h.flags|=2,l.return=t,h.return=t,l.sibling=h,t.child=l,tl(t,e.child,null,a),l=t.child,l.memoizedState=Ir(a),l.childLanes=ec(e,d,a),t.memoizedState=Pr,t=Cn(null,l));else if(Ea(t),Lc(h)){if(d=h.nextSibling&&h.nextSibling.dataset,d)var M=d.dgst;d=M,l=Error(c(419)),l.stack="",l.digest=d,mn({value:l,source:null,stack:null}),t=ac(e,t,a)}else if(Qe||Sl(e,t,a,!1),d=(a&e.childLanes)!==0,Qe||d){if(d=Me,d!==null&&(l=Au(d,a),l!==0&&l!==S.retryLane))throw S.retryLane=l,Za(e,l),xt(d,e,l),Wr;Uc(h)||Ps(),t=ac(e,t,a)}else Uc(h)?(t.flags|=192,t.child=e.child,t=null):(e=S.treeContext,ze=Ot(h.nextSibling),Ie=t,ye=!0,pa=null,_t=!1,e!==null&&Co(t,e),t=tc(t,l.children),t.flags|=4096);return t}return s?(Ca(),h=l.fallback,s=t.mode,S=e.child,M=S.sibling,l=Ft(S,{mode:"hidden",children:l.children}),l.subtreeFlags=S.subtreeFlags&65011712,M!==null?h=Ft(M,h):(h=Ka(h,s,a,null),h.flags|=2),h.return=t,l.return=t,l.sibling=h,t.child=l,Cn(null,l),l=t.child,h=e.child.memoizedState,h===null?h=Ir(a):(s=h.cachePool,s!==null?(S=Ve._currentValue,s=s.parent!==S?{parent:S,pool:S}:s):s=_o(),h={baseLanes:h.baseLanes|a,cachePool:s}),l.memoizedState=h,l.childLanes=ec(e,d,a),t.memoizedState=Pr,Cn(e.child,l)):(Ea(t),a=e.child,e=a.sibling,a=Ft(a,{mode:"visible",children:l.children}),a.return=t,a.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=a,t.memoizedState=null,a)}function tc(e,t){return t=Gs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Gs(e,t){return e=vt(22,e,null,t),e.lanes=0,e}function ac(e,t,a){return tl(t,e.child,null,a),e=tc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Vd(e,t,a){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),yr(e.return,t,a)}function lc(e,t,a,l,s,i){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:s,treeForkCount:i}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=l,d.tail=a,d.tailMode=s,d.treeForkCount=i)}function Xd(e,t,a){var l=t.pendingProps,s=l.revealOrder,i=l.tail;l=l.children;var d=Ye.current,h=(d&2)!==0;if(h?(d=d&1|2,t.flags|=128):d&=1,Z(Ye,d),tt(e,t,l,a),l=ye?fn:0,!h&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Vd(e,a,t);else if(e.tag===19)Vd(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(s){case"forwards":for(a=t.child,s=null;a!==null;)e=a.alternate,e!==null&&_s(e)===null&&(s=a),a=a.sibling;a=s,a===null?(s=t.child,t.child=null):(s=a.sibling,a.sibling=null),lc(t,!1,s,a,i,l);break;case"backwards":case"unstable_legacy-backwards":for(a=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&_s(e)===null){t.child=s;break}e=s.sibling,s.sibling=a,a=s,s=e}lc(t,!0,a,null,i,l);break;case"together":lc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function la(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Aa|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Sl(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,a=Ft(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Ft(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function nc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ss(e)))}function Fx(e,t,a){switch(t.tag){case 3:Ke(t,t.stateNode.containerInfo),ba(t,Ve,e.memoizedState.cache),Ja();break;case 27:case 5:Wl(t);break;case 4:Ke(t,t.stateNode.containerInfo);break;case 10:ba(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Rr(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Ea(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Gd(e,t,a):(Ea(t),e=la(e,t,a),e!==null?e.sibling:null);Ea(t);break;case 19:var s=(e.flags&128)!==0;if(l=(a&t.childLanes)!==0,l||(Sl(e,t,a,!1),l=(a&t.childLanes)!==0),s){if(l)return Xd(e,t,a);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Z(Ye,Ye.current),l)break;return null;case 22:return t.lanes=0,Hd(e,t,a,t.pendingProps);case 24:ba(t,Ve,e.memoizedState.cache)}return la(e,t,a)}function Qd(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Qe=!0;else{if(!nc(e,a)&&(t.flags&128)===0)return Qe=!1,Fx(e,t,a);Qe=(e.flags&131072)!==0}else Qe=!1,ye&&(t.flags&1048576)!==0&&Eo(t,fn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Ia(t.elementType),t.type=e,typeof e=="function")ur(e)?(l=ll(e,l),t.tag=1,t=$d(null,t,e,l,a)):(t.tag=0,t=Fr(null,t,e,l,a));else{if(e!=null){var s=e.$$typeof;if(s===te){t.tag=11,t=Dd(null,t,e,l,a);break e}else if(s===V){t.tag=14,t=Ud(null,t,e,l,a);break e}}throw t=Le(e)||e,Error(c(306,t,""))}}return t;case 0:return Fr(e,t,t.type,t.pendingProps,a);case 1:return l=t.type,s=ll(l,t.pendingProps),$d(e,t,l,s,a);case 3:e:{if(Ke(t,t.stateNode.containerInfo),e===null)throw Error(c(387));l=t.pendingProps;var i=t.memoizedState;s=i.element,Er(e,t),bn(t,l,null,a);var d=t.memoizedState;if(l=d.cache,ba(t,Ve,l),l!==i.cache&&pr(t,[Ve],a,!0),vn(),l=d.element,i.isDehydrated)if(i={element:l,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=kd(e,t,l,a);break e}else if(l!==s){s=At(Error(c(424)),t),mn(s),t=kd(e,t,l,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,ze=Ot(e.firstChild),Ie=t,ye=!0,pa=null,_t=!0,a=Ho(t,null,l,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Ja(),l===s){t=la(e,t,a);break e}tt(e,t,l,a)}t=t.child}return t;case 26:return ks(e,t),e===null?(a=n0(t.type,null,t.pendingProps,null))?t.memoizedState=a:ye||(a=t.type,e=t.pendingProps,l=si(fe.current).createElement(a),l[Pe]=t,l[ct]=e,at(l,a,e),We(l),t.stateNode=l):t.memoizedState=n0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Wl(t),e===null&&ye&&(l=t.stateNode=t0(t.type,t.pendingProps,fe.current),Ie=t,_t=!0,s=ze,Oa(t.type)?(Hc=s,ze=Ot(l.firstChild)):ze=s),tt(e,t,t.pendingProps.children,a),ks(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ye&&((s=l=ze)&&(l=wh(l,t.type,t.pendingProps,_t),l!==null?(t.stateNode=l,Ie=t,ze=Ot(l.firstChild),_t=!1,s=!0):s=!1),s||va(t)),Wl(t),s=t.type,i=t.pendingProps,d=e!==null?e.memoizedProps:null,l=i.children,zc(s,i)?l=null:d!==null&&zc(s,d)&&(t.flags|=32),t.memoizedState!==null&&(s=_r(e,t,kx,null,null,a),Yn._currentValue=s),ks(e,t),tt(e,t,l,a),t.child;case 6:return e===null&&ye&&((e=a=ze)&&(a=Ah(a,t.pendingProps,_t),a!==null?(t.stateNode=a,Ie=t,ze=null,e=!0):e=!1),e||va(t)),null;case 13:return Gd(e,t,a);case 4:return Ke(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=tl(t,null,l,a):tt(e,t,l,a),t.child;case 11:return Dd(e,t,t.type,t.pendingProps,a);case 7:return tt(e,t,t.pendingProps,a),t.child;case 8:return tt(e,t,t.pendingProps.children,a),t.child;case 12:return tt(e,t,t.pendingProps.children,a),t.child;case 10:return l=t.pendingProps,ba(t,t.type,l.value),tt(e,t,l.children,a),t.child;case 9:return s=t.type._context,l=t.pendingProps.children,Fa(t),s=et(s),l=l(s),t.flags|=1,tt(e,t,l,a),t.child;case 14:return Ud(e,t,t.type,t.pendingProps,a);case 15:return Ld(e,t,t.type,t.pendingProps,a);case 19:return Xd(e,t,a);case 31:return Wx(e,t,a);case 22:return Hd(e,t,a,t.pendingProps);case 24:return Fa(t),l=et(Ve),e===null?(s=jr(),s===null&&(s=Me,i=vr(),s.pooledCache=i,i.refCount++,i!==null&&(s.pooledCacheLanes|=a),s=i),t.memoizedState={parent:l,cache:s},Sr(t),ba(t,Ve,s)):((e.lanes&a)!==0&&(Er(e,t),bn(t,null,null,a),vn()),s=e.memoizedState,i=t.memoizedState,s.parent!==l?(s={parent:l,cache:l},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),ba(t,Ve,l)):(l=i.cache,ba(t,Ve,l),l!==s.cache&&pr(t,[Ve],a,!0))),tt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function na(e){e.flags|=4}function sc(e,t,a,l,s){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(bf())e.flags|=8192;else throw el=ws,Nr}else e.flags&=-16777217}function Zd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!u0(t))if(bf())e.flags|=8192;else throw el=ws,Nr}function Vs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Cu():536870912,e.lanes|=t,Ul|=t)}function Tn(e,t){if(!ye)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function Oe(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,l=0;if(t)for(var s=e.child;s!==null;)a|=s.lanes|s.childLanes,l|=s.subtreeFlags&65011712,l|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)a|=s.lanes|s.childLanes,l|=s.subtreeFlags,l|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=l,e.childLanes=a,t}function Px(e,t,a){var l=t.pendingProps;switch(mr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Oe(t),null;case 1:return Oe(t),null;case 3:return a=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),ea(Ve),qe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Nl(t)?na(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,hr())),Oe(t),null;case 26:var s=t.type,i=t.memoizedState;return e===null?(na(t),i!==null?(Oe(t),Zd(t,i)):(Oe(t),sc(t,s,null,l,a))):i?i!==e.memoizedState?(na(t),Oe(t),Zd(t,i)):(Oe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&na(t),Oe(t),sc(t,s,e,l,a)),null;case 27:if(ts(t),a=fe.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&na(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return Oe(t),null}e=W.current,Nl(t)?To(t):(e=t0(s,l,a),t.stateNode=e,na(t))}return Oe(t),null;case 5:if(ts(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&na(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return Oe(t),null}if(i=W.current,Nl(t))To(t);else{var d=si(fe.current);switch(i){case 1:i=d.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:i=d.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":i=d.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":i=d.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":i=d.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof l.is=="string"?d.createElement("select",{is:l.is}):d.createElement("select"),l.multiple?i.multiple=!0:l.size&&(i.size=l.size);break;default:i=typeof l.is=="string"?d.createElement(s,{is:l.is}):d.createElement(s)}}i[Pe]=t,i[ct]=l;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)i.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=i;e:switch(at(i,s,l),s){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&na(t)}}return Oe(t),sc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&na(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(c(166));if(e=fe.current,Nl(t)){if(e=t.stateNode,a=t.memoizedProps,l=null,s=Ie,s!==null)switch(s.tag){case 27:case 5:l=s.memoizedProps}e[Pe]=t,e=!!(e.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||Vf(e.nodeValue,a)),e||va(t,!0)}else e=si(e).createTextNode(l),e[Pe]=t,t.stateNode=e}return Oe(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(l=Nl(t),a!==null){if(e===null){if(!l)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[Pe]=t}else Ja(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Oe(t),e=!1}else a=hr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(jt(t),t):(jt(t),null);if((t.flags&128)!==0)throw Error(c(558))}return Oe(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Nl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!s)throw Error(c(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(c(317));s[Pe]=t}else Ja(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Oe(t),s=!1}else s=hr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(jt(t),t):(jt(t),null)}return jt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=l!==null,e=e!==null&&e.memoizedState!==null,a&&(l=t.child,s=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(s=l.alternate.memoizedState.cachePool.pool),i=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(i=l.memoizedState.cachePool.pool),i!==s&&(l.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Vs(t,t.updateQueue),Oe(t),null);case 4:return qe(),e===null&&wc(t.stateNode.containerInfo),Oe(t),null;case 10:return ea(t.type),Oe(t),null;case 19:if(Y(Ye),l=t.memoizedState,l===null)return Oe(t),null;if(s=(t.flags&128)!==0,i=l.rendering,i===null)if(s)Tn(l,!1);else{if(Be!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=_s(e),i!==null){for(t.flags|=128,Tn(l,!1),e=i.updateQueue,t.updateQueue=e,Vs(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)jo(a,e),a=a.sibling;return Z(Ye,Ye.current&1|2),ye&&Pt(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&ht()>Js&&(t.flags|=128,s=!0,Tn(l,!1),t.lanes=4194304)}else{if(!s)if(e=_s(i),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Vs(t,e),Tn(l,!0),l.tail===null&&l.tailMode==="hidden"&&!i.alternate&&!ye)return Oe(t),null}else 2*ht()-l.renderingStartTime>Js&&a!==536870912&&(t.flags|=128,s=!0,Tn(l,!1),t.lanes=4194304);l.isBackwards?(i.sibling=t.child,t.child=i):(e=l.last,e!==null?e.sibling=i:t.child=i,l.last=i)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=ht(),e.sibling=null,a=Ye.current,Z(Ye,s?a&1|2:a&1),ye&&Pt(t,l.treeForkCount),e):(Oe(t),null);case 22:case 23:return jt(t),Ar(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(a&536870912)!==0&&(t.flags&128)===0&&(Oe(t),t.subtreeFlags&6&&(t.flags|=8192)):Oe(t),a=t.updateQueue,a!==null&&Vs(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==a&&(t.flags|=2048),e!==null&&Y(Pa),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),ea(Ve),Oe(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function Ix(e,t){switch(mr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ea(Ve),qe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ts(t),null;case 31:if(t.memoizedState!==null){if(jt(t),t.alternate===null)throw Error(c(340));Ja()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(jt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Ja()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Y(Ye),null;case 4:return qe(),null;case 10:return ea(t.type),null;case 22:case 23:return jt(t),Ar(),e!==null&&Y(Pa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ea(Ve),null;case 25:return null;default:return null}}function Kd(e,t){switch(mr(t),t.tag){case 3:ea(Ve),qe();break;case 26:case 27:case 5:ts(t);break;case 4:qe();break;case 31:t.memoizedState!==null&&jt(t);break;case 13:jt(t);break;case 19:Y(Ye);break;case 10:ea(t.type);break;case 22:case 23:jt(t),Ar(),e!==null&&Y(Pa);break;case 24:ea(Ve)}}function wn(e,t){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var s=l.next;a=s;do{if((a.tag&e)===e){l=void 0;var i=a.create,d=a.inst;l=i(),d.destroy=l}a=a.next}while(a!==s)}}catch(h){Te(t,t.return,h)}}function Ta(e,t,a){try{var l=t.updateQueue,s=l!==null?l.lastEffect:null;if(s!==null){var i=s.next;l=i;do{if((l.tag&e)===e){var d=l.inst,h=d.destroy;if(h!==void 0){d.destroy=void 0,s=t;var S=a,M=h;try{M()}catch(B){Te(s,S,B)}}}l=l.next}while(l!==i)}}catch(B){Te(t,t.return,B)}}function Jd(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{qo(t,a)}catch(l){Te(e,e.return,l)}}}function Wd(e,t,a){a.props=ll(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(l){Te(e,t,l)}}function An(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof a=="function"?e.refCleanup=a(l):a.current=l}}catch(s){Te(e,t,s)}}function kt(e,t){var a=e.ref,l=e.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(s){Te(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(s){Te(e,t,s)}else a.current=null}function Fd(e){var t=e.type,a=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(s){Te(e,e.return,s)}}function ic(e,t,a){try{var l=e.stateNode;jh(l,e.type,a,t),l[ct]=t}catch(s){Te(e,e.return,s)}}function Pd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Oa(e.type)||e.tag===4}function rc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Pd(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Oa(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function cc(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Jt));else if(l!==4&&(l===27&&Oa(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(cc(e,t,a),e=e.sibling;e!==null;)cc(e,t,a),e=e.sibling}function Xs(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(l!==4&&(l===27&&Oa(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Xs(e,t,a),e=e.sibling;e!==null;)Xs(e,t,a),e=e.sibling}function Id(e){var t=e.stateNode,a=e.memoizedProps;try{for(var l=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);at(t,l,a),t[Pe]=e,t[ct]=a}catch(i){Te(e,e.return,i)}}var sa=!1,Ze=!1,uc=!1,ef=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function eh(e,t){if(e=e.containerInfo,Mc=fi,e=fo(e),ar(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var s=l.anchorOffset,i=l.focusNode;l=l.focusOffset;try{a.nodeType,i.nodeType}catch{a=null;break e}var d=0,h=-1,S=-1,M=0,B=0,G=e,z=null;t:for(;;){for(var D;G!==a||s!==0&&G.nodeType!==3||(h=d+s),G!==i||l!==0&&G.nodeType!==3||(S=d+l),G.nodeType===3&&(d+=G.nodeValue.length),(D=G.firstChild)!==null;)z=G,G=D;for(;;){if(G===e)break t;if(z===a&&++M===s&&(h=d),z===i&&++B===l&&(S=d),(D=G.nextSibling)!==null)break;G=z,z=G.parentNode}G=D}a=h===-1||S===-1?null:{start:h,end:S}}else a=null}a=a||{start:0,end:0}}else a=null;for(_c={focusedElem:e,selectionRange:a},fi=!1,Fe=t;Fe!==null;)if(t=Fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Fe=e;else for(;Fe!==null;){switch(t=Fe,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)s=e[a],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&i!==null){e=void 0,a=t,s=i.memoizedProps,i=i.memoizedState,l=a.stateNode;try{var J=ll(a.type,s);e=l.getSnapshotBeforeUpdate(J,i),l.__reactInternalSnapshotBeforeUpdate=e}catch(ne){Te(a,a.return,ne)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Dc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Dc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(c(163))}if(e=t.sibling,e!==null){e.return=t.return,Fe=e;break}Fe=t.return}}function tf(e,t,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:ra(e,a),l&4&&wn(5,a);break;case 1:if(ra(e,a),l&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(d){Te(a,a.return,d)}else{var s=ll(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){Te(a,a.return,d)}}l&64&&Jd(a),l&512&&An(a,a.return);break;case 3:if(ra(e,a),l&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{qo(e,t)}catch(d){Te(a,a.return,d)}}break;case 27:t===null&&l&4&&Id(a);case 26:case 5:ra(e,a),t===null&&l&4&&Fd(a),l&512&&An(a,a.return);break;case 12:ra(e,a);break;case 31:ra(e,a),l&4&&nf(e,a);break;case 13:ra(e,a),l&4&&sf(e,a),l&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=uh.bind(null,a),Rh(e,a))));break;case 22:if(l=a.memoizedState!==null||sa,!l){t=t!==null&&t.memoizedState!==null||Ze,s=sa;var i=Ze;sa=l,(Ze=t)&&!i?ca(e,a,(a.subtreeFlags&8772)!==0):ra(e,a),sa=s,Ze=i}break;case 30:break;default:ra(e,a)}}function af(e){var t=e.alternate;t!==null&&(e.alternate=null,af(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&qi(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var De=null,ot=!1;function ia(e,t,a){for(a=a.child;a!==null;)lf(e,t,a),a=a.sibling}function lf(e,t,a){if(gt&&typeof gt.onCommitFiberUnmount=="function")try{gt.onCommitFiberUnmount(Fl,a)}catch{}switch(a.tag){case 26:Ze||kt(a,t),ia(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Ze||kt(a,t);var l=De,s=ot;Oa(a.type)&&(De=a.stateNode,ot=!1),ia(e,t,a),Hn(a.stateNode),De=l,ot=s;break;case 5:Ze||kt(a,t);case 6:if(l=De,s=ot,De=null,ia(e,t,a),De=l,ot=s,De!==null)if(ot)try{(De.nodeType===9?De.body:De.nodeName==="HTML"?De.ownerDocument.body:De).removeChild(a.stateNode)}catch(i){Te(a,t,i)}else try{De.removeChild(a.stateNode)}catch(i){Te(a,t,i)}break;case 18:De!==null&&(ot?(e=De,Wf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Gl(e)):Wf(De,a.stateNode));break;case 4:l=De,s=ot,De=a.stateNode.containerInfo,ot=!0,ia(e,t,a),De=l,ot=s;break;case 0:case 11:case 14:case 15:Ta(2,a,t),Ze||Ta(4,a,t),ia(e,t,a);break;case 1:Ze||(kt(a,t),l=a.stateNode,typeof l.componentWillUnmount=="function"&&Wd(a,t,l)),ia(e,t,a);break;case 21:ia(e,t,a);break;case 22:Ze=(l=Ze)||a.memoizedState!==null,ia(e,t,a),Ze=l;break;default:ia(e,t,a)}}function nf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Gl(e)}catch(a){Te(t,t.return,a)}}}function sf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Gl(e)}catch(a){Te(t,t.return,a)}}function th(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ef),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ef),t;default:throw Error(c(435,e.tag))}}function Qs(e,t){var a=th(e);t.forEach(function(l){if(!a.has(l)){a.add(l);var s=oh.bind(null,e,l);l.then(s,s)}})}function dt(e,t){var a=t.deletions;if(a!==null)for(var l=0;l<a.length;l++){var s=a[l],i=e,d=t,h=d;e:for(;h!==null;){switch(h.tag){case 27:if(Oa(h.type)){De=h.stateNode,ot=!1;break e}break;case 5:De=h.stateNode,ot=!1;break e;case 3:case 4:De=h.stateNode.containerInfo,ot=!0;break e}h=h.return}if(De===null)throw Error(c(160));lf(i,d,s),De=null,ot=!1,i=s.alternate,i!==null&&(i.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)rf(t,e),t=t.sibling}var Ht=null;function rf(e,t){var a=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:dt(t,e),ft(e),l&4&&(Ta(3,e,e.return),wn(3,e),Ta(5,e,e.return));break;case 1:dt(t,e),ft(e),l&512&&(Ze||a===null||kt(a,a.return)),l&64&&sa&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var s=Ht;if(dt(t,e),ft(e),l&512&&(Ze||a===null||kt(a,a.return)),l&4){var i=a!==null?a.memoizedState:null;if(l=e.memoizedState,a===null)if(l===null)if(e.stateNode===null){e:{l=e.type,a=e.memoizedProps,s=s.ownerDocument||s;t:switch(l){case"title":i=s.getElementsByTagName("title")[0],(!i||i[en]||i[Pe]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=s.createElement(l),s.head.insertBefore(i,s.querySelector("head > title"))),at(i,l,a),i[Pe]=e,We(i),l=i;break e;case"link":var d=r0("link","href",s).get(l+(a.href||""));if(d){for(var h=0;h<d.length;h++)if(i=d[h],i.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&i.getAttribute("rel")===(a.rel==null?null:a.rel)&&i.getAttribute("title")===(a.title==null?null:a.title)&&i.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){d.splice(h,1);break t}}i=s.createElement(l),at(i,l,a),s.head.appendChild(i);break;case"meta":if(d=r0("meta","content",s).get(l+(a.content||""))){for(h=0;h<d.length;h++)if(i=d[h],i.getAttribute("content")===(a.content==null?null:""+a.content)&&i.getAttribute("name")===(a.name==null?null:a.name)&&i.getAttribute("property")===(a.property==null?null:a.property)&&i.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&i.getAttribute("charset")===(a.charSet==null?null:a.charSet)){d.splice(h,1);break t}}i=s.createElement(l),at(i,l,a),s.head.appendChild(i);break;default:throw Error(c(468,l))}i[Pe]=e,We(i),l=i}e.stateNode=l}else c0(s,e.type,e.stateNode);else e.stateNode=i0(s,l,e.memoizedProps);else i!==l?(i===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):i.count--,l===null?c0(s,e.type,e.stateNode):i0(s,l,e.memoizedProps)):l===null&&e.stateNode!==null&&ic(e,e.memoizedProps,a.memoizedProps)}break;case 27:dt(t,e),ft(e),l&512&&(Ze||a===null||kt(a,a.return)),a!==null&&l&4&&ic(e,e.memoizedProps,a.memoizedProps);break;case 5:if(dt(t,e),ft(e),l&512&&(Ze||a===null||kt(a,a.return)),e.flags&32){s=e.stateNode;try{fl(s,"")}catch(J){Te(e,e.return,J)}}l&4&&e.stateNode!=null&&(s=e.memoizedProps,ic(e,s,a!==null?a.memoizedProps:s)),l&1024&&(uc=!0);break;case 6:if(dt(t,e),ft(e),l&4){if(e.stateNode===null)throw Error(c(162));l=e.memoizedProps,a=e.stateNode;try{a.nodeValue=l}catch(J){Te(e,e.return,J)}}break;case 3:if(ci=null,s=Ht,Ht=ii(t.containerInfo),dt(t,e),Ht=s,ft(e),l&4&&a!==null&&a.memoizedState.isDehydrated)try{Gl(t.containerInfo)}catch(J){Te(e,e.return,J)}uc&&(uc=!1,cf(e));break;case 4:l=Ht,Ht=ii(e.stateNode.containerInfo),dt(t,e),ft(e),Ht=l;break;case 12:dt(t,e),ft(e);break;case 31:dt(t,e),ft(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Qs(e,l)));break;case 13:dt(t,e),ft(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ks=ht()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Qs(e,l)));break;case 22:s=e.memoizedState!==null;var S=a!==null&&a.memoizedState!==null,M=sa,B=Ze;if(sa=M||s,Ze=B||S,dt(t,e),Ze=B,sa=M,ft(e),l&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(a===null||S||sa||Ze||nl(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){S=a=t;try{if(i=S.stateNode,s)d=i.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{h=S.stateNode;var G=S.memoizedProps.style,z=G!=null&&G.hasOwnProperty("display")?G.display:null;h.style.display=z==null||typeof z=="boolean"?"":(""+z).trim()}}catch(J){Te(S,S.return,J)}}}else if(t.tag===6){if(a===null){S=t;try{S.stateNode.nodeValue=s?"":S.memoizedProps}catch(J){Te(S,S.return,J)}}}else if(t.tag===18){if(a===null){S=t;try{var D=S.stateNode;s?Ff(D,!0):Ff(S.stateNode,!1)}catch(J){Te(S,S.return,J)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,Qs(e,a))));break;case 19:dt(t,e),ft(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Qs(e,l)));break;case 30:break;case 21:break;default:dt(t,e),ft(e)}}function ft(e){var t=e.flags;if(t&2){try{for(var a,l=e.return;l!==null;){if(Pd(l)){a=l;break}l=l.return}if(a==null)throw Error(c(160));switch(a.tag){case 27:var s=a.stateNode,i=rc(e);Xs(e,i,s);break;case 5:var d=a.stateNode;a.flags&32&&(fl(d,""),a.flags&=-33);var h=rc(e);Xs(e,h,d);break;case 3:case 4:var S=a.stateNode.containerInfo,M=rc(e);cc(e,M,S);break;default:throw Error(c(161))}}catch(B){Te(e,e.return,B)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function cf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;cf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ra(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)tf(e,t.alternate,t),t=t.sibling}function nl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ta(4,t,t.return),nl(t);break;case 1:kt(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Wd(t,t.return,a),nl(t);break;case 27:Hn(t.stateNode);case 26:case 5:kt(t,t.return),nl(t);break;case 22:t.memoizedState===null&&nl(t);break;case 30:nl(t);break;default:nl(t)}e=e.sibling}}function ca(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,s=e,i=t,d=i.flags;switch(i.tag){case 0:case 11:case 15:ca(s,i,a),wn(4,i);break;case 1:if(ca(s,i,a),l=i,s=l.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(M){Te(l,l.return,M)}if(l=i,s=l.updateQueue,s!==null){var h=l.stateNode;try{var S=s.shared.hiddenCallbacks;if(S!==null)for(s.shared.hiddenCallbacks=null,s=0;s<S.length;s++)Bo(S[s],h)}catch(M){Te(l,l.return,M)}}a&&d&64&&Jd(i),An(i,i.return);break;case 27:Id(i);case 26:case 5:ca(s,i,a),a&&l===null&&d&4&&Fd(i),An(i,i.return);break;case 12:ca(s,i,a);break;case 31:ca(s,i,a),a&&d&4&&nf(s,i);break;case 13:ca(s,i,a),a&&d&4&&sf(s,i);break;case 22:i.memoizedState===null&&ca(s,i,a),An(i,i.return);break;case 30:break;default:ca(s,i,a)}t=t.sibling}}function oc(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&xn(a))}function dc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&xn(e))}function Bt(e,t,a,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)uf(e,t,a,l),t=t.sibling}function uf(e,t,a,l){var s=t.flags;switch(t.tag){case 0:case 11:case 15:Bt(e,t,a,l),s&2048&&wn(9,t);break;case 1:Bt(e,t,a,l);break;case 3:Bt(e,t,a,l),s&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&xn(e)));break;case 12:if(s&2048){Bt(e,t,a,l),e=t.stateNode;try{var i=t.memoizedProps,d=i.id,h=i.onPostCommit;typeof h=="function"&&h(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(S){Te(t,t.return,S)}}else Bt(e,t,a,l);break;case 31:Bt(e,t,a,l);break;case 13:Bt(e,t,a,l);break;case 23:break;case 22:i=t.stateNode,d=t.alternate,t.memoizedState!==null?i._visibility&2?Bt(e,t,a,l):Rn(e,t):i._visibility&2?Bt(e,t,a,l):(i._visibility|=2,zl(e,t,a,l,(t.subtreeFlags&10256)!==0||!1)),s&2048&&oc(d,t);break;case 24:Bt(e,t,a,l),s&2048&&dc(t.alternate,t);break;default:Bt(e,t,a,l)}}function zl(e,t,a,l,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,d=t,h=a,S=l,M=d.flags;switch(d.tag){case 0:case 11:case 15:zl(i,d,h,S,s),wn(8,d);break;case 23:break;case 22:var B=d.stateNode;d.memoizedState!==null?B._visibility&2?zl(i,d,h,S,s):Rn(i,d):(B._visibility|=2,zl(i,d,h,S,s)),s&&M&2048&&oc(d.alternate,d);break;case 24:zl(i,d,h,S,s),s&&M&2048&&dc(d.alternate,d);break;default:zl(i,d,h,S,s)}t=t.sibling}}function Rn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,l=t,s=l.flags;switch(l.tag){case 22:Rn(a,l),s&2048&&oc(l.alternate,l);break;case 24:Rn(a,l),s&2048&&dc(l.alternate,l);break;default:Rn(a,l)}t=t.sibling}}var Mn=8192;function Ol(e,t,a){if(e.subtreeFlags&Mn)for(e=e.child;e!==null;)of(e,t,a),e=e.sibling}function of(e,t,a){switch(e.tag){case 26:Ol(e,t,a),e.flags&Mn&&e.memoizedState!==null&&$h(a,Ht,e.memoizedState,e.memoizedProps);break;case 5:Ol(e,t,a);break;case 3:case 4:var l=Ht;Ht=ii(e.stateNode.containerInfo),Ol(e,t,a),Ht=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Mn,Mn=16777216,Ol(e,t,a),Mn=l):Ol(e,t,a));break;default:Ol(e,t,a)}}function df(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function _n(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];Fe=l,mf(l,e)}df(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ff(e),e=e.sibling}function ff(e){switch(e.tag){case 0:case 11:case 15:_n(e),e.flags&2048&&Ta(9,e,e.return);break;case 3:_n(e);break;case 12:_n(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Zs(e)):_n(e);break;default:_n(e)}}function Zs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];Fe=l,mf(l,e)}df(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ta(8,t,t.return),Zs(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Zs(t));break;default:Zs(t)}e=e.sibling}}function mf(e,t){for(;Fe!==null;){var a=Fe;switch(a.tag){case 0:case 11:case 15:Ta(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:xn(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,Fe=l;else e:for(a=e;Fe!==null;){l=Fe;var s=l.sibling,i=l.return;if(af(l),l===a){Fe=null;break e}if(s!==null){s.return=i,Fe=s;break e}Fe=i}}}var ah={getCacheForType:function(e){var t=et(Ve),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return et(Ve).controller.signal}},lh=typeof WeakMap=="function"?WeakMap:Map,Ne=0,Me=null,me=null,he=0,Ce=0,Nt=null,wa=!1,Dl=!1,fc=!1,ua=0,Be=0,Aa=0,sl=0,mc=0,St=0,Ul=0,zn=null,mt=null,xc=!1,Ks=0,xf=0,Js=1/0,Ws=null,Ra=null,Je=0,Ma=null,Ll=null,oa=0,hc=0,gc=null,hf=null,On=0,yc=null;function Et(){return(Ne&2)!==0&&he!==0?he&-he:H.T!==null?Sc():Ru()}function gf(){if(St===0)if((he&536870912)===0||ye){var e=ns;ns<<=1,(ns&3932160)===0&&(ns=262144),St=e}else St=536870912;return e=bt.current,e!==null&&(e.flags|=32),St}function xt(e,t,a){(e===Me&&(Ce===2||Ce===9)||e.cancelPendingCommit!==null)&&(Hl(e,0),_a(e,he,St,!1)),Il(e,a),((Ne&2)===0||e!==Me)&&(e===Me&&((Ne&2)===0&&(sl|=a),Be===4&&_a(e,he,St,!1)),Gt(e))}function yf(e,t,a){if((Ne&6)!==0)throw Error(c(327));var l=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Pl(e,t),s=l?ih(e,t):vc(e,t,!0),i=l;do{if(s===0){Dl&&!l&&_a(e,t,0,!1);break}else{if(a=e.current.alternate,i&&!nh(a)){s=vc(e,t,!1),i=!1;continue}if(s===2){if(i=t,e.errorRecoveryDisabledLanes&i)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var h=e;s=zn;var S=h.current.memoizedState.isDehydrated;if(S&&(Hl(h,d).flags|=256),d=vc(h,d,!1),d!==2){if(fc&&!S){h.errorRecoveryDisabledLanes|=i,sl|=i,s=4;break e}i=mt,mt=s,i!==null&&(mt===null?mt=i:mt.push.apply(mt,i))}s=d}if(i=!1,s!==2)continue}}if(s===1){Hl(e,0),_a(e,t,0,!0);break}e:{switch(l=e,i=s,i){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:_a(l,t,St,!wa);break e;case 2:mt=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(s=Ks+300-ht(),10<s)){if(_a(l,t,St,!wa),is(l,0,!0)!==0)break e;oa=t,l.timeoutHandle=Kf(pf.bind(null,l,a,mt,Ws,xc,t,St,sl,Ul,wa,i,"Throttled",-0,0),s);break e}pf(l,a,mt,Ws,xc,t,St,sl,Ul,wa,i,null,-0,0)}}break}while(!0);Gt(e)}function pf(e,t,a,l,s,i,d,h,S,M,B,G,z,D){if(e.timeoutHandle=-1,G=t.subtreeFlags,G&8192||(G&16785408)===16785408){G={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jt},of(t,i,G);var J=(i&62914560)===i?Ks-ht():(i&4194048)===i?xf-ht():0;if(J=kh(G,J),J!==null){oa=i,e.cancelPendingCommit=J(Tf.bind(null,e,t,i,a,l,s,d,h,S,B,G,null,z,D)),_a(e,i,d,!M);return}}Tf(e,t,i,a,l,s,d,h,S)}function nh(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var s=a[l],i=s.getSnapshot;s=s.value;try{if(!pt(i(),s))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function _a(e,t,a,l){t&=~mc,t&=~sl,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var s=t;0<s;){var i=31-yt(s),d=1<<i;l[i]=-1,s&=~d}a!==0&&Tu(e,a,t)}function Fs(){return(Ne&6)===0?(Dn(0),!1):!0}function pc(){if(me!==null){if(Ce===0)var e=me.return;else e=me,It=Wa=null,Dr(e),wl=null,gn=0,e=me;for(;e!==null;)Kd(e.alternate,e),e=e.return;me=null}}function Hl(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Eh(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),oa=0,pc(),Me=e,me=a=Ft(e.current,null),he=t,Ce=0,Nt=null,wa=!1,Dl=Pl(e,t),fc=!1,Ul=St=mc=sl=Aa=Be=0,mt=zn=null,xc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var s=31-yt(l),i=1<<s;t|=e[s],l&=~i}return ua=t,ps(),a}function vf(e,t){ue=null,H.H=En,t===Tl||t===Ts?(t=Do(),Ce=3):t===Nr?(t=Do(),Ce=4):Ce=t===Wr?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Nt=t,me===null&&(Be=1,Ys(e,At(t,e.current)))}function bf(){var e=bt.current;return e===null?!0:(he&4194048)===he?zt===null:(he&62914560)===he||(he&536870912)!==0?e===zt:!1}function jf(){var e=H.H;return H.H=En,e===null?En:e}function Nf(){var e=H.A;return H.A=ah,e}function Ps(){Be=4,wa||(he&4194048)!==he&&bt.current!==null||(Dl=!0),(Aa&134217727)===0&&(sl&134217727)===0||Me===null||_a(Me,he,St,!1)}function vc(e,t,a){var l=Ne;Ne|=2;var s=jf(),i=Nf();(Me!==e||he!==t)&&(Ws=null,Hl(e,t)),t=!1;var d=Be;e:do try{if(Ce!==0&&me!==null){var h=me,S=Nt;switch(Ce){case 8:pc(),d=6;break e;case 3:case 2:case 9:case 6:bt.current===null&&(t=!0);var M=Ce;if(Ce=0,Nt=null,Bl(e,h,S,M),a&&Dl){d=0;break e}break;default:M=Ce,Ce=0,Nt=null,Bl(e,h,S,M)}}sh(),d=Be;break}catch(B){vf(e,B)}while(!0);return t&&e.shellSuspendCounter++,It=Wa=null,Ne=l,H.H=s,H.A=i,me===null&&(Me=null,he=0,ps()),d}function sh(){for(;me!==null;)Sf(me)}function ih(e,t){var a=Ne;Ne|=2;var l=jf(),s=Nf();Me!==e||he!==t?(Ws=null,Js=ht()+500,Hl(e,t)):Dl=Pl(e,t);e:do try{if(Ce!==0&&me!==null){t=me;var i=Nt;t:switch(Ce){case 1:Ce=0,Nt=null,Bl(e,t,i,1);break;case 2:case 9:if(zo(i)){Ce=0,Nt=null,Ef(t);break}t=function(){Ce!==2&&Ce!==9||Me!==e||(Ce=7),Gt(e)},i.then(t,t);break e;case 3:Ce=7;break e;case 4:Ce=5;break e;case 7:zo(i)?(Ce=0,Nt=null,Ef(t)):(Ce=0,Nt=null,Bl(e,t,i,7));break;case 5:var d=null;switch(me.tag){case 26:d=me.memoizedState;case 5:case 27:var h=me;if(d?u0(d):h.stateNode.complete){Ce=0,Nt=null;var S=h.sibling;if(S!==null)me=S;else{var M=h.return;M!==null?(me=M,Is(M)):me=null}break t}}Ce=0,Nt=null,Bl(e,t,i,5);break;case 6:Ce=0,Nt=null,Bl(e,t,i,6);break;case 8:pc(),Be=6;break e;default:throw Error(c(462))}}rh();break}catch(B){vf(e,B)}while(!0);return It=Wa=null,H.H=l,H.A=s,Ne=a,me!==null?0:(Me=null,he=0,ps(),Be)}function rh(){for(;me!==null&&!Mm();)Sf(me)}function Sf(e){var t=Qd(e.alternate,e,ua);e.memoizedProps=e.pendingProps,t===null?Is(e):me=t}function Ef(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Yd(a,t,t.pendingProps,t.type,void 0,he);break;case 11:t=Yd(a,t,t.pendingProps,t.type.render,t.ref,he);break;case 5:Dr(t);default:Kd(a,t),t=me=jo(t,ua),t=Qd(a,t,ua)}e.memoizedProps=e.pendingProps,t===null?Is(e):me=t}function Bl(e,t,a,l){It=Wa=null,Dr(t),wl=null,gn=0;var s=t.return;try{if(Jx(e,s,t,a,he)){Be=1,Ys(e,At(a,e.current)),me=null;return}}catch(i){if(s!==null)throw me=s,i;Be=1,Ys(e,At(a,e.current)),me=null;return}t.flags&32768?(ye||l===1?e=!0:Dl||(he&536870912)!==0?e=!1:(wa=e=!0,(l===2||l===9||l===3||l===6)&&(l=bt.current,l!==null&&l.tag===13&&(l.flags|=16384))),Cf(t,e)):Is(t)}function Is(e){var t=e;do{if((t.flags&32768)!==0){Cf(t,wa);return}e=t.return;var a=Px(t.alternate,t,ua);if(a!==null){me=a;return}if(t=t.sibling,t!==null){me=t;return}me=t=e}while(t!==null);Be===0&&(Be=5)}function Cf(e,t){do{var a=Ix(e.alternate,e);if(a!==null){a.flags&=32767,me=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){me=e;return}me=e=a}while(e!==null);Be=6,me=null}function Tf(e,t,a,l,s,i,d,h,S){e.cancelPendingCommit=null;do ei();while(Je!==0);if((Ne&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(i=t.lanes|t.childLanes,i|=rr,Ym(e,a,i,d,h,S),e===Me&&(me=Me=null,he=0),Ll=t,Ma=e,oa=a,hc=i,gc=s,hf=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,dh(as,function(){return _f(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=H.T,H.T=null,s=Q.p,Q.p=2,d=Ne,Ne|=4;try{eh(e,t,a)}finally{Ne=d,Q.p=s,H.T=l}}Je=1,wf(),Af(),Rf()}}function wf(){if(Je===1){Je=0;var e=Ma,t=Ll,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=H.T,H.T=null;var l=Q.p;Q.p=2;var s=Ne;Ne|=4;try{rf(t,e);var i=_c,d=fo(e.containerInfo),h=i.focusedElem,S=i.selectionRange;if(d!==h&&h&&h.ownerDocument&&oo(h.ownerDocument.documentElement,h)){if(S!==null&&ar(h)){var M=S.start,B=S.end;if(B===void 0&&(B=M),"selectionStart"in h)h.selectionStart=M,h.selectionEnd=Math.min(B,h.value.length);else{var G=h.ownerDocument||document,z=G&&G.defaultView||window;if(z.getSelection){var D=z.getSelection(),J=h.textContent.length,ne=Math.min(S.start,J),Re=S.end===void 0?ne:Math.min(S.end,J);!D.extend&&ne>Re&&(d=Re,Re=ne,ne=d);var w=uo(h,ne),C=uo(h,Re);if(w&&C&&(D.rangeCount!==1||D.anchorNode!==w.node||D.anchorOffset!==w.offset||D.focusNode!==C.node||D.focusOffset!==C.offset)){var R=G.createRange();R.setStart(w.node,w.offset),D.removeAllRanges(),ne>Re?(D.addRange(R),D.extend(C.node,C.offset)):(R.setEnd(C.node,C.offset),D.addRange(R))}}}}for(G=[],D=h;D=D.parentNode;)D.nodeType===1&&G.push({element:D,left:D.scrollLeft,top:D.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<G.length;h++){var k=G[h];k.element.scrollLeft=k.left,k.element.scrollTop=k.top}}fi=!!Mc,_c=Mc=null}finally{Ne=s,Q.p=l,H.T=a}}e.current=t,Je=2}}function Af(){if(Je===2){Je=0;var e=Ma,t=Ll,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=H.T,H.T=null;var l=Q.p;Q.p=2;var s=Ne;Ne|=4;try{tf(e,t.alternate,t)}finally{Ne=s,Q.p=l,H.T=a}}Je=3}}function Rf(){if(Je===4||Je===3){Je=0,_m();var e=Ma,t=Ll,a=oa,l=hf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Je=5:(Je=0,Ll=Ma=null,Mf(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(Ra=null),Hi(a),t=t.stateNode,gt&&typeof gt.onCommitFiberRoot=="function")try{gt.onCommitFiberRoot(Fl,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=H.T,s=Q.p,Q.p=2,H.T=null;try{for(var i=e.onRecoverableError,d=0;d<l.length;d++){var h=l[d];i(h.value,{componentStack:h.stack})}}finally{H.T=t,Q.p=s}}(oa&3)!==0&&ei(),Gt(e),s=e.pendingLanes,(a&261930)!==0&&(s&42)!==0?e===yc?On++:(On=0,yc=e):On=0,Dn(0)}}function Mf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,xn(t)))}function ei(){return wf(),Af(),Rf(),_f()}function _f(){if(Je!==5)return!1;var e=Ma,t=hc;hc=0;var a=Hi(oa),l=H.T,s=Q.p;try{Q.p=32>a?32:a,H.T=null,a=gc,gc=null;var i=Ma,d=oa;if(Je=0,Ll=Ma=null,oa=0,(Ne&6)!==0)throw Error(c(331));var h=Ne;if(Ne|=4,ff(i.current),uf(i,i.current,d,a),Ne=h,Dn(0,!1),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot(Fl,i)}catch{}return!0}finally{Q.p=s,H.T=l,Mf(e,t)}}function zf(e,t,a){t=At(a,t),t=Jr(e.stateNode,t,2),e=Sa(e,t,2),e!==null&&(Il(e,2),Gt(e))}function Te(e,t,a){if(e.tag===3)zf(e,e,a);else for(;t!==null;){if(t.tag===3){zf(t,e,a);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ra===null||!Ra.has(l))){e=At(a,e),a=zd(2),l=Sa(t,a,2),l!==null&&(Od(a,l,t,e),Il(l,2),Gt(l));break}}t=t.return}}function bc(e,t,a){var l=e.pingCache;if(l===null){l=e.pingCache=new lh;var s=new Set;l.set(t,s)}else s=l.get(t),s===void 0&&(s=new Set,l.set(t,s));s.has(a)||(fc=!0,s.add(a),e=ch.bind(null,e,t,a),t.then(e,e))}function ch(e,t,a){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Me===e&&(he&a)===a&&(Be===4||Be===3&&(he&62914560)===he&&300>ht()-Ks?(Ne&2)===0&&Hl(e,0):mc|=a,Ul===he&&(Ul=0)),Gt(e)}function Of(e,t){t===0&&(t=Cu()),e=Za(e,t),e!==null&&(Il(e,t),Gt(e))}function uh(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Of(e,a)}function oh(e,t){var a=0;switch(e.tag){case 31:case 13:var l=e.stateNode,s=e.memoizedState;s!==null&&(a=s.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(c(314))}l!==null&&l.delete(t),Of(e,a)}function dh(e,t){return Oi(e,t)}var ti=null,ql=null,jc=!1,ai=!1,Nc=!1,za=0;function Gt(e){e!==ql&&e.next===null&&(ql===null?ti=ql=e:ql=ql.next=e),ai=!0,jc||(jc=!0,mh())}function Dn(e,t){if(!Nc&&ai){Nc=!0;do for(var a=!1,l=ti;l!==null;){if(e!==0){var s=l.pendingLanes;if(s===0)var i=0;else{var d=l.suspendedLanes,h=l.pingedLanes;i=(1<<31-yt(42|e)+1)-1,i&=s&~(d&~h),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(a=!0,Hf(l,i))}else i=he,i=is(l,l===Me?i:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(i&3)===0||Pl(l,i)||(a=!0,Hf(l,i));l=l.next}while(a);Nc=!1}}function fh(){Df()}function Df(){ai=jc=!1;var e=0;za!==0&&Sh()&&(e=za);for(var t=ht(),a=null,l=ti;l!==null;){var s=l.next,i=Uf(l,t);i===0?(l.next=null,a===null?ti=s:a.next=s,s===null&&(ql=a)):(a=l,(e!==0||(i&3)!==0)&&(ai=!0)),l=s}Je!==0&&Je!==5||Dn(e),za!==0&&(za=0)}function Uf(e,t){for(var a=e.suspendedLanes,l=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var d=31-yt(i),h=1<<d,S=s[d];S===-1?((h&a)===0||(h&l)!==0)&&(s[d]=qm(h,t)):S<=t&&(e.expiredLanes|=h),i&=~h}if(t=Me,a=he,a=is(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,a===0||e===t&&(Ce===2||Ce===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Di(l),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Pl(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(l!==null&&Di(l),Hi(a)){case 2:case 8:a=Su;break;case 32:a=as;break;case 268435456:a=Eu;break;default:a=as}return l=Lf.bind(null,e),a=Oi(a,l),e.callbackPriority=t,e.callbackNode=a,t}return l!==null&&l!==null&&Di(l),e.callbackPriority=2,e.callbackNode=null,2}function Lf(e,t){if(Je!==0&&Je!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(ei()&&e.callbackNode!==a)return null;var l=he;return l=is(e,e===Me?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(yf(e,l,t),Uf(e,ht()),e.callbackNode!=null&&e.callbackNode===a?Lf.bind(null,e):null)}function Hf(e,t){if(ei())return null;yf(e,t,!0)}function mh(){Ch(function(){(Ne&6)!==0?Oi(Nu,fh):Df()})}function Sc(){if(za===0){var e=El;e===0&&(e=ls,ls<<=1,(ls&261888)===0&&(ls=256)),za=e}return za}function Bf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:os(""+e)}function qf(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function xh(e,t,a,l,s){if(t==="submit"&&a&&a.stateNode===s){var i=Bf((s[ct]||null).action),d=l.submitter;d&&(t=(t=d[ct]||null)?Bf(t.formAction):d.getAttribute("formAction"),t!==null&&(i=t,d=null));var h=new xs("action","action",null,l,s);e.push({event:h,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(za!==0){var S=d?qf(s,d):new FormData(s);Gr(a,{pending:!0,data:S,method:s.method,action:i},null,S)}}else typeof i=="function"&&(h.preventDefault(),S=d?qf(s,d):new FormData(s),Gr(a,{pending:!0,data:S,method:s.method,action:i},i,S))},currentTarget:s}]})}}for(var Ec=0;Ec<ir.length;Ec++){var Cc=ir[Ec],hh=Cc.toLowerCase(),gh=Cc[0].toUpperCase()+Cc.slice(1);Lt(hh,"on"+gh)}Lt(ho,"onAnimationEnd"),Lt(go,"onAnimationIteration"),Lt(yo,"onAnimationStart"),Lt("dblclick","onDoubleClick"),Lt("focusin","onFocus"),Lt("focusout","onBlur"),Lt(zx,"onTransitionRun"),Lt(Ox,"onTransitionStart"),Lt(Dx,"onTransitionCancel"),Lt(po,"onTransitionEnd"),ol("onMouseEnter",["mouseout","mouseover"]),ol("onMouseLeave",["mouseout","mouseover"]),ol("onPointerEnter",["pointerout","pointerover"]),ol("onPointerLeave",["pointerout","pointerover"]),Ga("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ga("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ga("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ga("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ga("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ga("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Un="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),yh=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Un));function Yf(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var l=e[a],s=l.event;l=l.listeners;e:{var i=void 0;if(t)for(var d=l.length-1;0<=d;d--){var h=l[d],S=h.instance,M=h.currentTarget;if(h=h.listener,S!==i&&s.isPropagationStopped())break e;i=h,s.currentTarget=M;try{i(s)}catch(B){ys(B)}s.currentTarget=null,i=S}else for(d=0;d<l.length;d++){if(h=l[d],S=h.instance,M=h.currentTarget,h=h.listener,S!==i&&s.isPropagationStopped())break e;i=h,s.currentTarget=M;try{i(s)}catch(B){ys(B)}s.currentTarget=null,i=S}}}}function xe(e,t){var a=t[Bi];a===void 0&&(a=t[Bi]=new Set);var l=e+"__bubble";a.has(l)||($f(t,e,2,!1),a.add(l))}function Tc(e,t,a){var l=0;t&&(l|=4),$f(a,e,l,t)}var li="_reactListening"+Math.random().toString(36).slice(2);function wc(e){if(!e[li]){e[li]=!0,zu.forEach(function(a){a!=="selectionchange"&&(yh.has(a)||Tc(a,!1,e),Tc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[li]||(t[li]=!0,Tc("selectionchange",!1,t))}}function $f(e,t,a,l){switch(g0(t)){case 2:var s=Xh;break;case 8:s=Qh;break;default:s=kc}a=s.bind(null,t,a,e),s=void 0,!Zi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),l?s!==void 0?e.addEventListener(t,a,{capture:!0,passive:s}):e.addEventListener(t,a,!0):s!==void 0?e.addEventListener(t,a,{passive:s}):e.addEventListener(t,a,!1)}function Ac(e,t,a,l,s){var i=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var d=l.tag;if(d===3||d===4){var h=l.stateNode.containerInfo;if(h===s)break;if(d===4)for(d=l.return;d!==null;){var S=d.tag;if((S===3||S===4)&&d.stateNode.containerInfo===s)return;d=d.return}for(;h!==null;){if(d=rl(h),d===null)return;if(S=d.tag,S===5||S===6||S===26||S===27){l=i=d;continue e}h=h.parentNode}}l=l.return}Vu(function(){var M=i,B=Xi(a),G=[];e:{var z=vo.get(e);if(z!==void 0){var D=xs,J=e;switch(e){case"keypress":if(fs(a)===0)break e;case"keydown":case"keyup":D=ox;break;case"focusin":J="focus",D=Fi;break;case"focusout":J="blur",D=Fi;break;case"beforeblur":case"afterblur":D=Fi;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":D=Zu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":D=Pm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":D=mx;break;case ho:case go:case yo:D=tx;break;case po:D=hx;break;case"scroll":case"scrollend":D=Wm;break;case"wheel":D=yx;break;case"copy":case"cut":case"paste":D=lx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":D=Ju;break;case"toggle":case"beforetoggle":D=vx}var ne=(t&4)!==0,Re=!ne&&(e==="scroll"||e==="scrollend"),w=ne?z!==null?z+"Capture":null:z;ne=[];for(var C=M,R;C!==null;){var k=C;if(R=k.stateNode,k=k.tag,k!==5&&k!==26&&k!==27||R===null||w===null||(k=an(C,w),k!=null&&ne.push(Ln(C,k,R))),Re)break;C=C.return}0<ne.length&&(z=new D(z,J,null,a,B),G.push({event:z,listeners:ne}))}}if((t&7)===0){e:{if(z=e==="mouseover"||e==="pointerover",D=e==="mouseout"||e==="pointerout",z&&a!==Vi&&(J=a.relatedTarget||a.fromElement)&&(rl(J)||J[il]))break e;if((D||z)&&(z=B.window===B?B:(z=B.ownerDocument)?z.defaultView||z.parentWindow:window,D?(J=a.relatedTarget||a.toElement,D=M,J=J?rl(J):null,J!==null&&(Re=m(J),ne=J.tag,J!==Re||ne!==5&&ne!==27&&ne!==6)&&(J=null)):(D=null,J=M),D!==J)){if(ne=Zu,k="onMouseLeave",w="onMouseEnter",C="mouse",(e==="pointerout"||e==="pointerover")&&(ne=Ju,k="onPointerLeave",w="onPointerEnter",C="pointer"),Re=D==null?z:tn(D),R=J==null?z:tn(J),z=new ne(k,C+"leave",D,a,B),z.target=Re,z.relatedTarget=R,k=null,rl(B)===M&&(ne=new ne(w,C+"enter",J,a,B),ne.target=R,ne.relatedTarget=Re,k=ne),Re=k,D&&J)t:{for(ne=ph,w=D,C=J,R=0,k=w;k;k=ne(k))R++;k=0;for(var ae=C;ae;ae=ne(ae))k++;for(;0<R-k;)w=ne(w),R--;for(;0<k-R;)C=ne(C),k--;for(;R--;){if(w===C||C!==null&&w===C.alternate){ne=w;break t}w=ne(w),C=ne(C)}ne=null}else ne=null;D!==null&&kf(G,z,D,ne,!1),J!==null&&Re!==null&&kf(G,Re,J,ne,!0)}}e:{if(z=M?tn(M):window,D=z.nodeName&&z.nodeName.toLowerCase(),D==="select"||D==="input"&&z.type==="file")var ve=lo;else if(to(z))if(no)ve=Rx;else{ve=wx;var I=Tx}else D=z.nodeName,!D||D.toLowerCase()!=="input"||z.type!=="checkbox"&&z.type!=="radio"?M&&Gi(M.elementType)&&(ve=lo):ve=Ax;if(ve&&(ve=ve(e,M))){ao(G,ve,a,B);break e}I&&I(e,z,M),e==="focusout"&&M&&z.type==="number"&&M.memoizedProps.value!=null&&ki(z,"number",z.value)}switch(I=M?tn(M):window,e){case"focusin":(to(I)||I.contentEditable==="true")&&(gl=I,lr=M,dn=null);break;case"focusout":dn=lr=gl=null;break;case"mousedown":nr=!0;break;case"contextmenu":case"mouseup":case"dragend":nr=!1,mo(G,a,B);break;case"selectionchange":if(_x)break;case"keydown":case"keyup":mo(G,a,B)}var oe;if(Ii)e:{switch(e){case"compositionstart":var ge="onCompositionStart";break e;case"compositionend":ge="onCompositionEnd";break e;case"compositionupdate":ge="onCompositionUpdate";break e}ge=void 0}else hl?Iu(e,a)&&(ge="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(ge="onCompositionStart");ge&&(Wu&&a.locale!=="ko"&&(hl||ge!=="onCompositionStart"?ge==="onCompositionEnd"&&hl&&(oe=Xu()):(ga=B,Ki="value"in ga?ga.value:ga.textContent,hl=!0)),I=ni(M,ge),0<I.length&&(ge=new Ku(ge,e,null,a,B),G.push({event:ge,listeners:I}),oe?ge.data=oe:(oe=eo(a),oe!==null&&(ge.data=oe)))),(oe=jx?Nx(e,a):Sx(e,a))&&(ge=ni(M,"onBeforeInput"),0<ge.length&&(I=new Ku("onBeforeInput","beforeinput",null,a,B),G.push({event:I,listeners:ge}),I.data=oe)),xh(G,e,M,a,B)}Yf(G,t)})}function Ln(e,t,a){return{instance:e,listener:t,currentTarget:a}}function ni(e,t){for(var a=t+"Capture",l=[];e!==null;){var s=e,i=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||i===null||(s=an(e,a),s!=null&&l.unshift(Ln(e,s,i)),s=an(e,t),s!=null&&l.push(Ln(e,s,i))),e.tag===3)return l;e=e.return}return[]}function ph(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function kf(e,t,a,l,s){for(var i=t._reactName,d=[];a!==null&&a!==l;){var h=a,S=h.alternate,M=h.stateNode;if(h=h.tag,S!==null&&S===l)break;h!==5&&h!==26&&h!==27||M===null||(S=M,s?(M=an(a,i),M!=null&&d.unshift(Ln(a,M,S))):s||(M=an(a,i),M!=null&&d.push(Ln(a,M,S)))),a=a.return}d.length!==0&&e.push({event:t,listeners:d})}var vh=/\r\n?/g,bh=/\u0000|\uFFFD/g;function Gf(e){return(typeof e=="string"?e:""+e).replace(vh,`
|
|
9
|
+
`).replace(bh,"")}function Vf(e,t){return t=Gf(t),Gf(e)===t}function Ae(e,t,a,l,s,i){switch(a){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||fl(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&fl(e,""+l);break;case"className":cs(e,"class",l);break;case"tabIndex":cs(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":cs(e,a,l);break;case"style":ku(e,l,i);break;case"data":if(t!=="object"){cs(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=os(""+l),e.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(a,"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 i=="function"&&(a==="formAction"?(t!=="input"&&Ae(e,t,"name",s.name,s,null),Ae(e,t,"formEncType",s.formEncType,s,null),Ae(e,t,"formMethod",s.formMethod,s,null),Ae(e,t,"formTarget",s.formTarget,s,null)):(Ae(e,t,"encType",s.encType,s,null),Ae(e,t,"method",s.method,s,null),Ae(e,t,"target",s.target,s,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=os(""+l),e.setAttribute(a,l);break;case"onClick":l!=null&&(e.onclick=Jt);break;case"onScroll":l!=null&&xe("scroll",e);break;case"onScrollEnd":l!=null&&xe("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(a=l.__html,a!=null){if(s.children!=null)throw Error(c(60));e.innerHTML=a}}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}a=os(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);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(a,""+l):e.removeAttribute(a);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(a,""):e.removeAttribute(a);break;case"capture":case"download":l===!0?e.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,l):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(a,l):e.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(a):e.setAttribute(a,l);break;case"popover":xe("beforetoggle",e),xe("toggle",e),rs(e,"popover",l);break;case"xlinkActuate":Kt(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Kt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Kt(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Kt(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Kt(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Kt(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Kt(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Kt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Kt(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":rs(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Km.get(a)||a,rs(e,a,l))}}function Rc(e,t,a,l,s,i){switch(a){case"style":ku(e,l,i);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(a=l.__html,a!=null){if(s.children!=null)throw Error(c(60));e.innerHTML=a}}break;case"children":typeof l=="string"?fl(e,l):(typeof l=="number"||typeof l=="bigint")&&fl(e,""+l);break;case"onScroll":l!=null&&xe("scroll",e);break;case"onScrollEnd":l!=null&&xe("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Jt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ou.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(s=a.endsWith("Capture"),t=a.slice(2,s?a.length-7:void 0),i=e[ct]||null,i=i!=null?i[a]:null,typeof i=="function"&&e.removeEventListener(t,i,s),typeof l=="function")){typeof i!="function"&&i!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,l,s);break e}a in e?e[a]=l:l===!0?e.setAttribute(a,""):rs(e,a,l)}}}function at(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":xe("error",e),xe("load",e);var l=!1,s=!1,i;for(i in a)if(a.hasOwnProperty(i)){var d=a[i];if(d!=null)switch(i){case"src":l=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Ae(e,t,i,d,a,null)}}s&&Ae(e,t,"srcSet",a.srcSet,a,null),l&&Ae(e,t,"src",a.src,a,null);return;case"input":xe("invalid",e);var h=i=d=s=null,S=null,M=null;for(l in a)if(a.hasOwnProperty(l)){var B=a[l];if(B!=null)switch(l){case"name":s=B;break;case"type":d=B;break;case"checked":S=B;break;case"defaultChecked":M=B;break;case"value":i=B;break;case"defaultValue":h=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(c(137,t));break;default:Ae(e,t,l,B,a,null)}}Bu(e,i,h,S,M,d,s,!1);return;case"select":xe("invalid",e),l=d=i=null;for(s in a)if(a.hasOwnProperty(s)&&(h=a[s],h!=null))switch(s){case"value":i=h;break;case"defaultValue":d=h;break;case"multiple":l=h;default:Ae(e,t,s,h,a,null)}t=i,a=d,e.multiple=!!l,t!=null?dl(e,!!l,t,!1):a!=null&&dl(e,!!l,a,!0);return;case"textarea":xe("invalid",e),i=s=l=null;for(d in a)if(a.hasOwnProperty(d)&&(h=a[d],h!=null))switch(d){case"value":l=h;break;case"defaultValue":s=h;break;case"children":i=h;break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(c(91));break;default:Ae(e,t,d,h,a,null)}Yu(e,l,s,i);return;case"option":for(S in a)a.hasOwnProperty(S)&&(l=a[S],l!=null)&&(S==="selected"?e.selected=l&&typeof l!="function"&&typeof l!="symbol":Ae(e,t,S,l,a,null));return;case"dialog":xe("beforetoggle",e),xe("toggle",e),xe("cancel",e),xe("close",e);break;case"iframe":case"object":xe("load",e);break;case"video":case"audio":for(l=0;l<Un.length;l++)xe(Un[l],e);break;case"image":xe("error",e),xe("load",e);break;case"details":xe("toggle",e);break;case"embed":case"source":case"link":xe("error",e),xe("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(M in a)if(a.hasOwnProperty(M)&&(l=a[M],l!=null))switch(M){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Ae(e,t,M,l,a,null)}return;default:if(Gi(t)){for(B in a)a.hasOwnProperty(B)&&(l=a[B],l!==void 0&&Rc(e,t,B,l,a,void 0));return}}for(h in a)a.hasOwnProperty(h)&&(l=a[h],l!=null&&Ae(e,t,h,l,a,null))}function jh(e,t,a,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,i=null,d=null,h=null,S=null,M=null,B=null;for(D in a){var G=a[D];if(a.hasOwnProperty(D)&&G!=null)switch(D){case"checked":break;case"value":break;case"defaultValue":S=G;default:l.hasOwnProperty(D)||Ae(e,t,D,null,l,G)}}for(var z in l){var D=l[z];if(G=a[z],l.hasOwnProperty(z)&&(D!=null||G!=null))switch(z){case"type":i=D;break;case"name":s=D;break;case"checked":M=D;break;case"defaultChecked":B=D;break;case"value":d=D;break;case"defaultValue":h=D;break;case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(c(137,t));break;default:D!==G&&Ae(e,t,z,D,l,G)}}$i(e,d,h,S,M,B,i,s);return;case"select":D=d=h=z=null;for(i in a)if(S=a[i],a.hasOwnProperty(i)&&S!=null)switch(i){case"value":break;case"multiple":D=S;default:l.hasOwnProperty(i)||Ae(e,t,i,null,l,S)}for(s in l)if(i=l[s],S=a[s],l.hasOwnProperty(s)&&(i!=null||S!=null))switch(s){case"value":z=i;break;case"defaultValue":h=i;break;case"multiple":d=i;default:i!==S&&Ae(e,t,s,i,l,S)}t=h,a=d,l=D,z!=null?dl(e,!!a,z,!1):!!l!=!!a&&(t!=null?dl(e,!!a,t,!0):dl(e,!!a,a?[]:"",!1));return;case"textarea":D=z=null;for(h in a)if(s=a[h],a.hasOwnProperty(h)&&s!=null&&!l.hasOwnProperty(h))switch(h){case"value":break;case"children":break;default:Ae(e,t,h,null,l,s)}for(d in l)if(s=l[d],i=a[d],l.hasOwnProperty(d)&&(s!=null||i!=null))switch(d){case"value":z=s;break;case"defaultValue":D=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(c(91));break;default:s!==i&&Ae(e,t,d,s,l,i)}qu(e,z,D);return;case"option":for(var J in a)z=a[J],a.hasOwnProperty(J)&&z!=null&&!l.hasOwnProperty(J)&&(J==="selected"?e.selected=!1:Ae(e,t,J,null,l,z));for(S in l)z=l[S],D=a[S],l.hasOwnProperty(S)&&z!==D&&(z!=null||D!=null)&&(S==="selected"?e.selected=z&&typeof z!="function"&&typeof z!="symbol":Ae(e,t,S,z,l,D));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 ne in a)z=a[ne],a.hasOwnProperty(ne)&&z!=null&&!l.hasOwnProperty(ne)&&Ae(e,t,ne,null,l,z);for(M in l)if(z=l[M],D=a[M],l.hasOwnProperty(M)&&z!==D&&(z!=null||D!=null))switch(M){case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(c(137,t));break;default:Ae(e,t,M,z,l,D)}return;default:if(Gi(t)){for(var Re in a)z=a[Re],a.hasOwnProperty(Re)&&z!==void 0&&!l.hasOwnProperty(Re)&&Rc(e,t,Re,void 0,l,z);for(B in l)z=l[B],D=a[B],!l.hasOwnProperty(B)||z===D||z===void 0&&D===void 0||Rc(e,t,B,z,l,D);return}}for(var w in a)z=a[w],a.hasOwnProperty(w)&&z!=null&&!l.hasOwnProperty(w)&&Ae(e,t,w,null,l,z);for(G in l)z=l[G],D=a[G],!l.hasOwnProperty(G)||z===D||z==null&&D==null||Ae(e,t,G,z,l,D)}function Xf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Nh(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var s=a[l],i=s.transferSize,d=s.initiatorType,h=s.duration;if(i&&h&&Xf(d)){for(d=0,h=s.responseEnd,l+=1;l<a.length;l++){var S=a[l],M=S.startTime;if(M>h)break;var B=S.transferSize,G=S.initiatorType;B&&Xf(G)&&(S=S.responseEnd,d+=B*(S<h?1:(h-M)/(S-M)))}if(--l,t+=8*(i+d)/(s.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 Mc=null,_c=null;function si(e){return e.nodeType===9?e:e.ownerDocument}function Qf(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 Zf(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 zc(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 Oc=null;function Sh(){var e=window.event;return e&&e.type==="popstate"?e===Oc?!1:(Oc=e,!0):(Oc=null,!1)}var Kf=typeof setTimeout=="function"?setTimeout:void 0,Eh=typeof clearTimeout=="function"?clearTimeout:void 0,Jf=typeof Promise=="function"?Promise:void 0,Ch=typeof queueMicrotask=="function"?queueMicrotask:typeof Jf<"u"?function(e){return Jf.resolve(null).then(e).catch(Th)}:Kf;function Th(e){setTimeout(function(){throw e})}function Oa(e){return e==="head"}function Wf(e,t){var a=t,l=0;do{var s=a.nextSibling;if(e.removeChild(a),s&&s.nodeType===8)if(a=s.data,a==="/$"||a==="/&"){if(l===0){e.removeChild(s),Gl(t);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")Hn(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Hn(a);for(var i=a.firstChild;i;){var d=i.nextSibling,h=i.nodeName;i[en]||h==="SCRIPT"||h==="STYLE"||h==="LINK"&&i.rel.toLowerCase()==="stylesheet"||a.removeChild(i),i=d}}else a==="body"&&Hn(e.ownerDocument.body);a=s}while(a);Gl(t)}function Ff(e,t){var a=e;e=0;do{var l=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=l}while(a)}function Dc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Dc(a),qi(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function wh(e,t,a,l){for(;e.nodeType===1;){var s=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[en])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(i=e.getAttribute("src"),(i!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=Ot(e.nextSibling),e===null)break}return null}function Ah(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Ot(e.nextSibling),e===null))return null;return e}function Pf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ot(e.nextSibling),e===null))return null;return e}function Uc(e){return e.data==="$?"||e.data==="$~"}function Lc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Rh(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var l=function(){t(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Ot(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 If(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Ot(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function e0(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function t0(e,t,a){switch(t=si(a),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function Hn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);qi(e)}var Dt=new Map,a0=new Set;function ii(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var da=Q.d;Q.d={f:Mh,r:_h,D:zh,C:Oh,L:Dh,m:Uh,X:Hh,S:Lh,M:Bh};function Mh(){var e=da.f(),t=Fs();return e||t}function _h(e){var t=cl(e);t!==null&&t.tag===5&&t.type==="form"?pd(t):da.r(e)}var Yl=typeof document>"u"?null:document;function l0(e,t,a){var l=Yl;if(l&&typeof t=="string"&&t){var s=Tt(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof a=="string"&&(s+='[crossorigin="'+a+'"]'),a0.has(s)||(a0.add(s),e={rel:e,crossOrigin:a,href:t},l.querySelector(s)===null&&(t=l.createElement("link"),at(t,"link",e),We(t),l.head.appendChild(t)))}}function zh(e){da.D(e),l0("dns-prefetch",e,null)}function Oh(e,t){da.C(e,t),l0("preconnect",e,t)}function Dh(e,t,a){da.L(e,t,a);var l=Yl;if(l&&e&&t){var s='link[rel="preload"][as="'+Tt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(s+='[imagesrcset="'+Tt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(s+='[imagesizes="'+Tt(a.imageSizes)+'"]')):s+='[href="'+Tt(e)+'"]';var i=s;switch(t){case"style":i=$l(e);break;case"script":i=kl(e)}Dt.has(i)||(e=y({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Dt.set(i,e),l.querySelector(s)!==null||t==="style"&&l.querySelector(Bn(i))||t==="script"&&l.querySelector(qn(i))||(t=l.createElement("link"),at(t,"link",e),We(t),l.head.appendChild(t)))}}function Uh(e,t){da.m(e,t);var a=Yl;if(a&&e){var l=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Tt(l)+'"][href="'+Tt(e)+'"]',i=s;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=kl(e)}if(!Dt.has(i)&&(e=y({rel:"modulepreload",href:e},t),Dt.set(i,e),a.querySelector(s)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(qn(i)))return}l=a.createElement("link"),at(l,"link",e),We(l),a.head.appendChild(l)}}}function Lh(e,t,a){da.S(e,t,a);var l=Yl;if(l&&e){var s=ul(l).hoistableStyles,i=$l(e);t=t||"default";var d=s.get(i);if(!d){var h={loading:0,preload:null};if(d=l.querySelector(Bn(i)))h.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Dt.get(i))&&Bc(e,a);var S=d=l.createElement("link");We(S),at(S,"link",e),S._p=new Promise(function(M,B){S.onload=M,S.onerror=B}),S.addEventListener("load",function(){h.loading|=1}),S.addEventListener("error",function(){h.loading|=2}),h.loading|=4,ri(d,t,l)}d={type:"stylesheet",instance:d,count:1,state:h},s.set(i,d)}}}function Hh(e,t){da.X(e,t);var a=Yl;if(a&&e){var l=ul(a).hoistableScripts,s=kl(e),i=l.get(s);i||(i=a.querySelector(qn(s)),i||(e=y({src:e,async:!0},t),(t=Dt.get(s))&&qc(e,t),i=a.createElement("script"),We(i),at(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(s,i))}}function Bh(e,t){da.M(e,t);var a=Yl;if(a&&e){var l=ul(a).hoistableScripts,s=kl(e),i=l.get(s);i||(i=a.querySelector(qn(s)),i||(e=y({src:e,async:!0,type:"module"},t),(t=Dt.get(s))&&qc(e,t),i=a.createElement("script"),We(i),at(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},l.set(s,i))}}function n0(e,t,a,l){var s=(s=fe.current)?ii(s):null;if(!s)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=$l(a.href),a=ul(s).hoistableStyles,l=a.get(t),l||(l={type:"style",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=$l(a.href);var i=ul(s).hoistableStyles,d=i.get(e);if(d||(s=s.ownerDocument||s,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,d),(i=s.querySelector(Bn(e)))&&!i._p&&(d.instance=i,d.state.loading=5),Dt.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Dt.set(e,a),i||qh(s,e,a,d.state))),t&&l===null)throw Error(c(528,""));return d}if(t&&l!==null)throw Error(c(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=kl(a),a=ul(s).hoistableScripts,l=a.get(t),l||(l={type:"script",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function $l(e){return'href="'+Tt(e)+'"'}function Bn(e){return'link[rel="stylesheet"]['+e+"]"}function s0(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function qh(e,t,a,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}),at(t,"link",a),We(t),e.head.appendChild(t))}function kl(e){return'[src="'+Tt(e)+'"]'}function qn(e){return"script[async]"+e}function i0(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Tt(a.href)+'"]');if(l)return t.instance=l,We(l),l;var s=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),We(l),at(l,"style",s),ri(l,a.precedence,e),t.instance=l;case"stylesheet":s=$l(a.href);var i=e.querySelector(Bn(s));if(i)return t.state.loading|=4,t.instance=i,We(i),i;l=s0(a),(s=Dt.get(s))&&Bc(l,s),i=(e.ownerDocument||e).createElement("link"),We(i);var d=i;return d._p=new Promise(function(h,S){d.onload=h,d.onerror=S}),at(i,"link",l),t.state.loading|=4,ri(i,a.precedence,e),t.instance=i;case"script":return i=kl(a.src),(s=e.querySelector(qn(i)))?(t.instance=s,We(s),s):(l=a,(s=Dt.get(i))&&(l=y({},a),qc(l,s)),e=e.ownerDocument||e,s=e.createElement("script"),We(s),at(s,"link",l),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,ri(l,a.precedence,e));return t.instance}function ri(e,t,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=l.length?l[l.length-1]:null,i=s,d=0;d<l.length;d++){var h=l[d];if(h.dataset.precedence===t)i=h;else if(i!==s)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Bc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function qc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ci=null;function r0(e,t,a){if(ci===null){var l=new Map,s=ci=new Map;s.set(a,l)}else s=ci,l=s.get(a),l||(l=new Map,s.set(a,l));if(l.has(e))return l;for(l.set(e,null),a=a.getElementsByTagName(e),s=0;s<a.length;s++){var i=a[s];if(!(i[en]||i[Pe]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var d=i.getAttribute(t)||"";d=e+d;var h=l.get(d);h?h.push(i):l.set(d,[i])}}return l}function c0(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Yh(e,t,a){if(a===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 u0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function $h(e,t,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var s=$l(l.href),i=t.querySelector(Bn(s));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ui.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=i,We(i);return}i=t.ownerDocument||t,l=s0(l),(s=Dt.get(s))&&Bc(l,s),i=i.createElement("link"),We(i);var d=i;d._p=new Promise(function(h,S){d.onload=h,d.onerror=S}),at(i,"link",l),a.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=ui.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Yc=0;function kh(e,t){return e.stylesheets&&e.count===0&&di(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var l=setTimeout(function(){if(e.stylesheets&&di(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&Yc===0&&(Yc=62500*Nh());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&di(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>Yc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(s)}}:null}function ui(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)di(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var oi=null;function di(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,oi=new Map,t.forEach(Gh,e),oi=null,ui.call(e))}function Gh(e,t){if(!(t.state.loading&4)){var a=oi.get(e);if(a)var l=a.get(null);else{a=new Map,oi.set(e,a);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<s.length;i++){var d=s[i];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(a.set(d.dataset.precedence,d),l=d)}l&&a.set(null,l)}s=t.instance,d=s.getAttribute("data-precedence"),i=a.get(d)||l,i===l&&a.set(null,s),a.set(d,s),this.count++,l=ui.bind(this),s.addEventListener("load",l),s.addEventListener("error",l),i?i.parentNode.insertBefore(s,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var Yn={$$typeof:L,Provider:null,Consumer:null,_currentValue:le,_currentValue2:le,_threadCount:0};function Vh(e,t,a,l,s,i,d,h,S){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=Ui(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ui(0),this.hiddenUpdates=Ui(null),this.identifierPrefix=l,this.onUncaughtError=s,this.onCaughtError=i,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function o0(e,t,a,l,s,i,d,h,S,M,B,G){return e=new Vh(e,t,a,d,S,M,B,G,h),t=1,i===!0&&(t|=24),i=vt(3,null,null,t),e.current=i,i.stateNode=e,t=vr(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:l,isDehydrated:a,cache:t},Sr(i),e}function d0(e){return e?(e=vl,e):vl}function f0(e,t,a,l,s,i){s=d0(s),l.context===null?l.context=s:l.pendingContext=s,l=Na(t),l.payload={element:a},i=i===void 0?null:i,i!==null&&(l.callback=i),a=Sa(e,l,t),a!==null&&(xt(a,e,t),pn(a,e,t))}function m0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function $c(e,t){m0(e,t),(e=e.alternate)&&m0(e,t)}function x0(e){if(e.tag===13||e.tag===31){var t=Za(e,67108864);t!==null&&xt(t,e,67108864),$c(e,67108864)}}function h0(e){if(e.tag===13||e.tag===31){var t=Et();t=Li(t);var a=Za(e,t);a!==null&&xt(a,e,t),$c(e,t)}}var fi=!0;function Xh(e,t,a,l){var s=H.T;H.T=null;var i=Q.p;try{Q.p=2,kc(e,t,a,l)}finally{Q.p=i,H.T=s}}function Qh(e,t,a,l){var s=H.T;H.T=null;var i=Q.p;try{Q.p=8,kc(e,t,a,l)}finally{Q.p=i,H.T=s}}function kc(e,t,a,l){if(fi){var s=Gc(l);if(s===null)Ac(e,t,l,mi,a),y0(e,l);else if(Kh(s,e,t,a,l))l.stopPropagation();else if(y0(e,l),t&4&&-1<Zh.indexOf(e)){for(;s!==null;){var i=cl(s);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var d=ka(i.pendingLanes);if(d!==0){var h=i;for(h.pendingLanes|=2,h.entangledLanes|=2;d;){var S=1<<31-yt(d);h.entanglements[1]|=S,d&=~S}Gt(i),(Ne&6)===0&&(Js=ht()+500,Dn(0))}}break;case 31:case 13:h=Za(i,2),h!==null&&xt(h,i,2),Fs(),$c(i,2)}if(i=Gc(l),i===null&&Ac(e,t,l,mi,a),i===s)break;s=i}s!==null&&l.stopPropagation()}else Ac(e,t,l,null,a)}}function Gc(e){return e=Xi(e),Vc(e)}var mi=null;function Vc(e){if(mi=null,e=rl(e),e!==null){var t=m(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=g(t),e!==null)return e;e=null}else if(a===31){if(e=j(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return mi=e,null}function g0(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(zm()){case Nu:return 2;case Su:return 8;case as:case Om:return 32;case Eu:return 268435456;default:return 32}default:return 32}}var Xc=!1,Da=null,Ua=null,La=null,$n=new Map,kn=new Map,Ha=[],Zh="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 y0(e,t){switch(e){case"focusin":case"focusout":Da=null;break;case"dragenter":case"dragleave":Ua=null;break;case"mouseover":case"mouseout":La=null;break;case"pointerover":case"pointerout":$n.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":kn.delete(t.pointerId)}}function Gn(e,t,a,l,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:a,eventSystemFlags:l,nativeEvent:i,targetContainers:[s]},t!==null&&(t=cl(t),t!==null&&x0(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Kh(e,t,a,l,s){switch(t){case"focusin":return Da=Gn(Da,e,t,a,l,s),!0;case"dragenter":return Ua=Gn(Ua,e,t,a,l,s),!0;case"mouseover":return La=Gn(La,e,t,a,l,s),!0;case"pointerover":var i=s.pointerId;return $n.set(i,Gn($n.get(i)||null,e,t,a,l,s)),!0;case"gotpointercapture":return i=s.pointerId,kn.set(i,Gn(kn.get(i)||null,e,t,a,l,s)),!0}return!1}function p0(e){var t=rl(e.target);if(t!==null){var a=m(t);if(a!==null){if(t=a.tag,t===13){if(t=g(a),t!==null){e.blockedOn=t,Mu(e.priority,function(){h0(a)});return}}else if(t===31){if(t=j(a),t!==null){e.blockedOn=t,Mu(e.priority,function(){h0(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function xi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Gc(e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);Vi=l,a.target.dispatchEvent(l),Vi=null}else return t=cl(a),t!==null&&x0(t),e.blockedOn=a,!1;t.shift()}return!0}function v0(e,t,a){xi(e)&&a.delete(t)}function Jh(){Xc=!1,Da!==null&&xi(Da)&&(Da=null),Ua!==null&&xi(Ua)&&(Ua=null),La!==null&&xi(La)&&(La=null),$n.forEach(v0),kn.forEach(v0)}function hi(e,t){e.blockedOn===t&&(e.blockedOn=null,Xc||(Xc=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Jh)))}var gi=null;function b0(e){gi!==e&&(gi=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){gi===e&&(gi=null);for(var t=0;t<e.length;t+=3){var a=e[t],l=e[t+1],s=e[t+2];if(typeof l!="function"){if(Vc(l||a)===null)continue;break}var i=cl(a);i!==null&&(e.splice(t,3),t-=3,Gr(i,{pending:!0,data:s,method:a.method,action:l},l,s))}}))}function Gl(e){function t(S){return hi(S,e)}Da!==null&&hi(Da,e),Ua!==null&&hi(Ua,e),La!==null&&hi(La,e),$n.forEach(t),kn.forEach(t);for(var a=0;a<Ha.length;a++){var l=Ha[a];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Ha.length&&(a=Ha[0],a.blockedOn===null);)p0(a),a.blockedOn===null&&Ha.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var s=a[l],i=a[l+1],d=s[ct]||null;if(typeof i=="function")d||b0(a);else if(d){var h=null;if(i&&i.hasAttribute("formAction")){if(s=i,d=i[ct]||null)h=d.formAction;else if(Vc(s)!==null)continue}else h=d.action;typeof h=="function"?a[l+1]=h:(a.splice(l,3),l-=3),b0(a)}}}function j0(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(d){return s=d})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),l||setTimeout(a,20)}function a(){if(!l&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function Qc(e){this._internalRoot=e}yi.prototype.render=Qc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var a=t.current,l=Et();f0(a,l,e,t,null,null)},yi.prototype.unmount=Qc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;f0(e.current,2,null,e,null,null),Fs(),t[il]=null}};function yi(e){this._internalRoot=e}yi.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ru();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Ha.length&&t!==0&&t<Ha[a].priority;a++);Ha.splice(a,0,e),a===0&&p0(e)}};var N0=o.version;if(N0!=="19.2.4")throw Error(c(527,N0,"19.2.4"));Q.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=x(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var Wh={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var pi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pi.isDisabled&&pi.supportsFiber)try{Fl=pi.inject(Wh),gt=pi}catch{}}return Xn.createRoot=function(e,t){if(!f(e))throw Error(c(299));var a=!1,l="",s=Ad,i=Rd,d=Md;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=o0(e,1,!1,null,null,a,l,null,s,i,d,j0),e[il]=t.current,wc(e),new Qc(t)},Xn.hydrateRoot=function(e,t,a){if(!f(e))throw Error(c(299));var l=!1,s="",i=Ad,d=Rd,h=Md,S=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(s=a.identifierPrefix),a.onUncaughtError!==void 0&&(i=a.onUncaughtError),a.onCaughtError!==void 0&&(d=a.onCaughtError),a.onRecoverableError!==void 0&&(h=a.onRecoverableError),a.formState!==void 0&&(S=a.formState)),t=o0(e,1,!0,t,a??null,l,s,S,i,d,h,j0),t.context=d0(null),a=t.current,l=Et(),l=Li(l),s=Na(l),s.callback=null,Sa(a,s,l),a=l,t.current.lanes=a,Il(t,a),Gt(t),e[il]=t.current,wc(e),new yi(t)},Xn.version="19.2.4",Xn}var z0;function ig(){if(z0)return Jc.exports;z0=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(o){console.error(o)}}return r(),Jc.exports=sg(),Jc.exports}var rg=ig();var O0="popstate";function D0(r){return typeof r=="object"&&r!=null&&"pathname"in r&&"search"in r&&"hash"in r&&"state"in r&&"key"in r}function cg(r={}){function o(c,f){let m=f.state?.masked,{pathname:g,search:j,hash:p}=m||c.location;return iu("",{pathname:g,search:j,hash:p},f.state&&f.state.usr||null,f.state&&f.state.key||"default",m?{pathname:c.location.pathname,search:c.location.search,hash:c.location.hash}:void 0)}function u(c,f){return typeof f=="string"?f:Wn(f)}return og(o,u,null,r)}function Ue(r,o){if(r===!1||r===null||typeof r>"u")throw new Error(o)}function qt(r,o){if(!r){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function ug(){return Math.random().toString(36).substring(2,10)}function U0(r,o){return{usr:r.state,key:r.key,idx:o,masked:r.unstable_mask?{pathname:r.pathname,search:r.search,hash:r.hash}:void 0}}function iu(r,o,u=null,c,f){return{pathname:typeof r=="string"?r:r.pathname,search:"",hash:"",...typeof o=="string"?Zl(o):o,state:u,key:o&&o.key||c||ug(),unstable_mask:f}}function Wn({pathname:r="/",search:o="",hash:u=""}){return o&&o!=="?"&&(r+=o.charAt(0)==="?"?o:"?"+o),u&&u!=="#"&&(r+=u.charAt(0)==="#"?u:"#"+u),r}function Zl(r){let o={};if(r){let u=r.indexOf("#");u>=0&&(o.hash=r.substring(u),r=r.substring(0,u));let c=r.indexOf("?");c>=0&&(o.search=r.substring(c),r=r.substring(0,c)),r&&(o.pathname=r)}return o}function og(r,o,u,c={}){let{window:f=document.defaultView,v5Compat:m=!1}=c,g=f.history,j="POP",p=null,x=v();x==null&&(x=0,g.replaceState({...g.state,idx:x},""));function v(){return(g.state||{idx:null}).idx}function y(){j="POP";let T=v(),q=T==null?null:T-x;x=T,p&&p({action:j,location:O.location,delta:q})}function E(T,q){j="PUSH";let A=D0(T)?T:iu(O.location,T,q);x=v()+1;let L=U0(A,x),te=O.createHref(A.unstable_mask||A);try{g.pushState(L,"",te)}catch(K){if(K instanceof DOMException&&K.name==="DataCloneError")throw K;f.location.assign(te)}m&&p&&p({action:j,location:O.location,delta:1})}function _(T,q){j="REPLACE";let A=D0(T)?T:iu(O.location,T,q);x=v();let L=U0(A,x),te=O.createHref(A.unstable_mask||A);g.replaceState(L,"",te),m&&p&&p({action:j,location:O.location,delta:0})}function U(T){return dg(T)}let O={get action(){return j},get location(){return r(f,g)},listen(T){if(p)throw new Error("A history only accepts one active listener");return f.addEventListener(O0,y),p=T,()=>{f.removeEventListener(O0,y),p=null}},createHref(T){return o(f,T)},createURL:U,encodeLocation(T){let q=U(T);return{pathname:q.pathname,search:q.search,hash:q.hash}},push:E,replace:_,go(T){return g.go(T)}};return O}function dg(r,o=!1){let u="http://localhost";typeof window<"u"&&(u=window.location.origin!=="null"?window.location.origin:window.location.href),Ue(u,"No window.location.(origin|href) available to create URL");let c=typeof r=="string"?r:Wn(r);return c=c.replace(/ $/,"%20"),!o&&c.startsWith("//")&&(c=u+c),new URL(c,u)}function I0(r,o,u="/"){return fg(r,o,u,!1)}function fg(r,o,u,c){let f=typeof o=="string"?Zl(o):o,m=ma(f.pathname||"/",u);if(m==null)return null;let g=em(r);mg(g);let j=null;for(let p=0;j==null&&p<g.length;++p){let x=Eg(m);j=Ng(g[p],x,c)}return j}function em(r,o=[],u=[],c="",f=!1){let m=(g,j,p=f,x)=>{let v={relativePath:x===void 0?g.path||"":x,caseSensitive:g.caseSensitive===!0,childrenIndex:j,route:g};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(c)&&p)return;Ue(v.relativePath.startsWith(c),`Absolute route path "${v.relativePath}" nested under path "${c}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(c.length)}let y=Vt([c,v.relativePath]),E=u.concat(v);g.children&&g.children.length>0&&(Ue(g.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),em(g.children,o,E,y,p)),!(g.path==null&&!g.index)&&o.push({path:y,score:bg(y,g.index),routesMeta:E})};return r.forEach((g,j)=>{if(g.path===""||!g.path?.includes("?"))m(g,j);else for(let p of tm(g.path))m(g,j,!0,p)}),o}function tm(r){let o=r.split("/");if(o.length===0)return[];let[u,...c]=o,f=u.endsWith("?"),m=u.replace(/\?$/,"");if(c.length===0)return f?[m,""]:[m];let g=tm(c.join("/")),j=[];return j.push(...g.map(p=>p===""?m:[m,p].join("/"))),f&&j.push(...g),j.map(p=>r.startsWith("/")&&p===""?"/":p)}function mg(r){r.sort((o,u)=>o.score!==u.score?u.score-o.score:jg(o.routesMeta.map(c=>c.childrenIndex),u.routesMeta.map(c=>c.childrenIndex)))}var xg=/^:[\w-]+$/,hg=3,gg=2,yg=1,pg=10,vg=-2,L0=r=>r==="*";function bg(r,o){let u=r.split("/"),c=u.length;return u.some(L0)&&(c+=vg),o&&(c+=gg),u.filter(f=>!L0(f)).reduce((f,m)=>f+(xg.test(m)?hg:m===""?yg:pg),c)}function jg(r,o){return r.length===o.length&&r.slice(0,-1).every((c,f)=>c===o[f])?r[r.length-1]-o[o.length-1]:0}function Ng(r,o,u=!1){let{routesMeta:c}=r,f={},m="/",g=[];for(let j=0;j<c.length;++j){let p=c[j],x=j===c.length-1,v=m==="/"?o:o.slice(m.length)||"/",y=Si({path:p.relativePath,caseSensitive:p.caseSensitive,end:x},v),E=p.route;if(!y&&x&&u&&!c[c.length-1].route.index&&(y=Si({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},v)),!y)return null;Object.assign(f,y.params),g.push({params:f,pathname:Vt([m,y.pathname]),pathnameBase:Ag(Vt([m,y.pathnameBase])),route:E}),y.pathnameBase!=="/"&&(m=Vt([m,y.pathnameBase]))}return g}function Si(r,o){typeof r=="string"&&(r={path:r,caseSensitive:!1,end:!0});let[u,c]=Sg(r.path,r.caseSensitive,r.end),f=o.match(u);if(!f)return null;let m=f[0],g=m.replace(/(.)\/+$/,"$1"),j=f.slice(1);return{params:c.reduce((x,{paramName:v,isOptional:y},E)=>{if(v==="*"){let U=j[E]||"";g=m.slice(0,m.length-U.length).replace(/(.)\/+$/,"$1")}const _=j[E];return y&&!_?x[v]=void 0:x[v]=(_||"").replace(/%2F/g,"/"),x},{}),pathname:m,pathnameBase:g,pattern:r}}function Sg(r,o=!1,u=!0){qt(r==="*"||!r.endsWith("*")||r.endsWith("/*"),`Route path "${r}" will be treated as if it were "${r.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${r.replace(/\*$/,"/*")}".`);let c=[],f="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(g,j,p,x,v)=>{if(c.push({paramName:j,isOptional:p!=null}),p){let y=v.charAt(x+g.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return r.endsWith("*")?(c.push({paramName:"*"}),f+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):u?f+="\\/*$":r!==""&&r!=="/"&&(f+="(?:(?=\\/|$))"),[new RegExp(f,o?void 0:"i"),c]}function Eg(r){try{return r.split("/").map(o=>decodeURIComponent(o).replace(/\//g,"%2F")).join("/")}catch(o){return qt(!1,`The URL path "${r}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${o}).`),r}}function ma(r,o){if(o==="/")return r;if(!r.toLowerCase().startsWith(o.toLowerCase()))return null;let u=o.endsWith("/")?o.length-1:o.length,c=r.charAt(u);return c&&c!=="/"?null:r.slice(u)||"/"}var Cg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Tg(r,o="/"){let{pathname:u,search:c="",hash:f=""}=typeof r=="string"?Zl(r):r,m;return u?(u=u.replace(/\/\/+/g,"/"),u.startsWith("/")?m=H0(u.substring(1),"/"):m=H0(u,o)):m=o,{pathname:m,search:Rg(c),hash:Mg(f)}}function H0(r,o){let u=o.replace(/\/+$/,"").split("/");return r.split("/").forEach(f=>{f===".."?u.length>1&&u.pop():f!=="."&&u.push(f)}),u.length>1?u.join("/"):"/"}function Ic(r,o,u,c){return`Cannot include a '${r}' character in a manually specified \`to.${o}\` field [${JSON.stringify(c)}]. Please separate it out to the \`to.${u}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function wg(r){return r.filter((o,u)=>u===0||o.route.path&&o.route.path.length>0)}function am(r){let o=wg(r);return o.map((u,c)=>c===o.length-1?u.pathname:u.pathnameBase)}function ou(r,o,u,c=!1){let f;typeof r=="string"?f=Zl(r):(f={...r},Ue(!f.pathname||!f.pathname.includes("?"),Ic("?","pathname","search",f)),Ue(!f.pathname||!f.pathname.includes("#"),Ic("#","pathname","hash",f)),Ue(!f.search||!f.search.includes("#"),Ic("#","search","hash",f)));let m=r===""||f.pathname==="",g=m?"/":f.pathname,j;if(g==null)j=u;else{let y=o.length-1;if(!c&&g.startsWith("..")){let E=g.split("/");for(;E[0]==="..";)E.shift(),y-=1;f.pathname=E.join("/")}j=y>=0?o[y]:"/"}let p=Tg(f,j),x=g&&g!=="/"&&g.endsWith("/"),v=(m||g===".")&&u.endsWith("/");return!p.pathname.endsWith("/")&&(x||v)&&(p.pathname+="/"),p}var Vt=r=>r.join("/").replace(/\/\/+/g,"/"),Ag=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),Rg=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,Mg=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r,_g=class{constructor(r,o,u,c=!1){this.status=r,this.statusText=o||"",this.internal=c,u instanceof Error?(this.data=u.toString(),this.error=u):this.data=u}};function zg(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}function Og(r){return r.map(o=>o.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var lm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function nm(r,o){let u=r;if(typeof u!="string"||!Cg.test(u))return{absoluteURL:void 0,isExternal:!1,to:u};let c=u,f=!1;if(lm)try{let m=new URL(window.location.href),g=u.startsWith("//")?new URL(m.protocol+u):new URL(u),j=ma(g.pathname,o);g.origin===m.origin&&j!=null?u=j+g.search+g.hash:f=!0}catch{qt(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:c,isExternal:f,to:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var sm=["POST","PUT","PATCH","DELETE"];new Set(sm);var Dg=["GET",...sm];new Set(Dg);var Kl=N.createContext(null);Kl.displayName="DataRouter";var Ei=N.createContext(null);Ei.displayName="DataRouterState";var Ug=N.createContext(!1),im=N.createContext({isTransitioning:!1});im.displayName="ViewTransition";var Lg=N.createContext(new Map);Lg.displayName="Fetchers";var Hg=N.createContext(null);Hg.displayName="Await";var Ut=N.createContext(null);Ut.displayName="Navigation";var Fn=N.createContext(null);Fn.displayName="Location";var Xt=N.createContext({outlet:null,matches:[],isDataRoute:!1});Xt.displayName="Route";var du=N.createContext(null);du.displayName="RouteError";var rm="REACT_ROUTER_ERROR",Bg="REDIRECT",qg="ROUTE_ERROR_RESPONSE";function Yg(r){if(r.startsWith(`${rm}:${Bg}:{`))try{let o=JSON.parse(r.slice(28));if(typeof o=="object"&&o&&typeof o.status=="number"&&typeof o.statusText=="string"&&typeof o.location=="string"&&typeof o.reloadDocument=="boolean"&&typeof o.replace=="boolean")return o}catch{}}function $g(r){if(r.startsWith(`${rm}:${qg}:{`))try{let o=JSON.parse(r.slice(40));if(typeof o=="object"&&o&&typeof o.status=="number"&&typeof o.statusText=="string")return new _g(o.status,o.statusText,o.data)}catch{}}function kg(r,{relative:o}={}){Ue(Pn(),"useHref() may be used only in the context of a <Router> component.");let{basename:u,navigator:c}=N.useContext(Ut),{hash:f,pathname:m,search:g}=In(r,{relative:o}),j=m;return u!=="/"&&(j=m==="/"?u:Vt([u,m])),c.createHref({pathname:j,search:g,hash:f})}function Pn(){return N.useContext(Fn)!=null}function Qt(){return Ue(Pn(),"useLocation() may be used only in the context of a <Router> component."),N.useContext(Fn).location}var cm="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function um(r){N.useContext(Ut).static||N.useLayoutEffect(r)}function fu(){let{isDataRoute:r}=N.useContext(Xt);return r?ay():Gg()}function Gg(){Ue(Pn(),"useNavigate() may be used only in the context of a <Router> component.");let r=N.useContext(Kl),{basename:o,navigator:u}=N.useContext(Ut),{matches:c}=N.useContext(Xt),{pathname:f}=Qt(),m=JSON.stringify(am(c)),g=N.useRef(!1);return um(()=>{g.current=!0}),N.useCallback((p,x={})=>{if(qt(g.current,cm),!g.current)return;if(typeof p=="number"){u.go(p);return}let v=ou(p,JSON.parse(m),f,x.relative==="path");r==null&&o!=="/"&&(v.pathname=v.pathname==="/"?o:Vt([o,v.pathname])),(x.replace?u.replace:u.push)(v,x.state,x)},[o,u,m,f,r])}N.createContext(null);function Vg(){let{matches:r}=N.useContext(Xt),o=r[r.length-1];return o?o.params:{}}function In(r,{relative:o}={}){let{matches:u}=N.useContext(Xt),{pathname:c}=Qt(),f=JSON.stringify(am(u));return N.useMemo(()=>ou(r,JSON.parse(f),c,o==="path"),[r,f,c,o])}function Xg(r,o){return om(r,o)}function om(r,o,u){Ue(Pn(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:c}=N.useContext(Ut),{matches:f}=N.useContext(Xt),m=f[f.length-1],g=m?m.params:{},j=m?m.pathname:"/",p=m?m.pathnameBase:"/",x=m&&m.route;{let T=x&&x.path||"";fm(j,!x||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${j}" (under <Route path="${T}">) 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.
|
|
10
|
+
|
|
11
|
+
Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let v=Qt(),y;if(o){let T=typeof o=="string"?Zl(o):o;Ue(p==="/"||T.pathname?.startsWith(p),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${T.pathname}" was given in the \`location\` prop.`),y=T}else y=v;let E=y.pathname||"/",_=E;if(p!=="/"){let T=p.replace(/^\//,"").split("/");_="/"+E.replace(/^\//,"").split("/").slice(T.length).join("/")}let U=I0(r,{pathname:_});qt(x||U!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),qt(U==null||U[U.length-1].route.element!==void 0||U[U.length-1].route.Component!==void 0||U[U.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.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.`);let O=Wg(U&&U.map(T=>Object.assign({},T,{params:Object.assign({},g,T.params),pathname:Vt([p,c.encodeLocation?c.encodeLocation(T.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?p:Vt([p,c.encodeLocation?c.encodeLocation(T.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),f,u);return o&&O?N.createElement(Fn.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...y},navigationType:"POP"}},O):O}function Qg(){let r=ty(),o=zg(r)?`${r.status} ${r.statusText}`:r instanceof Error?r.message:JSON.stringify(r),u=r instanceof Error?r.stack:null,c="rgba(200,200,200, 0.5)",f={padding:"0.5rem",backgroundColor:c},m={padding:"2px 4px",backgroundColor:c},g=null;return console.error("Error handled by React Router default ErrorBoundary:",r),g=N.createElement(N.Fragment,null,N.createElement("p",null,"💿 Hey developer 👋"),N.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",N.createElement("code",{style:m},"ErrorBoundary")," or"," ",N.createElement("code",{style:m},"errorElement")," prop on your route.")),N.createElement(N.Fragment,null,N.createElement("h2",null,"Unexpected Application Error!"),N.createElement("h3",{style:{fontStyle:"italic"}},o),u?N.createElement("pre",{style:f},u):null,g)}var Zg=N.createElement(Qg,null),dm=class extends N.Component{constructor(r){super(r),this.state={location:r.location,revalidation:r.revalidation,error:r.error}}static getDerivedStateFromError(r){return{error:r}}static getDerivedStateFromProps(r,o){return o.location!==r.location||o.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:o.error,location:o.location,revalidation:r.revalidation||o.revalidation}}componentDidCatch(r,o){this.props.onError?this.props.onError(r,o):console.error("React Router caught the following error during render",r)}render(){let r=this.state.error;if(this.context&&typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){const u=$g(r.digest);u&&(r=u)}let o=r!==void 0?N.createElement(Xt.Provider,{value:this.props.routeContext},N.createElement(du.Provider,{value:r,children:this.props.component})):this.props.children;return this.context?N.createElement(Kg,{error:r},o):o}};dm.contextType=Ug;var eu=new WeakMap;function Kg({children:r,error:o}){let{basename:u}=N.useContext(Ut);if(typeof o=="object"&&o&&"digest"in o&&typeof o.digest=="string"){let c=Yg(o.digest);if(c){let f=eu.get(o);if(f)throw f;let m=nm(c.location,u);if(lm&&!eu.get(o))if(m.isExternal||c.reloadDocument)window.location.href=m.absoluteURL||m.to;else{const g=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(m.to,{replace:c.replace}));throw eu.set(o,g),g}return N.createElement("meta",{httpEquiv:"refresh",content:`0;url=${m.absoluteURL||m.to}`})}}return r}function Jg({routeContext:r,match:o,children:u}){let c=N.useContext(Kl);return c&&c.static&&c.staticContext&&(o.route.errorElement||o.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=o.route.id),N.createElement(Xt.Provider,{value:r},u)}function Wg(r,o=[],u){let c=u?.state;if(r==null){if(!c)return null;if(c.errors)r=c.matches;else if(o.length===0&&!c.initialized&&c.matches.length>0)r=c.matches;else return null}let f=r,m=c?.errors;if(m!=null){let v=f.findIndex(y=>y.route.id&&m?.[y.route.id]!==void 0);Ue(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(m).join(",")}`),f=f.slice(0,Math.min(f.length,v+1))}let g=!1,j=-1;if(u&&c){g=c.renderFallback;for(let v=0;v<f.length;v++){let y=f[v];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(j=v),y.route.id){let{loaderData:E,errors:_}=c,U=y.route.loader&&!E.hasOwnProperty(y.route.id)&&(!_||_[y.route.id]===void 0);if(y.route.lazy||U){u.isStatic&&(g=!0),j>=0?f=f.slice(0,j+1):f=[f[0]];break}}}}let p=u?.onError,x=c&&p?(v,y)=>{p(v,{location:c.location,params:c.matches?.[0]?.params??{},unstable_pattern:Og(c.matches),errorInfo:y})}:void 0;return f.reduceRight((v,y,E)=>{let _,U=!1,O=null,T=null;c&&(_=m&&y.route.id?m[y.route.id]:void 0,O=y.route.errorElement||Zg,g&&(j<0&&E===0?(fm("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),U=!0,T=null):j===E&&(U=!0,T=y.route.hydrateFallbackElement||null)));let q=o.concat(f.slice(0,E+1)),A=()=>{let L;return _?L=O:U?L=T:y.route.Component?L=N.createElement(y.route.Component,null):y.route.element?L=y.route.element:L=v,N.createElement(Jg,{match:y,routeContext:{outlet:v,matches:q,isDataRoute:c!=null},children:L})};return c&&(y.route.ErrorBoundary||y.route.errorElement||E===0)?N.createElement(dm,{location:c.location,revalidation:c.revalidation,component:O,error:_,children:A(),routeContext:{outlet:null,matches:q,isDataRoute:!0},onError:x}):A()},null)}function mu(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Fg(r){let o=N.useContext(Kl);return Ue(o,mu(r)),o}function Pg(r){let o=N.useContext(Ei);return Ue(o,mu(r)),o}function Ig(r){let o=N.useContext(Xt);return Ue(o,mu(r)),o}function xu(r){let o=Ig(r),u=o.matches[o.matches.length-1];return Ue(u.route.id,`${r} can only be used on routes that contain a unique "id"`),u.route.id}function ey(){return xu("useRouteId")}function ty(){let r=N.useContext(du),o=Pg("useRouteError"),u=xu("useRouteError");return r!==void 0?r:o.errors?.[u]}function ay(){let{router:r}=Fg("useNavigate"),o=xu("useNavigate"),u=N.useRef(!1);return um(()=>{u.current=!0}),N.useCallback(async(f,m={})=>{qt(u.current,cm),u.current&&(typeof f=="number"?await r.navigate(f):await r.navigate(f,{fromRouteId:o,...m}))},[r,o])}var B0={};function fm(r,o,u){!o&&!B0[r]&&(B0[r]=!0,qt(!1,u))}N.memo(ly);function ly({routes:r,future:o,state:u,isStatic:c,onError:f}){return om(r,void 0,{state:u,isStatic:c,onError:f})}function st(r){Ue(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function ny({basename:r="/",children:o=null,location:u,navigationType:c="POP",navigator:f,static:m=!1,unstable_useTransitions:g}){Ue(!Pn(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let j=r.replace(/^\/*/,"/"),p=N.useMemo(()=>({basename:j,navigator:f,static:m,unstable_useTransitions:g,future:{}}),[j,f,m,g]);typeof u=="string"&&(u=Zl(u));let{pathname:x="/",search:v="",hash:y="",state:E=null,key:_="default",unstable_mask:U}=u,O=N.useMemo(()=>{let T=ma(x,j);return T==null?null:{location:{pathname:T,search:v,hash:y,state:E,key:_,unstable_mask:U},navigationType:c}},[j,x,v,y,E,_,c,U]);return qt(O!=null,`<Router basename="${j}"> is not able to match the URL "${x}${v}${y}" because it does not start with the basename, so the <Router> won't render anything.`),O==null?null:N.createElement(Ut.Provider,{value:p},N.createElement(Fn.Provider,{children:o,value:O}))}function sy({children:r,location:o}){return Xg(ru(r),o)}function ru(r,o=[]){let u=[];return N.Children.forEach(r,(c,f)=>{if(!N.isValidElement(c))return;let m=[...o,f];if(c.type===N.Fragment){u.push.apply(u,ru(c.props.children,m));return}Ue(c.type===st,`[${typeof c.type=="string"?c.type:c.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ue(!c.props.index||!c.props.children,"An index route cannot have child routes.");let g={id:c.props.id||m.join("-"),caseSensitive:c.props.caseSensitive,element:c.props.element,Component:c.props.Component,index:c.props.index,path:c.props.path,middleware:c.props.middleware,loader:c.props.loader,action:c.props.action,hydrateFallbackElement:c.props.hydrateFallbackElement,HydrateFallback:c.props.HydrateFallback,errorElement:c.props.errorElement,ErrorBoundary:c.props.ErrorBoundary,hasErrorBoundary:c.props.hasErrorBoundary===!0||c.props.ErrorBoundary!=null||c.props.errorElement!=null,shouldRevalidate:c.props.shouldRevalidate,handle:c.props.handle,lazy:c.props.lazy};c.props.children&&(g.children=ru(c.props.children,m)),u.push(g)}),u}var ji="get",Ni="application/x-www-form-urlencoded";function Ci(r){return typeof HTMLElement<"u"&&r instanceof HTMLElement}function iy(r){return Ci(r)&&r.tagName.toLowerCase()==="button"}function ry(r){return Ci(r)&&r.tagName.toLowerCase()==="form"}function cy(r){return Ci(r)&&r.tagName.toLowerCase()==="input"}function uy(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function oy(r,o){return r.button===0&&(!o||o==="_self")&&!uy(r)}function cu(r=""){return new URLSearchParams(typeof r=="string"||Array.isArray(r)||r instanceof URLSearchParams?r:Object.keys(r).reduce((o,u)=>{let c=r[u];return o.concat(Array.isArray(c)?c.map(f=>[u,f]):[[u,c]])},[]))}function dy(r,o){let u=cu(r);return o&&o.forEach((c,f)=>{u.has(f)||o.getAll(f).forEach(m=>{u.append(f,m)})}),u}var vi=null;function fy(){if(vi===null)try{new FormData(document.createElement("form"),0),vi=!1}catch{vi=!0}return vi}var my=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function tu(r){return r!=null&&!my.has(r)?(qt(!1,`"${r}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ni}"`),null):r}function xy(r,o){let u,c,f,m,g;if(ry(r)){let j=r.getAttribute("action");c=j?ma(j,o):null,u=r.getAttribute("method")||ji,f=tu(r.getAttribute("enctype"))||Ni,m=new FormData(r)}else if(iy(r)||cy(r)&&(r.type==="submit"||r.type==="image")){let j=r.form;if(j==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=r.getAttribute("formaction")||j.getAttribute("action");if(c=p?ma(p,o):null,u=r.getAttribute("formmethod")||j.getAttribute("method")||ji,f=tu(r.getAttribute("formenctype"))||tu(j.getAttribute("enctype"))||Ni,m=new FormData(j,r),!fy()){let{name:x,type:v,value:y}=r;if(v==="image"){let E=x?`${x}.`:"";m.append(`${E}x`,"0"),m.append(`${E}y`,"0")}else x&&m.append(x,y)}}else{if(Ci(r))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');u=ji,c=null,f=Ni,g=r}return m&&f==="text/plain"&&(g=m,m=void 0),{action:c,method:u.toLowerCase(),encType:f,formData:m,body:g}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function hu(r,o){if(r===!1||r===null||typeof r>"u")throw new Error(o)}function hy(r,o,u,c){let f=typeof r=="string"?new URL(r,typeof window>"u"?"server://singlefetch/":window.location.origin):r;return u?f.pathname.endsWith("/")?f.pathname=`${f.pathname}_.${c}`:f.pathname=`${f.pathname}.${c}`:f.pathname==="/"?f.pathname=`_root.${c}`:o&&ma(f.pathname,o)==="/"?f.pathname=`${o.replace(/\/$/,"")}/_root.${c}`:f.pathname=`${f.pathname.replace(/\/$/,"")}.${c}`,f}async function gy(r,o){if(r.id in o)return o[r.id];try{let u=await import(r.module);return o[r.id]=u,u}catch(u){return console.error(`Error loading route module \`${r.module}\`, reloading page...`),console.error(u),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function yy(r){return r==null?!1:r.href==null?r.rel==="preload"&&typeof r.imageSrcSet=="string"&&typeof r.imageSizes=="string":typeof r.rel=="string"&&typeof r.href=="string"}async function py(r,o,u){let c=await Promise.all(r.map(async f=>{let m=o.routes[f.route.id];if(m){let g=await gy(m,u);return g.links?g.links():[]}return[]}));return Ny(c.flat(1).filter(yy).filter(f=>f.rel==="stylesheet"||f.rel==="preload").map(f=>f.rel==="stylesheet"?{...f,rel:"prefetch",as:"style"}:{...f,rel:"prefetch"}))}function q0(r,o,u,c,f,m){let g=(p,x)=>u[x]?p.route.id!==u[x].route.id:!0,j=(p,x)=>u[x].pathname!==p.pathname||u[x].route.path?.endsWith("*")&&u[x].params["*"]!==p.params["*"];return m==="assets"?o.filter((p,x)=>g(p,x)||j(p,x)):m==="data"?o.filter((p,x)=>{let v=c.routes[p.route.id];if(!v||!v.hasLoader)return!1;if(g(p,x)||j(p,x))return!0;if(p.route.shouldRevalidate){let y=p.route.shouldRevalidate({currentUrl:new URL(f.pathname+f.search+f.hash,window.origin),currentParams:u[0]?.params||{},nextUrl:new URL(r,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function vy(r,o,{includeHydrateFallback:u}={}){return by(r.map(c=>{let f=o.routes[c.route.id];if(!f)return[];let m=[f.module];return f.clientActionModule&&(m=m.concat(f.clientActionModule)),f.clientLoaderModule&&(m=m.concat(f.clientLoaderModule)),u&&f.hydrateFallbackModule&&(m=m.concat(f.hydrateFallbackModule)),f.imports&&(m=m.concat(f.imports)),m}).flat(1))}function by(r){return[...new Set(r)]}function jy(r){let o={},u=Object.keys(r).sort();for(let c of u)o[c]=r[c];return o}function Ny(r,o){let u=new Set;return new Set(o),r.reduce((c,f)=>{let m=JSON.stringify(jy(f));return u.has(m)||(u.add(m),c.push({key:m,link:f})),c},[])}function mm(){let r=N.useContext(Kl);return hu(r,"You must render this element inside a <DataRouterContext.Provider> element"),r}function Sy(){let r=N.useContext(Ei);return hu(r,"You must render this element inside a <DataRouterStateContext.Provider> element"),r}var gu=N.createContext(void 0);gu.displayName="FrameworkContext";function xm(){let r=N.useContext(gu);return hu(r,"You must render this element inside a <HydratedRouter> element"),r}function Ey(r,o){let u=N.useContext(gu),[c,f]=N.useState(!1),[m,g]=N.useState(!1),{onFocus:j,onBlur:p,onMouseEnter:x,onMouseLeave:v,onTouchStart:y}=o,E=N.useRef(null);N.useEffect(()=>{if(r==="render"&&g(!0),r==="viewport"){let O=q=>{q.forEach(A=>{g(A.isIntersecting)})},T=new IntersectionObserver(O,{threshold:.5});return E.current&&T.observe(E.current),()=>{T.disconnect()}}},[r]),N.useEffect(()=>{if(c){let O=setTimeout(()=>{g(!0)},100);return()=>{clearTimeout(O)}}},[c]);let _=()=>{f(!0)},U=()=>{f(!1),g(!1)};return u?r!=="intent"?[m,E,{}]:[m,E,{onFocus:Qn(j,_),onBlur:Qn(p,U),onMouseEnter:Qn(x,_),onMouseLeave:Qn(v,U),onTouchStart:Qn(y,_)}]:[!1,E,{}]}function Qn(r,o){return u=>{r&&r(u),u.defaultPrevented||o(u)}}function Cy({page:r,...o}){let{router:u}=mm(),c=N.useMemo(()=>I0(u.routes,r,u.basename),[u.routes,r,u.basename]);return c?N.createElement(wy,{page:r,matches:c,...o}):null}function Ty(r){let{manifest:o,routeModules:u}=xm(),[c,f]=N.useState([]);return N.useEffect(()=>{let m=!1;return py(r,o,u).then(g=>{m||f(g)}),()=>{m=!0}},[r,o,u]),c}function wy({page:r,matches:o,...u}){let c=Qt(),{future:f,manifest:m,routeModules:g}=xm(),{basename:j}=mm(),{loaderData:p,matches:x}=Sy(),v=N.useMemo(()=>q0(r,o,x,m,c,"data"),[r,o,x,m,c]),y=N.useMemo(()=>q0(r,o,x,m,c,"assets"),[r,o,x,m,c]),E=N.useMemo(()=>{if(r===c.pathname+c.search+c.hash)return[];let O=new Set,T=!1;if(o.forEach(A=>{let L=m.routes[A.route.id];!L||!L.hasLoader||(!v.some(te=>te.route.id===A.route.id)&&A.route.id in p&&g[A.route.id]?.shouldRevalidate||L.hasClientLoader?T=!0:O.add(A.route.id))}),O.size===0)return[];let q=hy(r,j,f.unstable_trailingSlashAwareDataRequests,"data");return T&&O.size>0&&q.searchParams.set("_routes",o.filter(A=>O.has(A.route.id)).map(A=>A.route.id).join(",")),[q.pathname+q.search]},[j,f.unstable_trailingSlashAwareDataRequests,p,c,m,v,o,r,g]),_=N.useMemo(()=>vy(y,m),[y,m]),U=Ty(y);return N.createElement(N.Fragment,null,E.map(O=>N.createElement("link",{key:O,rel:"prefetch",as:"fetch",href:O,...u})),_.map(O=>N.createElement("link",{key:O,rel:"modulepreload",href:O,...u})),U.map(({key:O,link:T})=>N.createElement("link",{key:O,nonce:u.nonce,...T,crossOrigin:T.crossOrigin??u.crossOrigin})))}function Ay(...r){return o=>{r.forEach(u=>{typeof u=="function"?u(o):u!=null&&(u.current=o)})}}var Ry=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Ry&&(window.__reactRouterVersion="7.13.1")}catch{}function My({basename:r,children:o,unstable_useTransitions:u,window:c}){let f=N.useRef();f.current==null&&(f.current=cg({window:c,v5Compat:!0}));let m=f.current,[g,j]=N.useState({action:m.action,location:m.location}),p=N.useCallback(x=>{u===!1?j(x):N.startTransition(()=>j(x))},[u]);return N.useLayoutEffect(()=>m.listen(p),[m,p]),N.createElement(ny,{basename:r,children:o,location:g.location,navigationType:g.action,navigator:m,unstable_useTransitions:u})}var hm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rt=N.forwardRef(function({onClick:o,discover:u="render",prefetch:c="none",relative:f,reloadDocument:m,replace:g,unstable_mask:j,state:p,target:x,to:v,preventScrollReset:y,viewTransition:E,unstable_defaultShouldRevalidate:_,...U},O){let{basename:T,navigator:q,unstable_useTransitions:A}=N.useContext(Ut),L=typeof v=="string"&&hm.test(v),te=nm(v,T);v=te.to;let K=kg(v,{relative:f}),ce=Qt(),V=null;if(j){let Ee=ou(j,[],ce.unstable_mask?ce.unstable_mask.pathname:"/",!0);T!=="/"&&(Ee.pathname=Ee.pathname==="/"?T:Vt([T,Ee.pathname])),V=q.createHref(Ee)}let[X,$,ee]=Ey(c,U),P=Oy(v,{replace:g,unstable_mask:j,state:p,target:x,preventScrollReset:y,relative:f,viewTransition:E,unstable_defaultShouldRevalidate:_,unstable_useTransitions:A});function Se(Ee){o&&o(Ee),Ee.defaultPrevented||P(Ee)}let Ge=!(te.isExternal||m),Le=N.createElement("a",{...U,...ee,href:(Ge?V:void 0)||te.absoluteURL||K,onClick:Ge?Se:o,ref:Ay(O,$),target:x,"data-discover":!L&&u==="render"?"true":void 0});return X&&!L?N.createElement(N.Fragment,null,Le,N.createElement(Cy,{page:K})):Le});rt.displayName="Link";var gm=N.forwardRef(function({"aria-current":o="page",caseSensitive:u=!1,className:c="",end:f=!1,style:m,to:g,viewTransition:j,children:p,...x},v){let y=In(g,{relative:x.relative}),E=Qt(),_=N.useContext(Ei),{navigator:U,basename:O}=N.useContext(Ut),T=_!=null&&By(y)&&j===!0,q=U.encodeLocation?U.encodeLocation(y).pathname:y.pathname,A=E.pathname,L=_&&_.navigation&&_.navigation.location?_.navigation.location.pathname:null;u||(A=A.toLowerCase(),L=L?L.toLowerCase():null,q=q.toLowerCase()),L&&O&&(L=ma(L,O)||L);const te=q!=="/"&&q.endsWith("/")?q.length-1:q.length;let K=A===q||!f&&A.startsWith(q)&&A.charAt(te)==="/",ce=L!=null&&(L===q||!f&&L.startsWith(q)&&L.charAt(q.length)==="/"),V={isActive:K,isPending:ce,isTransitioning:T},X=K?o:void 0,$;typeof c=="function"?$=c(V):$=[c,K?"active":null,ce?"pending":null,T?"transitioning":null].filter(Boolean).join(" ");let ee=typeof m=="function"?m(V):m;return N.createElement(rt,{...x,"aria-current":X,className:$,ref:v,style:ee,to:g,viewTransition:j},typeof p=="function"?p(V):p)});gm.displayName="NavLink";var _y=N.forwardRef(({discover:r="render",fetcherKey:o,navigate:u,reloadDocument:c,replace:f,state:m,method:g=ji,action:j,onSubmit:p,relative:x,preventScrollReset:v,viewTransition:y,unstable_defaultShouldRevalidate:E,..._},U)=>{let{unstable_useTransitions:O}=N.useContext(Ut),T=Ly(),q=Hy(j,{relative:x}),A=g.toLowerCase()==="get"?"get":"post",L=typeof j=="string"&&hm.test(j),te=K=>{if(p&&p(K),K.defaultPrevented)return;K.preventDefault();let ce=K.nativeEvent.submitter,V=ce?.getAttribute("formmethod")||g,X=()=>T(ce||K.currentTarget,{fetcherKey:o,method:V,navigate:u,replace:f,state:m,relative:x,preventScrollReset:v,viewTransition:y,unstable_defaultShouldRevalidate:E});O&&u!==!1?N.startTransition(()=>X()):X()};return N.createElement("form",{ref:U,method:A,action:q,onSubmit:c?p:te,..._,"data-discover":!L&&r==="render"?"true":void 0})});_y.displayName="Form";function zy(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ym(r){let o=N.useContext(Kl);return Ue(o,zy(r)),o}function Oy(r,{target:o,replace:u,unstable_mask:c,state:f,preventScrollReset:m,relative:g,viewTransition:j,unstable_defaultShouldRevalidate:p,unstable_useTransitions:x}={}){let v=fu(),y=Qt(),E=In(r,{relative:g});return N.useCallback(_=>{if(oy(_,o)){_.preventDefault();let U=u!==void 0?u:Wn(y)===Wn(E),O=()=>v(r,{replace:U,unstable_mask:c,state:f,preventScrollReset:m,relative:g,viewTransition:j,unstable_defaultShouldRevalidate:p});x?N.startTransition(()=>O()):O()}},[y,v,E,u,c,f,o,r,m,g,j,p,x])}function Ti(r){qt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let o=N.useRef(cu(r)),u=N.useRef(!1),c=Qt(),f=N.useMemo(()=>dy(c.search,u.current?null:o.current),[c.search]),m=fu(),g=N.useCallback((j,p)=>{const x=cu(typeof j=="function"?j(new URLSearchParams(f)):j);u.current=!0,m("?"+x,p)},[m,f]);return[f,g]}var Dy=0,Uy=()=>`__${String(++Dy)}__`;function Ly(){let{router:r}=ym("useSubmit"),{basename:o}=N.useContext(Ut),u=ey(),c=r.fetch,f=r.navigate;return N.useCallback(async(m,g={})=>{let{action:j,method:p,encType:x,formData:v,body:y}=xy(m,o);if(g.navigate===!1){let E=g.fetcherKey||Uy();await c(E,u,g.action||j,{unstable_defaultShouldRevalidate:g.unstable_defaultShouldRevalidate,preventScrollReset:g.preventScrollReset,formData:v,body:y,formMethod:g.method||p,formEncType:g.encType||x,flushSync:g.flushSync})}else await f(g.action||j,{unstable_defaultShouldRevalidate:g.unstable_defaultShouldRevalidate,preventScrollReset:g.preventScrollReset,formData:v,body:y,formMethod:g.method||p,formEncType:g.encType||x,replace:g.replace,state:g.state,fromRouteId:u,flushSync:g.flushSync,viewTransition:g.viewTransition})},[c,f,o,u])}function Hy(r,{relative:o}={}){let{basename:u}=N.useContext(Ut),c=N.useContext(Xt);Ue(c,"useFormAction must be used inside a RouteContext");let[f]=c.matches.slice(-1),m={...In(r||".",{relative:o})},g=Qt();if(r==null){m.search=g.search;let j=new URLSearchParams(m.search),p=j.getAll("index");if(p.some(v=>v==="")){j.delete("index"),p.filter(y=>y).forEach(y=>j.append("index",y));let v=j.toString();m.search=v?`?${v}`:""}}return(!r||r===".")&&f.route.index&&(m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index"),u!=="/"&&(m.pathname=m.pathname==="/"?u:Vt([u,m.pathname])),Wn(m)}function By(r,{relative:o}={}){let u=N.useContext(im);Ue(u!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:c}=ym("useViewTransitionState"),f=In(r,{relative:o});if(!u.isTransitioning)return!1;let m=ma(u.currentLocation.pathname,c)||u.currentLocation.pathname,g=ma(u.nextLocation.pathname,c)||u.nextLocation.pathname;return Si(f.pathname,g)!=null||Si(f.pathname,m)!=null}const pm=N.createContext({projects:[],activeProject:null,setActiveProject:()=>{},refreshProjects:()=>{}});function Jl(){return N.useContext(pm)}function qy(){const[r,o]=N.useState([]),[u,c]=Ti(),f=N.useCallback(async()=>{try{const x=await(await fetch("/api/projects")).json();x.ok&&o(x.data||[])}catch{}},[]);N.useEffect(()=>{f()},[f]);const m=u.get("project"),g=m?r.find(p=>p.id===m)||r[0]||null:r[0]||null,j=N.useCallback(p=>{c(x=>(x.set("project",p),x))},[c]);return{projects:r,activeProject:g,setActiveProject:j,refreshProjects:f}}function vm(r,o){const{timeout:u=3e4,retries:c=1,retryDelay:f=2e3}={},[m,g]=N.useState(null),[j,p]=N.useState(!0),[x,v]=N.useState(null),[y,E]=N.useState(0),[_,U]=N.useState(null),O=N.useCallback(()=>E(T=>T+1),[]);return N.useEffect(()=>{if(!r){p(!1),g(null),v(null);return}let T=!1;p(!0),v(null);async function q(A){const L=new AbortController,te=setTimeout(()=>L.abort(),u);try{const K=await fetch(r,{signal:L.signal});if(clearTimeout(te),!K.ok)throw new Error(`HTTP ${K.status}`);const ce=K.headers.get("content-type")||"";if(!ce.includes("application/json"))throw new Error(`Expected JSON response but got ${ce||"unknown"} — server may be restarting`);const V=await K.json();T||(g(V.data??V),v(null),U(new Date),p(!1))}catch(K){if(clearTimeout(te),T)return;if(A>0&&K.name!=="AbortError")return await new Promise(ce=>setTimeout(ce,f)),T?void 0:q(A-1);K.name==="AbortError"?v(`Request timed out (${Math.round(u/1e3)}s)`):v(String(K.message||K)),p(!1)}}return q(c),()=>{T=!0}},[r,y,u,c,f]),{data:m,loading:j,error:x,refetch:O,fetchedAt:_}}function _e(r,o){const{activeProject:u}=Jl(),c=r.includes("?")?"&":"?",f=u?`${r}${c}project=${u.id}`:r;return vm(f)}const yu=N.createContext(null),Yy=["heartbeat","increment-update","analytics-event","cost-update","notification","sync-update","sync-audit","error-detected","config-changed","activity","command-output","command-complete","job-progress","marketplace-scan","submission-update","verification-complete"];function $y({url:r="/api/events",children:o}){const[u,c]=N.useState("connecting"),f=N.useRef(null),m=N.useRef(null),g=N.useRef(new Map),j=N.useCallback(()=>{f.current&&f.current.close(),c("connecting");const x=new EventSource(r);f.current=x;for(const v of Yy)x.addEventListener(v,y=>{let E;try{E=JSON.parse(y.data)}catch{return}const _=g.current.get(v);if(_)for(const U of _)try{U(E)}catch{}});x.onopen=()=>c("connected"),x.onerror=()=>{x.close(),c("disconnected"),m.current=setTimeout(()=>{f.current===x&&j()},3e3)}},[r]);N.useEffect(()=>(j(),()=>{m.current&&(clearTimeout(m.current),m.current=null),f.current?.close(),f.current=null}),[j]);const p=N.useCallback((x,v)=>(g.current.has(x)||g.current.set(x,new Set),g.current.get(x).add(v),()=>{const y=g.current.get(x);y&&(y.delete(v),y.size===0&&g.current.delete(x))}),[]);return n.jsx(yu.Provider,{value:{status:u,subscribe:p},children:o})}function ke(r,o){const u=N.useContext(yu),c=N.useRef(o);c.current=o,N.useEffect(()=>{if(!u)return;const f=m=>c.current(m);return u.subscribe(r,f)},[u,r])}function ky(){return N.useContext(yu)?.status??"disconnected"}const Gy=[{path:"/",label:"Overview",icon:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-4 0a1 1 0 01-1-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 01-1 1"},{path:"/increments",label:"Increments",icon:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"},{path:"/analytics",label:"Analytics",icon:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"},{path:"/costs",label:"Costs",icon:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},{path:"/sync",label:"Sync",icon:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},{path:"/errors",label:"Errors",icon:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4.5c-.77-.833-2.694-.833-3.464 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z"},{path:"/activity",label:"Activity",icon:"M13 10V3L4 14h7v7l9-11h-7z"},{path:"/notifications",label:"Notifications",icon:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",badge:!0},{path:"/config",label:"Config",icon:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z"},{path:"/plugins",label:"Plugins",icon:"M17 14v6m-3-3h6M6 10h2a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v2a2 2 0 002 2zm10 0h2a2 2 0 002-2V6a2 2 0 00-2-2h-2a2 2 0 00-2 2v2a2 2 0 002 2zM6 20h2a2 2 0 002-2v-2a2 2 0 00-2-2H6a2 2 0 00-2 2v2a2 2 0 002 2z"},{path:"/marketplace",label:"Marketplace",icon:"M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 100 4 2 2 0 000-4z"},{path:"/repos",label:"Repos",icon:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},{path:"/services",label:"Services",icon:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"}];function Vy({d:r}){return n.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:r})})}function Xy(){const{projects:r,activeProject:o,setActiveProject:u}=Jl(),[c]=Ti(),{data:f}=_e("/api/overview"),[m,g]=N.useState(null),j=N.useCallback(E=>{const _=E;_?.pendingCount!=null&&g(_.pendingCount)},[]);ke("notification",j);const p=ky(),x=m??f?.notifications?.pendingCount??0,v=c.get("project"),y=E=>v?`${E}?project=${v}`:E;return n.jsxs("aside",{className:"w-56 bg-gray-900 border-r border-gray-800 flex flex-col h-screen sticky top-0",children:[n.jsx("div",{className:"px-4 py-5 border-b border-gray-800",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-8 h-8 bg-indigo-500 rounded-lg flex items-center justify-center",children:n.jsx("span",{className:"text-white font-bold text-sm",children:"SW"})}),n.jsxs("div",{children:[n.jsx("div",{className:"text-white font-semibold text-sm",children:"SpecWeave"}),n.jsx("div",{className:"text-gray-500 text-xs",children:"Dashboard"})]})]})}),(r.length>0||v)&&n.jsxs("div",{className:"px-3 py-3 border-b border-gray-800",children:[n.jsx("label",{className:"text-[10px] text-gray-500 uppercase tracking-wider mb-1 block",children:"Project"}),n.jsxs("select",{value:o?.id||v||"",onChange:E=>{E.target.value==="__add__"?window.location.href=y("/config"):u(E.target.value)},className:"w-full bg-gray-800 border border-gray-700 text-gray-300 text-xs rounded-lg px-2 py-1.5 focus:ring-indigo-500 focus:border-indigo-500",children:[r.map(E=>n.jsx("option",{value:E.id,children:E.name},E.id)),v&&!r.find(E=>E.id===v)&&n.jsxs("option",{value:v,children:[decodeURIComponent(v).split(/[-/]/).pop()||v," (not registered)"]}),n.jsx("option",{value:"__add__",children:"+ Add project..."})]})]}),n.jsx("nav",{className:"flex-1 overflow-y-auto py-3 px-2",children:Gy.map(E=>n.jsxs(gm,{to:y(E.path),end:E.path==="/",className:({isActive:_})=>`flex items-center gap-3 px-3 py-2 rounded-lg text-sm mb-0.5 transition-colors ${_?"bg-indigo-500/10 text-indigo-400":"text-gray-400 hover:bg-gray-800 hover:text-gray-200"}`,children:[n.jsx(Vy,{d:E.icon}),n.jsx("span",{className:"flex-1",children:E.label}),E.badge&&x>0&&n.jsx("span",{className:"min-w-[18px] h-[18px] px-1 bg-rose-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center",children:x>99?"99+":x})]},E.path))}),n.jsx("div",{className:"px-4 py-3 border-t border-gray-800",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:`w-2 h-2 rounded-full ${p==="connected"?"bg-emerald-400 pulse-dot":p==="connecting"?"bg-amber-400 pulse-dot":"bg-gray-500"}`}),n.jsx("span",{className:"text-xs text-gray-500",children:p==="connected"?"Connected":p==="connecting"?"Connecting...":"Disconnected"})]}),n.jsxs("span",{className:"text-[10px] text-gray-600",children:[r.length," project",r.length!==1?"s":""]})]})})]})}function Qy(){const{data:r}=vm("/api/health"),{activeProject:o}=Jl(),u=o?.name||"Project",c=r?.uptime?Zy(r.uptime):"...";return n.jsxs("header",{className:"h-14 bg-gray-900/50 backdrop-blur border-b border-gray-800 flex items-center justify-between px-6",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("h1",{className:"text-gray-200 font-medium text-sm",children:u}),n.jsx("span",{className:"text-gray-600 text-xs",children:"|"}),n.jsxs("span",{className:"text-gray-500 text-xs",children:["Uptime: ",c]})]}),n.jsx("div",{className:"flex items-center gap-4",children:n.jsxs("span",{className:"text-gray-500 text-xs",children:[r?.connections??0," client",(r?.connections??0)!==1?"s":""]})})]})}function Zy(r){if(r<60)return`${Math.floor(r)}s`;if(r<3600)return`${Math.floor(r/60)}m`;const o=Math.floor(r/3600),u=Math.floor(r%3600/60);return`${o}h ${u}m`}class Ky extends N.Component{constructor(o){super(o),this.state={hasError:!1,error:null}}static getDerivedStateFromError(o){return{hasError:!0,error:o}}componentDidCatch(o,u){console.error("[Dashboard ErrorBoundary]",o,u.componentStack)}componentDidUpdate(o){this.state.hasError&&o.resetKey!==this.props.resetKey&&this.setState({hasError:!1,error:null})}render(){return this.state.hasError?n.jsx("div",{className:"flex items-center justify-center min-h-[400px] p-8",children:n.jsxs("div",{className:"max-w-md text-center space-y-4",children:[n.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-rose-500/10 flex items-center justify-center",children:n.jsx("svg",{className:"w-6 h-6 text-rose-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),n.jsx("h3",{className:"text-lg font-semibold text-gray-200",children:"Something went wrong"}),n.jsx("p",{className:"text-sm text-gray-500",children:this.state.error?.message||"An unexpected error occurred while rendering this page."}),n.jsxs("div",{className:"flex gap-3 justify-center",children:[n.jsx("button",{onClick:()=>this.setState({hasError:!1,error:null}),className:"px-4 py-2 text-sm bg-gray-800 text-gray-300 rounded-lg hover:bg-gray-700 transition-colors",children:"Try Again"}),n.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 text-sm bg-indigo-600 text-white rounded-lg hover:bg-indigo-500 transition-colors",children:"Reload Page"}),n.jsx("a",{href:"/",className:"px-4 py-2 text-sm text-gray-400 hover:text-gray-200 transition-colors",children:"Go Home"})]})]})}):this.props.children}}const Jy={indigo:"from-indigo-500/10 to-indigo-500/5 border-indigo-500/20",emerald:"from-emerald-500/10 to-emerald-500/5 border-emerald-500/20",amber:"from-amber-500/10 to-amber-500/5 border-amber-500/20",rose:"from-rose-500/10 to-rose-500/5 border-rose-500/20",cyan:"from-cyan-500/10 to-cyan-500/5 border-cyan-500/20"},Wy={indigo:"text-indigo-400",emerald:"text-emerald-400",amber:"text-amber-400",rose:"text-rose-400",cyan:"text-cyan-400"};function se({title:r,value:o,subtitle:u,tooltip:c,color:f="indigo"}){return n.jsxs("div",{className:`bg-gradient-to-br ${Jy[f]} border rounded-xl p-4 relative group`,title:c,children:[n.jsx("div",{className:"text-gray-400 text-xs font-medium uppercase tracking-wider mb-2",children:r}),n.jsx("div",{className:`text-2xl font-bold ${Wy[f]}`,children:o}),u&&n.jsx("div",{className:"text-gray-500 text-xs mt-1",children:u}),c&&n.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2.5 py-1.5 bg-gray-800 border border-gray-700 rounded-lg text-[10px] text-gray-300 whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none z-10 shadow-lg",children:[c,n.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 -mt-px border-4 border-transparent border-t-gray-800"})]})]})}const Fy={active:"#6366f1",completed:"#10b981",paused:"#f59e0b",planning:"#06b6d4",abandoned:"#ef4444",backlog:"#6b7280",ready_for_review:"#8b5cf6"};function Py(r){return Fy[r]||"#6b7280"}function Iy({segments:r,size:o=160,centerLabel:u,centerValue:c}){const f=r.reduce((p,x)=>p+x.value,0);if(f===0)return n.jsx("div",{className:"flex items-center justify-center",style:{width:o,height:o},children:n.jsx("span",{className:"text-gray-600 text-xs",children:"No data"})});const m=52,g=2*Math.PI*m;let j=0;return n.jsxs("div",{className:"relative inline-flex items-center justify-center",style:{width:o,height:o},children:[n.jsx("svg",{viewBox:"0 0 128 128",className:"w-full h-full -rotate-90",children:r.map((p,x)=>{const y=p.value/f*g,E=j;return j+=y,n.jsx("circle",{cx:"64",cy:"64",r:m,fill:"none",stroke:p.color,strokeWidth:"12",strokeDasharray:`${y} ${g-y}`,strokeDashoffset:-E,className:"transition-all duration-500"},x)})}),n.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[c!=null&&n.jsx("span",{className:"text-xl font-bold text-white",children:c}),u&&n.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider",children:u})]})]})}function ep(r){return Object.entries(r).filter(([o,u])=>u>0).map(([o,u])=>({label:o,value:u,color:Py(o)}))}const tp={default:"bg-gray-800 text-gray-300",success:"bg-emerald-500/15 text-emerald-400",warning:"bg-amber-500/15 text-amber-400",error:"bg-rose-500/15 text-rose-400",info:"bg-cyan-500/15 text-cyan-400"};function de({label:r,variant:o="default"}){return n.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium ${tp[o]}`,children:r})}function wi(r){switch(r){case"active":case"running":return"info";case"completed":case"success":return"success";case"paused":case"pending":case"planning":return"warning";case"failed":case"abandoned":case"error":return"error";default:return"default"}}function ap({size:r="md"}){const o={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8"};return n.jsxs("svg",{className:`${o[r]} animate-spin text-indigo-400`,viewBox:"0 0 24 24",fill:"none",children:[n.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),n.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})}function lt(){return n.jsx("div",{className:"flex items-center justify-center h-64",children:n.jsx(ap,{size:"lg"})})}function Zt({message:r,onRetry:o,title:u="Something went wrong"}){const c=r.toLowerCase().includes("timed out");return n.jsx("div",{className:"p-6",children:n.jsxs("div",{className:"bg-rose-900/30 border border-rose-700 rounded-lg px-5 py-4 space-y-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-medium text-rose-300",children:u}),n.jsx("p",{className:"text-xs text-rose-400/80 mt-1",children:r})]}),o&&n.jsx("button",{onClick:o,className:"text-xs text-rose-400 hover:text-rose-200 px-3 py-1.5 border border-rose-700 rounded transition-colors flex-shrink-0",children:"Retry"})]}),c&&n.jsx("p",{className:"text-[10px] text-rose-400/60",children:"The server may be processing a large number of session logs. Try again in a moment."})]})})}function Y0(r){switch(r){case"connected":return"success";case"sync_failed":return"warning";case"configured_never_synced":return"info";default:return"default"}}function lp(r){switch(r){case"connected":return"Connected";case"sync_failed":return"Sync Failed";case"configured_never_synced":return"Ready";case"not_configured":return"Not Configured";default:return r||"Unknown"}}const au=r=>r.billingContext?.planType==="subscription";function np(){const[r,o]=N.useState(0),{data:u,loading:c,error:f,refetch:m}=_e(`/api/overview?_r=${r}`),[g,j]=N.useState([]),{activeProject:p}=Jl();ke("increment-update",()=>o(E=>E+1)),ke("notification",()=>o(E=>E+1)),ke("sync-update",()=>o(E=>E+1)),ke("cost-update",()=>o(E=>E+1));const x=N.useRef(null);N.useEffect(()=>{if(!p||x.current===p.id)return;x.current=p.id;const E=`project=${p.id}`;fetch(`/api/activity/stream?limit=20&${E}`).then(_=>_.json()).then(_=>{_.ok&&Array.isArray(_.data)&&j(_.data)}).catch(()=>{})},[p]);const v=N.useCallback(E=>{j(_=>[E,..._].slice(0,20))},[]);if(ke("activity",v),c)return n.jsx(lt,{});if(f)return n.jsx(Zt,{message:f,onRetry:m});if(!u)return null;const y=ep(u.project.statusBreakdown);return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsxs("h2",{className:"text-lg font-semibold text-gray-200",children:[u.project.name||"Project"," Overview"]}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(rt,{to:"/increments?status=active",className:"group",children:n.jsx(se,{title:"Active Increments",value:u.project.activeIncrements,subtitle:`${u.project.totalIncrements} total`,color:"indigo"})}),n.jsx(rt,{to:"/increments?status=completed",className:"group",children:n.jsx(se,{title:"Completed",value:u.project.completedIncrements,subtitle:`${Math.round(u.project.completedIncrements/Math.max(u.project.totalIncrements,1)*100)}% done`,color:"emerald"})}),n.jsx(rt,{to:"/costs",className:"group",children:n.jsx(se,{title:au(u.costs)?"Usage Value":"Total Cost",value:`$${u.costs.totalCost.toFixed(2)}`,subtitle:au(u.costs)?`via Claude Code · $${u.costs.billingContext?.monthlyAmount??"?"}/mo plan`:`via Claude Code · ${u.costs.sessionCount.toLocaleString()} sessions`,color:"amber"})}),n.jsx(rt,{to:"/analytics",className:"group",children:n.jsx(se,{title:"Events Today",value:u.analytics.last24hEvents,subtitle:`${u.analytics.totalEvents.toLocaleString()} total`,color:"cyan"})})]}),n.jsx(sp,{}),au(u.costs)&&n.jsxs("div",{className:"bg-indigo-500/10 border border-indigo-500/20 rounded-xl px-4 py-3 flex items-center gap-3",children:[n.jsx(de,{label:"Subscription",variant:"info"}),n.jsx("span",{className:"text-xs text-gray-300",children:"Costs shown as API-equivalent usage value."})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Increment Status"}),n.jsx("div",{className:"flex items-center justify-center",children:n.jsx(Iy,{segments:y,centerValue:u.project.totalIncrements,centerLabel:"total"})}),n.jsx("div",{className:"flex flex-wrap gap-2 mt-4 justify-center",children:y.map(E=>n.jsxs(rt,{to:`/increments?status=${E.label.toLowerCase()}`,className:"flex items-center gap-1.5 hover:opacity-80 transition-opacity",children:[n.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:E.color}}),n.jsxs("span",{className:"text-xs text-gray-500 hover:text-gray-300",children:[E.label," (",E.value,")"]})]},E.label))})]}),n.jsxs(rt,{to:"/sync",className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5 hover:border-gray-700 transition-colors block",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Sync Health"}),n.jsx("div",{className:"space-y-3",children:Object.entries(u.sync.platforms).length===0?n.jsx("p",{className:"text-gray-600 text-xs",children:"No sync platforms configured"}):Object.entries(u.sync.platforms).map(([E,_])=>n.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-800/50 rounded-lg",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-sm text-gray-300 capitalize",children:E}),_.configDetail&&n.jsx("div",{className:"text-[10px] text-gray-600 mt-0.5",children:_.configDetail}),!_.configDetail&&_.lastImport&&n.jsxs("div",{className:"text-xs text-gray-600 mt-0.5",children:["Last: ",new Date(_.lastImport).toLocaleDateString()]})]}),n.jsx(de,{label:lp(_.connectionStatus||_.lastSyncResult),variant:Y0(_.connectionStatus)!=="default"?Y0(_.connectionStatus):wi(_.lastSyncResult||"")})]},E))}),n.jsx("div",{className:"mt-4 pt-4 border-t border-gray-800",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs text-gray-500",children:"Notifications"}),n.jsxs("div",{className:"flex gap-2",children:[u.notifications.criticalCount>0&&n.jsx(rt,{to:"/notifications",onClick:E=>E.stopPropagation(),children:n.jsx(de,{label:`${u.notifications.criticalCount} critical`,variant:"error"})}),n.jsx(rt,{to:"/notifications",onClick:E=>E.stopPropagation(),children:n.jsx(de,{label:`${u.notifications.pendingCount} pending`,variant:u.notifications.pendingCount>0?"warning":"default"})})]})]})})]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Live Activity"}),n.jsx(rt,{to:"/activity",className:"text-[10px] text-indigo-400 hover:text-indigo-300",children:"View all"})]}),n.jsx("div",{className:"space-y-2 max-h-64 overflow-y-auto custom-scrollbar",children:g.length===0?n.jsx("p",{className:"text-gray-600 text-xs",children:"No recent activity"}):g.map((E,_)=>n.jsxs("div",{className:"flex items-start gap-2 py-1 slide-in",children:[n.jsx("div",{className:`w-1.5 h-1.5 rounded-full mt-1.5 ${E.severity==="error"?"bg-rose-400":E.severity==="warning"?"bg-amber-400":"bg-gray-600"}`}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"text-xs text-gray-400 truncate",children:E.title}),n.jsxs("div",{className:"text-[10px] text-gray-600",children:[E.category,E.timestamp&&` · ${ip(E.timestamp)}`]})]})]},_))})]})]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Increment Types"}),n.jsx("div",{className:"flex gap-4 flex-wrap",children:Object.entries(u.project.typeBreakdown).map(([E,_])=>n.jsxs(rt,{to:`/increments?type=${E}`,className:"flex items-center gap-2 px-3 py-2 bg-gray-800/50 rounded-lg hover:bg-gray-800/80 transition-colors",children:[n.jsx("span",{className:"text-sm text-gray-300 capitalize",children:E}),n.jsx("span",{className:"text-xs text-gray-500 bg-gray-800 px-2 py-0.5 rounded",children:_})]},E))})]})]})}function sp(){const[r,o]=N.useState(0);ke("error-detected",()=>o(_=>_+1));const{data:u}=_e(`/api/prompt-health?_r=${r}`);if(!u?.health||u.health.warningLevel==="normal")return null;const{health:c,alert:f}=u,m=f?.level==="emergency",g=c.warningLevel==="critical"||m,j=g?"border-rose-500/30":"border-amber-500/20",p=g?"bg-rose-500/10":"bg-amber-500/10",x=g?"text-rose-400":"text-amber-400",v=Math.round(c.baseline/1e3),y=Math.min(Math.round(c.baseline/2e5*100),100),E=g?"bg-rose-500":"bg-amber-500";return n.jsxs("div",{className:`${p} border ${j} rounded-xl px-4 py-3 space-y-2`,children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(de,{label:g?"Critical":"Warning",variant:g?"error":"warning"}),n.jsxs("span",{className:`text-xs ${x}`,children:["Prompt baseline: ",v,"KB (",y,"% of context window)"]})]}),n.jsx(rt,{to:"/errors",className:"text-[10px] text-gray-500 hover:text-gray-300",children:"Details"})]}),n.jsx("div",{className:"w-full bg-gray-800 rounded-full h-1.5",children:n.jsx("div",{className:`${E} h-1.5 rounded-full`,style:{width:`${y}%`}})}),n.jsxs("div",{className:"flex gap-4 text-[10px] text-gray-500",children:[n.jsxs("span",{children:["CLAUDE.md: ",Math.round(c.claudeMdSize/1e3),"KB"]}),n.jsxs("span",{children:["MEMORY.md: ",Math.round(c.memoryMdSize/1e3),"KB"]}),n.jsxs("span",{children:["Skills: ",Math.round(c.skillBudget/1e3),"KB"]}),f&&n.jsxs("span",{className:x,children:["Compactions: ",f.compactionCount]})]})]})}function ip(r){try{const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return""}}function rp(){const r=fu(),[o]=Ti();return N.useCallback(u=>{const c=o.get("project");if(c){const f=u.includes("?")?"&":"?";r(`${u}${f}project=${encodeURIComponent(c)}`)}else r(u)},[r,o])}const Kn=new Map;let lu=!1,bm=null;function cp(){lu||(lu=!0,queueMicrotask(()=>{lu=!1;const r=bm;if(!r||Kn.size===0){Kn.clear();return}const o=new Map(Kn);Kn.clear(),r(u=>{const c=new URLSearchParams(u);for(const[f,{value:m,defaultValue:g}]of o)m&&m!==g?c.set(f,m):c.delete(f);return c})}))}function Ya(r,o=""){const[u,c]=Ti(),f=u.get(r)??o,m=N.useCallback(g=>{bm=c,Kn.set(r,{value:g,defaultValue:o}),cp()},[r,o,c]);return[f,m]}function pu({title:r,description:o}){return n.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[n.jsx("div",{className:"w-12 h-12 rounded-full bg-gray-800 flex items-center justify-center mb-4",children:n.jsx("svg",{className:"w-6 h-6 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})})}),n.jsx("h3",{className:"text-gray-400 text-sm font-medium",children:r}),o&&n.jsx("p",{className:"text-gray-600 text-xs mt-1 max-w-xs",children:o})]})}const Zn=50;function up(){const[r,o]=N.useState(0),[u,c]=N.useState(0),[f,m]=Ya("status","all"),[g,j]=Ya("type","all"),p=rp(),x=N.useRef();ke("increment-update",()=>{x.current&&clearTimeout(x.current),x.current=setTimeout(()=>o(L=>L+1),500)}),N.useEffect(()=>()=>{x.current&&clearTimeout(x.current)},[]);const v=new URLSearchParams({_r:String(r),limit:String(Zn),offset:String(u)});f!=="all"&&v.set("status",f),g!=="all"&&v.set("type",g);const{data:y,loading:E,error:_,refetch:U}=_e(`/api/increments?${v}`),O=N.useRef(f),T=N.useRef(g);if(N.useEffect(()=>{(O.current!==f||T.current!==g)&&(c(0),O.current=f,T.current=g)},[f,g]),E&&u===0)return n.jsx(lt,{});if(_)return n.jsx(Zt,{message:_,onRetry:U});if(!y)return null;const q=Object.keys(y.summary).filter(L=>L!=="total"&&y.summary[L]>0),A=y.pagination;return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Increments"}),n.jsxs("span",{className:"text-sm text-gray-500",children:[A?.total??y.increments.length," total"]})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:"text-xs text-gray-500 w-14",children:"Status:"}),n.jsxs("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:[n.jsx(nu,{label:"All",active:f==="all",onClick:()=>m("all"),count:y.summary.total}),q.map(L=>n.jsx(nu,{label:L,active:f===L,onClick:()=>m(L),count:y.summary[L]},L))]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("span",{className:"text-xs text-gray-500 w-14",children:"Type:"}),n.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:n.jsx(nu,{label:"All",active:g==="all",onClick:()=>j("all")})})]}),A&&A.total>0&&n.jsxs("span",{className:"text-xs text-gray-500",children:["Showing ",u+1,"–",Math.min(u+Zn,A.total)," of ",A.total]})]}),y.increments.length===0?n.jsx(pu,{title:"No increments match filters",description:"Try adjusting your filters"}):n.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:n.jsxs("table",{className:"w-full",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-800",children:[n.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"ID"}),n.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Title"}),n.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Status"}),n.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Type"}),n.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Priority"}),n.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Tasks"}),n.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"ACs"}),n.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Last Activity"})]})}),n.jsx("tbody",{children:y.increments.map(L=>n.jsxs("tr",{onClick:()=>p(`/increments/${L.id}`),className:"border-b border-gray-800/50 hover:bg-gray-800/30 transition-colors cursor-pointer",children:[n.jsx("td",{className:"px-4 py-3",children:n.jsx("span",{className:"text-xs text-indigo-400 font-mono",children:L.id})}),n.jsx("td",{className:"px-4 py-3",children:n.jsx("span",{className:"text-sm text-gray-300",children:L.title})}),n.jsx("td",{className:"px-4 py-3",children:n.jsx(de,{label:L.status,variant:wi(L.status)})}),n.jsx("td",{className:"px-4 py-3",children:n.jsx("span",{className:"text-xs text-gray-400 capitalize",children:L.type})}),n.jsx("td",{className:"px-4 py-3",children:n.jsx(op,{priority:L.priority})}),n.jsx("td",{className:"px-4 py-3",children:n.jsx($0,{completed:L.tasks.completed,total:L.tasks.total})}),n.jsx("td",{className:"px-4 py-3",children:n.jsx($0,{completed:L.acs.completed,total:L.acs.total})}),n.jsx("td",{className:"px-4 py-3",children:n.jsx("span",{className:"text-xs text-gray-500",children:L.lastActivity?dp(L.lastActivity):"-"})})]},L.id))})]})}),A&&A.total>Zn&&n.jsxs("div",{className:"flex justify-center gap-2",children:[n.jsx("button",{onClick:()=>c(Math.max(0,u-Zn)),disabled:u===0,className:"px-4 py-2 text-sm text-gray-300 bg-gray-800 hover:bg-gray-700 rounded-lg transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Previous"}),n.jsx("button",{onClick:()=>c(u+Zn),disabled:!A.hasMore,className:"px-4 py-2 text-sm text-gray-300 bg-gray-800 hover:bg-gray-700 rounded-lg transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Next"})]})]})}function nu({label:r,active:o,onClick:u,count:c}){return n.jsxs("button",{onClick:u,className:`px-3 py-1 text-xs rounded-md transition-colors capitalize ${o?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:[r,c!==void 0&&n.jsx("span",{className:"ml-1 text-[10px] text-gray-500",children:c})]})}function $0({completed:r,total:o}){const u=o>0?Math.round(r/o*100):0;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-16 h-1.5 bg-gray-800 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-indigo-500 rounded-full transition-all",style:{width:`${u}%`}})}),n.jsxs("span",{className:"text-xs text-gray-500",children:[r,"/",o]})]})}function op({priority:r}){const o={P0:"text-rose-400 bg-rose-500/10",P1:"text-amber-400 bg-amber-500/10",P2:"text-cyan-400 bg-cyan-500/10",P3:"text-gray-400 bg-gray-500/10"};return n.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${o[r]||o.P2}`,children:r})}function dp(r){try{const o=new Date(r),c=new Date().getTime()-o.getTime(),f=Math.floor(c/6e4);if(f<1)return"Just now";if(f<60)return`${f}m ago`;const m=Math.floor(f/60);if(m<24)return`${m}h ago`;const g=Math.floor(m/24);return g<7?`${g}d ago`:o.toLocaleDateString()}catch{return r}}function fp(){const[r,o]=N.useState("skills"),[u,c]=N.useState(!1),[f,m]=N.useState(0);ke("analytics-event",()=>m(q=>q+1));const{data:g,loading:j,error:p,refetch:x,fetchedAt:v}=_e(`/api/analytics/summary?_r=${f}`),{data:y,loading:E,refetch:_}=_e(`/api/analytics/skills?_r=${f}`);if(j||E)return n.jsx(lt,{});if(p)return n.jsx(Zt,{message:p,onRetry:x});if(!g)return null;const U=g.topCommands?.reduce((q,A)=>q+A.count,0)||0,O=g.topSkills?.reduce((q,A)=>q+A.count,0)||0,T=g.topAgents?.reduce((q,A)=>q+A.count,0)||0;return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Analytics"}),n.jsxs("div",{className:"flex items-center gap-3",children:[v&&n.jsxs("span",{className:"text-[10px] text-gray-600",children:["Updated ",v.toLocaleTimeString()]}),n.jsxs("span",{className:"text-sm text-gray-500",children:[g.totalEvents.toLocaleString()," total events"]}),n.jsx("button",{onClick:()=>{c(!0),x(),_(),setTimeout(()=>c(!1),600)},disabled:u,className:"p-1.5 text-gray-500 hover:text-gray-300 hover:bg-gray-800 rounded-lg transition-colors disabled:opacity-50",title:"Refresh analytics",children:n.jsx("svg",{className:`w-4 h-4 ${u?"animate-spin":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})]})]}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(se,{title:"Total Events",value:g.totalEvents.toLocaleString(),subtitle:`${g.successRate}% success rate`,color:"indigo",tooltip:`${g.totalEvents} events tracked from analytics JSONL`}),n.jsx(se,{title:"Commands",value:U.toLocaleString(),subtitle:`${g.topCommands?.length||0} unique`,color:"cyan",tooltip:`${U} total command invocations across ${g.topCommands?.length||0} distinct commands`}),n.jsx(se,{title:"Skills",value:O.toLocaleString(),subtitle:`${g.topSkills?.length||0} unique`,color:"emerald",tooltip:`${O} total skill activations across ${g.topSkills?.length||0} distinct skills`}),n.jsx(se,{title:"Agents",value:T.toLocaleString(),subtitle:`${g.topAgents?.length||0} unique`,color:"amber",tooltip:`${T} agent spawns across ${g.topAgents?.length||0} distinct agent types`})]}),n.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:[{key:"skills",label:"Skills"},{key:"commands",label:"Commands"},{key:"agents",label:"Agents"},{key:"daily",label:"Daily Trends"}].map(q=>n.jsx("button",{onClick:()=>o(q.key),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${r===q.key?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:q.label},q.key))}),r==="commands"&&n.jsx(mp,{commands:g.topCommands||[]}),r==="skills"&&n.jsx(xp,{skills:y||[]}),r==="agents"&&n.jsx(hp,{agents:g.topAgents||[]}),r==="daily"&&n.jsx(gp,{days:g.dailySummaries||[]})]})}function mp({commands:r}){if(r.length===0)return n.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:n.jsx("p",{className:"text-gray-500 text-sm",children:"No command data available"})});const o=[...r].sort((c,f)=>f.count-c.count),u=o[0]?.count||1;return n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Top Commands"})}),n.jsxs("table",{className:"w-full",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-800",children:[n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500 w-12",children:"Rank"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Command"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Usage"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Count"})]})}),n.jsx("tbody",{children:o.map((c,f)=>{const m=Math.max(2,c.count/u*100);return n.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[n.jsxs("td",{className:"px-4 py-2.5 text-xs text-gray-600",children:["#",f+1]}),n.jsx("td",{className:"px-4 py-2.5",children:n.jsx("span",{className:"text-sm text-gray-300 font-mono",children:c.name})}),n.jsx("td",{className:"px-4 py-2.5",children:n.jsx("div",{className:"w-full h-1.5 bg-gray-800 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-indigo-500/60 transition-all",style:{width:`${m}%`}})})}),n.jsx("td",{className:"px-4 py-2.5 text-sm font-mono text-gray-400 text-right",children:c.count.toLocaleString()})]},c.name)})})]})]})}function xp({skills:r}){const o=[...r].sort((u,c)=>c.count-u.count);return o.length===0?n.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:n.jsx("p",{className:"text-gray-500 text-sm",children:"No skill usage data available"})}):n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Skill Usage Leaderboard"})}),n.jsxs("table",{className:"w-full",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-800",children:[n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500 w-12",children:"Rank"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Skill Name"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Plugin"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Invocations"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Success Rate"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Last Used"})]})}),n.jsx("tbody",{children:o.map((u,c)=>{const f=u.count>0?Math.round(u.successCount/u.count*100):100,m=f>=90?"success":f>=70?"warning":"error";return n.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[n.jsxs("td",{className:"px-4 py-2.5 text-xs text-gray-600",children:["#",c+1]}),n.jsx("td",{className:"px-4 py-2.5",children:n.jsx("span",{className:"text-sm text-gray-300 font-mono",children:u.name})}),n.jsx("td",{className:"px-4 py-2.5",children:u.plugin&&n.jsx("span",{className:"text-[10px] text-gray-600 bg-gray-800 px-1.5 py-0.5 rounded",children:u.plugin})}),n.jsx("td",{className:"px-4 py-2.5 text-sm font-mono text-gray-400 text-right",children:u.count.toLocaleString()}),n.jsx("td",{className:"px-4 py-2.5 text-right",children:n.jsx(de,{label:`${f}%`,variant:m})}),n.jsx("td",{className:"px-4 py-2.5 text-xs text-gray-600 text-right whitespace-nowrap",children:u.lastUsed?yp(u.lastUsed):"-"})]},u.name)})})]})]})}function hp({agents:r}){if(r.length===0)return n.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:n.jsx("p",{className:"text-gray-500 text-sm",children:"No agent data available"})});const o=[...r].sort((c,f)=>f.count-c.count),u=o[0]?.count||1;return n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Top Agents"})}),n.jsxs("table",{className:"w-full",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-800",children:[n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500 w-12",children:"Rank"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Agent"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Usage"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Count"})]})}),n.jsx("tbody",{children:o.map((c,f)=>{const m=Math.max(2,c.count/u*100);return n.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[n.jsxs("td",{className:"px-4 py-2.5 text-xs text-gray-600",children:["#",f+1]}),n.jsx("td",{className:"px-4 py-2.5",children:n.jsx("span",{className:"text-sm text-gray-300",children:c.name})}),n.jsx("td",{className:"px-4 py-2.5",children:n.jsx("div",{className:"w-full h-1.5 bg-gray-800 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full bg-cyan-500/60 transition-all",style:{width:`${m}%`}})})}),n.jsx("td",{className:"px-4 py-2.5 text-sm font-mono text-gray-400 text-right",children:c.count.toLocaleString()})]},c.name)})})]})]})}function gp({days:r}){const o=r.slice(-14);if(o.length===0)return n.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:n.jsx("p",{className:"text-gray-500 text-sm",children:"No daily data available"})});const u=Math.max(...o.map(m=>m.totalEvents),1),c=o.reduce((m,g)=>m+g.totalEvents,0),f=Math.round(c/o.length);return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[n.jsx(se,{title:"Period Total",value:c.toLocaleString(),subtitle:`Last ${o.length} days`,color:"indigo"}),n.jsx(se,{title:"Daily Average",value:f.toLocaleString(),color:"cyan"}),n.jsx(se,{title:"Peak Day",value:u.toLocaleString(),subtitle:o.find(m=>m.totalEvents===u)?.date||"",color:"emerald"})]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsxs("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:["Daily Events (Last ",o.length," Days)"]}),n.jsx("div",{className:"flex items-end gap-1.5 h-40",children:o.map(m=>{const g=Math.max(2,m.totalEvents/u*100),j=m.date.slice(5);return n.jsxs("div",{className:"flex-1 flex flex-col items-center gap-1",children:[n.jsx("span",{className:"text-[9px] text-gray-500",children:m.totalEvents}),n.jsx("div",{className:"w-full bg-indigo-500/40 rounded-t hover:bg-indigo-500/60 transition-colors cursor-default",style:{height:`${g}%`},title:`${m.date}: ${m.totalEvents} events`}),n.jsx("span",{className:"text-[8px] text-gray-700",children:j})]},m.date)})})]})]})}function yp(r){if(!r)return"";try{const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return""}}function jm({items:r,maxBars:o=10}){const u=[...r].sort((f,m)=>m.value-f.value).slice(0,o),c=Math.max(...u.map(f=>f.value),1);return n.jsx("div",{className:"space-y-2",children:u.map((f,m)=>n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"text-xs text-gray-400 w-28 truncate text-right",title:f.label,children:f.label}),n.jsx("div",{className:"flex-1 h-5 bg-gray-800 rounded overflow-hidden",children:n.jsx("div",{className:"h-full rounded transition-all duration-500",style:{width:`${f.value/c*100}%`,backgroundColor:f.color||"#6366f1"}})}),n.jsx("span",{className:"text-xs text-gray-500 w-10 text-right",children:f.value})]},m))})}function pp(){const[r,o]=N.useState("overview"),[u,c]=N.useState(null),[f,m]=N.useState(0);ke("cost-update",()=>m(A=>A+1));const{data:g,loading:j,error:p,refetch:x}=_e(`/api/costs/summary?_r=${f}`);if(j)return n.jsx(lt,{});if(p)return n.jsx(Zt,{message:p,onRetry:x});if(!g)return null;const v=g.sessions||[],y=g.billingContext?.planType==="subscription",E=g.modelBreakdown?Object.entries(g.modelBreakdown).map(([A,L])=>({model:A,...L})).sort((A,L)=>L.cost-A.cost):bp(v),_=v.reduce((A,L)=>A+(L.inputTokens||0),0),U=v.reduce((A,L)=>A+(L.outputTokens||0),0),O=v.reduce((A,L)=>A+(L.cacheReadTokens||0),0),T=v.reduce((A,L)=>A+(L.cacheWriteTokens||0),0),q=_+U+O+T;return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsx("div",{className:"flex items-center gap-3",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("svg",{className:"w-5 h-5 text-amber-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),n.jsx("path",{d:"M2 17l10 5 10-5"}),n.jsx("path",{d:"M2 12l10 5 10-5"})]}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Claude Code Usage"}),n.jsx("span",{className:"text-xs text-gray-500",children:y&&g.billingContext?.monthlyAmount?`$${g.billingContext.monthlyAmount}/mo plan`:"API-equivalent usage analytics"})]})]})}),y&&n.jsxs("div",{className:"bg-indigo-500/10 border border-indigo-500/20 rounded-xl px-4 py-3 flex items-center gap-3",children:[n.jsx(de,{label:"Subscription",variant:"info"}),n.jsxs("span",{className:"text-xs text-gray-300",children:[g.billingContext?.monthlyAmount?`$${g.billingContext.monthlyAmount}/mo plan. `:"","Costs shown as API-equivalent value for usage analytics."]})]}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(se,{title:y?"API-Equivalent Value":"Total Cost",value:`$${g.totalCost.toFixed(2)}`,subtitle:y&&g.billingContext?.monthlyAmount?`Your plan: $${g.billingContext.monthlyAmount}/mo`:void 0,color:"amber"}),n.jsx(se,{title:y?"Cache Efficiency":"Cache Savings",value:`$${g.totalSavings.toFixed(2)}`,subtitle:y?"API-equivalent savings from cache":void 0,color:"emerald"}),n.jsx(se,{title:"Total Tokens",value:Xl(g.totalTokens),subtitle:jp(g.totalTokens),color:"indigo"}),n.jsx(se,{title:"Sessions",value:g.sessionCount.toLocaleString(),color:"cyan"})]}),n.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:["overview","sessions"].map(A=>n.jsx("button",{onClick:()=>o(A),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${r===A?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:A==="overview"?"Breakdown":`Sessions (${v.length})`},A))}),r==="overview"&&n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:y?"Usage Value by Model":"Cost by Model"}),E.length>0?n.jsx(jm,{items:E.map(A=>({label:A.model,value:parseFloat(A.cost.toFixed(2)),color:"#f59e0b"}))}):n.jsx("p",{className:"text-gray-600 text-xs",children:"No model data"})]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Token Breakdown"}),n.jsxs("div",{className:"space-y-3",children:[n.jsx(bi,{label:"Input",value:_,total:q,color:"bg-indigo-500"}),n.jsx(bi,{label:"Output",value:U,total:q,color:"bg-cyan-500"}),O>0&&n.jsx(bi,{label:"Cache Read",value:O,total:q,color:"bg-emerald-500"}),T>0&&n.jsx(bi,{label:"Cache Write",value:T,total:q,color:"bg-amber-500"})]})]}),E.length>0&&n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden lg:col-span-2",children:[n.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Model Details"})}),n.jsxs("table",{className:"w-full",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-800",children:[n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Model"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Sessions"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Tokens"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Cost"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Avg/Session"})]})}),n.jsx("tbody",{children:E.map(A=>n.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[n.jsx("td",{className:"px-4 py-2 text-sm text-gray-300",children:A.model}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:A.sessions.toLocaleString()}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:Xl(A.tokens)}),n.jsxs("td",{className:"px-4 py-2 text-xs text-amber-400 text-right",children:["$",A.cost.toFixed(2)]}),n.jsxs("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:["$",A.sessions>0?(A.cost/A.sessions).toFixed(4):"0"]})]},A.model))})]})]})]}),r==="sessions"&&n.jsx(vp,{sessions:v,expandedSession:u,onToggle:A=>c(u===A?null:A)}),n.jsx("div",{className:"text-center py-4 border-t border-gray-800/50",children:n.jsx("span",{className:"text-xs text-gray-600",children:"More providers coming soon"})})]})}const su=37,k0=160,G0=5;function vp({sessions:r,expandedSession:o,onToggle:u}){const c=N.useRef(null),[f,m]=N.useState(0),g=N.useCallback(()=>{c.current&&m(c.current.scrollTop)},[]),j=N.useMemo(()=>r.map(O=>(O.sessionId||"-")===o?k0:su),[r,o]),p=N.useMemo(()=>{const O=[];let T=0;for(const q of j)O.push(T),T+=q;return O},[j]),x=p.length>0?p[p.length-1]+j[j.length-1]:0,v=Math.min(x,su*20),y=N.useMemo(()=>{if(r.length===0)return{start:0,end:0};const O=f,T=f+v;let q=0,A=r.length-1;for(;q<A;){const K=q+A>>1;p[K]+j[K]<=O?q=K+1:A=K}const L=Math.max(0,q-G0);for(q=L,A=r.length-1;q<A;){const K=q+A+1>>1;p[K]>=T?A=K-1:q=K}const te=Math.min(r.length,q+G0+1);return{start:L,end:te}},[f,v,r.length,p,j]);if(N.useEffect(()=>{if(!o||!c.current)return;const O=r.findIndex(L=>(L.sessionId||"-")===o);if(O<0)return;const T=p[O],q=T+k0,A=c.current;q>A.scrollTop+v?A.scrollTop=q-v:T<A.scrollTop&&(A.scrollTop=T)},[o,r,p,v]),r.length===0)return n.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:n.jsx("p",{className:"text-gray-500 text-sm",children:"No session data available"})});const E=r.slice(y.start,y.end),_=y.start>0?p[y.start]:0,U=y.end<r.length?x-p[y.end]:0;return n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsxs("div",{className:"px-5 py-3 border-b border-gray-800 flex items-center justify-between",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Recent Sessions"}),n.jsxs("span",{className:"text-xs text-gray-500",children:[r.length," sessions"]})]}),n.jsx("table",{className:"w-full table-fixed",children:n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-800",children:[n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500 w-8"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Session"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Model"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Input"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Output"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Cache"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Cost"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Duration"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"When"})]})})}),n.jsx("div",{ref:c,onScroll:g,className:"overflow-y-auto custom-scrollbar",style:{maxHeight:`${v}px`},children:n.jsxs("div",{style:{height:`${x}px`,position:"relative"},children:[_>0&&n.jsx("div",{style:{height:`${_}px`}}),n.jsx("table",{className:"w-full table-fixed",children:n.jsx("tbody",{children:E.map(O=>{const T=O.sessionId||"-",q=o===T,A=(O.cacheReadTokens||0)+(O.cacheWriteTokens||0);return n.jsxs(N.Fragment,{children:[n.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30 cursor-pointer",style:{height:`${su}px`},onClick:()=>u(T),children:[n.jsx("td",{className:"px-4 py-2 text-xs text-gray-600 w-8",children:n.jsx("span",{className:`inline-block transition-transform ${q?"rotate-90":""}`,children:"▸"})}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-400 font-mono",children:T.slice(0,8)}),n.jsx("td",{className:"px-4 py-2",children:n.jsx(de,{label:O.model||"unknown",variant:"default"})}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:Xl(O.inputTokens)}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:Xl(O.outputTokens)}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:A>0?Xl(A):"-"}),n.jsxs("td",{className:"px-4 py-2 text-xs text-amber-400 text-right",children:["$",O.cost?.toFixed(4)||"0.0000"]}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:O.duration?V0(O.duration):"-"}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500",children:Np(O.timestamp)})]}),q&&n.jsx("tr",{className:"border-b border-gray-800/50",children:n.jsx("td",{colSpan:9,className:"px-6 py-3 bg-gray-800/20",children:n.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-xs",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-gray-500 block mb-1",children:"Input Tokens"}),n.jsx("span",{className:"text-gray-300 font-mono",children:O.inputTokens.toLocaleString()})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-gray-500 block mb-1",children:"Output Tokens"}),n.jsx("span",{className:"text-gray-300 font-mono",children:O.outputTokens.toLocaleString()})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-gray-500 block mb-1",children:"Cache Write"}),n.jsx("span",{className:"text-gray-300 font-mono",children:(O.cacheWriteTokens||0).toLocaleString()})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-gray-500 block mb-1",children:"Cache Read"}),n.jsx("span",{className:"text-gray-300 font-mono",children:(O.cacheReadTokens||0).toLocaleString()})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-gray-500 block mb-1",children:"Cost"}),n.jsxs("span",{className:"text-amber-400 font-mono",children:["$",O.cost?.toFixed(6)||"0"]})]}),O.savings!=null&&O.savings>0&&n.jsxs("div",{children:[n.jsx("span",{className:"text-gray-500 block mb-1",children:"Cache Savings"}),n.jsxs("span",{className:"text-emerald-400 font-mono",children:["$",O.savings.toFixed(6)]})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-gray-500 block mb-1",children:"Duration"}),n.jsx("span",{className:"text-gray-300",children:O.duration?V0(O.duration):"-"})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-gray-500 block mb-1",children:"Session ID"}),n.jsx("span",{className:"text-gray-400 font-mono text-[10px]",children:O.sessionId})]})]})})})]},T)})})}),U>0&&n.jsx("div",{style:{height:`${U}px`}})]})})]})}function bi({label:r,value:o,total:u,color:c}){const f=u>0?o/u*100:0,m={"bg-indigo-500":"rgb(99 102 241 / 0.6)","bg-cyan-500":"rgb(6 182 212 / 0.6)","bg-emerald-500":"rgb(16 185 129 / 0.6)","bg-amber-500":"rgb(245 158 11 / 0.6)"};return n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:"text-xs text-gray-400",children:r}),n.jsxs("span",{className:"text-xs text-gray-500",children:[Xl(o)," (",f.toFixed(1),"%)"]})]}),n.jsx("div",{className:"h-2 bg-gray-800 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full rounded-full",style:{width:`${f}%`,backgroundColor:m[c]||c}})})]})}function bp(r){const o=new Map;for(const u of r){const c=u.model||"unknown",f=o.get(c)||{cost:0,tokens:0,sessions:0};f.cost+=u.cost||0,f.tokens+=(u.inputTokens||0)+(u.outputTokens||0),f.sessions++,o.set(c,f)}return Array.from(o.entries()).map(([u,c])=>({model:u,...c})).sort((u,c)=>c.cost-u.cost)}function Xl(r){return r?r>=1e6?`${(r/1e6).toFixed(1)}M`:r>=1e3?`${(r/1e3).toFixed(1)}K`:String(r):"0"}function jp(r){return r?r.toLocaleString():"0"}function V0(r){const o=Math.round(r);if(o<60)return`${o}s`;const u=Math.floor(o/60),c=o%60;return u<60?`${u}m ${c}s`:`${Math.floor(u/60)}h ${u%60}m`}function Np(r){if(!r)return"-";try{const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return"-"}}function Ai(){const[r,o]=N.useState(!1),[u,c]=N.useState(null),[f,m]=N.useState(null),[g,j]=N.useState([]),[p,x]=N.useState("idle"),v=N.useRef(null),y=N.useRef(null);ke("command-output",U=>{const O=U;y.current&&O.executionId===y.current&&O.line&&j(T=>[...T,O.line])}),ke("command-complete",U=>{const O=U;if(y.current&&O.executionId===y.current){if(v.current&&(clearTimeout(v.current),v.current=null),o(!1),O.exitCode===0)x("success"),j(T=>[...T,"Command completed successfully."]);else{x("error");const T=`Command failed (exit code ${O.exitCode??"unknown"})`;m(T),j(q=>[...q,T])}y.current=null}}),N.useEffect(()=>()=>{v.current&&clearTimeout(v.current)},[]);const E=N.useCallback(async(U,O)=>{o(!0),m(null),j([`> specweave ${U}${O?` (${Object.values(O).join(", ")})`:""}`]),x("running");try{const T=O?"?"+new URLSearchParams(O).toString():"",A=await(await fetch(`/api/commands/${U}${T}`,{method:"POST"})).json();return A.ok?(c(A.data),y.current=A.data?.id||null,v.current=setTimeout(()=>{y.current&&(y.current=null,o(!1),x("error"),m("Command timed out after 60 seconds"),j(L=>[...L,"Timed out after 60 seconds."]))},6e4),A.data):(m(A.error||"Command failed"),x("error"),j(L=>[...L,`Error: ${A.error||"Command failed"}`]),o(!1),null)}catch(T){return m(String(T)),x("error"),j(q=>[...q,`Error: ${String(T)}`]),o(!1),null}},[]),_=N.useCallback(()=>{o(!1),c(null),m(null),j([]),x("idle"),y.current=null,v.current&&(clearTimeout(v.current),v.current=null)},[]);return{execute:E,running:r,result:u,error:f,output:g,status:p,reset:_}}function Sp(r){switch(r){case"connected":return"success";case"sync_failed":return"warning";case"configured_never_synced":return"info";default:return"default"}}function Ep(r){switch(r){case"connected":return"Connected";case"sync_failed":return"Sync Failed";case"configured_never_synced":return"Ready";case"not_configured":return"Not Configured";default:return r||"Unknown"}}function Cp(){const[r,o]=N.useState("health"),[u,c]=N.useState(null),[f,m]=N.useState(0);ke("sync-update",()=>m(V=>V+1));const{data:g,loading:j,error:p,refetch:x}=_e(`/api/sync/status?_r=${f}`),{data:v,loading:y}=_e(`/api/sync/audit?limit=100&_r=${f}`),{data:E,loading:_}=_e(`/api/sync/audit/summary?_r=${f}`),{execute:U,running:O}=Ai(),T=async(V,X)=>{const $=X?`${X}-${V}`:V;c($);try{const ee=new URLSearchParams(window.location.search).get("project")||"",P=new URLSearchParams;P.set("platform",V),X&&P.set("repo",X),ee&&P.set("project",ee);const Se=new AbortController,Ge=setTimeout(()=>Se.abort(),3e4);await fetch(`/api/sync/verify?${P.toString()}`,{method:"POST",signal:Se.signal}),clearTimeout(Ge),x()}catch{}c(null)};if(j||y||_)return n.jsx(lt,{});if(p)return n.jsx(Zt,{message:p,onRetry:x});if(!g)return null;const q=v?.length||0,A=v?.filter(V=>V.result==="error").length||0,L=v?.filter(V=>V.conflict)||[],te=g.isUmbrella&&g.repos&&g.repos.length>0;let K=0,ce=0;if(te&&g.repos)for(const V of g.repos){const X=Object.values(V.platforms).filter($=>$.connectionStatus!=="not_configured");ce+=X.length,K+=X.filter($=>$.connectionStatus==="connected").length}else{const V=Object.entries(g.platforms).filter(([X])=>["github","jira","ado"].includes(X));ce=V.length,K=V.filter(([,X])=>X.connectionStatus==="connected").length}return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Sync Health"}),!te&&n.jsx("button",{onClick:()=>U("sync-push"),disabled:O,className:"px-3 py-1.5 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white text-xs rounded-lg transition-colors",children:O?"Syncing...":"Sync Now"})]}),g.permissions&&n.jsx(Tp,{permissions:g.permissions,onSave:x}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(se,{title:te?"Repos":"Platforms",value:te?g.repos.length:ce,subtitle:`${K} connected`,color:"indigo"}),n.jsx(se,{title:"Audit Entries",value:q,color:"cyan"}),n.jsx(se,{title:"Errors",value:A,color:"rose"}),n.jsx(se,{title:"Conflicts",value:L.length,color:"amber"})]}),n.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:["health","audit","conflicts"].map(V=>n.jsx("button",{onClick:()=>o(V),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${r===V?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:V==="health"?"Platform Health":V==="audit"?"Audit Log":`Conflicts (${L.length})`},V))}),r==="health"&&n.jsx(n.Fragment,{children:te&&g.repos?n.jsx(wp,{repos:g.repos,auditSummary:E,verifying:u,onVerify:T,execute:U,running:O}):n.jsx(Ap,{platforms:g.platforms,auditSummary:E,verifying:u,onVerify:T})}),r==="audit"&&n.jsx(X0,{entries:v||[]}),r==="conflicts"&&n.jsx(X0,{entries:L}),g.lastUpdated&&n.jsxs("p",{className:"text-xs text-gray-600",children:["Last metadata update: ",new Date(g.lastUpdated).toLocaleString()]})]})}function Tp({permissions:r,onSave:o}){const[u,c]=N.useState(r),[f,m]=N.useState(!1),[g,j]=N.useState(null),p=JSON.stringify(u)!==JSON.stringify(r),x=async()=>{m(!0),j(null);try{const y=new URLSearchParams(window.location.search).get("project")||"",E=y?`?project=${y}`:"",_=await fetch(`/api/config${E}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({sync:{settings:u}})});if(_.ok)o();else{const U=await _.json().catch(()=>({}));j(U.error||`Save failed (HTTP ${_.status})`)}}catch(y){j(String(y))}m(!1)},v=[{key:"canUpsertInternalItems",label:"Create/Update Internal",desc:"Can create/update items created by SpecWeave"},{key:"canUpdateExternalItems",label:"Update External",desc:"Can modify items originally from external tools"},{key:"canUpdateStatus",label:"Update Status",desc:"Can close/reopen issues on external platforms"},{key:"autoSyncOnCompletion",label:"Auto-Sync",desc:"Automatically sync when tasks are completed"}];return n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-4",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("span",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Sync Permissions"}),p&&n.jsx("button",{onClick:x,disabled:f,className:"px-2.5 py-1 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white text-[10px] rounded transition-colors",children:f?"Saving...":"Save"})]}),g&&n.jsxs("p",{className:"text-xs text-red-400 mb-2",children:["Failed to save: ",g]}),n.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:v.map(({key:y,label:E,desc:_})=>n.jsxs("button",{onClick:()=>c(U=>({...U,[y]:!U[y]})),className:`text-left p-2.5 rounded-lg border transition-colors ${u[y]?"bg-emerald-500/10 border-emerald-500/30 hover:border-emerald-500/50":"bg-gray-800/30 border-gray-800 hover:border-gray-700"}`,children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("div",{className:`w-2 h-2 rounded-full ${u[y]?"bg-emerald-400":"bg-gray-600"}`}),n.jsx("span",{className:"text-xs font-medium text-gray-300",children:E})]}),n.jsx("p",{className:"text-[10px] text-gray-500 leading-tight",children:_})]},y))})]})}function wp({repos:r,auditSummary:o,verifying:u,onVerify:c,execute:f,running:m}){return r.length===0?n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[n.jsx("p",{className:"text-gray-500 text-sm",children:"No child repositories configured"}),n.jsx("p",{className:"text-gray-600 text-xs mt-1",children:"Add repos in umbrella.childRepos in config.json"})]}):n.jsx("div",{className:"space-y-4",children:r.map(g=>{const p=Object.entries(g.platforms).filter(([x])=>["github","jira","ado"].includes(x)).filter(([,x])=>x.connectionStatus!=="not_configured");return n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-sm font-medium text-gray-200",children:g.repoName}),g.hasSpecweave&&n.jsx("span",{className:"px-1.5 py-0.5 text-[9px] font-medium bg-emerald-500/15 text-emerald-400 rounded",children:".specweave"}),!g.hasSpecweave&&n.jsx("span",{className:"px-1.5 py-0.5 text-[9px] font-medium bg-gray-700/50 text-gray-500 rounded",children:"no .specweave"})]}),n.jsx("span",{className:"text-[10px] text-gray-600",children:g.repoPath})]}),n.jsx("button",{onClick:()=>f("sync-push",{repo:g.repoId}),disabled:m||!g.hasSpecweave,title:g.hasSpecweave?"Sync this repository":"Initialize .specweave in this repo to enable sync",className:"px-3 py-1.5 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-40 disabled:cursor-not-allowed text-white text-xs rounded-lg transition-colors",children:m?"Syncing...":"Sync Now"})]}),p.length===0?n.jsxs("div",{className:"text-xs text-gray-600 p-3 bg-gray-800/20 rounded-lg",children:["No platforms configured for this repository.",n.jsx(rt,{to:"/config",className:"ml-1 text-indigo-400 hover:text-indigo-300",children:"Configure"})]}):n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:p.map(([x,v])=>n.jsx(Nm,{platform:x,info:v,summary:o?.[x],verifying:u===`${g.repoId}-${x}`,onVerify:()=>c(x,g.repoId)},x))})]},g.repoId)})})}function Ap({platforms:r,auditSummary:o,verifying:u,onVerify:c}){const f=Object.entries(r).filter(([m])=>["github","jira","ado"].includes(m));return f.length===0?n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[n.jsx("p",{className:"text-gray-500 text-sm",children:"No sync platforms configured"}),n.jsx("p",{className:"text-gray-600 text-xs mt-1",children:"Configure GitHub, JIRA, or ADO in your config"})]}):n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:f.map(([m,g])=>n.jsx(Nm,{platform:m,info:g,summary:o?.[m],verifying:u===m,onVerify:()=>c(m)},m))})}function Nm({platform:r,info:o,summary:u,verifying:c,onVerify:f}){const m=o.connectionStatus||"unknown";return n.jsxs("div",{className:"bg-gray-800/30 border border-gray-800/50 rounded-xl p-4",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Sm,{platform:r}),n.jsxs("div",{children:[n.jsx("span",{className:"text-sm font-medium text-gray-300 capitalize",children:r}),o.configDetail&&n.jsx("div",{className:"text-[10px] text-gray-600 mt-0.5",children:o.configDetail})]})]}),n.jsx(de,{label:Ep(m),variant:Sp(m)})]}),o.diagnosticMessage&&n.jsx("div",{className:"text-xs text-gray-500 mb-3 p-2 bg-gray-800/30 rounded-lg",children:o.diagnosticMessage}),m==="not_configured"&&n.jsx(rt,{to:"/config",className:"block text-center text-xs text-indigo-400 hover:text-indigo-300 py-2 border border-gray-800 rounded-lg hover:border-indigo-500/30 transition-colors",children:"Configure in Settings"}),m==="configured_never_synced"&&n.jsx("button",{onClick:f,disabled:c,className:"w-full text-xs text-indigo-400 hover:text-indigo-300 py-2 border border-gray-800 rounded-lg hover:border-indigo-500/30 transition-colors disabled:opacity-50",children:c?"Verifying...":"Verify Connection"}),m==="sync_failed"&&n.jsx("button",{onClick:f,disabled:c,className:"w-full text-xs text-amber-400 hover:text-amber-300 py-2 border border-amber-500/20 rounded-lg hover:border-amber-500/40 transition-colors disabled:opacity-50",children:c?"Verifying...":"Retry Sync"}),n.jsxs("div",{className:"space-y-2 mt-3",children:[o.lastImport&&n.jsx(Vl,{label:"Last Import",value:new Date(o.lastImport).toLocaleString()}),m==="connected"&&!o.lastImport&&n.jsx(Vl,{label:"Status",value:"Connected, no imports yet"}),o.lastImportCount!=null&&o.lastImportCount>0&&n.jsx(Vl,{label:"Items Imported",value:o.lastImportCount.toLocaleString()}),o.lastSkippedCount!=null&&o.lastSkippedCount>0&&n.jsx(Vl,{label:"Skipped",value:o.lastSkippedCount.toLocaleString()}),u&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"border-t border-gray-800 my-2"}),n.jsx(Vl,{label:"Total Ops",value:u.total.toLocaleString()}),n.jsx(Vl,{label:"Success",value:u.success.toLocaleString()}),u.errors>0&&n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs text-gray-500",children:"Errors"}),n.jsx(de,{label:String(u.errors),variant:"error"})]})]})]})]})}function X0({entries:r}){if(r.length===0)return n.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:n.jsx("p",{className:"text-gray-500 text-sm",children:"No audit entries"})});const o={success:"success",error:"error",denied:"warning",skipped:"default"};return n.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:n.jsxs("table",{className:"w-full",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-800",children:[n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Time"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Platform"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Operation"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Item"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Direction"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Result"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Duration"})]})}),n.jsx("tbody",{children:r.map((u,c)=>n.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500",children:Rp(u.timestamp)}),n.jsx("td",{className:"px-4 py-2",children:n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Sm,{platform:u.platform}),n.jsx("span",{className:"text-xs text-gray-400 capitalize",children:u.platform})]})}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-400",children:u.operation}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 font-mono max-w-[120px] truncate",children:u.itemId||"-"}),n.jsx("td",{className:"px-4 py-2",children:n.jsx(de,{label:u.direction,variant:u.direction==="push"?"info":"default"})}),n.jsx("td",{className:"px-4 py-2",children:n.jsx(de,{label:u.result,variant:o[u.result]||"default"})}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-600 text-right",children:u.duration?`${u.duration}ms`:"-"})]},c))})]})})}function Vl({label:r,value:o}){return n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs text-gray-500",children:r}),n.jsx("span",{className:"text-xs text-gray-400",children:o})]})}function Sm({platform:r}){const o={github:"bg-gray-700",jira:"bg-blue-700",ado:"bg-blue-600"};return n.jsx("div",{className:`w-5 h-5 rounded ${o[r]||"bg-gray-700"} flex items-center justify-center`,children:n.jsx("span",{className:"text-[9px] text-white font-bold",children:r[0]?.toUpperCase()})})}function Rp(r){if(!r)return"-";try{const o=new Date(r).getTime();if(isNaN(o))return"-";const u=Date.now()-o,c=Math.floor(u/6e4);if(c<1)return"just now";if(c<60)return`${c}m ago`;const f=Math.floor(c/60);return f<24?`${f}h ago`:`${Math.floor(f/24)}d ago`}catch{return"-"}}const Em={prompt_too_long:"error",api_error:"warning",tool_failure:"info",hook_error:"default",rate_limit:"warning",unknown:"default"},Jn=50;function Mp(){const[r,o]=Ya("tab","groups"),[u,c]=Ya("type",""),[f,m]=Ya("q",""),[g,j]=Ya("session",""),[p,x]=N.useState(0),[v,y]=N.useState(f),E=p*Jn,_=u?`&type=${encodeURIComponent(u)}`:"",U=f?`&search=${encodeURIComponent(f)}`:"",[O,T]=N.useState(0);ke("error-detected",()=>T(F=>F+1));const{data:q,loading:A,error:L}=_e(r==="groups"?`/api/errors/groups?_r=${O}`:""),{data:te,loading:K,error:ce}=_e(r==="errors"||r==="groups"?`/api/errors/recent?limit=${Jn}&offset=${E}${_}${U}&_r=${O}`:""),{data:V,loading:X,error:$}=_e(r==="sessions"||g?`/api/errors/sessions?limit=50&_r=${O}`:""),{data:ee,loading:P,error:Se}=_e(r==="timeline"?`/api/errors/timeline?bucket=60&_r=${O}`:""),Ge=N.useCallback(()=>{m(v.trim()),x(0),v.trim()&&o("errors")},[v,m,o]);N.useEffect(()=>{g&&V&&!V.find(F=>F.sessionId===g)&&j("")},[g,V,j]);const Le=r==="groups"&&A||r==="errors"&&K||r==="timeline"&&P||r==="sessions"&&X,Ee=L||ce||(r==="sessions"?$:null)||(r==="timeline"?Se:null),H=te?.total||0,Q=te?.errors||[],le=q?.length||0,pe=q?.reduce((F,Ke)=>F+Ke.sessions,0)||0,je=q?.[0]?.type||"-",b=g?V?.find(F=>F.sessionId===g):null,Y=u?(V||[]).filter(F=>F.errors.some(Ke=>Ke.type===u)):V||[],Z=Math.ceil(H/Jn),W=F=>{c(F),o("errors"),j(""),x(0)},ie=F=>{o(F),j(""),F!=="errors"&&x(0)},fe=()=>{c(""),m(""),y(""),x(0)};return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Error Tracing"}),n.jsx("span",{className:"text-xs text-gray-500",children:"Observability for Claude Code sessions"})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("input",{type:"text",value:v,onChange:F=>y(F.target.value),onKeyDown:F=>F.key==="Enter"&&Ge(),placeholder:"Search errors by message, tool name, or context...",className:"w-full px-3 py-2 text-sm bg-gray-900/50 border border-gray-700 rounded-lg text-gray-300 placeholder-gray-600 focus:outline-none focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500/30"}),f&&n.jsx("button",{onClick:()=>{m(""),y(""),x(0)},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-300 text-xs",children:"clear"})]}),n.jsx("button",{onClick:Ge,className:"px-4 py-2 text-sm bg-indigo-600 hover:bg-indigo-500 text-white rounded-lg transition-colors",children:"Search"})]}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(se,{title:"Total Errors",value:H,color:"rose"}),n.jsx(se,{title:"Error Types",value:le,color:"amber"}),n.jsx(se,{title:"Affected Sessions",value:pe,color:"indigo"}),n.jsx(se,{title:"Most Common",value:je,color:"cyan"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:["groups","errors","timeline","sessions"].map(F=>n.jsx("button",{onClick:()=>ie(F),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${r===F?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:F==="groups"?"Error Groups":F==="errors"?"All Errors":F==="timeline"?"Timeline":"Sessions"},F))}),(u||f)&&n.jsxs("div",{className:"flex items-center gap-2",children:[u&&n.jsx(de,{label:`type: ${u.replace(/_/g," ")}`,variant:"info"}),f&&n.jsx(de,{label:`search: ${f.slice(0,20)}`,variant:"default"}),n.jsx("button",{onClick:fe,className:"text-xs text-gray-500 hover:text-gray-300 transition-colors",children:"clear all"})]})]}),Ee&&n.jsxs("div",{className:"bg-rose-900/30 border border-rose-700 rounded-lg px-4 py-3 flex items-center justify-between",children:[n.jsx("div",{className:"text-sm text-rose-300",children:Ee}),n.jsx("button",{onClick:()=>window.location.reload(),className:"text-xs text-rose-400 hover:text-rose-200 px-2 py-1 border border-rose-700 rounded transition-colors",children:"Retry"})]}),g&&b&&n.jsx(Up,{session:b,onClose:()=>j("")}),Le&&!g&&n.jsx(lt,{}),!g&&!Le&&r==="groups"&&n.jsx(_p,{groups:q||[],onGroupClick:W}),!g&&!Le&&r==="errors"&&n.jsx(zp,{errors:Q,total:H,page:p,totalPages:Z,onPageChange:x,onSessionClick:F=>{j(F),o("sessions")}}),!g&&!Le&&r==="timeline"&&n.jsx(Op,{buckets:ee||[],errors:Q,onSessionClick:F=>j(F)}),!g&&!Le&&r==="sessions"&&n.jsx(Dp,{sessions:Y,onSelect:F=>j(F)}),!Le&&!Ee&&H===0&&!g&&n.jsx(pu,{title:"No errors detected",description:"Claude Code session logs are clean"})]})}function _p({groups:r,onGroupClick:o}){return r.length===0?null:n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Error Groups"})}),n.jsxs("table",{className:"w-full",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-800",children:[n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Type"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Count"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Sessions"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Last Seen"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Sample Message"})]})}),n.jsx("tbody",{children:r.map(u=>n.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[n.jsx("td",{className:"px-4 py-2",children:n.jsx(de,{label:u.type.replace(/_/g," "),variant:Em[u.type]||"default"})}),n.jsx("td",{className:"px-4 py-2 text-right",children:n.jsx("button",{onClick:()=>o(u.type),className:"text-sm text-indigo-400 hover:text-indigo-300 font-mono transition-colors",title:`View all ${u.count} errors of this type`,children:u.count})}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:u.sessions}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-300 font-mono",title:Ql(u.lastSeen),children:es(u.lastSeen)}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 max-w-xs truncate",children:u.recentMessages[0]||"-"})]},u.type))})]})]})}function zp({errors:r,total:o,page:u,totalPages:c,onPageChange:f,onSessionClick:m}){const[g,j]=N.useState(new Set),p=N.useCallback(y=>{j(E=>{const _=new Set(E);return _.has(y)?_.delete(y):_.add(y),_})},[]);if(r.length===0)return n.jsx(pu,{title:"No errors",description:"No errors match the current filter"});const x=u*Jn+1,v=Math.min(u*Jn+r.length,o);return n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsxs("div",{className:"px-5 py-3 border-b border-gray-800 flex items-center justify-between",children:[n.jsxs("h3",{className:"text-sm font-medium text-gray-300",children:["Errors ",x,"–",v," of ",o]}),c>1&&n.jsx(Q0,{page:u,totalPages:c,onChange:f})]}),n.jsx("div",{className:"divide-y divide-gray-800/50",children:r.map((y,E)=>{const _=g.has(E),U=y.message.length>120;return n.jsx("div",{className:"px-4 py-3 hover:bg-gray-800/20 transition-colors",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("div",{className:"flex-shrink-0 mt-0.5",children:n.jsx(de,{label:y.type.replace(/_/g," "),variant:Em[y.type]||"default"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:`text-xs text-gray-300 ${_?"whitespace-pre-wrap break-words":"truncate"} ${U?"cursor-pointer":""}`,onClick:()=>U&&p(E),title:U?_?"Click to collapse":"Click to expand details":void 0,children:[U&&n.jsx("span",{className:"text-indigo-400 mr-1 text-[10px] inline-block w-3",children:_?"▼":"▶"}),_?y.message:y.message.slice(0,200),!_&&U&&n.jsx("span",{className:"text-indigo-400 ml-1",children:"...more"})]}),y.context?.toolName&&n.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 bg-gray-800 border border-gray-700 rounded text-amber-400",children:y.context.toolName}),y.context.toolInput&&n.jsx("span",{className:"text-[10px] text-gray-500 font-mono truncate max-w-md",children:y.context.toolInput})]}),_&&n.jsx(Cm,{context:y.context})]}),n.jsxs("div",{className:"flex-shrink-0 text-right",children:[n.jsx("div",{className:"text-[10px] text-gray-300 font-mono",title:Ql(y.timestamp),children:es(y.timestamp)}),n.jsx("div",{className:"text-[10px] text-gray-600",children:Ql(y.timestamp)}),n.jsx("button",{onClick:()=>m(y.sessionId),className:"text-[10px] text-indigo-400 hover:text-indigo-300 font-mono mt-0.5 transition-colors",title:"View full session",children:y.sessionId.slice(0,8)}),y.context?.messageIndex!=null&&n.jsxs("div",{className:"text-[10px] text-gray-600",children:["msg #",y.context.messageIndex]})]})]})},`${y.sessionId}-${y.timestamp}-${E}`)})}),c>1&&n.jsx("div",{className:"px-5 py-3 border-t border-gray-800 flex justify-end",children:n.jsx(Q0,{page:u,totalPages:c,onChange:f})})]})}function Cm({context:r}){if(!r)return null;const{precedingAction:o,recentTools:u}=r;return!o&&(!u||u.length===0)?null:n.jsxs("div",{className:"mt-2 p-2 bg-gray-900/60 border border-gray-800 rounded-lg space-y-1.5",children:[o&&n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider",children:"What preceded this error:"}),n.jsx("div",{className:"text-[11px] text-gray-400 font-mono mt-0.5",children:o})]}),u&&u.length>0&&n.jsxs("div",{children:[n.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider",children:"Recent tool chain:"}),n.jsx("div",{className:"flex flex-col gap-0.5 mt-0.5",children:u.map((c,f)=>n.jsxs("div",{className:"flex items-center gap-1.5 text-[10px]",children:[n.jsxs("span",{className:"text-gray-600",children:[u.length-f,"."]}),n.jsx("span",{className:"font-mono text-amber-400/80",children:c.name}),c.input&&n.jsx("span",{className:"text-gray-600 font-mono truncate max-w-sm",children:c.input})]},f))})]})]})}function Q0({page:r,totalPages:o,onChange:u}){return n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("button",{onClick:()=>u(Math.max(0,r-1)),disabled:r===0,className:"px-2 py-1 text-xs rounded transition-colors disabled:text-gray-700 text-gray-400 hover:text-white hover:bg-gray-700",children:"Prev"}),n.jsxs("span",{className:"text-[10px] text-gray-500 px-2",children:[r+1," / ",o]}),n.jsx("button",{onClick:()=>u(Math.min(o-1,r+1)),disabled:r>=o-1,className:"px-2 py-1 text-xs rounded transition-colors disabled:text-gray-700 text-gray-400 hover:text-white hover:bg-gray-700",children:"Next"})]})}function Op({buckets:r,errors:o,onSessionClick:u}){const[c,f]=N.useState(null),m=Math.max(...r.map(x=>x.count),1),g={tool_failure:"bg-blue-500",prompt_too_long:"bg-rose-500",api_error:"bg-amber-500",hook_error:"bg-gray-500",rate_limit:"bg-amber-400",unknown:"bg-gray-600"},j=c?o.filter(x=>{const v=new Date(x.timestamp).getTime();return v>=new Date(c.start).getTime()&&v<new Date(c.end).getTime()}):o,p=x=>{try{return new Date(x).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return x}};return n.jsxs("div",{className:"space-y-4",children:[r.length>0&&n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Error Density (per hour)"}),c&&n.jsx("button",{onClick:()=>f(null),className:"text-[10px] text-indigo-400 hover:text-indigo-300",children:"Clear filter"})]}),n.jsx("div",{className:"flex items-end gap-px h-24",children:r.map((x,v)=>{const y=x.count/m*100,E=c?.start===x.start;return n.jsx("div",{className:"flex-1 flex flex-col items-center justify-end cursor-pointer group relative",onClick:()=>f(E?null:x),title:`${p(x.start)}: ${x.count} errors`,children:n.jsx("div",{className:`w-full min-h-[2px] rounded-t transition-all ${E?"bg-indigo-400":"bg-rose-500/70 group-hover:bg-rose-400"}`,style:{height:`${Math.max(y,2)}%`}})},v)})}),n.jsxs("div",{className:"flex justify-between mt-1",children:[n.jsx("span",{className:"text-[9px] text-gray-600",children:r.length>0?p(r[0].start):""}),n.jsx("span",{className:"text-[9px] text-gray-600",children:r.length>0?p(r[r.length-1].start):""})]}),n.jsx("div",{className:"flex gap-3 mt-2",children:Object.entries(g).map(([x,v])=>n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("div",{className:`w-2 h-2 rounded-full ${v}`}),n.jsx("span",{className:"text-[9px] text-gray-600",children:x.replace(/_/g," ")})]},x))})]}),c&&n.jsxs("div",{className:"text-xs text-gray-400 px-1",children:["Showing ",j.length," errors from ",p(c.start)]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:c?"Filtered Errors":"Recent Errors"}),n.jsxs("div",{className:"space-y-1 max-h-[400px] overflow-y-auto custom-scrollbar",children:[j.length===0&&n.jsx("p",{className:"text-xs text-gray-600",children:"No errors in this time range"}),j.slice(0,100).map((x,v)=>n.jsxs("div",{className:"flex items-start gap-3 py-2 px-2 hover:bg-gray-800/30 rounded cursor-pointer",onClick:()=>u(x.sessionId),children:[n.jsx("div",{className:`w-2 h-2 rounded-full mt-1.5 flex-shrink-0 ${g[x.type]||"bg-gray-500"}`}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-xs text-gray-400 font-mono",children:x.type.replace(/_/g," ")}),x.context?.toolName&&n.jsx("span",{className:"text-[10px] font-mono px-1 py-0.5 bg-gray-800 border border-gray-700 rounded text-amber-400",children:x.context.toolName}),n.jsx("span",{className:"text-[10px] text-gray-300 font-mono",children:es(x.timestamp)}),n.jsx("span",{className:"text-[10px] text-gray-600",children:Ql(x.timestamp)})]}),n.jsx("div",{className:"text-xs text-gray-500 truncate mt-0.5",children:x.message}),x.context?.precedingAction&&n.jsxs("div",{className:"text-[10px] text-gray-600 mt-0.5 truncate",children:["After: ",x.context.precedingAction]})]})]},v))]})]})]})}function Dp({sessions:r,onSelect:o}){return r.length===0?null:n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Recent Sessions"})}),n.jsxs("table",{className:"w-full",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-800",children:[n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Session"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Branch"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Messages"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Tool Calls"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Errors"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Started"})]})}),n.jsx("tbody",{children:r.map(u=>n.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30 cursor-pointer",onClick:()=>o(u.sessionId),children:[n.jsx("td",{className:"px-4 py-2 text-xs text-gray-400 font-mono",children:u.sessionId.slice(0,8)}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500",children:u.gitBranch||"-"}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:u.messageCount}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:u.toolCallCount}),n.jsx("td",{className:"px-4 py-2 text-right",children:u.errors.length>0?n.jsx(de,{label:String(u.errors.length),variant:"error"}):n.jsx("span",{className:"text-xs text-gray-600",children:"0"})}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-300 font-mono",title:Ql(u.startTime),children:es(u.startTime)})]},u.sessionId))})]})]})}function Up({session:r,onClose:o}){const[u,c]=N.useState(new Set),f=m=>{c(g=>{const j=new Set(g);return j.has(m)?j.delete(m):j.add(m),j})};return n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("div",{children:[n.jsxs("h3",{className:"text-sm font-medium text-gray-300",children:["Session: ",n.jsx("span",{className:"font-mono",children:r.sessionId.slice(0,12)})]}),n.jsxs("div",{className:"text-[10px] text-gray-600 mt-0.5",children:["v",r.version," | ",r.gitBranch," | ",r.messageCount," messages | ",r.toolCallCount," tool calls"]})]}),n.jsx("button",{onClick:o,className:"px-2 py-1 text-xs text-gray-400 hover:text-white hover:bg-gray-700 rounded transition-colors",children:"Back"})]}),n.jsxs("div",{className:"flex gap-3 mb-4",children:[n.jsxs("div",{className:"text-xs text-gray-500",children:["Started: ",new Date(r.startTime).toLocaleString()]}),r.endTime&&n.jsxs("div",{className:"text-xs text-gray-500",children:["Ended: ",new Date(r.endTime).toLocaleString()]})]}),r.errors.length===0?n.jsx("p",{className:"text-gray-600 text-xs",children:"No errors in this session"}):n.jsx("div",{className:"space-y-2",children:r.errors.map((m,g)=>{const j=u.has(g),p=m.message.length>150;return n.jsxs("div",{className:"p-3 bg-gray-800/50 rounded-lg border-l-2 border-rose-500/50",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx(de,{label:m.type.replace(/_/g," "),variant:"error"}),m.context?.toolName&&n.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 bg-gray-800 border border-gray-700 rounded text-amber-400",children:m.context.toolName}),n.jsx("span",{className:"text-[10px] text-gray-300 font-mono",children:es(m.timestamp)}),n.jsx("span",{className:"text-[10px] text-gray-600",children:Ql(m.timestamp)})]}),n.jsxs("div",{className:`text-xs text-gray-400 ${j?"whitespace-pre-wrap break-words":""} ${p?"cursor-pointer":""}`,onClick:()=>p&&f(g),title:p?j?"Click to collapse":"Click to expand":void 0,children:[p&&n.jsx("span",{className:"text-indigo-400 mr-1 text-[10px] inline-block w-3",children:j?"▼":"▶"}),j?m.message:m.message.slice(0,300),!j&&p&&n.jsx("span",{className:"text-indigo-400 ml-1",children:"...more"})]}),m.context?.toolInput&&n.jsx("div",{className:"text-[10px] text-gray-500 font-mono mt-1.5 bg-gray-900/50 px-2 py-1 rounded",children:m.context.toolInput}),m.context?.messageIndex!=null&&n.jsxs("div",{className:"text-[10px] text-gray-600 mt-1",children:["At message #",m.context.messageIndex]}),j&&n.jsx(Cm,{context:m.context})]},g)})})]})}function Ql(r){if(!r)return"-";const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}function es(r){if(!r)return"-";try{return new Date(r).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return r}}const Lp=[{value:"all",label:"All"},{value:"command",label:"Commands"},{value:"hook",label:"Hooks"},{value:"notification",label:"Notifications"},{value:"cost",label:"Cost"}],Hp=[{value:"all",label:"All Levels"},{value:"error",label:"Errors"},{value:"warning",label:"Warnings"},{value:"info",label:"Info"}];function Bp(){const[r,o]=Ya("category","all"),[u,c]=Ya("severity","all"),f=r||"all",m=u||"all",[g,j]=N.useState([]),[p,x]=N.useState(200),[v,y]=N.useState(null),E=new URLSearchParams;E.set("limit",String(p)),f!=="all"&&E.set("categories",f),m!=="all"&&E.set("severity",m);const{data:_,loading:U}=_e(`/api/activity/stream?${E.toString()}`),O=N.useCallback($=>{j(ee=>[$,...ee].slice(0,50))},[]);if(ke("activity",O),U)return n.jsx(lt,{});const T=[...g,..._||[]],q=new Set,A=[];for(const $ of T){const ee=`${$.timestamp}:${$.title}`;q.has(ee)||(q.add(ee),A.push($))}const L=A.filter($=>!(f!=="all"&&$.category!==f||m!=="all"&&$.severity!==m)),te=A.filter($=>$.severity==="error").length,K=A.filter($=>$.severity==="warning").length,ce=new Set(A.map($=>$.source)),V=$=>{y(ee=>ee===$?null:$)},X=()=>{x($=>$+200)};return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Activity Stream"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-2 h-2 rounded-full bg-emerald-400 pulse-dot"}),n.jsx("span",{className:"text-xs text-gray-500",children:"Live"})]})]}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(se,{title:"Total Events",value:A.length,color:"indigo"}),n.jsx(se,{title:"Errors",value:te,color:"rose"}),n.jsx(se,{title:"Warnings",value:K,color:"amber"}),n.jsx(se,{title:"Sources",value:ce.size,color:"cyan"})]}),n.jsxs("div",{className:"flex flex-wrap gap-4",children:[n.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:Lp.map($=>n.jsx("button",{onClick:()=>o($.value),className:`px-3 py-1 text-xs rounded-md transition-colors ${f===$.value?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:$.label},$.value))}),n.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:Hp.map($=>n.jsx("button",{onClick:()=>c($.value),className:`px-3 py-1 text-xs rounded-md transition-colors ${m===$.value?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:$.label},$.value))}),n.jsxs("span",{className:"text-xs text-gray-500 self-center",children:[L.length," events"]})]}),n.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl divide-y divide-gray-800/50",children:L.length===0?n.jsxs("div",{className:"p-8 text-center",children:[n.jsx("p",{className:"text-gray-500 text-sm",children:"No events match filters"}),n.jsx("p",{className:"text-gray-600 text-xs mt-1",children:"Try adjusting category or severity filters"})]}):n.jsxs(n.Fragment,{children:[L.slice(0,p).map(($,ee)=>{const P=`${$.timestamp}-${ee}`,Se=v===P;return n.jsx(qp,{event:$,isExpanded:Se,onToggle:()=>V(P)},P)}),L.length>=p&&n.jsx("div",{className:"p-4 text-center",children:n.jsx("button",{onClick:X,className:"px-4 py-2 text-xs text-indigo-400 hover:text-indigo-300 border border-indigo-500/30 rounded-lg transition-colors",children:"Load more events"})})]})})]})}function qp({event:r,isExpanded:o,onToggle:u}){const c=r.severity==="error"?"bg-rose-400":r.severity==="warning"?"bg-amber-400":"bg-gray-600",f={command:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",hook:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101",notification:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",cost:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1",sync:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581"},m=r.detail||r.metadata&&Object.keys(r.metadata).length>0;return n.jsxs("div",{children:[n.jsxs("div",{className:`px-4 py-3 flex items-start gap-3 transition-colors ${m?"cursor-pointer hover:bg-gray-800/20":""}`,onClick:m?u:void 0,children:[n.jsx("div",{className:`w-1.5 h-1.5 rounded-full mt-2 flex-shrink-0 ${c}`}),n.jsx("div",{className:"w-5 h-5 flex-shrink-0 mt-0.5 text-gray-500",children:n.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:f[r.category]||f.command})})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-sm text-gray-300",children:r.title}),n.jsx(de,{label:r.category,variant:wi(r.severity)})]}),r.detail&&!o&&n.jsx("p",{className:"text-xs text-gray-500 mt-0.5 truncate",children:r.detail}),r.source&&n.jsxs("span",{className:"text-[10px] text-gray-600 mt-0.5 block",children:["via ",r.source]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[r.timestamp&&n.jsx("span",{className:"text-[10px] text-gray-600 whitespace-nowrap",children:Yp(r.timestamp)}),m&&n.jsx("svg",{className:`w-4 h-4 text-gray-600 transition-transform duration-200 ${o?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),o&&n.jsxs("div",{className:"px-4 pb-3 ml-10 space-y-2",children:[r.detail&&n.jsxs("div",{className:"bg-gray-800/50 rounded p-3",children:[n.jsx("span",{className:"text-[10px] text-gray-500 uppercase block mb-1",children:"Detail"}),n.jsx("p",{className:"text-xs text-gray-300 whitespace-pre-wrap",children:r.detail})]}),r.metadata&&Object.keys(r.metadata).length>0&&n.jsxs("div",{className:"bg-gray-800/50 rounded p-3",children:[n.jsx("span",{className:"text-[10px] text-gray-500 uppercase block mb-1",children:"Metadata"}),n.jsx("pre",{className:"text-xs text-gray-400 font-mono whitespace-pre-wrap overflow-x-auto",children:JSON.stringify(r.metadata,null,2)})]})]})]})}function Yp(r){if(!r)return"-";const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}function $p(){const[r,o]=N.useState(0);ke("config-changed",()=>o(X=>X+1));const{data:u,loading:c,error:f,refetch:m}=_e(`/api/config?_r=${r}`),{activeProject:g}=Jl(),[j,p]=N.useState(new Set),[x,v]=N.useState({}),[y,E]=N.useState(!1),[_,U]=N.useState(null),[O,T]=N.useState([]);if(c)return n.jsx(lt,{});if(f)return n.jsx(Zt,{message:f,onRetry:m});if(!u)return null;const q=X=>{p($=>{const ee=new Set($);return ee.has(X)?ee.delete(X):ee.add(X),ee})},A=Object.keys(x).length>0,L=(X,$)=>{v(ee=>({...ee,[X]:$})),T(ee=>ee.filter(P=>P.path!==X))},te=async()=>{if(A){E(!0),U(null),T([]);try{const X={};for(const[Le,Ee]of Object.entries(x))Gp(X,Le,Ee);const $=g?`?project=${g.id}`:"",P=await(await fetch(`/api/config/validate${$}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(X)})).json();if(P.errors&&P.errors.length>0){T(P.errors),U("Validation failed. Fix errors before saving."),E(!1);return}const Ge=await(await fetch(`/api/config${$}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(X)})).json();Ge.ok?(U("Saved successfully"),v({}),T([]),m(),setTimeout(()=>U(null),3e3)):U(`Error: ${Ge.error}`)}catch(X){U(`Error: ${X}`)}finally{E(!1)}}},K=()=>{v({}),U(null),T([])},ce=Object.entries(u).filter(([X,$])=>typeof $=="object"&&$!==null),V=Object.entries(u).filter(([X,$])=>typeof $!="object"||$===null);return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Configuration"}),n.jsx("span",{className:"text-xs text-gray-500",children:".specweave/config.json"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[_&&n.jsx("span",{className:`text-xs ${_.startsWith("Error")||_.startsWith("Validation")?"text-rose-400":"text-emerald-400"}`,children:_}),A&&n.jsxs(n.Fragment,{children:[n.jsx(de,{label:`${Object.keys(x).length} changes`,variant:"warning"}),n.jsx("button",{onClick:K,className:"px-3 py-1.5 text-xs text-gray-400 hover:text-gray-200 border border-gray-700 rounded-lg transition-colors",children:"Discard"}),n.jsx("button",{onClick:te,disabled:y,className:"px-3 py-1.5 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white text-xs rounded-lg transition-colors",children:y?"Saving...":"Save Changes"})]})]})]}),_&&!A&&_==="Saved successfully"&&n.jsxs("div",{className:"bg-emerald-500/10 border border-emerald-500/30 rounded-lg px-4 py-2 flex items-center gap-2",children:[n.jsx("div",{className:"w-2 h-2 rounded-full bg-emerald-400"}),n.jsx("span",{className:"text-xs text-emerald-400",children:"Configuration saved successfully"})]}),O.length>0&&n.jsxs("div",{className:"bg-rose-500/10 border border-rose-500/30 rounded-lg px-4 py-3 space-y-1",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("div",{className:"w-2 h-2 rounded-full bg-rose-400"}),n.jsx("span",{className:"text-xs text-rose-400 font-medium",children:"Validation errors"})]}),O.map((X,$)=>n.jsxs("div",{className:"text-xs text-rose-300 pl-4",children:[n.jsx("span",{className:"font-mono text-rose-400",children:X.path}),": ",X.message]},$))]}),V.length>0&&n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-3",children:"General"}),n.jsx("div",{className:"space-y-3",children:V.map(([X,$])=>n.jsx(wm,{path:X,label:X,value:x[X]!==void 0?x[X]:$,original:$,onChange:ee=>L(X,ee),edited:x[X]!==void 0,validationError:O.find(ee=>ee.path===X)?.message},X))})]}),ce.map(([X,$])=>n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsxs("button",{onClick:()=>q(X),className:"w-full px-5 py-3 flex items-center justify-between hover:bg-gray-800/30 transition-colors",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 capitalize",children:X}),Z0(x,X)>0&&n.jsx(de,{label:`${Z0(x,X)} edited`,variant:"warning"}),O.some(ee=>ee.path.startsWith(X+"."))&&n.jsx(de,{label:"errors",variant:"error"})]}),n.jsx("svg",{className:`w-4 h-4 text-gray-500 transition-transform duration-200 ${j.has(X)?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),j.has(X)&&n.jsx("div",{className:"px-5 py-3 border-t border-gray-800",children:n.jsx(Tm,{data:$,path:X,edits:x,onChange:L,validationErrors:O,depth:0})})]},X))]})}function Tm({data:r,path:o,edits:u,onChange:c,validationErrors:f,depth:m}){return m>4?n.jsx("span",{className:"text-xs text-gray-600",children:"..."}):n.jsx("div",{className:"space-y-3",style:{marginLeft:m>0?16:0},children:Object.entries(r).map(([g,j])=>{const p=`${o}.${g}`;return j&&typeof j=="object"&&!Array.isArray(j)?n.jsxs("div",{children:[n.jsx("span",{className:"text-xs text-gray-400 font-mono font-medium",children:g}),n.jsx(Tm,{data:j,path:p,edits:u,onChange:c,validationErrors:f,depth:m+1})]},g):n.jsx(wm,{path:p,label:g,value:u[p]!==void 0?u[p]:j,original:j,onChange:x=>c(p,x),edited:u[p]!==void 0,validationError:f.find(x=>x.path===p)?.message},g)})})}function wm({path:r,label:o,value:u,original:c,onChange:f,edited:m,validationError:g}){return typeof c=="boolean"||typeof u=="boolean"?n.jsxs("div",{className:"py-1",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs text-gray-500 font-mono",children:o}),n.jsx("button",{onClick:()=>f(!u),className:`relative w-9 h-5 rounded-full transition-colors ${u?"bg-indigo-600":"bg-gray-700"} ${m?"ring-1 ring-amber-500/50":""}`,children:n.jsx("div",{className:`absolute top-0.5 w-4 h-4 bg-white rounded-full transition-transform ${u?"left-[18px]":"left-0.5"}`})})]}),g&&n.jsx("p",{className:"text-[10px] text-rose-400 mt-0.5",children:g})]}):typeof c=="number"||typeof u=="number"?n.jsxs("div",{className:"py-1",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs text-gray-500 font-mono",children:o}),n.jsx("input",{type:"number",value:String(u??""),onChange:j=>f(j.target.value?Number(j.target.value):0),className:`bg-gray-800 border text-xs text-amber-400 font-mono rounded px-2 py-1 w-24 text-right ${g?"border-rose-500":m?"border-amber-500/50":"border-gray-700"} focus:ring-indigo-500 focus:border-indigo-500`})]}),g&&n.jsx("p",{className:"text-[10px] text-rose-400 mt-0.5 text-right",children:g})]}):Array.isArray(c)||Array.isArray(u)?n.jsx(kp,{path:r,label:o,value:Array.isArray(u)?u:Array.isArray(c)?c:[],edited:m,onChange:f,validationError:g}):n.jsxs("div",{className:"py-1",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs text-gray-500 font-mono",children:o}),n.jsx("input",{type:"text",value:String(u??""),onChange:j=>f(j.target.value),className:`bg-gray-800 border text-xs text-gray-300 rounded px-2 py-1 w-48 text-right ${g?"border-rose-500":m?"border-amber-500/50":"border-gray-700"} focus:ring-indigo-500 focus:border-indigo-500`})]}),g&&n.jsx("p",{className:"text-[10px] text-rose-400 mt-0.5 text-right",children:g})]})}function kp({path:r,label:o,value:u,edited:c,onChange:f,validationError:m}){const[g,j]=N.useState(!1),[p,x]=N.useState(""),v=_=>{const U=[...u];U.splice(_,1),f(U)},y=()=>{const _=p.trim();_&&(f([...u,_]),x(""))},E=_=>{_.key==="Enter"&&(_.preventDefault(),y())};return n.jsxs("div",{className:"py-1",children:[n.jsxs("button",{onClick:()=>j(_=>!_),className:"flex items-center justify-between w-full group",children:[n.jsx("span",{className:"text-xs text-gray-500 font-mono",children:o}),n.jsxs("div",{className:"flex items-center gap-2",children:[c&&n.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-amber-500"}),n.jsxs("span",{className:"text-xs text-gray-400 font-mono",children:["[",u.length," items]"]}),n.jsx("svg",{className:`w-3 h-3 text-gray-500 transition-transform duration-200 ${g?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),g&&n.jsxs("div",{className:"mt-2 ml-4 space-y-1",children:[u.length===0&&n.jsx("p",{className:"text-[10px] text-gray-600",children:"No items"}),u.map((_,U)=>n.jsxs("div",{className:"flex items-center gap-2 group/item",children:[n.jsx("span",{className:"text-xs text-gray-300 font-mono flex-1 truncate",children:String(_)}),n.jsx("button",{onClick:()=>v(U),className:"text-[10px] text-gray-600 hover:text-rose-400 opacity-0 group-hover/item:opacity-100 transition-opacity",children:"remove"})]},U)),n.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[n.jsx("input",{type:"text",value:p,onChange:_=>x(_.target.value),onKeyDown:E,placeholder:"Add item...",className:"bg-gray-800 border border-gray-700 text-xs text-gray-300 rounded px-2 py-1 flex-1 focus:ring-indigo-500 focus:border-indigo-500"}),n.jsx("button",{onClick:y,disabled:!p.trim(),className:"px-2 py-1 text-[10px] text-indigo-400 hover:text-indigo-300 border border-indigo-500/30 rounded disabled:opacity-50 transition-colors",children:"Add"})]})]}),m&&n.jsx("p",{className:"text-[10px] text-rose-400 mt-0.5",children:m})]})}function Z0(r,o){return Object.keys(r).filter(u=>u.startsWith(o+".")).length}function Gp(r,o,u){const c=o.split(".");let f=r;for(let m=0;m<c.length-1;m++)(!f[c[m]]||typeof f[c[m]]!="object")&&(f[c[m]]={}),f=f[c[m]];f[c[c.length-1]]=u}function vu({lines:r,status:o,onDismiss:u}){const c=N.useRef(null);return N.useEffect(()=>{c.current?.scrollIntoView({behavior:"smooth"})},[r]),r.length===0&&o==="idle"?null:n.jsxs("div",{className:"mt-4 rounded-lg bg-gray-950 border border-gray-700 overflow-hidden",children:[n.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-gray-900 border-b border-gray-700",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:`w-2 h-2 rounded-full ${o==="running"?"bg-yellow-400 animate-pulse":o==="success"?"bg-green-400":o==="error"?"bg-red-400":"bg-gray-500"}`}),n.jsx("span",{className:"text-xs text-gray-400 font-mono",children:o==="running"?"Running...":o==="success"?"Completed":o==="error"?"Failed":"Output"})]}),o!=="running"&&u&&n.jsx("button",{onClick:u,className:"text-gray-500 hover:text-gray-300 text-xs",children:"Dismiss"})]}),n.jsxs("div",{className:"p-3 max-h-48 overflow-y-auto font-mono text-xs text-gray-300 whitespace-pre-wrap",children:[r.map((f,m)=>n.jsx("div",{children:f},m)),n.jsx("div",{ref:c})]})]})}function Vp(){const{data:r,loading:o}=_e("/api/plugins/full"),{execute:u,running:c,output:f,status:m,reset:g}=Ai(),[j,p]=N.useState(null);if(o)return n.jsx(lt,{});const x=r?.plugins||[],v=r?.skills||[],y=r?.lsp,E=r?.warmup,_=r?.triggerCount||0,U=x.reduce((A,L)=>A+L.skillCount,0),O=x.reduce((A,L)=>A+L.commandCount,0),T=A=>v.filter(L=>L.plugin===A).sort((L,te)=>te.count-L.count),q=A=>{p(L=>L===A?null:A)};return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Plugins & LSP"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>u("lsp-status"),disabled:c,className:"px-3 py-1.5 bg-gray-700 hover:bg-gray-600 disabled:opacity-50 text-white text-xs rounded-lg transition-colors",children:"Check LSP"}),n.jsx("button",{onClick:()=>u("refresh-plugins"),disabled:c,className:"px-3 py-1.5 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white text-xs rounded-lg transition-colors",children:c?"Running...":"Refresh Plugins"})]})]}),n.jsx(vu,{lines:f,status:m,onDismiss:g}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[n.jsx(qa,{label:"Plugins",value:x.length}),n.jsx(qa,{label:"Total Skills",value:U}),n.jsx(qa,{label:"Total Commands",value:O}),n.jsx(qa,{label:"Trigger Keywords",value:_})]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Installed Plugins"})}),x.length===0?n.jsx("div",{className:"p-5 text-gray-500 text-xs",children:"No plugins installed"}):n.jsx("div",{className:"divide-y divide-gray-800/50",children:x.map(A=>{const L=j===A.name,te=T(A.name);return n.jsxs("div",{children:[n.jsxs("button",{onClick:()=>q(A.name),className:"w-full px-4 py-3 flex items-center justify-between hover:bg-gray-800/30 transition-colors text-left",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("span",{className:"text-sm text-gray-300",children:A.name}),n.jsx("span",{className:"text-xs text-gray-500 font-mono",children:A.version})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(de,{label:`${A.skillCount} skills`,variant:"info"}),n.jsx(de,{label:`${A.commandCount} cmds`,variant:"default"}),n.jsx("svg",{className:`w-4 h-4 text-gray-500 transition-transform duration-200 ${L?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),L&&n.jsx("div",{className:"px-4 pb-4 bg-gray-800/20",children:te.length===0?n.jsx("p",{className:"text-xs text-gray-600 py-2",children:"No skill usage data for this plugin"}):n.jsxs("div",{className:"space-y-1 mt-1",children:[n.jsxs("div",{className:"grid grid-cols-[1fr,80px,80px,120px] gap-2 px-2 py-1",children:[n.jsx("span",{className:"text-[10px] text-gray-600 uppercase",children:"Skill"}),n.jsx("span",{className:"text-[10px] text-gray-600 uppercase text-right",children:"Invocations"}),n.jsx("span",{className:"text-[10px] text-gray-600 uppercase text-right",children:"Success"}),n.jsx("span",{className:"text-[10px] text-gray-600 uppercase text-right",children:"Last Used"})]}),te.map(K=>n.jsxs("div",{className:"grid grid-cols-[1fr,80px,80px,120px] gap-2 px-2 py-1.5 bg-gray-800/40 rounded",children:[n.jsx("span",{className:"text-xs text-gray-300 font-mono truncate",children:K.name}),n.jsx("span",{className:"text-xs text-gray-400 text-right font-mono",children:K.count}),n.jsxs("span",{className:"text-xs text-right font-mono",children:[n.jsx("span",{className:"text-emerald-400",children:K.successCount}),K.failureCount>0&&n.jsxs("span",{className:"text-rose-400",children:["/",K.failureCount]})]}),n.jsx("span",{className:"text-[10px] text-gray-500 text-right",children:K.lastUsed?Xp(K.lastUsed):"-"})]},K.name))]})})]},A.name)})})]}),v.length>0&&n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Skill Usage Leaderboard"}),n.jsx(jm,{items:v.sort((A,L)=>L.count-A.count).slice(0,20).map(A=>({label:A.name,value:A.count,color:"#10b981"})),maxBars:20})]}),y&&n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"LSP Status"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(de,{label:y.status,variant:y.status==="ok"?"success":"warning"}),y.checked&&n.jsxs("span",{className:"text-[10px] text-gray-600",children:["Checked: ",new Date(y.checked).toLocaleDateString()]})]})]}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 mb-4",children:[n.jsx(qa,{label:"Total Languages",value:y.stats.totalLanguages}),n.jsx(qa,{label:"Checked",value:y.stats.checkedLanguages}),n.jsx(qa,{label:"Binary Missing",value:y.stats.binaryMissing}),n.jsx(qa,{label:"Plugin Missing",value:y.stats.pluginMissing})]}),y.missing.length>0&&n.jsxs("div",{className:"space-y-2",children:[n.jsx("h4",{className:"text-xs text-gray-500",children:"Missing Languages"}),y.missing.map((A,L)=>n.jsxs("div",{className:"flex items-center justify-between p-2 bg-gray-800/50 rounded",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(de,{label:A.type,variant:A.type==="binary"?"warning":"default"}),n.jsx("span",{className:"text-xs text-gray-300",children:A.language})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("code",{className:"text-[10px] text-gray-500",children:A.binaryInstall}),A.message&&n.jsx("span",{className:"text-[10px] text-gray-600 max-w-[200px] truncate",children:A.message})]})]},L))]})]}),E&&n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"LSP Warmup Status"}),n.jsxs("span",{className:"text-[10px] text-gray-600",children:[E.elapsed?`${(E.elapsed/1e3).toFixed(1)}s`:""," |"," ",E.timestamp?new Date(E.timestamp).toLocaleString():""]})]}),n.jsxs("div",{className:"flex flex-wrap gap-2",children:[E.warmedUp.map(A=>n.jsx(de,{label:A,variant:"success"},A)),E.failed.map(A=>n.jsx(de,{label:A,variant:"error"},A))]}),E.warmedUp.length===0&&E.failed.length===0&&n.jsx("p",{className:"text-gray-600 text-xs",children:"No warmup data"})]})]})}function qa({label:r,value:o}){return n.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-3 text-center",children:[n.jsx("div",{className:"text-lg font-bold text-gray-300",children:o}),n.jsx("div",{className:"text-[10px] text-gray-500",children:r})]})}function Xp(r){if(!r)return"-";const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}function Qp(){const{data:r,loading:o}=_e("/api/links"),{data:u,loading:c,refetch:f}=_e("/api/services"),{execute:m,running:g,output:j,status:p,reset:x}=Ai();if(o||c)return n.jsx(lt,{});const v=(u||[]).filter(T=>T.status==="running").length,y=(u||[]).length,E=new Map;for(const T of u||[])if(T.port>0&&T.status==="running"){const q=E.get(T.port)||[];q.push(T.name),E.set(T.port,q)}const _=Array.from(E.entries()).filter(([,T])=>T.length>1),U=async T=>{await m(T),setTimeout(()=>f(),3e3)},O=async T=>{await m(T),setTimeout(()=>f(),2e3)};return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Services & Links"}),n.jsx(vu,{lines:j,status:p,onDismiss:x}),_.length>0&&n.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-xl p-4 flex items-start gap-3",children:[n.jsx("svg",{className:"w-5 h-5 text-amber-400 flex-shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4.5c-.77-.833-2.694-.833-3.464 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z"})}),n.jsxs("div",{children:[n.jsx("div",{className:"text-sm font-medium text-amber-300",children:"Port Conflict Detected"}),n.jsx("div",{className:"text-xs text-amber-400/80 mt-1",children:_.map(([T,q])=>n.jsxs("span",{className:"block",children:["Port ",T," is used by: ",q.join(", ")]},T))})]})]}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(se,{title:"Services",value:y,color:"indigo",tooltip:`${y} managed services`}),n.jsx(se,{title:"Running",value:v,color:"emerald",tooltip:`${v} services currently active`}),n.jsx(se,{title:"External Links",value:(r||[]).length,color:"cyan",tooltip:"Configured external links (docs, repos, etc.)"}),n.jsx(se,{title:"Stopped",value:y-v,color:"rose",tooltip:`${y-v} services not running`})]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Service Status"}),n.jsx("div",{className:"space-y-3",children:(u||[]).map((T,q)=>n.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-800/50 rounded-lg",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:`w-2 h-2 rounded-full ${T.status==="running"?"bg-emerald-400":"bg-gray-600"}`}),n.jsxs("div",{children:[n.jsx("span",{className:"text-sm text-gray-300",children:T.name}),n.jsx("div",{className:"text-[10px] text-gray-600",children:T.status==="running"&&T.detail?n.jsx("a",{href:T.detail,target:"_blank",rel:"noopener noreferrer",className:"text-indigo-400 hover:text-indigo-300 underline transition-colors",children:T.detail}):T.detail})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[T.status==="running"&&T.port>0&&n.jsx(de,{label:`Port ${T.port}`,variant:"info"}),T.status==="running"?n.jsx(de,{label:"Running",variant:"success"}):n.jsx(de,{label:"Stopped",variant:"default"}),T.name==="Docs Preview"&&(T.status==="running"?n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("a",{href:T.detail,target:"_blank",rel:"noopener noreferrer",className:"px-2 py-1 text-[10px] text-indigo-400 hover:text-indigo-300 border border-indigo-500/30 rounded transition-colors",children:"Open"}),n.jsx("button",{onClick:()=>O("docs-preview-stop"),disabled:g,className:"px-2 py-1 text-[10px] text-rose-400 hover:text-rose-300 border border-rose-500/30 rounded transition-colors disabled:opacity-50",children:"Stop"})]}):n.jsx("button",{onClick:()=>U("docs-preview-start"),disabled:g,className:"px-2 py-1 text-[10px] text-emerald-400 hover:text-emerald-300 border border-emerald-500/30 rounded transition-colors disabled:opacity-50",children:g?"Starting...":"Start"})),T.status==="running"&&T.name!=="Docs Preview"&&n.jsx("a",{href:T.detail,target:"_blank",rel:"noopener noreferrer",className:"px-2 py-1 text-[10px] text-indigo-400 hover:text-indigo-300 border border-indigo-500/30 rounded transition-colors",children:"Open"})]})]},q))})]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"External Links"}),(r||[]).length===0?n.jsx("p",{className:"text-xs text-gray-500",children:"No external links configured"}):n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:(r||[]).map((T,q)=>n.jsxs("a",{href:T.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between p-3 bg-gray-800/50 rounded-lg hover:bg-gray-800 transition-colors group",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Zp,{type:T.type}),n.jsxs("div",{children:[n.jsx("div",{className:"text-sm text-gray-300 group-hover:text-white transition-colors",children:T.name}),n.jsx("div",{className:"text-[10px] text-gray-600 truncate max-w-[200px]",children:T.url})]})]}),n.jsx("svg",{className:"w-4 h-4 text-gray-600 group-hover:text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]},q))})]})]})}function Zp({type:r}){const o={docs:"bg-indigo-600",github:"bg-gray-700",jira:"bg-blue-700",ado:"bg-blue-600"};return n.jsx("div",{className:`w-8 h-8 rounded-lg ${o[r]||"bg-gray-700"} flex items-center justify-center`,children:n.jsx("span",{className:"text-xs text-white font-bold",children:r[0]?.toUpperCase()})})}const K0={critical:0,warning:1,info:2};function Kp(){const[r,o]=N.useState("pending"),[u,c]=N.useState(null),[f,m]=N.useState(0);ke("notification",()=>m($=>$+1));const{activeProject:g}=Jl(),{data:j,loading:p,error:x,refetch:v}=_e(`/api/notifications?_r=${f}`);if(p)return n.jsx(lt,{});if(x)return n.jsx(Zt,{message:x,onRetry:v});const y=j||[],E=y.filter($=>!$.dismissedAt),_=y.filter($=>!!$.dismissedAt),U=E.filter($=>$.severity==="critical"),O=E.filter($=>$.severity==="warning"),q=[...r==="pending"?E:r==="dismissed"?_:y].sort(($,ee)=>{const P=K0[$.severity]??3,Se=K0[ee.severity]??3;return P!==Se?P-Se:new Date(ee.createdAt).getTime()-new Date($.createdAt).getTime()}),A=async $=>{c($);try{const ee=g?`?project=${g.id}`:"";(await fetch(`/api/notifications/${$}/dismiss${ee}`,{method:"POST"})).ok&&v()}finally{c(null)}},L=async()=>{c("__all__");try{const $=g?`?project=${g.id}`:"";for(const ee of E)await fetch(`/api/notifications/${ee.id}/dismiss${$}`,{method:"POST"});v()}finally{c(null)}},te=$=>$==="critical"?"error":$==="warning"?"warning":"info",K=$=>$==="critical"?"border-l-rose-500":$==="warning"?"border-l-amber-500":"border-l-blue-500",V=($=>{const ee={};for(const P of $)ee[P.severity]||(ee[P.severity]=[]),ee[P.severity].push(P);return ee})(q),X={critical:"Critical",warning:"Warnings",info:"Informational"};return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Notifications"}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(se,{title:"Pending",value:E.length,color:"indigo"}),n.jsx(se,{title:"Critical",value:U.length,color:"rose"}),n.jsx(se,{title:"Warnings",value:O.length,color:"amber"}),n.jsx(se,{title:"Dismissed",value:_.length,color:"cyan"})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:[{value:"pending",label:`Pending (${E.length})`},{value:"dismissed",label:`Dismissed (${_.length})`},{value:"all",label:`All (${y.length})`}].map($=>n.jsx("button",{onClick:()=>o($.value),className:`px-3 py-1.5 text-xs rounded-md transition-colors ${r===$.value?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:$.label},$.value))}),E.length>0&&n.jsx("button",{onClick:L,disabled:u==="__all__",className:"px-3 py-1.5 text-xs text-gray-400 hover:text-gray-200 border border-gray-700 rounded-lg transition-colors disabled:opacity-50",children:u==="__all__"?"Dismissing...":"Dismiss All"})]}),q.length===0?n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[n.jsx("div",{className:"w-12 h-12 rounded-full bg-gray-800 flex items-center justify-center mx-auto mb-4",children:n.jsx("svg",{className:"w-6 h-6 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})})}),n.jsx("p",{className:"text-gray-400 text-sm font-medium",children:r==="pending"?"No pending notifications":"No notifications"}),n.jsx("p",{className:"text-gray-600 text-xs mt-1 max-w-xs mx-auto",children:"Notifications appear here when imports complete, discrepancies are found, or syncs fail"})]}):n.jsx("div",{className:"space-y-4",children:["critical","warning","info"].map($=>{const ee=V[$];return!ee||ee.length===0?null:n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[n.jsx("h3",{className:"text-xs font-medium text-gray-400 uppercase",children:X[$]||$}),n.jsxs("span",{className:"text-[10px] text-gray-600",children:["(",ee.length,")"]})]}),n.jsx("div",{className:"space-y-2",children:ee.map(P=>n.jsxs("div",{className:`bg-gray-900/50 border border-gray-800 border-l-4 ${K(P.severity)} rounded-xl p-4 flex items-start gap-4 ${P.dismissedAt?"opacity-60":""}`,children:[n.jsx(Jp,{severity:P.severity}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("span",{className:"text-sm font-medium text-gray-200",children:P.title}),n.jsx(de,{label:P.severity,variant:te(P.severity)}),P.type&&n.jsx(de,{label:P.type,variant:"default"})]}),P.message&&n.jsx("p",{className:"text-xs text-gray-400 mb-2",children:P.message}),n.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-gray-600",children:[n.jsx("span",{children:new Date(P.createdAt).toLocaleString()}),P.source&&n.jsxs("span",{children:["via ",P.source]}),P.dismissedAt&&n.jsxs("span",{children:["Dismissed ",new Date(P.dismissedAt).toLocaleString()]})]})]}),!P.dismissedAt&&n.jsx("button",{onClick:()=>A(P.id),disabled:u===P.id,className:"px-2 py-1 text-xs text-gray-500 hover:text-gray-300 hover:bg-gray-800 rounded transition-colors disabled:opacity-50 flex-shrink-0",children:u===P.id?"...":"Dismiss"})]},P.id))})]},$)})})]})}function Jp({severity:r}){return r==="critical"?n.jsx("div",{className:"w-8 h-8 rounded-full bg-rose-500/10 flex items-center justify-center flex-shrink-0",children:n.jsx("svg",{className:"w-4 h-4 text-rose-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4.5c-.77-.833-2.694-.833-3.464 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z"})})}):r==="warning"?n.jsx("div",{className:"w-8 h-8 rounded-full bg-amber-500/10 flex items-center justify-center flex-shrink-0",children:n.jsx("svg",{className:"w-4 h-4 text-amber-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}):n.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-500/10 flex items-center justify-center flex-shrink-0",children:n.jsx("svg",{className:"w-4 h-4 text-blue-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})})}function Wp(r){if(!r)return null;if(r.startsWith("https://"))return r.replace(/\.git$/,"");const o=r.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(o)return`https://${o[1]}/${o[2]}`;const u=r.match(/^ssh:\/\/git@([^/]+)\/(.+?)(?:\.git)?$/);return u?`https://${u[1]}/${u[2]}`:null}function Fp(){const{data:r,loading:o,error:u,refetch:c}=_e("/api/repos");if(o)return n.jsx(lt,{});if(u)return n.jsx(Zt,{message:u,onRetry:c});const f=r||[],m=[...new Set(f.map(p=>p.org))],g=f.filter(p=>p.hasSpecweave||p.isUmbrellaManaged).length,j=f.find(p=>p.isCurrent);return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Repositories"}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(se,{title:"Repositories",value:f.length,color:"indigo"}),n.jsx(se,{title:"Organizations",value:m.length,color:"cyan"}),n.jsx(se,{title:"With SpecWeave",value:g,color:"emerald"}),n.jsx(se,{title:"Current",value:j?j.name:"-",subtitle:j?`${j.org}/${j.name}`:"No current project",color:"amber"})]}),f.length===0?n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[n.jsx("p",{className:"text-gray-500 text-sm",children:"No repositories found"}),n.jsx("p",{className:"text-gray-600 text-xs mt-1",children:"This project doesn't use multi-repo mode, or the repositories/ directory hasn't been set up yet"})]}):n.jsx(n.Fragment,{children:m.map(p=>{const x=f.filter(v=>v.org===p);return n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx(Pp,{}),n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:p}),n.jsxs("span",{className:"text-[10px] text-gray-600",children:[x.length," ",x.length===1?"repo":"repos"]})]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:x.map(v=>{const y=Wp(v.remote);return n.jsxs("div",{className:`bg-gray-900/50 border rounded-xl p-4 ${v.isCurrent?"border-indigo-500/30":"border-gray-800"}`,children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Ip,{}),n.jsx("span",{className:"text-sm font-medium text-gray-300",children:v.name})]}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[v.isCurrent&&n.jsx(de,{label:"Current Project",variant:"info"}),n.jsx(de,{label:v.hasSpecweave?"SpecWeave":v.isUmbrellaManaged?"via umbrella":"No SpecWeave",variant:v.hasSpecweave?"success":v.isUmbrellaManaged?"info":"default"})]})]}),n.jsxs("div",{className:"space-y-1.5 mt-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] text-gray-500",children:"Organization"}),n.jsx("span",{className:"text-[10px] text-gray-400",children:v.org})]}),v.branch&&n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] text-gray-500",children:"Branch"}),n.jsx(de,{label:v.branch,variant:"default"})]}),y&&n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] text-gray-500",children:"Remote"}),n.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-indigo-400 hover:text-indigo-300 hover:underline truncate max-w-[180px]",title:y,children:y.replace("https://","")})]}),!y&&v.remote&&n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] text-gray-500",children:"Remote"}),n.jsx("span",{className:"text-[10px] text-gray-600 font-mono truncate max-w-[180px]",title:v.remote,children:v.remote})]}),v.path&&n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] text-gray-500",children:"Path"}),n.jsx("span",{className:"text-[10px] text-gray-600 font-mono truncate max-w-[180px]",title:v.path,children:v.path.split("/").slice(-3).join("/")})]}),v.lastModified&&n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] text-gray-500",children:"Last Modified"}),n.jsx("span",{className:"text-[10px] text-gray-400",children:tv(v.lastModified)})]})]}),y&&n.jsxs("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"mt-3 flex items-center justify-center gap-1.5 text-xs text-gray-400 hover:text-gray-200 py-2 border border-gray-800 rounded-lg hover:border-gray-700 transition-colors",children:[n.jsx(ev,{}),"Open on GitHub"]})]},v.path||`${v.org}/${v.name}`)})})]},p)})})]})}function Pp(){return n.jsx("div",{className:"w-6 h-6 rounded bg-gray-700 flex items-center justify-center",children:n.jsx("svg",{className:"w-3.5 h-3.5 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"})})})}function Ip(){return n.jsx("svg",{className:"w-4 h-4 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})})}function ev(){return n.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:n.jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})})}function tv(r){if(!r)return"-";try{const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return"-"}}const av=[{value:"",label:"All"},{value:"discovered",label:"Discovered"},{value:"scanning",label:"Scanning"},{value:"tier1_passed",label:"Passed"},{value:"tier1_failed",label:"Failed"},{value:"verified",label:"Verified"},{value:"rejected",label:"Rejected"}],fa=20;function lv(r){switch(r){case"discovered":return"default";case"queued":return"info";case"scanning":return"warning";case"tier1_passed":return"success";case"tier1_failed":return"error";case"tier2_pending":return"info";case"verified":return"success";case"rejected":return"error";default:return"default"}}function nv(r){switch(r){case"discovered":return"Discovered";case"queued":return"Queued";case"scanning":return"Scanning";case"tier1_passed":return"T1 Passed";case"tier1_failed":return"T1 Failed";case"tier2_pending":return"T2 Pending";case"verified":return"Verified";case"rejected":return"Rejected";default:return r}}function J0(r){if(!r)return"-";try{const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return"-"}}function sv(r){return r>=80?"text-emerald-400":r>=50?"text-amber-400":"text-rose-400"}function Am(r){const o=r.tier1Result?.score??0,u=r.tier2Result?.score??0;return o&&u?Math.round((o+u)/2):o||u}function iv(r){return r>=80?"bg-emerald-500":r>=50?"bg-amber-500":"bg-rose-500"}function rv(r){return r>=80?"text-emerald-400":r>=50?"text-amber-400":"text-rose-400"}function cv(r){return r>=1e6?`${(r/1e6).toFixed(1)}m`:r>=1e3?`${(r/1e3).toFixed(1)}k`:String(r)}function W0(r){const o=Math.log10(Math.max(r.stars,1))*20,u=Am(r);return o+u}function uv(r,o){if(o===0)return"rose";const u=r/o;return u>.5?"emerald":u>.1?"amber":"rose"}function ov(){const[r,o]=N.useState(""),[u,c]=N.useState(0),[f,m]=N.useState(0),[g,j]=N.useState(null),[p,x]=N.useState(""),{output:v,status:y,reset:E}=Ai(),_=r?`status=${r}&limit=${fa}&offset=${u}`:`limit=${fa}&offset=${u}`,{data:U,loading:O,error:T,refetch:q}=_e(`/api/marketplace/scanner/status?_r=${f}`),{data:A,loading:L,refetch:te}=_e(`/api/marketplace/queue?${_}&_r=${f}`),{data:K,loading:ce}=_e(`/api/marketplace/verified?_r=${f}`),{data:V,loading:X}=_e(`/api/marketplace/insights?_r=${f}`),$=N.useCallback(()=>{m(b=>b+1)},[]);ke("submission-update",N.useCallback(()=>{$()},[$])),ke("marketplace-scan",N.useCallback(()=>{$()},[$])),ke("verification-complete",N.useCallback(()=>{$()},[$]));const ee=async()=>{try{const b=new URLSearchParams(window.location.search).get("project")||"",Y=b?`?project=${b}`:"";await fetch(`/api/marketplace/scanner/start${Y}`,{method:"POST"}),q()}catch{}},P=async()=>{try{const b=new URLSearchParams(window.location.search).get("project")||"",Y=b?`?project=${b}`:"";await fetch(`/api/marketplace/scanner/stop${Y}`,{method:"POST"}),q()}catch{}},Se=async b=>{j(b);try{const Y=new URLSearchParams(window.location.search).get("project")||"",Z=Y?`?project=${Y}`:"";await fetch(`/api/marketplace/queue/${b}/approve${Z}`,{method:"POST"}),te()}catch{}j(null)},Ge=async b=>{j(b);try{const Y=new URLSearchParams(window.location.search).get("project")||"",Z=Y?`?project=${Y}`:"";await fetch(`/api/marketplace/queue/${b}/reject${Z}`,{method:"POST"}),te()}catch{}j(null)};if(O&&L&&ce&&X)return n.jsx(lt,{});const Ee=A?.items||[],H=A?.total||0,Q=K||[],le=Math.floor(u/fa)+1,pe=Math.ceil(H/fa),je=b=>b==="tier1_passed"||b==="tier2_pending";return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Marketplace Scanner"}),n.jsx("div",{className:"flex gap-2",children:U?.running?n.jsx("button",{onClick:P,className:"px-3 py-1.5 bg-rose-600 hover:bg-rose-500 disabled:opacity-50 text-white text-xs rounded-lg transition-colors",children:"Stop Scanner"}):n.jsx("button",{onClick:ee,className:"px-3 py-1.5 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white text-xs rounded-lg transition-colors",children:"Start Scanner"})})]}),n.jsx(vu,{lines:v,status:y,onDismiss:E}),T&&n.jsx(Zt,{message:T,onRetry:q}),U?n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(se,{title:"Scanner",value:U.running?"Running":"Stopped",subtitle:U.running?"Active":"Idle",color:U.running?"emerald":"amber"}),n.jsx(se,{title:"Last Scan",value:U.lastScanTime?J0(U.lastScanTime):"Never",color:"cyan"}),n.jsx(se,{title:"Repos Scanned",value:U.reposScanned,color:"indigo"}),n.jsx(se,{title:"Rate Limit",value:U.rateLimitRemaining!=null&&U.rateLimitTotal!=null?`${U.rateLimitRemaining}/${U.rateLimitTotal}`:"No token",subtitle:U.rateLimitRemaining!=null&&U.rateLimitTotal!=null&&U.rateLimitTotal>0?`${Math.round(U.rateLimitRemaining/U.rateLimitTotal*100)}% remaining`:"Set GITHUB_TOKEN in environment",color:U.rateLimitRemaining!=null&&U.rateLimitTotal!=null?uv(U.rateLimitRemaining,U.rateLimitTotal):"amber"})]}):!O&&!T?n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[n.jsx("div",{className:"text-gray-400 text-sm mb-2",children:"No scanner data available"}),n.jsx("p",{className:"text-gray-600 text-xs mb-4",children:"Start the marketplace scanner to discover and verify community skills."}),n.jsx("button",{onClick:ee,className:"px-4 py-2 bg-indigo-600 hover:bg-indigo-500 text-white text-sm rounded-lg transition-colors",children:"Start Scanner"})]}):null,n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsxs("div",{className:"px-5 py-3 border-b border-gray-800 flex items-center justify-between",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Submission Queue"}),n.jsxs("span",{className:"text-xs text-gray-500",children:[H," total"]})]}),n.jsx("div",{className:"flex gap-1 px-4 pt-3 pb-2 overflow-x-auto",children:av.map(b=>n.jsx("button",{onClick:()=>{o(b.value),c(0)},className:`px-3 py-1.5 text-xs rounded-md transition-colors whitespace-nowrap ${r===b.value?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300 hover:bg-gray-800"}`,children:b.label},b.value))}),L?n.jsx("div",{className:"p-8 flex justify-center",children:n.jsx(lt,{})}):Ee.length===0?n.jsxs("div",{className:"p-8 text-center",children:[n.jsx("p",{className:"text-gray-500 text-sm",children:"No submissions found"}),n.jsx("p",{className:"text-gray-600 text-xs mt-1",children:r?"Try a different filter.":"Submissions will appear here once the scanner discovers repos."})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-gray-800",children:[n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Repo"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Author"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Stars"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Status"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Tier"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Security"}),n.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Discovered"}),n.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Actions"})]})}),n.jsx("tbody",{children:Ee.map(b=>n.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[n.jsx("td",{className:"px-4 py-2",children:b.repoUrl?n.jsx("a",{href:b.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-indigo-400 hover:text-indigo-300 font-mono",children:b.repoFullName}):n.jsx("span",{className:"text-xs text-gray-300 font-mono",children:b.repoFullName})}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-400",children:b.author}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-400 text-right font-mono",children:b.stars.toLocaleString()}),n.jsx("td",{className:"px-4 py-2",children:n.jsx(de,{label:nv(b.status),variant:lv(b.status)})}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-400",children:b.tier||"-"}),n.jsx("td",{className:`px-4 py-2 text-xs text-right font-mono ${sv(b.securityScore)}`,children:b.securityScore!=null?b.securityScore:"-"}),n.jsx("td",{className:"px-4 py-2 text-xs text-gray-500",children:J0(b.discoveredAt)}),n.jsx("td",{className:"px-4 py-2 text-right",children:je(b.status)&&n.jsxs("div",{className:"flex gap-1 justify-end",children:[n.jsx("button",{onClick:()=>Se(b.id),disabled:g===b.id,className:"px-2 py-1 bg-emerald-600/20 hover:bg-emerald-600/40 text-emerald-400 text-[10px] rounded transition-colors disabled:opacity-50",children:"Approve"}),n.jsx("button",{onClick:()=>Ge(b.id),disabled:g===b.id,className:"px-2 py-1 bg-rose-600/20 hover:bg-rose-600/40 text-rose-400 text-[10px] rounded transition-colors disabled:opacity-50",children:"Reject"})]})})]},b.id))})]})}),H>fa&&n.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-gray-800",children:[n.jsxs("span",{className:"text-xs text-gray-500",children:[u+1,"-",Math.min(u+fa,H)," of ",H]}),n.jsxs("div",{className:"flex gap-1",children:[n.jsx("button",{onClick:()=>c(Math.max(0,u-fa)),disabled:u===0,className:"px-2 py-1 text-xs text-gray-400 hover:text-gray-200 disabled:opacity-30 disabled:cursor-not-allowed",children:"Prev"}),n.jsxs("span",{className:"px-2 py-1 text-xs text-gray-500",children:["Page ",le," of ",pe]}),n.jsx("button",{onClick:()=>c(u+fa),disabled:u+fa>=H,className:"px-2 py-1 text-xs text-gray-400 hover:text-gray-200 disabled:opacity-30 disabled:cursor-not-allowed",children:"Next"})]})]})]})]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsxs("div",{className:"px-5 py-3 border-b border-gray-800 flex items-center justify-between gap-4",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 shrink-0",children:"Popular Skills"}),Q.length>0&&n.jsxs("div",{className:"relative max-w-xs w-full",children:[n.jsx("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),n.jsx("input",{type:"text",placeholder:"Discover popular skills...",value:p,onChange:b=>x(b.target.value),className:"w-full pl-8 pr-3 py-1.5 bg-gray-800/50 border border-gray-700 rounded-lg text-xs text-gray-200 placeholder-gray-500 focus:outline-none focus:border-gray-600 transition-colors"})]})]}),ce?n.jsx("div",{className:"p-8 flex justify-center",children:n.jsx(lt,{})}):Q.length===0?n.jsxs("div",{className:"p-8 text-center",children:[n.jsx("p",{className:"text-gray-500 text-sm",children:"No verified skills yet"}),n.jsx("p",{className:"text-gray-600 text-xs mt-1",children:"Skills will appear here after passing security verification."})]}):n.jsx(dv,{skills:Q,search:p})]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:n.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Insights"})}),X?n.jsx("div",{className:"p-8 flex justify-center",children:n.jsx(lt,{})}):V?n.jsxs("div",{className:"p-4 space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(se,{title:"Discovered",value:V.totalDiscovered,color:"cyan"}),n.jsx(se,{title:"Verified",value:V.totalVerified,color:"emerald"}),n.jsx(se,{title:"Rejected",value:V.totalRejected,color:"rose"}),n.jsx(se,{title:"Pending",value:V.totalPending,color:"amber"})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsx(F0,{label:"Tier 1 Pass Rate",rate:V.tier1PassRate}),n.jsx(F0,{label:"Tier 2 Pass Rate",rate:V.tier2PassRate})]})]}):n.jsx("div",{className:"p-8 text-center",children:n.jsx("p",{className:"text-gray-500 text-sm",children:"No insights data available"})})]})]})}function dv({skills:r,search:o}){const u=[...r].sort((m,g)=>W0(g)-W0(m)),c=new Set(u.slice(0,3).map(m=>m.id)),f=o?u.filter(m=>m.repoFullName.toLowerCase().includes(o.toLowerCase())||m.author.toLowerCase().includes(o.toLowerCase())):u;return f.length===0?n.jsx("div",{className:"p-8 text-center",children:n.jsxs("p",{className:"text-gray-500 text-sm",children:['No skills match "',o,'"']})}):n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 p-4",children:f.map(m=>n.jsx(fv,{skill:m,trending:c.has(m.id)},m.id))})}function fv({skill:r,trending:o}){const u=Am(r),c=iv(u),f=rv(u);return n.jsxs("div",{className:"bg-gray-800/50 border border-gray-700/50 rounded-lg p-4 hover:border-gray-600 transition-colors",children:[n.jsxs("div",{className:"flex items-start justify-between mb-2",children:[n.jsxs("div",{className:"min-w-0 flex-1",children:[r.repoUrl?n.jsx("a",{href:r.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium text-gray-200 hover:text-indigo-300 truncate block transition-colors",children:r.repoFullName.split("/").pop()}):n.jsx("div",{className:"text-sm font-medium text-gray-200 truncate",children:r.repoFullName.split("/").pop()}),n.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:r.author})]}),n.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 ml-2",children:[o&&n.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 bg-orange-500/15 text-orange-400 text-[10px] font-medium rounded",children:[n.jsx("svg",{className:"w-2.5 h-2.5",viewBox:"0 0 20 20",fill:"currentColor",children:n.jsx("path",{fillRule:"evenodd",d:"M12.395 2.553a1 1 0 00-1.45-.385c-.345.23-.614.558-.822.88-.214.33-.403.713-.57 1.116-.334.804-.614 1.768-.84 2.734a31.365 31.365 0 00-.613 3.58 2.64 2.64 0 01-.945-1.067c-.328-.68-.398-1.534-.398-2.654A1 1 0 005.05 6.05 6.981 6.981 0 003 11a7 7 0 1011.95-4.95c-.592-.591-.98-.985-1.348-1.467-.363-.476-.724-1.063-1.207-2.03zM12.12 15.12A3 3 0 017 13s.879.5 2.5.5c0-1 .5-4 1.25-4.5.5 1 .786 1.293 1.371 1.879A2.99 2.99 0 0113 13a2.99 2.99 0 01-.879 2.121z",clipRule:"evenodd"})}),"Hot"]}),n.jsx(de,{label:"Verified",variant:"success"})]})]}),n.jsxs("div",{className:"mb-3",children:[n.jsxs("div",{className:"flex items-center justify-between mb-1",children:[n.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider",children:"Trust"}),n.jsx("span",{className:`text-xs font-mono font-medium ${f}`,children:u})]}),n.jsx("div",{className:"w-full h-1.5 bg-gray-700 rounded-full overflow-hidden",children:n.jsx("div",{className:`h-full ${c} rounded-full transition-all duration-500`,style:{width:`${u}%`}})})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("span",{className:"text-xs text-gray-400 flex items-center gap-1",children:[n.jsx("svg",{className:"w-3.5 h-3.5 text-amber-400",fill:"currentColor",viewBox:"0 0 20 20",children:n.jsx("path",{d:"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"})}),cv(r.stars)]}),r.repoUrl&&n.jsx("a",{href:r.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-gray-500 hover:text-gray-300 transition-colors",children:"View on GitHub"})]})]})}function F0({label:r,rate:o}){const u=Math.round(o),c=u>=70?"bg-emerald-500":u>=40?"bg-amber-500":"bg-rose-500";return n.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-4",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("span",{className:"text-xs text-gray-400",children:r}),n.jsxs("span",{className:"text-sm font-bold text-gray-200",children:[u,"%"]})]}),n.jsx("div",{className:"w-full h-2 bg-gray-700 rounded-full overflow-hidden",children:n.jsx("div",{className:`h-full ${c} rounded-full transition-all duration-500`,style:{width:`${u}%`}})})]})}function mv(){const{id:r}=Vg(),[o,u]=N.useState(0);ke("increment-update",()=>u(x=>x+1));const{data:c,loading:f,error:m,refetch:g}=_e(`/api/increments/${r||"_none"}?_r=${o}`);if(!r)return n.jsx("div",{className:"p-6 text-gray-500 text-sm",children:"No increment ID specified"});if(f)return n.jsx(lt,{});if(m)return n.jsx(Zt,{message:m,onRetry:g});if(!c)return n.jsx("div",{className:"p-6 text-gray-500 text-sm",children:"Increment not found"});const j=c.taskSummary.total>0?Math.round(c.taskSummary.completed/c.taskSummary.total*100):0,p=c.acSummary.total>0?Math.round(c.acSummary.completed/c.acSummary.total*100):0;return n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[n.jsx("span",{className:"text-xs text-indigo-400 font-mono",children:c.dirName}),n.jsx(de,{label:c.metadata.status||"unknown",variant:wi(c.metadata.status||"")}),c.metadata.type&&n.jsx("span",{className:"text-xs text-gray-400 capitalize",children:c.metadata.type}),c.metadata.priority&&n.jsx(xv,{priority:c.metadata.priority})]}),n.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:c.metadata.title||c.id}),c.metadata.project&&n.jsxs("span",{className:"text-xs text-gray-500",children:["Project: ",c.metadata.project]})]}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[n.jsx(se,{title:"Tasks",value:`${c.taskSummary.completed}/${c.taskSummary.total}`,color:"indigo"}),n.jsx(se,{title:"Task Progress",value:`${j}%`,color:"cyan"}),n.jsx(se,{title:"ACs",value:`${c.acSummary.completed}/${c.acSummary.total}`,color:"emerald"}),n.jsx(se,{title:"AC Progress",value:`${p}%`,color:"amber"})]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5 space-y-4",children:[n.jsx(P0,{label:"Tasks",completed:c.taskSummary.completed,total:c.taskSummary.total,color:"indigo"}),n.jsx(P0,{label:"Acceptance Criteria",completed:c.acSummary.completed,total:c.acSummary.total,color:"emerald"})]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:n.jsxs("h3",{className:"text-sm font-medium text-gray-300",children:["Tasks (",c.tasks.length,")"]})}),c.tasks.length===0?n.jsx("div",{className:"p-5 text-center text-gray-500 text-xs",children:"No tasks found in tasks.md"}):n.jsx("div",{className:"divide-y divide-gray-800/50",children:c.tasks.map(x=>n.jsxs("div",{className:"px-5 py-3 flex items-center gap-3",children:[n.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center flex-shrink-0 ${x.status==="completed"?"bg-indigo-500/20 border-indigo-500 text-indigo-400":"border-gray-600"}`,children:x.status==="completed"&&n.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-xs text-gray-500 font-mono",children:x.id}),n.jsx("span",{className:`text-sm ${x.status==="completed"?"text-gray-500 line-through":"text-gray-300"}`,children:x.title})]}),(x.userStory||x.acs)&&n.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[x.userStory&&n.jsx("span",{className:"text-[10px] text-indigo-400",children:x.userStory}),x.acs?.map(v=>n.jsx("span",{className:"text-[10px] text-emerald-500",children:v},v))]})]})]},x.id))})]}),c.acs.length>0&&n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[n.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:n.jsxs("h3",{className:"text-sm font-medium text-gray-300",children:["Acceptance Criteria (",c.acs.length,")"]})}),n.jsx("div",{className:"divide-y divide-gray-800/50",children:c.acs.map(x=>n.jsxs("div",{className:"px-5 py-3 flex items-start gap-3",children:[n.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center flex-shrink-0 mt-0.5 ${x.completed?"bg-emerald-500/20 border-emerald-500 text-emerald-400":"border-gray-600"}`,children:x.completed&&n.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),n.jsxs("div",{children:[n.jsx("span",{className:"text-xs text-emerald-500 font-mono",children:x.id}),n.jsx("span",{className:`text-sm ml-2 ${x.completed?"text-gray-500 line-through":"text-gray-300"}`,children:x.text})]})]},x.id))})]}),n.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-3",children:"Metadata"}),n.jsx("div",{className:"space-y-1.5",children:Object.entries(c.metadata).filter(([x])=>!["title"].includes(x)).map(([x,v])=>n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-xs text-gray-500 font-mono",children:x}),n.jsx("span",{className:"text-xs text-gray-400",children:typeof v=="object"?JSON.stringify(v):String(v??"")})]},x))})]})]})}function P0({label:r,completed:o,total:u,color:c}){const f=u>0?Math.round(o/u*100):0,m=c==="emerald"?"bg-emerald-500":"bg-indigo-500";return n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[n.jsx("span",{className:"text-xs text-gray-400",children:r}),n.jsxs("span",{className:"text-xs text-gray-500",children:[o,"/",u," (",f,"%)"]})]}),n.jsx("div",{className:"w-full h-2 bg-gray-800 rounded-full overflow-hidden",children:n.jsx("div",{className:`h-full ${m} rounded-full transition-all`,style:{width:`${f}%`}})})]})}function xv({priority:r}){const o={P0:"text-rose-400 bg-rose-500/10",P1:"text-amber-400 bg-amber-500/10",P2:"text-cyan-400 bg-cyan-500/10",P3:"text-gray-400 bg-gray-500/10"};return n.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${o[r]||o.P2}`,children:r})}function hv(){const r=qy(),o=Qt();return n.jsx(pm.Provider,{value:r,children:n.jsx($y,{children:n.jsxs("div",{className:"flex min-h-screen bg-gray-950 text-gray-100",children:[n.jsx(Xy,{}),n.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[n.jsx(Qy,{}),n.jsx("main",{className:"flex-1 overflow-y-auto",children:n.jsx(Ky,{resetKey:o.pathname,children:n.jsxs(sy,{children:[n.jsx(st,{path:"/",element:n.jsx(np,{})}),n.jsx(st,{path:"/increments",element:n.jsx(up,{})}),n.jsx(st,{path:"/increments/:id",element:n.jsx(mv,{})}),n.jsx(st,{path:"/analytics",element:n.jsx(fp,{})}),n.jsx(st,{path:"/costs",element:n.jsx(pp,{})}),n.jsx(st,{path:"/sync",element:n.jsx(Cp,{})}),n.jsx(st,{path:"/errors",element:n.jsx(Mp,{})}),n.jsx(st,{path:"/activity",element:n.jsx(Bp,{})}),n.jsx(st,{path:"/config",element:n.jsx($p,{})}),n.jsx(st,{path:"/plugins",element:n.jsx(Vp,{})}),n.jsx(st,{path:"/services",element:n.jsx(Qp,{})}),n.jsx(st,{path:"/notifications",element:n.jsx(Kp,{})}),n.jsx(st,{path:"/repos",element:n.jsx(Fp,{})}),n.jsx(st,{path:"/marketplace",element:n.jsx(ov,{})}),n.jsx(st,{path:"*",element:n.jsxs("div",{className:"p-6 text-center",children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-200 mb-2",children:"Page Not Found"}),n.jsx("p",{className:"text-sm text-gray-500",children:"The page you're looking for doesn't exist."})]})})]})})})]})]})})})}rg.createRoot(document.getElementById("root")).render(n.jsx(N.StrictMode,{children:n.jsx(My,{children:n.jsx(hv,{})})}));
|